instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Which of the following has the best performance?
I have seen method two implemented in JavaScript with huge performance gains, however, I was unable to measure any gain in C# and was wondering if the compiler already does method 2 even when written like method 1.
The theory behind method 2 is that the code doesn't have... | The performance difference between the two methods you're comparing (Method 1 and Method 2) largely hinges on how the `DataTable.Rows.Count` property is implemented in the context of your code.
### Explanation of the Two Methods:
1. **Method 1:**
```csharp
for (int i = 0; i < DataTable.Rows.Count; i++) {
... | 172 | [
{
"from": "human",
"value": "Which of the following has the best performance?\nI have seen method two implemented in JavaScript with huge performance gains, however, I was unable to measure any gain in C# and was wondering if the compiler already does method 2 even when written like method 1.\nThe theory be... |
What's the best lifetime model for a DataContext? Should I just create a new one whenever I need it (aka, function level), should I keep one available in each class that would use it (class level), or should I create a static class with a static DataContext (app-domain level)? Are there any considered best practices on... | When it comes to managing the lifetime of a `DataContext` in an application, particularly in the context of using ORM frameworks like Entity Framework or LINQ to SQL, there are several considerations and best practices to keep in mind. Here are some common approaches and the reasoning behind them:
### 1. **Function Le... | 316 | [
{
"from": "human",
"value": "What's the best lifetime model for a DataContext? Should I just create a new one whenever I need it (aka, function level), should I keep one available in each class that would use it (class level), or should I create a static class with a static DataContext (app-domain level)? A... |
Anyone know if it's possible to databind the ScaleX and ScaleY of a render transform in Silverlight 2 Beta 2? Binding transforms is possible in WPF - But I'm getting an error when setting up my binding in Silverlight through XAML. Perhaps it's possible to do it through code?
<Image Height="60" HorizontalAlignment="Righ... | In Silverlight 2 Beta 2, you can bind properties of a `Transform` in XAML, but there are limitations compared to WPF. Specifically, Silverlight does not support binding on properties of transforms directly in XAML as it does in WPF. The error you are encountering is likely due to the binding engine not being able to ha... | 260 | [
{
"from": "human",
"value": "Anyone know if it's possible to databind the ScaleX and ScaleY of a render transform in Silverlight 2 Beta 2? Binding transforms is possible in WPF - But I'm getting an error when setting up my binding in Silverlight through XAML. Perhaps it's possible to do it through code?\n<I... |
If I have Python code
class A():
pass
class B():
pass
class C(A, B):
pass
and I have class C, is there a way to iterate through it's super classed (A and B)? Something like pseudocode:
>>> magicGetSuperClasses(C)
(<type 'A'>, <type 'B'>)
One solution seems to be inspect module and getclasstree function.
d... | Yes, there is a more "Pythonic" way to achieve this without needing to use the `inspect` module. You can simply utilize the `__bases__` attribute of the class to get its immediate superclass(es). You can then recursively go through the base classes to gather all the superclasses, if needed. Here's how you can implement... | 1,489 | [
{
"from": "human",
"value": "If I have Python code\nclass A():\n pass\nclass B():\n pass\nclass C(A, B):\n pass\n\nand I have class C, is there a way to iterate through it's super classed (A and B)? Something like pseudocode:\n>>> magicGetSuperClasses(C)\n(<type 'A'>, <type 'B'>)\n\nOne solution se... |
I'm trying to redirect all requests to my domain to another domain using mod_rewrite in an Apache 2.2 VirtualHost declaration. There is one exception to this -- I'd like all requests to the /audio path not to be redirected.
I've written a RewriteCond and RewriteRule to do this but it's not quite right and I can't figu... | It looks like you're on the right track with using `RewriteCond` to exclude the `/audio` path from the redirection. However, the issue in your setup is with the placement of the conditions and rules.
Your current `RewriteCond` is set up correctly to match requests that do not start with `/audio`, but it appears you're... | 1,003 | [
{
"from": "human",
"value": "I'm trying to redirect all requests to my domain to another domain using mod_rewrite in an Apache 2.2 VirtualHost declaration. There is one exception to this -- I'd like all requests to the /audio path not to be redirected.\nI've written a RewriteCond and RewriteRule to do this... |
I want to programatically create an NSTextView. How can I determine the correct frame height so that the view displays one line of text in the current default font?
| To programmatically create an `NSTextView` and set its frame height to display exactly one line of text in the current default font, you can follow these steps in your macOS application using Swift.
1. **Get the Default Font**: Use the `NSFont` class to get the default font for the text view.
2. **Calculate the Line H... | 1,061 | [
{
"from": "human",
"value": "I want to programatically create an NSTextView. How can I determine the correct frame height so that the view displays one line of text in the current default font?\n"
},
{
"from": "gpt",
"value": "To programmatically create an `NSTextView` and set its frame height t... |
I'm trying to read through the documentation on Berkeley DB XML, and I think I could really use a developer's blog post or synopsis of when they had a problem that found the XML layer atop Berkeley DB was the exact prescription for.
Maybe I'm not getting it, but it seems like they're both in-process DBs, and ultimatel... | Your intuition is correct that both Berkeley DB and Berkeley DB XML are in-process databases, and you could argue that storing data in a parsed format rather than XML could be more efficient in many cases. However, there are specific scenarios where the XML layer on top of Berkeley DB provides unique advantages that ma... | 401 | [
{
"from": "human",
"value": "I'm trying to read through the documentation on Berkeley DB XML, and I think I could really use a developer's blog post or synopsis of when they had a problem that found the XML layer atop Berkeley DB was the exact prescription for. \nMaybe I'm not getting it, but it seems like ... |
I have recently started having problems with TortoiseCVS, or more specifically with plink, the SSH application that comes with it. The IP address it tries to connect to can not be changed and is stuck with the old CVS repository's IP. Downloading plink from it's home site and calling from the command line still has thi... | If you're experiencing issues with `plink` that comes with TortoiseCVS and need an alternative SSH client, there are several options you can consider:
1. **OpenSSH for Windows**:
- This is a widely used SSH client that has been made available for Windows. You can install it through the Windows Features option or d... | 899 | [
{
"from": "human",
"value": "I have recently started having problems with TortoiseCVS, or more specifically with plink, the SSH application that comes with it. The IP address it tries to connect to can not be changed and is stuck with the old CVS repository's IP. Downloading plink from it's home site and ca... |
I am using xampp on Windows, but I would like to use something closer to my server setup.
Federico Cargnelutti tutorial explains how to setup LAMP VMWARE appliance; it is a great introduction to VMware appliances, but one of the commands was not working and it doesn't describe how to change the keyboard layout and the ... | Certainly! Here are instructions for setting the keyboard layout and timezone in a Linux environment, which you can refer to whenever you reinstall your LAMP stack on a VMware appliance.
### Change Keyboard Layout
To change the keyboard layout in a Linux environment, you can use the `loadkeys` command for temporary c... | 327 | [
{
"from": "human",
"value": "I am using xampp on Windows, but I would like to use something closer to my server setup.\nFederico Cargnelutti tutorial explains how to setup LAMP VMWARE appliance; it is a great introduction to VMware appliances, but one of the commands was not working and it doesn't describe ... |
Given a DateTime representing a person's birthday, how do I calculate their age in years?
| To calculate a person's age in years from a `DateTime` representing their birthday, you can follow these general steps in most programming languages:
1. Get the current date.
2. Calculate the difference in years between the current date and the birthday.
3. Adjust the calculation if the birthday hasn't occurred yet th... | 60 | [
{
"from": "human",
"value": "Given a DateTime representing a person's birthday, how do I calculate their age in years?\n"
},
{
"from": "gpt",
"value": "To calculate a person's age in years from a `DateTime` representing their birthday, you can follow these general steps in most programming langu... |
For debugging purposes in a somewhat closed system, I have to output text to a file.
Does anyone know of a tool that runs on windows (console based or not) that detects changes to a file and outputs them in real-time?
| Yes, there are several tools you can use on Windows to monitor changes to a file in real time. Here are a few popular options:
1. **PowerShell**: You can use PowerShell to monitor a file and output changes in real time. Here’s a simple script that does that:
```powershell
$filePath = "C:\path\to\your\file.txt"
... | 1,160 | [
{
"from": "human",
"value": "For debugging purposes in a somewhat closed system, I have to output text to a file.\nDoes anyone know of a tool that runs on windows (console based or not) that detects changes to a file and outputs them in real-time?\n"
},
{
"from": "gpt",
"value": "Yes, there are ... |
As you develop an application database changes inevitably pop up. The trick I find is keeping your database build in step with your code. In the past I have added a build step that executed SQL scripts against the target database but that is dangerous in so much as you could inadvertanly add bogus data or worse.
My... | Keeping your database in sync with your application code is a common challenge in software development. Here are some tips and best practices to help ensure that your database changes align with your code, particularly when it comes to version control, rollbacks, and branching:
### 1. Use Database Migration Tools
Util... | 626 | [
{
"from": "human",
"value": "As you develop an application database changes inevitably pop up. The trick I find is keeping your database build in step with your code. In the past I have added a build step that executed SQL scripts against the target database but that is dangerous in so much as you could i... |
I am writing an application in Java for the desktop using the Eclipse SWT library for GUI rendering. I think SWT helps Java get over the biggest hurdle for acceptance on the desktop: namely providing a Java application with a consistent, responsive interface that looks like that belonging to any other app on your desk... | Packaging a Java application into a native executable on Windows can indeed be a challenge, but there are several tools and methods available to help you create a more user-friendly installation experience without resorting to expensive commercial solutions or extensive custom development.
Here are a few options you c... | 301 | [
{
"from": "human",
"value": "I am writing an application in Java for the desktop using the Eclipse SWT library for GUI rendering. I think SWT helps Java get over the biggest hurdle for acceptance on the desktop: namely providing a Java application with a consistent, responsive interface that looks like tha... |
Terminals and shells are very powerful but can be complicated to learn, especially to get the best out of them. Does anyone know of a more GUI based command shell that helps a user or displays answers in a more friendly way? I'm aware of IPython, but even the syntax of that is somewhat convoluted, although it's a step ... | There are several GUI-based command shell alternatives and tools that can help simplify the user experience while still providing powerful functionality. Here are a few options you might consider:
1. **Jupyter Notebook**:
- While you mentioned IPython, it's worth highlighting Jupyter as it builds on IPython and pro... | 721 | [
{
"from": "human",
"value": "Terminals and shells are very powerful but can be complicated to learn, especially to get the best out of them. Does anyone know of a more GUI based command shell that helps a user or displays answers in a more friendly way? I'm aware of IPython, but even the syntax of that is s... |
How is it possible to make prototype methods in C#.Net?
In JavaScript, I can do the following to create a trim method for the string object:
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g,"");
}
How can I go about doing this in C#.Net?
| In C#, you cannot directly modify the built-in types (like `String`) by adding methods to their prototypes as you can in JavaScript. However, you can achieve similar functionality by using extension methods. Extension methods allow you to add new methods to existing types without modifying their original definitions.
... | 336 | [
{
"from": "human",
"value": "How is it possible to make prototype methods in C#.Net?\nIn JavaScript, I can do the following to create a trim method for the string object:\nString.prototype.trim = function() {\n return this.replace(/^\\s+|\\s+$/g,\"\");\n}\n\nHow can I go about doing this in C#.Net?\n"
... |
I'm just in the process of parsing some text and can't remember what the escape character is for a tab in C#?
| In C#, the escape character for a tab is `\t`. You can use it in strings to insert a tab character. For example:
```csharp
string example = "Column1\tColumn2\tColumn3";
```
In this example, `\t` will create a tab space between "Column1", "Column2", and "Column3". | 3,598 | [
{
"from": "human",
"value": "I'm just in the process of parsing some text and can't remember what the escape character is for a tab in C#?\n"
},
{
"from": "gpt",
"value": "In C#, the escape character for a tab is `\\t`. You can use it in strings to insert a tab character. For example:\n\n```csha... |
How do I convert the value of a PHP variable to string?
I was looking for something better than concatenating with an empty string:
$myText = $myVar . '';
Like the ToString() method in Java or .NET.
| In PHP, you can convert a variable to a string using several methods, but one of the most straightforward ways is indeed concatenating it with an empty string (like you mentioned). However, there are other methods as well, similar to the `ToString()` method in Java or .NET. Here are some of the most common ways to conv... | 1,640 | [
{
"from": "human",
"value": "How do I convert the value of a PHP variable to string?\nI was looking for something better than concatenating with an empty string:\n$myText = $myVar . '';\n\nLike the ToString() method in Java or .NET.\n"
},
{
"from": "gpt",
"value": "In PHP, you can convert a vari... |
When writing multi-threaded applications, one of the most common problems experienced are deadlocks.
My questions to the community are:
What is a deadlock?
How do you detect them?
Do you handle them?
And finally, how do you prevent them from occurring?
| ### What is a Deadlock?
A deadlock is a situation in a multi-threaded application where two or more threads are unable to proceed because each is waiting for resources held by the other(s). In simpler terms, a deadlock occurs when threads cannot continue execution because they are waiting for resources that are held by... | 577 | [
{
"from": "human",
"value": "When writing multi-threaded applications, one of the most common problems experienced are deadlocks. \nMy questions to the community are:\n\nWhat is a deadlock? \nHow do you detect them? \nDo you handle them? \nAnd finally, how do you prevent them from occurring?\n\n"
},
{... |
Is it possible to do 3.1 or 5.1 audio using Flash? We're starting a project here for an interactive kiosk, and we've been told to use Flash. However, we also have a requirement to support either 3.1 or 5.1 audio (where 5.1 is the most wanted feature).
I haven't done any high-tech audio stuff using Flash, so I was w... | Flash does not natively support multi-channel audio formats like 3.1 or 5.1 surround sound. The audio support in Flash is generally limited to stereo output (2 channels). While there are some workarounds and techniques that developers have used to simulate surround sound, they usually involve mixing audio tracks or usi... | 2,304 | [
{
"from": "human",
"value": "Is it possible to do 3.1 or 5.1 audio using Flash? We're starting a project here for an interactive kiosk, and we've been told to use Flash. However, we also have a requirement to support either 3.1 or 5.1 audio (where 5.1 is the most wanted feature). \nI haven't done any hig... |
Original Question
If you are given N maximally distant colors (and some associated distance metric), can you come up with a way to sort those colors into some order such that the first M are also reasonably close to being a maximally distinct set?
In other words, given a bunch of distinct colors, come up with an orderi... | To tackle the problem of ordering a set of colors so that the first M colors are visually distinct from one another, we can use techniques rooted in clustering and sorting based on a distance metric. Here's a step-by-step approach to achieve this:
### Step 1: Calculate Distances
First, you need to calculate the pairwi... | 166 | [
{
"from": "human",
"value": "Original Question\nIf you are given N maximally distant colors (and some associated distance metric), can you come up with a way to sort those colors into some order such that the first M are also reasonably close to being a maximally distinct set?\nIn other words, given a bunch... |
I have some C# / asp.net code I inherited which has a textbox which I want to make multiline. I did so by adding textmode="multiline" but when I try to insert a newline, the enter key instead submits the form :P
I googled around and it seems like the default behavior should be for enter (or control-enter) to insert a n... | In ASP.NET Web Forms, when you set the `TextMode` property of a `TextBox` control to `MultiLine`, the default behavior should indeed allow users to insert new lines by pressing the Enter key. However, if hitting Enter submits the form instead, there might be a couple of reasons for this behavior.
### Possible Solution... | 350 | [
{
"from": "human",
"value": "I have some C# / asp.net code I inherited which has a textbox which I want to make multiline. I did so by adding textmode=\"multiline\" but when I try to insert a newline, the enter key instead submits the form :P\nI googled around and it seems like the default behavior should b... |
So I am writing a registration form and I need the display name to be only numbers, letters and underscores.
Have a look at my code and tell me what I'm doing wrong.
<form method="post" action="/" onsubmit="return check_form()">
<input type="text" id="display-name" name="display-name" maxlength="255" />
<input... | Your regular expression is close, but there's a slight issue with how it's constructed. The current regex you have (`/^([a-zA-Z0-9_])+`) will only check if the string starts with one or more valid characters. It won't validate the entire string, which is why it may not be working as expected.
To ensure that the entire... | 1,868 | [
{
"from": "human",
"value": "So I am writing a registration form and I need the display name to be only numbers, letters and underscores. \nHave a look at my code and tell me what I'm doing wrong.\n<form method=\"post\" action=\"/\" onsubmit=\"return check_form()\">\n <input type=\"text\" id=\"display-na... |
I'm currently using VS2005 Profesional and .NET 2.0, and since our project is rather large (25 projects in the solution), I'd like to try VS 2008, since its theoretically faster with larger projects.
Before doing such thing, i'd like to know if what I've read is true: can I use VS2008 in ".net 2.0" mode? I don't want ... | Yes, you can use Visual Studio 2008 to work with .NET Framework 2.0 projects. Visual Studio 2008 is backward compatible with earlier versions of the .NET Framework, so you can continue to develop and maintain your applications targeting .NET 2.0.
When you open your existing solution in Visual Studio 2008, it will allo... | 839 | [
{
"from": "human",
"value": "I'm currently using VS2005 Profesional and .NET 2.0, and since our project is rather large (25 projects in the solution), I'd like to try VS 2008, since its theoretically faster with larger projects. \nBefore doing such thing, i'd like to know if what I've read is true: can I us... |
I'm wondering if there's a way to do what I can do below with Python, in Ruby:
sum = reduce(lambda x, y: x + y, map(lambda x, y: x * y, weights, data))
I have two arrays of equal sizes with the weights and data but I can't seem to find a function similar to map in Ruby, reduce I have working.
| In Ruby, you can achieve similar functionality using the `zip`, `map`, and `reduce` methods (or `inject` which is synonymous with `reduce`). Here’s how you can replicate the given Python code in Ruby:
First, let's break down what you're doing in Python:
1. You are using `map` to multiply corresponding elements from t... | 1,163 | [
{
"from": "human",
"value": "I'm wondering if there's a way to do what I can do below with Python, in Ruby:\nsum = reduce(lambda x, y: x + y, map(lambda x, y: x * y, weights, data))\n\nI have two arrays of equal sizes with the weights and data but I can't seem to find a function similar to map in Ruby, redu... |
How do I call a function, using a string with the function's name? For example:
import foo
func_name = "bar"
call(foo, func_name) # calls foo.bar()
| In Python, you can call a function using its name as a string by utilizing the `getattr()` function. The `getattr()` function retrieves an attribute (including methods) from an object by name. Here's how you can do it in your example:
```python
import foo
func_name = "bar"
# Call the function using getattr
result = g... | 2,602 | [
{
"from": "human",
"value": "How do I call a function, using a string with the function's name? For example:\nimport foo\nfunc_name = \"bar\"\ncall(foo, func_name) # calls foo.bar()\n\n"
},
{
"from": "gpt",
"value": "In Python, you can call a function using its name as a string by utilizing the... |
I have some code for starting a thread on the .NET CF 2.0:
ThreadStart tStart = new ThreadStart(MyMethod);
Thread t = new Thread(tStart);
t.Start();
If I call this inside a loop the items completely out of order. How do introduce a wait after t.Start(), so that the work on the thread completes before the code continue... | When working with threads in .NET Compact Framework 2.0, if you need to ensure that a thread has completed its work before continuing with the rest of your code, you can use the `Thread.Join()` method. This method blocks the calling thread until the thread represented by the `Thread` instance has completed its executio... | 1,850 | [
{
"from": "human",
"value": "I have some code for starting a thread on the .NET CF 2.0:\nThreadStart tStart = new ThreadStart(MyMethod);\nThread t = new Thread(tStart);\nt.Start();\n\nIf I call this inside a loop the items completely out of order. How do introduce a wait after t.Start(), so that the work on... |
I'm developing a C# application that uses a handful of XML files and some classes in System.Xml. A coworker insists on adding the MSXML6 redistributable to our install, along with the .NET framework but I don't think the .NET framework uses or needs MSXML in anyway. I am well aware that using MSXML from .NET is not s... | The .NET Framework's `System.Xml` namespace does not use MSXML. The `System.Xml` classes are built on the .NET runtime and provide their own XML parsing and manipulation capabilities. They do not rely on the MSXML library (Microsoft XML Core Services), which is a COM-based implementation.
Here are some key points to h... | 2,198 | [
{
"from": "human",
"value": "I'm developing a C# application that uses a handful of XML files and some classes in System.Xml. A coworker insists on adding the MSXML6 redistributable to our install, along with the .NET framework but I don't think the .NET framework uses or needs MSXML in anyway. I am well ... |
I am trying out the dialog from jquery UI. All the online demos use flora.css.
I can't get the dialog to display correctly with the css file generated by the themeroller application.
Am I missing something? Should these things work out of the box?
Update: Thanks Brock. When I cleaned up my code to make a sample, I real... | It sounds like you've resolved your issue with the jQuery UI dialog and the custom CSS generated from Themeroller. Just to summarize and clarify your findings for anyone else who might encounter a similar problem:
1. **CSS from Themeroller**: When using a custom theme from Themeroller, make sure that your dialog's HTM... | 1,709 | [
{
"from": "human",
"value": "I am trying out the dialog from jquery UI. All the online demos use flora.css.\nI can't get the dialog to display correctly with the css file generated by the themeroller application.\nAm I missing something? Should these things work out of the box?\nUpdate: Thanks Brock. When I... |
Are there any VC++ settings I should know about to generate better PDB files that contain more information?
I have a crash dump analysis system in place based on the project crashrpt.
Also, my production build server has the source code installed on the D:\, but my development machine has the source code on the C:\. ... | Generating more informative PDB (Program Database) files in Visual C++ (VC++) is crucial for effective debugging and crash dump analysis. Here are some settings and best practices you should consider to enhance the quality of the PDB files:
### 1. Compiler and Linker Settings
- **Optimization Level**: When building f... | 424 | [
{
"from": "human",
"value": "Are there any VC++ settings I should know about to generate better PDB files that contain more information? \nI have a crash dump analysis system in place based on the project crashrpt.\nAlso, my production build server has the source code installed on the D:\\, but my developme... |
I'm using ant to generate javadocs, but get this exception over and over - why?
I'm using JDK version 1.6.0_06.
[javadoc] java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl cannot be cast to com.sun.javadoc.AnnotationTypeDoc
[javadoc] at com.sun.tools.javadoc.AnnotationDescImpl.annotationType(Annota... | The `ClassCastException` you're encountering while generating Javadocs using Ant and JDK version 1.6.0_06 suggests that there's an issue with how the Javadoc tool is handling annotations in your codebase. Specifically, the error message indicates that the class `com.sun.tools.javadoc.ClassDocImpl` is trying to be cast ... | 96 | [
{
"from": "human",
"value": "I'm using ant to generate javadocs, but get this exception over and over - why?\nI'm using JDK version 1.6.0_06.\n[javadoc] java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl cannot be cast to com.sun.javadoc.AnnotationTypeDoc\n [javadoc] at com.sun.tools.java... |
If so how?
Did you roll your own with jQuery or use the Microsoft AJAX toolkit?
Did you create a webservice or call an action?
EDIT : Please note that this question was asked before Microsoft announced that they were going to bundle jQuery in with VS/ASP.NET MVC. I think there is less of a discussion around this to... | It seems like you are discussing options for making asynchronous calls in an ASP.NET MVC application, particularly around the time when jQuery was gaining popularity and Microsoft was just starting to bundle it with their development tools.
When considering how to implement AJAX functionality in an ASP.NET MVC project... | 750 | [
{
"from": "human",
"value": "If so how? \nDid you roll your own with jQuery or use the Microsoft AJAX toolkit?\nDid you create a webservice or call an action?\n\nEDIT : Please note that this question was asked before Microsoft announced that they were going to bundle jQuery in with VS/ASP.NET MVC. I think... |
I need to know how the performance of different XML tools (parsers, validators, XPath expression evaluators, etc) is affected by the size and complexity of the input document. Are there resources out there that document how CPU time and memory usage are affected by... well, what? Document size in bytes? Number of nodes... | The performance of XML tools such as parsers, validators, and XPath evaluators is indeed influenced by various factors, including document size, complexity, and the specific structure of the XML content. Here are some general considerations and resources related to XML performance evaluation:
### Key Factors Affecting... | 779 | [
{
"from": "human",
"value": "I need to know how the performance of different XML tools (parsers, validators, XPath expression evaluators, etc) is affected by the size and complexity of the input document. Are there resources out there that document how CPU time and memory usage are affected by... well, what... |
I need to filter out anchor tags in a string. For instance,
Check out this site: <a href="http://www.stackoverflow.com">stackoverflow</a>
I need to be able to filter out the anchor tag to this:
Check out this site: http://www.stackoverflow.com
That format may not be constant, either. There could be other attributes ... | To filter out anchor tags from a string in VB.NET, you can use regular expressions to match and replace the anchor tags with just the link text or the href attribute's URL. Below is a code example that demonstrates how to do this.
### VB.NET Code Example
```vb.net
Imports System.Text.RegularExpressions
Module Module... | 340 | [
{
"from": "human",
"value": "I need to filter out anchor tags in a string. For instance, \nCheck out this site: <a href=\"http://www.stackoverflow.com\">stackoverflow</a>\nI need to be able to filter out the anchor tag to this:\nCheck out this site: http://www.stackoverflow.com\nThat format may not be cons... |
I'm trying to wrap my head around reflection, so I decided to add plugin capability to a program that I'm writing. The only way to understand a concept is to get your fingers dirty and write the code, so I went the route of creating a simple interface library consisting of the IPlugin and IHost interfaces, a plugin imp... | You're on the right track with your exploration of reflection and plugin systems! Let's address your questions step by step.
### 1. Why couldn't you cast the object returned by `Activator.CreateInstance(Type t)` to an interface that the object implemented?
The `InvalidCastException` you're experiencing when trying to... | 159 | [
{
"from": "human",
"value": "I'm trying to wrap my head around reflection, so I decided to add plugin capability to a program that I'm writing. The only way to understand a concept is to get your fingers dirty and write the code, so I went the route of creating a simple interface library consisting of the I... |
Suppose your git history looks like this:
1
2
3
4
5
1–5 are separate revisions. You need to remove 3 while still keeping 1, 2, 4 and 5. How can this be done?
Is there an efficient method when there are hundreds of revisions after the one to be deleted?
| To remove a specific commit (e.g., commit `3`) from your Git history while keeping the surrounding commits (`1`, `2`, `4`, and `5`), you can use the `git rebase` command or `git cherry-pick` if you want to preserve the rest of your history efficiently.
### Using Git Rebase
1. **Start an Interactive Rebase:**
Begin... | 72 | [
{
"from": "human",
"value": "Suppose your git history looks like this:\n1\n2\n3\n4\n5\n1–5 are separate revisions. You need to remove 3 while still keeping 1, 2, 4 and 5. How can this be done?\nIs there an efficient method when there are hundreds of revisions after the one to be deleted?\n"
},
{
"fr... |
I'm running Apache on Linux within VMWare.
One of the PHP pages I'm requesting does a sleep(), and I find that if I attempt to request a second page whilst the first page is sleep()'ing, the second page hangs, waiting for the sleep() from the first page to finish.
Has anyone else seen this behaviour?
I know that PHP is... | Yes, the behavior you're experiencing is not uncommon when running PHP in certain configurations. This is typically related to how PHP is executed and how the web server is configured to handle requests. Here are a few points to consider regarding the behavior you're observing:
1. **PHP Execution Model**: PHP is tradi... | 954 | [
{
"from": "human",
"value": "I'm running Apache on Linux within VMWare.\nOne of the PHP pages I'm requesting does a sleep(), and I find that if I attempt to request a second page whilst the first page is sleep()'ing, the second page hangs, waiting for the sleep() from the first page to finish.\nHas anyone e... |
I've noticed a lot of sites, SO included, use XHTML as their mark-up language and then fail to adhere to the spec. Just browsing the source for SO there are missing closing tags for paragraphs, invalid elements, etc.
So should tools (and developers) use the XHTML doctype if they are going to produce invalid mark up? An... | You've raised an interesting topic regarding the use of XHTML as a markup language and the adherence to its specifications. Here are some points to consider:
1. **Using XHTML Doctype**: XHTML is indeed a stricter version of HTML and has rules that must be followed for the markup to be valid. When developers choose an ... | 1,510 | [
{
"from": "human",
"value": "I've noticed a lot of sites, SO included, use XHTML as their mark-up language and then fail to adhere to the spec. Just browsing the source for SO there are missing closing tags for paragraphs, invalid elements, etc.\nSo should tools (and developers) use the XHTML doctype if the... |
Is it possible to do image processing in silverlight 2.0?
What I want to do is take an image, crop it, and then send the new cropped image up to the server. I know I can fake it by clipping the image, but that only effects the rendering of the image. I want to create a new image.
After further research I have answere... | You're correct that Silverlight 2.0 has limited capabilities when it comes to image processing. Specifically, the `System.Windows.Media.Imaging` namespace in Silverlight lacks some of the classes needed for advanced image manipulation, such as cropping and creating new images.
Using an external library like fjcore is... | 2,831 | [
{
"from": "human",
"value": "Is it possible to do image processing in silverlight 2.0?\nWhat I want to do is take an image, crop it, and then send the new cropped image up to the server. I know I can fake it by clipping the image, but that only effects the rendering of the image. I want to create a new im... |
OK, here is my problem, without being too specific for reasons of being fired for putting company practices on the internet.
There are spreadsheets made. These are uploaded to the database. I need to filter out duplicates from uploading. The only way to do this is by making sure that for each and every entry that two f... | I understand your need to filter duplicates from your uploads based on two specific fields (let's say `FLDA` and `FLDB`). To achieve this, you can indeed use a query with a subquery, or you can use a `JOIN` to filter out the duplicates.
### Using a Subquery
You can use a subquery in your `WHERE` clause to check for t... | 934 | [
{
"from": "human",
"value": "OK, here is my problem, without being too specific for reasons of being fired for putting company practices on the internet.\nThere are spreadsheets made. These are uploaded to the database. I need to filter out duplicates from uploading. The only way to do this is by making sur... |
For classes that have a long list of setters that are used frequently, I found this way very useful (although I have recently read about the Builder pattern in Effective Java that is kinda the same).
Basically, all setter methods return the object itself so then you can use code like this:
myClass
.setInt(1)
.s... | Your approach of having setter methods return the object itself (often referred to as method chaining or fluent interfaces) is a common and useful technique in object-oriented programming. It can make the code more concise and readable. However, like any design choice, it comes with its own set of pros and cons.
### P... | 174 | [
{
"from": "human",
"value": "For classes that have a long list of setters that are used frequently, I found this way very useful (although I have recently read about the Builder pattern in Effective Java that is kinda the same).\nBasically, all setter methods return the object itself so then you can use cod... |
I'm making a webform using a LoginView, the problem is that because the control includes a grey bar telling you what type of control it is it throws of correctly formatting the page (it has LoginView1 at the top).
Is there a way to hide this on the LoginView as the contentPlaceholder does an excellent job for this.
I'v... | In ASP.NET Web Forms, the `LoginView` control indeed has a header that can sometimes interfere with layout, especially when rendering as part of a larger page. If you're looking to hide the header (which shows the control's type like "LoginView1"), there are several approaches you can take that are cleaner than removin... | 700 | [
{
"from": "human",
"value": "I'm making a webform using a LoginView, the problem is that because the control includes a grey bar telling you what type of control it is it throws of correctly formatting the page (it has LoginView1 at the top).\nIs there a way to hide this on the LoginView as the contentPlace... |
We deployed a live, fresh, swanky site using preview 3 including rigorous stress testing.
Page Output caching was our saviour and afforded us the ability to meet our performance contractual requirements.
My question is, is there a difference between action OutputCacheFilter and page output caching?
Is the action outpu... | Yes, there is a difference between action output caching and page output caching in web applications, and they can have different impacts on performance.
### Page Output Caching:
- **Scope**: This caching strategy caches the entire generated output of a page, including all its components (HTML, styles, scripts, etc.).... | 705 | [
{
"from": "human",
"value": "We deployed a live, fresh, swanky site using preview 3 including rigorous stress testing. \nPage Output caching was our saviour and afforded us the ability to meet our performance contractual requirements.\nMy question is, is there a difference between action OutputCacheFilter a... |
I'm trying to solve the 3n+1 problem and I have a for loop that looks like this:
for(int i = low; i <= high; ++i)
{
res = runalg(i);
if (res > highestres)
{
highestres = res;
}
}
Unfortunately I'm getting this err... | The error you are encountering is due to the fact that you are using a variable declaration within the `for` loop initialization in a C compiler that defaults to an older C standard (such as C89), which does not allow this style of declaration.
In C89, all variable declarations must be at the beginning of a block (i.e... | 2,148 | [
{
"from": "human",
"value": "I'm trying to solve the 3n+1 problem and I have a for loop that looks like this: \nfor(int i = low; i <= high; ++i)\n {\n res = runalg(i);\n if (res > highestres)\n {\n highestres = res;\n ... |
My dilemma is, basically, how to share an enumeration between two applications.
The users upload documents through a front-end application that is on the web. This application calls a web service of the back-end application and passes the document to it. The back-end app saves the document and inserts a row in the Docu... | When designing the interaction between two applications, especially regarding shared data such as document types, there are several considerations that can help you choose the best approach. Both of the options you've mentioned have their pros and cons, so let's analyze them:
### Option 1: Descriptive Strings
#### Pr... | 500 | [
{
"from": "human",
"value": "My dilemma is, basically, how to share an enumeration between two applications.\nThe users upload documents through a front-end application that is on the web. This application calls a web service of the back-end application and passes the document to it. The back-end app saves ... |
It seems that it is impossible to capture the keyboard event normally used for copy when running a Flex application in the browser or as an AIR app, presumably because the browser or OS is intercepting it first.
Is there a way to tell the browser or OS to let the event through?
For example, on an AdvancedDataGrid I hav... | Capturing keyboard events for copy (Ctrl + C) in a Flex application can indeed be challenging due to the way operating systems and browsers handle these shortcuts. The browser or operating system often intercepts these events before they reach your application, which is why you are having trouble detecting the combinat... | 783 | [
{
"from": "human",
"value": "It seems that it is impossible to capture the keyboard event normally used for copy when running a Flex application in the browser or as an AIR app, presumably because the browser or OS is intercepting it first.\nIs there a way to tell the browser or OS to let the event through?... |
I have a custom validation function in JavaScript in a user control on a .Net 2.0 web site which checks to see that the fee paid is not in excess of the fee amount due.
I've placed the validator code in the ascx file, and I have also tried using Page.ClientScript.RegisterClientScriptBlock() and in both cases the valid... | The error message you're encountering indicates that the JavaScript function `feeAmountCheck` isn't accessible at the time it's being called. This can happen due to several reasons. Below are some suggestions to help you remedy this issue without needing to add the function to your master page or consuming page:
### 1... | 216 | [
{
"from": "human",
"value": "I have a custom validation function in JavaScript in a user control on a .Net 2.0 web site which checks to see that the fee paid is not in excess of the fee amount due. \nI've placed the validator code in the ascx file, and I have also tried using Page.ClientScript.RegisterClien... |
In many places, (1,2,3) (a tuple) and [1,2,3] (a list) can be used interchangeably.
When should I use one or the other, and why?
| Tuples and lists are both data structures in Python that can store collections of items, but they have different characteristics and use cases. Here are some key differences and guidelines on when to use each:
### Lists
- **Mutability**: Lists are mutable, which means you can change their content (add, remove, or modi... | 1,110 | [
{
"from": "human",
"value": "In many places, (1,2,3) (a tuple) and [1,2,3] (a list) can be used interchangeably.\nWhen should I use one or the other, and why?\n"
},
{
"from": "gpt",
"value": "Tuples and lists are both data structures in Python that can store collections of items, but they have d... |
It looks interesting and I've played around with it some --- but the development IDE in a web browser seems to be nightmare eventually.
Does anyone have experience using it and what are your thoughts?
| It sounds like you're referring to a web-based development environment, which can indeed have its pros and cons. Here are some thoughts on the experience of using a web-based IDE:
### Pros:
1. **Accessibility**: You can access your projects from anywhere with an internet connection, which is great for remote work or c... | 1,988 | [
{
"from": "human",
"value": "It looks interesting and I've played around with it some --- but the development IDE in a web browser seems to be nightmare eventually.\nDoes anyone have experience using it and what are your thoughts?\n"
},
{
"from": "gpt",
"value": "It sounds like you're referring ... |
I have read through several reviews on Amazon and some books seem outdated. I am currently using MyEclipse 6.5 which is using Eclipse 3.3. I'm interested in hearing from people that have experience learning RCP and what reference material they used to get started.
| If you're looking to learn about Eclipse Rich Client Platform (RCP) and are currently using MyEclipse 6.5 with Eclipse 3.3, it's worth noting that both the RCP and Eclipse IDE have evolved significantly since then. However, there are still valuable resources to help you get started with RCP development.
Here are some ... | 387 | [
{
"from": "human",
"value": "I have read through several reviews on Amazon and some books seem outdated. I am currently using MyEclipse 6.5 which is using Eclipse 3.3. I'm interested in hearing from people that have experience learning RCP and what reference material they used to get started.\n"
},
{
... |
If I create a class like so:
// B.h
#ifndef _B_H_
#define _B_H_
class B
{
private:
int x;
int y;
};
#endif // _B_H_
and use it like this:
// main.cpp
#include <iostream>
#include <vector>
class B; // Forward declaration.
class A
{
public:
A() {
std::cout << v.size() << std::endl;
}
priva... | The issue you're encountering relates to how the C++ language handles forward declarations and the need for complete type definitions when working with certain constructs, particularly containers like `std::vector`.
### Explanation:
1. **Forward Declaration**: When you declare `class B;`, you're informing the compile... | 1,096 | [
{
"from": "human",
"value": "If I create a class like so: \n// B.h\n#ifndef _B_H_\n#define _B_H_\n\nclass B\n{\nprivate:\n int x;\n int y;\n};\n\n#endif // _B_H_\n\nand use it like this:\n// main.cpp\n#include <iostream>\n#include <vector>\n\nclass B; // Forward declaration.\n\nclass A\n{\npublic:\n ... |
Is there a C library function that will return the index of a character in a string?
So far, all I've found are functions like strstr that will return the found char *, not it's location in the original string.
| In the C standard library, there is no specific function that directly returns the index of a character in a string. However, you can easily implement this functionality yourself.
You can use the standard library function `strchr()` to find the first occurrence of a character in a string, but since it returns a point... | 1,387 | [
{
"from": "human",
"value": "Is there a C library function that will return the index of a character in a string?\nSo far, all I've found are functions like strstr that will return the found char *, not it's location in the original string.\n"
},
{
"from": "gpt",
"value": "In the C standard libr... |
I'm trying out Git on Windows. I got to the point of trying "git commit" and I got this error:
Terminal is dumb but no VISUAL nor
EDITOR defined. Please supply the
message using either -m or -F option.
So I figured out I need to have an environment variable called EDITOR. No problem. I set it to point to Notepad.... | If you're looking for a text editor to use with Git on Windows for editing commit messages, Notepad++ can indeed be configured to work, but there are also other editors that might be easier to set up. Here are a few options, including how to set up Notepad++ if you want to stick with it:
### 1. Using Notepad++
To con... | 400 | [
{
"from": "human",
"value": "I'm trying out Git on Windows. I got to the point of trying \"git commit\" and I got this error:\n\nTerminal is dumb but no VISUAL nor\n EDITOR defined. Please supply the\n message using either -m or -F option.\n\nSo I figured out I need to have an environment variable called ... |
Im currently writing my bachelor thesis with latex and using TexnicCenter. I want to be able to send my generated pdf file to people and they should be able to write comments.
It seems like commenting is not allowed by default, how do I change this?
I am using straight to PDF with pdflatex and acrobat reader 9 to read ... | To enable commenting on your PDF file, you'll need to ensure that the PDF permissions are set appropriately when generating the PDF with LaTeX. This can be accomplished using the `pdfcomment` package or by specifying permissions in the document class options or using the `hyperref` package.
Here's a step-by-step guide... | 386 | [
{
"from": "human",
"value": "Im currently writing my bachelor thesis with latex and using TexnicCenter. I want to be able to send my generated pdf file to people and they should be able to write comments.\nIt seems like commenting is not allowed by default, how do I change this?\nI am using straight to PDF ... |
I'm having trouble figuring out how to get the testing framework set up and usable in Visual Studio 2008 for C++ presumably with the built-in unit testing suite.
Any links or tutorials would be appreciated.
| Visual Studio 2008 does not include a built-in unit testing framework for C++, unlike more recent versions of Visual Studio which have integrated testing tools. However, you can set up a unit testing framework for C++ using third-party libraries. One of the most popular options for unit testing in C++ is **Google Test*... | 514 | [
{
"from": "human",
"value": "I'm having trouble figuring out how to get the testing framework set up and usable in Visual Studio 2008 for C++ presumably with the built-in unit testing suite.\nAny links or tutorials would be appreciated.\n"
},
{
"from": "gpt",
"value": "Visual Studio 2008 does no... |
The following code illustrates an object literal being assigned, but with no semicolon afterwards:
var literal = {
say: function(msg) { alert(msg); }
}
literal.say("hello world!");
This appears to be legal, and doesn't issue a warning (at least in Firefox 3). Is this completely legal, or is there a strict version ... | The code you've provided is indeed valid JavaScript, and the absence of a semicolon at the end of the object literal does not lead to any syntax errors in this context. JavaScript has automatic semicolon insertion (ASI) that allows for certain cases where semicolons can be omitted without causing problems.
However, w... | 2,012 | [
{
"from": "human",
"value": "The following code illustrates an object literal being assigned, but with no semicolon afterwards:\nvar literal = {\n say: function(msg) { alert(msg); }\n}\nliteral.say(\"hello world!\");\n\nThis appears to be legal, and doesn't issue a warning (at least in Firefox 3). Is thi... |
I am writing a client-side Swing application (graphical font designer) on Java 5. Recently, I am running into java.lang.OutOfMemoryError: Java heap space error because I am not being conservative on memory usage. The user can open unlimited number of files, and the program keeps the opened objects in the memory. After ... | You're encountering a common issue in applications that handle potentially unbounded amounts of data. In your case, the `java.lang.OutOfMemoryError: Java heap space` error indicates that your application is trying to use more memory than the Java Virtual Machine (JVM) is allowed to allocate. Here are several strategies... | 1,094 | [
{
"from": "human",
"value": "I am writing a client-side Swing application (graphical font designer) on Java 5. Recently, I am running into java.lang.OutOfMemoryError: Java heap space error because I am not being conservative on memory usage. The user can open unlimited number of files, and the program keeps... |
I'm looking for shell scripts files installed on my system, but find doesn't work:
$ find /usr -name *.sh
But I know there are a ton of scripts out there. For instance:
$ ls /usr/local/lib/*.sh
/usr/local/lib/tclConfig.sh
/usr/local/lib/tkConfig.sh
Why doesn't find work?
| The issue you're experiencing with the `find` command is due to the way shell expansion (globbing) works. When you run the command:
```bash
find /usr -name *.sh
```
the shell expands `*.sh` before the `find` command is executed. If there are no files matching the pattern in the current directory, the shell passes `*.... | 1,807 | [
{
"from": "human",
"value": "I'm looking for shell scripts files installed on my system, but find doesn't work:\n$ find /usr -name *.sh\n\nBut I know there are a ton of scripts out there. For instance:\n$ ls /usr/local/lib/*.sh\n/usr/local/lib/tclConfig.sh \n/usr/local/lib/tkConfig.sh\n\nWhy doesn't find ... |
Is it possible to write a doctest unit test that will check that an exception is raised?
For example, if I have a function foo(x) that is supposed to raise an exception if x < 0, how would I write the doctest for that?
| Yes, you can write a doctest that checks whether an exception is raised in Python. To do this, you can use the `>>>` prompt followed by an ellipsis (`...`) to indicate that an exception is expected. The syntax is as follows:
```python
>>> foo(-1)
Traceback (most recent call last):
...
ValueError: x must be non-neg... | 2,197 | [
{
"from": "human",
"value": "Is it possible to write a doctest unit test that will check that an exception is raised?\nFor example, if I have a function foo(x) that is supposed to raise an exception if x < 0, how would I write the doctest for that?\n"
},
{
"from": "gpt",
"value": "Yes, you can w... |
I've grokked the code for all the aforementioned apps and I still can't find a straightforward way to create a static directory structure from a single command.
| Creating a static directory structure from a single command can be accomplished in various ways, depending on your operating system and the tools you have at your disposal. Here are a few methods you can use:
### Using Command Line (Linux/Mac)
You can use the `mkdir` command with the `-p` flag, which allows you to cr... | 492 | [
{
"from": "human",
"value": "I've grokked the code for all the aforementioned apps and I still can't find a straightforward way to create a static directory structure from a single command.\n"
},
{
"from": "gpt",
"value": "Creating a static directory structure from a single command can be accomp... |
Can you tell me what is the difference between abstraction and information hiding in software development?
I am confused. Abstraction hides detail implementation and
information hiding abstracts whole details of something.
Update: I found a good answer for these three concepts. See the separate answer below for several... | Certainly! Abstraction and information hiding are two important concepts in software development, but they serve different purposes and focus on different aspects of software design. Here's a breakdown of each concept:
### Abstraction
- **Definition**: Abstraction is the process of simplifying complex reality by model... | 1,297 | [
{
"from": "human",
"value": "Can you tell me what is the difference between abstraction and information hiding in software development?\nI am confused. Abstraction hides detail implementation and\ninformation hiding abstracts whole details of something.\nUpdate: I found a good answer for these three concept... |
What kinds of considerations are there for migrating an application from NHibernate 1.2 to 2.0? What are breaking changes vs. recommended changes?
Are there mapping issues?
| Migrating from NHibernate 1.2 to 2.0 involves several considerations, including breaking changes, recommended changes, and potential mapping issues. Below are some key points to keep in mind during the migration process:
### Breaking Changes
1. **Namespace Changes**:
- NHibernate 2.0 introduced changes in namespac... | 130 | [
{
"from": "human",
"value": "What kinds of considerations are there for migrating an application from NHibernate 1.2 to 2.0? What are breaking changes vs. recommended changes? \nAre there mapping issues?\n"
},
{
"from": "gpt",
"value": "Migrating from NHibernate 1.2 to 2.0 involves several consi... |
I am interested in moving a number of my projects from Visual Studio and Access/Office Basic with a SQL back-end to the Linux world.
Are there any utilities available to move code over to a similar platform on Linux?
| Transitioning from Visual Studio and Access/Office Basic to a Linux environment involves several considerations, especially when you are moving to new programming languages, databases, and possibly different development frameworks. Here are some steps and utilities that could help facilitate this migration:
### 1. Cho... | 459 | [
{
"from": "human",
"value": "I am interested in moving a number of my projects from Visual Studio and Access/Office Basic with a SQL back-end to the Linux world. \nAre there any utilities available to move code over to a similar platform on Linux?\n"
},
{
"from": "gpt",
"value": "Transitioning ... |
I use Firebug and the Mozilla JS console heavily, but every now and then I run into an IE-only JavaScript bug, which is really hard to locate (ex: error on line 724, when the source HTML only has 200 lines).
I would love to have a lightweight JS tool (a la firebug) for Internet Explorer, something I can install in seco... | For lightweight debugging tools that you can use with Internet Explorer, here are a few options:
1. **F12 Developer Tools**: Starting from Internet Explorer 8, Microsoft included built-in developer tools that can be accessed by pressing F12. This provides a JavaScript console, HTML/CSS debugging tools, and network mon... | 1,390 | [
{
"from": "human",
"value": "I use Firebug and the Mozilla JS console heavily, but every now and then I run into an IE-only JavaScript bug, which is really hard to locate (ex: error on line 724, when the source HTML only has 200 lines).\nI would love to have a lightweight JS tool (a la firebug) for Internet... |
I'm trying to access a data source that is defined within a web container (JBoss) from a fat client outside the container.
I've decided to look up the data source through JNDI. Actually, my persistence framework (Ibatis) does this.
When performing queries I always end up getting this error:
java.lang.IllegalAccessExcep... | The error message you're encountering—`java.lang.IllegalAccessException: Method=public abstract java.sql.Connection java.sql.Statement.getConnection() throws java.sql.SQLException does not return Serializable`—suggests that there's a problem with how the JNDI data source is being accessed or utilized in your client app... | 33 | [
{
"from": "human",
"value": "I'm trying to access a data source that is defined within a web container (JBoss) from a fat client outside the container.\nI've decided to look up the data source through JNDI. Actually, my persistence framework (Ibatis) does this.\nWhen performing queries I always end up getti... |
I need to store products for an e-commerce solution in a database. Each product should have descriptive information, such as name, description etc.
I need any product to be localized to x number of languages.
What I've done so far, is to make any column that should be localized and nvarchar(MAX) and then i store an XML... | Your current approach of storing localized product information as XML within a single column can work, but there are some limitations and potential drawbacks to this design. For example, querying specific languages directly from the database may require additional processing and can affect performance. Additionally, XM... | 515 | [
{
"from": "human",
"value": "I need to store products for an e-commerce solution in a database. Each product should have descriptive information, such as name, description etc.\nI need any product to be localized to x number of languages.\nWhat I've done so far, is to make any column that should be localize... |
I'm aware of some of the test data generators out there, but most seem to just fill name and address style databases [feel free to correct me].
We have a large integrated and normalised application - e.g. invoices have part numbers linked to stocking tables, customer numbers linked to customer tables, change logs linke... | Creating test data for complex, normalized databases can indeed be challenging, especially when dealing with interdependencies among tables (like invoices linked to customers and parts). Here are some tools and methods you can use to generate large volumes of realistic test data:
### 1. **Data Generators with Relation... | 219 | [
{
"from": "human",
"value": "I'm aware of some of the test data generators out there, but most seem to just fill name and address style databases [feel free to correct me].\nWe have a large integrated and normalised application - e.g. invoices have part numbers linked to stocking tables, customer numbers li... |
I have a DLL with some COM objects. Sometimes, this objects crashes and register an error event in the Windows Event Log with lots of hexadecimal informations. I have no clue why this crashes happens.
So, How can I trace those COM objects exceptions?
| Tracing COM object exceptions and diagnosing crashes can be challenging, but there are several methods and tools you can use to gather more information and possibly identify the root cause of the crashes. Here are some steps you can take:
### 1. **Enable Debugging and Logging:**
- **Add Logging:** Implement detaile... | 806 | [
{
"from": "human",
"value": "I have a DLL with some COM objects. Sometimes, this objects crashes and register an error event in the Windows Event Log with lots of hexadecimal informations. I have no clue why this crashes happens. \nSo, How can I trace those COM objects exceptions?\n"
},
{
"from": "g... |
How do you resolve a domain name to an IP address with .NET/C#?
| In .NET/C#, you can resolve a domain name to an IP address using the `System.Net.Dns` class. This class provides methods that allow you to perform DNS lookups. Here’s a simple example of how to use it:
### Example Code:
```csharp
using System;
using System.Net;
class Program
{
static void Main()
{
st... | 1,386 | [
{
"from": "human",
"value": "How do you resolve a domain name to an IP address with .NET/C#?\n"
},
{
"from": "gpt",
"value": "In .NET/C#, you can resolve a domain name to an IP address using the `System.Net.Dns` class. This class provides methods that allow you to perform DNS lookups. Here’s a s... |
Does anyone know of any good library that abstracts the problem of path manipulation in a nice way? I'd like to be able to combine and parse paths with arbitrary separators ('/' or ':' for example) without reinventing the wheel.
It's a shame that System.IO.Path isn't more reusable.
Thanks
| If you're looking for a library that abstracts path manipulation and allows you to use arbitrary separators, you might want to consider the following options:
1. **PathUtils**: This is a simple utility library that provides functions for manipulating paths. It allows you to specify custom separators and has various fu... | 1,701 | [
{
"from": "human",
"value": "Does anyone know of any good library that abstracts the problem of path manipulation in a nice way? I'd like to be able to combine and parse paths with arbitrary separators ('/' or ':' for example) without reinventing the wheel.\nIt's a shame that System.IO.Path isn't more reusa... |
I have a job interview tomorrow for a .NET shop. For the past few years I have been developing in languages other than .NET and figure it is probably a good idea to brush up on what is cool and new in the world of .NET. I've been reading about LINQ and WPF but these are more technologies than trends. What else shoul... | It sounds like you did your homework before your interview! Even if the conversation didn’t dive deep into .NET specifics, being well-versed in current trends and technologies can still make a strong impression. Here are some additional areas you might want to familiarize yourself with in the .NET ecosystem:
1. **.NET... | 566 | [
{
"from": "human",
"value": "I have a job interview tomorrow for a .NET shop. For the past few years I have been developing in languages other than .NET and figure it is probably a good idea to brush up on what is cool and new in the world of .NET. I've been reading about LINQ and WPF but these are more t... |
I'm trying to call a 3rd party vendor's C DLL from vb.net 2005 and am getting P/Invoke errors. I'm successfully calling other methods but have hit a bottle-neck on one of the more complex. The structures involved are horrendous and in an attempt to simplify the troubleshooting I'd like to create a C++ DLL to replicat... | Creating a simple C++ DLL that can be called from VB.NET is a straightforward task. Below is a minimal example of how to create a C++ DLL with a function that matches the signature you're trying to call from VB.NET.
### Step 1: Create the C++ DLL
1. **Open Visual Studio** and create a new project.
2. **Select `Visual... | 36 | [
{
"from": "human",
"value": "I'm trying to call a 3rd party vendor's C DLL from vb.net 2005 and am getting P/Invoke errors. I'm successfully calling other methods but have hit a bottle-neck on one of the more complex. The structures involved are horrendous and in an attempt to simplify the troubleshooting... |
I expected the two span tags in the following sample to display next to each other, instead they display one below the other. If I set the width of the class span.right to 49% they display next to each other. I am not able to figure out why the right span is pushed down like the right span has some invisible padding/ma... | The issue you're encountering with the two `<span>` elements displaying one below the other instead of side by side is indeed related to how the browser calculates the widths and handles spacing in inline-block elements.
### Explanation of the Issue
- By default, inline-block elements respect whitespace in HTML, which... | 645 | [
{
"from": "human",
"value": "I expected the two span tags in the following sample to display next to each other, instead they display one below the other. If I set the width of the class span.right to 49% they display next to each other. I am not able to figure out why the right span is pushed down like the... |
Yes, I know. The existence of a running copy of SQL Server 6.5 in 2008 is absurd.
That stipulated, what is the best way to migrate from 6.5 to 2005? Is there any direct path? Most of the documentation I've found deals with upgrading 6.5 to 7.
Should I forget about the native SQL Server upgrade utilities, script out ... | It sounds like you navigated a complex migration process quite successfully! Upgrading from SQL Server 6.5 to 2005 can indeed be challenging due to the significant changes in features and functionality over those versions, but your approach seems to have worked well. Here’s a summary of your successful strategy, along ... | 1,441 | [
{
"from": "human",
"value": "Yes, I know. The existence of a running copy of SQL Server 6.5 in 2008 is absurd.\nThat stipulated, what is the best way to migrate from 6.5 to 2005? Is there any direct path? Most of the documentation I've found deals with upgrading 6.5 to 7.\nShould I forget about the nativ... |
I've been using WatiN as a testing tool for my current project. Besides the minor bugs with the Test Recorder, I've been able to use it and automate a lot of my tests in conjunction with NUnit. Anyone else out there with experience with different tools they might suggest?
| It's great to hear that you're having success with WatiN for your testing needs! While WatiN is a solid choice, there are several other tools that you might want to consider for test automation, especially if you're looking for alternatives or want to explore different capabilities. Here are some popular tools that you... | 93 | [
{
"from": "human",
"value": "I've been using WatiN as a testing tool for my current project. Besides the minor bugs with the Test Recorder, I've been able to use it and automate a lot of my tests in conjunction with NUnit. Anyone else out there with experience with different tools they might suggest?\n"
}... |
I have been experimenting with woopra.com A web analytics tool. Which requires a piece of javascript code to be added to each page to function. This is easy enough with more dynamic sites with universal headers or footers but not for totally static html pages.
I attempted to work round it by using a combination of Apac... | It looks like you're on the right track trying to integrate Woopra analytics into static HTML pages using Apache's mod_rewrite and Server Side Includes (SSI). However, there are a couple of issues and potential improvements to consider in your approach.
### Problems with Your Current Approach
1. **Rewrite Rule Issue**... | 758 | [
{
"from": "human",
"value": "I have been experimenting with woopra.com A web analytics tool. Which requires a piece of javascript code to be added to each page to function. This is easy enough with more dynamic sites with universal headers or footers but not for totally static html pages.\nI attempted to wo... |
When running my application I sometimes get an error about too many files open.
Running ulimit -a reports that the limit is 1024. How do I increase the limit above 1024?
Edit
ulimit -n 2048 results in a permission error.
| The error you are encountering indicates that your process has reached the maximum number of open file descriptors allowed by the system. The `ulimit` command allows you to set limits on resource usage for the shell and processes started by it, including the maximum number of open files.
If you receive a permission er... | 646 | [
{
"from": "human",
"value": "When running my application I sometimes get an error about too many files open.\nRunning ulimit -a reports that the limit is 1024. How do I increase the limit above 1024? \nEdit\nulimit -n 2048 results in a permission error.\n"
},
{
"from": "gpt",
"value": "The err... |
Does anyone know where online copies of the old The Perl Journal articles can be found?
I know they are now owned by Dr. Dobb's, just the main page for it says they are part of whatever section the subject matter is relevant too, rather than being indexed together. That said, I have never been able to find any of them ... | Finding old articles from *The Perl Journal* can indeed be challenging, especially since they have been integrated into other sections of the Dr. Dobb's website. Here are a few suggestions for locating them:
1. **Dr. Dobb's Archive**: While there is no dedicated section for *The Perl Journal*, you can use the Dr. Dobb... | 1,922 | [
{
"from": "human",
"value": "Does anyone know where online copies of the old The Perl Journal articles can be found?\nI know they are now owned by Dr. Dobb's, just the main page for it says they are part of whatever section the subject matter is relevant too, rather than being indexed together. That said, I... |
we have a lot of users running in different shared and solo-owned repositories in Subversion. As part of our work, we do project-shared code and individual work, and we need to control access, ideally on a group basis.
Currenly, we use SVNManager to allow users to manage access and create repositories. However, in or... | There are several free and open-source SVN management systems that you can use for managing your Subversion repositories on a Linux system. Here are some options that you can explore:
1. **Apache Subversion (SVN)**: While this is not a management system per se, using the native Apache configuration for Subversion can ... | 1,428 | [
{
"from": "human",
"value": "we have a lot of users running in different shared and solo-owned repositories in Subversion. As part of our work, we do project-shared code and individual work, and we need to control access, ideally on a group basis. \n Currenly, we use SVNManager to allow users to manage acce... |
Is this even a valid question? I have a .NET Windows app that is using MSTDC and it is throwing an exception:
System.Transactions.TransactionManagerCommunicationException: Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for
network access in the security configuration ... | The error message you're encountering indicates that the Distributed Transaction Coordinator (MSDTC) is not configured properly to support network transactions. This is a common issue when dealing with distributed transactions in .NET applications.
Here are the steps you should take to resolve this issue:
### 1. **Ch... | 267 | [
{
"from": "human",
"value": "Is this even a valid question? I have a .NET Windows app that is using MSTDC and it is throwing an exception:\n\nSystem.Transactions.TransactionManagerCommunicationException: Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for\n n... |
The minimum spanning tree problem is to take a connected weighted graph and find the subset of its edges with the lowest total weight while keeping the graph connected (and as a consequence resulting in an acyclic graph).
The algorithm I am considering is:
Find all cycles.
remove the largest edge from each cycle.
The... | Your proposed algorithm for finding a minimum spanning tree (MST) has an interesting approach by focusing on cycles and removing the largest edges. However, while it has some merits, it may not always produce a correct MST for all types of graphs. Let's delve into the reasoning behind this and provide some context abou... | 1,396 | [
{
"from": "human",
"value": "The minimum spanning tree problem is to take a connected weighted graph and find the subset of its edges with the lowest total weight while keeping the graph connected (and as a consequence resulting in an acyclic graph).\nThe algorithm I am considering is:\n\nFind all cycles.\n... |
I'm writing some documentation in Markdown, and creating a separate file for each section of the doc. I would like to be able to convert all the files to HTML in one go, but I can't find anyone else who has tried the same thing. I'm on a Mac, so I would think a simple bash script should be able to handle it, but I've... | You can certainly create a simple Bash script to convert all your Markdown files to HTML using a Markdown processor like `pandoc` or `markdown`, depending on what you have installed. Below, I'll provide an example using `pandoc`, which is a popular choice for Markdown conversion.
### Steps to Create the Bash Script
1... | 1,485 | [
{
"from": "human",
"value": "I'm writing some documentation in Markdown, and creating a separate file for each section of the doc. I would like to be able to convert all the files to HTML in one go, but I can't find anyone else who has tried the same thing. I'm on a Mac, so I would think a simple bash scr... |
I have an element which may contain very big amounts of data, but I don't want it to ruin the page layout, so I set max-height: 100px and overflow:auto, hoping for scrollbars to appear when the content does not fit.
It all works fine in Firefox and IE7, but IE8 behaves as if overflow:hidden was present instead of over... | This issue with `max-height` and `overflow: auto` in Internet Explorer 8 is a known bug. As you observed, the combination does not function as expected, leading to content being truncated without scrollbars appearing.
Here are a few workarounds you might consider:
### 1. JavaScript Solution
You could use JavaScript t... | 287 | [
{
"from": "human",
"value": "I have an element which may contain very big amounts of data, but I don't want it to ruin the page layout, so I set max-height: 100px and overflow:auto, hoping for scrollbars to appear when the content does not fit. \nIt all works fine in Firefox and IE7, but IE8 behaves as if o... |
I know it is a good idea to store configuration data in app.config (e.g. database connection strings) instead of hardcoing it, even if I am writing an application just for myself. But is there a way to update the configuration data stored in app.config from the program that is using it?
| Yes, it is possible to update the configuration data stored in `app.config` from within your application, but it's important to note that you should be cautious when modifying configuration files at runtime, as this can lead to potential issues with application state or configurations not being reloaded until the appli... | 1,115 | [
{
"from": "human",
"value": "I know it is a good idea to store configuration data in app.config (e.g. database connection strings) instead of hardcoing it, even if I am writing an application just for myself. But is there a way to update the configuration data stored in app.config from the program that is u... |
I have a MySQL table with coordinates; the column names are X and Y. Now I want to swap the column values in this table, so that X becomes Y and Y becomes X. The most apparent solution would be renaming the columns, but I don't want to make structure changes since I don't necessarily have permissions to do that.
Is thi... | Yes, you can swap the values in the `X` and `Y` columns without making any structural changes to the table. The key is to use a temporary variable to hold one of the values during the update process to avoid overwriting the values.
Here's how you can do it:
```sql
UPDATE your_table_name
SET
@temp := X, -- Store... | 2,662 | [
{
"from": "human",
"value": "I have a MySQL table with coordinates; the column names are X and Y. Now I want to swap the column values in this table, so that X becomes Y and Y becomes X. The most apparent solution would be renaming the columns, but I don't want to make structure changes since I don't necess... |
In SQL Server I have a DATETIME column which includes a time element.
Example:
'14 AUG 2008 14:23:019'
What is the best method to only select the records for a particular day, ignoring the time part?
Example: (Not safe, as it does not match the time part and returns no rows)
DECLARE @p_date DATETIME
SET @p_d... | To select records for a specific date in SQL Server while ignoring the time part, you can use the `CAST` or `CONVERT` functions to strip the time from your `DATETIME` column. One common approach is to compare the `DATETIME` column to the range of the entire day you're interested in. Here’s an efficient way to do it:
`... | 763 | [
{
"from": "human",
"value": "In SQL Server I have a DATETIME column which includes a time element.\nExample: \n'14 AUG 2008 14:23:019'\n\nWhat is the best method to only select the records for a particular day, ignoring the time part?\nExample: (Not safe, as it does not match the time part and returns no... |
In the code below
For i = LBound(arr) To UBound(arr)
What is the point in asking using LBound? Surely that is always 0.
| In many programming languages, including Visual Basic for Applications (VBA), arrays can have different lower bounds. While it is common for arrays to start at index 0, this is not always the case. The lower bound of an array can vary depending on how the array is defined.
Here's a breakdown of why using `LBound(arr)`... | 2,181 | [
{
"from": "human",
"value": "In the code below\nFor i = LBound(arr) To UBound(arr)\n\nWhat is the point in asking using LBound? Surely that is always 0.\n"
},
{
"from": "gpt",
"value": "In many programming languages, including Visual Basic for Applications (VBA), arrays can have different lower ... |
In C++, there isn't a de-facto standard logging tool. In my experience, shops roll their own. This creates a bit of a problem, however, when trying to create reusable software components. If everything in your system depends on the logging component, this makes the software less reusable, basically forcing any downs... | You've identified a common challenge in software design, particularly in C++. Logging is indeed one of those cross-cutting concerns that can lead to tight coupling if not managed correctly. To address your question, yes, adding a dependency on a proprietary logging framework can sacrifice the reusability of a component... | 201 | [
{
"from": "human",
"value": "In C++, there isn't a de-facto standard logging tool. In my experience, shops roll their own. This creates a bit of a problem, however, when trying to create reusable software components. If everything in your system depends on the logging component, this makes the software l... |
I've got a bunch of FoxPro (VFP9) DBF files on my Ubuntu system, is there a library to open these in Python? I only need to read them, and would preferably have access to the memo fields too.
Update: Thanks @cnu, I used Yusdi Santoso's dbf.py and it works nicely. One gotcha: The memo file name extension must be lower... | Yes, you can read FoxPro DBF files in Python on your Ubuntu system using libraries specifically designed for this purpose. Since you mentioned that you found success with Yusdi Santoso's `dbf.py`, that's a great choice for reading DBF files and accessing memo fields.
For others who might be looking for similar solutio... | 1,779 | [
{
"from": "human",
"value": "I've got a bunch of FoxPro (VFP9) DBF files on my Ubuntu system, is there a library to open these in Python? I only need to read them, and would preferably have access to the memo fields too.\nUpdate: Thanks @cnu, I used Yusdi Santoso's dbf.py and it works nicely. One gotcha: ... |
Pretty much every other editor that isn't a vi descendant (vim, cream, vi-emu) seems to use the emacs shortcuts (ctrl+w to delete back a word and so on)
| Yes, many text editors, especially those in graphical environments or integrated development environments (IDEs), tend to adopt Emacs-style keyboard shortcuts due to their widespread use and familiarity among users. This includes popular editors like Sublime Text, Visual Studio Code, Atom, and others.
Emacs-style shor... | 2,665 | [
{
"from": "human",
"value": "Pretty much every other editor that isn't a vi descendant (vim, cream, vi-emu) seems to use the emacs shortcuts (ctrl+w to delete back a word and so on)\n"
},
{
"from": "gpt",
"value": "Yes, many text editors, especially those in graphical environments or integrated ... |
I imagine everyone has seen code like:
public void Server2ClientEnumConvert( ServerEnum server)
{
switch(server)
{
case ServerEnum.One:
return ClientEnum.ABC
//And so on.
Instead of this badness we could do somthing like:
public enum ServerEnum
{
[Enum2Enum(ClientEnum.ABC)]
O... | The problem you're encountering arises from how attributes work in C#. In C#, when you define an attribute, the types of the parameters you can use in its constructor must be known at compile time. Enum is a base class for all enums, and it cannot be used as a parameter type in an attribute constructor because the spec... | 415 | [
{
"from": "human",
"value": "I imagine everyone has seen code like:\npublic void Server2ClientEnumConvert( ServerEnum server)\n{\n switch(server)\n {\n case ServerEnum.One:\n return ClientEnum.ABC\n //And so on.\n\nInstead of this badness we could do somthing like:\npublic enum S... |
I was looking at the API documentation for stl vector, and noticed there was no method on the vector class that allowed the removal of an element with a certain value. This seems like a common operation, and it seems odd that there's no built in way to do this.
| You're correct that the C++ Standard Library's `std::vector` does not have a member function specifically dedicated to removing elements by value. However, you can accomplish this using the combination of algorithms provided by the `<algorithm>` header. The typical approach is to use the `std::remove` algorithm followe... | 1,268 | [
{
"from": "human",
"value": "I was looking at the API documentation for stl vector, and noticed there was no method on the vector class that allowed the removal of an element with a certain value. This seems like a common operation, and it seems odd that there's no built in way to do this.\n"
},
{
"... |
Im searching a tool which allows me to specify some folders as "bookmarks" and than access them on the commandline (on Windows XP) via a keyword. Something like:
C:\> go home
D:\profiles\user\home\> go svn-project1
D:\projects\project1\svn\branch\src\>
I'm currently using a bunch of batch files, but editing them by ha... | If you're looking for a classic command line solution on Windows XP to create "bookmarks" for your directories, you can achieve this by creating a simple batch script. Here’s a way to create a "go" command that allows you to navigate to your favorite directories using keywords.
### Step 1: Create a Batch File
1. Open... | 1,132 | [
{
"from": "human",
"value": "Im searching a tool which allows me to specify some folders as \"bookmarks\" and than access them on the commandline (on Windows XP) via a keyword. Something like:\nC:\\> go home\nD:\\profiles\\user\\home\\> go svn-project1\nD:\\projects\\project1\\svn\\branch\\src\\>\n\nI'm cur... |
I'm guessing it needs to be something like:
CONVERT(CHAR(24), lastModified, 101)
However I'm not sure of the right value for the third parameter.
Thanks!
Well I'm trying to write a script to copy my sql server db to a sqlite file, which gets downloaded to an air app, which then syncs the data to another sqlite file. ... | When working with SQL Server and SQLite, handling dates can be tricky due to their different formats. SQL Server typically stores date and time using specific data types (like `DATETIME`, `DATE`, etc.), while SQLite stores dates as strings in ISO 8601 format or as integers (like Unix timestamps).
To convert a SQL Ser... | 1,494 | [
{
"from": "human",
"value": "I'm guessing it needs to be something like:\nCONVERT(CHAR(24), lastModified, 101)\n\nHowever I'm not sure of the right value for the third parameter.\nThanks!\n\nWell I'm trying to write a script to copy my sql server db to a sqlite file, which gets downloaded to an air app, whi... |
What is the syntax for placing constraints on multiple types? The basic example:
class Animal<SpeciesType> where SpeciesType : Species
I would like to place constraints on both types in the following definition such that SpeciesType must inherit from Species and OrderType must inherit from Order:
class Animal<Species... | In C#, you can place constraints on multiple generic type parameters in a class definition using the `where` keyword. To specify that `SpeciesType` must inherit from `Species` and `OrderType` must inherit from `Order`, you can use the following syntax:
```csharp
class Animal<SpeciesType, OrderType>
where SpeciesT... | 2,946 | [
{
"from": "human",
"value": "What is the syntax for placing constraints on multiple types? The basic example:\nclass Animal<SpeciesType> where SpeciesType : Species\n\nI would like to place constraints on both types in the following definition such that SpeciesType must inherit from Species and OrderType m... |
I'm working on a C#/ASP.NET project that has all the javascript files in a /Javascript folder. If I refer to the JS file using this syntax: src="/Javascript/jsfile.js" then the file is correctly picked up if the project is deployed to the root of the URL.
However, if this "web site" is deployed to a sub-folder of the m... | To handle the issue of referencing JavaScript files in a C#/ASP.NET project that can be deployed either to the root of the URL or to a sub-folder, you can take a couple of different approaches. The main goal is to ensure that your script paths are correctly resolved regardless of where the application is hosted.
Here ... | 565 | [
{
"from": "human",
"value": "I'm working on a C#/ASP.NET project that has all the javascript files in a /Javascript folder. If I refer to the JS file using this syntax: src=\"/Javascript/jsfile.js\" then the file is correctly picked up if the project is deployed to the root of the URL.\nHowever, if this \"w... |
I'm sure we've all seen it before...A code base that has been around for a year or two, and as features have been added and bugs fixed, we end up with pieces of code that aren't actually in use anymore. I'm wondering if there is a way (especially in VS.NET with or without a third-party tool) to search the codebase and... | Identifying unused code is a common challenge in software maintenance, especially in large codebases that have evolved over time. In Visual Studio .NET, there are several approaches you can take to find methods and functions that are not being used anywhere else in the code.
### 1. **Code Analysis Tools**:
Visual Stud... | 549 | [
{
"from": "human",
"value": "I'm sure we've all seen it before...A code base that has been around for a year or two, and as features have been added and bugs fixed, we end up with pieces of code that aren't actually in use anymore. I'm wondering if there is a way (especially in VS.NET with or without a thi... |
We use a data acquisition card to take readings from a device that increases its signal to a peak and then falls back to near the original value. To find the peak value we currently search the array for the highest reading and use the index to determine the timing of the peak value which is used in our calculations.
Th... | Your approach to identifying peaks in your data is fundamentally sound, but you're right to consider enhancements to address issues such as noise and the possibility of multiple peaks. Here are several techniques and considerations to improve your peak detection process:
### 1. **Threshold-Based Filtering**
Before att... | 1,086 | [
{
"from": "human",
"value": "We use a data acquisition card to take readings from a device that increases its signal to a peak and then falls back to near the original value. To find the peak value we currently search the array for the highest reading and use the index to determine the timing of the peak va... |
I'm in the process of weeding out all hardcoded values in a Java library and was wondering what framework would be the best (in terms of zero- or close-to-zero configuration) to handle run-time configuration? I would prefer XML-based configuration files, but it's not essential.
Please do only reply if you have practic... | Based on my experience, one of the best frameworks for handling runtime configuration in Java, particularly with a focus on minimal configuration and ease of use, is Spring Boot.
### Why Spring Boot?
1. **Convention Over Configuration**: Spring Boot promotes a convention-over-configuration approach, meaning that it ... | 1,328 | [
{
"from": "human",
"value": "I'm in the process of weeding out all hardcoded values in a Java library and was wondering what framework would be the best (in terms of zero- or close-to-zero configuration) to handle run-time configuration? I would prefer XML-based configuration files, but it's not essential. ... |
I generally use a manual process:
Look at the page, figure out the semantic elements, and build the HTML
Slice up the images I think I'll need
Start writing CSS
Tweak and repeat different steps as necessary
Got a better approach, or a tool?
| Your current process is quite common in web development, especially for smaller projects or when focusing on custom designs. However, there are several tools and methodologies that can help streamline your workflow, improve efficiency, and enhance collaboration. Here are some suggestions:
### Tools and Approaches
1. ... | 967 | [
{
"from": "human",
"value": "I generally use a manual process:\n\nLook at the page, figure out the semantic elements, and build the HTML\nSlice up the images I think I'll need\nStart writing CSS\nTweak and repeat different steps as necessary\n\nGot a better approach, or a tool?\n"
},
{
"from": "gpt"... |
We have a SharePoint list setup with history enabled so the Comments field keeps all the past values. When it displays, the Comments field is void of all line breaks. However, when SharePoint e-mails the change to us, the line breaks are in there. The Description field also shows the line breaks.
So, something must be... | In SharePoint, when you encounter issues with line breaks not being displayed in the Comments field within the read-only view (like on the `/DispForm.aspx` or `/EditForm.aspx`), but they are visible in emails, it's typically related to how the field's data is rendered in the HTML.
Here are some options you can conside... | 1,008 | [
{
"from": "human",
"value": "We have a SharePoint list setup with history enabled so the Comments field keeps all the past values. When it displays, the Comments field is void of all line breaks. However, when SharePoint e-mails the change to us, the line breaks are in there. The Description field also show... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.