instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I want to override OnMouseClick and OnMouseDoubleClick and perform different actions depending on which click style was used.
The problem is that OnMouseClick is happening for both single and double clicks, and is getting called before OnMouseDoubleClick.
I'm certain this must be a common requirement, so I guess I'm mi... | It looks like you're running into a common issue when handling mouse events in Windows Forms (or similar frameworks). The problem arises because the single click event (`OnMouseClick`) is fired before the double-click event (`OnMouseDoubleClick`). The `MouseEventArgs.Clicks` property does not help in your case because,... | 25,231 | [
{
"from": "human",
"value": "I want to override OnMouseClick and OnMouseDoubleClick and perform different actions depending on which click style was used.\nThe problem is that OnMouseClick is happening for both single and double clicks, and is getting called before OnMouseDoubleClick.\nI'm certain this must... |
Suppose a header file defines a function template. Now suppose two implementation files #include this header, and each of them has a call to the function template. In both implementation files the function template is instantiated with the same type.
// header.hh
template <typename T>
void f(const T& o)
{
// ...
... | The behavior you're observing with function templates is indeed defined by the C++ standard, and there are specific reasons for it.
### How Templates Work
In C++, function templates are not functions until they are instantiated with a specific type. When you include a header file that defines a function template, it ... | 23,982 | [
{
"from": "human",
"value": "Suppose a header file defines a function template. Now suppose two implementation files #include this header, and each of them has a call to the function template. In both implementation files the function template is instantiated with the same type.\n// header.hh\ntemplate <t... |
How can you find out the number of active users when you're using a StateServer? Also is it possible to query the StateServer and retrieve the contents in the Session State?
I know that this is all possible if you use SqlServer for a backing store, but I want them to be in memory.
| When using ASP.NET's StateServer mode for session state, the ability to directly query the number of active users or retrieve the contents of session state is limited compared to using SQL Server or other persistent storage options. However, there are ways to get around these limitations with some custom implementation... | 25,698 | [
{
"from": "human",
"value": "How can you find out the number of active users when you're using a StateServer? Also is it possible to query the StateServer and retrieve the contents in the Session State? \nI know that this is all possible if you use SqlServer for a backing store, but I want them to be in... |
I am getting ready to completely overhaul my web server. I use it for both development and to present product to clients. It also hosts my company website. I will be loading MS Server 2008 and MS SQL 2008. I want it to have the latest .NET Framework as well as the latest MVC templates. I want it to use SubSonic. I als... | Hi Scott and the Dev Team,
It sounds like you're gearing up for a significant upgrade to your web server environment! Here are some suggestions and best practices that can help you maximize the effectiveness of your setup and improve your development workflow:
### Operating System and Database
1. **MS Server 2008 & M... | 23,460 | [
{
"from": "human",
"value": "I am getting ready to completely overhaul my web server. I use it for both development and to present product to clients. It also hosts my company website. I will be loading MS Server 2008 and MS SQL 2008. I want it to have the latest .NET Framework as well as the latest MVC te... |
Rails comes with RESTful resources out of the box, but do you use those for your actual public API? If so, how would you accomplish versioning of your API i.e. example.com/api/v2/foo/bar?
| Yes, Rails provides a convenient way to set up RESTful resources out of the box, and it is often a good choice to use these for your public API. You can leverage Rails' routing and controller capabilities to create a clean and maintainable API structure.
To implement versioning in your API, you can follow these steps:... | 12,314 | [
{
"from": "human",
"value": "Rails comes with RESTful resources out of the box, but do you use those for your actual public API? If so, how would you accomplish versioning of your API i.e. example.com/api/v2/foo/bar? \n"
},
{
"from": "gpt",
"value": "Yes, Rails provides a convenient way to set u... |
I recently started working on a small game for my own amusement, using Microsoft XNA and C#. My question is in regards to designing a game object and the objects that inherit it. I'm going to define a game object as something that can be rendered on screen. So for this, I decided to make a base class which all other ob... | Your initial approach of creating a base `GameObject` class and having derived classes like `Ship` is a common and valid way to design game objects in an object-oriented manner. However, as you've pointed out, the constructors can become cumbersome, especially if you have multiple parameters. Here are several suggestio... | 23,185 | [
{
"from": "human",
"value": "I recently started working on a small game for my own amusement, using Microsoft XNA and C#. My question is in regards to designing a game object and the objects that inherit it. I'm going to define a game object as something that can be rendered on screen. So for this, I decide... |
In Peter Seibel's Practical Common Lisp, he gives this example:
(do ((nums nil) (i 1 (1+ i)))
((> i 10) (nreverse nums))
(push i nums))
I can see how it works, using nums inside the loop but not giving it a step-form. Why would you put nums in the variable-definition rather than do this:
(let (nums) (do ((i 1 (... | The reason for placing `nums` in the variable-definition part of the `do` loop instead of using a `let` to define it externally is related to the intended functionality and the lifecycle of the variables involved.
### Explanation of the Original `do` Loop:
```lisp
(do ((nums nil) (i 1 (1+ i)))
((> i 10) (nreverse... | 25,476 | [
{
"from": "human",
"value": "In Peter Seibel's Practical Common Lisp, he gives this example:\n(do ((nums nil) (i 1 (1+ i)))\n ((> i 10) (nreverse nums))\n (push i nums))\n\nI can see how it works, using nums inside the loop but not giving it a step-form. Why would you put nums in the variable-definitio... |
I've got some generic class for my JPA model POJO that goes like this:
public interface Identifiable<PK extends Serializable> {
PK getUniqueId();
}
public interface GenericDao<T extends Identifiable<PK>> {
public T findById(PK id);
}
This code won't compile. For this to work, I need to specify
public interfa... | To avoid redundant information in your generic interfaces and ensure that the type parameter for the primary key (`PK`) can be inferred from the type parameter for the entity (`T`), you can make use of a bounded type parameter for `T` that includes the primary key type.
Here's how you can do it:
1. Update the `Ident... | 26,530 | [
{
"from": "human",
"value": "I've got some generic class for my JPA model POJO that goes like this:\npublic interface Identifiable<PK extends Serializable> {\n PK getUniqueId();\n}\n\npublic interface GenericDao<T extends Identifiable<PK>> {\n public T findById(PK id);\n}\n\nThis code won't compile. F... |
Our Test DB is suddenly missing rows. We want them back.
Is there a way to sift through everything that has happened to the database today? Each SQL statement? I presume this kind of stuff is in the transaction log, but am not sure how to view it.
Is there a way to undo delete operations?
BTW: Yes, we do have a backup,... | Recovering missing rows in a database and understanding the cause of the deletions can be a complex task, but you have a few options to investigate and possibly recover the missing data. Here are the steps you can take:
### 1. Check Transaction Logs
Most relational databases have transaction logs that record all chang... | 26,009 | [
{
"from": "human",
"value": "Our Test DB is suddenly missing rows. We want them back.\nIs there a way to sift through everything that has happened to the database today? Each SQL statement? I presume this kind of stuff is in the transaction log, but am not sure how to view it.\nIs there a way to undo delete... |
For example, how much memory is required to store a list of one million (32-bit) integers?
alist = range(1000000) # or list(range(1000000)) in Python 3.0
| To calculate the amount of memory required to store a list of one million (32-bit) integers, we can follow these steps:
1. **Size of a 32-bit Integer**: A 32-bit integer uses 4 bytes of memory (since 1 byte = 8 bits).
2. **Number of Integers**: In this case, we have one million integers.
3. **Total Memory Calculatio... | 26,307 | [
{
"from": "human",
"value": "For example, how much memory is required to store a list of one million (32-bit) integers?\nalist = range(1000000) # or list(range(1000000)) in Python 3.0\n\n"
},
{
"from": "gpt",
"value": "To calculate the amount of memory required to store a list of one million (32... |
I am debugging some code and have encountered the following SQL query (simplified version):
SELECT ads.*, location.county
FROM ads
LEFT JOIN location ON location.county = ads.county_id
WHERE ads.published = 1
AND ads.type = 13
AND ads.county_id = 2
OR ads.county_id = 5
OR ads.county_id = 7
OR ads.county_id = 9
I'm g... | You are correct in your suspicion that the placement of the `OR` operators is causing your query to return unexpected results. In SQL, the `AND` operator has a higher precedence than `OR`, so your current WHERE clause is being evaluated in a way that you likely did not intend.
To ensure that the `OR` conditions are ap... | 27,654 | [
{
"from": "human",
"value": "I am debugging some code and have encountered the following SQL query (simplified version):\nSELECT ads.*, location.county \nFROM ads\nLEFT JOIN location ON location.county = ads.county_id\nWHERE ads.published = 1 \nAND ads.type = 13\nAND ads.county_id = 2\nOR ads.county_id = 5\... |
I am trying to deserialize an object from XML in Ruby.
Something simple like:
u = User.new({:client_key => "Bar"})
v = User.new(u.to_xml)
I get an error:
NoMethodError: undefined method 'stringify_keys!' for #String:0x20fc7cc>
I'm not sure what I have to do in order to get the string from XML to an object.
Update:... | In Ruby, deserializing an object from XML can be done using the `from_xml` method, which is part of ActiveSupport if you're using Rails or ActiveSupport in a standalone application.
Here's how to correctly deserialize an XML string back into an object:
1. First, make sure you have `active_support` included in your R... | 25,419 | [
{
"from": "human",
"value": "I am trying to deserialize an object from XML in Ruby. \nSomething simple like:\nu = User.new({:client_key => \"Bar\"})\nv = User.new(u.to_xml)\n\nI get an error:\n\nNoMethodError: undefined method 'stringify_keys!' for #String:0x20fc7cc>\n\nI'm not sure what I have to do in or... |
Today I had an idea of writing a unit testing framework for stored procedures in MySQL. The full idea is written on a recent post on my blog. In short it goes like this:
I want to automate my procedure testing, I want to use a standardized way to test my procedures. Unit testing is widely documented, and there are a z... | Your idea of creating a unit testing framework for stored procedures in MySQL is not silly or stupid at all; in fact, it's quite valuable! Here are some thoughts and considerations regarding your concept:
### Value of a Unit Testing Framework for Stored Procedures
1. **Standardization**: Automating the testing of sto... | 25,721 | [
{
"from": "human",
"value": "Today I had an idea of writing a unit testing framework for stored procedures in MySQL. The full idea is written on a recent post on my blog. In short it goes like this: \nI want to automate my procedure testing, I want to use a standardized way to test my procedures. Unit testi... |
Why is the following displayed different in Linux vs Windows?
System.out.println(new String("¿".getBytes("UTF-8"), "UTF-8"));
in Windows:
¿
in Linux:
¿
| The difference in output you're observing between Linux and Windows is likely due to how the terminal (or console) on each operating system handles character encoding and text rendering.
### Explanation of the Code
The line of code you provided is doing the following:
1. `new String("¿".getBytes("UTF-8"), "UTF-8")`:... | 25,277 | [
{
"from": "human",
"value": "Why is the following displayed different in Linux vs Windows?\nSystem.out.println(new String(\"¿\".getBytes(\"UTF-8\"), \"UTF-8\"));\n\nin Windows:\n¿\nin Linux:\n¿\n"
},
{
"from": "gpt",
"value": "The difference in output you're observing between Linux and Windows ... |
I'd love to know how Stack Overflow's tagging and search is architected, because it seems to work pretty well.
What is a good database/search model if I want to do all of the following:
Storing Tags on various entities, (how normalized? i.e. Entity, Tag, and Entity_Tag tables?)
Searching for items with particular... | Stack Overflow has a robust architecture that handles tags and search effectively. Let's break down your questions and the best practices for implementing a similar system.
### 1. Database Design for Tags
For storing tags on various entities, a normalized approach is commonly adopted to maintain data integrity and re... | 24,065 | [
{
"from": "human",
"value": "I'd love to know how Stack Overflow's tagging and search is architected, because it seems to work pretty well. \nWhat is a good database/search model if I want to do all of the following:\n\nStoring Tags on various entities, (how normalized? i.e. Entity, Tag, and Entity_Tag ta... |
I'm trying to sign an XPI on linux (no gui) using the NSS cert db (cert8.db and key3.db) i copied from another server of mine, on which I can sign XPI's just fine.
On the new box I can sign with a brand new test certificate ok, but when i try to use the old cert db, it complains with:
signtool: PROBLEM signing data (U... | When transferring an NSS certificate database between different systems, there are a few things you need to keep in mind to ensure that the database is usable and that certificates can be correctly recognized:
1. **NSS Database Files**: The primary files for the NSS certificate database are `cert8.db`, `key3.db`, and ... | 26,124 | [
{
"from": "human",
"value": "I'm trying to sign an XPI on linux (no gui) using the NSS cert db (cert8.db and key3.db) i copied from another server of mine, on which I can sign XPI's just fine. \nOn the new box I can sign with a brand new test certificate ok, but when i try to use the old cert db, it complai... |
I'm looking into building a content site with possibly thousands of different entries, accessible by index and by search.
What are the measures I can take to prevent malicious crawlers from ripping off all the data from my site? I'm less worried about SEO, although I wouldn't want to block legitimate crawlers all toget... | Building a content site that is both user-friendly and resistant to scraping can be challenging, but there are several strategies you can implement to help protect your data. Here are some measures you can consider:
1. **Robots.txt**: Use a `robots.txt` file to specify which parts of your site can be accessed by crawl... | 25,859 | [
{
"from": "human",
"value": "I'm looking into building a content site with possibly thousands of different entries, accessible by index and by search.\nWhat are the measures I can take to prevent malicious crawlers from ripping off all the data from my site? I'm less worried about SEO, although I wouldn't w... |
I am using Borland Builder C++. I have a memory leak and I know it must be because of this class I created, but I am not sure how to fix it. Please look at my code-- any ideas would be greatly appreciated!
Here's the .h file:
#ifndef HeaderH
#define HeaderH
#include <vcl.h>
#include <string>
using std::string;
class He... | Based on the code you provided, there are a few issues to address in order to fix potential memory leaks and ensure that your `Header` class functions properly. Here are some observations and suggestions:
### Key Issues Identified:
1. **Constructor Definition**: You declare a constructor `NitfHeader(double latitude, ... | 22,417 | [
{
"from": "human",
"value": "I am using Borland Builder C++. I have a memory leak and I know it must be because of this class I created, but I am not sure how to fix it. Please look at my code-- any ideas would be greatly appreciated!\nHere's the .h file:\n#ifndef HeaderH\n#define HeaderH\n#include <vcl.h>\... |
I am writing a stored procedure where I have an input parameter called my_size that is an INTEGER. I want to be able to use it in a LIMIT clause in a SELECT statement. Apparently this is not supported, is there a way to work around this?
# I want something like:
SELECT * FROM some_table LIMIT my_size;
# Instead of har... | In many SQL databases, you can't directly use a parameter in the `LIMIT` clause of a `SELECT` statement. However, there are workarounds you can use depending on the database system you are working with. Here are a few common solutions for different SQL databases:
### MySQL
In MySQL, you can use prepared statements or... | 26,090 | [
{
"from": "human",
"value": "I am writing a stored procedure where I have an input parameter called my_size that is an INTEGER. I want to be able to use it in a LIMIT clause in a SELECT statement. Apparently this is not supported, is there a way to work around this?\n# I want something like:\nSELECT * FROM ... |
We have a SharePoint Team Site (WSS 3.0 not MOSS), that includes Tasks list to records every tasks related to a project. Here's the scenario.
Users :
List item
Supervisor1
TeamMember1
TeamMember2
TeamMember3
How do we set the permission settings so that
Every users (Supervisor and team members) can see any tasks.
S... | To achieve the desired permission settings in SharePoint WSS 3.0, where every user can see all tasks, supervisors can edit all tasks, and team members can only edit their own tasks, you will need to use a combination of SharePoint permissions and workflows. Since WSS 3.0 does not provide out-of-the-box capabilities for... | 21,447 | [
{
"from": "human",
"value": "We have a SharePoint Team Site (WSS 3.0 not MOSS), that includes Tasks list to records every tasks related to a project. Here's the scenario.\nUsers :\n\nList item\nSupervisor1\nTeamMember1\nTeamMember2\nTeamMember3\n\nHow do we set the permission settings so that \n\nEvery user... |
Has anyone come up with a good way to share a set of Visual Studio Code Snippets (actual .snippet files that Visual studio uses) amongst a team of developers automatically? It would be great for other developers on my team to benefit from shortcuts I've created for myself, and vice versa.
| Sharing Visual Studio Code (VSCode) snippets among a team of developers can greatly enhance productivity and maintain consistency. Here are a few approaches to automate the sharing of `.code-snippets` files:
### 1. **Using Version Control (Git)**
One of the simplest ways to share your snippets is to store them in a ve... | 22,387 | [
{
"from": "human",
"value": "Has anyone come up with a good way to share a set of Visual Studio Code Snippets (actual .snippet files that Visual studio uses) amongst a team of developers automatically? It would be great for other developers on my team to benefit from shortcuts I've created for myself, and ... |
I am trying to install Php on Vista (IIS 7). The installation and configuration seems to be fine. Pretty much followed everything mentioned in http://blogs.iis.net/bills/archive/2006/09/19/How-to-install-PHP-on-IIS7-_2800_RC1_2900_.aspx
I can even bring up a test.php which is basically and can also connect to mysql db... | It sounds like you're encountering an issue related to PHP configuration or compatibility with IIS 7 on Windows Vista. The access violation message often indicates a problem either with the PHP setup itself or with the specific PHP scripts that you're trying to run.
Here are some steps you can take to troubleshoot and... | 20,589 | [
{
"from": "human",
"value": "I am trying to install Php on Vista (IIS 7). The installation and configuration seems to be fine. Pretty much followed everything mentioned in http://blogs.iis.net/bills/archive/2006/09/19/How-to-install-PHP-on-IIS7-_2800_RC1_2900_.aspx\nI can even bring up a test.php which is b... |
I have a ListBox that when in focus, and when I have an item selected returns a valid SelectedIndex. If I have a valid SelectedIndex and I click on a TextBox on the same Forum, the SelectedIndex now becomes -1. However I want it to keep its SelectedIndex from changing. How would I go about doing this?
| To prevent the `SelectedIndex` of a `ListBox` from changing when you click on a `TextBox`, you can handle the `LostFocus` event of the `ListBox`. When the `ListBox` loses focus, you can store the current `SelectedIndex` in a variable and then reassign it when the `ListBox` regains focus.
Here’s a simple approach in C#... | 25,003 | [
{
"from": "human",
"value": "I have a ListBox that when in focus, and when I have an item selected returns a valid SelectedIndex. If I have a valid SelectedIndex and I click on a TextBox on the same Forum, the SelectedIndex now becomes -1. However I want it to keep its SelectedIndex from changing. How would... |
Currently I'm using
var x = dict.ContainsKey(key) ? dict[key] : defaultValue
I'd like some way to have dictionary[key] return null for nonexistant keys, so I could write something like
var x = dict[key] ?? defaultValue;
this also winds up being part of linq queries etc. so I'd prefer one-line solutions.
| You can achieve the desired behavior by creating an extension method for the dictionary that will return `null` for non-existent keys. Here's a simple implementation you can use:
```csharp
using System.Collections.Generic;
public static class DictionaryExtensions
{
public static TValue GetValueOrDefault<TKey, TVa... | 29,326 | [
{
"from": "human",
"value": "Currently I'm using\nvar x = dict.ContainsKey(key) ? dict[key] : defaultValue\n\nI'd like some way to have dictionary[key] return null for nonexistant keys, so I could write something like\nvar x = dict[key] ?? defaultValue;\n\nthis also winds up being part of linq queries etc.... |
Anyone know how to convert a JPEG image to MPEG still frame format? I'd love to do it in java but a linux command line process would be ok. (I saw something on code project that does this for c sharp).
| To convert a JPEG image to an MPEG still frame format, you can use the `ffmpeg` command-line tool. This tool is widely used for handling multimedia files and supports a variety of formats. Below, I'll outline how to do this using `ffmpeg` on the command line as well as a Java example.
### Using FFmpeg on the Command L... | 25,256 | [
{
"from": "human",
"value": "Anyone know how to convert a JPEG image to MPEG still frame format? I'd love to do it in java but a linux command line process would be ok. (I saw something on code project that does this for c sharp).\n"
},
{
"from": "gpt",
"value": "To convert a JPEG image to an MP... |
I am building a web application using .NET 3.5 (ASP.NET, SQL Server, C#, WCF, WF, etc) and I have run into a major design dilemma. This is a uni project btw, but it is 100% up to me what I develop.
I need to design a system whereby I can take an image and automatically crop a certain object within it, without user inpu... | Your project presents an interesting challenge and is a good exploration of image processing techniques. The task of automatically cropping specific objects from an image—especially in a generic context where the specific object is not predefined—can be quite complex. However, there are a few approaches you can conside... | 25,153 | [
{
"from": "human",
"value": "I am building a web application using .NET 3.5 (ASP.NET, SQL Server, C#, WCF, WF, etc) and I have run into a major design dilemma. This is a uni project btw, but it is 100% up to me what I develop.\nI need to design a system whereby I can take an image and automatically crop a c... |
Big problem. I'm not sure what it was that I did, but it seems that I can no longer debug into functions.
It happens in no particular place, just all throughout the code. I set a breakpoint, and then try to "step over" in order to go to the next like of code. Now, the debugger seems to interpret that as "continue".
... | It sounds like you're experiencing a frustrating debugging issue. Here are some suggestions that might help you identify and resolve the problem:
1. **Check Debug Configuration**: Make sure you're running your project in Debug mode, not Release mode. Release mode may optimize code in a way that prevents proper debuggi... | 26,842 | [
{
"from": "human",
"value": "Big problem. I'm not sure what it was that I did, but it seems that I can no longer debug into functions.\nIt happens in no particular place, just all throughout the code. I set a breakpoint, and then try to \"step over\" in order to go to the next like of code. Now, the debu... |
List<tinyClass> ids = new List<tinyClass();
ids.Add(new tinyClass(1, 2));
bool b = ids.IndexOf(new tinyClass(1, 2)) >= 0; //true or false?
If it compares by value, it should return true; if by reference, it will return false.
If it compares by reference, and I make tinyClass a struct - will that make a difference?
| In C#, whether the `IndexOf` method returns `true` or `false` when comparing instances of `tinyClass` depends on how `tinyClass` is defined.
By default, classes in C# are reference types, so the default behavior for `IndexOf` will compare references, meaning it would return `false` for `new tinyClass(1, 2)` because i... | 25,173 | [
{
"from": "human",
"value": "\nList<tinyClass> ids = new List<tinyClass();\nids.Add(new tinyClass(1, 2));\n\nbool b = ids.IndexOf(new tinyClass(1, 2)) >= 0; //true or false?\n\n\nIf it compares by value, it should return true; if by reference, it will return false.\nIf it compares by reference, and I make t... |
What is the best way to refresh a DataGridView when you update an underlying data source?
I'm updating the datasource frequently and wanted to display the outcome to the user as it happens.
I've got something like this (and it works), but setting the DataGridView.DataSource to null doesn't seem like the right way.
List... | Instead of setting `DataGridView.DataSource` to `null` and then reassigning it, which can lead to inefficiencies and potential flickering, you can use `BindingList<T>` or `ObservableCollection<T>` as your data source. These collections provide built-in notification mechanisms that automatically update the `DataGridView... | 28,458 | [
{
"from": "human",
"value": "What is the best way to refresh a DataGridView when you update an underlying data source?\nI'm updating the datasource frequently and wanted to display the outcome to the user as it happens.\nI've got something like this (and it works), but setting the DataGridView.DataSource to... |
In an information security lab I'm working on, I've been tasked with executing multiple commands with a single call to "system()" (written in C, running on Fedora). What is the syntax that will allow me to execute more than command through system()? (The idea being you could execute arbitrary commands through a progr... | In C, the `system()` function allows you to execute shell commands by passing a string to it. If you want to execute multiple commands within a single call to `system()`, you can chain them together using the appropriate command separator for the shell.
On most Unix-like systems, including Fedora, you can use the semi... | 27,319 | [
{
"from": "human",
"value": "In an information security lab I'm working on, I've been tasked with executing multiple commands with a single call to \"system()\" (written in C, running on Fedora). What is the syntax that will allow me to execute more than command through system()? (The idea being you could... |
I've used NUnit before, but not in a while, and never on this machine. I unzipped version 2.4.8 under Program Files, and I keep getting this error when trying to load my tests.
Could not load file or assembly 'nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencie... | It looks like you're encountering an issue with finding the `nunit.framework.dll` assembly when running your NUnit tests. This can happen if the test runner cannot locate the required assembly or if there are version mismatches. Here are some troubleshooting steps to help you resolve the issue:
1. **Ensure that NUnit.... | 21,975 | [
{
"from": "human",
"value": "I've used NUnit before, but not in a while, and never on this machine. I unzipped version 2.4.8 under Program Files, and I keep getting this error when trying to load my tests.\n\nCould not load file or assembly 'nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=... |
I have a "Login" button that I want to be disabled until 3 text boxes on the same WPF form are populated with text (user, password, server).
I have a backing object with a boolean property called IsLoginEnabled which returns True if and only if all 3 controls have data. However, when should I be checking this proper... | Using the `LostFocus` event to check the `IsLoginEnabled` property of your backing object is one way to do it, but it may not provide the best user experience. Users may not be aware that they should complete all three fields before the "Login" button becomes enabled, and they might find it frustrating if they lose foc... | 23,448 | [
{
"from": "human",
"value": "I have a \"Login\" button that I want to be disabled until 3 text boxes on the same WPF form are populated with text (user, password, server). \nI have a backing object with a boolean property called IsLoginEnabled which returns True if and only if all 3 controls have data. Ho... |
Can anyone suggest which of the Redmine or Tracd would be a better option for project management? Currently I am planning to deploy it on a one project setup but plan to use it across multiple projects in the fututre. Which of the two is easier to deploy? I use windows. Any other software which is web based and comes w... | Both Redmine and Trac are popular project management tools, but they have different features and capabilities. Here's a comparison to help you decide which might be better for your needs, especially considering that you plan to use it across multiple projects in the future and that you're using Windows.
### Redmine
#... | 26,859 | [
{
"from": "human",
"value": "Can anyone suggest which of the Redmine or Tracd would be a better option for project management? Currently I am planning to deploy it on a one project setup but plan to use it across multiple projects in the fututre. Which of the two is easier to deploy? I use windows. Any othe... |
I'm a confused newbie and hobbyist programmer trying to get a grip on this, so forgive me if my question is a little off or doesn't make much sense.
I see a lot of questions on SO revolving around the use of design patterns, and I'm wondering if anyone has a good resources for learning about, and implementing design pa... | It's great to hear that you're diving into design patterns! Understanding these patterns can significantly improve your coding skills and make your programs more organized and maintainable. Here are some resources and suggestions for learning about and implementing design patterns, particularly in C#:
### Books
1. **"... | 25,482 | [
{
"from": "human",
"value": "I'm a confused newbie and hobbyist programmer trying to get a grip on this, so forgive me if my question is a little off or doesn't make much sense.\nI see a lot of questions on SO revolving around the use of design patterns, and I'm wondering if anyone has a good resources for ... |
My goal is to recognize simple gestures from accelerometers mounted on a sun spot. A gesture could be as simple as rotating the device or moving the device in several different motions. The device currently only has accelerometers but we are considering adding gyroscopes if it would make it easier/more accurate.
Does ... | Recognizing gestures from accelerometers is an interesting challenge and can be done effectively with the right approach. Here are some recommendations to help you get started, along with potential libraries and papers that could be beneficial:
### 1. **Adding Gyroscopes:**
Adding gyroscopes can indeed improve the acc... | 25,472 | [
{
"from": "human",
"value": "My goal is to recognize simple gestures from accelerometers mounted on a sun spot. A gesture could be as simple as rotating the device or moving the device in several different motions. The device currently only has accelerometers but we are considering adding gyroscopes if it w... |
In few months I start a project in PHP and I am hesitating to do like usual : develop on my Windows Vista 64bits machine. Since I know few things on Linux, I think it can be a good way to learn by working on a Linux distribution.
Do you think it's a good idea or not? I would run a VirtualBox with Ubuntu (on my Vista64b... | Using a Linux distribution in a VirtualBox VM to develop your PHP project is definitely a good idea for several reasons:
1. **Learning Opportunity**: Since you're looking to learn Linux, developing in a Linux environment will provide you hands-on experience. You'll learn how to navigate the command line, manage files,... | 23,415 | [
{
"from": "human",
"value": "In few months I start a project in PHP and I am hesitating to do like usual : develop on my Windows Vista 64bits machine. Since I know few things on Linux, I think it can be a good way to learn by working on a Linux distribution.\nDo you think it's a good idea or not? I would ru... |
We are re-platforming for a client, and they are concerned about SEO. Their current site supports SEO friendly URLs, and so does the new platform. So for those, we are just going to create the same URL mapping. However, they have a large number of other URLs that are not SEO friendly that they want to permanently redir... | Handling SEO-friendly URL redirects while ensuring your front controller operates properly can be achieved with a few strategies on a LAMP stack (Linux, Apache, MySQL, PHP). Here's a step-by-step guide on how to implement this effectively:
### 1. Identify URLs for Redirect
Make a comprehensive list of all the URLs yo... | 25,642 | [
{
"from": "human",
"value": "We are re-platforming for a client, and they are concerned about SEO. Their current site supports SEO friendly URLs, and so does the new platform. So for those, we are just going to create the same URL mapping. However, they have a large number of other URLs that are not SEO fri... |
I recently had to rename a table (and a column and FK/PK contraints) in SQL Server 2000 without losing an data. There did not seem to be an obvious DDL T-SQL statements for performing this action, so I used sp_rename to directly fiddle with object names.
Was this the only solution to the problem? (other, than give the ... | Renaming a table, column, or constraints in SQL Server can be accomplished using the `sp_rename` stored procedure, as you have done. In SQL Server 2000, there are no direct DDL commands for renaming objects like there are in later versions of SQL Server. Here’s a summary of how you can manage these types of changes and... | 26,106 | [
{
"from": "human",
"value": "I recently had to rename a table (and a column and FK/PK contraints) in SQL Server 2000 without losing an data. There did not seem to be an obvious DDL T-SQL statements for performing this action, so I used sp_rename to directly fiddle with object names.\nWas this the only solut... |
I seem to remember being able to print out (or locate) the specific switches that each -O<num> option turns on. Can you remind?
Thanks!
| In many programming languages, especially in C and C++, the `-O` flags are used with compilers like GCC or Clang to enable various levels of optimization. Each `-O` level corresponds to different optimization strategies and techniques that the compiler applies to the code to improve performance.
Here’s a breakdown of ... | 26,760 | [
{
"from": "human",
"value": "I seem to remember being able to print out (or locate) the specific switches that each -O<num> option turns on. Can you remind?\nThanks!\n"
},
{
"from": "gpt",
"value": "In many programming languages, especially in C and C++, the `-O` flags are used with compilers l... |
An svn repository I'm mirroring through git-svn has changed URL.
In vanilla svn you'd just do svn switch --relocate old_url_base new_url_base.
How can I do this using git-svn?
Simply changing the svn url in the config file fails.
| When working with `git-svn`, changing the URL of the SVN repository you are mirroring requires a different approach since `git-svn` does not have a direct `switch` command like SVN does. Instead, you need to follow these steps to relocate your `git-svn` repository to the new SVN URL:
1. **Change the URL in the Git con... | 28,320 | [
{
"from": "human",
"value": "An svn repository I'm mirroring through git-svn has changed URL.\nIn vanilla svn you'd just do svn switch --relocate old_url_base new_url_base.\nHow can I do this using git-svn? \nSimply changing the svn url in the config file fails.\n"
},
{
"from": "gpt",
"value": "... |
How is it possible to identify that the browser's close button was clicked?
| Detecting when a user has clicked the browser's close button (or is navigating away from the page) can be tricky due to browser security and user experience guidelines. However, there are methods to handle page unload events in JavaScript, though they won't specifically tell you that the close button was clicked.
### ... | 27,935 | [
{
"from": "human",
"value": "How is it possible to identify that the browser's close button was clicked?\n"
},
{
"from": "gpt",
"value": "Detecting when a user has clicked the browser's close button (or is navigating away from the page) can be tricky due to browser security and user experience g... |
How can I document a member inline in .Net? Let me explain. Most tools that extract documentation from comments support some kind of inline documentation where you can add a brief after the member declaration. Something like:
public static string MyField; /// <summary>Information about MyField.</summary>
Is there a wa... | In C#, inline documentation in the style you're describing (e.g., placing XML comments directly after the member declaration) is not supported. XML comments for documenting code must be placed before the member declaration. The standard way to document members in C# is as follows:
```csharp
/// <summary>
/// Informati... | 28,668 | [
{
"from": "human",
"value": "How can I document a member inline in .Net? Let me explain. Most tools that extract documentation from comments support some kind of inline documentation where you can add a brief after the member declaration. Something like:\npublic static string MyField; /// <summary>Informati... |
I have an img tag in my webapp that uses the onload handler to resize the image:
<img onLoad="SizeImage(this);" src="foo" >
This works fine in Firefox 3, but fails in IE7 because the image object being passed to the SizeImage() function has a width and height of 0 for some reason -- maybe IE calls the function before ... | To handle the resizing of images upon loading in a way that works across different browsers, including IE 6, 7, and Firefox, we can use JavaScript along with the Prototype and EXT JS libraries that you mentioned already being included in your project.
Here's a solution that uses the `onload` event of the `img` tag co... | 24,792 | [
{
"from": "human",
"value": "I have an img tag in my webapp that uses the onload handler to resize the image:\n<img onLoad=\"SizeImage(this);\" src=\"foo\" >\n\nThis works fine in Firefox 3, but fails in IE7 because the image object being passed to the SizeImage() function has a width and height of 0 for so... |
I have a list of tuples like this:
[
('a', 1),
('a', 2),
('a', 3),
('b', 1),
('b', 2),
('c', 1),
]
I want to iterate through this keying by the first item, so, for example, I could print something like this:
a 1 2 3
b 1 2
c 1
How would I go about doing this without keeping an item to track whether the first item is t... | You can achieve this by using a dictionary to group the values by their corresponding keys (the first item in each tuple). Here’s a step-by-step breakdown of how you can do this:
1. Initialize a dictionary to hold the grouped items.
2. Loop through the list of tuples and populate the dictionary, using the first item a... | 27,442 | [
{
"from": "human",
"value": "I have a list of tuples like this:\n[\n('a', 1),\n('a', 2),\n('a', 3),\n('b', 1),\n('b', 2),\n('c', 1),\n]\n\nI want to iterate through this keying by the first item, so, for example, I could print something like this:\na 1 2 3\nb 1 2\nc 1\n\nHow would I go about doing this with... |
I am trying to use page methods in my asp.net page. I have enable page methods set to true on the script manager, the webmethod attribute defined on the method, the function is public static string, I know the function works because when I run it from my code behind it generates the expected result, but when I call it... | Using Page Methods in ASP.NET can be tricky sometimes, especially if you miss a small configuration step or if there is an issue with your JavaScript call. Here are some steps to help you troubleshoot and resolve your problem:
1. **Ensure ScriptManager is Properly Configured**:
Ensure that you have a `<asp:ScriptMa... | 22,480 | [
{
"from": "human",
"value": "I am trying to use page methods in my asp.net page. I have enable page methods set to true on the script manager, the webmethod attribute defined on the method, the function is public static string, I know the function works because when I run it from my code behind it generate... |
I am debugging VisualStudio 2005 webservice client software, accessing a Linux webserver.
VisualStudio has MSVSMON.exe for remote debugging of webserver code.
Is there an equivalent debug-monitor for Linux?
| For debugging applications on a Linux web server, there are several tools and methods you can use, although there isn't a direct equivalent to `MSVSMON.exe` for Visual Studio. Here are some common options for remote debugging on Linux:
1. **GDB (GNU Debugger)**:
- GDB is the standard debugger for C and C++ applicat... | 26,361 | [
{
"from": "human",
"value": "I am debugging VisualStudio 2005 webservice client software, accessing a Linux webserver. \nVisualStudio has MSVSMON.exe for remote debugging of webserver code.\nIs there an equivalent debug-monitor for Linux?\n"
},
{
"from": "gpt",
"value": "For debugging applicatio... |
I use Visual Basic and an automation interface to retrieve strings from an external application. These strings contain simple html formatting codes (<b>, <i>, etc.).
Is there any easy function in Visual Basic for Word to insert these strings into a word document and convert the html formatting codes to word formatting?... | Yes, you can convert simple HTML formatting codes into Word formatting by using the `Range` object in a Word document. Word provides a method to insert formatted text, but it doesn't directly support parsing HTML. However, you can use the `HTMLFormat` property of a `Range` object to achieve this.
Here's a simple examp... | 25,900 | [
{
"from": "human",
"value": "I use Visual Basic and an automation interface to retrieve strings from an external application. These strings contain simple html formatting codes (<b>, <i>, etc.).\nIs there any easy function in Visual Basic for Word to insert these strings into a word document and convert the... |
I am running tomcat and I have some custom images which when I store on my C drive do not show up.If I move them to webapp root foder, they r fine but I do not want these images to end up in the war file.As I am using Windows symbolic link is not an option. Any idea as to how I can make the images show up without stori... | If you want to serve custom images from a location outside your Tomcat web application's WAR file but still have them accessible via your application, you can achieve this by configuring a custom context in Tomcat.
Here are the steps to do this:
1. **Create an External Directory**:
Create a directory on your C dri... | 26,858 | [
{
"from": "human",
"value": "I am running tomcat and I have some custom images which when I store on my C drive do not show up.If I move them to webapp root foder, they r fine but I do not want these images to end up in the war file.As I am using Windows symbolic link is not an option. Any idea as to how I ... |
I would like to set the log file name for a log4j and log4net appender to have the current date. We are doing Daily rollovers but the current log file does not have a date. The log file name format would be
logname.2008-10-10.log
Anyone know the best way for me to do this?
edit: I forgot to mention that we would w... | To achieve daily rollovers with a date in the log file name using both Log4j (for Java applications) and Log4net (for .NET applications), you will need to configure the respective appenders to generate the log files with the desired naming convention. Here's how you can do it for both logging frameworks:
### Log4j Con... | 22,523 | [
{
"from": "human",
"value": "I would like to set the log file name for a log4j and log4net appender to have the current date. We are doing Daily rollovers but the current log file does not have a date. The log file name format would be \nlogname.2008-10-10.log\n\nAnyone know the best way for me to do this... |
I am new to Access. I have a table full of records. I want to write a function to check if any id is null or empty. If so, I want to update it with xxxxx.
The check for id must be run through all tables in a database.
Can anyone provide some sample code?
| Certainly! In Microsoft Access, you can write a VBA (Visual Basic for Applications) function to check for `NULL` or empty values in the "ID" field of all tables in your database and update them with "xxxxx" if needed.
Here’s a sample VBA code snippet to accomplish this:
1. Open your Access database.
2. Press `ALT + F... | 24,300 | [
{
"from": "human",
"value": "I am new to Access. I have a table full of records. I want to write a function to check if any id is null or empty. If so, I want to update it with xxxxx.\nThe check for id must be run through all tables in a database.\nCan anyone provide some sample code?\n"
},
{
"fro... |
How would it be possible to capture the audio programmatically? I am implementing an application that streams in real time the desktop on the network. The video part is finished. I need to implement the audio part. I need a way to get PCM data from the sound card to feed to my encoder (implemented using Windows Media F... | To capture audio programmatically on Windows, you can indeed use the Win32 API. The key functions you mentioned, `waveInOpen()` and related functions, are used for recording audio through the waveIn API.
Here’s a high-level outline of how to capture PCM data from the sound card:
### Steps to Capture Audio with Win32 ... | 13,168 | [
{
"from": "human",
"value": "How would it be possible to capture the audio programmatically? I am implementing an application that streams in real time the desktop on the network. The video part is finished. I need to implement the audio part. I need a way to get PCM data from the sound card to feed to my e... |
Is there a way to invoke an external script or batch file from VC6 (and later) project files?
I have a background process that I need to kill before attempting to build certain projects (DLLS, executables) and haven't found a way to successfully do so from the project itself. I'd like simply to call a batch file with ... | In Visual C++ 6.0 (VC6) and later versions, you can use the pre-build or post-build events in your project settings to invoke an external script or batch file. This allows you to execute a command or script automatically as part of your build process.
### Steps to Invoke an External Script or Batch File:
1. **Open Pr... | 23,046 | [
{
"from": "human",
"value": "Is there a way to invoke an external script or batch file from VC6 (and later) project files?\nI have a background process that I need to kill before attempting to build certain projects (DLLS, executables) and haven't found a way to successfully do so from the project itself. ... |
I have a class that contains a bunch of properties. It is a mistake by a programmer if they call ToString() on an object of that type. Take this example code:
using System;
public class Foo
{
public int ID = 123;
public string Name = "SomeName";
private string ToString() { return null; }
}
public class M... | In C#, you cannot completely hide or remove the `ToString()` method from a class because it is a method inherited from the `object` class, which is the base class for all types in C#. However, you can work around this limitation by using an interface or by making a `ToString` method that throws an exception, which serv... | 26,377 | [
{
"from": "human",
"value": "I have a class that contains a bunch of properties. It is a mistake by a programmer if they call ToString() on an object of that type. Take this example code:\nusing System;\n\npublic class Foo\n{\n public int ID = 123;\n public string Name = \"SomeName\";\n\n private s... |
I often use Dictionary in C#2.0 with the first key as string that was containing a unique identifier.
I am learning C#3.0+ and it seems that I can now simply use a List and simply do LINQ on that object to get the specific object (with the .where()).
So, if I understand well, the Dictionary class has lost its purpose?
| The introduction of LINQ in C# 3.0 certainly enhances the way you can query collections, including `List<T>`. However, the `Dictionary<TKey, TValue>` class still has a distinct purpose and advantages over `List<T>` in certain scenarios.
Here are some key points to consider:
1. **Performance**:
- A `Dictionary<TK... | 25,706 | [
{
"from": "human",
"value": "I often use Dictionary in C#2.0 with the first key as string that was containing a unique identifier.\nI am learning C#3.0+ and it seems that I can now simply use a List and simply do LINQ on that object to get the specific object (with the .where()).\nSo, if I understand well, ... |
I'm looking for syntatic examples or common techniques for doing regular expression style transformations on words instead of characters, given a procedural language.
For example, to trace copying, one would want to create a document with similar meaning but with different word choices.
I'd like to be able to concisel... | To achieve word-level transformations in a procedural language like C#, you can leverage techniques that utilize regular expressions in combination with context-aware parsing of the input text. Below are some examples of rules and techniques you could use to define such transformations, along with a basic implementatio... | 22,544 | [
{
"from": "human",
"value": "I'm looking for syntatic examples or common techniques for doing regular expression style transformations on words instead of characters, given a procedural language. \nFor example, to trace copying, one would want to create a document with similar meaning but with different wor... |
How do I make an asynchronous call to a web service using the PHP SOAP Extension?
| Making asynchronous calls to a web service using the PHP SOAP extension can be somewhat tricky because the standard SOAP client does not support asynchronous requests out of the box. However, you can achieve asynchronous behavior using multi-threading, forking, or other methods. Here are a couple of ways to do that:
#... | 18,384 | [
{
"from": "human",
"value": "How do I make an asynchronous call to a web service using the PHP SOAP Extension?\n"
},
{
"from": "gpt",
"value": "Making asynchronous calls to a web service using the PHP SOAP extension can be somewhat tricky because the standard SOAP client does not support asynchr... |
I know a little about SNMP, but not enough. I need to develop an application that can read standard SNMP MIBs and read/write the various properties. The network end is no problem, but the actual MIBs and exactly what they may contain is something of a black art to me.
I believe I should be able to use LIBSMI to 'parse'... | Sure! Let's break this down into manageable parts, focusing on understanding MIBs, the LIBSMI library, and how to interact with SNMP.
### Understanding MIBs
MIBs (Management Information Bases) are essentially databases used to manage devices on a network. They define the structure of the management data of a device a... | 21,877 | [
{
"from": "human",
"value": "I know a little about SNMP, but not enough. I need to develop an application that can read standard SNMP MIBs and read/write the various properties. The network end is no problem, but the actual MIBs and exactly what they may contain is something of a black art to me.\nI believe... |
I need to have multiple forms in the same webpage, all of them POSTing to itself and then performing different actions depending on the type of form.
What's the best way to achieve this?
To be more specific, the page shows the details of an event, with a form to subscribe (a drop-down box) and another form for each of ... | To create a webpage with multiple forms that all POST to the same URL and perform different actions based on the type of form, you can follow these steps:
1. **Use Different Form Types**: Each form should have a unique `name` or `id` and possibly different `action` attributes. This way, you can easily identify which f... | 21,411 | [
{
"from": "human",
"value": "I need to have multiple forms in the same webpage, all of them POSTing to itself and then performing different actions depending on the type of form.\nWhat's the best way to achieve this?\nTo be more specific, the page shows the details of an event, with a form to subscribe (a d... |
Three buttons, Save, Cancel, Close looks messy, yet after the user has saved the data should they really click a Cancel button?
I need the 'Save' button to leave the form open.
What is best practice?
Thanks
| When designing a user interface with buttons such as "Save," "Cancel," and "Close," it's important to consider user experience and clarity. Here are some best practices to streamline these actions:
1. **Clarify Button Functions:**
- **Save:** This button should save the current data but keep the form open, allowing... | 27,019 | [
{
"from": "human",
"value": "Three buttons, Save, Cancel, Close looks messy, yet after the user has saved the data should they really click a Cancel button?\nI need the 'Save' button to leave the form open.\nWhat is best practice?\nThanks\n"
},
{
"from": "gpt",
"value": "When designing a user in... |
I know I can add a icon to the Resources.resx file of a project and then reference that icon from within the code.
How do I set the icon of the entire EXE from the resources? All I see is a place to browse for another file. I want to use the current icon file that I have in my resources and not have to have a duplicate... | To set the icon of your entire executable (EXE) from a resource file (like `Resources.resx`) in a .NET project, you can't directly use the icon stored in `Resources.resx`. Instead, you need to extract the icon from the resources and specify it in your project properties. However, you can achieve this without keeping a ... | 24,569 | [
{
"from": "human",
"value": "I know I can add a icon to the Resources.resx file of a project and then reference that icon from within the code.\nHow do I set the icon of the entire EXE from the resources? All I see is a place to browse for another file. I want to use the current icon file that I have in my ... |
I would like to know how to filter files in a open file dialog (in winforms)
based on a regular expression. Files have all same extensions (.xml).
Big files are split up into several files with the same name only to be separated with _1 ...
We only want to show the files without _1 (first data file)
the open file dial... | In a WinForms application, the `OpenFileDialog` control does not support filtering files using regular expressions directly. However, you can work around this limitation by using the `FileDialog.FileOk` event to manually filter the files based on your criteria after the user selects them.
Here’s a simple way to achie... | 16,836 | [
{
"from": "human",
"value": "I would like to know how to filter files in a open file dialog (in winforms)\nbased on a regular expression. Files have all same extensions (.xml). \nBig files are split up into several files with the same name only to be separated with _1 ...\nWe only want to show the files wit... |
I have a complex command that I'd like to make a shell/bash script of. I can write it in terms of $1 easily:
foo $1 args -o $1.ext
I want to be able to pass multiple input names to the script. What's the right way to do it?
And, of course, I want to handle filenames with spaces in them.
| You can write a Bash script that accepts multiple filenames as arguments by using a loop to iterate over each argument. To handle filenames with spaces, you should enclose the variable in double quotes. Here’s a simple example of how you could structure your script:
```bash
#!/bin/bash
# Check if at least one argumen... | 27,230 | [
{
"from": "human",
"value": "I have a complex command that I'd like to make a shell/bash script of. I can write it in terms of $1 easily:\nfoo $1 args -o $1.ext\n\nI want to be able to pass multiple input names to the script. What's the right way to do it? \nAnd, of course, I want to handle filenames with... |
I have stfw but I cannot find a simple / standalone way to create a webservice client in java.
Does anyone have a link/sample into this?
| Creating a simple web service client in Java can be achieved using various libraries and frameworks. A popular choice for making RESTful web service clients is to use the `HttpURLConnection` class, or a more modern approach would be to use libraries such as Apache HttpClient or the Spring RestTemplate.
Here's a basic ... | 21,244 | [
{
"from": "human",
"value": "I have stfw but I cannot find a simple / standalone way to create a webservice client in java.\nDoes anyone have a link/sample into this?\n"
},
{
"from": "gpt",
"value": "Creating a simple web service client in Java can be achieved using various libraries and frame... |
I am tryiing to create an "add to cart" button for each item that is displayed by an XSLT file. The button must be run at server (VB) and I need to pass parameters into the onlick, so that the requested item is added to the cart. Is this possible, and if so, how should I go about it?
When I try
<asp:Button id="Button12... | Creating a server-side "Add to Cart" button using XSLT can be somewhat challenging, as XSLT is primarily used for transforming XML data into HTML and does not directly handle server-side controls like ASP.NET. However, it is possible to achieve your goal by combining XSLT for rendering the HTML with ASP.NET for handlin... | 18,824 | [
{
"from": "human",
"value": "I am tryiing to create an \"add to cart\" button for each item that is displayed by an XSLT file. The button must be run at server (VB) and I need to pass parameters into the onlick, so that the requested item is added to the cart. Is this possible, and if so, how should I go ab... |
Google results on this one are a bit thin, but suggest that it is not easily possible.
My specific problem is that I need to renumber the IDs in two tables that are related to each other such that table B has an "table_a_id" column in it. I can't renumber table A first because then its children in B point to the old ID... | In PostgreSQL, it is indeed possible to temporarily disable referential integrity checks, allowing you to renumber IDs in a way that avoids the issues you've outlined. However, PostgreSQL does not directly support the disabling of foreign key constraints for a transaction in the same way that some other database manage... | 16,168 | [
{
"from": "human",
"value": "Google results on this one are a bit thin, but suggest that it is not easily possible.\nMy specific problem is that I need to renumber the IDs in two tables that are related to each other such that table B has an \"table_a_id\" column in it. I can't renumber table A first becaus... |
In visual studio, I have an asp.net 3.5 project that is using MS Enterprise Library 4.0 application blocks.
When I have my web config file open, my Error list fills up with 99 messages with things like
Could not find schema information for the element 'dataConfiguration'.
Could not find schema information for the a... | The issue you're facing is due to the absence of the corresponding XSD schema files for the Enterprise Library configuration sections in your `Web.config`. Visual Studio tries to validate the XML structure of the configuration file against these schemas, and since they cannot be found, it results in the errors you're s... | 22,579 | [
{
"from": "human",
"value": "In visual studio, I have an asp.net 3.5 project that is using MS Enterprise Library 4.0 application blocks. \nWhen I have my web config file open, my Error list fills up with 99 messages with things like \nCould not find schema information for the element 'dataConfiguration'. \... |
I need a way to do key-value lookups across (potentially) hundreds of GB of data. Ideally something based on a distributed hashtable, that works nicely with Java. It should be fault-tolerant, and open source.
The store should be persistent, but would ideally cache data in memory to speed things up.
It should be able ... | For your requirements of a distributed, fault-tolerant, open-source key-value store that supports Java and is optimized for concurrent reads and writes, you might consider the following options:
1. **Apache Ignite**:
- **Description**: Ignite is an in-memory computing platform that includes a distributed key-value ... | 20,986 | [
{
"from": "human",
"value": "I need a way to do key-value lookups across (potentially) hundreds of GB of data. Ideally something based on a distributed hashtable, that works nicely with Java. It should be fault-tolerant, and open source.\nThe store should be persistent, but would ideally cache data in mem... |
I would like to know if I can install say Visual Studio 2008 Pro and Visual Studio 2008 standard on the same machine. I have tried to install the pro (trial edition available on MSDN) after the express, and it seems to require them to be installed in the same directory. Is this specific to the express edition ?
The rea... | You should be able to install both Visual Studio 2008 Professional and Visual Studio 2008 Standard on the same machine. However, both of these versions typically require that they be installed in different directories, which is a common requirement for the non-Express versions of Visual Studio to avoid conflicts.
In y... | 28,886 | [
{
"from": "human",
"value": "I would like to know if I can install say Visual Studio 2008 Pro and Visual Studio 2008 standard on the same machine. I have tried to install the pro (trial edition available on MSDN) after the express, and it seems to require them to be installed in the same directory. Is this ... |
I often need to design a dialog in Delphi/C++Builder that allows various properties of an object to be modified, and the code to use it typically looks like this.
Dialog.Edit1.Text := MyObject.Username;
Dialog.Edit2.Text := MyObject.Password;
// ... many more of the same
if (Dialog.ShowModal = mrOk)
begin
MyObject.... | Yes, there are several techniques and idioms that can help you avoid repetitive code when working with property modification dialogs in Delphi/C++Builder. Here are a few approaches you can consider:
### 1. Use a Mapping Method
You can create a mapping method that takes care of transferring data between the dialog con... | 22,079 | [
{
"from": "human",
"value": "I often need to design a dialog in Delphi/C++Builder that allows various properties of an object to be modified, and the code to use it typically looks like this.\nDialog.Edit1.Text := MyObject.Username;\nDialog.Edit2.Text := MyObject.Password;\n// ... many more of the same\n\ni... |
Is there a .NET equivalent of Java Web Start?
I want a one-click, from the web, lightweight install for a group of .NET assemblies and resources. Hopefully, the link would continue to keep the user updated with the latest version, similar to what Java Web Start does.
The application is written in F#, for what it's wor... | While there isn't a direct equivalent of Java Web Start for .NET, there are several ways you can achieve similar functionality for deploying and updating .NET applications. Here are a few approaches you might consider:
1. **ClickOnce Deployment**:
- **Overview**: ClickOnce is a Microsoft technology that allows you ... | 25,959 | [
{
"from": "human",
"value": "Is there a .NET equivalent of Java Web Start?\nI want a one-click, from the web, lightweight install for a group of .NET assemblies and resources. Hopefully, the link would continue to keep the user updated with the latest version, similar to what Java Web Start does. \nThe appl... |
Basically I need a hosted solution, where one can create an account for a project and the distributed team members can interact through that site during the project implementation. I know a lot of such software but not a hosted one.
| If you're looking for a hosted solution that enables project collaboration for distributed teams, there are several options that cater to various needs. Here are some popular hosted platforms that allow team members to interact and collaborate effectively during project implementation:
1. **Trello**:
- Trello is a ... | 26,397 | [
{
"from": "human",
"value": "Basically I need a hosted solution, where one can create an account for a project and the distributed team members can interact through that site during the project implementation. I know a lot of such software but not a hosted one.\n"
},
{
"from": "gpt",
"value": "I... |
is there any good Ruby audio libraries that we can build upon?
Need to manage/edit mp3 files!!!
| Yes, there are several Ruby libraries available for handling audio files, including MP3s. Here are a few notable ones:
1. **ruby-mp3info**:
- This library allows you to read and write ID3 tags in MP3 files. It can help you manage metadata associated with MP3 files.
- GitHub: [ruby-mp3info](https://github.com/djm... | 25,924 | [
{
"from": "human",
"value": "is there any good Ruby audio libraries that we can build upon?\nNeed to manage/edit mp3 files!!!\n"
},
{
"from": "gpt",
"value": "Yes, there are several Ruby libraries available for handling audio files, including MP3s. Here are a few notable ones:\n\n1. **ruby-mp3in... |
A recent article on Ars Technica discusses a recent study performed by the Psychology Department of North Carolina State University, that showed users have a tendency to do whatever it takes to get rid of a dialog box to get back to their task at hand. Most of them would click OK or yes, minimize the dialog, or close ... | Understanding that users often rush to dismiss dialog boxes without fully reading the content is crucial for designing user interfaces. This behavior can have significant implications for how we present critical information and actions in our applications. Here are some design considerations and strategies to mitigate ... | 25,104 | [
{
"from": "human",
"value": "A recent article on Ars Technica discusses a recent study performed by the Psychology Department of North Carolina State University, that showed users have a tendency to do whatever it takes to get rid of a dialog box to get back to their task at hand. Most of them would click ... |
I want to do something like this:
SQL.Text := Format('select foo from bar where baz like ''%s%''',[SearchTerm]);
But Format doesn't like that last '%', of course. So how can I escape it? \%? %%?
Or do I have to do this:
SQL.Text := Format('select foo from bar where baz like ''%s''',[SearchTerm+'%']);
?
| In your SQL query, when using the `Format` function in Delphi (or similar languages), you need to escape the percent signs properly so that they are treated as literal percent signs in the resulting string.
In this case, the percent sign is part of the SQL LIKE pattern, and you cannot escape it using backslashes like ... | 30,430 | [
{
"from": "human",
"value": "I want to do something like this:\nSQL.Text := Format('select foo from bar where baz like ''%s%''',[SearchTerm]);\n\nBut Format doesn't like that last '%', of course. So how can I escape it? \\%? %%? \nOr do I have to do this:\nSQL.Text := Format('select foo from bar where baz l... |
.Net's implementation of HTTP is ... problematic. Beyond some issues in compliance with HTTP/1.0, what's bugging me right now is that HttpWebResponse.GetResponse() with ReadTimeout and Timeout set to 5000 blocks for about 20 seconds before failing (the problem is it should fail after 5 seconds, but it actually takes 20... | If you're experiencing issues with .NET's `HttpWebRequest` and `HttpWebResponse`, and you're looking for a more reliable library with better protocol conformance and timeout control, here are a few options you might consider:
1. **HttpClient (System.Net.Http)**:
- If you're not already using `HttpClient`, consider ... | 20,983 | [
{
"from": "human",
"value": ".Net's implementation of HTTP is ... problematic. Beyond some issues in compliance with HTTP/1.0, what's bugging me right now is that HttpWebResponse.GetResponse() with ReadTimeout and Timeout set to 5000 blocks for about 20 seconds before failing (the problem is it should fail ... |
I currently have a functioning in-house Windows Forms application which extensively uses the DataGridView control for data entry. There are some support issues which are expected when we roll this out to more locations, so one of our consultants has recommended putting together an AJAX application with substantially th... | Transitioning from WinForms to an AJAX-based web application can be a significant shift, especially when it comes to understanding the web-based architecture and event-driven programming. However, since you have experience with C#, you'll find that many of the language principles carry over, and you can leverage that k... | 19,457 | [
{
"from": "human",
"value": "I currently have a functioning in-house Windows Forms application which extensively uses the DataGridView control for data entry. There are some support issues which are expected when we roll this out to more locations, so one of our consultants has recommended putting together ... |
Is there a way to Deserialize Expressions in C#, I would like to store Expressions in a Database and load them at run time.
| Deserializing expressions in C# can be tricky because the `Expression` trees are not easily serializable due to their complex structure. However, there are several approaches you can take to store and deserialize expression trees.
### 1. Using Expression Serialization Libraries
One of the easiest ways to serialize an... | 24,048 | [
{
"from": "human",
"value": "Is there a way to Deserialize Expressions in C#, I would like to store Expressions in a Database and load them at run time.\n"
},
{
"from": "gpt",
"value": "Deserializing expressions in C# can be tricky because the `Expression` trees are not easily serializable due t... |
Does anyone know of a better GUI client for displaying Windows System Monitor log files? (System Monitor is sometimes called Performance Monitor.) I'm trying to track a long-term memory leak in a C# application running on Windows XP or 2K3 by comparing memory usages to run logs.
Specifically I want a client that will a... | There are a few options for analyzing Windows Performance Monitor (System Monitor) log files that may provide the functionality you’re looking for. While the native tool has its limitations, third-party tools and some Microsoft tools can offer enhanced capabilities. Here are some recommendations:
1. **Performance Anal... | 24,545 | [
{
"from": "human",
"value": "Does anyone know of a better GUI client for displaying Windows System Monitor log files? (System Monitor is sometimes called Performance Monitor.) I'm trying to track a long-term memory leak in a C# application running on Windows XP or 2K3 by comparing memory usages to run logs.... |
I'm new to Spring Security. How do I add an event listener which will be called as a user logs in successfully? Also I need to get some kind of unique session ID in this listener which should be available further on. I need this ID to synchronize with another server.
| In Spring Security, you can add an event listener for successful logins by using the `AuthenticationSuccessHandler` interface or by registering an event listener that listens for `AuthenticationSuccessEvent`. In this case, we'll focus on using the event listener approach because it can be easier to manage and extend.
... | 21,346 | [
{
"from": "human",
"value": "I'm new to Spring Security. How do I add an event listener which will be called as a user logs in successfully? Also I need to get some kind of unique session ID in this listener which should be available further on. I need this ID to synchronize with another server.\n"
},
{... |
Lucene is an excellent search engine, but the .NET version is behind the official Java release (latest stable .NET release is 2.0, but the latest Java Lucene version is 2.4, which has more features).
How do you get around this?
| To work with the differences in versions between Lucene for .NET and the official Java release, you have a few options to consider:
1. **Switch to Lucene.Net**: If you want to use features from a more recent version of Lucene, consider moving to Lucene.Net, which is an actively maintained .NET port of the original Luc... | 25,935 | [
{
"from": "human",
"value": "Lucene is an excellent search engine, but the .NET version is behind the official Java release (latest stable .NET release is 2.0, but the latest Java Lucene version is 2.4, which has more features).\nHow do you get around this?\n"
},
{
"from": "gpt",
"value": "To wo... |
When using webforms the appropriate place to assign master pages to a page dynamically seems to be the pages PreInit event:
this.Master.MasterPageFile = "~/leaf.Master"
If nessasary, master pages in a hierarchy of nested master pages may be set here too:
this.Master.MasterPageFile = "~/leaf.Master"
this.Master.Master... | In ASP.NET MVC, handling multiple levels of master pages (also known as layout pages in MVC) is a bit different compared to WebForms. However, you can achieve dynamic selection of layout pages using a combination of custom logic in your controllers and Razor view engine capabilities.
### Setup of Layouts
In your MVC ... | 24,390 | [
{
"from": "human",
"value": "When using webforms the appropriate place to assign master pages to a page dynamically seems to be the pages PreInit event: \nthis.Master.MasterPageFile = \"~/leaf.Master\"\n\nIf nessasary, master pages in a hierarchy of nested master pages may be set here too:\nthis.Master.Mast... |
Is there an easy way to have the form helpers set the tabindex parameter automatically when using form helpers in Rails?
Basically, I don't want to have to manually set the tab index on every form element when building forms (I keep forgetting to update them when I change things). The majority of the forms I write are... | You can achieve automatic `tabindex` management in your Rails forms by extending the form helpers. The idea is to create a custom form builder that automatically assigns a `tabindex` to each form element based on the order they are defined.
Here's how you can implement this:
1. **Create a Custom Form Builder**:
Fi... | 24,530 | [
{
"from": "human",
"value": "Is there an easy way to have the form helpers set the tabindex parameter automatically when using form helpers in Rails?\nBasically, I don't want to have to manually set the tab index on every form element when building forms (I keep forgetting to update them when I change thing... |
If you are using ASP.NET MVC how are you doing grid display?
Rolled your own?
Got a library from somewhere?
These are some of the known grid display solutions I have found for ASP.NET MVC
ASP.NET MVC Flexgrid - Has nice column layout method
Code based ASP.NET MVC GridView - simple, small, clean
MVC Contrib - grid f... | There are many options available for grid display in ASP.NET MVC, and the choice largely depends on your project requirements, personal preference, and the level of functionality you need. Below is a summary of some popular libraries and frameworks, along with a few additional options you might find useful:
### Popula... | 25,064 | [
{
"from": "human",
"value": "If you are using ASP.NET MVC how are you doing grid display?\nRolled your own?\nGot a library from somewhere?\nThese are some of the known grid display solutions I have found for ASP.NET MVC\n\nASP.NET MVC Flexgrid - Has nice column layout method\nCode based ASP.NET MVC GridV... |
How do you prepare your SQL deltas? do you manually save each schema-changing SQL to a delta folder, or do you have some kind of an automated diffing process?
I am interested in conventions for versioning database schema along with the source code. Perhaps a pre-commit hook that diffs the schema?
Also, what options for... | Creating and managing SQL deltas (or migration scripts) is a crucial part of versioning your database schema, especially when you want to keep it in sync with your source code. Here's an overview of how to prepare your SQL deltas, automate their creation, and some conventions that may help.
### Manual vs Automated Del... | 23,503 | [
{
"from": "human",
"value": "How do you prepare your SQL deltas? do you manually save each schema-changing SQL to a delta folder, or do you have some kind of an automated diffing process?\nI am interested in conventions for versioning database schema along with the source code. Perhaps a pre-commit hook tha... |
I'm having trouble selecting elements that are part of an specific namespace. My xpath expression works in XMLSpy but fails when using the Xalan libraries..
<item>
<media:content attrb="xyz">
<dcterms:valid>VALUE</dcterms:valid>
</media:content>
</item>
My expression is ./item/media:content/dcterms:valid. ... | When working with XPath expressions that involve namespaces, it's essential to ensure that the namespace prefixes used in your XPath expression match the namespaces defined in your XSLT. Since you mentioned that you're using Xalan and have already added the namespace definitions to your XSLT, here are some potential is... | 22,264 | [
{
"from": "human",
"value": "I'm having trouble selecting elements that are part of an specific namespace. My xpath expression works in XMLSpy but fails when using the Xalan libraries..\n<item>\n <media:content attrb=\"xyz\">\n <dcterms:valid>VALUE</dcterms:valid>\n </media:content>\n</item>\n\nMy e... |
Let me start by saying I'm a huge fan of the elegance of this pattern -- I have a group of basic entities that I have implemented builders for (specifically for testing). However I have found (and this may be the caveat) that as my program evolved I kept having to go back and re-work the builders. In the end, it real... | It's great to hear that you've found value in the builder pattern for your testing needs, but it's also understandable that maintaining builders can become cumbersome as your application evolves. The choice between using builders and an object mother (or factory) largely depends on the specific context of your applicat... | 27,038 | [
{
"from": "human",
"value": "Let me start by saying I'm a huge fan of the elegance of this pattern -- I have a group of basic entities that I have implemented builders for (specifically for testing). However I have found (and this may be the caveat) that as my program evolved I kept having to go back and r... |
I have compression enabled within IIS7 and it works as expected on all responses except for those constructed by ASP.NET AJAX. I have a web service that provides data to the client. When the web service is called directly, it is properly compressed. However, when it is called via ASP.NET AJAX, the JSON response is n... | To enable GZip compression for JSON responses sent via ASP.NET AJAX in IIS7, you'll need to ensure a few things are configured correctly:
1. **Ensure IIS Compression is Enabled**: You've mentioned that compression is already working for other responses, but just to double-check, make sure that both static and dynamic ... | 25,137 | [
{
"from": "human",
"value": "I have compression enabled within IIS7 and it works as expected on all responses except for those constructed by ASP.NET AJAX. I have a web service that provides data to the client. When the web service is called directly, it is properly compressed. However, when it is called... |
I've got an ASP.NET 2.0 website with a custom 404 page. When content is not found the site serves the custom 404 page with a query string addition of aspxerrorpath=/mauro.aspx. The 404 page itself is served with an HTTP status of 200. To try to resolve this I've added
protected void Page_Load(object sender, EventAr... | You have a couple of different issues to address. Let's tackle them one at a time:
### Issue 1: Custom 404 Page with Correct HTTP Status Code
To properly serve your custom 404 page with an HTTP status code of 404 while preserving the original requested URL, you can use the `HttpContext` in the `Application_BeginReque... | 22,133 | [
{
"from": "human",
"value": "I've got an ASP.NET 2.0 website with a custom 404 page. When content is not found the site serves the custom 404 page with a query string addition of aspxerrorpath=/mauro.aspx. The 404 page itself is served with an HTTP status of 200. To try to resolve this I've added\n prote... |
I want to load up a window using the java swing, something like this
However I want to be able to use it for text input also not just to dump data into it..
any idea how to do it?
| Certainly! If you want to create a Java Swing window that allows for both displaying data and accepting text input, you can use components like `JTextArea` or `JTextField` depending on your requirements.
### Example using `JTextArea` for multi-line input:
Here's an example of a simple Swing application that creates ... | 23,860 | [
{
"from": "human",
"value": "I want to load up a window using the java swing, something like this\nHowever I want to be able to use it for text input also not just to dump data into it..\nany idea how to do it?\n"
},
{
"from": "gpt",
"value": "Certainly! If you want to create a Java Swing window... |
I need to use NSImage which appears need to be imported from <AppKit/AppKit.h>. I have included the AppKit framework, and I do see AppKit.h there. But I am still getting compilation error saying <AppKit/AppKit.h> not found.
What I might missed ?
Thanks.
| If you're encountering a compilation error indicating that `<AppKit/AppKit.h>` is not found, there could be a few reasons for this. Here are some steps you can follow to troubleshoot and resolve the issue:
1. **Check Your Target**:
- Ensure that your project is targeting macOS. The AppKit framework is specific to m... | 26,701 | [
{
"from": "human",
"value": "I need to use NSImage which appears need to be imported from <AppKit/AppKit.h>. I have included the AppKit framework, and I do see AppKit.h there. But I am still getting compilation error saying <AppKit/AppKit.h> not found.\nWhat I might missed ?\nThanks.\n"
},
{
"from":... |
In ASP.NET MVC, you can mark up a controller method with AuthorizeAttribute, like this:
[Authorize(Roles = "CanDeleteTags")]
public void Delete(string tagName)
{
// ...
}
This means that, if the currently logged-in user is not in the "CanDeleteTags" role, the controller method will never be called.
Unfortunately, ... | You're correct in identifying that the default behavior of the `AuthorizeAttribute` in ASP.NET MVC can be a bit confusing when dealing with authorization failures for logged-in users. By default, when a user is authenticated but does not have the required role, they receive a 401 Unauthorized status, which triggers the... | 24,267 | [
{
"from": "human",
"value": "In ASP.NET MVC, you can mark up a controller method with AuthorizeAttribute, like this:\n[Authorize(Roles = \"CanDeleteTags\")]\npublic void Delete(string tagName)\n{\n // ...\n}\n\nThis means that, if the currently logged-in user is not in the \"CanDeleteTags\" role, the con... |
Oracle Forms10g provides a tool to convert the Oracle Forms modules, from the binary format (.FMB) that Oracle Forms Builder works with, to text format (.FMT).
For example, if you create a module called mymodule.fmb with Oracle Forms Builder, and then invoke
frmcmp module=mymodule.fmb script=yes batch=yes logon=no
fro... | Decoding the codified PL/SQL code from Oracle Forms `.FMT` files is not straightforward, as it involves understanding the specific encoding used by Oracle Forms. The encoded PL/SQL segments are typically transformed into a binary format that is not directly human-readable.
While Oracle does not provide an official too... | 23,952 | [
{
"from": "human",
"value": "Oracle Forms10g provides a tool to convert the Oracle Forms modules, from the binary format (.FMB) that Oracle Forms Builder works with, to text format (.FMT).\nFor example, if you create a module called mymodule.fmb with Oracle Forms Builder, and then invoke\nfrmcmp module=mymo... |
I'm using $.post() to call a servlet using Ajax and then using the resulting HTML fragment to replace a div element in the user's current page. However, if the session times out, the server sends a redirect directive to send the user to the login page. In this case, jQuery is replacing the div element with the contents... | When using Ajax calls, especially with jQuery, handling session timeouts and redirects properly can be challenging. In your case, when the session times out, instead of directly replacing the content of the div with the HTML of the login page, you want to intercept that response and handle it appropriately.
Here’s how... | 26,279 | [
{
"from": "human",
"value": "I'm using $.post() to call a servlet using Ajax and then using the resulting HTML fragment to replace a div element in the user's current page. However, if the session times out, the server sends a redirect directive to send the user to the login page. In this case, jQuery is re... |
In my Windows XP Task Manager, some processes display a higher value in the Mem Usage column than the VMSize. My Firefox instance, for example shows 111544 K as mem usage and 100576 K as VMSize.
According to the help file of Task Manager Mem Usage is the working set of the process and VMSize is the committed memory in... | Your understanding of the memory metrics in Windows Task Manager is mostly correct, but there are some nuances that can explain the behavior you're observing.
1. **VMSize (Virtual Memory Size):** This represents the total amount of virtual memory that the process has committed. This includes both the physical memory t... | 26,411 | [
{
"from": "human",
"value": "In my Windows XP Task Manager, some processes display a higher value in the Mem Usage column than the VMSize. My Firefox instance, for example shows 111544 K as mem usage and 100576 K as VMSize. \nAccording to the help file of Task Manager Mem Usage is the working set of the pro... |
I heard somewhere that you can drop down to C++ directly inside C# code.
How is this done? Or did I hear wrong?
Note: I do not mean C++ / CLI.
| What you might be referring to is the ability to use C++ code from within C# code through a process called P/Invoke (Platform Invocation Services). This allows managed code (like C#) to call unmanaged code (like C or C++) libraries (DLLs).
Here's how it can be done:
### Steps to Call C++ Code from C#
1. **Create a ... | 24,807 | [
{
"from": "human",
"value": "I heard somewhere that you can drop down to C++ directly inside C# code. \nHow is this done? Or did I hear wrong?\nNote: I do not mean C++ / CLI.\n"
},
{
"from": "gpt",
"value": "What you might be referring to is the ability to use C++ code from within C# code throu... |
So, maybe I'm a bit old-school, but when we created websites in the past, we'd develop the site on a development server, then publish or promote the pages and files to the production server. This has always seemed to be a good way to go so that users didn't see messed up pages or (God forbid) a downed server because o... | Hi Dan,
You've raised some important points regarding SharePoint's management strategy and the challenges of developing and deploying features, particularly around content types and columns. Let's dive into your concerns step by step.
### 1. **Development and Production Environment Strategy**
You're right about the t... | 24,138 | [
{
"from": "human",
"value": "So, maybe I'm a bit old-school, but when we created websites in the past, we'd develop the site on a development server, then publish or promote the pages and files to the production server. This has always seemed to be a good way to go so that users didn't see messed up pages ... |
I currently use Notepad++ for most of my development. I have been checking out other, more full-featured options and would like to switch (I'm in particular a fan of Aptana so far) but there is one thing about Notepad++ that I really like and I haven't been able to get so far.
My current workflow is something like t... | It sounds like you're looking for a way to manage your development workflow more effectively while transitioning from Notepad++ to Aptana. Here are a few suggestions to help you streamline your process:
### Setting Up Automatic File Management in Aptana
1. **Workspace Configuration**:
- Make sure your Aptana works... | 25,961 | [
{
"from": "human",
"value": "I currently use Notepad++ for most of my development. I have been checking out other, more full-featured options and would like to switch (I'm in particular a fan of Aptana so far) but there is one thing about Notepad++ that I really like and I haven't been able to get so far. ... |
Is there a nice way to dependency inject using a jsp taglib?
either using ejb 3.0, spring, or guice...
I have a lot of services/pojos that I would like to use in my taglibs
| Dependency injection in JSP tag libraries can be accomplished through various means, such as using Java EE (EJB), Spring, or Guice. Below, I'll outline a few approaches for each framework that can help you achieve dependency injection in a taglib.
### 1. Using Spring
Spring provides robust support for dependency inje... | 22,019 | [
{
"from": "human",
"value": "Is there a nice way to dependency inject using a jsp taglib?\neither using ejb 3.0, spring, or guice...\nI have a lot of services/pojos that I would like to use in my taglibs\n"
},
{
"from": "gpt",
"value": "Dependency injection in JSP tag libraries can be accomplish... |
I've been writing a little application that will let people upload & download files to me. I've added a web service to this applciation to provide the upload/download functionality that way but I'm not too sure on how well my implementation is going to cope with large files.
At the moment the definitions of the upload... | You're correct that using a byte array to handle file uploads and downloads can lead to memory issues, especially with large files. Instead, using streams is a better approach for handling file transfers in a web service context. Apache CXF, like many other frameworks, supports streaming file uploads and downloads whic... | 23,428 | [
{
"from": "human",
"value": "I've been writing a little application that will let people upload & download files to me. I've added a web service to this applciation to provide the upload/download functionality that way but I'm not too sure on how well my implementation is going to cope with large files.\nA... |
How can I implement a diff function, such as Stack Overflow's question revision history?
| Implementing a diff function similar to that used in platforms like Stack Overflow for displaying revision histories involves several key components. Below is a high-level overview and some implementation details to help you create such a feature.
### Key Components
1. **Data Storage**: You need a way to store revisi... | 25,670 | [
{
"from": "human",
"value": "How can I implement a diff function, such as Stack Overflow's question revision history?\n"
},
{
"from": "gpt",
"value": "Implementing a diff function similar to that used in platforms like Stack Overflow for displaying revision histories involves several key compone... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.