instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I know there have been a few threads on this before, but I have tried absolutely everything suggested (that I could find) and nothing has worked for me thus far...
With that in mind, here is what I'm trying to do:
First, I want to allow users to publish pages and give them each a subdomain of their choice (ex: user.exa... | To accomplish your goal of allowing users to publish pages on their own subdomains (e.g., user.example.com) and have those subdomains redirect to a specific path on your main site (e.g., example.com/user), you can use a combination of wildcard DNS settings and URL rewriting with `.htaccess`.
### Step 1: Set Up Wildca... | 9,217 | [
{
"from": "human",
"value": "I know there have been a few threads on this before, but I have tried absolutely everything suggested (that I could find) and nothing has worked for me thus far...\nWith that in mind, here is what I'm trying to do:\nFirst, I want to allow users to publish pages and give them eac... |
Im trying to find out a good JavaScript library that can create a nice "inner-window" popup within a page on my site.
I would like to not have to worry about screen positioning (i.e. dont have to calcuate if the size of the window will be off screen, etc...), but just make a new pop-up that has content in it.
I'll be u... | For your requirement of creating an "inner-window" popup using a floating div style approach in a .NET ASP.NET environment, there are several JavaScript libraries that can help you achieve this easily. Below are some popular options that you can consider:
### 1. **jQuery UI Dialog**
jQuery UI provides a dialog widget ... | 22,327 | [
{
"from": "human",
"value": "Im trying to find out a good JavaScript library that can create a nice \"inner-window\" popup within a page on my site.\nI would like to not have to worry about screen positioning (i.e. dont have to calcuate if the size of the window will be off screen, etc...), but just make a ... |
I'm trying to use Scrubyt to get the details from this page http://www.nuffieldtheatre.co.uk/cn/events/event_listings.php?section=events. I've managed to get the titles and detail URLs from the list, but I can't use next_page to get the scraper to go to the next page. I assume that's cause I'm not using the correct pat... | To navigate to the next page using Scrubyt, you need to correctly define the `next_page` link based on how it is structured in the HTML of the target page. The issue might be that the string "Next Page" is not properly identifying the link, or the link itself might be a button or an anchor tag with a different text or ... | 24,176 | [
{
"from": "human",
"value": "I'm trying to use Scrubyt to get the details from this page http://www.nuffieldtheatre.co.uk/cn/events/event_listings.php?section=events. I've managed to get the titles and detail URLs from the list, but I can't use next_page to get the scraper to go to the next page. I assume t... |
Is there an efficient way of detecting if a jpeg file is corrupted?
Background info:
solutions needs to work from within a php script
the jpeg files are on disk
manual checking is no option (user uploaded data)
I know that imagecreatefromjpeg(string $filename); can do it. But it is quite slow at doing so.
Doe... | Detecting corrupted JPEG files in an efficient way can indeed be challenging, especially when working within a PHP environment. While `imagecreatefromjpeg()` is a commonly used function for this purpose, it can be slow, especially for large files. Here are some alternative approaches you can consider to improve the per... | 21,303 | [
{
"from": "human",
"value": "Is there an efficient way of detecting if a jpeg file is corrupted? \nBackground info:\n solutions needs to work from within a php script\n the jpeg files are on disk\n manual checking is no option (user uploaded data) \nI know that imagecreatefromjpeg(string $filename); ca... |
In my code, I am creating a collection of objects which will be accessed by various threads in a fashion that is only safe if the objects are immutable. When an attempt is made to insert a new object into my collection, I want to test to see if it is immutable (if not, I'll throw an exception).
One thing I can do is to... | Detecting whether a class is truly immutable can be quite complex and cannot be guaranteed with absolute certainty due to the dynamic nature of Java and the possibility of custom implementations. However, there are some heuristics you can use in conjunction with reflection to improve your check for immutability.
Here'... | 19,963 | [
{
"from": "human",
"value": "In my code, I am creating a collection of objects which will be accessed by various threads in a fashion that is only safe if the objects are immutable. When an attempt is made to insert a new object into my collection, I want to test to see if it is immutable (if not, I'll thro... |
I would like to append a path to the PATH environment variable in a Visual Studio 2005 deployment project. How does one do this?
| To append a path to the PATH environment variable in a Visual Studio 2005 deployment project, you need to follow these steps:
1. **Open your Deployment Project**: Start Visual Studio 2005 and open your deployment project.
2. **Add a Custom Action**: You need to add a custom action that modifies the PATH variable. Thi... | 22,712 | [
{
"from": "human",
"value": "I would like to append a path to the PATH environment variable in a Visual Studio 2005 deployment project. How does one do this?\n"
},
{
"from": "gpt",
"value": "To append a path to the PATH environment variable in a Visual Studio 2005 deployment project, you need t... |
So I understand what a static method or field is, I am just wondering when to use them. That is, when writing code what design lends itself to using static methods and fields.
One common pattern is to use static methods as a static factory, but this could just as easily be done by overloading a constructor. Correct? F... | You're correct in your observations about static methods and fields, and you've highlighted some common use cases. Let's delve deeper into when and how to effectively use static members in your code.
### When to Use Static Methods
1. **Utility Functions**:
- Static methods are often used for utility or helper func... | 19,161 | [
{
"from": "human",
"value": "So I understand what a static method or field is, I am just wondering when to use them. That is, when writing code what design lends itself to using static methods and fields. \nOne common pattern is to use static methods as a static factory, but this could just as easily be don... |
I sometimes get the following exception for a custom control of mine:
XamlParseException occurred Unknown attribute Points in element SectionClickableArea [Line: 10 Position 16]
The stack trace:
{System.Windows.Markup.XamlParseException: Unknown attribute Points on element SectionClickableArea. [Line: 10 Position: 16]
... | The issues you're facing with your custom control, `SectionClickableArea`, seem to stem from a couple of potential problems that are common when working with custom controls and XAML in WPF. Let's break down the exceptions and explore some solutions.
### Exception 1: XamlParseException - Unknown attribute Points
The ... | 22,867 | [
{
"from": "human",
"value": "I sometimes get the following exception for a custom control of mine:\nXamlParseException occurred Unknown attribute Points in element SectionClickableArea [Line: 10 Position 16]\nThe stack trace:\n{System.Windows.Markup.XamlParseException: Unknown attribute Points on element Se... |
When I use the default model binding to bind form parameters to a complex object which is a parameter to an action, the framework remembers the values passed to the first request, meaning that any subsequent request to that action gets the same data as the first. The parameter values and validation state are persisted ... | The issue you're encountering with ASP.NET MVC's default model binding and the persistence of `ModelState` can indeed be confusing. When you submit a form that binds to a complex object, the `ModelState` object contains validation information that persists between requests. This is usually not what you want when the us... | 24,273 | [
{
"from": "human",
"value": "When I use the default model binding to bind form parameters to a complex object which is a parameter to an action, the framework remembers the values passed to the first request, meaning that any subsequent request to that action gets the same data as the first. The parameter v... |
Is it possible to get the machine name, or IP, or MAC address (basically client network information) from javascript running Internet Explorer?
I found the following code that seems to accomplish this:
function Button1_onclick() {
var locator = new ActiveXObject("WbemScripting.SWbemLocator");
var service = locator.... | The code you've provided does indeed use an ActiveX object to access system-level information, which is specific to Internet Explorer and Windows environments. It uses WMI (Windows Management Instrumentation) to retrieve network configuration details. ActiveX objects can only be created and run in Internet Explorer and... | 24,749 | [
{
"from": "human",
"value": "Is it possible to get the machine name, or IP, or MAC address (basically client network information) from javascript running Internet Explorer?\nI found the following code that seems to accomplish this:\nfunction Button1_onclick() {\n var locator = new ActiveXObject(\"WbemScrip... |
What is the most reliable and secure way to determine what page either sent, or called (via AJAX), the current page. I don't want to use the $_SERVER['HTTP_REFERER'], because of the (lack of) reliability, and I need the page being called to only come from requests originating on my site.
Edit: I am looking to verify ... | To reliably determine which page or script has made a request to your server-side script, particularly when it comes to AJAX requests, you can implement a few strategies that don't rely on `$_SERVER['HTTP_REFERER']`, which can be easily spoofed and is not always reliable.
Here are a few approaches you could take:
###... | 23,909 | [
{
"from": "human",
"value": "What is the most reliable and secure way to determine what page either sent, or called (via AJAX), the current page. I don't want to use the $_SERVER['HTTP_REFERER'], because of the (lack of) reliability, and I need the page being called to only come from requests originating ... |
This was something originally discussed during a presentation given by Charles Brian Quinn of the Big Nerd Ranch at acts_as_conference. He was discussing what he had learned from instructing a Ruby on Rails Bootcamp to many people both new to programming and new to Rails.
One particular slide that stood out was along ... | The use of "foo" and "bar" as placeholder names in programming examples is a long-standing tradition that many developers have grown accustomed to. However, the concerns raised by Charles Brian Quinn highlight important points about pedagogy and effective communication in programming.
### Why "Foo" and "Bar"?
1. **Co... | 23,663 | [
{
"from": "human",
"value": "This was something originally discussed during a presentation given by Charles Brian Quinn of the Big Nerd Ranch at acts_as_conference. He was discussing what he had learned from instructing a Ruby on Rails Bootcamp to many people both new to programming and new to Rails.\nOne ... |
Using an idea from Bob King idea I wrote the following method.
It works great on CD's, removable drives, regular drives.
However for a floppy it always return "Not Available". Any ideas?
public static void TestFloppy( char driveLetter ) {
using( var searcher = new ManagementObjectSearcher( @"SELECT * FROM Win32_Lo... | The issue you're experiencing with the floppy disk returning "Not Available" for the `FreeSpace` property could be due to how floppy disks are handled by the operating system and the ManagementObject model. Floppy disks may not support the `FreeSpace` property in the same way that other storage media do.
Here are a fe... | 22,143 | [
{
"from": "human",
"value": "Using an idea from Bob King idea I wrote the following method.\nIt works great on CD's, removable drives, regular drives.\nHowever for a floppy it always return \"Not Available\". Any ideas?\npublic static void TestFloppy( char driveLetter ) {\n using( var searcher = new Mana... |
I'm debating the best way to propagate fairly complex permissions from the server to an AJAX application, and I'm not sure the best approach to take.
Essentially, I want my permissions to be defined so I can request a whole set of permissions in one shot, and adjust the UI as appropriate (the UI changes can be as low l... | Propagating and managing permissions effectively between the server and an AJAX application is a common challenge. Here are some strategies to consider for maintaining permissions, enforcing them server-side, and providing easy access in JavaScript without excessive round trips:
### 1. Define a Permissions Model
Firs... | 25,497 | [
{
"from": "human",
"value": "I'm debating the best way to propagate fairly complex permissions from the server to an AJAX application, and I'm not sure the best approach to take.\nEssentially, I want my permissions to be defined so I can request a whole set of permissions in one shot, and adjust the UI as a... |
I have this view set:
glMatrixMode(GL_MODELVIEW); //Switch to the drawing perspective
glLoadIdentity(); //Reset the drawing perspective
and I get a screen position (sx, sy) from a mouse click.
Given a value of z, how can I calculate x and y in 3d-space from sx and sy?
| To convert screen coordinates `(sx, sy)` to 3D coordinates `(x, y, z)` in OpenGL, you need to perform a series of steps involving the projection matrix and viewport transformation. This process generally involves using the inverse of the projection matrix and the modelview matrix that were used to render the scene. Her... | 16,311 | [
{
"from": "human",
"value": "I have this view set:\nglMatrixMode(GL_MODELVIEW); //Switch to the drawing perspective\nglLoadIdentity(); //Reset the drawing perspective\n\nand I get a screen position (sx, sy) from a mouse click.\nGiven a value of z, how can I calculate x and y in 3d-space from sx and sy?\n"
... |
According to the MSDN, the BaseDirectory is where an AppDomain will look for DLLs to load, while ExecutablePath will provide the path to the original executable file (including file name). I know that one has the file name and the other does not. I know that if I create a new AppDomain I can give it a different path.... | In general, for a single AppDomain in a .NET application, the `BaseDirectory` and `ExecutablePath` are often the same in many scenarios, especially when the application is running from its installed location. However, there are some nuances and potential scenarios where they can differ:
1. **Definition**:
- **BaseD... | 22,974 | [
{
"from": "human",
"value": "According to the MSDN, the BaseDirectory is where an AppDomain will look for DLLs to load, while ExecutablePath will provide the path to the original executable file (including file name). I know that one has the file name and the other does not. I know that if I create a new ... |
I have the following C# which simply replaces parts of the input string that look like EQUIP:19d005 into URLs, like this:
input = Regex.Replace(input, @"(EQUIP:)(\S+)", @"<a title=""View equipment item $2"" href=""/EquipmentDisplay.asp?eqnum=$2"">$1$2</a>", RegexOptions.IgnoreCase);
The HTML ends up looking like this.... | Yes, you can achieve this by modifying the C# code to apply an uppercase transformation to the matched value when building the replacement string in the `Regex.Replace` method. To do this, you can use a MatchEvaluator delegate which allows for more complex logic in the replacement process, including transforming the ma... | 24,613 | [
{
"from": "human",
"value": "I have the following C# which simply replaces parts of the input string that look like EQUIP:19d005 into URLs, like this:\ninput = Regex.Replace(input, @\"(EQUIP:)(\\S+)\", @\"<a title=\"\"View equipment item $2\"\" href=\"\"/EquipmentDisplay.asp?eqnum=$2\"\">$1$2</a>\", RegexOp... |
how can you dynamically add items to a combobox using the datagridview virtual mode?
| To dynamically add items to a ComboBox within a DataGridView in virtual mode, you can follow these steps:
### Step-by-step Guide:
1. **Set Up DataGridView in Virtual Mode**: You need to enable virtual mode for your DataGridView and handle its events to manage the display of items.
2. **Create a Data Source**: Define... | 14,683 | [
{
"from": "human",
"value": "how can you dynamically add items to a combobox using the datagridview virtual mode?\n"
},
{
"from": "gpt",
"value": "To dynamically add items to a ComboBox within a DataGridView in virtual mode, you can follow these steps:\n\n### Step-by-step Guide:\n\n1. **Set Up D... |
I went to all the documentation, also I went to the IRC channel (BTW a great community) and they told me that is not possible to create a model and limit choices in a field where the 'current user' is in a ForeignKey.
I will try to explain this with an example:
class Project(models.Model):
name = models.CharField(max... | You're right that the challenge you're facing is related to the limitations of Django's `limit_choices_to` when defining the `ForeignKey` field on the model. The `limit_choices_to` argument is evaluated when the model is defined, which means it can't take a dynamic value like `request.user` directly.
However, you can ... | 21,021 | [
{
"from": "human",
"value": "I went to all the documentation, also I went to the IRC channel (BTW a great community) and they told me that is not possible to create a model and limit choices in a field where the 'current user' is in a ForeignKey.\nI will try to explain this with an example:\nclass Project(m... |
I need to figure out a way uniquely identify each computer which visits the web site I am creating. Does anybody have any advice on how to achieve this?
Because i want the solution to work on all machines and all browsers (within reason) I am trying to create a solution using javascript.
Cookies will not do.
I need the... | Creating a unique identifier for a computer that visits your website is a challenging task, especially since you want it to be repeatable and work across different browsers and devices. Using JavaScript for this purpose has its limitations due to security and privacy concerns. Here are some points to consider:
### 1. ... | 21,649 | [
{
"from": "human",
"value": "I need to figure out a way uniquely identify each computer which visits the web site I am creating. Does anybody have any advice on how to achieve this?\nBecause i want the solution to work on all machines and all browsers (within reason) I am trying to create a solution using j... |
I'm trying to write a web application using SpringMVC. Normally I'd just map some made-up file extension to Spring's front controller and live happily, but this time I'm going for REST-like URLs, with no file-name extensions.
Mapping everything under my context path to the front controller (let's call it "app") means ... | The behavior you are experiencing has to do with how servlet mappings and URL patterns work in a web application. Let's examine the setups you've provided and discuss why they behave differently:
### Successful Setup:
```xml
<servlet-mapping>
<servlet-name>app</servlet-name>
<url-pattern>/</url-pattern>
</servlet-... | 23,487 | [
{
"from": "human",
"value": "\nI'm trying to write a web application using SpringMVC. Normally I'd just map some made-up file extension to Spring's front controller and live happily, but this time I'm going for REST-like URLs, with no file-name extensions.\nMapping everything under my context path to the fr... |
I'm building an application that is used by several different customers. Each customer has a fair amount of custom business logic, which I have cleverly refactored out into an assembly that gets loaded at runtime. The name of that assembly, along with a number of other customer-specific settings, are stored in the ap... | It sounds like you're facing a cumbersome workflow for switching between different customer configurations in your application. There are definitely more streamlined approaches you could take to manage your configuration files and facilitate debugging without the extensive manual renaming and resetting of settings. Her... | 25,198 | [
{
"from": "human",
"value": "I'm building an application that is used by several different customers. Each customer has a fair amount of custom business logic, which I have cleverly refactored out into an assembly that gets loaded at runtime. The name of that assembly, along with a number of other custome... |
What is the difference between Obfuscation, Hashing, and Encryption?
Here is my understanding:
Hashing is a one-way algorithm; cannot be reversed
Obfuscation is similar to encryption but doesn't require any "secret" to understand (ROT13 is one example)
Encryption is reversible but a "secret" is required to do so... | Your understanding is quite good, and you've captured the essential differences between hashing, obfuscation, and encryption. Here's a more detailed explanation of each concept:
### Hashing
- **Definition**: Hashing is the process of transforming input data of any size into a fixed-size string of characters, which typ... | 23,587 | [
{
"from": "human",
"value": "What is the difference between Obfuscation, Hashing, and Encryption?\nHere is my understanding: \n\nHashing is a one-way algorithm; cannot be reversed \nObfuscation is similar to encryption but doesn't require any \"secret\" to understand (ROT13 is one example) \nEncryption i... |
Can pipes be used across LAN computers?
In particular I'm looking for Windows, but if you have more info on other platforms, that will also help others who find this thread later.
| Yes, pipes can be used across LAN computers, but the implementation and methods to achieve this vary between operating systems. Below, I'll provide an overview of how named pipes work in Windows and some other options for interprocess communication (IPC) in different environments.
### Windows
In Windows, named pipes ... | 23,348 | [
{
"from": "human",
"value": "Can pipes be used across LAN computers?\nIn particular I'm looking for Windows, but if you have more info on other platforms, that will also help others who find this thread later. \n"
},
{
"from": "gpt",
"value": "Yes, pipes can be used across LAN computers, but the... |
Let's say I have many-to-many relationship (using the ActiveRecord attribute HasAndBelongsToMany) between Posts and Tags (domain object names changed to protect the innocent), and I wanted a method like FindAllPostByTags(IList<Tag> tags) that returns all Posts that have all (not just some of) the Tags in the parameter.... | To retrieve all `Post` entities that have all the specified `Tag` entities using HQL in NHibernate, you can leverage the `JOIN` clause along with a `GROUP BY` and `HAVING` clause to filter the posts that meet your criteria.
Here’s a basic example of how you might structure this in HQL:
```hql
SELECT p
FROM Post p
JOI... | 23,175 | [
{
"from": "human",
"value": "Let's say I have many-to-many relationship (using the ActiveRecord attribute HasAndBelongsToMany) between Posts and Tags (domain object names changed to protect the innocent), and I wanted a method like FindAllPostByTags(IList<Tag> tags) that returns all Posts that have all (not... |
I'm writing a small application in VB.NET and I would like some of the classes to be able to write themselves out to XML to serve as a "save" feature. I have seen XSD files used to generate VB classes that can serialize themselves into and out of XML very easily. How would I do this if I do have any pre-existing XML ... | To create classes in VB.NET that can serialize themselves to XML (and deserialize from XML) while conforming to an existing XML format, you can make use of the built-in XML serialization capabilities in .NET. You have two main approaches for this: using attributes to decorate your classes and properties, or using an `X... | 22,955 | [
{
"from": "human",
"value": "I'm writing a small application in VB.NET and I would like some of the classes to be able to write themselves out to XML to serve as a \"save\" feature. I have seen XSD files used to generate VB classes that can serialize themselves into and out of XML very easily. How would I... |
I'd like to know which method is recommended on Windows C programming: using malloc or the Win32 HeapAlloc (maybe VirtualAlloc?) function.
I've read the MSDN Memory Management Functions article and the MSDN articles regarding malloc and HeapAlloc, but they do not say which one should be used and in what situations.
| When deciding between using `malloc` (part of the C standard library) and the Windows-specific functions like `HeapAlloc` or `VirtualAlloc`, the choice largely depends on your application's requirements and the level of control you need over memory management. Here's a breakdown of when to use each:
### `malloc`
**Re... | 24,764 | [
{
"from": "human",
"value": "I'd like to know which method is recommended on Windows C programming: using malloc or the Win32 HeapAlloc (maybe VirtualAlloc?) function.\nI've read the MSDN Memory Management Functions article and the MSDN articles regarding malloc and HeapAlloc, but they do not say which one ... |
What is the most elegant way to solve this:
open a file for reading, but only if it is not already opened for writing
open a file for writing, but only if it is not already opened for reading or writing
The built-in functions work like this
>>> path = r"c:\scr.txt"
>>> file1 = open(path, "w")
>>> print file1
<open fi... | To solve the problem of managing file access in Python where you want to ensure that you do not open a file for reading if it is already opened for writing (and vice versa), we can use a file locking mechanism. Here, I'll provide a solution that uses the `fcntl` module available in Unix-like systems for file locking. F... | 19,779 | [
{
"from": "human",
"value": "What is the most elegant way to solve this:\n\nopen a file for reading, but only if it is not already opened for writing\nopen a file for writing, but only if it is not already opened for reading or writing\n\nThe built-in functions work like this\n>>> path = r\"c:\\scr.txt\"\n>... |
Ok so ive got a swing app going using the "System" look and feel. Now, I want to change the background colour of the main panels to black. Too easy right?
UIManager.put("Panel.background", Color.BLACK);
Well yeah, except now the controls in the app look stupid, because their 'shadows', for want of a better word, are g... | Changing the look and feel of a Swing application can sometimes lead to unintended visual consequences, as you've experienced with the gradients and shadows of controls. When you change the background color of the panels, it can clash with the default settings for various UI components.
To address this issue without c... | 24,337 | [
{
"from": "human",
"value": "Ok so ive got a swing app going using the \"System\" look and feel. Now, I want to change the background colour of the main panels to black. Too easy right?\nUIManager.put(\"Panel.background\", Color.BLACK);\n\nWell yeah, except now the controls in the app look stupid, because t... |
We are working on a website for a client that (for once) is expected to get a fair amount of traffic on day one. There are press releases, people are blogging about it, etc. I am a little concerned that we're going to fall flat on our face on day one. What are the main things you would look at to ensure (in advance wit... | Launching a website that’s expected to handle significant traffic can be nerve-wracking, but with the right preparations, you can increase your chances of a smooth launch. Here are key areas to focus on given your LAMP/PHP stack and current setup:
### 1. **Infrastructure and Server Optimization**
- **Load Testing**: C... | 22,588 | [
{
"from": "human",
"value": "We are working on a website for a client that (for once) is expected to get a fair amount of traffic on day one. There are press releases, people are blogging about it, etc. I am a little concerned that we're going to fall flat on our face on day one. What are the main things yo... |
Although my question might seem abstract I hope it's not. Suppose I develop an application, an ASP.NET MVC site and later I am tasked to build an Winforms client for this application how much and how can I reuse from the existing application?
I defined the models, I defined controllers and views. They all work well.
No... | Certainly! Reusing components of your ASP.NET MVC application when developing a WinForms client is a great approach. Here's how you can achieve that, focusing on reusing the models and controllers, while maintaining a clear architecture.
### Key Steps to Reuse Code
1. **Separate Projects and Assemblies**:
- **Crea... | 18,241 | [
{
"from": "human",
"value": "Although my question might seem abstract I hope it's not. Suppose I develop an application, an ASP.NET MVC site and later I am tasked to build an Winforms client for this application how much and how can I reuse from the existing application?\nI defined the models, I defined con... |
I have an application that works great on my development workstation but fails when the application is deployed to the live environment. It seems that Application_Start is not being called in the live environment.
| When `Application_Start` in your ASP.NET application is not being called in the live environment, there could be several reasons for this behavior. Here are some common troubleshooting steps you can follow to identify and resolve the issue:
### 1. **Check IIS Configuration:**
- Ensure that the application pool is s... | 22,632 | [
{
"from": "human",
"value": "I have an application that works great on my development workstation but fails when the application is deployed to the live environment. It seems that Application_Start is not being called in the live environment.\n"
},
{
"from": "gpt",
"value": "When `Application_S... |
I have the following code fragment that starts a Google Earth process using a hardcoded path:
var process =
new Process
{
StartInfo =
{
//TODO: Get location of google earth executable from registry
FileName = @"C:\Program Files\Google\Googl... | To programmatically retrieve the installation path of Google Earth from the Windows registry, you can utilize the `Microsoft.Win32` namespace in C#. Google Earth typically registers its installation path in the registry during installation. The exact path may vary based on the version installed, but it often follows a ... | 21,312 | [
{
"from": "human",
"value": "I have the following code fragment that starts a Google Earth process using a hardcoded path:\nvar process =\n new Process\n {\n StartInfo =\n {\n //TODO: Get location of google earth executable from registry\n ... |
I committed a bunch of files (dozens of files in different folders) by accident. What is the easiest, cleanest (and safest!) way to 'undo' that commit without having to delete the files from my working directory?
| If you've accidentally committed a bunch of files in Git and you want to undo that commit without deleting the files from your working directory, you can use the `git reset` command. This allows you to keep your changes in the working directory while removing the commit from the history.
Here's how to do it safely:
1... | 26,014 | [
{
"from": "human",
"value": "I committed a bunch of files (dozens of files in different folders) by accident. What is the easiest, cleanest (and safest!) way to 'undo' that commit without having to delete the files from my working directory?\n"
},
{
"from": "gpt",
"value": "If you've accidentall... |
If yes, on which operating system, shell or whatever?
Consider the following Java program (I'm using Java just as an example; any language would be good for this question, which is more about operation systems):
public class ExitCode {
public static void main(String args[]) {
System.exit(Integer.parseInt(ar... | The behavior you're observing with exit codes in Unix-like operating systems (including Linux) is due to the way these systems handle process exit statuses. Specifically, exit codes are typically limited to the range of 0-255, as the exit status is represented using an 8-bit value.
### Unix-like Systems (Linux, macOS,... | 20,685 | [
{
"from": "human",
"value": "If yes, on which operating system, shell or whatever?\nConsider the following Java program (I'm using Java just as an example; any language would be good for this question, which is more about operation systems):\npublic class ExitCode {\n public static void main(String args[... |
Is there a Java equivalent to .NET's App.Config?
If not is there a standard way to keep you application settings, so that they can be changed after an app has been distributed?
| Java does not have a direct equivalent to .NET's `App.Config` file, which is typically used to store application settings in XML format. However, there are several common practices and tools in the Java ecosystem that serve similar purposes. Here are some of the most widely used methods to manage application configurat... | 20,568 | [
{
"from": "human",
"value": "Is there a Java equivalent to .NET's App.Config?\nIf not is there a standard way to keep you application settings, so that they can be changed after an app has been distributed?\n"
},
{
"from": "gpt",
"value": "Java does not have a direct equivalent to .NET's `App.Co... |
Just wondering if there are any good server-side libraries for AJAX (prefer JSON rather then XML but anything is good) for classic ASP (VBScript)...
Rather not reinvent the wheel if it's already working and debugged.
Cheers,
Gaspard
EDIT: Server-side ASP VBScript... I have already seen many javascript client side libra... | While classic ASP (VBScript) is an older technology and might not have as many modern libraries as newer server-side frameworks, there are still ways to implement AJAX functionality effectively.
Here are some suggestions for libraries and techniques to handle AJAX in classic ASP while focusing on JSON:
### 1. **JSON ... | 25,759 | [
{
"from": "human",
"value": "Just wondering if there are any good server-side libraries for AJAX (prefer JSON rather then XML but anything is good) for classic ASP (VBScript)...\nRather not reinvent the wheel if it's already working and debugged.\nCheers,\nGaspard\nEDIT: Server-side ASP VBScript... I have a... |
I want to avoid the duplication of stylesheet link tags in the output html when a user control is dropped onto an aspx page. However if you omit the stylesheet link tag you don't get design time support for the stylesheet.
Anybody know a way around this problem?
| To avoid duplication of stylesheet link tags in your ASP.NET user controls while still retaining design-time support for the stylesheet, you can follow these steps:
### Method 1: Conditional StyleSheet Registration
One common approach is to check if the stylesheet is already registered before adding it again. This ca... | 23,341 | [
{
"from": "human",
"value": "I want to avoid the duplication of stylesheet link tags in the output html when a user control is dropped onto an aspx page. However if you omit the stylesheet link tag you don't get design time support for the stylesheet.\nAnybody know a way around this problem?\n"
},
{
... |
I see a lot of IoC frameworks for .Net and Java. Does anyone know why there are no equivalent frameworks for Smalltalk. This is more a philosophy question than anything else. I'm wondering if there is something in the Smalltalk way of doing things that precludes the necessity of having an IoC framework.
| The absence of widely adopted Inversion of Control (IoC) frameworks in Smalltalk can be attributed to several philosophical and practical aspects of the language and its ecosystem:
1. **Object Orientation**: Smalltalk is one of the purest object-oriented programming languages. Its design encourages a more organic appr... | 24,836 | [
{
"from": "human",
"value": "I see a lot of IoC frameworks for .Net and Java. Does anyone know why there are no equivalent frameworks for Smalltalk. This is more a philosophy question than anything else. I'm wondering if there is something in the Smalltalk way of doing things that precludes the necessity... |
When a RewriteRule is executed by MOD_Rewrite will all the MOD_Rewrite rules be executed again for the newly generated request? Specifically in the following example, will this cause a loop?
RewriteCond Host: (?:www\.)?mysite\.com
RewriteRule ^(.*)$ $1 [QSA,L]
| In the scenario you've described, when the `RewriteRule` is executed, it will **not** cause a loop under normal circumstances. Here's a breakdown of what's happening:
1. **Rewrite Conditions and Rule Execution**:
The `RewriteCond` checks if the host matches `mysite.com` or `www.mysite.com`. If this condition is met... | 22,940 | [
{
"from": "human",
"value": "When a RewriteRule is executed by MOD_Rewrite will all the MOD_Rewrite rules be executed again for the newly generated request? Specifically in the following example, will this cause a loop?\nRewriteCond Host: (?:www\\.)?mysite\\.com\nRewriteRule ^(.*)$ $1 [QSA,L]\n\n"
},
{... |
I am using VB.NET. In Visual Studio, if I right-click a property name and click "Find All References", it searches for all instances of the property being used.
However, a property is always used either for assignment (Set method) or retrieval (Get method). Is there any way of searching for only one of these uses? e.g.... | In Visual Studio, while the "Find All References" feature allows you to locate all instances of a property being used, it does not provide a built-in way to filter those references by whether they are `Set` (assignment) or `Get` (retrieval). However, there are some strategies you can use to achieve a similar effect:
#... | 25,487 | [
{
"from": "human",
"value": "I am using VB.NET. In Visual Studio, if I right-click a property name and click \"Find All References\", it searches for all instances of the property being used.\nHowever, a property is always used either for assignment (Set method) or retrieval (Get method). Is there any way o... |
Does anyone know a good SMTP/IMAP server library for C#?
I only found some long abandoned projects.
Only SERVER SIDE libraries, please no more posts about client libs.
Thanks,
Fionn
| If you're looking for server-side SMTP/IMAP libraries in C#, here are a few options that are more active and could meet your needs:
1. **MailKit**: While MailKit is primarily known for its client capabilities, it also has some server-side functionalities. It can be useful if you need basic email server features and wa... | 26,238 | [
{
"from": "human",
"value": "Does anyone know a good SMTP/IMAP server library for C#?\nI only found some long abandoned projects.\n\nOnly SERVER SIDE libraries, please no more posts about client libs.\nThanks,\nFionn\n"
},
{
"from": "gpt",
"value": "If you're looking for server-side SMTP/IMAP li... |
Scenario - I need to access an HTML template to generate a e-mail from my Business Logic Layer. It is a class library contains a sub folder that contains the file. When I tried the following code in a unit test:
string FilePath = string.Format(@"{0}\templates\MyFile.htm", Environment.CurrentDirectory);
string FilePat... | When working with file paths in a class library (like your Business Logic Layer) that may be used in different contexts (like unit tests or WCF services), it's essential to have a reliable way to access resources. Since you're experiencing issues with the `Environment.CurrentDirectory` and `AppDomain.CurrentDomain.Base... | 24,190 | [
{
"from": "human",
"value": "Scenario - I need to access an HTML template to generate a e-mail from my Business Logic Layer. It is a class library contains a sub folder that contains the file. When I tried the following code in a unit test:\nstring FilePath = string.Format(@\"{0}\\templates\\MyFile.htm\",... |
I am writing a command-line tool for Windows that uses libcurl to download files from the internet.
Obviously, the downloading doesn't work when the user is behind a proxy server, because the proxy needs to be configured. I want to keep my tool as simple as possible however, and not have to burden the user with having ... | When it comes to dealing with proxy settings in Windows, you're correct in thinking that Internet Explorer (IE) is the default source for proxy configuration, and these settings are also generally used by other applications, including modern browsers. Therefore, if you can extract the proxy settings from Internet Explo... | 19,152 | [
{
"from": "human",
"value": "I am writing a command-line tool for Windows that uses libcurl to download files from the internet.\nObviously, the downloading doesn't work when the user is behind a proxy server, because the proxy needs to be configured. I want to keep my tool as simple as possible however, an... |
Edit: I have solved this by myself. See my answer below
I have set up a nice sortable table with jQuery and it is quite nice. But now i want to extend it.
Each table row has a text box, and i want i am after is to, every time a row is dropped, the text boxes update to reflect the order of the text boxes. E.g. The text ... | It looks like you're trying to update the values of the textboxes in each row to reflect their order in the table after a drag-and-drop operation. You can achieve this by iterating through the rows in the `onDrop` callback and updating the values of the textboxes accordingly. Here’s an updated version of your JavaScrip... | 24,330 | [
{
"from": "human",
"value": "Edit: I have solved this by myself. See my answer below\nI have set up a nice sortable table with jQuery and it is quite nice. But now i want to extend it.\nEach table row has a text box, and i want i am after is to, every time a row is dropped, the text boxes update to reflect ... |
I have a home-spun 2000 lines VBScript script, that has become progressively slow with each additional code I add. It was created as a private debugging aid and now that it has become really useful. I want to polish it and ship it along with our product.
I thought I could speed it up by compiling it and making it an EX... | Given your requirements and the current context of your project, here are some options and recommendations to consider:
### 1. **Using VB6:**
VB6 can be used to create a graphical user interface (GUI) and can also compile your VBScript-like functionality into an EXE. Here are the steps you would need to follow:
- **... | 24,580 | [
{
"from": "human",
"value": "I have a home-spun 2000 lines VBScript script, that has become progressively slow with each additional code I add. It was created as a private debugging aid and now that it has become really useful. I want to polish it and ship it along with our product.\nI thought I could speed... |
What is a realistic use for VB.Net's MyClass keyword?
I understand the technical usage of MyClass; I don't understand the practical usage of it in the real world.
Using MyClass only makes sense if you have any virtual (overridable) members. But it also means that you want to ignore the overridden implementations in su... | The `MyClass` keyword in VB.Net is a way to refer explicitly to the current instance of the class, bypassing any overridden members in derived classes. While it may seem to have limited utility, there are some realistic scenarios where its use can be beneficial, especially in complex inheritance hierarchies. Here are a... | 21,786 | [
{
"from": "human",
"value": "What is a realistic use for VB.Net's MyClass keyword?\nI understand the technical usage of MyClass; I don't understand the practical usage of it in the real world.\nUsing MyClass only makes sense if you have any virtual (overridable) members. But it also means that you want to ... |
Are there any templates/patterns/guides I can follow for designing a multithreaded server? I can't find anything terribly useful online through my google searches.
My program will start a thread to listen for connections using TcpListener.
Every client connection will be handled by it's own IClientHandler thread. The... | Designing a multithreaded server can be a complex task, but you can definitely follow some well-established patterns and practices to make it easier. Below, I’ll outline a basic structure for a TCP server that uses threading and provides a clean way to handle connections, manage client handlers, and shutdown operations... | 16,766 | [
{
"from": "human",
"value": "Are there any templates/patterns/guides I can follow for designing a multithreaded server? I can't find anything terribly useful online through my google searches.\nMy program will start a thread to listen for connections using TcpListener.\nEvery client connection will be hand... |
I am in a situation where I must update an existing database structure from varchar to nvarchar using a script. Since this script is run everytime a configuration application is run, I would rather determine if a column has already been changed to nvarchar and not perform an alter on the table. The databases which I ... | To achieve your goal of updating an existing database structure from `varchar` to `nvarchar` and ensuring that the script does not attempt to alter a column that has already been changed, you can create a script that checks the data type of the columns before performing the `ALTER TABLE` command.
Below is a SQL script... | 22,700 | [
{
"from": "human",
"value": "I am in a situation where I must update an existing database structure from varchar to nvarchar using a script. Since this script is run everytime a configuration application is run, I would rather determine if a column has already been changed to nvarchar and not perform an al... |
PHP has a number of opcode caches, which as i understand it are scripts that handle the caching aspects of an application. Is there something similar for classic asp, especially something that does not require component installation?
Regarding the IIS caching behaviour, it seems from reading here that the behaviour is ... | Classic ASP does not have a built-in opcode cache like PHP’s opcode caches (such as OPcache), which optimize performance by caching the compiled bytecode of scripts. Classic ASP is interpreted, and each request to an ASP page typically involves re-interpreting the code, which can lead to performance bottlenecks, especi... | 20,592 | [
{
"from": "human",
"value": "PHP has a number of opcode caches, which as i understand it are scripts that handle the caching aspects of an application. Is there something similar for classic asp, especially something that does not require component installation?\nRegarding the IIS caching behaviour, it seem... |
I have a Windows Forms (.NET) application that can have multiple documents open simultaneously.
It would be convenient to have each document (form) running its own event loop. With brief experimentation, starting several event loops in their own STA threads seems to work. Is there any reason why this is a bad idea?
| Running multiple event loops for different Windows Forms documents in separate STA threads is technically possible, but it introduces several challenges and potential pitfalls. Here are some important points to consider:
### 1. Complexity of Communication
- **Cross-thread Communication**: If you need to communicate be... | 25,680 | [
{
"from": "human",
"value": "I have a Windows Forms (.NET) application that can have multiple documents open simultaneously.\nIt would be convenient to have each document (form) running its own event loop. With brief experimentation, starting several event loops in their own STA threads seems to work. Is th... |
How do the timeouts work in WCF? I know for example that you can configure sendTimeout and receiveTimeout for a clients binding. But how do they work?
MSDN describes sendTimeout as:
A TimeSpan value that specifies the interval of time provided for a
send operation to complete. This value should be greater than or eq... | In Windows Communication Foundation (WCF), timeouts are critical for managing the duration of various operations, ensuring that the application remains responsive and can handle scenarios where a service might be slow or unresponsive. The two main types of timeouts you mentioned—`sendTimeout` and `receiveTimeout`—are p... | 23,306 | [
{
"from": "human",
"value": "How do the timeouts work in WCF? I know for example that you can configure sendTimeout and receiveTimeout for a clients binding. But how do they work?\nMSDN describes sendTimeout as:\n\nA TimeSpan value that specifies the interval of time provided for a\n send operation to comp... |
I'm pretty sure stackoverflow.com is created with ASP.NET, but no matter where I click I see no .aspx extension in the address bar.
How it is done and is there a particular reason for this?
| Stack Overflow, like many modern web applications, uses URL routing and can be built on ASP.NET without exposing the traditional `.aspx` file extensions in the URLs. This is achieved through a feature called "URL routing."
### How URL Routing Works in ASP.NET
1. **Routing Configuration**: ASP.NET provides a routing f... | 23,602 | [
{
"from": "human",
"value": "I'm pretty sure stackoverflow.com is created with ASP.NET, but no matter where I click I see no .aspx extension in the address bar.\nHow it is done and is there a particular reason for this?\n"
},
{
"from": "gpt",
"value": "Stack Overflow, like many modern web applic... |
I'm working on a JSP where I need to call methods on object that come from a Bean. The previous version of the page does not use JSTL and it works properly. My new version has a set up like this:
<jsp:useBean id="pageBean" scope="request" type="com.epicentric.page.website.PageBean" />
<c:set var="pageDividers" value="<... | The error you're encountering indicates that you're trying to call a method on a List object (`pageDividers`) using JSTL syntax, but JSTL does not directly recognize the method calls without a proper syntax.
To fix the issue, you should use JSTL's built-in functions to work with collections instead of trying to access... | 23,997 | [
{
"from": "human",
"value": "I'm working on a JSP where I need to call methods on object that come from a Bean. The previous version of the page does not use JSTL and it works properly. My new version has a set up like this:\n<jsp:useBean id=\"pageBean\" scope=\"request\" type=\"com.epicentric.page.website.... |
I'm pasting test data from a SQL results into my code. I'm using the SQL results to manually populate a strongly typed dataset. However, the data types need to be casted to the correct data types. VS2005 tells me that I need to cast each field as an int, decimal, date, etc., but I'd rather not have to click this hun... | In Visual Studio 2005, you can indeed streamline the process of resolving data type issues in your code. While there isn't a direct shortcut to auto-cast all fields, you can navigate through errors and accept suggestions quickly, making your workflow much more efficient.
### 1. Navigating to the Next Error
You can use... | 26,230 | [
{
"from": "human",
"value": "I'm pasting test data from a SQL results into my code. I'm using the SQL results to manually populate a strongly typed dataset. However, the data types need to be casted to the correct data types. VS2005 tells me that I need to cast each field as an int, decimal, date, etc., ... |
In asp.net, you can retrieve MULTIPLE datatables from a single call to the database. Can you do the same thing in php?
Example:
$sql ="select * from t1; select * from t2;";
$result = SomeQueryFunc($sql);
print_r($result[0]); // dump results for t1
print_r($result[1]); // dump results for t2
Can you do something like ... | Yes, you can retrieve multiple result sets from a single query in PHP, but it largely depends on the database library you're using. The `mysqli` and `PDO` extensions in PHP can be used to achieve this with a stored procedure or by using the appropriate methods to fetch multiple result sets. Below is an example of how t... | 23,269 | [
{
"from": "human",
"value": "In asp.net, you can retrieve MULTIPLE datatables from a single call to the database. Can you do the same thing in php?\nExample:\n$sql =\"select * from t1; select * from t2;\";\n$result = SomeQueryFunc($sql);\nprint_r($result[0]); // dump results for t1\nprint_r($result[1]); //... |
I am just embarking on my first large-scale refactor, and need to split an (unfortunately large) class into two, which then communicate only via an interface. (My Presenter has turned out to be a Controller, and needs to split GUI logic from App logic). Using C# in VisualStudio 2008 and Resharper, what is the easiest w... | Refactoring a large class into two separate classes that communicate via an interface can be quite the undertaking, but it can also greatly enhance the maintainability and readability of your code. Here are some tips and gotchas to consider as you go through your refactoring process:
### Tips:
1. **Understand the Res... | 23,122 | [
{
"from": "human",
"value": "I am just embarking on my first large-scale refactor, and need to split an (unfortunately large) class into two, which then communicate only via an interface. (My Presenter has turned out to be a Controller, and needs to split GUI logic from App logic). Using C# in VisualStudio ... |
I have webservice which is passed an array of ints.
I'd like to do the select statement as follows but keep getting errors. Do I need to change the array to a string?
[WebMethod]
public MiniEvent[] getAdminEvents(int buildingID, DateTime startDate)
{
command.CommandText = @"SELECT id,
... | To use an array of integers in a SQL `IN` clause, you cannot directly use a parameter for the entire array. SQL Server does not support passing an array directly into an `IN` clause in a single parameter. However, you can achieve the desired functionality by converting the array of integers into a comma-separated strin... | 21,083 | [
{
"from": "human",
"value": "I have webservice which is passed an array of ints.\nI'd like to do the select statement as follows but keep getting errors. Do I need to change the array to a string?\n[WebMethod]\npublic MiniEvent[] getAdminEvents(int buildingID, DateTime startDate)\n{ \n command.Command... |
We are using TFS 2008 for project managmeent and I am looking for a method to roll up smaller tasks into larger tasks within tfs. Our work flow works like this:
I create a new large work item, say 'Implement web page X' and assign it to my developer (lets call him Brad)
Brad receives the task. Now he has never desig... | In TFS 2008, you can implement a hierarchical structure for work items to manage the relationship between larger tasks (master tasks) and smaller tasks (sub-tasks). Here’s a suggested workflow for you and Brad to achieve this:
### Step-by-step Workflow for Task Roll-Up in TFS:
1. **Create the Master Task:**
- When... | 15,687 | [
{
"from": "human",
"value": "We are using TFS 2008 for project managmeent and I am looking for a method to roll up smaller tasks into larger tasks within tfs. Our work flow works like this:\n\nI create a new large work item, say 'Implement web page X' and assign it to my developer (lets call him Brad)\nBra... |
I am actually developing and application that has around 15 modules, all of them using the same database.
I am using Apache + Mongrel, I cannot use Passenger because I am working on Windows (please forgive me for this deadly sin!)
Which of the following is a better approach?
Deploy multiple small rails
applications us... | When deciding between deploying multiple small Rails applications or a single large Rails application, especially in a scenario involving a shared database and a setup using Apache with Mongrel on Windows, there are several factors to consider:
### Option 1: Multiple Small Rails Applications
#### Pros:
1. **Isolation:... | 24,442 | [
{
"from": "human",
"value": "I am actually developing and application that has around 15 modules, all of them using the same database.\nI am using Apache + Mongrel, I cannot use Passenger because I am working on Windows (please forgive me for this deadly sin!)\nWhich of the following is a better approach?\n... |
I've run into this issue quite a few times and never liked the solution chosen. Let's say you have a list of States (just as a simple example) in the database. In your code-behind, you want to be able to reference a State by ID and have the list of them available via Intellisense.
For example:
States.Arizona.Id //... | You're addressing a common challenge in software design where you want to avoid hard-coding values while also maintaining the ease of access and maintainability of your constants. Here are several alternative approaches that strike a balance between flexibility and usability:
### 1. **Using a Static Class with Reflect... | 21,861 | [
{
"from": "human",
"value": "I've run into this issue quite a few times and never liked the solution chosen. Let's say you have a list of States (just as a simple example) in the database. In your code-behind, you want to be able to reference a State by ID and have the list of them available via Intellise... |
Having downloaded Pango and GLib from the GTK+ Project's Win32 downloads page and having created and configured a Win32 project under Visual Studio 2005 so it points to the proper lib and include directories, how do you initialize Pango for rendering to a Win32 window?
Should the first call be to pango_win32_get_contex... | To initialize Pango for rendering text in a Win32 window, you need to set up a few components correctly. The process generally involves creating a Pango context and layout, but it also requires initializing GTK+ as it sets up various subsystems that Pango relies on. Below are steps to initialize Pango and render text u... | 20,459 | [
{
"from": "human",
"value": "Having downloaded Pango and GLib from the GTK+ Project's Win32 downloads page and having created and configured a Win32 project under Visual Studio 2005 so it points to the proper lib and include directories, how do you initialize Pango for rendering to a Win32 window?\nShould t... |
We recently installed SVN 1.5.2 (with VisualSVN/Apache) on some of our servers / virtual machines, and now when I send a commandline command with username/password they don't get cached anymore.
Before, we were running SVN 1.5.0 installed with CollabNet, on svn://, and the credentials were cached after the first comman... | The issue you are encountering with credential caching between SVN over `svn://` and `http://` can stem from a few different factors. Let's address these step by step:
### Differences in Protocols
1. **Caching Behavior**:
- Subversion's credential caching behavior can differ between the `svn://` and `http://` prot... | 22,303 | [
{
"from": "human",
"value": "We recently installed SVN 1.5.2 (with VisualSVN/Apache) on some of our servers / virtual machines, and now when I send a commandline command with username/password they don't get cached anymore.\nBefore, we were running SVN 1.5.0 installed with CollabNet, on svn://, and the cred... |
Joel Test is a good and famous list checking some requisites every software company should concern about.
They are:
Do you use source control?
Can you make a build in one step?
Do you make daily builds?
Do you have a bug database?
Do you fix bugs before writing new code?
Do you have an up-to-date schedule?
Do you have... | It's great to hear that you've made progress in your company by implementing source control, a one-step build process, and daily builds! Those are foundational practices that can significantly improve development efficiency and quality.
As for my company, I'll hypothetically assign it a score of around 8. Here's how ... | 25,404 | [
{
"from": "human",
"value": "Joel Test is a good and famous list checking some requisites every software company should concern about.\nThey are:\n\nDo you use source control?\nCan you make a build in one step?\nDo you make daily builds?\nDo you have a bug database?\nDo you fix bugs before writing new code?... |
Our team is working on SAP and getting a website frontend written with PHP and MySQL to connect with the recruitment database on SAP ...
we've tried making SOAP clients and everything but it seems we're missing something.. what are the steps to ensure that they can synchronize with or without a wsdl..
| When integrating a PHP and MySQL frontend with an SAP recruitment database, there are several approaches to ensure that your system can connect and synchronize data effectively. Below are steps that can help you achieve this, whether you're using SOAP or other methods.
### Steps to Connect PHP and MySQL with SAP Recr... | 22,001 | [
{
"from": "human",
"value": "Our team is working on SAP and getting a website frontend written with PHP and MySQL to connect with the recruitment database on SAP ...\nwe've tried making SOAP clients and everything but it seems we're missing something.. what are the steps to ensure that they can synchronize ... |
Does anybody know a good and free add-in for Visual Studio 2005 to get refactoring features in VB?
| For Visual Studio 2005, there are a few options you might consider for refactoring features in VB.NET. While many of the advanced refactoring tools are available in later versions of Visual Studio, you still have some options for VS 2005:
1. **Refactoring Essentials**: Although primarily aimed at newer versions of Vis... | 27,214 | [
{
"from": "human",
"value": "Does anybody know a good and free add-in for Visual Studio 2005 to get refactoring features in VB?\n"
},
{
"from": "gpt",
"value": "For Visual Studio 2005, there are a few options you might consider for refactoring features in VB.NET. While many of the advanced refac... |
I see this all the time in Ruby:
require File.dirname(__FILE__) + "/../../config/environment"
What does __FILE__ mean?
| In Ruby, `__FILE__` is a special keyword that represents the current file's name as a string. It is often used to determine the path of the current file, especially when you need to reference files in relation to the current file's location.
In your example:
```ruby
require File.dirname(__FILE__) + "/../../config/env... | 28,919 | [
{
"from": "human",
"value": "I see this all the time in Ruby:\nrequire File.dirname(__FILE__) + \"/../../config/environment\" \n\nWhat does __FILE__ mean?\n"
},
{
"from": "gpt",
"value": "In Ruby, `__FILE__` is a special keyword that represents the current file's name as a string. It is often u... |
We've run into a thorny problem. We are writing a c++ program that receives multicast UDP traffic. We're in the process of moving our applications to a different network environment and our operations team has requested that we support IGMPv3 membership announcements from our applications. Initial investigations ind... | To enable IGMPv3 support in your application for joining multicast groups, you will need to use the `ip_mreqn` structure instead of `ip_mreq`. The `ip_mreqn` structure provides additional fields that allow you to specify the source and interface for multicast group memberships, enabling IGMPv3 features such as source-s... | 23,496 | [
{
"from": "human",
"value": "We've run into a thorny problem. We are writing a c++ program that receives multicast UDP traffic. We're in the process of moving our applications to a different network environment and our operations team has requested that we support IGMPv3 membership announcements from our ... |
I was given an .xml file that I needed to read into my code as a DataSet (as background, the file was created by creating a DataSet in C# and calling dataSet.WriteXml(file, XmlWriteMode.IgnoreSchema), but this was done by someone else).
The .xml file was shaped like this:
<?xml version="1.0" standalone="yes"?>
<NewD... | The behavior you're encountering when using `DataSet.ReadXml()` is due to how the XML data structure is represented and interpreted by the `DataSet`. Here’s a breakdown of what's happening:
1. **XML Structure**:
The XML structure you provided has a nested arrangement, where `<Foo>` elements contain both `<Bar>` ele... | 13,654 | [
{
"from": "human",
"value": "I was given an .xml file that I needed to read into my code as a DataSet (as background, the file was created by creating a DataSet in C# and calling dataSet.WriteXml(file, XmlWriteMode.IgnoreSchema), but this was done by someone else). \nThe .xml file was shaped like this:\n <?... |
I have tried but for some reason the workflow is not triggered.
| If your workflow isn't being triggered, here are some common issues and troubleshooting steps you can follow:
1. **Check Trigger Conditions:**
- Verify that the conditions set for triggering the workflow are correctly configured. Ensure that the event or conditions you expect to initiate the workflow are met.
2. *... | 26,551 | [
{
"from": "human",
"value": "I have tried but for some reason the workflow is not triggered. \n"
},
{
"from": "gpt",
"value": "If your workflow isn't being triggered, here are some common issues and troubleshooting steps you can follow:\n\n1. **Check Trigger Conditions:**\n - Verify that the c... |
We are moving from regular 2.0 webforms with no testing to TDD MVC
I'm looking to find out all the requirements for making the jump from 2.0 to 3.5 MVC.
Does SQL Server 2000 work with .net 3.5?
Does the MVC Framework come with .net 3.5?
How does AJAX work with all this stuff?
Is visual studios team suite worth the... | Transitioning from ASP.NET Web Forms to ASP.NET MVC with a Test-Driven Development (TDD) approach can be a significant but beneficial step for your application. Here's a breakdown of your queries:
### 1. **SQL Server 2000 Compatibility with .NET 3.5**
Yes, SQL Server 2000 can work with .NET Framework 3.5. However, kee... | 23,856 | [
{
"from": "human",
"value": "We are moving from regular 2.0 webforms with no testing to TDD MVC \nI'm looking to find out all the requirements for making the jump from 2.0 to 3.5 MVC. \n\nDoes SQL Server 2000 work with .net 3.5? \nDoes the MVC Framework come with .net 3.5?\nHow does AJAX work with all this... |
I'm looking for recommendations on books about MVC on the desktop. If they use Java, that is a bonus.
Some background:
I'm writing a desktop application in Java. It's an audio application that has a number of views and a central model called a Library with playlists, effects lists and a folder structure to organize t... | It sounds like you're deep into the process of implementing MVC in your Java desktop application using SWT. Here are some book recommendations that specifically cover MVC patterns, desktop application design, and Java programming:
1. **"Java Concurrency in Practice" by Brian Goetz** - While not solely focused on MVC, ... | 23,616 | [
{
"from": "human",
"value": "I'm looking for recommendations on books about MVC on the desktop. If they use Java, that is a bonus.\nSome background:\nI'm writing a desktop application in Java. It's an audio application that has a number of views and a central model called a Library with playlists, effects... |
Systems demand that certain primitives be aligned to certain points within the memory (ints to bytes that are multiples of 4, shorts to bytes that are multiples of 2, etc.). Of course, these can be optimized to waste the least space in padding.
My question is why doesn't GCC do this automatically? Is the more obvious ... | The alignment and padding of structures in C and C++ can indeed be a complex and nuanced topic. The reason GCC (and other compilers) do not automatically reorder struct members for optimal packing has several interrelated considerations:
1. **Consistency and Predictability**: C and C++ aim to provide a level of predic... | 23,394 | [
{
"from": "human",
"value": "Systems demand that certain primitives be aligned to certain points within the memory (ints to bytes that are multiples of 4, shorts to bytes that are multiples of 2, etc.). Of course, these can be optimized to waste the least space in padding.\nMy question is why doesn't GCC d... |
I'm using the PHP function imagettftext() to convert text into a GIF image. The text I am converting has Unicode characters including Japanese. Everything works fine on my local machine (Ubuntu 7.10), but on my webhost server, the Japanese characters are mangled. What could be causing the difference? Everything should ... | The issue you’re experiencing with the `imagettftext()` function rendering Japanese characters incorrectly on your web host could be due to several factors related to font support, locale settings, or PHP configuration on the server. Here are some steps to troubleshoot and resolve the problem:
1. **Font Availability**... | 20,987 | [
{
"from": "human",
"value": "I'm using the PHP function imagettftext() to convert text into a GIF image. The text I am converting has Unicode characters including Japanese. Everything works fine on my local machine (Ubuntu 7.10), but on my webhost server, the Japanese characters are mangled. What could be c... |
I'm attempting to create a custom calendar control that inherits from ASP.Net's built in calendar user control.
the code-behind file for my control looks like this:
public partial class WeeklyEventsCalendar : Calendar
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
and compiles fine.
Howeve... | The issue you're experiencing stems from a few key misunderstandings about how to create and register custom user controls in ASP.NET.
### Issue Breakdown
1. **User Control vs. Inheriting a Control**: In your situation, it seems like you're trying to create a user control (`WeeklyEventsCalendar.ascx`), but you are ac... | 16,817 | [
{
"from": "human",
"value": "I'm attempting to create a custom calendar control that inherits from ASP.Net's built in calendar user control. \nthe code-behind file for my control looks like this:\npublic partial class WeeklyEventsCalendar : Calendar\n{\n protected void Page_Load(object sender, EventArgs ... |
I'm writing server-side programs in PHP for an iPhone app. And I have no iPhone. :P
The iPhone app requests XML files from the site whenever a user runs the iPhone app. You may visit http://www.appvee.com/iphone/ads or http://www.appvee.com/iphone/latest for the XML files.
And a message box will show up with the follow... | The error message you're encountering indicates that the iPhone app is having trouble parsing the XML files you're generating. This could be due to several reasons, but let's address the potential UTF-8 encoding issue and the content type header first.
### 1. Set the Correct Content-Type Header
Yes, you should defini... | 20,320 | [
{
"from": "human",
"value": "I'm writing server-side programs in PHP for an iPhone app. And I have no iPhone. :P\nThe iPhone app requests XML files from the site whenever a user runs the iPhone app. You may visit http://www.appvee.com/iphone/ads or http://www.appvee.com/iphone/latest for the XML files.\nAnd... |
It's hard to search for D using Google, so I wasn't able to find a good answer:
I have an old iBook G3 and I'd like to install Linux on it and use it to compile (and test) D programs written using Tango on it. Is this possible? Or hasn't anybody tried it, yet? After all the Mac port of GDC + Tango is broken in parts, t... | Installing Linux on an old iBook G3 is certainly possible, and you can use it to compile and test D programs, although there may be some limitations and challenges to overcome. Here are some steps and considerations for your project:
1. **Choose a Suitable Linux Distribution**: Since the iBook G3 has relatively limite... | 21,288 | [
{
"from": "human",
"value": "It's hard to search for D using Google, so I wasn't able to find a good answer:\nI have an old iBook G3 and I'd like to install Linux on it and use it to compile (and test) D programs written using Tango on it. Is this possible? Or hasn't anybody tried it, yet? After all the Mac... |
I'm developing a POS application that is used in about 200 locations as of right now using .Net 2.0, WCF and SyncFusion components for the GUI.
Two days ago we installed the application in a new location, and it has been suffering sudden termination of the application.
The application has a running log of events and ... | It sounds like you're dealing with a challenging issue related to the sudden termination of your POS application, and it's good that you have logging in place to help diagnose the problem. Here are some steps and suggestions you can take to help troubleshoot and possibly resolve the issue:
### 1. Investigate "b0" Outp... | 22,777 | [
{
"from": "human",
"value": "I'm developing a POS application that is used in about 200 locations as of right now using .Net 2.0, WCF and SyncFusion components for the GUI. \nTwo days ago we installed the application in a new location, and it has been suffering sudden termination of the application. \nThe a... |
I'm sure there are a million posts about this out there, but surprisingly I'm having trouble finding something.
I have a simple script where I want to set the onClick handler for an <A> link on initialization of the page.
When I run this I immediately get a 'foo' alert box where I expected to only get an alert when I ... | The reason you are seeing the alert box immediately when the page loads is because of the way you are setting the `click` event handler in your script. Specifically, you are using `new function() {...}` which immediately invokes the function rather than assigning it as a handler. Additionally, you should be using `oncl... | 26,255 | [
{
"from": "human",
"value": "I'm sure there are a million posts about this out there, but surprisingly I'm having trouble finding something. \nI have a simple script where I want to set the onClick handler for an <A> link on initialization of the page.\nWhen I run this I immediately get a 'foo' alert box wh... |
I have a database table with 6 columns. The primary key is a composite key made up of 5 of the 6 columns
I am trying to use the SqlClient.SqlCommandBuilder.GetDeleteCommand to delete the row.
However I am getting the following error:
"System.InvalidOperationException : Dynamic SQL generation for the
DeleteCommand is... | Yes, the error you're encountering is indeed related to the composite primary key. The `SqlCommandBuilder.GetDeleteCommand` method requires that the `SelectCommand` includes key column information. In your case, since you have a composite primary key made up of five of the six columns, the `SelectCommand` must include ... | 26,250 | [
{
"from": "human",
"value": "I have a database table with 6 columns. The primary key is a composite key made up of 5 of the 6 columns\nI am trying to use the SqlClient.SqlCommandBuilder.GetDeleteCommand to delete the row.\nHowever I am getting the following error:\n\n\"System.InvalidOperationException : Dyn... |
I'm looking for an open-source pastebin web-application written in either Python or Perl.
I need it in order to implement a web-based specialized editor for my own needs, and I want to borrow code / ideas from the pastebin since I don't have much experience in web programming.
Can you point to one (or a few) ?
Thanks ... | Sure! Here are a few open-source pastebin applications written in Python and Perl that you can check out for your project:
### Python
1. **Hastebin**
- **Repository**: [Hastebin on GitHub](https://github.com/kanaka/haste-paste)
- **Description**: Hastebin is a simple, open-source pastebin that allows users to s... | 25,539 | [
{
"from": "human",
"value": "I'm looking for an open-source pastebin web-application written in either Python or Perl. \nI need it in order to implement a web-based specialized editor for my own needs, and I want to borrow code / ideas from the pastebin since I don't have much experience in web programming.... |
I have a web service that uses Python's SimpleJSON to serialize JSON, and a javascript/ client that uses Google's Visualization API. When I try to read in the JSON response using Google Data Table's Query method, I am getting a "invalid label" error.
I noticed that Google spreadsheet outputs JSON without quotes around... | The issue you're encountering stems from the fact that the JSON format strictly requires quotes around object keys. Google Visualization API expects properly formatted JSON, and using unquoted keys will lead to parsing errors, as you've experienced.
### Recommended Solutions
Here are some potential solutions to ensur... | 21,053 | [
{
"from": "human",
"value": "I have a web service that uses Python's SimpleJSON to serialize JSON, and a javascript/ client that uses Google's Visualization API. When I try to read in the JSON response using Google Data Table's Query method, I am getting a \"invalid label\" error. \nI noticed that Google sp... |
From one apache server file_get_contents returns the contents of a url straight away. On another apache server file_get contents won't return the contents of the same url until the keep-alive limit of the server hosting that url has been expired. The 2 php servers are retrieving the same url but through different net... | The behavior you're encountering with `file_get_contents` on the two different Apache servers can stem from a variety of factors. Here are some potential causes for one server waiting for the keep-alive limit to expire before receiving data, while the other server retrieves the content immediately:
1. **HTTP/1.1 vs HT... | 20,900 | [
{
"from": "human",
"value": "From one apache server file_get_contents returns the contents of a url straight away. On another apache server file_get contents won't return the contents of the same url until the keep-alive limit of the server hosting that url has been expired. The 2 php servers are retrievi... |
Is it possible to easily embed ActiveX controls in Java application? Is it worth it. In my next project I should either use existing activex in Java app or have to reimplement everything from scratch, so I'm wondering what will be less hassle.
| Embedding ActiveX controls in a Java application can be quite challenging and generally isn't considered a straightforward or practical approach. Here are some points to consider:
### Challenges of Using ActiveX in Java
1. **Platform Dependency**: ActiveX is primarily designed for the Windows platform and Internet Ex... | 26,101 | [
{
"from": "human",
"value": "Is it possible to easily embed ActiveX controls in Java application? Is it worth it. In my next project I should either use existing activex in Java app or have to reimplement everything from scratch, so I'm wondering what will be less hassle.\n"
},
{
"from": "gpt",
... |
I've seen this is various codebases, and wanted to know if this generally frowned upon or not.
For example:
public class MyClass
{
public int Id;
public MyClass()
{
Id = new Database().GetIdFor(typeof(MyClass));
}
}
| The code you posted demonstrates a practice that is generally frowned upon in software design for several reasons:
### 1. **Tight Coupling**
The constructor of `MyClass` directly instantiates a `Database` object. This creates a tight coupling between `MyClass` and the `Database` class, making it difficult to change or... | 20,223 | [
{
"from": "human",
"value": "I've seen this is various codebases, and wanted to know if this generally frowned upon or not.\nFor example:\npublic class MyClass\n{\n public int Id;\n\n public MyClass()\n {\n Id = new Database().GetIdFor(typeof(MyClass));\n }\n}\n\n"
},
{
"from": "gpt",
... |
Is it possible to extend LINQ-to-SQL entity-classes with constructor-methods and in the same go; make that entity-class inherit from it's data-context class?--In essence converting the entity-class into a business object.
This is the pattern I am currently using:
namespace Xxx
{
public class User : Xxx.DataContext
... | Your approach of extending the LINQ-to-SQL entity class and also making it inherit from the data context is an interesting concept, but it introduces some complications and is generally not recommended.
### Issues with Your Approach:
1. **Inheritance Misuse**: In your `User` class, you are trying to inherit from the ... | 21,776 | [
{
"from": "human",
"value": "Is it possible to extend LINQ-to-SQL entity-classes with constructor-methods and in the same go; make that entity-class inherit from it's data-context class?--In essence converting the entity-class into a business object.\nThis is the pattern I am currently using:\nnamespace Xxx... |
Within an iframe I have a user validate credit card payment information with a 3rd party website and upon validation the page will redirect to a predefined URL within our application. However, it POSTs to this URL within the iframe itself. Is there a clean way to redirect to the page I need? or do I have to use some in... | Redirecting within an iframe can be tricky, especially when dealing with cross-origin restrictions and user experience considerations. If the 3rd party payment validation redirects within the iframe, it can lead to undesirable user experiences or security issues. Here are a few approaches you can consider:
### 1. **Us... | 25,399 | [
{
"from": "human",
"value": "Within an iframe I have a user validate credit card payment information with a 3rd party website and upon validation the page will redirect to a predefined URL within our application. However, it POSTs to this URL within the iframe itself. Is there a clean way to redirect to the... |
Is it more efficient for a class to access member variables or local variables? For example, suppose you have a (callback) method whose sole responsibility is to receive data, perform calculations on it, then pass it off to other classes. Performance-wise, would it make more sense to have a list of member variables tha... | In your scenario, you're evaluating the efficiency of using local variables versus member variables in a callback method that is called frequently (hundreds of times per second). Here are some points to consider regarding performance, maintainability, and design:
### Performance Considerations
1. **Local Variables**:... | 24,297 | [
{
"from": "human",
"value": "Is it more efficient for a class to access member variables or local variables? For example, suppose you have a (callback) method whose sole responsibility is to receive data, perform calculations on it, then pass it off to other classes. Performance-wise, would it make more sen... |
We have a production SQL Server 2005 database server with the production version of our application's database on it. I would like to be able to copy down the data contents of the production database to a development server for testing.
Several sites (and Microsoft's forums) suggest using the Backup/Restore options to... | Copying the contents of a production SQL Server 2005 database to a development server can indeed be tricky, especially if you are restricted from using the Backup/Restore methods. Given your situation, here are some approaches you can take to accomplish this task:
### 1. **Generate Scripts for Data Only**
You can use ... | 25,089 | [
{
"from": "human",
"value": "We have a production SQL Server 2005 database server with the production version of our application's database on it. I would like to be able to copy down the data contents of the production database to a development server for testing.\nSeveral sites (and Microsoft's forums) s... |
Within my Subversion project I have a few directories that contain other open source projects that my code needs. For example ffmpeg, freetype, matrixssl and a few others.
What is the best way to update SVN to hold the the latest version of one of these projects?
Essentially I will be doing the following (using ffmpeg... | To effectively update your Subversion (SVN) project to hold the latest version of an open source project (like FFmpeg), you can follow a structured approach. Here’s a step-by-step guide:
### Step-by-Step Update Process
1. **Rename the Current ffmpeg Folder**
- Navigate to your project directory in your terminal or... | 25,050 | [
{
"from": "human",
"value": "Within my Subversion project I have a few directories that contain other open source projects that my code needs. For example ffmpeg, freetype, matrixssl and a few others. \nWhat is the best way to update SVN to hold the the latest version of one of these projects?\nEssentially ... |
I need to be able to validate a string against a list of the possible United States Postal Service state abbreviations, and Google is not offering me any direction.
I know of the obvious solution: and that is to code a horridly huge if (or switch) statement to check and compare against all 50 states, but I am asking S... | You can validate a string against the list of United States Postal Service (USPS) state abbreviations efficiently by using a `HashSet<string>` in C#. This approach allows for quick lookups. You can also use a simple array or list, but a `HashSet` provides O(1) average-time complexity for lookups.
Here is how you can i... | 25,214 | [
{
"from": "human",
"value": "I need to be able to validate a string against a list of the possible United States Postal Service state abbreviations, and Google is not offering me any direction. \nI know of the obvious solution: and that is to code a horridly huge if (or switch) statement to check and compar... |
I am currently using Net::HTTP in a Ruby script to post files to a website via a multipart form post. It works great for small files, but I frequently have to send very large files using this script, and HTTP#post only seems to accept post data as a String object, which means that the file I'm sending has to be read i... | You're correct that `Net::HTTP` can be a bit tricky when it comes to handling large files for multipart form uploads. However, using the `body_stream` method is indeed a great way to send large files without loading them entirely into memory.
The `body_stream` method allows you to provide an IO object (like a file), a... | 21,427 | [
{
"from": "human",
"value": "I am currently using Net::HTTP in a Ruby script to post files to a website via a multipart form post. It works great for small files, but I frequently have to send very large files using this script, and HTTP#post only seems to accept post data as a String object, which means t... |
I have written an HTML Application (hta file) and am wondering if there is a way to embed an icon file into the hta file itself.
I have seen html emails that include embedded graphic files, is there any way to do this with html applications and icons?
HTA files have an HTA:APPLICATION tag that allows you to specify an ... | Unfortunately, HTML Applications (HTA files) do not natively support embedding icons within the HTA file itself in the same way that some other formats might allow for embedded images or resources. The `HTA:APPLICATION` tag does provide a way to specify an icon for the application, but it requires a separate icon file,... | 25,184 | [
{
"from": "human",
"value": "I have written an HTML Application (hta file) and am wondering if there is a way to embed an icon file into the hta file itself.\nI have seen html emails that include embedded graphic files, is there any way to do this with html applications and icons?\nHTA files have an HTA:APP... |
I have xml files I want to read in and store in the database. Linq to sql requires the data to be sent in using an xelement, but if I send in the data this
new XElement("build", BuildNode.InnerXml)
I end up with data looking like this in the database lt;..gt;.. It converts the brackets into lt; and gt; which then make... | When you create an `XElement` using `InnerXml`, it interprets the XML content as a string, which is why you are seeing the encoded characters (like `<` and `>`). To store the XML correctly in your database, you should create the `XElement` directly from the XML structure instead of using `InnerXml`.
Here is how ... | 26,203 | [
{
"from": "human",
"value": "I have xml files I want to read in and store in the database. Linq to sql requires the data to be sent in using an xelement, but if I send in the data this\nnew XElement(\"build\", BuildNode.InnerXml)\n\nI end up with data looking like this in the database lt;..gt;.. It converts... |
I'm trying to understand the concepts behind DDD, but I find it hard to understand just by reading books as they tend to discuss the topic in a rather abstract way. I would like to see some good implementations of DDD in code, preferably in C#.
Are there any good examples of projects practicing DDD in the open source w... | Domain-Driven Design (DDD) can indeed be a complex topic to grasp purely through theory. Exploring open-source projects that implement DDD can help solidify your understanding by providing concrete examples of how DDD concepts can be applied in practice. Here are some notable open-source projects and resources in C# th... | 20,854 | [
{
"from": "human",
"value": "I'm trying to understand the concepts behind DDD, but I find it hard to understand just by reading books as they tend to discuss the topic in a rather abstract way. I would like to see some good implementations of DDD in code, preferably in C#.\nAre there any good examples of pr... |
I am using Visual Studio Team System 2008, version 9.0.30729.1 SP. I have a database project that I was working with yesterday with no issues - I was able to build and deploy the database successfully. Today, however, when I open the solution I receive what is listed as a "Warning" that halts any Build/Deploy/etc proce... | The warning "TSD3004: The application encountered an unexpected error" in Visual Studio Team System 2008 (VSTS) can be frustrating, especially when there is little information available to troubleshoot it. Here are some steps you can take to try to resolve the issue:
1. **Enable Tracing**: As suggested by the warning ... | 23,693 | [
{
"from": "human",
"value": "I am using Visual Studio Team System 2008, version 9.0.30729.1 SP. I have a database project that I was working with yesterday with no issues - I was able to build and deploy the database successfully. Today, however, when I open the solution I receive what is listed as a \"Warn... |
I understand benefits of dependency injection itself. Let's take Spring for instance. I also understand benefits of other Spring featureslike AOP, helpers of different kinds, etc. I'm just wondering, what are the benefits of XML configuration such as:
<bean id="Mary" class="foo.bar.Female">
<property name="age" value... | You raise some thoughtful points regarding dependency injection (DI) and the use of XML (or other external) configuration in frameworks like Spring. Let's address your concerns systematically.
### Benefits of XML Configuration vs. Plain Java Code
1. **Separation of Concerns**:
- XML configuration allows for a clea... | 18,984 | [
{
"from": "human",
"value": "I understand benefits of dependency injection itself. Let's take Spring for instance. I also understand benefits of other Spring featureslike AOP, helpers of different kinds, etc. I'm just wondering, what are the benefits of XML configuration such as:\n<bean id=\"Mary\" class=\"... |
I have a program with two TForm classes and have added a TMainMenu to them each. I am then trying to merge them dynamically at run-time.
My problem is that when they merge the menu items in the merged in TMainMenu now display images stored in the imagelist in the form they were merged into rather than the images stored... | When you merge two `TMainMenu` components from different forms in Delphi, the images for the menu items are not automatically copied from the original form's `TImageList`. Instead, they reference the `TImageList` that is currently associated with the `TMainMenu` of the target form. This is the reason you see the images... | 22,319 | [
{
"from": "human",
"value": "I have a program with two TForm classes and have added a TMainMenu to them each. I am then trying to merge them dynamically at run-time.\nMy problem is that when they merge the menu items in the merged in TMainMenu now display images stored in the imagelist in the form they were... |
When debugging multithreaded midlet in the EclipseMe, the breakpoints work for me only in the main thread but not I other threads. Any ideas?
| Debugging multithreaded applications, especially in environments like EclipseMe for MIDP (Mobile Information Device Profile), can sometimes be tricky. Here are some ideas to help you debug breakpoints in threads other than the main thread:
1. **Ensure Breakpoints are Set Properly**: Make sure that your breakpoints are... | 23,309 | [
{
"from": "human",
"value": "When debugging multithreaded midlet in the EclipseMe, the breakpoints work for me only in the main thread but not I other threads. Any ideas?\n"
},
{
"from": "gpt",
"value": "Debugging multithreaded applications, especially in environments like EclipseMe for MIDP (Mo... |
I'm consuming a third party .NET WebService in my client application. For debugging purposes I want to capture the SOAP requests that are being sent from my server. How would I go about doing this? This is being done on .NET 2.0 without the use of WCF or WSE.
| To capture SOAP requests being sent from a .NET application (especially in .NET 2.0) without using WCF or WSE, you can utilize a few different techniques. Here are some approaches you could take:
### 1. Use a Proxy
One effective way to capture SOAP requests is to set up a proxy server that will intercept the outgoing... | 21,935 | [
{
"from": "human",
"value": "I'm consuming a third party .NET WebService in my client application. For debugging purposes I want to capture the SOAP requests that are being sent from my server. How would I go about doing this? This is being done on .NET 2.0 without the use of WCF or WSE.\n"
},
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.