instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Well, after a long time writing .net programs in C# I started to feel angry and frustrated about all that syntactic trash that comes with statically typed languages. Now I want to change to dynamically typed languages, that takes advantage of CLI.
So I searched a bit around and I didn't like of what I saw. I first look... | It sounds like you’re exploring the landscape of dynamic languages that run on the Common Language Infrastructure (CLI) and are feeling a bit frustrated with the options available. Given your experience and the points you've raised, I can offer some insights into your choices.
### IronPython
While you have reservation... | 16,125 | [
{
"from": "human",
"value": "Well, after a long time writing .net programs in C# I started to feel angry and frustrated about all that syntactic trash that comes with statically typed languages. Now I want to change to dynamically typed languages, that takes advantage of CLI.\nSo I searched a bit around and... |
We have our domain model declared in rusty old hbm files, we wish to move to POJOs annotated with the javax.persistence.* annotations.
Has anyone had experience doing so?
Are there tools that we could employ?
| Migrating from Hibernate Mapping files (HBM) to POJOs annotated with JPA annotations (`javax.persistence.*`) is a common task, and several tools and strategies can help facilitate this transition. Here’s a guide on how to approach this migration, including available tools and best practices:
### Steps for Migration
1... | 12,497 | [
{
"from": "human",
"value": "We have our domain model declared in rusty old hbm files, we wish to move to POJOs annotated with the javax.persistence.* annotations.\nHas anyone had experience doing so? \nAre there tools that we could employ?\n"
},
{
"from": "gpt",
"value": "Migrating from Hiber... |
I have a big string (let's call it a CSV file, though it isn't actually one, it'll just be easier for now) that I have to parse in C# code.
The first step of the parsing process splits the file into individual lines by just using a StreamReader object and calling ReadLine until it's through the file. However, any given... | You can indeed use regular expressions (Regex) to handle the parsing of your CSV-like string, especially when dealing with embedded newlines within quoted strings. Here’s a structured approach to achieve your goal using Regex in C#.
### Step 1: Read the File
You will start by reading the file line by line using a `Str... | 6,150 | [
{
"from": "human",
"value": "I have a big string (let's call it a CSV file, though it isn't actually one, it'll just be easier for now) that I have to parse in C# code.\nThe first step of the parsing process splits the file into individual lines by just using a StreamReader object and calling ReadLine until... |
I would like to confirm that the following analysis is correct:
I am building a web app in RoR. I have a data structure for my postgres db designed (around 70 tables; this design may need changes and additions during development to reflect Rails ways of doing things. EG, I designed some user and role tables - but if it... | Your analysis presents a thoughtful approach to the use of databases and migrations in a Ruby on Rails (RoR) application. Let’s evaluate each of your propositions based on your assertions and the practices surrounding Rails and Postgres.
### Proposition 1:
**If I replace the script and sql files with Migrations, it is... | 13,592 | [
{
"from": "human",
"value": "I would like to confirm that the following analysis is correct:\nI am building a web app in RoR. I have a data structure for my postgres db designed (around 70 tables; this design may need changes and additions during development to reflect Rails ways of doing things. EG, I desi... |
So I have logical entities (person, country, etc.), GUI elements / controls, data and navigation controllers / managers, then things like quad-trees and timers, and I always struggle with cleanly separating these things into logical namespaces.
I usually have something like this:
Leviathan.GUI.Controls
Leviathan.GUI.V... | Organizing code into logical namespaces is crucial for maintainability, readability, and scalability, especially in larger projects. Below are some strategies and guidelines to help you achieve better separation and organization of your code:
### 1. **Define Clear Responsibilities**
- Each namespace or module shoul... | 13,776 | [
{
"from": "human",
"value": "So I have logical entities (person, country, etc.), GUI elements / controls, data and navigation controllers / managers, then things like quad-trees and timers, and I always struggle with cleanly separating these things into logical namespaces.\nI usually have something like thi... |
Is there a tool or programmatic way to install an SSL certificate to the default website in IIS 6 and 7? Ideally I am looking for something that can be done via unmanaged code or .NET managed code.
| Yes, you can programmatically install an SSL certificate for the default website in IIS 6 and IIS 7 using various methods. Below are the approaches you can take for each version of IIS.
### IIS 6
To manage SSL certificates in IIS 6, you can use the `ADS` (Active Directory Services) interfaces or script using VBScript... | 9,953 | [
{
"from": "human",
"value": "Is there a tool or programmatic way to install an SSL certificate to the default website in IIS 6 and 7? Ideally I am looking for something that can be done via unmanaged code or .NET managed code.\n"
},
{
"from": "gpt",
"value": "Yes, you can programmatically insta... |
First let me say that I really feel directionless on this question. I am using windows integrated security, and I can use vb.net to look up information about a user from AD. I also have other information about users I can look up from a MS SQL 2005 server by getting the logon identity name.
What I would like to do is d... | Building a feature that tracks active users on a webpage can indeed be challenging, especially with the limitations you've encountered using AJAX polling. Here’s a strategy that might help you achieve your goal more reliably:
### Using WebSockets for Real-Time Updates
Instead of relying on AJAX polling, consider usin... | 9,144 | [
{
"from": "human",
"value": "First let me say that I really feel directionless on this question. I am using windows integrated security, and I can use vb.net to look up information about a user from AD. I also have other information about users I can look up from a MS SQL 2005 server by getting the logon id... |
I was asked to make some drools traning for my teammates. Just to show them how it can be used and how usefull it may be. To do this training I first have to learn Drools, and I figured that the best way to learn it will be small project centered around drools.
Any interesting ideas?
My idea for this project was to d... | That's a great initiative! Drools is a powerful rules engine that can help automate decision-making processes. Your idea of using it for webMethods flow files validation is a solid start, but if you're looking for something that does more work while still being educational, here are a few project ideas you might consid... | 11,091 | [
{
"from": "human",
"value": "I was asked to make some drools traning for my teammates. Just to show them how it can be used and how usefull it may be. To do this training I first have to learn Drools, and I figured that the best way to learn it will be small project centered around drools. \nAny interesting... |
I am a .NET webdev using ASP.NET, C# etc... I "learned" javascript in college 5+ years ago and can do basic jobs with it. But I wonder if it is useful to become proficient in it.
Why should I learn Javascript?
Is it more advantageous then learning JQuery or a different library?
| Learning JavaScript can be extremely beneficial, especially for a .NET web developer. Here are several reasons why you should consider becoming more proficient in JavaScript:
### 1. **Core Technology for Web Development**
JavaScript is one of the three core technologies of the web, alongside HTML and CSS. Understandin... | 12,620 | [
{
"from": "human",
"value": "I am a .NET webdev using ASP.NET, C# etc... I \"learned\" javascript in college 5+ years ago and can do basic jobs with it. But I wonder if it is useful to become proficient in it.\nWhy should I learn Javascript?\nIs it more advantageous then learning JQuery or a different libra... |
Has anyone implements Subversion with Siteminder as authentication provider ? If yes, would it be possible to provide an overview of how the whole setup is done ?
Since I am using only HTTP authentication, I think it would be easier to integrate with SM, but I am not able to find much help on this on the net.
Is there ... | Yes, it is possible to implement Subversion (SVN) with CA SSO (formerly known as SiteMinder) as an authentication provider. The integration primarily relies on configuring Apache HTTP Server with mod_auth_sso to handle the authentication through SiteMinder. Below is an overview of how the setup can be done along with p... | 10,137 | [
{
"from": "human",
"value": "Has anyone implements Subversion with Siteminder as authentication provider ? If yes, would it be possible to provide an overview of how the whole setup is done ?\nSince I am using only HTTP authentication, I think it would be easier to integrate with SM, but I am not able to fi... |
I am trying to create a table with the following:
CREATE TABLE GTW_WORKFLOW_MON
(
WORKFLOW_NAME VARCHAR(255) NOT NULL,
WORKFLOW_LOADED NUMERIC(20) NOT NULL,
ACTIVITY_NAME VARCHAR(255) NOT NULL,
FLAGS INTEGER NOT NULL,
MONITOR_NAME VARCHAR(255) NOT NULL,
CLASSNAME VARCHAR(255) NOT NULL,
ST... | The error you are encountering regarding "column length not being large enough" may not be explicitly due to the lengths defined in your `CREATE TABLE` statement. However, there are a few considerations to ensure that the table creation does not fail:
1. **Data Type Size**: You might be running into issues with the ma... | 15,520 | [
{
"from": "human",
"value": "I am trying to create a table with the following:\nCREATE TABLE GTW_WORKFLOW_MON \n(\n WORKFLOW_NAME VARCHAR(255) NOT NULL, \n WORKFLOW_LOADED NUMERIC(20) NOT NULL, \n ACTIVITY_NAME VARCHAR(255) NOT NULL,\n FLAGS INTEGER NOT NULL,\n MONITOR_NAME VARCHAR(255) NOT N... |
I want to merge multiple rss feeds into a single feed, removing any duplicates. Specifically, I'm interested in merging the feeds for the tags I'm interested in.
[A quick search turned up some promising links, which I don't have time to visit at the moment]
Broadly speaking, the ideal would be a reader that would lis... | To merge multiple RSS feeds into a single feed while removing duplicates, you can utilize a combination of programming and available tools. Here's a broad overview of how to achieve this, along with some recommendations for tools and libraries you could use.
### Step-by-Step Guide
1. **Collect RSS Feed URLs:**
Sta... | 10,042 | [
{
"from": "human",
"value": "I want to merge multiple rss feeds into a single feed, removing any duplicates. Specifically, I'm interested in merging the feeds for the tags I'm interested in.\n[A quick search turned up some promising links, which I don't have time to visit at the moment]\n\nBroadly speaking... |
How do you trace/profile your .NET applications?
The MSDN online help mentions Visual Studio Team (which I do not possess) and there is the Windows Performance Toolkit. But, are there other solutions you can recommend? Preferably (of course) a solution that works without changing the code (manually) and that can be int... | Tracing and profiling .NET applications can help identify performance bottlenecks and analyze application behavior without requiring extensive code changes. Here are several tools and approaches that you can use, especially those that can integrate with Visual Studio or operate without manual code modifications:
### 1... | 13,091 | [
{
"from": "human",
"value": "How do you trace/profile your .NET applications?\nThe MSDN online help mentions Visual Studio Team (which I do not possess) and there is the Windows Performance Toolkit. But, are there other solutions you can recommend? Preferably (of course) a solution that works without changi... |
I am writing my first serious wxWidgets program. I'd like to use the wxConfig facility to make the program's user options persistent. However I don't want wxConfigBase to automatically use the Windows registry. Even though I'm initially targeting Windows, I'd prefer to use a configuration (eg .ini) file. Does anyone kn... | Certainly! In wxWidgets, you can easily use `wxFileConfig` instead of the default `wxConfig` or `wxConfigBase`, which defaults to using the Windows registry. The `wxFileConfig` class allows you to store configuration settings in a file, such as an .ini file, instead of the registry.
Here's a simple guide on how to use... | 9,993 | [
{
"from": "human",
"value": "I am writing my first serious wxWidgets program. I'd like to use the wxConfig facility to make the program's user options persistent. However I don't want wxConfigBase to automatically use the Windows registry. Even though I'm initially targeting Windows, I'd prefer to use a con... |
I know there are some ways to get notified when the page body has loaded (before all the images and 3rd party resources load which fires the window.onload event), but it's different for every browser.
Is there a definitive way to do this on all the browsers?
So far I know of:
DOMContentLoaded : On Mozilla, Opera 9 and... | To handle the loading of the DOM content in a standardized way across various browsers, you can rely primarily on the `DOMContentLoaded` event, which is widely supported across modern browsers, including Chrome, Firefox, Safari, and Edge. This event is fired when the initial HTML document has been completely loaded and... | 15,008 | [
{
"from": "human",
"value": "I know there are some ways to get notified when the page body has loaded (before all the images and 3rd party resources load which fires the window.onload event), but it's different for every browser.\nIs there a definitive way to do this on all the browsers?\nSo far I know of:\... |
Hi im new to MVC and I've fished around with no luck on how to build MVC User Controls that have ViewData returned to them. I was hoping someone would post a step by step solution on how to approach this problem. If you could make your solution very detailed that would help out greatly.
Sorry for being so discrete with... | Certainly! It seems you want to create an MVC User Control (technically referred to as a Partial View in ASP.NET MVC) that can take data passed from a controller and render it. Below, I'll provide a step-by-step guide to achieve this.
### Step 1: Create the Model
Firstly, ensure you have a model that represents the d... | 13,448 | [
{
"from": "human",
"value": "Hi im new to MVC and I've fished around with no luck on how to build MVC User Controls that have ViewData returned to them. I was hoping someone would post a step by step solution on how to approach this problem. If you could make your solution very detailed that would help out ... |
I want to debug a windows C++ application I've written to see why it isn't responding to WM_QUERYENDSESSION how I expect it to. Clearly it's a little tricky to do this by just shutting the system down. Is there any utility or code which I can use to send a fake WM_QUERYENDSESSION to my application windows myself?
| Debugging how your application handles the `WM_QUERYENDSESSION` message can indeed be tricky, especially if you want to avoid shutting down your system each time you test. Fortunately, there are ways you can simulate sending the `WM_QUERYENDSESSION` message to your application without rebooting.
### Method 1: Using a ... | 13,626 | [
{
"from": "human",
"value": "I want to debug a windows C++ application I've written to see why it isn't responding to WM_QUERYENDSESSION how I expect it to. Clearly it's a little tricky to do this by just shutting the system down. Is there any utility or code which I can use to send a fake WM_QUERYENDSESSIO... |
I’ve got a problem with Visual Basic (6) in combination with LDAP. When I try to connect to an LDAP store, I always get errors like ‘Bad Pathname’ or ‘Table does not exist’ (depending on what the code looks like).
This is the part of the code I wrote to connect:
path = "LDAP://xx.xxx.xxx.xxx:xxx/"
Logging.WriteToLogFil... | When dealing with LDAP in VB6, you need to ensure that your query and connection string are correctly formatted. The error "Table does not exist" indicates that the query syntax or the path you are trying to access is not recognized by the system.
Here are some considerations and potential fixes for your VB6 code:
##... | 12,184 | [
{
"from": "human",
"value": "I’ve got a problem with Visual Basic (6) in combination with LDAP. When I try to connect to an LDAP store, I always get errors like ‘Bad Pathname’ or ‘Table does not exist’ (depending on what the code looks like).\nThis is the part of the code I wrote to connect:\npath = \"LDAP:... |
I'm trying to create a ImageIcon from a animated gif stored in a jar file.
ImageIcon imageIcon = new ImageIcon(ImageIO.read(MyClass.class.getClassLoader().getResourceAsStream("animated.gif")));
The image loads, but only the first frame of the animated gif. The animation does not play.
If I load the animated gif from... | The issue you're facing is due to the way `ImageIO.read()` processes GIF images. When you load the animated GIF using `ImageIO.read()`, it only reads and decodes the first frame of the image. This is why you're only seeing the first frame when the GIF is loaded from the JAR file.
To properly display an animated GIF in... | 16,715 | [
{
"from": "human",
"value": "I'm trying to create a ImageIcon from a animated gif stored in a jar file.\nImageIcon imageIcon = new ImageIcon(ImageIO.read(MyClass.class.getClassLoader().getResourceAsStream(\"animated.gif\")));\n\nThe image loads, but only the first frame of the animated gif. The animation d... |
I'm downloading some images from a service that doesn't always include a content-type and doesn't provide an extension for the file I'm downloading (ugh, don't ask).
What's the best way to determine the image format in .NET?
The application that is reading these downloaded images needs to have a proper file extension o... | To determine the image format of a downloaded file in .NET, you can use the `System.Drawing` namespace, specifically the `Image` class, which has the ability to identify the format of an image based on its content rather than relying on the file extension or content-type.
Here’s how you can do it:
1. Load the image i... | 12,896 | [
{
"from": "human",
"value": "I'm downloading some images from a service that doesn't always include a content-type and doesn't provide an extension for the file I'm downloading (ugh, don't ask).\nWhat's the best way to determine the image format in .NET?\nThe application that is reading these downloaded ima... |
To elaborate ..
a) A table (BIGTABLE) has a capacity to hold a million rows with a primary Key as the ID. (random and unique)
b) What algorithm can be used to arrive at an ID that has not been used so far. This number will be used to insert another row into table BIGTABLE.
Updated the question with more details..
C) Th... | To solve the problem of generating a unique ID for inserting into the BIGTABLE, it's essential to avoid the inefficiencies of generating random numbers repeatedly and encountering collisions with existing IDs. Here are several strategies and an algorithm to help you efficiently generate a unique ID.
### Suggested Appr... | 13,100 | [
{
"from": "human",
"value": "To elaborate ..\na) A table (BIGTABLE) has a capacity to hold a million rows with a primary Key as the ID. (random and unique)\nb) What algorithm can be used to arrive at an ID that has not been used so far. This number will be used to insert another row into table BIGTABLE.\nUp... |
Is it possible to install the x86 Remote Debugger as a Service on a 64bit machine? I need to attach a debugger to managed code in a Session 0 process. The process runs 32bit but the debugger service that gets installed is 64bit and wont attach to the 32bit process.
I tried creating the Service using the SC command,... | To debug a 32-bit process running in Session 0 on a 64-bit machine using the Visual Studio Remote Debugger, you need to ensure that the 32-bit version of the Remote Debugging Monitor (MSVSMON.EXE) is running in Session 0. Here’s a step-by-step guide to set this up correctly:
### Steps to Install and Run x86 Remote Deb... | 12,517 | [
{
"from": "human",
"value": "Is it possible to install the x86 Remote Debugger as a Service on a 64bit machine? I need to attach a debugger to managed code in a Session 0 process. The process runs 32bit but the debugger service that gets installed is 64bit and wont attach to the 32bit process. \nI tried ... |
I want to write tests that can show whether or not the database is in sync with my models.py file. Actually I have already written them, only to find out that django creates a new database each time the tests are run based on the models.py file.
Is there any way I can make the models.py test use the existing database ... | To test whether your Django models are in sync with an existing database schema without creating a new test database, you can use Django's testing framework along with raw SQL checks against your existing database. Here’s a general approach to achieve this:
1. **Use a Database Connection**: Instead of letting Django c... | 13,997 | [
{
"from": "human",
"value": "I want to write tests that can show whether or not the database is in sync with my models.py file. Actually I have already written them, only to find out that django creates a new database each time the tests are run based on the models.py file. \nIs there any way I can make the... |
In Visual Studio, when I type the line "Implements IDisposable", the IDE automatically adds:
a disposedValue member variable
a Sub Dispose() Implements IDisposable.Dispose
a Sub Dispose(ByVal disposing As Boolean)
The Dispose() should be left alone, and the clean up code should be put in Dispose(disposing).
However t... | In Visual Studio, when you use the "Implements IDisposable" functionality, the IDE aims to assist you in implementing the `IDisposable` pattern but it doesn't automatically add the finalizer (`Finalize`) method for a couple of reasons.
1. **Common Practice**: Many modern classes that implement `IDisposable` do not req... | 15,897 | [
{
"from": "human",
"value": "In Visual Studio, when I type the line \"Implements IDisposable\", the IDE automatically adds:\n\na disposedValue member variable\na Sub Dispose() Implements IDisposable.Dispose\na Sub Dispose(ByVal disposing As Boolean)\n\nThe Dispose() should be left alone, and the clean up co... |
How to encode video on the fly and send it trough the network from C#?
Can't find a suitable library. I need to encode in WMV and don't mind if the actual encoding is made in C++ as long as the library has a .NET assembly available.
Thanks
| To encode video on the fly in C# and send it over the network, you might consider using libraries that can interact with native C++ libraries or use existing .NET libraries that support video encoding. While WMV (Windows Media Video) is somewhat dated, you might have better luck with libraries that support more modern ... | 11,540 | [
{
"from": "human",
"value": "How to encode video on the fly and send it trough the network from C#?\nCan't find a suitable library. I need to encode in WMV and don't mind if the actual encoding is made in C++ as long as the library has a .NET assembly available.\nThanks\n"
},
{
"from": "gpt",
"v... |
I have a Java program that uses Hibernate and MySQL to store a lot of tracing data about the use of the Eclipse IDE. This data contains a lot of strings such as method names, directories, perspective name, etc.
For example, an event object (which is then reflected in a record) can specify the source file and the curre... | Yes, you can create a custom solution using Hibernate to achieve what you're looking for by creating a manual mapping that involves a lookup table for your frequently repeated strings. This solution would require a few steps to implement:
### Step 1: Create a String Lookup Table
You can create a simple table to store ... | 12,501 | [
{
"from": "human",
"value": "I have a Java program that uses Hibernate and MySQL to store a lot of tracing data about the use of the Eclipse IDE. This data contains a lot of strings such as method names, directories, perspective name, etc. \nFor example, an event object (which is then reflected in a record)... |
I got a typed (not connected) dataset, and many records (binary seriliazed) created with this dataset.
I've added a property to one of the types, and I want to convert the old records with the new data set.
I know how to load them: providing custom binder for the BinaryFormatter with the old schema dll.
The question i... | To convert objects of the old type to the new type when both types share the same name but differ in the properties, you can follow these general steps. Note that this example assumes you are using C# and that you have access to both types (the old type from the old assembly and the new type from the new assembly).
##... | 12,392 | [
{
"from": "human",
"value": "I got a typed (not connected) dataset, and many records (binary seriliazed) created with this dataset.\nI've added a property to one of the types, and I want to convert the old records with the new data set.\nI know how to load them: providing custom binder for the BinaryFormatt... |
I have a cross platform program that runs on Windows, Linux and Macintosh. My windows version has an Icon but I don't know how to make have one for my Linux build.
Is there a standard format for KDE, Gnome etc. or will I have to do something special for each one?
My app is in c++ and distributed as source so the end us... | To create an icon for your Linux application that works well across different desktop environments like GNOME and KDE, you typically need to provide your application with a `.desktop` file and icon files in specific formats. Here’s a step-by-step guide on how to do that.
### 1. Icon File Format
Most Linux desktop env... | 13,129 | [
{
"from": "human",
"value": "I have a cross platform program that runs on Windows, Linux and Macintosh. My windows version has an Icon but I don't know how to make have one for my Linux build.\nIs there a standard format for KDE, Gnome etc. or will I have to do something special for each one?\nMy app is in ... |
In our Java applications we typically use the maven conventions (docs, src/java, test, etc.). For Perl we follow similar conventions only using a top level 'lib' which is easy to add to Perl's @INC.
I'm about to embark on creating a service written in Erlang, what's a good source layout for Erlang applications?
| Erlang has its own conventions and best practices for organizing source code, which can be somewhat different from those of Java or Perl. Here’s a recommended layout for an Erlang application:
### Recommended Source Layout for Erlang Applications
```
my_app/
├── src/
│ ├── my_app.erl # Main applicati... | 13,105 | [
{
"from": "human",
"value": "In our Java applications we typically use the maven conventions (docs, src/java, test, etc.). For Perl we follow similar conventions only using a top level 'lib' which is easy to add to Perl's @INC.\nI'm about to embark on creating a service written in Erlang, what's a good sou... |
I have a LAMP (PHP) web app which need to interface with programs on an IBM 3270 mainframe (via Microsoft SNA Server). One solution I'm looking at is screen-scraping via 3270. (I'm integrating the present with the past!)
Many years ago, I wrote C code which used HLLAPI as the basis for such a task.
Is HLLAPI still t... | Integrating a modern LAMP (Linux, Apache, MySQL, PHP) application with IBM 3270 mainframe systems can be challenging, especially if you're considering using screen scraping techniques. HLLAPI (High-Level Language Application Programming Interface) is indeed a standard API for interacting with IBM mainframes, and it's s... | 13,259 | [
{
"from": "human",
"value": "I have a LAMP (PHP) web app which need to interface with programs on an IBM 3270 mainframe (via Microsoft SNA Server). One solution I'm looking at is screen-scraping via 3270. (I'm integrating the present with the past!)\nMany years ago, I wrote C code which used HLLAPI as the... |
I have a QMainWindow in a Qt application. When I close it I want it to store its current restore size (the size of the window when it is not maximized). This works well when I close the window in restore mode (that is, not maximized). But if I close the window if it is maximized, then next time i start the application ... | Yes, you can handle the issue of storing the window size when it is closed, regardless of whether it is in a maximized state or not. To achieve this in a Qt application, you can utilize the `QMainWindow`'s signals and slots to store the size and state of the window when it is about to close, and then restore the approp... | 13,791 | [
{
"from": "human",
"value": "I have a QMainWindow in a Qt application. When I close it I want it to store its current restore size (the size of the window when it is not maximized). This works well when I close the window in restore mode (that is, not maximized). But if I close the window if it is maximized... |
How does the new Microsoft asp.net mvc implementation handle partitioning your application - for example:
--index.aspx
--about.aspx
--contact.aspx
--/feature1
--/feature1/subfeature/action
--/feature2/subfeature/action
I guess what I am trying to say is that it seems everything has to go into the root of the views/con... | When you're transitioning from ASP.NET Web Forms to ASP.NET MVC, one key aspect to understand is how ASP.NET MVC handles routing, views, and controllers. MVC promotes a more structured approach to building applications that aligns with the principles of separation of concerns, making it easier to manage large projects.... | 5,732 | [
{
"from": "human",
"value": "How does the new Microsoft asp.net mvc implementation handle partitioning your application - for example:\n--index.aspx\n--about.aspx\n--contact.aspx\n--/feature1\n--/feature1/subfeature/action\n--/feature2/subfeature/action\n\nI guess what I am trying to say is that it seems ev... |
I'm looking for a framework to generate Java source files.
Something like the following API:
X clazz = Something.createClass("package name", "class name");
clazz.addSuperInterface("interface name");
clazz.addMethod("method name", returnType, argumentTypes, ...);
File targetDir = ...;
clazz.generate(targetDir);
Then, ... | For generating Java source files with the requirements you've outlined, there are a couple of frameworks that can effectively help you achieve this:
### 1. **JavaPoet**
JavaPoet is a popular Java API for generating `.java` source files. It provides a fluent API for building classes, methods, fields, and more. It also ... | 9,904 | [
{
"from": "human",
"value": "I'm looking for a framework to generate Java source files.\nSomething like the following API:\nX clazz = Something.createClass(\"package name\", \"class name\");\nclazz.addSuperInterface(\"interface name\");\nclazz.addMethod(\"method name\", returnType, argumentTypes, ...);\n\nF... |
While generating charts using RS 2008 betas, RC0 and such., I never specified any fonts for axis labels, legends etc. They were all rendered with the Arial font by default, which looked awesome. But as soon as we switched to RS 2008 final, the fonts got all messed up - they are rendered in some kind of bold console fon... | It sounds like you're experiencing a common issue related to font rendering in SQL Server Reporting Services (SSRS) 2008 after moving from the beta/RC versions to the final release. Here are some potential solutions and workarounds that might help you resolve the font issues:
1. **Check Installed Fonts**: Ensure that ... | 14,185 | [
{
"from": "human",
"value": "While generating charts using RS 2008 betas, RC0 and such., I never specified any fonts for axis labels, legends etc. They were all rendered with the Arial font by default, which looked awesome. But as soon as we switched to RS 2008 final, the fonts got all messed up - they are ... |
As an exercise for myself, I was translating a sample program into various languages. Starting in C#, I had a visitor-pattern interface like so:
interface Visitor
{
void Accept(Bedroom x);
void Accept(Bathroom x);
void Accept(Kitchen x);
void Accept(LivingRoom x);
}
Moving to ... | In dynamic languages like Ruby and Python, there are different idioms for implementing the Visitor pattern compared to statically typed languages like C#. Both approaches you presented can work, but they each have their own trade-offs. Let's explore both, and then I'll introduce an alternative idiom that's commonly use... | 11,921 | [
{
"from": "human",
"value": "As an exercise for myself, I was translating a sample program into various languages. Starting in C#, I had a visitor-pattern interface like so:\ninterface Visitor\n {\n void Accept(Bedroom x);\n void Accept(Bathroom x);\n void Accept(Kitchen x);\n ... |
Recently I got IE7 crashed on Vista on jar loading (presumably) with the following error:
Problem signature:
Problem Event Name: BEX
Application Name: iexplore.exe
Application Version: 7.0.6001.18000
Application Timestamp: 47918f11
Fault Module Name: ntdll.dll
Fault Module ... | ### What BEX Stands For:
BEX stands for **Buffer Overflow Exception**. It indicates that a buffer overflow has been detected in the application, leading to the crash. In the context of Windows applications, this usually means that the program tried to write more data to a buffer than it could hold, potentially leading ... | 13,594 | [
{
"from": "human",
"value": "Recently I got IE7 crashed on Vista on jar loading (presumably) with the following error:\nProblem signature:\n Problem Event Name: BEX\n Application Name: iexplore.exe\n Application Version: 7.0.6001.18000\n Application Timestamp: 47918f11\n Fault... |
What is the best practice for naming UI controls (textboxes, drop-downs, etc.) on forms and reports for reference in the code-behind pages?
I develop a lot of reports and forms in my office. I have several web applications providing about 80+ "live" reports being generated from various and multiple data sources (Acces... | When naming UI controls for forms and reports, especially in applications where you have a large number of components and dynamic data interactions, following best practices for naming conventions is essential for maintaining readability, maintainability, and ease of development. Here are some best practices to conside... | 15,024 | [
{
"from": "human",
"value": "What is the best practice for naming UI controls (textboxes, drop-downs, etc.) on forms and reports for reference in the code-behind pages?\nI develop a lot of reports and forms in my office. I have several web applications providing about 80+ \"live\" reports being generated f... |
I have the problem that an specific step in Ant can only be executed when we have Java 1.5 installed in the build computer. The task definition uses uses a jar file that was compiled using 1.5, so running with a 1.4 virtual machine will throw an IncompatibleClassVersion exception.
I have to find a solution meanwhile ... | To conditionally execute an Ant task based on the version of Java being used, you can use the built-in `condition` task provided by Ant, specifically the `os` and `version` conditions. Here’s how you can check the Java version and control the execution of your specific task.
### Step-by-Step Approach:
1. **Determine ... | 14,889 | [
{
"from": "human",
"value": "I have the problem that an specific step in Ant can only be executed when we have Java 1.5 installed in the build computer. The task definition uses uses a jar file that was compiled using 1.5, so running with a 1.4 virtual machine will throw an IncompatibleClassVersion except... |
I'm supposed to create a simple rule engine in C#. Any leads on how I can proceed?. It's a minimalistic rule engine, and would use SQL server as the back end. Do we have any general blueprint or design patterns that generally apply to rule engines? What kind of .Net technologies can I use to design one? Any directions ... | Creating a simple rule engine in C# can be a fun and rewarding project. Below, I've outlined some general design patterns and architectural considerations, as well as technologies you might consider using.
### General Design Patterns and Architecture
1. **Rule Definition**:
- Define rules in a way that can be sto... | 9,879 | [
{
"from": "human",
"value": "I'm supposed to create a simple rule engine in C#. Any leads on how I can proceed?. It's a minimalistic rule engine, and would use SQL server as the back end. Do we have any general blueprint or design patterns that generally apply to rule engines? What kind of .Net technologies... |
I'm working on a VB6 application and I would like to send a Type as a reference and store it in another form. Is this possible?
Sending it is no problem, I just use the ByRef keyword:
public Sub SetStopToEdit(ByRef currentStop As StopType)
But when I try to use Set to store currentStop in the receiving module I get th... | In VB6, `Type` is a value type, meaning that it is stored directly in the variable, rather than by reference, which is how objects work. When you try to use `Set` with a user-defined `Type`, you get an "Object required" error because `Set` is only used for object references.
Since you want to have a variable that can ... | 11,231 | [
{
"from": "human",
"value": "I'm working on a VB6 application and I would like to send a Type as a reference and store it in another form. Is this possible?\nSending it is no problem, I just use the ByRef keyword:\npublic Sub SetStopToEdit(ByRef currentStop As StopType)\n\nBut when I try to use Set to store... |
How do you generate C# classes for accessing WMI?
| To generate C# classes for accessing Windows Management Instrumentation (WMI), you can use the `System.Management` namespace provided by the .NET Framework. This namespace allows you to interact with WMI in a straightforward way.
Here's a step-by-step guide to help you create C# classes for accessing WMI:
### Step 1:... | 12,009 | [
{
"from": "human",
"value": "How do you generate C# classes for accessing WMI?\n"
},
{
"from": "gpt",
"value": "To generate C# classes for accessing Windows Management Instrumentation (WMI), you can use the `System.Management` namespace provided by the .NET Framework. This namespace allows you t... |
I need to take any given valid XML schema (XSD) and denormalize it to a simple form containing no refs, no includes, etc. All simple type definitions should be inline, such that when looking at any given element, all declarations are visible without performing another lookup.
I've found some tools that have this built... | To achieve the denormalization of an XML schema (XSD) in Java, where all type definitions and element declarations are visible in a single schema representation without references or external inclusions, you can utilize a few libraries along with some custom code. Although there might not be an out-of-the-box solution ... | 10,312 | [
{
"from": "human",
"value": "I need to take any given valid XML schema (XSD) and denormalize it to a simple form containing no refs, no includes, etc. All simple type definitions should be inline, such that when looking at any given element, all declarations are visible without performing another lookup.\n... |
What is the best way to handle a big team that has access to a stable but no so pretty code, that is easy to introduce bugs into?
I'm looking for something along the lines of SVN locking the file(s).
| Handling a large team with access to stable but less-than-ideal code requires a combination of processes, tools, and cultural shifts within the team to minimize the risk of introducing bugs. While SVN locking can help prevent simultaneous edits, it’s generally not the best solution for collaborative development in mode... | 15,068 | [
{
"from": "human",
"value": "What is the best way to handle a big team that has access to a stable but no so pretty code, that is easy to introduce bugs into?\nI'm looking for something along the lines of SVN locking the file(s). \n"
},
{
"from": "gpt",
"value": "Handling a large team with acces... |
I am looking to replace the life cycle tools currently used by my development teams.
Tools that I'm looking for:
Version Control
Defect/Issue Tracking
Requirements Tracking
Test Case Management
(potentially) Project Management: Project Status, hours entry
I have a new beefy server (Windows 2008 Server) to run all too... | Selecting a good suite of lifecycle tools for your development teams involves considering both the specific needs of your organization and the capabilities of available tools. Here are some recommendations for both Commercial Off-The-Shelf (COTS) and open-source options that can fit your requirements:
### 1. **COTS Op... | 13,559 | [
{
"from": "human",
"value": "I am looking to replace the life cycle tools currently used by my development teams.\nTools that I'm looking for:\n\nVersion Control\nDefect/Issue Tracking\nRequirements Tracking\nTest Case Management\n(potentially) Project Management: Project Status, hours entry\n\nI have a new... |
As a follow up to this question: Developing a online exam application, how do I prevent cheaters?
Can I detect when Flex application looses its focus? that is if a user has clicked onto another application or opened a browser tab?
I read this: Detecting when a Flex application loses focus but was not very clear...
| Preventing cheating in an online exam application can be quite challenging, but there are various strategies and techniques you can employ to mitigate the risk. Detecting when a Flex application loses focus is one approach, and while it may not be a foolproof method to prevent all cheating, it can help discourage some ... | 14,367 | [
{
"from": "human",
"value": "As a follow up to this question: Developing a online exam application, how do I prevent cheaters?\nCan I detect when Flex application looses its focus? that is if a user has clicked onto another application or opened a browser tab?\nI read this: Detecting when a Flex application... |
How do I go about using HTTPS for some of the pages in my ASP.NET MVC based site?
Steve Sanderson has a pretty good tutorial on how to do this in a DRY way on Preview 4 at:
http://blog.codeville.net/2008/08/05/adding-httpsssl-support-to-aspnet-mvc-routing/
Is there a better / updated way with Preview 5?,
| As of ASP.NET MVC and its updates beyond Preview 4, there are improved and more structured methods to implement HTTPS for specific pages in your ASP.NET MVC application. Below, I will guide you on how to enable HTTPS for specific actions or controllers in a DRY (Don't Repeat Yourself) way, leveraging attributes.
### 1... | 12,974 | [
{
"from": "human",
"value": "How do I go about using HTTPS for some of the pages in my ASP.NET MVC based site?\nSteve Sanderson has a pretty good tutorial on how to do this in a DRY way on Preview 4 at:\nhttp://blog.codeville.net/2008/08/05/adding-httpsssl-support-to-aspnet-mvc-routing/\nIs there a better /... |
We attempt to do agile development at my current job and we succeed for the most part. The main problem seems to be that the developers on the project are always waiting for requirements at the beginning of the sprint and rushing to get get things down by the end. The business analysts who are delivering the requiremen... | It sounds like you're facing a common challenge in agile development, especially in the context of customizing a Commercial Off-The-Shelf (COTS) application. Here are several suggestions to address the issues you've described regarding user stories and the flow of requirements:
### 1. **Improve Collaboration Between D... | 13,369 | [
{
"from": "human",
"value": "We attempt to do agile development at my current job and we succeed for the most part. The main problem seems to be that the developers on the project are always waiting for requirements at the beginning of the sprint and rushing to get get things down by the end. The business a... |
I'm starting to get comfortable with the idea of fakes, stubs, mocks, and dynamic mocks. But I am still a little iffy in my understanding of when to use partial mocks.
It would seem that if you're planning on mocking a service and need to resort to a partial mock then it is a sign of bad design. Is it that partial ... | You’re delving into an important aspect of testing in software development, and your thoughts on partial mocks reflect a nuanced understanding of when and why they might be used. Here’s a breakdown of the concepts and your questions regarding partial mocks:
### What are Partial Mocks?
Partial mocks allow you to overr... | 14,547 | [
{
"from": "human",
"value": "I'm starting to get comfortable with the idea of fakes, stubs, mocks, and dynamic mocks. But I am still a little iffy in my understanding of when to use partial mocks. \nIt would seem that if you're planning on mocking a service and need to resort to a partial mock then it is ... |
Greetings.
I'm looking for a way to parse a number of XML files in a particular directory with ASP.NET (C#). I'd like to be able to return content from particular elements, but before that, need to find those that have a certain value between an element.
Example XML file 1:
<file>
<title>Title 1</title>
<someCo... | Hello James,
Certainly! You can achieve this by using LINQ to XML in C#. This approach allows you to efficiently parse and query multiple XML files in a specified directory based on your conditions.
Below is a sample code snippet that demonstrates how to do this:
```csharp
using System;
using System.Collections.Gene... | 8,481 | [
{
"from": "human",
"value": "Greetings.\nI'm looking for a way to parse a number of XML files in a particular directory with ASP.NET (C#). I'd like to be able to return content from particular elements, but before that, need to find those that have a certain value between an element.\nExample XML file 1:\n<... |
I've got a web application working using VB and Ajax. I'm using updatepanels to avoid the irritating "flicker" on postbacks to the server.
I would like to have a button control defined within the updatepanel itself (tried moving it outside and got some catastrophic error, so left it there) that makes the current pane... | It sounds like you're experiencing issues with the timing of updates in your UpdatePanels when using asynchronous postbacks. In ASP.NET, UpdatePanels work by performing partial page updates, which can sometimes lead to unexpected behavior if the controls aren't properly synchronized or if the visibility changes don't o... | 11,976 | [
{
"from": "human",
"value": "I've got a web application working using VB and Ajax. I'm using updatepanels to avoid the irritating \"flicker\" on postbacks to the server. \nI would like to have a button control defined within the updatepanel itself (tried moving it outside and got some catastrophic error, so... |
Suppose you work at a medium-to-large software company with many independently-developed projects (independent coders) but which rely on each other (dependent code).
If it were up to you, would you make sure each project produced stable branches so that the other projects could more reliably use those branches, or woul... | The decision between using stable release branches or relying on the latest available code from dependent projects is a nuanced one, and both strategies have their pros and cons. Here’s a balanced perspective based on industry experience with both alternatives:
### Using Stable Release Branches
**Advantages:**
1. **... | 12,744 | [
{
"from": "human",
"value": "Suppose you work at a medium-to-large software company with many independently-developed projects (independent coders) but which rely on each other (dependent code).\nIf it were up to you, would you make sure each project produced stable branches so that the other projects could... |
In the past and with most my current projects I tend to use a for loop like this:
var elements = document.getElementsByTagName('div');
for (var i=0; i<elements.length; i++) {
doSomething(elements[i]);
}
I've heard that using a "reverse while" loop is quicker but I have no real way to confirm this:
var elements = d... | When it comes to looping through elements in JavaScript, especially when dealing with collections like NodeLists or Arrays, there are several considerations regarding performance, readability, and best practices. Here are some points to consider:
### Performance
1. **Reverse While Loop**:
- The reverse `while` loo... | 13,250 | [
{
"from": "human",
"value": "In the past and with most my current projects I tend to use a for loop like this:\nvar elements = document.getElementsByTagName('div');\nfor (var i=0; i<elements.length; i++) {\n doSomething(elements[i]);\n}\n\nI've heard that using a \"reverse while\" loop is quicker but I h... |
Does anyone know a Tutorial for the Reporting in C# .NET. I mean the Reports in "Microsoft.Reporting" Namespace (not Crystal Reports).
| Yes, there are several resources available online that can help you learn about reporting using the `Microsoft.Reporting` namespace in C#. Here is a basic overview and some tutorial resources you might find helpful:
### Overview of Microsoft Reporting
The `Microsoft.Reporting` namespace is typically associated with S... | 10,569 | [
{
"from": "human",
"value": "Does anyone know a Tutorial for the Reporting in C# .NET. I mean the Reports in \"Microsoft.Reporting\" Namespace (not Crystal Reports).\n"
},
{
"from": "gpt",
"value": "Yes, there are several resources available online that can help you learn about reporting using t... |
OK, this might sound a bit confusing and complicated, so bear with me.
We've written a framework that allows us to define friendly URLs. If you surf to any arbitrary URL, IIS tries to display a 404 error (or, in some cases, 403;14 or 405). However, IIS is set up so that anything directed to those specific errors is sen... | This is indeed a challenging situation, and it sounds like you've put significant effort into the implementation of your framework. The issue you're experiencing with POST requests returning a 405 error and losing the form data after being redirected to an error handling page is a known quirk in IIS 7 and later version... | 12,693 | [
{
"from": "human",
"value": "OK, this might sound a bit confusing and complicated, so bear with me.\nWe've written a framework that allows us to define friendly URLs. If you surf to any arbitrary URL, IIS tries to display a 404 error (or, in some cases, 403;14 or 405). However, IIS is set up so that anythin... |
I come across this problem when i am writing an event handler in SharePoint. My event handler has a web reference. When i create this web reference, the URL of the web service will be added in the .config file of the assembly. If i have to change the web reference URL i just have to change the link in the config file. ... | This is a common challenge when working with web references in SharePoint event handlers, particularly when you want to update the configuration without recompiling the assembly or losing changes made to auto-generated files.
Here are several approaches you might consider:
### 1. Use an App.config or Web.config
Whil... | 10,222 | [
{
"from": "human",
"value": "I come across this problem when i am writing an event handler in SharePoint. My event handler has a web reference. When i create this web reference, the URL of the web service will be added in the .config file of the assembly. If i have to change the web reference URL i just hav... |
I need to store database passwords in a config file. For obvious reasons, I want to encrypt them (preferably with AES). Does anyone know a Delphi implementation that is easy to introduce into an existing project with > 10,000 lines of historically grown (URGH!) source code?
Clarification: Easy means adding the unit to ... | Storing database passwords securely is essential, and using AES encryption for this purpose is a good approach. In Delphi, you can use the `System.Hash` and `System.SysUtils` units for easy implementation of AES encryption.
One popular Delphi library for encryption is **DCPCrypt**, which provides AES support and is re... | 13,963 | [
{
"from": "human",
"value": "I need to store database passwords in a config file. For obvious reasons, I want to encrypt them (preferably with AES). Does anyone know a Delphi implementation that is easy to introduce into an existing project with > 10,000 lines of historically grown (URGH!) source code?\nCla... |
I'm calling some code that uses the BitmapData class from .NET. I've hit something where I can't find a definitive answer on Googlespace.
Because it seems that LockBits and UnlockBits must always be called in a pair, I'm using this:
System.Drawing.Imaging.BitmapData tempImageData = tempImage.LockBits(
... | Using `try-finally` is indeed a good practice when working with `LockBits` and `UnlockBits`. This ensures that `UnlockBits` is always called, even if an exception occurs while processing the bitmap data.
In your scenario, you're locking the bitmap to work with its pixel data, and if any exception is thrown while you'... | 14,973 | [
{
"from": "human",
"value": "I'm calling some code that uses the BitmapData class from .NET. I've hit something where I can't find a definitive answer on Googlespace.\nBecause it seems that LockBits and UnlockBits must always be called in a pair, I'm using this:\n System.Drawing.Imaging.BitmapData t... |
I have a Ruby/Rails app that has two or three main "sections". When a user visits that section, I wish to display some sub-navigation. All three sections use the same layout, so I can't "hard code" the navigation into the layout.
I can think of a few different methods to do this. I guess in order to help people vote I'... | Certainly! Implementing dynamic sub-navigation in a Ruby on Rails app can be achieved in several ways. Here are a few methods you might consider:
### 1. **Partial View Rendering**
You can create partial views for each section's sub-navigation and render them conditionally in your layout based on the current controller... | 15,467 | [
{
"from": "human",
"value": "I have a Ruby/Rails app that has two or three main \"sections\". When a user visits that section, I wish to display some sub-navigation. All three sections use the same layout, so I can't \"hard code\" the navigation into the layout.\nI can think of a few different methods to do... |
In my free time I started writing a small multiplayer game with a database backend. I was looking to separate player login information from other in game information (inventory, stats, and status) and a friend brought up this might not be the best idea.
Would it be better to lump everything together in one table?
| When designing a database for a multiplayer game, it's crucial to balance normalization (separating data into distinct tables to avoid redundancy) and performance. Here are some considerations for your scenario of separating player login information from in-game information:
### Pros of Separating Tables
1. **Securit... | 14,572 | [
{
"from": "human",
"value": "In my free time I started writing a small multiplayer game with a database backend. I was looking to separate player login information from other in game information (inventory, stats, and status) and a friend brought up this might not be the best idea.\nWould it be better to lu... |
Suppose I have a design like this:
Object GUI has two objects: object aManager and object bManager, which don't ever talk to each other.
Both aManager and bManager have object cManager as an attribute (or rather a pointer to cManager). So when aManager modifies its cManager, it's affecting bManager's cManager as well.
... | You are correct in recognizing that having `cManager` as a shared resource between `aManager` and `bManager` can lead to tightly coupled designs. The objective here is to maintain separation of concerns while allowing both managers to work with the same instance of `cManager`. Here are a few design considerations and p... | 9,646 | [
{
"from": "human",
"value": "Suppose I have a design like this:\nObject GUI has two objects: object aManager and object bManager, which don't ever talk to each other.\nBoth aManager and bManager have object cManager as an attribute (or rather a pointer to cManager). So when aManager modifies its cManager, i... |
Given this data set:
ID Name City Birthyear
1 Egon Spengler New York 1957
2 Mac Taylor New York 1955
3 Sarah Connor Los Angeles 1959
4 Jean-Luc Picard La Barre 2305
5 Ellen Ripley Nostromo 2092
6 James T. Kirk Riverside 2233
7 Hen... | To solve the problem of finding the three oldest persons from different cities, while ensuring that only one person per city is selected, you can use a combination of Common Table Expressions (CTEs) or subqueries. Given your existing solution and the performance improvements you have seen with joins, here is a refined ... | 17,763 | [
{
"from": "human",
"value": "Given this data set:\nID Name City Birthyear\n1 Egon Spengler New York 1957\n2 Mac Taylor New York 1955\n3 Sarah Connor Los Angeles 1959\n4 Jean-Luc Picard La Barre 2305\n5 Ellen Ripley Nostromo 2092\n... |
How do you setup an asp.net sql membership role/membership provider on a production machine? I'm trying to setup BlogEngine.NET and all the documentation says to use the ASP.NET Website Administration tool from Visual Studio but that isn't available on a production machine. Am I the first BlogEngine user to use it on a... | Setting up an ASP.NET SQL Membership provider on a production machine without the Visual Studio Website Administration Tool can be a bit tricky, but it's definitely doable. Since you've already run the `aspnet_regsql` utility to create the necessary schema, you can create users and roles directly using SQL Management S... | 12,837 | [
{
"from": "human",
"value": "How do you setup an asp.net sql membership role/membership provider on a production machine? I'm trying to setup BlogEngine.NET and all the documentation says to use the ASP.NET Website Administration tool from Visual Studio but that isn't available on a production machine. Am I... |
We have a system where we want to prevent the same credit card number being registered for two different accounts. As we don't store the credit card number internally - just the last four digits and expiration date - we cannot simply compare credit card numbers and expiration dates.
Our current idea is to store a hash ... | Your approach of storing a hash of credit card information along with a salt to prevent duplicate registrations is on the right track, but there are several important considerations and potential flaws in your method. Here are some key points to address:
1. **Using SHA-1**: SHA-1 is considered weak and vulnerable to c... | 14,173 | [
{
"from": "human",
"value": "We have a system where we want to prevent the same credit card number being registered for two different accounts. As we don't store the credit card number internally - just the last four digits and expiration date - we cannot simply compare credit card numbers and expiration da... |
I am going to hosting for files that user submits. I need to grab some data from the file and then move it to some directory.
There two points of interest for the lifetime of this file. The first is when the data is being abstracted and the second is when the file is archived so that it can be shared.
When data is bein... | When designing a file storage and archiving system, it's important to consider several factors such as file organization, ease of access, scalability, and the potential need for future expansion. Here are some strategies that you might find useful based on the points you've mentioned:
### 1. **File Naming Conventions*... | 12,274 | [
{
"from": "human",
"value": "I am going to hosting for files that user submits. I need to grab some data from the file and then move it to some directory.\nThere two points of interest for the lifetime of this file. The first is when the data is being abstracted and the second is when the file is archived s... |
I'm using the Excel interop in C# (ApplicationClass) and have placed the following code in my finally clause:
while (System.Runtime.InteropServices.Marshal.ReleaseComObject(excelSheet) != 0) { }
excelSheet = null;
GC.Collect();
GC.WaitForPendingFinalizers();
Although this kind of works, the Excel.exe process is still ... | When working with Excel interop in C#, it’s crucial to ensure that all COM objects are properly released to prevent lingering Excel processes. The issue you are experiencing—where the Excel process remains in the background—is likely due to not releasing all COM objects correctly or not following best practices for int... | 14,067 | [
{
"from": "human",
"value": "I'm using the Excel interop in C# (ApplicationClass) and have placed the following code in my finally clause:\nwhile (System.Runtime.InteropServices.Marshal.ReleaseComObject(excelSheet) != 0) { }\nexcelSheet = null;\nGC.Collect();\nGC.WaitForPendingFinalizers();\n\nAlthough this... |
I'm storing all localizable strings in a ResourceDictionary (in App.xaml) and assign those via the StaticResource markup extension to TextBlock.Text, Button.Content etc.
In Beta 2 and RC0, sometimes parsing the XAML in InitializeComponent() will fail with an AG_E_PARSER_BAD_PROPERTY_VALUE on the line and position where... | The issue you're experiencing with the `AG_E_PARSER_BAD_PROPERTY_VALUE` error in XAML can be quite frustrating, especially since it appears to be intermittent. This error typically indicates a problem with how the XAML parser is interpreting your resource definitions or bindings. Here are some potential reasons and sol... | 15,311 | [
{
"from": "human",
"value": "I'm storing all localizable strings in a ResourceDictionary (in App.xaml) and assign those via the StaticResource markup extension to TextBlock.Text, Button.Content etc.\nIn Beta 2 and RC0, sometimes parsing the XAML in InitializeComponent() will fail with an AG_E_PARSER_BAD_PRO... |
I am debugging my ASP.NET application on my Windows XP box with a virtual directory set up in IIS (5.1).
I am also running VirtualPC with XP and IE6 for testing purposes. When I connect to my real machine from the virtual machine, I enter the URL: http://machinename/projectname.
I get a security popup to connect to my ... | The issue you're encountering is related to how Windows XP handles authentication for network connections, especially in a VirtualPC environment. Here are steps you can take to resolve the problem and enable the username field to allow you to enter your credentials:
1. **Disable Guest Access**:
Ensure that the Gues... | 9,522 | [
{
"from": "human",
"value": "I am debugging my ASP.NET application on my Windows XP box with a virtual directory set up in IIS (5.1).\nI am also running VirtualPC with XP and IE6 for testing purposes. When I connect to my real machine from the virtual machine, I enter the URL: http://machinename/projectname... |
We have a VXML project that a 3rd party parses to provide us with a phone navigation system. We require them to enter an id code to leave a message, which is later reviewed by our company.
We currently have this working as follows:
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Stream m = new MemoryStream();... | Yes, your observation about the inefficiency of the code is correct. The process of reading the entire byte array back from the memory stream to convert it to a string is unnecessary. You can directly write to the response stream without having to first read the data into a byte array.
Here is a more efficient way to... | 15,195 | [
{
"from": "human",
"value": "We have a VXML project that a 3rd party parses to provide us with a phone navigation system. We require them to enter an id code to leave a message, which is later reviewed by our company.\nWe currently have this working as follows:\nResponse.Cache.SetCacheability(HttpCacheabili... |
I have a simple message box in a WPF application that is launched as below:
private void Button_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("Howdy", "Howdy");
}
I can get white to click my button and launch the message box.
UISpy shows it as a child of my window I couldn't work out the method to acc... | In a WPF application, when you show a `MessageBox`, it is a modal dialog that typically does not provide a direct way to access its elements through standard automation tools like UISpy. However, you can still verify the contents of the MessageBox using a few different approaches. Here are some possible methods to achi... | 11,750 | [
{
"from": "human",
"value": "I have a simple message box in a WPF application that is launched as below:\nprivate void Button_Click(object sender, RoutedEventArgs e)\n{\n MessageBox.Show(\"Howdy\", \"Howdy\");\n}\n\nI can get white to click my button and launch the message box. \nUISpy shows it as a chil... |
http://localhost:8080/rtsclient/loginform.faces
Url jnp://localhost:1099
Application Server Type jboss40
Datasource jdbc/ilogDataSource
User rtsAdmin
Password rtsAdmin
The above is for jboss.
Now i have deployed RTS onto Sun Application Server. And i want to configure the jndi such that.
My RTS client can actually... | To configure your RTS (Rules Technology Suite) client to access your application deployed on the Sun Application Server (now known as GlassFish), you will need to set up the JNDI resources properly. Here’s a general guide to get you started:
### 1. Create JDBC Resource
1. **Login to the GlassFish Admin Console**: Ope... | 12,881 | [
{
"from": "human",
"value": "http://localhost:8080/rtsclient/loginform.faces\nUrl jnp://localhost:1099\nApplication Server Type jboss40\nDatasource jdbc/ilogDataSource\nUser rtsAdmin\nPassword rtsAdmin\nThe above is for jboss.\nNow i have deployed RTS onto Sun Application Server. And i want to configur... |
Given a small set of entities (say, 10 or fewer) to insert, delete, or update in an application, what is the best way to perform the necessary database operations? Should multiple queries be issued, one for each entity to be affected? Or should some sort of XML construct that can be parsed by the database engine be use... | When dealing with a small set of entities (10 or fewer), you have several options for performing database operations like insert, delete, or update. Each approach has its pros and cons, and the best choice often depends on the specific requirements of your application, the database system you're using, and your team's ... | 11,993 | [
{
"from": "human",
"value": "Given a small set of entities (say, 10 or fewer) to insert, delete, or update in an application, what is the best way to perform the necessary database operations? Should multiple queries be issued, one for each entity to be affected? Or should some sort of XML construct that ca... |
I'm creating an ORM in PHP, and I've got a class 'ORM' which basically creates an object corresponding to a database table (I'm aiming for similar to/same functionality as an ActiveRecord pattern.) ORM itself extends 'Database', which sets up the database connection.
So, I can call: $c = new Customer();
$c->name = 'Jo... | Your approach to building an Object-Relational Mapping (ORM) system in PHP using the ActiveRecord pattern is quite common. In terms of whether or not to extend the `ORM` class, it really depends on your design goals and how you want to manage your models. Here are some considerations to help you make your decision:
##... | 12,743 | [
{
"from": "human",
"value": "I'm creating an ORM in PHP, and I've got a class 'ORM' which basically creates an object corresponding to a database table (I'm aiming for similar to/same functionality as an ActiveRecord pattern.) ORM itself extends 'Database', which sets up the database connection. \nSo, I can... |
Is it possible for items in a WIn32 TreeView control to have variable heights when using NM_CUSTOMDRAW?
Right now, I can successfully select variable sized fonts in the dc in NM_CUSTOMDRAW, but the item texts get clipped.
| In a Win32 TreeView control, the standard behavior doesn't support variable item heights directly. However, you can implement a workaround to achieve variable heights using the `NM_CUSTOMDRAW` notification. The clipping issue you're facing likely stems from the fact that the control doesn't know about the variable heig... | 8,755 | [
{
"from": "human",
"value": "Is it possible for items in a WIn32 TreeView control to have variable heights when using NM_CUSTOMDRAW?\nRight now, I can successfully select variable sized fonts in the dc in NM_CUSTOMDRAW, but the item texts get clipped.\n"
},
{
"from": "gpt",
"value": "In a Win32 ... |
I have this in a page :
<textarea id="taEditableContent" runat="server" rows="5"></textarea>
<ajaxToolkit:DynamicPopulateExtender ID="dpeEditPopulate" runat="server" TargetControlID="taEditableContent"
ClearContentsDuringUpdate="true" PopulateTriggerControlID="hLink" ServicePath="/Content.asmx"
ServiceM... | The issue you're encountering with the `<textarea>` not displaying line breaks correctly from the response of your web service is due to how line breaks are handled in HTML versus how they are represented in plain text.
When you're working with a `<textarea>`, the line breaks should be represented by the newline chara... | 12,438 | [
{
"from": "human",
"value": "I have this in a page :\n<textarea id=\"taEditableContent\" runat=\"server\" rows=\"5\"></textarea>\n<ajaxToolkit:DynamicPopulateExtender ID=\"dpeEditPopulate\" runat=\"server\" TargetControlID=\"taEditableContent\"\n ClearContentsDuringUpdate=\"true\" PopulateTriggerCont... |
Our application is structured something like:
UI <--> REST API <--> Workflow <--> Business Logic <--> DAL <--> DB
However, I am seeing a few examples where it looks like people are doing
UI <--> Workflow <--> REST API <--> Business Logic <--> DAL <--> DB
Is this my imagination? Or is the second option considered a vi... | The structure of your application, where the UI interacts directly with the REST API, is a common and widely accepted design pattern. This setup allows for a clear separation of concerns between the user interface, the API that handles communication and data retrieval, and the underlying business logic and data access ... | 15,458 | [
{
"from": "human",
"value": "Our application is structured something like:\nUI <--> REST API <--> Workflow <--> Business Logic <--> DAL <--> DB\nHowever, I am seeing a few examples where it looks like people are doing\nUI <--> Workflow <--> REST API <--> Business Logic <--> DAL <--> DB\nIs this my imagina... |
I've been having trouble to make a JFormattedTextField to use dates with the format dd/MM/yyyy. Specifically, as the user types, the cursor should "jump" the slashes, and get directly to the next number position.
Also, the JFormattedTextField must verify if the date entered is valid, and reject it somehow if the date i... | Creating a `JFormattedTextField` in Java Swing for date input that behaves as you've described can be accomplished using a custom `AbstractFormatter` and implementing some input validation. Below is a complete example of how you might achieve this.
### Step 1: Custom Formatter
We'll create a custom formatter that enf... | 8,669 | [
{
"from": "human",
"value": "I've been having trouble to make a JFormattedTextField to use dates with the format dd/MM/yyyy. Specifically, as the user types, the cursor should \"jump\" the slashes, and get directly to the next number position.\nAlso, the JFormattedTextField must verify if the date entered i... |
I have a class to parse a matrix that keeps the result in an array member:
class Parser
{
...
double matrix_[4][4];
};
The user of this class needs to call an API function (as in, a function I have no control over, so I can't just change its interface to make things work more easily) that looks like this:
void api... | You're correct in your observation that C++ treats multidimensional arrays quite differently from pointers, and this can lead to some confusion when trying to interface with API functions that expect a specific array type.
To answer your question: No, making `matrix_` public is not the only way to achieve this. While ... | 14,431 | [
{
"from": "human",
"value": "I have a class to parse a matrix that keeps the result in an array member:\nclass Parser\n{\n ...\n double matrix_[4][4];\n};\n\nThe user of this class needs to call an API function (as in, a function I have no control over, so I can't just change its interface to make things ... |
Each time a python file is imported that contains a large quantity of static regular expressions, cpu cycles are spent compiling the strings into their representative state machines in memory.
a = re.compile("a.*b")
b = re.compile("c.*d")
...
Question: Is it possible to store these regular expressions in a cache on di... | Yes, it is indeed possible to cache pre-compiled regular expressions to avoid the overhead of compiling them every time a Python file is imported. Although the `re` objects themselves cannot be directly pickled or marshaled due to their complexity, you can achieve this by storing the regular expressions in a serialized... | 13,540 | [
{
"from": "human",
"value": "Each time a python file is imported that contains a large quantity of static regular expressions, cpu cycles are spent compiling the strings into their representative state machines in memory.\na = re.compile(\"a.*b\")\nb = re.compile(\"c.*d\")\n...\n\nQuestion: Is it possible t... |
I have been trying to get around this error for a day now and have not had much luck. I have a VS 2008 project that uses the embedded Crystal Reports which of course runs fine locally, but when deploying to my remote server the reports will no longer run.
I gathered that it was because I didn't have the right Crystal... | When deploying a Visual Studio project that uses Crystal Reports, it can be a challenge if the necessary components are not available on the remote server. If you're encountering a missing reference to `CrystalDecisions.ReportAppServer.ClientDoc`, you generally need to have the proper Crystal Reports runtime installed ... | 15,752 | [
{
"from": "human",
"value": "I have been trying to get around this error for a day now and have not had much luck. I have a VS 2008 project that uses the embedded Crystal Reports which of course runs fine locally, but when deploying to my remote server the reports will no longer run.\nI gathered that it w... |
We've got an interesting case where we are trying to determine how different instances of our app were launched. Is there any way for .NET to be able to query another running instance and get the command line parameters passed to that instance? I've not been able to find any way to do it in .NET so far, so I thought I'... | In .NET, directly querying another running instance of an application to retrieve its command-line parameters isn't natively supported. However, there are a few approaches you can take to achieve this. Here are a couple of methods:
### 1. Using Windows API
You can use the Windows API to query the command line of anoth... | 11,898 | [
{
"from": "human",
"value": "We've got an interesting case where we are trying to determine how different instances of our app were launched. Is there any way for .NET to be able to query another running instance and get the command line parameters passed to that instance? I've not been able to find any way... |
I need to find a way to get at the request/response streams inside of the webbrowser winforms control and see that it's not real intuitive. For example, I need to be able to modify post data when a user clicks a submit button. It looks like you have to register for some MSHTML COM events to do so, but am unsure which I... | To modify request/response streams in the `WebBrowser` control in WinForms, you're correct that it can be somewhat challenging because the `WebBrowser` control is a wrapper around Internet Explorer's rendering engine. It doesn't expose low-level hooks for directly modifying HTTP requests and responses. However, you can... | 13,480 | [
{
"from": "human",
"value": "I need to find a way to get at the request/response streams inside of the webbrowser winforms control and see that it's not real intuitive. For example, I need to be able to modify post data when a user clicks a submit button. It looks like you have to register for some MSHTML C... |
I want to have a PHP script send a XML formatted string to another PHP script that resides on a different server in a different part of town.
Is there any nice, clean way of doing this?
(PHP5 and all the latest software available)
| Yes, you can send an XML formatted string from one PHP script to another using various methods. One of the most straightforward and clean ways to achieve this is by using `cURL`, which is a powerful PHP library for making HTTP requests.
Here's a step-by-step guide on how to implement this:
### Step 1: Create the Send... | 12,623 | [
{
"from": "human",
"value": "I want to have a PHP script send a XML formatted string to another PHP script that resides on a different server in a different part of town.\nIs there any nice, clean way of doing this?\n(PHP5 and all the latest software available)\n"
},
{
"from": "gpt",
"value": "Y... |
When I was in China my company's website was blocked for about 24 hours.
I assume it was the "Great Chinese Firewall" but I was wondering if there is any way that I can find out exactly where a packet or TCP/IP connection gets blocked.
I was able to verify that it wasn't being blocked at our end(I used the local host f... | Understanding where packets are being blocked, especially in a complex environment like China's Great Firewall (GFW), can be quite challenging. Here are some approaches and tools that could help you identify where and how a connection is being blocked:
### 1. **Traceroute with Different Protocols and Ports:**
- Sta... | 12,822 | [
{
"from": "human",
"value": "When I was in China my company's website was blocked for about 24 hours.\nI assume it was the \"Great Chinese Firewall\" but I was wondering if there is any way that I can find out exactly where a packet or TCP/IP connection gets blocked.\nI was able to verify that it wasn't bei... |
Ok, so we have clients and those clients get to customize their web facing page. One option we are giving them is to be able to change the color of a graphic (it's like a framish-looking bar) using one of those hex wheels or whatever.
So, I've thought about it, and I don't know where to start. I am sending comps out t... | It sounds like you're looking to implement a feature that allows clients to customize the color of an image (specifically, a graphic like a "framerish-looking bar") on their web pages by entering hex color values. Here's a general approach on how to implement this functionality, assuming you're working with a web appli... | 11,466 | [
{
"from": "human",
"value": "Ok, so we have clients and those clients get to customize their web facing page. One option we are giving them is to be able to change the color of a graphic (it's like a framish-looking bar) using one of those hex wheels or whatever. \nSo, I've thought about it, and I don't kno... |
I'm wondering, and in need, of strategies that can be applied to reducing low-level locking.
However the catch here is that this is not new code (with tens of thousands of lines of C++ code) for a server application, so I can't just rewrite the whole thing.
I fear there might not be a solution to this problem by now (t... | Reducing low-level locking in an existing codebase, especially one as extensive as yours, can be a challenging task, particularly when it involves legacy C++ code that wasn’t originally designed with concurrency in mind. However, there are strategies that you can implement to minimize the impact of locks without needin... | 10,596 | [
{
"from": "human",
"value": "I'm wondering, and in need, of strategies that can be applied to reducing low-level locking.\nHowever the catch here is that this is not new code (with tens of thousands of lines of C++ code) for a server application, so I can't just rewrite the whole thing.\nI fear there might ... |
Here is what I have:
context "Create ingredient from string" do
context "1 cups butter" do
setup do
@ingredient = Ingredient.create(:ingredient_string => "1 cups butter")
end
should "return unit" do
assert_equal @ingredient.unit, 'cups'
end
... | Certainly! You can reduce duplication in your test suite by using a helper method to define the setup and assertions for each ingredient test case. By extracting the common logic, you can streamline your test code. Here's how you might refactor your tests:
```ruby
context "Create ingredient from string" do
def test_... | 15,972 | [
{
"from": "human",
"value": "Here is what I have:\n context \"Create ingredient from string\" do\n context \"1 cups butter\" do\n\n setup do\n @ingredient = Ingredient.create(:ingredient_string => \"1 cups butter\")\n end\n\n should \"return unit\" do\n a... |
I want to display an error message on my asp.net application. This message is a warning message, this is the way I did it:
CmdCalcInvoke.Attributes["onclick"] = "return confirm('Are you sure you want to calculate the certification? WARNING: If the quarter has not finished, all the partners status will change')";
The c... | In a standard JavaScript `confirm` dialog, you cannot customize the appearance of the message, such as making a word bold or changing its color. The `confirm` dialog is rendered by the browser and has a fixed styling which does not allow for any HTML formatting or CSS styling.
However, there are alternative approaches... | 11,343 | [
{
"from": "human",
"value": "I want to display an error message on my asp.net application. This message is a warning message, this is the way I did it:\nCmdCalcInvoke.Attributes[\"onclick\"] = \"return confirm('Are you sure you want to calculate the certification? WARNING: If the quarter has not finished, a... |
I'm currently working on a class that calculates the difference between two objects. I'm trying to decide what the best design for this class would be. I see two options:
1) Single-use class instance. Takes the objects to diff in the constructor and calculates the diff for that.
public class MyObjDiffer {
public M... | When designing a class to handle the calculation of differences between two objects, both options you presented have their merits, but they come with different implications in terms of design principles and usability. Let's discuss the pros and cons of each approach to help guide your decision.
### Option 1: Single-us... | 10,700 | [
{
"from": "human",
"value": "I'm currently working on a class that calculates the difference between two objects. I'm trying to decide what the best design for this class would be. I see two options:\n1) Single-use class instance. Takes the objects to diff in the constructor and calculates the diff for t... |
I would like to know if there is some way to share a variable or an object between two or more Servlets, I mean some "standard" way. I suppose that this is not a good practice but is a easier way to build a prototype.
I don't know if it depends on the technologies used, but I'll use Tomcat 5.5
I want to share a Vector... | In a Java web application using Servlets, there are a few standard ways to share data between different servlets. Since you're using Tomcat 5.5, the following methods can work for you. However, remember that these methods are generally not recommended for production use, especially if you're dealing with complex data o... | 15,175 | [
{
"from": "human",
"value": "I would like to know if there is some way to share a variable or an object between two or more Servlets, I mean some \"standard\" way. I suppose that this is not a good practice but is a easier way to build a prototype.\nI don't know if it depends on the technologies used, but I... |
I want to create a UITableView with varying row heights, and I'm trying to accomplish this by creating UILabels inside the UITableViewCells.
Here's my code so far:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"EntryCell";
... | To create a `UITableView` with cells of varying heights based on the content of `UILabels`, you need to follow a few steps to properly configure your cell and ensure the table view calculates the correct row heights.
Here’s a revised version of your code and the steps you should take:
1. **Use Auto Layout**: Instead ... | 11,166 | [
{
"from": "human",
"value": "I want to create a UITableView with varying row heights, and I'm trying to accomplish this by creating UILabels inside the UITableViewCells.\nHere's my code so far:\n- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {\n sta... |
Let's say you have a function that returns a date:
Date myFunc(paramA, paramB){
//conditionally return a date?
}
Is it appropriate to return null from this function? This seems ugly because it forces clients to check for null.
The "null object" pattern is an implementation pattern that addresses this concern.
I'm ... | When designing a function that returns a date, it's important to consider how clients of your function will handle the return value. Returning `null` can indeed lead to `NullPointerExceptions` and force clients to do extra null checks. There are several common design patterns and alternatives you can use to improve thi... | 14,101 | [
{
"from": "human",
"value": "Let's say you have a function that returns a date:\nDate myFunc(paramA, paramB){\n //conditionally return a date?\n}\n\nIs it appropriate to return null from this function? This seems ugly because it forces clients to check for null.\nThe \"null object\" pattern is an impleme... |
I spent hours researching the problem, and just want to share a solution in case you ever need to implement paging for asp:DataList in .NET 2.0.
My specific requirement was to have "Previous" and "Next" links and page number links.
| Implementing paging for an `asp:DataList` in .NET 2.0 can be achieved with a combination of server-side logic and appropriate markup in your ASP.NET page. Below is a simple example demonstrating how to set up paging with "Previous" and "Next" links and page number links.
### Step 1: Define the ASPX Page
In your ASPX ... | 9,046 | [
{
"from": "human",
"value": "I spent hours researching the problem, and just want to share a solution in case you ever need to implement paging for asp:DataList in .NET 2.0.\nMy specific requirement was to have \"Previous\" and \"Next\" links and page number links. \n"
},
{
"from": "gpt",
"value... |
I need some sort of interactive chart control for my .NET-based web app. I have some wide XY charts, and the user should be able to interactively scroll and zoom into a specific window on the x axis. Something that acts similar to the google finance control would be nice, but without the need for the date labels or t... | If you're looking for an interactive chart control for a .NET-based web application that allows for scrolling and zooming on an XY chart without the need for date labels or Flash, there are several libraries you can consider:
1. **Chart.js**:
- **Description**: A popular JavaScript library for creating responsive c... | 11,158 | [
{
"from": "human",
"value": "I need some sort of interactive chart control for my .NET-based web app. I have some wide XY charts, and the user should be able to interactively scroll and zoom into a specific window on the x axis. Something that acts similar to the google finance control would be nice, but ... |
I was asked to do a code review and report on the feasibility of adding a new feature to one of our new products, one that I haven't personally worked on until now. I know it's easy to nitpick someone else's code, but I'd say it's in bad shape (while trying to be as objective as possible). Some highlights from my code ... | You've conducted a thorough review of the codebase, and your observations indicate significant architectural and design issues. The decision between refactoring the existing code and rewriting it from scratch can be complex and often depends on several factors. Here are some considerations to help you make an informed ... | 12,607 | [
{
"from": "human",
"value": "I was asked to do a code review and report on the feasibility of adding a new feature to one of our new products, one that I haven't personally worked on until now. I know it's easy to nitpick someone else's code, but I'd say it's in bad shape (while trying to be as objective as... |
I would like to subscribe to the ItemCommand event of a Reorderlist I have on my page. The front end looks like this...
<cc1:ReorderList id="ReorderList1" runat="server" CssClass="Sortables" Width="400" OnItemReorder="ReorderList1_ItemReorder" OnItemCommand="ReorderList1_ItemCommand">
...
<asp:ImageButton ID="btnDele... | In your setup, it looks like you're trying to subscribe to the `ItemCommand` event of the `ReorderList` control both through markup (using `OnItemCommand` attribute) and in the `Page_Load` method. However, having both is unnecessary and could lead to confusion.
Here are some key points to ensure the `ItemCommand` eve... | 13,538 | [
{
"from": "human",
"value": "I would like to subscribe to the ItemCommand event of a Reorderlist I have on my page. The front end looks like this...\n<cc1:ReorderList id=\"ReorderList1\" runat=\"server\" CssClass=\"Sortables\" Width=\"400\" OnItemReorder=\"ReorderList1_ItemReorder\" OnItemCommand=\"Reorde... |
Preferably free tools if possible.
Also, the option of searching for multiple regular expressions and each replacing with different strings would be a bonus.
| If you're looking for free tools that can help you search for multiple regular expressions and replace them with different strings, there are several options available. Here are a few tools you can consider:
### 1. **Notepad++**
- **Platform:** Windows
- **Description:** Notepad++ is a popular text editor that support... | 9,379 | [
{
"from": "human",
"value": "Preferably free tools if possible.\nAlso, the option of searching for multiple regular expressions and each replacing with different strings would be a bonus.\n"
},
{
"from": "gpt",
"value": "If you're looking for free tools that can help you search for multiple regu... |
I'm in the unfortunate position of having to implement a drop-down cascading menu on a site I'm building. I'm looking for a Suckerfish-style solution that is primarily CSS-based and works on a simple set of nested ULs and LIs.
Son of Suckerfish seems like the way to go, but I don't like the way it just disappears the ... | To implement a drop-down cascading menu with a delay before disappearing, you can build upon the Son of Suckerfish concept while adding some custom JavaScript for the delay. Here’s how you can achieve a multi-level, CSS-based drop-down menu with a mouseout delay:
### HTML Structure
First, set up your HTML with nested... | 5,136 | [
{
"from": "human",
"value": "I'm in the unfortunate position of having to implement a drop-down cascading menu on a site I'm building. I'm looking for a Suckerfish-style solution that is primarily CSS-based and works on a simple set of nested ULs and LIs.\nSon of Suckerfish seems like the way to go, but I ... |
I am implementing a comment control that allows a person to select comments and have them sent to specified departments. The email needs to be formatted in a specific way, and I was wondering what the best way to do this would be.
Should I just hard code all of the style information into one massive method, or should ... | When it comes to implementing an email formatting system for your comment control, there are a few best practices to consider regarding maintainability, readability, and flexibility. Here are two primary approaches with their pros and cons:
### Option 1: Hardcoding Styles in a Method
**Pros:**
- Simple and straightfo... | 7,483 | [
{
"from": "human",
"value": "I am implementing a comment control that allows a person to select comments and have them sent to specified departments. The email needs to be formatted in a specific way, and I was wondering what the best way to do this would be.\nShould I just hard code all of the style infor... |
I have a ARM11 based hardware board which runs a Linux kernel ver. 2.6.21.5-cfs-v19. I have my application running on this ARM-LINUX board. To do source level debugging, of my application I used to use gdb from command prompt of the linux board, that was with some earlier version of the board linux version.
With this ... | Finding a compatible version of `gdb` for a specific, older version of Linux, especially on ARM architecture, can be challenging. Here are some steps and resources you might consider to obtain `gdb` for your board:
### 1. Precompiled Binaries
You might be able to find a precompiled binary for `gdb` for ARM architectur... | 11,862 | [
{
"from": "human",
"value": "I have a ARM11 based hardware board which runs a Linux kernel ver. 2.6.21.5-cfs-v19. I have my application running on this ARM-LINUX board. To do source level debugging, of my application I used to use gdb from command prompt of the linux board, that was with some earlier versio... |
I want to ask how other programmers are producing Dynamic SQL strings for execution as the CommandText of a SQLCommand object.
I am producing parameterized queries containing user-generated WHERE clauses and SELECT fields. Sometimes the queries are complex and I need a lot of control over how the different parts are bu... | Creating dynamic SQL queries can be complex, especially when dealing with user-generated input, aggregate functions, and various clauses that can change based on user requirements. While your current approach is functional, it’s understandable that it can become challenging to maintain and read. Here are several strate... | 14,524 | [
{
"from": "human",
"value": "I want to ask how other programmers are producing Dynamic SQL strings for execution as the CommandText of a SQLCommand object.\nI am producing parameterized queries containing user-generated WHERE clauses and SELECT fields. Sometimes the queries are complex and I need a lot of c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.