instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I have been pushing into the .NET framework in PowerShell, and I have hit something that I don't understand. This works fine:
$foo = New-Object "System.Collections.Generic.Dictionary``2[System.String,System.String]"
$foo.Add("FOO", "BAR")
$foo
Key Value
--- ... | The issue you're encountering with `SortedDictionary` not being recognized by `New-Object` in PowerShell is likely due to how PowerShell interacts with .NET types and assemblies. In PowerShell v1, there were some limitations and quirks related to loading certain types.
In your case, the error message indicates that Po... | 24,853 | [
{
"from": "human",
"value": "I have been pushing into the .NET framework in PowerShell, and I have hit something that I don't understand. This works fine:\n$foo = New-Object \"System.Collections.Generic.Dictionary``2[System.String,System.String]\"\n$foo.Add(\"FOO\", \"BAR\")\n$foo\n\nKey ... |
Visual Studio 2008 has built-in unittesting that was previously only available in the Team Suite editions. What unittesting framework is this based on? MbUint, MStest, xUnit or something completely different?
| Visual Studio 2008 introduced built-in support for unit testing through the use of the **MSTest** framework. MSTest is Microsoft’s own testing framework that allows developers to create and run unit tests within Visual Studio. Prior to this, unit testing features were primarily available in the Team Suite editions. MST... | 27,963 | [
{
"from": "human",
"value": "Visual Studio 2008 has built-in unittesting that was previously only available in the Team Suite editions. What unittesting framework is this based on? MbUint, MStest, xUnit or something completely different?\n"
},
{
"from": "gpt",
"value": "Visual Studio 2008 introd... |
Is there a way to figure out versions of modules that were loaded into the process' address space when the process crashed from a crash dump that was generated by the process calling the MiniDumpWriteDump function? In other words, is any version information stored inside a dmp file?
Thanks.
| Yes, when a process crashes and a dump file is generated using the `MiniDumpWriteDump` function, some information about the loaded modules, including version information, can be found within the dump file. The `MINIDUMP_MODULE` structure in the dump contains details about each module that was loaded into the process's ... | 21,676 | [
{
"from": "human",
"value": "Is there a way to figure out versions of modules that were loaded into the process' address space when the process crashed from a crash dump that was generated by the process calling the MiniDumpWriteDump function? In other words, is any version information stored inside a dmp f... |
Kind of a random question...
What I'm looking for is a way to express a cast operation which uses a defined operator of the class instance I'm casting from, and generates a compile-time error if there is not a defined cast operator for the type. So, for example, what I'm looking for is something like:
template< typenam... | To achieve a compile-time check for the presence of a specific casting operator in C++, you can use SFINAE (Substitution Failure Is Not An Error) along with `std::enable_if` and template specialization. This allows you to ensure that your `operator_cast` function is only enabled if the type `INPUT_TYPE` has a member fu... | 21,919 | [
{
"from": "human",
"value": "Kind of a random question...\nWhat I'm looking for is a way to express a cast operation which uses a defined operator of the class instance I'm casting from, and generates a compile-time error if there is not a defined cast operator for the type. So, for example, what I'm lookin... |
I have a String which I would like to modify in some way. For example: reverse it or upcase it.
I have discovered that the fastest way to do this is by using a unsafe block and pointers.
For example:
unsafe
{
fixed (char* str = text)
{
*str = 'X';
... | Using unsafe code and pointers in C# can lead to performance improvements in certain scenarios, particularly in scenarios that require intensive data manipulation. However, there are several reasons why you might want to avoid using unsafe code unless absolutely necessary:
1. **Safety Risks**: The main reason to avoid... | 23,076 | [
{
"from": "human",
"value": "I have a String which I would like to modify in some way. For example: reverse it or upcase it. \nI have discovered that the fastest way to do this is by using a unsafe block and pointers. \nFor example: \n unsafe \n {\n fixed (char* str = text)\n ... |
I have a Pylons app where I would like to move some of the logic to a separate batch process. I've been running it under the main app for testing, but it is going to be doing a lot of work in the database, and I'd like it to be a separate process that will be running in the background constantly. The main pylons ap... | It sounds like you're trying to create a standalone batch process that interacts with your database through SQLAlchemy, using a Pylons application structure. The error you're encountering suggests that there may be an issue with how the SQLAlchemy session is being managed in your standalone script.
Here's a general gu... | 17,004 | [
{
"from": "human",
"value": "I have a Pylons app where I would like to move some of the logic to a separate batch process. I've been running it under the main app for testing, but it is going to be doing a lot of work in the database, and I'd like it to be a separate process that will be running in the ba... |
private string? typeOfContract
{
get { return (string?)ViewState["typeOfContract"]; }
set { ViewState["typeOfContract"] = value; }
}
Later in the code I use it like this:
typeOfContract = Request.QueryString["type"];
I am getting the following error at the declaration of typeOfContract line stating:
The type 'st... | The error you're encountering suggests that the `ViewState` is expecting a non-nullable type when you use `string?` (nullable string). This issue often arises from the way `ViewState` is being used or configured, particularly if the project is using an older version of the .NET framework that does not fully support nul... | 24,141 | [
{
"from": "human",
"value": "private string? typeOfContract\n{\n get { return (string?)ViewState[\"typeOfContract\"]; }\n set { ViewState[\"typeOfContract\"] = value; }\n}\n\nLater in the code I use it like this:\ntypeOfContract = Request.QueryString[\"type\"];\n\nI am getting the following error at the d... |
Anyone know how to programmatically mute the Windows XP Volume using C#?
| To programmatically mute the volume on Windows XP using C#, you can use the `winmm.dll` library, which is part of the Windows API. Here’s a step-by-step guide on how to achieve that:
1. **Import the necessary DLLs**: You need to import the functions from the `winmm.dll` to interact with the volume settings.
2. **Impl... | 19,924 | [
{
"from": "human",
"value": "Anyone know how to programmatically mute the Windows XP Volume using C#?\n"
},
{
"from": "gpt",
"value": "To programmatically mute the volume on Windows XP using C#, you can use the `winmm.dll` library, which is part of the Windows API. Here’s a step-by-step guide on... |
Does YUI have selector methods like jQuery?
e.g. get me all div's that are children of <table> that have links in them?
| Yes, YUI (Yahoo User Interface Library) does have selector methods that allow you to perform similar operations to jQuery's selector capabilities. You can use YUI's `Y.all()` function along with a CSS selector to select elements in a manner similar to jQuery.
For your specific requirement—to get all `<div>` elements t... | 25,481 | [
{
"from": "human",
"value": "Does YUI have selector methods like jQuery?\ne.g. get me all div's that are children of <table> that have links in them?\n"
},
{
"from": "gpt",
"value": "Yes, YUI (Yahoo User Interface Library) does have selector methods that allow you to perform similar operations t... |
I'm using javax naming to connect to an LDAP database.
Is there a good way to check if a connection is still valid?
I'm looking for something really efficient here because it may need to be done often.
After some web searching all I have found is a suggestion to do a quick search, is there any more lightweight way?
/ma... | When working with LDAP connections in Java using the `javax.naming` package, validating a connection can be crucial, especially in long-lived applications or when connections may time out. Here are some strategies you can consider, focusing on efficiency:
### 1. **Perform a Lightweight LDAP Operation**
As you've menti... | 22,860 | [
{
"from": "human",
"value": "I'm using javax naming to connect to an LDAP database.\nIs there a good way to check if a connection is still valid?\nI'm looking for something really efficient here because it may need to be done often.\nAfter some web searching all I have found is a suggestion to do a quick se... |
How do I format a number in Java?
What are the "Best Practices"?
Will I need to round a number before I format it?
32.302342342342343 => 32.30
.7323 => 0.73
etc.
| In Java, you can format numbers using several approaches, primarily using `java.text.DecimalFormat`, `String.format()`, or `NumberFormat`. Below, I’ll discuss these methods, best practices, and how to handle rounding.
### Formatting Numbers in Java
1. **Using `DecimalFormat`**:
The `DecimalFormat` class allows you... | 20,658 | [
{
"from": "human",
"value": "How do I format a number in Java?\nWhat are the \"Best Practices\"?\nWill I need to round a number before I format it?\n\n32.302342342342343 => 32.30\n.7323 => 0.73\n\netc.\n"
},
{
"from": "gpt",
"value": "In Java, you can format numbers using several approaches, pri... |
I have some really complicated legacy code I've been working on that crashes when collecting big chunks of data. I've been unable to find the exact reason for the crashes and am trying different ways to solve it or at least recover nicely. The last thing I did was enclose the crashing code in a
try
...
except
clean... | In many programming environments, exceptions like "access violation" can occur under specific circumstances, and there are several reasons why your cleanup code might not be executed when an exception is thrown.
1. **Uncatchable Exceptions**: In some languages or frameworks, certain severe errors, such as stack overfl... | 19,106 | [
{
"from": "human",
"value": "I have some really complicated legacy code I've been working on that crashes when collecting big chunks of data. I've been unable to find the exact reason for the crashes and am trying different ways to solve it or at least recover nicely. The last thing I did was enclose the cr... |
I am currently using NUnit and testing a class library. Up until now, I have used a list of constants at the top of the test class to hold some static test variables. Is this the best way to do this, or is there a more fluent way to handle it?
| Using a list of constants at the top of your test class is a common and straightforward approach to manage static test variables in NUnit. However, there are several strategies you can consider to improve the organization and readability of your tests:
1. **Use Test Fixtures**: If certain constants are used across mul... | 20,952 | [
{
"from": "human",
"value": "I am currently using NUnit and testing a class library. Up until now, I have used a list of constants at the top of the test class to hold some static test variables. Is this the best way to do this, or is there a more fluent way to handle it?\n"
},
{
"from": "gpt",
... |
In ASP.NET MVC is there an equivalent of the Html.ActionLink helper for Img tags?
I have a controller action that outputs a dynamically generated JPEG and I wanted to use the same Lambda expressions to link to it as I do HREFs using ActionLink.
Alternatively, a helper that just gives the URL to a route (again specifie... | In ASP.NET MVC, while there is no built-in helper specifically for generating `<img>` tags with an action link like `Html.ActionLink`, you can create a custom HTML helper method or use the `Url.Action` method to generate the URL for your image.
Here’s how you can do it:
### Option 1: Using Url.Action
You can use the... | 23,131 | [
{
"from": "human",
"value": "In ASP.NET MVC is there an equivalent of the Html.ActionLink helper for Img tags? \nI have a controller action that outputs a dynamically generated JPEG and I wanted to use the same Lambda expressions to link to it as I do HREFs using ActionLink.\nAlternatively, a helper that ju... |
I was given one big JPG of the HTML interface. Now I need to break it down into pieces and assemble them with html table. Without a slicer it's pretty arduous and error prone. I do not have photoshop or firework, does anybody know of any free utilities that I can use?
| If you need to break down a JPG image into smaller pieces for use in an HTML interface, and you don't have access to tools like Photoshop or Fireworks, there are several free alternatives you can use. Here are some suggestions:
1. **GIMP**: GIMP is a powerful open-source image editing tool that can be used to slice im... | 22,671 | [
{
"from": "human",
"value": "I was given one big JPG of the HTML interface. Now I need to break it down into pieces and assemble them with html table. Without a slicer it's pretty arduous and error prone. I do not have photoshop or firework, does anybody know of any free utilities that I can use?\n"
},
... |
Based on several report parameters in SQL Server 2005 reporting services, I would like to automatically generate one or several chart(s) for each row in the return result and paginate or space them out. How do I go about that?
| To automatically generate one or several charts for each row in a dataset in SQL Server 2005 Reporting Services (SSRS), you'll need to follow a series of steps to design your report and set up the charts. Below are the steps to achieve this:
### Steps to Create Charts in SSRS for Each Row of a Dataset
1. **Create you... | 21,204 | [
{
"from": "human",
"value": "Based on several report parameters in SQL Server 2005 reporting services, I would like to automatically generate one or several chart(s) for each row in the return result and paginate or space them out. How do I go about that?\n"
},
{
"from": "gpt",
"value": "To auto... |
In the default Visual Studio template for a dynamic data web application, Global.asax includes the following two sample routes.
// route #1
routes.Add(new DynamicDataRoute("{table}/ListDetails.aspx") {
Action = PageAction.List,
ViewName = "ListDetails",
Model = model
});
// route #2
routes.Add(new DynamicD... | In the context of the Dynamic Data framework within ASP.NET, the routes defined in the `Global.asax` file are meant to map specific URLs to the various actions that a dynamic data application can perform (CRUD - Create, Read, Update, Delete). Each `DynamicDataRoute` represents a mapping between a URL pattern and a spec... | 23,100 | [
{
"from": "human",
"value": "In the default Visual Studio template for a dynamic data web application, Global.asax includes the following two sample routes.\n// route #1\nroutes.Add(new DynamicDataRoute(\"{table}/ListDetails.aspx\") {\n Action = PageAction.List,\n ViewName = \"ListDetails\",\n Mode... |
I am a member of a team that is about to launch a beta of a python (Django specifically) based web site and accompanying suite of backend tools. The team itself has doubled in size from 2 to 4 over the past few weeks and we expect continued growth for the next couple of months at least. One issue that has started to ... | Setting up a consistent development environment across multiple platforms and languages can indeed be a challenging task. Here are a few suggestions that can help streamline the process of onboarding new developers and managing dependencies across different languages and libraries:
### 1. Use Docker
One of the best so... | 20,852 | [
{
"from": "human",
"value": "I am a member of a team that is about to launch a beta of a python (Django specifically) based web site and accompanying suite of backend tools. The team itself has doubled in size from 2 to 4 over the past few weeks and we expect continued growth for the next couple of months ... |
We use the DesignSurface and all that good IDesignerHost goodness in our own designer. The designed forms are then persisted in our own bespoke format and all that works great. WE also want to export the forms to a text-based format (which we've done as it isn't that difficult).
However, we also want to import that tex... | Your task of importing text-based representations of forms back into a designer environment using the .NET DesignerHost is indeed challenging, especially since the `Parse` method for code parsing is not implemented. Given the constraints you've mentioned, here are a few alternative approaches and suggestions that may h... | 21,517 | [
{
"from": "human",
"value": "We use the DesignSurface and all that good IDesignerHost goodness in our own designer. The designed forms are then persisted in our own bespoke format and all that works great. WE also want to export the forms to a text-based format (which we've done as it isn't that difficult).... |
When comparing an HTTP GET to an HTTP POST, what are the differences from a security perspective? Is one of the choices inherently more secure than the other? If so, why?
I realize that POST doesn't expose information on the URL, but is there any real value in that or is it just security through obscurity? Is there eve... | When comparing HTTP GET and HTTP POST from a security perspective, there are several important factors to consider. Both methods have their uses and should be employed appropriately based on the context of the data being transmitted.
### Key Differences
1. **Visibility of Data:**
- **GET:** Data is appended to the... | 21,471 | [
{
"from": "human",
"value": "When comparing an HTTP GET to an HTTP POST, what are the differences from a security perspective? Is one of the choices inherently more secure than the other? If so, why?\nI realize that POST doesn't expose information on the URL, but is there any real value in that or is it jus... |
How do I make vi-Vim never use tabs (converting spaces to tabs, bad!), makes the tab key == 4 spaces, and automatically indent code after curly brace blocks like Emacs does?
Also, how do I save these settings so I never have to input them again?
I've seen other questions related to this, but it always seems to be a lit... | To configure Vim to use spaces instead of tabs, set the tab key to insert 4 spaces, and automatically indent code after curly brace blocks, you need to add specific settings to your Vim configuration file. Follow these steps:
1. **Open your Vim configuration file**:
This file is usually located at `~/.vimrc`. You c... | 23,813 | [
{
"from": "human",
"value": "How do I make vi-Vim never use tabs (converting spaces to tabs, bad!), makes the tab key == 4 spaces, and automatically indent code after curly brace blocks like Emacs does?\nAlso, how do I save these settings so I never have to input them again?\nI've seen other questions relat... |
I learned C++ when it was C with classes. I find myself increasingly disliking new technologies like XML and Garbage collection.
On the other hand, I have discovered scripting languages like Lua and Python. And I find myself rather liking a hybrid environment of C++, with deterministic memory control, with an embedded ... | It's great to hear that you're exploring new programming paradigms and languages! Transitioning from C++ to languages like Python and Lua, while also picking up concepts such as lambdas and closures, can indeed be a bit overwhelming at first. However, there are plenty of online resources to help you get acquainted with... | 21,855 | [
{
"from": "human",
"value": "I learned C++ when it was C with classes. I find myself increasingly disliking new technologies like XML and Garbage collection.\nOn the other hand, I have discovered scripting languages like Lua and Python. And I find myself rather liking a hybrid environment of C++, with deter... |
I'm trying to write a regex to replace all spaces that are not included in quotes so something like this:
a = 4, b = 2, c = "space here"
would return this:
a=4,b=2,c="space here"
I spent some time searching this site and I found a similar q/a ( Split a string by spaces -- preserving quoted substrings -- in Python ) t... | To replace all spaces that are not included in quotes, you can use a regular expression that captures these spaces while respecting the quoted strings.
Here's an approach in Python using the `re` module that leverages a regex pattern to find spaces that are outside of quotes:
```python
import re
def replace_spaces(... | 25,531 | [
{
"from": "human",
"value": "I'm trying to write a regex to replace all spaces that are not included in quotes so something like this:\na = 4, b = 2, c = \"space here\"\n\nwould return this:\na=4,b=2,c=\"space here\"\n\nI spent some time searching this site and I found a similar q/a ( Split a string by spac... |
I've just started working with ASP.NET MVC now that it's in beta. In my code, I'm running a simple LINQ to SQL query to get a list of results and passing that to my view. This sort of thing:
var ords = from o in db.Orders
where o.OrderDate == DateTime.Today
select o;
return View(ords);
However, ... | In ASP.NET MVC, when you're working with LINQ to SQL or any other data access technology, it's common to create a view model that specifically represents the data you want to pass to your view. This approach not only helps to encapsulate the data but also provides a clean and strong-typed way to represent what your vie... | 23,443 | [
{
"from": "human",
"value": "I've just started working with ASP.NET MVC now that it's in beta. In my code, I'm running a simple LINQ to SQL query to get a list of results and passing that to my view. This sort of thing:\nvar ords = from o in db.Orders\n where o.OrderDate == DateTime.Today\n ... |
Just out of curiosity:
I know I can tell the compiler if I want a value to be interpreted as a certain numeric type, e.g. as Integer (32 bit signed), this way appending an "I" (type character) to the constant value:
Private Function GetTheAnswerAsInteger() As Integer
Return 42I
End Function
There's also "S" for S... | In VB.NET, the suffix for a Byte literal is not "B" but rather "UI" (for Unsigned Integer). So if you want to specify a Byte value using a suffix, you can use the `UI` suffix.
For example, to specify a Byte value of `255`, you would write:
```vb
Dim byteValue As Byte = 255UI
```
However, it's worth noting that usin... | 26,600 | [
{
"from": "human",
"value": "Just out of curiosity:\nI know I can tell the compiler if I want a value to be interpreted as a certain numeric type, e.g. as Integer (32 bit signed), this way appending an \"I\" (type character) to the constant value:\nPrivate Function GetTheAnswerAsInteger() As Integer\n\n R... |
I'm using sIFR in a page that's being popped up in a nyroModal lightbox, but when the page is displayed, the sIFR objects aren't being shown. What do I need to do to get them to show?
| When you're using sIFR (Scalable Inman Flash Replacement) within a modal lightbox like nyroModal, you might encounter issues with sIFR objects not being displayed correctly. This is likely due to the fact that sIFR relies on the availability of the DOM at the time it executes. Here are some steps you can take to resolv... | 21,812 | [
{
"from": "human",
"value": "I'm using sIFR in a page that's being popped up in a nyroModal lightbox, but when the page is displayed, the sIFR objects aren't being shown. What do I need to do to get them to show?\n"
},
{
"from": "gpt",
"value": "When you're using sIFR (Scalable Inman Flash Repla... |
its out of question that a dao will not hold any state.
however, for easiest access to the class, is it better to use prototype( = new every time) or singleton?
simple object creation is cheap for dao's.. it typically only holds a sessionfactory,
accessing the object from a list of singletons may be equally expensive. ... | When considering the scope of Data Access Objects (DAOs) in your application, there are several factors to consider, including the lifecycle of the DAO, the resources it manages, and the conventions used in the framework or technology stack you're employing.
### Common Conventions for DAOs
1. **Prototype Scope (New I... | 21,721 | [
{
"from": "human",
"value": "its out of question that a dao will not hold any state.\nhowever, for easiest access to the class, is it better to use prototype( = new every time) or singleton?\nsimple object creation is cheap for dao's.. it typically only holds a sessionfactory,\naccessing the object from a l... |
I am currently running gdb version 6.7.1 on Ubuntu Linux, and working in a C++ project.
Surprisingly I was trying to debug a constructor and I have found that local variables declared within the scope of the constructor are not followed or noticed by gdb. Is this a bug ?
Thanks for any information ..
| What you're experiencing with GDB (GNU Debugger) not recognizing local variables in a constructor can be due to several factors, especially considering that you're using a relatively old version (6.7.1) of GDB. Here are some things to consider and potential solutions:
1. **Version Limitation**: GDB version 6.7.1 is qu... | 24,737 | [
{
"from": "human",
"value": "I am currently running gdb version 6.7.1 on Ubuntu Linux, and working in a C++ project.\nSurprisingly I was trying to debug a constructor and I have found that local variables declared within the scope of the constructor are not followed or noticed by gdb. Is this a bug ?\nThank... |
I have a lot of constants that are somehow related, at some point I need to pair them, something like this:
const
key1 = '1';
key2 = '2';
key3 = '3';
value1 = 'a';
value2 = 'b';
value3 = 'c';
I want to avoid doing:
if MyValue = key1 then Result := value1;
I know how to do it with string lists using:
MySt... | Yes, there's a more straightforward way to pair keys and values without needing to use string lists. You can use a dictionary or a similar data structure that directly maps keys to their corresponding values. If you're working in a language that supports dictionaries (like Delphi's `TDictionary` or Python's dictionary)... | 25,094 | [
{
"from": "human",
"value": "I have a lot of constants that are somehow related, at some point I need to pair them, something like this:\nconst\n key1 = '1';\n key2 = '2';\n key3 = '3';\n\n value1 = 'a';\n value2 = 'b';\n value3 = 'c';\n\nI want to avoid doing:\nif MyValue = key1 then Result := value1... |
What exactly does the word patch mean when referring to 'submitting a patch'?
I've seen this used a lot, especially in the open source world. What what does it mean and what exactly is involved in submitting a patch?
| In the context of software development, particularly in open source projects, a **"patch"** refers to a set of changes or updates to the source code. This can include modifications, fixes, or enhancements to existing code. The term originates from the idea of "patching" a problem in the code, similar to how one might s... | 23,012 | [
{
"from": "human",
"value": "What exactly does the word patch mean when referring to 'submitting a patch'?\nI've seen this used a lot, especially in the open source world. What what does it mean and what exactly is involved in submitting a patch?\n"
},
{
"from": "gpt",
"value": "In the context o... |
Here's the page:
https://www.testmasters.net/test/ssltest2.aspx
When I go to it (in firefox or chrome), it says "connection partially encrypted". But all references to objects are https and not http as far as I can tell.
What's odd is that if you remove the RequiredFieldValidator, the page works fine. Here's the source... | The "connection partially encrypted" message typically indicates that there are mixed content issues on the page, meaning that some resources are being loaded over an insecure (HTTP) connection while others are secure (HTTPS). This can happen if certain elements on the page are referenced with an HTTP URL instead of HT... | 23,208 | [
{
"from": "human",
"value": "Here's the page:\nhttps://www.testmasters.net/test/ssltest2.aspx\nWhen I go to it (in firefox or chrome), it says \"connection partially encrypted\". But all references to objects are https and not http as far as I can tell.\nWhat's odd is that if you remove the RequiredFieldVal... |
I am using boost::signal in a native C++ class, and I now I am writing a .NET wrapper in C++/CLI, so that I can expose the native C++ callbacks as .NET events. When I try to use boost::bind to take the address of a member function of my managed class, I get compiler error 3374, saying I cannot take the address of a mem... | The issue you're encountering arises from the fact that in C++/CLI, you cannot directly bind member functions of managed classes to a native function pointer or use `boost::bind` as you would for a native class. Instead, you need to create a delegate that matches the signature of your method and then bind your managed ... | 24,415 | [
{
"from": "human",
"value": "I am using boost::signal in a native C++ class, and I now I am writing a .NET wrapper in C++/CLI, so that I can expose the native C++ callbacks as .NET events. When I try to use boost::bind to take the address of a member function of my managed class, I get compiler error 3374, ... |
Actually here is a similar topic with little practical value.
As far as I understand, primitives perform better and should be used everywhere except for the cases where Object-related features (e.g. null check) are needed. Right?
| Your understanding touches on an important aspect of programming with primitives and their corresponding wrapper objects (like `Integer`, `Double`, etc.) in languages like Java.
1. **Performance**: Primitives typically have better performance than wrapper objects. This is because primitives are stored directly on the ... | 26,402 | [
{
"from": "human",
"value": "Actually here is a similar topic with little practical value.\nAs far as I understand, primitives perform better and should be used everywhere except for the cases where Object-related features (e.g. null check) are needed. Right?\n"
},
{
"from": "gpt",
"value": "You... |
I have read on Stack Overflow some people that have converting to C#2.0 to C#3, but is it really worth it?
I have a project that is done at 75% before going in maintenance phase. I am asking to myself if it is worth it to switch to C#3.0?
Update:
The project will have a web interface now so before entering the maintena... | Upgrading from C# 2.0 to C# 3.0 (or even 3.5) can provide several benefits, particularly when considering the changes and enhancements introduced in these versions. Here are some points to consider that may help you decide if the upgrade is worth it for your project:
### Benefits of Upgrading to C# 3.0 / 3.5
1. **Lan... | 14,264 | [
{
"from": "human",
"value": "I have read on Stack Overflow some people that have converting to C#2.0 to C#3, but is it really worth it?\nI have a project that is done at 75% before going in maintenance phase. I am asking to myself if it is worth it to switch to C#3.0?\nUpdate:\nThe project will have a web i... |
How do I go about making the default value of the combobox as the first item in the array.
| To set the default value of a ComboBox to the first item in an array, the exact method depends on the programming language and framework you are using. Below are examples for a few common scenarios.
### 1. **HTML and JavaScript**
If you're using plain HTML with JavaScript:
```html
<!DOCTYPE html>
<html lang="en">
<he... | 22,081 | [
{
"from": "human",
"value": "How do I go about making the default value of the combobox as the first item in the array. \n"
},
{
"from": "gpt",
"value": "To set the default value of a ComboBox to the first item in an array, the exact method depends on the programming language and framework you a... |
I was wondering if there was a good way to monitor a document library on SharePoint for changes (new files added, files changed / checked-in, files deleted, etc.)
Basically, what System.IO.FileSystemWatcher does on local / network directories.
Are there events that get fired when documents are uploaded to document libr... | Monitoring changes in a SharePoint document library can be achieved through several methods, each with its own advantages. Here are some suggestions:
### 1. **Using SharePoint Webhooks**
SharePoint supports webhooks that allow you to receive notifications when changes occur in a SharePoint site or document library. H... | 24,784 | [
{
"from": "human",
"value": "I was wondering if there was a good way to monitor a document library on SharePoint for changes (new files added, files changed / checked-in, files deleted, etc.)\nBasically, what System.IO.FileSystemWatcher does on local / network directories.\nAre there events that get fired w... |
I want to store values in a bunch of currencies and I'm not too keen on the imprecise nature of floats. Being able to do math on them directly in queries is also a requirement.
Is Decimal the way to go here?
| Yes, using the `Decimal` type (or its equivalent in your specific database management system) is generally the best approach for storing values in currencies. Here are a few reasons why `Decimal` is preferable over `float` for this purpose:
1. **Precision**: `Decimal` types allow you to specify the precision and scale... | 25,693 | [
{
"from": "human",
"value": "I want to store values in a bunch of currencies and I'm not too keen on the imprecise nature of floats. Being able to do math on them directly in queries is also a requirement. \nIs Decimal the way to go here?\n"
},
{
"from": "gpt",
"value": "Yes, using the `Decimal`... |
I'm using TortoiseHg 0.5 (which includes Mercurial 1.0.2) on Vista64. My understanding from the Mercurial Book is that Mercurial should handle filenames in a case-insensitive manner on a case-insensitive filesystem (such as NTFS, which is what I'm on). However I find that my installation of Mercurial is in fact sensiti... | What you are experiencing is a known behavior in Mercurial when used on a case-insensitive filesystem like NTFS on Windows. In general, Mercurial should indeed handle filenames in a case-insensitive way, but there are a few factors that could lead to the behavior you're observing.
1. **Repository Initialization**: If ... | 24,567 | [
{
"from": "human",
"value": "I'm using TortoiseHg 0.5 (which includes Mercurial 1.0.2) on Vista64. My understanding from the Mercurial Book is that Mercurial should handle filenames in a case-insensitive manner on a case-insensitive filesystem (such as NTFS, which is what I'm on). However I find that my ins... |
I'm trying to add multi-language support to an OpenSocial application. I see that I can link to my own message bundles in the gadget XML markup:
<Module>
<ModulePrefs title="Hello" description="Message bundle demo">
<Require feature="opensocial-0.7"/>
<Locale lang="en" messages="http://example.com/hello/en_... | To extract values from message bundles in your OpenSocial application, you can use the `opensocial.getMessage` method provided by the OpenSocial API. Here’s how you can utilize it within your gadget.
1. **Define your message bundles**: Ensure that you have your message bundles properly defined in XML format. For examp... | 17,224 | [
{
"from": "human",
"value": "I'm trying to add multi-language support to an OpenSocial application. I see that I can link to my own message bundles in the gadget XML markup:\n<Module>\n <ModulePrefs title=\"Hello\" description=\"Message bundle demo\">\n <Require feature=\"opensocial-0.7\"/>\n <Loca... |
Has Java 1.6 SDK been released for mac? I can't seem to find it...
| Java 1.6 (also known as Java SE 6) was officially released for macOS as part of the Mac OS X 10.6 (Snow Leopard) operating system in 2009. If you are looking for the Java 1.6 SDK for macOS, it may not be available as a standalone download from Oracle, as Apple provided their own version of Java for macOS.
If you are u... | 23,954 | [
{
"from": "human",
"value": "Has Java 1.6 SDK been released for mac? I can't seem to find it...\n"
},
{
"from": "gpt",
"value": "Java 1.6 (also known as Java SE 6) was officially released for macOS as part of the Mac OS X 10.6 (Snow Leopard) operating system in 2009. If you are looking for the J... |
I am attempting to set up an nmake makefile to export our balsamiq mockup files to png files automatically, but I'm afraid I can't make heads nor tails of how to make a generic rule for doing so, without explicitly listing all the files I want exported.
This page details the command line syntax for exporting the files,... | To set up a makefile using `nmake` that can automatically export Balsamiq mockup files (.bmml) to PNG files, you'll want to define a rule that tells `nmake` how to build the target files from the source files. Let's break this down into steps.
### Basic Structure
Your goal is to have a rule that can convert `.bmml` f... | 23,382 | [
{
"from": "human",
"value": "I am attempting to set up an nmake makefile to export our balsamiq mockup files to png files automatically, but I'm afraid I can't make heads nor tails of how to make a generic rule for doing so, without explicitly listing all the files I want exported.\nThis page details the co... |
The coding is done using VS2008
There are two divs in my page namely "dvLeftContent" and "dvRightContent".
I cannot statically set the height of the pages since "dvRightContent" have variable heights on various pages (Master Pages are used here)
Is there a client side function(javascript or jquery) that takes the heigh... | Yes, you can achieve this by using JavaScript or jQuery to dynamically set the height of the `dvLeftContent` div to match the height of the `dvRightContent` div. This can be done by running a script when the document is ready or when the page is loaded. Below is an example of how to do this using jQuery:
### Using jQu... | 22,606 | [
{
"from": "human",
"value": "The coding is done using VS2008\nThere are two divs in my page namely \"dvLeftContent\" and \"dvRightContent\".\nI cannot statically set the height of the pages since \"dvRightContent\" have variable heights on various pages (Master Pages are used here)\nIs there a client side f... |
What techniques are available to profile services running in WebMethods Integration Server?
That is, to obtain data which would indicate which parts would benefit most from optimisation.
| Profiling services in webMethods Integration Server (IS) is essential for identifying performance bottlenecks and optimizing system performance. Various techniques and tools can be utilized to profile services effectively. Here are some common methods:
### 1. **Built-in Performance Monitoring Tools:**
- **webMethod... | 21,632 | [
{
"from": "human",
"value": "What techniques are available to profile services running in WebMethods Integration Server?\nThat is, to obtain data which would indicate which parts would benefit most from optimisation.\n"
},
{
"from": "gpt",
"value": "Profiling services in webMethods Integration S... |
When running a CherryPy app it will send server name tag something like CherryPy/version.
Is it possible to rename/overwrite that from the app without modifying CherryPy so it will show something else?
Maybe something like MyAppName/version (CherryPy/version)
| Yes, it is possible to customize the server header in a CherryPy application without modifying the CherryPy library itself. You can do this by overriding the `server_name` attribute of the CherryPy configuration. This allows you to set a custom name for your application in the server response headers.
Here’s how you c... | 25,717 | [
{
"from": "human",
"value": "When running a CherryPy app it will send server name tag something like CherryPy/version.\nIs it possible to rename/overwrite that from the app without modifying CherryPy so it will show something else? \nMaybe something like MyAppName/version (CherryPy/version) \n"
},
{
... |
I have an xml file where I need to comment out a whole piece of text with Ant.
There's this Ant task
<replace file="${src.dir}/Version.as"
token="@revisionPrana" value="${revision}"/>
that I use to replace words, but in my case I need to replace a whole block like this:
<value>
<object class="edumatic.back... | In Apache Ant, the `<replace>` task is primarily meant for simple token-based text replacements, and it doesn't support multi-line replacements or comments as you would need for your specific XML block. Since you're looking to comment out a whole block of XML, using the `<replace>` task isn't the right approach.
Howev... | 23,218 | [
{
"from": "human",
"value": "I have an xml file where I need to comment out a whole piece of text with Ant.\nThere's this Ant task\n<replace file=\"${src.dir}/Version.as\" \n token=\"@revisionPrana\" value=\"${revision}\"/>\n\nthat I use to replace words, but in my case I need to replace a whole blo... |
Is there a way to Invoke an overloaded method using reflection in .NET (2.0). I have an application that dynamically instantiates classes that have been derived from a common base class. For compatibility purposes, this base class contains 2 methods of the same name, one with parameters, and one without. I need to c... | To invoke an overloaded method using reflection in .NET (including .NET 2.0), you need to specify which overload you want to call explicitly. In your case, since you have a parameterless method and another one with parameters, the ambiguity arises when you attempt to call the method without specifying which overload yo... | 22,885 | [
{
"from": "human",
"value": "Is there a way to Invoke an overloaded method using reflection in .NET (2.0). I have an application that dynamically instantiates classes that have been derived from a common base class. For compatibility purposes, this base class contains 2 methods of the same name, one with ... |
What is the best comment in source code you have ever encountered?
| The "best" comment in source code can be subjective and may vary from person to person based on their experiences and preferences. However, some of the most appreciated comments often share a few key characteristics: they are clear, concise, informative, and sometimes even humorous. Here are a few examples of notable c... | 25,829 | [
{
"from": "human",
"value": "What is the best comment in source code you have ever encountered?\n"
},
{
"from": "gpt",
"value": "The \"best\" comment in source code can be subjective and may vary from person to person based on their experiences and preferences. However, some of the most apprecia... |
How can I scale the content of an iframe (in my example it is an HTML page, and is not a popup) in a page of my web site?
For example, I want to display the content that appears in the iframe at 80% of the original size.
| To scale the content of an iframe in a web page to a specific percentage (such as 80% of the original size), you can use CSS to achieve this effect. Here are a couple of methods you can use to scale the iframe content:
### Method 1: Using CSS Transform
You can use the CSS `transform` property to scale the iframe. Her... | 19,162 | [
{
"from": "human",
"value": "How can I scale the content of an iframe (in my example it is an HTML page, and is not a popup) in a page of my web site?\nFor example, I want to display the content that appears in the iframe at 80% of the original size.\n"
},
{
"from": "gpt",
"value": "To scale the... |
I’m having an issue where a drop down list in IE 6/7 is behaving as such:
You can see that the drop down width is not wide enough to display the whole text without expanding the overall drop down list.
However in Firefox, there is no issue as it expands the width accordingly. This is the behaviour we want in IE 6/7:
... | Dealing with dropdown lists in Internet Explorer 6 and 7 can be quite tricky due to the limited CSS capabilities and inconsistent rendering behaviors compared to more modern browsers. Unfortunately, IE 6 and 7 do not natively support auto-expanding dropdown widths based on content like Firefox does.
However, you can a... | 20,615 | [
{
"from": "human",
"value": "I’m having an issue where a drop down list in IE 6/7 is behaving as such:\n\nYou can see that the drop down width is not wide enough to display the whole text without expanding the overall drop down list.\nHowever in Firefox, there is no issue as it expands the width accordingly... |
As stated in RFC 3286:
"...endpoints must manage the conversion between bytes sent and received and TSNs sent and received, since TSN is per chunk rather than per byte".
How does this affect the congestion control algorithm?
| RFC 3286 discusses the Stream Control Transmission Protocol (SCTP) and its handling of messages, particularly the way it deals with Transport Sequence Numbers (TSNs) in relation to the chunks of data that it sends and receives. Each chunk has a unique TSN, which helps to maintain the order and integrity of the data bei... | 21,482 | [
{
"from": "human",
"value": "As stated in RFC 3286:\n\"...endpoints must manage the conversion between bytes sent and received and TSNs sent and received, since TSN is per chunk rather than per byte\".\nHow does this affect the congestion control algorithm?\n"
},
{
"from": "gpt",
"value": "RFC 3... |
I'm trying to load fragments of XHTML markup using jQuery's $.fn.load function, but it raises an error trying to add the new markup into the DOM. I've narrowed this down to the XML declaration (<?xml...?>) -- the view works if I return static text without the declaration. I don't understand why this would cause failure... | The issue you're encountering arises from the fact that jQuery and the browser's DOM handling have limitations when dealing with XML documents that include an XML declaration (like `<?xml version="1.0" encoding="UTF-8"?>`). When you retrieve an XHTML document as an XML document, the inclusion of the XML declaration mak... | 23,797 | [
{
"from": "human",
"value": "I'm trying to load fragments of XHTML markup using jQuery's $.fn.load function, but it raises an error trying to add the new markup into the DOM. I've narrowed this down to the XML declaration (<?xml...?>) -- the view works if I return static text without the declaration. I don'... |
I would like to translate some C code to Python code or bytecode. The C code in question is what i'd call purely algorithmic: platform independent, no I/O, just algorithms and in-memory data structures.
An example would be a regular expression library. Translation tool would process library source code and produce a fu... | Translating C code to Python code or bytecode involves several steps and considerations. Here are some approaches, tools, and techniques you can use for the translation process, especially for algorithms and data structures without platform-specific dependencies or I/O operations:
### Approaches
1. **Manual Translati... | 22,356 | [
{
"from": "human",
"value": "I would like to translate some C code to Python code or bytecode. The C code in question is what i'd call purely algorithmic: platform independent, no I/O, just algorithms and in-memory data structures.\nAn example would be a regular expression library. Translation tool would pr... |
I am running a series of JUnits using Apache ANT using JDK 1.5.
All JUnits that use an Oracle JDBC driver give the UnsatisfiedLinkError shown below.
What native library is it looking for and how do I solve this? What should the PATH variable contain?
java.lang.UnsatisfiedLinkError: oracle/jdbc/driver/T2CConnection.t2cG... | The `UnsatisfiedLinkError` you are seeing indicates that the Oracle JDBC driver is trying to load a native library that it cannot find. The specific method mentioned in the error (`t2cGetCharSet`) suggests that it is looking for a native library related to the Oracle OCI (Oracle Call Interface).
To resolve this issue,... | 20,646 | [
{
"from": "human",
"value": "I am running a series of JUnits using Apache ANT using JDK 1.5.\nAll JUnits that use an Oracle JDBC driver give the UnsatisfiedLinkError shown below.\nWhat native library is it looking for and how do I solve this? What should the PATH variable contain?\njava.lang.UnsatisfiedLink... |
Are there any libraries for Java that can generate unit tests or unit test skeletons for existing code? I'm looking for something similar to pythoscope. Ideally it would generate code that follows JUnit4 or TestNG conventions.
It looks like Agitar does something like this, but I'm looking for something free.
| Yes, there are a few libraries and tools available in the Java ecosystem that can help generate unit tests or skeletons for existing code, and many of them are free. Here are some options you can explore:
1. **JUnit-Quickcheck**:
- Although it is primarily a property-based testing library for Java, you can use it t... | 23,541 | [
{
"from": "human",
"value": "Are there any libraries for Java that can generate unit tests or unit test skeletons for existing code? I'm looking for something similar to pythoscope. Ideally it would generate code that follows JUnit4 or TestNG conventions.\nIt looks like Agitar does something like this, but ... |
Why would you choose java over others? Why did you choose java to program your application?
Please include what you are using java for (desktop application/ web application/ mobile).
| Choosing Java for application development can be based on various factors, depending on the specific requirements of the project and the characteristics of Java itself. Here are several reasons why one might choose Java over other programming languages, along with potential use cases for desktop applications, web appli... | 21,552 | [
{
"from": "human",
"value": "Why would you choose java over others? Why did you choose java to program your application?\nPlease include what you are using java for (desktop application/ web application/ mobile).\n"
},
{
"from": "gpt",
"value": "Choosing Java for application development can be b... |
Say I need some very special multiplication operator. It may be implemented in following macro:
macro @<<!(op1, op2)
{
<[ ( $op1 * $op2 ) ]>
}
And I can use it like
def val = 2 <<! 3
And its work.
But what I really want is some 'english'-like operator for the DSL Im developing now:
macro @multiply(op1, op2)
{
... | The issue you're encountering arises from the fact that typical programming languages expect operators (like `*`, `+`, etc.) to be used in specific formats, and they don't have built-in support for creating infix functions or macros using just the `def` keyword and calling the function by an arbitrary name like `multip... | 23,042 | [
{
"from": "human",
"value": "Say I need some very special multiplication operator. It may be implemented in following macro:\nmacro @<<!(op1, op2)\n{\n <[ ( $op1 * $op2 ) ]>\n}\n\nAnd I can use it like\ndef val = 2 <<! 3\n\nAnd its work.\nBut what I really want is some 'english'-like operator for the DSL... |
I have a web server built in Delphi, and I'm trying to consume its web services on Java (I'm using Eclipse IDE) by creating a Web Service Client through the Eclipse wizard. The Web Services Explorer recognice the WSDL file, but when trying to create the client, the wizard says there's an "unexpected attribute" and does... | The issue you are encountering with the WSDL file is due to the fact that it uses the "rpc" style with the "encoded" use, which is less commonly supported and often leads to compatibility issues with WSDL consumers. Many modern tools and frameworks prefer "document" style WSDLs with "literal" use due to their simplicit... | 20,376 | [
{
"from": "human",
"value": "I have a web server built in Delphi, and I'm trying to consume its web services on Java (I'm using Eclipse IDE) by creating a Web Service Client through the Eclipse wizard. The Web Services Explorer recognice the WSDL file, but when trying to create the client, the wizard says t... |
Having difficulty articulating this correlated subquery. I have two tables fictitious tables, foo and bar. foo has two fields of foo_id and total_count. bar has two fields, seconds and id.
I need to aggregate the seconds in bar for each individual id and update the total_count in foo. id is a foreign key in bar for fo... | To achieve the desired update where you're aggregating the `seconds` from the `bar` table and updating the `total_count` in the `foo` table, you need to ensure that the subquery properly relates to the outer update and correctly filters based on the foreign key relationship.
Here’s an example of how you can structure ... | 22,137 | [
{
"from": "human",
"value": "Having difficulty articulating this correlated subquery. I have two tables fictitious tables, foo and bar. foo has two fields of foo_id and total_count. bar has two fields, seconds and id.\nI need to aggregate the seconds in bar for each individual id and update the total_count... |
as google does not deliver what i want to know, i try to ask stackoverflow :)
what is the number of max concurrent connections to a sql ce 3.5 database?
thanks
j.
| SQL Server Compact Edition (SQL CE) 3.5 supports a maximum of **256 concurrent connections**. However, it's important to note that while it can handle up to 256 connections, performance may degrade as more connections are added due to the limitations of the lightweight database engine.
Keep in mind that SQL CE is des... | 27,770 | [
{
"from": "human",
"value": "as google does not deliver what i want to know, i try to ask stackoverflow :)\nwhat is the number of max concurrent connections to a sql ce 3.5 database?\nthanks\nj.\n"
},
{
"from": "gpt",
"value": "SQL Server Compact Edition (SQL CE) 3.5 supports a maximum of **256 ... |
Given the hash of a blob, is there a way to get a list of commits that have this blob in their tree?
| Yes, if you have the hash of a blob in a Git repository and want to find all the commits that contain this blob in their tree, you can do so by using a combination of Git commands. The basic approach involves using `git rev-list` along with `git grep` to search through the history of the repository.
Here's a step-by-s... | 23,373 | [
{
"from": "human",
"value": "Given the hash of a blob, is there a way to get a list of commits that have this blob in their tree?\n"
},
{
"from": "gpt",
"value": "Yes, if you have the hash of a blob in a Git repository and want to find all the commits that contain this blob in their tree, you ca... |
I'm building an ASP.Net MVC website. Rather than have everything in one project, I've decided to separate the Web, Model and Controller out into different projects in the same solution, that reference each-other.
The referencing goes like this:
Web ---[references]---> Controller ---[references]---> Model
Now I wanted... | Based on your description, it seems like you've correctly defined custom extension methods for the `HtmlHelper` class in your ASP.NET MVC project. However, the runtime error you're encountering indicates that the application cannot find the `IncludeScript` method at runtime, despite it appearing correctly in IntelliSen... | 22,261 | [
{
"from": "human",
"value": "I'm building an ASP.Net MVC website. Rather than have everything in one project, I've decided to separate the Web, Model and Controller out into different projects in the same solution, that reference each-other.\nThe referencing goes like this:\n\nWeb ---[references]---> Contro... |
For an std::map<std::string, std::string> variables, I'd like to do this:
BOOST_CHECK_EQUAL(variables["a"], "b");
The only problem is, in this context variables is const, so operator[] won't work :(
Now, there are several workarounds to this; casting away the const, using variables.count("a") ? variables.find("a")->se... | You're correct that `std::map::operator[]` is not suitable for accessing values from a `const std::map` because it can modify the map if the key does not exist. However, there are more elegant alternatives to directly accessing elements that keep your code clean and maintainable.
Here are a few options you might consi... | 23,264 | [
{
"from": "human",
"value": "For an std::map<std::string, std::string> variables, I'd like to do this:\nBOOST_CHECK_EQUAL(variables[\"a\"], \"b\");\n\nThe only problem is, in this context variables is const, so operator[] won't work :(\nNow, there are several workarounds to this; casting away the const, usi... |
My Account model has the following two associations:
has_many :expenses,
:order => 'expenses.dated_on DESC',
:dependent => :destroy
has_many :recent_expenses,
:class_name => 'Expense',
:conditions => "expenses.dated_on <= '#{Date.today}'",
:order => 'dated_on DES... | The behavior you are observing with the `:conditions` clause in your `recent_expenses` association is likely due to the way that Active Record caches the query and how the Ruby string interpolation works at the time the association is defined.
When you define the `:conditions` with a string that includes `#{Date.today... | 25,969 | [
{
"from": "human",
"value": "My Account model has the following two associations:\nhas_many :expenses, \n :order => 'expenses.dated_on DESC', \n :dependent => :destroy\n\nhas_many :recent_expenses, \n :class_name => 'Expense', \n :conditions => \"expenses.dated_on <= '#... |
I have multiple threads (C# application running on IIS) running that all need to communicate with the same MQ backend. To minimize network traffic, I need to only send a backend request when there is work to be done. There will be one thread to monitor if there is work to be done, and it needs to notify the other thr... | Certainly! To optimize the communication between your monitor and worker threads, you can use thread synchronization constructs provided by .NET, such as `AutoResetEvent` or `ManualResetEvent`. These constructs allow the monitor thread to notify the worker threads only when work is available, instead of having them con... | 22,445 | [
{
"from": "human",
"value": "I have multiple threads (C# application running on IIS) running that all need to communicate with the same MQ backend. To minimize network traffic, I need to only send a backend request when there is work to be done. There will be one thread to monitor if there is work to be d... |
I wrote a C# application for a client a couple of years ago, but I no longer have the source code. All I have is the EXE that I deployed on the client's PC. Is there a way I can generate C# source code from the EXE?
| Yes, you can reverse-engineer an EXE file to generate C# source code using various tools. While the result may not be identical to the original source code (especially with respect to comments, original variable names, and structure), you can get a fairly good approximation of the code. Here are some popular tools for ... | 21,655 | [
{
"from": "human",
"value": "I wrote a C# application for a client a couple of years ago, but I no longer have the source code. All I have is the EXE that I deployed on the client's PC. Is there a way I can generate C# source code from the EXE?\n"
},
{
"from": "gpt",
"value": "Yes, you can rev... |
I want to copy all of the columns of a row, but not have to specify every column. I am aware of the syntax at http://dev.mysql.com/doc/refman/5.1/en/insert-select.html but I see no way to ignore a column.
For my example, I am trying to copy all the columns of a row to a new row, except for the primary key.
Is there a w... | In MySQL, there is no built-in way to directly copy all columns from a row while excluding specific columns using a single command. However, you can achieve your goal by using a workaround. Here are two common approaches:
### Approach 1: Dynamic SQL
If you want to avoid hardcoding column names, you can write a dynami... | 23,822 | [
{
"from": "human",
"value": "I want to copy all of the columns of a row, but not have to specify every column. I am aware of the syntax at http://dev.mysql.com/doc/refman/5.1/en/insert-select.html but I see no way to ignore a column.\nFor my example, I am trying to copy all the columns of a row to a new row... |
I tried the following code in LINQPad and got the results given below:
List<string> listFromSplit = new List<string>("a, b".Split(",".ToCharArray())).Dump();
listFromSplit.ForEach(delegate(string s)
{
s.Trim();
});
listFromSplit.Dump();
"a" and " b"
so the letter b didn't get the white-space removed as I was ex... | The issue you're encountering arises from how the `Trim()` method is being used in your code. In your `ForEach` loop, the `Trim()` method is called on the string `s`, but it does not modify `s` in place, because strings in C# are immutable. Instead, `Trim()` returns a new string with the whitespace removed. Since you'r... | 23,879 | [
{
"from": "human",
"value": "I tried the following code in LINQPad and got the results given below:\nList<string> listFromSplit = new List<string>(\"a, b\".Split(\",\".ToCharArray())).Dump();\nlistFromSplit.ForEach(delegate(string s) \n{ \n s.Trim(); \n});\nlistFromSplit.Dump();\n\n\n\"a\" and \" b\"\n\nso... |
Suppose I have a hash_map and a code like
// i is an iterator
i = hash_map.erase(i)
But GCC's STL doesn't return iterator in erase, but a void. Now is a code like
hash_map.erase(i++)
safe (i.e. does not invalidate the iterator or does any other unexpected or unpleasant things)? Please note this is a hash_map.
| When using a `std::unordered_map` (often referred to as a hash map in C++), the behavior of the `erase` function is important to understand, especially regarding iterators.
In standard C++ (as provided by GCC's implementation of the STL), the `erase` function can operate on an iterator, and it removes the element poin... | 23,590 | [
{
"from": "human",
"value": "Suppose I have a hash_map and a code like\n// i is an iterator\ni = hash_map.erase(i)\n\nBut GCC's STL doesn't return iterator in erase, but a void. Now is a code like\nhash_map.erase(i++)\n\nsafe (i.e. does not invalidate the iterator or does any other unexpected or unpleasant ... |
What is the best way to save enums into a database?
I know Java provides name() and valueOf() methods to convert enum values into a String and back. But are there any other (flexible) options to store these values?
Is there a smart way to make enums into unique numbers (ordinal() is not safe to use)?
Update
Thanks for ... | Storing enums in a database efficiently and flexibly can indeed be a challenge, especially when you want to avoid duplicated code across multiple enum types. Here are some strategies you might consider:
### 1. Use a Base Enum Class
While Java enums cannot extend classes, you can define a common interface or abstract c... | 23,354 | [
{
"from": "human",
"value": "What is the best way to save enums into a database?\nI know Java provides name() and valueOf() methods to convert enum values into a String and back. But are there any other (flexible) options to store these values?\nIs there a smart way to make enums into unique numbers (ordina... |
I'm attempting to determine the row length in bytes of a table by executing the following stored procedure:
CREATE TABLE #tmp
(
[ID] int,
Column_name varchar(640),
Type varchar(640),
Computed varchar(640),
Length int,
Prec int,
Scale int,
Nullable varchar(640),
TrimTrailingBlanks varchar(640)... | The issue you are encountering is that the structure of the temporary table `#tmp` you created does not match the columns returned by the `sp_help` stored procedure. The `sp_help` procedure returns multiple result sets, and the first result set contains information about the table's columns.
To properly create the `#... | 23,650 | [
{
"from": "human",
"value": "I'm attempting to determine the row length in bytes of a table by executing the following stored procedure:\nCREATE TABLE #tmp \n(\n [ID] int, \n Column_name varchar(640), \n Type varchar(640), \n Computed varchar(640), \n Length int, \n Prec int, \n Scale int, \n Nullab... |
Is there a nicer way of styling a <hr /> tag using CSS, that is cross-browser consistent and doesn't involve wrapping a div around it? I'm struggling to find one.
The best way I have found, is as follows:
CSS
.hr {
height:20px;
background: #fff url(nice-image.gif) no-repeat scroll center;
}
hr {
d... | Certainly! You can style the `<hr />` tag directly using CSS without needing to wrap it in a `<div>`. Below are a couple of examples demonstrating how to create a styled `<hr />` with cross-browser consistency, utilizing pure CSS.
### Example 1: Basic Styling
```css
hr {
border: none; /* Remove the defaul... | 24,405 | [
{
"from": "human",
"value": "Is there a nicer way of styling a <hr /> tag using CSS, that is cross-browser consistent and doesn't involve wrapping a div around it? I'm struggling to find one.\nThe best way I have found, is as follows:\nCSS\n.hr { \n height:20px; \n background: #fff url(nice-image.gi... |
I have some application code which generates XML documents, which are then validated against an XML Schema. The schema makes use of NMTOKEN types, and occasionally, the generated XML contains string values which are illegal NMTOKENs (e.g. they contain spaces or weird punctuation). The Xerces schema validation catches ... | You are correct that handling NMTOKEN validation manually can be a bit cumbersome, and while there is no specific utility in Apache Commons dedicated exclusively to XML NMTOKEN validation, you can leverage regular expressions to perform this validation in a straightforward way.
Here's a brief overview of how you could... | 22,375 | [
{
"from": "human",
"value": "I have some application code which generates XML documents, which are then validated against an XML Schema. The schema makes use of NMTOKEN types, and occasionally, the generated XML contains string values which are illegal NMTOKENs (e.g. they contain spaces or weird punctuation... |
I have a very strange problem, when I try to var_dump (or print_r) a Doctrine Object, my Apache responses with an empty blank page (200 OK header). I can var_dump a normal php var like:
$dummy = array("a" => 1, "b" =>2);
And it works fine. But I can't with any object from any Doctrine class, (like a result from $conne... | This issue where `var_dump` or `print_r` on a Doctrine object leads to an empty response from the server is likely related to the way Doctrine objects are structured and how they interact with PHP's output buffering or object serialization mechanisms.
Here are a few potential reasons and solutions for this problem:
#... | 21,554 | [
{
"from": "human",
"value": "I have a very strange problem, when I try to var_dump (or print_r) a Doctrine Object, my Apache responses with an empty blank page (200 OK header). I can var_dump a normal php var like:\n$dummy = array(\"a\" => 1, \"b\" =>2);\n\nAnd it works fine. But I can't with any object fro... |
This is the SQL that I want to accomplish:
WHERE domain_nm + '\' + group_nm in ('DOMAINNAME\USERNAME1','DOMAINNAME2\USERNAME2')
I can't for the life of me find an appropriate Expression for this. And I don't think I can use two expressions as the domain name and the group name need to be concatenated.
Thanks!
| If you're trying to filter results based on the concatenation of `domain_nm` and `group_nm`, you can use SQL string concatenation in your `WHERE` clause, but the syntax will depend on your SQL dialect. Most SQL databases have a way to concatenate strings.
For example, in SQL Server, you can use the `+` operator for co... | 23,766 | [
{
"from": "human",
"value": "This is the SQL that I want to accomplish:\nWHERE domain_nm + '\\' + group_nm in ('DOMAINNAME\\USERNAME1','DOMAINNAME2\\USERNAME2') \n\nI can't for the life of me find an appropriate Expression for this. And I don't think I can use two expressions as the domain name and the grou... |
I'm looking for suggestions on possible IPC mechanisms that are:
Cross platform (Win32 and Linux at least)
Simple to implement in C++ as well as the most common scripting languages (perl, ruby, python, etc).
Finally, simple to use from a programming point of view!
What my options are? I'm programming under Linux, but... | When considering inter-process communication (IPC) mechanisms that are cross-platform, simple to implement in C++, and widely supported in scripting languages like Perl, Ruby, and Python, you have a few solid options:
### 1. **Sockets**
- **Description:** Sockets provide a robust mechanism for IPC and can be used for ... | 13,875 | [
{
"from": "human",
"value": "I'm looking for suggestions on possible IPC mechanisms that are:\n\nCross platform (Win32 and Linux at least)\nSimple to implement in C++ as well as the most common scripting languages (perl, ruby, python, etc).\nFinally, simple to use from a programming point of view!\n\nWhat m... |
In our industrial automation application, we need to capture and display the data in the milliseconds.
We have data binding between data grid control and a DataTable object. We have around three hundred records which needs to be display in the grid. So we update the 300 records every time we get the records.
Example
... | To improve the performance of updating and displaying data in your DataTable, particularly in a high-frequency data update scenario (like capturing data in milliseconds), you can consider several strategies. Here are some ideas that might help:
### 1. Use `DataTable.BeginLoadData` and `DataTable.EndLoadData`
Using the... | 22,780 | [
{
"from": "human",
"value": "In our industrial automation application, we need to capture and display the data in the milliseconds.\nWe have data binding between data grid control and a DataTable object. We have around three hundred records which needs to be display in the grid. So we update the 300 records... |
I am attempting to run the following code in phpMyAdmin:
set @tagTokenNum=0;
select @tagTokenNum:=tag_token_id from tag_token where tag_token_name = 'XXX';
delimiter go
if @tagTokenNum is null then
insert into tag_token (tag_token_name) values ('XXX');
select @tagTokenNum:=last_insert_id();
end if;
go
I have al... | In MySQL, the `IF` statement you are trying to use is a control flow statement that can only be used inside stored routines (like stored procedures or functions) and cannot be run directly in a regular query. The `delimiter` command is also not needed when running individual statements directly in phpMyAdmin.
To achie... | 22,252 | [
{
"from": "human",
"value": "I am attempting to run the following code in phpMyAdmin:\nset @tagTokenNum=0;\nselect @tagTokenNum:=tag_token_id from tag_token where tag_token_name = 'XXX';\ndelimiter go\nif @tagTokenNum is null then \n insert into tag_token (tag_token_name) values ('XXX');\n select @tagTo... |
What is the data that Process and Thread will not share ?
An advance thanks goes to everybody who provide their time
| In an operating system, processes and threads have different levels of isolation and sharing of resources. Here are the key distinctions regarding what processes and threads do **not** share:
### Processes
1. **Memory Space**: Each process has its own memory space. This means that the virtual address space for one pro... | 24,464 | [
{
"from": "human",
"value": "What is the data that Process and Thread will not share ? \nAn advance thanks goes to everybody who provide their time\n"
},
{
"from": "gpt",
"value": "In an operating system, processes and threads have different levels of isolation and sharing of resources. Here are... |
I'm a long-time Windows developer, having cut my teeth on win32 and early COM. I've been working with .NET since 2001, so I'm pretty fluent in C# and the CLR. I'd never heard of Castle Windsor until I started participating in Stack Overflow. I've read the Castle Windsor "Getting Started" guide, but it's not clicking... | Castle Windsor is a powerful Inversion of Control (IoC) container for .NET that helps manage object lifetimes, dependencies, and configurations in a more modular and maintainable way. Given your background in Win32, COM, and .NET, here’s why you might want to consider integrating Castle Windsor (or any IoC container) i... | 21,769 | [
{
"from": "human",
"value": "I'm a long-time Windows developer, having cut my teeth on win32 and early COM. I've been working with .NET since 2001, so I'm pretty fluent in C# and the CLR. I'd never heard of Castle Windsor until I started participating in Stack Overflow. I've read the Castle Windsor \"Get... |
I have a table like as follows:
SoftwareName Count Country
Project 15 Canada
Visio 12 Canada
Project 10 USA
Visio 5 USA
How do I query it to give me a summary like...
SoftwareName Canada USA Total
Project 15 10 25
Visio ... | To achieve the desired summary of the data in T-SQL, you can use the `PIVOT` function along with `SUM` to aggregate the counts for each software by country. Here’s how you can write the query:
```sql
SELECT
SoftwareName,
ISNULL(Canada, 0) AS Canada,
ISNULL(USA, 0) AS USA,
ISNULL(Canada, 0) + ISNULL(USA... | 26,209 | [
{
"from": "human",
"value": "I have a table like as follows:\n\nSoftwareName Count Country\nProject 15 Canada\nVisio 12 Canada\nProject 10 USA\nVisio 5 USA\n\nHow do I query it to give me a summary like...\n\nSoftwareName Canada USA ... |
Does anybody knows why this snippet returns false even if the passed string is "Active"?
if ($('status_'+id).getText()=="Active")
I've also tried changing the code to
if ($('status_'+id).getText()==String("Active"))
and
if (String($('status_'+id).getText())=="Active")
and still no luck.
I've also checked $('status_'... | The issue you're encountering with the comparison returning `false` could be due to several factors related to whitespace, casing, or type coercion. Here are some steps to help you troubleshoot and resolve the issue:
1. **Check for Leading/Trailing Whitespace**: Sometimes, strings may have extra spaces before or after... | 25,669 | [
{
"from": "human",
"value": "Does anybody knows why this snippet returns false even if the passed string is \"Active\"?\nif ($('status_'+id).getText()==\"Active\")\n\nI've also tried changing the code to\nif ($('status_'+id).getText()==String(\"Active\"))\n\nand\nif (String($('status_'+id).getText())==\"Act... |
Is there a way to take a backup file from SQL Server Express Edition and restore it into a standard SQL Server database? I tried to do it from Management Studio but it didn't recognize the file format.
| Yes, you can take a backup from SQL Server Express Edition and restore it in a Standard (or any other edition) of SQL Server. Both editions use the same backup file format. However, there might be some reasons why you are facing issues with the restore process. Here are some steps and considerations for successfully ba... | 22,894 | [
{
"from": "human",
"value": "Is there a way to take a backup file from SQL Server Express Edition and restore it into a standard SQL Server database? I tried to do it from Management Studio but it didn't recognize the file format.\n"
},
{
"from": "gpt",
"value": "Yes, you can take a backup from... |
I have monthly sales figures stored in separate sheets. I would like to create a plot of sales for multiple products per month. Each product would be represented in a different colored line on the same chart with each month running along the x axis.
What is the best way to create a single line chart that pulls from t... | To create a single line chart that pulls sales data for multiple products from separate sheets, you can follow these steps. This approach uses Microsoft Excel, but similar principles can be applied in Google Sheets or other spreadsheet software.
### Step-by-Step Guide for Excel:
1. **Organize Your Data**:
- Ensur... | 22,242 | [
{
"from": "human",
"value": "I have monthly sales figures stored in separate sheets. I would like to create a plot of sales for multiple products per month. Each product would be represented in a different colored line on the same chart with each month running along the x axis.\nWhat is the best way to cr... |
Is it possible to use a CHECK constraint to prevent any date that falls on a Sunday? I don't want to use a trigger.
| Yes, it is possible to use a `CHECK` constraint to prevent any date that falls on a Sunday in SQL. The exact implementation can vary slightly depending on the database system you're using (e.g., PostgreSQL, SQL Server, MySQL, etc.), but the general concept is to use a condition that checks the day of the week for the d... | 22,945 | [
{
"from": "human",
"value": "Is it possible to use a CHECK constraint to prevent any date that falls on a Sunday? I don't want to use a trigger.\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to use a `CHECK` constraint to prevent any date that falls on a Sunday in SQL. The exact implemen... |
I've been looking for a generic way to deal with bidirectional associations and a way to handle the inverse updates in manual written Java code.
For those who don't know what I'm talking about, here is an example. Below it are my current results of (unsatisfying) solutions.
public class A {
public B getB();
pub... | Hi Elmar,
Handling bidirectional associations can indeed be cumbersome in object-oriented programming, especially when you want to maintain consistency without duplicating code across your model classes. While there may not be a widely-adopted framework that exactly matches the functionality of the outdated Gemini pro... | 16,945 | [
{
"from": "human",
"value": "I've been looking for a generic way to deal with bidirectional associations and a way to handle the inverse updates in manual written Java code.\nFor those who don't know what I'm talking about, here is an example. Below it are my current results of (unsatisfying) solutions.\npu... |
I have 150+ SQL queries in separate text files that I need to analyze (just the actual SQL code, not the data results) in order to identify all column names and table names used. Preferably with the number of times each column and table makes an appearance. Writing a brand new SQL parsing program is trickier than is se... | To analyze SQL queries and extract column names and table names along with their frequencies, you can use existing SQL parsing libraries that simplify the process. Several libraries are available in different programming languages that can help with parsing SQL and extracting the desired information without the need to... | 19,215 | [
{
"from": "human",
"value": "I have 150+ SQL queries in separate text files that I need to analyze (just the actual SQL code, not the data results) in order to identify all column names and table names used. Preferably with the number of times each column and table makes an appearance. Writing a brand new S... |
What is the easiest way to check if events have been logged in the eventlog during a period of time?
I want to perform a series of automated test steps and then check if any errors were logged to the Application Event Log, ignoring a few sources that I'm not interested in. I can use System.Diagnostics.EventLog and then... | To efficiently monitor the Windows Event Log for specific entries during a defined time period while ignoring certain sources, you can create a more structured approach than directly accessing the `EventLog.Entries` collection. Since `EventLog.Entries` can be volatile (entries can be removed), it’s advisable to read en... | 21,677 | [
{
"from": "human",
"value": "What is the easiest way to check if events have been logged in the eventlog during a period of time?\nI want to perform a series of automated test steps and then check if any errors were logged to the Application Event Log, ignoring a few sources that I'm not interested in. I ca... |
I'm porting some MATLAB functions to Scilab. The cool thing is that there is a conversion toolbox that make things very easy.
The problem is I did not find the counterpart to the syms function, and the symbolic toolbox in general. (I'd like a port of the Control System Toolbox too, amd I'm still searching for some func... | The choice between Scilab with Maxima and Python with SymPy depends on several factors, including your project's specific needs, your familiarity with the tools, and the level of community support available for each option.
### Scilab with Maxima
1. **Advantages**:
- **Open Source**: Both Scilab and Maxima are open... | 25,591 | [
{
"from": "human",
"value": "I'm porting some MATLAB functions to Scilab. The cool thing is that there is a conversion toolbox that make things very easy.\nThe problem is I did not find the counterpart to the syms function, and the symbolic toolbox in general. (I'd like a port of the Control System Toolbox ... |
We are using Hibernate 3.1 with Spring MVC 2.0. Our problem occurs when data is updated on the database directly (not in the application). We use a Filter to filter a collection of results by whether the orders are opened or closed. If we change an order on the DB to be closed, the filter returns the correct list, h... | It sounds like you're running into an issue with Hibernate's session caching. Hibernate maintains a first-level cache (also known as the session cache), which means that any entities retrieved in a session will be cached within that session until it is closed or cleared. When you update data directly in the database, H... | 21,057 | [
{
"from": "human",
"value": "We are using Hibernate 3.1 with Spring MVC 2.0. Our problem occurs when data is updated on the database directly (not in the application). We use a Filter to filter a collection of results by whether the orders are opened or closed. If we change an order on the DB to be close... |
What are best practices for moving/exporting SQL Server Integration Services Packages from a SQL Server 2005 DB over to 2008?
What are some of the security concerns?
| Migrating SQL Server Integration Services (SSIS) packages from SQL Server 2005 to SQL Server 2008 involves several best practices and considerations, especially concerning security. Here’s a structured approach to help ensure a smooth transition:
### Best Practices for Moving/Exporting SSIS Packages
1. **Understand C... | 20,599 | [
{
"from": "human",
"value": "What are best practices for moving/exporting SQL Server Integration Services Packages from a SQL Server 2005 DB over to 2008? \nWhat are some of the security concerns? \n"
},
{
"from": "gpt",
"value": "Migrating SQL Server Integration Services (SSIS) packages from... |
I'm supporting a site that still uses mixed ASP.NET and ASP Classic. The user receives a 'You are not authorized' error page while accessing certain ASP Classic page. I've checked her active directory account and she could access other pages in the said site. Can it be attributed to classic ASP or to IIS?
| The "You are not authorized" error could be attributed to a few factors related to either the classic ASP code itself or the configuration settings in IIS. Here are some steps you can take to investigate and potentially resolve the issue:
### 1. **Check Authorization Settings in IIS**
- **Directory Security**: In IIS... | 23,930 | [
{
"from": "human",
"value": "I'm supporting a site that still uses mixed ASP.NET and ASP Classic. The user receives a 'You are not authorized' error page while accessing certain ASP Classic page. I've checked her active directory account and she could access other pages in the said site. Can it be attribute... |
I have multiple classes that all derive from a base class, now some of the derived classes will not be compiled depending on the platform. I have a class that allows me to return an object of the base class, however now all the names of the derived classes have been hard coded.
Is there a way to determine what classes ... | In C++, determining which derived classes of a base class have been compiled at runtime is not straightforward due to the nature of static linking and the way the C++ type system works. However, there are some strategies that you can use to achieve a similar effect, particularly when using dynamically loadable librarie... | 17,988 | [
{
"from": "human",
"value": "I have multiple classes that all derive from a base class, now some of the derived classes will not be compiled depending on the platform. I have a class that allows me to return an object of the base class, however now all the names of the derived classes have been hard coded.\... |
Somewhat-simplified example situation: I have entities A and B which are incredibly "heavy" domain objects. Loading one from the database is a pretty big deal. Then I have an entity C, which is a very simple object that has a label string, one A, and one B -- both lazy.
I'm doing some low-level querying to create huge ... | In NHibernate, to handle the situation you described—where you want to associate entities without fully loading them—you can use a technique called "proxy" objects. Proxies allow you to work with references to the domain objects (A and B) without having to load the full objects from the database until you actually need... | 21,586 | [
{
"from": "human",
"value": "Somewhat-simplified example situation: I have entities A and B which are incredibly \"heavy\" domain objects. Loading one from the database is a pretty big deal. Then I have an entity C, which is a very simple object that has a label string, one A, and one B -- both lazy.\nI'm d... |
I want my WPF application to be skinnable, by applying a certain XAML template, and the changes to be application wide, even for dynamic controls or controls that aren't even in the visual/logical tree.
What can I use to accomplish this type of functionality? Are there any good resources or tutorials that show how thi... | To make your WPF application skinnable with the ability to apply a certain XAML template globally, including for dynamically created controls or those that aren’t directly part of the visual/logical tree, you can leverage several techniques:
### Techniques to Create a Skinnable WPF Application
1. **Resource Dictionar... | 16,662 | [
{
"from": "human",
"value": "I want my WPF application to be skinnable, by applying a certain XAML template, and the changes to be application wide, even for dynamic controls or controls that aren't even in the visual/logical tree. \nWhat can I use to accomplish this type of functionality? Are there any goo... |
Is there currently any easy way to set up a YAWS web server in front of Apache Tomcat Servlet container, similar to popular Apache httpd + Tomcat set up?
| Yes, you can set up a YAWS (Yet Another Web Server) server in front of an Apache Tomcat servlet container, similar to how you would use Apache HTTP Server as a reverse proxy for Tomcat. Here's a general approach on how to achieve this:
### Step 1: Install YAWS
If you haven't already installed YAWS, you can typically ... | 22,903 | [
{
"from": "human",
"value": "Is there currently any easy way to set up a YAWS web server in front of Apache Tomcat Servlet container, similar to popular Apache httpd + Tomcat set up?\n"
},
{
"from": "gpt",
"value": "Yes, you can set up a YAWS (Yet Another Web Server) server in front of an Apache... |
string[] filesOfType1 = GetFileList1();
string[] filesOfType2 = GetFileList2();
var cookieMap = new Dictionary<string, CookieContainer>();
Action<string, Func<string, KeyValuePair<string, CookieContainer>>> addToMap = (filename, pairGetter) =>
{
KeyValuePair<string, CookieContainer> cookiePair;
try... | Based on your requirements and the features you want to preserve, here's a functional approach that refines your logic while maintaining the importance of file types and handling exceptions gracefully.
### Improved Solution
We will continue to use LINQ but enhance the logic to account for the precedence of file types ... | 24,709 | [
{
"from": "human",
"value": "string[] filesOfType1 = GetFileList1();\nstring[] filesOfType2 = GetFileList2();\nvar cookieMap = new Dictionary<string, CookieContainer>();\n\nAction<string, Func<string, KeyValuePair<string, CookieContainer>>> addToMap = (filename, pairGetter) =>\n {\n KeyValuePair<s... |
This is a part algorithm-logic question (how to do it), part implementation question (how to do it best!). I'm working with Django, so I thought I'd share with that.
In Python, it's worth mentioning that the problem is somewhat related to how-do-i-use-pythons-itertoolsgroupby.
Suppose you're given two Django Model-deri... | To group Django `Car` instances by their common set of `Mods`, we can approach the problem using a combination of Django's ORM for querying and Python's built-in tools for data manipulation, such as `defaultdict` for organizing data and `frozenset` for easy set comparisons.
Here's a step-by-step breakdown of how you c... | 17,225 | [
{
"from": "human",
"value": "This is a part algorithm-logic question (how to do it), part implementation question (how to do it best!). I'm working with Django, so I thought I'd share with that.\nIn Python, it's worth mentioning that the problem is somewhat related to how-do-i-use-pythons-itertoolsgroupby.\... |
When trying to commit to a cvs branch after adding a new file I get this error
Assertion failed: key != NULL, file hash.c, line 317
Any idea how to fix it so I can check my code in?
Both server and client are Linux and there are pre-commits involved.
| The error message you're seeing, `Assertion failed: key != NULL, file hash.c, line 317`, suggests that there might be an issue with the way CVS is handling the file hashing in the pre-commit process. This can happen due to several reasons:
1. **Corrupted CVS Repository**: There could be corruption in the CVS repositor... | 8,376 | [
{
"from": "human",
"value": "When trying to commit to a cvs branch after adding a new file I get this error\nAssertion failed: key != NULL, file hash.c, line 317\n\nAny idea how to fix it so I can check my code in?\nBoth server and client are Linux and there are pre-commits involved.\n"
},
{
"from":... |
My problem:
There are numerous (>100) tools the development teams use which are "home" written. They are sometimes a perl script, or a "web page", or just something that does a couple of small functions. I need to find a way (as part of my "Middle Manager in charge of tools" job) to collect these into a single catalog... | You're addressing a common challenge in many organizations that have a mix of custom-built tools. Here’s a structured approach to help you establish a centralized catalog for these tools, including technology options, best practices for management, and process checks.
### 1. Technology Options for Centralized Storage ... | 19,812 | [
{
"from": "human",
"value": "My problem: \nThere are numerous (>100) tools the development teams use which are \"home\" written. They are sometimes a perl script, or a \"web page\", or just something that does a couple of small functions. I need to find a way (as part of my \"Middle Manager in charge of too... |
I have a textarea with overflow-x: auto; attributed to it. It works great when a user is typing text into the box by hand. When a user copy pastes a line from a file, however, that is bigger than my textarea, the overflow-x property does not work, instead the textarea wordwraps the long line.
Is there a way (maybe java... | Yes, the behavior you're observing with the `<textarea>` is due to its default handling of content. When text is pasted into a `<textarea>`, the browser may automatically wrap long lines based on the `wrap` attribute or the CSS styles applied. However, you can control this behavior using JavaScript to help ensure that ... | 21,779 | [
{
"from": "human",
"value": "I have a textarea with overflow-x: auto; attributed to it. It works great when a user is typing text into the box by hand. When a user copy pastes a line from a file, however, that is bigger than my textarea, the overflow-x property does not work, instead the textarea wordwraps ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.