instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I'm very impressed with my initial tests with db4o. However, i'm wondering just how many enterprise class websites are out there powered by db4o, i couldn't see any on the main website?
I can't see any reason why db4o should not be used. There appears to be decent enough support for transactions and ways to handle con... | While db4o (database for objects) was a popular object-oriented database for Java and .NET applications, it did not gain widespread adoption compared to other database systems like MySQL, PostgreSQL, or NoSQL options like MongoDB. As a result, there are not many high-profile enterprise-class websites or applications th... | 15,271 | [
{
"from": "human",
"value": "I'm very impressed with my initial tests with db4o. However, i'm wondering just how many enterprise class websites are out there powered by db4o, i couldn't see any on the main website? \nI can't see any reason why db4o should not be used. There appears to be decent enough suppo... |
Name the design considerations in deciding between use of a singleton versus a static class. In doing this, you're kind of forced to contrast the two, so whatever contrasts you can come up with are also useful in showing your thought process! Also, every interviewer likes to see illustrative examples. :)
| When deciding between using a Singleton or a Static Class in design, several considerations and contrasts need to be taken into account. Both patterns serve different purposes and are suitable for different scenarios. Below are key design considerations, alongside an illustrative example for each.
### 1. **Instance Ma... | 7,733 | [
{
"from": "human",
"value": "Name the design considerations in deciding between use of a singleton versus a static class. In doing this, you're kind of forced to contrast the two, so whatever contrasts you can come up with are also useful in showing your thought process! Also, every interviewer likes to see... |
I'm in the middle of writing code in .Net to draw something in my app and I need to pick a color to use. But what does the color "Chartreuse" look like? Isn't there a nice bitmap that shows what each of the system colors look like somewhere?
Thanks!
| Chartreuse is a vibrant color that is halfway between green and yellow. In RGB values, it is represented as (127, 255, 0), which means it has a medium amount of red, a full amount of green, and no blue. The result is a bright, eye-catching color.
For visual reference, there are several resources where you can find col... | 13,244 | [
{
"from": "human",
"value": "I'm in the middle of writing code in .Net to draw something in my app and I need to pick a color to use. But what does the color \"Chartreuse\" look like? Isn't there a nice bitmap that shows what each of the system colors look like somewhere?\nThanks!\n"
},
{
"from": "g... |
Some of us would invariably have to support 'legacy' code using Microsoft's Visual Studio 6.0 IDEs which - although opinions would differ - are generally regarded to be less user friendly compared to the later incarnations of the Visual Studio series of IDEs.
So I'd like to hear about some of your best hidden/poorly do... | One of the hidden gems in Visual Studio 6.0, particularly for C++ development, is the **"Class Wizard"**. While it may not be completely undocumented, many users don't fully leverage its capabilities.
### Class Wizard:
The Class Wizard in Visual Studio 6.0 allows you to manage your classes and their associated messag... | 13,209 | [
{
"from": "human",
"value": "Some of us would invariably have to support 'legacy' code using Microsoft's Visual Studio 6.0 IDEs which - although opinions would differ - are generally regarded to be less user friendly compared to the later incarnations of the Visual Studio series of IDEs.\nSo I'd like to hea... |
is there an alternative for mysql_insert_id() php function for PostgreSQL? Most of the frameworks are solving the problem partially by finding the current value of the sequence used in the ID. However, there are times that the primary key is not a serial column....
| In PostgreSQL, the equivalent to `mysql_insert_id()` for retrieving the last inserted ID after performing an insert is to use the `RETURNING` clause in your SQL statement. This allows you to directly return the values of the columns you need, including the primary key, right after the insert operation.
Here's an examp... | 13,512 | [
{
"from": "human",
"value": "is there an alternative for mysql_insert_id() php function for PostgreSQL? Most of the frameworks are solving the problem partially by finding the current value of the sequence used in the ID. However, there are times that the primary key is not a serial column....\n"
},
{
... |
Requirements:
free, preferably open-source
implemented in one of the .NET managed langs
Google found these:
A Generic, Reusable Diff
Algorithm on codeproject
An O(ND) Difference Algorithm for C#
Diff/Merge/Patch Library for C#/.NET by Joshua Tauberer
EDIT:
No apps please, only libraries.
| Based on your requirements for a free, preferably open-source diff library implemented in one of the .NET managed languages, here are some suggestions:
1. **DiffPlex**
- **GitHub:** [DiffPlex](https://github.com/mmanwaring/DiffPlex)
- **Description:** DiffPlex is a .NET library that provides functionality for co... | 11,718 | [
{
"from": "human",
"value": "Requirements:\n\nfree, preferably open-source\nimplemented in one of the .NET managed langs\n\nGoogle found these:\n\nA Generic, Reusable Diff\nAlgorithm on codeproject\nAn O(ND) Difference Algorithm for C#\nDiff/Merge/Patch Library for C#/.NET by Joshua Tauberer\n\nEDIT:\nNo ap... |
An example of unspecified behavior in the C language is the order of evaluation of arguments to a function. It might be left to right or right to left, you just don't know. This would affect how foo(c++, c) or foo(++c, c) gets evaluated.
What other unspecified behavior is there that can surprise the unaware programmer... | In the C language, unspecified behavior occurs in situations where the standard allows multiple valid implementations to choose between options, but it does not define which option to use. This can lead to surprises for programmers who might assume a certain behavior. Here are several examples of unspecified behavior t... | 10,860 | [
{
"from": "human",
"value": "An example of unspecified behavior in the C language is the order of evaluation of arguments to a function. It might be left to right or right to left, you just don't know. This would affect how foo(c++, c) or foo(++c, c) gets evaluated.\nWhat other unspecified behavior is ther... |
My program generates relatively simple PDF documents on request, but I'm having trouble with unicode characters, like kanji or odd math symbols. To write a normal string in PDF, you place it in brackets:
(something)
There is also the option to escape a character with octal codes:
(\527)
but this only goes up to 512 c... | It sounds like you've found a solution to your problem with Unicode characters in PDFs by switching to the iText library, which offers better support for Unicode and works with a `Graphics2D` API that you're familiar with.
For others who might encounter similar issues with encoding Unicode characters in PDF documents... | 11,352 | [
{
"from": "human",
"value": "My program generates relatively simple PDF documents on request, but I'm having trouble with unicode characters, like kanji or odd math symbols. To write a normal string in PDF, you place it in brackets:\n(something)\n\nThere is also the option to escape a character with octal c... |
I want to load one or more DLLs dynamically so that they run with a different security or basepath than my main application. How do I load these DLLs into a separate AppDomain and instantiate objects from them?
| To load one or more DLLs dynamically in .NET and execute them in a separate `AppDomain`, you can follow these steps:
1. **Create a new AppDomain**: This will allow you to load the DLLs with a different security context or base path.
2. **Load the assembly into the new AppDomain**: You can use the `AppDomain.Load` met... | 7,708 | [
{
"from": "human",
"value": "I want to load one or more DLLs dynamically so that they run with a different security or basepath than my main application. How do I load these DLLs into a separate AppDomain and instantiate objects from them?\n"
},
{
"from": "gpt",
"value": "To load one or more DL... |
This question is related to this one, though I think I was a little too long-winded there to really get a good answer. I'll keep this brief.
I'm working on a web handler (ashx) that accepts a form post from an aspx page. When the handler receives this form post, in order to do what it needs to do, it needs to know the ... | To retrieve the logged-in user's identity from the session ID in an ASHX handler after a form post, you can follow these steps:
1. **Get the SessionID**: When your ASPX page posts the form data to the ASHX handler, make sure to include the `Session.SessionID` as a hidden field.
2. **Retrieve Session Data in the Handl... | 10,094 | [
{
"from": "human",
"value": "This question is related to this one, though I think I was a little too long-winded there to really get a good answer. I'll keep this brief.\nI'm working on a web handler (ashx) that accepts a form post from an aspx page. When the handler receives this form post, in order to do ... |
As a pet-project, I'd like to attempt to implement a basic language of my own design that can be used as a web-scripting language. It's trivial to run a C++ program as an Apache CGI, so the real work lies in how to parse an input file containing non-code (HTML/CSS markup) and server-side code.
In my undergrad compiler ... | Your idea for parsing a mixed input of HTML and a server-side scripting language is fundamentally sound, and it aligns with how many languages that interleave markup and scripting (like PHP, ASP, etc.) function. Here’s an outline of your approach, along with some suggestions and considerations for improving your design... | 8,541 | [
{
"from": "human",
"value": "As a pet-project, I'd like to attempt to implement a basic language of my own design that can be used as a web-scripting language. It's trivial to run a C++ program as an Apache CGI, so the real work lies in how to parse an input file containing non-code (HTML/CSS markup) and se... |
A couple of months ago I've coded a tiny tool that we needed at work for a specific task, and I've decided to share it on CodePlex. It's written in C# and honestly it's not big deal but since it's the first project I've ever built from scratch in that language and with the goal of opening it from the very beginning, on... | It's great to hear that you've taken the initiative to share your project on CodePlex! Encouraging participation and feedback can be challenging, but there are several strategies you can use to engage potential users and contributors:
1. **Create Comprehensive Documentation**: Make sure your project has clear and thor... | 10,243 | [
{
"from": "human",
"value": "A couple of months ago I've coded a tiny tool that we needed at work for a specific task, and I've decided to share it on CodePlex. It's written in C# and honestly it's not big deal but since it's the first project I've ever built from scratch in that language and with the goal ... |
what is the best method for inter process communication in a multithreaded java app.
It should be performant (so no JMS please) easy to implement and reliable,so that
objects & data can be bound to one thread only?
Any ideas welcome!
| In a multithreaded Java application, effective inter-process communication (IPC) can be achieved through various methods depending on your specific requirements, including performance, reliability, and ease of implementation. Below are some of the best methods suited for your criteria:
### 1. **Synchronized Blocks and... | 11,170 | [
{
"from": "human",
"value": "what is the best method for inter process communication in a multithreaded java app.\nIt should be performant (so no JMS please) easy to implement and reliable,so that\nobjects & data can be bound to one thread only?\nAny ideas welcome!\n"
},
{
"from": "gpt",
"value"... |
One of the best tips for using vim that I have learned so far has been that one can press Ctrl+C or Ctrl+[ instead of the Esc key. However I use a dvorak keyboard so Ctrl+[ is a little out of reach for me as well so I mostly use Ctrl+C. Now I've read somewhere that these two key combinations don't actually have exactly... | In Vim, both `Ctrl+C` and `Ctrl+[` can be used to exit from insert mode (and other modes) back to normal mode, but they behave slightly differently under certain circumstances.
### Differences between `Ctrl+C` and `Ctrl+[`:
1. **Intended Use**:
- `Ctrl+[`: This is intended to act as the escape key and is the more ... | 12,336 | [
{
"from": "human",
"value": "One of the best tips for using vim that I have learned so far has been that one can press Ctrl+C or Ctrl+[ instead of the Esc key. However I use a dvorak keyboard so Ctrl+[ is a little out of reach for me as well so I mostly use Ctrl+C. Now I've read somewhere that these two key... |
What java GUI layout manager does everyone use? Lately, I have been using MigLayout, which has some powerful component controls. Just wanted to see what other developers are using other than the standard JDK ones.
| MigLayout is indeed a popular choice among developers for creating complex layouts in Java GUI applications due to its flexibility and ease of use. However, there are several other layout managers and libraries that developers commonly use. Here are a few:
1. **GridBagLayout**: Although it's part of the standard JDK, ... | 13,968 | [
{
"from": "human",
"value": "What java GUI layout manager does everyone use? Lately, I have been using MigLayout, which has some powerful component controls. Just wanted to see what other developers are using other than the standard JDK ones.\n"
},
{
"from": "gpt",
"value": "MigLayout is indee... |
What I'm looking for is a simple timer queue possibly with an external timing source and a poll method (in this way it will be multi-platform). Each enqueued message could be an object implementing a simple interface with a virtual onTimer() member function.
| Certainly! You can implement a simple timer queue in C++ that meets your requirements. Below is a conceptual implementation that includes a timer queue which allows you to enqueue messages (objects implementing a virtual `onTimer()` function). The design allows you to use an external timing source and provides a poll m... | 9,902 | [
{
"from": "human",
"value": "What I'm looking for is a simple timer queue possibly with an external timing source and a poll method (in this way it will be multi-platform). Each enqueued message could be an object implementing a simple interface with a virtual onTimer() member function.\n"
},
{
"fro... |
I need to parse a string like "February 12, 1981" as a Date. I use SimpleDateFormat. But if I do:
new SimpleDateFormat("MMMMM dd, yyyy").parse("February 12, 1981")
I get java.text.ParseException.
I tried to reduce it to see where the problem is. First:
new SimpleDateFormat("MMMMM").parse("February")
works. Then:
new ... | The issue you are encountering with `SimpleDateFormat` is due to the use of `"MMMMM"` in your format string. The `M` in the pattern represents the month, and the correct format for the full month name is `"MMMM"` (with four `M`s).
Here’s how you can correctly parse the string `"February 12, 1981"`:
```java
import ja... | 14,193 | [
{
"from": "human",
"value": "I need to parse a string like \"February 12, 1981\" as a Date. I use SimpleDateFormat. But if I do:\nnew SimpleDateFormat(\"MMMMM dd, yyyy\").parse(\"February 12, 1981\")\n\nI get java.text.ParseException.\nI tried to reduce it to see where the problem is. First:\nnew SimpleDate... |
I have a basic understanding of mock and fake objects, but I'm not sure I have a feeling about when/where to use mocking - especially as it would apply to this scenario here.
| Understanding when and where to use mocks and fakes in your testing strategy is key to writing effective unit tests. Both mocks and fakes are types of test doubles used to isolate the unit of work being tested, but they serve different purposes. Here’s a brief overview to help clarify:
### Mocks vs. Fakes
- **Mocks**... | 5,307 | [
{
"from": "human",
"value": "I have a basic understanding of mock and fake objects, but I'm not sure I have a feeling about when/where to use mocking - especially as it would apply to this scenario here.\n"
},
{
"from": "gpt",
"value": "Understanding when and where to use mocks and fakes in your... |
What is the best python framework to create distributed applications? For example to build a P2P app.
| When it comes to building distributed applications, particularly for peer-to-peer (P2P) systems, there are several Python frameworks and libraries that can help. Here are some of the most popular and effective options:
1. **Tornado**:
- Tornado is a scalable, non-blocking web server and web application framework. I... | 11,284 | [
{
"from": "human",
"value": "What is the best python framework to create distributed applications? For example to build a P2P app.\n"
},
{
"from": "gpt",
"value": "When it comes to building distributed applications, particularly for peer-to-peer (P2P) systems, there are several Python frameworks... |
Suppose I have a vector that is nested in a dataframe with one or two levels. Is there a quick and dirty way to access the last value, without using the length() function? Something ala PERL's $# special var?
So I would like something like:
dat$vec1$vec2[$#]
instead of:
dat$vec1$vec2[length(dat$vec1$vec2)]
| In R, while there isn't a direct equivalent to Perl's `$#` to access the last element of a vector, you can use negative indexing or the `tail()` function to achieve a similar outcome without explicitly using the `length()` function. Here are a couple of approaches:
1. **Using negative indexing**:
You can use `-1` t... | 14,976 | [
{
"from": "human",
"value": "Suppose I have a vector that is nested in a dataframe with one or two levels. Is there a quick and dirty way to access the last value, without using the length() function? Something ala PERL's $# special var?\nSo I would like something like:\ndat$vec1$vec2[$#]\n\ninstead of:\n... |
I know websphere does it, so there must be something that lets apache figure out what needs to go to the app server and what it can handle itself.
| Yes, you can configure Apache HTTP Server to determine which requests it can handle itself and which ones should be forwarded to an application server, such as WebSphere, using various methods and modules. The most common way to achieve this is through the use of reverse proxying and URL routing.
Here are a few approa... | 11,524 | [
{
"from": "human",
"value": "I know websphere does it, so there must be something that lets apache figure out what needs to go to the app server and what it can handle itself.\n"
},
{
"from": "gpt",
"value": "Yes, you can configure Apache HTTP Server to determine which requests it can handle its... |
How do I go about programmatically creating audio streams using Cocoa on the Mac. To make, say a white-noise generator using core frameworks on Mac OSX in Cocoa apps?
| Creating an audio stream programmatically in a macOS application using Cocoa can be achieved with the Core Audio framework. For generating white noise, you'll typically use the `AVAudioEngine` and `AVAudioPlayerNode` classes from the AVFoundation framework, which simplifies working with audio. Below is a basic outline ... | 6,112 | [
{
"from": "human",
"value": "How do I go about programmatically creating audio streams using Cocoa on the Mac. To make, say a white-noise generator using core frameworks on Mac OSX in Cocoa apps?\n"
},
{
"from": "gpt",
"value": "Creating an audio stream programmatically in a macOS application us... |
I'm building an application in C# using WPF. How can I bind to some keys?
Also, how can I bind to the Windows key?
| In a WPF application, you can handle key bindings using the `KeyBinding` class. To bind specific keys to commands, you can define them in the `InputBindings` collection of a window or a control.
### Basic Key Binding Example
Here’s how you can bind to keys, for example, the F1 key and the Ctrl + S combination:
1. **... | 7,654 | [
{
"from": "human",
"value": "I'm building an application in C# using WPF. How can I bind to some keys?\nAlso, how can I bind to the Windows key?\n"
},
{
"from": "gpt",
"value": "In a WPF application, you can handle key bindings using the `KeyBinding` class. To bind specific keys to commands, you... |
The problem itself is simple, but I can't figure out a solution that does it in one query, and here's my "abstraction" of the problem to allow for a simpler explanation:
I will let my original explenation stand, but here's a set of sample data and the result i expect:
Ok, so here's some sample data, i separated pairs b... | You can achieve your desired result by using a Common Table Expression (CTE) or a subquery, along with a conditional aggregation technique. The query will involve grouping the results by `ID` and then checking for the existence of `NAME` values "John" and "Bruce".
Here's an SQL query that fits your criteria:
```sql
... | 13,155 | [
{
"from": "human",
"value": "The problem itself is simple, but I can't figure out a solution that does it in one query, and here's my \"abstraction\" of the problem to allow for a simpler explanation:\nI will let my original explenation stand, but here's a set of sample data and the result i expect:\nOk, so... |
One of the biggest issues currently holding me back from diving full steam into unit testing is that a really large percentage of the code I write is heavily dependent on third-party COM objects from different sources that also tend to interact with each other (I'm writing add-ins for Microsoft Office using several hel... | Unit testing in environments heavily reliant on COM objects can be quite challenging, especially when those objects are responsible for a lot of the application's behavior. Here are some best practices and strategies that you can use to facilitate unit testing in such scenarios, particularly for Delphi but applicable g... | 8,509 | [
{
"from": "human",
"value": "One of the biggest issues currently holding me back from diving full steam into unit testing is that a really large percentage of the code I write is heavily dependent on third-party COM objects from different sources that also tend to interact with each other (I'm writing add-i... |
How come this doesn't work (operating on an empty select list <select id="requestTypes"></select>
$(function() {
$.getJSON("/RequestX/GetRequestTypes/", showRequestTypes);
}
);
function showRequestTypes(data, textStatus) {
$.each(data,
function() {
var optio... | The reason the first version of your code (using jQuery) does not work while the second version (using plain JavaScript) does can be traced back to the way you're using jQuery to add options to a `<select>` element. The issue lies in the way the `add()` method is used with jQuery objects versus DOM elements.
### Expla... | 13,366 | [
{
"from": "human",
"value": "How come this doesn't work (operating on an empty select list <select id=\"requestTypes\"></select>\n$(function() {\n\n $.getJSON(\"/RequestX/GetRequestTypes/\", showRequestTypes);\n\n }\n );\n\n\n function showRequestTypes(data, textStatus) {\n\n $.each(d... |
What I want to do is have a Windows application launch another Direct3D application and have the Direct3D application render into a control provided by the parent process.
Is this even possible? If it is, how would it be done?
| Yes, it is possible to have a Windows application launch another Direct3D application and render its output into a control provided by the parent process. However, this involves advanced techniques, as rendering typically occurs in a separate window or context. Below are the steps and concepts involved in achieving thi... | 7,980 | [
{
"from": "human",
"value": "What I want to do is have a Windows application launch another Direct3D application and have the Direct3D application render into a control provided by the parent process. \nIs this even possible? If it is, how would it be done?\n"
},
{
"from": "gpt",
"value": "Yes... |
Over the years I have created and tweaked a set of NAnt scripts to perform complete project builds. The main script takes a single application end point (a web application project for example) and does a complete, from source control, build of it. The scripts are preconfigured with the necessary information regarding... | The challenge you're facing is common in organizations that develop a diverse range of applications, particularly when it comes to standardizing the build process for projects that may not have a long-term support roadmap. Here are some strategies that could help you improve the build management for arbitrary projects ... | 6,603 | [
{
"from": "human",
"value": "Over the years I have created and tweaked a set of NAnt scripts to perform complete project builds. The main script takes a single application end point (a web application project for example) and does a complete, from source control, build of it. The scripts are preconfigured... |
I have a very serious problem with Visual Studio 2008.
Occasionally when I right-click (for go to definition, set next statement etc) when I'm debugging, Visual Studio will just dead-lock and go into not responding mode.
Has anyone had the same problem? Does anyone know how to solve it?
Edit: I'm using SP1 with a coup... | Experiencing a deadlock or "not responding" state in Visual Studio 2008 during debugging can be frustrating. Here are some steps you can take to troubleshoot and potentially resolve this issue:
### 1. **Update Visual Studio**
- Ensure that you are using the latest service packs and hotfixes. You mentioned using SP1; h... | 11,067 | [
{
"from": "human",
"value": "I have a very serious problem with Visual Studio 2008.\nOccasionally when I right-click (for go to definition, set next statement etc) when I'm debugging, Visual Studio will just dead-lock and go into not responding mode.\nHas anyone had the same problem? Does anyone know how to... |
I'm a bit of a DI newbie, so forgive me if this is the wrong approach or a silly question.
Let's say I have a form which creates/updates an order, and I know it's going to need to retrieve a list of products and customers to display. I want to pass in the Order object that it's editing, but I also want to inject the Pr... | The question you're asking is a common consideration when dealing with dependency injection (DI) and constructor parameters. While there isn't a definitive right or wrong approach, there are some best practices and conventions you can follow to make your code more readable and maintainable.
### Common Practices
1. **... | 12,696 | [
{
"from": "human",
"value": "I'm a bit of a DI newbie, so forgive me if this is the wrong approach or a silly question.\nLet's say I have a form which creates/updates an order, and I know it's going to need to retrieve a list of products and customers to display. I want to pass in the Order object that it's... |
I have a JSF woodstock table with checkboxes. When a row is selected I want to do some processing with those items. I managed to get a selection of RowKey objects but can't find out how to get the original objects I put in back. The table is populated by an ObjectListDataProvider.
| In JSF with Woodstock components, when you are dealing with a table populated by an `ObjectListDataProvider` and you want to process selected items (i.e., the original objects) based on selected row keys, you can achieve this by utilizing the `ObjectListDataProvider`'s features along with your own backing bean.
Here's... | 9,896 | [
{
"from": "human",
"value": "I have a JSF woodstock table with checkboxes. When a row is selected I want to do some processing with those items. I managed to get a selection of RowKey objects but can't find out how to get the original objects I put in back. The table is populated by an ObjectListDataProvide... |
I've been wondering, as a lone game developer,
or to say a part of team which has only got programmers and people who like to play games...
How do I manage the void created by lack of artists (sprites/tiles/animations) in such a situation???
What do you do in that case? and suppose I am a student, with no money to hir... | As a lone game developer or part of a small team lacking artists, there are several strategies you can employ to manage the absence of visual assets like sprites, tiles, and animations:
### 1. **Learn Basic Art Skills:**
- **Start Simple:** Invest time in learning basic art skills. You can find numerous tutorials o... | 8,358 | [
{
"from": "human",
"value": "I've been wondering, as a lone game developer, \nor to say a part of team which has only got programmers and people who like to play games...\nHow do I manage the void created by lack of artists (sprites/tiles/animations) in such a situation???\nWhat do you do in that case? and ... |
I want to verify a drag & drop operation is allowed. A valid item can come from another one of our "controls", or internally from within the custom treeview. Currently I have this:
bool CanDrop(DragEventArgs e)
{
bool allow = false;
Point point = tree.PointToClient(new Point(e.X, e.Y));
TreeNode target = tr... | When it comes to validating drag-and-drop operations in a TreeView control (or any other UI control), it's important to structure your code for readability, maintainability, and reusability. Your current method has a lot of nested logic, which can make it difficult to follow. Here are a few suggestions to improve your ... | 10,344 | [
{
"from": "human",
"value": "I want to verify a drag & drop operation is allowed. A valid item can come from another one of our \"controls\", or internally from within the custom treeview. Currently I have this:\nbool CanDrop(DragEventArgs e)\n{\n bool allow = false;\n Point point = tree.PointToClient... |
Is it possible to prevent an asp.net Hyperlink control from linking, i.e. so that it appears as a label, without actually having to replace the control with a label? Maybe using CSS or setting an attribute?
I know that marking it as disabled works but then it gets displayed differently (greyed out).
To clarify my point... | If you want to keep using the ASP.NET `HyperLink` control but prevent it from linking to a URL conditionally (for instance, when a user is disabled), one approach you can take is to use CSS and JavaScript (or jQuery) to achieve this without needing to replace the control with a label.
### Method 1: Use CSS and JavaScr... | 10,606 | [
{
"from": "human",
"value": "Is it possible to prevent an asp.net Hyperlink control from linking, i.e. so that it appears as a label, without actually having to replace the control with a label? Maybe using CSS or setting an attribute?\nI know that marking it as disabled works but then it gets displayed dif... |
I have a list with two <div>s in every <li> and I want to float them one next to the other and I want the <li> to take the whole availabe space. How do I do it?
<html>
<head>
<title></title>
<style type="text/css">
body {
}
ul {
}
li {
... | To achieve the desired layout where the two `<div>` elements are floated next to each other within the `<li>`, and the `<li>` takes up the entire available width, you can use CSS properties like `display: flex;` or `float`. Here's how you can do it using both methods:
### Method 1: Using Flexbox
This is the more moder... | 10,694 | [
{
"from": "human",
"value": "I have a list with two <div>s in every <li> and I want to float them one next to the other and I want the <li> to take the whole availabe space. How do I do it?\n<html>\n <head>\n <title></title>\n <style type=\"text/css\">\n body {\n }\n ... |
I'm developing a web app on Yaws 1.65 (installed through apt) running on Debian etch on a VPS with UML. Whenever I do /etc/init.d/yaws restart or a stop/start, it initializes according to an old version of the config file (/etc/yaws/yaws.conf).
I know this because I changed the docroot from the default to another dire... | It sounds like you're facing a strange caching or configuration issue with Yaws that is causing it to revert to an old configuration when restarted, rather than picking up the most recent changes you made. Here are several potential causes and steps to troubleshoot the issue further:
1. **Multiple Config Files**: Doub... | 10,000 | [
{
"from": "human",
"value": "I'm developing a web app on Yaws 1.65 (installed through apt) running on Debian etch on a VPS with UML. Whenever I do /etc/init.d/yaws restart or a stop/start, it initializes according to an old version of the config file (/etc/yaws/yaws.conf).\nI know this because I changed th... |
I like putting shortcuts of the form "g - google.lnk" in my start menu so google is two keystrokes away. Win, g.
My eight or so most frequent applications go there.
I also make links to my solution files I am always opening "x - Popular Project.lnk"
Are there any better ways to automate opening frequently used applicat... | Certainly! There are various ways to streamline the process of opening frequently used applications and files beyond just using shortcuts in the Start menu. Here are some suggestions:
1. **Keyboard Shortcuts**: In addition to your existing shortcuts, you can create custom keyboard shortcuts for your applications. Righ... | 11,927 | [
{
"from": "human",
"value": "I like putting shortcuts of the form \"g - google.lnk\" in my start menu so google is two keystrokes away. Win, g.\nMy eight or so most frequent applications go there.\nI also make links to my solution files I am always opening \"x - Popular Project.lnk\"\nAre there any better w... |
I come from a Java background, where packages are used, not namespaces. I'm used to putting classes that work together to form a complete object into packages, and then reusing them later from that package. But now I'm working in C++.
How do you use namespaces in C++? Do you create a single namespace for the entire app... | In C++, namespaces serve a similar purpose to packages in Java: they help organize code, avoid name collisions, and make the codebase easier to manage. However, namespaces are not as rigidly structured as Java packages, and you can use them flexibly based on the needs of your project.
### Creating Namespaces
You can ... | 7,133 | [
{
"from": "human",
"value": "I come from a Java background, where packages are used, not namespaces. I'm used to putting classes that work together to form a complete object into packages, and then reusing them later from that package. But now I'm working in C++.\nHow do you use namespaces in C++? Do you cr... |
Given the code bellow, how do I style the radio buttons to be next to the labels and style the label of the selected radio button differently than the other labels?
<link href="http://yui.yahooapis.com/2.5.2/build/reset-fonts-grids/reset-fonts-grids.css" rel="stylesheet">
<link href="http://yui.yahooapis.com/2.5.2/b... | Certainly! You can achieve the desired layout and styling of the radio buttons and labels using CSS, along with some simple JavaScript to change the appearance of the selected label. Here's how you can do it:
### CSS
You can use the following CSS to position the radio buttons next to their labels, and to style the sel... | 5,646 | [
{
"from": "human",
"value": "Given the code bellow, how do I style the radio buttons to be next to the labels and style the label of the selected radio button differently than the other labels?\n\n\n<link href=\"http://yui.yahooapis.com/2.5.2/build/reset-fonts-grids/reset-fonts-grids.css\" rel=\"stylesheet\... |
How do I assign a method's output to a textbox value without code behind?
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Public TextFromString As String = "test text test text"
Public Tex... | In ASP.NET Web Forms, assigning values to server controls such as TextBox or Label can be done in a few different ways. However, there's a key difference in how these controls work compared to standard HTML elements.
### Why the Issue Occurs
1. **Server Control vs. Regular HTML Elements**: `<asp:TextBox>` and `<asp:La... | 9,999 | [
{
"from": "human",
"value": "How do I assign a method's output to a textbox value without code behind?\n<%@ Page Language=\"VB\" %>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<script runat=\"server\">\n Public TextFromSt... |
I noticed a new web service today called a Dead man's switch, which dispatches email in the event that you don't respond to periodic "pings" that prove you're still alive. But it occurred to me that I might outlive the person or organization that pays the bills for the service, making the service useless.
There are oth... | The concept of a self-sustaining service that can operate independently of its creators is intriguing and presents a number of engineering and operational challenges. Here are some considerations and potential "gotchas" to address your questions:
### 1. **Bank Account Ownership and Unclaimed Status:**
- **Ownership... | 9,103 | [
{
"from": "human",
"value": "I noticed a new web service today called a Dead man's switch, which dispatches email in the event that you don't respond to periodic \"pings\" that prove you're still alive. But it occurred to me that I might outlive the person or organization that pays the bills for the service... |
Does any one have a preference on how to check if a value is DBNull? I've found these two statements give me the results I want, but just wondering if there's a preference?
if (any is System.DBNull)
same as:
if (any == System.DBNull.Value)
Thanks!
| Both ways to check if a value is `DBNull` that you've provided are functionally equivalent, but there are some subtle differences and preferences that you might consider.
1. **Using `is` keyword:**
```csharp
if (any is System.DBNull)
```
- This syntax is generally more readable and is often preferred for t... | 13,824 | [
{
"from": "human",
"value": "Does any one have a preference on how to check if a value is DBNull? I've found these two statements give me the results I want, but just wondering if there's a preference?\nif (any is System.DBNull)\nsame as:\nif (any == System.DBNull.Value)\nThanks!\n"
},
{
"from": "g... |
I want to get a files these attributes as integer values.
| To retrieve file attributes as integer values, you'll typically want to focus on attributes like file size, creation time, modification time, or permissions. The method of obtaining these values can vary depending on the programming language you are using. Below, I'll provide examples in Python, but you can specify a d... | 12,360 | [
{
"from": "human",
"value": "I want to get a files these attributes as integer values. \n"
},
{
"from": "gpt",
"value": "To retrieve file attributes as integer values, you'll typically want to focus on attributes like file size, creation time, modification time, or permissions. The method of obt... |
There appear to be a lot of unnecessary frameworks loading into my iPhone app. I didn't link against them in Xcode, and I don't need them.
When I run "lsof -p" against them on the iPhone, I see these (and others) that I can't explain:
CoreVideo
AddressBookUI
JavaScriptCore
MobileSync
EAP8021X
BluetoothManager
MusicL... | When developing for iOS, especially on jailbroken devices, it's not uncommon to see various system frameworks and libraries loaded even if your app doesn't explicitly link against them. This behavior is typical of the iOS operating system, which loads various frameworks as part of its overall functioning, especially if... | 12,978 | [
{
"from": "human",
"value": "There appear to be a lot of unnecessary frameworks loading into my iPhone app. I didn't link against them in Xcode, and I don't need them.\nWhen I run \"lsof -p\" against them on the iPhone, I see these (and others) that I can't explain:\n\nCoreVideo \nAddressBookUI\nJavaScript... |
Can you explain STA and MTA in your own words?
Also, what are apartment threads and do they pertain only to COM? If so, why?
| Sure! Let's break down STA, MTA, and apartment threads.
### STA (Single Threaded Apartment)
STA stands for Single Threaded Apartment. In this model, each thread is responsible for handling its own message loop and managing its own objects. This means that only one thread can access the objects within a given STA at an... | 10,138 | [
{
"from": "human",
"value": "Can you explain STA and MTA in your own words?\nAlso, what are apartment threads and do they pertain only to COM? If so, why?\n"
},
{
"from": "gpt",
"value": "Sure! Let's break down STA, MTA, and apartment threads.\n\n### STA (Single Threaded Apartment)\nSTA stands f... |
Can anyone recommend a good 3rd party control(s) for MS SQL 2005 Reporting Services. If you know some open library or implementation of such controls that could be very useful too.
| When working with SQL Server Reporting Services (SSRS), especially in the context of SQL Server 2005, there are several third-party controls and libraries you can consider for enhancing reporting capabilities. Here are some recommendations:
### 1. **Telerik Reporting**
- **Description**: A popular reporting solutio... | 10,872 | [
{
"from": "human",
"value": "Can anyone recommend a good 3rd party control(s) for MS SQL 2005 Reporting Services. If you know some open library or implementation of such controls that could be very useful too.\n"
},
{
"from": "gpt",
"value": "When working with SQL Server Reporting Services (SSRS... |
Newer ARM processors include the PLD and PLI instructions.
I'm writing tight inner loops (in C++) which have a non-sequential memory access pattern, but a pattern that naturally my code fully understands. I would anticipate a substantial speedup if I could prefetch the next location whilst processing the current memor... | To explicitly insert prefetch instructions like PLD (Prefetch Data) and PLI (Prefetch Instructions) in your C++ code, you can make use of compiler intrinsics or assembly language. Most modern compilers, including ARM's compilers, allow you to write inline assembly or use platform-specific intrinsics to generate these i... | 10,587 | [
{
"from": "human",
"value": "Newer ARM processors include the PLD and PLI instructions.\nI'm writing tight inner loops (in C++) which have a non-sequential memory access pattern, but a pattern that naturally my code fully understands. I would anticipate a substantial speedup if I could prefetch the next lo... |
In answer to this question Joel Coehoorn said
Finally, only after the site's gone through a suitable QA process, the production server is updated from source control, not from within visual studio.
Does VSS Explorer have tools for deploying sites (via FTP, I would assume)? I noticed for the first time a Web/Deploy m... | Visual Studio offers various tools for deploying web applications, but there are specific settings and configurations that must be in place for these tools to become active. Here’s a breakdown of how deployment works in Visual Studio and what you might need to do to enable it:
### Deployment in Visual Studio
1. **Pub... | 10,665 | [
{
"from": "human",
"value": "In answer to this question Joel Coehoorn said \n\nFinally, only after the site's gone through a suitable QA process, the production server is updated from source control, not from within visual studio.\n\nDoes VSS Explorer have tools for deploying sites (via FTP, I would assume)... |
(Java question)
If I reference a field in an inner class, does this cause a circular dependency between the enclosing class and the inner class?
How can I avoid this?
Here is an example:
public class Outer {
private Other o;
private Inner i;
public Outer() {
o = new Other();
i = new Inner() {
... | In Java, when an inner class references a field or method of its enclosing class, this doesn't create a circular dependency in the traditional sense. Instead, it creates a stronger association between the inner class and the outer class, because the inner class holds an implicit reference to its outer class instance.
... | 11,021 | [
{
"from": "human",
"value": "(Java question)\nIf I reference a field in an inner class, does this cause a circular dependency between the enclosing class and the inner class?\nHow can I avoid this? \nHere is an example:\npublic class Outer {\n\n private Other o;\n private Inner i; \n\n public Outer() ... |
Is there any need of Virtual Constructors? If so can any one post a scenario?
| In C++, the term "virtual constructor" is a bit of a misnomer because constructors cannot be declared as virtual. However, the concept often refers to the need for creating objects dynamically based on some runtime information, usually in scenarios involving polymorphism.
### Scenario: Factory Pattern
One common scen... | 9,804 | [
{
"from": "human",
"value": "Is there any need of Virtual Constructors? If so can any one post a scenario?\n"
},
{
"from": "gpt",
"value": "In C++, the term \"virtual constructor\" is a bit of a misnomer because constructors cannot be declared as virtual. However, the concept often refers to the... |
How do you return 1 value per row of the max of several columns:
TableName
[Number, Date1, Date2, Date3, Cost]
I need to return something like this:
[Number, Most_Recent_Date, Cost]
Query?
| To return one value per row of the maximum date from several date columns along with the corresponding cost, you can use a combination of a `UNION ALL` to transform the multiple date columns into rows, and then aggregate the results. Here's an example SQL query that demonstrates this approach:
```sql
SELECT
Numbe... | 13,593 | [
{
"from": "human",
"value": "How do you return 1 value per row of the max of several columns:\nTableName\n[Number, Date1, Date2, Date3, Cost]\n\nI need to return something like this:\n[Number, Most_Recent_Date, Cost]\n\nQuery?\n"
},
{
"from": "gpt",
"value": "To return one value per row of the m... |
If I was to create a ipfw divert rule to forward all FTP traffic to a specific socket, is it possible to use Java to connect to the socekt and read the packet information? If so, how would i go about reading/writing to the scoket?
| Yes, it is possible to use Java to connect to a socket and read the packet information if you have set up an IPFW divert rule to forward FTP traffic to that specific socket. Here's a general outline of how you can achieve this:
### Step 1: Set Up IPFW Divert Rule
First, ensure that your IPFW rule is correctly set up ... | 8,819 | [
{
"from": "human",
"value": "If I was to create a ipfw divert rule to forward all FTP traffic to a specific socket, is it possible to use Java to connect to the socekt and read the packet information? If so, how would i go about reading/writing to the scoket?\n"
},
{
"from": "gpt",
"value": "Yes... |
I've got two tables:
TableA
------
ID,
Name
TableB
------
ID,
SomeColumn,
TableA_ID (FK for TableA)
The relationship is one row of TableA - many of TableB.
Now, I want to see a result like this:
ID Name SomeColumn
1. ABC X, Y, Z (these are three different rows)
2. MNO R, S
This won't wo... | To achieve your desired result of combining multiple rows of `SomeColumn` from `TableB` into a single comma-separated string for each `ID` and `Name` from `TableA`, you can use the SQL `GROUP_CONCAT` function if you are using MySQL, or similar string aggregation functions available in other SQL databases. Here’s how yo... | 10,513 | [
{
"from": "human",
"value": "I've got two tables:\nTableA\n------\nID,\nName\n\nTableB\n------\nID,\nSomeColumn,\nTableA_ID (FK for TableA)\n\nThe relationship is one row of TableA - many of TableB.\nNow, I want to see a result like this:\nID Name SomeColumn\n\n1. ABC X, Y, Z (these are t... |
We've got a product which utilizes multiple SQL Server 2005 databases with triggers. We're looking for a sustainable solution for deploying and upgrading the database schemas on customer servers.
Currently, we're using Red Gate's SQL Packager, which appears to be the wrong tool for this particular job. Not only does SQ... | For your requirements, it sounds like you're looking for a comprehensive database deployment and migration tool that can handle multiple SQL Server 2005 databases, including triggers and other schema objects. Here are some recommendations that might fit your needs:
### 1. **Redgate SQL Compare**
- **Description**: ... | 8,962 | [
{
"from": "human",
"value": "We've got a product which utilizes multiple SQL Server 2005 databases with triggers. We're looking for a sustainable solution for deploying and upgrading the database schemas on customer servers.\nCurrently, we're using Red Gate's SQL Packager, which appears to be the wrong tool... |
Unfortunately I have to use Windows Server 2003 on my 32 bit workstation due to memory constraints of Windows XP.
In Windows XP, when you connect via Remote Desktop the current session I am logged in is instantly shared on the Remote Desktop. I can see all the applications I have opened on my workstation and can contin... | Windows Server 2003 does behave differently from Windows XP regarding Remote Desktop sessions. By default, Windows Server 2003 allows each user to connect to a new session, which is why you're not seeing your existing applications when you connect remotely. However, you can configure the server to behave more like Wind... | 12,371 | [
{
"from": "human",
"value": "Unfortunately I have to use Windows Server 2003 on my 32 bit workstation due to memory constraints of Windows XP.\nIn Windows XP, when you connect via Remote Desktop the current session I am logged in is instantly shared on the Remote Desktop. I can see all the applications I ha... |
Typically I use E_ALL to see anything that PHP might say about my code to try and improve it.
I just noticed a error constant E_STRICT, but have never used or heard about it, is this a good setting to use for development? The manual says:
Run-time notices. Enable to have PHP suggest changes to your code which will ens... | Using `E_ALL` is indeed a good practice during development because it captures all types of errors, warnings, notices, and deprecations that PHP can throw. This helps you ensure that your code is as robust as possible.
`E_STRICT` specifically is a set of suggestions to improve your code in terms of interoperability an... | 14,236 | [
{
"from": "human",
"value": "Typically I use E_ALL to see anything that PHP might say about my code to try and improve it.\nI just noticed a error constant E_STRICT, but have never used or heard about it, is this a good setting to use for development? The manual says:\n\nRun-time notices. Enable to have PHP... |
Whenever I indent HTML in PHP mode, emacs (22.1.1, basic install on Redaht Linux over Putty-SSH) pops up a frame and tells me to get MUMODE or somesuch extra add-on. I installed PHP Mode without a big hassle, but I don't know how to get this multi-mode rolling.
I'd like to know 2 things
How to install and configure m... | To install and configure `mumamo` (the multi-mode package for editing mixed-language files in Emacs) and to disable pop-ups in Emacs, follow these steps:
### Installing and Configuring Mumamo
1. **Install `mumamo`:**
If you have Emacs 22.1, `mumamo` might already be included, but if not, you can install it via the... | 11,356 | [
{
"from": "human",
"value": "Whenever I indent HTML in PHP mode, emacs (22.1.1, basic install on Redaht Linux over Putty-SSH) pops up a frame and tells me to get MUMODE or somesuch extra add-on. I installed PHP Mode without a big hassle, but I don't know how to get this multi-mode rolling.\n\nI'd like to k... |
I remember my old Radeon graphics drivers which had a number of overlay effects or color filters (whatever they are called) that would render the screen in e.g. sepia tones or negative colors. My current NVIDIA card does not seem to have such a function so I wondered if it is possible to make my own for Vista.
I don't ... | Creating custom color effects for your screen can indeed be an interesting project! Since you're using Windows Vista and an NVIDIA graphics card, there are a few approaches you might consider. Here are a few options:
### 1. **NVIDIA Control Panel**
The NVIDIA Control Panel allows some adjustments to color settings, b... | 10,907 | [
{
"from": "human",
"value": "I remember my old Radeon graphics drivers which had a number of overlay effects or color filters (whatever they are called) that would render the screen in e.g. sepia tones or negative colors. My current NVIDIA card does not seem to have such a function so I wondered if it is po... |
I can't seem to figure out a good way to do this, but it seems like it should be simple. I have an element that I want to append a div to. Then I have another element that I want to clone and shove into that intermediate div. Here's what I was hoping to do:
$("#somediv > ul").after("<div id='xxx'></div>").append($("... | You're right in your observation that the way you're currently trying to use `.after()` and `.append()` isn't working as intended because `.append()` is being called on the original selection, rather than the newly created div.
To achieve what you're aiming for, you'll want to first create and append the intermediate ... | 13,058 | [
{
"from": "human",
"value": "I can't seem to figure out a good way to do this, but it seems like it should be simple. I have an element that I want to append a div to. Then I have another element that I want to clone and shove into that intermediate div. Here's what I was hoping to do:\n$(\"#somediv > ul... |
I can't seem to find much documentation on X-Sendfile or example code for PHP (there is some rails code).
Anyone used it before and would mind giving a quick snippet of code and a brief description?
| X-Sendfile is a powerful feature that allows web servers to serve files directly, bypassing PHP's memory limit and handling capabilities. It's particularly useful for serving large files, as it offloads the task of file delivery to the web server (like Apache or Nginx) while maintaining the ability to handle authentica... | 11,259 | [
{
"from": "human",
"value": "I can't seem to find much documentation on X-Sendfile or example code for PHP (there is some rails code).\nAnyone used it before and would mind giving a quick snippet of code and a brief description?\n"
},
{
"from": "gpt",
"value": "X-Sendfile is a powerful feature t... |
I need to generate a directory in my makefile and I would like to not get the "directory already exists error" over and over even though I can easily ignore it.
I mainly use mingw/msys but would like something that works across other shells/systems too.
I tried this but it didn't work, any ideas?
ifeq (,$(findstring $... | You can modify your Makefile to create a directory in a way that doesn't throw an error if it already exists. Using the `mkdir` command with the `-p` option is a standard approach, as it creates the directory if it doesn't exist and does nothing if it does. This works across various systems, including Unix-like environ... | 14,118 | [
{
"from": "human",
"value": "I need to generate a directory in my makefile and I would like to not get the \"directory already exists error\" over and over even though I can easily ignore it.\nI mainly use mingw/msys but would like something that works across other shells/systems too.\nI tried this but it ... |
Any recommended crypto libraries for Python. I know I've asked something similar in x509 certificate parsing libraries for Java, but I should've split the question in two.
What I need is the ability to parse X.509 Certificates to extract the information contained in them.
Looking around, I've found two options:
Python... | Both of the libraries you've mentioned, **pyOpenSSL** and the Python OpenSSL Wrappers (often referred to as `pow`), can be used to work with X.509 certificates in Python, but `pyOpenSSL` is indeed the more commonly used and maintained option. Here's a bit more information on both, along with some recommendations:
### ... | 11,690 | [
{
"from": "human",
"value": "Any recommended crypto libraries for Python. I know I've asked something similar in x509 certificate parsing libraries for Java, but I should've split the question in two.\nWhat I need is the ability to parse X.509 Certificates to extract the information contained in them.\nLook... |
I want to add a mailto link on our web page. I want to add a urgent priority to this mail.
| To create a mailto link with an urgent priority in your web page, you can use the `mailto:` link format. While there isn't a standard way to set an "urgent" priority directly through a mailto link, you can include a specific subject line or body text that indicates the urgency.
Here's how you can create a mailto link ... | 13,379 | [
{
"from": "human",
"value": "I want to add a mailto link on our web page. I want to add a urgent priority to this mail.\n"
},
{
"from": "gpt",
"value": "To create a mailto link with an urgent priority in your web page, you can use the `mailto:` link format. While there isn't a standard way to se... |
I have a page where I submit some data, and return to the original form with a "Save Successful" message. However, the user would like the ability to return to the previous page they were at (which contains search results) by clicking the browser's "Back" button. However, due to the postback, when they click the "Bac... | It's great that you're trying to enhance the user experience by allowing them to return to their previous search results using the browser's "Back" button. SmartNavigation is indeed deprecated, and using ASP.NET AJAX with UpdatePanels is a common approach. However, it sounds like you're still facing some challenges. He... | 11,209 | [
{
"from": "human",
"value": "I have a page where I submit some data, and return to the original form with a \"Save Successful\" message. However, the user would like the ability to return to the previous page they were at (which contains search results) by clicking the browser's \"Back\" button. However, ... |
How would you refactor these two classes to abstract out the similarities? An abstract class? Simple inheritance? What would the refactored class(es) look like?
public class LanguageCode
{
/// <summary>
/// Get the lowercase two-character ISO 639-1 language code.
/// </summary>
public readonly string Va... | To refactor the `LanguageCode` and `RegionCode` classes by abstracting their similarities, we can create a generic base class that encapsulates the shared behavior and properties. This can be done using an abstract class with generics. Here's how it can be structured:
1. Define a generic abstract class `CodeBase<T>` t... | 10,098 | [
{
"from": "human",
"value": "How would you refactor these two classes to abstract out the similarities? An abstract class? Simple inheritance? What would the refactored class(es) look like?\npublic class LanguageCode\n{\n /// <summary>\n /// Get the lowercase two-character ISO 639-1 language code.\n ... |
I know PHP scripts don't actually compile until they are run. However, say I want to create a small simple program and compile it to a binary without requiring the PHP binary. How could I do this?
I've seen a few IDE's out there that would do this, but either they are all for windows or the Linux versions don't actuall... | Compiling PHP scripts to binaries is not as straightforward as doing so with languages like Python, which has tools like `py2exe` or `PyInstaller`. However, there are a few options available to package PHP scripts into a standalone executable. Below are some methods and tools that you can consider:
### 1. **PHP-Exe**
... | 5,425 | [
{
"from": "human",
"value": "I know PHP scripts don't actually compile until they are run. However, say I want to create a small simple program and compile it to a binary without requiring the PHP binary. How could I do this?\nI've seen a few IDE's out there that would do this, but either they are all for w... |
I see them all the time and always ignore them. Can someone explain to me why they have become so prevalent? If I'm using a site that allows me to explore it via tags (e.g., this one, del.icio.us, etc.) that's what I will do. Why would I need a "cloud" of tags upon which to click? I can just type that tag(s) into a ... | It sounds like you're referring to "tag clouds," which are visual representations of tags or keywords, where the size of each tag reflects its frequency or popularity. While you may find them unnecessary, there are a few reasons why tag clouds have become prevalent on websites and platforms:
1. **Visual Appeal**: Tag ... | 11,744 | [
{
"from": "human",
"value": "I see them all the time and always ignore them. Can someone explain to me why they have become so prevalent? If I'm using a site that allows me to explore it via tags (e.g., this one, del.icio.us, etc.) that's what I will do. Why would I need a \"cloud\" of tags upon which to ... |
How can you programmatically measure per-process (or better, per-thread) CPU usage under windows 95, windows 98 and windows ME?
If it requires the DDK, where can you obtain that?
Please note the Win9x requirement. It's easy on NT.
EDIT: I tried installing the Win95/98 version of WMI, but Win32_Process.KernelModeTime an... | Measuring per-process or per-thread CPU usage on Windows 95, Windows 98, and Windows ME is quite challenging due to the lack of built-in support and APIs that would allow for detailed performance monitoring like you would find in Windows NT. Windows 9x is primarily designed for consumer usage, and thus the system metri... | 8,299 | [
{
"from": "human",
"value": "How can you programmatically measure per-process (or better, per-thread) CPU usage under windows 95, windows 98 and windows ME?\nIf it requires the DDK, where can you obtain that?\nPlease note the Win9x requirement. It's easy on NT.\nEDIT: I tried installing the Win95/98 version... |
I read a text recently saying the MVC pattern describes the layers in an application. But personally I see MVC showing several key roles in an application.
Which word do you think is better, layer or role, to describe the three main pieces of MVC?
| The choice between "layer" and "role" to describe the three main pieces of the MVC pattern—Model, View, and Controller—depends on the context and perspective you want to emphasize.
- **Layer**: This term is often used in the context of architectural patterns and can imply a strict separation of concerns, where each co... | 15,592 | [
{
"from": "human",
"value": "I read a text recently saying the MVC pattern describes the layers in an application. But personally I see MVC showing several key roles in an application.\nWhich word do you think is better, layer or role, to describe the three main pieces of MVC?\n"
},
{
"from": "gpt",... |
How can I mount a floppy image file using cygwin. I would like to mount the image, copy a file to the mounted drive, and then unmount it from the command line.
I know you can use Virtual Floppy Drive in windows, but is there a way to do this in Cygwin?
| Yes, you can mount a floppy image file in Cygwin using a combination of tools. However, Cygwin itself does not provide built-in functionality to mount floppy disk images like you would find in a native Linux environment. Instead, you can use additional tools that are compatible with Cygwin.
Here’s a step-by-step guide... | 11,933 | [
{
"from": "human",
"value": "How can I mount a floppy image file using cygwin. I would like to mount the image, copy a file to the mounted drive, and then unmount it from the command line. \nI know you can use Virtual Floppy Drive in windows, but is there a way to do this in Cygwin?\n"
},
{
"from"... |
I'm looking for a good way to represent organic growth - especially trees and flowers - using code.
I've found Lindenmayer Systems as a reasonable way to portray this, but need a good place to start programming this.
Any good suggestions?
| Lindenmayer Systems (L-systems) are indeed a great way to represent the growth patterns of plants, including trees and flowers. They use a set of rules to iteratively develop structures that can be visualized graphically. Here's a basic outline to help you get started with programming L-systems:
### Step 1: Define You... | 9,839 | [
{
"from": "human",
"value": "I'm looking for a good way to represent organic growth - especially trees and flowers - using code.\nI've found Lindenmayer Systems as a reasonable way to portray this, but need a good place to start programming this.\nAny good suggestions?\n"
},
{
"from": "gpt",
"va... |
I have an instance of a System.Drawing.Bitmap and would like to make it available to my WPF app in the form of a System.Windows.Media.Imaging.BitmapImage.
What would be the best approach for this?
| To convert a `System.Drawing.Bitmap` to a `System.Windows.Media.Imaging.BitmapImage` in a WPF application, you'll typically need to follow a two-step process. First, you will need to save the `Bitmap` to a stream, and then create a `BitmapImage` from that stream.
Here's a step-by-step guide to achieving this:
1. **Co... | 11,671 | [
{
"from": "human",
"value": "I have an instance of a System.Drawing.Bitmap and would like to make it available to my WPF app in the form of a System.Windows.Media.Imaging.BitmapImage.\nWhat would be the best approach for this?\n"
},
{
"from": "gpt",
"value": "To convert a `System.Drawing.Bitmap`... |
My goal here is to create a very simple template language. At the moment, I'm working on replacing a variable with a value, like this:
This input:
The Web
Should produce this output:
The Web This Is A Test Variable
I've got it working. But looking at my code, I'm running multiple identical regexes on the same st... | To improve the efficiency and readability of your template processing code, we can eliminate the repeated calls to `search` and use a single pass for both variable definitions and variable usage. We'll also modify the `processVariables` function to replace matches with their corresponding definitions as we go, rather t... | 12,172 | [
{
"from": "human",
"value": "My goal here is to create a very simple template language. At the moment, I'm working on replacing a variable with a value, like this:\nThis input:\n\n The Web \n\nShould produce this output:\n\nThe Web This Is A Test Variable\n\nI've got it working. But looking at my code, I'm... |
I've got a sign up form that requires the user to enter their email and password, both are in two separate text boxes. I want to provide a button that the user can click so that the password (which is masked) will appear in a popup when the user clicks the button.
Currently my JavaScript code for this is as follows:
... | The reason your password field gets cleared with each button click is that you are using the `alert()` function, which can cause the focus to shift away from the input field, and in some browsers, this can inadvertently lead to the value being reset or cleared.
To allow users to toggle the visibility of their password... | 11,956 | [
{
"from": "human",
"value": "I've got a sign up form that requires the user to enter their email and password, both are in two separate text boxes. I want to provide a button that the user can click so that the password (which is masked) will appear in a popup when the user clicks the button.\nCurrently my ... |
I need to do a multilingual website, with urls like
www.domain.com/en/home.aspx for english
www.domain.com/es/home.aspx for spanish
In the past, I would set up two virtual directories in IIS, and then detect the URL in global.aspx and change the language according to the URL
Sub Application_BeginRequest(ByVal sender A... | Using routing in ASP.NET is definitely a more elegant and flexible approach compared to relying on virtual directories and manual URL detection. By leveraging the routing capabilities of ASP.NET, you can create a clean and maintainable way to handle multilingual URLs. Here’s how you can set up routing for your multilin... | 10,330 | [
{
"from": "human",
"value": "I need to do a multilingual website, with urls like\nwww.domain.com/en/home.aspx for english\nwww.domain.com/es/home.aspx for spanish\n\nIn the past, I would set up two virtual directories in IIS, and then detect the URL in global.aspx and change the language according to the UR... |
Python's convention is that variables are created by first assignment, and trying to read their value before one has been assigned raises an exception. PHP by contrast implicitly creates a variable when it is read, with a null value. This means it is easy to do this in PHP:
function mymodule_important_calculation() {
... | Yes, in PHP, you can enable stricter error reporting and variable handling to help catch issues like the one you described. Here are a few methods to make PHP stricter with variable assignments:
1. **Enable Strict Error Reporting**: You can set the error reporting level to include warnings for uninitialized variables.... | 12,511 | [
{
"from": "human",
"value": "Python's convention is that variables are created by first assignment, and trying to read their value before one has been assigned raises an exception. PHP by contrast implicitly creates a variable when it is read, with a null value. This means it is easy to do this in PHP:\nfun... |
I haven't kept up lately with the C++ world. Exactly where do things stand these days regarding the standard?
Is TR1 adopted?
Is there a TR2?
How do these relate to C++0x? Are the subsumed?
Has a decision been reached on threading yet?
| As of my last knowledge update in October 2023, here's the state of the C++ world regarding the standard:
1. **C++ Standards and C++11 (C++0x):** The standard known as C++0x has been officially released as C++11, which was published in 2011. C++11 introduced a variety of significant new features such as auto type infe... | 12,266 | [
{
"from": "human",
"value": "I haven't kept up lately with the C++ world. Exactly where do things stand these days regarding the standard? \nIs TR1 adopted? \nIs there a TR2? \nHow do these relate to C++0x? Are the subsumed?\nHas a decision been reached on threading yet?\n"
},
{
"from": "gpt",
... |
Many websites, including this one, add what are apparently called slugs - descriptive but as far as I can tell useless bits of text - to the end of URLs.
For example, the URL the site gives for this question is:
https://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of-urls
But the followin... | Slugs in URLs serve several important purposes beyond just aesthetics. Here are the main reasons why they are commonly used:
1. **SEO (Search Engine Optimization):** Search engines like Google use URLs as one of many factors to determine the relevance of a page. Descriptive slugs can improve search rankings because th... | 14,492 | [
{
"from": "human",
"value": "Many websites, including this one, add what are apparently called slugs - descriptive but as far as I can tell useless bits of text - to the end of URLs.\nFor example, the URL the site gives for this question is:\nhttps://stackoverflow.com/questions/47427/why-do-some-websites-ad... |
Any suggestion for a JavaScript interactive drawing library? Just need to draw lines, polygons, texts of different colors. IE/Firefox/Opera/Safari compatible.
| For an interactive drawing library in JavaScript that meets your requirements (drawing lines, polygons, and texts of different colors, while being compatible with major browsers like IE, Firefox, Opera, and Safari), here are a few options you can consider:
1. **Fabric.js**:
- **Description**: Fabric.js is a powerfu... | 9,698 | [
{
"from": "human",
"value": "Any suggestion for a JavaScript interactive drawing library? Just need to draw lines, polygons, texts of different colors. IE/Firefox/Opera/Safari compatible.\n\n"
},
{
"from": "gpt",
"value": "For an interactive drawing library in JavaScrip... |
What problems does MEF (Managed Extensibility Framework) solves that cannot be solved by existing IoC/DI containers?
| The Managed Extensibility Framework (MEF) is designed to enable the creation of extensible applications, particularly in scenarios where you want to allow for dynamic composition of parts, as well as providing a more straightforward mechanism for integrating components without tightly coupling them. While Inversion of ... | 8,566 | [
{
"from": "human",
"value": "What problems does MEF (Managed Extensibility Framework) solves that cannot be solved by existing IoC/DI containers?\n"
},
{
"from": "gpt",
"value": "The Managed Extensibility Framework (MEF) is designed to enable the creation of extensible applications, particularly... |
I am currently working on an web application that uses ASP.NET 2.0 framework. I need to redirect to a certain page, say SessionExpired.aspx, when the user session expires. There are lot of pages in the project, so adding code to every page of the site is not really a good solution. I have MasterPages though, which I th... | Using MasterPages in ASP.NET can definitely help you manage session expiration for a web application without having to add code to every individual page. One effective way to handle session expiration is to check for the session state in the `Page_Load` event of your MasterPage. This way, you can redirect users to `Ses... | 11,728 | [
{
"from": "human",
"value": "I am currently working on an web application that uses ASP.NET 2.0 framework. I need to redirect to a certain page, say SessionExpired.aspx, when the user session expires. There are lot of pages in the project, so adding code to every page of the site is not really a good soluti... |
I have a certain page (we'll call it MyPage) that can be accessed from three different pages. In the Web.sitemap file, I tried to stuff the XML for this page under the three separate nodes like this:
< Page 1 >
< MyPage / >
...
< /Page 1 >
< Page 2 >
< MyPage / >
...
< /Page 2 >
< Page 3 >
< MyPage ... | You're correct that the `XmlSiteMapProvider` requires that each URL in your sitemap is unique. When you try to define the same page (`MyPage`) under multiple parents, it leads to a conflict because the URLs must be distinct. Here are a few alternatives to work around this limitation:
### 1. Use a Single Node with Mult... | 10,391 | [
{
"from": "human",
"value": "I have a certain page (we'll call it MyPage) that can be accessed from three different pages. In the Web.sitemap file, I tried to stuff the XML for this page under the three separate nodes like this:\n< Page 1 >\n < MyPage / >\n ...\n< /Page 1 >\n< Page 2 >\n < MyPage /... |
I've read in a couple of places that the desktop wallpaper can be set to an HTML document. Has anyone had any success changing it programmatically?
The following snippet of VB6 helps me set things up for BMPs but when I try to use it for HTML, I get a nice blue background and nothing else.
Dim reg As New StdRegistry
... | Setting a desktop wallpaper to an HTML document is a more complex operation than simply changing it to a BMP or JPEG image. Windows does allow you to set the desktop background using HTML through the Active Desktop feature, which was more common in older versions of Windows, such as Windows XP. However, in later versio... | 11,557 | [
{
"from": "human",
"value": "I've read in a couple of places that the desktop wallpaper can be set to an HTML document. Has anyone had any success changing it programmatically? \nThe following snippet of VB6 helps me set things up for BMPs but when I try to use it for HTML, I get a nice blue background and ... |
I have a command line tool, written in Delphi, which job is to insert a node in a XML file and then immediately exit. I need to make it possible several instances of the tool to be executed simultaneously and insert nodes to one and the same XML.
To achieve this purpose I have introduced a simple file "mutex" - the to... | Using a simple file-based mutex can work for a small number of instances, but it often becomes a bottleneck when many concurrent processes are trying to access the same resource. Here are some alternative approaches you can consider to improve the situation:
### 1. **Use System Mutexes:**
Instead of using a file-based... | 13,213 | [
{
"from": "human",
"value": "I have a command line tool, written in Delphi, which job is to insert a node in a XML file and then immediately exit. I need to make it possible several instances of the tool to be executed simultaneously and insert nodes to one and the same XML. \nTo achieve this purpose I have... |
We have an application that works with MS Office and uses Microsoft.mshtml.dll. We use ClickOnce to deploy the application. The application deploys without issues on most machines, but sometimes we get errors saying "System Update Required, Microsoft.mshtl.dll should be in the GAC".
We tried installing the PIA for Off... | Deploying an application that relies on `Microsoft.mshtml.dll` can be challenging, especially since this DLL is part of the Microsoft Office interop assemblies and is generally installed with Microsoft Office. Here are some strategies to address the deployment issues you're encountering:
1. **Ensure Microsoft Office i... | 12,280 | [
{
"from": "human",
"value": "We have an application that works with MS Office and uses Microsoft.mshtml.dll. We use ClickOnce to deploy the application. The application deploys without issues on most machines, but sometimes we get errors saying \"System Update Required, Microsoft.mshtl.dll should be in the ... |
I'm trying to setup a stress/load test using the WCAT toolkit included in the IIS Resources.
Using LogParser, I've processed a UBR file with configuration. It looks something like this:
[Configuration]
NumClientMachines: 1 # number of distinct client machines to use
NumClientThreads: 100 # number of... | It looks like you're setting up a stress test using the WCAT (Web Capacity Analysis Tool) toolkit, but you're encountering a connection error when trying to run the client. The error code `10061` indicates that the connection was refused, which often points to several potential issues. Here are some troubleshooting ste... | 12,584 | [
{
"from": "human",
"value": "I'm trying to setup a stress/load test using the WCAT toolkit included in the IIS Resources.\nUsing LogParser, I've processed a UBR file with configuration. It looks something like this:\n [Configuration]\nNumClientMachines: 1 # number of distinct client machines to u... |
Ok, this is a curly one. I'm working on some Delphi code that I didn't write, and I'm encountering a very strange problem. One of my stored procedures' parameters is coming through as null, even though it's definitely being sent 1.
The Delphi code uses a TADOQuery to execute the stored procedure (anonymized):
ADOQuery... | This seems to be a rather complex issue, but let's break down some potential causes and fixes.
### 1. **Parameter Naming and Case Sensitivity**
In SQL Server, parameter names are case insensitive by default, but in your Delphi code, you're using `ParamByName("Foo")`, which depends on how parameters are named and hand... | 10,704 | [
{
"from": "human",
"value": "Ok, this is a curly one. I'm working on some Delphi code that I didn't write, and I'm encountering a very strange problem. One of my stored procedures' parameters is coming through as null, even though it's definitely being sent 1.\nThe Delphi code uses a TADOQuery to execute th... |
What's the best way to enumerate a set of files and folders using FinalBuilder?
The context of my question is, I want to compare a source folder with a destination folder, and replace any matching files in the destination folder that are older than the source folder.
Any suggestions?
| To enumerate files and folders and compare a source folder with a destination folder in FinalBuilder, you can follow these steps:
### 1. Use the File Search Action
- **Create a File Search Action**: Use the “File Search” action to list all files in your source folder.
- **Set Properties**: Configure it to search for ... | 12,155 | [
{
"from": "human",
"value": "What's the best way to enumerate a set of files and folders using FinalBuilder?\nThe context of my question is, I want to compare a source folder with a destination folder, and replace any matching files in the destination folder that are older than the source folder.\nAny sugge... |
In a Java application I need to checkout files from Borland Starteam 2006 R2 using Starteam API by various parameters (date, label). Is there any framework that helps to write automatic tests for such functionality?
| When working with the Borland StarTeam API to perform operations like checking out files based on various parameters (e.g., date, label), you can certainly develop automated tests for that functionality. However, while there may not be a specific framework dedicated solely to testing StarTeam interactions, you can use ... | 9,602 | [
{
"from": "human",
"value": "In a Java application I need to checkout files from Borland Starteam 2006 R2 using Starteam API by various parameters (date, label). Is there any framework that helps to write automatic tests for such functionality?\n"
},
{
"from": "gpt",
"value": "When working with ... |
What are the various charting tools that are available for displaying charts on a web page using ASP.NET?
I know about commercial tools such as Dundas and Infragistics.
I could have "googled" this but I want to know the various tools that SO participants have used? Any free charting tools that are available are also we... | There are a variety of charting tools available for use in ASP.NET applications, ranging from commercial offerings to free, open-source options. Here’s a list of some popular tools that developers in the community often use:
### Commercial Tools
1. **Dundas Charts**: A comprehensive and powerful charting tool with a ... | 10,261 | [
{
"from": "human",
"value": "What are the various charting tools that are available for displaying charts on a web page using ASP.NET?\nI know about commercial tools such as Dundas and Infragistics.\nI could have \"googled\" this but I want to know the various tools that SO participants have used? Any free ... |
What would be the simplest way to daemonize a python script in Linux ? I need that this works with every flavor of Linux, so it should only use python based tools.
| Daemonizing a Python script can be done in various ways, but one of the simplest methods is to use the `os` and `sys` modules to handle the forking and detachment from the terminal. Here's a basic example of how to daemonize a Python script in a way that should work across different Linux distributions:
### Simple Dae... | 9,603 | [
{
"from": "human",
"value": "What would be the simplest way to daemonize a python script in Linux ? I need that this works with every flavor of Linux, so it should only use python based tools. \n"
},
{
"from": "gpt",
"value": "Daemonizing a Python script can be done in various ways, but one of t... |
Is there a easy way to do this? Or do I have to parse the file and do some search/replacing on my own?
The ideal would be something like:
var myXML: XML = ???; // ... load xml data into the XML object
myXML.someAttribute = newValue;
| To manipulate XML data easily in your code, you'll want to use an XML parsing library or a built-in XML feature in your programming language. The specific implementation will depend on the language you are using. Here are a few examples in popular languages:
### ActionScript (AS3)
If you're working in ActionScript, yo... | 10,880 | [
{
"from": "human",
"value": "Is there a easy way to do this? Or do I have to parse the file and do some search/replacing on my own?\nThe ideal would be something like:\nvar myXML: XML = ???; // ... load xml data into the XML object\n\nmyXML.someAttribute = newValue; \n\n"
},
{
"from": "gpt",
"va... |
In C++, it's not possible to initialize array members in the initialization list, thus member objects should have default constructors and they should be properly initialized in the constructor. Is there any (reasonable) workaround for this apart from not using arrays?
[Anything that can be initialized using only the i... | If you want to initialize an array of objects with non-default constructors in C++ while maintaining the benefits of static memory allocation, you can use an approach with a combination of `std::array` and aggregate initialization, which allows for the initialization of an array of non-default constructible types.
Sta... | 12,777 | [
{
"from": "human",
"value": "In C++, it's not possible to initialize array members in the initialization list, thus member objects should have default constructors and they should be properly initialized in the constructor. Is there any (reasonable) workaround for this apart from not using arrays?\n[Anythin... |
Is there any C#/F# performance comparison available on web to show proper usage of new F# language?
| There are several resources and articles that provide performance comparisons between C# and F# across various scenarios. However, performance can be highly context-dependent, influenced by factors such as the specific application, the way code is written, and the usage patterns of the languages. Here are a few key poi... | 12,214 | [
{
"from": "human",
"value": "Is there any C#/F# performance comparison available on web to show proper usage of new F# language?\n"
},
{
"from": "gpt",
"value": "There are several resources and articles that provide performance comparisons between C# and F# across various scenarios. However, per... |
In a Windows Form with a Resizing Frame, the frame border draws with a raised 3-D look. I'd like it to draw with a flat single pixel border in a color of my choosing.
Is this possible without having to owner draw the whole form?
| In a Windows Forms application, achieving a custom flat border for a form while maintaining the standard behavior of the form can be a bit tricky, but it is possible to accomplish without fully owner-drawing the form. One method to achieve this is by using the form's `Paint` event to draw the border manually. Below are... | 9,219 | [
{
"from": "human",
"value": "In a Windows Form with a Resizing Frame, the frame border draws with a raised 3-D look. I'd like it to draw with a flat single pixel border in a color of my choosing.\nIs this possible without having to owner draw the whole form?\n"
},
{
"from": "gpt",
"value": "In a... |
I have an asp.net mvc application with a route similar to:
routes.MapRoute("Blog",
"{controller}/{action}/{year}/{month}/{day}/{friendlyName}",
new { controller = "Blog", action = "Index", id = "", friendlyName="" },
new { controller = @"[^\.]*",
year = @"\d{4}",
... | The issue you are encountering stems from how the `Html.ActionLink` method interprets the action method parameters. By default, `Html.ActionLink` will use the query string for parameters that it does not find in the route data, especially when those parameters are not declared in a way that adheres to the routing expec... | 11,823 | [
{
"from": "human",
"value": "I have an asp.net mvc application with a route similar to:\nroutes.MapRoute(\"Blog\", \n \"{controller}/{action}/{year}/{month}/{day}/{friendlyName}\", \n new { controller = \"Blog\", action = \"Index\", id = \"\", friendlyName=\"\" }, \n new { ... |
I have 2 arrays of 16 elements (chars) that I need to "compare" and see how many elements are equal between the two.
This routine is going to be used millions of times (a usual run is about 60 or 70 million times), so I need it to be as fast as possible. I'm working on C++ (C++Builder 2007, for the record)
Right now, I... | To compare two arrays of 16 elements and count how many elements are equal, your current method of using 16 explicit comparisons is indeed quite straightforward and can be relatively fast for small sizes. However, if you're looking for potential improvements, particularly considering that you are running this compariso... | 10,213 | [
{
"from": "human",
"value": "I have 2 arrays of 16 elements (chars) that I need to \"compare\" and see how many elements are equal between the two.\nThis routine is going to be used millions of times (a usual run is about 60 or 70 million times), so I need it to be as fast as possible. I'm working on C++ (C... |
How do I get a list of the files checked out by users (including the usernames) using P4V or P4?
I want to provide a depot location and see a list of any files under that location (including sub folders) that are checked out.
| To get a list of files checked out by users in a specific depot location using Perforce (P4V or P4 command line), you can follow these steps:
### Using P4 Command Line
1. **Open your command line interface** (Terminal on macOS/Linux or Command Prompt/PowerShell on Windows).
2. **Use the `p4 opened` command** to g... | 13,212 | [
{
"from": "human",
"value": "How do I get a list of the files checked out by users (including the usernames) using P4V or P4? \nI want to provide a depot location and see a list of any files under that location (including sub folders) that are checked out.\n"
},
{
"from": "gpt",
"value": "To get... |
I've found the standard hashing function on VS2005 is painfully slow when trying to achieve high performance look ups. What are some good examples of fast and efficient hashing algorithms that should void most collisions?
| If you're looking for faster and more efficient hashing algorithms that reduce collisions, especially for high-performance lookups, there are several options to consider. Here are some well-known hashing algorithms that are optimized for performance and have good properties regarding collisions:
1. **MurmurHash**:
... | 11,612 | [
{
"from": "human",
"value": "I've found the standard hashing function on VS2005 is painfully slow when trying to achieve high performance look ups. What are some good examples of fast and efficient hashing algorithms that should void most collisions?\n"
},
{
"from": "gpt",
"value": "If you're lo... |
This is a fairly trivial matter, but I'm curious to hear people's opinions on it.
If I have a Dictionary which I'm access through properties, which of these formats would you prefer for the property?
/// <summary>
/// This class's FirstProperty property
/// </summary>
[DefaultValue("myValue")]
public string FirstProper... | Both approaches you presented have their merits, and your choice ultimately depends on your priorities, such as code readability, maintainability, and the potential for errors. Let’s break down the pros and cons of each approach:
### Approach 1: Directly Using the String Key
```csharp
/// <summary>
/// This class's F... | 11,075 | [
{
"from": "human",
"value": "This is a fairly trivial matter, but I'm curious to hear people's opinions on it.\nIf I have a Dictionary which I'm access through properties, which of these formats would you prefer for the property?\n/// <summary>\n/// This class's FirstProperty property\n/// </summary>\n[Defa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.