instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Below is my $.ajax call, how do I put a selects (multiple) selected values in the data section?
$.ajax({
type: "post",
url: "http://myServer" ,
dataType: "text",
data: {
'service' : 'myService',
'program' : 'myProgram',
'start' : start,
'end' : end ,
},
succes... | To include the selected values from a multiple `<select>` element in your `data` section of the `.ajax` call, you can first create an array to hold those values while looping through the selected options. Then you can add that array to your `data` object.
Here’s how you can modify your AJAX call to achieve this:
```... | 18,755 | [
{
"from": "human",
"value": "Below is my $.ajax call, how do I put a selects (multiple) selected values in the data section?\n$.ajax({\n type: \"post\",\n url: \"http://myServer\" ,\n dataType: \"text\",\n data: {\n 'service' : 'myService',\n 'program' : 'myProgram',\n 'star... |
This is kind of a weird problem, but I have to create a search box for our site that will be iframed on another site. When the user clicks the search button, it needs to redirect the parent frame to our search results page.
At the moment what I've done is to make the search button a postback trigger then registering a... | You're on the right track with using `window.parent.location.href`, but you can make the implementation cleaner and avoid the issue of the back button redirecting users back to the search results page.
### Here’s a refined approach:
1. **Use a Button Click Event to Redirect the Parent Frame**:
Instead of using a p... | 18,553 | [
{
"from": "human",
"value": "This is kind of a weird problem, but I have to create a search box for our site that will be iframed on another site. When the user clicks the search button, it needs to redirect the parent frame to our search results page.\nAt the moment what I've done is to make the search bu... |
Underneath one "Project" in TFS we have multiple products. This is because for us, a project is a business unit and they each can have many applications that we develop for them. Each one has its own folder in source control(under the TFS project) and each one has its own TeamBuild set up. The issue I have is that w... | To filter the changesets in TFS (Team Foundation Server) build reports to only include those that are relevant to the specific applications being built, you can consider the following approaches:
### 1. **Use Build Definitions Scoped to Specific Paths**
If each application has its own folder in source control, ensure ... | 13,376 | [
{
"from": "human",
"value": "Underneath one \"Project\" in TFS we have multiple products. This is because for us, a project is a business unit and they each can have many applications that we develop for them. Each one has its own folder in source control(under the TFS project) and each one has its own Te... |
I want to have a class which implements an interface, which specifies the specific subclass as a parameter.
public abstract Task implements TaskStatus<Task> {
TaskStatus<T> listener;
protected complete() {
// ugly, unsafe cast
callback.complete((T) this);
}
}
public interface TaskStatus<T> {
publ... | Your approach to ensure type safety in your `Task` and `TaskStatus` implementation is quite close, but it requires a few adjustments to enforce the correct type relationship.
Here's a correct way to achieve what you want:
1. Use a generic type parameter for the `Task` class that represents the specific subclass.
2. E... | 19,505 | [
{
"from": "human",
"value": "I want to have a class which implements an interface, which specifies the specific subclass as a parameter.\npublic abstract Task implements TaskStatus<Task> {\n TaskStatus<T> listener;\n\n protected complete() {\n // ugly, unsafe cast\n callback.complete((T) this);\... |
I have these two pieces of code, wich one is more readable?
foreach
decimal technicalPremium = 0;
foreach (Risk risk in risks)
{
technicalPremium = technicalPremium + risk.TechnicalPremium;
}
return technicalPremium;
linq
return risks.Sum(risk => risk.TechnicalPremium);
| The second piece of code using LINQ is generally considered more readable and concise:
```csharp
return risks.Sum(risk => risk.TechnicalPremium);
```
Here’s why the LINQ version is often preferred:
1. **Conciseness**: The LINQ approach accomplishes the same task in a single line, reducing the amount of boilerplate c... | 21,242 | [
{
"from": "human",
"value": "I have these two pieces of code, wich one is more readable?\n\nforeach\ndecimal technicalPremium = 0;\nforeach (Risk risk in risks)\n{\n technicalPremium = technicalPremium + risk.TechnicalPremium;\n}\nreturn technicalPremium;\n\nlinq\nreturn risks.Sum(risk => risk.Technical... |
I am trying to fix some bugs in a product I inherited, and I have this snippet of javascript that is supposed to hilight a couple of boxes and pop up a confirm box. What currently happens is I see the boxes change color and there is a 5 or so second delay, then it's as if the missing confirm just accepts itself. Does... | The issue you're experiencing with the confirm dialog is likely due to the way the browser handles the focus and style changes before displaying the confirmation box. Specifically, the `focus()` method can sometimes delay the display of the confirmation dialog, especially if it's followed by immediate style changes.
H... | 18,176 | [
{
"from": "human",
"value": "I am trying to fix some bugs in a product I inherited, and I have this snippet of javascript that is supposed to hilight a couple of boxes and pop up a confirm box. What currently happens is I see the boxes change color and there is a 5 or so second delay, then it's as if the m... |
I cannot seem to compile mod_dontdothat on Windows. Has anybody managed to achieve this?
Edit:
I've tried compiling the file according to the readme on the site and I've tried to add extra libs to reduce the link errors. Ive got the following installed:
Apache 2.2.9
Visual Studio 2008
ActivePerl
apxs-win32 from Apache... | It looks like you're encountering multiple unresolved external symbol errors when trying to compile the `mod_dontdothat` module for Apache on Windows. This is often due to missing libraries or improper linkage. Let's go through some steps to resolve the issues.
### Steps to Resolve Unresolved External Symbols
1. **Ch... | 14,671 | [
{
"from": "human",
"value": "I cannot seem to compile mod_dontdothat on Windows. Has anybody managed to achieve this?\nEdit:\nI've tried compiling the file according to the readme on the site and I've tried to add extra libs to reduce the link errors. Ive got the following installed:\n\nApache 2.2.9\nVisual... |
I've so far dabbled in Flash doing 1-man shows for quite some time, but have never done any big projects with it, where actually source management and code-reuse was truly necessary. However I'm considering Flash for a new project, but this time around it's won't be a 1-man show, that's when it struck me that I had no ... | Working on a larger project in Flash (or any game/application development environment) requires good planning and effective collaboration. Here are some tips and resources that can help you manage your project more effectively:
### Tips for Effective Workflow in Flash
1. **Version Control**: Use a version control sys... | 17,816 | [
{
"from": "human",
"value": "I've so far dabbled in Flash doing 1-man shows for quite some time, but have never done any big projects with it, where actually source management and code-reuse was truly necessary. However I'm considering Flash for a new project, but this time around it's won't be a 1-man show... |
Elementree has become the accepted standard for interacting with xml. What is the prevalent web service/SOAP library in use today?
| As of my last knowledge update in October 2023, the prevalent libraries for working with web services and SOAP in various programming languages include:
1. **Java**: Apache CXF and JAX-WS (Java API for XML Web Services) are widely used for creating SOAP web services in Java. Spring Web Services is also popular for its... | 19,741 | [
{
"from": "human",
"value": "Elementree has become the accepted standard for interacting with xml. What is the prevalent web service/SOAP library in use today?\n"
},
{
"from": "gpt",
"value": "As of my last knowledge update in October 2023, the prevalent libraries for working with web services ... |
I'm maintaining a library that contains compiled objects that need to be linked into
a 3rd party executable. sometimes the executable has been compiled for Solaris, sometimes as a 32bit Linux Application, sometimes its a 64bit linux application.
What I'd love to do is pass one "path" to the library, and have the appl... | To create a more flexible and automated way to link your PLI/VPI functions based on the operating system and architecture, you can make use of environment variables and a shell script to dynamically resolve the correct library path. This way, you can set up your library paths according to the system's characteristics w... | 18,293 | [
{
"from": "human",
"value": "I'm maintaining a library that contains compiled objects that need to be linked into \na 3rd party executable. sometimes the executable has been compiled for Solaris, sometimes as a 32bit Linux Application, sometimes its a 64bit linux application. \nWhat I'd love to do is pass o... |
By default, cocoa progress bars are slightly fat and I want something a little slimmer, like the progress bars seen in the Finder copy dialog. However, Interface Builder locks the NSProgressIndicator control height to 20 pixels and my programmatic attempts to slim down aren't working, as calls to
[progressBar setContro... | If you want to create a slimmer `NSProgressIndicator` in a macOS application, it's true that the default height is set to 20 pixels, and the `setControlSize:` method does not affect the height of a `NSProgressIndicator`. However, you can achieve a slimmer progress bar by subclassing `NSProgressIndicator` and overriding... | 16,482 | [
{
"from": "human",
"value": "By default, cocoa progress bars are slightly fat and I want something a little slimmer, like the progress bars seen in the Finder copy dialog. However, Interface Builder locks the NSProgressIndicator control height to 20 pixels and my programmatic attempts to slim down aren't wo... |
I'm currently looking for a resource management system for actionscript3. More specifically in this case, I'm looking for opinions on off-the-shelf resource loaders/managers from people who have used them,
are they clean/simple to use?
are they designed to be extended?
I plan on using this with an MVC like system, M... | When looking for a resource management system for ActionScript 3, specifically for loaders and managers, there are several popular options, and each has its pros and cons. Here’s a brief overview of the three you've mentioned based on common opinions from users:
### 1. **masapi**
- **Usability:** masapi is considered ... | 18,488 | [
{
"from": "human",
"value": "I'm currently looking for a resource management system for actionscript3. More specifically in this case, I'm looking for opinions on off-the-shelf resource loaders/managers from people who have used them, \n\nare they clean/simple to use? \nare they designed to be extended?\nI ... |
In your own application that is.
[edit]
Alright, so I agree completely -- more than you know -- without equivocation that graphical emoticons are an abomination.
But! That doesn't help me when the project owners tell me that we must support graphical emoticons.
[/edit]
The problem more complex than it would initially s... | Rendering graphical emoticons in a text-based environment can indeed present various challenges, especially when considering issues like text editing, wrapping, and alignment. Here are some strategies you might consider based on your experience and the challenges you've mentioned:
### 1. **Text Replacement with Overla... | 15,922 | [
{
"from": "human",
"value": "In your own application that is.\n[edit]\nAlright, so I agree completely -- more than you know -- without equivocation that graphical emoticons are an abomination.\nBut! That doesn't help me when the project owners tell me that we must support graphical emoticons.\n[/edit]\nThe ... |
How can I delete the contents of a local folder in Python?
The current project is for Windows, but I would like to see *nix also.
| You can delete the contents of a local folder in Python using the `os` and `shutil` modules. Here’s how to do it for both Windows and Unix-like systems (Linux, macOS). The method will work on both platforms since Python handles file operations in a platform-independent way.
### Using `os` and `shutil`
Here’s a genera... | 19,018 | [
{
"from": "human",
"value": "How can I delete the contents of a local folder in Python?\nThe current project is for Windows, but I would like to see *nix also.\n"
},
{
"from": "gpt",
"value": "You can delete the contents of a local folder in Python using the `os` and `shutil` modules. Here’s how... |
I'm currently in the process of writing my first Windows Forms application. I've read a few C# books now so I've got a relatively good understanding of what language features C# has to deal with exceptions. They're all quite theoretical however so what I haven't got yet is a feel for how to translate the basic concepts... | When it comes to exception handling in C# Windows Forms applications, it’s important to develop a solid understanding of how to manage errors effectively while keeping your application robust and user-friendly. Here are some guidelines, common pitfalls, and best practices:
### 1. When to Re-Throw an Exception
- **Pres... | 16,675 | [
{
"from": "human",
"value": "I'm currently in the process of writing my first Windows Forms application. I've read a few C# books now so I've got a relatively good understanding of what language features C# has to deal with exceptions. They're all quite theoretical however so what I haven't got yet is a fee... |
What is the simplest SOAP example using Javascript?
To be as useful as possible, the answer should:
Be functional (in other words actually work)
Send at least one parameter that can be set elsewhere in the code
Process at least one result value that can be read elsewhere in the code
Work with most modern browser versi... | Here's a simple example of how to create a SOAP request using JavaScript. This example assumes you are calling a SOAP web service that takes a single parameter and returns a result.
### Example SOAP Request in JavaScript
```javascript
function soapRequest(parameterValue) {
// Create a new XMLHttpRequest object
... | 17,548 | [
{
"from": "human",
"value": "What is the simplest SOAP example using Javascript?\nTo be as useful as possible, the answer should:\n\nBe functional (in other words actually work)\nSend at least one parameter that can be set elsewhere in the code\nProcess at least one result value that can be read elsewhere i... |
I've managed to mostly ignore all this multi-byte character stuff, but now I need to do some UI work and I know my ignorance in this area is going to catch up with me! Can anyone explain in a few paragraphs or less just what I need to know so that I can localize my applications? What types should I be using (I use both... | Certainly! When localizing applications, understanding multi-byte character encodings is essential, especially since languages can include characters beyond the traditional ASCII set. Here’s a brief overview for both .NET and C/C++ in the context of localization:
### Multi-Byte Character Encodings
1. **UTF-8**: This i... | 15,428 | [
{
"from": "human",
"value": "I've managed to mostly ignore all this multi-byte character stuff, but now I need to do some UI work and I know my ignorance in this area is going to catch up with me! Can anyone explain in a few paragraphs or less just what I need to know so that I can localize my applications?... |
I've got a UI front end which talks to and manipulates a SQL Server database, and one of the things it can do is run reports on the data in the database.
This UI can be installed on multiple computers, and so far I've just been keeping the reports in a folder with the install, but this means that any time a new report... | Storing report files (like `.rpt` files) as BLOBs in your SQL Server database is a viable approach to centralize report management and eliminate the need to manually distribute reports to each installation of your UI. Here are some considerations, tips, and potential caveats for this approach:
### Benefits
1. **Centra... | 16,521 | [
{
"from": "human",
"value": "I've got a UI front end which talks to and manipulates a SQL Server database, and one of the things it can do is run reports on the data in the database. \nThis UI can be installed on multiple computers, and so far I've just been keeping the reports in a folder with the install,... |
I am inside of...
public class bgchange : IMapServerDropDownBoxAction
{
void IServerAction.ServerAction(ToolbarItemInfo info)
{
Some code...
and after "some code" I want to trigger
[WebMethod]
public static void DoSome()
{
}
Which triggers some javascript. Is this possible?
Ok, switch methods here. I ... | The issue you're encountering is related to the fact that `Page.ClientScript` is an instance member of the `Page` class, and you're trying to access it from a static context within your `bgchange` class, which implements `IServerAction`.
Since you're within a class that does not directly have access to the `Page` inst... | 18,455 | [
{
"from": "human",
"value": "I am inside of...\npublic class bgchange : IMapServerDropDownBoxAction\n{\n void IServerAction.ServerAction(ToolbarItemInfo info)\n {\n Some code...\n\nand after \"some code\" I want to trigger\n[WebMethod]\npublic static void DoSome()\n{\n\n}\n\nWhich triggers some ja... |
I have read (or perhaps heard from a colleague) that in .NET, TransactionScope can hit its timeout and then VoteCommit (as opposed to VoteRollback). Is this accurate or hearsay? I couldn't track down information on the web that talked about this issue (if it IS an issue), so I wonder if anyone has any direct experien... | The behavior you're describing about `TransactionScope` in .NET is not typical and does not represent standard behavior. In the context of a `TransactionScope`, the timeout refers to the duration the transaction is allowed to remain in an uncertain state before being forcibly rolled back.
### Understanding Transactio... | 19,285 | [
{
"from": "human",
"value": "I have read (or perhaps heard from a colleague) that in .NET, TransactionScope can hit its timeout and then VoteCommit (as opposed to VoteRollback). Is this accurate or hearsay? I couldn't track down information on the web that talked about this issue (if it IS an issue), so I... |
What criteria should I use to decide whether I write VBA code like this:
Set xmlDocument = New MSXML2.DOMDocument
or like this:
Set xmlDocument = CreateObject("MSXML2.DOMDocument")
?
| The choice between using `Set xmlDocument = New MSXML2.DOMDocument` and `Set xmlDocument = CreateObject("MSXML2.DOMDocument")` in VBA often comes down to a few key criteria:
### 1. **Early Binding vs. Late Binding:**
- **Early Binding:** `Set xmlDocument = New MSXML2.DOMDocument`
- Advantages:
- Intelli... | 19,138 | [
{
"from": "human",
"value": "What criteria should I use to decide whether I write VBA code like this:\nSet xmlDocument = New MSXML2.DOMDocument\n\nor like this:\nSet xmlDocument = CreateObject(\"MSXML2.DOMDocument\")\n\n?\n"
},
{
"from": "gpt",
"value": "The choice between using `Set xmlDocument... |
Is it possible to use the Flex Framework and Components, without using MXML? I know ActionScript pretty decently, and don't feel like messing around with some new XML language just to get some simple UI in there. Can anyone provide an example consisting of an .as file which can be compiled (ideally via FlashDevelop, th... | Yes, it is indeed possible to use the Flex Framework and components exclusively with ActionScript, without having to write any MXML. Below is an example of how you can create a simple Flex application that includes a button that, when clicked, opens an alert dialog. This example can be compiled using FlashDevelop or th... | 17,617 | [
{
"from": "human",
"value": "Is it possible to use the Flex Framework and Components, without using MXML? I know ActionScript pretty decently, and don't feel like messing around with some new XML language just to get some simple UI in there. Can anyone provide an example consisting of an .as file which can ... |
I have the following situation:
class A
{
public:
A(int whichFoo);
int foo1();
int foo2();
int foo3();
int callFoo(); // cals one of the foo's depending on the value of whichFoo
};
In my current implementation I save the value of whichFoo in a data member in the constructor and use a switch in cal... | In the scenario you've described, the performance implications of your two approaches can indeed differ, especially given the specific use case you've outlined where an object of class A is constructed only once, but the `callFoo()` method is invoked a large number of times.
### Approach 1: Using a switch statement in... | 15,057 | [
{
"from": "human",
"value": "I have the following situation:\n\nclass A\n{\npublic:\n A(int whichFoo);\n int foo1();\n int foo2();\n int foo3();\n int callFoo(); // cals one of the foo's depending on the value of whichFoo\n};\n\nIn my current implementation I save the value of whichFoo in a d... |
I am searching for a good system for PHP, which does UnitTesting, Subversion, Coding Standards.
I would love to hear your suggestions and which one is the best and why.
I will be running it on a debian server so anything which runs on mac or windows servers would be out of the question.
| For a robust PHP development environment that incorporates Unit Testing, version control (Subversion), and coding standards enforcement, here are several options that you can consider. I'll highlight the most relevant tools and frameworks for your needs, and explain their strengths.
### 1. **PHPUnit for Unit Testing**... | 12,241 | [
{
"from": "human",
"value": "I am searching for a good system for PHP, which does UnitTesting, Subversion, Coding Standards.\nI would love to hear your suggestions and which one is the best and why.\nI will be running it on a debian server so anything which runs on mac or windows servers would be out of the... |
I have a Zimbra installation and I need to programmaticaly update contacts in it. It seems that its REST interface is only working to add new contacts, but I need to update existing ones. Is there a way, tool or something, open-source, to do that ?
| Zimbra provides a REST API that should allow you to update contacts, although sometimes specific implementations can be tricky depending on the version of Zimbra you are using. If you find that the REST API is limited in your case, there are a few alternatives you might consider.
### 1. Zimbra REST API
First, ensure ... | 18,899 | [
{
"from": "human",
"value": "I have a Zimbra installation and I need to programmaticaly update contacts in it. It seems that its REST interface is only working to add new contacts, but I need to update existing ones. Is there a way, tool or something, open-source, to do that ?\n"
},
{
"from": "gpt",... |
Is there a manual for cross-compiling a C++ application from Linux to Windows?
Just that. I would like some information (links, reference, examples...) to guide me to do that.
I don't even know if it's possible.
My objective is to compile a program in Linux and get a .exe file that I can run under Windows.
| Yes, cross-compiling a C++ application from Linux to Windows is definitely possible, and there are several tools and methods to achieve this. The most common approach is to use a cross-compiler, such as MinGW (Minimalist GNU for Windows). Below, I’ll provide you with some resources, tools, and a basic example to help y... | 15,778 | [
{
"from": "human",
"value": "Is there a manual for cross-compiling a C++ application from Linux to Windows?\nJust that. I would like some information (links, reference, examples...) to guide me to do that.\nI don't even know if it's possible. \nMy objective is to compile a program in Linux and get a .exe fi... |
I have a site I made really fast that uses floats to display different sections of content. The floated content and the content that has an additional margin both appear fine in FF/IE, but on safari one of the divs is completely hidden. I've tried switching to padding and position:relative, but nothing has worked for m... | It sounds like you're encountering a common issue that can arise when using floats in CSS, especially with the layout behavior of Safari. Here are some suggestions you can try to troubleshoot and resolve the issue with your layout:
### 1. Clearfix for Floats
You can use a clearfix to ensure that the parent container r... | 18,896 | [
{
"from": "human",
"value": "I have a site I made really fast that uses floats to display different sections of content. The floated content and the content that has an additional margin both appear fine in FF/IE, but on safari one of the divs is completely hidden. I've tried switching to padding and positi... |
Is there any substantial difference between those two terms?. I understand that JDK stands for Java Development Kit that is a subset of SDK (Software Development Kit). But specifying Java SDK, it should mean the same as JDK.
| Yes, you are correct that JDK (Java Development Kit) is a specific implementation of an SDK (Software Development Kit) tailored for Java development. However, there are some important distinctions to consider:
1. **Definition**:
- **SDK (Software Development Kit)**: This is a more general term that refers to a coll... | 19,220 | [
{
"from": "human",
"value": "Is there any substantial difference between those two terms?. I understand that JDK stands for Java Development Kit that is a subset of SDK (Software Development Kit). But specifying Java SDK, it should mean the same as JDK.\n"
},
{
"from": "gpt",
"value": "Yes, you ... |
I need to convert inline css style attributes to their HTML tag equivelants. The solution I have works but runs VERY slowly using the Microsoft .Net Regex namespace and long documents (~40 pages of html). I've tried several variations but with no useful results. I've done a little wrapping around executing the expre... | The performance issue you're encountering with your regular expressions is likely due to their complexity and the greedy nature of the quantifiers you're using. Parsing HTML with regex can be quite slow, especially when dealing with long documents, because regex is not inherently designed to parse nested structures lik... | 16,471 | [
{
"from": "human",
"value": "I need to convert inline css style attributes to their HTML tag equivelants. The solution I have works but runs VERY slowly using the Microsoft .Net Regex namespace and long documents (~40 pages of html). I've tried several variations but with no useful results. I've done a l... |
What is the best way to layout a large django project? The tutorials provide simple instructions for setting up apps, models, and views, but there is less information about how apps and projects should be broken down, how much sharing is allowable/necessary between apps in a typical project (obviously that is largely ... | Laying out a large Django project efficiently requires careful consideration of several factors, including scalability, maintainability, and the organization of code. Below, I’ll outline a structured approach to organizing a large Django project, keeping in mind your specific interests in unit tests, string externaliza... | 11,499 | [
{
"from": "human",
"value": "What is the best way to layout a large django project? The tutorials provide simple instructions for setting up apps, models, and views, but there is less information about how apps and projects should be broken down, how much sharing is allowable/necessary between apps in a ty... |
Is there an easy way to marshal a PHP associative array to and from XML? For example, I have the following array:
$items = array("1", "2",
array(
"item3.1" => "3.1",
"item3.2" => "3.2"
"isawesome" => true
)
);
How would I turn it into something similar to the following XML in as few lin... | You can easily convert a PHP associative array to XML and back again using native PHP functions without the need for external libraries or complex custom classes. Below is a simple solution using the `SimpleXMLElement` class to handle the conversion:
### Converting an Array to XML
Here's a function that will take a P... | 14,714 | [
{
"from": "human",
"value": "Is there an easy way to marshal a PHP associative array to and from XML? For example, I have the following array:\n$items = array(\"1\", \"2\",\n array(\n \"item3.1\" => \"3.1\",\n \"item3.2\" => \"3.2\"\n \"isawesome\" => true\n )\n);\n\nHow would I t... |
I'm looking for a tool that will, in bulk, add a license header to some source files, some of which already have the header. Is there a tool out there that will insert a header, if it is not already present?
Edit: I am intentionally not marking an answer to this question, since answers are basically all environment-sp... | Yes, there are several tools that can help you add a license header to source files in bulk, checking first if one is already present. Here are a few popular options that are environment-specific but widely used:
1. **Header Checker and Inserter Scripts**:
- You can write a simple script in languages like Python or... | 19,654 | [
{
"from": "human",
"value": "I'm looking for a tool that will, in bulk, add a license header to some source files, some of which already have the header. Is there a tool out there that will insert a header, if it is not already present?\nEdit: I am intentionally not marking an answer to this question, sinc... |
I have a large inherited C/C++ project. Are there any good tools or techniques to produce a report on the "sizeof" of all the datatypes, and a breakdown of the stack footprints of each function in such a project.
| Analyzing the memory footprint of data types and function stack usage in a large inherited C/C++ project can be quite complex, but there are tools and techniques that can help you accomplish this. Here's a step-by-step guide on how to approach this task:
### 1. **Using Compiler Options**
Most compilers, such as GCC a... | 13,248 | [
{
"from": "human",
"value": "I have a large inherited C/C++ project. Are there any good tools or techniques to produce a report on the \"sizeof\" of all the datatypes, and a breakdown of the stack footprints of each function in such a project. \n"
},
{
"from": "gpt",
"value": "Analyzing the memo... |
I have a DataRow with columns col1 and col2. Each column has a value: val1 and val2 respectively. How can I turn this into an xml string using C#?
For the DataRow mentioned above I'd like the following string:
<col1>val1</col1><col2>val2</col2>
| To convert a `DataRow` into an XML string format in C#, you can iterate over the columns of the `DataRow`, constructing the XML string accordingly. Here's a sample code snippet that demonstrates how to achieve this:
```csharp
using System;
using System.Data;
public class Program
{
public static void Main()
{
... | 20,561 | [
{
"from": "human",
"value": "I have a DataRow with columns col1 and col2. Each column has a value: val1 and val2 respectively. How can I turn this into an xml string using C#?\nFor the DataRow mentioned above I'd like the following string:\n<col1>val1</col1><col2>val2</col2>\n\n"
},
{
"from": "gp... |
I am looking for a way to create a ZIP file from a folder in Windows C/C++ APIs. I can find the way to do this in VBScript using the Shell32.Application CopyHere method, and I found a tutorial explaining how to do it in C# also, but nothing for the C API (C++ is fine too, project already uses MFC).
I'd be really gratef... | Creating a ZIP file in Windows using C/C++ APIs without third-party libraries can be a bit tricky, as Windows doesn't provide direct native support for creating ZIP files through its standard libraries. However, you can leverage the Windows Shell API to achieve this by using `Shell32.dll`.
Here's a basic example of h... | 11,826 | [
{
"from": "human",
"value": "I am looking for a way to create a ZIP file from a folder in Windows C/C++ APIs. I can find the way to do this in VBScript using the Shell32.Application CopyHere method, and I found a tutorial explaining how to do it in C# also, but nothing for the C API (C++ is fine too, projec... |
My company is going to be storing sensitive data for our customers, and will be encrypting data using one of the managed .NET encryption algorithm classes. Most of the work is done, but we haven't figured out how/where to store the key. I've done some light searching and reading, and it seems like a hardware solution m... | Storing sensitive encryption keys securely is crucial to the overall security of your application, especially when handling customer data. Here are some common approaches and recommendations for key management:
### 1. **Use a Key Management Service (KMS)**
Many cloud providers offer Key Management Services that are d... | 18,050 | [
{
"from": "human",
"value": "My company is going to be storing sensitive data for our customers, and will be encrypting data using one of the managed .NET encryption algorithm classes. Most of the work is done, but we haven't figured out how/where to store the key. I've done some light searching and reading... |
I'm looking for a log viewer with similar capablilties as Chainsaw, in which I can tail Glassfish log files over for instance SSH/SCP. Does anyone know if such a tool exist?
| If you're looking for a log viewer that can tail log files over SSH/SCP with capabilities similar to Chainsaw, there are a few options you can consider:
1. **LogViewer**: This is a simple and lightweight log viewer that supports reading log files over SSH. You may need to set it up to handle remote log file viewing.
... | 20,300 | [
{
"from": "human",
"value": "I'm looking for a log viewer with similar capablilties as Chainsaw, in which I can tail Glassfish log files over for instance SSH/SCP. Does anyone know if such a tool exist?\n"
},
{
"from": "gpt",
"value": "If you're looking for a log viewer that can tail log files o... |
This is a continuation question from a previous question I have asked
I now have a /externals directory in the root of my project tree. Inside this I have a reference to another project. I'm able to script the build of all my externals in the main project NAnt script. The result of these builds are as follows:
/externa... | It's great to hear that you've clarified your thoughts about managing external project dependencies! Here are some considerations for your approach to referencing and managing build artifacts in your main project:
### 1. **Reference Directly in Build Artifacts**
If the external projects are frequently updated or are ... | 17,573 | [
{
"from": "human",
"value": "This is a continuation question from a previous question I have asked\nI now have a /externals directory in the root of my project tree. Inside this I have a reference to another project. I'm able to script the build of all my externals in the main project NAnt script. The resul... |
We've been developing a windows based application using Java for a while now, but NOW we want to make a mac port and have to reverse of code from Java 6 and Java 5. Is there any easy way to do this rather than re-coding Java 6 specific code? We'd like to keep our code up to date.
| If you're looking to port your Java application from Windows to macOS while maintaining compatibility with Java 5 and Java 6, there are a few steps you can take to simplify the process:
1. **Check for Java Language Features**: Java 6 introduced some new language features and APIs that may not be available in Java 5. I... | 8,672 | [
{
"from": "human",
"value": "We've been developing a windows based application using Java for a while now, but NOW we want to make a mac port and have to reverse of code from Java 6 and Java 5. Is there any easy way to do this rather than re-coding Java 6 specific code? We'd like to keep our code up to da... |
Just this - How do you add a timer to a C# console application? It would be great if you could supply some example coding.
| Adding a timer to a C# console application can be achieved using the `System.Timers.Timer` class or the `System.Threading.Timer` class. Below is an example using `System.Timers.Timer`, which is more commonly used for this purpose in console applications.
### Example Code using `System.Timers.Timer`
Here's a simple c... | 19,445 | [
{
"from": "human",
"value": "Just this - How do you add a timer to a C# console application? It would be great if you could supply some example coding.\n"
},
{
"from": "gpt",
"value": "Adding a timer to a C# console application can be achieved using the `System.Timers.Timer` class or the `System... |
Has anyone had this problem. You install Silverlight 2 RTW, and open your old project. Everything loads fine in the designer. You have to change a few properties of your DataGrid because "DisplayMemberBinding" was changed to "Binding". Press F5, and receive a Win32 exception in IEXPLORE.EXE. You go check out the e... | The issue you're experiencing with Silverlight and Internet Explorer could be caused by several factors. Here are some steps and considerations to help troubleshoot and resolve the problem:
1. **Update Silverlight**: Ensure you have the latest version of Silverlight installed. Sometimes, updates include fixes for bugs... | 19,151 | [
{
"from": "human",
"value": "Has anyone had this problem. You install Silverlight 2 RTW, and open your old project. Everything loads fine in the designer. You have to change a few properties of your DataGrid because \"DisplayMemberBinding\" was changed to \"Binding\". Press F5, and receive a Win32 excep... |
As far as I know (not much I'll admit), the currently popular programming paradigms are Object Oriented (Java, C#, Ruby) vs functional (F#). As someone who is mostly familiar with the first paradigm, I have several questions:
Can a programmer simply stick with one paradigm all of his/her life? Or in other words, can a... | These are excellent questions, and they touch on some important aspects of programming paradigms, language choice, and software development practices. Let’s address each of your questions systematically:
### 1. Can a programmer simply stick with one paradigm all their life?
While it's possible for a programmer to spe... | 17,386 | [
{
"from": "human",
"value": "As far as I know (not much I'll admit), the currently popular programming paradigms are Object Oriented (Java, C#, Ruby) vs functional (F#). As someone who is mostly familiar with the first paradigm, I have several questions:\n\nCan a programmer simply stick with one paradigm al... |
The problem is that the compiler says that there is a redefinition of a function between a library that belongs to MySQL and math.h from the std library.
I have been over this for two days and I still can't figure it out.
Has this ever happened to anyone?
This is the output from the compiler
C:\mingw\bin\mingw32-mak... | The issue you're encountering is a common one, where two different libraries (in your case, MySQL and the standard math library) define the same function name (`rint(double)`). This leads to a redefinition error during compilation.
### Steps to Resolve the Issue:
1. **Check for Macros and Compilation Flags**:
Some... | 18,611 | [
{
"from": "human",
"value": "The problem is that the compiler says that there is a redefinition of a function between a library that belongs to MySQL and math.h from the std library.\nI have been over this for two days and I still can't figure it out. \nHas this ever happened to anyone?\nThis is the output ... |
I want to use forms authentication in my asp.net mvc site.
Can I use an already existing sql db (on a remote server) for it? How do I configure the site to use this db for authentication? Which tables do I need/are used for authentication?
| Yes, you can use an existing SQL database on a remote server for forms authentication in your ASP.NET MVC site. To configure your site to use this database for authentication, you will typically follow these steps:
### Step 1: Database Configuration
1. **Connection String**: You need to set up a connection string in ... | 13,962 | [
{
"from": "human",
"value": "I want to use forms authentication in my asp.net mvc site.\nCan I use an already existing sql db (on a remote server) for it? How do I configure the site to use this db for authentication? Which tables do I need/are used for authentication?\n"
},
{
"from": "gpt",
"va... |
We are looking at moving from Visual Studio 2008 Professional to Visual Studio Team System. I believe I've read that the client Development Edition is a superset of what Professional has/does. I'd like to ease into the transition with the client end first, then get the Team Foundation Server up and running later, and I... | Moving from Visual Studio 2008 Professional to Visual Studio Team System (VSTS) Development Edition can be a positive transition, as the Development Edition is indeed a superset of the Professional edition. This means that you should not lose any functionality that you currently have in Visual Studio 2008 Professional,... | 17,348 | [
{
"from": "human",
"value": "We are looking at moving from Visual Studio 2008 Professional to Visual Studio Team System. I believe I've read that the client Development Edition is a superset of what Professional has/does. I'd like to ease into the transition with the client end first, then get the Team Foun... |
I know that there are issues with the VFP OLEDB provider on 64 bit machines. ... but what issues do you encounter while actually running a VFP application - on a 64 bit machine? Has anyone had any experience in this area?
My first thought was that it would just run as a 32bit app, without making use of the 64 bit power... | Running Visual FoxPro (VFP) applications on 64-bit machines can indeed lead to a variety of issues, particularly due to the way 32-bit applications and their components interact with the 64-bit environment. Here are some common issues and considerations that users have encountered:
1. **OLEDB Provider Limitations**:
... | 16,223 | [
{
"from": "human",
"value": "I know that there are issues with the VFP OLEDB provider on 64 bit machines. ... but what issues do you encounter while actually running a VFP application - on a 64 bit machine? Has anyone had any experience in this area?\nMy first thought was that it would just run as a 32bit a... |
I am looking into improving the backup process a group of animators use. Currently they back up their work into external hard drives or DVDs manually, taking full copies of everything. The data consists of thousands of high resolution images, project files of various video editing software and sound files. Basically ev... | When considering backup and version control solutions for a group of animators managing a large volume of binary data, there are several factors to weigh. Traditional version control systems (VCS) like Git or Subversion are primarily designed for text-based source code and may not handle binary data efficiently, especi... | 15,043 | [
{
"from": "human",
"value": "I am looking into improving the backup process a group of animators use. Currently they back up their work into external hard drives or DVDs manually, taking full copies of everything. The data consists of thousands of high resolution images, project files of various video editi... |
Is there a built-in mechanism in .NET to match patterns other than regular expressions (regex)? I'd like to match using Unix-style (glob) wildcards (* = any number of any character).
I'd like to use this for a end-user facing control. I fear that permitting all regex capabilities will be very confusing.
| Yes, .NET provides a way to work with Unix-style (glob) wildcards through the `System.IO` namespace, specifically using the `System.IO.Directory` class for file and directory operations. While there's no direct built-in function to match strings against glob patterns in .NET's core libraries, you can use the `Microsoft... | 17,352 | [
{
"from": "human",
"value": "Is there a built-in mechanism in .NET to match patterns other than regular expressions (regex)? I'd like to match using Unix-style (glob) wildcards (* = any number of any character).\nI'd like to use this for a end-user facing control. I fear that permitting all regex capabili... |
I have some old rrdtool databases, for which the exact creation recipe has long been since lost. I need to create a new database with the same characteristics as the current ones. I've dumped a couple of old databases and pored over the contents but I'm not sure how to interpret the metadata. I think it appears in the ... | To replicate an RRD (Round Robin Database) with the same characteristics as an existing one, you need to understand the various attributes specified in the metadata you've gathered from your old RRD files. Here’s a breakdown of the important attributes and how you can recreate an RRD database with them.
### Key Attrib... | 15,002 | [
{
"from": "human",
"value": "I have some old rrdtool databases, for which the exact creation recipe has long been since lost. I need to create a new database with the same characteristics as the current ones. I've dumped a couple of old databases and pored over the contents but I'm not sure how to interpret... |
I have two collections which have property Email in both collections. I need to get a list of the items in the first list where Email does not exist in the second list. With SQL I would just use "not in", but I do not know the equivalent in LINQ. How is that done?
So far I have a join, like...
var matches = from item1 ... | To achieve the functionality of "not in" using LINQ, you can use the `Where` method combined with `Contains` to filter the items from the first collection (`list1`) that do not exist in the second collection (`list2`). Here's how you can do it:
Assuming `list1` and `list2` are collections of a type that have an `Email... | 19,344 | [
{
"from": "human",
"value": "I have two collections which have property Email in both collections. I need to get a list of the items in the first list where Email does not exist in the second list. With SQL I would just use \"not in\", but I do not know the equivalent in LINQ. How is that done?\nSo far I ha... |
I want to do some checking in a writer accessor. My first idea was returning a boolean.
class MyClass
def var=(var)
@var = var
# some checking
return true
end
end
m = MyClass.new
retval = (m.var = 'foo')
=> "foo"
Can I set a return value in a writer accessor? If yes, how can I get this value?
| In Ruby, writer accessors (methods that set instance variables) traditionally do not return a value that is useful in the way you are describing. When you use the assignment syntax, it evaluates the last expression in the method, which is why you see the value of the variable being assigned.
If you want to perform che... | 20,467 | [
{
"from": "human",
"value": "I want to do some checking in a writer accessor. My first idea was returning a boolean.\nclass MyClass\n def var=(var)\n @var = var\n # some checking\n return true\n end\nend\n\nm = MyClass.new\nretval = (m.var = 'foo')\n\n=> \"foo\"\n\nCan I set a return value in a w... |
I'm using MS Sql Server 2000, and for many queries when I run a query in Query Analyzer, with the statistics turned on, the numbers reported in the statistics tab are extremely different from the values shown in the Query Profiler. When the profiler and the analyzer are running at the same time, some queries report 20... | The discrepancy you're observing between the Query Analyzer and SQL Server Profiler readings regarding the number of reads can be attributed to a few different factors:
1. **Timing and Context**: When you execute a query in Query Analyzer with statistics turned on, it can report the number of reads that occurred durin... | 17,898 | [
{
"from": "human",
"value": "I'm using MS Sql Server 2000, and for many queries when I run a query in Query Analyzer, with the statistics turned on, the numbers reported in the statistics tab are extremely different from the values shown in the Query Profiler. When the profiler and the analyzer are running... |
In the following code below:
Image img = new Image();
img.Source = new BitmapImage(new Uri("http://someURL/somefilename.jpg", UriKind.Absolute));
how can I determine if the image successfully loaded (when there's a valid URI)? i.e., The URI is a valid format, but the file may not exist.
| To determine if an image has successfully loaded in WPF (Windows Presentation Foundation), you can handle the `ImageOpened` and `ImageFailed` events provided by the `BitmapImage` class. These events allow you to capture the state of the image loading process. Here's how you can implement it:
```csharp
using System;
us... | 19,900 | [
{
"from": "human",
"value": "In the following code below:\nImage img = new Image();\nimg.Source = new BitmapImage(new Uri(\"http://someURL/somefilename.jpg\", UriKind.Absolute));\n\nhow can I determine if the image successfully loaded (when there's a valid URI)? i.e., The URI is a valid format, but the file... |
I'm thinking floats. For the record I'm also using NHibernate.
| It sounds like you’re working on a project involving NHibernate and you're considering using floating-point numbers (floats) for some aspect of your data model or calculations. Here are some key considerations and best practices when working with floats in NHibernate:
### 1. Mapping Floats in NHibernate:
When mapping ... | 14,204 | [
{
"from": "human",
"value": "I'm thinking floats. For the record I'm also using NHibernate.\n"
},
{
"from": "gpt",
"value": "It sounds like you’re working on a project involving NHibernate and you're considering using floating-point numbers (floats) for some aspect of your data model or calcula... |
I have an old Excel 4 macro that I use to run monthly invoices. It is about 3000 lines and has many Excel 5 Dialog Box sheets (for dialog boxes). I would like to know what the easiest way would be to change it into VBA and if it is worth it. Also, if once I have converted it to VBA, how to create a standalone applicati... | Converting an old Excel 4 macro (XLM) to VBA can be quite a task, especially if your macro is extensive like yours (around 3000 lines). However, it can be worth it for several reasons, such as improved performance, better debugging options, and access to more powerful features. Here's how you can approach the conversio... | 9,611 | [
{
"from": "human",
"value": "I have an old Excel 4 macro that I use to run monthly invoices. It is about 3000 lines and has many Excel 5 Dialog Box sheets (for dialog boxes). I would like to know what the easiest way would be to change it into VBA and if it is worth it. Also, if once I have converted it to ... |
For example
int f(int a) {
...
return a > 10;
}
is that considered acceptable (not legal, I mean is it ``good code''), or should it always be in a conditional, like this
int f(int a) {
...
if (a > 10)
return 1;
else
return 0;
}
| Using the expression `return a > 10;` in your function is acceptable and can be considered "good code" in many contexts. Here's why:
1. **Simplicity and Clarity**: The expression `return a > 10;` directly returns the result of the comparison as a boolean value (0 for false, 1 for true in the context of C/C++). It is c... | 19,123 | [
{
"from": "human",
"value": "For example\nint f(int a) {\n ...\n return a > 10;\n}\n\nis that considered acceptable (not legal, I mean is it ``good code''), or should it always be in a conditional, like this\nint f(int a) {\n ...\n if (a > 10)\n return 1;\n else\n return 0;\n}\n\n"
},
... |
This might seem obvious but I've had this error when trying to use LINQ to SQL with my business logic in a separate class library project.
I've created the DBML in a class library, with all my business logic and custom controls in this project. I'd referenced the class library from my web project and attempted to u... | It sounds like you've encountered a common issue when working with LINQ to SQL in a multi-project solution. The error message "Login failed for user 'username'" typically indicates that the application is trying to connect to a SQL Server database using a connection string that doesn't have the correct credentials or i... | 9,967 | [
{
"from": "human",
"value": "This might seem obvious but I've had this error when trying to use LINQ to SQL with my business logic in a separate class library project. \nI've created the DBML in a class library, with all my business logic and custom controls in this project. I'd referenced the class libr... |
I have a command which includes an includegraphics command - I can pass an image to my command, and it will do some standard formatting for me before actually including the image. Some of the images that I'm including via this command are smaller than \textwidth, while some are larger. I'd like to scale the larger im... | You can achieve the desired behavior of scaling larger images down to `\textwidth` while leaving smaller images unchanged by utilizing the `graphicx` package and its commands. Specifically, you can retrieve the width of the image with the `\includegraphics` command and then use a conditional structure to check whether ... | 17,764 | [
{
"from": "human",
"value": "I have a command which includes an includegraphics command - I can pass an image to my command, and it will do some standard formatting for me before actually including the image. Some of the images that I'm including via this command are smaller than \\textwidth, while some ar... |
From time to time, I need to dump USB traffic under Windows, mostly to support hardware under Linux, so my primary goal is to produce dump files for protocol analysis.
For USB traffic, it seems that SniffUsb is the clear winner... It works under Windows XP (but not later) and has a much nicer GUI than earlier versions.... | You're on the right track by using SniffUSB for USB traffic analysis and Portmon for serial port monitoring. Here's a brief overview of both tools and some alternatives you might consider, as well as tips for effective USB traffic capture.
### SniffUSB
- **Use Case**: Best for capturing low-level USB traffic.
- **Lim... | 18,728 | [
{
"from": "human",
"value": "From time to time, I need to dump USB traffic under Windows, mostly to support hardware under Linux, so my primary goal is to produce dump files for protocol analysis.\nFor USB traffic, it seems that SniffUsb is the clear winner... It works under Windows XP (but not later) and h... |
As far as I can tell, this is isn't possible, so I'm really just hoping for a left field undocumented allocation hook function.
I want a way to track allocations like in _CrtSetAllocHook, but for C#/.NET.
The only visibility to the garbage collector/allocation appears to be GC.CollectionCount.
Anyone have any other .NE... | In .NET, tracking memory allocations at a low level similar to `_CrtSetAllocHook` from C++ is indeed not natively supported. However, there are several approaches and tools you can leverage to monitor memory allocation and analyze performance, albeit with some limitations:
### 1. Profilers
- **Visual Studio Diagnostic... | 19,718 | [
{
"from": "human",
"value": "As far as I can tell, this is isn't possible, so I'm really just hoping for a left field undocumented allocation hook function.\nI want a way to track allocations like in _CrtSetAllocHook, but for C#/.NET.\nThe only visibility to the garbage collector/allocation appears to be GC... |
When I run my Visual Studio Windows Forms application by clicking F5 (debug mode), after I click on the close button (which calls Application.Exit()), after a few seconds
I get an error that says:
cannot acess a disposed object: Object name 'SampleForm'.
A bit of background, I have another thread that runs every x se... | Yes, you are correct in your assessment. When you close your Windows Forms application and call `Application.Exit()`, any threads that are still running can lead to attempts to access UI components, which will cause exceptions like the one you are seeing ("cannot access a disposed object").
In a Windows Forms applicat... | 15,742 | [
{
"from": "human",
"value": "When I run my Visual Studio Windows Forms application by clicking F5 (debug mode), after I click on the close button (which calls Application.Exit()), after a few seconds\nI get an error that says:\n\ncannot acess a disposed object: Object name 'SampleForm'.\n\nA bit of backgrou... |
I'm writing a setup program to install an application to a USB drive. The application is meant to be used only from USB drives, so it would save an extra step for the user by automatically selecting USB drive to install to.
I might explore using Nullsoft or MSI for install, but since I'm mostly familiar with .NET I ini... | Yes, you can determine the drive letters of USB flash drives using .NET. This can be achieved by using the `System.IO` namespace to access drive information and filtering the drives based on their type.
Here’s a step-by-step guide and an example code snippet that demonstrates how to identify USB drives:
1. Use the `... | 16,115 | [
{
"from": "human",
"value": "I'm writing a setup program to install an application to a USB drive. The application is meant to be used only from USB drives, so it would save an extra step for the user by automatically selecting USB drive to install to.\nI might explore using Nullsoft or MSI for install, but... |
I was recently considering using GoogleData for a hobby project to store my service's old data, (say 24+hours old), while I keep the fresh data on my servers (hobby project==cheap home server).
However I haven't really heard of anyone using GoogleData, so I was wondering about what other's experiences have been.
Edit: ... | Using Google Cloud services, particularly Cloud Firestore or Google Cloud Storage, can be a great option for storing historical or less frequently accessed data, especially for a hobby project. Here's an overview of the benefits, considerations, and potential experiences you might encounter while using these services.
... | 19,361 | [
{
"from": "human",
"value": "I was recently considering using GoogleData for a hobby project to store my service's old data, (say 24+hours old), while I keep the fresh data on my servers (hobby project==cheap home server).\nHowever I haven't really heard of anyone using GoogleData, so I was wondering about ... |
I have one question maybe someone here can help me. If i do "ps aux --sort user" on linux console I have one list of users and their processes runing on the machine. My question is how do I remove the users name and print that list like this in a C program:
for example:
(…)
---------------------------------------------... | To achieve your goal in a C program, you'll want to execute the `ps aux --sort=user` command, parse its output, and then print it in the desired format. Here's a simple outline of how you can implement this:
1. Execute the command using `popen()`.
2. Read the output line by line.
3. Parse each line to separate the use... | 16,359 | [
{
"from": "human",
"value": "I have one question maybe someone here can help me. If i do \"ps aux --sort user\" on linux console I have one list of users and their processes runing on the machine. My question is how do I remove the users name and print that list like this in a C program:\nfor example:\n(…)\... |
I want to post an xml document to an asp page from an asp.net page. If I use WebRequest with content/type text/xml the document never gets to the asp page. How can I do this ?
| To post an XML document from an ASP.NET page to an ASP page using `WebRequest`, you need to ensure that you're setting up the request correctly, including the request method, content type, and writing the XML data to the request stream. Below is an example of how you can achieve this:
### ASP.NET Code to Post XML Docu... | 18,236 | [
{
"from": "human",
"value": "I want to post an xml document to an asp page from an asp.net page. If I use WebRequest with content/type text/xml the document never gets to the asp page. How can I do this ?\n"
},
{
"from": "gpt",
"value": "To post an XML document from an ASP.NET page to an ASP pag... |
(function()
{
//codehere
}
)();
What is special about this kind of syntax?
What does ()(); imply?
| The syntax you've provided is an example of an Immediately Invoked Function Expression (IIFE). Here's a breakdown of what makes this syntax special and what `()();` implies:
### Special Aspects of IIFE:
1. **Immediate Invocation**: The function is defined and executed immediately, without the need to call it explicitl... | 19,226 | [
{
"from": "human",
"value": "(function() \n {\n //codehere\n }\n)();\n\nWhat is special about this kind of syntax?\nWhat does ()(); imply?\n"
},
{
"from": "gpt",
"value": "The syntax you've provided is an example of an Immediately Invoked Function Expression (IIFE). Here's a breakdown of wha... |
I am working a standalone c# desktop application that sends out documents and then imports them from Outlook when they are sent back. The application picks up the emails from a specified folder processes them and then saves the senders name plus other stuff to a database.
This works well for Outlook 2003 and 2007 which... | It sounds like you've navigated quite a complex situation with Outlook's different versions and the need for reliable email address retrieval. It's great to hear that you found a solution with Redemption and overcame the registration challenges using registry-free COM.
For anyone else facing similar issues with retrie... | 18,371 | [
{
"from": "human",
"value": "I am working a standalone c# desktop application that sends out documents and then imports them from Outlook when they are sent back. The application picks up the emails from a specified folder processes them and then saves the senders name plus other stuff to a database.\nThis ... |
Does anyone know if dbunit has the power to export specific data from multiple tables at once based on a sql statement, as can be done by using dbunit's QueryDataSet class to export data from a single table based on a sql statement, as can been seen here.
James
| DBUnit's `QueryDataSet` class allows you to export data from a single table based on a SQL statement, but if you want to extract data from multiple tables at once, you'll need to use a different approach since `QueryDataSet` is designed for one table at a time.
While DBUnit does not directly support exporting data fro... | 17,824 | [
{
"from": "human",
"value": "Does anyone know if dbunit has the power to export specific data from multiple tables at once based on a sql statement, as can be done by using dbunit's QueryDataSet class to export data from a single table based on a sql statement, as can been seen here.\nJames\n"
},
{
... |
I have a <div> that I want to be on a line by itself. According to W3Schools, this rule:
div.foo {
clear: both;
}
...should mean this:
"No floating elements allowed on either the left or the right side."
However, if I float two <div> elements left, and apply the rule above to the first one, the second one does not... | You're on the right track in understanding how the `clear` property works in CSS. To clarify further, the `clear` property indeed only affects the element it is applied to, rather than other elements on the page.
Here’s how it works:
1. **Floating Elements**: When you float elements (like `<div>`s), they are taken o... | 20,676 | [
{
"from": "human",
"value": "I have a <div> that I want to be on a line by itself. According to W3Schools, this rule:\ndiv.foo {\n clear: both;\n}\n\n...should mean this:\n\n\"No floating elements allowed on either the left or the right side.\"\n\nHowever, if I float two <div> elements left, and apply the ... |
I'm looking to use a VBScript variable within a reference to a DOM element for a web-app I'm building. Here's a brief excerpt of the affected area of code:
dim num
num = CInt(document.myform.i.value)
dim x
x = 0
dim orders(num)
For x = 0 To num
orders(x) = document.getElementById("order" & x).value
objFile.wri... | It looks like you're trying to concatenate a string to form the ID of DOM elements in VBScript, which is generally supported. However, one common issue that can arise in VBScript is how the variable type might not be handled as you expect.
Here's a modified version of your code to ensure it properly handles the DOM e... | 20,473 | [
{
"from": "human",
"value": "I'm looking to use a VBScript variable within a reference to a DOM element for a web-app I'm building. Here's a brief excerpt of the affected area of code:\ndim num\nnum = CInt(document.myform.i.value)\ndim x\nx = 0\ndim orders(num)\nFor x = 0 To num\n orders(x) = document.g... |
Can anyone recommend a framework for templating/formatting messages in a standalone application along the lines of the JSP EL (Expression Language)?
I would expect to be able to instantiate a an object of some sort, give it a template along the lines of
Dear ${customer.firstName}. You order will be dispatched on ${orde... | There are several templating libraries in Java that can help you achieve the functionality you're looking for. Here are a few popular options that support an Expression Language-like syntax and are suitable for standalone applications:
1. **Apache FreeMarker**:
- **Overview**: FreeMarker is a powerful template engi... | 12,436 | [
{
"from": "human",
"value": "Can anyone recommend a framework for templating/formatting messages in a standalone application along the lines of the JSP EL (Expression Language)?\nI would expect to be able to instantiate a an object of some sort, give it a template along the lines of\nDear ${customer.firstNa... |
I develop and manage about 45 WindowsCE5 devices. Updating applications on the devices is a nightmare. Is it possible/feasible to do Click-Once on the CF?
I take the lack of answers to be "No". :)
EDIT: This is a duplicate of question 116713
| Unfortunately, ClickOnce is not supported on the .NET Compact Framework (CF), which is what Windows CE 5 devices typically run. ClickOnce is primarily designed for desktop applications and does not extend its capabilities to embedded systems like those running on Windows CE.
For Windows CE devices, updating applicatio... | 20,528 | [
{
"from": "human",
"value": "I develop and manage about 45 WindowsCE5 devices. Updating applications on the devices is a nightmare. Is it possible/feasible to do Click-Once on the CF?\nI take the lack of answers to be \"No\". :)\nEDIT: This is a duplicate of question 116713\n"
},
{
"from": "gpt",... |
Greetings,
I need to include a property in my class which is a collection of System.IO.FileInfo objects. I am not really sure how to do this and how I would add and removed objects from an instance of the the class (I would assume like any other collection).
Please let me know if I need to add more information.
Th... | Your approach to using a collection of `System.IO.FileInfo` objects in a class is valid, and it's a common use case in many applications. Storing collections as properties is often done, but it comes with certain considerations and best practices.
### Defining a Class with a Collection Property
You can define your cl... | 17,129 | [
{
"from": "human",
"value": "Greetings,\nI need to include a property in my class which is a collection of System.IO.FileInfo objects. I am not really sure how to do this and how I would add and removed objects from an instance of the the class (I would assume like any other collection). \nPlease let me... |
How do I launch Windows' RegEdit with certain path located, like "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0", so I don't have to do the clicking?
What's the command line argument to do this? Or is there a place to find the explanation of RegEdit's switches?
| You can launch the Windows Registry Editor (`RegEdit`) directly to a specific path by using the command line or Run dialog with a specific syntax. To open `RegEdit` at the specified registry path, you can use the following command:
1. Open the Run dialog by pressing `Win + R`.
2. Type the following command and press E... | 19,379 | [
{
"from": "human",
"value": "How do I launch Windows' RegEdit with certain path located, like \"HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\8.0\", so I don't have to do the clicking?\nWhat's the command line argument to do this? Or is there a place to find the explanation of RegEdit's switches?\n"... |
I'd like to get at least one JRE/JDK level on my Windows machine where I have the JRE/JDK source that matches the exact level of the JRE/JDK. My purpose is to be able to go into the system classes while debugging. Any suggestions about how to do this? Thanks in advance.
| To set up a Java Runtime Environment (JRE) or Java Development Kit (JDK) on your Windows machine, including the source code that matches the exact version of the JRE/JDK, you can follow these steps:
### Step 1: Download JRE/JDK
1. **Choose the Version**: Identify the exact version of the JDK you want to download. You... | 15,111 | [
{
"from": "human",
"value": "I'd like to get at least one JRE/JDK level on my Windows machine where I have the JRE/JDK source that matches the exact level of the JRE/JDK. My purpose is to be able to go into the system classes while debugging. Any suggestions about how to do this? Thanks in advance.\n"
},
... |
I'm wondering what's a reasonable size for iPhone Apps. Right now I'm working on an iPhone game, and of course it loads fast into my device since I'm connected directly to it through a USB cable, but I've no idea how long it would actually take to download from the App Store.
In my case it's about 2mb in size, which is... | When it comes to iPhone app sizes, there are a few key considerations to keep in mind:
### Reasonable App Size
1. **General Guidelines**: A size of around 2 MB for your game is quite small, especially compared to many modern apps. While smaller apps are always preferable for quicker downloads and less storage consumpt... | 18,491 | [
{
"from": "human",
"value": "I'm wondering what's a reasonable size for iPhone Apps. Right now I'm working on an iPhone game, and of course it loads fast into my device since I'm connected directly to it through a USB cable, but I've no idea how long it would actually take to download from the App Store.\nI... |
This discussion started over here but I thought it would be nice to have a definitive answer...
So let's say you have MovieClip on the Stage (or a UIComponent for the Flex audience) - what do you have to do to not make it so that the user can't see the object but also so that the AVM2 doesn't even factor it in when ren... | To ensure that an object (like a `MovieClip` or `UIComponent`) is not rendered by the ActionScript Virtual Machine 2 (AVM2) and is also not visible to the user, you have a couple of options. The most straightforward and commonly accepted method is to set the `visible` property to `false`. Here’s how that works:
1. **S... | 19,821 | [
{
"from": "human",
"value": "This discussion started over here but I thought it would be nice to have a definitive answer...\nSo let's say you have MovieClip on the Stage (or a UIComponent for the Flex audience) - what do you have to do to not make it so that the user can't see the object but also so that t... |
I want to play around with silverlight without having to buy a Visual Studio 2008 license.
I already used my trial time with Visual Studio, so I'm trying to find another solution.
Any thing out there?
Thanks
| If you're looking to experiment with Silverlight without purchasing a Visual Studio 2008 license, there are a few alternative options you can consider:
1. **Visual Web Developer 2008 Express**: This is a free version of Visual Studio that supports Silverlight development. While it’s more limited than the full version ... | 20,536 | [
{
"from": "human",
"value": "I want to play around with silverlight without having to buy a Visual Studio 2008 license.\nI already used my trial time with Visual Studio, so I'm trying to find another solution.\nAny thing out there?\nThanks\n"
},
{
"from": "gpt",
"value": "If you're looking to ex... |
I'm not sure if the term's actually "Array Addition".
I'm trying to understand what does the following line do:
int var[2 + 1] = {2, 1};
How is that different from int var[3]?
I've been using Java for several years, so I'd appreciate if explained using Java-friendly words.
Edit: Thousands of thanks to everyone who he... | The line of code you provided is written in C (or C++) rather than Java, but I'll explain it in a way that should be easy for you to understand with your Java background.
### Explanation of the Code
1. **Array Declaration**:
```c
int var[2 + 1] = {2, 1};
```
- Here, `var` is being declared as an array of ... | 17,678 | [
{
"from": "human",
"value": "I'm not sure if the term's actually \"Array Addition\". \nI'm trying to understand what does the following line do:\nint var[2 + 1] = {2, 1};\n\nHow is that different from int var[3]?\nI've been using Java for several years, so I'd appreciate if explained using Java-friendly wor... |
I've got a WPF browser-like application with a few pages. When I switch between pages, I'd like to set the keyboard focus.
When a page is loaded the first time, this works by calling Control.Focus() in the constructor.
But when I switch between pages this does not work anymore - the focus is just on the first field, an... | In a WPF application, setting focus can be tricky, especially when dealing with pages that are reused (due to `KeepAlive=true`). The issue you're facing with focus reverting to the first field likely occurs because WPF handles focus differently, especially after navigation.
Here are several approaches you can take to ... | 16,970 | [
{
"from": "human",
"value": "I've got a WPF browser-like application with a few pages. When I switch between pages, I'd like to set the keyboard focus.\nWhen a page is loaded the first time, this works by calling Control.Focus() in the constructor.\nBut when I switch between pages this does not work anymore... |
INotifyPropertyChanged is fairly self explanatory and I think I'm clear on when to raise that one (i.e. when I've finished updating the values).
If I implement INotifyPropertyChanging I'm tending to raise the event as soon as I enter the setter or other method that changes the objects state and then continue with any g... | The `INotifyPropertyChanging` interface is designed to provide notifications that a property value is about to change, which can be particularly useful for scenarios where you need to manage state or perform logic before the actual change occurs. Your instinct to raise the `PropertyChanging` event at the start of the s... | 18,102 | [
{
"from": "human",
"value": "INotifyPropertyChanged is fairly self explanatory and I think I'm clear on when to raise that one (i.e. when I've finished updating the values).\nIf I implement INotifyPropertyChanging I'm tending to raise the event as soon as I enter the setter or other method that changes the ... |
How can I include a bookmarklet in a Markdown parsed document? Is there any "tag" for markdown that basically says "don't parse this"??
For example you could have something like:
<a href="javascript:function my_bookmarklet()
{alert('Hello World');}
my_bookmarklet();">Hello</a>
But if I ... | Markdown itself does not have a built-in way to include raw JavaScript or prevent specific content from being parsed. However, there are a few approaches you can take to include bookmarklets in a Markdown document without having them processed incorrectly.
### 1. Use Code Blocks
You can use code blocks to display the... | 19,610 | [
{
"from": "human",
"value": "How can I include a bookmarklet in a Markdown parsed document? Is there any \"tag\" for markdown that basically says \"don't parse this\"??\nFor example you could have something like:\n<a href=\"javascript:function my_bookmarklet()\n {alert('Hello World');}\n ... |
Is there a difference (performance, overhead) between these two ways of merging data sets?
MyTypedDataSet aDataSet = new MyTypedDataSet();
aDataSet .Merge(anotherDataSet);
aDataSet .Merge(yetAnotherDataSet);
and
MyTypedDataSet aDataSet = anotherDataSet;
aDataSet .Merge(yetAnotherDataSet);
Which do you recommend?
| Yes, there is a difference in performance and overhead between the two approaches you presented for merging data sets, and the recommended approach can depend on specific requirements and context.
### Option 1:
```csharp
MyTypedDataSet aDataSet = new MyTypedDataSet();
aDataSet.Merge(anotherDataSet);
aDataSet.Merge(yet... | 20,066 | [
{
"from": "human",
"value": "Is there a difference (performance, overhead) between these two ways of merging data sets?\nMyTypedDataSet aDataSet = new MyTypedDataSet();\naDataSet .Merge(anotherDataSet);\naDataSet .Merge(yetAnotherDataSet);\n\nand\nMyTypedDataSet aDataSet = anotherDataSet;\naDataSet .Merge(y... |
Where do you put user input validation in a web form application?
View: JavaScript client side
Controller: Server side language (C#...)
Model: Database (stored procedures or dependencies)
I think there is validation required by each level:
Did the user input a sane value
are dates actual dates, are numbers actua... | You're absolutely correct in identifying the need for user input validation at different levels of a web form application: client-side (View), server-side (Controller), and database level (Model). Here’s a breakdown of where and why you would implement validation at each level:
### 1. Client-side Validation (View - Ja... | 17,005 | [
{
"from": "human",
"value": "Where do you put user input validation in a web form application?\n\nView: JavaScript client side\nController: Server side language (C#...)\nModel: Database (stored procedures or dependencies) \n\nI think there is validation required by each level:\n\nDid the user input a sane v... |
I have a TemplateField in a DetailsView and its input should be one of a few choices in a lookup table. Currently it's a text field, but I want it to be a group of radio buttons, and it should work in both insert and edit mode (the correct current value should be selected in edit mode).
How do I create mutually exclusi... | To create mutually exclusive radio buttons within a `DetailsView` control in ASP.NET, you can use the `TemplateField` to define a custom layout for your field. Below, I'll guide you through how to set this up for both insert and edit modes.
### Step 1: Define the DetailsView
In your ASPX page, you need to define your ... | 11,808 | [
{
"from": "human",
"value": "I have a TemplateField in a DetailsView and its input should be one of a few choices in a lookup table. Currently it's a text field, but I want it to be a group of radio buttons, and it should work in both insert and edit mode (the correct current value should be selected in edi... |
What's the best way to add a flash message, for successful or unsuccessful login when using the merb-auth slice (Other than overriding sessions create)?
| When working with Merb and the `merb-auth` slice, adding flash messages for login success or failure can typically be done by utilizing the hooks available in the Merb framework. Here’s a general approach you can follow without overriding the `sessions/create` action directly:
### Using Controller Hooks
1. **Override... | 20,725 | [
{
"from": "human",
"value": "What's the best way to add a flash message, for successful or unsuccessful login when using the merb-auth slice (Other than overriding sessions create)? \n"
},
{
"from": "gpt",
"value": "When working with Merb and the `merb-auth` slice, adding flash messages for logi... |
In StackOverflow podcast no. 19, Joe describe Fogcreek's decision to have one database PER client instead of one database for ALL clients. That kinda sets me thinking about the following.
Assuming I have 1000 users.
Each user has 100 clients.
Each client has 1000 products.
So that means I'm gonna have 1000 x 100 x ... | The decision between using a single database versus multiple databases (e.g., one per client) for managing a large dataset, like the one you described, hinges on several factors including query performance, complexity of data operations, and scalability needs. Here’s a breakdown of considerations to help you make this ... | 17,011 | [
{
"from": "human",
"value": "In StackOverflow podcast no. 19, Joe describe Fogcreek's decision to have one database PER client instead of one database for ALL clients. That kinda sets me thinking about the following.\n\nAssuming I have 1000 users. \nEach user has 100 clients. \nEach client has 1000 products... |
I am able to serialize an object into a file and then restore it again as is shown in the next code snippet. I would like to serialize the object into a string and store into a database instead. Can anyone help me?
LinkedList<Diff_match_patch.Patch> patches = // whatever...
FileOutputStream fileStream = new FileOutputS... | To serialize an object into a string instead of a file, you can use a `ByteArrayOutputStream` along with `ObjectOutputStream` to convert the serialized data into a byte array, then encode it as a string (e.g., using Base64). Here's how you can do it in Java:
### Serialization to String
```java
import java.io.ByteArra... | 17,456 | [
{
"from": "human",
"value": "I am able to serialize an object into a file and then restore it again as is shown in the next code snippet. I would like to serialize the object into a string and store into a database instead. Can anyone help me?\nLinkedList<Diff_match_patch.Patch> patches = // whatever...\nFi... |
I am looking for a way to do a keep alive check in .NET. The scenario is for both UDP and TCP.
Currently in TCP what I do is that one side connects and when there is no data to send it sends a keep alive every X seconds.
I want the other side to check for data, and if non was received in X seconds, to raise an event or... | In your scenario, you're using TCP for a keep-alive mechanism. It's important to understand how socket timeouts work in .NET and how to manage them effectively without causing your socket to close unexpectedly.
### Understanding Socket Receive Timeout
When you set a `ReceiveTimeout` on a TCP socket, it specifies the ... | 16,105 | [
{
"from": "human",
"value": "I am looking for a way to do a keep alive check in .NET. The scenario is for both UDP and TCP.\nCurrently in TCP what I do is that one side connects and when there is no data to send it sends a keep alive every X seconds.\nI want the other side to check for data, and if non was ... |
I am trying to get in place editing working but I am running into this error:
ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken)
I understand that rails now wants to protect against forgery and that I need to pass a form authenticity token but I am not clear on how to do this with t... | The `ActionController::InvalidAuthenticityToken` error in Rails occurs when the authenticity token is missing or does not match the expected token. Rails provides protection against Cross-Site Request Forgery (CSRF) attacks by requiring a valid authenticity token in forms and AJAX requests.
If you are using an in-plac... | 15,761 | [
{
"from": "human",
"value": "I am trying to get in place editing working but I am running into this error:\nActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken)\nI understand that rails now wants to protect against forgery and that I need to pass a form authenticity token ... |
In what cases,or for what kind of algorithms, do you start using your objects as data structure with methodes outside of the objects (ie : Tree Walking, etc...).
What scheme do you use ? (Visitor ? pattern-matching ?)
Or do you think an object should always be the only one allowed to act on its own data ?
| The design choice of whether to use methods outside of an object (e.g., through algorithms like tree walking) or to encapsulate behavior within the object itself depends on various factors, including design principles, the nature of the problem domain, and the intended use of the data structures.
### 1. Encapsulation ... | 16,160 | [
{
"from": "human",
"value": "In what cases,or for what kind of algorithms, do you start using your objects as data structure with methodes outside of the objects (ie : Tree Walking, etc...). \nWhat scheme do you use ? (Visitor ? pattern-matching ?)\nOr do you think an object should always be the only one al... |
I have a windows laptop (thinkpad) and somewhat recently rediscovered emacs and the benefit that all those wacky shortcuts can be when the arrow keys are located somewhere near you right armpit.
I was discouraged after php-mode, css-mode, etc, under mmm-mode was inconsistent, buggy, and refused to properly interpret so... | It sounds like you're looking for a stable and consistent editing experience across different platforms while using Emacs, but are facing issues with specific modes. Here are a few suggestions to address your concerns:
### Improving Your Emacs Experience:
1. **Update Emacs**: First and foremost, make sure you're usin... | 11,553 | [
{
"from": "human",
"value": "I have a windows laptop (thinkpad) and somewhat recently rediscovered emacs and the benefit that all those wacky shortcuts can be when the arrow keys are located somewhere near you right armpit.\nI was discouraged after php-mode, css-mode, etc, under mmm-mode was inconsistent, b... |
I have a strongly-typed MVC View Control which is responsible for the UI where users can create and edit Client items. I'd like them to be able to define the ClientId on creation, but not edit, and this to be reflected in the UI.
To this end, I have the following line:
<%= Html.TextBox("Client.ClientId", ViewData.Mode... | Yes, you can achieve this by using a ternary operator that conditionally adds the `readonly` attribute only when necessary. In HTML, if an attribute is present, it takes effect regardless of its value. Therefore, to avoid making the input read-only when you do not want it to be, you can simply omit the `readonly` attri... | 16,538 | [
{
"from": "human",
"value": "I have a strongly-typed MVC View Control which is responsible for the UI where users can create and edit Client items. I'd like them to be able to define the ClientId on creation, but not edit, and this to be reflected in the UI.\nTo this end, I have the following line:\n<%= Ht... |
Possible Duplicate:
Debugging JavaScript in IE7
Firefox has Web Developer plugin and Firebug for troubleshooting html/css/javascript issues. Google Chrome and Safari have a very similar console and right-click options for "Inspect Element".
Does IE7 have anything similar for troubleshooting layout/html/css issues?
| Internet Explorer 7 (IE7) does not have built-in developer tools as robust as those found in modern browsers like Firefox or Google Chrome. However, there are a few options you can consider for troubleshooting HTML, CSS, and JavaScript issues in IE7:
1. **IE Developer Toolbar**: Microsoft offers the IE Developer Toolb... | 18,646 | [
{
"from": "human",
"value": "\nPossible Duplicate:\nDebugging JavaScript in IE7 \n\nFirefox has Web Developer plugin and Firebug for troubleshooting html/css/javascript issues. Google Chrome and Safari have a very similar console and right-click options for \"Inspect Element\".\nDoes IE7 have anything simil... |
A recent project had me working with C# again, and I noticed something I hadn't before -- C#'s Intellisense shows possible exceptions that can be thrown when calling a method
Since I work mostly with VB.NET applications, it'd be really nice to have this feature in those applications as well, but it's unfortunately abs... | Customizing Visual Studio's Intellisense to show exceptions and other information from XML comments in VB.NET is indeed a bit more complex than simply changing a configuration setting. Unfortunately, as of my last knowledge update in October 2023, Visual Studio does not natively support this feature in VB.NET Intellise... | 18,514 | [
{
"from": "human",
"value": "A recent project had me working with C# again, and I noticed something I hadn't before -- C#'s Intellisense shows possible exceptions that can be thrown when calling a method\n\nSince I work mostly with VB.NET applications, it'd be really nice to have this feature in those appli... |
When I started writing database queries I didn't know the JOIN keyword yet and naturally I just extended what I already knew and wrote queries like this:
SELECT a.someRow, b.someRow
FROM tableA AS a, tableB AS b
WHERE a.ID=b.ID AND b.ID= $someVar
Now that I know that this is the same as an INNER JOIN I find all thes... | Your assessment is mostly correct! There are a few points to consider regarding your old style of writing queries and the use of `JOIN` syntax:
### Readability and Maintainability
1. **Clarity**: Using the `JOIN` keyword (like `INNER JOIN`, `LEFT JOIN`, etc.) makes the intent of the query clearer. It's immediately obv... | 20,704 | [
{
"from": "human",
"value": "When I started writing database queries I didn't know the JOIN keyword yet and naturally I just extended what I already knew and wrote queries like this:\nSELECT a.someRow, b.someRow \nFROM tableA AS a, tableB AS b \nWHERE a.ID=b.ID AND b.ID= $someVar\n\nNow that I know that thi... |
I have a foxpro app, that contains hard coded path for icons and bitmaps. That's how foxpro does it and there is no way around it. And this works fine, except that when a removable drive has been used but is not connected, and when is connected windows assigns the same letter as hard coded path, when opening any form t... | The issue you’re experiencing is a common problem when an application (in this case, your FoxPro app) uses hard-coded paths that point to resources on a removable drive. When the removable drive isn't connected, and Windows attempts to access the specified path (after you’ve hard-coded it to the drive letter), it gener... | 17,322 | [
{
"from": "human",
"value": "I have a foxpro app, that contains hard coded path for icons and bitmaps. That's how foxpro does it and there is no way around it. And this works fine, except that when a removable drive has been used but is not connected, and when is connected windows assigns the same letter as... |
Has anyone out there used TFS's API to synchronize different types of repositories? I have a SVN repo that I want to sync with a TFS repo. More accurately, I just want to take everything latest from SVN occasionally (nightly) and dump it out to TFS as the latest version.
Any advice?
| Synchronizing different version control systems like SVN (Subversion) and TFS (Team Foundation Server) can be challenging, but it is certainly doable. Here are some general steps and advice to help you set up a process to sync the latest changes from your SVN repository to TFS.
### Steps to Synchronize SVN with TFS
1... | 17,976 | [
{
"from": "human",
"value": "Has anyone out there used TFS's API to synchronize different types of repositories? I have a SVN repo that I want to sync with a TFS repo. More accurately, I just want to take everything latest from SVN occasionally (nightly) and dump it out to TFS as the latest version.\nAny ... |
Is there a way to select manually a node in virtualizing TreeView and then bring it into view?
The data model I'm using with my TreeView is implemented based on the VM-M-V model. Each TreeViewItem's IsSelected property is binded to a corresponing property in ViewModel. I've also created a listener for TreeView's ItemSe... | To manually bring a selected node into view in a virtualizing `TreeView`, you can utilize the `VirtualizingStackPanel` along with the `BringIntoView` method after setting the selected item. However, as you rightly pointed out, the `ItemSelected` event does not get raised until the corresponding `TreeViewItem` is create... | 16,736 | [
{
"from": "human",
"value": "Is there a way to select manually a node in virtualizing TreeView and then bring it into view?\nThe data model I'm using with my TreeView is implemented based on the VM-M-V model. Each TreeViewItem's IsSelected property is binded to a corresponing property in ViewModel. I've als... |
I just found myself creating a class called "InstructionBuilderFactoryMapFactory". That's 4 "pattern suffixes" on one class. It immediately reminded me of this:
http://www.jroller.com/landers/entry/the_design_pattern_facade_pattern
Is this a design smell? Should I impose a limit on this number?
I know some programm... | It sounds like you're encountering a situation that may be indicative of a design smell. While there's no hard and fast rule about the number of suffixes you can have in a class name, having a very long and complex name can be a sign that your design might be more complicated than necessary. Here are some consideration... | 18,522 | [
{
"from": "human",
"value": "I just found myself creating a class called \"InstructionBuilderFactoryMapFactory\". That's 4 \"pattern suffixes\" on one class. It immediately reminded me of this:\nhttp://www.jroller.com/landers/entry/the_design_pattern_facade_pattern\nIs this a design smell? Should I impose... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.