instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I'm serializing an object in a C# VS2003 / .Net 1.1 application. I need it serialized without the processing instruction, however. The XmlSerializer class puts out something like this:
<?xml version="1.0" encoding="utf-16" ?>
<MyObject>
<Property1>Data</Property1>
<Property2>More Data</Property2>
</MyObject>
... | In .NET Framework 1.1, the `XmlSerializer` class does not provide a built-in way to serialize an object without including the XML declaration at the beginning of the output. However, you can achieve your goal by using a `StringWriter` and then removing the XML declaration manually after the serialization process.
Sinc... | 31,132 | [
{
"from": "human",
"value": "I'm serializing an object in a C# VS2003 / .Net 1.1 application. I need it serialized without the processing instruction, however. The XmlSerializer class puts out something like this:\n<?xml version=\"1.0\" encoding=\"utf-16\" ?> \n<MyObject>\n <Property1>Data</Property1>\n ... |
I'm using java and referring to the "double" datatype.
To keep it short, I'm reading some values from standard input that I read in my code as doubles (I would much rather use something like BigInteger but right now it's not possible).
I expect to get double values from the user but sometimes they might input things li... | In Java, the `double` data type is a double-precision 64-bit IEEE 754 floating point. It can represent a wide range of values, but as you mentioned, precision issues arise when dealing with very large numbers or numbers with a significant number of decimal places.
To determine whether a specific string input can be ac... | 28,235 | [
{
"from": "human",
"value": "I'm using java and referring to the \"double\" datatype.\nTo keep it short, I'm reading some values from standard input that I read in my code as doubles (I would much rather use something like BigInteger but right now it's not possible).\nI expect to get double values from the ... |
Microsoft like implementing their own versions of popular open-source frameworks and assemblies, for example:
Microsoft's MVC Framework vs MonoRail
Microsoft's Unity IoC container vs Castle Windsor / Spring.net / Ninject etc
Microsoft's VS Unit Test framework vs nUnit (and various others)
Questions:
What else has Mic... | Microsoft has indeed created its own versions of many popular open-source frameworks and libraries, often with the aim of providing a more integrated or "enterprise-ready" solution. Here are some examples, along with insights into the developer community's attitudes and preferences:
### Examples of Microsoft's Own Imp... | 29,955 | [
{
"from": "human",
"value": "Microsoft like implementing their own versions of popular open-source frameworks and assemblies, for example:\n\nMicrosoft's MVC Framework vs MonoRail\nMicrosoft's Unity IoC container vs Castle Windsor / Spring.net / Ninject etc\nMicrosoft's VS Unit Test framework vs nUnit (and ... |
I have G729 encoded audio files. I need to programmatically convert them to WAV PCM (16bit 8kHz mono) in the flow of a tool that is doing other thing too. I have an executable that will do that for me. But spawning that external process every time I convert is too heavy on resources. Especially if I need many of them b... | To convert G.729 encoded audio files to WAV PCM format in .NET without the overhead of spawning an external process, you can use libraries that handle audio decoding. However, G.729 is not a format that is widely supported in .NET libraries, as it is a patented codec.
Here's a couple of approaches you can consider:
... | 20,889 | [
{
"from": "human",
"value": "I have G729 encoded audio files. I need to programmatically convert them to WAV PCM (16bit 8kHz mono) in the flow of a tool that is doing other thing too. I have an executable that will do that for me. But spawning that external process every time I convert is too heavy on resou... |
How can I achieve this? I am trying to load content from the database and fuse it together with the Content control. The progrm is some of the content has dynamic bits to it and thus would like it to be compiled on the fly. Has anyone done this sort of stuff before?
| It sounds like you're looking to dynamically generate and load content into a UI control (like a Content Control in a WPF application, for example) using data from a database. Here's a high-level approach to achieving this:
### Steps to Load Dynamic Content from a Database
1. **Set Up Your Database:**
Make sure yo... | 26,234 | [
{
"from": "human",
"value": "How can I achieve this? I am trying to load content from the database and fuse it together with the Content control. The progrm is some of the content has dynamic bits to it and thus would like it to be compiled on the fly. Has anyone done this sort of stuff before?\n"
},
{
... |
I admit - I'm a complete novice when it comes to unit testing. I can grasp the concepts easily enough (test one thing, break-fix-test-repeat, etc.), but I'm having a bit of a problem getting my mind around this one...
I've been tasked with rewriting a large section of our application, and I've got the class structure d... | You're not alone in this challenge—it's a common situation that many developers encounter, especially when working with `Friend` classes in a language like C#. The primary issue at hand is testing internal components while respecting encapsulation. Here are a few approaches you might consider to resolve this without dr... | 28,985 | [
{
"from": "human",
"value": "I admit - I'm a complete novice when it comes to unit testing. I can grasp the concepts easily enough (test one thing, break-fix-test-repeat, etc.), but I'm having a bit of a problem getting my mind around this one...\nI've been tasked with rewriting a large section of our appli... |
We use Tomcat to host our WAR based applications. We are servlet container compliant J2EE applications with the exception of org.apache.catalina.authenticator.SingleSignOn.
We are being asked to move to a commercial Java EE application server.
The first downside to changing that
I see is the cost. No matter what
the... | When considering a transition from Tomcat to a commercial Java EE application server, it's important to weigh both the potential benefits and drawbacks of such a move. You have already identified some key concerns regarding cost and complexity, but let's delve deeper into the benefits and drawbacks that you may not hav... | 28,965 | [
{
"from": "human",
"value": "We use Tomcat to host our WAR based applications. We are servlet container compliant J2EE applications with the exception of org.apache.catalina.authenticator.SingleSignOn.\nWe are being asked to move to a commercial Java EE application server.\n\nThe first downside to changing... |
Is there a .net equivalent to the C++ unexpected()/set_unexpected() functionality?
Edit: Sorry--I omitted some details previously:
Language: C# 2.0
I have some legacy apps that seem to be throwing some unhandled exception somewhere. I just want to put something in place to stop the customer's pain until I can trace ... | In .NET, particularly in C#, there isn't a direct equivalent to C++'s `set_unexpected()` functionality. However, you can achieve similar behavior by using global exception handling mechanisms available in .NET.
Here’s how you can handle unhandled exceptions in a C# application:
### For Windows Forms Applications
You... | 27,764 | [
{
"from": "human",
"value": "Is there a .net equivalent to the C++ unexpected()/set_unexpected() functionality?\n\nEdit: Sorry--I omitted some details previously:\nLanguage: C# 2.0\nI have some legacy apps that seem to be throwing some unhandled exception somewhere. I just want to put something in place t... |
I've got a project that was written in BASIC. I'm not sure of the exact reason, but the app will not function except when being run from a FAT-16 file system.
I'd rather try to set up an environment that will support this app in a modern OS (Vista/XP) instead of rewriting it.
Does anyone know how to get an app like th... | To run an application originally designed for a FAT-16 file system on a modern operating system like Windows XP or Vista, you can take several approaches:
### 1. Use a Virtual Machine
You could create a virtual machine that emulates an older operating system (like MS-DOS or an old version of Windows that supports FAT... | 29,160 | [
{
"from": "human",
"value": "I've got a project that was written in BASIC. I'm not sure of the exact reason, but the app will not function except when being run from a FAT-16 file system.\nI'd rather try to set up an environment that will support this app in a modern OS (Vista/XP) instead of rewriting it.\... |
We may tag a question with multiple tags in StackOverflow website, I'm wondering how to find out the most related questions with common tags.
Assume we have 100 questions in a database, each question has several tags. Let's say user is browsing a specific question, and we want to make the system to display the related ... | To efficiently design a database for storing questions and their associated tags, and to quickly retrieve related questions based on common tags, you can use a relational database with a many-to-many relationship structure. Here's how you can set it up and implement the retrieval logic.
### Database Design
1. **Quest... | 27,597 | [
{
"from": "human",
"value": "We may tag a question with multiple tags in StackOverflow website, I'm wondering how to find out the most related questions with common tags.\nAssume we have 100 questions in a database, each question has several tags. Let's say user is browsing a specific question, and we want ... |
I have a new object with a collection of new objects within it on some property as an IList. I see through sql profiler two insert queries being executed.. one for the parent, which has the new guid id, and one for the child, however, the foreign-key on the child that references the parent, is an empty guid. Here is my... | It looks like you encountered a common issue when dealing with parent-child relationships in NHibernate. The foreign key on the child (BackerEntry) was not being set correctly, which led to a conflict when you tried to insert the child entity.
To solve this issue, you need to ensure that the child entity has a refere... | 12,171 | [
{
"from": "human",
"value": "I have a new object with a collection of new objects within it on some property as an IList. I see through sql profiler two insert queries being executed.. one for the parent, which has the new guid id, and one for the child, however, the foreign-key on the child that references... |
So far, in my research I have seen that it is unwise to set AllowUnsafeUpdates on GET request operation to avoid cross site scripting. But, if it is required to allow this, what is the proper way to handle the situation to mitigate any exposure?
Here is my best first guess on a reliable pattern if you absolutely need ... | Your concern about using `AllowUnsafeUpdates` on GET requests in a SharePoint context is valid. Allowing unsafe updates introduces risks, including Cross-Site Scripting (XSS) and data corruption. The best practice is to limit such permissions as much as possible and control when they are enabled. Below are some best pr... | 27,722 | [
{
"from": "human",
"value": "So far, in my research I have seen that it is unwise to set AllowUnsafeUpdates on GET request operation to avoid cross site scripting. But, if it is required to allow this, what is the proper way to handle the situation to mitigate any exposure? \nHere is my best first guess on ... |
What's the best way to go about creating a vertical and horizontal ruler bars in an SDI app? Would you make it part of the frame or the view? Derive it from CControlBar, or is there a better method?
The vertical ruler must also be docked to a pane and not the frame.
To make it a little clearer as to what I'm after, i... | Creating vertical and horizontal ruler bars in an SDI (Single Document Interface) application using MFC (Microsoft Foundation Class Library) can be achieved in various ways. Below, I outline a recommended approach for implementing these ruler bars, considering your requirements.
### Design Considerations
1. **Placeme... | 28,588 | [
{
"from": "human",
"value": "What's the best way to go about creating a vertical and horizontal ruler bars in an SDI app? Would you make it part of the frame or the view? Derive it from CControlBar, or is there a better method?\nThe vertical ruler must also be docked to a pane and not the frame.\nTo make ... |
I have a site with multiple document libraries in it. One of the site users has full control of the site & at one point, instead of creating a new document library, they renamed the default document library from "Shared Documents" to "Correspondence". Now they've opened the document library in windows explorer, so it... | Changing the URL of a document library in SharePoint can be a bit tricky, especially when you want to keep the existing content and permissions intact. Unfortunately, SharePoint does not provide a direct option to change the URL of an existing document library. Here are a few methods you can consider:
### 1. **Create ... | 24,759 | [
{
"from": "human",
"value": "I have a site with multiple document libraries in it. One of the site users has full control of the site & at one point, instead of creating a new document library, they renamed the default document library from \"Shared Documents\" to \"Correspondence\". Now they've opened th... |
The project is poorly defined: we are to write educational software for CS 111 Computer Programming I students focusing on functions. We have 6 student developers with various backgrounds working in Flex. The project has a duration of about 7 weeks. We have very limited face time (30 min per week) and very limited work... | Given the constraints and characteristics of your project for developing educational software for CS 111 students, an Agile methodology—specifically a variation like Scrum or Kanban—would be most suitable. Here’s an analysis of why Agile methodologies are appropriate and how you can adapt features from various methodol... | 29,191 | [
{
"from": "human",
"value": "The project is poorly defined: we are to write educational software for CS 111 Computer Programming I students focusing on functions. We have 6 student developers with various backgrounds working in Flex. The project has a duration of about 7 weeks. We have very limited face tim... |
Here's my binding source object:
Public Class MyListObject
Private _mylist As New ObservableCollection(Of String)
Private _selectedName As String
Public Sub New(ByVal nameList As List(Of String), ByVal defaultName As String)
For Each name In nameList
_mylist.Add(name)
Next
... | The issue you're experiencing is due to the fact that when you switch the `ObjectInstance` of the `ObjectDataProvider`, the binding for `SelectedValue` does not automatically refresh to use the new `ObjectInstance`'s `SelectedName` property. The `ComboBox` is only evaluating the `SelectedValue` when the binding is firs... | 30,272 | [
{
"from": "human",
"value": "Here's my binding source object: \nPublic Class MyListObject\n\n Private _mylist As New ObservableCollection(Of String)\n Private _selectedName As String\n\n Public Sub New(ByVal nameList As List(Of String), ByVal defaultName As String)\n\n For Each name In nameL... |
I reloaded an old project, and tried to run it only to run into the Binding Failure MDA Assistant:
BindingFailure was detected
Message: The assembly with display name 'SoapTest.XmlSerializers' failed to load in the
'LoadFrom' binding context of the AppDomain with ID 1. The cause of the failure was:
System.IO.FileNo... | The `SoapTest.XmlSerializers.dll` is an assembly that is typically generated automatically by the .NET Framework when you add a web reference to a project. This DLL is responsible for serialization of the data types used by the web service you've referenced in your project.
If you are encountering a `FileNotFoundExcep... | 23,699 | [
{
"from": "human",
"value": "I reloaded an old project, and tried to run it only to run into the Binding Failure MDA Assistant:\n\nBindingFailure was detected \n\nMessage: The assembly with display name 'SoapTest.XmlSerializers' failed to load in the\n'LoadFrom' binding context of the AppDomain with ID 1. T... |
I've written some custom model binders (implementing IModelBinder) in our ASP.NET MVC application. I'm wondering what is a good approach to unittest them (binders)?
| Unit testing custom model binders in an ASP.NET MVC application is an important step to ensure they function as expected. Here are some best practices and approaches you can follow when unit testing your custom model binders:
### 1. Use Mocking Frameworks
Leverage mocking frameworks like Moq or NSubstitute to create m... | 27,529 | [
{
"from": "human",
"value": "I've written some custom model binders (implementing IModelBinder) in our ASP.NET MVC application. I'm wondering what is a good approach to unittest them (binders)?\n"
},
{
"from": "gpt",
"value": "Unit testing custom model binders in an ASP.NET MVC application is an... |
I have seen the following methods of putting JavaScript code in an <a> tag:
function DoSomething() { ... return false; }
<a href="javascript:;" onClick="return DoSomething();">link</a>
<a href="javascript:DoSomething();">link</a>
<a href="javascript:void(0);" onClick="return DoSomething();">link</a>
<a href="#" onCli... | When it comes to using JavaScript within `<a>` tags, you have multiple options, each with its pros and cons. Let's examine each of your provided methods more closely and discuss their implications:
### 1. `javascript:;` with `onClick`
```html
<a href="javascript:;" onClick="return DoSomething();">link</a>
```
- **Pros... | 28,152 | [
{
"from": "human",
"value": "I have seen the following methods of putting JavaScript code in an <a> tag:\nfunction DoSomething() { ... return false; }\n\n\n<a href=\"javascript:;\" onClick=\"return DoSomething();\">link</a>\n<a href=\"javascript:DoSomething();\">link</a>\n<a href=\"javascript:void(0);\" onC... |
I have some code which returns InnerXML for a XMLNode.
The node can contain just some text (with HTML) or XML.
For example:
<XMLNode>
Here is some <strong>HTML</strong>
<XMLNode>
or
<XMLNode>
<XMLContent>Here is some content</XMLContnet>
</XMLNode>
if I get the InnerXML for <XmlNode> the HTML tags... | When dealing with XML and HTML encoded entities in .NET, you can use the `System.Web.HttpUtility.HtmlDecode` method to decode HTML entities. However, you are correct that this method primarily focuses on HTML entities (like `<`, `>`, `&`, etc.) and may not handle all XML-specific entities (like `'`, `&qu... | 26,934 | [
{
"from": "human",
"value": "I have some code which returns InnerXML for a XMLNode.\nThe node can contain just some text (with HTML) or XML.\nFor example:\n<XMLNode>\n Here is some <strong>HTML</strong>\n<XMLNode>\n\nor\n<XMLNode>\n <XMLContent>Here is some content</XMLContnet>\n</XMLNode>... |
What is the differences and similarities between Domain Specific Languages (DSL) and Domain Driven Design (DDD)?
| Domain-Specific Languages (DSL) and Domain-Driven Design (DDD) are both concepts that address the organization and manipulation of software systems in relation to specific problem domains, but they serve different purposes and operate at different levels of abstraction. Below are the key similarities and differences be... | 25,974 | [
{
"from": "human",
"value": "What is the differences and similarities between Domain Specific Languages (DSL) and Domain Driven Design (DDD)?\n"
},
{
"from": "gpt",
"value": "Domain-Specific Languages (DSL) and Domain-Driven Design (DDD) are both concepts that address the organization and manipu... |
I'm trying to automate the build of the project I'm working on. My ultimate goal is to eventually have a continuous integration server and so far everything was great. In order to find out what is the minimal setup I can have for my project, I started configuring a freshly installed system and stumbled with the require... | Automating builds for Windows Mobile 5 projects can be challenging due to the requirement of the Visual Studio IDE for certain SDKs. However, it is possible to set up a more streamlined build environment without needing the full IDE on your continuous integration server. Here are some steps and considerations that may ... | 29,450 | [
{
"from": "human",
"value": "I'm trying to automate the build of the project I'm working on. My ultimate goal is to eventually have a continuous integration server and so far everything was great. In order to find out what is the minimal setup I can have for my project, I started configuring a freshly insta... |
I've got a number of batch processes that run behind the scenes for a Linux/PHP website. They are starting to grow in number and complexity, so I want to bring a small amount of process to bear on them.
My source tree has a bunch of cpp files and scripts, organized with development but not deployment in mind. After com... | Managing deployment for a growing number of batch processes can indeed become complex, but there are several strategies and tools you can use to streamline the process and reduce errors. Here are some recommendations for managing your deployment more effectively:
### 1. **Directory Structure for Deployment**
Create a ... | 27,566 | [
{
"from": "human",
"value": "I've got a number of batch processes that run behind the scenes for a Linux/PHP website. They are starting to grow in number and complexity, so I want to bring a small amount of process to bear on them.\nMy source tree has a bunch of cpp files and scripts, organized with develop... |
I have an import-from-excel script as part of a CMS that previously ran without issue.
My shared-hosting provider has recently upgraded their infrastructure, including PHP from 5.1 to 5.2.6, and the script now returns "Uninitialized string offset: -XXX in /path/scriptname.php on line 27" (XXX being a decreasing number ... | It sounds like you've already identified the issue as being related to the compatibility of the Excel parser (Spreadsheet Excel Reader) with PHP 5.2.6. Given that the error is stemming from accessing an uninitialized string offset, it’s likely that the data being parsed from the Excel file is not being handled correctl... | 31,079 | [
{
"from": "human",
"value": "I have an import-from-excel script as part of a CMS that previously ran without issue.\nMy shared-hosting provider has recently upgraded their infrastructure, including PHP from 5.1 to 5.2.6, and the script now returns \"Uninitialized string offset: -XXX in /path/scriptname.php ... |
The code is,
set VAR=before
if "%VAR%" == "before" (
set VAR=after;
echo %VAR%
)
What will the preceding Windows .bat file code segment display? Why? (i.e. why doesn't it behave as you might first think)?
| The provided Windows batch file code segment:
```batch
set VAR=before
if "%VAR%" == "before" (
set VAR=after;
echo %VAR%
)
```
will display:
```
before
```
### Explanation:
At first glance, one might expect that the output should be `after`, since the variable `VAR` is set to `after` inside the `if` block. Ho... | 31,938 | [
{
"from": "human",
"value": "The code is,\nset VAR=before\n\nif \"%VAR%\" == \"before\" (\n\n set VAR=after;\n\n echo %VAR%\n\n)\n\nWhat will the preceding Windows .bat file code segment display? Why? (i.e. why doesn't it behave as you might first think)?\n"
},
{
"from": "gpt",
"value": "The ... |
In a previous question, I asked about various ORM libraries. It turns out Kohana looks very clean yet functional for the purposes of ORM. I already have an MVC framework that I am working in though. If I don't want to run it as a framework, what is the right fileset to include to just give me the DB and ORM base class ... | Kohana is designed as a full MVC framework, but if you want to use its ORM functionality without adopting the entire framework, you can certainly do that. However, there are a few key files and dependencies you'll need to include to make it work properly.
### Files to Include
1. **Core ORM Files**: The core ORM funct... | 23,628 | [
{
"from": "human",
"value": "In a previous question, I asked about various ORM libraries. It turns out Kohana looks very clean yet functional for the purposes of ORM. I already have an MVC framework that I am working in though. If I don't want to run it as a framework, what is the right fileset to include t... |
I have a static method in my code that I would like somehow to mock.
I am using jmock.
One way I suppose I could do this is to have "wrapper class" around the static method and
mock this but I was hoping for a better solution.
I am going about this the wrong way?
FEEDBACK:
I was going to have a interface and class that... | Mocking static methods can indeed be a challenge, as traditional mocking frameworks like JMock or Mockito do not support static method mocking directly. Your approach of using a wrapper class is a common and acceptable solution in such cases, and while it may feel a bit like a workaround, it can lead to more testable a... | 26,198 | [
{
"from": "human",
"value": "I have a static method in my code that I would like somehow to mock.\nI am using jmock.\nOne way I suppose I could do this is to have \"wrapper class\" around the static method and\nmock this but I was hoping for a better solution.\nI am going about this the wrong way?\nFEEDBACK... |
Can anyone please tell me if Certifying Authorities (CAs) are allowed to make modifications to the Certificate Signing Request (CSR) before actually signing the certificate with their own private key?
Specifically, I'd like to know if it's valid for the CA to insert additional fields (such as EKUs) into the cert befor... | Certifying Authorities (CAs) are generally not allowed to modify a Certificate Signing Request (CSR) before signing it. A CSR contains specific information about the entity requesting the certificate, including the public key and information about the subject. When a CA receives a CSR, it is expected to validate the in... | 32,067 | [
{
"from": "human",
"value": "Can anyone please tell me if Certifying Authorities (CAs) are allowed to make modifications to the Certificate Signing Request (CSR) before actually signing the certificate with their own private key? \nSpecifically, I'd like to know if it's valid for the CA to insert additional... |
If you have an STL vector which has been resized, is it safe to take the address of element 0 and assume the rest of the vector will follow in memory?
e.g.
vector<char> vc(100);
// do some stuff with vc
vc.resize(200);
char* p = &vc[0];
// do stuff with *p
| When you resize an STL vector in C++, the behavior regarding memory allocation depends on the current state of the vector and the parameters of the `resize` call.
In your specific example:
```cpp
#include <vector>
std::vector<char> vc(100);
// do some stuff with vc
vc.resize(200);
char* p = &vc[0];
// do stuff with ... | 31,446 | [
{
"from": "human",
"value": "If you have an STL vector which has been resized, is it safe to take the address of element 0 and assume the rest of the vector will follow in memory?\ne.g.\nvector<char> vc(100);\n// do some stuff with vc\nvc.resize(200);\nchar* p = &vc[0];\n// do stuff with *p\n\n"
},
{
... |
I'm pretty new to regular expressions. I have a requirement to replace spaces in a piece of multi-line text. The replacement rules are these:
Replace all spaces at start-of-line with a non-breaking space ( ).
Replace any instance of repeated spaces (more than one space together) with the same number of non-breaki... | You can achieve the desired output using PHP's `preg_replace()` function with a combination of two regular expression patterns. The first pattern will handle spaces at the start of a line, and the second pattern will handle repeated spaces.
Here’s how you can implement this in PHP:
```php
$input = "asdasd asdasd as... | 30,650 | [
{
"from": "human",
"value": "I'm pretty new to regular expressions. I have a requirement to replace spaces in a piece of multi-line text. The replacement rules are these:\n\nReplace all spaces at start-of-line with a non-breaking space ( ).\nReplace any instance of repeated spaces (more than one space ... |
I want to use input from a user as a regex pattern for a search over some text. It works, but how I can handle cases where user puts characters that have meaning in regex?
For example, the user wants to search for Word (s): regex engine will take the (s) as a group. I want it to treat it like a string "(s)" . I can ... | To handle user input for regular expressions in a way that treats all special characters as literals, you can escape all the special characters automatically. Instead of manually replacing each regex symbol with its escaped counterpart, you can use a function to handle the escaping for you.
In Python, for example, you... | 32,926 | [
{
"from": "human",
"value": "I want to use input from a user as a regex pattern for a search over some text. It works, but how I can handle cases where user puts characters that have meaning in regex?\nFor example, the user wants to search for Word (s): regex engine will take the (s) as a group. I want it... |
Should I include dependencies when I do releases for my common projects such as CommonUtils or should I simply specify which dependencies should be referenced when they are to be used?
| When managing dependencies in your common projects, like `CommonUtils`, it's generally advisable to **not include** the dependencies themselves directly in your release, but rather to specify which dependencies should be referenced. Here are the key considerations:
### Reasons to Specify Dependencies Instead of Includ... | 31,145 | [
{
"from": "human",
"value": "Should I include dependencies when I do releases for my common projects such as CommonUtils or should I simply specify which dependencies should be referenced when they are to be used?\n"
},
{
"from": "gpt",
"value": "When managing dependencies in your common project... |
Does anyone have a good technique (or tutorial) to implement rulers within a C# Windows Forms application? I want to display an image while showing rulers that indicate your mouse position to allow a more accurate positioning of the cursor. Just like the image below:
I tried using splitter controls to hold the tick ma... | Implementing rulers in a C# Windows Forms application to visually indicate mouse position relative to an image can be a great enhancement for precise positioning. Here's a step-by-step guide on how to create a simple ruler system:
### Step 1: Set Up Your Windows Forms Application
1. **Create a new Windows Forms Appli... | 23,228 | [
{
"from": "human",
"value": "Does anyone have a good technique (or tutorial) to implement rulers within a C# Windows Forms application? I want to display an image while showing rulers that indicate your mouse position to allow a more accurate positioning of the cursor. Just like the image below:\n\nI tried ... |
i.e. I just want them to be permanently accepted all the time.
| It sounds like you want to ensure that certain conditions or requests are always met or recognized. Could you please provide more context or specify what you are referring to? This way, I can give you a more tailored response! | 35,582 | [
{
"from": "human",
"value": "i.e. I just want them to be permanently accepted all the time.\n"
},
{
"from": "gpt",
"value": "It sounds like you want to ensure that certain conditions or requests are always met or recognized. Could you please provide more context or specify what you are referring... |
I use C#, IIS, ASP.NET, SQL Server.
Is there a third-party platform I can easily integrate into my system, to handle password management?
It would have to integrate 100% (no OpenID), so that the users would not notice.
| Yes, there are several third-party platforms that can be integrated into your C#, IIS, ASP.NET, and SQL Server system for handling password management while providing a seamless experience for users. Here are a few popular options that might suit your needs:
1. **Auth0**: Auth0 is a popular identity management platfor... | 30,511 | [
{
"from": "human",
"value": "I use C#, IIS, ASP.NET, SQL Server.\nIs there a third-party platform I can easily integrate into my system, to handle password management? \nIt would have to integrate 100% (no OpenID), so that the users would not notice.\n"
},
{
"from": "gpt",
"value": "Yes, there a... |
Let's say branch B is a topic branch off of branch A, and you want those changes in branch C. What does it mean when you cherry-pick the merge commit of branch A and branch B to branch C?
For example, if you use the -m flag to specify the old HEAD of branch A to cherry-pick the merge to branch C, does that simply mean... | Cherry-picking a merge commit, especially using the `-m` flag, can be a bit tricky. Let's break it down in your scenario.
### Cherry-Picking a Merge Commit
When you cherry-pick a merge commit, you are effectively choosing to apply the changes introduced by that merge commit to the current branch you are on (in this c... | 28,611 | [
{
"from": "human",
"value": "Let's say branch B is a topic branch off of branch A, and you want those changes in branch C. What does it mean when you cherry-pick the merge commit of branch A and branch B to branch C?\nFor example, if you use the -m flag to specify the old HEAD of branch A to cherry-pick th... |
Is there a way to search Microsoft Visual SourceSafe 6.0d for all files tagged with a specific label?
| Yes, in Microsoft Visual SourceSafe 6.0d, you can search for all files that have been tagged with a specific label by using the SourceSafe Explorer or the command line.
### Using SourceSafe Explorer:
1. Open **Visual SourceSafe Explorer**.
2. Navigate to the project that you want to search within.
3. Right-click on th... | 32,765 | [
{
"from": "human",
"value": "Is there a way to search Microsoft Visual SourceSafe 6.0d for all files tagged with a specific label?\n"
},
{
"from": "gpt",
"value": "Yes, in Microsoft Visual SourceSafe 6.0d, you can search for all files that have been tagged with a specific label by using the Sour... |
I've been working through a recent Computer Science homework involving recursion and big-O notation. I believe I understand this pretty well (certainly not perfectly, though!) But there is one question in particular that is giving me the most problems. The odd thing is that by looking it, it looks to be the most simple... | To analyze the recurrence relation you've provided, we can use the recurrence tree method or the Master Theorem. Let's break down the recurrence:
The recurrence is:
- T(1) = 2
- T(n) = 2T(n - 1) + 1 for n > 1
### Step 1: Unroll the recurrence
To understand the growth, let's unroll the recurrence for a few levels:
1... | 29,142 | [
{
"from": "human",
"value": "I've been working through a recent Computer Science homework involving recursion and big-O notation. I believe I understand this pretty well (certainly not perfectly, though!) But there is one question in particular that is giving me the most problems. The odd thing is that by l... |
I like Vim's visual mode. v for highlight/select chars or lines, Ctrlv for rectangle highlighting, as far as I know (I am a beginner). Is there any way to use visual mode to highlight last two chars, for example, on each line for some selected lines? The selected lines are in different length. Basically, I would like t... | In Vim, you can indeed use visual mode to highlight the last two characters of each line within a selected range of lines. However, visual mode alone may not be the most efficient way to achieve this specific task. Instead, you can use a combination of visual selection and normal mode commands to remove the last two ch... | 30,932 | [
{
"from": "human",
"value": "I like Vim's visual mode. v for highlight/select chars or lines, Ctrlv for rectangle highlighting, as far as I know (I am a beginner). Is there any way to use visual mode to highlight last two chars, for example, on each line for some selected lines? The selected lines are in di... |
Just to make this clear - what is the difference between:
String(value)
and
value as String
What are the cases where you would use one over the other? They seem interchangeable...
| The two expressions `String(value)` and `value as String` are used in different contexts and have different purposes. Here's a breakdown of the differences:
### `String(value)`
- **Type**: This is a function call that explicitly converts a value to a string.
- **Use Case**: You would typically use this when you want ... | 30,935 | [
{
"from": "human",
"value": "Just to make this clear - what is the difference between:\nString(value)\n\nand\nvalue as String\n\nWhat are the cases where you would use one over the other? They seem interchangeable...\n"
},
{
"from": "gpt",
"value": "The two expressions `String(value)` and `valu... |
How can I set cron to run certain commands every one and a half hours?
| In a cron job, you can schedule tasks to run at specific intervals. However, cron does not support fractional hours directly. To achieve a schedule of every one and a half hours, you can set up two separate entries in your crontab file.
### Method 1: Two Separate Cron Entries
You can create two separate cron entries ... | 31,119 | [
{
"from": "human",
"value": "How can I set cron to run certain commands every one and a half hours?\n"
},
{
"from": "gpt",
"value": "In a cron job, you can schedule tasks to run at specific intervals. However, cron does not support fractional hours directly. To achieve a schedule of every one an... |
CVS and Subversion both have a handy merge feature so that when you update a source file that you have modified, it merges in changes that others have made on the same file.
However, if your changes and the other ones are incompatible - generally if you have both changed the same parts of the code - it will create a co... | Both CVS and Subversion (SVN) can be tricky when dealing with whitespace and formatting issues during merges. However, there are a few approaches you can take to mitigate the problem of merge conflicts caused by differing development environments.
### For Subversion (SVN)
1. **Use an External Merge Tool**: You can co... | 28,081 | [
{
"from": "human",
"value": "CVS and Subversion both have a handy merge feature so that when you update a source file that you have modified, it merges in changes that others have made on the same file.\nHowever, if your changes and the other ones are incompatible - generally if you have both changed the sa... |
I want to do a conditional rendering at the layout level based on the actual template has defined content_for(:an__area), any idea how to get this done?
| In a Ruby on Rails application, conditional rendering based on the content defined in a specific view area (using `content_for`) can be done in your layout file. The `content_for` helper allows you to define a content block in your views that can be accessed later in your layout.
Here’s a step-by-step approach to cond... | 30,073 | [
{
"from": "human",
"value": "I want to do a conditional rendering at the layout level based on the actual template has defined content_for(:an__area), any idea how to get this done?\n"
},
{
"from": "gpt",
"value": "In a Ruby on Rails application, conditional rendering based on the content define... |
Given this HTML:
<div>foo</div><div>bar</div><div>baz</div>
How do you make them display inline like this:
foo bar baz
not like this:
foo
bar
baz
| To make the `<div>` elements display inline, you can use CSS to change their display property. By default, `<div>` elements are block-level elements, which means they take up the full width available and stack on top of each other. To display them inline, you can set their display property to `inline`, `inline-block`, ... | 31,340 | [
{
"from": "human",
"value": "Given this HTML:\n<div>foo</div><div>bar</div><div>baz</div>\n\nHow do you make them display inline like this:\n\nfoo bar baz\n\nnot like this:\n\nfoo\n bar\n baz \n\n"
},
{
"from": "gpt",
"value": "To make the `<div>` elements display inline, you can use CSS to c... |
I am instantiating a class A (which I am importing from somebody
else, so I can't modify it) into my class X.
Is there a way I can intercept or wrap calls to methods in A?
I.e., in the code below can I call
x.a.p1()
and get the output
X.pre
A.p1
X.post
Many TIA!
class A:
# in my real application, this is an impor... | Yes, you can wrap or intercept calls to methods in the class `A` by using a technique known as method overriding via a proxy or by using a decorator. Since you cannot modify class `A`, you can create a wrapper class that will manage the instantiation of `A` and override its methods.
Here’s how you can do it using a si... | 30,576 | [
{
"from": "human",
"value": "I am instantiating a class A (which I am importing from somebody\nelse, so I can't modify it) into my class X.\nIs there a way I can intercept or wrap calls to methods in A?\nI.e., in the code below can I call\nx.a.p1()\n\nand get the output\nX.pre\nA.p1\nX.post\n\nMany TIA!\ncl... |
Is it possible to add custom command-line arguments to an Eclipse .app folder? In my particular case, I'm working with ZendStudio. I'm assuming the base Eclipse release would behave the same way.
I've found what looks like two different places that could work, but neither yield any results:
ZendStudio.app\Contents\info... | Yes, it is possible to add custom command-line arguments to an Eclipse application (including ZendStudio, which is based on Eclipse). However, modifying the `info.plist` or `ZendStudio.ini` files directly won't help you pass command-line arguments when launching the application.
Instead, you can use a couple of differ... | 30,954 | [
{
"from": "human",
"value": "Is it possible to add custom command-line arguments to an Eclipse .app folder? In my particular case, I'm working with ZendStudio. I'm assuming the base Eclipse release would behave the same way.\nI've found what looks like two different places that could work, but neither yield... |
What is the difference between new/delete and malloc/free?
Related (duplicate?): In what cases do I use malloc vs new?
| `new` and `delete` are operators in C++ used for dynamic memory allocation and deallocation of objects, while `malloc` and `free` are functions in C used for allocating and freeing memory.
Here's a breakdown of the differences and use cases for each:
### `new` and `delete`
1. **C++ Operators**: `new` and `delete` are... | 27,454 | [
{
"from": "human",
"value": "What is the difference between new/delete and malloc/free?\nRelated (duplicate?): In what cases do I use malloc vs new?\n"
},
{
"from": "gpt",
"value": "`new` and `delete` are operators in C++ used for dynamic memory allocation and deallocation of objects, while `mal... |
If I want to put a form up on SharePoint, is it easier to use InfoPath or build a custom web part in C#? Are there other options that I should consider?
What are the requirements and hurdles for each option?
| When deciding how to create a form in SharePoint, you have several options, including InfoPath, custom web parts in C#, and other tools. Each has its pros and cons based on your specific needs. Here’s a breakdown of the options:
### Option 1: InfoPath
**Pros:**
- **Ease of Use:** InfoPath provides a user-friendly inte... | 24,309 | [
{
"from": "human",
"value": "If I want to put a form up on SharePoint, is it easier to use InfoPath or build a custom web part in C#? Are there other options that I should consider? \nWhat are the requirements and hurdles for each option?\n"
},
{
"from": "gpt",
"value": "When deciding how to c... |
We developed a website for a client and he has purchased the .com, .net, .info versions of the domain.
Is there any way to redirect all to the same page without being considered by Google as duplicated content and therefore penalized in the ranking position?
| Yes, you can redirect the various domain versions (.com, .net, .info) to a single primary domain without being penalized for duplicate content. The recommended method to achieve this is through 301 redirects, which indicate a permanent redirection from one URL to another. Here’s how to do it:
1. **Choose a Primary Dom... | 31,910 | [
{
"from": "human",
"value": "We developed a website for a client and he has purchased the .com, .net, .info versions of the domain.\nIs there any way to redirect all to the same page without being considered by Google as duplicated content and therefore penalized in the ranking position?\n"
},
{
"fr... |
Given an EmployeeId, how can I construct a Linq to Sql query to find all of the ancestors of the employee? Each EmployeeId has an associated SupervisorId (see below).
For example, a query of the ancestors for EmployeeId 6 (Frank Black) should return Jane Doe, Bob Smith, Joe Bloggs, and Head Honcho.
If necessary, I can... | To improve the performance of your query for finding the ancestors of an employee in a hierarchy (using the Supervisor relationship), you can leverage a single database call to retrieve all employees and then process the hierarchy in memory. This way, you avoid multiple database round trips.
Here's how you can do it u... | 30,841 | [
{
"from": "human",
"value": "Given an EmployeeId, how can I construct a Linq to Sql query to find all of the ancestors of the employee? Each EmployeeId has an associated SupervisorId (see below).\nFor example, a query of the ancestors for EmployeeId 6 (Frank Black) should return Jane Doe, Bob Smith, Joe Bl... |
I used to do the following to execute javascript from the server:
Page.ClientScript.RegisterStartupScript( ... );
And it would execute when the page loads back at the client. I am now modifing existing pages to use UpdatePanels and my javascript is no longer being fired.
| When using ASP.NET UpdatePanels, the page's lifecycle is altered, and traditional methods of executing JavaScript code, like `Page.ClientScript.RegisterStartupScript`, may not work as expected because these methods are designed for full postbacks rather than partial postbacks.
To execute JavaScript after an UpdatePane... | 31,746 | [
{
"from": "human",
"value": "I used to do the following to execute javascript from the server:\nPage.ClientScript.RegisterStartupScript( ... );\n\nAnd it would execute when the page loads back at the client. I am now modifing existing pages to use UpdatePanels and my javascript is no longer being fired.\n"
... |
I found a good description on wikipedia with a few reference links, but there may be better ones, please help me to find these!
To be clear, I am not looking for implementation for any language specific implementation guides, just the pure concept.
| Certainly! If you're looking for pure conceptual explanations of a specific topic without the implementation details in any programming language, I can provide some suggestions for types of resources you might explore:
1. **Online Educational Platforms**: Websites like Coursera, edX, or Khan Academy often have courses... | 27,326 | [
{
"from": "human",
"value": "I found a good description on wikipedia with a few reference links, but there may be better ones, please help me to find these!\nTo be clear, I am not looking for implementation for any language specific implementation guides, just the pure concept.\n"
},
{
"from": "gpt"... |
I'm having some trouble importing and accessing a private key with the ASPNET user.
I know that when one imports a private key (.pfx file) manually, in windows, you get an option to mark the key as exportable.
Now, as far as I can tell, this is needed in order to retrieve that private key later on.
My problem comes in ... | The issue you're facing likely stems from how the `X509Certificate2` class is handling the private key when you import the `.pfx` file. When importing a certificate with a private key, you need to ensure that you are importing it with the right settings to retain the exportability of the private key.
The `X509Certifi... | 26,113 | [
{
"from": "human",
"value": "I'm having some trouble importing and accessing a private key with the ASPNET user.\nI know that when one imports a private key (.pfx file) manually, in windows, you get an option to mark the key as exportable.\nNow, as far as I can tell, this is needed in order to retrieve that... |
I'm using NHibernate mappings as a defining schema for my app in the development phase and for the schema definition I'm using the NHibernate.Tool.hbm2ddl.SchemaExport() method to generate a createscript.
Now, I have considered using the Configuration.GenerateSchemaUpdateScript() method to generate database changescrip... | Using NHibernate's `GenerateSchemaUpdateScript` method to manage schema changes can be a viable approach, especially during the development phase. However, there are several considerations and potential drawbacks that you should be aware of when adopting this strategy for managing your database schema updates:
### Adv... | 29,495 | [
{
"from": "human",
"value": "I'm using NHibernate mappings as a defining schema for my app in the development phase and for the schema definition I'm using the NHibernate.Tool.hbm2ddl.SchemaExport() method to generate a createscript.\nNow, I have considered using the Configuration.GenerateSchemaUpdateScript... |
I have a few places in the code where I need to use the TimeZone. I can get the timezone name using DateTime::TimeZone. Is it reasonable to put the timezone name in a constant? Or should it be in a variable?
| Whether to use a constant or a variable for storing the timezone name in your code depends on how you plan to use it.
### Use a Constant When:
1. **Fixed Value**: The timezone name is fixed and will not change during the execution of your application. For example, if you are always using "America/New_York", it makes s... | 33,336 | [
{
"from": "human",
"value": "I have a few places in the code where I need to use the TimeZone. I can get the timezone name using DateTime::TimeZone. Is it reasonable to put the timezone name in a constant? Or should it be in a variable?\n"
},
{
"from": "gpt",
"value": "Whether to use a constant ... |
I have Virtual PC 2007. I am writing a C# program that will run on the Host and Virtual. It needs to communicate both ways.
What is the best way to do this?
Can it be done in a way that does not require changing Virtual settings?
(the OSs will be XP, Vista, Server 2000 / 2003)
| Communicating between a host machine and a virtual machine using Virtual PC 2007 can be a bit challenging, especially since you want to avoid changing the virtual machine's settings. However, here are some approaches that you can consider:
### 1. **Using Network Communication**
If the virtual machine is set up to use ... | 26,812 | [
{
"from": "human",
"value": "I have Virtual PC 2007. I am writing a C# program that will run on the Host and Virtual. It needs to communicate both ways.\nWhat is the best way to do this?\nCan it be done in a way that does not require changing Virtual settings?\n(the OSs will be XP, Vista, Server 2000 / 20... |
All of the various postings, when speaking of Setup projects in vs2005, simply say "the properties are there" and/or "In Studio, I just click on the project name in the Explorer and I get the property window typical to other projects, and it's right there." BUT I DON'T!! I get a very limited list of properties (Outpu... | It sounds like you're experiencing frustration with accessing the full set of properties for your Setup project in Visual Studio 2005. Here’s how you can access more properties for your Setup project:
1. **Open the Setup Project**: Make sure that you have your Setup project selected in the Solution Explorer.
2. **Che... | 28,753 | [
{
"from": "human",
"value": "All of the various postings, when speaking of Setup projects in vs2005, simply say \"the properties are there\" and/or \"In Studio, I just click on the project name in the Explorer and I get the property window typical to other projects, and it's right there.\" BUT I DON'T!! I... |
If I have a type defined as a set of an enumerated type, it's easy to create an empty set with [], but how do I create a full set?
EDIT: Yeah, the obvious solution is to use a for loop. That's also a really bad solution if there's another way. Does anyone know of a way that'll work in constant time?
| To create a full set from an enumerated type, you can use a few different approaches depending on the programming language you are using and the specific features it offers. Here's how you can do it in a few common programming languages:
### Python
If you have an enumerated type using the `Enum` class, you can easily ... | 26,683 | [
{
"from": "human",
"value": "If I have a type defined as a set of an enumerated type, it's easy to create an empty set with [], but how do I create a full set?\nEDIT: Yeah, the obvious solution is to use a for loop. That's also a really bad solution if there's another way. Does anyone know of a way that'l... |
If I use multiple repositories, all located under a single root folder, how can I set it up so that they will use a single master svnconf/passwd file for setup but still allow me to customize each if the need arises?
This is on Windows, but I guess the process would be similar on other systems.
Update: I am using svnse... | To configure multiple SVN repositories under a single root folder while using a single `svnserve` configuration file and password file, you can follow these steps. The setup will allow you to share common settings while providing the flexibility to customize each repository if necessary.
### Step 1: Setting Up Directo... | 26,393 | [
{
"from": "human",
"value": "If I use multiple repositories, all located under a single root folder, how can I set it up so that they will use a single master svnconf/passwd file for setup but still allow me to customize each if the need arises?\nThis is on Windows, but I guess the process would be similar ... |
Is LINQ a kind of Object-Relational Mapper?
| LINQ (Language Integrated Query) is not an Object-Relational Mapper (ORM) by itself, but it is often used in conjunction with ORMs to facilitate querying data. LINQ provides a way to query collections of objects in a consistent manner across different data sources (like databases, XML, or in-memory collections) using a... | 29,980 | [
{
"from": "human",
"value": "Is LINQ a kind of Object-Relational Mapper?\n"
},
{
"from": "gpt",
"value": "LINQ (Language Integrated Query) is not an Object-Relational Mapper (ORM) by itself, but it is often used in conjunction with ORMs to facilitate querying data. LINQ provides a way to query c... |
I am trying to upload files using the FileReference class. Files >2MB all work correctly but files <2MB cause this error:
"java.io.IOException: Corrupt form data: premature ending"
On the server I am using the com.oreilly.servlet package to handle the request.
I have used this package many times to successfully handl... | The error you're encountering, `java.io.IOException: Corrupt form data: premature ending`, typically indicates that the server is unable to fully read the multipart form data being sent from the client. Since you mentioned that files larger than 2MB are being handled correctly while smaller files are not, this suggests... | 27,310 | [
{
"from": "human",
"value": "I am trying to upload files using the FileReference class. Files >2MB all work correctly but files <2MB cause this error:\n\n\"java.io.IOException: Corrupt form data: premature ending\"\n\nOn the server I am using the com.oreilly.servlet package to handle the request.\nI have us... |
We are developing a WPF application that uses the System.AddIn framework to host add-ins that display additional WPF content. Everything seems to be working fine, but overnight, the application threw the following NullReferenceException:
Message: Error : Object reference not set to an instance of an object.
StackTrac... | The `NullReferenceException` you're encountering appears to be happening in the WPF internals when handling keyboard input for your add-ins using the System.AddIn framework. Since it’s occurring in the framework code and not in your application, it can be challenging to determine the exact cause. However, here are some... | 30,963 | [
{
"from": "human",
"value": "We are developing a WPF application that uses the System.AddIn framework to host add-ins that display additional WPF content. Everything seems to be working fine, but overnight, the application threw the following NullReferenceException:\n\nMessage: Error : Object reference not... |
What is the name of the technology behind Google Maps which allows the server to send only the part of the map requested from the user to enhance the performance, and is there any library to handle this?
| The technology behind Google Maps that allows the server to send only the requested part of the map to enhance performance is known as **"tiling"**. In this approach, the map is divided into smaller square sections called tiles, which can be loaded independently based on the user's viewport. This way, only the relevant... | 32,582 | [
{
"from": "human",
"value": "What is the name of the technology behind Google Maps which allows the server to send only the part of the map requested from the user to enhance the performance, and is there any library to handle this?\n"
},
{
"from": "gpt",
"value": "The technology behind Google M... |
I'm using C# on Framework 3.5. I'm looking to quickly sort a Generic List<T>. For the sake of this example, let's say I have a List of a Person type with a property of lastname. How would I sort this List using a lambda expression?
List<Person> people = PopulateList();
people.OrderBy(???? => ?????)
| In C#, you can use LINQ to sort a `List<T>` easily with a lambda expression. Since you're using .NET Framework 3.5, you will need to include the `System.Linq` namespace, which provides the `OrderBy` method.
Here's how you can sort a `List<Person>` by the `LastName` property using a lambda expression:
```csharp
using ... | 30,721 | [
{
"from": "human",
"value": "I'm using C# on Framework 3.5. I'm looking to quickly sort a Generic List<T>. For the sake of this example, let's say I have a List of a Person type with a property of lastname. How would I sort this List using a lambda expression?\nList<Person> people = PopulateList();\npeop... |
I have a large collection of data in an excel file (and csv files). The data needs to be placed into a database (mysql). However, before it goes into the database it needs to be processed..for example if columns 1 is less than column 3 add 4 to column 2. There are quite a few rules that must be followed before the info... | Given your requirements and current implementation using the Chain of Responsibility design pattern, there are definitely ways you can improve your data processing setup for CSV/Excel data before persisting it to a MySQL database. Here's a potential design approach that could enhance maintainability, readability, and e... | 18,107 | [
{
"from": "human",
"value": "I have a large collection of data in an excel file (and csv files). The data needs to be placed into a database (mysql). However, before it goes into the database it needs to be processed..for example if columns 1 is less than column 3 add 4 to column 2. There are quite a few ru... |
I have headers in <h1> through <h6> tags. Is there a way that I can use JavaScript to generate a table of contents for the contents that serves as anchor tags as well?
I would like the output to be something like:
<ol>
<li>Header 1</li>
<li>Header 1</li>
<li>Header 2</li>
<li>Header 3</li>
<... | You can indeed generate a table of contents (TOC) dynamically using JavaScript. This is a common requirement, and there are existing solutions, but creating a simple one from scratch is a great exercise. Below is a step-by-step guide along with a code example to help you achieve this:
### Step 1: Prepare Your HTML Str... | 25,764 | [
{
"from": "human",
"value": "I have headers in <h1> through <h6> tags. Is there a way that I can use JavaScript to generate a table of contents for the contents that serves as anchor tags as well?\nI would like the output to be something like:\n<ol>\n <li>Header 1</li>\n <li>Header 1</li>\n <li... |
I'm looking for programs/projects that are small to moderate size that show good modern practices for developing applications in C on Linux. I'd like to learn by example and curious how things are done out in the real world.
| Exploring open-source C projects can be a great way to learn modern practices for developing applications in C on Linux. Here are some small to moderate-sized projects that demonstrate good coding practices, project structure, and usage of modern tools:
### 1. **GLib**
- **Repository**: [GLib on GitLab](https://gitlab... | 23,857 | [
{
"from": "human",
"value": "I'm looking for programs/projects that are small to moderate size that show good modern practices for developing applications in C on Linux. I'd like to learn by example and curious how things are done out in the real world.\n"
},
{
"from": "gpt",
"value": "Exploring... |
I'm working on an ASP.NET project using MVP architecture. We would like to use an object validation framework in the domain, but are not that familiar with available frameworks other than the Castle.Components.Validator namespace.
Does anyone have experience with any other light-weight object validation frameworks. ... | In the ASP.NET ecosystem, there are several lightweight object validation frameworks that can be used in a domain-driven design context, particularly with the MVP architecture. Here are a few popular options beyond `Castle.Components.Validator` that you might consider:
### 1. **FluentValidation**
FluentValidation is a... | 30,117 | [
{
"from": "human",
"value": "I'm working on an ASP.NET project using MVP architecture. We would like to use an object validation framework in the domain, but are not that familiar with available frameworks other than the Castle.Components.Validator namespace. \nDoes anyone have experience with any other l... |
I want to be able to run a function in my firefox sidebar js file when the selected tab in the main content window is reloaded or changed. So the sidebar can change depending on the site the user is looking at.
Anyone able to point me in the right direction?
| To run a function in your Firefox sidebar JavaScript file when the selected tab in the main content window is reloaded or changed, you can utilize the WebExtensions API. Specifically, you will want to listen to the `tabs.onUpdated` event for updates and the `tabs.onActivated` event for tab changes. Here's a basic guide... | 28,845 | [
{
"from": "human",
"value": "I want to be able to run a function in my firefox sidebar js file when the selected tab in the main content window is reloaded or changed. So the sidebar can change depending on the site the user is looking at. \nAnyone able to point me in the right direction?\n"
},
{
"f... |
I have a unique situation where I need to implement client certificate authentication over HTTPS between IE browser and IIS 6. The browser and IIS are separated by a firewall that only allows the browser to connect to IIS on the SSL port.
We have an internal certificate server on the same network as IIS. I've generat... | When working with client certificate authentication in Internet Explorer (IE) and IIS, there are a few important aspects to consider to ensure that the client certificate is sent correctly:
### 1. Client Certificate Subject
Yes, the Subject field of the client certificate does matter. When a client certificate is issu... | 29,872 | [
{
"from": "human",
"value": "I have a unique situation where I need to implement client certificate authentication over HTTPS between IE browser and IIS 6. The browser and IIS are separated by a firewall that only allows the browser to connect to IIS on the SSL port.\nWe have an internal certificate server... |
We don't teach children calculus first. We first teach them arithmetic, then algebra, then geometry, the analytical geometry, then finally calculus.
Why then, do we teach our computer scientists frameworks and IDE first. Some curriculum do force students to learn computer science fundamentals, but the vast majority o... | You've raised some important points about the structure of computer science education and the way we introduce students to the discipline. The analogy between teaching mathematical concepts and computer science fundamentals is quite apt. Here are some thoughts on how we might better foster an understanding of fundament... | 28,585 | [
{
"from": "human",
"value": "We don't teach children calculus first. We first teach them arithmetic, then algebra, then geometry, the analytical geometry, then finally calculus.\nWhy then, do we teach our computer scientists frameworks and IDE first. Some curriculum do force students to learn computer sci... |
This came up when answering another user's question (TheSoftwareJedi)...
Given the following table:
ROW_PRIORITY COL1 COL2 COL3
0 0.1 100 <NULL>
12 <NULL> <NULL> 3
24 0.2 <NULL> <NULL>
and the following query:
select 'B' METRIC, ROW_PRIORITY,
las... | The behavior you're observing with the `LAST_VALUE` function in your query is due to how window functions work in SQL, specifically regarding the ordering and window frame.
The `LAST_VALUE` function retrieves the last value in the specified order within the current window frame. By default, the frame for `LAST_VALUE` ... | 30,625 | [
{
"from": "human",
"value": "This came up when answering another user's question (TheSoftwareJedi)...\nGiven the following table:\nROW_PRIORITY COL1 COL2 COL3\n0 0.1 100 <NULL>\n12 <NULL> <NULL> 3\n24 0.2 <NULL> <NULL>\n\nand the following quer... |
Hopefully I can do the problem justice, because it was too difficult to summarise it in the title! (suggestions are welcome in the comments)
Right, so here's my table:
Tasks
task_id (number)
job_id (number)
to_do_by_date (date)
task_name (varchar / text)
status (number)
complet... | To solve your problem using Oracle SQL, we need to create a query that returns tasks according to the complex criteria you've specified. Here's a breakdown of the requirements and how to approach them:
1. **Select tasks where at least one task for the job has a status other than "Done" (i.e., `status <> 3`), but if al... | 25,951 | [
{
"from": "human",
"value": "Hopefully I can do the problem justice, because it was too difficult to summarise it in the title! (suggestions are welcome in the comments)\nRight, so here's my table:\nTasks\n task_id (number)\n job_id (number)\n to_do_by_date (date)\n task_name (varc... |
I have a C program with an embedded Perl interpreter. I want to be able to precompile some Perl code from within the program. How do I do that?
Rationale (if anyone is interested) is to be able to compile it once, store the parse tree, and execute many times (as long as the compiled code does not change).
Thanks!
Madhu... | To precompile Perl code from within a C program using the embedded Perl interpreter, you can utilize the Perl API to compile your Perl code into a parse tree and then store that parse tree for later execution. Here's how you can achieve this in Perl 5.8:
### Steps to Precompile and Store Perl Code in C
1. **Include R... | 27,370 | [
{
"from": "human",
"value": "I have a C program with an embedded Perl interpreter. I want to be able to precompile some Perl code from within the program. How do I do that?\nRationale (if anyone is interested) is to be able to compile it once, store the parse tree, and execute many times (as long as the com... |
I have a WinForms C# application using a MS SQL Server Express database. The application is deployed on the PCs of our customers and they don't have computer related knowledge.
The application updates the database regularly and I see a lot of fragmentation on the index files. How do I keep the database healthy/respons... | Maintaining a SQL Server database, especially one that is heavily updated, is essential for performance. Index fragmentation can lead to slow queries, and it's wise to take steps to mitigate this. Your idea to use a stored procedure to reorganize indexes is on the right track. Below, I'll guide you on how to create a s... | 26,128 | [
{
"from": "human",
"value": "I have a WinForms C# application using a MS SQL Server Express database. The application is deployed on the PCs of our customers and they don't have computer related knowledge. \nThe application updates the database regularly and I see a lot of fragmentation on the index files. ... |
I have compression enabled within IIS7 and it works as expected on all responses except for those constructed by ASP.NET AJAX. I have a web service that provides data to the client. When the web service is called directly, it is properly compressed. However, when it is called via ASP.NET AJAX, the JSON response is n... | If you're experiencing issues with GZip compression not working for JSON responses when using ASP.NET AJAX in IIS7, you can take the following steps to ensure that the responses are compressed correctly:
### 1. Ensure Compression is Enabled in IIS
First, make sure that both static and dynamic content compression are ... | 24,856 | [
{
"from": "human",
"value": "I have compression enabled within IIS7 and it works as expected on all responses except for those constructed by ASP.NET AJAX. I have a web service that provides data to the client. When the web service is called directly, it is properly compressed. However, when it is called... |
I want to add complex databinding to my custom winforms control, so I can do the following:
myControl.DisplayMember = "Name";
myControl.ValueMember = "Name";
myControl.DataSource = new List<someObject>();
Does anyone know what interfaces, etc. have to be implemented to achieve this?
I have had a look into it and all I... | To implement complex data binding in a custom WinForms control, you need to implement a few interfaces and properties that are part of the data binding infrastructure in Windows Forms. Here's a high-level overview of what you need to do:
### 1. Implement Required Interfaces
You should implement the following interfac... | 26,933 | [
{
"from": "human",
"value": "I want to add complex databinding to my custom winforms control, so I can do the following:\nmyControl.DisplayMember = \"Name\";\nmyControl.ValueMember = \"Name\";\nmyControl.DataSource = new List<someObject>();\n\nDoes anyone know what interfaces, etc. have to be implemented to... |
What single aspect of agile development should we implement first to improve our development process, and why?
I'm in a situation that's requiring me to "tweak" my process, rather than re-engineer it, and "agile" seems to be the mantra of the day. If we can make only one change that will improve something--quality, ... | In your current software development life cycle (SDLC), it seems like you have a rigid process that may benefit greatly from increased flexibility and responsiveness to change. Given your context as a "restartup" with legacy products and a small team, one of the most impactful changes you could implement first is adopt... | 31,562 | [
{
"from": "human",
"value": "What single aspect of agile development should we implement first to improve our development process, and why? \nI'm in a situation that's requiring me to \"tweak\" my process, rather than re-engineer it, and \"agile\" seems to be the mantra of the day. If we can make only one... |
I have to create the sin function from scratch in my Comp Sci class, and I am getting close to a solution. However, I am still having a few problems. If I put in a value of .5PI or less it works, but otherwise I get the incorrect result. Here is the code I have so far:
double i=1;
double sinSoFar = 0;
int term = 1;
whi... | It looks like you're trying to implement the Taylor series expansion for the sine function. The Taylor series for sin(x) around 0 is given by:
\[
\sin(x) = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{(2n+1)!}
\]
From your code, I see a few issues that could lead to incorrect results, especially for values of `sinOf` g... | 28,237 | [
{
"from": "human",
"value": "I have to create the sin function from scratch in my Comp Sci class, and I am getting close to a solution. However, I am still having a few problems. If I put in a value of .5PI or less it works, but otherwise I get the incorrect result. Here is the code I have so far:\ndouble i... |
I work in a shop that is certified at CMMI level 5. This certification is important because it gives us access to certain customers and contracts. I'm looking at how to blend Scrum with CMMI. I've found some info on mixing Scrum with CMMI-3, but quite a bit of it is "hand wavy" and wouldn't hold up to intense scruti... | Blending Scrum with CMMI (Capability Maturity Model Integration), especially at Level 5, can indeed be a challenging but rewarding endeavor. CMMI focuses on process improvement and organizational maturity, while Scrum emphasizes agility and adaptability. Here are some insights based on experiences from organizations th... | 29,790 | [
{
"from": "human",
"value": "I work in a shop that is certified at CMMI level 5. This certification is important because it gives us access to certain customers and contracts. I'm looking at how to blend Scrum with CMMI. I've found some info on mixing Scrum with CMMI-3, but quite a bit of it is \"hand wa... |
It appears that Directory.GetFiles() in C# modifies the Last access date of a file.
I've googled for hours and can't seem to find a work around for this issue. Is there anyway to keep all the MAC (Modified, Accessed, Created) attributes of a file?
I'm using Directory.GetDirectories(), Directory.GetFiles(), and FileInf... | The issue you're experiencing with `Directory.GetFiles()` and `FileInfo.LastAccessTime` is related to how certain file operations can influence the access time of files on some file systems. Specifically, on Windows, accessing a file can result in its last access timestamp being updated.
To work around this issue and ... | 27,198 | [
{
"from": "human",
"value": "It appears that Directory.GetFiles() in C# modifies the Last access date of a file.\nI've googled for hours and can't seem to find a work around for this issue. Is there anyway to keep all the MAC (Modified, Accessed, Created) attributes of a file? \nI'm using Directory.GetDirec... |
I would like to be able to emulate the functionality of the "Presenter Tools" in MS Office. This requires the program to be able to detect and use an external/secondary monitor/projector.
Could somebody please point me in the right direction for achieving this.
I would like to use Java 1.5
Thankyou.
| Emulating the "Presenter Tools" functionality in Microsoft Office requires detecting an external/secondary monitor and managing windows accordingly in Java. Since you're using Java 1.5, there are certain limitations on libraries and frameworks you can utilize, but it's still feasible to achieve your goal. Below, I'll o... | 28,936 | [
{
"from": "human",
"value": "I would like to be able to emulate the functionality of the \"Presenter Tools\" in MS Office. This requires the program to be able to detect and use an external/secondary monitor/projector.\nCould somebody please point me in the right direction for achieving this.\nI would like... |
Scenario
I have two wrappers around Microsoft Office, one for 2003 and one for 2007. Since having two versions of Microsoft Office running side by side is "not officially possible" nor recommended by Microsoft, we have two boxes, one with Office 2003 and the other with Office 2007. We compile the wrappers separately. T... | This is indeed a challenging situation with multiple versions of Microsoft Office and the need to maintain compatibility with your application. Given your constraints and requirements, here are several strategies you can consider to simplify and automate your build process:
### 1. Use a Shared Interface
Create a comm... | 29,621 | [
{
"from": "human",
"value": "Scenario\nI have two wrappers around Microsoft Office, one for 2003 and one for 2007. Since having two versions of Microsoft Office running side by side is \"not officially possible\" nor recommended by Microsoft, we have two boxes, one with Office 2003 and the other with Office... |
#!/bin/bash
hello()
{
SRC=$1
DEST=$2
for IP in `cat /opt/ankit/configs/machine.configs` ; do
echo $SRC | grep '*' > /dev/null
if test `echo $?` -eq 0 ; then
for STAR in $SRC ; do
echo -en "$IP"
echo -en "\n\t ARG1=$STAR ARG2=$2\n\n"
d... | The issue you're encountering arises from the way shell globbing (wildcard expansion) works in bash. When you pass a pattern like `*.pdf` to your script, the shell expands that pattern to the actual files that match it before the script runs. As a result, the value of the `SRC` variable ends up being the matched files ... | 30,869 | [
{
"from": "human",
"value": "#!/bin/bash\n\nhello()\n{\n SRC=$1\n DEST=$2\n\n for IP in `cat /opt/ankit/configs/machine.configs` ; do\n echo $SRC | grep '*' > /dev/null\n if test `echo $?` -eq 0 ; then\n for STAR in $SRC ; do\n echo -en \"$IP\"\n ... |
"To help protect your security,
Explorer has restricted this webpage
from running scripts or ActiveX
controls that could access your
computer"
Whenever I add Flash movies or javascript code this message will show. It also shows for somebody else, so how do I get rid of this message? If I load or access some o... | The message you're seeing is related to Internet Explorer's security settings. It indicates that the browser is blocking certain scripts or ActiveX controls to protect users from potentially harmful content. Here are some steps you can take to address the issue:
### 1. Adjust Security Settings in Internet Explorer
Yo... | 29,511 | [
{
"from": "human",
"value": "\n\"To help protect your security,\n Explorer has restricted this webpage\n from running scripts or ActiveX\n controls that could access your\n computer\"\n\nWhenever I add Flash movies or javascript code this message will show. It also shows for somebody else, so how do I g... |
We have a software product that evolves at the rhythm of clients' needs and of a more general roadmap.
Because we are in a SCRUM project environment, it happens very regurlarly that a new feature makes its way to the product, and then we are confronted with the choice of:
implementing this feature in an already releas... | Managing feature implementation in a dynamic SCRUM environment, especially when dealing with rapid client requests and core changes, can indeed be a challenging balancing act. Here are some practices and strategies that you might consider to address these issues:
### 1. **Feature Toggles (Feature Flags)**
- **What it ... | 27,536 | [
{
"from": "human",
"value": "We have a software product that evolves at the rhythm of clients' needs and of a more general roadmap.\nBecause we are in a SCRUM project environment, it happens very regurlarly that a new feature makes its way to the product, and then we are confronted with the choice of:\n\nim... |
I am trying to write an interface between RSPEC (ruby flavoured BDD) and a Windows application. The application itself is written in an obscure language, but it has a C API to provide access. I've gone with Ruby/DL but am having difficulties getting even the most basic call to a DLL method to work. Here is what I ha... | It seems that you are on the right track with using `DL` to interface with the C API of your application, but there are a few key points regarding how to pass strings and pointers between Ruby and C that you need to address. Let's break it down step by step.
### Issues with Passing Strings
1. **Passing Strings:** In ... | 28,783 | [
{
"from": "human",
"value": "I am trying to write an interface between RSPEC (ruby flavoured BDD) and a Windows application. The application itself is written in an obscure language, but it has a C API to provide access. I've gone with Ruby/DL but am having difficulties getting even the most basic call to... |
I keep on hearing about concurrent programing every where.
Can you guys throw some light on what it's and how c++ new standards facilitate doing the same?
| Concurrent programming is a paradigm that allows multiple computations to run simultaneously, which can lead to better resource utilization, improved performance, and responsiveness in applications. It is particularly important in multi-core and distributed systems, where multiple threads or processes can be executed i... | 26,167 | [
{
"from": "human",
"value": "I keep on hearing about concurrent programing every where.\nCan you guys throw some light on what it's and how c++ new standards facilitate doing the same?\n"
},
{
"from": "gpt",
"value": "Concurrent programming is a paradigm that allows multiple computations to run ... |
I am trying to make my window manager conform to the ICCCM specifications. I fully understand the reason for the _NET_SUPPORTING_WM_CHECK atom - this ensures that no invalid information stays whenever the window manager isn't running anymore.
What I don't understand is why are no other atoms like _NET_NUMBER_OF_DESKTOP... | The ICCCM (Inter-Client Communication Conventions Manual) and the Extended Window Manager Hints (EWMH) define a set of standards and conventions for window management in the X Window System, including how window managers and client applications should interact. The `_NET_SUPPORTING_WM_CHECK` atom plays a critical role ... | 30,017 | [
{
"from": "human",
"value": "I am trying to make my window manager conform to the ICCCM specifications. I fully understand the reason for the _NET_SUPPORTING_WM_CHECK atom - this ensures that no invalid information stays whenever the window manager isn't running anymore.\nWhat I don't understand is why are ... |
I am working with an existing code base made up of some COM interfaces written in C++ with a C# front end. There is some new functionality that needs to be added, so I'm having to modify the COM portions. In one particular case, I need to pass an array (allocated from C#) to the component to be filled.
What I would lik... | Given your constraints and requirements, it sounds like you're seeking a way to define your COM interface in a way that allows you to pass an array from C# without resorting to unsafe code or using `INT_PTR`. Here's how you can approach this:
### Suggested COM Interface Definition
You can define your COM method in ID... | 30,069 | [
{
"from": "human",
"value": "I am working with an existing code base made up of some COM interfaces written in C++ with a C# front end. There is some new functionality that needs to be added, so I'm having to modify the COM portions. In one particular case, I need to pass an array (allocated from C#) to the... |
Let's say I've got some Perl code that increments a column in a specific row of a database each time it's hit, and I'm expecting it to be hit pretty frequently, so I'd like to optimize it with FCGI. Right now, I basically wrapped most of the code in something like this:
while (FCGI::accept() >= 0) {
[code which curre... | When optimizing a Perl script that uses FastCGI (FCGI) for performance, one key factor to consider is the handling of database connections. In your case, since you're hitting the database frequently, it's typically more efficient to create a database connection outside of the FCGI loop. This approach will allow the scr... | 29,170 | [
{
"from": "human",
"value": "Let's say I've got some Perl code that increments a column in a specific row of a database each time it's hit, and I'm expecting it to be hit pretty frequently, so I'd like to optimize it with FCGI. Right now, I basically wrapped most of the code in something like this:\nwhile ... |
I've created a dtsx package with Sql Server Business Intelligence Development studio, and I am executing it using the dtexec utility. Using dtexec I am setting certain properties at runtime using the /set switch. So my command looks something like:
dtexec /f "mypackage.dtsx" /set
\Package.Connections[Destination].Prop... | The issue you are encountering when moving your SSIS package to a different system and running it with `dtexec` could be attributed to several factors. Here are some potential reasons and how to address them:
1. **Package Connections**: The error message indicates that the connection object `Destination` cannot be fou... | 28,316 | [
{
"from": "human",
"value": "I've created a dtsx package with Sql Server Business Intelligence Development studio, and I am executing it using the dtexec utility. Using dtexec I am setting certain properties at runtime using the /set switch. So my command looks something like:\ndtexec /f \"mypackage.dtsx\" ... |
I have a LINQ-to-SQL DataContext that represents a parent-child relationship of Products to Prices. I'm iterating through a list of products and retrieving the prices for each one. The problem is that the tables behind both the Products and Prices contain a list of Products or Prices for multiple environments, determi... | Yes, you can achieve this by using a combination of a custom `DataContext` and an extension method or property that encapsulates the filtering logic based on your environment parameters (Client, SalesOrg, and DistributionChannel). Here's how you could implement this approach.
### Step 1: Create a Custom DataContext
F... | 30,112 | [
{
"from": "human",
"value": "I have a LINQ-to-SQL DataContext that represents a parent-child relationship of Products to Prices. I'm iterating through a list of products and retrieving the prices for each one. The problem is that the tables behind both the Products and Prices contain a list of Products or ... |
I was wondering how to make a toolbar in MFC that used 24bit or 256 colour bitmaps rather than the horrible 16 colour ones.
Can anyone point me in the direction of some simple code?
Thanks
| Creating a toolbar in an MFC (Microsoft Foundation Class) application that uses 24-bit or 256-color bitmaps is certainly possible, although MFC's toolbar controls traditionally handle 16-color bitmaps. However, you can use the `CImageList` class to manage the images for your toolbar.
Here's a simple step-by-step guide... | 28,234 | [
{
"from": "human",
"value": "I was wondering how to make a toolbar in MFC that used 24bit or 256 colour bitmaps rather than the horrible 16 colour ones.\nCan anyone point me in the direction of some simple code?\nThanks\n"
},
{
"from": "gpt",
"value": "Creating a toolbar in an MFC (Microsoft Fou... |
I have a web-based application that notifies users of activity on the site via email. Users can choose which kinds of notifcations they want to receive. So far there are about 10 different options (each one is a true/false).
I'm currently storing this in one varchar field as a 0 or 1 separated by commas. For example:
1... | Storing multiple boolean flags (like notification preferences) in a single varchar field, as you currently do, can lead to complications in maintenance and scalability. There are more efficient and structured ways to handle this in a relational database that make it easier to add new notification types and manage the r... | 29,880 | [
{
"from": "human",
"value": "I have a web-based application that notifies users of activity on the site via email. Users can choose which kinds of notifcations they want to receive. So far there are about 10 different options (each one is a true/false).\nI'm currently storing this in one varchar field as a ... |
I just saw a really useful UI feature of the forthcoming Windows 7 ( visit http://www.gizmodo.com.au/2008/10/windows_7_walkthrough_boot_video_and_impressions-2.html and scroll down to the video entitled Super Scientific Video of New Window Resizing Feature)
In a nutshell you can drag a window by the title bar to the to... | Creating a feature similar to the Aero Snap functionality from Windows 7 can indeed be accomplished in .NET, although it does require some low-level Windows API calls to manage window positioning and drag events. Here's a high-level overview of how you could approach building such an application in C#.
### Overview of... | 25,677 | [
{
"from": "human",
"value": "I just saw a really useful UI feature of the forthcoming Windows 7 ( visit http://www.gizmodo.com.au/2008/10/windows_7_walkthrough_boot_video_and_impressions-2.html and scroll down to the video entitled Super Scientific Video of New Window Resizing Feature)\nIn a nutshell you ca... |
I have a custom application with a simple app.config specifying SQL Server name and Database, I want to prompt the user on application install for application configuration items and then update the app.config file.
I admit I'm totally new to setup projects and am looking for some guidance.
Thank You
Mark Koops
| Hello Mark,
To achieve your goal of prompting the user for configuration items during the installation of your custom application and then updating the `app.config` file accordingly, you can follow these steps:
### Steps to Create a Setup Project
1. **Create Your Application**: Ensure that your application is workin... | 26,299 | [
{
"from": "human",
"value": "I have a custom application with a simple app.config specifying SQL Server name and Database, I want to prompt the user on application install for application configuration items and then update the app.config file.\nI admit I'm totally new to setup projects and am looking for s... |
I have a TreeView windows forms control with an ImageList, and I want some of the nodes to display images, but the others to not have images.
I don't want a blank space where the image should be. I don't want an image that looks like the lines that the TreeView would draw if it didn't have an ImageList. How do I get ... | To achieve displaying images for only certain nodes in a `TreeView` control in WinForms, while avoiding blank spaces for nodes without images, you can simply set the `ImageIndex` and `SelectedImageIndex` properties of the nodes that require images, and leave these properties unset (or set them to -1) for nodes that do ... | 27,447 | [
{
"from": "human",
"value": "I have a TreeView windows forms control with an ImageList, and I want some of the nodes to display images, but the others to not have images.\nI don't want a blank space where the image should be. I don't want an image that looks like the lines that the TreeView would draw if i... |
I'm using the JSP displaytag tag lib to create HTML tables. I'd like the user to able to click on a column header in order to sort the data. My JSP code is shown below:
<display:table name="tableData" id="stat" sort="page">
<display:column property="name" title="Name" sortable="true"/>
<display:column property="age... | The `displaytag` library is primarily designed for server-side processing of data and does not support client-side sorting out of the box. When you set `sortable="true"` on a column, it generates a hyperlink that initiates a request to the server, and the server then sorts the data before sending it back to the client.... | 29,424 | [
{
"from": "human",
"value": "I'm using the JSP displaytag tag lib to create HTML tables. I'd like the user to able to click on a column header in order to sort the data. My JSP code is shown below:\n<display:table name=\"tableData\" id=\"stat\" sort=\"page\">\n <display:column property=\"name\" title=\"Nam... |
I've recently started using code coverage tools (particularily Emma and EclEmma), and I really like the view that it gives me as to the completeness of my unit tests - and the ability to see what areas of the code my unit tests aren't hitting at all. I currently work in an organization that doesn't do a lot of unit tes... | Your desire to achieve high code coverage through unit tests, especially in an environment where unit testing is not yet common, is commendable. However, it's essential to approach code coverage with a balanced perspective. While code coverage can provide insights into the completeness of your testing, it should not be... | 27,530 | [
{
"from": "human",
"value": "I've recently started using code coverage tools (particularily Emma and EclEmma), and I really like the view that it gives me as to the completeness of my unit tests - and the ability to see what areas of the code my unit tests aren't hitting at all. I currently work in an organ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.