instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I have been looking for a logging framework for .net (c#) and decided to give log4net a go after reading up on a few question/answer threads here on stackoverflow. I see people mentioning over and over that they use a wrapper class for log4net and I am wonder what that would look like.
I have my code split up into diff... | Using a wrapper class for a logging framework like log4net can help decouple your logging implementation from your business logic, making it easier to change the logging framework later if needed. Below are some suggestions and examples on how to implement a log4net wrapper class, as well as answers to your questions.
... | 19,303 | [
{
"from": "human",
"value": "I have been looking for a logging framework for .net (c#) and decided to give log4net a go after reading up on a few question/answer threads here on stackoverflow. I see people mentioning over and over that they use a wrapper class for log4net and I am wonder what that would loo... |
Can we extend the Team Site to host our own pages. i.e. Does TFS allows you to add pages/web parts that are developed by us. I have found few clues in Google but no one could elaborate properly.
| Yes, you can extend a Team Foundation Server (TFS) team site to host your own pages and web parts, but the extent of customization and the methods available may depend on the version of TFS you are using and whether you are using TFS on-premises or Azure DevOps Services (the successor to TFS).
### For TFS and Azure De... | 19,237 | [
{
"from": "human",
"value": "Can we extend the Team Site to host our own pages. i.e. Does TFS allows you to add pages/web parts that are developed by us. I have found few clues in Google but no one could elaborate properly.\n"
},
{
"from": "gpt",
"value": "Yes, you can extend a Team Foundation S... |
I'm using a COM Wrapper to interact with Windows Media Player.
The it is using an AxHost to somehow wrap the player, for me it's all just magic under the hood^^
The AxHost.AttachInterfaces looks like this
protected override void AttachInterfaces()
{
try
{
//Get the IOleObject fo... | To use an `AxHost` control, like the Windows Media Player control, outside of a traditional Windows Forms environment (like a console application), there are a few important points to consider. The `AxHost` control is designed to be used within a Windows Forms application, and it relies heavily on the message loop and ... | 16,843 | [
{
"from": "human",
"value": "I'm using a COM Wrapper to interact with Windows Media Player.\nThe it is using an AxHost to somehow wrap the player, for me it's all just magic under the hood^^\nThe AxHost.AttachInterfaces looks like this\n protected override void AttachInterfaces() \n {\n try \n ... |
I just got through manually removing the bin\ and obj\ folders from around 30 VS projects getting them ready for an initial SVN commit. Yeah, I know, I should have done it alot sooner, but these are personal project on my home PC, and I only installed a SVN server locally today.
Anyway, it occurs to me that there must ... | Cleaning out the `bin\` and `obj\` folders from multiple Visual Studio projects can be tedious, especially when done manually. Here are some methods you can use to automate this process:
### Method 1: Use Visual Studio's Clean Solution Option
If you just want to clean up the build outputs for the active solution:
1. ... | 18,906 | [
{
"from": "human",
"value": "I just got through manually removing the bin\\ and obj\\ folders from around 30 VS projects getting them ready for an initial SVN commit. Yeah, I know, I should have done it alot sooner, but these are personal project on my home PC, and I only installed a SVN server locally toda... |
I'm starting on a project that I expect will include a substantial amount of non-Java code (mostly shell and SQL scripts).
I would still like to manage this project with Maven. What are the best practices wrt non-Java source code and Maven? Where should the source go? What happens to them during the different lifecycle... | Managing a project with non-Java code using Maven is certainly possible and can be quite effective, especially if you're already familiar with Maven's structure and lifecycle. Here are some best practices and guidelines to help you integrate non-Java code, such as shell and SQL scripts, into your Maven project:
### 1.... | 15,456 | [
{
"from": "human",
"value": "I'm starting on a project that I expect will include a substantial amount of non-Java code (mostly shell and SQL scripts).\nI would still like to manage this project with Maven. What are the best practices wrt non-Java source code and Maven? Where should the source go? What happ... |
Null or empty string -- is one better than the other to represent no data in a table column? (I specifically use MySQL, but I'm thinking this is system-independent.) Are there major advantages/disadvantages to using one over the other, or is it simply programmer preference?
| The choice between using `NULL` and an empty string (`''`) to represent "no data" in a database column is an important one and can have significant implications depending on your use case. Here’s a breakdown of the advantages and disadvantages of each approach:
### NULL
#### Advantages:
1. **Semantic Meaning**: `NULL`... | 17,609 | [
{
"from": "human",
"value": "Null or empty string -- is one better than the other to represent no data in a table column? (I specifically use MySQL, but I'm thinking this is system-independent.) Are there major advantages/disadvantages to using one over the other, or is it simply programmer preference?\n"
... |
I am having a very hard time finding a standard pattern / best practice that deals with rendering child controls inside a composite based on a property value.
Here is a basic scenario. I have a Composite Control that has two child controls, a textbox and a dropdown. Lets say there is a property that toggles which child... | When dealing with a composite control in ASP.NET that conditionally renders child controls based on a property value, you can follow a pattern that ensures the property value is maintained across postbacks while allowing the appropriate child control to be displayed. Below is a simplified example to demonstrate this ap... | 16,145 | [
{
"from": "human",
"value": "I am having a very hard time finding a standard pattern / best practice that deals with rendering child controls inside a composite based on a property value.\nHere is a basic scenario. I have a Composite Control that has two child controls, a textbox and a dropdown. Lets say th... |
I have a RDK-IDM from Luminary Micro. This board has a 32-bit ARM® Cortex™-M3 core. Has anybody tried to run a .NET Micro Framework application on such a device?
| The RDK-IDM from Luminary Micro, based on the ARM Cortex-M3 core, is indeed capable of running the .NET Micro Framework (NETMF). The .NET Micro Framework is designed for resource-constrained devices, making it a good fit for embedded systems like the one you have.
To get started with running a .NET Micro Framework ap... | 20,150 | [
{
"from": "human",
"value": "I have a RDK-IDM from Luminary Micro. This board has a 32-bit ARM® Cortex™-M3 core. Has anybody tried to run a .NET Micro Framework application on such a device?\n"
},
{
"from": "gpt",
"value": "The RDK-IDM from Luminary Micro, based on the ARM Cortex-M3 core, is ind... |
I tried "x = y ** e", but that didn't work.
| The expression `x = y ** e` is generally valid in Python if `y` is a number (int or float) and `e` is another number, which indicates the exponent to which `y` is raised. If you encountered an issue, it might be due to one of the following reasons:
1. **Undefined Variables**: Ensure that both `y` and `e` have been def... | 20,966 | [
{
"from": "human",
"value": "I tried \"x = y ** e\", but that didn't work.\n"
},
{
"from": "gpt",
"value": "The expression `x = y ** e` is generally valid in Python if `y` is a number (int or float) and `e` is another number, which indicates the exponent to which `y` is raised. If you encountere... |
With SQLServer, it seems to be generally accepted that adding a SELECT SCOPE_IDENTITY() to the end of your insert is the best way to return the PK of the newly-inserted record, assuming you're using an auto-increment field for the pk.
However, I can't seem to find the equivalent for Oracle.
Best practice seems to be ... | In Oracle, there are indeed best practices for handling the retrieval of the primary key (PK) after an insert operation, especially when using sequences. The approach you choose can depend on various factors, such as your specific use case, performance considerations, and how much control you want over the insertion pr... | 13,994 | [
{
"from": "human",
"value": "With SQLServer, it seems to be generally accepted that adding a SELECT SCOPE_IDENTITY() to the end of your insert is the best way to return the PK of the newly-inserted record, assuming you're using an auto-increment field for the pk. \nHowever, I can't seem to find the equivale... |
I'm trying to write a Windows cmd script to perform several tasks in series.
However, it always stops after the first command in the script.
The command it stops after is a maven build (not sure if that's relevant).
How do I make it carry on and run each task in turn please?
Installing any software or configuring the r... | To create a Windows CMD script that continues executing subsequent commands after a command is run (like a Maven build), you can use the `CALL` command. This allows you to run a batch file or command and then return to the calling batch file without stopping execution.
By default, if a command fails in a batch file (r... | 20,925 | [
{
"from": "human",
"value": "I'm trying to write a Windows cmd script to perform several tasks in series.\nHowever, it always stops after the first command in the script.\nThe command it stops after is a maven build (not sure if that's relevant).\nHow do I make it carry on and run each task in turn please?\... |
A client wants me to do some maintenance work to a VB 6.0 application (migration to .NET is also in the pipeline), but he doesn't have the development tools because he received just the source code and running application from the original programmer, who is no longer available.
Microsoft doesn't sell Visual Studio 6.0... | If you need to maintain and modify a Visual Basic 6.0 application, you have a few options to consider, especially since Visual Studio 6.0 is no longer sold by Microsoft:
1. **Acquisition of Visual Basic 6.0**:
- You might need to look for a legitimate second-hand copy of Visual Basic 6.0. This can sometimes be fou... | 19,582 | [
{
"from": "human",
"value": "A client wants me to do some maintenance work to a VB 6.0 application (migration to .NET is also in the pipeline), but he doesn't have the development tools because he received just the source code and running application from the original programmer, who is no longer available.... |
In particular from this web.config:
<configuration>
<configSections>
<section name="RStrace" type="Microsoft.ReportingServices.Diagnostics.RSTraceSectionHandler,Microsoft.ReportingServices.Diagnostics" />
</configSections>
<system.diagnostics>
<switches>
<add name="DefaultTraceSwitch" value="3" />
... | The provided `web.config` snippet is a configuration file used in ASP.NET applications, particularly for applications related to Microsoft SQL Server Reporting Services (SSRS). Below is an explanation of the main sections and settings in the configuration file:
### Configuration Sections
1. **configSections**:
- T... | 20,751 | [
{
"from": "human",
"value": "In particular from this web.config:\n<configuration>\n <configSections>\n <section name=\"RStrace\" type=\"Microsoft.ReportingServices.Diagnostics.RSTraceSectionHandler,Microsoft.ReportingServices.Diagnostics\" />\n </configSections>\n <system.diagnostics>\n <switches>\... |
Can anyone recommend a cheap and good RTF control for .Net 1.1 Windows development. It needs to be able to do print/preview and some basic text formatting, fonts etc but nothing too advanced.
Cheers
Andreas
| For .NET 1.1 Windows development, finding a cheap and effective RTF control can be a bit challenging due to the age of the technology. However, here are a few options you can consider:
1. **RichTextBox Control (Built-in)**:
- The simplest option is to use the built-in `RichTextBox` control available in Windows Form... | 11,610 | [
{
"from": "human",
"value": "Can anyone recommend a cheap and good RTF control for .Net 1.1 Windows development. It needs to be able to do print/preview and some basic text formatting, fonts etc but nothing too advanced.\nCheers\nAndreas\n"
},
{
"from": "gpt",
"value": "For .NET 1.1 Windows deve... |
I start a .Net server side program on my local workstation, but soon it throws a security exception. I searched the web for answers, but no quick fix was found / worked. I just want to run my program. How do I get rid of the exception? I fully trust the program, because its mine.
Edit: Oh, yes, I do run the program fro... | It sounds like you're encountering a security exception due to running your .NET program from a mapped network drive. This is a common issue because .NET has security restrictions that apply to applications running from network shares. Here are a few options to resolve this:
1. **Run from Local Drive**: As you've alre... | 20,762 | [
{
"from": "human",
"value": "I start a .Net server side program on my local workstation, but soon it throws a security exception. I searched the web for answers, but no quick fix was found / worked. I just want to run my program. How do I get rid of the exception? I fully trust the program, because its mine... |
i am working on a simple web app which has a user model and role model (among others), and an admin section that contains many controllers. i would like to use a before_filter to check that the user of the user in the session has a 'can_access_admin' flag.
i have this code in the application.rb:
def check_role
@user ... | It seems like the issue you're encountering is due to the fact that the `@user` object in your `check_role` method is not an instance of your User model, which has the `role` association. Instead, it is being retrieved directly from the session, and it's likely just a simple hash or an object that does not have the met... | 20,286 | [
{
"from": "human",
"value": "i am working on a simple web app which has a user model and role model (among others), and an admin section that contains many controllers. i would like to use a before_filter to check that the user of the user in the session has a 'can_access_admin' flag.\ni have this code in t... |
Which algorithm does the JavaScript Array#sort() function use? I understand that it can take all manner of arguments and functions to perform different kinds of sorts, I'm simply interested in which algorithm the vanilla sort uses.
| In modern JavaScript engines, the `Array.prototype.sort()` function typically uses an algorithm called **Timsort**. Timsort is a hybrid sorting algorithm derived from merge sort and insertion sort, designed to perform well on many kinds of real-world data. It was originally implemented in Python and has since been adop... | 23,935 | [
{
"from": "human",
"value": "Which algorithm does the JavaScript Array#sort() function use? I understand that it can take all manner of arguments and functions to perform different kinds of sorts, I'm simply interested in which algorithm the vanilla sort uses.\n"
},
{
"from": "gpt",
"value": "I... |
I have a Console application hosting a WCF service. I would like to be able to fire an event from a method in the WCF service and handle the event in the hosting process of the WCF service. Is this possible? How would I do this? Could I derive a custom class from ServiceHost?
| Yes, you can fire an event from a method in your WCF service and handle that event in the hosting application. While deriving from `ServiceHost` is one approach, you can achieve this functionality more straightforwardly by using delegates and events in your WCF service class.
Here’s a step-by-step guide on how you can... | 15,475 | [
{
"from": "human",
"value": "I have a Console application hosting a WCF service. I would like to be able to fire an event from a method in the WCF service and handle the event in the hosting process of the WCF service. Is this possible? How would I do this? Could I derive a custom class from ServiceHost... |
I downloaded Hex Workshop, and I was told to read a .dbc file.
It should contain 28,315 if you read
offset 0x04 and 0x05
I am unsure how to do this? What does 0x04 mean?
| The term "offset" refers to a specific location in a file where data is stored. In your case, `0x04` and `0x05` are hexadecimal (base 16) addresses that indicate where to find the relevant data in your `.dbc` file.
Here’s a quick breakdown of the offsets you mentioned:
- `0x04` refers to the 5th byte in the file (sin... | 17,492 | [
{
"from": "human",
"value": "I downloaded Hex Workshop, and I was told to read a .dbc file.\n\nIt should contain 28,315 if you read\n offset 0x04 and 0x05\n\nI am unsure how to do this? What does 0x04 mean?\n"
},
{
"from": "gpt",
"value": "The term \"offset\" refers to a specific location in a ... |
I have a tree representation of pages in a CMS application. I understand how to persist the tree in the database. However, I don't have a good way to:
A) Reorder subpages under a particular parent page.
B) Provide a UI implementation that allows the user to change the order.
Any suggestions?
| Reordering subpages in a tree representation of pages in a Content Management System (CMS) requires both an effective backend logic to persist the changes in order and a user-friendly front-end interface for the users to change the order. Here are some suggestions for both aspects:
### A) Backend Logic for Reordering
... | 14,412 | [
{
"from": "human",
"value": "I have a tree representation of pages in a CMS application. I understand how to persist the tree in the database. However, I don't have a good way to:\nA) Reorder subpages under a particular parent page.\nB) Provide a UI implementation that allows the user to change the order.\n... |
Do moderate or large projects ever not require an architect? I have worked on a number of projects where the development company involved has choosen not to assign an application architect. Either the software is built organically and with little concern for design or the design responsibility falls to senior developer... | The necessity of an architect for moderate or large software projects can vary significantly based on several factors, including the project's complexity, team structure, development methodology, and organizational philosophy. Here are some considerations regarding projects that may not require a dedicated architect:
... | 20,265 | [
{
"from": "human",
"value": "Do moderate or large projects ever not require an architect? I have worked on a number of projects where the development company involved has choosen not to assign an application architect. Either the software is built organically and with little concern for design or the design... |
Using JDK1.5 how does one send a binary attachemnt (such as a PDF file) easily using the JavaMail API?
| To send a binary attachment like a PDF file using the JavaMail API in JDK 1.5, you can follow these steps. The JavaMail API allows you to compose emails and send them through an SMTP server, including the ability to attach files.
Here’s a simple example of how you can do this:
1. Make sure you have the JavaMail API l... | 15,990 | [
{
"from": "human",
"value": "Using JDK1.5 how does one send a binary attachemnt (such as a PDF file) easily using the JavaMail API?\n"
},
{
"from": "gpt",
"value": "To send a binary attachment like a PDF file using the JavaMail API in JDK 1.5, you can follow these steps. The JavaMail API allows ... |
I'm creating a .net custom control and it should be able to load multiple text files. I have a public property named ListFiles with those properties set :
[Browsable(true), Category("Configuration"), Description("List of Files to Load")]
public string ListFiles
{
get { return m_oList; }
set { m_oList = va... | To implement a custom property in a .NET control that utilizes an `OpenFileDialog` for file selection within the Property Grid, you can create a custom type editor. Here's a step-by-step guide on how to achieve this.
1. **Create a custom type for the ListFiles property:**
Define a custom type for your property. Thi... | 14,421 | [
{
"from": "human",
"value": "I'm creating a .net custom control and it should be able to load multiple text files. I have a public property named ListFiles with those properties set : \n\n[Browsable(true), Category(\"Configuration\"), Description(\"List of Files to Load\")]\npublic string ListFiles\n {\n ... |
By default Attachment Fu stores uploaded files in "public/#{table_name}". I want to modify this to be something like "public/#{table_name}/#{site_id}", where site_id is a property of the model. Note that I've tried using self.site_id and both fail.
has_attachment :storage => :file_system,
:max_size => 2... | Yes, the issue you're facing is that the `has_attachment` method is evaluated when the class is loaded, which is before any instances of the class are created or the `initialize` method is called. At that point, the `site_id` instance variable does not exist yet, which is why you get the "undefined local variable or me... | 20,679 | [
{
"from": "human",
"value": "By default Attachment Fu stores uploaded files in \"public/#{table_name}\". I want to modify this to be something like \"public/#{table_name}/#{site_id}\", where site_id is a property of the model. Note that I've tried using self.site_id and both fail.\nhas_attachment :storage =... |
I have the following code:
import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;
public class ScratchPad {
public static void main(String args[]) throws Exception {
String html ="<html>"+
"<head>"+
"<meta http-equiv=\"Content-Ty... | The issue you're experiencing arises from how the `JEditorPane` handles character encoding specified in the HTML content. When you include a `charset` specification in the `<meta>` tag, `JEditorPane` expects the HTML content to actually be in that encoding. If the string you provide is in a different encoding (like UTF... | 18,097 | [
{
"from": "human",
"value": "I have the following code:\nimport javax.swing.JEditorPane;\nimport javax.swing.JFrame;\nimport javax.swing.JScrollPane;\nimport javax.swing.ScrollPaneConstants;\n\n\npublic class ScratchPad {\n\n public static void main(String args[]) throws Exception {\n String html ... |
A little while ago I managed to get Visual Studio 2008 (C++) into a state where, if I would select a keyword (or any symbol for that matter), by either double clicking on it or highlighting it, all other instances of that symbol within the current file would become highlighted too.
This was a really useful feature.
Sin... | It sounds like you're referring to the "highlight references" feature in Visual Studio. This feature allows you to see all instances of a selected keyword or symbol highlighted in the current file. If it has stopped working, you can try the following steps to restore it:
1. **Check the Options**:
- Go to `Tools` ->... | 22,448 | [
{
"from": "human",
"value": "A little while ago I managed to get Visual Studio 2008 (C++) into a state where, if I would select a keyword (or any symbol for that matter), by either double clicking on it or highlighting it, all other instances of that symbol within the current file would become highlighted t... |
Say for example you just queried a database and you recieved this 2D array.
$results = array(
array('id' => 1, 'name' => 'red' , 'spin' => 1),
array('id' => 2, 'name' => 'green', 'spin' => -1),
array('id' => 3, 'name' => 'blue' , 'spin' => .5)
);
I often find myself writing loops like this.
foreach($resu... | Yes, you can achieve this using built-in functions in PHP that can manipulate arrays without explicitly writing loops in your code. For example, you can use the `array_column` function to extract a single column from a multi-dimensional array.
To get the `$names` array from your `$results` array without using a loop,... | 21,940 | [
{
"from": "human",
"value": "Say for example you just queried a database and you recieved this 2D array.\n$results = array(\n array('id' => 1, 'name' => 'red' , 'spin' => 1),\n array('id' => 2, 'name' => 'green', 'spin' => -1),\n array('id' => 3, 'name' => 'blue' , 'spin' => .5)\n);\n\nI often fi... |
We all know that RAW pointers need to be wrapped in some form of smart pointer to get Exception safe memory management. But when it comes to containers of pointers the issue becomes more thorny.
The std containers insist on the contained object being copyable so this rules out the use of std::auto_ptr, though you can s... | Choosing between using a Boost Pointer Container (like `boost::ptr_vector`) and a `std::vector` of smart pointers (like `std::shared_ptr`) depends on several factors, including ownership semantics, performance, and the specific use case in your application. Here are some considerations to help you decide which option t... | 9,794 | [
{
"from": "human",
"value": "We all know that RAW pointers need to be wrapped in some form of smart pointer to get Exception safe memory management. But when it comes to containers of pointers the issue becomes more thorny.\nThe std containers insist on the contained object being copyable so this rules out ... |
I'm familiar with the LAMP stack and over the years have successfully deployed a handful of web sties based on it. I've used everything from Apache + modPerl, to PHP, to Ruby and Rails. With good use of caching my Rails site can sustain a pretty good load, but I'm not talking massive.
I never really liked Java as a lan... | It's great that you're seeking to understand the differences between Java EE and LAMP (Linux, Apache, MySQL, PHP) stacks in a nuanced way. There are indeed strengths and weaknesses in both ecosystems, and concrete comparisons can help you make an informed decision about what might be the best fit for your specific need... | 17,358 | [
{
"from": "human",
"value": "I'm familiar with the LAMP stack and over the years have successfully deployed a handful of web sties based on it. I've used everything from Apache + modPerl, to PHP, to Ruby and Rails. With good use of caching my Rails site can sustain a pretty good load, but I'm not talking ma... |
I've been using tags in my projects. I was browsing the custom tags on grails.org to find some new tags for my library.
http://www.grails.org/Contribute+a+Tag
I was wondering if people in the StackOverflow community have a favorite custom tag that they would like to share.
| While I can’t browse the internet for the latest tags on grails.org, I can certainly provide some popular custom tags that are often appreciated in the Grails community. Here are a few that you might find useful:
1. **Form Tags**: These are often used to simplify the creation of forms, handling the binding of form fie... | 21,191 | [
{
"from": "human",
"value": "I've been using tags in my projects. I was browsing the custom tags on grails.org to find some new tags for my library.\nhttp://www.grails.org/Contribute+a+Tag\nI was wondering if people in the StackOverflow community have a favorite custom tag that they would like to share.\n"... |
So I build an array of various dates. Birthdays, anniversaries, and holidays. I'd like to order the array by which one is happening next, essentially sort October to September (wrapping to next year)
so if my array is
$a = ([0]=>"1980-04-14", [1]=>"2007-06-08",
[2]=>"2008-12-25", [3]=>"1978-11-03")
I'd like to sor... | To sort your array of dates in the desired order (from the current month, wrapping around to the next year), you'll need to adjust your comparison function to consider both the month and the day, as well as the current month and day. This way, you can determine which date is "next" based on today's date.
Here’s an imp... | 17,610 | [
{
"from": "human",
"value": "So I build an array of various dates. Birthdays, anniversaries, and holidays. I'd like to order the array by which one is happening next, essentially sort October to September (wrapping to next year)\nso if my array is \n$a = ([0]=>\"1980-04-14\", [1]=>\"2007-06-08\", \n [2]=>\... |
Microsoft recently announced that the Javascript/HTML DOM library jQuery will be integrated into the ASP.NET MVC framework and into ASP.NET / Visual Studio.
What is the best practice or strategy adopting jQuery using ASP.NET 2.0? I'd like to prepare a large, existing ASP.NET Web Application (not MVC) for jQuery. How wo... | Integrating jQuery into an existing ASP.NET Web Application (not MVC) can enhance interactivity and improve the user experience. Here are some best practices and strategies to adopt jQuery in your ASP.NET 2.0 application while dealing with versioning and related issues:
### 1. **Plan Your Integration**
- **Identify... | 16,002 | [
{
"from": "human",
"value": "Microsoft recently announced that the Javascript/HTML DOM library jQuery will be integrated into the ASP.NET MVC framework and into ASP.NET / Visual Studio.\nWhat is the best practice or strategy adopting jQuery using ASP.NET 2.0? I'd like to prepare a large, existing ASP.NET We... |
I have an versioned document store which I want to access through an dict like interface.
Common usage is to access the latest revision (get, set, del), but one should be able to access specific revisions too (keys are always str/unicode or int).
from UserDict import DictMixin
class VDict(DictMixin):
def __getit... | Your current approach of using a dictionary-like interface with support for both the latest revision and specific revisions is an interesting design choice. It allows for flexible access patterns while still conforming to the familiar `dict` interface. Here are some considerations for both the current design and the pr... | 14,787 | [
{
"from": "human",
"value": "I have an versioned document store which I want to access through an dict like interface.\nCommon usage is to access the latest revision (get, set, del), but one should be able to access specific revisions too (keys are always str/unicode or int).\nfrom UserDict import DictMixin... |
I have a fairly good feel for what MySQL replication can do. I'm wondering what other databases support replication, and how they compare to MySQL and others?
Some questions I would have are:
Is replication built in, or an add-on/plugin?
How does the replication work (high-level)? MySQL provides statement-based repl... | Replication is a critical aspect of modern database systems, and many databases offer various replication mechanisms with distinct characteristics. Here's an overview of some popular databases and how they compare with MySQL regarding replication:
### 1. PostgreSQL
- **Built-In vs. Add-on:** Replication is built-in.
-... | 15,556 | [
{
"from": "human",
"value": "I have a fairly good feel for what MySQL replication can do. I'm wondering what other databases support replication, and how they compare to MySQL and others?\nSome questions I would have are:\n\nIs replication built in, or an add-on/plugin?\nHow does the replication work (high... |
Have a n-tire web application and search often times out after 30 secs. How to detect the root cause of the problem?
| Identifying the root cause of a search timing out in a n-tier web application can be challenging, but there are several systematic steps you can take to diagnose and resolve the issue. Here’s a structured approach to help you detect the root cause:
### 1. **Check Application Logs:**
- **Look for Errors:** Review se... | 17,106 | [
{
"from": "human",
"value": "Have a n-tire web application and search often times out after 30 secs. How to detect the root cause of the problem?\n"
},
{
"from": "gpt",
"value": "Identifying the root cause of a search timing out in a n-tier web application can be challenging, but there are seve... |
I have a Tapestry application that is serving its page as UTF-8. That is, server responses have header:
Content-type: text/html;charset=UTF-8
Now within this application there is a single page that should be served with ISO-8859-1 encoding. That is, server response should have this header:
Content-type: text/html;char... | In Tapestry 4, setting a specific encoding for an individual page can be a bit tricky since the default behavior is to use a single encoding for the entire application. Since you've already discovered a workaround using a servlet filter and a response wrapper, that is a valid approach.
However, if you're looking for a... | 17,031 | [
{
"from": "human",
"value": "I have a Tapestry application that is serving its page as UTF-8. That is, server responses have header:\nContent-type: text/html;charset=UTF-8\n\nNow within this application there is a single page that should be served with ISO-8859-1 encoding. That is, server response should ha... |
How do I test the concrete methods of an abstract class with PHPUnit?
I'd expect that I'd have to create some sort of object as part of the test. Though, I've no idea the best practice for this or if PHPUnit allows for this.
| Testing concrete methods of an abstract class in PHP using PHPUnit can be accomplished by creating a concrete subclass that implements the abstract methods. This allows you to instantiate the subclass and test the concrete methods of the abstract class. Here's how you can do it step-by-step:
### Step 1: Define the Abs... | 17,448 | [
{
"from": "human",
"value": "How do I test the concrete methods of an abstract class with PHPUnit?\nI'd expect that I'd have to create some sort of object as part of the test. Though, I've no idea the best practice for this or if PHPUnit allows for this.\n"
},
{
"from": "gpt",
"value": "Testing ... |
I'm doing some research on the feasibility of an iPhone application, and can't find any indication in Apple's documentation that an iPhone app can read the call history of the phone, specifically the number/address book entry called, when, and the duration.
Does anyone know if this is possible, and how?
Note: The purpo... | As of my last knowledge update in October 2023, iOS does not provide any public APIs that allow third-party applications to access call history data, including details such as the number called, address book entries, when the call occurred, and the duration of the calls. This is primarily due to privacy and security co... | 21,035 | [
{
"from": "human",
"value": "I'm doing some research on the feasibility of an iPhone application, and can't find any indication in Apple's documentation that an iPhone app can read the call history of the phone, specifically the number/address book entry called, when, and the duration.\nDoes anyone know if ... |
What I'm trying to do with FileStream in C#/.NET is to open two streams: one appending to a file and the other reading those writes asynchronously (for unit testing some network connection handling code). I can't figure out how to get the writer stream to open the file in non-exlusive locking mode and thus the code al... | To create a setup where one `FileStream` can write to a file while another can read from it simultaneously, you need to ensure that the `FileStream` for the writer allows shared access for reading. Additionally, when you open the reader stream, you must set it to share with write access.
Here’s how you can achieve thi... | 17,639 | [
{
"from": "human",
"value": "What I'm trying to do with FileStream in C#/.NET is to open two streams: one appending to a file and the other reading those writes asynchronously (for unit testing some network connection handling code). I can't figure out how to get the writer stream to open the file in non-e... |
I have the situation where i use GIS software which stores the information about GIS objects into separate database table for each type/class of GIS object (road, river, building, sea, ...) and keeps the metadata table in which it stores info about the class name and its DB table.
Those GIS objects of different classes... | Yes, you can indeed handle this situation using NHibernate, although it may require some customization, especially since you have multiple database tables for different GIS classes and want to create a common C# class (`GisObject`) to represent them.
To achieve this, you can follow these steps:
### Step 1: Define the... | 13,081 | [
{
"from": "human",
"value": "I have the situation where i use GIS software which stores the information about GIS objects into separate database table for each type/class of GIS object (road, river, building, sea, ...) and keeps the metadata table in which it stores info about the class name and its DB tabl... |
Now that shared_ptr is in tr1, what do you think should happen to the use of std::auto_ptr? They both have different use cases, but all use cases of auto_ptr can be solved with shared_ptr, too. Will you abandon auto_ptr or continue to use it in cases where you want to express explicitly that only one class has ownershi... | Your observations regarding `std::auto_ptr` and `std::shared_ptr` reflect a significant transition in C++ regarding resource management. The introduction of smart pointers in the C++11 standard, including `std::unique_ptr` (which replaced `std::auto_ptr`) and `std::shared_ptr`, addressed many of the shortcomings of ear... | 19,213 | [
{
"from": "human",
"value": "Now that shared_ptr is in tr1, what do you think should happen to the use of std::auto_ptr? They both have different use cases, but all use cases of auto_ptr can be solved with shared_ptr, too. Will you abandon auto_ptr or continue to use it in cases where you want to express ex... |
Is it possible to programmatically, or otherwise, increase the width of the Windows console window? Or do I need to create a wrapper program that looks and acts like the console somehow? Are there any programs around that do this already? I use Cygwin extensively in my development, and it seems a little ridiculous to m... | In Windows XP, the console window does have some limitations when it comes to resizing, but there are ways to programmatically increase the width of a console window. Here are a few approaches you can consider:
### 1. Using `SetConsoleScreenBufferSize`
You can use the `SetConsoleScreenBufferSize` function from the Win... | 17,598 | [
{
"from": "human",
"value": "Is it possible to programmatically, or otherwise, increase the width of the Windows console window? Or do I need to create a wrapper program that looks and acts like the console somehow? Are there any programs around that do this already? I use Cygwin extensively in my developme... |
I really enjoy having "pretty" URLs (e.g. /Products/Edit/1 instead of /products.aspx?productID=1) but I'm at a loss on how to do this for pages that let you search by a large number of variables.
For instance, let's say you have a page that lets a user search for all products of a particular type with a certain name an... | When it comes to designing URLs for search functionalities, there are a few considerations to keep in mind, especially when dealing with multiple parameters. Both approaches you mentioned have their pros and cons:
### Pretty URLs
**Pros:**
1. **Readability**: They are more human-readable and often look cleaner, which... | 19,609 | [
{
"from": "human",
"value": "I really enjoy having \"pretty\" URLs (e.g. /Products/Edit/1 instead of /products.aspx?productID=1) but I'm at a loss on how to do this for pages that let you search by a large number of variables.\nFor instance, let's say you have a page that lets a user search for all products... |
I have valid HBITMAP handle of ARGB type. How to draw it using GDI+?
I've tried method:
graphics.DrawImage(Bitmap::FromHBITMAP(m_hBitmap, NULL), 0, 0);
But it doesn't use alpha channel.
| To draw an `HBITMAP` that has an alpha channel using GDI+, you need to ensure that GDI+ correctly interprets the alpha information in your bitmap. Unfortunately, directly using `Bitmap::FromHBITMAP` does not preserve the alpha channel. Instead, you'll need to use a different approach to create a GDI+ bitmap that mainta... | 16,148 | [
{
"from": "human",
"value": "I have valid HBITMAP handle of ARGB type. How to draw it using GDI+?\nI've tried method:\ngraphics.DrawImage(Bitmap::FromHBITMAP(m_hBitmap, NULL), 0, 0);\n\nBut it doesn't use alpha channel.\n"
},
{
"from": "gpt",
"value": "To draw an `HBITMAP` that has an alpha chan... |
I have a string in Bash:
string="My string"
How can I test if it contains another string?
if [ $string ?? 'foo' ]; then
echo "It's there!"
fi
Where ?? is my unknown operator. Do I use echo and grep?
if echo "$string" | grep 'foo'; then
echo "It's there!"
fi
That looks a bit clumsy.
| You can simplify the check for whether a string contains a substring in Bash using the `[[` conditional expression with the `*` wildcard. This is often cleaner and avoids the need for using `echo` and `grep`. Here's how you can do it:
```bash
string="My string"
if [[ $string == *'foo'* ]]; then
echo "It's there!"
e... | 23,210 | [
{
"from": "human",
"value": "I have a string in Bash:\nstring=\"My string\"\n\nHow can I test if it contains another string?\nif [ $string ?? 'foo' ]; then\n echo \"It's there!\"\nfi\n\nWhere ?? is my unknown operator. Do I use echo and grep?\nif echo \"$string\" | grep 'foo'; then\n echo \"It's there!\"\... |
In a script, when a command-let or other executable statement errors out, is there a try/catch type of mechanism to recover from these errors? I haven't run across one in the documentation.
| Yes, in PowerShell, you can use a `try/catch` block to handle errors that occur during the execution of commandlets or other executable statements. This provides a way to recover from errors and manage exceptions effectively. Here's how you can use it:
### Example of `try/catch` in PowerShell
```powershell
try {
... | 19,020 | [
{
"from": "human",
"value": "In a script, when a command-let or other executable statement errors out, is there a try/catch type of mechanism to recover from these errors? I haven't run across one in the documentation.\n"
},
{
"from": "gpt",
"value": "Yes, in PowerShell, you can use a `try/catch... |
Our team has a task system where we post small incremental tasks assigned to each developer.
Each task is developed in its own branch, and then each branch is tested before being merged to the trunk.
My question is: Once the task is done, who should define the test cases that should be done on this task?
Ideally I th... | Your situation is quite common in software development teams, and finding the right balance between developer responsibility and QA oversight can be challenging. Here are some suggestions to address the issue of who should define test cases and how to improve the process:
1. **Collaborative Approach**: Encourage a col... | 18,550 | [
{
"from": "human",
"value": "Our team has a task system where we post small incremental tasks assigned to each developer. \nEach task is developed in its own branch, and then each branch is tested before being merged to the trunk.\nMy question is: Once the task is done, who should define the test cases that... |
Is there anyway to have items in an ASP.NET DropDownList have either their Text or Value bound to a method on the source rather than a property?
| In ASP.NET Web Forms, the `DropDownList` control's items are typically bound to a data source that exposes properties for `Text` and `Value` (for example, a list of objects). However, if you want to bind either the `Text` or `Value` of the items to a method rather than a property, there are no built-in features that al... | 19,402 | [
{
"from": "human",
"value": "Is there anyway to have items in an ASP.NET DropDownList have either their Text or Value bound to a method on the source rather than a property? \n"
},
{
"from": "gpt",
"value": "In ASP.NET Web Forms, the `DropDownList` control's items are typically bound to a data s... |
I was talking to somebody a recently who mentioned it was possible to store reports created using Crystal Reports as XML files.
Upon Googling this, I can't find anything suggesting that this is the case (using data stored in XML in a report, yes, but actually storing the report, the part stored by default as a .rpt fil... | You are correct in your understanding. Crystal Reports primarily saves reports in its proprietary file format, which is the `.rpt` file extension. While it is possible to use XML as a data source for reports, and you can export report data to XML format, Crystal Reports does not natively support saving the entire repor... | 24,112 | [
{
"from": "human",
"value": "I was talking to somebody a recently who mentioned it was possible to store reports created using Crystal Reports as XML files.\nUpon Googling this, I can't find anything suggesting that this is the case (using data stored in XML in a report, yes, but actually storing the report... |
In Apple's iPhone apps (like Contacts), they have a nice magnifying glass icon at the top of the table view index. Since the table view index API is character-based, I assume that this magnifying glass is a Unicode character. So far I've resorted to placing a question mark character there, but that looks lame.
Can anyo... | The magnifying glass icon that you see in Apple's iPhone apps is likely the Unicode character for a magnifying glass, which is represented by the Unicode code point U+1F50D. This character can be represented in many programming languages and frameworks using its Unicode escape sequence.
In Swift, for example, you coul... | 24,352 | [
{
"from": "human",
"value": "In Apple's iPhone apps (like Contacts), they have a nice magnifying glass icon at the top of the table view index. Since the table view index API is character-based, I assume that this magnifying glass is a Unicode character. So far I've resorted to placing a question mark chara... |
I have a list of objects, each containing an Id, Code and Description.
I need to convert this list into a Hashtable, using Description as the key and Id as the value.
This is so the Hashtable can then be serialised to JSON.
Is there a way to convert from List<Object> to Hashtable without writing a loop to go through ea... | Yes, you can achieve the conversion from a `List<Object>` to a `Hashtable` using LINQ in C#. While you would technically still be iterating over the elements, using LINQ allows you to do this in a more concise way without explicitly writing a loop. Here’s how you can do it:
Assuming you have a class defined like this:... | 19,170 | [
{
"from": "human",
"value": "I have a list of objects, each containing an Id, Code and Description.\nI need to convert this list into a Hashtable, using Description as the key and Id as the value.\nThis is so the Hashtable can then be serialised to JSON.\nIs there a way to convert from List<Object> to Hasht... |
We're running a Rails site at http://hansard.millbanksystems.com, on a dedicated Accelerator. We currently have Apache setup with mod-proxy-balancer, proxying to four mongrels running the application.
Some requests are rather slow and in order to prevent the situation where other requests get queued up behind them, we'... | Your current setup with Apache and Mongrel is functional, but as you noted, it may lead to slow requests blocking others due to the single-threaded nature of Mongrel. Here are some considerations regarding the options you mentioned, along with additional suggestions:
### Options You've Considered
1. **Recompiling mod... | 19,503 | [
{
"from": "human",
"value": "We're running a Rails site at http://hansard.millbanksystems.com, on a dedicated Accelerator. We currently have Apache setup with mod-proxy-balancer, proxying to four mongrels running the application.\nSome requests are rather slow and in order to prevent the situation where oth... |
How do you convert a numerical number to an Excel column name in C# without using automation getting the value directly from Excel.
Excel 2007 has a possible range of 1 to 16384, which is the number of columns that it supports. The resulting values should be in the form of excel column names, e.g. A, AA, AAA etc.
| To convert a numerical column index to an Excel column name in C#, you can use a simple algorithm that repeatedly divides the index by 26 and adjusts for the fact that Excel column naming starts from 1 (A) rather than 0. Here’s how you can implement this:
```csharp
using System;
class Program
{
static void Main()... | 19,789 | [
{
"from": "human",
"value": "How do you convert a numerical number to an Excel column name in C# without using automation getting the value directly from Excel.\nExcel 2007 has a possible range of 1 to 16384, which is the number of columns that it supports. The resulting values should be in the form of exce... |
I have a very large (~6GB) SVN repository, for which I've written a batch file script to do an incremental backup each day. The script checks when the last backup was run and dumps only the revisions since then.
The files are named: backup-{lower_revision}-{higher_revision}.svn eg: backup-156-162.svn, backup-163-170.sv... | Restoring from multiple incremental dump files in SVN can be tedious, but there are several approaches you can take to simplify the process. Here are some options to consider:
### 1. **Batch File Automation**
Creating a batch file to automate the restore process is a practical approach. You can loop through the dump f... | 17,550 | [
{
"from": "human",
"value": "I have a very large (~6GB) SVN repository, for which I've written a batch file script to do an incremental backup each day. The script checks when the last backup was run and dumps only the revisions since then.\nThe files are named: backup-{lower_revision}-{higher_revision}.svn... |
Basically I have the following class:
class StateMachine {
...
StateMethod stateA();
StateMethod stateB();
...
};
The methods stateA() and stateB() should be able return pointers to stateA() and stateB().
How to typedef the StateMethod?
| To achieve this, you can define a typedef for `StateMethod` as a pointer to a member function of the `StateMachine` class. Assuming that `StateMethod` is a member function that returns a pointer to `StateMethod`, you can define it as follows:
First, let's specify the return type and parameters of the `StateMethod`. If... | 22,247 | [
{
"from": "human",
"value": "Basically I have the following class:\nclass StateMachine {\n...\nStateMethod stateA();\nStateMethod stateB();\n...\n};\n\nThe methods stateA() and stateB() should be able return pointers to stateA() and stateB().\nHow to typedef the StateMethod?\n"
},
{
"from": "gpt",
... |
I am working on a project that has grown to a decent size, and I am the only developer. We currently don't use any version control, but I definitely need to start.
I want to use Subversion. What would be the best way to transfer an existing project to it?
I have a test server that I use for developing new features, th... | Transitioning your project to version control with Subversion (SVN) is a great step to improve your development workflow. Below are the steps to transfer your existing project to Subversion and automate the deployment process to your test and production servers.
### Step 1: Install Subversion
1. Install Subversion on ... | 18,305 | [
{
"from": "human",
"value": "I am working on a project that has grown to a decent size, and I am the only developer. We currently don't use any version control, but I definitely need to start.\nI want to use Subversion. What would be the best way to transfer an existing project to it?\nI have a test server... |
Coming from C++ to Java, the obvious unanswered question is why didn't Java include operator overloading?
Isn't Complex a, b, c; a = b + c; much simpler than Complex a, b, c; a = b.add(c);?
Is there a known reason for this, valid arguments for not allowing operator overloading? Is the reason arbitrary, or lost to time?... | Java's decision not to include operator overloading is a deliberate choice made for several reasons, primarily focusing on simplicity, readability, and maintenance of the language. Here are some key arguments often cited regarding this design decision:
1. **Simplicity and Readability**: One of Java's core design princ... | 17,462 | [
{
"from": "human",
"value": "Coming from C++ to Java, the obvious unanswered question is why didn't Java include operator overloading?\nIsn't Complex a, b, c; a = b + c; much simpler than Complex a, b, c; a = b.add(c);?\nIs there a known reason for this, valid arguments for not allowing operator overloading... |
Some files are uploaded with a reported MIME type:
image/x-citrix-pjpeg
They are valid jpeg files and I accept them as such.
I was wondering however: why is the MIME type different?
Is there any difference in the format? or was this mimetype invented by some light bulb at citrix for no apparent reason?
| The MIME type `image/x-citrix-pjpeg` refers to a variant of JPEG that is used primarily in the context of Citrix environments, particularly when utilizing their remote desktop and application delivery solutions.
### Explanation of the MIME Type
1. **"image/x-" Prefix**:
- The `x-` prefix indicates that this is a... | 20,542 | [
{
"from": "human",
"value": "Some files are uploaded with a reported MIME type:\nimage/x-citrix-pjpeg\n\nThey are valid jpeg files and I accept them as such.\nI was wondering however: why is the MIME type different?\nIs there any difference in the format? or was this mimetype invented by some light bulb at ... |
Most of us have already used the casual patterns such as MVC, strategy, etc.
But there must be some unusual solutions to unusual problems, and I'd like to hear about it.
| Certainly! While many developers are familiar with common design patterns like MVC (Model-View-Controller) and Strategy, there are several lesser-known or unusual patterns that can be useful in specific scenarios. Here are some interesting ones:
### 1. **Event Sourcing**
Instead of storing the current state of the dat... | 9,558 | [
{
"from": "human",
"value": "Most of us have already used the casual patterns such as MVC, strategy, etc.\nBut there must be some unusual solutions to unusual problems, and I'd like to hear about it.\n"
},
{
"from": "gpt",
"value": "Certainly! While many developers are familiar with common desig... |
I have some local changes to an open source project which uses Subversion as its source control. (I do not have commit access on the original project repository.)
My change adds a file, but this file is not included in the output of "svn diff". (It may be worth noting that the new file is a binary, not plain text.)
H... | In Subversion (SVN), the `svn diff` command does not include additions of binary files or new files in its output by default. To create a patch that includes the new file(s), you can use the `svn diff` command with the `--summarize` option and then manually generate the patch for the new file.
Here are the steps to cr... | 20,055 | [
{
"from": "human",
"value": "I have some local changes to an open source project which uses Subversion as its source control. (I do not have commit access on the original project repository.)\nMy change adds a file, but this file is not included in the output of \"svn diff\". (It may be worth noting that ... |
What's a good way for an IE hosted .net user control (e.g., < object classid="myctrl.dll#init">) to pull down an unmanaged dll for it to use?
For Click-once, this is easy with a manifest, but ie hosted controls don't get installed in the click-once app cache and instead run out of the download cache. Copy the dll th... | Using an Internet Explorer (IE) hosted .NET User Control (also known as a .NET ActiveX control) does present challenges when it comes to using unmanaged DLLs, especially considering that they aren't supported by ClickOnce deployment. Here are some suggested methods for loading an unmanaged DLL in this context:
### 1. ... | 19,129 | [
{
"from": "human",
"value": "What's a good way for an IE hosted .net user control (e.g., < object classid=\"myctrl.dll#init\">) to pull down an unmanaged dll for it to use? \nFor Click-once, this is easy with a manifest, but ie hosted controls don't get installed in the click-once app cache and instead run... |
I'm using Windows Installer 4.5 new features and WiX to generate MSI packages.
I have created an MSI chain installation in order to install a collection of other MSI packages as a transaction. Each package is using the new Embedded UI option so the UI can be WPF. Everything works OK this far.
Except one of the goals wo... | To achieve a common progress bar for all installs in your MSI chain installation while using the Windows Installer and WiX, you'll need to make use of the `MsiEmbeddedChainer` and correctly manage the progress reporting for all your child MSI packages. Here is a step-by-step guide on how to accomplish that:
### Step 1... | 16,876 | [
{
"from": "human",
"value": "I'm using Windows Installer 4.5 new features and WiX to generate MSI packages.\nI have created an MSI chain installation in order to install a collection of other MSI packages as a transaction. Each package is using the new Embedded UI option so the UI can be WPF. Everything wor... |
I have a berkeley db file (*.bdb) which is created by the C implementation(python bsddb module). Is it possible to read this file by a pure java implementation of Berkeley Db? I tried to read it using berkeley db java edition (je) but could not. je throws out an exception saying that it could not detect the berkeley da... | Berkeley DB has several different implementations, and the compatibility between these implementations is limited. Specifically, Berkeley DB C API files (such as those created using the Python `bsddb` module) are not directly compatible with Berkeley DB Java Edition (JE) files. Here’s why:
### Different File Formats
1... | 20,341 | [
{
"from": "human",
"value": "I have a berkeley db file (*.bdb) which is created by the C implementation(python bsddb module). Is it possible to read this file by a pure java implementation of Berkeley Db? I tried to read it using berkeley db java edition (je) but could not. je throws out an exception saying... |
I have a swf that is run from C:/ in the browser instead of a server (long story) and that swf loads a video that it located at ../../videos/video in relation to that swf.
Problem is, When I run it in Flex, everything is cool. Running locally, it can't find the file (not a security error) and is throwing a connectionE... | When running a SWF file locally on Windows, especially when using relative paths, it can sometimes be tricky due to how the local filesystem is treated compared to when it's served over a web server. Here are a few things you could try to resolve the issue:
1. **Absolute Path**: Instead of using a relative path, try u... | 21,382 | [
{
"from": "human",
"value": "I have a swf that is run from C:/ in the browser instead of a server (long story) and that swf loads a video that it located at ../../videos/video in relation to that swf.\nProblem is, When I run it in Flex, everything is cool. Running locally, it can't find the file (not a sec... |
Is it correct to say that typically user_dump_dest is on a local drive?
If so, are there issues with mounting a NAS volume to both Unix and Windows and pointing user_dump_dest at that?
If so, what are they?
Are any issues worth not doing this in prod?
| ### User Dump Destination
In Oracle databases, the `USER_DUMP_DEST` parameter specifies the directory where user dump files (e.g., trace files) are written. It is typical to place this on a local drive for several reasons:
1. **Performance**: Local drives generally offer faster read and write speeds compared to netwo... | 18,999 | [
{
"from": "human",
"value": "Is it correct to say that typically user_dump_dest is on a local drive?\nIf so, are there issues with mounting a NAS volume to both Unix and Windows and pointing user_dump_dest at that?\nIf so, what are they? \nAre any issues worth not doing this in prod? \n"
},
{
"from"... |
I'm trying to create and retrieve a BLOB in a MySQL table via Kohana's ORM library.
The code looks something like:
$attachment = new Attachment_Model();
$attachment->name = $info['FileName'];
$attachment->size = strlen($info['Data']);
$attachment->data = $info['Data'];
$attachment->mime_type = $info['content-type'];
$a... | The issue you're experiencing with the BLOB data being corrupted in your MySQL database is likely related to how the data is being handled and stored. Here are several areas to investigate:
1. **Database Column Type**: Ensure that the column used for storing the BLOB is correctly set. For binary data, you should use a... | 19,723 | [
{
"from": "human",
"value": "I'm trying to create and retrieve a BLOB in a MySQL table via Kohana's ORM library.\nThe code looks something like:\n$attachment = new Attachment_Model();\n$attachment->name = $info['FileName'];\n$attachment->size = strlen($info['Data']);\n$attachment->data = $info['Data'];\n$at... |
Is there any way to clean up this type of loop using LINQ?
List<Car> result;
List<string> makes;
List<string> models;
for (int i = 0; i < makes.Count() && i < models.Count(); i++)
{
result.Add(new Car() { Make = makes[i], Model = models[i] });
}
Basically I'm looking for some way to collate multiple a... | Yes, you can certainly clean up that loop using LINQ! You can use the `Zip` method, which is designed for combining two sequences into a single sequence by applying a specified function. This would eliminate the need for the explicit loop and make your code cleaner and more concise.
Here's how you can achieve that wit... | 19,660 | [
{
"from": "human",
"value": "Is there any way to clean up this type of loop using LINQ?\n List<Car> result;\n List<string> makes;\n List<string> models;\n\n for (int i = 0; i < makes.Count() && i < models.Count(); i++)\n {\n result.Add(new Car() { Make = makes[i], Model = models[i] });\n }\n\nBasic... |
I want to make a deep copy of a LINQ to XML XElement. The reason I want to do this is there are some nodes in the document that I want to create modified copies of (in the same document). I don't see a method to do this.
I could convert the element to an XML string and then reparse it, but I'm wondering if there's a ... | To create a deep copy of an `XElement` in LINQ to XML, you can use the `XElement` constructor that takes another `XElement` as a parameter. This constructor creates a new `XElement` that is a deep copy of the original, including all its attributes and child nodes.
Here’s how you can do it:
```csharp
using System;
usi... | 21,608 | [
{
"from": "human",
"value": "I want to make a deep copy of a LINQ to XML XElement. The reason I want to do this is there are some nodes in the document that I want to create modified copies of (in the same document). I don't see a method to do this.\nI could convert the element to an XML string and then r... |
I recall reading somewhere that using references to smart pointers can cause memory corruption. Is this simply because of using the reference of the smart pointer after its been destroyed? Or does the reference counting get messed up?
Thanks for clarifying
| Using references to smart pointers themselves does not directly cause memory corruption, but there are certain pitfalls that can arise depending on how you manage them. Let's clarify a few points regarding smart pointers and references:
1. **Smart Pointer Basics**: Smart pointers like `std::shared_ptr` and `std::uniqu... | 18,546 | [
{
"from": "human",
"value": "I recall reading somewhere that using references to smart pointers can cause memory corruption. Is this simply because of using the reference of the smart pointer after its been destroyed? Or does the reference counting get messed up?\nThanks for clarifying\n"
},
{
"fr... |
I have a User class which may or may not have an associated Department. This is referenced through the foreign key DepartmentId, and the relevant field in the User table is set to allow nulls.
When I set up my "Create User" form and select no Department, I get a conflict error on SubmitChanges():
The INSERT statement ... | When dealing with foreign key relationships in LINQ to SQL, if you want to allow a `NULL` value for the `DepartmentId` when no department is selected, you'll need to ensure that your form correctly handles this scenario and that your dropdown list is set up properly.
Here's how you can do this in a few steps:
### 1. ... | 16,664 | [
{
"from": "human",
"value": "I have a User class which may or may not have an associated Department. This is referenced through the foreign key DepartmentId, and the relevant field in the User table is set to allow nulls.\nWhen I set up my \"Create User\" form and select no Department, I get a conflict err... |
Currently, primary keys in our system are 10 digits longs, just over the limit for Java Integers. I want to avoid any maintenance problems down the road caused by numeric overflow in these keys, but at the same time I do not want to sacrifice much system performance to store infinitely large numbers that I will never n... | When designing a database schema and selecting the appropriate data type for primary keys, there are several factors to consider, especially in your case where you want to avoid overflow issues while maintaining performance.
### Key Considerations:
1. **Current and Future Scale**:
- If your current primary keys ar... | 20,421 | [
{
"from": "human",
"value": "Currently, primary keys in our system are 10 digits longs, just over the limit for Java Integers. I want to avoid any maintenance problems down the road caused by numeric overflow in these keys, but at the same time I do not want to sacrifice much system performance to store inf... |
I'm failing to understand exactly what the IF statement is doing, from what I can see it is checking if the variable x is equal to the int 0. If this is true the ABSOLUTE value of the variable y is returned... this is when I lose the plot, why would the return statement then go on to include <= ESPILON? Surely this mea... | In the provided Java code snippet, the `if` statement is indeed checking if the variable `x` is equal to `0`. Here's a breakdown of the logic:
```java
final double EPSILON = 1E-14;
if (x == 0)
return Math.abs(y) <= EPSILON;
```
1. **Understanding the condition**: The `if` statement is checking if `x` is exactly `... | 18,763 | [
{
"from": "human",
"value": "I'm failing to understand exactly what the IF statement is doing, from what I can see it is checking if the variable x is equal to the int 0. If this is true the ABSOLUTE value of the variable y is returned... this is when I lose the plot, why would the return statement then go ... |
I'm using the Telerik RAD Controls RADEditor/WYSIWYG control as part of a Dynamic Data solution.
I would like to be able to upload files using the Document Manager of this control.
However, these files are larger than whatever the default setting is for maximum upload file size.
Can anyone point me in the right directi... | To increase the maximum upload file size in the Telerik RAD Editor's Document Manager, you'll need to adjust several settings both in your web application and in the server configuration. Here's a step-by-step guide to help you through the process:
### Step 1: Configure the Web.config
1. **Open your Web.config file.*... | 17,703 | [
{
"from": "human",
"value": "I'm using the Telerik RAD Controls RADEditor/WYSIWYG control as part of a Dynamic Data solution.\nI would like to be able to upload files using the Document Manager of this control.\nHowever, these files are larger than whatever the default setting is for maximum upload file siz... |
I'm working with caching and persistence for the first time.
I have a user object that handles all my user data. Persisting this from page to page I'm planning on using a cookie with a token that then returns the user-object from the cache.
What's the best way to implement this. The two ideas/solutions that appear to ... | Welcome to the world of web development and caching! Your approach to persisting user data through cookies and caching is a common pattern. Let's break down your two ideas and consider best practices.
### Option 1: Cache a Dictionary
In this approach, you create a dictionary where the token is the key and the user ob... | 18,081 | [
{
"from": "human",
"value": "I'm working with caching and persistence for the first time. \nI have a user object that handles all my user data. Persisting this from page to page I'm planning on using a cookie with a token that then returns the user-object from the cache.\nWhat's the best way to implement th... |
Is it possible to change the language of system messages from PostgreSQL?
In MSSQL for instance this is possible with the SQL statement SET LANGUAGE.
| In PostgreSQL, the language of system messages (like error messages and other feedback from the database server) is determined by the `lc_messages` setting. However, unlike SQL Server's `SET LANGUAGE`, you can change this setting either at the session level or globally (for all sessions) through configuration.
### To ... | 21,825 | [
{
"from": "human",
"value": "Is it possible to change the language of system messages from PostgreSQL?\nIn MSSQL for instance this is possible with the SQL statement SET LANGUAGE.\n"
},
{
"from": "gpt",
"value": "In PostgreSQL, the language of system messages (like error messages and other feedb... |
From the Java 6 Pattern documentation:
Special constructs (non-capturing)
(?:X) X, as a non-capturing group
…
(?>X) X, as an independent, non-capturing group
Between (?:X) and (?>X) what is the difference? What does the independent mean in this context?
| In Java regular expressions, the constructs `(?:X)` and `(?>X)` serve different purposes when grouping expressions, and the key difference lies in how they handle backtracking during the matching process.
### `(?:X)` - Non-Capturing Group
- The `(?:X)` construct is a non-capturing group that allows you to group a part... | 20,502 | [
{
"from": "human",
"value": "From the Java 6 Pattern documentation:\n\nSpecial constructs (non-capturing)\n(?:X) X, as a non-capturing group\n…\n(?>X) X, as an independent, non-capturing group\n\nBetween (?:X) and (?>X) what is the difference? What does the independent mean in this context?\n"
},
{
... |
With very large amounts of ram these days I was wondering, it is possible to allocate a single chunk of memory that is larger than 4GB? Or would I need to allocate a bunch of smaller chunks and handle switching between them?
Why???
I'm working on processing some openstreetmap xml data and these files are huge. I'm curr... | The ability to allocate a single chunk of memory larger than 4GB depends on several factors, including:
1. **Operating System**: Some operating systems have different limits on memory allocation. For example, 32-bit operating systems typically impose a limit of 4GB for process memory, with an even smaller practical li... | 18,427 | [
{
"from": "human",
"value": "With very large amounts of ram these days I was wondering, it is possible to allocate a single chunk of memory that is larger than 4GB? Or would I need to allocate a bunch of smaller chunks and handle switching between them?\nWhy???\nI'm working on processing some openstreetmap ... |
I currently have a Java SAX parser that is extracting some info from a 30GB XML file.
Presently it is:
reading each XML node
storing it into a string object,
running some regexex on the string
storing the results to the database
For several million elements. I'm running this on a computer with 16GB of memory, but t... | Working with large XML files can indeed be challenging, especially when you're using an approach that involves storing entire nodes in memory. Since you're already utilizing a SAX parser (which is efficient in terms of memory), you have a good foundation. Here are a few strategies to optimize your processing further wi... | 17,533 | [
{
"from": "human",
"value": "I currently have a Java SAX parser that is extracting some info from a 30GB XML file. \nPresently it is:\n\nreading each XML node\nstoring it into a string object, \nrunning some regexex on the string\nstoring the results to the database\n\nFor several million elements. I'm runn... |
I get a generic failure when I try to run:
saslpasswd2 username
This was installed by Collanet's Subversion 1.5.2.
| The `saslpasswd2` command is part of the Cyrus SASL (Simple Authentication and Security Layer) library, and a generic failure message can indicate a few different issues related to its configuration. Here are several troubleshooting steps you can take to resolve the problem:
1. **Check Configuration File**: Ensure tha... | 19,852 | [
{
"from": "human",
"value": "I get a generic failure when I try to run:\nsaslpasswd2 username\n\nThis was installed by Collanet's Subversion 1.5.2.\n"
},
{
"from": "gpt",
"value": "The `saslpasswd2` command is part of the Cyrus SASL (Simple Authentication and Security Layer) library, and a gener... |
When I Alt+Tab to my VM from my host the VM does not get keyboard input until I click inside it. This is causing me an issue as it looks like the VM has control of the input (as the cursor is flashing away). If while in this state, VMWare server has the focus rather then the application inside it, if you do ctrl+Z (n... | It sounds like you're experiencing an issue with focus and input handling when switching between your host machine and a VMware virtual machine (VM). This is a common concern for many users, but unfortunately, VMware Server has some limitations in how it handles keyboard input and focus.
While there isn't a direct opt... | 19,471 | [
{
"from": "human",
"value": "When I Alt+Tab to my VM from my host the VM does not get keyboard input until I click inside it. This is causing me an issue as it looks like the VM has control of the input (as the cursor is flashing away). If while in this state, VMWare server has the focus rather then the a... |
So, In a Flex app I add a new GUI component by creating it and calling parent.addChild(). However in some cases, this causes an error in the bowels of Flex. Turns out, addChild actually does:
return addChildAt(child, numChildren);
In the cases where it breaks, somehow the numChildren is off by one. Leading to this err... | The issue you are experiencing with the `addChild` method in a Flex application is quite common and can be tricky to debug. The error message you are encountering, `RangeError: Error #2006: The supplied index is out of bounds`, usually indicates that there is an inconsistency in the internal state of the display list.
... | 15,662 | [
{
"from": "human",
"value": "So, In a Flex app I add a new GUI component by creating it and calling parent.addChild(). However in some cases, this causes an error in the bowels of Flex. Turns out, addChild actually does:\nreturn addChildAt(child, numChildren);\n\nIn the cases where it breaks, somehow the nu... |
In Oracle, I can re-create a view with a single statement, as shown here:
CREATE OR REPLACE VIEW MY_VIEW AS
SELECT SOME_FIELD
FROM SOME_TABLE
WHERE SOME_CONDITIONS
As the syntax implies, this will drop the old view and re-create it with whatever definition I've given.
Is there an equivalent in MSSQL (SQL Server 2005 o... | In SQL Server, there is no direct `CREATE OR REPLACE VIEW` statement like in Oracle. However, you can achieve a similar effect using `DROP VIEW` followed by `CREATE VIEW`. Since SQL Server does not allow you to drop a view that is currently being used in an active session, you should handle the dropping and creation ca... | 21,429 | [
{
"from": "human",
"value": "In Oracle, I can re-create a view with a single statement, as shown here:\nCREATE OR REPLACE VIEW MY_VIEW AS\nSELECT SOME_FIELD\nFROM SOME_TABLE\nWHERE SOME_CONDITIONS\n\nAs the syntax implies, this will drop the old view and re-create it with whatever definition I've given.\nIs... |
I have two tables: foos and bars, and there is a many-to-one relationship between them: each foo can have many bars. I also have a view foobars, which joins these two tables (its query is like select foo.*, bar.id from foos, bars where bar.foo_id=foo.id).
EDIT: You would not be wrong if you said that there's a many-to-... | Your current approach involves using a view (`foobars`) that combines the `foos` and `bars` tables, treating `bars` as tags associated with `foos`. While your insertion logic seems to work well, the challenge arises when updating the associated `bars` for a `foo`.
### Issues with Your Current Approach
1. **Deleting A... | 18,509 | [
{
"from": "human",
"value": "I have two tables: foos and bars, and there is a many-to-one relationship between them: each foo can have many bars. I also have a view foobars, which joins these two tables (its query is like select foo.*, bar.id from foos, bars where bar.foo_id=foo.id).\nEDIT: You would not be... |
Definition:
A palindrome is a word, phrase, number or other sequence of units that has the property of reading the same in either direction
How to check if the given string is a palindrome?
This was one of the FAIQ [Frequently Asked Interview Question] a while ago but that mostly using C.
Looking for solutions in any a... | Certainly! Below are examples of how to check if a string is a palindrome in various programming languages.
### Python
```python
def is_palindrome(s):
cleaned = ''.join(c.lower() for c in s if c.isalnum())
return cleaned == cleaned[::-1]
# Example usage
print(is_palindrome("A man, a plan, a canal, Panama")) ... | 15,831 | [
{
"from": "human",
"value": "Definition:\nA palindrome is a word, phrase, number or other sequence of units that has the property of reading the same in either direction\nHow to check if the given string is a palindrome?\nThis was one of the FAIQ [Frequently Asked Interview Question] a while ago but that mo... |
I was asked to build a java system that will have the ability to load new code (expansions) while running.
How do I re-load a jar file while my code is running? or how do I load a new jar?
Obviously, since constant up-time is important, I'd like to add the ability to re-load existing classes while at it (if it does no... | Reloading classes and adding new classes dynamically in a running Java application can be a complex task, but it is achievable with careful design. Here are some approaches and considerations for both scenarios:
### 1. Reloading Existing Classes While Running
To reload classes at runtime, you can utilize a custom cla... | 18,483 | [
{
"from": "human",
"value": "I was asked to build a java system that will have the ability to load new code (expansions) while running. \nHow do I re-load a jar file while my code is running? or how do I load a new jar?\nObviously, since constant up-time is important, I'd like to add the ability to re-load ... |
How do I obtain the serial number of the installed Vista system?
Also is there a tool that does the same thing so I can verify MY results?
| To obtain the serial number (also referred to as the product key) of your installed Windows Vista system, you can use several methods:
### Method 1: Using Command Prompt
1. **Open Command Prompt**:
- Click on the Start menu.
- Type `cmd` in the search box, then right-click on "Command Prompt" and choose "Run as... | 20,523 | [
{
"from": "human",
"value": "How do I obtain the serial number of the installed Vista system?\nAlso is there a tool that does the same thing so I can verify MY results?\n"
},
{
"from": "gpt",
"value": "To obtain the serial number (also referred to as the product key) of your installed Windows Vi... |
I've created a tool that is used with a fairly popular music retailer.
The tool provides an enhanced search feature (transparent last.fm results, no ads, no lameness, nothing creepy) and I've found the most useful and unobtrusive way to display the search is as a toolbar using the much maligned iframe. This allows user... | You're correct that using iframes can introduce several challenges, particularly when it comes to navigating away from them and managing the user experience without compromising security. Here's a breakdown of your concerns and potential solutions:
### The Challenges
1. **Same-Origin Policy**: The primary security me... | 18,687 | [
{
"from": "human",
"value": "I've created a tool that is used with a fairly popular music retailer.\nThe tool provides an enhanced search feature (transparent last.fm results, no ads, no lameness, nothing creepy) and I've found the most useful and unobtrusive way to display the search is as a toolbar using ... |
How can I detect if the internet connection is offline in JavaScript?
| In JavaScript, you can detect if the internet connection is offline by using the `navigator.onLine` property in combination with the `online` and `offline` events. Here’s how you can do it:
### Method 1: Using `navigator.onLine`
The `navigator.onLine` property returns a boolean value indicating whether the browser is... | 17,904 | [
{
"from": "human",
"value": "How can I detect if the internet connection is offline in JavaScript?\n"
},
{
"from": "gpt",
"value": "In JavaScript, you can detect if the internet connection is offline by using the `navigator.onLine` property in combination with the `online` and `offline` events. ... |
Is it possible to use AIX's mksysb and savevg to create a bootable tape with the rootvg and then append all the other VGs?
| Yes, it is possible to use AIX's `mksysb` command to create a bootable backup of the root volume group (rootvg) and then use the `savevg` command to back up additional volume groups. However, there are some important considerations regarding the creation of a bootable tape and appending other volume groups:
1. **Creat... | 19,496 | [
{
"from": "human",
"value": "Is it possible to use AIX's mksysb and savevg to create a bootable tape with the rootvg and then append all the other VGs?\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to use AIX's `mksysb` command to create a bootable backup of the root volume group (rootvg)... |
We have a "master database structure", and need a routine to keep the database structure on client sites up-to-date.
A number of suggestions have been given to a related question, but I am looking for a more specific solution, along these lines:
I would like to generate a text file (XML or other readable format) which... | To achieve your goal of maintaining and synchronizing the database structure between a master schema and client databases, you can follow a two-step approach: generating the database schema into a readable format, and then applying updates to client databases to align them with the master schema.
### Step 1: Generate ... | 16,653 | [
{
"from": "human",
"value": "We have a \"master database structure\", and need a routine to keep the database structure on client sites up-to-date.\nA number of suggestions have been given to a related question, but I am looking for a more specific solution, along these lines:\n\nI would like to generate a ... |
Have had to write my first "proper" multithreaded coded recently, and realised just how little I knew about how "imperative-style" (ie, concurrency models used by C++/C#/Java, and the like) concurrent programming techniques.
What resources are there (both books and online tutorials, etc) in order to learn more about th... | Learning about multithreading and concurrency in imperative languages like C++, C#, and Java is a valuable skill, especially for building efficient and responsive applications. Here are some resources—books, online courses, and tutorials—that can help you deepen your understanding of concurrent programming in these lan... | 16,886 | [
{
"from": "human",
"value": "Have had to write my first \"proper\" multithreaded coded recently, and realised just how little I knew about how \"imperative-style\" (ie, concurrency models used by C++/C#/Java, and the like) concurrent programming techniques.\nWhat resources are there (both books and online t... |
As a follow up to an earlier question that attracted a whole zero answers, I'm wondering about the possibilities of allowing a web server (apache) to write to its own document root (Linux), in order to dynamically create meta-redirect files.
Of course, this sounds incredibly dangerous, and I'm wary of going the whole h... | You're right to be cautious about granting a web server, like Apache, write access to its document root, as doing so can introduce significant security risks. Here are some considerations and alternative approaches for allowing dynamic creation of files while minimizing risks:
### 1. **Using a Separate Directory for D... | 20,396 | [
{
"from": "human",
"value": "As a follow up to an earlier question that attracted a whole zero answers, I'm wondering about the possibilities of allowing a web server (apache) to write to its own document root (Linux), in order to dynamically create meta-redirect files.\nOf course, this sounds incredibly da... |
Is there any way to redefine a class or some of its methods without using typical inheritance? For example:
class third_party_library {
function buggy_function() {
return 'bad result';
}
function other_functions(){
return 'blah';
}
}
What can I do to replace buggy_function()? Obviously ... | In PHP, you can't redefine a class or its methods directly without using inheritance or modifying the library. However, there are a few alternatives to modify or extend the behavior of a class without directly changing its source code.
### 1. **Using Composition**:
Instead of redefining the class, you can create a wra... | 18,267 | [
{
"from": "human",
"value": "Is there any way to redefine a class or some of its methods without using typical inheritance? For example:\nclass third_party_library {\n function buggy_function() {\n return 'bad result';\n }\n function other_functions(){\n return 'blah';\n }\n}\n\nWh... |
I need to either find a file in which the version is encoded or a way of polling it across the web so it reveals its version. The server is running at a host who will not provide me command line access, although I can browse the install location via FTP.
I have tried HEAD and do not get a version number reported.
If I ... | It sounds like you're facing a common challenge when dealing with a well-secured server environment. Here are some strategies to try and ascertain the version of the software running on the server, without needing direct command-line access:
1. **Check for Common Files or Directories**:
- Sometimes software package... | 20,348 | [
{
"from": "human",
"value": "I need to either find a file in which the version is encoded or a way of polling it across the web so it reveals its version. The server is running at a host who will not provide me command line access, although I can browse the install location via FTP.\nI have tried HEAD and d... |
I'm writing (in C# with .NET 3.5) an administrative application which will poll multiple Windows systems for various bits of data. In many cases it will use WMI, but in some cases it may need to read remote registry or remotely execute some command or script on the polled system. This polling will happen at repeating i... | To securely handle passwords in a C# application that may run in both domain and non-domain environments, you need to consider multiple aspects of security, including storage, retrieval, and usage of the credentials. Here are some suggestions for implementing this in a secure and efficient manner:
### 1. Use Windows D... | 14,429 | [
{
"from": "human",
"value": "I'm writing (in C# with .NET 3.5) an administrative application which will poll multiple Windows systems for various bits of data. In many cases it will use WMI, but in some cases it may need to read remote registry or remotely execute some command or script on the polled system... |
I'm looking to create a "Countries You've Visited" map - just like the ones you've probably seen on Facebook, TravelAdvisor and whatnot.
I've tried different flash kits, but they're not quite as advanced as I'd like them to be. The main problem I've encountered with all the different kits is changing the background col... | Creating an interactive "Countries You've Visited" map can indeed be challenging, especially when you're looking for specific features like changing background colors on click and retaining those states. Since you mentioned some limitations with Flash and various mapping libraries, here are a few suggestions that could... | 13,612 | [
{
"from": "human",
"value": "I'm looking to create a \"Countries You've Visited\" map - just like the ones you've probably seen on Facebook, TravelAdvisor and whatnot.\nI've tried different flash kits, but they're not quite as advanced as I'd like them to be. The main problem I've encountered with all the d... |
For a school project, I need to create a way to create personnalized queries based on end-user choices.
Since the user can choose basically any fields from any combination of tables, I need to find a way to map the tables in order to make a join and not have extraneous data (This may lead to incoherent reports, but we... | To address your challenge of creating personalized queries based on end-user choices while ensuring meaningful joins between tables, you can adopt a systematic approach. The core of your problem is to find paths through your database schema that connect the selected tables. Here are steps and considerations to help you... | 17,769 | [
{
"from": "human",
"value": "For a school project, I need to create a way to create personnalized queries based on end-user choices.\nSince the user can choose basically any fields from any combination of tables, I need to find a way to map the tables in order to make a join and not have extraneous data (Th... |
How would you describe and promote WCF as a technology to a non-technical client/manager/CEO/etc?
What are competing solutions or ideas that they might bring up(such as those they read about in their magazines touting new technology)?
What is WCF not good for that you've seen people try to shoehorn it into?
-Adam
| ### Description and Promotion of WCF to a Non-Technical Client
**What is WCF?**
Windows Communication Foundation (WCF) is a flexible framework for building service-oriented applications. It allows different applications to communicate with each other, regardless of their platform or programming language. Think of it a... | 18,128 | [
{
"from": "human",
"value": "How would you describe and promote WCF as a technology to a non-technical client/manager/CEO/etc?\nWhat are competing solutions or ideas that they might bring up(such as those they read about in their magazines touting new technology)?\nWhat is WCF not good for that you've seen ... |
Vi and Vim allow for really awesome customization, typically stored inside a .vimrc file. Typical features for a programmer would be syntax highlighting, smart indenting and so on.
What other tricks for productive programming have you got, hidden in your .vimrc?
I am mostly interested in refactorings, auto classes and ... | Certainly! Vim is a powerful tool for programming, and with the right configuration in your `.vimrc`, you can enhance your productivity significantly, especially for C#. Below are some tricks and customizations that can help you with refactoring, auto-completion, and more.
### Basic .vimrc Setup
Here's a simple start... | 16,024 | [
{
"from": "human",
"value": "Vi and Vim allow for really awesome customization, typically stored inside a .vimrc file. Typical features for a programmer would be syntax highlighting, smart indenting and so on.\nWhat other tricks for productive programming have you got, hidden in your .vimrc?\nI am mostly in... |
From the MSDN article on STAThread:
Indicates that the COM threading model for an application is single-threaded apartment (STA).
(For reference, that's the entire article.)
Single-threaded apartment... OK, that went over my head. Also, I read somewhere that unless your application uses COM interop, this attribute ac... | The `STAThread` and `MTAThread` attributes in .NET define the threading models used for COM (Component Object Model) interactions within your application. Understanding these models is crucial for applications that need to interact with COM components, such as Windows Forms applications or when using certain libraries ... | 19,331 | [
{
"from": "human",
"value": "From the MSDN article on STAThread:\n\nIndicates that the COM threading model for an application is single-threaded apartment (STA).\n\n(For reference, that's the entire article.)\nSingle-threaded apartment... OK, that went over my head. Also, I read somewhere that unless your a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.