instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I want to parse some HTML in order to find the values of some attributes/tags etc.
What HTML parsers do you recommend? Any pros and cons?
| There are several HTML parsers available for different programming languages, each with its own set of features, pros, and cons. Here are some popular ones:
### Python
1. **Beautiful Soup**
- **Pros**:
- Easy to use and beginner-friendly.
- Allows for simple searching and navigating of the parse tree.
... | 5,452 | [
{
"from": "human",
"value": "I want to parse some HTML in order to find the values of some attributes/tags etc.\nWhat HTML parsers do you recommend? Any pros and cons?\n"
},
{
"from": "gpt",
"value": "There are several HTML parsers available for different programming languages, each with its own... |
What are some reasons why PHP would force errors to show, no matter what you tell it to disable?
I have tried
error_reporting(0);
ini_set('display_errors', 0);
with no luck.
| If PHP continues to show errors despite your attempts to disable them, there could be several reasons for this behavior. Here are some potential causes and solutions:
1. **Configuration Files**: Check your `php.ini` file for settings that might override your script settings. Look for the following directives:
- `di... | 4,134 | [
{
"from": "human",
"value": "What are some reasons why PHP would force errors to show, no matter what you tell it to disable?\nI have tried \nerror_reporting(0);\nini_set('display_errors', 0); \n\nwith no luck.\n"
},
{
"from": "gpt",
"value": "If PHP continues to show errors despite your attempt... |
I have a structure which I need to populate and write to disk (several actually).
An example is:
byte-6
bit0 - original_or_copy
bit1 - copyright
bit2 - data_alignment_indicator
bit3 - PES_priority
bit4-bit5 - PES_scrambling control.
bit6-bit7 - reserved
In C I might do something like the following:
str... | In C#, you can achieve a similar behavior to C-style bit-fields using the `StructLayout` attribute in combination with a byte array or an integer to represent the packed bits, and a set of properties or methods to access each bit. Unfortunately, C# does not support bit-fields directly in structures like C/C++. However,... | 2,790 | [
{
"from": "human",
"value": "I have a structure which I need to populate and write to disk (several actually).\nAn example is:\nbyte-6 \nbit0 - original_or_copy \nbit1 - copyright \nbit2 - data_alignment_indicator \nbit3 - PES_priority \nbit4-bit5 - PES_scrambling control. \nbit6-bit7 - reserved \n... |
I'm trying to make the case for click-once and smart client development but my network support team wants to keep with web development for everything.
What is the best way to convince them that click-once and smart client development have a place in the business?
| To effectively argue in favor of ClickOnce and smart client development over a solely web-based approach, you'll want to emphasize the specific benefits and use cases where these technologies can provide significant advantages. Here are some key points to consider:
### 1. **Rich User Experience**
- **Performance**:... | 5,176 | [
{
"from": "human",
"value": "I'm trying to make the case for click-once and smart client development but my network support team wants to keep with web development for everything.\nWhat is the best way to convince them that click-once and smart client development have a place in the business?\n"
},
{
... |
Often I find myself interacting with files in some way but after writing the code I'm always uncertain how robust it actually is. The problem is that I'm not entirely sure how file related operations can fail and, therefore, the best way to handle exceptions.
The simple solution would seem to be just to catch any IOExc... | To enhance the robustness of your file handling code in C#, you can adopt a more granular approach to error handling. Instead of catching general exceptions, it's important to differentiate specific exceptions that might arise during file operations. Below, I'll update your `ReadFile` and `WriteFile` methods to include... | 4,778 | [
{
"from": "human",
"value": "Often I find myself interacting with files in some way but after writing the code I'm always uncertain how robust it actually is. The problem is that I'm not entirely sure how file related operations can fail and, therefore, the best way to handle exceptions.\nThe simple solutio... |
Sometimes I need to quickly extract some arbitrary data from XML files to put into a CSV format. What's your best practices for doing this in the Unix terminal? I would love some code examples, so for instance how can I get the following problem solved?
Example XML input:
<root>
<myel name="Foo" />
<myel name="... | Extracting data from XML files and converting it to CSV format can be efficiently done using command-line tools available in the Unix terminal. Here are some best practices and a straightforward method to achieve the desired outcome using tools like `xmllint`, `awk`, and `sed`.
### Tools You'll Need
- `xmllint`: A par... | 2,586 | [
{
"from": "human",
"value": "Sometimes I need to quickly extract some arbitrary data from XML files to put into a CSV format. What's your best practices for doing this in the Unix terminal? I would love some code examples, so for instance how can I get the following problem solved?\nExample XML input:\n<roo... |
I'm using MediaTemple's Grid Server (shared/grid hosting) to run some MySQL/PHP sites I'm writing and noticed that I wasn't closing one of my MySQL connections, which caused my site to error out:
"Too Many Connections"
I can't log in anywhere to close the connections manually.
Is that any way to close open connectio... | If you're encountering a "Too Many Connections" error on your MediaTemple Grid Server due to not closing MySQL connections properly, there are a few things you can consider:
1. **Using a Script to Close Connections**: Unfortunately, you cannot directly close MySQL connections that are opened by previous scripts withou... | 6,339 | [
{
"from": "human",
"value": "I'm using MediaTemple's Grid Server (shared/grid hosting) to run some MySQL/PHP sites I'm writing and noticed that I wasn't closing one of my MySQL connections, which caused my site to error out: \n\"Too Many Connections\"\n\nI can't log in anywhere to close the connections manu... |
The arguments about the simplicity of solutions using XML-RPC or REST are easy to understand and hard to argue with.
I have often also heard arguments that the increased overhead of SOAP may significantly impact used bandwidth and possibly even latency. I would like to see the results of a test that quantifies the imp... | There are several studies, articles, and benchmarks available that compare the performance of different web service protocols, including XML-RPC, REST, and SOAP. These resources often focus on aspects such as bandwidth usage, latency, and overall performance. Here are a few recommendations for sources where you might f... | 6,861 | [
{
"from": "human",
"value": "The arguments about the simplicity of solutions using XML-RPC or REST are easy to understand and hard to argue with.\nI have often also heard arguments that the increased overhead of SOAP may significantly impact used bandwidth and possibly even latency. I would like to see the... |
I want to write a simple colour management framework in C#, Java and AS3. I only want to write the unit tests once though, rather than recreating the unit tests in JUnit, FlexUnit and say NUnit.
I have in mind the idea of say an xml file that defines manipulations of "instance" and assertions based on the state of "in... | The idea of creating a single set of unit tests defined in an XML format that can then be transformed into multiple xUnit frameworks (like JUnit for Java, NUnit for C#, and FlexUnit for ActionScript 3) is an interesting approach and could save time and effort in managing tests across different programming environments.... | 5,898 | [
{
"from": "human",
"value": "I want to write a simple colour management framework in C#, Java and AS3. I only want to write the unit tests once though, rather than recreating the unit tests in JUnit, FlexUnit and say NUnit. \nI have in mind the idea of say an xml file that defines manipulations of \"instanc... |
At what length of text and/or length of audio snippet does a piece of commercially distributable software pass the threshold of fair use and violate the included work's copyright? Does attribution absolve the developer from infringement? An example would be a quote from a novel used on a start-up screen.
| The concept of fair use in copyright law is complex and does not have a specific length threshold for text or audio snippets. Instead, fair use is determined based on several factors, which include:
1. **Purpose and Character of the Use**: Whether the use is for commercial purposes or for nonprofit educational purpose... | 5,264 | [
{
"from": "human",
"value": "At what length of text and/or length of audio snippet does a piece of commercially distributable software pass the threshold of fair use and violate the included work's copyright? Does attribution absolve the developer from infringement? An example would be a quote from a nove... |
I have an xslt sheet with some text similar to below:
<xsl:text>I am some text, and I want to be bold</xsl:text>
I would like some text to be bold, but this doesn't work.
<xsl:text>I am some text, and I want to be <strong>bold<strong></xsl:text>
The deprecated b tag doesn't work either. How do I format text within an... | In XSLT, the `<xsl:text>` element is used to output literal text. However, it does not allow you to include other elements or markup within it. If you want to include formatting (like bold text) within your output, you need to use other XSLT elements.
Instead of using `<xsl:text>`, you can output mixed content by simp... | 4,983 | [
{
"from": "human",
"value": "I have an xslt sheet with some text similar to below:\n<xsl:text>I am some text, and I want to be bold</xsl:text>\n\nI would like some text to be bold, but this doesn't work.\n<xsl:text>I am some text, and I want to be <strong>bold<strong></xsl:text>\n\nThe deprecated b tag does... |
I'm storing a Word document in a SQL Server 2005 database in a varbinary(max) column. Is there a way to open this document from a VB.NET Windows Forms application without serialising to a file first (i.e. directly from the byte array I've read from the database)?
| Yes, you can open and display a Word document directly from a `varbinary(max)` column in a SQL Server database in a VB.NET Windows Forms application without needing to serialize it to a file first. This can be achieved by using a `MemoryStream` to hold the byte array and then using the `Process.Start` method to open it... | 5,618 | [
{
"from": "human",
"value": "I'm storing a Word document in a SQL Server 2005 database in a varbinary(max) column. Is there a way to open this document from a VB.NET Windows Forms application without serialising to a file first (i.e. directly from the byte array I've read from the database)?\n"
},
{
... |
Google's not coming to my rescue, here, and I just know this is the perfect place to ask.
I'm writing a custom DirectiveProcessor for a DSL and I want to be able to access a diagram from within my T4 template.
Within my DirectiveProcessor, I've loaded the domain model and my diagram using (wait for it...) LoadModelAndD... | When you're working with T4 templates and dealing with a loaded diagram in a DSL (Domain-Specific Language) environment, you'll need to ensure you correctly access the Store and the diagram elements you need.
Here’s a general approach to help you access the diagram from your T4 template after you have used `LoadModelA... | 2,958 | [
{
"from": "human",
"value": "Google's not coming to my rescue, here, and I just know this is the perfect place to ask.\nI'm writing a custom DirectiveProcessor for a DSL and I want to be able to access a diagram from within my T4 template.\nWithin my DirectiveProcessor, I've loaded the domain model and my d... |
ASP.NET 1.1 - I have a DataGrid on an ASPX page that is databound and displays a value within a textbox. The user is able to change this value, then click on a button where the code behind basically iterates through each DataGridItem in the grid, does a FindControl for the ID of the textbox then assigns the .Text value... | It sounds like you are encountering a common issue with ASP.NET Web Forms when working with controls that are bound to data. The problem you're facing typically occurs due to the DataGrid being rebound before you can access the user-entered values.
When you bind a DataGrid (or any control) to a data source, the contro... | 4,947 | [
{
"from": "human",
"value": "ASP.NET 1.1 - I have a DataGrid on an ASPX page that is databound and displays a value within a textbox. The user is able to change this value, then click on a button where the code behind basically iterates through each DataGridItem in the grid, does a FindControl for the ID of... |
When I run this code the selected item is not visible. I've already tried to run it in a separate thread with no luck.
import javax.swing.JFrame;
import java.awt.Container;
import javax.swing.JList;
import javax.swing.ListSelectionModel;
import javax.swing.JScrollPane;
import java.awt.Dimension;
public class ScrollLi... | The issue with your code is related to the order in which you are creating and interacting with the JList. In particular, you are creating the JList inside the `createScrollPane` method, which means the list you are trying to show with `ensureIndexIsVisible` is not the same list that is being displayed in the JScrollPa... | 5,000 | [
{
"from": "human",
"value": "When I run this code the selected item is not visible. I've already tried to run it in a separate thread with no luck.\nimport javax.swing.JFrame;\nimport java.awt.Container;\nimport javax.swing.JList;\nimport javax.swing.ListSelectionModel;\nimport javax.swing.JScrollPane;\nim... |
Basically we need a custom diagram component in our new WPF based application.
Needs to show text/lines, linked 2D Nodes and custom images apart from the other diagramming features like Undo/Redo, Align, Group, etc.. ala Visio.
The initial team did a bit of investigation and settled on the WinForms Northwoods GoDiagram... | Yes, there are several WPF diagramming libraries that you can consider for your application. Here are some popular ones that provide features similar to what you've described:
1. **Syncfusion Diagram**:
- Syncfusion offers a powerful WPF Diagram control that allows you to create various types of diagrams, including... | 5,645 | [
{
"from": "human",
"value": "Basically we need a custom diagram component in our new WPF based application.\nNeeds to show text/lines, linked 2D Nodes and custom images apart from the other diagramming features like Undo/Redo, Align, Group, etc.. ala Visio.\nThe initial team did a bit of investigation and s... |
Why does Leopard mangle some symbols with $non_lazy_ptr? More importantly what is the best method to fix undefined symbol errors because a symbol has been mangled with $non_lazy_ptr?
| In macOS, particularly in versions like Leopard (10.5) and later, the `$non_lazy_ptr` suffix in symbol names is associated with a mechanism used for dynamic linking and symbol resolution in shared libraries. This mangling typically occurs for symbols that are accessed indirectly through the Global Offset Table (GOT) an... | 5,335 | [
{
"from": "human",
"value": "Why does Leopard mangle some symbols with $non_lazy_ptr? More importantly what is the best method to fix undefined symbol errors because a symbol has been mangled with $non_lazy_ptr?\n"
},
{
"from": "gpt",
"value": "In macOS, particularly in versions like Leopard (1... |
What I'd like to know is if there is a nice way to queue jQuery functions to execute after a set amount of time. This wouldn't pause the execution of other functions, just the ones following in the chain. Perhaps an example of what I'd envisage it would look like would illustrate:
$('#alert')
.show()
.wait(5000... | jQuery does not have a built-in `.wait()` method that can seamlessly fit into its method chaining. However, you can achieve a similar effect by extending jQuery to include a custom method that allows you to pause the execution of the chained methods for a specified duration.
Here's how you can create a custom jQuery m... | 5,286 | [
{
"from": "human",
"value": "What I'd like to know is if there is a nice way to queue jQuery functions to execute after a set amount of time. This wouldn't pause the execution of other functions, just the ones following in the chain. Perhaps an example of what I'd envisage it would look like would illustrat... |
Firefox 3 stores the bookmarks in a sqlite database.
There are several hacked sqlite java libraries available.
Is there a way to hack the sqlite database in java(not using libraries) to read bookmarks reliably?
Does someone know how the sqlite DB is stored and access programmatically (from java)?
| To access and read an SQLite database in Java without using any third-party libraries like SQLite JDBC or similar, you would need to implement your own low-level SQLite communication. However, this approach is extremely complicated and impractical due to the need to handle the SQLite file format and the underlying SQLi... | 5,834 | [
{
"from": "human",
"value": "Firefox 3 stores the bookmarks in a sqlite database.\nThere are several hacked sqlite java libraries available.\nIs there a way to hack the sqlite database in java(not using libraries) to read bookmarks reliably?\nDoes someone know how the sqlite DB is stored and access programm... |
I was wondering if anyone could suggest a utility library that has useful functions for handling dates in ASP.NET easily taking away some of the leg work you normally have to do when handling dates?
Subsonic Sugar has some really nice functions:
http://subsonichelp.com/html/1413bafa-b5aa-99aa-0478-10875abe82ec.htm
http... | If you're looking for a utility library to simplify date handling in ASP.NET, consider using **NodaTime**. It's a powerful library that provides a comprehensive model for date and time in .NET, addressing many of the common problems developers face with date and time handling. It also handles time zones and durations i... | 3,175 | [
{
"from": "human",
"value": "I was wondering if anyone could suggest a utility library that has useful functions for handling dates in ASP.NET easily taking away some of the leg work you normally have to do when handling dates?\nSubsonic Sugar has some really nice functions:\nhttp://subsonichelp.com/html/14... |
Is there any API to get the currently logged in user's name and password in Windows?
Thank you in advance.
| Accessing the currently logged-in user's password programmatically is not allowed for security reasons. Windows does not provide an API or any method for applications to retrieve the password of the currently logged-in user. Passwords are stored securely and are encrypted to protect user privacy and system security.
H... | 7,523 | [
{
"from": "human",
"value": "Is there any API to get the currently logged in user's name and password in Windows?\nThank you in advance.\n"
},
{
"from": "gpt",
"value": "Accessing the currently logged-in user's password programmatically is not allowed for security reasons. Windows does not provi... |
The html helper methods check the ViewDataDictionary for a value. The value can either be in the dictionary or in the Model, as a property. To extract the value, an internal sealed class named the ViewDataEvaluator uses PropertyDescriptor to get the value. Then, Convert.ToString() is called to convert the object return... | To achieve property-specific formatting for your model's properties in ASP.NET MVC, you can create a custom HTML helper that allows you to specify how each property should be formatted. This approach gives you the flexibility to define the formatting logic on a per-property basis without relying on attributes or extern... | 4,149 | [
{
"from": "human",
"value": "The html helper methods check the ViewDataDictionary for a value. The value can either be in the dictionary or in the Model, as a property. To extract the value, an internal sealed class named the ViewDataEvaluator uses PropertyDescriptor to get the value. Then, Convert.ToString... |
With VMWare Server running under Linux (Debain), I would like to have the following setup:
1st: NIC being used by many of the
images running under VMWare, as well
as being used by the Linux OS
2nd: NIC being used by only 1 image and to be unused by the Linux OS (as its part of a DMZ)
Although the second NIC won't be... | Yes, your proposed setup is possible with VMware Server on a Linux host. You can configure the network settings to achieve the desired network isolation for your virtual machines (VMs) and host system. Here’s how you can set it up:
### 1. Network Configuration Overview
- **First NIC (eth0)**: This NIC will be used by ... | 5,590 | [
{
"from": "human",
"value": "With VMWare Server running under Linux (Debain), I would like to have the following setup:\n\n1st: NIC being used by many of the\nimages running under VMWare, as well\nas being used by the Linux OS \n2nd: NIC being used by only 1 image and to be unused by the Linux OS (as its pa... |
Do you know if it's possible to build an application for the LinkedIn platform?
| Yes, it is possible to build applications that integrate with the LinkedIn platform through the LinkedIn Developer Program. LinkedIn provides various APIs and SDKs that developers can use to build applications that can interact with LinkedIn's services. Here are some key points regarding building applications for Linke... | 5,146 | [
{
"from": "human",
"value": "Do you know if it's possible to build an application for the LinkedIn platform?\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to build applications that integrate with the LinkedIn platform through the LinkedIn Developer Program. LinkedIn provides various APIs... |
I've been looking for a simple Java algorithm to generate a pseudo-random alpha-numeric string. In my situation it would be used as a unique session/key identifier that would "likely" be unique over 500K+ generation (my needs don't really require anything much more sophisticated).
Ideally, I would be able to specify... | You can create a simple Java algorithm to generate a pseudo-random alphanumeric string by utilizing the `java.util.Random` class. Below is an implementation that allows you to specify the length of the generated string. It includes both uppercase letters and digits.
Here's a sample implementation:
```java
import java... | 5,797 | [
{
"from": "human",
"value": "I've been looking for a simple Java algorithm to generate a pseudo-random alpha-numeric string. In my situation it would be used as a unique session/key identifier that would \"likely\" be unique over 500K+ generation (my needs don't really require anything much more sophistica... |
Since the keyboard is the interface we use to the computer, I've always thought touch typing should be something I should learn, but I've always been, well, lazy is the word. So, anyone recommend any good touch typing software?
It's easy enough to google, but I'ld like to hear recommendations.
| Absolutely, touch typing is a valuable skill that can significantly improve your productivity. Here are some highly recommended touch typing software and online resources:
1. **TypingClub**: This is a popular online platform that offers a structured curriculum for learning touch typing. It provides engaging lessons an... | 5,211 | [
{
"from": "human",
"value": "Since the keyboard is the interface we use to the computer, I've always thought touch typing should be something I should learn, but I've always been, well, lazy is the word. So, anyone recommend any good touch typing software?\nIt's easy enough to google, but I'ld like to hear ... |
I'm working on a website that will switch to a new style on a set date. The site's built-in semantic HTML and CSS, so the change should just require a CSS reference change. I'm working with a designer who will need to be able to see how it's looking, as well as a client who will need to be able to review content update... | Your approach to handling the CSS switch for your website looks solid, but let's refine it a bit for clarity and ensure a smooth experience for both the designer and the client. Below, I’ll outline an approach that uses query string parameters and cookies effectively, while also considering the requirement to maintain ... | 2,082 | [
{
"from": "human",
"value": "I'm working on a website that will switch to a new style on a set date. The site's built-in semantic HTML and CSS, so the change should just require a CSS reference change. I'm working with a designer who will need to be able to see how it's looking, as well as a client who will... |
I'm reading lines of text that can come in any order. The problem is that the output can actually be indentical to the previous output. How can I detect this, without sorting the output first?
Is there some kind of hash function that can take identical input, but in any order, and still produce the same result?
| Yes, you can achieve this by using a hash function that is designed to treat its input in a way that is agnostic to the order of elements. One common approach is to hash a canonical representation of the input data. Here are some methods you can use:
1. **Sort the Input**: Although you mentioned not wanting to sort th... | 6,327 | [
{
"from": "human",
"value": "I'm reading lines of text that can come in any order. The problem is that the output can actually be indentical to the previous output. How can I detect this, without sorting the output first?\nIs there some kind of hash function that can take identical input, but in any order, ... |
How would you dynamically subscribe to a C# event so that given a Object instance and a String name containing the name of the event, you subscribe to that event and do something (write to the console for example) when that event has been fired?
It would seem using Reflection this isn't possible and I would like to avo... | Dynamically subscribing to an event in C# when you do not know the delegate signature at compile time is indeed challenging. However, you can use a combination of reflection and dynamic delegate creation to achieve this without resorting to `Reflection.Emit`.
Here's a method to subscribe to an event given an object i... | 3,709 | [
{
"from": "human",
"value": "How would you dynamically subscribe to a C# event so that given a Object instance and a String name containing the name of the event, you subscribe to that event and do something (write to the console for example) when that event has been fired?\nIt would seem using Reflection t... |
I would like to know how to write PHPUnit tests with Zend_Test and in general with PHP.
| Certainly! Writing tests in PHP can be done using PHPUnit, which is a widely-used testing framework. Zend_Test is a part of the Zend Framework and provides tools for testing, but it's often more common to see PHPUnit used directly, as it has a broader adoption and is well-integrated into various PHP projects.
### Gett... | 4,541 | [
{
"from": "human",
"value": "I would like to know how to write PHPUnit tests with Zend_Test and in general with PHP.\n"
},
{
"from": "gpt",
"value": "Certainly! Writing tests in PHP can be done using PHPUnit, which is a widely-used testing framework. Zend_Test is a part of the Zend Framework and... |
Generally the database server is the biggest, most expensive box we have to buy as scaling vertically is the only option. Are there any databases that scale well horizontally (i.e. across multiple commodity machines) and what are the limitations in this approach?
| Yes, there are several databases that are designed to scale horizontally, meaning they can distribute data and workloads across multiple commodity machines. This approach is often referred to as "horizontal scaling" or "scaling out," and it is a common strategy for handling large volumes of data and high throughput.
#... | 4,752 | [
{
"from": "human",
"value": "Generally the database server is the biggest, most expensive box we have to buy as scaling vertically is the only option. Are there any databases that scale well horizontally (i.e. across multiple commodity machines) and what are the limitations in this approach?\n"
},
{
... |
Nokia has stopped offering its Developer's Suite, relying on other IDEs, including Eclipse. Meanwhile, Nokia changed its own development tools again and EclipseMe has also changed. This leaves most documentation irrelevant.
I want to know what does it take to make a simple Hello-World?
(I already found out myself, so ... | Creating a simple "Hello, World!" application for Nokia devices, or any mobile platform, generally involves several steps. While the specific tools and frameworks may vary depending on the platform you are targeting, below is a general guide that can help you create a basic "Hello, World!" application.
### Steps to Cr... | 3,560 | [
{
"from": "human",
"value": "Nokia has stopped offering its Developer's Suite, relying on other IDEs, including Eclipse. Meanwhile, Nokia changed its own development tools again and EclipseMe has also changed. This leaves most documentation irrelevant. \nI want to know what does it take to make a simple Hel... |
Are you aware of any tool that creates diagrams showing the branch/merge activity in a SVN repository?
We've all seen these diagrams in various tutorials. Some good, some not so good. Can they be created automatically (or maybe with a little prodding -- you might have to tell it what if your branching philosophy is dev... | Creating diagrams that visualize branch and merge activity in an SVN repository can indeed be a bit challenging, as SVN doesn't natively provide graphical representations like some other version control systems (e.g., Git with tools like GitGraph). However, there are tools and approaches you can consider to create clea... | 5,129 | [
{
"from": "human",
"value": "Are you aware of any tool that creates diagrams showing the branch/merge activity in a SVN repository?\nWe've all seen these diagrams in various tutorials. Some good, some not so good. Can they be created automatically (or maybe with a little prodding -- you might have to tell i... |
I'm using Eclipse as my IDE for a C++ project, and I would love for it to tell me where a given symbol is defined and what the parameters are for a function.
However, there's a catch: I also use Lazy C++, a tool that takes a single source file and generates the .h and the .cpp files. Those .lzz files look like headers,... | Hi Carl,
When working with Eclipse CDT (C/C++ Development Tooling) and non-standard C++ file formats like those created by Lazy C++, it can sometimes cause issues with the indexer, as it expects standard C++ syntax and structure. Here are some suggestions to help you troubleshoot and potentially resolve the indexing i... | 5,906 | [
{
"from": "human",
"value": "I'm using Eclipse as my IDE for a C++ project, and I would love for it to tell me where a given symbol is defined and what the parameters are for a function.\nHowever, there's a catch: I also use Lazy C++, a tool that takes a single source file and generates the .h and the .cpp ... |
I have a byte array in memory, read from a file. I would like to split the byte array at a certain point (index) without having to just create a new byte array and copy each byte at a time, increasing the in memory foot print of the operation. What I would like is something like this:
byte[] largeBytes = [1,2,3,4,5,6,... | In Java, arrays have a fixed size, so you cannot directly split an array without creating new arrays. However, you can achieve your goal of splitting the byte array without having to copy each byte manually by using the `System.arraycopy` method, which is optimized for copying arrays.
That said, if your goal is to man... | 3,357 | [
{
"from": "human",
"value": "I have a byte array in memory, read from a file. I would like to split the byte array at a certain point (index) without having to just create a new byte array and copy each byte at a time, increasing the in memory foot print of the operation. What I would like is something lik... |
I'm pretty sure I know the answer to this, but short of a virtual Vista installation, is there a way to install IIS 7 on XP?
| IIS 7 is not compatible with Windows XP, as it was specifically designed to run on Windows Vista and later versions of Windows. If you are looking to use a version of IIS on Windows XP, you can install IIS 5.1, which is the version that comes with Windows XP Professional.
If you specifically need features from IIS 7, ... | 8,983 | [
{
"from": "human",
"value": "I'm pretty sure I know the answer to this, but short of a virtual Vista installation, is there a way to install IIS 7 on XP? \n"
},
{
"from": "gpt",
"value": "IIS 7 is not compatible with Windows XP, as it was specifically designed to run on Windows Vista and later v... |
I am writing a bash script to deal with some installations in an automated way... I have the possibility of getting one such program in 32 or 64 bit binary... is it possible to detect the machine architecture from bash so I can select the correct binary?
This will be for Ubuntu machines.
| Yes, you can easily detect the machine architecture from a bash script on an Ubuntu machine using the `uname` command. This command provides system information, including the architecture type.
You can use the following command in your script to check the architecture:
```bash
ARCH=$(uname -m)
```
Here is a breakdow... | 6,672 | [
{
"from": "human",
"value": "I am writing a bash script to deal with some installations in an automated way... I have the possibility of getting one such program in 32 or 64 bit binary... is it possible to detect the machine architecture from bash so I can select the correct binary?\nThis will be for Ubuntu... |
I had a plugin installed in Visual Studio 2008, and it created some extra dockable windows. I have uninstalled it, and I can't get rid of the windows it created - I close them, but they always come back. They're just empty windows now, since the plugin is no longer present, but nothing I've tried gets rid of them. I... | It sounds like you're dealing with a persistent UI state in Visual Studio 2008 that's not fully resetting after the plugin uninstallation. Here are a few additional steps you can try to remove those unwanted dockable windows:
### 1. Delete the Visual Studio User Settings:
Sometimes, the Visual Studio user settings can... | 6,926 | [
{
"from": "human",
"value": "I had a plugin installed in Visual Studio 2008, and it created some extra dockable windows. I have uninstalled it, and I can't get rid of the windows it created - I close them, but they always come back. They're just empty windows now, since the plugin is no longer present, bu... |
If I understand correctly, ClickOnce only checks for prerequisites with the first install of an application through the setup.exe file that contains the prerequisite information. If the user opens the app in the future it will check for new versions, but it does not launch the setup.exe again, thus not checking for any... | You're correct that ClickOnce applications only check for prerequisites during the initial installation process. After the application is installed, ClickOnce will only check for new application updates when the user runs the application, but it won't automatically reinstall or check for new prerequisites.
However, th... | 6,697 | [
{
"from": "human",
"value": "If I understand correctly, ClickOnce only checks for prerequisites with the first install of an application through the setup.exe file that contains the prerequisite information. If the user opens the app in the future it will check for new versions, but it does not launch the s... |
Does anyone know how bash handles sending data through pipes?
cat file.txt | tail -20
Does this command print all the contents of file.txt into a buffer, which is then read by tail? Or does this command, say, print the contents of file.txt line by line, and then pause at each line for tail to process, and then ask for... | In a Unix-like environment, pipes facilitate inter-process communication by allowing the output of one process to be used as the input to another. When you execute a command like `cat file.txt | tail -20`, several key behaviors and mechanics come into play regarding how data flows through the pipe and how the processes... | 3,313 | [
{
"from": "human",
"value": "Does anyone know how bash handles sending data through pipes?\ncat file.txt | tail -20\n\nDoes this command print all the contents of file.txt into a buffer, which is then read by tail? Or does this command, say, print the contents of file.txt line by line, and then pause at eac... |
I have a team lead who seems to think that business logic is very subjective, to the point that if my stored procedure has a WHERE ID = @ID — he would call this “business logic”
What approach should I take to define “business logic” in a very objective way without offending my team lead?
| Defining “business logic” in an objective manner can indeed be a delicate task, especially when you want to maintain a positive relationship with your team lead. Here’s a structured approach you can take:
### 1. **Clarify Definitions**
Start by establishing a common understanding of what constitutes business logic v... | 5,372 | [
{
"from": "human",
"value": "I have a team lead who seems to think that business logic is very subjective, to the point that if my stored procedure has a WHERE ID = @ID — he would call this “business logic”\nWhat approach should I take to define “business logic” in a very objective way without offending my ... |
The codebase I work on is huge, and grepping it takes about 20 minutes. I'm looking for a good web-based source code search engine.. something like an intranet version of koders.com.
The only thing I've found is Krugle Enterprise Edition, which doesn't post its prices... and if you have to ask, you can't afford it.
I'... | If you're looking for a web-based source code search engine that is simple and efficient, here are several options you might consider:
1. **OpenGrok**: This is a fast and usable source code search and cross-reference engine that supports various programming languages. OpenGrok is open-source and can be installed on yo... | 6,708 | [
{
"from": "human",
"value": "The codebase I work on is huge, and grepping it takes about 20 minutes. I'm looking for a good web-based source code search engine.. something like an intranet version of koders.com.\nThe only thing I've found is Krugle Enterprise Edition, which doesn't post its prices... and i... |
Can anyone explain what is windows workflow and how can we use in the work organization.
| **Windows Workflow Foundation (WF)** is a .NET framework that provides a way to define, execute, and manage workflows in applications. A workflow is essentially a sequence of steps or tasks that can be automated and executed, which can improve efficiency and standardize processes within organizations.
### Key Concept... | 5,514 | [
{
"from": "human",
"value": "Can anyone explain what is windows workflow and how can we use in the work organization. \n"
},
{
"from": "gpt",
"value": "**Windows Workflow Foundation (WF)** is a .NET framework that provides a way to define, execute, and manage workflows in applications. A workflo... |
When a script is saved as a bundle, it can use the localized string command to find the appropriate string, e.g. in Contents/Resources/English.lproj/Localizable.strings. If this is a format string, what is the best way to fill in the placeholders? In other words, what is the AppleScript equivalent of +[NSString stringW... | In AppleScript, there isn't a direct equivalent to `+[NSString stringWithFormat:]` for formatting strings like you find in Objective-C. However, there are several ways to achieve string formatting in AppleScript.
The most straightforward method is to use the `replace` command to insert values into a format string. Her... | 6,276 | [
{
"from": "human",
"value": "When a script is saved as a bundle, it can use the localized string command to find the appropriate string, e.g. in Contents/Resources/English.lproj/Localizable.strings. If this is a format string, what is the best way to fill in the placeholders? In other words, what is the App... |
In the vein of programming questions: suppose there's a collection of objects that can be compared to each other and sorted. What's the most efficient way to keep track of the smallest element in the collection as objects are added and the current smallest occasionally removed?
| To efficiently track the smallest element in a collection of comparable objects while allowing for dynamic additions and occasional removals, you can use a **min-heap (or min-priority queue)** data structure. Here's how it works and why it's effective:
### Explanation of Using a Min-Heap
1. **Efficient Insertions**: ... | 3,131 | [
{
"from": "human",
"value": "In the vein of programming questions: suppose there's a collection of objects that can be compared to each other and sorted. What's the most efficient way to keep track of the smallest element in the collection as objects are added and the current smallest occasionally removed?\... |
I am using sp_send_dbmail in SQL2005 to send an email with the results in an attachment. When the attachment is sent it is UCS-2 Encoded, I want it to be ANSI or UTF-8.
Here is the SQL
EXEC msdb.dbo.sp_send_dbmail
@recipients = 'temp@example.com'
, @query = 'DECLARE @string_to_trim varchar(60);SET @string_to_tr... | In SQL Server 2005, the behavior of `sp_send_dbmail` generating attachments in UCS-2 encoding can indeed be a limitation, especially since you want the results in ANSI or UTF-8 format. As you mentioned, the release of SQL Server 2005 SP2 was supposed to address some of these issues, but it may not have resolved them co... | 5,004 | [
{
"from": "human",
"value": "I am using sp_send_dbmail in SQL2005 to send an email with the results in an attachment. When the attachment is sent it is UCS-2 Encoded, I want it to be ANSI or UTF-8.\nHere is the SQL\nEXEC msdb.dbo.sp_send_dbmail\n @recipients = 'temp@example.com'\n , @query = 'DECLARE ... |
In PHP, how can I replicate the expand/contract feature for Tinyurls as on search.twitter.com?
| To replicate an expand/contract feature for TinyURLs in PHP, you would typically need to use JavaScript for the front-end to handle the user interface and the PHP backend to manage the URL shortening/expanding logic. Here's a simple implementation guide:
### Steps to Implement Expand/Contract for TinyURLs
1. **Create... | 3,495 | [
{
"from": "human",
"value": "In PHP, how can I replicate the expand/contract feature for Tinyurls as on search.twitter.com?\n"
},
{
"from": "gpt",
"value": "To replicate an expand/contract feature for TinyURLs in PHP, you would typically need to use JavaScript for the front-end to handle the use... |
I'm looking for (arguably) the correct way to return data from a XmlHttpRequest. Options I see are:
Plain HTML. Let the request format the data and return it in a usable format.
Advantage: easy to consume by the calling page.Disadvantage: Very rigid, stuck with a fixed layout.
XML. Let the request return XML, format i... | Choosing the correct way to return data from an `XmlHttpRequest` largely depends on the specific use case, including how the data will be consumed, the architecture of the application, and the preferences of the development team. Let's break down each of your options and considerations:
### 1. Plain HTML
- **Advantage... | 3,711 | [
{
"from": "human",
"value": "I'm looking for (arguably) the correct way to return data from a XmlHttpRequest. Options I see are:\n\nPlain HTML. Let the request format the data and return it in a usable format.\nAdvantage: easy to consume by the calling page.Disadvantage: Very rigid, stuck with a fixed layou... |
What are some standard practices for managing a medium-large JavaScript application? My concerns are both speed for browser download and ease and maintainability of development.
Our JavaScript code is roughly "namespaced" as:
var Client = {
var1: '',
var2: '',
accounts: {
/* 100's of functions and varia... | Managing a medium to large JavaScript application can be challenging, especially when it comes to maintainability, performance, and ease of development. Here are some standard practices and recommendations to help you manage your application more effectively:
### 1. Modularization
- **Split Your Code into Modules**: I... | 3,251 | [
{
"from": "human",
"value": "What are some standard practices for managing a medium-large JavaScript application? My concerns are both speed for browser download and ease and maintainability of development.\nOur JavaScript code is roughly \"namespaced\" as:\nvar Client = {\n var1: '',\n var2: '',\n\n ... |
What does it mean when a PostgreSQL process is "idle in transaction"?
On a server that I'm looking at, the output of "ps ax | grep postgres" I see 9 PostgreSQL processes that look like the following:
postgres: user db 127.0.0.1(55658) idle in transaction
Does this mean that some of the processes are hung, waiting for ... | In PostgreSQL, a process that is shown as "idle in transaction" means that it is currently in a transaction block but is not actively executing any queries. This state occurs when a transaction has been initiated (usually with a `BEGIN` or an implicit transaction that occurs with the execution of a command) but has not... | 7,034 | [
{
"from": "human",
"value": "What does it mean when a PostgreSQL process is \"idle in transaction\"?\nOn a server that I'm looking at, the output of \"ps ax | grep postgres\" I see 9 PostgreSQL processes that look like the following:\npostgres: user db 127.0.0.1(55658) idle in transaction\n\nDoes this mean ... |
I'm a C# developer who's fumbling in the first VB code he's written since VB6, so if I am asking a rather obvious question, please forgive me.
I decided to experiment with XML Literals to generate some XML code for me, instead of using XMLDocument
I have 2 questions, the second regarding a workaround due to my inabilit... | Welcome back to VB! It sounds like you're on the right track using XML literals, but there are some subtleties in how to use them effectively.
Let's address your first question: generating XML dynamically from a `Dictionary(Of String, String)`.
### Ideal Solution
The problem with your current approach is that you are... | 6,741 | [
{
"from": "human",
"value": "I'm a C# developer who's fumbling in the first VB code he's written since VB6, so if I am asking a rather obvious question, please forgive me.\nI decided to experiment with XML Literals to generate some XML code for me, instead of using XMLDocument\nI have 2 questions, the secon... |
I am trying out the debugger built into Zend studio. It seems great! One thing though, when I start a page using the debugger does anyone know how I can set a request get argument within the page?
For example, I don't want to debug runtests.php
I want to debug runtests.php?test=10
I assume its a simple configuration ... | To set a GET request argument in Zend Studio while debugging a PHP script, you can typically do this by configuring the debug settings for the particular run configuration. Here’s how you can set the request GET argument for your debug session:
1. **Open the Debug Configurations**:
- Go to the `Run` menu at the top... | 6,755 | [
{
"from": "human",
"value": "I am trying out the debugger built into Zend studio. It seems great! One thing though, when I start a page using the debugger does anyone know how I can set a request get argument within the page?\nFor example, I don't want to debug runtests.php\nI want to debug runtests.php?t... |
I worked on an embedded system this summer written in straight C. It was an existing project that the company I work for had taken over. I have become quite accustomed to writing unit tests in Java using JUnit but was at a loss as to the best way to write unit tests for existing code (which needed refactoring) as wel... | Unit testing in C, especially in an embedded systems context, can be a bit more challenging than in higher-level languages like Java, but there are several frameworks and approaches that can help you achieve a similar level of testing rigor. Here are some popular unit testing frameworks for C that can be used, along wi... | 5,079 | [
{
"from": "human",
"value": "I worked on an embedded system this summer written in straight C. It was an existing project that the company I work for had taken over. I have become quite accustomed to writing unit tests in Java using JUnit but was at a loss as to the best way to write unit tests for existi... |
I need to specifically catch SQL server timeout exceptions so that they can be handled differently. I know I could catch the SqlException and then check if the message string Contains "Timeout" but was wondering if there is a better way to do it?
try
{
//some code
}
catch (SqlException ex)
{
if (ex.Message.Co... | Yes, while checking the message string for "Timeout" can work, there is a more robust way to specifically handle SQL Server timeout exceptions. The `SqlException` class provides a property called `Number` which can be used to determine the specific error that occurred.
For SQL Server, there are specific error numbers... | 7,940 | [
{
"from": "human",
"value": "I need to specifically catch SQL server timeout exceptions so that they can be handled differently. I know I could catch the SqlException and then check if the message string Contains \"Timeout\" but was wondering if there is a better way to do it?\ntry\n{\n //some code\n}\n... |
As a programmer I have no idea how one would go about programming menus for a DVD, I have heard that this is possible, and even seen basic games using DVD menus - although it may very well be a closed-system. Is it even possible and if so, what language, compilers etc exist for this?
| Creating interactive menus for DVDs is indeed possible, and it often involves the use of a specialized set of standards and tools. Here’s a general overview of how to go about programming menus for a DVD, including the languages, tools, and processes involved.
### Overview of DVD Menu Creation
DVD menus are typically... | 4,927 | [
{
"from": "human",
"value": "As a programmer I have no idea how one would go about programming menus for a DVD, I have heard that this is possible, and even seen basic games using DVD menus - although it may very well be a closed-system. Is it even possible and if so, what language, compilers etc exist for ... |
I am working with ASP.net.
I am trying to call a method that exists on the base class for the page I am using. I want to call this method via Javascript and do not require any rendering to be handled by ASP.net.
What would be the easiest way to accomplish this.
I have looked at PageMethods which for some reason are no... | If you're working with ASP.NET and want to call a method in your code-behind (i.e., the base class for your page) from JavaScript without using ASP.NET's built-in AJAX features (like PageMethods), one common approach is to use a combination of an ASP.NET Web Method and JavaScript AJAX.
Here's a step-by-step guide on h... | 5,994 | [
{
"from": "human",
"value": "I am working with ASP.net.\nI am trying to call a method that exists on the base class for the page I am using. I want to call this method via Javascript and do not require any rendering to be handled by ASP.net.\nWhat would be the easiest way to accomplish this.\n\nI have looke... |
I recently discovered the org-mode in emacs and it works very well for me. I also like www.RememberTheMilk.com. I would like to be able to sync my org-mode file and RTM list. I know that RTM has its API exposed as web services. I am currently looking for a HTTP library that I could use to write my script. I found a cou... | It's great to hear that you're enjoying org-mode and are looking to sync it with Remember The Milk (RTM)! Given your experience with Emacs and your desire to use its HTTP capabilities, I'll provide you with a step-by-step approach to help you get started with making API calls to RTM.
### Step 1: Choose an HTTP Library... | 3,423 | [
{
"from": "human",
"value": "I recently discovered the org-mode in emacs and it works very well for me. I also like www.RememberTheMilk.com. I would like to be able to sync my org-mode file and RTM list. I know that RTM has its API exposed as web services. I am currently looking for a HTTP library that I co... |
How do I get an element or element list by it's tag name. Take for example that I want all elements from <h1></h1>.
| To get elements by their tag name, you can use different methods depending on the context you are working in (e.g., plain JavaScript, jQuery, or a specific library). Here are a few approaches for both JavaScript and jQuery:
### Using Plain JavaScript
You can use the `getElementsByTagName` method, which is part of the... | 6,863 | [
{
"from": "human",
"value": "How do I get an element or element list by it's tag name. Take for example that I want all elements from <h1></h1>.\n\n"
},
{
"from": "gpt",
"value": "To get elements by their tag name, you can use different methods depending on the cont... |
Test the following code:
#include <stdio.h>
#include <stdlib.h>
main()
{
const char *yytext="0";
const float f=(float)atof(yytext);
size_t t = *((size_t*)&f);
printf("t should be 0 but is %d\n", t);
}
Compile it with:
gcc -O3 test.c
The GOOD output should be:
"t should be 0 but is 0"
But with my gcc ... | The behavior you're observing in your code can be attributed to a couple of issues, especially with how you're interpreting the float value and how you're using the `size_t` type. Here's a step-by-step analysis of the code and potential reasons for the unexpected output.
### Code Analysis:
```c
#include <stdio.h>
#in... | 3,865 | [
{
"from": "human",
"value": "Test the following code:\n#include <stdio.h>\n#include <stdlib.h>\nmain()\n{\n const char *yytext=\"0\";\n const float f=(float)atof(yytext);\n size_t t = *((size_t*)&f);\n printf(\"t should be 0 but is %d\\n\", t);\n}\n\nCompile it with:\ngcc -O3 test.c\n\nThe GOOD ... |
I have a data structure that represents a directed graph, and I want to render that dynamically on an HTML page. These graphs will usually be just a few nodes, maybe ten at the very upper end, so my guess is that performance isn't going to be a big deal. Ideally, I'd like to be able to hook it in with jQuery so that u... | To dynamically render a directed graph on an HTML page and allow users to manipulate it by dragging nodes, you can use SVG (Scalable Vector Graphics) along with jQuery. Below is a simple implementation that provides a basic example of how you can achieve this.
### Step 1: Setup HTML Structure
You’ll need a simple HTM... | 1,900 | [
{
"from": "human",
"value": "I have a data structure that represents a directed graph, and I want to render that dynamically on an HTML page. These graphs will usually be just a few nodes, maybe ten at the very upper end, so my guess is that performance isn't going to be a big deal. Ideally, I'd like to be... |
Well behaved windows programs need to allow users to save their work when they are shutting the PC down.
How can I make my app detect the shutdown event? Any solution should allow the user to abort the shutdown if user selects, say "Cancel".
The normal Swing window closing hook doesn't work, nor does adding a shutdown ... | Detecting shutdown events in a Java Swing application can indeed be tricky, especially because the usual methods like `WindowListener` don't get triggered when the operating system initiates a shutdown. In fact, this is due to the way that the OS handles shutdown events, and it is not a bug in Swing itself.
To effecti... | 5,246 | [
{
"from": "human",
"value": "Well behaved windows programs need to allow users to save their work when they are shutting the PC down.\nHow can I make my app detect the shutdown event? Any solution should allow the user to abort the shutdown if user selects, say \"Cancel\".\nThe normal Swing window closing h... |
How can I get an image to stretch the height of a DIV class?
Currently it looks like this:
However, I would like the DIV to be stretched so the image fits properly, but I do not want to resize the `image.
Here is the CSS for the DIV (the grey box):
.product1 {
width: 100%;
padding: 5px;
margin: 0px 0px 15p... | To make the image stretch the height of the `.product1` DIV without resizing the image itself, you can use a combination of CSS flexbox or modify your existing CSS. Here are a couple of approaches you can take:
### Approach 1: Using Flexbox
You can use flexbox on the `.product1` class to make sure the image stretches... | 6,015 | [
{
"from": "human",
"value": "How can I get an image to stretch the height of a DIV class?\nCurrently it looks like this:\n\nHowever, I would like the DIV to be stretched so the image fits properly, but I do not want to resize the `image.\nHere is the CSS for the DIV (the grey box):\n.product1 {\n width: ... |
I'm looking for a way to configure a DB connection at runtime; specifically using the Enterprise Library. I see that there's a *.Data.Configuration (or something close to this ... don't recall off the top of my head) assembly but am finding not much on the interwebs. Complicating matters is the fact that the API help... | To configure a database connection at runtime without permanently modifying the `App.config`, you can create a custom `Database` object programmatically using the Enterprise Library Data Application Block. This avoids the need to manipulate `ConfigurationManager` directly.
Here’s an example of how you can create a cus... | 4,254 | [
{
"from": "human",
"value": "I'm looking for a way to configure a DB connection at runtime; specifically using the Enterprise Library. I see that there's a *.Data.Configuration (or something close to this ... don't recall off the top of my head) assembly but am finding not much on the interwebs. Complicat... |
How can I call a BizTalk Orchestration dynamically knowing the Orchestration name?
The call Orchestration shapes need to know the name and parameters of Orchestrations at design time. I've tried using 'call' XLang keyword but it also required Orchestration name as Design Time like in expression shape, we can write as ... | In BizTalk Server 2006 R1, dynamic invocation of orchestrations is limited, as the `call` shape requires a statically defined orchestration name at design time. Unfortunately, this makes truly dynamic orchestration invocation based on runtime parameters (like orchestration names coming from incoming messages or configu... | 6,353 | [
{
"from": "human",
"value": "How can I call a BizTalk Orchestration dynamically knowing the Orchestration name? \nThe call Orchestration shapes need to know the name and parameters of Orchestrations at design time. I've tried using 'call' XLang keyword but it also required Orchestration name as Design Time ... |
I just did a merge using something like:
svn merge -r 67212:67213 https://my.svn.repository/trunk .
I only had 2 files, one of which is a simple ChangeLog. Rather than just merging my ChangeLog changes, it actually pulled mine plus some previous ones that were not in the destination ChangeLog. I noticed there was a ... | It looks like you're dealing with a common confusion regarding how SVN merges work. Let's clarify a few things about merging in SVN to explain what happened in your case.
### Understanding SVN Merges
When you use the `svn merge -r X:Y` command, you're telling SVN to merge changes from one revision (Y) back to a previ... | 4,374 | [
{
"from": "human",
"value": "I just did a merge using something like:\nsvn merge -r 67212:67213 https://my.svn.repository/trunk .\n\nI only had 2 files, one of which is a simple ChangeLog. Rather than just merging my ChangeLog changes, it actually pulled mine plus some previous ones that were not in the de... |
I have a relationship between two entities (e1 and e2) and e1 has a collection of e2, however I have a similar relationship set up between (e2 and e3), yet e2 does not contain a collection of e3's, any reason why this would happen? Anything I can post to make this easier to figure out?
Edit: I just noticed that the rel... | It sounds like you are working with a modeling scenario, possibly in a context like database design, UML diagrams, or an object-oriented programming design. Let's break down the situation you've described:
### Relationship between Entities
1. **e1 and e2**:
- You mentioned that e1 has a collection of e2 entities.... | 5,657 | [
{
"from": "human",
"value": "I have a relationship between two entities (e1 and e2) and e1 has a collection of e2, however I have a similar relationship set up between (e2 and e3), yet e2 does not contain a collection of e3's, any reason why this would happen? Anything I can post to make this easier to figu... |
I am wondering what experiences people are having using the ASP.NET MVC Framework? In particular I am looking for feedback on the type of experience folks are having using the framework.
What are people using for their view engine? What about the db layer, NHibernate, LINQ to SQL or something else?
I know stackoverfl... | Many developers using the ASP.NET MVC Framework have a variety of experiences based on their project requirements, team preferences, and familiarity with different technologies. Here's an overview of what people commonly report:
### Experience with ASP.NET MVC Framework
1. **Learning Curve**: Developers often mention... | 4,846 | [
{
"from": "human",
"value": "I am wondering what experiences people are having using the ASP.NET MVC Framework? In particular I am looking for feedback on the type of experience folks are having using the framework.\nWhat are people using for their view engine? What about the db layer, NHibernate, LINQ to... |
I don't know when to add to a dataset a tableadapter or a query from toolbox. Does it make any difference?
I also dont know where to create instances of the adapters.
Should I do it in the Page_Load?
Should I just do it when I'm going to use it?
Am I opening a new connection when I create a new instance?
This doe... | When working with datasets, TableAdapters, and queries in .NET (especially with Windows Forms or ASP.NET), it’s important to understand their roles and how they manage data access. Let's address your questions step by step.
### 1. Choosing Between TableAdapter and Query
- **TableAdapters**: Use TableAdapters when you ... | 4,359 | [
{
"from": "human",
"value": "I don't know when to add to a dataset a tableadapter or a query from toolbox. Does it make any difference?\nI also dont know where to create instances of the adapters. \n\nShould I do it in the Page_Load? \nShould I just do it when I'm going to use it? \nAm I opening a new conn... |
I am looking for any strategies people use when implementing server applications that service client TCP (or UDP) requests: design patterns, implementation techniques, best practices, etc.
Let's assume for the purposes of this question that the requests are relatively long-lived (several minutes) and that the traffic i... | Implementing server applications that handle long-lived, time-sensitive TCP or UDP requests involves careful consideration of architecture, design patterns, and best practices. Below are strategies that can be applied generally, though I will also provide .NET-specific examples where applicable.
### 1. Asynchronous I/... | 1,526 | [
{
"from": "human",
"value": "I am looking for any strategies people use when implementing server applications that service client TCP (or UDP) requests: design patterns, implementation techniques, best practices, etc.\nLet's assume for the purposes of this question that the requests are relatively long-live... |
Here is a problem I've struggled with ever since I first started learning object-oriented programming: how should one implement a logger in "proper" OOP code?
By this, I mean an object that has a method that we want every other object in the code to be able to access; this method would output to console/file/whatever, ... | Implementing a logger in an object-oriented programming (OOP) design can indeed be challenging, especially when considering the principles of encapsulation and maintainability. Here are several strategies you can use to implement a logger in a way that adheres to OOP principles without resorting to global variables or ... | 4,742 | [
{
"from": "human",
"value": "Here is a problem I've struggled with ever since I first started learning object-oriented programming: how should one implement a logger in \"proper\" OOP code?\nBy this, I mean an object that has a method that we want every other object in the code to be able to access; this me... |
I want to fire up a flash presentation inside Powerpoint 2007. I am calling the Win32 ShellExecute() routine. When I run this from a location whose path is a UNC path (\myserver\myfolder\sample.ppt) it does not work.
The ShellExecute routine expects 6 arguments, one of which is the path to run it from. I've tried to se... | When using `ShellExecute()` to launch a PowerPoint presentation from a UNC path in PowerPoint 2007, there are a few considerations to keep in mind. The `ShellExecute` function requires a working directory, and sometimes using a UNC path can lead to issues if the working directory is not set correctly.
Here’s a way to ... | 6,033 | [
{
"from": "human",
"value": "I want to fire up a flash presentation inside Powerpoint 2007. I am calling the Win32 ShellExecute() routine. When I run this from a location whose path is a UNC path (\\myserver\\myfolder\\sample.ppt) it does not work.\nThe ShellExecute routine expects 6 arguments, one of which... |
I want to get an overview of files that are updated in TFS (that someone else checked in) that I don't have the latest version for.
| To get an overview of files that have been updated in Team Foundation Server (TFS) that you don't have the latest version for, you can use the Visual Studio IDE or the command-line tools provided by TFS. Here’s how you can do this using both methods:
### Using Visual Studio
1. **Open Visual Studio** and connect to yo... | 4,246 | [
{
"from": "human",
"value": "I want to get an overview of files that are updated in TFS (that someone else checked in) that I don't have the latest version for.\n"
},
{
"from": "gpt",
"value": "To get an overview of files that have been updated in Team Foundation Server (TFS) that you don't have... |
I have a simple xml document that looks like the following snippet. I need to write a XSLT transform that basically 'unpivots' this document based on some of the attributes.
<?xml version="1.0" encoding="utf-8" ?>
<root xmlns:z="foo">
<z:row A="1" X="2" Y="n1" Z="500"/>
<z:row A="2" X="5" Y="n2" Z="1500"/>
</ro... | To achieve the desired output through XSLT, you can create a stylesheet that processes each `<z:row>` element and generates a new set of `<z:row>` elements based on its attributes. Here is an example of how you could write the XSLT for your transformation:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet ... | 5,508 | [
{
"from": "human",
"value": "I have a simple xml document that looks like the following snippet. I need to write a XSLT transform that basically 'unpivots' this document based on some of the attributes.\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<root xmlns:z=\"foo\">\n <z:row A=\"1\" X=\"2\" Y=\"n1\"... |
I want to be able to get an estimate of how much code & static data is used by my C++ program?
Is there a way to find this out by looking at the executable or object files? Or perhaps something I can do at runtime?
Will objdump & readelf help?
| Yes, you can obtain estimates of how much code and static data is used by your C++ program by examining the executable or object files. Tools like `objdump` and `readelf` can certainly help in this process, along with other methods. Here are some approaches you can take:
### 1. Use `objdump`
`objdump` is a versatile ... | 5,197 | [
{
"from": "human",
"value": "I want to be able to get an estimate of how much code & static data is used by my C++ program?\nIs there a way to find this out by looking at the executable or object files? Or perhaps something I can do at runtime?\nWill objdump & readelf help?\n"
},
{
"from": "gpt",
... |
Let's say that there is a solution that contains two projects (Project1 and Project2).
Project1 is set as a StartUp Project (its name is displayed in a bold font). I double-click some file in Project2 to open it. The file opens, but something else happens too - Project2 gets set as a StartUp Project.
I tried to find an... | The behavior you're experiencing—where double-clicking a file in Project2 changes the startup project from Project1 to Project2—is often a feature in IDEs like Visual Studio that aims to provide a more context-sensitive development experience. However, it can indeed feel like a bug if it interrupts your workflow unexpe... | 6,411 | [
{
"from": "human",
"value": "Let's say that there is a solution that contains two projects (Project1 and Project2).\nProject1 is set as a StartUp Project (its name is displayed in a bold font). I double-click some file in Project2 to open it. The file opens, but something else happens too - Project2 gets se... |
Suppose I have the following CSS rule in my page:
body {
font-family: Calibri, Trebuchet MS, Helvetica, sans-serif;
}
How could I detect which one of the defined fonts were used in the user's browser?
For people wondering why I want to do this is because the font I'm detecting contains glyphs that are not availabl... | Detecting the specific font used by a user's browser can be tricky, as CSS does not provide a built-in way to directly access or check which font is rendered for a given text. However, you can use a combination of JavaScript and CSS to achieve this by measuring the dimensions of text rendered with a specific font. Here... | 3,088 | [
{
"from": "human",
"value": "Suppose I have the following CSS rule in my page:\nbody {\n font-family: Calibri, Trebuchet MS, Helvetica, sans-serif;\n}\n\nHow could I detect which one of the defined fonts were used in the user's browser?\nFor people wondering why I want to do this is because the font I'm ... |
The company I work for is wanting to add blog functionality to our website and they were looking to spend an awful amount of money to have some crap being built on top of a CMS they purchased (sitecore). I pointed them to Telligent's Community Server and we had a sales like meeting today to get the Marketing folks on... | It sounds like you're considering Telligent's Community Server (now known as Telligent Community or Zimbra Community) for your blog functionality, and you have specific requirements that make it a strong candidate. Here are some insights regarding your questions about Community Server, including potential issues with s... | 3,151 | [
{
"from": "human",
"value": "The company I work for is wanting to add blog functionality to our website and they were looking to spend an awful amount of money to have some crap being built on top of a CMS they purchased (sitecore). I pointed them to Telligent's Community Server and we had a sales like me... |
When i try to offline a disk in a zfs raidz pool (the raidz pool is not mirrored), zfs says that the disk cannot be taken offline because it has no valid mirror.
Isn't one of the properties of raidz that it has a redundant disk (or even 2 disks in raidz2)...?
| Yes, RAID-Z and RAID-Z2 do provide redundancy; however, ZFS operates under certain constraints when it comes to taking disks offline. Here’s what you need to understand:
1. **RAID-Z Basics**: In a RAID-Z configuration (RAID-Z1), data and parity information are distributed across all disks in the pool, providing redund... | 7,267 | [
{
"from": "human",
"value": "When i try to offline a disk in a zfs raidz pool (the raidz pool is not mirrored), zfs says that the disk cannot be taken offline because it has no valid mirror.\nIsn't one of the properties of raidz that it has a redundant disk (or even 2 disks in raidz2)...?\n"
},
{
"f... |
I have a REST data service where I want to allow the users to create new items with HTTP PUT using different formats like json,xml,csv. I'm unsure how to best handle the format specification in the url:
PUT /ressource/ID/json
PUT /ressource/ID/xml
or
PUT /ressource/ID?format=json
PUT /ressource/ID?format=xml
So what ... | When designing a REST API, specifying how to indicate different formats for data payloads can be approached in multiple ways. Both methods you presented (using URL path segments or query parameters) can be valid, but they come with different implications:
1. **Using Path Segments**:
- `PUT /resource/ID/json`
- T... | 6,510 | [
{
"from": "human",
"value": "I have a REST data service where I want to allow the users to create new items with HTTP PUT using different formats like json,xml,csv. I'm unsure how to best handle the format specification in the url:\nPUT /ressource/ID/json\nPUT /ressource/ID/xml\n\nor\nPUT /ressource/ID?form... |
Is there any way to save an object using Hibernate if there is already an object using that identifier loaded into the session?
Doing session.contains(obj) seems to only return true if the session contains that exact object, not another object with the same ID.
Using merge(obj) throws an exception if the object is new... | In Hibernate, if you want to save an object that has the same identifier as an already loaded object in the session, you need to take into account how Hibernate handles persistence contexts and session states.
Here are some strategies you can use:
### 1. Use `session.merge()` Correctly
The `session.merge()` method c... | 5,118 | [
{
"from": "human",
"value": "Is there any way to save an object using Hibernate if there is already an object using that identifier loaded into the session?\n\nDoing session.contains(obj) seems to only return true if the session contains that exact object, not another object with the same ID.\nUsing merge(o... |
There are so many examples of how to set up your dotnet projects but none seemed to fit our situation.
We have one solution with multiple applications, multiple dependencies. We're on SourceSafe currently and are planning to move to subversion but are finding it difficult to organize our source the right way.
Example... | Your situation highlights several common challenges when migrating legacy systems to a more modern development environment, especially with regards to project organization, dependency management, and deployment strategies. Below are some structured recommendations to help you navigate this transition to Subversion (SVN... | 2,428 | [
{
"from": "human",
"value": "There are so many examples of how to set up your dotnet projects but none seemed to fit our situation.\nWe have one solution with multiple applications, multiple dependencies. We're on SourceSafe currently and are planning to move to subversion but are finding it difficult to o... |
Well the docs finally said it, I need to take it easy on my wrist for a few months. Being that I'm a .NET Developer this could end my livelihood for a little while, something I'm not anxious to do. That said, are there any good handsfree options for developers? Anyone had success using any of the speech recognition so... | I'm glad to hear you've recovered to a point where you can return to two-handed programming! It sounds like you had a tough time, but I'm glad you're back on track. For those times when you might need to take it easy on your wrist again or for future reference, here are some hands-free options that developers have foun... | 6,740 | [
{
"from": "human",
"value": "Well the docs finally said it, I need to take it easy on my wrist for a few months. Being that I'm a .NET Developer this could end my livelihood for a little while, something I'm not anxious to do. That said, are there any good handsfree options for developers? Anyone had succe... |
I use PHPMyAdmin for convenience in updating a remote database.
But it doesn't show warnings, by default, which recently got me into some embarrassing trouble where I was updating a SET field with string not on its list and not noticing the problem.
I'm using 2.11.9.1 (Dreamhost's default install).
On the PHPMyAdmin w... | In phpMyAdmin, the ability to display warnings is a feature that is often enabled by default in newer versions. However, in older versions like 2.11.9.1, it may not be enabled by default, and the user interface may not provide an obvious way to turn it on.
Here’s how you can check for warnings or enable the display of... | 6,980 | [
{
"from": "human",
"value": "I use PHPMyAdmin for convenience in updating a remote database.\nBut it doesn't show warnings, by default, which recently got me into some embarrassing trouble where I was updating a SET field with string not on its list and not noticing the problem. \nI'm using 2.11.9.1 (Dreamh... |
I am working on a web application where I want the content to fill the height of the entire screen.
The page has a header, which contains a logo, and account information. This could be an arbitrary height. I want the content div to fill the rest of the page to the bottom.
I have a header div and a content div. At the m... | You can achieve the layout you desire using CSS Flexbox, which is a modern approach that eliminates the need for tables. Flexbox allows you to create a flexible and responsive layout that can automatically fill the available space. Here's how to achieve your layout with Flexbox:
### HTML Structure
```html
<div id="pa... | 6,161 | [
{
"from": "human",
"value": "I am working on a web application where I want the content to fill the height of the entire screen.\nThe page has a header, which contains a logo, and account information. This could be an arbitrary height. I want the content div to fill the rest of the page to the bottom.\nI ha... |
DB_DataObject does not appear to be ActiveRecord because you do not necessarily store business logic in the "table" classes. It seems more like Table Data Gateway or Row Data Gateway, but I really cannot tell. What I need is good ORM layer that we can use with DataMapper and a DomainModel. Any ideas?
| It sounds like you're looking for a way to implement an ORM (Object-Relational Mapping) layer that fits well with a Domain Model and Data Mapper pattern, and you're considering alternatives to DB_DataObject. Here are a few popular options that might suit your needs:
1. **Doctrine ORM** (for PHP): Doctrine is a powerfu... | 6,833 | [
{
"from": "human",
"value": "DB_DataObject does not appear to be ActiveRecord because you do not necessarily store business logic in the \"table\" classes. It seems more like Table Data Gateway or Row Data Gateway, but I really cannot tell. What I need is good ORM layer that we can use with DataMapper and a... |
Possible Duplicate:
SQL Query to get latest price
I have a database containing stock price history. I want to select most recent prices for every stock that is listed. I know PostreSQL has a DISTINCT ON statement that would suit ideally here.
Table columns are name, closingPrice and date; name and date together form... | To efficiently select the most recent stock prices for every stock in your database, you can indeed use the `DISTINCT ON` clause in PostgreSQL, which can provide an elegant solution to this problem. Here's how you can do it:
```sql
SELECT DISTINCT ON (name) name, closingPrice, date
FROM stockPrices
ORDER BY name, date... | 7,368 | [
{
"from": "human",
"value": "\nPossible Duplicate:\nSQL Query to get latest price \n\nI have a database containing stock price history. I want to select most recent prices for every stock that is listed. I know PostreSQL has a DISTINCT ON statement that would suit ideally here.\nTable columns are name, clos... |
this is a bit of a philosophical question. I am adding a small feature to my software which I assume will be used by most users but only maybe 10% of the times they use the software. In other words, the software has been fine without it for 3 months, but 4 or 5 users have asked for it, and I agree that it should be the... | This is indeed a philosophical question that touches on software development, user experience, and the nature of user expectations. Here are some considerations to help you navigate this decision:
1. **User Needs and Expectations**: Since you have received requests from users, it indicates that there is some demand fo... | 7,235 | [
{
"from": "human",
"value": "this is a bit of a philosophical question. I am adding a small feature to my software which I assume will be used by most users but only maybe 10% of the times they use the software. In other words, the software has been fine without it for 3 months, but 4 or 5 users have asked ... |
I am using the function below to match URLs inside a given text and replace them for HTML links. The regular expression is working great, but currently I am only replacing the first match.
How I can replace all the URL? I guess I should be using the exec command, but I did not really figure how to do it.
function repla... | To replace all occurrences of URLs in your text with HTML links, you can use the `replace` method with a global regular expression flag (`g`). This will ensure that all matches are replaced, not just the first one.
You can modify your regular expression to include the `g` flag and remove the capturing group, since it... | 3,081 | [
{
"from": "human",
"value": "I am using the function below to match URLs inside a given text and replace them for HTML links. The regular expression is working great, but currently I am only replacing the first match.\nHow I can replace all the URL? I guess I should be using the exec command, but I did not ... |
What is "missing" in the Visual Studio 2008 Express Editions?
In particular,
what functionality is not available?
what restrictions are there on its use?
| Visual Studio 2008 Express Editions were designed to provide a simplified, lightweight development environment for different programming languages (such as Visual C#, Visual Basic, Visual Web Developer, and Visual C++). While they are quite capable for small projects and learning purposes, there are several features an... | 4,714 | [
{
"from": "human",
"value": "What is \"missing\" in the Visual Studio 2008 Express Editions?\nIn particular,\n\nwhat functionality is not available?\nwhat restrictions are there on its use?\n\n"
},
{
"from": "gpt",
"value": "Visual Studio 2008 Express Editions were designed to provide a simplifi... |
I'm wanting to change my movie clips to actionscript classes in AS3. Is there a standard list of things I need to do to make sure the classes work?
| Converting movie clips to ActionScript 3 (AS3) classes is a common practice to improve organization and reusability in your Flash projects. Here’s a standard list of steps and best practices you can follow to ensure that your classes work correctly:
### Steps to Convert Movie Clips to AS3 Classes
1. **Create a New Ac... | 6,017 | [
{
"from": "human",
"value": "I'm wanting to change my movie clips to actionscript classes in AS3. Is there a standard list of things I need to do to make sure the classes work?\n"
},
{
"from": "gpt",
"value": "Converting movie clips to ActionScript 3 (AS3) classes is a common practice to improve... |
A Sprint cellular modem plugs into a laptop - often the PCMCIA slot. To connect, the user opens a program called the Connection Manager. This program has a menu option to display the serial number and phone number of the modem that's currently inserted.
Does that imply that the serial/phone number of the modem could be... | In the context of Windows XP, when a Sprint cellular modem is connected via a PCMCIA slot and is managed by the Connection Manager, the modem itself may expose certain details such as its serial number and phone number via the Windows operating system.
### Availability of Modem Information to Other Programs
1. **API... | 6,096 | [
{
"from": "human",
"value": "A Sprint cellular modem plugs into a laptop - often the PCMCIA slot. To connect, the user opens a program called the Connection Manager. This program has a menu option to display the serial number and phone number of the modem that's currently inserted.\nDoes that imply that the... |
If I use restful_authentication in my ruby on rails app are passwords transfered between the broswer and the server in paintext? And if so how worried should I be about it?
| When using `restful_authentication` in a Ruby on Rails application, it is important to understand how passwords are handled during authentication. By default, if you do not take additional precautions, passwords can be transmitted in plaintext over the network.
### Concerns About Plaintext Passwords
1. **Unencrypted ... | 6,866 | [
{
"from": "human",
"value": "If I use restful_authentication in my ruby on rails app are passwords transfered between the broswer and the server in paintext? And if so how worried should I be about it?\n"
},
{
"from": "gpt",
"value": "When using `restful_authentication` in a Ruby on Rails applic... |
What is the best way to draw a variable width line without using glLineWidth?
Just draw a rectangle?
Various parallel lines?
None of the above?
| The best way to draw a variable width line without using `glLineWidth` can depend on the specific requirements and constraints of your graphics application, but here are some common techniques:
### 1. **Using a Quad (Rectangle)**:
- Draw a rectangle that follows the path of the line. This is often the simplest meth... | 7,521 | [
{
"from": "human",
"value": "What is the best way to draw a variable width line without using glLineWidth? \nJust draw a rectangle? \nVarious parallel lines?\nNone of the above?\n"
},
{
"from": "gpt",
"value": "The best way to draw a variable width line without using `glLineWidth` can depend on... |
What are the main differences (if any) between the box models of IE8 and Firefox3?
Are they the same now?
What are the other main differences between these two browsers? Can a web developer assume that these two browsers as the same since they (seem to) support the latest web standards?
| The differences between the box models in Internet Explorer 8 (IE8) and Firefox 3 are significant, particularly in how they interpret the CSS box model properties for width and height.
### Box Model Differences
1. **Box Model Interpretation**:
- **IE8**: By default, IE8 uses the "traditional" box model, where the... | 1,986 | [
{
"from": "human",
"value": "What are the main differences (if any) between the box models of IE8 and Firefox3?\nAre they the same now?\nWhat are the other main differences between these two browsers? Can a web developer assume that these two browsers as the same since they (seem to) support the latest web ... |
I have a framework written in Perl that sets a bunch of environment variables to support interprocess (typically it is sub process) communication. We keep a sets of key/value pairs in XML-ish files. We tried to make the key names camel-case somethingLikeThis. This all works well.
Recently we have had occasion to pa... | In Perl on Windows, the environment variable names are typically stored in a case-insensitive manner by the operating system. This means that when you create or access environment variables, the key names may be automatically converted to uppercase. As a result, when you export these variables to files or pass them to ... | 5,015 | [
{
"from": "human",
"value": "I have a framework written in Perl that sets a bunch of environment variables to support interprocess (typically it is sub process) communication. We keep a sets of key/value pairs in XML-ish files. We tried to make the key names camel-case somethingLikeThis. This all works ... |
I'm handling the onSelectIndexChanged event. An event is raised when the DropDownList selection changes. the problem is that the DropDownList still returns the old values for SelectedValue and SelectedIndex. What am I doing wrong?
Here is the DropDownList definition from the aspx file:
<div style="margin: 0px; padding:... | The issue you're experiencing is related to the ASP.NET page lifecycle. The `OnSelectedIndexChanged` event for the `DropDownList` occurs after the page's controls have been populated (and their state restored) but before the page is fully rendered. If the `DropDownList` is being repopulated in the Page_Load event witho... | 6,705 | [
{
"from": "human",
"value": "I'm handling the onSelectIndexChanged event. An event is raised when the DropDownList selection changes. the problem is that the DropDownList still returns the old values for SelectedValue and SelectedIndex. What am I doing wrong?\nHere is the DropDownList definition from the as... |
I have been trying out Service Factory and have run into some problems in regards to long filenames - surpassing the limit in Vista/XP. The problem is that when generating code from the models service factory prefixes everything with the namespace specified. Making the folder structure huge. For example starting in
c:\... | You're encountering a common issue with overly long file paths and names due to the way namespaces are being used in your folder structure when generating code with Service Factory. Here are some potential workarounds and solutions you can consider:
### 1. Shorten the Namespace
If possible, consider shortening your n... | 3,968 | [
{
"from": "human",
"value": "I have been trying out Service Factory and have run into some problems in regards to long filenames - surpassing the limit in Vista/XP. The problem is that when generating code from the models service factory prefixes everything with the namespace specified. Making the folder st... |
I've got a collection that implements an interface that extends both IList<T> and List.
public Interface IMySpecialCollection : IList<MyObject>, IList { ... }
That means I have two versions of the indexer.
I wish the generic implementation to be used, so I implement that one normally:
public MyObject this[int index... | The issue you're encountering arises from the way that C# handles interface implementations and method resolutions when there are multiple definitions that could apply. When you create a new interface that inherits from both `IList<T>` and `IList`, you essentially create two separate indexers that can be seen as candid... | 6,346 | [
{
"from": "human",
"value": "I've got a collection that implements an interface that extends both IList<T> and List. \npublic Interface IMySpecialCollection : IList<MyObject>, IList { ... }\n\nThat means I have two versions of the indexer. \nI wish the generic implementation to be used, so I implement that... |
I have 1 red polygon say and 50 randomly placed blue polygons - they are situated in geographical 2D space. What is the quickest/speediest algorithim to find the the shortest distance between a red polygon and its nearest blue polygon?
Bear in mind that it is not a simple case of taking the points that make up the ver... | Finding the shortest distance between a red polygon and multiple blue polygons in a 2D space can be complex due to the nature of polygons. Since you are looking for the closest blue polygon to a given red polygon, you can use the following algorithm, which leverages geometric principles and efficient distance calculati... | 3,888 | [
{
"from": "human",
"value": "I have 1 red polygon say and 50 randomly placed blue polygons - they are situated in geographical 2D space. What is the quickest/speediest algorithim to find the the shortest distance between a red polygon and its nearest blue polygon?\nBear in mind that it is not a simple case... |
I'm looking for a way to find a the windows login associated with a specific group. I'm trying to add permissions to a tool that only allows names formatted like:
DOMAIN\USER
DOMAIN\GROUP
I have a list of users in active directory format that I need to add:
ou=group1;ou=group2;ou=group3
I have tried adding DOMAIN\Gr... | To find the Windows login associated with a specific group in Active Directory, you typically need to ensure you are using the correct format and permissions to access the information. Here's a general approach you can follow:
### 1. Check Group Membership in Active Directory
Since you're not a LAN admin, you may hav... | 3,758 | [
{
"from": "human",
"value": "I'm looking for a way to find a the windows login associated with a specific group. I'm trying to add permissions to a tool that only allows names formatted like:\nDOMAIN\\USER \nDOMAIN\\GROUP\n\nI have a list of users in active directory format that I need to add:\nou=group1;ou... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.