instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
The title may not really explain what I'm really trying to get at, couldn't really think of a way to describe what I mean.
I was wondering if it is good practice to check the arguments that a function accepts for nulls or empty before using them. I have this function which just wraps some hash creation like so.
Public ... | Checking for null (or in your case, `Nothing`) arguments at the beginning of a function is generally considered good practice for several reasons:
1. **Immediate Feedback:** By checking the arguments right away, you provide immediate feedback to the caller of the function. If an invalid argument is passed, the functio... | 27,484 | [
{
"from": "human",
"value": "The title may not really explain what I'm really trying to get at, couldn't really think of a way to describe what I mean.\nI was wondering if it is good practice to check the arguments that a function accepts for nulls or empty before using them. I have this function which just... |
We have found out that Firefox (at least v3) and Safari don't properly cache images referenced from a css file. The images are cached, but they are never refreshed, even if you change them on the server. Once Firefox has the image in the cache, it will never check if it has changed.
Our css file looks like this:
div#ne... | This is a known issue with browser caching, particularly for images referenced in CSS files. The way browsers handle caching can lead to outdated images being displayed if they are changed on the server but not updated in the user's cache. This behavior can vary between browsers, as you've noted with Firefox and Intern... | 27,269 | [
{
"from": "human",
"value": "We have found out that Firefox (at least v3) and Safari don't properly cache images referenced from a css file. The images are cached, but they are never refreshed, even if you change them on the server. Once Firefox has the image in the cache, it will never check if it has chan... |
This question will expand on: Best way to open a socket in Python
When opening a socket how can I test to see if it has been established, and that it did not timeout, or generally fail.
Edit:
I tried this:
try:
s.connect((address, '80'))
except:
alert('failed' + address, 'down')
but the alert function is call... | When opening a socket in Python, you can test whether the connection has been successfully established by handling exceptions correctly and using the appropriate socket options. Below is a structured approach to check if the socket connection is established without timeouts or failures.
### Step-by-step Solution
1. *... | 25,811 | [
{
"from": "human",
"value": "This question will expand on: Best way to open a socket in Python\nWhen opening a socket how can I test to see if it has been established, and that it did not timeout, or generally fail.\n\nEdit:\nI tried this:\ntry:\n s.connect((address, '80'))\nexcept:\n alert('failed' +... |
Ages ago when I was a java developer I could make separate ant scripts that I would call from my main ant script. I would put properties unique to each environment where my main script would run. I want to do the same thing in MSBuild but I can't find out how to chain MSBuild scripts together.
| In MSBuild, you can achieve a similar effect to what you described with Ant by using the concept of "targets" and importing other project files. Here's how you can organize your MSBuild scripts to achieve the same functionality:
### 1. Create Separate MSBuild Files
You can create separate MSBuild files for different e... | 29,222 | [
{
"from": "human",
"value": "Ages ago when I was a java developer I could make separate ant scripts that I would call from my main ant script. I would put properties unique to each environment where my main script would run. I want to do the same thing in MSBuild but I can't find out how to chain MSBuild sc... |
Is there a relatively simple way in nant, without writing a custom task, to get the name of the newest folder in a certain directory? Recursion is not needed. I have been trying to do it with directory::get-creation-time and a foreach loop and if statements, yada yada. It's too complex, and I'm about to create a cust... | In NAnt, while there isn't a direct built-in function to get the newest folder, you can indeed achieve this by leveraging the existing tasks in a simpler way without writing a custom task.
Here's a way to do it using `directory::get-creation-time` in combination with a loop to check the creation times of the directori... | 27,082 | [
{
"from": "human",
"value": "Is there a relatively simple way in nant, without writing a custom task, to get the name of the newest folder in a certain directory? Recursion is not needed. I have been trying to do it with directory::get-creation-time and a foreach loop and if statements, yada yada. It's to... |
I have the following problem.
My tomcat 5.5 based web application is using a trust store to verify SSL connections.
The application allows the user to add or remove CA certificates to be used in the verification process.
However, adding or removing certificates from the trust store doesn't change a thing. The applicati... | To handle changes to your trust store dynamically in a Tomcat 5.5 web application, you can follow these steps:
1. **Create a Custom Trust Manager**: You need to implement a custom `TrustManager` that can dynamically manage the trust store. Instead of relying on the default Java SSL context, your code will instantiate ... | 23,780 | [
{
"from": "human",
"value": "I have the following problem.\nMy tomcat 5.5 based web application is using a trust store to verify SSL connections.\nThe application allows the user to add or remove CA certificates to be used in the verification process.\nHowever, adding or removing certificates from the trust... |
Suddenly, we found out that WinXP SP3 didn't allow to create NTFS sparse file in user-mode application. Namely, DeviceIoControl with FSCTL_SET_SPARSE returns with error 0x57 (ERROR_INVALID_PARAMETER). The same code works well in SP2. Also, it's all ok if make the same calls from kernel-mode (both in SP3 and SP2).
Googl... | Yes, the issue you're encountering with Windows XP Service Pack 3 (SP3) when attempting to create NTFS sparse files in user-mode applications through the `DeviceIoControl` function with `FSCTL_SET_SPARSE` returning `ERROR_INVALID_PARAMETER` (0x57) is known to be a change in behavior compared to Service Pack 2 (SP2).
I... | 29,218 | [
{
"from": "human",
"value": "Suddenly, we found out that WinXP SP3 didn't allow to create NTFS sparse file in user-mode application. Namely, DeviceIoControl with FSCTL_SET_SPARSE returns with error 0x57 (ERROR_INVALID_PARAMETER). The same code works well in SP2. Also, it's all ok if make the same calls from... |
Here's my scenario. I created an application which uses Integrated Windows Authentication in order to work. In Application_AuthenticateRequest(), I use HttpContext.Current.User.Identity to get the current WindowsPrincipal of the user of my website.
Now here's the funny part. Some of our users have recently gotten ma... | It seems like you've already identified the root cause of the issue with Windows Integrated Authentication and user name changes due to the caching of user information in your environment. Here’s a concise summary of the problem and potential approaches for others who might face a similar situation:
### Problem Summar... | 24,196 | [
{
"from": "human",
"value": "Here's my scenario. I created an application which uses Integrated Windows Authentication in order to work. In Application_AuthenticateRequest(), I use HttpContext.Current.User.Identity to get the current WindowsPrincipal of the user of my website.\nNow here's the funny part. ... |
Curious, how many of you develop under a VMware environment?
Is it popular for employers to setup vmware for everyone?
Seems like a great way to rollout new desktop computers and perform backups etc.
Just worried about the performance though (PC vmwares).
Update
I was just looking at vmware's site, 1.3 BILLION in sales... | Many organizations do use VMware as part of their IT infrastructure for various reasons, including desktop virtualization, server consolidation, and disaster recovery solutions. Here are some insights into the use of VMware environments in the workplace:
1. **Popularity among Employers**: VMware is quite popular among... | 28,575 | [
{
"from": "human",
"value": "Curious, how many of you develop under a VMware environment?\nIs it popular for employers to setup vmware for everyone?\nSeems like a great way to rollout new desktop computers and perform backups etc.\nJust worried about the performance though (PC vmwares).\nUpdate\nI was just ... |
I have an iphone app where I call these three functions in appDidFinishLaunching:
glMatrixMode(GL_PROJECTION);
glOrthof(0, rect.size.width, 0, rect.size.height, -1, 1);
glMatrixMode(GL_MODELVIEW);
When stepping through with the debugger I get EXC BAD ACCESS when I execute the first line. Any ideas why this is happeni... | The `EXC_BAD_ACCESS` error you are encountering when calling `glMatrixMode(GL_PROJECTION)` suggests that there may be an issue with how the OpenGL ES context is set up or whether it has been correctly initialized before making OpenGL ES calls.
Here are some steps and considerations that may help you resolve the issue:... | 27,356 | [
{
"from": "human",
"value": "I have an iphone app where I call these three functions in appDidFinishLaunching:\nglMatrixMode(GL_PROJECTION);\nglOrthof(0, rect.size.width, 0, rect.size.height, -1, 1);\nglMatrixMode(GL_MODELVIEW);\n\nWhen stepping through with the debugger I get EXC BAD ACCESS when I execute ... |
I need to convert a Word document into HTML file(s) in Java. The function will take input an word document and the output will be html file(s) based on the number of pages the word document has i.e. if the word document has 3 pages then there will be 3 html files generated having the required page break.
I searched for... | To convert a Word document into HTML files using Java, you can make use of the Apache POI library, which allows you to manipulate Microsoft Office files, including Word documents. Additionally, to handle complex formatting and layout, you can consider using the `docx4j` library.
Below, I'll provide a sample solution u... | 23,344 | [
{
"from": "human",
"value": "I need to convert a Word document into HTML file(s) in Java. The function will take input an word document and the output will be html file(s) based on the number of pages the word document has i.e. if the word document has 3 pages then there will be 3 html files generated havin... |
Could anyone please introduce books/papers/articles that I should read If I want to write a high-performance RPC server in Java, which handles large number of concurrent connections(C10K or over), is fault-tolerant, can be scaled out, and maintains high throughput? Thanks!
| If you're looking to write a high-performance RPC (Remote Procedure Call) server in Java that can handle a large number of concurrent connections, is fault-tolerant, can scale out, and maintains high throughput, there are several resources that you might find helpful. Below is a list of books, papers, and articles that... | 23,087 | [
{
"from": "human",
"value": "Could anyone please introduce books/papers/articles that I should read If I want to write a high-performance RPC server in Java, which handles large number of concurrent connections(C10K or over), is fault-tolerant, can be scaled out, and maintains high throughput? Thanks! \n"
... |
I have a stub Qt application and I keep getting compiler errors
#include <QApplication>
int main(int argc, char *argv[])
{
return 0;
}
I used qmake -project and qmake commands and as far as I can tell
they did their job correctly. When I subsequently call make at the command
line I get the following error:
g+... | The errors you're encountering with your Qt application stem from a couple of issues related to the toolchain you're using and the way it interacts with the Qt build system. Here are some steps to help you resolve the problems:
### 1. Check Your Toolchain
Ensure that you are using the correct version of the GNU compi... | 26,246 | [
{
"from": "human",
"value": "I have a stub Qt application and I keep getting compiler errors\n#include <QApplication>\n\nint main(int argc, char *argv[])\n {\n return 0;\n }\n\nI used qmake -project and qmake commands and as far as I can tell\nthey did their job correctly. When I subsequently call make ... |
Is there a CSS style that IE7 and Firefox will obey that changes the behaviour of a TEXTAREA so that it behaves more like.... um..... more like the thing I'm typing into right now!
| To make a `<textarea>` behave more like a rich text editor (like the input area you're typing into right now), you'll need to use a combination of CSS styles and JavaScript, as plain `<textarea>` elements are limited in their styling and behavior across different browsers.
### CSS Styling
Here's some CSS to get you s... | 25,804 | [
{
"from": "human",
"value": "Is there a CSS style that IE7 and Firefox will obey that changes the behaviour of a TEXTAREA so that it behaves more like.... um..... more like the thing I'm typing into right now!\n"
},
{
"from": "gpt",
"value": "To make a `<textarea>` behave more like a rich text e... |
Is there a mandatory relationship between a Controller Action and a View? I mean is it necessary to have a physical View (.aspx page) for each Action inside a Controller class?
| In the context of ASP.NET MVC, there is no mandatory requirement for every controller action to have a physical view (like an `.aspx` or `.cshtml` file) associated with it. While the typical convention is that controller actions return views that are rendered to the user, there are several scenarios where an action mig... | 27,789 | [
{
"from": "human",
"value": "Is there a mandatory relationship between a Controller Action and a View? I mean is it necessary to have a physical View (.aspx page) for each Action inside a Controller class?\n"
},
{
"from": "gpt",
"value": "In the context of ASP.NET MVC, there is no mandatory requ... |
What is the slowest (therefore best) hash algorithm for passwords in ASP Classic?
EDIT: For those unaware, when hashing passwords, slower hashes are preferred to faster to help slow rainbow table style attacks.
EDIT2: And yes, of course speed isn't the only valid concern for hash selection. My question assumes that Al... | When hashing passwords in ASP Classic, you should consider using algorithms that are deliberately slow to thwart brute force and rainbow table attacks. However, the options in ASP Classic are limited, as it doesn't natively support many of the modern password hashing algorithms designed for security.
### Options for S... | 27,740 | [
{
"from": "human",
"value": "What is the slowest (therefore best) hash algorithm for passwords in ASP Classic?\nEDIT: For those unaware, when hashing passwords, slower hashes are preferred to faster to help slow rainbow table style attacks. \nEDIT2: And yes, of course speed isn't the only valid concern for ... |
I have a rails app that is working fine except for one thing.
When I request something that doesn't exist (i.e. /not_a_controller_or_file.txt) and rails throws a "No Route matches..." exception, the response is this (blank line intentional):
HTTP/1.1 200 OK
Date: Thu, 02 Oct 2008 10:28:02 GMT
Content-Type: text/html
Co... | It sounds like you're encountering a problem with how your Rails application is handling routes, particularly when it comes to errors that occur due to "No route matches" exceptions. In this case, it seems that Apache is not properly forwarding the 500 Internal Server Error status code, which is leading to a confusing ... | 26,454 | [
{
"from": "human",
"value": "I have a rails app that is working fine except for one thing.\nWhen I request something that doesn't exist (i.e. /not_a_controller_or_file.txt) and rails throws a \"No Route matches...\" exception, the response is this (blank line intentional):\nHTTP/1.1 200 OK\nDate: Thu, 02 Oc... |
I'm a total newbie, but I was writing a little program that worked on strings in C# and I noticed that if I did a few things differently, the code executed significantly faster.
So it had me wondering, how do you go about clocking your code's execution speed? Are there any (free)utilities? Do you go about it the old-fa... | Measuring the execution speed of your code in C# can be done in a few ways, and you don't necessarily need to rely on external utilities. The most common methods involve using built-in features of the .NET Framework. Here are a few approaches you can consider:
### 1. Using `Stopwatch`
The `System.Diagnostics.Stopwatc... | 21,583 | [
{
"from": "human",
"value": "I'm a total newbie, but I was writing a little program that worked on strings in C# and I noticed that if I did a few things differently, the code executed significantly faster.\nSo it had me wondering, how do you go about clocking your code's execution speed? Are there any (fre... |
I have what is essentially a jagged array of name value pairs - i need to generate a set of unique name values from this. the jagged array is approx 86,000 x 11 values.
It does not matter to me what way I have to store a name value pair (a single string "name=value" or a specialised class for example KeyValuePair).
Add... | To optimize the performance of generating a set of unique name-value pairs from a jagged array, you can make a few adjustments to your existing approach. Here are a few suggestions to improve the code you have shared:
1. **Use a HashSet Instead of a Dictionary**: Since you only need to store unique name-value pairs an... | 28,771 | [
{
"from": "human",
"value": "I have what is essentially a jagged array of name value pairs - i need to generate a set of unique name values from this. the jagged array is approx 86,000 x 11 values.\nIt does not matter to me what way I have to store a name value pair (a single string \"name=value\" or a spec... |
I'm by no means a sysadmin so please correct me if I'm wrong.
I want to run aspnet_regiis.exe -s.
This requires the metabase path of my website.
How do I find this metabase path?
| You're right that `aspnet_regiis.exe -s` is used to register ASP.NET applications with IIS, and it does require the metabase path of your site. The metabase path is typically in the format of `/LM/W3SVC/1/ROOT`, where `1` represents the ID of your IIS website. Here's how you can find the metabase path for your website:... | 28,217 | [
{
"from": "human",
"value": "I'm by no means a sysadmin so please correct me if I'm wrong.\nI want to run aspnet_regiis.exe -s.\nThis requires the metabase path of my website.\nHow do I find this metabase path?\n"
},
{
"from": "gpt",
"value": "You're right that `aspnet_regiis.exe -s` is used to ... |
Unsure if I've phrased this correctly, but in the callback how do I reference the controls property of the base class?
This has been bugging me for some time and I usually work around it, but I'd be grateful if anybody can enlighten me on how I should do this properly.
var base = function() {
var controls = {};
... | Hi Paul,
It looks like you're trying to access the `controls` property in a callback function defined within the `foo` method. However, when you use `this` inside the jQuery callback, it refers to the DOM element that triggered the event rather than the context of your base object.
To correctly reference the `control... | 29,479 | [
{
"from": "human",
"value": "Unsure if I've phrased this correctly, but in the callback how do I reference the controls property of the base class?\nThis has been bugging me for some time and I usually work around it, but I'd be grateful if anybody can enlighten me on how I should do this properly.\nvar bas... |
I have a class with some abstract methods, but I want to be able to edit a subclass of that class in the designer. However, the designer can't edit the subclass unless it can create an instance of the parent class. So my plan is to replace the abstract methods with stubs and mark them as virtual - but then if I make ... | If you're looking for a way to ensure that subclasses of your class implement certain methods without making those methods abstract (and thus allowing the designer to instantiate your class), you can use a combination of virtual methods and a runtime check.
### Approach
1. **Mark Methods as Virtual**: You can define ... | 26,110 | [
{
"from": "human",
"value": "I have a class with some abstract methods, but I want to be able to edit a subclass of that class in the designer. However, the designer can't edit the subclass unless it can create an instance of the parent class. So my plan is to replace the abstract methods with stubs and m... |
I have the following regular expression :
I figured out most of the part which is as follows :
ValidationExpression="^[\u0020\u0027\u002C\u002D\u0030-\u0039\u0041-\u005A\u005F\u0061-\u007A\u00C0-\u00FF°./]{1,256}$"
u0020 : SPACE
u0027 : APOSTROPHE
u002C : COMMA
u002D : HYPHEN / MINUS
u0030-\u0039\ : 0-9
u0041-\u005A ... | The final part of your regular expression, `u00C0-\u00FF°./`, can be broken down into two components: the range `u00C0-\u00FF` and the characters `°./`.
### 1. `u00C0-\u00FF`
This portion of the regular expression refers to a range of Unicode characters. In particular:
- `u00C0` refers to the Unicode code point 192, ... | 28,744 | [
{
"from": "human",
"value": "I have the following regular expression :\nI figured out most of the part which is as follows :\n\nValidationExpression=\"^[\\u0020\\u0027\\u002C\\u002D\\u0030-\\u0039\\u0041-\\u005A\\u005F\\u0061-\\u007A\\u00C0-\\u00FF°./]{1,256}$\"\n\nu0020 : SPACE\nu0027 : APOSTROPHE\nu002C :... |
I have an executable that depending on the command line switch supplied looks something like:
Program.cs -
namespace DiskSpaceReporting
{
class Program
{
static void Main(string[] args)
{
if(args.Length == 1)
{
switch(args[0])
{
... | To ensure that the `Helpers.CreateMessage()` method uses the same logger as its caller in your `SummaryDiskSpaceReporter` and `DetailedDiskSpaceReporter` classes, you can pass the logger instance as an argument to the helper method. This way, the helper method can utilize the specific logger for its logging needs witho... | 22,456 | [
{
"from": "human",
"value": "I have an executable that depending on the command line switch supplied looks something like:\nProgram.cs -\nnamespace DiskSpaceReporting\n{\n class Program\n {\n static void Main(string[] args)\n {\n if(args.Length == 1)\n {\n ... |
I have a Form being launched from another form on a different thread. Most of the time it works perfectly, but I get the below error from time to time. Can anyone help?
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
at System.Drawi... | The error you're encountering appears to be related to the use of `System.Drawing.Bitmap` and the `System.Windows.Forms` libraries in a multi-threaded environment. This type of issue typically arises when trying to access GUI components or perform drawing operations on a thread other than the main UI thread.
### Cause... | 24,416 | [
{
"from": "human",
"value": "I have a Form being launched from another form on a different thread. Most of the time it works perfectly, but I get the below error from time to time. Can anyone help?\nat System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)\nat System.Drawing.Bitmap..ctor... |
Which functions are available within Delphi to play a sound-file?
| In Delphi, you have several options to play sound files. Here are some commonly used methods:
1. **Using the `PlaySound` function**:
The Windows API function `PlaySound` allows you to play a wave file. Here's a basic example:
```delphi
uses
MMSystem;
begin
PlaySound('C:\path\to\your\soundfile.w... | 26,451 | [
{
"from": "human",
"value": "Which functions are available within Delphi to play a sound-file?\n"
},
{
"from": "gpt",
"value": "In Delphi, you have several options to play sound files. Here are some commonly used methods:\n\n1. **Using the `PlaySound` function**:\n The Windows API function `Pl... |
I am using wordpress and use custom permalink structure: /%category%/%postname%/
My problem is that a decent number of people link to the site without including the trailing slash in the URL, so users get a 404 page.
I'm using the default .htaccess file that comes with wordpress because no solution I've tried has worke... | You can resolve the issue of trailing slashes in your WordPress site using a couple of methods, including updating your `.htaccess` file. Since you're using a custom permalink structure, the solution typically involves adding a redirect rule to ensure that URLs without trailing slashes are redirected to those with trai... | 26,671 | [
{
"from": "human",
"value": "I am using wordpress and use custom permalink structure: /%category%/%postname%/\nMy problem is that a decent number of people link to the site without including the trailing slash in the URL, so users get a 404 page.\nI'm using the default .htaccess file that comes with wordpre... |
I am interested in using/learning RoR in a project where I have to use a .NET dll. Is Ruby capable of importing a .NET dll?
| Ruby on Rails (RoR) itself does not have built-in support for directly importing or using .NET DLLs, as they are part of the .NET ecosystem and are typically used with languages like C#. However, there are a few approaches you can consider if you need to integrate Ruby with a .NET DLL:
1. **Using IronRuby**: IronRuby ... | 28,635 | [
{
"from": "human",
"value": "I am interested in using/learning RoR in a project where I have to use a .NET dll. Is Ruby capable of importing a .NET dll?\n"
},
{
"from": "gpt",
"value": "Ruby on Rails (RoR) itself does not have built-in support for directly importing or using .NET DLLs, as they a... |
How do I get a function's name as a string?
def foo():
pass
>>> name_of(foo)
"foo"
| You can obtain a function's name as a string in Python by using the `__name__` attribute of the function. Here's how you can implement a simple function to achieve that:
```python
def name_of(func):
return func.__name__
def foo():
pass
# Usage
print(name_of(foo)) # Output: "foo"
```
In this code, `name_of`... | 32,716 | [
{
"from": "human",
"value": "How do I get a function's name as a string?\ndef foo():\n pass\n\n>>> name_of(foo)\n\"foo\"\n\n"
},
{
"from": "gpt",
"value": "You can obtain a function's name as a string in Python by using the `__name__` attribute of the function. Here's how you can implement a ... |
I'm having an issue with a standard ASP.NET page that has a TextBox and a RequiredFieldValidator. The steps to reproduce are quite simple:
Place a TextBox on a page
Place a RequiredFieldValidator on the page
Point the RequiredFieldValidator at the TextBox
Run the app
Tab away from the TextBox the RequiredFieldValidat... | This behavior you've described occurs because the RequiredFieldValidator is set to validate only when the input field has a non-empty value, and the default client-side validation may not trigger on losing focus if the input field is initially empty. This is often seen when the validator's `ValidationGroup`, `EnableCli... | 27,923 | [
{
"from": "human",
"value": "I'm having an issue with a standard ASP.NET page that has a TextBox and a RequiredFieldValidator. The steps to reproduce are quite simple:\n\nPlace a TextBox on a page\nPlace a RequiredFieldValidator on the page\nPoint the RequiredFieldValidator at the TextBox\nRun the app\nTab... |
i want to find the mime-type for a given file extension on an IIS ASP.NET web-server from the code-behind file.
i want to search the same list that the server itself uses when serving up a file. This means that any mime types a web-server administrator has added to the Mime Map will be included.
i could blindly use
HK... | To retrieve MIME types used by IIS for a given file extension, you can utilize the `System.Web.Configuration.WebConfigurationManager` class to access the configuration settings in the `web.config` file or the server's configuration for MIME types. In ASP.NET, you can obtain the MIME types from the configuration and ens... | 20,007 | [
{
"from": "human",
"value": "i want to find the mime-type for a given file extension on an IIS ASP.NET web-server from the code-behind file.\ni want to search the same list that the server itself uses when serving up a file. This means that any mime types a web-server administrator has added to the Mime Ma... |
I was trying to solve my XNA Font problem, when I found this here:
Visual Studio doesn’t recognize any
fonts you add after it is up and
running.
Is there a way to use fonts installed after Visual Studio?
After finding out that is was the Font file why would the tutorial mention something like that ?
| When you encounter issues with XNA (or other similar frameworks) and custom fonts in Visual Studio, there are a couple of things to understand about how fonts are handled:
1. **Font File Inclusion**: In XNA, if you want to use a font, you need to include it in your project. This usually involves adding the `.spritefon... | 27,186 | [
{
"from": "human",
"value": "I was trying to solve my XNA Font problem, when I found this here:\n\nVisual Studio doesn’t recognize any\n fonts you add after it is up and\n running.\n\nIs there a way to use fonts installed after Visual Studio?\nAfter finding out that is was the Font file why would the tuto... |
I have a tool which automatically creates InstallShield installers (InstallScript, not MSI), and my main problem at the moment is that when upgrading an installation, I need a way to prevent features from being upgraded. During the installation, I want to check the version of a exe-file installed on the target system, ... | In InstallShield's InstallScript-based installations, controlling the upgrade behavior of features can be a bit nuanced, especially when you want to prevent certain features from being upgraded based on the state of an installed application.
Here’s a general approach to handling this scenario:
### Method to Exclude a... | 28,095 | [
{
"from": "human",
"value": "I have a tool which automatically creates InstallShield installers (InstallScript, not MSI), and my main problem at the moment is that when upgrading an installation, I need a way to prevent features from being upgraded. During the installation, I want to check the version of a ... |
I ran into the problem that my primary key sequence is not in sync with my table rows.
That is, when I insert a new row I get a duplicate key error because the sequence implied in the serial datatype returns a number that already exists.
It seems to be caused by import/restores not maintaining the sequence properly.
| The issue you're encountering with your primary key sequence not being in sync with your table rows is a common problem, especially when you've performed imports or restores from backups. The sequence generator may not be aware of the existing rows in your table, leading to duplicate key errors when you try to insert n... | 25,177 | [
{
"from": "human",
"value": "I ran into the problem that my primary key sequence is not in sync with my table rows. \nThat is, when I insert a new row I get a duplicate key error because the sequence implied in the serial datatype returns a number that already exists.\nIt seems to be caused by import/restor... |
I want to put "random" output from my result set (about 1.5 mil rows) in a file in a sorted manner. I know i can use sort by command in my query but that command is "expensive".
Can you tell me is there any algorithm for writing result set rows in a file so the content would be sorted in the end and can i gain in perf... | When dealing with a large dataset like 1.5 million rows, sorting can indeed be resource-intensive, especially when you have complex queries with multiple joins. If you want to extract a "random" subset of rows from your result set and write them to a file in sorted order without relying on the SQL `ORDER BY` clause, yo... | 20,977 | [
{
"from": "human",
"value": "I want to put \"random\" output from my result set (about 1.5 mil rows) in a file in a sorted manner. I know i can use sort by command in my query but that command is \"expensive\". \nCan you tell me is there any algorithm for writing result set rows in a file so the content wou... |
I'm doing some PHP work recently, and in all the code I've seen, people tend to use few methods. (They also tend to use few variables, but that's another issue.) I was wondering why this is, and I found this note "A function call with one parameter and an empty function body takes about the same time as doing 7-8 $loca... | When it comes to PHP and the performance of your code, there are a few factors to consider regarding the use of functions (methods) versus direct variable manipulations. While it is true that function calls incur some overhead compared to executing simple variable operations, the differences in performance can often be... | 25,551 | [
{
"from": "human",
"value": "I'm doing some PHP work recently, and in all the code I've seen, people tend to use few methods. (They also tend to use few variables, but that's another issue.) I was wondering why this is, and I found this note \"A function call with one parameter and an empty function body ta... |
When you are somewhere between version 1 and version 2, what do you do to maintain your software?
The terms Patch, Hotfix, Maintenance Release, Service Pack, and others are all blurry from my point of view, with different definitions depending on who you talk to.
What do you call your incremental maintenance efforts be... | Maintaining software between major versions (like version 1 and version 2) involves various incremental updates and improvements. The terminology can indeed be quite confusing, as different organizations and software communities may have their own definitions. Here’s a breakdown of common terms, along with what they ge... | 29,186 | [
{
"from": "human",
"value": "When you are somewhere between version 1 and version 2, what do you do to maintain your software?\nThe terms Patch, Hotfix, Maintenance Release, Service Pack, and others are all blurry from my point of view, with different definitions depending on who you talk to.\nWhat do you c... |
When executing a pixel shader under Direct3D, do the limits on texture coordinates imposed by MaxTextureRepeat only become an issue during calls to texture lookup functions such as Tex2D(), or do they come into play anytime the texture coordinates are accessed within the shader?
I wish to know whether it's possible to ... | In Direct3D, the `MaxTextureRepeat` limitation refers specifically to the number of times a texture can be repeated when sampling it. This limitation indeed comes into play when calling texture lookup functions like `Tex2D()`, where the texture coordinates are used to determine the corresponding texel.
If you are usin... | 26,467 | [
{
"from": "human",
"value": "When executing a pixel shader under Direct3D, do the limits on texture coordinates imposed by MaxTextureRepeat only become an issue during calls to texture lookup functions such as Tex2D(), or do they come into play anytime the texture coordinates are accessed within the shader?... |
We are developing a desktop application(visual basic 6.0).We have our own logging framework. What are good practices? When we have a web application, then we can control the level of logging. How to go about in a desktop app?
| When developing a desktop application, particularly in Visual Basic 6.0, implementing an effective logging framework is essential for tracking application behavior, diagnosing issues, and improving the overall user experience. Here are some good practices to consider:
### 1. **Logging Levels**
- Define different lo... | 26,412 | [
{
"from": "human",
"value": "We are developing a desktop application(visual basic 6.0).We have our own logging framework. What are good practices? When we have a web application, then we can control the level of logging. How to go about in a desktop app?\n"
},
{
"from": "gpt",
"value": "When dev... |
I am still very new to Ruby (reading through the Pickaxe and spending most of my time in irb), and now that I know it's possible to patch classes in Ruby, I'm wondering when it's acceptable to do so, specifically whether it's acceptable to patch Ruby's base classes. For example: I answered another Ruby question here wh... | Patching existing classes in Ruby (also known as monkey patching) is a powerful feature, but it comes with some trade-offs, especially when it comes to base classes like `DateTime` or `Fixnum` (which is now `Integer` in recent Ruby versions). Let's evaluate your approach and consider best practices.
### When to Use Mo... | 26,767 | [
{
"from": "human",
"value": "I am still very new to Ruby (reading through the Pickaxe and spending most of my time in irb), and now that I know it's possible to patch classes in Ruby, I'm wondering when it's acceptable to do so, specifically whether it's acceptable to patch Ruby's base classes. For example:... |
How would I get the length of an ArrayList using a JSF EL expression?
#{MyBean.somelist.length}
does not work.
| In JSF (JavaServer Faces), when you want to get the size of an `ArrayList` or any collection in an EL (Expression Language) expression, you should use the `size()` method instead of trying to access a `length` property, which is common in JavaScript but not valid in this context.
To get the length of an `ArrayList` in... | 29,891 | [
{
"from": "human",
"value": "How would I get the length of an ArrayList using a JSF EL expression? \n#{MyBean.somelist.length}\n\ndoes not work.\n"
},
{
"from": "gpt",
"value": "In JSF (JavaServer Faces), when you want to get the size of an `ArrayList` or any collection in an EL (Expression Lang... |
What is a free tool to compare two Sql Server tables (data and schema).
It would be great if the tool can script the differences found.
I also went through some older posts. The closest I have seen is SQLDBDiff but I would love to try more options.
| There are several free tools available for comparing SQL Server tables, both for schema and data differences. Here are a few options you might consider:
1. **SQL Server Data Tools (SSDT)**:
- SSDT is a free add-in for Visual Studio that includes tools for database development. It allows you to compare database sche... | 28,349 | [
{
"from": "human",
"value": "What is a free tool to compare two Sql Server tables (data and schema). \nIt would be great if the tool can script the differences found.\nI also went through some older posts. The closest I have seen is SQLDBDiff but I would love to try more options.\n"
},
{
"from": "g... |
I know that one of the defining principles of Test driven development is that you write your Unit tests first and then write code to pass those unit tests, but is it necessary to do it this way?
I've found that I often don't know what I am testing until I've written it, mainly because the past couple of projects I've w... | It's great that you're exploring Test Driven Development (TDD), but it's also completely normal to find it challenging, especially when dealing with projects that evolve from proof of concepts. Here are some key points to consider regarding the necessity and flexibility of TDD:
1. **Core Principle of TDD**: The essenc... | 29,243 | [
{
"from": "human",
"value": "I know that one of the defining principles of Test driven development is that you write your Unit tests first and then write code to pass those unit tests, but is it necessary to do it this way?\nI've found that I often don't know what I am testing until I've written it, mainly ... |
I have an automated test running on my program that generates some large MPG files along with other files. After running the test, I have the script clean up after itself. The other files (a mix of binary and text files) are removed with no problems. The MPG files, however, don't get deleted. If I try and manually ... | The issue you are experiencing with the MPG files not being deleted after your automated test is likely related to how file handles are being managed by the application that generates these files and how they are being accessed by the Windows Explorer.
Here are some potential reasons and solutions for why the MPG file... | 25,740 | [
{
"from": "human",
"value": "I have an automated test running on my program that generates some large MPG files along with other files. After running the test, I have the script clean up after itself. The other files (a mix of binary and text files) are removed with no problems. The MPG files, however, d... |
Eclipse is a really great editor, which I prefer to use, but the GUI design tools for Eclipse are lacking. On the other hand, NetBeans works really well for GUI design.
Are there any tips, tricks or pitfalls for using NetBeans for GUI design and Eclipse for everything else on the same project?
EDIT: I tried Maven, a... | Using NetBeans for GUI design while managing the rest of your Java project in Eclipse is a feasible approach, but it comes with its own set of challenges and considerations. Here are some tips, tricks, and potential pitfalls to keep in mind:
### Tips:
1. **Project Structure**:
- Maintain a clear project structure ... | 15,499 | [
{
"from": "human",
"value": "Eclipse is a really great editor, which I prefer to use, but the GUI design tools for Eclipse are lacking. On the other hand, NetBeans works really well for GUI design. \nAre there any tips, tricks or pitfalls for using NetBeans for GUI design and Eclipse for everything else o... |
I am working on an ASP.NET MVC web app that allows people to publish content, but other than publish the content to a remote server, I want to allow people to use their domain name directly. For example, the user "Tom" can have his domain name TomSite.com point to http://www.mywebapp.com/user/tom, but the sub path wil... | To achieve the goal of allowing users to publish content to your ASP.NET MVC web app while using their custom domain names transparently, you'll need to implement a combination of DNS settings, URL rewriting, and potentially an SSL certificate for secure connections. Here are the steps you can take to set this up:
###... | 12,476 | [
{
"from": "human",
"value": "I am working on an ASP.NET MVC web app that allows people to publish content, but other than publish the content to a remote server, I want to allow people to use their domain name directly. For example, the user \"Tom\" can have his domain name TomSite.com point to http://www.... |
My php is weak and I'm trying to change this string:
http://www.example.com/backend.php?/c=crud&m=index&t=care
^
to be:
http://www.example.com/backend.php?c=crud&m=index&t=care
^
removing the / after the backend.php?. Any ideas on the best way to do... | You can easily achieve this in PHP using the `str_replace` function to remove the unwanted `/` after `backend.php?`. Here’s a simple example:
```php
<?php
$url = "http://www.example.com/backend.php?/c=crud&m=index&t=care";
// Use str_replace to remove the unwanted '/'
$cleaned_url = str_replace("backend.php?/", "back... | 31,280 | [
{
"from": "human",
"value": "My php is weak and I'm trying to change this string:\nhttp://www.example.com/backend.php?/c=crud&m=index&t=care\n ^\n\nto be:\nhttp://www.example.com/backend.php?c=crud&m=index&t=care\n ^\n\nremoving the / after ... |
Or perhaps this is a manual install only deal.
| It sounds like you might be referring to software or hardware that requires manual installation rather than being available for automatic installation or configuration. If you need specific guidance on how to manually install something, feel free to provide more details about what you're trying to install, and I can he... | 32,995 | [
{
"from": "human",
"value": "Or perhaps this is a manual install only deal.\n"
},
{
"from": "gpt",
"value": "It sounds like you might be referring to software or hardware that requires manual installation rather than being available for automatic installation or configuration. If you need specif... |
I'm trying to add the jVal attribute to a textbox that I created in the HTML.
<input id="subJobName" type="text" jval="{valid:function (val) { return validateSubJobName(val); }, message:'Name already exists or is longer than 14 characters.', styleType:'cover'}" />
I would let to add /set the jVal in the javascript ins... | You can certainly set the `jVal` attribute dynamically using JavaScript or jQuery after removing it from your HTML. However, the way you're trying to set it using `attr` is incorrect since `jVal` is expected to be a JavaScript object rather than a string. Instead, you'll need to set it as a data attribute or directly m... | 22,030 | [
{
"from": "human",
"value": "I'm trying to add the jVal attribute to a textbox that I created in the HTML.\n<input id=\"subJobName\" type=\"text\" jval=\"{valid:function (val) { return validateSubJobName(val); }, message:'Name already exists or is longer than 14 characters.', styleType:'cover'}\" />\n\nI wo... |
I recently introduced HTML into some RSS feeds that I publish (which up to now only had plain text, no markup), and I was wondering which method is better: use character encoding (such as htmlspecialchars) or just encapsulate everything in CDATA?
It seems to me that CDATA might be easier, but I'm unclear as to whether ... | When it comes to including HTML content in RSS feeds, both character encoding (such as using `htmlspecialchars`) and encapsulating your content in CDATA sections have their advantages and disadvantages. Here are some considerations for each approach:
### CDATA Sections
**Advantages:**
1. **Easier to Read**: Using CDAT... | 27,224 | [
{
"from": "human",
"value": "I recently introduced HTML into some RSS feeds that I publish (which up to now only had plain text, no markup), and I was wondering which method is better: use character encoding (such as htmlspecialchars) or just encapsulate everything in CDATA?\nIt seems to me that CDATA might... |
I am cloning a hidden table row then populating it and after validation I want to show the row using a jquery effect ... say .show("slow")
var baseRow = $("#tasks tr#baseTaskLine");
var newRow = baseRow.clone();
var lastRow = $("#tasks tr[id^='TaskLine_']" + dayClass + ":last");
var newRowId;
if (lastRow.length == 0) ... | It sounds like you're trying to show a newly cloned and populated row in a table with a slow animation, but it's appearing instantly. This issue is likely due to the fact that you're hiding the whole row (`newRow.hide()`) before showing it again. When you directly show the row with `.show("slow")`, it sometimes may not... | 29,687 | [
{
"from": "human",
"value": "I am cloning a hidden table row then populating it and after validation I want to show the row using a jquery effect ... say .show(\"slow\")\nvar baseRow = $(\"#tasks tr#baseTaskLine\");\nvar newRow = baseRow.clone();\nvar lastRow = $(\"#tasks tr[id^='TaskLine_']\" + dayClass + ... |
I'm a big fan of log4net, but recently, some (in my department) have questioned its inclusion in our projects because of the seemingly heaviness of each logging method. I would argue that there are better techniques than others, but that's another question.
I'm curious to know, what is the typical impact of a log4net D... | Using log4net, the impact of logging calls, including `DebugFormat`, can vary significantly based on several factors, such as logging configuration, the logging level set for the application, and the specific context in which logging is employed. Here are some observations based on real-world experiences with log4net a... | 18,397 | [
{
"from": "human",
"value": "I'm a big fan of log4net, but recently, some (in my department) have questioned its inclusion in our projects because of the seemingly heaviness of each logging method. I would argue that there are better techniques than others, but that's another question.\nI'm curious to know,... |
does anybody know how to make a numericupdown control for asp. There's one for making winforms, but I don't know if theres one for making webforms. Is there an addon or something that I can use?
| In ASP.NET Web Forms, there isn't a built-in `NumericUpDown` control like the one you find in WinForms. However, you can achieve similar functionality using a combination of HTML input elements and some JavaScript. There are also several third-party libraries and frameworks you can use to create a numeric up-down contr... | 27,990 | [
{
"from": "human",
"value": "does anybody know how to make a numericupdown control for asp. There's one for making winforms, but I don't know if theres one for making webforms. Is there an addon or something that I can use?\n"
},
{
"from": "gpt",
"value": "In ASP.NET Web Forms, there isn't a bui... |
One of my co-workers has resigned and was made to leave the premises before checking in all of his code to TFS. I have access to the physical files. Is there a way for me to access his workspace and check in some of the changes that are still left unchecked in? From tfs I can see which files he has checked out but no w... | When dealing with TFS (Team Foundation Server), if your co-worker's workspace is still accessible on the physical machine, you can attempt to check in the changes. However, there are some important steps and considerations to keep in mind:
### Steps to Access and Check In Code
1. **Identify the Workspace**:
- Dete... | 27,568 | [
{
"from": "human",
"value": "One of my co-workers has resigned and was made to leave the premises before checking in all of his code to TFS. I have access to the physical files. Is there a way for me to access his workspace and check in some of the changes that are still left unchecked in? From tfs I can se... |
Is there a typedef equivalent in C#, or someway to get some sort of similar behaviour? I've done some googling, but everywhere I look seems to be negative. Currently I have a situation similar to the following:
class GenericClass<T>
{
public event EventHandler<EventData> MyEvent;
public class EventData : Event... | In C#, there's no direct equivalent of C's `typedef`. However, you can achieve a similar effect by using `using` directives to create type aliases or by defining your own delegate types. Here are a couple of ways to simplify your event handler declarations:
### Option 1: Using a Type Alias with `using`
You can create... | 25,542 | [
{
"from": "human",
"value": "Is there a typedef equivalent in C#, or someway to get some sort of similar behaviour? I've done some googling, but everywhere I look seems to be negative. Currently I have a situation similar to the following:\nclass GenericClass<T> \n{\n public event EventHandler<EventData>... |
At the moment I am using Visual Source Safe (yeah yeah!) to store my Technical Specification documentation.
The actual docs are written in MS word.
If find that having the spec written in word format to be a big burden, for specs to be truly used there shouldn't be any barrier to usage and more importantly access.
If I... | You’re right in recognizing the limitations of using MS Word and Visual Source Safe for storing and managing technical specifications, particularly when it comes to accessibility and interlinking documents. Fortunately, there are several alternatives that can facilitate better organization, accessibility, and usability... | 26,554 | [
{
"from": "human",
"value": "At the moment I am using Visual Source Safe (yeah yeah!) to store my Technical Specification documentation.\nThe actual docs are written in MS word.\nIf find that having the spec written in word format to be a big burden, for specs to be truly used there shouldn't be any barrier... |
I want to detect whether adobe reader is installed using VB6. Also if detected that it's not installed, what would be the best solution?
| To check whether Adobe Reader is installed on a Windows machine using VB6, you can look for the Adobe Reader registry entries or the program files in the expected installation directories.
### Checking for Adobe Reader Installation
Here's a simple VB6 function that checks the registry for the Adobe Reader installatio... | 28,163 | [
{
"from": "human",
"value": "I want to detect whether adobe reader is installed using VB6. Also if detected that it's not installed, what would be the best solution?\n"
},
{
"from": "gpt",
"value": "To check whether Adobe Reader is installed on a Windows machine using VB6, you can look for the A... |
What is the best way to stop a user from resizing the top-level window of an application written in WPF?
| In a WPF application, you can prevent the user from resizing the top-level window by setting the `ResizeMode` property of the window. You can set this property to `NoResize` or `CanMinimize` based on your requirements. Here’s how to do it in XAML or in code-behind.
### XAML Method
You can set the `ResizeMode` directly... | 30,122 | [
{
"from": "human",
"value": "What is the best way to stop a user from resizing the top-level window of an application written in WPF?\n"
},
{
"from": "gpt",
"value": "In a WPF application, you can prevent the user from resizing the top-level window by setting the `ResizeMode` property of the win... |
For my C# RichTextBox, I want to programmatically do the same thing as clicking the up arrow at the top of a vertical scroll bar, which moves the RichTextBox display up by one line. What is the code for this? Thanks!
| To programmatically scroll the content of a `RichTextBox` in C# (equivalent to clicking the up arrow of the vertical scrollbar), you can use the `Lines` property of the `RichTextBox` to retrieve the current selection and adjust it accordingly. However, an easier way to achieve this is to use the `SelectionStart` proper... | 27,408 | [
{
"from": "human",
"value": "For my C# RichTextBox, I want to programmatically do the same thing as clicking the up arrow at the top of a vertical scroll bar, which moves the RichTextBox display up by one line. What is the code for this? Thanks!\n"
},
{
"from": "gpt",
"value": "To programmatic... |
Looking for a software solution to to store large files (>50MB - 1.5GB), distributed across multiple servers. We have looked at MogileFS, however, given existing software demands, need to have an NFS interface. Would prefer open source, however, open to all options.
| For your requirements of storing large files across multiple servers with an NFS interface, here are some options to consider:
### 1. **GlusterFS**
- **Overview**: An open-source distributed file system that can aggregate various storage servers into a single global namespace.
- **Features**:
- NFS interfac... | 22,070 | [
{
"from": "human",
"value": "Looking for a software solution to to store large files (>50MB - 1.5GB), distributed across multiple servers. We have looked at MogileFS, however, given existing software demands, need to have an NFS interface. Would prefer open source, however, open to all options.\n"
},
... |
I just got hold of a PDA (Samsung Omnia i900) with an embedded motion sensor (accelerometer) and would like to code something that would exploit this feature. Any pointers?
| That's great to hear you've got a Samsung Omnia i900! Working with a PDA's accelerometer can lead to some fun and interesting applications. Here are some pointers and ideas on how you can get started with coding to utilize the accelerometer feature:
### 1. Understanding the SDK:
- **SDK and Development Environment**: ... | 27,014 | [
{
"from": "human",
"value": "I just got hold of a PDA (Samsung Omnia i900) with an embedded motion sensor (accelerometer) and would like to code something that would exploit this feature. Any pointers?\n"
},
{
"from": "gpt",
"value": "That's great to hear you've got a Samsung Omnia i900! Workin... |
What non-GPL libraries are available for writing JSON-RPC servers and clients in native C++?
According to http://json-rpc.org/wiki/implementations, there seems to only exist one implementation of JSON-RPC for C++, namely JsonRpc-Cpp, but that only available under GPL. Unfortunately we cannot use GPL code in our softwar... | If you are looking for non-GPL libraries for writing JSON-RPC servers and clients in native C++, here are a few options to consider:
1. **jsonrpc-cpp**: While this library is available under GPL, it is often worth checking if there is a commercial license available. Many projects offer dual licensing options that allo... | 26,687 | [
{
"from": "human",
"value": "What non-GPL libraries are available for writing JSON-RPC servers and clients in native C++?\nAccording to http://json-rpc.org/wiki/implementations, there seems to only exist one implementation of JSON-RPC for C++, namely JsonRpc-Cpp, but that only available under GPL. Unfortuna... |
In Java, is there a programmatic way to find out how many concurrent threads are supported by a CPU?
Update
To clarify, I'm not trying to hammer the CPU with threads and I am aware of Runtime.getRuntime().availableProcessors() function, which provides me part of the information I'm looking for.
I want to find out if th... | In Java, you can use the `OperatingSystemMXBean` interface provided by the `java.lang.management` package to gather more detailed information about the operating system and its capabilities. However, obtaining the number of concurrent threads supported by the CPU in terms of logical processors per core is not directly ... | 28,323 | [
{
"from": "human",
"value": "In Java, is there a programmatic way to find out how many concurrent threads are supported by a CPU?\nUpdate\nTo clarify, I'm not trying to hammer the CPU with threads and I am aware of Runtime.getRuntime().availableProcessors() function, which provides me part of the informatio... |
Sometimes in our production environment occurs situation when connection between service (which is python program that uses MySQLdb) and mysql server is flacky, some packages are lost, some black magic happens and .execute() of MySQLdb.Cursor object never ends (or take great amount of time to end).
This is very bad be... | Yes, you can implement a mechanism to interrupt a MySQL query after a specified timeout when using MySQLdb in Python. Unfortunately, MySQLdb itself does not provide built-in support for timeout on queries, but you can achieve this using a combination of threading and a timeout mechanism.
Here is a general approach:
1... | 23,102 | [
{
"from": "human",
"value": "Sometimes in our production environment occurs situation when connection between service (which is python program that uses MySQLdb) and mysql server is flacky, some packages are lost, some black magic happens and .execute() of MySQLdb.Cursor object never ends (or take great amo... |
I am currently building a web site and I just implemented SqlCacheDependency using LinqToSQL like so.
public IQueryable<VictoryList> GetVictoryList()
{
string cacheKey = HttpContext.Current.User.Identity.Name + "victoryCacheKey";
IQueryable<VictoryList> cachednews = (IQueryable<Vic... | In the implementation you provided, the behavior you're observing—seeing the query still execute through SQL Profiler despite using SqlCacheDependency—is indeed expected in certain situations, especially when you are using a LINQ to SQL query.
### Explanation:
1. **SqlCacheDependency**:
SqlCacheDependency works by... | 26,834 | [
{
"from": "human",
"value": "I am currently building a web site and I just implemented SqlCacheDependency using LinqToSQL like so.\n public IQueryable<VictoryList> GetVictoryList()\n {\n string cacheKey = HttpContext.Current.User.Identity.Name + \"victoryCacheKey\";\n IQuer... |
What is the best choice for a Python GUI application to display large number of thumbnails, e.g. 10000 or more? For performance reasons such thumbnail control must support virtual items, i.e. request application for those thumbnails only which are currently visible to user.
| When developing a Python GUI application to display a large number of thumbnails, it's essential to choose a toolkit that can efficiently handle virtual items (i.e., loading thumbnails only when they are visible to the user). Here are some options that support virtual item handling:
### 1. **Qt with PyQt or PySide**
-... | 25,908 | [
{
"from": "human",
"value": "What is the best choice for a Python GUI application to display large number of thumbnails, e.g. 10000 or more? For performance reasons such thumbnail control must support virtual items, i.e. request application for those thumbnails only which are currently visible to user. \n"
... |
I have some HTML menus, which I show completely when a user clicks on the head of these menus. I would like to hide these elements when the user clicks outside the menus' area.
Is something like this possible with jQuery?
$("#menuscontainer").clickOutsideThisElement(function() {
// Hide the menus
});
| Yes, you can achieve that functionality using jQuery by listening for click events on the document and then checking if the click occurred outside the specified menu elements. Unfortunately, there is no built-in `clickOutsideThisElement` method in jQuery, but you can easily implement this yourself. Here's how you can d... | 26,584 | [
{
"from": "human",
"value": "I have some HTML menus, which I show completely when a user clicks on the head of these menus. I would like to hide these elements when the user clicks outside the menus' area.\nIs something like this possible with jQuery?\n$(\"#menuscontainer\").clickOutsideThisElement(function... |
I can correctly setup up a windows hook, but I get confused by the line in MSDN that says "Calling the CallNextHookEx function to chain to the next hook procedure is optional, but it is highly recommended; otherwise, other applications that have installed hooks will not receive hook notifications and may behave incorre... | You're on the right track with setting up your hook procedure, and it's great to see that you're considering the implications of not calling `CallNextHookEx`. In a hook procedure, when you receive a code that you're not interested in (like any code other than `HCBT_CREATEWND` in your case), you should indeed call `Call... | 28,909 | [
{
"from": "human",
"value": "I can correctly setup up a windows hook, but I get confused by the line in MSDN that says \"Calling the CallNextHookEx function to chain to the next hook procedure is optional, but it is highly recommended; otherwise, other applications that have installed hooks will not receive... |
Regarding cross-site request forgery (CSRF) attacks, if cookies are most used authentication method, why do web browsers allow sending cookies of some domain (and to that domain) from a page generated from another domain?
Isn't CSRF easily preventable in browser by disallowing such behavior?
As far as I know, this kin... | Your confusion is understandable, as the behavior of browsers in relation to cookies and CSRF can indeed seem counterintuitive at first. Let's clarify a few points about how cookies work, why CSRF is a problem, and the reasoning behind the current browser behavior.
### How Cookies Work
1. **Same-Origin Policy**: Brow... | 24,703 | [
{
"from": "human",
"value": "Regarding cross-site request forgery (CSRF) attacks, if cookies are most used authentication method, why do web browsers allow sending cookies of some domain (and to that domain) from a page generated from another domain?\nIsn't CSRF easily preventable in browser by disallowing ... |
I think I know how to create custom encrypted RSA keys, but how can I read one encrypted like ssh-keygen does?
I know I can do this:
OpenSSL::PKey::RSA.new(File.read('private_key'))
But then OpenSSL asks me for the passphrase... How can I pass it to OpenSSL as a parameter?
And, how can I create one compatible to the o... | Creating custom encrypted RSA keys and ensuring compatibility with OpenSSH's format can be quite tricky. Let’s break down the steps you need to follow to achieve your goals.
### 1. Reading an Encrypted RSA Key
When reading an encrypted RSA key using OpenSSL, you can pass the passphrase as an argument to the method. T... | 24,031 | [
{
"from": "human",
"value": "I think I know how to create custom encrypted RSA keys, but how can I read one encrypted like ssh-keygen does?\nI know I can do this:\nOpenSSL::PKey::RSA.new(File.read('private_key'))\n\nBut then OpenSSL asks me for the passphrase... How can I pass it to OpenSSL as a parameter?\... |
As far as I know Hibernate let's you configure entities and collections to be stored in a second-level cache.
When does Hibernate try to read these cached entities from the second-level cache and when does it hit the DB? Does Hibernate only read from the second-level cache when loading entities by calling Sesssion.get... | Hibernate's second-level cache is designed to improve the performance of your application by reducing the number of database queries required to retrieve data that has been accessed previously. Let's clarify how Hibernate interacts with the second-level cache and when it falls back to hitting the database.
### When Do... | 22,884 | [
{
"from": "human",
"value": "As far as I know Hibernate let's you configure entities and collections to be stored in a second-level cache. \nWhen does Hibernate try to read these cached entities from the second-level cache and when does it hit the DB? Does Hibernate only read from the second-level cache whe... |
How do you get a image from the scanner using .NET (C#) on Vista?
Preferably to have the possibility to set the DPI.
There are a few controls on the market that do this, but they don't seem to work very well.
| To get an image from a scanner in .NET (C#) on Windows Vista, you can use the WIA (Windows Image Acquisition) library, which is built into Windows. WIA provides a way to communicate with image acquisition devices like scanners and webcams.
Below is a step-by-step guide on how to use WIA to scan an image with a specifi... | 25,335 | [
{
"from": "human",
"value": "How do you get a image from the scanner using .NET (C#) on Vista?\nPreferably to have the possibility to set the DPI.\nThere are a few controls on the market that do this, but they don't seem to work very well.\n"
},
{
"from": "gpt",
"value": "To get an image from a ... |
I have some code which needs to ensure some data is in a mysql enum prior to insertion in the database. The cleanest way I've found of doing this is the following code:
sub enum_values {
my ( $self, $schema, $table, $column ) = @_;
# don't eval to let the error bubble up
my $columns = $schema->storage->db... | Your approach to retrieving and parsing MySQL ENUM values using raw SQL and Text::CSV_XS is functional, but there are indeed better practices that can improve the code's readability and maintainability, especially when leveraging DBIx::Class capabilities.
DBIx::Class has built-in mechanisms to work with database schem... | 22,929 | [
{
"from": "human",
"value": "I have some code which needs to ensure some data is in a mysql enum prior to insertion in the database. The cleanest way I've found of doing this is the following code:\nsub enum_values {\n my ( $self, $schema, $table, $column ) = @_;\n\n # don't eval to let the error bub... |
How to debug javascript in visual studio when an asp.net application is run under mozilla firefox browser? IE supports by enabling javascript debug option .
| Debugging JavaScript in a Visual Studio ASP.NET application while using Mozilla Firefox can be accomplished through a few steps, as Visual Studio doesn't natively support debugging in Firefox the same way it does for Internet Explorer. Here’s a general approach to get you started:
### 1. Use Visual Studio and Firefox ... | 26,740 | [
{
"from": "human",
"value": "How to debug javascript in visual studio when an asp.net application is run under mozilla firefox browser? IE supports by enabling javascript debug option .\n"
},
{
"from": "gpt",
"value": "Debugging JavaScript in a Visual Studio ASP.NET application while using Mozil... |
What effect does a field name length has on the performance of a database? Is it negligible? Should I go with long descriptive names?
| The length of field names in a database can have several effects on performance and maintainability, though many of these effects are often negligible compared to other factors. Here’s a breakdown of considerations regarding field name length:
### 1. **Performance Impact:**
- **Storage Overhead:** In most modern da... | 29,011 | [
{
"from": "human",
"value": "What effect does a field name length has on the performance of a database? Is it negligible? Should I go with long descriptive names?\n"
},
{
"from": "gpt",
"value": "The length of field names in a database can have several effects on performance and maintainability,... |
Can someone point me a good step-by-step tutorial to consuming an already running web service in java?
PS: I tried creating the classes with wsconsume, but it cries with
[ERROR] rpc/encoded wsdls are not supported in JAXWS 2.0. (my web service is rpc/encoded)
If I can consume web services entirely by hand (using no wi... | Certainly! Consuming a web service in Java, especially one that uses the JAX-RPC specification, can be done step-by-step by manually creating the necessary classes and configurations. Below, I've outlined a general approach to help you get started with consuming an RPC/encoded web service using JAX-RPC.
### Step-by-St... | 23,452 | [
{
"from": "human",
"value": "Can someone point me a good step-by-step tutorial to consuming an already running web service in java?\nPS: I tried creating the classes with wsconsume, but it cries with\n[ERROR] rpc/encoded wsdls are not supported in JAXWS 2.0. (my web service is rpc/encoded)\nIf I can consum... |
I have a requirement to install multiple web setup projects (using VS2005 and ASP.Net/C#) into the same virtual folder. The projects share some assembly references (the file systems are all structured to use the same 'bin' folder), making deployment of changes to those assemblies problematic since the MS installer wi... | To address your requirement for managing assembly versioning for multiple web setup projects in a shared environment, you can implement a solution using MSBuild and a custom versioning strategy. The goal is to update the assembly version only if the assembly constituents have changed, reducing the risk of inadvertently... | 22,364 | [
{
"from": "human",
"value": "I have a requirement to install multiple web setup projects (using VS2005 and ASP.Net/C#) into the same virtual folder. The projects share some assembly references (the file systems are all structured to use the same 'bin' folder), making deployment of changes to those assembl... |
Currently we have mutiple projects sharing a JIRA instances. We want to make it such that the users only view the projects that they are doing testing.
But however we are currently groupging these users to the standard grouping jira-users.
What is the best way to filter out JIRA project that only certain users can see ... | To restrict users in JIRA to only see and access projects that they are directly involved in, you can follow these steps:
### 1. **Create Project Roles:**
- Instead of using the default `jira-users` group, consider creating specific project roles for your testing teams. For example, you could create roles like `Tester... | 25,992 | [
{
"from": "human",
"value": "Currently we have mutiple projects sharing a JIRA instances. We want to make it such that the users only view the projects that they are doing testing.\nBut however we are currently groupging these users to the standard grouping jira-users.\nWhat is the best way to filter out JI... |
When you create your mapping files, do you map your properties to fields or properties :
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Foo" namespace="Foo.Bar" >
<class name="Foo" table="FOOS" batch-size="100">
[...]
<property name="FooProperty1" access="field.camelcase" column="FOO_1" type=... | In NHibernate, the decision to map your entities to fields or properties can depend on several factors, including your design philosophy, performance considerations, and the use of encapsulation in your classes. Let's break down the options:
### Mapping to Properties
Mapping to properties is the most common approach ... | 23,734 | [
{
"from": "human",
"value": "When you create your mapping files, do you map your properties to fields or properties :\n<hibernate-mapping xmlns=\"urn:nhibernate-mapping-2.2\" assembly=\"Foo\" namespace=\"Foo.Bar\" >\n <class name=\"Foo\" table=\"FOOS\" batch-size=\"100\">\n [...]\n <property name=\"F... |
I've created a windows service in C# and Windows Server 2003. I would like my service to be able to run an exe file that is Windows forms application. When I start the service - it runs the other application but I cannot see it. When I open Task Manager - i can see that the application is running but I just cannot see ... | Running a Windows Forms application from a Windows Service is generally not recommended and can lead to issues, particularly with displaying the GUI to the desktop. Windows Services operate in a different session from the user’s desktop session, which is why you cannot see the application even if it is running.
On Win... | 25,940 | [
{
"from": "human",
"value": "I've created a windows service in C# and Windows Server 2003. I would like my service to be able to run an exe file that is Windows forms application. When I start the service - it runs the other application but I cannot see it. When I open Task Manager - i can see that the appl... |
New to javascript/jquery and having a hard time with using this or $(this) to get the current object.
I have a table with a set of radio buttons on each row, each named s_<rowindex>. None of the radio buttons are checked by default:
<tr>
<td align="left" style="width: 300px">
<div id="div_s_0">
<input... | You can achieve this by using jQuery's event handling capabilities. You want to add an event listener to the radio buttons that will check if the selected radio button is from the last row of your table. If it is, you'll add a new row. Let's go through this step by step.
### Step 1: Set Up Event Listener
You will set... | 22,040 | [
{
"from": "human",
"value": "New to javascript/jquery and having a hard time with using this or $(this) to get the current object.\nI have a table with a set of radio buttons on each row, each named s_<rowindex>. None of the radio buttons are checked by default:\n<tr>\n <td align=\"left\" style=\"width: 3... |
Is it possible with Axis2 and Eclipse to generate a Web Service client and have it use java types that you already have in packages instead of creating it's own types. Reason being of course if I have type A already created and it creates it's own Type A I can't just assign variable of type A to variable of type B.
Th... | Generating a Web Service client with Axis2 that uses existing Java types rather than creating its own types can be a bit tricky, but it can be done with some additional configuration. Here are a few approaches you can consider:
### Option 1: Using JAXB Custom Bindings
If you're generating your client from WSDL, you c... | 23,251 | [
{
"from": "human",
"value": "Is it possible with Axis2 and Eclipse to generate a Web Service client and have it use java types that you already have in packages instead of creating it's own types. Reason being of course if I have type A already created and it creates it's own Type A I can't just assign var... |
I've got a little problem that's slightly frustrating. Is it possible to set a default value when deserializing xml in C# (.NET 3.5)? Basically I'm trying to deserialize some xml that is not under my control and one element looks like this:
<assignee-id type="integer">38628</assignee-id>
it can also look like this:
<a... | You can handle the situation with nullable types in C#. When using nullable types, you can effectively handle cases where the XML element might not contain a valid integer value.
Here's how you can handle the scenario where the XML might either contain an integer or represent a nil value:
1. Change your property to u... | 27,732 | [
{
"from": "human",
"value": "I've got a little problem that's slightly frustrating. Is it possible to set a default value when deserializing xml in C# (.NET 3.5)? Basically I'm trying to deserialize some xml that is not under my control and one element looks like this:\n<assignee-id type=\"integer\">38628</... |
I am attempting to disable SSL v2.0 protocol on IIS 7.
The following article refers to IIS v6:
http://support.microsoft.com/kb/187498
It doesn't seem to apply because the only protocol listed in the registry is SSL 2.0 (not all the others) and the setting "DisabledByDefault=1" is already in there, which would seem to i... | Disabling SSL v2.0 on IIS 7 is an important step in securing your web server, as SSL v2.0 is considered outdated and vulnerable to various attacks. The process involves modifying registry settings, which can impact your server’s configuration. Here’s how to properly disable SSL v2.0 in IIS 7:
### Steps to Disable SSL ... | 24,989 | [
{
"from": "human",
"value": "I am attempting to disable SSL v2.0 protocol on IIS 7.\nThe following article refers to IIS v6:\nhttp://support.microsoft.com/kb/187498\nIt doesn't seem to apply because the only protocol listed in the registry is SSL 2.0 (not all the others) and the setting \"DisabledByDefault=... |
I was wondering if this seemed to familiar to any experience NHibernate developers or if someone could give me an idea as to where to start to try and resolve this issue:
I inherited an NHibernate site written in ASP.NET 1.1 using NHibernate 0.6 and .NET remoting to the DAL layer residing on the database server. I hav... | It sounds like you're facing a concurrency or resource exhaustion issue in your NHibernate application, especially since you mentioned that the problem occurs under load. Here are some potential areas to investigate and steps to troubleshoot:
1. **Connection Pooling**:
- Ensure that you are using connection pooling... | 28,836 | [
{
"from": "human",
"value": "I was wondering if this seemed to familiar to any experience NHibernate developers or if someone could give me an idea as to where to start to try and resolve this issue:\nI inherited an NHibernate site written in ASP.NET 1.1 using NHibernate 0.6 and .NET remoting to the DAL lay... |
I am having an issue when using LoadControl( type, Params ). Let me explain...
I have a super simple user control (ascx)
<%@ Control Language="C#" AutoEventWireup="True" Inherits="ErrorDisplay" Codebehind="ErrorDisplay.ascx.cs" EnableViewState="false" %>
<asp:Label runat="server" ID="lblTitle" />
<asp:Label runat="ser... | The issue you're encountering stems from how ASP.NET handles the lifecycle of server controls and user controls. Specifically, when you use `LoadControl`, the control is instantiated, but the ASP.NET page lifecycle events are not designed to handle a control that depends on constructor parameters in that way.
Here’s ... | 28,444 | [
{
"from": "human",
"value": "I am having an issue when using LoadControl( type, Params ). Let me explain...\nI have a super simple user control (ascx)\n<%@ Control Language=\"C#\" AutoEventWireup=\"True\" Inherits=\"ErrorDisplay\" Codebehind=\"ErrorDisplay.ascx.cs\" EnableViewState=\"false\" %>\n\n<asp:Labe... |
I don't know if this has been discussed.
Let's say you are in a three developer team. How would you share:
models - views - controllers
by controllers
by use cases
something else?
Maybe someone says this has nothing to do with asp.net mvc but I think it affects somehow.
| In a three-developer team working with an ASP.NET MVC application, effective sharing and organization of models, views, and controllers is crucial for maintaining code quality, facilitating collaboration, and ensuring that the application remains scalable and maintainable. Here are some common strategies for organizing... | 24,289 | [
{
"from": "human",
"value": "I don't know if this has been discussed. \nLet's say you are in a three developer team. How would you share: \n\nmodels - views - controllers\nby controllers\nby use cases\nsomething else?\n\nMaybe someone says this has nothing to do with asp.net mvc but I think it affects someh... |
I have an alert script that I am trying to keep from spamming me so I'd like to place a condition that if an alert has been sent within, say the last hour, to not send another alert. Now I have a cron job that checks the condition every minute because I need to be alerted quickly when the condition is met but I don't ... | To prevent spamming alerts in a Bash script, you can store the timestamp of the last alert sent and compare it to the current time to decide whether to send a new alert or not. You can do this by creating a simple file that contains the timestamp of the last alert.
Here's a basic outline of how you could accomplish th... | 26,669 | [
{
"from": "human",
"value": "I have an alert script that I am trying to keep from spamming me so I'd like to place a condition that if an alert has been sent within, say the last hour, to not send another alert. Now I have a cron job that checks the condition every minute because I need to be alerted quick... |
Why is an exception being thrown in the "f++" part of the code below ("IndexOutOfRangeException was unhandled by user code"):
for (int f = 0; f < gnf; f++)
{
fieldNames[g] = grid.FieldName(f);
}
The bug is in the "fieldNames[g] = ..." part of the code, my algorithm should be:
for (int f = 0; f < gnf; f++) ... | The behavior you're encountering, where the debugger seems to indicate that an exception is occurring at the wrong line of code, can be explained by a few potential reasons:
1. **Out-of-Bounds Indexing**: In your original code (`fieldNames[g] = grid.FieldName(f);`), if `g` is out of the bounds of the `fieldNames` arra... | 26,621 | [
{
"from": "human",
"value": "Why is an exception being thrown in the \"f++\" part of the code below (\"IndexOutOfRangeException was unhandled by user code\"):\nfor (int f = 0; f < gnf; f++) \n{ \n fieldNames[g] = grid.FieldName(f); \n} \n\nThe bug is in the \"fieldNames[g] = ...\" part of the code, m... |
When in Outlook 2003, open the Address Book, select Tools->Options. You get the address dialog showing the option "When sending mail, check names using these address lists in the following order:"
For most people, this will contain only "Contacts". For corporate networks, it'll probably also contain "Global Address ... | Reordering the address lists for name resolution in Outlook through the registry can be challenging, especially when dealing with user-specific values like the Contacts ID, which can vary across installations.
Here's a potential approach to automate the process for multiple PCs while accommodating the variability of t... | 25,147 | [
{
"from": "human",
"value": "When in Outlook 2003, open the Address Book, select Tools->Options. You get the address dialog showing the option \"When sending mail, check names using these address lists in the following order:\"\n\nFor most people, this will contain only \"Contacts\". For corporate network... |
template <class M, class A> class C { std::list<M> m_List; ... }
Is the above code possible? I would like to be able to do something similar.
Why I ask is that i get the following error:
Error 1 error C2079: 'std::_List_nod<_Ty,_Alloc>::_Node::_Myval' uses undefined class 'M' C:\Program Files\Microsoft Visual Studi... | The code snippet you provided is a template class declaration in C++, which looks like this:
```cpp
template <class M, class A>
class C {
std::list<M> m_List;
// ...
};
```
The error you are encountering suggests that there is an issue with how you are using `M`. Specifically, it appears that the `std::list<M... | 28,786 | [
{
"from": "human",
"value": "template <class M, class A> class C { std::list<M> m_List; ... }\n\nIs the above code possible? I would like to be able to do something similar.\nWhy I ask is that i get the following error:\nError 1 error C2079: 'std::_List_nod<_Ty,_Alloc>::_Node::_Myval' uses undefined class ... |
I've got an image library on Amazon S3. For each image, I md5 the source URL on my server plus a timestamp to get a unique filename. Since S3 can't have subdirectories, I need to store all of these images in a single flat folder.
Do I need to worry about collisions in the MD5 hash value that gets produced?
Bonus: How m... | MD5 produces a 128-bit hash value, which translates to \(2^{128}\) possible unique hash values. Although MD5 is not collision-resistant in the sense that it has been shown to have vulnerabilities, the probability of collision is still quite low for practical purposes when dealing with a relatively small number of files... | 27,281 | [
{
"from": "human",
"value": "I've got an image library on Amazon S3. For each image, I md5 the source URL on my server plus a timestamp to get a unique filename. Since S3 can't have subdirectories, I need to store all of these images in a single flat folder.\nDo I need to worry about collisions in the MD5 h... |
I'm trying to find out whether there is a way to reliably determine when a managed thread is about to terminate. I'm using a third-party library that includes support for PDF documents and the problem is that in order to use the PDF functionality, I have to explicitly initialize the PDF component, do the work, then ex... | It sounds like you're facing a challenging situation with managing the lifecycle of threads and ensuring the proper initialization and uninitialization of the PDF component. Since the `Thread` class in .NET does not provide events or a direct way to detect when a thread is about to terminate, you will need to implement... | 27,305 | [
{
"from": "human",
"value": "I'm trying to find out whether there is a way to reliably determine when a managed thread is about to terminate. I'm using a third-party library that includes support for PDF documents and the problem is that in order to use the PDF functionality, I have to explicitly initializ... |
Do you think changing directories inside bash or Perl scripts is acceptable? Or should one avoid doing this at all costs?
What is the best practice for this issue?
| Changing directories inside Bash or Perl scripts is technically acceptable, but it comes with certain risks and caveats. Here are some considerations and best practices regarding changing directories in scripts:
### Risks of Changing Directories
1. **State Management**: Changing the current working directory can lead... | 27,994 | [
{
"from": "human",
"value": "Do you think changing directories inside bash or Perl scripts is acceptable? Or should one avoid doing this at all costs?\nWhat is the best practice for this issue?\n"
},
{
"from": "gpt",
"value": "Changing directories inside Bash or Perl scripts is technically accep... |
How do I go about setting a <div> in the center of the screen using jQuery?
| To center a `<div>` element in the middle of the screen using jQuery, you can use a combination of CSS for positioning and jQuery to dynamically adjust the position. Below are two common methods: using CSS with Flexbox and using jQuery to calculate the position.
### Method 1: Using CSS Flexbox
The simplest way to cen... | 23,136 | [
{
"from": "human",
"value": "How do I go about setting a <div> in the center of the screen using jQuery?\n"
},
{
"from": "gpt",
"value": "To center a `<div>` element in the middle of the screen using jQuery, you can use a combination of CSS for positioning and jQuery to dynamically adjust the po... |
I'm building a data warehouse that includes delivery information for restaurants. The data is stored in SQL Server 2005 and is then put into a SQL Server Analysis Services 2005 cube.
The Deliveries information consists of the following tables:
FactDeliveres
BranchKey
DeliveryDateKey
ProductKey
InvoiceNumber (DD: degen... | To create a robust data warehouse and cube design based on your Delivery data, you'll need to follow some key steps to ensure that your fact table is properly structured and that your dimensions are well-defined. Let's break down the approach:
### Step 1: Define Fact and Dimension Tables
#### Fact Table: FactDeliveri... | 22,140 | [
{
"from": "human",
"value": "I'm building a data warehouse that includes delivery information for restaurants. The data is stored in SQL Server 2005 and is then put into a SQL Server Analysis Services 2005 cube.\nThe Deliveries information consists of the following tables:\nFactDeliveres\n\nBranchKey\nDeliv... |
Consider the following subversion directory structure
/dir1/file.txt
/dir2/file.txt
I want to move the file.txt in dir1 to replace the same file in dir2 and ensure that the history for the dir1 file is maintained. I don't care about the history of original dir2 file.
Is this possible using subversion commands and not h... | Yes, it is possible to move a file from one directory to another in Subversion (SVN) while maintaining its history. You can achieve this by using the `svn move` command, which effectively renames or moves a file or directory in the repository while preserving the history of the source file.
Here's how you can do it fo... | 26,488 | [
{
"from": "human",
"value": "Consider the following subversion directory structure\n/dir1/file.txt\n/dir2/file.txt\nI want to move the file.txt in dir1 to replace the same file in dir2 and ensure that the history for the dir1 file is maintained. I don't care about the history of original dir2 file.\nIs this... |
Using C#, does anyone know how to get the MarshalAsAttribute's Sizeconst value in runtime ?
Eg. I would like to retrieve the value of 10.
[StructLayout[LayoutKind.Sequential, Pack=1]
Class StructureToMarshalFrom
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
public byte[] _value1;
}
| In C#, you can retrieve the `SizeConst` value of the `MarshalAsAttribute` at runtime using reflection. Here's how you can do it for your given structure `StructureToMarshalFrom`.
First, ensure that your structure is defined correctly. Note that you should use `struct` instead of `class` when defining a structure for m... | 23,889 | [
{
"from": "human",
"value": "Using C#, does anyone know how to get the MarshalAsAttribute's Sizeconst value in runtime ?\nEg. I would like to retrieve the value of 10.\n[StructLayout[LayoutKind.Sequential, Pack=1]\nClass StructureToMarshalFrom\n{\n [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]\n ... |
Does anybody have any reference material that details Cauchy-Reed algorithm? Googling for Cauchy-Reed Solomon results cleversafe.org. Although they have an open sourced product based on Cauchy Reed-Solomon code, they haven't provided any material explaining how the algorithm works.
| The Cauchy-Reed-Solomon (CRS) algorithm is a form of error-correcting code that is particularly useful in data storage and communication systems. It is a variation of the Reed-Solomon code, and it uses Cauchy matrices for encoding and decoding.
Here are some resources and references that should help you understand the... | 26,347 | [
{
"from": "human",
"value": "Does anybody have any reference material that details Cauchy-Reed algorithm? Googling for Cauchy-Reed Solomon results cleversafe.org. Although they have an open sourced product based on Cauchy Reed-Solomon code, they haven't provided any material explaining how the algorithm wo... |
Some of the other questions and answers here on SO extol the virtues of using an enterprise repository tool like Archiva, Artifactory, or Nexus. What are the pros and cons of each? How do I choose between them?
In case it helps:
We use both Maven 1 and Maven 2 (at least for a while)
We want to store both internally-ge... | When evaluating enterprise repository tools like Archiva, Artifactory, and Nexus, it's essential to consider your specific use cases, technical requirements, and long-term strategy. Below is an overview of the pros and cons of each tool, along with recommendations for selecting the right one for your needs.
### 1. **A... | 22,660 | [
{
"from": "human",
"value": "Some of the other questions and answers here on SO extol the virtues of using an enterprise repository tool like Archiva, Artifactory, or Nexus. What are the pros and cons of each? How do I choose between them?\nIn case it helps:\n\nWe use both Maven 1 and Maven 2 (at least for ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.