instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
What is the fastest way to share data structures between Java and C#? I want something where I can literally send a "car" object or a "foo" object and have it serialized and deserialized on both server and client.
| To efficiently share data structures between Java and C#, you can use a common serialization format that both languages can understand. The goal is to create a system where you can send objects such as "car" or "foo" from one language to the other without losing structure or information. Here are some of the best appro... | 45,008 | [
{
"from": "human",
"value": "What is the fastest way to share data structures between Java and C#? I want something where I can literally send a \"car\" object or a \"foo\" object and have it serialized and deserialized on both server and client.\n"
},
{
"from": "gpt",
"value": "To efficiently ... |
How can I rewrite or is there a way to writing my own custom function that simulates the Custom System.Collections.Generic.Contains but only factors in certain Public Properties of a Custom Object?
For example if I have a custom Object with Properties Name and ID, I would like my Unique Value List to contain all the DI... | You can achieve this by creating a custom function that uses LINQ to group your objects by the specified properties, in this case, the `Name` property while ignoring case sensitivity. Then, you can select the first occurrence of each distinct name to build a new list.
Here's how you can implement this in C#:
```cshar... | 44,600 | [
{
"from": "human",
"value": "How can I rewrite or is there a way to writing my own custom function that simulates the Custom System.Collections.Generic.Contains but only factors in certain Public Properties of a Custom Object?\nFor example if I have a custom Object with Properties Name and ID, I would like ... |
I have at my SQL Server 2000 Database a column with type Image. How can I map it into NHibernate?
| Mapping a column of type `Image` in SQL Server 2000 to NHibernate can be done using the `Binary` type in your mapping file or by using Fluent NHibernate. Here's how you can do it with both approaches.
### 1. Using XML Mapping File
If you are using XML mapping files, you can define the mapping for the `Image` column a... | 47,715 | [
{
"from": "human",
"value": "I have at my SQL Server 2000 Database a column with type Image. How can I map it into NHibernate?\n"
},
{
"from": "gpt",
"value": "Mapping a column of type `Image` in SQL Server 2000 to NHibernate can be done using the `Binary` type in your mapping file or by using F... |
In C#, I'm trying to build an extension method for StringBuilder called AppendCollection() that would let me do this:
var sb1 = new StringBuilder();
var sb2 = new StringBuilder();
var people = new List<Person>() { ...init people here... };
var orders = new List<Orders>() { ...init orders here... };
sb1.AppendCollectio... | To create an extension method for `StringBuilder` that appends a collection of items using a specified formatting function (lambda), you can use generics and a delegate type. Specifically, you would define a method that accepts an `IEnumerable<T>` for the collection and a `Func<T, string>` to represent the formatting l... | 42,649 | [
{
"from": "human",
"value": "In C#, I'm trying to build an extension method for StringBuilder called AppendCollection() that would let me do this:\nvar sb1 = new StringBuilder();\nvar sb2 = new StringBuilder();\nvar people = new List<Person>() { ...init people here... };\nvar orders = new List<Orders>() { .... |
as I am implementing the ICollection-Interface in my class I want to implement the CopyTo-Method and I have to throw an Argument-exception if the array is multidimensional.
What is meant by this? The head of my method is this
public void CopyTo(MyClass[] array, int arrayIndex)
I thought these brackets would mean that ... | In C#, arrays can be either single-dimensional (1D) or multi-dimensional (such as 2D arrays). The notation `MyClass[]` indeed represents a single-dimensional array of `MyClass` objects. However, when implementing the `CopyTo` method of the `ICollection` interface, you need to ensure that the `array` parameter provided ... | 47,180 | [
{
"from": "human",
"value": "as I am implementing the ICollection-Interface in my class I want to implement the CopyTo-Method and I have to throw an Argument-exception if the array is multidimensional. \nWhat is meant by this? The head of my method is this\npublic void CopyTo(MyClass[] array, int arrayIndex... |
I need to match a string holiding html using a regex to pull out all the nested spans, I assume I assume there is a way to do this using a regex but have had no success all morning.
So for a sample input string of
<DIV id=c445c9c2-a02e-4cec-b254-c134adfa4192 style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000... | Using regex to parse nested HTML structures can be tricky, as regular expressions are not designed for hierarchical data. However, for the specific case of extracting `<SPAN>` tags and their nested content, we can employ a regex that aims to match these tags.
Below is a regex pattern that can be used to match outer `<... | 42,955 | [
{
"from": "human",
"value": "I need to match a string holiding html using a regex to pull out all the nested spans, I assume I assume there is a way to do this using a regex but have had no success all morning. \nSo for a sample input string of \n<DIV id=c445c9c2-a02e-4cec-b254-c134adfa4192 style=\"BORDER-R... |
I'm trying some of the ASP.NET MVC tutorials and one of them has the following steps:
Right-click on the "App_Data" folder, and choose "Add New item"
Choose "SQL Server Database" under the "Data" category.
However, once I do that, I get the following message from Visual Studio:
Connections to SQL Server files (*.mdf... | The message you're encountering suggests that Visual Studio is expecting SQL Server Express to be installed in order to create and manage SQL Server database files (.mdf) directly from your project. However, since you already have SQL Server 2008 Developer Edition installed, you can work around this issue by following ... | 45,441 | [
{
"from": "human",
"value": "I'm trying some of the ASP.NET MVC tutorials and one of them has the following steps:\n\nRight-click on the \"App_Data\" folder, and choose \"Add New item\"\nChoose \"SQL Server Database\" under the \"Data\" category.\n\nHowever, once I do that, I get the following message from ... |
I am doing some calculations that require a large array to be initialized. The maximum size of the array determines the maximum size of the problem I can solve.
Is there a way to programmatically determine how much memory is available for say, the biggest array of bytes possible?
Thanks
| Yes, you can programmatically determine the amount of memory available for arrays in various programming environments, but it's important to remember that the actual maximum size of an array can be influenced by various factors, such as the architecture of the machine (32-bit vs. 64-bit), memory limits imposed by the o... | 42,786 | [
{
"from": "human",
"value": "I am doing some calculations that require a large array to be initialized. The maximum size of the array determines the maximum size of the problem I can solve. \nIs there a way to programmatically determine how much memory is available for say, the biggest array of bytes poss... |
Is there a fast algorithm for finding the Largest Common Substring in two strings or is it an NPComplete problem?
In PHP I can find a needle in a haystack:
<?php
if (strstr("there is a needle in a haystack", "needle")) {
echo "found<br>\n";
}
?>
I guess I could do this in a loop over one of the strings but that w... | Finding the Largest Common Substring (LCS) between two strings is not NP-complete; rather, it can be solved efficiently in polynomial time using dynamic programming techniques.
### Dynamic Programming Approach
The most common approach for finding the longest common substring is to use a 2D dynamic programming table.... | 41,673 | [
{
"from": "human",
"value": "Is there a fast algorithm for finding the Largest Common Substring in two strings or is it an NPComplete problem?\nIn PHP I can find a needle in a haystack:\n<?php\n\nif (strstr(\"there is a needle in a haystack\", \"needle\")) {\n echo \"found<br>\\n\";\n}\n?>\n\nI guess I c... |
Not sure what's going on here.
I have a DateTime object, and when I try:
String.Format( "{0:dd/MM/yyyy}", _date)
the value returned is:
"24-05-1967"
What I want is
"24/05/1967"
Can anyone explain why my format string is being ignored?
A bit more background:
This is a web app which started out life as .net 1.1, and ... | The behavior you are experiencing is likely due to the culture settings of your ASP.NET application. In .NET, the formatting of dates (as well as numbers and other culture-sensitive formats) depends on the current culture settings of the thread. If the culture is set to something like "af-ZA" (Afrikaans - South Africa)... | 45,339 | [
{
"from": "human",
"value": "Not sure what's going on here.\nI have a DateTime object, and when I try:\nString.Format( \"{0:dd/MM/yyyy}\", _date)\n\nthe value returned is:\n\"24-05-1967\"\n\nWhat I want is\n\"24/05/1967\"\n\nCan anyone explain why my format string is being ignored? \nA bit more background:\... |
What is the best way to convert word HTML to word XML? I cannot buy a tool so need something preferably XSLT which is free and works suitably with basic formatting like paragraphs, lists, bold and italic.
| Converting Word HTML to Word XML (specifically Office Open XML, which is the format used by modern versions of Microsoft Word) using XSLT can be a bit complex due to the differences in the structures of these formats. However, you can create a basic XSLT stylesheet to help you achieve this for simple formatting like pa... | 40,357 | [
{
"from": "human",
"value": "What is the best way to convert word HTML to word XML? I cannot buy a tool so need something preferably XSLT which is free and works suitably with basic formatting like paragraphs, lists, bold and italic.\n"
},
{
"from": "gpt",
"value": "Converting Word HTML to Word ... |
In C and C++ what do the following declarations do?
const int * i;
int * const i;
const volatile int ip;
const int *i;
Are any of the above declarations wrong?
If not what is the meaning and differences between them?
What are the useful uses of above declarations (I mean in which situation we have to use them in C/C++... | Let's break down each of the provided declarations in C and C++ and discuss their meanings, differences, and potential use cases.
### Declarations:
1. **`const int *i;`**
- This declares a pointer `i` to a constant integer. This means that the integer value pointed to by `i` cannot be modified through this pointer... | 43,511 | [
{
"from": "human",
"value": "In C and C++ what do the following declarations do?\nconst int * i;\nint * const i;\nconst volatile int ip;\nconst int *i;\n\nAre any of the above declarations wrong?\nIf not what is the meaning and differences between them?\nWhat are the useful uses of above declarations (I mea... |
For a current project, I was thinking of implementing WebDAV to present a virtual file store that clients can access. I have only done Google research so far but it looks like I can get away with only implementing two methods:
GET, PROPFIND
I think that this is great. I was just curious though. If I wanted to implemen... | Implementing WebDAV to create a virtual file store is a solid choice, especially if you only need basic functionality like retrieving file metadata and fetching files. As you’ve noted, implementing the GET and PROPFIND methods will give you a functional starting point. If you choose to add file uploading with the PUT m... | 46,041 | [
{
"from": "human",
"value": "For a current project, I was thinking of implementing WebDAV to present a virtual file store that clients can access. I have only done Google research so far but it looks like I can get away with only implementing two methods:\nGET, PROPFIND\n\nI think that this is great. I was ... |
I have an application that is sensitive to the directory it gets invoked from — it loads some files using relative paths.
When I start the program through a debugger, how can I control what the initial current directory will be?
I'd prefer to avoid adding special code to the debugged program to make it call chdir; my i... | When you're using a debugger like TotalView or others on Linux, there are a few ways to control the current working directory from which your program runs without modifying the code directly. Below are methods specific to TotalView as well as general approaches that apply to other debuggers like GDB.
### TotalView
In... | 44,820 | [
{
"from": "human",
"value": "I have an application that is sensitive to the directory it gets invoked from — it loads some files using relative paths.\nWhen I start the program through a debugger, how can I control what the initial current directory will be?\nI'd prefer to avoid adding special code to the d... |
I'm getting quite a few errors in my code. Consequently, I would like to be able to minimize them at the outset or see as many errors as possible before code execution. Is this possible and if so, how can I do this?
| Yes, it is definitely possible to minimize errors in your code and catch as many issues as possible before execution. Here are several strategies and tools you can employ to achieve this:
### 1. **Use an Integrated Development Environment (IDE)**
Using an IDE can significantly help reduce errors since they provide re... | 44,310 | [
{
"from": "human",
"value": "I'm getting quite a few errors in my code. Consequently, I would like to be able to minimize them at the outset or see as many errors as possible before code execution. Is this possible and if so, how can I do this?\n"
},
{
"from": "gpt",
"value": "Yes, it is definit... |
I wish to perform an experiment many different times. After every trial, I am left with a "large" set of output statistics -- let's say, 1000. I would like to store the outputs of my experiments in a table, but what's the best way...?
Option 1
Have a table with 1000 columns. Seems like a bad idea. What if the numbe... | You're correct in identifying the strengths and weaknesses of both options you've considered for storing your experimental output statistics. Let’s explore some potential solutions and their trade-offs.
### Option 1: Wide Format (1000 columns)
- **Pros:**
- Simple to read and interpret for each experiment.
- Easie... | 24,164 | [
{
"from": "human",
"value": "I wish to perform an experiment many different times. After every trial, I am left with a \"large\" set of output statistics -- let's say, 1000. I would like to store the outputs of my experiments in a table, but what's the best way...?\nOption 1\nHave a table with 1000 column... |
Possible Duplicate:
What is the exact problem with multiple inheritance?
Why is multiple inheritance considered to be evil while implementing multiple interfaces is not? Especially when once considers that interfaces are simply pure abstract classes?
(More or less) duplicate of What is the exact problem with multip... | The perception that multiple inheritance is "evil" while multiple interfaces are generally accepted stems from a few key differences in how these concepts are implemented and the potential complications they introduce.
### Key Reasons:
1. **Diamond Problem**:
- In multiple inheritance, if a class inherits from tw... | 45,172 | [
{
"from": "human",
"value": "\nPossible Duplicate:\nWhat is the exact problem with multiple inheritance? \n\nWhy is multiple inheritance considered to be evil while implementing multiple interfaces is not? Especially when once considers that interfaces are simply pure abstract classes?\n(More or less) dupl... |
I'm trying to do query result pagination with hibernate and displaytag, and Hibernate DetachedCriteria objects are doing their best to stand in the way. Let me explain...
The easiest way to do pagination with displaytag seems to be implementing the PaginatedList interface that has, among others, the following methods:
... | To achieve pagination with Hibernate using DetachedCriteria while ensuring that your query for the total count and the query for the actual page of data can coexist, you're correct in concluding that you'll need to use two distinct `Criteria` objects. Here’s a structured approach to implement the `PaginatedList` interf... | 45,894 | [
{
"from": "human",
"value": "I'm trying to do query result pagination with hibernate and displaytag, and Hibernate DetachedCriteria objects are doing their best to stand in the way. Let me explain...\nThe easiest way to do pagination with displaytag seems to be implementing the PaginatedList interface that ... |
How do I implement this equality comparison is a sane java way?
boolean x = (a == b) || (a.equals(b))
I want to make sure the content of both objects is equal but null is also ok, i.e. both can be null and are thus equal.
Update: just to be clear, I have to implement this comparison several times and don't want to... | You can create a utility method to handle this equality comparison in a clean and reusable way. This will allow you to avoid code duplication while ensuring that the logic remains consistent across different parts of your application. Here's how you can implement it:
### Create a Utility Method
You can create a stati... | 42,707 | [
{
"from": "human",
"value": "How do I implement this equality comparison is a sane java way? \nboolean x = (a == b) || (a.equals(b))\n\nI want to make sure the content of both objects is equal but null is also ok, i.e. both can be null and are thus equal.\nUpdate: just to be clear, I have to implement th... |
I'm new to WPF and data binding so hopefully I can explain the problem I'm having with enough detail to get some help.
I have a list of objects that is data bound to a window. Let's say its a list of recipes. I have managed to get the application to display some details of each recipe in a list box, and some more detai... | The issue you are facing with your WPF application is related to how you are declaring and using the `Ingredients` property in the `RecipeDetails` class. In your current setup, `Ingredients` is defined as a `List<RecipeIngredient>`, but for data binding to work correctly in WPF, it should be an `ObservableCollection<Re... | 43,924 | [
{
"from": "human",
"value": "I'm new to WPF and data binding so hopefully I can explain the problem I'm having with enough detail to get some help.\nI have a list of objects that is data bound to a window. Let's say its a list of recipes. I have managed to get the application to display some details of each... |
Suppose I have a directory of 100 .ISO files. Do you know how I could automate burning them to DVDs? I'd basically like to send them to a DVD burner with a hopper of DVDs similar to how you can print sheets of paper on a printer.
Any ideas on how to do this on Windows?
| Automating the process of burning multiple ISO files to DVDs on Windows can be achieved using a combination of software tools and a bit of scripting. Here’s a step-by-step guide on how you could set this up:
### Requirements:
1. **DVD Burner with Hopper:** Ensure you have a DVD burner that supports multiple discs (li... | 42,339 | [
{
"from": "human",
"value": "Suppose I have a directory of 100 .ISO files. Do you know how I could automate burning them to DVDs? I'd basically like to send them to a DVD burner with a hopper of DVDs similar to how you can print sheets of paper on a printer.\nAny ideas on how to do this on Windows?\n"
}... |
A link that stands out is http://www.devdaily.com/blog/post/jfc-swing/handling-main-mac-menu-in-swing-application/ however the menu bar under Mac OS X displays as the package name as opposed to the application name. I'm using the code in the above link without any luck, so I'm unsure if anything's changed in recent Ma... | The issue you're encountering with the Mac OS X menu bar displaying the package name instead of the application name is related to the way Java Swing applications are configured to run on macOS.
To address your problem, ensure you are correctly setting the application name in the properties before you create your `Ro... | 42,664 | [
{
"from": "human",
"value": "A link that stands out is http://www.devdaily.com/blog/post/jfc-swing/handling-main-mac-menu-in-swing-application/ however the menu bar under Mac OS X displays as the package name as opposed to the application name. I'm using the code in the above link without any luck, so I'm ... |
I need to display external resources loaded via cross domain requests and make sure to only display "safe" content.
Could use Prototype's String#stripScripts to remove script blocks. But handlers such as onclick or onerror are still there.
Is there any library which can at least
strip script blocks,
kill DOM handlers... | When working with cross-domain requests and displaying external content, it is indeed important to sanitize the content to prevent XSS (Cross-Site Scripting) attacks. Here are some libraries and techniques that you can use to sanitize HTML content by stripping scripts, killing DOM handlers, and removing unwanted tags.
... | 38,790 | [
{
"from": "human",
"value": "I need to display external resources loaded via cross domain requests and make sure to only display \"safe\" content. \nCould use Prototype's String#stripScripts to remove script blocks. But handlers such as onclick or onerror are still there.\nIs there any library which can at ... |
Problem: EmacsW32 is a version of Emacs that allows the user to make Emacs treat the "Windows" key as the "Meta" key (instead of treating the Alt key as the "Meta" key). Although this works as advertised, the question is what happens when you want to create an Emacs keybinding for the "Alt" key?
Question: Is there a wa... | In EmacsW32, when you configure the Windows key to act as the Meta key, the default behavior typically assigns the Alt key to standard input without treating it as a modifier. However, if you want to capture and create keybindings for the Alt key while still using the Windows key as Meta, you have a couple of options.
... | 46,928 | [
{
"from": "human",
"value": "Problem: EmacsW32 is a version of Emacs that allows the user to make Emacs treat the \"Windows\" key as the \"Meta\" key (instead of treating the Alt key as the \"Meta\" key). Although this works as advertised, the question is what happens when you want to create an Emacs keybin... |
I'm writing some RSS feeds in PHP and stuggling with character-encoding issues. Should I utf8_encode() before or after htmlentities() encoding? For example, I've got both ampersands and Chinese characters in a description element, and I'm not sure which of these is proper:
$output = utf8_encode(htmlentities($source)); ... | When dealing with character encoding issues in PHP, especially when generating RSS feeds, it's important to understand how `utf8_encode()` and `htmlentities()` work, as well as the appropriate sequence to use them.
1. **`utf8_encode()`**: This function is intended to convert ISO-8859-1 encoded strings into UTF-8. If y... | 48,885 | [
{
"from": "human",
"value": "I'm writing some RSS feeds in PHP and stuggling with character-encoding issues. Should I utf8_encode() before or after htmlentities() encoding? For example, I've got both ampersands and Chinese characters in a description element, and I'm not sure which of these is proper:\n$out... |
I am writing a curriculum project for students new to Java. It has a folder structure as so.
myjar.jar
solutions/my/really/long/package/MySolution.class
I got it so the jar can load all classes in the solutions/my/really/long/package/ directory.
by adding 'solutions/' to the classpath.
My question is if it is possible... | In Java, the package structure is directly tied to the directory structure where the class files are stored. However, if you want to avoid long nested folders while still using a named package (i.e., not using the default package), you can achieve this by using a simple, single-level package declaration for your classe... | 46,046 | [
{
"from": "human",
"value": "I am writing a curriculum project for students new to Java. It has a folder structure as so.\nmyjar.jar\nsolutions/my/really/long/package/MySolution.class\n\nI got it so the jar can load all classes in the solutions/my/really/long/package/ directory.\nby adding 'solutions/' to t... |
I have written a small java application for which I need to obtain performance metrics such as memory usage, running time etc., Is there any simple to use performance measurement tool available?
| Yes, there are several tools and libraries you can use to obtain performance metrics for your Java application, including memory usage and running time. Here are some popular and easy-to-use options:
1. **Java Mission Control (JMC)**:
- A powerful profiling and diagnostics tool included with the JDK.
- Can monit... | 43,828 | [
{
"from": "human",
"value": "I have written a small java application for which I need to obtain performance metrics such as memory usage, running time etc., Is there any simple to use performance measurement tool available? \n"
},
{
"from": "gpt",
"value": "Yes, there are several tools and libra... |
The size and range of the integer value types in C++ are platform specific. Values found on most 32-bit systems can be found at Variables. Data Types. - C++ Documentation. How do you determine what the actual size and range are for your specific system?
| In C++, the size and range of integer value types can be determined using the `sizeof` operator and by utilizing the `<limits>` header, which provides the limits of the integral types.
Here's a step-by-step guide to determine the size and range of integer types on your specific system:
1. **Include the Necessary Head... | 44,275 | [
{
"from": "human",
"value": "The size and range of the integer value types in C++ are platform specific. Values found on most 32-bit systems can be found at Variables. Data Types. - C++ Documentation. How do you determine what the actual size and range are for your specific system?\n"
},
{
"from":... |
Is there some way to catch exceptions which are otherwise unhandled (including those thrown outside the catch block)?
I'm not really concerned about all the normal cleanup stuff done with exceptions, just that I can catch it, write it to log/notify the user and exit the program, since the exceptions in these casese are... | To catch unhandled exceptions in a C++ application, particularly on Windows, you can use structured exception handling (SEH) or a signal handler. Here's how you can set it up:
### Using Structured Exception Handling (SEH) in Windows
SEH is a mechanism provided by Windows that allows you to catch low-level hardware ex... | 44,918 | [
{
"from": "human",
"value": "Is there some way to catch exceptions which are otherwise unhandled (including those thrown outside the catch block)?\nI'm not really concerned about all the normal cleanup stuff done with exceptions, just that I can catch it, write it to log/notify the user and exit the program... |
Good file comparison tools were already discussed to the pain, but my problem is more exotic. Is there any visual text comparison tool (like WinMerge) that would allow me easily do visual comparison on two sections within the same file?
I have multiple configurations within vcproj file and need to maintain them. It is ... | It sounds like you're looking for a specialized tool that can help you compare sections within the same file, especially for XML files like `.vcproj`. Here are a few suggestions that may meet your requirements:
1. **Meld**:
- Meld is a visual diff and merge tool that allows for file comparison, directory comparison... | 48,000 | [
{
"from": "human",
"value": "Good file comparison tools were already discussed to the pain, but my problem is more exotic. Is there any visual text comparison tool (like WinMerge) that would allow me easily do visual comparison on two sections within the same file?\nI have multiple configurations within vcp... |
I notice that get/set is not the c++ way as far as I can tell by looking at boost/stl, and even reading the writings of some of the top c++ experts.
Does anyone use get/set in their c++ class design, and can someone suggest a rule of thumb on where if at all this paradigm belongs in the c++ world?
It is obviously very ... | You’re correct that the getter/setter paradigm is less commonly used in C++ compared to languages like Java or C#. In C++, especially with the use of idiomatic patterns and features of the language, the approach to encapsulation tends to be more flexible and less reliant on explicit getter and setter methods.
### Reas... | 46,111 | [
{
"from": "human",
"value": "I notice that get/set is not the c++ way as far as I can tell by looking at boost/stl, and even reading the writings of some of the top c++ experts.\nDoes anyone use get/set in their c++ class design, and can someone suggest a rule of thumb on where if at all this paradigm belon... |
I have a C# method that projects the value of a number from an interval to a target interval.
For example: we have an interval of -1000 and 9000 and a value of 5000; if we want to project this value to an interval of 0..100 we get 60.
Here is the method:
/// <summary>
/// Projects a value to an interval
/// </summar... | Your method for projecting a value from one interval to another is correct in its logic, but there are opportunities for optimization to improve performance, especially since you'll be calling it for thousands of values. Here are a few suggestions:
1. **Avoid Repeated Calculations**: If the same `min`, `max`, `interva... | 44,469 | [
{
"from": "human",
"value": "I have a C# method that projects the value of a number from an interval to a target interval.\nFor example: we have an interval of -1000 and 9000 and a value of 5000; if we want to project this value to an interval of 0..100 we get 60.\nHere is the method: \n/// <summary> \n///... |
I'm just getting started/familar with Subversion and was wondering
which protocol gives the best performance file:// or svn://, when accessing a Subversion repository over the network? If we don't use the svn:// protocol, will be missing out on any features that we couldn't mitgate using the file:// protocol? We're a... | When choosing between the `file://` and `svn://` protocols for accessing a Subversion (SVN) repository over the network, it’s important to understand the differences in performance and features:
### Performance
- **file:// Protocol**: This protocol is typically the fastest when accessing a repository on a local file ... | 46,016 | [
{
"from": "human",
"value": "I'm just getting started/familar with Subversion and was wondering\nwhich protocol gives the best performance file:// or svn://, when accessing a Subversion repository over the network? If we don't use the svn:// protocol, will be missing out on any features that we couldn't mi... |
What is smart navigation in .NET?
| Smart Navigation is a feature in ASP.NET that enhances the user experience by improving the way web pages respond during postbacks. It provides a more seamless interaction model for web applications by maintaining the state of page controls and the scrolling position in the browser when a postback occurs.
### Key Aspe... | 45,580 | [
{
"from": "human",
"value": "What is smart navigation in .NET? \n"
},
{
"from": "gpt",
"value": "Smart Navigation is a feature in ASP.NET that enhances the user experience by improving the way web pages respond during postbacks. It provides a more seamless interaction model for web applications ... |
I'm using the MultiPoint SDK to create a collaborative educational application for children in less affluent countries, where there is not one computer for each student in the classroom.
Because we need to support up to 40 mice connected to one computer, we need an automated way to test our software. The SDK will suppo... | Creating a test harness to simulate multiple mouse inputs in Windows is a complex task but can be achieved using several methods. Below, I’ll outline an approach you could take to build such a harness using the Windows API, along with some libraries that could help you simulate mouse input.
### Approach Overview
1. *... | 41,768 | [
{
"from": "human",
"value": "I'm using the MultiPoint SDK to create a collaborative educational application for children in less affluent countries, where there is not one computer for each student in the classroom.\nBecause we need to support up to 40 mice connected to one computer, we need an automated wa... |
When editing an XML file in IntelliJ IDEA, if the document references a schema, IDEA will fetch the schema and use the information for auto-complete. It knows which tags are valid in which contexts, so when you hit CTRL-space, it suggests only those tags. It also highlights any tags that are invalid according to the ... | Yes, there are several extensions and tools you can use in Vim to provide functionality similar to what IntelliJ IDEA offers for XML editing, especially with respect to schema validation and auto-completion. Here are a few options:
1. **vim-xml**: This is a built-in syntax highlighting for XML. It doesn’t provide sche... | 47,984 | [
{
"from": "human",
"value": "When editing an XML file in IntelliJ IDEA, if the document references a schema, IDEA will fetch the schema and use the information for auto-complete. It knows which tags are valid in which contexts, so when you hit CTRL-space, it suggests only those tags. It also highlights an... |
I'm looking to learn some fundamentals on cartesian geometry or coordinates based game programming. Platform is irrelevant, although I'm most proficient in JavaScript, C, Objective-C. Ultimately being able to create something such as dots or checkers would be ideal. The idea is for me to learn how sprites work and how ... | It's great that you're interested in learning the fundamentals of Cartesian geometry and game programming! Since you're looking for resources that are not math-heavy and cater to your experience with JavaScript, C, and Objective-C, here are some recommendations:
### Online Courses and Tutorials
1. **Codecademy - Lear... | 44,939 | [
{
"from": "human",
"value": "I'm looking to learn some fundamentals on cartesian geometry or coordinates based game programming. Platform is irrelevant, although I'm most proficient in JavaScript, C, Objective-C. Ultimately being able to create something such as dots or checkers would be ideal. The idea is ... |
If the user does a "onmousedown" inside a iframe, drags outside the iframe and hovers over elements that have a "onmouseover" attached to them - safari does not fire this event.
I have a slightly unconventional drag n drop setup. The items that can be "dragged" are inside a iframe. The drop targets are outside the ifra... | This is a known behavior in Safari (and some other browsers) related to how events are handled across iframes. When you initiate a drag operation inside an iframe and then move the mouse outside of it, the parent document does not receive mouse events in the same way as other browsers do. This is largely due to securit... | 45,121 | [
{
"from": "human",
"value": "If the user does a \"onmousedown\" inside a iframe, drags outside the iframe and hovers over elements that have a \"onmouseover\" attached to them - safari does not fire this event.\nI have a slightly unconventional drag n drop setup. The items that can be \"dragged\" are inside... |
Is it possible to read the data in the php $_SESSION array in the .htaccess file in Apache? So say I have the following:
$_SESSION['foo'] = 'bar';
could I then in .htaccess do something like:
RewriteRule bla.png folder/{the php session var foo}/file.png
Is that possible?
I already have a working workaround but if thi... | No, it is not possible to directly read PHP session variables (such as those stored in the `$_SESSION` array) in the Apache `.htaccess` file. The reason for this is that `.htaccess` files are processed by the Apache web server and operate independently of PHP and its runtime environment. Session variables in PHP are av... | 48,473 | [
{
"from": "human",
"value": "Is it possible to read the data in the php $_SESSION array in the .htaccess file in Apache? So say I have the following:\n$_SESSION['foo'] = 'bar';\n\ncould I then in .htaccess do something like:\nRewriteRule bla.png folder/{the php session var foo}/file.png\n\nIs that possible?... |
I have seen:
http://www...
ftp://blah.blah...
file://blah.blah...
unreal://blah.blah...
mailto://blah.blah...
What is that first section where you see http and the like called?
Can I register my own?
| The first section of a URL, such as `http`, `ftp`, `file`, `unreal`, or `mailto`, is called the **"protocol"** or **"scheme"**. It indicates the method or protocol that the browser should use to access the resource specified in the URL.
As for registering your own protocol, yes, you can create custom URL schemes for u... | 49,666 | [
{
"from": "human",
"value": "I have seen:\n\nhttp://www...\nftp://blah.blah...\nfile://blah.blah...\nunreal://blah.blah...\nmailto://blah.blah...\n\nWhat is that first section where you see http and the like called?\nCan I register my own?\n"
},
{
"from": "gpt",
"value": "The first section of a ... |
We are migrating from one domain to another, and I'd like to be able to keep my same workspace, user settings, history, etc.
Is there any way to change just my domain or log in name within Team Foundation Server?
| Migrating from one domain to another in Team Foundation Server (TFS) can be a bit complex, especially when it comes to preserving your workspace, user settings, and history. Here are some steps you can take to change your domain or login name within TFS:
1. **User Mapping**:
- When you migrate users to a new domain... | 45,619 | [
{
"from": "human",
"value": "We are migrating from one domain to another, and I'd like to be able to keep my same workspace, user settings, history, etc.\nIs there any way to change just my domain or log in name within Team Foundation Server?\n"
},
{
"from": "gpt",
"value": "Migrating from one d... |
I'm trying to produce a report that has multiple grouping but does not just show the group as the single field being grouped. I think it may be best shown with an example:
> Date <- Grouped, broken by page
> Meeting type <- grouped
> Meeting_Time Meeting_Place Meeting_Title Meeting_Priority
> Agenda_... | Creating a report that uses multi-level grouping is a common requirement in reporting tools, and it can certainly be done. Based on your example, it seems like you want to group your report by "Date" and "Meeting type", and then show relevant details such as "Meeting_Time", "Meeting_Place", "Meeting_Title", and "Meetin... | 43,096 | [
{
"from": "human",
"value": "I'm trying to produce a report that has multiple grouping but does not just show the group as the single field being grouped. I think it may be best shown with an example:\n> Date <- Grouped, broken by page \n> Meeting type <- grouped\n> Meeting_Time Meeting_Place Meetin... |
My Firefox 3.0.4 does not display non-existing images at all, or it displays the image alt as plain text (if available).
This way I would have no idea that there is supposed to be an image there.
Does anyone know if there is a way to make it work like IE/Opera? (ie. display a box even if the image file doesn't exists) ... | In Firefox 3.0.4, images that do not exist are typically not displayed at all, which is different from how Internet Explorer and Opera handle missing images. Unfortunately, since Firefox 3.0.4 is quite an old version, support for it has diminished over time, and there may not be many options or plugins available to cha... | 47,761 | [
{
"from": "human",
"value": "My Firefox 3.0.4 does not display non-existing images at all, or it displays the image alt as plain text (if available).\nThis way I would have no idea that there is supposed to be an image there.\nDoes anyone know if there is a way to make it work like IE/Opera? (ie. display a ... |
I'm creating a custom ITask for MSBuild which uploads the output files of my build. I'm using a web deployment project to publish my app and hooking in to the AfterBuild target to do my custom work.
If I add a file to my web application, the first time I do a build, my custom task is not recognizing the recently added... | The issue you're facing with your custom `ITask` in MSBuild, specifically with the `AfterBuild` target not picking up newly added files in the web application, stems from the way MSBuild evaluates item collections.
When you define the `PublishContent` item group before the build begins, it captures the files at that m... | 44,821 | [
{
"from": "human",
"value": "I'm creating a custom ITask for MSBuild which uploads the output files of my build. I'm using a web deployment project to publish my app and hooking in to the AfterBuild target to do my custom work. \nIf I add a file to my web application, the first time I do a build, my custom ... |
I have the table (Product_Id, category priority, atribute1, atribute2...) in MS Access, and I am trying to make a query that orders the data grouped by Category and ordered by the highest priority. Priority can be Null, so it should be placed at the end.
Example:
Table
1, 100, 2, atr1, atr2
2, 300, , atr1, atr2
3, 100... | To achieve the desired ordering in MS Access, you can create a query that groups by the category and orders the records by priority, making sure that null values in the priority column are placed at the end of the result set. Here's how you can structure your SQL query:
```sql
SELECT Product_Id, category_priority, atr... | 48,436 | [
{
"from": "human",
"value": "I have the table (Product_Id, category priority, atribute1, atribute2...) in MS Access, and I am trying to make a query that orders the data grouped by Category and ordered by the highest priority. Priority can be Null, so it should be placed at the end.\nExample:\nTable\n1, 100... |
I currently have a cluster of 4 Apache web servers which are used to serve up static files of up to 30Mb in size. Generally, I can expect up to 5000 concurrent connections to these servers. What performance improvement would I expect to get by moving this to lighttpd?
| Switching from Apache to lighttpd can lead to performance improvements in specific use cases, especially for serving static files and handling a high number of concurrent connections. Here are some key factors to consider regarding potential performance gains:
1. **Event-Driven Architecture**: Lighttpd uses an event-d... | 48,671 | [
{
"from": "human",
"value": "I currently have a cluster of 4 Apache web servers which are used to serve up static files of up to 30Mb in size. Generally, I can expect up to 5000 concurrent connections to these servers. What performance improvement would I expect to get by moving this to lighttpd?\n"
},
... |
Is it possible to access JSTL's forEach variable via code from within the loop?
<c:forEach items="${elements}" var="element">
<% element.someMethod(); %>
</c:forEach>
| In JSP (JavaServer Pages), you can use JSTL (JavaServer Pages Standard Tag Library) to iterate over collections, such as lists or arrays, using the `<c:forEach>` tag. However, you cannot directly access the `element` variable defined in the JSTL tag using the scriptlet `<% ... %>` syntax within the loop.
The variable ... | 49,438 | [
{
"from": "human",
"value": "Is it possible to access JSTL's forEach variable via code from within the loop?\n<c:forEach items=\"${elements}\" var=\"element\">\n <% element.someMethod(); %>\n</c:forEach>\n\n"
},
{
"from": "gpt",
"value": "In JSP (JavaServer Pages), you can use JSTL (JavaServe... |
Is there a utility that can take ALL the SO's that an Elf needs turn them into static then converts the Elf to be SO's free?
| It seems you're asking about a utility or tool that can take all the **"Skill Overrides" (SO)** required by an **"Elf"** in a game or a programming context and convert them into **static values**, effectively removing the need for Skill Overrides altogether.
However, the specifics of your question are not clear withou... | 48,768 | [
{
"from": "human",
"value": "Is there a utility that can take ALL the SO's that an Elf needs turn them into static then converts the Elf to be SO's free? \n"
},
{
"from": "gpt",
"value": "It seems you're asking about a utility or tool that can take all the **\"Skill Overrides\" (SO)** required b... |
I want my validation.xml to only check for a null if certain options are selected from a dropdown. So far I have
<field property="empFDServiceStartDate" depends="requiredif, date">
<arg0 key="Service Start date" resource="false"/>
<var>
<var-name>field[0]</var-name>
<var-... | Based on the information you provided, it looks like you are trying to implement conditional validation in your `validation.xml` for a Struts 1.1 application. The rule you've set up is close, but let's ensure it's correctly configured to enforce the required validation.
Here’s an enhanced example of how you could set ... | 43,431 | [
{
"from": "human",
"value": "I want my validation.xml to only check for a null if certain options are selected from a dropdown. So far I have\n<field property=\"empFDServiceStartDate\" depends=\"requiredif, date\">\n <arg0 key=\"Service Start date\" resource=\"false\"/>\n <var>\n ... |
Ok Here is the exact scenario:
I have a view named Index
I have a partial view (user control) named SayHi
I have an AdminController which has an Action named SayHi which doesn't do anything else
ViewData["Message"] = "Hi There!";
I am using ajax to load partial views from the Index.aspx
so when I have the followinf... | To achieve what you are trying to do with your ASP.NET MVC application, you need to return your partial view along with a way to let the front-end know that the "SayHi" section should be displayed when the AJAX request is made.
Given your requirements, the following steps and code can be implemented to handle this sce... | 45,087 | [
{
"from": "human",
"value": "Ok Here is the exact scenario: \nI have a view named Index\nI have a partial view (user control) named SayHi\nI have an AdminController which has an Action named SayHi which doesn't do anything else \nViewData[\"Message\"] = \"Hi There!\";\n\nI am using ajax to load partial vie... |
I have a page which work like a navigation and a iframe in this page which show the content.
Now there are some situation when the inner page is directly shown in the browser.
eg: if somebody types the inner page's url in the browser address bar, the page is displayed in the window.
I want to prevent this.
Better s... | To prevent your inner page from being displayed directly in the browser and to redirect users back to another page, you can implement a couple of techniques depending on your setup. Here are some common approaches:
### Option 1: Using JavaScript to Detect Frame
You can include a JavaScript snippet on the inner page t... | 48,027 | [
{
"from": "human",
"value": "I have a page which work like a navigation and a iframe in this page which show the content. \nNow there are some situation when the inner page is directly shown in the browser. \neg: if somebody types the inner page's url in the browser address bar, the page is displayed in the... |
If both get and set are compulsory in C# automatic properties, why do I have to bother specifying "get; set;" at all?
| In C#, automatic properties allow you to create properties without having to define a backing field explicitly. When you define an automatic property with `{ get; set; }`, you are specifying that both a getter and a setter are available for that property. This is a shorthand that makes it easier to define simple proper... | 46,735 | [
{
"from": "human",
"value": "If both get and set are compulsory in C# automatic properties, why do I have to bother specifying \"get; set;\" at all?\n"
},
{
"from": "gpt",
"value": "In C#, automatic properties allow you to create properties without having to define a backing field explicitly. Wh... |
I have a string of test like this:
<customtag>hey</customtag>
I want to use a RegEx to modify the text between the "customtag" tags so that it might look like this:
<customtag>hey, this is changed!</customtag>
I know that I can use a MatchEvaluator to modify the text, but I'm unsure of the proper RegEx syntax to use.... | To modify the text between the `<customtag>` tags using a regular expression, you can use a pattern that captures the text inside the tags. Here's a simple approach using C# as an example, but the regex pattern itself will be similar across different programming languages.
### Regular Expression
You can use the follo... | 46,449 | [
{
"from": "human",
"value": "I have a string of test like this:\n<customtag>hey</customtag>\n\nI want to use a RegEx to modify the text between the \"customtag\" tags so that it might look like this:\n<customtag>hey, this is changed!</customtag>\n\nI know that I can use a MatchEvaluator to modify the text, ... |
I'm trying to run the Camel Example "camel-example-spring-jms" (also at http://activemq.apache.org/camel/tutorial-jmsremoting.html).
However, when I try to start Camel using "org.apache.camel.spring.Main" class, I get the error saying
"Configuration problem: Unable to locate Spring NamespaceHandler for XML schema names... | The error you're encountering typically arises from the Spring XML configuration being unable to find the necessary classes or schemas to handle the ActiveMQ XML namespace (`http://activemq.apache.org/schema/core`). Here are some steps to troubleshoot and potentially resolve the issue:
### 1. Check Dependencies
Make s... | 44,355 | [
{
"from": "human",
"value": "I'm trying to run the Camel Example \"camel-example-spring-jms\" (also at http://activemq.apache.org/camel/tutorial-jmsremoting.html).\nHowever, when I try to start Camel using \"org.apache.camel.spring.Main\" class, I get the error saying\n\"Configuration problem: Unable to loc... |
I have a custom WinForms control (inherits from control, i.e. without user interface jsut as Timer) to which I want to add a custom command add design time.
This could be similar to the "right click and choose 'Edit Items...'" of a menu.
Is this posisble? How?
Also, could you recommend some general reading (online) ab... | Yes, it is possible to add custom commands to your WinForms control that can be accessed during design time. To do this, you'll typically implement the `IComponentChangeService` interface, add a custom menu item, and handle the logic for the command.
Here's a basic example of how to add a custom command to your contro... | 44,502 | [
{
"from": "human",
"value": "I have a custom WinForms control (inherits from control, i.e. without user interface jsut as Timer) to which I want to add a custom command add design time. \nThis could be similar to the \"right click and choose 'Edit Items...'\" of a menu.\nIs this posisble? How?\nAlso, could ... |
my global.asax looks like this
Imports Castle.Windsor
Imports Castle.Windsor.Configuration.Interpreters
Public Class MvcApplication
Inherits System.Web.HttpApplication
Implements IContainerAccessor
Private Shared IoC As IWindsorContainer
Shared Sub RegisterRoutes(ByVal routes As RouteCollection)
... | To access the `Container` property from within a model class in your ASP.NET MVC application, you generally want to avoid tightly coupling your model classes to the infrastructure details like the IoC container. However, if you need to access the `Container` property directly within a model class, you can accomplish th... | 45,797 | [
{
"from": "human",
"value": "my global.asax looks like this\nImports Castle.Windsor\nImports Castle.Windsor.Configuration.Interpreters\n\nPublic Class MvcApplication\n Inherits System.Web.HttpApplication\n Implements IContainerAccessor\n\n Private Shared IoC As IWindsorContainer\n\n Shared Sub R... |
I have a base class that has a private static member:
class Base
{
private static Base m_instance = new Base();
public static Base Instance
{
get { return m_instance; }
}
}
And I want to derive multiple classes from this:
class DerivedA : Base {}
class DerivedB : Base {}
class DerivedC : Base {... | Yes, there is a design pattern that can help you with this situation called the **Factory Method** pattern, and another potential solution is to use the **Singleton** pattern, but with some adjustments for inheritance.
The core problem you're facing is that the `Base` class is implementing a Singleton pattern which is... | 41,188 | [
{
"from": "human",
"value": "I have a base class that has a private static member:\nclass Base\n{\n private static Base m_instance = new Base();\n public static Base Instance\n {\n get { return m_instance; }\n }\n}\n\nAnd I want to derive multiple classes from this:\nclass DerivedA : Base... |
I am a Java programmer and need to work on a Flex/ActionScript project right now. I got an example of using ITreeDataDesriptor from Flex 3 Cookbook, but there is one line of actionscript code that's hard for me to understand. I appreciate if someone could explain this a little further.
public function getData(node:Obj... | Certainly! Let's break down that line of ActionScript code within the context of the `getData` function:
```actionscript
return {children:{label:node.name, label:node.address}};
```
### Explanation
1. **Object Literals**:
- In ActionScript, you can create an object using curly braces `{}`. This is known as an obj... | 46,774 | [
{
"from": "human",
"value": "I am a Java programmer and need to work on a Flex/ActionScript project right now. I got an example of using ITreeDataDesriptor from Flex 3 Cookbook, but there is one line of actionscript code that's hard for me to understand. I appreciate if someone could explain this a little f... |
An application is hanging occasionally, and I would like to see the dump at the time to figure it out. I had written an application that the user can run to automatically create a dump that I can look at. However I can't seem to get the users to remember to run it when it hangs, no matter what I try. They always end up... | Dealing with application hangs on Windows Server 2003, especially in a multi-user environment, can indeed be challenging. While your situation is complicated by user behavior, here are some possible solutions to help you retain the dump files without requiring user intervention:
### 1. **Modify Windows Error Reporting... | 45,605 | [
{
"from": "human",
"value": "An application is hanging occasionally, and I would like to see the dump at the time to figure it out. I had written an application that the user can run to automatically create a dump that I can look at. However I can't seem to get the users to remember to run it when it hangs,... |
I have a table of data sorted by date, from which a user can select a set of data by supplying a start and end date. The data itself is non-continuous, in that I don't have data for weekends and public holidays.
I would like to be able to list all the days that I don't have data for in the extracted dataset. Is there ... | Certainly! In Java, you can accomplish this by following a structured approach. You'll need to check the selected date range and compare it with the available dates to determine which dates in the range do not have data. Below is a simple way to do this.
Here's a sample implementation:
```java
import java.time.LocalD... | 44,581 | [
{
"from": "human",
"value": "I have a table of data sorted by date, from which a user can select a set of data by supplying a start and end date. The data itself is non-continuous, in that I don't have data for weekends and public holidays. \nI would like to be able to list all the days that I don't have da... |
Is there anyway possible to set the clearButtonMode for a UITextField in Interface Builder? Is this only possible to do code? I do not see it as an option in the UITextField attributes panel.
| As of my knowledge cutoff in October 2023, the `clearButtonMode` property for a `UITextField` cannot be directly set through Interface Builder. The `clearButtonMode` property allows you to specify when the clear button should appear in the text field, but this property is not exposed in the Interface Builder's attribut... | 49,733 | [
{
"from": "human",
"value": "Is there anyway possible to set the clearButtonMode for a UITextField in Interface Builder? Is this only possible to do code? I do not see it as an option in the UITextField attributes panel.\n"
},
{
"from": "gpt",
"value": "As of my knowledge cutoff in October 2023,... |
How can I get a PL/SQL block to output the results of a SELECT statement the same way as if I had done a plain SELECT?
For example how to do a SELECT like:
SELECT foo, bar FROM foobar;
Hint :
BEGIN
SELECT foo, bar FROM foobar;
END;
doesn't work.
| In PL/SQL, the syntax you've provided will not work because a PL/SQL block cannot directly output the results of a `SELECT` statement in the same way a standard SQL query does. However, you can achieve the desired effect by using a cursor or directly using a loop to retrieve the results and then using `DBMS_OUTPUT.PUT_... | 45,319 | [
{
"from": "human",
"value": "How can I get a PL/SQL block to output the results of a SELECT statement the same way as if I had done a plain SELECT?\nFor example how to do a SELECT like:\nSELECT foo, bar FROM foobar;\n\nHint :\nBEGIN\nSELECT foo, bar FROM foobar;\nEND;\n\ndoesn't work.\n"
},
{
"from"... |
I would like to learn the best practices to employ when creating a database driven web-application.
I prefer to learn from examples.
What is a good sample application that I can download and run to learn this:
I am looking for:
Should be written in C# (preferably)
Should contain a complex database design (parent chil... | Creating a database-driven web application with best practices in mind is an excellent way to learn both C# and database design. Below, I'll outline a sample application that meets your criteria and provide some resources to help you get started.
### Sample Application: ASP.NET Core MVC with Oracle Database
#### Appl... | 43,528 | [
{
"from": "human",
"value": "I would like to learn the best practices to employ when creating a database driven web-application.\nI prefer to learn from examples. \nWhat is a good sample application that I can download and run to learn this:\nI am looking for:\n\nShould be written in C# (preferably)\nShould... |
I've recently have a reason to include into our build script the creation of an XML configuration file. The most straightforward way I can think of to do this is to hard-code the XML content as a string into the script and then to simply create a file and write that XML string to the file (named appropriately etc). Is ... | Hard-coding XML content in a VBScript can be straightforward but may not be the most elegant or maintainable approach, especially if your XML configuration is complex or might change in the future. Here are some alternative methods you can consider for creating an XML configuration file in VBScript:
### 1. Use an XML ... | 43,959 | [
{
"from": "human",
"value": "I've recently have a reason to include into our build script the creation of an XML configuration file. The most straightforward way I can think of to do this is to hard-code the XML content as a string into the script and then to simply create a file and write that XML string t... |
In jQuery, how do you select the <a> which href is pointing to the current URL
For example:
URL = http://server/dir/script.aspx?id=1
I want to select this <a>
<a href="/dir/script.aspx">...</a>
I tried this but it doesn't work:
var url = window.location.href;
$('#ulTopMenu a["'+url+'"*=href]').addClass("selected");
Pr... | To select an `<a>` element with an `href` attribute that matches the current URL, you can use jQuery's attribute selectors. However, your syntax has a few issues. Here’s how you can achieve that:
1. First, get the current URL path without any query parameters.
2. Then, use the `filter()` method to find the link that m... | 49,127 | [
{
"from": "human",
"value": "In jQuery, how do you select the <a> which href is pointing to the current URL\nFor example:\nURL = http://server/dir/script.aspx?id=1\nI want to select this <a>\n<a href=\"/dir/script.aspx\">...</a>\nI tried this but it doesn't work:\nvar url = window.location.href;\n$('#ulTopM... |
How I can configure Jboss 5 to support EJB2?
I'm testing the new release of jboss (5) and need to deploy my old EJB2
| Configuring JBoss 5 to support EJB 2 is typically straightforward since JBoss has built-in support for EJB 2.x specifications. Here are the steps to ensure that your EJB 2 applications can be deployed successfully on JBoss 5:
### 1. **Install JBoss 5**
First, download and install JBoss 5 if you haven't done so alread... | 38,331 | [
{
"from": "human",
"value": "How I can configure Jboss 5 to support EJB2?\nI'm testing the new release of jboss (5) and need to deploy my old EJB2\n"
},
{
"from": "gpt",
"value": "Configuring JBoss 5 to support EJB 2 is typically straightforward since JBoss has built-in support for EJB 2.x speci... |
Using Ruby I'm trying to split the following text with a Regex
~foo\~\=bar =cheese~monkey
Where ~ or = denotes the beginning of match unless it is escaped with \
So it should match
~foo\~\=bar
then
=cheese
then
~monkey
I thought the following would work, but it doesn't.
([~=]([^~=]|\\=|\\~)+)(.*)
What is a better ... | It looks like you're looking for a way to split a string based on certain delimiters (`~` and `=`) while respecting escape sequences. Your initial regex was on the right track, but you need a more tailored approach to properly handle escaped characters.
Given the requirements you've laid out, here's a refined approach... | 45,258 | [
{
"from": "human",
"value": "Using Ruby I'm trying to split the following text with a Regex\n~foo\\~\\=bar =cheese~monkey\n\nWhere ~ or = denotes the beginning of match unless it is escaped with \\\nSo it should match\n~foo\\~\\=bar\n\nthen\n=cheese\n\nthen\n~monkey\n\nI thought the following would work, bu... |
Should I invest time learning Microsoft's new F# language?
I am mainly a C# .NET developer and I wonder if learning F# will be of any help in developing today's typical applications.
| Investing time in learning F# can be beneficial, especially for someone with a background in C# and .NET development. Here are some reasons why you might consider learning F#:
1. **Functional Programming Paradigm**: F# is a functional-first language, which means it emphasizes functional programming concepts. Understan... | 48,437 | [
{
"from": "human",
"value": "Should I invest time learning Microsoft's new F# language?\nI am mainly a C# .NET developer and I wonder if learning F# will be of any help in developing today's typical applications.\n"
},
{
"from": "gpt",
"value": "Investing time in learning F# can be beneficial, e... |
I am currently doing some socket programming using C/C++. To be able to use a somewhat cleaner interface, and a more OO structure, I decided to write a few simple wrapper classes around parts of the C socket API, but while doing so I stumbled upon a problem:
Given the following code:
// Global method
int foo(int x)
{
... | The issue you're encountering stems from C++'s name resolution rules, particularly when it comes to member functions and global functions.
In your code:
```cpp
// Global method
int foo(int x)
{
return x;
}
// Class that calls the global method
class FooBar
{
public:
void foo() { return; };
void baz() { f... | 45,182 | [
{
"from": "human",
"value": "I am currently doing some socket programming using C/C++. To be able to use a somewhat cleaner interface, and a more OO structure, I decided to write a few simple wrapper classes around parts of the C socket API, but while doing so I stumbled upon a problem:\nGiven the following... |
We have created a list of traps (notifications) that our application is exposing and described it in a MIB file.
Today, we found ourselves in a situation where we need to update the MIB and add an additional (optional) parameter to the trap (update the Objects)
so that, in the end, we'll have an existing notification t... | Your understanding is generally correct, and here's a more detailed explanation of how SNMP and MIBs work in relation to your scenario:
### Scenario 1: Customer Did Not Install the Updated MIB
- **Sending a Trap with a New Parameter**: If you send a trap that includes the new optional parameter, the SNMP manager (if i... | 44,526 | [
{
"from": "human",
"value": "We have created a list of traps (notifications) that our application is exposing and described it in a MIB file.\nToday, we found ourselves in a situation where we need to update the MIB and add an additional (optional) parameter to the trap (update the Objects)\nso that, in the... |
In my application, there are publishers and categories. One publisher can belong to several categories. When I make my mysql transaction, it will return the same publisher record for each category it belongs to. Here's the query:
SELECT
grdirect_publisher.name,
grdirect_publisher.short_description,
grdir... | To ensure that each publisher shows up only once in the results, you can use the `GROUP_CONCAT` function in your SQL query. This function concatenates values from multiple rows into a single string, which is particularly useful for this scenario where a publisher can belong to multiple categories.
Here's how you can ... | 45,804 | [
{
"from": "human",
"value": "In my application, there are publishers and categories. One publisher can belong to several categories. When I make my mysql transaction, it will return the same publisher record for each category it belongs to. Here's the query:\nSELECT\n grdirect_publisher.name,\n grd... |
public class doublePrecision {
public static void main(String[] args) {
double total = 0;
total += 5.6;
total += 5.8;
System.out.println(total);
}
}
The above code prints:
11.399999999999
How would I get this to just print (or be able to use it as) 11.4?
| In Java, the issue you are encountering is due to how floating-point numbers (like `double`) are represented in binary, which can lead to small precision errors. To round a `double` value to a specific number of decimal places for output, you can use `String.format`, `DecimalFormat`, or `System.out.printf`.
Here are ... | 49,164 | [
{
"from": "human",
"value": "public class doublePrecision {\n public static void main(String[] args) {\n\n double total = 0;\n total += 5.6;\n total += 5.8;\n System.out.println(total);\n }\n}\n\nThe above code prints:\n11.399999999999\n\nHow would I get this to just print ... |
I'm trying to sort the columns of a datagrid A to Z, the code below works apart from I get a column beginning with 'c' in between the 'A' (e.g. a,a,a,a,c,a,a,b,b,b), this happens the first time I run the code. If I then use columnNames.Reverse(); (Z to A) and then re-run columnNames.Sort() (A to Z) it sorts correctly. ... | The issue you're experiencing with the sorting of column headers in your `DataGridView` is likely due to the way you are setting the `DisplayIndex` for the columns after sorting the `columnNames` list. When you use `columnNames.IndexOf(col.HeaderText)` to set the `DisplayIndex`, it's possible that the method is not ret... | 48,620 | [
{
"from": "human",
"value": "I'm trying to sort the columns of a datagrid A to Z, the code below works apart from I get a column beginning with 'c' in between the 'A' (e.g. a,a,a,a,c,a,a,b,b,b), this happens the first time I run the code. If I then use columnNames.Reverse(); (Z to A) and then re-run columnN... |
In order to provide nice URLs between parts of our app we split everything up into several modules which are compiled independently. For example, there is a "manager" portion and an "editor" portion. The editor launches in a new window. By doing this we can link to the editor directly:
/com.example.EditorApp?id=1
The ... | Your situation highlights a common challenge when structuring modular applications while trying to maintain clean URLs and minimize code duplication. Both approaches you mentioned have their pros and cons. Here are some considerations and potential solutions to help you decide on the best path forward:
### 1. **Keep S... | 39,381 | [
{
"from": "human",
"value": "In order to provide nice URLs between parts of our app we split everything up into several modules which are compiled independently. For example, there is a \"manager\" portion and an \"editor\" portion. The editor launches in a new window. By doing this we can link to the edito... |
I have a Java method which returns an array of doubles. I would then like to store these values in individual variables in the calling function. Is there an elegant way of doing this in Java.
I could write it as this:
double[] returnValues = calculateSomeDoubles();
double firstVar = returnValues[0];
double secondVar =... | In Java, you can't destructure arrays like you can in some other languages (e.g., Python or JavaScript) due to its stronger type system. However, you can achieve a similar effect using a couple of approaches to keep your code more concise.
### 1. Using Array Destructuring with Helper Method
While you cannot directly d... | 44,585 | [
{
"from": "human",
"value": "I have a Java method which returns an array of doubles. I would then like to store these values in individual variables in the calling function. Is there an elegant way of doing this in Java.\nI could write it as this:\ndouble[] returnValues = calculateSomeDoubles();\ndouble fir... |
I need to build a terminal-like application that needs to be used under my usual Ubuntu install but also under Windows. I've been looking for a terminal component that accepts commands and is able to show some kind of command history together with output.
There is a component called VTE that is used in gnome-terminal, ... | Building a terminal-like application that works on both Ubuntu and Windows can be challenging, particularly with components like VTE, which are heavily tied to Unix/Linux functionality. However, there are a few alternatives and approaches you can consider for developing a cross-platform terminal application using GTK:
... | 44,878 | [
{
"from": "human",
"value": "I need to build a terminal-like application that needs to be used under my usual Ubuntu install but also under Windows. I've been looking for a terminal component that accepts commands and is able to show some kind of command history together with output.\nThere is a component c... |
I have a form made up of multiple, optional subparts - each of which is enclosed in a
<div class="details"></div>
When editing the form I would like to hide those subparts which aren't as yet completed, and obviously I would like to do it unobtrusively. To simplify things I'm just checking to see if those fields whose... | You're on the right track with your jQuery code, but there are a couple of adjustments to make it work correctly. The `:empty` selector checks if the element contains no children at all, including text nodes. For input elements, you want to check if their `value` is empty, which is not what `:empty` does.
Instead, you... | 46,176 | [
{
"from": "human",
"value": "I have a form made up of multiple, optional subparts - each of which is enclosed in a\n<div class=\"details\"></div>\n\nWhen editing the form I would like to hide those subparts which aren't as yet completed, and obviously I would like to do it unobtrusively. To simplify things ... |
I have just come across a Visual C++ option that allows you to force file(s) to be included - this came about when I was looking at some code that was missing a #include "StdAfx.h" on each .cpp file, but was actually doing so via this option.
The option can be found on the Advanced C/C++ Configuration Properties page a... | Using the `/FI` (Force Include) compiler option in Visual C++ can certainly be a useful feature, but it's important to be aware of potential issues and best practices before adopting it widely. Here are some considerations:
### Gotchas and Considerations:
1. **Implicit Dependencies**: When you use `/FI` to include a ... | 45,972 | [
{
"from": "human",
"value": "I have just come across a Visual C++ option that allows you to force file(s) to be included - this came about when I was looking at some code that was missing a #include \"StdAfx.h\" on each .cpp file, but was actually doing so via this option.\nThe option can be found on the Ad... |
I'm trying to run a c++ 2d array (pretty simple file) and it works but an error (at least I think it's an error) appears on the end.
The code for the array is;
int myArray[10][10];
for (int i = 0; i <= 9; ++i){
for (int t = 0; t <=9; ++t){
myArray[i][t] = i+t; //This will give each element a value
}
... | The output you see (`0x22fbb0`) at the end of your program is likely coming from the fact that you're missing a closing brace for your final `for` loop and the entire function in which you're running this code. In C++, if you don't correctly close your functions or scopes with the appropriate braces, the compiler might... | 44,662 | [
{
"from": "human",
"value": "I'm trying to run a c++ 2d array (pretty simple file) and it works but an error (at least I think it's an error) appears on the end.\nThe code for the array is;\nint myArray[10][10];\nfor (int i = 0; i <= 9; ++i){\n\n for (int t = 0; t <=9; ++t){\n\n myArray[i][t] = i+... |
Thats what I am using to read e-mail using C#:
outLookApp.NewMailEx += new ApplicationEvents_11_NewMailExEventHandler(outLookApp_NewMailEx);
Outlook.NameSpace olNameSpace = outLookApp.GetNamespace("mapi");
olNameSpace.Logon("xxxx", "xxxxx", false, true);
Outlook.MAPIFolder oInbox = olNameSpace.GetDefaultF... | If you're encountering the "The server is not available" exception when trying to access Outlook data while Outlook is closed, this is because the Outlook COM object model requires the Outlook application to be running in order to function properly. When Outlook is closed, there is no running instance to connect to, wh... | 45,460 | [
{
"from": "human",
"value": "Thats what I am using to read e-mail using C#:\noutLookApp.NewMailEx += new ApplicationEvents_11_NewMailExEventHandler(outLookApp_NewMailEx);\n Outlook.NameSpace olNameSpace = outLookApp.GetNamespace(\"mapi\");\n\nolNameSpace.Logon(\"xxxx\", \"xxxxx\", false, true);\n... |
I would like to keep a static counter in a garbage collected class and increment it using Interlocked::Increment. What's the C++/CLI syntax to do this?
I've been trying variations on the following, but no luck so far:
ref class Foo
{
static __int64 _counter;
__int64 Next()
{
return System::Threading::I... | In C++/CLI, to use `Interlocked::Increment` with a static member variable, you'll need to ensure that you're working with a managed type correctly. The issue you're encountering is likely due to trying to use the address-of operator (`&`) on a managed variable.
In managed C++/CLI, static fields are handled differentl... | 45,661 | [
{
"from": "human",
"value": "I would like to keep a static counter in a garbage collected class and increment it using Interlocked::Increment. What's the C++/CLI syntax to do this?\nI've been trying variations on the following, but no luck so far:\nref class Foo\n{\n static __int64 _counter;\n\n __int6... |
What I can think of is pre-populating certain form input elements based on the user's geographical information.
What are other ways can you think of to speed up user input on long application forms?
Or at least keep them focus on completing the application form?
| Improving user input on long application forms involves both optimizing the form design and enhancing user engagement. Here are several strategies to speed up user input and keep users focused:
### 1. **Progress Indicators**
- **Progress Bars:** Show a visual indicator of progress through the form, so users know ho... | 44,172 | [
{
"from": "human",
"value": "What I can think of is pre-populating certain form input elements based on the user's geographical information.\nWhat are other ways can you think of to speed up user input on long application forms?\nOr at least keep them focus on completing the application form?\n"
},
{
... |
(I'm using the pyprocessing module in this example, but replacing processing with multiprocessing should probably work if you run python 2.6 or use the multiprocessing backport)
I currently have a program that listens to a unix socket (using a processing.connection.Listener), accept connections and spawns a thread hand... | To achieve a graceful shutdown of your Unix socket server while handling incoming connections in a non-blocking manner, you can indeed employ the use of threads, but with a more elegant approach to interrupt the blocking `accept()` call. Here’s an approach using an event or a flag, which allows for a controlled shutdow... | 44,453 | [
{
"from": "human",
"value": "(I'm using the pyprocessing module in this example, but replacing processing with multiprocessing should probably work if you run python 2.6 or use the multiprocessing backport)\nI currently have a program that listens to a unix socket (using a processing.connection.Listener), a... |
Possible Duplicate:
When to use “strictfp” keyword in java?
What is the use of Strictfp method in java?
| The `strictfp` keyword in Java is used to ensure that floating-point calculations adhere to a specific, consistent behavior across different platforms. It stands for "strict floating-point" and was introduced in Java 1.2.
Here are the key points about `strictfp`:
1. **Consistency Across Platforms**: When you declare ... | 47,108 | [
{
"from": "human",
"value": "\nPossible Duplicate:\nWhen to use “strictfp” keyword in java? \n\nWhat is the use of Strictfp method in java?\n"
},
{
"from": "gpt",
"value": "The `strictfp` keyword in Java is used to ensure that floating-point calculations adhere to a specific, consistent behavior... |
Image i have a view that is cached with the OutputCache attribute but i still need to increment a counter that records that the page has been viewed, how could i do it?
I thought about creating my own Custom ActionFilterAttribute, and using Action Filter Order of Execution to record this .. but i'm not sure it will wor... | You're on the right track considering custom action filters and the order of execution, but there are a few points to clarify and some strategies to consider for incrementing a view count while leveraging caching with `OutputCache`.
### 1. Understanding Output Caching
You're correct in assuming that if the result is ... | 43,814 | [
{
"from": "human",
"value": "Image i have a view that is cached with the OutputCache attribute but i still need to increment a counter that records that the page has been viewed, how could i do it?\nI thought about creating my own Custom ActionFilterAttribute, and using Action Filter Order of Execution to r... |
F
Is there a way to monitor the FTP port so that I can know what commands my FTP application is sending to a FTP server?
I am using a closed-source FTP client application, which is not working with a closed-source FTP application server. The client and the server are not communicating well with each other, and I would ... | Yes, there are several tools and methods you can use to monitor FTP traffic and capture the commands being sent from your FTP client to the server. Here are a few options:
1. **Wireshark**: This is a powerful network protocol analyzer that can capture and display the data traveling over a network in real time. You can... | 44,106 | [
{
"from": "human",
"value": "F\nIs there a way to monitor the FTP port so that I can know what commands my FTP application is sending to a FTP server?\nI am using a closed-source FTP client application, which is not working with a closed-source FTP application server. The client and the server are not commu... |
In our Sharepoint implementation users have been granted site collection admin rights. On a few occasions they've managed to delete a subsite or even the entire site collection. I'd like to be able to block this but not being a developer I'm finding it pretty tricky.
I've had a look at the MSIT site delete capture tool... | In SharePoint, controlling the deletion of site collections and subsites, especially when users have been granted Site Collection Administrator rights, can be a challenging task. Unfortunately, due to the inherent nature of SharePoint permissions and its architecture, there isn’t a built-in way to completely override o... | 43,496 | [
{
"from": "human",
"value": "In our Sharepoint implementation users have been granted site collection admin rights. On a few occasions they've managed to delete a subsite or even the entire site collection. I'd like to be able to block this but not being a developer I'm finding it pretty tricky.\nI've had a... |
Where can you get information on the ASP.NET State Service e.g. how it works, performance, behaviour characteristics etc.
Have looked on internet but cant find in depth information or an article dedicated to the subject.
Thanks
| Finding in-depth information about the ASP.NET State Service can be a bit challenging since it is a more specialized topic. However, there are several resources you can explore to learn more about how it works, its performance characteristics, and behavior:
### Official Documentation
1. **Microsoft Documentation**: St... | 46,519 | [
{
"from": "human",
"value": "Where can you get information on the ASP.NET State Service e.g. how it works, performance, behaviour characteristics etc.\nHave looked on internet but cant find in depth information or an article dedicated to the subject.\nThanks\n"
},
{
"from": "gpt",
"value": "Find... |
I want to send an array constructed in javascript with the selected values of a multiple select. Is there a way to send this array to a php script using ajax?
| Yes, you can send an array of selected values from a multiple select input to a PHP script using AJAX in JavaScript. Here’s a step-by-step guide on how to achieve this:
### Step 1: HTML Structure
First, create a multiple select element in your HTML:
```html
<select id="mySelect" multiple>
<option value="1">Optio... | 43,393 | [
{
"from": "human",
"value": "I want to send an array constructed in javascript with the selected values of a multiple select. Is there a way to send this array to a php script using ajax?\n"
},
{
"from": "gpt",
"value": "Yes, you can send an array of selected values from a multiple select input ... |
I'm trying to write a script that will create a file on the server then use header() to redirect the user to that file. Then, after about 10 seconds I want to delete the file. I've tried this:
header('Location: '.$url);
flush();
sleep(10);
unlink($url);
But the browser just waits for the script to complete then gets r... | In your PHP script, when you call `header('Location: '.$url)`, it will not actually send the HTTP response to the client until the script finishes executing. This is why the browser is waiting for the script to complete, and the file is deleted before the user gets redirected.
To achieve the desired behavior of redire... | 44,387 | [
{
"from": "human",
"value": "I'm trying to write a script that will create a file on the server then use header() to redirect the user to that file. Then, after about 10 seconds I want to delete the file. I've tried this:\nheader('Location: '.$url);\nflush();\nsleep(10);\nunlink($url);\n\nBut the browser ju... |
I am trying to write a JavaScript script to add to greasemonkey that adds a button after an element. The onClick for this button should copy the parents element text to the keyboard. I have seen plenty of examples that copy already selected text to the clipboard such as this:
<SCRIPT LANGUAGE="JavaScript">
<!--... | To create a Greasemonkey script that adds a button to copy the text of a parent element to the clipboard, you can utilize the modern Clipboard API in JavaScript. The example you provided relies on document selection, which isn't necessary for copying text from a specified element directly.
Here's a simplified version ... | 44,065 | [
{
"from": "human",
"value": "I am trying to write a JavaScript script to add to greasemonkey that adds a button after an element. The onClick for this button should copy the parents element text to the keyboard. I have seen plenty of examples that copy already selected text to the clipboard such as this:\n ... |
I put together a class yesterday to do some useful task. I started alpha testing, and at some point realized I was adding alpha test related methods to the class itself. It hit me that they don't belong there. After a bit of head scratching I derived a test class from the base class that has access to the protected ... | It's great to hear that you are thinking critically about the design of your classes and how to effectively implement testing without bloating them. Here are some techniques and best practices that can help you maintain the integrity of your classes while facilitating effective alpha and unit testing:
### 1. **Use Tes... | 45,102 | [
{
"from": "human",
"value": "I put together a class yesterday to do some useful task. I started alpha testing, and at some point realized I was adding alpha test related methods to the class itself. It hit me that they don't belong there. After a bit of head scratching I derived a test class from the bas... |
Our team is migrating from VSS 6.0 to TFS 2008 to be used for source control purposes. I am wondering if anyone has any experience with this migration. In particular, we are interested in preserving the history of files in source control, as well as any other potential gotchas.
| Migrating from Visual SourceSafe (VSS) 6.0 to Team Foundation Server (TFS) 2008 can be a significant step, especially in terms of preserving your source control history and ensuring a smooth transition for your team. Here are some key points and best practices based on experiences from others who have gone through this... | 46,882 | [
{
"from": "human",
"value": "Our team is migrating from VSS 6.0 to TFS 2008 to be used for source control purposes. I am wondering if anyone has any experience with this migration. In particular, we are interested in preserving the history of files in source control, as well as any other potential gotchas.\... |
How do you gracefully handle failed future feature imports? If a user is running using Python 2.5 and the first statement in my module is:
from __future__ import print_function
Compiling this module for Python 2.5 will fail with a:
File "__init__.py", line 1
from __future__ import print_function
SyntaxError: fut... | Handling failed future feature imports gracefully in Python, especially in older versions like 2.5, is a bit tricky because of the strict requirements around where future imports must appear in the code. Since Python 2.5 does not support `print_function`, you'll need to check the Python version at the very start of you... | 48,930 | [
{
"from": "human",
"value": "How do you gracefully handle failed future feature imports? If a user is running using Python 2.5 and the first statement in my module is:\nfrom __future__ import print_function\n\nCompiling this module for Python 2.5 will fail with a:\n File \"__init__.py\", line 1\n from _... |
I am using a piece of html something like the following:-
<a class="somePseudoClass" title="Blablabla">Something</a>
and I have the following css in an imported file.
a.somePseudoClass:hover {color: #000000; text-decoration: underline;}
This works perfectly in Firefox 2.0 but in IE6 the underline fails to show.
D... | The issue you're experiencing with the underline not appearing on hover in Internet Explorer 6 is a known problem with how the browser handles certain CSS properties. Here are a few workarounds that you can try:
### Workaround 1: Use `display: inline-block;`
Sometimes forcing the link to behave like a block element ca... | 47,955 | [
{
"from": "human",
"value": "I am using a piece of html something like the following:-\n<a class=\"somePseudoClass\" title=\"Blablabla\">Something</a>\n\nand I have the following css in an imported file.\na.somePseudoClass:hover {color: #000000; text-decoration: underline;}\n\nThis works perfectly in Fi... |
I'm terrible with regex, but I've had a try and a Google (and even looked in reddit's source) and I'm still stuck so here goes:
My aim is to match the following 'codes' and replace them with the HTML tags. It's just the regex I'm stuck with.
**bold text**
_italic text_
~hyperlink~
Here's my attempts at the bold one:
^... | Your regex attempts to match double asterisks for bold text, but there are a few issues with it. Let’s break it down and improve it step by step:
1. **Matching Bold Text:** You want to match text wrapped in double asterisks (`**text**`). The regex you provided, `^\*\*([.^\*]+)\*\*$`, is almost there, but let’s adjust ... | 46,728 | [
{
"from": "human",
"value": "I'm terrible with regex, but I've had a try and a Google (and even looked in reddit's source) and I'm still stuck so here goes:\nMy aim is to match the following 'codes' and replace them with the HTML tags. It's just the regex I'm stuck with.\n**bold text**\n_italic text_\n~hype... |
Are there any Code Generators that would take a well-formed XML document, and write out an XSD schema based on how the XML document is structured?
| Yes, there are several tools and libraries that can generate an XML Schema Definition (XSD) from a well-formed XML document. Here are some popular ones:
1. **XMLSpy**: Altova's XMLSpy is a comprehensive XML editor that can generate an XSD from an XML file. It's a commercial product, but it offers a wide range of XML-r... | 44,992 | [
{
"from": "human",
"value": "Are there any Code Generators that would take a well-formed XML document, and write out an XSD schema based on how the XML document is structured?\n"
},
{
"from": "gpt",
"value": "Yes, there are several tools and libraries that can generate an XML Schema Definition (... |
While there appears to some documentation on how to expose JMX through various firewall and tunneling schemes, I sort of want the opposite. I want to ensure that JMX is only accessible to local machine. Unfortunately it appears that the "out of the box" management options do not allow restricting the ports to a local... | To restrict Java Management Extensions (JMX) to be accessible only from the local machine, you can configure it to bind only to the localhost interface (typically 127.0.0.1). By default, JMX might listen on all network interfaces, which can pose a security risk if you're concerned about exposing management functionalit... | 43,196 | [
{
"from": "human",
"value": "While there appears to some documentation on how to expose JMX through various firewall and tunneling schemes, I sort of want the opposite. I want to ensure that JMX is only accessible to local machine. Unfortunately it appears that the \"out of the box\" management options do... |
I'm having problems with this.
The thing is that when I send an MMS with J2ME to another devices with JSR 205 (two tested: SonyEriccson w610i and Nokia 5300), a receiving icon flashes, but the message is not in the inbox folder. I think this happens because of the application ID -which may not be recognized-, so, is th... | When sending MMS messages using J2ME (Java 2 Micro Edition) with JSR 205 (the MMS API), there are a few things to keep in mind to ensure compatibility across different devices. Here are some considerations and suggestions that might help address the issue you're experiencing:
1. **Application ID**: The application ID ... | 44,121 | [
{
"from": "human",
"value": "I'm having problems with this.\nThe thing is that when I send an MMS with J2ME to another devices with JSR 205 (two tested: SonyEriccson w610i and Nokia 5300), a receiving icon flashes, but the message is not in the inbox folder. I think this happens because of the application I... |
Which techniqes would you use to implement a search for contents in a column on a very big table in MySql? Say for instance that you have 10.000.000 emails stored in a table in the database and would like to implement a subject search, that would enable me to search for one or more words that was present in the email ... | When dealing with large datasets, such as a table containing 10 million email subjects, optimizing your search functionality is critical for performance. There are several techniques you can employ in MySQL, as well as alternative databases that better support full-text search. Here are a few methods to consider:
### ... | 46,400 | [
{
"from": "human",
"value": "Which techniqes would you use to implement a search for contents in a column on a very big table in MySql? Say for instance that you have 10.000.000 emails stored in a table in the database and would like to implement a subject search, that would enable me to search for one or ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.