instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I need to dynamically construct an XPath query for an element attribute, where the attribute value is provided by the user. I'm unsure how to go about cleaning or sanitizing this value to prevent the XPath equivalent of a SQL injection attack. For example (in PHP):
<?php
function xPathQuery($attr) {
$xml = simple... | When constructing XPath queries, you need to be cautious about user-provided input to avoid injection attacks, similar to what you would do with SQL queries. The way XPath handles quoting and escapes can lead to issues if not handled properly.
In your case, the input for the XPath query could include single quotes, do... | 17,312 | [
{
"from": "human",
"value": "I need to dynamically construct an XPath query for an element attribute, where the attribute value is provided by the user. I'm unsure how to go about cleaning or sanitizing this value to prevent the XPath equivalent of a SQL injection attack. For example (in PHP):\n<?php\nfun... |
There are thousands of vi tutorials on the web, most of them generically listing all the commands. There are even videos on youtube which show basic functionality.
But does anyone know of a vi tutorial which focuses on the needs of programmers?
For example when I program in Perl with vi, moving to the "next paragraph"... | Finding a vi (or vim) tutorial that specifically caters to the needs of programmers can be a bit challenging, as many resources tend to cover the basics rather than advanced or practical use cases tailored to coding. However, I can provide you with a list of useful commands and tips, and point you towards resources tha... | 14,413 | [
{
"from": "human",
"value": "There are thousands of vi tutorials on the web, most of them generically listing all the commands. There are even videos on youtube which show basic functionality.\nBut does anyone know of a vi tutorial which focuses on the needs of programmers? \nFor example when I program in P... |
We're creating a Interaction design pattern website for a class.
We've been using google docs to create the patterns list during the classes, sharing it with the teacher for evaluation.
So the environment is this:
We've been able to fetch a single image from each presentation we want to display, such as: http://docs.g... | It looks like you're encountering issues with fetching images from Google Docs via your RSS feed for use with Cooliris (now known as LiveShare). There could be several reasons for the black thumbnails and content not displaying correctly. Here are some suggestions to troubleshoot and potentially resolve the issue:
1. ... | 20,210 | [
{
"from": "human",
"value": "We're creating a Interaction design pattern website for a class.\nWe've been using google docs to create the patterns list during the classes, sharing it with the teacher for evaluation.\nSo the environment is this:\n\nWe've been able to fetch a single image from each presentati... |
I've got a lot of mysql data that I need to generate reports from. It's mostly historic data so it won't be changing much, but it weighs in at 20-30 gigabytes easily and is expected to grow. I currently have a collection of php scripts that will do some complex queries and output csv and excel files. I also use phpMyAd... | It sounds like you're at a pivotal point in your data management and reporting journey. Transitioning from PHP scripts and phpMyAdmin to a more robust data warehousing and reporting solution can save you time and provide scalable options for accessing and analyzing your data. Here are some steps and suggestions to help... | 14,089 | [
{
"from": "human",
"value": "I've got a lot of mysql data that I need to generate reports from. It's mostly historic data so it won't be changing much, but it weighs in at 20-30 gigabytes easily and is expected to grow. I currently have a collection of php scripts that will do some complex queries and outpu... |
I'm looking at this as a baseline explanation of the SQL 2005 Enterprise partitioning. Is there a resource that goes deeper into fine points and considerations of this issue. Some more examples would be useful too.
My main scenario is a time based partition system. With one partition that has the most accessed last X d... | SQL Server 2005 introduced table partitioning as a feature that allows you to break large tables into smaller, more manageable pieces (partitions) while still being able to access the table as a whole. When designing a partitioning strategy, especially for time-based data, there are several factors to consider, includi... | 14,352 | [
{
"from": "human",
"value": "I'm looking at this as a baseline explanation of the SQL 2005 Enterprise partitioning. Is there a resource that goes deeper into fine points and considerations of this issue. Some more examples would be useful too.\nMy main scenario is a time based partition system. With one par... |
I have a page using .NETs server-side input validation controls. This page also has a javascript confirm box that fires when the form is submitted. Currently when the Submit button is selected, the javascript confirm box appears, and once confirmed the ASP.NET server-side validation controls are fired. I would like ... | To achieve the desired functionality of running server-side validation before showing the JavaScript confirm dialog, you can modify the approach to handle the validation using JavaScript and then conditionally call the server-side processing based on the result of that validation.
### Steps to Implement
1. Use the AS... | 16,629 | [
{
"from": "human",
"value": "I have a page using .NETs server-side input validation controls. This page also has a javascript confirm box that fires when the form is submitted. Currently when the Submit button is selected, the javascript confirm box appears, and once confirmed the ASP.NET server-side vali... |
I've attempted just about everything to get our ClickOnce VB.NET app to run under Terminal Services as a RemoteApp. I have a batch file that runs the .application file for the app.
This works fine via RDP desktop session on the terminal server. As a TS RemoteApp, however, well... not so much.
I get a quick flash of c... | Running ClickOnce applications as RemoteApps in a Terminal Services environment can present some unique challenges. Given the behavior you've described—where the app runs fine in an RDP session but not as a RemoteApp—it's likely related to how ClickOnce and RemoteApps handle execution contexts, permissions, and user pr... | 17,438 | [
{
"from": "human",
"value": "I've attempted just about everything to get our ClickOnce VB.NET app to run under Terminal Services as a RemoteApp. I have a batch file that runs the .application file for the app.\nThis works fine via RDP desktop session on the terminal server. As a TS RemoteApp, however, wel... |
My application draws all its own window borders and decorations. It works fine with Windows taskbars that are set to auto-hide, except when my application window is maximized. The taskbar won't "roll up". It will behave normally if I have the application not maximized, even when sized all the way to the bottom of the... | It sounds like you're experiencing a specific issue with your application's window management behavior in relation to the Windows taskbar when the application is maximized. Here are a few potential solutions and considerations:
### 1. Check Window Styles
Make sure your application is using the correct window styles wh... | 18,266 | [
{
"from": "human",
"value": "My application draws all its own window borders and decorations. It works fine with Windows taskbars that are set to auto-hide, except when my application window is maximized. The taskbar won't \"roll up\". It will behave normally if I have the application not maximized, even ... |
So my site uses shadowbox to do display some dynamic text. Problem is I need the user to be able to copy and paste that text.
Right-clicking and selecting copy works but Ctrl+C doesn't (no keyboard shortcuts do) and most people use Ctrl+C? You can see an example of what I'm talking about here.
Just go to the "web"... | It sounds like you're facing an issue with keyboard shortcuts not working in the Shadowbox when displaying dynamic text, possibly due to how the content is rendered or focused. Here's a general approach you can take to troubleshoot and potentially resolve the issue:
### 1. Ensure Text is Selectable
Make sure that the... | 17,940 | [
{
"from": "human",
"value": "So my site uses shadowbox to do display some dynamic text. Problem is I need the user to be able to copy and paste that text. \nRight-clicking and selecting copy works but Ctrl+C doesn't (no keyboard shortcuts do) and most people use Ctrl+C? You can see an example of what I'm... |
I'm trying to grasp the concept of .NET Generics and actually use them in my own code but I keep running into a problem.
Can someone try to explain to me why the following setup does not compile?
public class ClassA
{
ClassB b = new ClassB();
public void MethodA<T>(IRepo<T> repo) where T : ITypeEntity
{
... | The issue you're encountering stems from the fact that generics in C# are invariant by default. Let's break it down with your example:
You have:
- `MethodA<T>` which takes an `IRepo<T>` where `T : ITypeEntity`.
- `ClassB.MethodB` which accepts an `IRepo<ITypeEntity>`.
Here's the crux of the problem: even though `T` i... | 18,026 | [
{
"from": "human",
"value": "I'm trying to grasp the concept of .NET Generics and actually use them in my own code but I keep running into a problem.\nCan someone try to explain to me why the following setup does not compile?\npublic class ClassA\n{\n ClassB b = new ClassB();\n\n public void MethodA<T... |
My motivation for trying out git-svn is the effortless merging and branching. Then I noticed that man git-svn(1) says:
Running git-merge or git-pull is NOT recommended on a branch you plan
to dcommit from. Subversion does not represent merges in any
reasonable or useful fashion; so users using Subversion cannot s... | The warning in the `git-svn` man page is indeed crucial to understand when working with Git and Subversion (SVN) together. Here’s a breakdown of what it means and the implications for your workflow:
### Merging in git-svn
1. **Merging Back to SVN Branches**: While you can create local branches from an SVN branch (lik... | 17,530 | [
{
"from": "human",
"value": "My motivation for trying out git-svn is the effortless merging and branching. Then I noticed that man git-svn(1) says: \n\nRunning git-merge or git-pull is NOT recommended on a branch you plan\n to dcommit from. Subversion does not represent merges in any\n reasonable or usefu... |
I need to be able to GZip compress a file in an Excel VBA function. Specifically I need to be able to use the 'deflate' algorithm.
Is there a way to do this without having to exec a command line application? With no dependency on external tools the code will be more robust.
Ideally the code would make use of pre-instal... | Using the .NET framework's `GZipStream` for GZip compression directly from Excel VBA can be accomplished via COM Interop. However, it requires you to have the .NET framework installed on your machine, and it also requires creating a wrapper class to expose the GZip functionality as a COM object. Below, I will guide you... | 16,917 | [
{
"from": "human",
"value": "I need to be able to GZip compress a file in an Excel VBA function. Specifically I need to be able to use the 'deflate' algorithm.\nIs there a way to do this without having to exec a command line application? With no dependency on external tools the code will be more robust.\nId... |
I saw this quote on the question: What is a good functional language on which to build a web service?
Scala in particular doesn't support tail-call elimination except in self-recursive functions, which limits the kinds of composition you can do (this is a fundamental limitation of the JVM).
Is this true? If so, what... | The statement about Scala and tail-call elimination is partially accurate but needs some clarification. Tail-call elimination (also known as tail-call optimization) is a technique used by some languages and compilers to optimize recursive function calls so that they do not consume additional stack space. This is partic... | 15,080 | [
{
"from": "human",
"value": "I saw this quote on the question: What is a good functional language on which to build a web service?\n\nScala in particular doesn't support tail-call elimination except in self-recursive functions, which limits the kinds of composition you can do (this is a fundamental limitati... |
I am fairly comfortable with standalone Java app development, but will soon be working on a project using a Java EE application server.
Does anyone know of a straightforward how-to tutorial to getting a hello-world type application working in an application server? I'm (perhaps naievly) assuming that the overall approa... | Sure! Here is a straightforward guide to create a simple "Hello, World!" Java EE application using the widely used **Apache TomEE** server. TomEE is based on Apache Tomcat and provides support for Java EE features, making it a good choice for beginners.
### Prerequisites
1. **Java Development Kit (JDK)**: Ensure you ... | 9,944 | [
{
"from": "human",
"value": "I am fairly comfortable with standalone Java app development, but will soon be working on a project using a Java EE application server.\nDoes anyone know of a straightforward how-to tutorial to getting a hello-world type application working in an application server? I'm (perhaps... |
A program receives a list of Messages (base type). Each message in the list has to be processed according to it's type (descendant type). However, different messages need different inputs in order to be processed correctly.
What is the following technique called? (I haven't checked this code in a compiler)
abstract ... | The code snippets you've provided are examples of the **Factory Method** pattern. This pattern is used to encapsulate the instantiation of objects, allowing a class to defer instantiation to its subclasses or a specific factory method. In your case, the `GetProcessor` method in both `MessageProcessor` and `MessageProce... | 19,249 | [
{
"from": "human",
"value": "A program receives a list of Messages (base type). Each message in the list has to be processed according to it's type (descendant type). However, different messages need different inputs in order to be processed correctly.\nWhat is the following technique called? (I haven't ... |
I need to determine the highest .NET framework version installed on a desktop machine from C\C++ code. Looks like I can iterate the folders under %systemroot%\Microsoft.NET\Framework, but that seems kind of error prone. Is there a better way? Perhaps a registry key I can inspect? Thanks.
| Yes, checking the registry is indeed a more reliable way to determine the highest installed .NET Framework version on a Windows machine, as it provides a systematic way to access version information without relying on folder structures, which can be error-prone.
The .NET Framework version information can be found in t... | 16,091 | [
{
"from": "human",
"value": "I need to determine the highest .NET framework version installed on a desktop machine from C\\C++ code. Looks like I can iterate the folders under %systemroot%\\Microsoft.NET\\Framework, but that seems kind of error prone. Is there a better way? Perhaps a registry key I can i... |
I'm trying to figure out the best way to parse a GE Logician MEL trace file to make it easier to read.
It has segments like
>{!gDYNAMIC_3205_1215032915_810 = (clYN)}
execute>GDYNAMIC_3205_1215032915_810 = "Yes, No"
results>"Yes, No"
execute>end
results>"Yes, No"
>{!gDYNAMIC_3205_1215032893_294 = (clYN)}
execute>GD... | You're not wrong; regex can be quite powerful for parsing structured text data like the GE Logician MEL trace file you've shared. Using regular expressions (regex), you can define rules to extract relevant segments and their contents, which can then be formatted to make the data easier to read.
Here's a step-by-step a... | 15,147 | [
{
"from": "human",
"value": "I'm trying to figure out the best way to parse a GE Logician MEL trace file to make it easier to read.\nIt has segments like \n>{!gDYNAMIC_3205_1215032915_810 = (clYN)}\nexecute>GDYNAMIC_3205_1215032915_810 = \"Yes, No\"\nresults>\"Yes, No\" \nexecute>end \nresults>\"Yes, No\" \... |
I'm currently in the planning stage for a web application and I find myself trying to decide on using Grails or Django. From an operation perspective:
Which ecosystem is easier to maintain (migrations, backup, disaster recovery etc.)? If using grails it'll probably be a typical tomcat + mysql on linux. If django it... | When considering the operational aspects of maintaining a web application with Grails vs. Django, several factors come into play, including migrations, backups, disaster recovery, and hosting options. Let's break down these points:
### 1. Maintenance (Migrations, Backups, Disaster Recovery)
**Grails:**
- **Migrations... | 18,811 | [
{
"from": "human",
"value": "I'm currently in the planning stage for a web application and I find myself trying to decide on using Grails or Django. From an operation perspective:\n\nWhich ecosystem is easier to maintain (migrations, backup, disaster recovery etc.)? If using grails it'll probably be a typ... |
Does anyone have a decent algorithm for calculating axis minima and maxima?
When creating a chart for a given set of data items, I'd like to be able to give the algorithm:
the maximum (y) value in the set
the minimum (y) value in the set
the number of tick marks to appear on the axis
an optional value that must a... | To calculate the axis minima and maxima for a chart based on your criteria, you can follow a structured algorithm. The goal is to determine appropriate axis limits and intervals based on the data and user-defined parameters.
Here’s a step-by-step outline of a possible algorithm in pseudocode, followed by an example:
... | 13,560 | [
{
"from": "human",
"value": "Does anyone have a decent algorithm for calculating axis minima and maxima? \nWhen creating a chart for a given set of data items, I'd like to be able to give the algorithm: \n\nthe maximum (y) value in the set \nthe minimum (y) value in the set \nthe number of tick marks to app... |
What are the guidelines for when to create a new exception type instead of using one of the built-in exceptions in .Net?
The problem that got me thinking is this. I have a WCF service, which is a basic input-output service. If the service is unable to create an output, because the input is invalid, I want to throw an e... | Creating custom exception types in .NET is a common practice when you need to represent specific error conditions that are not adequately covered by the built-in exception classes. Here are some guidelines to help you decide when to create a new exception type versus using an existing one:
### When to Create a New Exc... | 20,204 | [
{
"from": "human",
"value": "What are the guidelines for when to create a new exception type instead of using one of the built-in exceptions in .Net?\nThe problem that got me thinking is this. I have a WCF service, which is a basic input-output service. If the service is unable to create an output, because ... |
I'd like to map a reference to an object instead of the object value with an HashTable
configMapping.Add("HEADERS_PATH", Me.headers_path)
that way when I'm going to retrieve the value of "HEADERS_PATH" I'll be able to assign a value to Me.headers_path
something like the " & " operator in C
| In VB.NET, if you want to store a reference to an object (such as a property) in a `Hashtable`, you can use a `Delegate` or a `PropertyInfo` to reference the property. This allows you to retrieve and set the value later.
Here’s how you can do it using a delegate that encapsulates the property access:
### Option 1: U... | 18,136 | [
{
"from": "human",
"value": "I'd like to map a reference to an object instead of the object value with an HashTable\nconfigMapping.Add(\"HEADERS_PATH\", Me.headers_path)\n\nthat way when I'm going to retrieve the value of \"HEADERS_PATH\" I'll be able to assign a value to Me.headers_path\nsomething like the... |
There's a lot of people today who sell unittesting as bread-and-butter of development. That might even work for strongly algorithmically-oriented routines. However, how would you unit-test, for example, a memory allocator (think malloc()/realloc()/free()). It's not hard to produce a working (but absolutely useless) m... | You're correct in identifying the complexities involved in unit testing a memory allocator. Unlike typical application logic that can be easily partitioned and isolated, memory allocators require a broader perspective to ensure they not only meet the API's contractual obligations but also exhibit desired internal behav... | 14,070 | [
{
"from": "human",
"value": "There's a lot of people today who sell unittesting as bread-and-butter of development. That might even work for strongly algorithmically-oriented routines. However, how would you unit-test, for example, a memory allocator (think malloc()/realloc()/free()). It's not hard to pro... |
The situation is this: I have a USB device (a custom device I'm trying to talk to) with two endpoints, one writing to the device, one reading from the device. Both are bulk transfers. Every communication transaction takes the form of (1) Write a command to the device (2) Read the response. I'm using libusb (version 0.1... | The issue you're encountering with libusb on Ubuntu might be related to several factors. The error message "error submitting URB: Invalid argument" often indicates a problem with the parameters you're passing for the read operation. Here are a few troubleshooting steps you can take to diagnose and potentially fix the i... | 20,686 | [
{
"from": "human",
"value": "The situation is this: I have a USB device (a custom device I'm trying to talk to) with two endpoints, one writing to the device, one reading from the device. Both are bulk transfers. Every communication transaction takes the form of (1) Write a command to the device (2) Read th... |
You may think that this is a coincidence that the topic of my question is similar to the name of the forum but I actually got here by googling the term "stack overflow".
I use the OPNET network simulator in which I program using C. I think I am having a problem with big array sizes. It seems that I am hitting some sort... | Hello Ali,
It sounds like you're running into a stack overflow issue due to the large size of your arrays. In C, local variables (like your arrays) are typically allocated on the stack, which has a limited size (often around 1 MB or so, depending on the system and configuration). When you allocate large arrays, especi... | 18,132 | [
{
"from": "human",
"value": "You may think that this is a coincidence that the topic of my question is similar to the name of the forum but I actually got here by googling the term \"stack overflow\".\nI use the OPNET network simulator in which I program using C. I think I am having a problem with big array... |
Now, I know this is completely subjective, so please don't flame me. I've never been entirely satisfied with linux whenever I decided to install a distro like Ubuntu, Fedora etc. because of their awkward positioning and spacing of widgets.
Have a look at this:
Notice the awkward spacing of the text field's text.
I've... | It's great that you're exploring Linux, and your observations about UI consistency are valid. Aesthetics and usability are essential factors for many users, and achieving a polished, cohesive look can be challenging on Linux due to the vast diversity of environments, themes, and applications. Here are a few points to c... | 19,306 | [
{
"from": "human",
"value": "Now, I know this is completely subjective, so please don't flame me. I've never been entirely satisfied with linux whenever I decided to install a distro like Ubuntu, Fedora etc. because of their awkward positioning and spacing of widgets.\nHave a look at this:\n\n\nNotice the a... |
This may be simple one, but 5 mins of Googling didn't give me the answer.
How do you save and load bitmaps using .Net librabries?
I have an Image object and I need to save it to disk in some format (preferably png) and load back in later.
A C# example would be great.
| Certainly! In .NET, you can use the `System.Drawing` namespace to work with images, including saving and loading bitmap images. Below is an example of how to save an `Image` object to disk in PNG format and then load it back.
First, make sure to include the necessary namespaces:
```csharp
using System;
using System.D... | 15,488 | [
{
"from": "human",
"value": "This may be simple one, but 5 mins of Googling didn't give me the answer.\nHow do you save and load bitmaps using .Net librabries?\nI have an Image object and I need to save it to disk in some format (preferably png) and load back in later.\nA C# example would be great.\n"
},
... |
I have a Window where I have put a Frame. I would like to add a Page to the Frame when I click a button that is also on the Window but not in the Frame. There are several buttons in the Window and each click on a button should load a different Page in the Frame.
Since I'm a total newbie on this WPF stuff it's quite pos... | In WPF, using a `Frame` to navigate between different `Page` objects is a common approach, especially when you want to take advantage of the built-in navigation features like back and forward navigation. However, if you prefer using `UserControl` with a `Canvas`, that is also a valid approach and provides more flexibil... | 11,467 | [
{
"from": "human",
"value": "I have a Window where I have put a Frame. I would like to add a Page to the Frame when I click a button that is also on the Window but not in the Frame. There are several buttons in the Window and each click on a button should load a different Page in the Frame.\nSince I'm a tot... |
When I call Response.Redirect(someUrl) I get the following HttpException:
Cannot redirect after HTTP headers have been sent.
Why do I get this? And how can I fix this issue?
| The error "Cannot redirect after HTTP headers have been sent" occurs when your application tries to send an HTTP redirect response after the HTTP headers have already been sent to the client. In HTTP, headers need to be sent before the body of the response. If your application sends output to the client (like HTML, tex... | 18,414 | [
{
"from": "human",
"value": "When I call Response.Redirect(someUrl) I get the following HttpException:\n\nCannot redirect after HTTP headers have been sent.\n\nWhy do I get this? And how can I fix this issue?\n"
},
{
"from": "gpt",
"value": "The error \"Cannot redirect after HTTP headers have be... |
What logging solutions exist for j2me?
I'm specifically interested in easily excluding logging for "release" version, to have a smaller package & memory footprint.
| Logging in J2ME (Java 2 Micro Edition) can be a bit challenging due to the constraints of mobile devices and the limited availability of libraries compared to standard Java. However, there are a few solutions and approaches that you can consider, especially if you want to include logging in your development environment... | 15,336 | [
{
"from": "human",
"value": "What logging solutions exist for j2me? \nI'm specifically interested in easily excluding logging for \"release\" version, to have a smaller package & memory footprint. \n"
},
{
"from": "gpt",
"value": "Logging in J2ME (Java 2 Micro Edition) can be a bit challenging d... |
I'm using Hibernate for ORM of my Java app to an Oracle database (not that the database vendor matters, we may switch to another database one day), and I want to retrieve objects from the database according to user-provided strings. For example, when searching for people, if the user is looking for people who live in '... | To achieve the desired functionality using Hibernate, you can make use of the Criteria API (or the JPA Criteria API) to build queries dynamically based on user-provided input. The idea is to use a `LIKE` clause in your query to match substrings in your database.
Here’s how you can achieve this with Hibernate’s Criteri... | 15,038 | [
{
"from": "human",
"value": "I'm using Hibernate for ORM of my Java app to an Oracle database (not that the database vendor matters, we may switch to another database one day), and I want to retrieve objects from the database according to user-provided strings. For example, when searching for people, if the... |
How can I find out which column and value is violating the constraint? The exception message isn't helpful at all:
Failed to enable constraints. One or
more rows contain values violating
non-null, unique, or foreign-key
constraints.
| When you encounter the error message "Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints," it indicates that there is an issue with the data in your DataSet or DataTable that violates one or more of the defined constraints. Here are steps you can take to... | 17,827 | [
{
"from": "human",
"value": "How can I find out which column and value is violating the constraint? The exception message isn't helpful at all:\n\nFailed to enable constraints. One or\n more rows contain values violating\n non-null, unique, or foreign-key\n constraints.\n\n"
},
{
"from": "gpt",
... |
Just wanted to get an idea for ways (web) developers get round the short fall of (most) WYSIWYG editors, whereby the users that are editing the text aren't always HTML literate enough to produce good/great results.
In the past we have resigned ourselves to either locking down the editor or simply not supplying one.
Wha... | The limitations of WYSIWYG (What You See Is What You Get) editors for web development are well known, especially when it comes to user experience and maintaining clean HTML code. Here are some strategies that developers have used to enhance the editing experience while mitigating these issues:
### 1. **Custom Toolbar ... | 17,911 | [
{
"from": "human",
"value": "Just wanted to get an idea for ways (web) developers get round the short fall of (most) WYSIWYG editors, whereby the users that are editing the text aren't always HTML literate enough to produce good/great results.\nIn the past we have resigned ourselves to either locking down t... |
I'm stuck on a fix to a legacy Visual C++ 6 app. In the C++ DLL source I have put
extern "C" _declspec(dllexport) char* MyNewVariable = 0;
which results in MyNewVariable showing up (nicely undecorated) in the export table (as shown by dumpbin /exports blah.dll). However, I can't figure out how to declare the variable ... | To access a variable exported from a C++ DLL in a C source file, you need to ensure that the variable's name is not mangled when you declare it in your C code. Here’s a step-by-step guide on how to achieve this:
1. **Export the Variable from the C++ DLL:**
Make sure your variable is exported correctly from the C++ ... | 17,959 | [
{
"from": "human",
"value": "I'm stuck on a fix to a legacy Visual C++ 6 app. In the C++ DLL source I have put\nextern \"C\" _declspec(dllexport) char* MyNewVariable = 0;\n\nwhich results in MyNewVariable showing up (nicely undecorated) in the export table (as shown by dumpbin /exports blah.dll). However, I... |
I'm working on a C++ library that (among other stuff) has functions to read config files; and I want to add tests for this. So far, this has lead me to create lots of valid and invalid config files, each with only a few lines that test one specific functionality. But it has now got very unwieldy, as there are so many f... | Testing configuration file parsing can indeed become unwieldy, especially when dealing with a large number of test cases. Here are several strategies to help you organize your tests, applications, and data in a more maintainable manner.
### 1. Use Parameterized Tests
If your testing framework supports it (such as Goo... | 18,941 | [
{
"from": "human",
"value": "I'm working on a C++ library that (among other stuff) has functions to read config files; and I want to add tests for this. So far, this has lead me to create lots of valid and invalid config files, each with only a few lines that test one specific functionality. But it has now ... |
In WPF, there are two ways to set the focus to an element.
You can either call the .Focus() method of the input element, or call Keyboard.Focus() with the input element as parameter.
// first way:
item.Focus();
// alternate way:
Keyboard.Focus(item);
What is the difference between these two? Are there special reasons ... | In WPF (Windows Presentation Foundation), both methods you mentioned are used to set the focus on a control, but they differ slightly in their intended use cases and the specifics of their implementation.
### 1. `item.Focus()`
- **Usage**: The `.Focus()` method is an instance method that can be called on any `UIEleme... | 19,275 | [
{
"from": "human",
"value": "In WPF, there are two ways to set the focus to an element.\nYou can either call the .Focus() method of the input element, or call Keyboard.Focus() with the input element as parameter.\n// first way:\nitem.Focus();\n// alternate way:\nKeyboard.Focus(item);\n\nWhat is the differen... |
I've been using Xcode for the usual C/C++/ObjC development. I'm wondering what are practical considerations, opinions of Xcode, Eclipse or NetBeans usage on a Mac for Java development?
Please don't include my current usage of Xcode in your analysis.
| When it comes to Java development on macOS, both Eclipse and NetBeans are popular Integrated Development Environments (IDEs) alongside IntelliJ IDEA. Here are some practical considerations and opinions regarding each option:
### Eclipse
**Pros:**
1. **Mature Ecosystem:** Eclipse has a long history and a vast library ... | 16,430 | [
{
"from": "human",
"value": "I've been using Xcode for the usual C/C++/ObjC development. I'm wondering what are practical considerations, opinions of Xcode, Eclipse or NetBeans usage on a Mac for Java development? \nPlease don't include my current usage of Xcode in your analysis. \n"
},
{
"from": "g... |
I'm using the jQuery slideToggle function on a site to reveal 'more information' about something. When I trigger the slide, the content is gradually revealed, but is located to the right by about 100 pixels until the end of the animation when it suddenly jumps to the correct position. Going the other way, the content... | The issue you're experiencing with the `slideToggle` animation causing the content to jump is likely related to the CSS properties affecting the positioning or width of the element you're animating. Here are several steps you can take to troubleshoot and fix the problem:
### 1. Check CSS Styles
Make sure there are no ... | 19,221 | [
{
"from": "human",
"value": "I'm using the jQuery slideToggle function on a site to reveal 'more information' about something. When I trigger the slide, the content is gradually revealed, but is located to the right by about 100 pixels until the end of the animation when it suddenly jumps to the correct po... |
G'day Stackoverflowers,
I'm the author of Perl's autodie pragma, which changes Perl's built-ins to throw exceptions on failure. It's similar to Fatal, but with lexical scope, an extensible exception model, more intelligent return checking, and much, much nicer error messages. It will be replacing the Fatal module in ... | G'day!
It sounds like you’re dealing with an interesting edge case regarding how `flock` behaves on Windows compared to Unix-like systems. Since you’re looking for a way to handle the `LOCK_NB` option without hard-coding a magic number for the specific error code, let's explore a solution that can help you dynamicall... | 15,833 | [
{
"from": "human",
"value": "G'day Stackoverflowers,\nI'm the author of Perl's autodie pragma, which changes Perl's built-ins to throw exceptions on failure. It's similar to Fatal, but with lexical scope, an extensible exception model, more intelligent return checking, and much, much nicer error messages. ... |
I've got a lightbox textbox that is displayed using an AJAX call from an ASP.NET UpdatePanel. When the lightbox is displayed, I use the focus() method of a textbox that is in the lightbox to bring focus to the textbox right away.
When in Firefox, the text box gains focus with no problem. In IE, the text box does not ga... | You're experiencing a common issue where certain browsers, like Internet Explorer, do not immediately allow focus on an element after it has been added to the DOM. This is especially prevalent in cases where the element is rendered as a result of an AJAX call, and focus cannot be achieved right away.
Here’s how you ca... | 19,236 | [
{
"from": "human",
"value": "I've got a lightbox textbox that is displayed using an AJAX call from an ASP.NET UpdatePanel. When the lightbox is displayed, I use the focus() method of a textbox that is in the lightbox to bring focus to the textbox right away.\nWhen in Firefox, the text box gains focus with n... |
I have just started using silverlight 2 beta and cannot find how to or if it is possible to render a canvas to an bitmap image and then upload it to my web server?
Is this possible and if so how would I complete this task?
Update: This is now possible under silverlight 3 using a writable bitmap to save the XAML as a J... | In Silverlight 2, there wasn't a built-in method to render a `Canvas` or any other visual elements directly to a bitmap. However, with Silverlight 3, the introduction of the `WritableBitmap` class made this task possible, allowing you to render XAML to an image format like JPEG or PNG.
Here’s a brief overview of how t... | 16,181 | [
{
"from": "human",
"value": "I have just started using silverlight 2 beta and cannot find how to or if it is possible to render a canvas to an bitmap image and then upload it to my web server?\nIs this possible and if so how would I complete this task?\n\nUpdate: This is now possible under silverlight 3 usi... |
We have some COBOL programs running on our mainframe and we need one of those to communicate with our back end vault through a Java API. Is there any way a Cobol program can invoke the Java program?
Would it be possible to use a Web Service from Cobol? How would I integrate a Cobol program with anything else?
| Integrating COBOL programs with modern technologies such as Java APIs can be challenging but certainly feasible. Here are some options for enabling communication between COBOL programs and a Java backend, specifically through web services or other methods:
### 1. **Web Services (SOAP/REST)**
COBOL programs can indeed... | 14,662 | [
{
"from": "human",
"value": "We have some COBOL programs running on our mainframe and we need one of those to communicate with our back end vault through a Java API. Is there any way a Cobol program can invoke the Java program?\nWould it be possible to use a Web Service from Cobol? How would I integrate a C... |
I have a serializiable object with listeners registered. Currently the list of listeners is stored in the object as transient. When the object is serialized and then deserialized, obviously the listeners are no longer registered.
What would be the safest and best way to go about re-registering the listeners automatical... | To re-register listeners automatically when your serializable object is deserialized, you can implement the `readObject` method in your class. This method allows you to customize the deserialization process, enabling you to re-establish any necessary state, including re-registering your listeners.
Here’s a general out... | 18,623 | [
{
"from": "human",
"value": "I have a serializiable object with listeners registered. Currently the list of listeners is stored in the object as transient. When the object is serialized and then deserialized, obviously the listeners are no longer registered.\nWhat would be the safest and best way to go abou... |
I am using PHP with Apache on Linux, with Sendmail. I use the PHP mail function. The email is sent, but the envelope has the Apache_user@localhostname in MAIL FROM (example nobody@conniptin.internal) and some remote mail servers reject this because the domain doesn't exist (obviously). Using mail, can I force it to cha... | You're correct that the `mail()` function in PHP has a fifth parameter that can be used to set the envelope sender (also known as the Return-Path). This can help you avoid issues with mail servers rejecting emails due to an incorrect MAIL FROM address.
Here's a quick refresher on the `mail()` function syntax:
```php
... | 18,442 | [
{
"from": "human",
"value": "I am using PHP with Apache on Linux, with Sendmail. I use the PHP mail function. The email is sent, but the envelope has the Apache_user@localhostname in MAIL FROM (example nobody@conniptin.internal) and some remote mail servers reject this because the domain doesn't exist (obvi... |
I have a C# module responsible for acquiring the list of network adapters that are "connected to the internet" on a windows Vista machine. The module uses the "Network List Manager API" (or NLM API) to iterate over all network connections and returns all those for which the IsConnectedToInternet value is true.
I receiv... | Your approach to testing the module that checks for internet-connected network adapters using an alternative method is valid, especially if you need a way to verify the functionality of the original module. I'll address your questions one by one.
### 1. How to Test the Module
Testing such a module, especially one rel... | 19,400 | [
{
"from": "human",
"value": "I have a C# module responsible for acquiring the list of network adapters that are \"connected to the internet\" on a windows Vista machine. The module uses the \"Network List Manager API\" (or NLM API) to iterate over all network connections and returns all those for which the ... |
I love the way I can profile a Java/.Net app to find performance bottlenecks or memory problems. For example, it's very easy to find a performance bottleneck looking at the call tree with execution times and invocation counts per method. In SQL Server, I have stored procedures that call other stored procedures that dep... | While SQL Server Profiler is indeed a commonly used tool for monitoring SQL Server performance, many users find it limited in terms of detailed profiling like you would find in application profiling tools for Java or .NET. Here are some alternative tools and techniques that may help you profile SQL Server stored proced... | 16,998 | [
{
"from": "human",
"value": "I love the way I can profile a Java/.Net app to find performance bottlenecks or memory problems. For example, it's very easy to find a performance bottleneck looking at the call tree with execution times and invocation counts per method. In SQL Server, I have stored procedures t... |
I'm working on an application that is supposed to create products (like shipping insurance policies) when PayPal Instant Payment Notifications are received. Unfortunately, PayPal sometimes sends duplicate notifications. Furthermore, there is another third-party that is performing web-service updates simultaneously wh... | The scenario you describe involves handling potential race conditions and duplicate notifications from PayPal, specifically in the context of creating and updating database records in a multi-threaded environment. Let's analyze your approach using the `RepeatableRead` isolation level and suggest some potential improvem... | 18,008 | [
{
"from": "human",
"value": "I'm working on an application that is supposed to create products (like shipping insurance policies) when PayPal Instant Payment Notifications are received. Unfortunately, PayPal sometimes sends duplicate notifications. Furthermore, there is another third-party that is perform... |
Maybe my understanding of agile development isn't as good as it should be, but I'm curious how an agile developer would potentially use off-the-shelf (OTS) software when the requirements and knowledge of what the final system should be are changing as rapidly as I understand them to (often after each iteration of devel... | Your understanding of the nuances in agile development, particularly regarding the use of off-the-shelf (OTS) software, raises important questions about flexibility, adaptability, and cost-effectiveness. Let’s delve into how agile principles can interact with OTS software and what strategies teams can employ in the sce... | 12,899 | [
{
"from": "human",
"value": "Maybe my understanding of agile development isn't as good as it should be, but I'm curious how an agile developer would potentially use off-the-shelf (OTS) software when the requirements and knowledge of what the final system should be are changing as rapidly as I understand the... |
My group is a Perl shop in an organization that is very heterogenous. Although we support the odd Java, PHP, or Python installation, we're using Perl for nearly all of our web applications and systems/data marshalling tasks. All of our boxes are Linux, although we interface with IIS systems as well.
We're coming unde... | Your situation is not uncommon in heterogeneous environments where management looks for standardization or the adoption of a more widely used technology. When considering the transition to Java, there are several factors to weigh:
### Considerations for Java Adoption
1. **Mindshare and Talent Availability**: Java has... | 18,714 | [
{
"from": "human",
"value": "My group is a Perl shop in an organization that is very heterogenous. Although we support the odd Java, PHP, or Python installation, we're using Perl for nearly all of our web applications and systems/data marshalling tasks. All of our boxes are Linux, although we interface wi... |
I'm writing a Java app that is accepting URL parameter values that may or may not be encoded. I need an easy way to tell whether or not I need to encode the parameter string.
In other words, I want a function boolean needsEncoding(String param), which will return true if I pass in the String "foo@test.com", and false ... | The ambiguity surrounding URL encoding can indeed make it challenging to determine whether a string should be encoded. Since both encoded and unencoded strings can contain `%`, it’s difficult to develop a foolproof method to ascertain the "original" intent of the string.
Here are a few options you might consider:
###... | 19,420 | [
{
"from": "human",
"value": "I'm writing a Java app that is accepting URL parameter values that may or may not be encoded. I need an easy way to tell whether or not I need to encode the parameter string.\nIn other words, I want a function boolean needsEncoding(String param), which will return true if I pas... |
I have a program that uses the built in webbrowser control. At some point during the usage of this, I'm not sure at what point, but it appears to be random, I get the following error:
System.AccessViolationException
FullText = System.AccessViolationException: Attempted to read or write protected memory. This is often... | The `System.AccessViolationException` that you are encountering indicates that your program is trying to access memory that it is not allowed to access. This often happens in applications that involve unmanaged code or external libraries, such as the built-in WebBrowser control, which is based on Internet Explorer and ... | 18,273 | [
{
"from": "human",
"value": "I have a program that uses the built in webbrowser control. At some point during the usage of this, I'm not sure at what point, but it appears to be random, I get the following error:\nSystem.AccessViolationException\n\nFullText = System.AccessViolationException: Attempted to r... |
I installed Ruby and Ruby on Rails yesterday on Vista 32bit using the directions on this site: http://rubyonrails.org/down
So I downloaded the installer, then Gems, then I downloaded rails with Gems.
Now I can't use the Gem or Ruby commands in the command line... so I assume there's something wrong with the environment... | It sounds like you need to set up your environment variables so that the command line can recognize the Ruby and RubyGems commands. Here’s how you can do it on Windows Vista:
### Step 1: Find the installation paths
First, you need to locate where Ruby and RubyGems are installed. The default installation path for Ruby... | 18,416 | [
{
"from": "human",
"value": "I installed Ruby and Ruby on Rails yesterday on Vista 32bit using the directions on this site: http://rubyonrails.org/down\nSo I downloaded the installer, then Gems, then I downloaded rails with Gems.\nNow I can't use the Gem or Ruby commands in the command line... so I assume t... |
In my Silverlight project I have a thread that fires every x milliseconds. In this thread I was attempting to change the state of the application. This wasn't working and I didn't know why, so put a breakpoint in to the Timer callback. The breakpoint was hit, but the minute I attempted to change the state it just baile... | In Visual Studio, you can configure it to break on exceptions that occur in your application, even when they are handled or thrown in a separate thread. Here's how you can do that:
1. **Enable Exception Settings**:
- Open your project in Visual Studio.
- Go to the **Debug** menu and select **Windows** -> **Excep... | 18,872 | [
{
"from": "human",
"value": "In my Silverlight project I have a thread that fires every x milliseconds. In this thread I was attempting to change the state of the application. This wasn't working and I didn't know why, so put a breakpoint in to the Timer callback. The breakpoint was hit, but the minute I at... |
What is the best method for adding options to a <select> from a JavaScript object using jQuery?
I'm looking for something that I don't need a plugin to do, but I would also be interested in the plugins that are out there.
This is what I did:
selectValues = { "1": "test 1", "2": "test 2" };
for (key in selectValues) {
... | Your approach to populating a `<select>` element with options from a JavaScript object using jQuery is on the right track. Here’s a refined and efficient way to do it, including some improvements for clarity and best practices.
### Improved Method
```javascript
$(document).ready(function() {
var selectValues = { ... | 14,577 | [
{
"from": "human",
"value": "What is the best method for adding options to a <select> from a JavaScript object using jQuery?\nI'm looking for something that I don't need a plugin to do, but I would also be interested in the plugins that are out there.\nThis is what I did:\nselectValues = { \"1\": \"test 1\"... |
I have created some extra functionality on my Linq-to-SQL classes to make things easier as I develop my applications. For example I have defined a property that retrieves active contracts from a list of contracts. However if I try to use this property in a lambda expression or in general in a query it either throws an ... | In LINQ to SQL, when you define a property on your entity class that isn't directly mapped to a database column or doesn't return a simple value, it typically becomes a runtime-only property. This means that when you use it in a LINQ query, LINQ to SQL won't know how to translate it into SQL, which can lead to the exce... | 17,585 | [
{
"from": "human",
"value": "I have created some extra functionality on my Linq-to-SQL classes to make things easier as I develop my applications. For example I have defined a property that retrieves active contracts from a list of contracts. However if I try to use this property in a lambda expression or i... |
I am developing an iPhone app and have to parse xml files in order to put them into a database. I will also be using those same xml parsers in my app so users can import their own data. I was wondering how I can extract those xml parsers into a bundle or a library so I can use them both in my iPhone app and in a comman... | To create reusable XML parsers that you can use in both your iPhone app and a command line app, you can encapsulate the parsing functionality into a separate Swift package or a framework. This allows for code reusability and easy integration into different projects. Here's a step-by-step guide on how to achieve this:
... | 16,939 | [
{
"from": "human",
"value": "I am developing an iPhone app and have to parse xml files in order to put them into a database. I will also be using those same xml parsers in my app so users can import their own data. I was wondering how I can extract those xml parsers into a bundle or a library so I can use t... |
Does anyone have some good information on the usage of the .SaveChanges() method?
I am experiencing a variety of issues when attempting to use the .SaveChanges() method on my data context object. I am taking data from an existing data source, creating the appropriate EntityFramework/DataService objects, populating tho... | Using `.SaveChanges()` in Entity Framework can be tricky, especially when you're working with a large volume of data, as in your case with 90,000 records. Here are some insights and best practices that could help address the issues you're experiencing:
### Understanding .SaveChanges()
1. **Memory Management**:
- W... | 17,207 | [
{
"from": "human",
"value": "Does anyone have some good information on the usage of the .SaveChanges() method?\nI am experiencing a variety of issues when attempting to use the .SaveChanges() method on my data context object. I am taking data from an existing data source, creating the appropriate EntityFra... |
I have 2 classes for accessing the database:
MovieDAO - access database using "select" statements only; the purpose is for retrieving data for displaying in the web browser.
and
MovieExtendedDAO (extends MovieDAO) - which is more complete and allows for creating/updating/deleting a movie in addition to the inherited f... | The design you are using, where you have a base class (`MovieDAO`) for read-only operations and a derived class (`MovieExtendedDAO`) for both read and write operations, is a reasonable approach. It reflects a common practice in software design known as the **Single Responsibility Principle (SRP)**, which is part of SOL... | 18,587 | [
{
"from": "human",
"value": "I have 2 classes for accessing the database:\nMovieDAO - access database using \"select\" statements only; the purpose is for retrieving data for displaying in the web browser.\nand \nMovieExtendedDAO (extends MovieDAO) - which is more complete and allows for creating/updating/d... |
I run php 5.2.6 as a cgi under lighttpd 1.4 and for some reason it's always running as root. All php-cgi processes in are owned by root and all files written to the file system are owned by root.
I've tried setting the user in lighttpd as non privileged, and confirmed, it's running right it's just php that runs as roo... | Running PHP as the root user is a security risk, and it's essential to configure it properly to run as a non-privileged user. To achieve this with Lighttpd and PHP running as CGI, you can use the `suEXEC` module or modify the Lighttpd configuration.
Here’s how you can run PHP-CGI under a non-privileged user:
### Opti... | 16,580 | [
{
"from": "human",
"value": "I run php 5.2.6 as a cgi under lighttpd 1.4 and for some reason it's always running as root. All php-cgi processes in are owned by root and all files written to the file system are owned by root. \nI've tried setting the user in lighttpd as non privileged, and confirmed, it's ru... |
From Wikipedia:
Generic programming is a style of
computer programming in which
algorithms are written in terms of
to-be-specified-later types that are
then instantiated when needed for
specific types provided as parameters
and was pioneered by Ada which
appeared in 1983. This approach
permits writing... | C# and VB.NET incorporate generics to provide several important benefits, enhancing code quality, performance, and maintainability. Here are some key reasons and benefits of using generics in these languages:
### Benefits of Generics in C# and VB.NET:
1. **Type Safety**: Generics allow developers to specify the types... | 15,909 | [
{
"from": "human",
"value": "From Wikipedia: \n\nGeneric programming is a style of\n computer programming in which\n algorithms are written in terms of\n to-be-specified-later types that are\n then instantiated when needed for\n specific types provided as parameters\n and was pioneered by Ada which\n ... |
I haven't written any code yet, but I've encountered a similar problem before. Hopefully things have changed since the last time I visited it.
I'm trying to do my own image conversion for games into a special OpenGL image format.
In order to perform the conversion correctly, I need all pixel data and more importantly, ... | Yes, the `System.Drawing` namespace in .NET supports 32-bit images, including full alpha transparency. When you load an image using `System.Drawing.Image` or any of its derived classes, the alpha channel (8 bits per pixel) will be retained.
When you want to access pixel data, you can use the `Bitmap` class, which allo... | 20,115 | [
{
"from": "human",
"value": "I haven't written any code yet, but I've encountered a similar problem before. Hopefully things have changed since the last time I visited it.\nI'm trying to do my own image conversion for games into a special OpenGL image format.\nIn order to perform the conversion correctly, I... |
I want to create basic line, bar, pie and area charts for .NET 3.5 WinForms and I'm interested in finding a free, mature, open-source .NET (preferably C# based) project to help me accomplish that. I would consider a WPF based project, however I'm more comfortable in GDI+ so I'd rather it used System.Drawing and/or GDI... | If you are looking for an open-source charting library that works with .NET 3.5 WinForms and is based on GDI+ or System.Drawing, I recommend checking out **ZedGraph**. ZedGraph is a free and mature library that supports various types of graphs including line, bar, pie, and area charts. It is specifically designed for u... | 16,326 | [
{
"from": "human",
"value": "I want to create basic line, bar, pie and area charts for .NET 3.5 WinForms and I'm interested in finding a free, mature, open-source .NET (preferably C# based) project to help me accomplish that. I would consider a WPF based project, however I'm more comfortable in GDI+ so I'd... |
Is there a good method for writing C / C++ function headers with default parameters that are function calls?
I have some header with the function:
int foo(int x, int y = 0);
I am working in a large code base where many functions call this function and depend on this default value. This default value now needs to chan... | In C and C++, default parameters in function headers must be constant expressions or values known at compile time, meaning that you cannot use function calls (like `bar()` or `baz.bar()`) to provide default values for parameters. This design decision is based on how the C++ language specification defines default argume... | 19,312 | [
{
"from": "human",
"value": "Is there a good method for writing C / C++ function headers with default parameters that are function calls? \nI have some header with the function:\nint foo(int x, int y = 0);\n\nI am working in a large code base where many functions call this function and depend on this defaul... |
I am writing a tracing tool which needs to deal with the output of a a JIT, so the stack can look pretty bizarre at times. I'd like to try to apply some heuristics to addresses to determine if they are code, data or garbage. (If I'm wrong some of the time, it's no big deal; however if the process crashes, not so much... | In Linux, directly accessing memory protection details from within a process (i.e., checking the read, write, and execute permissions for a specific address) without parsing `/proc/<pid>/maps` is not straightforward. However, there are a few techniques you can employ to achieve your goal.
### Using `mincore()`
While ... | 18,605 | [
{
"from": "human",
"value": "I am writing a tracing tool which needs to deal with the output of a a JIT, so the stack can look pretty bizarre at times. I'd like to try to apply some heuristics to addresses to determine if they are code, data or garbage. (If I'm wrong some of the time, it's no big deal; ho... |
I have a new app I'll be working on where I have to generate a Word document that contains tables, graphs, a table of contents and text. What's a good API to use for this? How sure are you that it supports graphs, ToCs, and tables? What are some hidden gotcha's in using them?
Some clarifications:
I can't output a P... | Given your requirements, here are a few options to consider for generating Word documents that include tables, graphs, a table of contents, and text, while also allowing you to start with a template:
1. **Apache POI**:
- **Overview**: Apache POI is a popular Java library for manipulating various file formats based ... | 19,612 | [
{
"from": "human",
"value": "I have a new app I'll be working on where I have to generate a Word document that contains tables, graphs, a table of contents and text. What's a good API to use for this? How sure are you that it supports graphs, ToCs, and tables? What are some hidden gotcha's in using them?... |
Been using PHP/MySQL for a little while now, and I'm wondering if there are any specific advantages (performance or otherwise) to using mysql_fetch_object() vs mysql_fetch_assoc() / mysql_fetch_array().
| When working with PHP and MySQL, particularly using the older `mysql` extension, you have a few options for fetching data from a result set. Specifically, you mentioned `mysql_fetch_object()`, `mysql_fetch_assoc()`, and `mysql_fetch_array()`. Each of these functions has its own characteristics, and choosing one over th... | 17,227 | [
{
"from": "human",
"value": "Been using PHP/MySQL for a little while now, and I'm wondering if there are any specific advantages (performance or otherwise) to using mysql_fetch_object() vs mysql_fetch_assoc() / mysql_fetch_array().\n"
},
{
"from": "gpt",
"value": "When working with PHP and MySQL... |
I am trying to nail down free space on a remote server by querying all the drives and then looping until I find the drive I am seeking.
Is there a better way to do this?
Dim oConn As New ConnectionOptions
Dim sNameSpace As String = "\\mnb-content2\root\cimv2"
Dim oMS As New ManagementScope(sNameSpace, oConn)
Dim oQue... | The code you've shared does a good job of querying all the logical drives on a remote server and checking for a specific drive (in this case, "Y:"). However, if your goal is to find a specific drive and only retrieve its information, you can optimize the code a bit to reduce unnecessary iterations.
Instead of looping ... | 19,893 | [
{
"from": "human",
"value": "I am trying to nail down free space on a remote server by querying all the drives and then looping until I find the drive I am seeking.\nIs there a better way to do this? \nDim oConn As New ConnectionOptions\nDim sNameSpace As String = \"\\\\mnb-content2\\root\\cimv2\"\nDim oMS ... |
I wonder if there is a way to either programatically or using a third party tool (profiler?) get an overview of how many instances of a class are currently active in the AppDomain (including or excluding derived classes), and even better, where they are allocated (not sure if that is even possible).
I know that I could... | To gather information about the instances of a class in the AppDomain, including those of derived classes, you can use various techniques and tools within the .NET ecosystem. Here are some methods and tools that might help you:
### 1. **Profiling API**
You can use the .NET Profiling API, which allows you to create a ... | 19,520 | [
{
"from": "human",
"value": "I wonder if there is a way to either programatically or using a third party tool (profiler?) get an overview of how many instances of a class are currently active in the AppDomain (including or excluding derived classes), and even better, where they are allocated (not sure if th... |
Concrete use case:
In the Eclipse IDE, new 'plugins' can be added by copying a plugin's file(s) into the $ECLIPSE_HOME/plugins directory. However, I want to keep my original Eclipse installation 'clean' without additional plugins because I want to run this basic installation on its own at times.
What is a way of avoid... | Yes, you can achieve the desired overlay of plugin directories in Eclipse using symbolic links. Symbolic links allow you to create a reference to a file or directory in another location, effectively allowing you to "overlay" the contents of a directory without physically copying files.
Here's how you can do it with sy... | 13,113 | [
{
"from": "human",
"value": "Concrete use case:\nIn the Eclipse IDE, new 'plugins' can be added by copying a plugin's file(s) into the $ECLIPSE_HOME/plugins directory. However, I want to keep my original Eclipse installation 'clean' without additional plugins because I want to run this basic installation on... |
When I add a breakpoint and hit F5 to run in the debugger (I am using my debug build), a dialog pops up telling my my web.config file does not have debug=true in it (which is does) and I get 2 choices a) run without the debugger or b) let visual studio update my web.config file. If I choose b) the web.config is updated... | It sounds like you're encountering an issue with debugging your ASP.NET application in Visual Studio. Let's troubleshoot the problem together. Here are several steps and checks you can perform to resolve the issue:
### 1. Check the Web.config File
Ensure that your `web.config` file has the correct configuration for de... | 20,179 | [
{
"from": "human",
"value": "When I add a breakpoint and hit F5 to run in the debugger (I am using my debug build), a dialog pops up telling my my web.config file does not have debug=true in it (which is does) and I get 2 choices a) run without the debugger or b) let visual studio update my web.config file.... |
Want to know what the stackoverflow community feels about the various free and non-free Java Profilers and profiling tools available.
| The Stack Overflow community has discussed various Java profiling tools over the years, and opinions can vary based on personal experience, use cases, and specific needs. Here’s a summary of the general sentiment regarding some popular free and non-free Java profilers and profiling tools:
### Free Java Profilers:
1. ... | 19,776 | [
{
"from": "human",
"value": "Want to know what the stackoverflow community feels about the various free and non-free Java Profilers and profiling tools available.\n"
},
{
"from": "gpt",
"value": "The Stack Overflow community has discussed various Java profiling tools over the years, and opinions... |
I have a products table that contains a FK for a category, the Categories table is created in a way that each category can have a parent category, example:
Computers
Processors
Intel
Pentium
Core 2 Duo
AMD
Athlon
I need to make a select query that if the selected... | Your scenario involves querying a hierarchical structure of categories, where you want to return products from a specific category and all its descendants. A common approach for managing such hierarchical data in SQL is to use recursive Common Table Expressions (CTEs). This allows you to dynamically build the list of c... | 19,854 | [
{
"from": "human",
"value": "I have a products table that contains a FK for a category, the Categories table is created in a way that each category can have a parent category, example:\nComputers\n Processors\n Intel\n Pentium\n Core 2 Duo\n AMD\n Athlon\n\n... |
I am building a product that we are eventually going to white-label. Right now I am trying to figure out the best way to facilitate these requirements programmatically so the user can update the basic design of the site (ie header color, etc) via their profile/settings form.
Requirements:
User can update the logo (t... | Storing user-specific CSS overrides in a database is a common approach for enabling white-labeling and customization features. Your idea of writing the custom CSS to the Master Page during the `PreInit` event is a solid foundation, but there are some considerations and alternatives you might want to keep in mind.
### ... | 18,211 | [
{
"from": "human",
"value": "I am building a product that we are eventually going to white-label. Right now I am trying to figure out the best way to facilitate these requirements programmatically so the user can update the basic design of the site (ie header color, etc) via their profile/settings form. \nR... |
I'm trying to find out whether I should be using business critical logic in a trigger or constraint inside of my database.
So far I've added logic in triggers as it gives me the control over what happens next and means I can provide custom user messages instead of an error that will probably confuse the users.
Is there... | When deciding whether to use triggers or constraints for implementing business logic in your database, it's essential to understand their differences, use cases, and implications for performance and maintainability. Below, I provide some insights to help you make an informed choice.
### Triggers vs. Constraints
1. **... | 15,736 | [
{
"from": "human",
"value": "I'm trying to find out whether I should be using business critical logic in a trigger or constraint inside of my database.\nSo far I've added logic in triggers as it gives me the control over what happens next and means I can provide custom user messages instead of an error that... |
The Interwebs are no help on this one. We're encoding data in ColdFusion using serializeJSON and trying to decode it in PHP using json_decode. Most of the time, this is working fine, but in some cases, json_decode returns NULL. We've looked for the obvious culprits, but serializeJSON seems to be formatting things as ex... | It sounds like you've identified the root cause of the issue: "smart" quotes or other special characters that are typically present in text copied from Microsoft Word. These characters can lead to problems with JSON encoding and decoding, especially if they are not valid UTF-8 characters.
Here are some considerations... | 21,751 | [
{
"from": "human",
"value": "The Interwebs are no help on this one. We're encoding data in ColdFusion using serializeJSON and trying to decode it in PHP using json_decode. Most of the time, this is working fine, but in some cases, json_decode returns NULL. We've looked for the obvious culprits, but serializ... |
I generally build web based applications. But, there is sometimes a need to distribute these applications to various platforms and have them act more like regular applications than web apps. A quick solution might be to create an icon that opens the browser with no menu, url bar, or icons.
It looks like IE might have... | Deploying web applications as more conventional desktop applications can be accomplished in several ways across different platforms. Here are some options to consider for Windows, Linux, and macOS:
### 1. **Web Technologies with Electron**
Electron is a popular framework that allows you to build cross-platform desktop... | 19,508 | [
{
"from": "human",
"value": "I generally build web based applications. But, there is sometimes a need to distribute these applications to various platforms and have them act more like regular applications than web apps. A quick solution might be to create an icon that opens the browser with no menu, url b... |
We've just "upgraded" our production database server from 32-bit to 64-bit. It's running SQL Server 2005 Standard on Windows Server 2003. During the night after the upgrade the server was unavailable for nearly an hour - client requests were timing out. The problem then seemed to fix itself. The only clue I have as to ... | It looks like your SQL Server instance is experiencing memory pressure, which can cause performance issues, including timeouts, especially in a production environment. The messages in the log indicate that SQL Server is struggling to find free memory buffers to satisfy requests, which can lead to the symptoms you're ob... | 17,013 | [
{
"from": "human",
"value": "We've just \"upgraded\" our production database server from 32-bit to 64-bit. It's running SQL Server 2005 Standard on Windows Server 2003. During the night after the upgrade the server was unavailable for nearly an hour - client requests were timing out. The problem then seemed... |
I've got an ms-access application that's accessing and ms-sql db through an ODBC connection. I'm trying to force my users to update the data only through the application portion, but I don't care if they read the data directly or through their own custom ms-access db (they use it for creating ad hoc reports).
What I'm ... | To achieve your goal of ensuring that data can only be edited through your compiled MS Access application (.mde) while allowing users to read data through their own MS Access databases, you'll want to implement a combination of access controls, user management, and database security measures. Here's a possible approach... | 18,311 | [
{
"from": "human",
"value": "I've got an ms-access application that's accessing and ms-sql db through an ODBC connection. I'm trying to force my users to update the data only through the application portion, but I don't care if they read the data directly or through their own custom ms-access db (they use i... |
This is clearly not appears like it wouldn't be a best practice. Can someone explain why it would not be a best practice or how this works? Any books or articles providing an explanation would be appreciated.
//The constructor
public Page_Index() {
//create a local value
string currentValue = "This is the FIR... | The scenario you've described involves the use of a local variable (`currentValue`) in a delegate that's executed later. The key point here is how C# handles closures with local variables within delegate (or lambda) expressions. Let's break this down:
### Explanation
1. **Local Variable in Delegate**: The local varia... | 16,930 | [
{
"from": "human",
"value": "This is clearly not appears like it wouldn't be a best practice. Can someone explain why it would not be a best practice or how this works? Any books or articles providing an explanation would be appreciated.\n//The constructor\npublic Page_Index() {\n\n //create a local val... |
I have an assembly containing very thorough XML-based documentation, which is used through Sandcastle to generate the help-files for the product. We also use the output XML files for providing proper Intellisense in Visual Studio when programmers use the assembly obviously.
In order to do this, it seems we have do both... | Yes, it is indeed possible to embed the XML documentation within your assembly as an embedded resource. This allows you to distribute a single file (the assembly) while still providing the XML documentation for Intellisense and other purposes. Below are the steps to achieve this:
### Steps to Embed XML Documentation i... | 20,693 | [
{
"from": "human",
"value": "I have an assembly containing very thorough XML-based documentation, which is used through Sandcastle to generate the help-files for the product. We also use the output XML files for providing proper Intellisense in Visual Studio when programmers use the assembly obviously.\nIn ... |
I know what Hungarian refers to - giving information about a variable, parameter, or type as a prefix to its name. Everyone seems to be rabidly against it, even though in some cases it seems to be a good idea. If I feel that useful information is being imparted, why shouldn't I put it right there where it's available?
... | Hungarian notation, which involves prefixing variable names with type or usage information, has sparked considerable debate among developers. Here are some points for and against its use, as well as some context to help you decide whether it's appropriate for your own projects:
### Pros of Hungarian Notation
1. **Imm... | 15,462 | [
{
"from": "human",
"value": "I know what Hungarian refers to - giving information about a variable, parameter, or type as a prefix to its name. Everyone seems to be rabidly against it, even though in some cases it seems to be a good idea. If I feel that useful information is being imparted, why shouldn't I ... |
I am bit confused about ADO.Net Data Services.
Is it just meant for creating RESTful web services? I know WCF started in the SOAP world but now I hear it has good support for REST. Same goes for ADO.Net data services where you can make it work in an RPC model if you cannot look at everything from a resource oriented vi... | You're correct in observing that ADO.NET Data Services (now commonly referred to as WCF Data Services) and WCF have evolved over time and that the lines between RESTful and SOAP-based services have become somewhat blurred.
### Understanding ADO.NET Data Services/WCF Data Services
1. **Purpose**: ADO.NET Data Services... | 6,796 | [
{
"from": "human",
"value": "I am bit confused about ADO.Net Data Services.\nIs it just meant for creating RESTful web services? I know WCF started in the SOAP world but now I hear it has good support for REST. Same goes for ADO.Net data services where you can make it work in an RPC model if you cannot look... |
I recently heard of BDD and found it very similar to TDD.
Which of these two do you use (if any)?
and which are the pros and cons of each?
| Behavior Driven Development (BDD) and Test Driven Development (TDD) are both software development methodologies that focus on improving the quality and reliability of software through testing, but they approach the concept of testing from different perspectives. Here’s a comparison of both, along with their pros and co... | 12,751 | [
{
"from": "human",
"value": "I recently heard of BDD and found it very similar to TDD.\nWhich of these two do you use (if any)?\nand which are the pros and cons of each?\n"
},
{
"from": "gpt",
"value": "Behavior Driven Development (BDD) and Test Driven Development (TDD) are both software develop... |
When we are developing new sites or testing changes in new ones that involve css after the new code is committed and someone goes to check the changes they always see a cached version of the old css. This is causing a lot of problems in testing because people never are sure if they have the latest css on screen (I know... | Dealing with CSS caching can indeed be a significant challenge during development and testing. Here are some strategies you can implement to minimize or eliminate the issues caused by cached stylesheets:
1. **Cache Busting**:
- **Versioning the CSS file**: Append a version number or a query string to the CSS file i... | 19,510 | [
{
"from": "human",
"value": "When we are developing new sites or testing changes in new ones that involve css after the new code is committed and someone goes to check the changes they always see a cached version of the old css. This is causing a lot of problems in testing because people never are sure if t... |
Is there any way to verify in Java code that an e-mail address is valid. By valid, I don't just mean that it's in the correct format (someone@domain.subdomain), but that's it's a real active e-mail address.
I'm almost certain that there's no 100% reliable way to do this, because such a technique would be the stuff of s... | You're correct that verifying an email address is a complex task, and there isn't a foolproof way to determine if an email address is "real" or "active." However, you can implement a few techniques to get a better indication of whether an email address is potentially valid and active:
1. **Regular Expression Validatio... | 18,154 | [
{
"from": "human",
"value": "Is there any way to verify in Java code that an e-mail address is valid. By valid, I don't just mean that it's in the correct format (someone@domain.subdomain), but that's it's a real active e-mail address.\nI'm almost certain that there's no 100% reliable way to do this, becaus... |
I read in this article that a company has created a software capable of using multiple GPU-based video cards in parallel to process hundreds of billions fixed-point calculations per second.
The program seems to run in Windows. Is it possible from Windows to assign a thread to a GPU? Do they create their own driver and... | Yes, it is indeed possible to utilize multiple GPU-based video cards in parallel from a Windows environment to perform high-performance computing tasks, including managing multiple threads and assigning workloads to different GPUs. Here’s a general overview of how this is achieved:
### 1. Utilizing APIs:
Most high-per... | 18,469 | [
{
"from": "human",
"value": "I read in this article that a company has created a software capable of using multiple GPU-based video cards in parallel to process hundreds of billions fixed-point calculations per second.\nThe program seems to run in Windows. Is it possible from Windows to assign a thread to ... |
Structs seem like a useful way to parse a binary blob of data (ie a file or network packet). This is fine and dandy until you have variable size arrays in the blob. For instance:
struct nodeheader{
int flags;
int data_size;
char data[];
};
This allows me to find the last data character:
nodeh... | When working with variable-length arrays in C or C++, there are a few common patterns that can help manage the memory layout while allowing for flexible sizes. Unfortunately, C/C++ do not support multiple flexible array members in the way that you're trying to define them directly within a single struct.
Instead, you... | 18,203 | [
{
"from": "human",
"value": "Structs seem like a useful way to parse a binary blob of data (ie a file or network packet). This is fine and dandy until you have variable size arrays in the blob. For instance:\nstruct nodeheader{\n int flags;\n int data_size;\n char data[];\n};\n\nThis ... |
I have created a brand new project in XCode and have the following in my AppDelegate.py file:
from Foundation import *
from AppKit import *
class MyApplicationAppDelegate(NSObject):
def applicationDidFinishLaunching_(self, sender):
NSLog("Application did finish launching.")
statusItem = NSStatusBa... | It looks like you're trying to create a macOS application using PyObjC, and you want to display a status bar item. However, there are a couple of things to check to ensure that your status bar item appears correctly.
Here are a few troubleshooting tips and code adjustments you can consider:
1. **Check Application Inf... | 18,798 | [
{
"from": "human",
"value": "I have created a brand new project in XCode and have the following in my AppDelegate.py file:\nfrom Foundation import *\nfrom AppKit import *\n\nclass MyApplicationAppDelegate(NSObject):\n def applicationDidFinishLaunching_(self, sender):\n NSLog(\"Application did fini... |
When i deploy a rails application in production mode, it appends a date-time string as a query param to the end of all the static asset urls. This is to prevent browsers using old-out of date cahed copies of the assets after I redeploy the application.
Is there a way to make rails use the old time stamps for the asset... | In a typical Rails application, when you deploy in production mode, it uses a fingerprinting mechanism (such as the digest) to cache assets. This appends a unique hash based on the file contents to the filenames of the assets, which prevents browsers from caching old copies of updated files. However, there can be a con... | 16,193 | [
{
"from": "human",
"value": "When i deploy a rails application in production mode, it appends a date-time string as a query param to the end of all the static asset urls. This is to prevent browsers using old-out of date cahed copies of the assets after I redeploy the application. \nIs there a way to make r... |
I know the standard answer is No. However hear out the reasons for wanting it, and then we'll go for whether it is possible to achieve the same effect as ReadyBoost via either enabling (and installing) ReadyBoost or using third party software.
Reasons for using Widows Server 2008 as a development environment on a lapto... | While Windows Server 2008 does not support ReadyBoost natively, you can use third-party software solutions to achieve similar functionality. Here’s a step-by-step process outlining how to use a tool called **eBoostr**, which is known for enabling ReadyBoost-like caching capabilities on Windows systems that do not suppo... | 12,613 | [
{
"from": "human",
"value": "I know the standard answer is No. However hear out the reasons for wanting it, and then we'll go for whether it is possible to achieve the same effect as ReadyBoost via either enabling (and installing) ReadyBoost or using third party software.\nReasons for using Widows Server 20... |
It seems that most of the installers for Perl are centered around installing Perl modules, not applications. Things like ExtUtils::MakeMaker and Module::Build are very well suited for modules, but require some additional work for Web Apps.
Ideally it would be nice to be able to do the following after checking out the ... | Creating a generalized installer for Perl web applications that accommodates your requirements is a great idea. While you can customize solutions using Module::Build or ExtUtils::MakeMaker, there are existing tools and strategies that can facilitate a more streamlined approach. Below are some recommendations and method... | 11,710 | [
{
"from": "human",
"value": "It seems that most of the installers for Perl are centered around installing Perl modules, not applications. Things like ExtUtils::MakeMaker and Module::Build are very well suited for modules, but require some additional work for Web Apps.\nIdeally it would be nice to be able t... |
I need to copy several tables from one DB to another in SQL Server 2000, using C# (VS 2005). The call needs to be parameterized - I need to be able to pass in the name of the database to which I am going to be copying these tables.
I could use DTS with parameters, but I can't find any sample code that does this from C... | You can achieve copying tables from one database to another in SQL Server 2000 using C#. While SQL Server 2000 does not have many of the modern features available in later versions, you can still accomplish your goal using ADO.NET with parameterized queries. Below is an example of how you can use C# to copy tables from... | 15,734 | [
{
"from": "human",
"value": "I need to copy several tables from one DB to another in SQL Server 2000, using C# (VS 2005). The call needs to be parameterized - I need to be able to pass in the name of the database to which I am going to be copying these tables.\nI could use DTS with parameters, but I can't ... |
Is there a way to get a detailed failure information from QObjet::connect in case of its failure?
Returned boolean value doesn't give any information about reason of failure.
I wish exception were so widely used in C++ as they are in Java.
| In Qt, the `QObject::connect` method returns a boolean value to indicate whether the connection was successful, but it does not provide detailed failure information. This behavior can indeed be frustrating, especially when debugging complex applications.
When a connection fails in Qt, it typically happens for one of t... | 16,960 | [
{
"from": "human",
"value": "Is there a way to get a detailed failure information from QObjet::connect in case of its failure?\nReturned boolean value doesn't give any information about reason of failure.\nI wish exception were so widely used in C++ as they are in Java.\n"
},
{
"from": "gpt",
"v... |
I am converting an excel sheet formula to java but I can't understand how excel manages to take the following: 0.22
Applies a formula: =TEXT(R5/14, "h:mm")
and somehow arrives at: 0.22
Again if I provide: 2.8
it arrives at 4.48
Can someone please explain to me how it does this. I have read a little regarding decimal an... | In Excel, the formula `=TEXT(R5/14, "h:mm")` formats a numeric value into a time format. To understand how Excel produces outputs like `0.22` and `4.48` from the inputs you've provided (`0.22` and `2.8`), let's break down what happens in the formula.
### Understanding the Formula
1. **Input Value**:
- When you en... | 18,457 | [
{
"from": "human",
"value": "I am converting an excel sheet formula to java but I can't understand how excel manages to take the following: 0.22\nApplies a formula: =TEXT(R5/14, \"h:mm\")\nand somehow arrives at: 0.22\nAgain if I provide: 2.8\nit arrives at 4.48\nCan someone please explain to me how it does... |
My component is handed a long value that I later use as a key into a cache. The key itself is a string representation of the long value as if it were unsigned 64-bit value. That is, when my component is handed -2944827264075010823L, I need to convert that into the string key "15501916809634540793".
I have a solution, b... | Certainly! There is indeed a more straightforward way to convert a signed `long` value to its corresponding unsigned string representation as a 64-bit number without manually manipulating the hexadecimal representation. Here's a cleaner and more elegant solution using `BigInteger` directly:
### Suggested Solution
You... | 21,969 | [
{
"from": "human",
"value": "My component is handed a long value that I later use as a key into a cache. The key itself is a string representation of the long value as if it were unsigned 64-bit value. That is, when my component is handed -2944827264075010823L, I need to convert that into the string key \"1... |
We are using c++ to develop an application that runs in Windows CE 4 on an embedded system.
One of our constraint is that all the memory used by the application shall be allocated during startup only. We wrote a lot of containers and algorithms that are using only preallocated memory instead of allocating new one.
Do y... | Using Boost libraries in a memory-constrained environment like Windows CE 4 with strict allocation requirements can be challenging, but it's not impossible. Here are some considerations and advice for using Boost libraries while adhering to your memory allocation constraints:
### 1. Memory Allocation in Boost:
Many Bo... | 19,905 | [
{
"from": "human",
"value": "We are using c++ to develop an application that runs in Windows CE 4 on an embedded system.\nOne of our constraint is that all the memory used by the application shall be allocated during startup only. We wrote a lot of containers and algorithms that are using only preallocated ... |
I am currently working on a rather large multi tiered app that will be deployed overseas. Although I hope it won't fall over or blow up once depolyed I can't be 100% sure of this. Therefore it would be nice to know that I could request the log file, to work out exactly what went wrong and why.
So basically as the tit... | Logging is a crucial aspect of application development and maintenance, especially for large, multi-tiered applications that may be deployed in diverse environments. A comprehensive logging strategy will help you diagnose issues, understand user behavior, and improve application performance. Here are key considerations... | 18,161 | [
{
"from": "human",
"value": "I am currently working on a rather large multi tiered app that will be deployed overseas. Although I hope it won't fall over or blow up once depolyed I can't be 100% sure of this. Therefore it would be nice to know that I could request the log file, to work out exactly what we... |
I'm trying to upgrade my subversion server (I have it hosted with Dreamhost)
This is what I run:
wget http://subversion.tigris.org/downloads/subversion-1.5.2.tar.bz2
wget http://subversion.tigris.org/downloads/subversion-deps-1.5.2.tar.bz2
tar -xjf subversion-1.5.2.tar.bz2
tar -xjf subversion-deps-1.5.2.tar.bz2
cd sub... | It seems you're running into an issue with the `configure` script when trying to compile Subversion from source on your Dreamhost server. The specific error message `C compiler cannot create executables` often indicates a problem with the environment setup, such as missing dependencies, insufficient permissions, or inc... | 17,048 | [
{
"from": "human",
"value": "I'm trying to upgrade my subversion server (I have it hosted with Dreamhost)\nThis is what I run:\n\nwget http://subversion.tigris.org/downloads/subversion-1.5.2.tar.bz2\nwget http://subversion.tigris.org/downloads/subversion-deps-1.5.2.tar.bz2\ntar -xjf subversion-1.5.2.tar.bz2... |
What needs to be done to have your .NET application show up in Window's system tray as icon?
And how do you handle mousebutton clicks on said icon?
| To make a .NET application show up in the Windows system tray (also known as the notification area) with an icon, you can use the `NotifyIcon` class provided by the `System.Windows.Forms` namespace. Below are the steps to implement this in a Windows Forms application, along with how to handle mouse button clicks on the... | 14,176 | [
{
"from": "human",
"value": "What needs to be done to have your .NET application show up in Window's system tray as icon?\nAnd how do you handle mousebutton clicks on said icon?\n"
},
{
"from": "gpt",
"value": "To make a .NET application show up in the Windows system tray (also known as the noti... |
I am using the jQuery AutoComplete plugin in an html page where I also have an accordion menu which uses prototype.
They both work perfectly separately but when I tried to implement both components in a single page I get an error that I have not been able to understand.
uncaught exception: [Exception... "Component ret... | It sounds like you're encountering a conflict between jQuery and Prototype, especially since they both manipulate the DOM and could potentially overwrite each other's functionality. Here are a few suggestions you can try to resolve the issue:
### 1. Use jQuery.noConflict()
Since you're using both jQuery and Prototype... | 18,094 | [
{
"from": "human",
"value": "I am using the jQuery AutoComplete plugin in an html page where I also have an accordion menu which uses prototype.\nThey both work perfectly separately but when I tried to implement both components in a single page I get an error that I have not been able to understand.\n\nunca... |
I know that some people swear against using a language-specific IDE ever (vim/emacs or die! type stuff) and that some people are really uncomfortable with coding/compiling in the terminal at all, so my question has the following parts.
When do you switch from one to the other
Is it even necessary to know both? If not... | Your question about the use of IDEs vs. text editors like Vim or Emacs touches on some essential aspects of software development. Let’s break down your queries into parts.
### When to Switch from One to the Other
- **Context and Project Size**: For small projects, prototyping, or scripting tasks, a lightweight text ed... | 19,722 | [
{
"from": "human",
"value": "I know that some people swear against using a language-specific IDE ever (vim/emacs or die! type stuff) and that some people are really uncomfortable with coding/compiling in the terminal at all, so my question has the following parts.\n\nWhen do you switch from one to the other... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.