instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I'm using Grails to send a large number of HTML emails. I use the SimpleTemplateEngine to create my email bodies in this fashion:
def ccIdToEmailMap = [:]
def emailTemplateFile = Utilities.retrieveFile("email${File.separator}emailTemplate.gtpl")
def engine = new SimpleTemplateEngine()
def clientContacts = ClientContac... | It sounds like you're experiencing a performance issue or resource exhaustion when generating a large number of emails with the SimpleTemplateEngine. Here are a few potential reasons and corresponding solutions to address the freezing issue:
### Potential Reasons and Solutions
1. **Resource Exhaustion**:
- **Memo... | 48,984 | [
{
"from": "human",
"value": "I'm using Grails to send a large number of HTML emails. I use the SimpleTemplateEngine to create my email bodies in this fashion:\ndef ccIdToEmailMap = [:]\ndef emailTemplateFile = Utilities.retrieveFile(\"email${File.separator}emailTemplate.gtpl\")\ndef engine = new SimpleTemp... |
How can I refer a custom function in xml? Suppose that I have a function written in Java and want it to refer by the xml tag, how is this possible?
Current senario: I am using XACML2.0 which contains xml tags and I want to refer some function in Java that will talk to the backend data, I'm unable to refer a function i... | In XACML (eXtensible Access Control Markup Language), you typically use XML to define policies and rules for access control decisions. However, integrating custom Java functions directly into XACML can be a bit complex because XACML itself does not directly support invoking Java methods.
Here are some strategies you c... | 43,412 | [
{
"from": "human",
"value": "How can I refer a custom function in xml? Suppose that I have a function written in Java and want it to refer by the xml tag, how is this possible?\nCurrent senario: I am using XACML2.0 which contains xml tags and I want to refer some function in Java that will talk to the back... |
Background:
I have an old web CMS that stored content in XML files, one XML file per page. I am in the process of importing content from that CMS into a new one, and I know I'm going to need to massage the existing XML in order for the import process to work properly.
Existing XML:
<page>
<audience1>true</audience>... | To achieve your goal of modifying the existing XML files to include the new `<audiences>` node with a comma-delimited list of the `audienceN` nodes that are set to `true`, you can use a programming language like Python, which is well-suited for XML manipulation. Python provides libraries such as `xml.etree.ElementTree`... | 48,703 | [
{
"from": "human",
"value": "Background:\nI have an old web CMS that stored content in XML files, one XML file per page. I am in the process of importing content from that CMS into a new one, and I know I'm going to need to massage the existing XML in order for the import process to work properly.\nExisting... |
I'd like to create an application that would run on Google's appengine.
However, this application needs to be able to generate PDFs dynamically.
How could I do this?
| Creating an application on Google App Engine (GAE) that generates PDFs dynamically can be accomplished by using various libraries and services. Here's a step-by-step guide to get you started:
### Step 1: Set Up Your Google App Engine Project
1. **Create a Google Cloud Project**: Go to the Google Cloud Console, create... | 46,861 | [
{
"from": "human",
"value": "I'd like to create an application that would run on Google's appengine.\nHowever, this application needs to be able to generate PDFs dynamically.\nHow could I do this?\n"
},
{
"from": "gpt",
"value": "Creating an application on Google App Engine (GAE) that generates ... |
I have a multi file C program. I'd like the user to be able to specify different debugging levels at run time.
What is the best way to implement this?
I was thinking of having a debug(level, "message") type function exported and used everywhere. Any better/other ideas?
| Using a `debug(level, "message")` function is indeed a common and effective approach for implementing debugging levels in a multi-file C program. Here’s a structured way to go about it, along with some considerations and enhancements:
### Implementation Steps
1. **Define Debug Levels**: Start by defining the possible... | 48,229 | [
{
"from": "human",
"value": "I have a multi file C program. I'd like the user to be able to specify different debugging levels at run time.\nWhat is the best way to implement this?\nI was thinking of having a debug(level, \"message\") type function exported and used everywhere. Any better/other ideas?\n"
... |
I have heard that uploading your website with FTP is now for n00bs, but it's the only way I've known how for the 8 or so years I've been building websites. Apparently all the buzz now is using a version control system, like SVN or Git, and somehow using SSH to upload only the files that have changed (if I understand c... | It's great that you're looking to modernize your workflow! Using version control systems (VCS) like Git, along with secure upload methods like SSH, can greatly enhance your development process and collaboration abilities. Here's a comprehensive guide to help you get started.
### Understanding Version Control Systems (... | 48,070 | [
{
"from": "human",
"value": "I have heard that uploading your website with FTP is now for n00bs, but it's the only way I've known how for the 8 or so years I've been building websites. Apparently all the buzz now is using a version control system, like SVN or Git, and somehow using SSH to upload only the f... |
I have some radio buttons inside a <div> container which I show and hide via jQuery effect. When the container hides in Firefox, the radio buttons are fine and the values reappear when the container reappears. However, in IE, the radio buttons first clear the checked radio button and then hides. You can see it happe... | Yes, this is a known issue with Internet Explorer, where the checked state of radio buttons (and checkboxes) can behave inconsistently when using jQuery effects like `.hide()` and `.show()`. This often happens because the way these effects manipulate the DOM can cause IE to lose track of the checked state.
To work aro... | 45,299 | [
{
"from": "human",
"value": "I have some radio buttons inside a <div> container which I show and hide via jQuery effect. When the container hides in Firefox, the radio buttons are fine and the values reappear when the container reappears. However, in IE, the radio buttons first clear the checked radio but... |
Anyone have an pointers on an easy way to consume a search.twitter.com feed with ASP.Net? I tried using the RSSToolKit, but it doesn't provide anything for parsing the and other tags in the feed.
For example: I want to parse this feed: http://search.twitter.com/search.atom?q=c%23 and make it appear on a page just lik... | To consume and parse the Twitter search feed using ASP.NET, you can use the `HttpClient` class to fetch the feed and then parse the Atom feed using LINQ to XML or other parsing techniques. The `RSSToolKit` might not meet your needs for this specific Atom format, but using built-in libraries in .NET will give you more c... | 49,905 | [
{
"from": "human",
"value": "Anyone have an pointers on an easy way to consume a search.twitter.com feed with ASP.Net? I tried using the RSSToolKit, but it doesn't provide anything for parsing the and other tags in the feed. \nFor example: I want to parse this feed: http://search.twitter.com/search.atom?q=... |
I'm trying to make a front end for all my music and video files on a spare PC I have but have come up against a bit of a road block. I originally wanted to stream the movies (avi, mpeg, flv etc) using a flash media player but after a bit of searching it seems that flash can only stream flv's. Obviously, I don't want to... | It sounds like you're trying to set up a media streaming solution that can handle a variety of video formats without the need for conversion. Here are a few options you can consider to improve the reliability and performance of your media streaming setup:
### 1. Use HTML5 Video Tag
HTML5 provides native support for v... | 48,248 | [
{
"from": "human",
"value": "I'm trying to make a front end for all my music and video files on a spare PC I have but have come up against a bit of a road block. I originally wanted to stream the movies (avi, mpeg, flv etc) using a flash media player but after a bit of searching it seems that flash can only... |
We are given an undirected graph G = (V, E) and two vertices s, t ∈ V . We consider simple
paths between s and t. A path is simple if every vertex is visited at most once.
Are the following in P or NP-complete?
Does an efficient algorithm polynomial time exist for the following?
"n" represents the number of vertices in... | Let's analyze each of the questions you presented regarding paths in an undirected graph \( G = (V, E) \) with two vertices \( s \) and \( t \).
1. **Is there a simple path from s to t of length at most \( n/100 \)?**
**Analysis:** This problem can be solved in polynomial time by modifying a breadth-first search ... | 49,889 | [
{
"from": "human",
"value": "We are given an undirected graph G = (V, E) and two vertices s, t ∈ V . We consider simple\npaths between s and t. A path is simple if every vertex is visited at most once.\nAre the following in P or NP-complete?\nDoes an efficient algorithm polynomial time exist for the followi... |
I am new to unittesting and currently have a problem with finding a decent way to test methods that contain branches.
I created a small demo method I hope could be used to explain the problem.
public void ExportAccounts()
{
int emptyAccounts = 0;
int nonEmptyAccounts = 0;
int errorous = 0;
string o... | Unit testing methods with branches can indeed be tricky, but with some best practices in mind, you can create effective tests that verify your method's behavior while minimizing code duplication and side effects. Let's address your questions one by one:
### 1. Should I input a list of accounts that are empty and non-e... | 47,418 | [
{
"from": "human",
"value": "I am new to unittesting and currently have a problem with finding a decent way to test methods that contain branches. \nI created a small demo method I hope could be used to explain the problem.\npublic void ExportAccounts()\n{\n int emptyAccounts = 0;\n int nonEmptyAcco... |
Following Alan Green's "Naming Java classes without Manager" I've started hunting *Manager classes in my own code.
How would you rename the following class? ServiceLoader, maybe? but it doesn't "load" anything from anywhere.
class ServiceManager
{
public bool IsRunning { get; };
public void Start();
public ... | Given your description of the `ServiceManager` class, it sounds like its primary responsibilities are to control the lifecycle of a .NET Remoting service, specifically starting, stopping, and restarting the service. Since "Manager" classes often imply a broad range of responsibilities and can lead to ambiguity in namin... | 47,677 | [
{
"from": "human",
"value": "Following Alan Green's \"Naming Java classes without Manager\" I've started hunting *Manager classes in my own code.\nHow would you rename the following class? ServiceLoader, maybe? but it doesn't \"load\" anything from anywhere.\nclass ServiceManager\n{\n public bool IsRunni... |
I'm currently playing around with the PopupControlExtender in the ajaxToolkit and can't quite get the functionality I want.
I'm trying to display a free floating "help" panel for an input form.
Once the user presses the help button on the form the panel pops up and displays no problem however once I click back on the m... | Yes, it is possible to keep the PopupControlExtender visible until the user explicitly closes it. By default, the PopupControlExtender is designed to close when it loses focus or when the user clicks outside of the popup. However, you can achieve the desired behavior by using a combination of JavaScript and ASP.NET AJA... | 49,785 | [
{
"from": "human",
"value": "I'm currently playing around with the PopupControlExtender in the ajaxToolkit and can't quite get the functionality I want.\nI'm trying to display a free floating \"help\" panel for an input form.\nOnce the user presses the help button on the form the panel pops up and displays ... |
I've created a model using SQL Server Reporting Services. When I try to create a report using the Report Builder, I can drag an entity to the report, followed by a nested sub-entity. I get the two-level grouping as expected.
However, I cannot add a third level entity to the relationship, no matter which combination I t... | In SQL Server Reporting Services (SSRS) and Report Builder, working with multi-level entity relationships can sometimes be tricky due to the way data is structured and how relationships are defined. Here are several steps you can take to enable and troubleshoot multi-level entity relationships in Report Builder:
### 1... | 45,912 | [
{
"from": "human",
"value": "I've created a model using SQL Server Reporting Services. When I try to create a report using the Report Builder, I can drag an entity to the report, followed by a nested sub-entity. I get the two-level grouping as expected.\nHowever, I cannot add a third level entity to the rel... |
Suppose you store instances of a class in a relational table. How would you go about persisting a static attribute of that class? For example:
class WebSiteUser {
private static $common_homepage_content;
private $username;
private $password_hash;
...
}
Corresponding to:
CREATE TABLE web_site_users
(
... | To persist a static attribute like `$common_homepage_content` in a relational database, you have several options, since static attributes are shared across all instances of a class and are not tied to individual records. Here's how you can approach it:
### Option 1: Separate Configuration Table
Create a separate tabl... | 47,181 | [
{
"from": "human",
"value": "Suppose you store instances of a class in a relational table. How would you go about persisting a static attribute of that class? For example:\nclass WebSiteUser {\n private static $common_homepage_content;\n private $username;\n private $password_hash;\n ...\n}\n\nC... |
I understand that Firefox addins can be created in Javascript and Chrome.
How do they run advanced graphics applications such as CoolIris ?
(source: cooliris.com)
| CoolIris was a visual media browser that enabled users to experience web content in a more immersive and visually appealing way. It utilized advanced graphics capabilities to present images and videos in a 3D-like environment. While specific details about the implementation of CoolIris may not be publicly available, I ... | 49,973 | [
{
"from": "human",
"value": "I understand that Firefox addins can be created in Javascript and Chrome.\nHow do they run advanced graphics applications such as CoolIris ?\n\n(source: cooliris.com) \n"
},
{
"from": "gpt",
"value": "CoolIris was a visual media browser that enabled users to experien... |
I don't have any experience with creating Skins, but I have the tools to do it (Fireworks, etc.). I'm used to doing as much as I can with styles, but, I want to break out of the mold and start using Skins more, especially so that the look and feel of my apps can be ported to other platforms. Where do I get started?
| Getting started with creating skins for applications can be an exciting journey, especially if you want to enhance the look and feel of your apps and ensure consistency across different platforms. Here’s a step-by-step guide to help you start creating skins:
### 1. **Understand the Basics of Skins**
- **Definition*... | 49,465 | [
{
"from": "human",
"value": "I don't have any experience with creating Skins, but I have the tools to do it (Fireworks, etc.). I'm used to doing as much as I can with styles, but, I want to break out of the mold and start using Skins more, especially so that the look and feel of my apps can be ported to oth... |
I'm looking for something like alert(), but that doesn't "pause" the script.
I want to display an alert and allow the next command, a form submit(), to continue. So the page will be changing after the alert is displayed, but it won't wait till the user has clicked OK.
Is there something like this or is it just one of t... | In JavaScript, the `alert()` function is synchronous, which means it blocks the execution of code until the user dismisses the alert. If you want to display a message without pausing the execution of your code, you will need to use a different method, such as creating a custom modal or using `setTimeout()` to allow the... | 47,762 | [
{
"from": "human",
"value": "I'm looking for something like alert(), but that doesn't \"pause\" the script.\nI want to display an alert and allow the next command, a form submit(), to continue. So the page will be changing after the alert is displayed, but it won't wait till the user has clicked OK.\nIs the... |
We're using Silverlight 2 with ADO.NET dataservices and to test the silverlight page we used a service in the same domain which works fine. We then decided to try use a proxy or intermediate service (sitting in the same domain as the Silverlight app) which basically just surfaces a service sitting in another domain (by... | The error message you are encountering suggests that there is a limitation in the way the Data Service handles query options, particularly when using the `Expand` method in your query. Let's break down some potential causes and solutions for this issue.
### Understanding the Problem
1. **Composability in Queries**: L... | 48,039 | [
{
"from": "human",
"value": "We're using Silverlight 2 with ADO.NET dataservices and to test the silverlight page we used a service in the same domain which works fine. We then decided to try use a proxy or intermediate service (sitting in the same domain as the Silverlight app) which basically just surface... |
Could you give some guidance for good resources (books, online tutorials) about embedded assembly in C/C++ for windows?
| Certainly! Here are some recommended resources for learning embedded assembly in C/C++ for Windows:
### Books
1. **"Programming Embedded Systems in C and C++" by Michael Barr and Anthony Massa**
- This book provides a solid foundation in embedded systems programming and includes discussions on using assembly langu... | 47,087 | [
{
"from": "human",
"value": "Could you give some guidance for good resources (books, online tutorials) about embedded assembly in C/C++ for windows?\n"
},
{
"from": "gpt",
"value": "Certainly! Here are some recommended resources for learning embedded assembly in C/C++ for Windows:\n\n### Books\n... |
I am now writing a image viewer, It is used for view thumbnails.
As it is ugly, I decide to draw shadow round thumbnail.
There is background color.
I am using StretchDIBits to draw a shadow image at the location of thumbnail.
However it is really annoying that it cover the background color...
When the background is whi... | Creating a perfect shadow effect for thumbnails, especially when dealing with variable background colors, can be a bit tricky. When you use shadows, the goal is usually to simulate a soft, semi-transparent shadow that blends seamlessly into any background. Here's a step-by-step guide on how to achieve that:
### 1. Cre... | 49,967 | [
{
"from": "human",
"value": "I am now writing a image viewer, It is used for view thumbnails.\nAs it is ugly, I decide to draw shadow round thumbnail.\nThere is background color.\nI am using StretchDIBits to draw a shadow image at the location of thumbnail.\nHowever it is really annoying that it cover the b... |
Can anyone send me a c code to divide 2 64bit numbers. My compiler only supports 32/32 division.
Thanx & Regards
Mani
| Certainly! To perform division of two 64-bit numbers using only 32-bit operations, you can implement a function that utilizes repeated subtraction or bit manipulation to achieve the desired result. Here's an example of how to do this using C:
```c
#include <stdio.h>
#include <stdint.h>
typedef struct {
uint32_t h... | 47,449 | [
{
"from": "human",
"value": "Can anyone send me a c code to divide 2 64bit numbers. My compiler only supports 32/32 division.\nThanx & Regards\nMani\n"
},
{
"from": "gpt",
"value": "Certainly! To perform division of two 64-bit numbers using only 32-bit operations, you can implement a function th... |
How can I send a picture in Java ME ? Maybe using base64 decode and the send in post form via http request
| Sending an image in Java ME (Micro Edition) can be achieved by encoding the image in Base64 and sending it as part of an HTTP POST request. Java ME does not have built-in support for Base64, so you may need to implement it or find a library to do the encoding.
Here's a step-by-step guide on how to send a picture using... | 49,487 | [
{
"from": "human",
"value": "How can I send a picture in Java ME ? Maybe using base64 decode and the send in post form via http request\n"
},
{
"from": "gpt",
"value": "Sending an image in Java ME (Micro Edition) can be achieved by encoding the image in Base64 and sending it as part of an HTTP P... |
Sorry for asking an implement my feature question type question last time. I am new to Stackoverflow.com and also to php that's why.
What I was trying to ask is:
I have made a admin account. Members have registration page so a member will register. When user registers in the database table I will have a field for whi... | You're on the right track with your PHP code! To add functionality for deleting and approving members, you can include buttons or radio buttons in your HTML table. You will need to modify the code that generates the table to include these buttons and ensure they send the correct parameters to your PHP script when click... | 48,167 | [
{
"from": "human",
"value": "Sorry for asking an implement my feature question type question last time. I am new to Stackoverflow.com and also to php that's why.\nWhat I was trying to ask is:\nI have made a admin account. Members have registration page so a member will register. When user registers in the... |
My Windows application runs under Wine, but the installation is a bit of a headache for laymen, and the wrappers I've seen online (PlayOnLinux, Wine Doors) require even more packages to be installed. Is there a way to make a package that will install Wine if the user needs it to be installed, install the application an... | Creating a package that simplifies the installation of a Windows application under Wine can certainly help make the process more user-friendly. Below is a general guide to help you package your application along with Wine (if necessary) for a seamless installation experience. This method assumes you are targeting a Lin... | 45,822 | [
{
"from": "human",
"value": "My Windows application runs under Wine, but the installation is a bit of a headache for laymen, and the wrappers I've seen online (PlayOnLinux, Wine Doors) require even more packages to be installed. Is there a way to make a package that will install Wine if the user needs it to... |
I would like to generate some JavaScript on the server side in ASP.Net MVC. Is there a view engine that supports this? Ideally I would like to be able to get JavaScript from an url like:
http://myapp/controller/action.js
I've looked at the MonoRail project, and they seem to have this feature, but it's very lacking in... | In ASP.NET MVC, you can achieve the ability to render JavaScript from a controller action by simply returning different views based on the request. The approach you can take is to define a controller action that serves both HTML and JavaScript depending on the requested URL.
Here’s a step-by-step guide on how to do it... | 44,898 | [
{
"from": "human",
"value": "I would like to generate some JavaScript on the server side in ASP.Net MVC. Is there a view engine that supports this? Ideally I would like to be able to get JavaScript from an url like: \nhttp://myapp/controller/action.js\n\nI've looked at the MonoRail project, and they seem to... |
For a particular segment of Java code, I'd like to measure:
Execution time (most likely thread execution time)
Memory usage
CPU load (specifically attributable to the code segment)
I'm a relative Java novice and am not familiar with how this might be achieved. I've been referred to JMX, however I'm not sure how that ... | To achieve performance measurement in Java in a simple and lightweight manner, you can create a custom `MetricLogger` class that tracks execution time, memory usage, and CPU load. Below, I'll provide a basic example of such a class, and then show you how to use it to measure your code segment.
### MetricLogger Class
... | 46,853 | [
{
"from": "human",
"value": "For a particular segment of Java code, I'd like to measure:\n\nExecution time (most likely thread execution time)\nMemory usage\nCPU load (specifically attributable to the code segment)\n\nI'm a relative Java novice and am not familiar with how this might be achieved. I've been ... |
I have a small app/site on a dev server with a data table in SQL Server [varchar(40),varchar(40),varchar(MAX)]. I want to take the data table and push it to the live server. I have tried exporting in txt, Excel and Access but every time there is an error on import related to not being able to parse due to the data in t... | Transferring data between SQL Server databases when you have constraints like network access issues can be challenging, but there are several methods you can use to accomplish this. Given your situation, where you want a manual approach without needing to access the live server directly, here are a few options:
### 1.... | 49,792 | [
{
"from": "human",
"value": "I have a small app/site on a dev server with a data table in SQL Server [varchar(40),varchar(40),varchar(MAX)]. I want to take the data table and push it to the live server. I have tried exporting in txt, Excel and Access but every time there is an error on import related to not... |
I would like to enhance Eclipse so that when I press a custom key combo--say Ctrl + Shift + E--then it will run a command on the current file (if my current buffer is foo.c then it will run `mycommand foo.c' in foo.c's directory).
| To enhance Eclipse with a custom key combination that runs a command on the currently open file in your editor, you can create a simple Eclipse plugin or use an external tool. Here’s a general guide on how to set this up using an Eclipse plugin approach.
### Method 1: Creating a Custom Eclipse Plugin
1. **Set Up the ... | 48,376 | [
{
"from": "human",
"value": "I would like to enhance Eclipse so that when I press a custom key combo--say Ctrl + Shift + E--then it will run a command on the current file (if my current buffer is foo.c then it will run `mycommand foo.c' in foo.c's directory). \n"
},
{
"from": "gpt",
"value": "To... |
There's a webpage that enables service providers to check customers insurance validity.
The page comprises a text box to enter the customer's insurance number, a button to send the number for checking and a frame in which the results appear.
It's a java server page and it's https. As you can probably tell I'm clueless ... | Certainly! If you want to check insurance numbers directly from your program without needing to display the webpage, you can interact with the server programmatically. There are typically two ways to achieve this:
1. **Using HTTP Requests**: If the webpage sends the insurance number to the server via an HTTP request (... | 47,565 | [
{
"from": "human",
"value": "There's a webpage that enables service providers to check customers insurance validity.\nThe page comprises a text box to enter the customer's insurance number, a button to send the number for checking and a frame in which the results appear.\nIt's a java server page and it's ht... |
I am trying to get the OpenNetCF.Net FTP Components working with my PDA application. I am struggling to get it doing any more than connecting to the server and wondered if anyone knew of any sample code I could use to learn how to use it with?
I need to be able to download and upload files, as well as determining the d... | Using the OpenNetCF.Net FTP components can be a great way to manage file transfers in your PDA application. Below, I provide a simple example to demonstrate how to connect to an FTP server, upload files, download files, and retrieve the size of files.
Before you begin, make sure you have the OpenNetCF.Net library inte... | 47,123 | [
{
"from": "human",
"value": "I am trying to get the OpenNetCF.Net FTP Components working with my PDA application. I am struggling to get it doing any more than connecting to the server and wondered if anyone knew of any sample code I could use to learn how to use it with?\nI need to be able to download and ... |
What are the steps to get Team Foundation Server running unit tests when a given build runs?
What are the caveats / pitfalls / workarounds a dev or sysadmin should be aware of when setting up a TFS server to do this for the first time?
What are common troubleshooting steps for unit test problems during builds?
| Setting up Team Foundation Server (TFS) to run unit tests as part of a build process involves several steps. Here’s a detailed guide, along with potential pitfalls and troubleshooting strategies.
### Steps to Set Up Unit Tests in TFS Build:
1. **Install Necessary Tools**:
- Ensure that the build agent has the requ... | 49,100 | [
{
"from": "human",
"value": "What are the steps to get Team Foundation Server running unit tests when a given build runs? \nWhat are the caveats / pitfalls / workarounds a dev or sysadmin should be aware of when setting up a TFS server to do this for the first time? \nWhat are common troubleshooting steps... |
I need to let users pick a CSV or XLS file from their filesystem and press Submit and have PHP open it, look at it, decide if it is valid and then put the data in MySQL.
I am stuck on how the server gets the file they pick from their desktop?
Do I have to upload the file they pick to a temp directory?
Can I just take ... | To handle file uploads in a web application using PHP, the typical process involves allowing the user to select a file from their filesystem and upload it to the server. Here’s a step-by-step guide on how to achieve this, along with some example code.
### 1. HTML Form for File Upload
Create a simple HTML form that al... | 48,064 | [
{
"from": "human",
"value": "I need to let users pick a CSV or XLS file from their filesystem and press Submit and have PHP open it, look at it, decide if it is valid and then put the data in MySQL.\nI am stuck on how the server gets the file they pick from their desktop? \nDo I have to upload the file they... |
I'm researching possible options how to organize data storage for an Erlang application. The data it supposed to use is basically a huge collection of binary blobs indexed by short string ids. Each blob is under 10 Kb but there are many of them. I'd expect that in total they would have size up to 200 Gb so obviously it... | Your requirements for organizing data storage in an Erlang application present a few interesting challenges, particularly given the size of the data and the performance targets you're aiming for. Here are some options to consider based on your requirements:
### 1. **Berkeley DB with Erlang**
Using the **EDTK Berkeley... | 48,763 | [
{
"from": "human",
"value": "I'm researching possible options how to organize data storage for an Erlang application. The data it supposed to use is basically a huge collection of binary blobs indexed by short string ids. Each blob is under 10 Kb but there are many of them. I'd expect that in total they wou... |
I'm trying to make a webpage that allows the uploading of multiple files at the same times. I will limit the file extensions to the most common images like JPG, JPEG, PNG and GIF.
I've done some research on this and everywhere I look it's flash this and flash that.
I don't want to use flash really. Especially with Flas... | Creating a webpage that allows users to upload multiple files without using Flash can be accomplished easily with HTML and JavaScript, along with PHP for server-side processing. Here’s a simple way to do this.
### HTML & JavaScript
You can use a combination of `input` elements of type `file` and JavaScript to dynamic... | 47,876 | [
{
"from": "human",
"value": "I'm trying to make a webpage that allows the uploading of multiple files at the same times. I will limit the file extensions to the most common images like JPG, JPEG, PNG and GIF.\nI've done some research on this and everywhere I look it's flash this and flash that.\nI don't wan... |
How do I calculate the time period between 2 dates in C (any library, etc.)?
The program should take two (local) dates as input and provide the duration period between them as output.
For example,
startDate = OCT-09-1976 and endDate = OCT-09-2008
should show a duration of 32 years.
startDate = OCT-09-1976 and endD... | To calculate the duration between two dates in C, you can make use of the `struct tm` from the `<time.h>` library, which allows you to handle date and time easily. You will need to parse the input dates, convert them into `time_t` format, and then compute the difference.
Here's an example program that does just that:
... | 46,129 | [
{
"from": "human",
"value": "How do I calculate the time period between 2 dates in C (any library, etc.)? \nThe program should take two (local) dates as input and provide the duration period between them as output. \nFor example,\nstartDate = OCT-09-1976 and endDate = OCT-09-2008 \nshould show a duration of... |
PySmell seems like a good starting point.
I think it should be possible, PySmell's idehelper.py does a majority of the complex stuff, it should just be a case of giving it the current line, offering up the completions (the bit I am not sure about) and then replacing the line with the selected one.
>>> import idehelper
... | It sounds like you are making significant progress in integrating PySmell for Python code completion in TextMate! Your script shows a solid understanding of how to use PySmell's `idehelper` module to provide suggestions based on the current context of the code being edited.
To further enhance your completion system, c... | 43,023 | [
{
"from": "human",
"value": "PySmell seems like a good starting point.\nI think it should be possible, PySmell's idehelper.py does a majority of the complex stuff, it should just be a case of giving it the current line, offering up the completions (the bit I am not sure about) and then replacing the line wi... |
Lets say a have a table
t (id int, someVeryLongText text)
and want to store the result of a query:
select someVeryLongText from t where id = 1
in the file.
In Managemant Studio when I select Tools->Options->QueryResults and choose Results to File It seems that only the first 8192 characters are written to the file.
I... | In SQL Server Management Studio (SSMS), when you export query results to a file, there is indeed a default limit on the number of characters that are written out, especially for text data types. By default, the maximum number of characters that can be outputted for text fields is limited to 8192 characters when saving ... | 44,671 | [
{
"from": "human",
"value": "Lets say a have a table\nt (id int, someVeryLongText text)\n\nand want to store the result of a query:\nselect someVeryLongText from t where id = 1\n\nin the file.\nIn Managemant Studio when I select Tools->Options->QueryResults and choose Results to File It seems that only the ... |
What is the smartest way to get an entity with a field of type List persisted?
Command.java
package persistlistofstring;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.... | The issue you're facing arises from the way JPA (Java Persistence API) handles collections. Specifically, JPA does not support directly persisting `List<String>` as a field type in an entity class. The error message indicates that the type `List` does not satisfy JPA's requirements for serialized mapping.
To successfu... | 48,460 | [
{
"from": "human",
"value": "What is the smartest way to get an entity with a field of type List persisted?\nCommand.java\npackage persistlistofstring;\n\nimport java.io.Serializable;\nimport java.util.ArrayList;\nimport java.util.List;\nimport javax.persistence.Basic;\nimport javax.persistence.Entity;\nimp... |
I am seeking insight on how to have each row in a Gridview expand to show a DIV or PANEL that has a form of elements, i.e. a simple form of textboxes, etc. I don't need a nested Gridview showing results or using DynamicPopulate.
I have tried some techniques from a DataGrid Expandable Row, but ran into some problems try... | To achieve an expandable row in a GridView that displays a DIV or Panel with a form, you can use a combination of JavaScript, CSS, and ASP.NET features. Below is a general approach to create an expandable GridView with a simple form.
### Steps to Implement Expandable Rows in GridView
1. **GridView Setup**: Create a ... | 47,928 | [
{
"from": "human",
"value": "I am seeking insight on how to have each row in a Gridview expand to show a DIV or PANEL that has a form of elements, i.e. a simple form of textboxes, etc. I don't need a nested Gridview showing results or using DynamicPopulate.\nI have tried some techniques from a DataGrid Expa... |
I want to send a message to a thread and handle it in the thread. How can I do this in Delphi? I guess PostMessage is the way to go, but the examples I've seen so far are describing the other way, i.e. from the thread to main thread.
| Yes, you can use `PostMessage` in Delphi to send a message from the main thread to a worker thread. This allows you to communicate with the thread in a safe manner, as `PostMessage` adds the message to the thread's message queue and the thread can handle it when it processes messages.
Here's a simple example to illust... | 46,097 | [
{
"from": "human",
"value": "I want to send a message to a thread and handle it in the thread. How can I do this in Delphi? I guess PostMessage is the way to go, but the examples I've seen so far are describing the other way, i.e. from the thread to main thread.\n"
},
{
"from": "gpt",
"value": "... |
I have a little python script that pulls emails from a POP mail address and dumps them into a file (one file one email)
Then a PHP script runs through the files and displays them.
I am having an issue with ISO-8859-1 (Latin-1) encoded email
Here's an example of the text i get: =?iso-8859-1?Q?G=EDsli_Karlsson?= and Sj=E... | To handle emails encoded in ISO-8859-1 correctly, you need to decode the headers (like the `From` and `Subject` fields) and also handle the body content appropriately, especially if it contains special characters.
The `rfc822` module can help you with decoding headers, but you should also ensure that you are writing ... | 49,763 | [
{
"from": "human",
"value": "I have a little python script that pulls emails from a POP mail address and dumps them into a file (one file one email)\nThen a PHP script runs through the files and displays them.\nI am having an issue with ISO-8859-1 (Latin-1) encoded email\nHere's an example of the text i get... |
Sorry if this is a really basic question but I struggling with how I should attack this. I am trying to wrap up some commands for a OLE object, the basic spec looks like this:
Set Window window_id
//Units is part of the position setter.
[ Position ( x, y ) [ Units paper_units ] ]
[ Width win_width [ Units... | Your approach of using polymorphism to handle the optional commands is a solid one. This design not only promotes separation of concerns but also enhances the maintainability and readability of your code. By encapsulating the command-related logic into separate classes, you can easily add or modify commands without imp... | 47,122 | [
{
"from": "human",
"value": "Sorry if this is a really basic question but I struggling with how I should attack this. I am trying to wrap up some commands for a OLE object, the basic spec looks like this:\nSet Window window_id\n //Units is part of the position setter.\n [ Position ( x, y ) [ Units pa... |
As a passionate JavaScript developer, I'd like to know if there's any quality Podcasts out there, devoted to JavaScript. (Both video and audio).
I am currently subscribing to:
YUI Theater
Audible Ajax
| Great to hear that you're diving into JavaScript! Here are some quality podcasts (both audio and video) that you might find interesting:
### Audio Podcasts
1. **JavaScript Jabber**
- A weekly podcast featuring a panel of developers discussing various JavaScript topics, frameworks, tools, and best practices.
2. *... | 29,349 | [
{
"from": "human",
"value": "As a passionate JavaScript developer, I'd like to know if there's any quality Podcasts out there, devoted to JavaScript. (Both video and audio).\nI am currently subscribing to:\n\nYUI Theater\nAudible Ajax\n\n"
},
{
"from": "gpt",
"value": "Great to hear that you're ... |
How do i set up a subdomain w/o a TLD? i have this set under my main config
<VirtualHost *:80>
ServerName bbs.67.777.777.777 #fake bc my server can easily be hacked ATM :(
DocumentRoot /var/www/phpBB
</VirtualHost>
when i goto bbs.serveripaddress i get a Address Not Found error. if i put that above my main con... | When you're trying to set up a subdomain with an IP address instead of a Top-Level Domain (TLD), you are running into a few issues that could be causing your problem. Here's how you can set it up correctly in Apache on your Debian system.
### Steps to Configure Apache for a Subdomain Using an IP Address
1. **Configur... | 44,467 | [
{
"from": "human",
"value": "How do i set up a subdomain w/o a TLD? i have this set under my main config\n<VirtualHost *:80>\n ServerName bbs.67.777.777.777 #fake bc my server can easily be hacked ATM :(\n DocumentRoot /var/www/phpBB\n</VirtualHost>\n\nwhen i goto bbs.serveripaddress i get a Address N... |
I am trying to load a flash player onto an html page. The page is housed in my root folder. The flv and swf are both in a folder titled "videos".
The user forum located on the website that created the flash component offered this...make sure the path is pointing to the folder. Right, I get that. But I'm not sure where... | To ensure your Flash player loads correctly, you'll want to verify that the paths to your SWF and FLV files are set correctly. From the code you provided, here are the key points to check:
1. **File Structure**: Ensure your HTML file is located in the root folder and that the "videos" folder is in the same root direct... | 48,813 | [
{
"from": "human",
"value": "I am trying to load a flash player onto an html page. The page is housed in my root folder. The flv and swf are both in a folder titled \"videos\". \nThe user forum located on the website that created the flash component offered this...make sure the path is pointing to the folde... |
public static IQueryable<TResult> ApplySortFilter<T, TResult>(this IQueryable<T> query, string columnName)
where T : EntityObject
{
var param = Expression.Parameter(typeof(T), "o");
var body = Expression.PropertyOrField(param,columnName);
var sortExpression = Expression.Lambda(body, param);
return query.Orde... | You're correct in observing that in C#, type parameters such as `TSortColumn` cannot be determined at runtime due to type erasure and compile-time type inference limitations. However, there is a workaround to achieve dynamic sorting without specifying the type at compile time. You can use reflection and a more dynamic ... | 48,281 | [
{
"from": "human",
"value": "public static IQueryable<TResult> ApplySortFilter<T, TResult>(this IQueryable<T> query, string columnName)\n where T : EntityObject\n{\n var param = Expression.Parameter(typeof(T), \"o\");\n var body = Expression.PropertyOrField(param,columnName);\n\n var sortExpression = Ex... |
What's the best way to identify if a string (is or) might be UTF-8 encoded? The Win32 API IsTextUnicode isn't of much help here. Also, the string will not have an UTF-8 BOM, so that cannot be checked for. And, yes, I know that only characters above the ASCII range are encoded with more than 1 byte.
| To determine if a string is or might be UTF-8 encoded without relying on a BOM (Byte Order Mark) or the Win32 API `IsTextUnicode`, you can follow a series of checks based on the properties of UTF-8 encoding. Here’s a methodical approach:
### UTF-8 Encoding Rules
UTF-8 is a variable-length encoding system, which means ... | 48,603 | [
{
"from": "human",
"value": "What's the best way to identify if a string (is or) might be UTF-8 encoded? The Win32 API IsTextUnicode isn't of much help here. Also, the string will not have an UTF-8 BOM, so that cannot be checked for. And, yes, I know that only characters above the ASCII range are encoded wi... |
How do I best capture the HTML (in my instance, for logging) rendered by an aspx-page?
I dont want to have to write back to the page using Response.Write, since it messes up my site layout.
Using the Response.OutputStream or Response.Output's stream results in an ArgumentException ({System.ArgumentException: Stream was... | Capturing the rendered HTML of an ASPX page without altering the page output directly can be achieved using a few methods in ASP.NET. One common approach is to use the `HtmlTextWriter` class along with a `StringWriter` to capture the HTML output in a way that doesn't interfere with the layout or require modifications t... | 48,695 | [
{
"from": "human",
"value": "How do I best capture the HTML (in my instance, for logging) rendered by an aspx-page?\nI dont want to have to write back to the page using Response.Write, since it messes up my site layout.\nUsing the Response.OutputStream or Response.Output's stream results in an ArgumentExcep... |
We have about 10 applications that basically do the same thing, all written using the Wizard Control for .Net 2.0. The flow they follow is pretty simple:
1. User selects option from a drop downs.
2. Next page has more options more narrowed.
3. User sees confirmation page.
4. Report is generated.
Some of these applica... | Merging multiple applications that share similar functionality can be a complex task, but leveraging configuration tables to drive the wizard flow is a common and effective approach. Below are some suggestions to streamline your design and implementation:
### 1. **Define a Modular Architecture**
- **Separation of C... | 45,039 | [
{
"from": "human",
"value": "We have about 10 applications that basically do the same thing, all written using the Wizard Control for .Net 2.0. The flow they follow is pretty simple:\n1. User selects option from a drop downs.\n2. Next page has more options more narrowed.\n3. User sees confirmation page.\n4... |
I have a flex app that uploads files to a server. The server requires authentication to be able to upload. In IE the upload works fine. However in FF and Safari, it does not upload. I have seen people all over with this same problem but no answers. Don't fail me now stackoverflowers.
| File uploads in Flex applications can encounter issues due to differences in how browsers handle requests, especially when authentication is involved. Since you're experiencing issues with Firefox and Safari, while Internet Explorer works fine, here are a few suggestions to troubleshoot and potentially resolve the prob... | 44,512 | [
{
"from": "human",
"value": "I have a flex app that uploads files to a server. The server requires authentication to be able to upload. In IE the upload works fine. However in FF and Safari, it does not upload. I have seen people all over with this same problem but no answers. Don't fail me now stackoverflo... |
I work in a medium sized team and I run into these painfully large class files on a regular basis. My first tendency is to go at them with a knife, but that usually just makes matters worse and puts me into a bad state of mind.
For example, imagine you were just given a windows service to work on. Now there is a bug in... | Dealing with large, monolithic classes—often referred to as "God classes"—can be challenging, especially when you need to maintain or fix bugs within them. Here’s a structured approach you can follow, along with strategies for managing your emotions while navigating such situations:
### 1. **Start with Understanding**... | 48,350 | [
{
"from": "human",
"value": "I work in a medium sized team and I run into these painfully large class files on a regular basis. My first tendency is to go at them with a knife, but that usually just makes matters worse and puts me into a bad state of mind.\nFor example, imagine you were just given a windows... |
I need to create a DHTML menu with the specified features, but I can't figure out how to do it. Here's what I need:
All items are layed out horizontally. If they would be wider than the screen, two little arrows appear on the right side of the menu that allow to scroll it. Something like this:
+--------+--------+------... | Creating a DHTML menu with the specified features involves using HTML for structure, CSS for styling, and JavaScript for functionality. Below is a simple implementation that meets your requirements.
### HTML
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content=... | 46,881 | [
{
"from": "human",
"value": "I need to create a DHTML menu with the specified features, but I can't figure out how to do it. Here's what I need:\nAll items are layed out horizontally. If they would be wider than the screen, two little arrows appear on the right side of the menu that allow to scroll it. Some... |
Today I'm starting a little project to create a Django based school administration program. I'm currently designing the models and their corresponding relationships. Being rather new to Django and relational databases in general, I would like some input.
Before I show you the current model layout, you need to have an i... | Your project idea for a Django-based school administration program is ambitious and well-thought-out, and your model layout already reflects a strong foundation. Below, I offer feedback on your existing models, suggest improvements, and discuss possible enhancements:
### General Suggestions:
1. **Use of `ForeignKey` a... | 41,700 | [
{
"from": "human",
"value": "Today I'm starting a little project to create a Django based school administration program. I'm currently designing the models and their corresponding relationships. Being rather new to Django and relational databases in general, I would like some input.\nBefore I show you the c... |
I have a chunk of MDX that I'd like to throw into an ASP.NET form. Hopefully just binding the results to a gridview. Are there any good links or snippets? I'm using VB.NET, but I am able to port from C# if no Visual Basic code is available.
| Certainly! To bind the results of an MDX query to a GridView in an ASP.NET application using VB.NET, you will typically go through the following steps:
1. **Establish a connection to the Analysis Services**.
2. **Execute the MDX query**.
3. **Load the results into a data structure** (like a DataTable).
4. **Bind that ... | 44,416 | [
{
"from": "human",
"value": "I have a chunk of MDX that I'd like to throw into an ASP.NET form. Hopefully just binding the results to a gridview. Are there any good links or snippets? I'm using VB.NET, but I am able to port from C# if no Visual Basic code is available.\n"
},
{
"from": "gpt",
... |
I'm looking for a cross-browser way of wrapping long portions of text that have no breaking spaces (e.g. long URLs) inside of divs with pre-determined widths.
Here are some solutions I've found around the web and why they don't work for me:
overflow : hidden / auto / scroll - I need the entire text to be visible witho... | Dealing with long strings of text, such as URLs, that do not contain natural break points can be challenging, especially when trying to ensure cross-browser compatibility. Here are a few additional techniques and considerations that could help you wrap long text while ensuring it remains visible without scrolling:
###... | 49,420 | [
{
"from": "human",
"value": "I'm looking for a cross-browser way of wrapping long portions of text that have no breaking spaces (e.g. long URLs) inside of divs with pre-determined widths.\nHere are some solutions I've found around the web and why they don't work for me:\n\noverflow : hidden / auto / scroll ... |
I have a ASP.Net TreeView control that I am binding to an XML data source. I'm wanting to be able to control which nodes are expanded and which ones are collapsed in the XML definition file. The Expanded='' doesn't work for me though. In the following simple example, I want Node 2 to be fully expanded.
ASP Page...
<asp... | To control the expansion state of nodes in a TreeView control bound to an XML data source, you can implement a custom binding logic in your ASP.NET code-behind. The `Expanded` attribute in your XML doesn't directly control the TreeView's node expansion. Instead, you will need to manually set the expansion state for eac... | 49,641 | [
{
"from": "human",
"value": "I have a ASP.Net TreeView control that I am binding to an XML data source. I'm wanting to be able to control which nodes are expanded and which ones are collapsed in the XML definition file. The Expanded='' doesn't work for me though. In the following simple example, I want Node... |
I've got in an ASP.NET application this process :
Start a connection
Start a transaction
Insert into a table "LoadData" a lot of values with the SqlBulkCopy class with a column that contains a specific LoadId.
Call a stored procedure that :
read the table "LoadData" for the specific LoadId.
For each line does a lot ... | To tackle the problem of concurrent transactions on the `LoadData` table without causing blocking or timeouts, there are several strategies you can consider:
### 1. Optimize the Transaction Scope
First, you should try to limit the transaction scope to minimize locks. Instead of wrapping the entire process in a single ... | 46,292 | [
{
"from": "human",
"value": "I've got in an ASP.NET application this process :\n\nStart a connection\nStart a transaction\nInsert into a table \"LoadData\" a lot of values with the SqlBulkCopy class with a column that contains a specific LoadId.\nCall a stored procedure that :\n\n\nread the table \"LoadData... |
I have a page with a number of ListViews that I want users to be able to sort and page through. Rather than postback and rebind the entire page each time, I would like to do it via jQuery/AJAX selectively for the control in question. I am comfortable making the client-side call to a WebMethod in my page - my question i... | To update a ListView with data returned from a WebMethod using jQuery and AJAX without an UpdatePanel in ASP.NET, you can follow these steps:
### Step 1: Set up your WebMethod
First, make sure you have a WebMethod in your ASP.NET page that can return the data you need. For example:
```csharp
[System.Web.Services.Web... | 46,288 | [
{
"from": "human",
"value": "I have a page with a number of ListViews that I want users to be able to sort and page through. Rather than postback and rebind the entire page each time, I would like to do it via jQuery/AJAX selectively for the control in question. I am comfortable making the client-side call ... |
I have a java applet that is embedded in html using the object-comment-embed method. I would like to resize the applet whenever the browser window is resized. I have found solutions around the internet, but they all work based on the deprecated applet tag.
Also, when trying a setSize() call on my embed element in FireB... | To resize your Java applet correctly in the browser, you need to modify the HTML and JavaScript code. It appears you are using the `setSize` method, which does not apply in this context for `<object>` or `<embed>` elements. Instead, you need to change the `width` and `height` attributes directly.
Here's a modified ve... | 49,823 | [
{
"from": "human",
"value": "I have a java applet that is embedded in html using the object-comment-embed method. I would like to resize the applet whenever the browser window is resized. I have found solutions around the internet, but they all work based on the deprecated applet tag.\nAlso, when trying a s... |
I have the following scenario:
1. .NET UI side uses Logging App Block to write to a flat file
2. Unmanaged Windows Service uses a proprietary logger to write to the same file as 1.
Question: Is there a way to enable FlatFile TraceListener to close it's file handle once the entry is logged so that the Windows Service co... | It seems like you've already found a solution by invoking `Dispose()` on the `FlatFileTraceListener`, which effectively closes the file handle after logging an entry, thus allowing your unmanaged Windows Service to access the same file. This is a valid approach, and it's great that you've identified it.
However, if yo... | 48,882 | [
{
"from": "human",
"value": "I have the following scenario:\n1. .NET UI side uses Logging App Block to write to a flat file\n2. Unmanaged Windows Service uses a proprietary logger to write to the same file as 1.\nQuestion: Is there a way to enable FlatFile TraceListener to close it's file handle once the en... |
Does anyone have an example of setting up a text field where users can enter their name and/or email address to submit it online to a high score database? I would like to have
it be similar to the form that pops up when you attempt to download something from the AppStore, where you put in your email and password then... | Sure! To create a simple HTML form that allows users to enter their name and email address, you can follow the example below. This form will include input fields for the user's name and email, as well as "OK" and "Cancel" buttons.
Here’s a basic example of how you can set this up in HTML and CSS:
### HTML (index.html... | 47,414 | [
{
"from": "human",
"value": "Does anyone have an example of setting up a text field where users can enter their name and/or email address to submit it online to a high score database? I would like to have \nit be similar to the form that pops up when you attempt to download something from the AppStore, whe... |
I have an application into which users can upload an XSD to describe certain kinds of user data. The application needs to parse this XSD to correctly initialise various bits of database metadata (e.g. translating xs:enumerations into lists of permitted values that will populate drop-down lists). The same user-entered X... | Yes, it is possible to create a master XSD that can validate user-supplied XSDs, thereby limiting how users can describe their data. To enforce specific rules, such as disallowing the `<xs:union>` construct, you can define a schema that represents the allowed structure of the user-supplied XSD.
Below is an outline of ... | 43,980 | [
{
"from": "human",
"value": "I have an application into which users can upload an XSD to describe certain kinds of user data. The application needs to parse this XSD to correctly initialise various bits of database metadata (e.g. translating xs:enumerations into lists of permitted values that will populate ... |
I'm planning to write a javascript-based web application. I'm wondering what the best way to implement it in terms of file stucture is.
There is one main page (main.html) containing a menu and a main div section. The way it works is simple: When the user clicks on one of the links in the menu (for example 'Page 1'), th... | Your approach to structuring your JavaScript-based web application makes sense, especially given that you're prioritizing modularization by keeping JavaScript code for each page separate. However, there are a few considerations and best practices that could enhance your application’s performance, maintainability, and s... | 46,321 | [
{
"from": "human",
"value": "I'm planning to write a javascript-based web application. I'm wondering what the best way to implement it in terms of file stucture is.\nThere is one main page (main.html) containing a menu and a main div section. The way it works is simple: When the user clicks on one of the li... |
Given a DataSet, I'm left joining DataTables[1-n] onto DataTable[0]. I have created a method with a signature as follows:
public DataTable LeftJoin(DataSet ds, params JoinKey[] JoinKey)
Notes:
The return type is a DataTable, which is the resulting left join.
DataSet ds is a collection of DataTables for joining.
Join... | It looks like you're trying to create a dynamic left join using the provided `JoinKey` object in your `KeySelector` function, but you're encountering issues with how you're generating the key selector for the `GroupJoin` operation.
In your current implementation, it seems that while you're successfully extracting the... | 49,119 | [
{
"from": "human",
"value": "Given a DataSet, I'm left joining DataTables[1-n] onto DataTable[0]. I have created a method with a signature as follows:\npublic DataTable LeftJoin(DataSet ds, params JoinKey[] JoinKey)\n\nNotes:\n\nThe return type is a DataTable, which is the resulting left join.\nDataSet ds ... |
I have a few modules of block of code in VBA to run on few Access databases. I would like to know how I should proceed if I want to convert the coding to C# environment. And is it possible to implement and obtain the same results as I am getting now with Access and VBA?
I am completely new to C# at this point.
| Transitioning from VBA in Access to C# can be a significant change, but it’s certainly possible to achieve similar functionality with the right approach. Here’s how you can proceed step by step:
### 1. Understanding the Environment
- **C# Basics**: Before converting your VBA code, familiarize yourself with basic C# sy... | 49,416 | [
{
"from": "human",
"value": "I have a few modules of block of code in VBA to run on few Access databases. I would like to know how I should proceed if I want to convert the coding to C# environment. And is it possible to implement and obtain the same results as I am getting now with Access and VBA?\n I ... |
I wrote a raw TCP client for HTTP/HTTPS requests, however I'm having problems with chunked encoding responses. HTTP/1.1 is requirement therefore I should support it.
Raw TCP is a business requirement that I need to keep, therefore I can't switch to .NET HTTPWebRequest/HTTPWebResponse However if there is way to convert ... | To implement support for chunked transfer encoding in your raw TCP client for HTTP/1.1, you'll need to handle the parsing of chunked responses manually since you're working at a lower level than using the higher-level libraries. Here's a basic overview of how chunked transfer encoding works and how you can implement it... | 49,479 | [
{
"from": "human",
"value": "I wrote a raw TCP client for HTTP/HTTPS requests, however I'm having problems with chunked encoding responses. HTTP/1.1 is requirement therefore I should support it.\nRaw TCP is a business requirement that I need to keep, therefore I can't switch to .NET HTTPWebRequest/HTTPWebRe... |
We use memcache basically as an after thought to just cache query results.
Invalidation is a nightmare due to the way it was implemented. We since learned some techniques with memcache thru reading the mailing list, for example the trick to allow group invalidation of a bunch of keys. For those who know it, skip the ... | Using memcached effectively requires a good understanding of its strengths and potential pitfalls. You've already identified a great technique with sequence numbers for group invalidation. Below, I'll provide a summary of some best practices and design patterns that can help you implement memcached more efficiently.
#... | 49,147 | [
{
"from": "human",
"value": "We use memcache basically as an after thought to just cache query results.\nInvalidation is a nightmare due to the way it was implemented. We since learned some techniques with memcache thru reading the mailing list, for example the trick to allow group invalidation of a bunch ... |
I Have created an SSRS Report for retrieving 55000 records using a Stored Procedure. When
executing from the Stored Proc it is taking just 3 seconds but when executing from SSRS report it is taking more than one minute. How can I solve this problem?
| The issue you're facing, where a stored procedure runs quickly but takes significantly longer when executed through an SSRS report, is not uncommon. There are several potential reasons for this discrepancy, and you can take various steps to improve the performance of your SSRS report.
### Steps to Troubleshoot and Imp... | 46,589 | [
{
"from": "human",
"value": "I Have created an SSRS Report for retrieving 55000 records using a Stored Procedure. When \nexecuting from the Stored Proc it is taking just 3 seconds but when executing from SSRS report it is taking more than one minute. How can I solve this problem?\n"
},
{
"from": "gp... |
In a html form, I'm displaying multiple records from a table, ready for update.
Right now I use: name=<column-name>_<pk-id> value=<value> for the fields.
Then in my python-script I go for:
for key in form.keys():
if key.startswith('<name-A>_'):
update <table> set <name-A> = <value> where pk=<pk-id>
if k... | Using the approach you described, where you construct field names using a combination of column names and primary keys, is common, but it can indeed feel a bit unwieldy and error-prone, especially as the number of fields increases. Below are some more organized ways to handle multi-record updates in a form:
### Option... | 44,993 | [
{
"from": "human",
"value": "In a html form, I'm displaying multiple records from a table, ready for update.\nRight now I use: name=<column-name>_<pk-id> value=<value> for the fields.\nThen in my python-script I go for:\nfor key in form.keys():\n if key.startswith('<name-A>_'):\n update <table> se... |
We have a client application that has reference to a webservice. We had set the timeout property on the webclientprotocol object to 50 (ms) and wanted to observe what goes on. We tied up a long running webmethod that returns a huge DataSet to the client. When the default value was there, the DataSet was returned proper... | When you set the timeout property on the `WebClientProtocol` object to a very low value (like 50 milliseconds), you are defining the maximum amount of time that the client will wait for a response from the server before considering the request failed.
In your scenario, when you had the timeout set to the default value... | 49,677 | [
{
"from": "human",
"value": "We have a client application that has reference to a webservice. We had set the timeout property on the webclientprotocol object to 50 (ms) and wanted to observe what goes on. We tied up a long running webmethod that returns a huge DataSet to the client. When the default value w... |
I find that in my daily Flex/Flash work, I do this number a lot:
//Calling a function...
MyCustomObject(container.getChildAt(i)).mySpecialFunction();
The question is - is this the best way to do this? Should I do this:
//Calling a function
var tempItem:MyCustomObject = container.getChildAt(i) as MyCustomObject;
tempI... | When working with ActionScript (or similar languages) in the context of Flex/Flash, both approaches you mentioned are valid, but they come with different implications in terms of readability, performance, and best practices.
### First Approach
```actionscript
MyCustomObject(container.getChildAt(i)).mySpecialFunction()... | 46,550 | [
{
"from": "human",
"value": "I find that in my daily Flex/Flash work, I do this number a lot:\n//Calling a function...\nMyCustomObject(container.getChildAt(i)).mySpecialFunction();\n\nThe question is - is this the best way to do this? Should I do this:\n//Calling a function\nvar tempItem:MyCustomObject = c... |
I am debugging a third-party DLL for which I don't have the source code. This DLL maintains a pool of strings. I want to trap the earliest occurrence at which one of these strings is passed into a function...any function at all...
In other words, I want to detect when a pointer-to-a-null-terminated-string having a cert... | To achieve your goal of trapping when a specific format of a null-terminated string is passed into any function, you'll need to use a combination of breakpoints and memory inspection techniques. Here’s a general approach you can follow using WinDbg, which is a powerful debugger for Windows applications.
### Steps to S... | 47,297 | [
{
"from": "human",
"value": "I am debugging a third-party DLL for which I don't have the source code. This DLL maintains a pool of strings. I want to trap the earliest occurrence at which one of these strings is passed into a function...any function at all...\nIn other words, I want to detect when a pointer... |
I have a Rails app that lets a user construct a database query by filling out an extensive form. I wondered the best practice for checking form parameters in Rails. Previously, I have had my results method (the one to which the form submits) do the following:
if params[:name] && !params[:name].blank?
@name = params... | Your approach to validating form parameters in your Rails application has certainly evolved, and it's clear you're striving for a cleaner and more maintainable solution. Here are some suggestions that could help streamline your validation process and enhance the overall design:
### 1. Use Strong Parameters
Starting fr... | 49,828 | [
{
"from": "human",
"value": "I have a Rails app that lets a user construct a database query by filling out an extensive form. I wondered the best practice for checking form parameters in Rails. Previously, I have had my results method (the one to which the form submits) do the following:\nif params[:name]... |
I am trying to develop a slideshow with a pause between slides. So I'm trying to use the setTimeout statement as shown below. This is written to swap 2.jpg for 1.jpg with a pause of 10 seconds on clicking the button. But it does now work. Can anyone help me. Thanks.
<html>
<head>
<script type="text/javascript">
var t;
... | It looks like your implementation of the `setTimeout` function in the `swap` function is not set up correctly, especially for the recursive call. You need to ensure that the `swap` function continues to call itself with the next image after the specified time interval, and you should avoid using the string version of t... | 46,686 | [
{
"from": "human",
"value": "I am trying to develop a slideshow with a pause between slides. So I'm trying to use the setTimeout statement as shown below. This is written to swap 2.jpg for 1.jpg with a pause of 10 seconds on clicking the button. But it does now work. Can anyone help me. Thanks.\n<html>\n<he... |
I used to have one class for one file. For example car.cs has the class car. But as I program more classes, I would like to add them to the same file. For example car.cs has the class car and the door class, etc.
My question is good for Java, C#, PHP or any other programming language. Should I try not having multiple c... | The decision to place multiple classes in the same file or to keep each class in its own file depends on several factors, including the programming language you are using, the size and complexity of the classes, and your project's organization and coding standards. Here are some considerations for common programming la... | 46,229 | [
{
"from": "human",
"value": "I used to have one class for one file. For example car.cs has the class car. But as I program more classes, I would like to add them to the same file. For example car.cs has the class car and the door class, etc.\nMy question is good for Java, C#, PHP or any other programming la... |
I think I am pretty good with programming C# syntax. What I am looking for now is some resources, books(preferable), websites, blogs, that deal with the best way to design object oriented Desktop Applications and Web applications, especially when it comes to data and databases.
Thanks
| It's great to hear that you're comfortable with C# syntax and are looking to deepen your understanding of designing object-oriented applications. Here are some recommended resources, including books, websites, and blogs that focus on object-oriented design, architecture, and best practices for both desktop and web appl... | 46,593 | [
{
"from": "human",
"value": "I think I am pretty good with programming C# syntax. What I am looking for now is some resources, books(preferable), websites, blogs, that deal with the best way to design object oriented Desktop Applications and Web applications, especially when it comes to data and databases. ... |
Here's my scenario:
I've got a table of (let's call them) nodes. Primary key on each one is simply "node_id".
I've got a table maintaining a hierarchy of nodes, with only two columns: parent_node_id and child_node_id.
The hierarchy is maintained in a separate table because nodes can have an N:N relationship. That is ... | The best approach for fetching all ancestors in a hierarchical structure like the one you described can vary based on several factors, including the size of your dataset, the depth of the hierarchy, and the specific capabilities of your database management system (DBMS). However, I can provide some insights into both a... | 45,161 | [
{
"from": "human",
"value": "Here's my scenario:\nI've got a table of (let's call them) nodes. Primary key on each one is simply \"node_id\".\nI've got a table maintaining a hierarchy of nodes, with only two columns: parent_node_id and child_node_id.\nThe hierarchy is maintained in a separate table because... |
I'm not sure why finding any frameworks or good example projects for developing windows application is so difficult. I'm sure that for web application framework, we have Castle Project or ASP.NET MVC that are very great stuffs and have many examples that follow the best practices like IoC, Caching, and etc.
Is there s... | Yes, there are several frameworks and libraries that can help you develop Windows applications using WinForms, along with examples that follow best practices such as dependency injection (IoC), MVVM (Model-View-ViewModel), and other design patterns. Here are a few notable ones:
### Frameworks for WinForms
1. **Calibu... | 46,344 | [
{
"from": "human",
"value": "I'm not sure why finding any frameworks or good example projects for developing windows application is so difficult. I'm sure that for web application framework, we have Castle Project or ASP.NET MVC that are very great stuffs and have many examples that follow the best practice... |
I'm still learning ASP.NET and I often see code like this throughout parts of our framework:
Public MustInherit Class DBFileManager(Of F As IDBFile, FC As IDBFileContent, FT As IDBFileThumb)
Can anybody tell me what this means? Much thanks!
| In VB.NET (Visual Basic .NET), the line of code you provided defines an abstract (or base) class that uses generics. Let’s break it down step-by-step:
### Breakdown of the Code
1. **Public**: This access modifier means that the class can be accessed from any other code in the same assembly or another assembly that re... | 47,661 | [
{
"from": "human",
"value": "I'm still learning ASP.NET and I often see code like this throughout parts of our framework:\nPublic MustInherit Class DBFileManager(Of F As IDBFile, FC As IDBFileContent, FT As IDBFileThumb)\n\nCan anybody tell me what this means? Much thanks!\n"
},
{
"from": "gpt",
... |
How do I do a regexp search against a Mandarin string?
| To perform a regular expression (regexp) search against a Mandarin string, you can use regular expression libraries available in various programming languages that support Unicode. Here are some general steps and examples for different programming languages:
### 1. Python
In Python, you can use the `re` module:
```p... | 45,823 | [
{
"from": "human",
"value": "How do I do a regexp search against a Mandarin string?\n"
},
{
"from": "gpt",
"value": "To perform a regular expression (regexp) search against a Mandarin string, you can use regular expression libraries available in various programming languages that support Unicode... |
Edited:
What is the easiest way to scrape extract SharePoint list data to a separate SQL Server table? One condition: you're in a work environment where you don't control the SQL Server behind the SharePoint Server, so you can't just pull from the UserData table.
Is there there any utilities that you can use to sche... | To scrape or extract SharePoint list data to a separate SQL Server table in an environment where you don’t have direct access to the SQL Server behind SharePoint, you can consider the following approaches:
### 1. **Using SharePoint REST API or CSOM (Client-Side Object Model)**
You can use the SharePoint REST API or CS... | 49,262 | [
{
"from": "human",
"value": "Edited:\nWhat is the easiest way to scrape extract SharePoint list data to a separate SQL Server table? One condition: you're in a work environment where you don't control the SQL Server behind the SharePoint Server, so you can't just pull from the UserData table. \nIs there t... |
I use System.Web.Services.WebMethodAttribute to make a public static method of an ASP.NET page callable from a client-side script:
test.aspx.cs
[System.Web.Services.WebMethod]
public static string GetResult()
{
return "result";
}
test.aspx
<asp:ScriptManager ID="sm" runat="server" EnablePageMethods="true" />
<scr... | The issue you are encountering when using `Server.Transfer` instead of `Response.Redirect` is related to how the ASP.NET page lifecycle and routing work with web methods.
### Explanation of the Error
1. **Server.Transfer**: This method transfers the control from one page to another on the server-side. When you use `S... | 45,150 | [
{
"from": "human",
"value": "I use System.Web.Services.WebMethodAttribute to make a public static method of an ASP.NET page callable from a client-side script:\ntest.aspx.cs\n[System.Web.Services.WebMethod]\npublic static string GetResult()\n{\n return \"result\";\n}\n\ntest.aspx\n<asp:ScriptManager ID=\... |
I got this page, and have some problems with ie < 7 and opera 7.11
This is what i hoped to be the layout in all browsers, and these are the IE ones instead: ie 5.5 and ie 6.0.
the xhtml is quite simple:
print "<div id=\"page\">
<div id=\"header\">
<ul id=\"nav\">
<li><a href=\"/\" class=\"first\">Címlap<div... | It looks like you're trying to create a layout that should be consistent across various browsers, specifically for older versions of Internet Explorer (IE 5.5, 6.0) and Opera 7.11. Here are a few points to consider in order to address potential rendering issues and achieve your desired layout:
### 1. Doctype Declarati... | 49,556 | [
{
"from": "human",
"value": "I got this page, and have some problems with ie < 7 and opera 7.11\nThis is what i hoped to be the layout in all browsers, and these are the IE ones instead: ie 5.5 and ie 6.0.\nthe xhtml is quite simple:\nprint \"<div id=\\\"page\\\">\n <div id=\\\"header\\\">\n <ul id=\\\"... |
The server I'm trying to maintain is sassing me.
Among other things, I ran tload. This probably provides helpful information to someone who knows how to read this data. I do not.
It says:
1.36, 1.12, 0.59 -------------
What should I glean from this? This is our home-grown stat server, it gets a crap-ton of requests, ... | The output you're seeing from `tload` represents the load averages on your server over three different time periods: the last 1 minute, the last 5 minutes, and the last 15 minutes. In this case, the values are as follows:
- **1 minute**: 1.36
- **5 minutes**: 1.12
- **15 minutes**: 0.59
### Understanding Load Average... | 49,744 | [
{
"from": "human",
"value": "The server I'm trying to maintain is sassing me.\nAmong other things, I ran tload. This probably provides helpful information to someone who knows how to read this data. I do not.\nIt says:\n\n1.36, 1.12, 0.59 -------------\n\nWhat should I glean from this? This is our home-grow... |
I have an html table which i bind data dynamically on the server side in C#.. The problem is that I have a search button that calls a search on the DB(in a search method on the server side) based on the information from the client page. this search method loads the info from the DB and updates the html table(this is wh... | To implement pagination without using ASP.NET data controls while retaining your data in the session, you'll need to follow these steps:
1. **Store Data in Session**: As you mentioned, you're already storing the data in the session. Ensure that the data you're binding to the HTML table is obtained from the session var... | 46,071 | [
{
"from": "human",
"value": "I have an html table which i bind data dynamically on the server side in C#.. The problem is that I have a search button that calls a search on the DB(in a search method on the server side) based on the information from the client page. this search method loads the info from the... |
1 Dim x as Integer? = Nothing
2 If x = Nothing Then
3 'this is what I think will happen
4 Else
5 'this is what really happens
6 End If
The proper way to write that is "If x Is Nothing".
Is there a FXCop rule that checks for this? Or better yet, can someone show me how to write my own?
Jonathan
| Yes, you are correct that when checking for a nullable value type (like `Integer?` in VB.NET), you should use `If x Is Nothing` rather than `If x = Nothing`. This distinction is important because using `=` for this type can lead to unexpected behavior, as it is not the appropriate operator for reference type comparison... | 48,453 | [
{
"from": "human",
"value": "1 Dim x as Integer? = Nothing \n2 If x = Nothing Then \n3 'this is what I think will happen \n4 Else \n5 'this is what really happens \n6 End If \n\nThe proper way to write that is \"If x Is Nothing\".\nIs there a FXCop rule that checks for this? Or better yet, c... |
I'm trying to write a windows batch file that can delete files from subdirectories. I would rather not hard code the directory structure in, so I can use this process with other projects.
I need to delete files of X type,
I have the parent folder C:\MyProject,
There are Y subfolders C:\MyProject\?,
There are N files ... | Certainly! In a Windows batch file, you can use the `DEL` command along with the `FOR` command to delete files of a specific type from subdirectories. Below is an example batch file that demonstrates how to do this.
### Batch File Example
```batch
@echo off
setlocal
rem Set the parent directory and file extension ty... | 45,462 | [
{
"from": "human",
"value": "I'm trying to write a windows batch file that can delete files from subdirectories. I would rather not hard code the directory structure in, so I can use this process with other projects.\n\nI need to delete files of X type,\nI have the parent folder C:\\MyProject,\nThere are Y... |
In my asp.net mvc page, I want to call a RedirectToAction(actionName, controllerName, values).
The values parameter is an object that contains all the nessecary values.
Example
return RedirectToAction(redirectAction, redirectController,
new{ personId = foundId,
personEmail = foundEmail,
... | In ASP.NET MVC, if you're dealing with an unknown number of parameters that can be `null`, using an anonymous type for `RedirectToAction` can indeed lead to issues with `Uri.EscapeDataString` when passing `null` values. Since you're concerned about the exponential growth of combinations with multiple parameters, here a... | 49,806 | [
{
"from": "human",
"value": "In my asp.net mvc page, I want to call a RedirectToAction(actionName, controllerName, values). \nThe values parameter is an object that contains all the nessecary values.\nExample\nreturn RedirectToAction(redirectAction, redirectController,\n new{ personId = foundId,\n... |
Take the following hypothetical situation, how would I implement it in MVC?
All my pages sit in a Master, which has a CurrentUser property on it. This object is determined from some session user id, and then queried from the db on every page load. This object is then used throughout the site, for example to display "We... | In an MVC (Model-View-Controller) architecture, implementing a scenario where you need to manage a common user state (like `CurrentUser`), handle partial views (user controls), and maintain a responsive user interface can be achieved effectively with some design patterns and conventions.
Here's how you can implement y... | 49,624 | [
{
"from": "human",
"value": "Take the following hypothetical situation, how would I implement it in MVC?\nAll my pages sit in a Master, which has a CurrentUser property on it. This object is determined from some session user id, and then queried from the db on every page load. This object is then used throu... |
How do you correct use frame on a asp.net page, so I have a left frame and a right frame, when I click the links on the page presented in the left frame, it loads the according page in the right frame? On top of this, I need to have a master page on all the right frame's pages.
How do I do this? or is there another w... | Using frames in web development has fallen out of favor in recent years due to various issues related to usability, accessibility, and SEO. However, if you still want to implement a frame-like structure in an ASP.NET application, you can use an `iframe` to achieve a similar effect, or you can use a combination of a mas... | 45,004 | [
{
"from": "human",
"value": "How do you correct use frame on a asp.net page, so I have a left frame and a right frame, when I click the links on the page presented in the left frame, it loads the according page in the right frame? On top of this, I need to have a master page on all the right frame's pages.... |
I have a function (called "powersearch", the irony!) that searches for a set of strings across a bunch(~ 5) of fields.
The words come in as one string and are separated by spaces.
Some fields can have exact matches, others should have "contains".
(Snipped for brevety)
//Start with all colors
IQueryable<Color> q = db.... | Optimizing your query can involve several strategies, especially since you have a complex situation with potential performance issues due to a large dataset. Here are some suggestions to improve the performance of your `powersearch` function:
### 1. Index Optimization
If the database structure is not in your control, ... | 49,231 | [
{
"from": "human",
"value": "I have a function (called \"powersearch\", the irony!) that searches for a set of strings across a bunch(~ 5) of fields.\nThe words come in as one string and are separated by spaces.\nSome fields can have exact matches, others should have \"contains\". \n(Snipped for brevety)\n... |
I want something simple in order to experiment/hack. I've created a lot interpreters/compilers for c and I just want something simple. A basic BASIC :D
If you don't know any (I've done my google search...), yacc/bison is the only way?
Thx
| If you're looking for a simple BASIC interpreter to experiment with, there are a few options you can consider that don’t necessarily require you to dive deep into tools like Yacc or Bison right away. Here are some possibilities:
### 1. **Tiny BASIC**
Tiny BASIC is a minimal version of the BASIC programming language, o... | 46,836 | [
{
"from": "human",
"value": "I want something simple in order to experiment/hack. I've created a lot interpreters/compilers for c and I just want something simple. A basic BASIC :D\nIf you don't know any (I've done my google search...), yacc/bison is the only way?\nThx\n"
},
{
"from": "gpt",
"va... |
I'm working on a large web application with a lot of AJAX whose event handling has gotten out of control. I'm trying to set up an event delegation system to manage all of it, but am wondering if there's a workaround for IE's non-bubbling form submits (there are a lot of forms that get inserted/updated via AJAX). The ... | Event delegation in JavaScript can become quite complex, especially when dealing with older browsers like Internet Explorer (IE) that have specific quirks. As you've noted, form submit events do not bubble in IE, which complicates the use of a common event delegation pattern. Here are some strategies to manage form sub... | 49,440 | [
{
"from": "human",
"value": "I'm working on a large web application with a lot of AJAX whose event handling has gotten out of control. I'm trying to set up an event delegation system to manage all of it, but am wondering if there's a workaround for IE's non-bubbling form submits (there are a lot of forms t... |
Once our web application is being used on production environment we have a really hard time updating it with enhancements or bug fixes. The main reason is an initial flaw in the design of our CMS system. We have to usually spent hours to update each prod environment and many times with errors and long hours of debugg... | It sounds like you're facing several significant challenges with your CMS system that are impacting your ability to deploy updates effectively. Let's break down the issues and explore possible solutions or strategies you might consider to improve your deployment process and minimize errors.
### Key Issues Identified
... | 49,674 | [
{
"from": "human",
"value": "Once our web application is being used on production environment we have a really hard time updating it with enhancements or bug fixes. The main reason is an initial flaw in the design of our CMS system. We have to usually spent hours to update each prod environment and many t... |
I have a Template Column under which I have Placed a Dropdownlist. Now I would Like to get the selectedRow of the datagrid on selectedIndeChanged event of the dropdownlist that's inside the template Column
| To get the selected row of a `DataGrid` (or `GridView` in ASP.NET WebForms) when the selected index of a `DropDownList` inside a template column changes, you'll need to handle the `SelectedIndexChanged` event of the `DropDownList`. Here's how you can do this step by step:
### Step 1: Setting Up the Grid with TemplateC... | 49,890 | [
{
"from": "human",
"value": "I have a Template Column under which I have Placed a Dropdownlist. Now I would Like to get the selectedRow of the datagrid on selectedIndeChanged event of the dropdownlist that's inside the template Column\n"
},
{
"from": "gpt",
"value": "To get the selected row of a... |
I have a web page with 3 forms on it. Not nested, just one after the other (they are almost identical, just one hidden variable that's different). A user will only fill in one form, and I'd like to validate/etc all the forms with only one JS script.
So how, when a user clicks the submit button of form#1, do I make my... | You can certainly achieve your goal of validating only the fields of the form that the user submits by using jQuery to scope your selectors to the specific form that contains the submit button. Instead of using `$(this).parents('form')`, you can use `$(this).closest('form')` to get the closest parent form to the clicke... | 43,249 | [
{
"from": "human",
"value": "I have a web page with 3 forms on it. Not nested, just one after the other (they are almost identical, just one hidden variable that's different). A user will only fill in one form, and I'd like to validate/etc all the forms with only one JS script.\nSo how, when a user clicks... |
I'd like to know if it's possible to compile an .swf file at runtime via C# (would be called via a Flex Application). I've read some articles about using fsch.exe, but nothing that gave any concrete examples.
I'm fairly certain this is possible, so a secondary question is whether it's feasible on a medium scale. I'd li... | Compiling an SWF file at runtime via C# is indeed a challenging task, but it's possible with the right approach. Here are some insights on how you might achieve this and considerations regarding its feasibility.
### Compiling SWF Files
1. **Using `fscommand` and `fsch.exe`:**
- `fsch.exe` is a command-line tool th... | 46,770 | [
{
"from": "human",
"value": "I'd like to know if it's possible to compile an .swf file at runtime via C# (would be called via a Flex Application). I've read some articles about using fsch.exe, but nothing that gave any concrete examples.\nI'm fairly certain this is possible, so a secondary question is wheth... |
I'm building a symbol table for a project I'm working on. I was wondering what peoples opinions are on the advantages and disadvantages of the various methods available for storing and creating a symbol table.
I've done a fair bit of searching and the most commonly recommended are binary trees or linked lists or hash t... | When designing a symbol table, choosing the right data structure can significantly impact the performance and functionality of your project. Each method—binary trees, linked lists, and hash tables—comes with its own advantages and disadvantages. Here’s a breakdown of each:
### Linked Lists
**Advantages:**
1. **Simpli... | 47,996 | [
{
"from": "human",
"value": "I'm building a symbol table for a project I'm working on. I was wondering what peoples opinions are on the advantages and disadvantages of the various methods available for storing and creating a symbol table.\nI've done a fair bit of searching and the most commonly recommended ... |
In a Java application (JRE 1.5.0_12) on Windows XP, I call a native method:
public native int attachImage( ... );
... which lives in a Visual C++ 6.0 .dll. It displays an application-modal window. Problem is, the application's tray icon doesn't respond to mouseclicks while this window has focus. This is an issue becau... | The issue you're experiencing is related to how modal dialogs behave in the context of a native Windows application and the Java application's event loop. When a modal window is displayed, it typically prevents interaction with other windows in the same application, including the application’s tray icon. This is a comm... | 47,760 | [
{
"from": "human",
"value": "In a Java application (JRE 1.5.0_12) on Windows XP, I call a native method:\npublic native int attachImage( ... );\n\n... which lives in a Visual C++ 6.0 .dll. It displays an application-modal window. Problem is, the application's tray icon doesn't respond to mouseclicks while t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.