instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I am wondering how the HttpContext is maintained given that the request-response nature of the web is essentially stateless.
Is an identifier being for the HttpContext object being sent as part of the __EVENTTarget / __EVENTARGUMENTS hidden fields so that the HttpRuntime class can create the HttpContext class by readin... | Your question addresses an important aspect of web development: managing state in a stateless environment. HTTP is inherently stateless, which means that each request is independent and does not retain any context from previous requests. However, various techniques are employed to maintain state in web applications.
... | 36,816 | [
{
"from": "human",
"value": "I am wondering how the HttpContext is maintained given that the request-response nature of the web is essentially stateless.\nIs an identifier being for the HttpContext object being sent as part of the __EVENTTarget / __EVENTARGUMENTS hidden fields so that the HttpRuntime class ... |
I would like to build a web application on Castle MonoRail, I was wondering how can we use an action with extension and another action without extension? How can HTML helper generator url for us?
Ex:
http://mysite.com/Products/list
http://mysite.com/Products/abc.castle
| Building a web application with Castle MonoRail can be quite flexible regarding URL routing and action extensions. In your scenario, you want to create routes that allow for both standard actions and actions that include a specific extension (.castle).
To achieve this, you can configure the routing in your MonoRail a... | 38,352 | [
{
"from": "human",
"value": "I would like to build a web application on Castle MonoRail, I was wondering how can we use an action with extension and another action without extension? How can HTML helper generator url for us?\nEx: \n\nhttp://mysite.com/Products/list\nhttp://mysite.com/Products/abc.castle\n\n... |
When I am single stepping through one thread of a multi threaded program, the debugger gets interrupted with:
0x(some hex ref) : tdb_event_death : ret
dbx: thread has exited -- next aborted
My guess is a thread somewhere in the program I am debugging has stopped, but it's not the one I'm debugging so I can't see ... | The behavior you're experiencing with your debugger is due to the way multi-threaded applications operate. When one thread exits, the debugger is notified, and this can disrupt the debugging session of the thread you're actively stepping through.
Here are several approaches you could consider to alleviate this problem... | 36,604 | [
{
"from": "human",
"value": "When I am single stepping through one thread of a multi threaded program, the debugger gets interrupted with:\n0x(some hex ref) : tdb_event_death : ret\ndbx: thread has exited -- next aborted\n\nMy guess is a thread somewhere in the program I am debugging has stopped, but i... |
When coding, what is a good rule of thumb to keep in mind with respect to performance? There are endless ways to optimize for a specific platform and compiler, but I'm looking for answers that apply equally well (or almost) across compilers and platforms.
| When it comes to performance in coding, especially in a cross-platform context, there are several general principles or "rules of thumb" you can follow that tend to hold true regardless of the specific platform or compiler. Here are some key ones:
1. **Understand Algorithm Complexity**: Before optimizing code, ensure ... | 38,870 | [
{
"from": "human",
"value": "When coding, what is a good rule of thumb to keep in mind with respect to performance? There are endless ways to optimize for a specific platform and compiler, but I'm looking for answers that apply equally well (or almost) across compilers and platforms.\n"
},
{
"from":... |
I'm trying to figure out a way to detect files that are not opened for editing but have nevertheless been modified locally. p4 fstat returns a value headModTime for any given file, but this is the change time in the depot, which should not be equal to the filesystem's stat last modified time.
I'm hoping that there exis... | To detect files that have been modified locally but are not opened for editing in Perforce, you can employ a few different approaches without needing to perform a full sync or a diff operation. Here are some methods you can consider:
### 1. Use `p4 status` or `p4 diff -se`
- The `p4 status` command provides a summary... | 33,003 | [
{
"from": "human",
"value": "I'm trying to figure out a way to detect files that are not opened for editing but have nevertheless been modified locally. p4 fstat returns a value headModTime for any given file, but this is the change time in the depot, which should not be equal to the filesystem's stat last ... |
What is the max size of the multi line text field? Can I set it?
| The maximum size of a multi-line text field can vary depending on the platform or programming language you are using. For example:
1. **HTML**: In HTML, you can use a `<textarea>` element for multi-line text input. The size of the text that can be entered is not strictly defined by the element itself; however, it may ... | 35,916 | [
{
"from": "human",
"value": "What is the max size of the multi line text field? Can I set it?\n"
},
{
"from": "gpt",
"value": "The maximum size of a multi-line text field can vary depending on the platform or programming language you are using. For example:\n\n1. **HTML**: In HTML, you can use a... |
I have been working on web application which includes java applet. My app is working fine on PC with different browsers like IE and Firefox. The web application hosted on Linux (Ubuntu).
I had problem on Mac with Firefox. I was unable to load the applet.
This is the error i found in java console.
Java.lang.classNotFoun... | It sounds like you're dealing with a couple of different issues related to your Java applet running on different operating systems and versions of Java.
### ClassNotFoundException Issue
The `java.lang.ClassNotFoundException` indicates that the Java runtime is unable to find the `ImageObsApplet.class` file. Here are a... | 37,831 | [
{
"from": "human",
"value": "I have been working on web application which includes java applet. My app is working fine on PC with different browsers like IE and Firefox. The web application hosted on Linux (Ubuntu).\nI had problem on Mac with Firefox. I was unable to load the applet.\nThis is the error i fo... |
I am getting the following error when trying to install Visual Studio 2005 on my 64bit, Vista computer:
"1305.Error reading from file
C:\Program Files (x86)\Microsoft
Visual Studio 8\Microsoft Visual
Studio 2005 Standard Edition -
ENU\SITSetup.dll"
I have successfully used the same DVD's to install Visual Stu... | The error you're encountering during the Visual Studio 2005 installation on your 64-bit Vista machine could be related to several issues, such as problems with file permissions, the DVD drive, or the installation media. Here are several troubleshooting steps you can try to resolve the issue:
1. **Run as Administrator*... | 39,278 | [
{
"from": "human",
"value": "I am getting the following error when trying to install Visual Studio 2005 on my 64bit, Vista computer:\n\n\"1305.Error reading from file\n C:\\Program Files (x86)\\Microsoft\n Visual Studio 8\\Microsoft Visual\n Studio 2005 Standard Edition -\n ENU\\SITSetup.dll\"\n\nI have... |
I have written a secure TCP server in .NET. This was basically as simple as creating a TcpListener instance and wrapping the connected client's NetworkStreams with SslStreams.
Now I need to access this TCP server with Delphi 7 (alternatively: Delphi 2007).
I haven't found anything in the help, and a Google search shows... | To access a secure TCP server using SSL/TLS in Delphi 7 or Delphi 2007, you can utilize several approaches, as there are no native SSL/TLS components built into these versions of Delphi. Below are some options, including open-source libraries and commercial packages that you might find helpful:
### 1. **Indy Component... | 38,824 | [
{
"from": "human",
"value": "I have written a secure TCP server in .NET. This was basically as simple as creating a TcpListener instance and wrapping the connected client's NetworkStreams with SslStreams.\nNow I need to access this TCP server with Delphi 7 (alternatively: Delphi 2007).\nI haven't found anyt... |
Suppose I have #define foo in various header files. It may expand to some different things. I would like to know (when compiling a .cc file) when a #define is encountered, to what it will expand, it which file it is and where it got included from.
Is it possible? If not, are there any partial solutions that may help?
F... | Understanding which `#define` is in effect at a specific point in your source code when there are multiple definitions in different header files can indeed be tricky. However, there are several techniques you can use to get more visibility into the preprocessing phase and track where each `#define` comes from. Here are... | 35,216 | [
{
"from": "human",
"value": "Suppose I have #define foo in various header files. It may expand to some different things. I would like to know (when compiling a .cc file) when a #define is encountered, to what it will expand, it which file it is and where it got included from.\nIs it possible? If not, are th... |
I've just learned what ASP.NET MVC is and I'm wondering if the pattern is ever used in Windows Desktop application development?
I'm specifically looking at potentially trying to use it in a Desktop .NET application.
Please forgive me if this question is way out in left field in terms of how MVC is suppose to be used... | It's great that you're exploring the Model-View-Controller (MVC) pattern! While MVC is most commonly associated with web development, particularly in frameworks like ASP.NET MVC, the principles of the pattern can certainly be applied to Windows Desktop application development as well.
### Understanding MVC
MVC is a d... | 35,860 | [
{
"from": "human",
"value": "I've just learned what ASP.NET MVC is and I'm wondering if the pattern is ever used in Windows Desktop application development? \nI'm specifically looking at potentially trying to use it in a Desktop .NET application. \nPlease forgive me if this question is way out in left fiel... |
So, I have a pair of typeclasses that I'll be using a lot together, and I want to avoid specifying both each time. Basically, instead of putting
:: (Ord a, Fractional a, Ord b, Fractional b, ... Ord z, Fractional z) =>
at the beginning of all my type specifications, I'd rather put
:: (OrdFractional a, OrdFractional b... | Yes, you can achieve what you want in Haskell by using the `FlexibleInstances` language extension to allow more flexibility in instance declarations. Additionally, you can use the `GeneralizedNewtypeDeriving` extension if needed.
Here’s how you can structure your code to define the `OrdFractional` typeclass with the a... | 38,176 | [
{
"from": "human",
"value": "So, I have a pair of typeclasses that I'll be using a lot together, and I want to avoid specifying both each time. Basically, instead of putting\n:: (Ord a, Fractional a, Ord b, Fractional b, ... Ord z, Fractional z) =>\n\nat the beginning of all my type specifications, I'd rat... |
I'm betting that someone has already solved this and maybe I'm using the wrong search terms for google to tell me the answer, but here is my situation.
I have a script that I want to run, but I want it to run only when scheduled and only one at a time. (can't run the script simultaneously)
Now the sticky part is tha... | To achieve your requirements of running a script on a schedule, ensuring only one instance of the script runs at a time, and managing multiple scheduled tasks from a database table (`myhappyschedule`), you can consider the following approach:
### High-Level Overview
1. **Database Table**: You already have a table (`m... | 34,531 | [
{
"from": "human",
"value": "I'm betting that someone has already solved this and maybe I'm using the wrong search terms for google to tell me the answer, but here is my situation.\nI have a script that I want to run, but I want it to run only when scheduled and only one at a time. (can't run the script si... |
I am running MOSS 2007 on a Windows 2003 box. I need to know what configuration must be done to get Alerts to work. SMTP settings, etc.... When I create my alert, it is created but it does not send the email to show me that something changed in my document library or on any particular document. What am I missing?
I did... | To ensure that alerts work properly in MOSS 2007 (Microsoft Office SharePoint Server 2007), you need to confirm and configure a few key areas, particularly with SMTP settings and SharePoint configuration. Here’s a checklist to help troubleshoot and ensure everything is configured correctly:
### 1. SMTP Configuration
... | 36,377 | [
{
"from": "human",
"value": "I am running MOSS 2007 on a Windows 2003 box. I need to know what configuration must be done to get Alerts to work. SMTP settings, etc.... When I create my alert, it is created but it does not send the email to show me that something changed in my document library or on any part... |
I am having a Html hyperlink. I need to link this hyperlink to another page.When I place the mouse over the link. It should show the image.
how to do this
| You can achieve this by using HTML, CSS, and a bit of JavaScript to display an image when you hover over a hyperlink. Here’s a simple example to illustrate this:
### HTML
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0... | 37,979 | [
{
"from": "human",
"value": "I am having a Html hyperlink. I need to link this hyperlink to another page.When I place the mouse over the link. It should show the image.\nhow to do this\n"
},
{
"from": "gpt",
"value": "You can achieve this by using HTML, CSS, and a bit of JavaScript to display an... |
Why does UDP have a length field in the header and TCP does not?
I am guessing that the length of the segment in TCP is inferred from the IP header but one should be able to do the same for a UDP datagram
| The difference in how UDP and TCP handle segment lengths in their respective headers can be attributed to the characteristics and design goals of the two protocols.
### UDP (User Datagram Protocol)
1. **Length Field Purpose**: The UDP header includes a length field to explicitly specify the length of the UDP datagram... | 39,521 | [
{
"from": "human",
"value": "Why does UDP have a length field in the header and TCP does not?\nI am guessing that the length of the segment in TCP is inferred from the IP header but one should be able to do the same for a UDP datagram\n"
},
{
"from": "gpt",
"value": "The difference in how UDP an... |
I was asked to recall a message I sent out to remove some personal info from it and replace it with a generic made up person as an example.
Does message recall really work?
It's my opinion because you get told a message has been recalled it just causes you to want to find out what was in the original message. All you ... | Your points about message recall are well-founded and reflect common frustrations with the feature, particularly in Microsoft Exchange environments. Here’s a breakdown of your questions and observations:
### Message Recall Effectiveness
1. **Recall Mechanism**: Message recall can work under specific conditions, such a... | 37,805 | [
{
"from": "human",
"value": "I was asked to recall a message I sent out to remove some personal info from it and replace it with a generic made up person as an example. \nDoes message recall really work?\nIt's my opinion because you get told a message has been recalled it just causes you to want to find out... |
I have an app that needs to handle very large strings between a SQL Server database and .NET code. I have a LINQ query that generates the strings when saving them to the database, but when trying to create the strings from the database, the app crashes with an OutOfMemoryException because of the size of the strings.
Do... | Handling very large strings in a SQL Server database with .NET can be challenging, especially when dealing with the risk of `OutOfMemoryException`. Here are several approaches to consider that might help you manage the size of the strings and prevent crashes:
### 1. **Stream the Data Instead of Loading it All at Once*... | 38,104 | [
{
"from": "human",
"value": "I have an app that needs to handle very large strings between a SQL Server database and .NET code. I have a LINQ query that generates the strings when saving them to the database, but when trying to create the strings from the database, the app crashes with an OutOfMemoryExcepti... |
I'm wondering how I can make a plugin to output some data via the admin panel.
Just to get me going what code would make a page in the admin panel (for only administrators) to display time()?
| Creating a simple WordPress plugin to display the current timestamp in the admin panel involves a few steps. Below is a basic example to help you get started. This plugin will create a new admin menu page that is accessible only to administrators, and it will display the output of the `time()` function.
### Step 1: Cr... | 36,404 | [
{
"from": "human",
"value": "I'm wondering how I can make a plugin to output some data via the admin panel.\nJust to get me going what code would make a page in the admin panel (for only administrators) to display time()?\n"
},
{
"from": "gpt",
"value": "Creating a simple WordPress plugin to dis... |
Our team is using a SecureRandom to generate a list of key pairs (the SecureRandom is passed to a KeyPairGenerator). We cannot agree on which of the following two options to use:
Create a new instance every time we need to generate a key pair
Initialize a static instance and use it for all key pairs
Which approach i... | Your updated understanding is correct: the choice between creating a new instance of `SecureRandom` each time you need to generate a key pair versus using a static instance does not significantly impact security in the context of cryptographic operations, particularly when using a proper implementation of `SecureRandom... | 39,397 | [
{
"from": "human",
"value": "Our team is using a SecureRandom to generate a list of key pairs (the SecureRandom is passed to a KeyPairGenerator). We cannot agree on which of the following two options to use:\n\nCreate a new instance every time we need to generate a key pair\nInitialize a static instance an... |
I am working on a tool where I need to convert string values to their proper object types. E.g. convert a string like "2008-11-20T16:33:21Z" to a DateTime value. Numeric values like "42" and "42.42" must be converted to an Int32 value and a Double value respectively.
What is the best and most efficient approach to det... | When you need to convert string values to their proper object types in C#, using methods like `Int32.TryParse` and `Double.TryParse` is indeed a recommended and efficient approach. Here's a breakdown of how to handle the different types of conversions based on the examples you've provided:
### Conversion Strategy
1. ... | 37,757 | [
{
"from": "human",
"value": "I am working on a tool where I need to convert string values to their proper object types. E.g. convert a string like \"2008-11-20T16:33:21Z\" to a DateTime value. Numeric values like \"42\" and \"42.42\" must be converted to an Int32 value and a Double value respectively. \nWha... |
In previous releases there were 3 ways to pass data from controller to view AFAIK (shown below).
I want to use method (2) with MVC Beta 1, but I can't find the renderView method. So what's the new syntax (if it's still possible)? Thanks in advance.
Ben.
Syntax #1: Old-school dictionary
ViewData["Name"] = "Moo-moo";
Vi... | In ASP.NET MVC, starting from later versions (including MVC Beta 1), the `RenderView` method that you referenced has been replaced with `View` and `ViewResult` mechanisms for rendering views. Here's how you can achieve the equivalent functionality of your second syntax using the new framework conventions:
### Updated ... | 39,757 | [
{
"from": "human",
"value": "In previous releases there were 3 ways to pass data from controller to view AFAIK (shown below). \nI want to use method (2) with MVC Beta 1, but I can't find the renderView method. So what's the new syntax (if it's still possible)? Thanks in advance.\nBen.\nSyntax #1: Old-school... |
I am trying to write a little backup program for friends and family and want it to be as simple to use a possible. I don't want to have to ask the user where to backup their data to, I just want to search for and use the first USB hard drive connected to the computer. Obtaining the unique ID of the hard drive would pro... | Creating a simple backup program that automatically detects the first USB hard drive connected to the computer can be done using various programming languages. Below, I'll provide an example using Python, which is widely used and has libraries that can help with hardware detection and file operations.
### Steps to Cre... | 33,769 | [
{
"from": "human",
"value": "I am trying to write a little backup program for friends and family and want it to be as simple to use a possible. I don't want to have to ask the user where to backup their data to, I just want to search for and use the first USB hard drive connected to the computer. Obtaining ... |
I see APIs in Quartz for drawing lines and circles. But all I want to do is to specify the (x,y) cartesian coordinate to color a pixel a particular value. How do I do that?
| In Quartz, you can manipulate the pixels of a bitmap context directly to set the color of specific pixels. To color a specific pixel at (x, y) coordinates, you typically need to create a bitmap context, set the desired pixel color, and then render this context onto the screen or an image. Here's how you can do that:
#... | 35,874 | [
{
"from": "human",
"value": "I see APIs in Quartz for drawing lines and circles. But all I want to do is to specify the (x,y) cartesian coordinate to color a pixel a particular value. How do I do that?\n"
},
{
"from": "gpt",
"value": "In Quartz, you can manipulate the pixels of a bitmap contex... |
I have a somewhat complicated branching structure at work (at least for me). It is something like this:
Main
|
1
|
2
| \
3 \
Ver2
|
1
| \
2 \
| ProjectA
3 |
1
There are 2 branches off of main. "Ver2" which has everyone's changes for the next ve... | Creating a configuration specification (config spec) that meets your requirements involves using conditional logic to prioritize which versions to retrieve based on their merging status. It sounds like you are using a version control system that supports branching and merging, such as ClearCase, Git, or similar systems... | 25,185 | [
{
"from": "human",
"value": "I have a somewhat complicated branching structure at work (at least for me). It is something like this:\n\nMain\n |\n 1\n |\n 2\n | \\\n 3 \\\n Ver2\n |\n 1\n | \\\n 2 \\ \n | ProjectA\n 3 |\n 1\n\nThere are 2 branches of... |
I have a regular expression to match a persons name.
So far I have ^([a-zA-Z\'\s]+)$ but id like to add a check to allow for a maximum of 4 spaces. How do I amend it to do this?
Edit: what i meant was 4 spaces anywhere in the string
| To modify your regular expression to allow for a maximum of 4 spaces anywhere in the string, you can use a combination of a pattern that captures spaces and a quantifier to limit them. Here’s how you can do it:
```regex
^(?!(?:[^ ]* ){5})[a-zA-Z' ]+$
```
### Explanation:
1. **^** - Asserts the start of the string.
2... | 37,026 | [
{
"from": "human",
"value": "I have a regular expression to match a persons name.\nSo far I have ^([a-zA-Z\\'\\s]+)$ but id like to add a check to allow for a maximum of 4 spaces. How do I amend it to do this?\nEdit: what i meant was 4 spaces anywhere in the string\n"
},
{
"from": "gpt",
"value"... |
Has anyone ever modified the "post-new.php" file in their WordPress installation?
I want to modify the look of this page to include pieces that I standardly include in my blog posts, and I just don't know if it is do-able/easy/worth my time.
Should I just find another CMS that allows more modifcation like Drupal?
| Modifying the `post-new.php` file in WordPress is generally not recommended for several reasons:
1. **Core Updates**: WordPress is frequently updated, and any modifications made directly to core files will be overwritten during an update. This means you would have to reapply your changes after every update, which can ... | 38,343 | [
{
"from": "human",
"value": "Has anyone ever modified the \"post-new.php\" file in their WordPress installation? \nI want to modify the look of this page to include pieces that I standardly include in my blog posts, and I just don't know if it is do-able/easy/worth my time.\nShould I just find another CMS ... |
I want to put my master pages in a central library so I can use them in several projects without having the maintanance nightmare.
Everything is refactored in a generic and central way, they are all in a "shared" namespace.
But if put them in a seperate project, I can't reference them
| To create a central library for your master pages (or other shared components) that can be referenced across multiple projects without maintenance issues, you'll want to follow a few steps to set up your shared library correctly. Here’s a general outline you can follow:
### Step 1: Create a Shared Library Project
1. *... | 35,308 | [
{
"from": "human",
"value": "I want to put my master pages in a central library so I can use them in several projects without having the maintanance nightmare.\nEverything is refactored in a generic and central way, they are all in a \"shared\" namespace.\nBut if put them in a seperate project, I can't refe... |
I've been trying to run a jar file - let's call it test.jar - that uses the Sybase jconn3.jar on a Unix system.
I have created a MANIFEST.MF file that has the following:
Class-Path: $SYBASE/jConnect-6_0/classes/jconn3.jar commons-net-1.3.0.jar
This gives a ClassNotFoundError. $SYBASE is the system variable that points... | It sounds like you've run into a common issue with the Class-Path in a JAR's manifest file. Here are a few things to check and consider:
1. **Class-Path Format**: Make sure that the paths specified in your `Class-Path` attribute are formatted correctly and are absolute paths if you are using them in a Unix environment... | 39,587 | [
{
"from": "human",
"value": "I've been trying to run a jar file - let's call it test.jar - that uses the Sybase jconn3.jar on a Unix system.\nI have created a MANIFEST.MF file that has the following:\nClass-Path: $SYBASE/jConnect-6_0/classes/jconn3.jar commons-net-1.3.0.jar\n\nThis gives a ClassNotFoundErro... |
On a more abstract level then a previous question, in my experience there are 3 ways to call a javascript function on an html page from an embedded .swf using AS3: ExternalInterface, fscommand, and navigateToURL.
Let's compare and contrast these methods (and maybe others I haven't listed) and talk about the pros and co... | You're correct that there are several ways to call JavaScript functions from an embedded SWF file in ActionScript 3 (AS3). The three primary methods you've mentioned—`ExternalInterface`, `fscommand`, and `navigateToURL`—each have their own use cases, advantages, and disadvantages. Let’s break them down:
### 1. **Exter... | 35,810 | [
{
"from": "human",
"value": "On a more abstract level then a previous question, in my experience there are 3 ways to call a javascript function on an html page from an embedded .swf using AS3: ExternalInterface, fscommand, and navigateToURL.\nLet's compare and contrast these methods (and maybe others I have... |
Has anybody come across an elegant and efficient .NET spam filtering component that can be used in ASP.NET applications? I want something that I can pass a string and returns to me a percentage of how likely it could be spam, does such a thing exist?
| Yes, there are several spam filtering components and libraries available for .NET that you can use in ASP.NET applications to analyze text and determine its likelihood of being spam. Here are a few options you might consider:
1. **SpamAssassin**: While primarily a Perl-based tool, SpamAssassin can be used in .NET appl... | 37,951 | [
{
"from": "human",
"value": "Has anybody come across an elegant and efficient .NET spam filtering component that can be used in ASP.NET applications? I want something that I can pass a string and returns to me a percentage of how likely it could be spam, does such a thing exist?\n"
},
{
"from": "gpt... |
I'm a developer so I'm a little lost in the DBA world. Our systems guys have given me a backup of an Oracle 9i database. I have installed oracle 9i on my pc and am now trying to 'import' the backup files so I have a normal database to work with.
The backup folder has on SNCF[SID].ora file and around 150 [SID]-[Date]-... | It sounds like you're in a challenging situation, but I can help guide you through the process of restoring your Oracle 9i database from the backup files you have. Since you've already created a database with the same SID, let’s proceed with the steps to restore the database using RMAN (Recovery Manager).
### Steps to... | 36,442 | [
{
"from": "human",
"value": "I'm a developer so I'm a little lost in the DBA world. Our systems guys have given me a backup of an Oracle 9i database. I have installed oracle 9i on my pc and am now trying to 'import' the backup files so I have a normal database to work with.\nThe backup folder has on SNCF[... |
Running Mongrel 1.1.5 on Rails 2.1.2 using PostgreSQL 8.3 via ruby-pg 0.7.9 on OS X 10.4 server...
Added restful_authentication and exception_notification, the latter of which appears to be doing me no good when Mongrel simply dies with "Illegal instruction" every time I select /RESOURCE_NAME/new.
Doesn't matter what r... | It sounds like you're dealing with a pretty frustrating issue. The "Illegal instruction" error is often indicative of a low-level issue, perhaps related to the Ruby interpreter or the Mongrel server. Here are some steps you can try to help diagnose and potentially resolve the problem:
1. **Upgrade Ruby and Gems**: Alt... | 37,289 | [
{
"from": "human",
"value": "Running Mongrel 1.1.5 on Rails 2.1.2 using PostgreSQL 8.3 via ruby-pg 0.7.9 on OS X 10.4 server...\nAdded restful_authentication and exception_notification, the latter of which appears to be doing me no good when Mongrel simply dies with \"Illegal instruction\" every time I sele... |
We have a web application that manages inventory for our computer support group. One of the things that we will be using this for is to drive a "Computers Currently In Use" map for our larger computer labs so that users can find an open computer more easily (the lab in our Main library has around 150 computers). The ... | Your approach to managing the visibility of the "Computers Currently In Use" map is reasonable and aligns well with common practices in web application development. Below are some suggestions and alternatives to enhance the functionality and usability of your implementation.
### Suggestions
1. **Database Extension**:... | 35,261 | [
{
"from": "human",
"value": "We have a web application that manages inventory for our computer support group. One of the things that we will be using this for is to drive a \"Computers Currently In Use\" map for our larger computer labs so that users can find an open computer more easily (the lab in our Ma... |
Java was initially slow before the JIT but today performance is pretty close to C++. I want to know if someone has done measurable performance comparisons between the two languages? Where does Java fall short when compared to C++? Java provides many productivity gains to developers so they can write applications muc... | Performance comparisons between Java and C++ have been the subject of extensive studies, and indeed, there are measurable differences between the two languages. Here are some key areas where Java may fall short compared to C++, particularly for applications where performance is critical:
### 1. **Memory Management**
... | 36,100 | [
{
"from": "human",
"value": "Java was initially slow before the JIT but today performance is pretty close to C++. I want to know if someone has done measurable performance comparisons between the two languages? Where does Java fall short when compared to C++? Java provides many productivity gains to deve... |
I want some slightly 'dynamic' XML source files. I want some of the element values to be dynamic, or 'expandable'.
I'm providing a value for this variable, from some other source.
@Name = 'freezingkiwis'
What I want to provide is something like this in an XML file:
<?xml version="1.0" encoding="UTF-8"?>
<Contact>
... | To achieve dynamic content in your XML file, you have a few options. Since XML is a markup language, it does not natively support dynamic variables like you would find in a programming language. However, you can manually replace placeholders in the XML after reading it from the file.
Here's a simple approach using Ru... | 37,032 | [
{
"from": "human",
"value": "I want some slightly 'dynamic' XML source files. I want some of the element values to be dynamic, or 'expandable'.\nI'm providing a value for this variable, from some other source.\n@Name = 'freezingkiwis'\n\nWhat I want to provide is something like this in an XML file:\n<?xml ... |
I am wondering what the best way is using php to obtain a list of all the rows in the database, and when clicking on a row show the information in more detail, such as a related image etc.
Should I use frames to do this? Are there good examples of this somewhere?
Edit:
I need much simpler instructions, as I am not a pr... | Using frames is generally not recommended for modern web development due to various reasons, including usability, accessibility, and search engine optimization issues. Instead, I suggest using a combination of PHP and JavaScript to create a more user-friendly experience. You can achieve your goal by following a simple ... | 34,330 | [
{
"from": "human",
"value": "I am wondering what the best way is using php to obtain a list of all the rows in the database, and when clicking on a row show the information in more detail, such as a related image etc.\nShould I use frames to do this? Are there good examples of this somewhere?\nEdit:\nI need... |
Is there any reason to start a GUI program (application for Windows) written in VB.NET in the Sub Main of a module rather than directly in a form?
EDIT: The program won't take any command line parameters and it will be executed as a GUI program always.
| In a typical Windows Forms application written in VB.NET, the entry point is usually defined in the `Sub Main` method of a module, which is configured as the startup object in the project settings. While it is perfectly valid to start your application directly from a form, there are several reasons to use `Sub Main` as... | 37,819 | [
{
"from": "human",
"value": "Is there any reason to start a GUI program (application for Windows) written in VB.NET in the Sub Main of a module rather than directly in a form?\nEDIT: The program won't take any command line parameters and it will be executed as a GUI program always.\n"
},
{
"from": ... |
I have populated a Datatable, from 2 different servers. I am able to make adjustments where my length>0, what I want to do is remove the rows that does not hit. Here is a summary of what I have
DataRow[] dr = payments.dtPayments.Select(myselect);
if (dr.Length > 0)
{
for (int a = 0; a < dr.Length; a++)
{
... | To remove rows from a `DataTable` based on a condition and to handle your specific logic, you'll need to iterate through the `DataRow` array `dr`, and conditionally delete rows or perform other actions. After that, you also want to handle the case where `dr` has a length of 0 (i.e., no rows were selected).
Here’s an u... | 37,492 | [
{
"from": "human",
"value": "I have populated a Datatable, from 2 different servers. I am able to make adjustments where my length>0, what I want to do is remove the rows that does not hit. Here is a summary of what I have\nDataRow[] dr = payments.dtPayments.Select(myselect);\n\nif (dr.Length > 0)\n{\n ... |
I know class foo(object) is an old school way of defining a class. But I would like to understand in more detail the difference between these two.
| In Python, there are two primary ways to define classes: the "old-style" classes and the "new-style" classes. The distinction mainly applies to Python 2, where both styles existed. In Python 3, all classes are new-style classes, but understanding the difference can still be useful for historical context and when readin... | 39,357 | [
{
"from": "human",
"value": "I know class foo(object) is an old school way of defining a class. But I would like to understand in more detail the difference between these two.\n"
},
{
"from": "gpt",
"value": "In Python, there are two primary ways to define classes: the \"old-style\" classes and ... |
I read an excel sheet into a datagrid.From there , I have managed to read the grid's rows into a DataTable object.The DataTable object has data because when I make equal a grid's datasource to that table object , the grid is populated.
My Problem : I want to use the table object and manipulate its values using SQL serv... | To achieve your goal of using a `DataTable` as a temporary table in SQL Server and running queries against it from C# code, you need to follow a few steps. The main issue you're encountering is with the way you're using temporary tables in SQL Server. Temporary tables are created and exist only for the duration of the ... | 33,585 | [
{
"from": "human",
"value": "I read an excel sheet into a datagrid.From there , I have managed to read the grid's rows into a DataTable object.The DataTable object has data because when I make equal a grid's datasource to that table object , the grid is populated.\nMy Problem : I want to use the table objec... |
I have an msbuild project which builds a SLN file from visual studio which holds all the projects in (about 70+ project), and a lot of the projects are dependent on each other meaning they need to be build in order - sometimes a developer forgets to set the build order manually in visual studio in the solution file cau... | Yes, MSBuild can handle project dependencies and build projects in the correct order without requiring you to manually set the build order in the solution file. Here's how you can leverage MSBuild to do this:
### Understanding MSBuild Project Dependencies
1. **Project References**: MSBuild understands dependencies th... | 39,169 | [
{
"from": "human",
"value": "I have an msbuild project which builds a SLN file from visual studio which holds all the projects in (about 70+ project), and a lot of the projects are dependent on each other meaning they need to be build in order - sometimes a developer forgets to set the build order manually ... |
I'm having an issue with JQuery and Safari (Windows Version). The code works on FF/IE7/Chrome but not Safari.
I have a simple <li> that has a <div> embedded in to - clicking the <li> should expose the hidden div, but not in Safari.
The HTML:
<ul>
<li>something</li>
<li>something2</li>
<li class="more">
<a href... | The issue you are encountering in Safari (especially on Windows, which may have its own quirks) is likely due to the way the default behavior of the anchor tag `<a>` is handled. When you click on the link, it is attempting to navigate to the URL specified in the `href` attribute (in this case, an empty string), which c... | 38,323 | [
{
"from": "human",
"value": "I'm having an issue with JQuery and Safari (Windows Version). The code works on FF/IE7/Chrome but not Safari.\nI have a simple <li> that has a <div> embedded in to - clicking the <li> should expose the hidden div, but not in Safari.\nThe HTML:\n<ul>\n<li>something</li>\n<li>som... |
Can anyone explain the difference between the types mentioned above and some sample usage to clearly explain the difference between the two?
Any help would be highly appreciated!
Note: this question is a spin-off from this other question
| It looks like you're asking for clarification on some types or concepts that were discussed in a previous question, but you haven't specified which types you’re referring to. If you could provide more context or mention the specific types you're interested in (for example, data types, programming types, etc.), I'd be h... | 42,460 | [
{
"from": "human",
"value": "Can anyone explain the difference between the types mentioned above and some sample usage to clearly explain the difference between the two?\nAny help would be highly appreciated!\nNote: this question is a spin-off from this other question\n"
},
{
"from": "gpt",
"val... |
I've been tasked to write our department's C# Programming Standard (including guidelines). What sort of standards/guidelines should I include? I've already taken bits from various standards around the net (and pieces from Code Complete), but I'd like hear from developers in the field.
I've already got:
Naming Convent... | Creating a comprehensive C# Programming Standard for your department is a great initiative that can help improve code quality, maintainability, and collaboration among developers. Below is a list of additional standards and guidelines you might consider including, as well as some considerations on what not to include.
... | 32,977 | [
{
"from": "human",
"value": "I've been tasked to write our department's C# Programming Standard (including guidelines). What sort of standards/guidelines should I include? I've already taken bits from various standards around the net (and pieces from Code Complete), but I'd like hear from developers in th... |
What are the API calls to copy a file that is currently locked. I'm hoping to be able to use .Net, but Win32 calls would be fine as well.
Please feel free to chime in about the same functionality on Unix, or any other OS.
| Copying a locked file can be challenging because operating systems typically prevent access to files that are in use by another process. However, there are various approaches to handle this situation, depending on the operating system (Windows or Unix/Linux).
### On Windows
#### Using .NET
If you're working with .N... | 34,748 | [
{
"from": "human",
"value": "What are the API calls to copy a file that is currently locked. I'm hoping to be able to use .Net, but Win32 calls would be fine as well. \nPlease feel free to chime in about the same functionality on Unix, or any other OS.\n"
},
{
"from": "gpt",
"value": "Copying ... |
What do you think is the best way to present a hierarchical list of functionality to users within your traditional WinForms application? (A menu system - Assume functionality can be split into a small number of modules and sub-modules but with no fixed depth in terms of those sub-modules).
Do you like the traditional d... | When it comes to presenting a hierarchical list of functionalities in a WinForms application, the choice of interface largely depends on the complexity of the features, the frequency of use, and user familiarity. Below are some considerations for different approaches, along with recommendations:
### 1. Traditional Dro... | 38,105 | [
{
"from": "human",
"value": "What do you think is the best way to present a hierarchical list of functionality to users within your traditional WinForms application? (A menu system - Assume functionality can be split into a small number of modules and sub-modules but with no fixed depth in terms of those su... |
I used a new Date() object to fill a field in a MySQL DB, but the actual value stored in that field is in my local timezone.
How can I configure MySQL to store it in the UTC/GMT timezone?
I think, configuring the connection string will help but I don't know how. There are many properties in the connection string like u... | To store datetime values in UTC in your MySQL database, you have a few options to consider. It's important to ensure that the MySQL server is set up correctly, and you also need to configure your application connection accordingly.
### Step 1: Configure MySQL Server
1. **Set the Server Time Zone**: Ideally, you shoul... | 35,923 | [
{
"from": "human",
"value": "I used a new Date() object to fill a field in a MySQL DB, but the actual value stored in that field is in my local timezone.\nHow can I configure MySQL to store it in the UTC/GMT timezone?\nI think, configuring the connection string will help but I don't know how. There are many... |
I mistakenly added files to Git using the command:
git add myfile.txt
I have not yet run git commit. How do I undo this so that these changes will not be included in the commit?
| If you've added files to the staging area using `git add`, but you haven't committed them yet, you can remove the files from the staging area using the following command:
```bash
git reset myfile.txt
```
This command will unstage `myfile.txt`, which means it will not be included in the next commit. The changes in the... | 41,812 | [
{
"from": "human",
"value": "I mistakenly added files to Git using the command:\ngit add myfile.txt\n\nI have not yet run git commit. How do I undo this so that these changes will not be included in the commit?\n"
},
{
"from": "gpt",
"value": "If you've added files to the staging area using `git... |
Is there ever a good reason to not declare a virtual destructor for a class? When should you specifically avoid writing one?
| In C++, declaring a virtual destructor is important for base classes that are intended to be used polymorphically. A virtual destructor ensures that when a derived class object is deleted through a base class pointer, the derived class's destructor is called, allowing for proper resource cleanup.
However, there are so... | 36,989 | [
{
"from": "human",
"value": "Is there ever a good reason to not declare a virtual destructor for a class? When should you specifically avoid writing one?\n"
},
{
"from": "gpt",
"value": "In C++, declaring a virtual destructor is important for base classes that are intended to be used polymorphi... |
Anyone knows a way to define refactoring in a more formal way?
UPDATE.
A refactoring is a pair R = (pre; T) where pre is the precondition that
the program must satisfy, and T is the program transformation.
| Your formal definition of refactoring captures the essence of what refactoring entails, but it can be further refined for clarity and completeness. Here's a revised version:
A refactoring can be defined as a pair \( R = (pre, T) \) where:
1. **Precondition \( pre \)**: A logical expression or set of conditions that t... | 37,490 | [
{
"from": "human",
"value": "Anyone knows a way to define refactoring in a more formal way?\nUPDATE.\n\nA refactoring is a pair R = (pre; T) where pre is the precondition that\n the program must satisfy, and T is the program transformation.\n\n"
},
{
"from": "gpt",
"value": "Your formal definit... |
I'm making a C program where I need to get the directory that the program is started from. This program is written for UNIX computers. I've been looking at opendir() and telldir(), but telldir() returns a off_t (long int), so it really doesn't help me.
How can I get the current path in a string (char array)?
| To get the current working directory in a C program on UNIX systems, you can use the `getcwd()` function provided in the `<unistd.h>` header. This function allows you to retrieve the absolute path of the current working directory and store it in a character array.
Here is a simple example demonstrating how to use `get... | 39,843 | [
{
"from": "human",
"value": "I'm making a C program where I need to get the directory that the program is started from. This program is written for UNIX computers. I've been looking at opendir() and telldir(), but telldir() returns a off_t (long int), so it really doesn't help me. \nHow can I get the curre... |
We are designing a Payroll Generation System for a client.
The organization we are targeting has a hierarchy as follows:
Company -> Cluster -> Business Unit (BU) -> Department -> Employee
The salary for an employee is made up of various salary components.
Each salary component has 3 rules associated with it, a Calculat... | Designing a Payroll Generation System with the requirements you described involves several considerations around flexibility, maintainability, and performance. Here are some thoughts and suggestions based on your priorities:
### 1. Logic Placement
**Stored Procedures (SPs):**
- **Pros:**
- They can encapsulate compl... | 33,854 | [
{
"from": "human",
"value": "We are designing a Payroll Generation System for a client.\nThe organization we are targeting has a hierarchy as follows:\nCompany -> Cluster -> Business Unit (BU) -> Department -> Employee\nThe salary for an employee is made up of various salary components.\nEach salary compone... |
I was curious if anyone had any hard numbers around the performance difference between annotating Entities using private fields instead of public getter methods. I've heard people say that fields are slower because they're called "through reflection" but then again so are the getter methods, no? Hibernate needs to se... | Your question touches on an interesting aspect of Java Persistence API (JPA) and Hibernate regarding the performance implications of using private fields versus public getter methods for entity mapping. Let's break down the performance considerations and the actual mechanics involved.
### Reflection and Accessibility
... | 39,663 | [
{
"from": "human",
"value": "I was curious if anyone had any hard numbers around the performance difference between annotating Entities using private fields instead of public getter methods. I've heard people say that fields are slower because they're called \"through reflection\" but then again so are the... |
I would like to customize the background (and maybe the border too) of all of the UITableViewCells within my UITableView. So far I have not been able to customize this stuff, so I have a bunch of white background cells which is the default.
Is there a way to do this with the iPhone SDK?
| Yes, you can customize the background and border of `UITableViewCell` in your `UITableView`. Here’s how you can do it:
### Customize UITableViewCell Background Color
You can customize the background color of `UITableViewCell` by setting the `backgroundColor` property of the cell. You can also customize the selected b... | 38,798 | [
{
"from": "human",
"value": "I would like to customize the background (and maybe the border too) of all of the UITableViewCells within my UITableView. So far I have not been able to customize this stuff, so I have a bunch of white background cells which is the default.\nIs there a way to do this with the iP... |
I tend to get the feeling that most folks here think SVN is gold-plated goodness, whereas VSS is the worst program ever devised (at least as Version Control is concerned).
That said, why? I've used some CVS, and my current job uses VSS, and from a grunt on the team's perspective, I can't really tell that much differen... | The opinions about version control systems like SVN (Subversion) and VSS (Visual SourceSafe) can vary greatly depending on users' experiences, workflows, and the specific features they value. Here are some key points that might clarify why SVN is often seen as superior to VSS, especially in a professional development e... | 38,616 | [
{
"from": "human",
"value": "I tend to get the feeling that most folks here think SVN is gold-plated goodness, whereas VSS is the worst program ever devised (at least as Version Control is concerned).\nThat said, why? I've used some CVS, and my current job uses VSS, and from a grunt on the team's perspecti... |
What is the difference between a Snapshot Repository and Release Repository?
This is with reference to setting up Repositories (like Artifactory, Nexus etc)
| In the context of repository management systems like JFrog Artifactory and Sonatype Nexus, the terms "Snapshot Repository" and "Release Repository" refer to different types of repositories designed to handle different kinds of artifacts in software development. Here's a breakdown of the differences:
### Snapshot Repos... | 38,861 | [
{
"from": "human",
"value": "What is the difference between a Snapshot Repository and Release Repository?\nThis is with reference to setting up Repositories (like Artifactory, Nexus etc)\n"
},
{
"from": "gpt",
"value": "In the context of repository management systems like JFrog Artifactory and S... |
I'm in javascript, running this in the console
d = new Date();
d.setMonth(1);
d.setFullYear(2009);
d.setDate(15);
d.toString();
outputs this:
"Sun Mar 15 2009 18:05:46 GMT-0400 (EDT)"
Why would this be happening? It seems like a browser bug.
| The output you are seeing is not a bug but rather the result of how the `Date` object and its methods work in JavaScript.
Let's break down your code:
1. You create a new `Date` object:
```javascript
d = new Date();
```
2. You set the month to February (note that months are zero-indexed in JavaScript, so `1... | 36,357 | [
{
"from": "human",
"value": "I'm in javascript, running this in the console \nd = new Date(); \nd.setMonth(1);\nd.setFullYear(2009);\nd.setDate(15); \nd.toString();\n\noutputs this:\n\"Sun Mar 15 2009 18:05:46 GMT-0400 (EDT)\"\n\nWhy would this be happening? It s... |
I was looking into the best encryption for a license key for an application, and someone said that someone can easily decompile the application and then just skip the test for the license key.
how would someone go about doing that practically speaking? So they have my .dll, they have to decompile it somehow, then comm... | To understand how someone might bypass a license key check in a compiled application (such as a .dll file), it's important to recognize the steps involved in decompiling and modifying the code. Here’s a general overview of how this process might be carried out practically:
1. **Decompilation**: The attacker uses a dec... | 36,814 | [
{
"from": "human",
"value": "I was looking into the best encryption for a license key for an application, and someone said that someone can easily decompile the application and then just skip the test for the license key.\nhow would someone go about doing that practically speaking? So they have my .dll, th... |
There is an executable that is dynamically linked to number of shared objects. How can I determine, to which of them some symbol (imported into executable) belongs ?
If there are more than one possibility, could I silmulate ld and see from where it is being taken ?
| To determine which shared object (shared library) a symbol belongs to in a dynamically linked executable, you can use a variety of tools available on Unix-like systems, primarily on Linux. Here’s how to do it:
### Using `nm` and `grep`
1. **List symbols in the shared object**: You can use `nm` to list the symbols in ... | 38,853 | [
{
"from": "human",
"value": "There is an executable that is dynamically linked to number of shared objects. How can I determine, to which of them some symbol (imported into executable) belongs ?\nIf there are more than one possibility, could I silmulate ld and see from where it is being taken ?\n"
},
{
... |
Ok, I am trying to use Tail to monitor a log file, but I cannot get the same behavior programatically as when I manually run it through cmd prompt using the same parameters.
When run through cmd prompt it displays the new lines instantly. Programatically though, I have to wait for about 75+ new lines in log file before... | It sounds like you're encountering an issue with how the `tail` command and your process redirection are interacting. The difference in behavior when running from the command prompt versus programmatically might stem from buffering and output flushing settings in your tail implementation or the environment in which it'... | 37,109 | [
{
"from": "human",
"value": "Ok, I am trying to use Tail to monitor a log file, but I cannot get the same behavior programatically as when I manually run it through cmd prompt using the same parameters.\nWhen run through cmd prompt it displays the new lines instantly. Programatically though, I have to wait ... |
We are building an application which stores data in an S3 bucket. However, we are having problems with the PutObject method. Here is the xml packet we are sending out:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchem... | The response from the S3 service indicates that there is a "Malformed request." Since you are trying to use SOAP to communicate with S3, it's important to note that Amazon S3 primarily uses REST APIs, and there is no native support for SOAP requests. Here are several points to consider regarding your XML packet and the... | 39,301 | [
{
"from": "human",
"value": "We are building an application which stores data in an S3 bucket. However, we are having problems with the PutObject method. Here is the xml packet we are sending out:\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-inst... |
Is there a tsql command on sqlserver 2008 which can be run in order to enable Database Diagramming instead of this dialog appearing:
This database does not have one or more of the support objects required to use database diagramming. Do you wish to create them?
| In SQL Server 2008, database diagrams require certain system objects to be created in the database to support this feature. If these objects are missing, you will encounter the dialog that prompts you to create them.
To enable database diagramming without the dialog box, you can run a T-SQL script that creates the req... | 39,686 | [
{
"from": "human",
"value": "Is there a tsql command on sqlserver 2008 which can be run in order to enable Database Diagramming instead of this dialog appearing:\nThis database does not have one or more of the support objects required to use database diagramming. Do you wish to create them? \n"
},
{
... |
I’m using Treeview Control (ASP.NET 2.0) in a web control. The funny thing is, that everything is working fine : expanding, collapse, selecting a node etc. ,but after every click firebug shows an error : TreeView_SelectNode is not defined [Break on this error] HelpFile.aspx (line 1)
The error comes up every time I'm se... | The error message you're seeing, `TreeView_SelectNode is not defined`, indicates that there is a JavaScript function `TreeView_SelectNode` that is expected to be available on the client side when you click on a node in the TreeView, but for some reason it is not defined or not included in the page's output.
Here are s... | 34,283 | [
{
"from": "human",
"value": "I’m using Treeview Control (ASP.NET 2.0) in a web control. The funny thing is, that everything is working fine : expanding, collapse, selecting a node etc. ,but after every click firebug shows an error : TreeView_SelectNode is not defined [Break on this error] HelpFile.aspx (lin... |
I'm working on a kind of unique app which needs to generate images at specific resolutions according to the device they are displayed on. So the output is different on a regular Windows browser (96ppi), iPhone (163ppi), Android G1 (180ppi), and other devices. I'm wondering if there's a way to detect this automatically.... | Detecting screen resolution and pixel density accurately across different devices can be quite challenging due to the variations in how different browsers and operating systems report this information. Your research into using CSS and JavaScript to gauge the display's PPI (pixels per inch) is a good starting point, but... | 37,461 | [
{
"from": "human",
"value": "I'm working on a kind of unique app which needs to generate images at specific resolutions according to the device they are displayed on. So the output is different on a regular Windows browser (96ppi), iPhone (163ppi), Android G1 (180ppi), and other devices. I'm wondering if th... |
My code runs inside a JAR file, say foo.jar, and I need to know, in the code, in which folder the running foo.jar is.
So, if foo.jar is in C:\FOO\, I want to get that path no matter what my current working directory is.
| To determine the directory in which your JAR file (`foo.jar`) is located at runtime, you can use the `CodeSource` of your main class. Here’s how you can do this in Java:
1. Get the `ProtectionDomain` of your class.
2. Retrieve the `CodeSource` from the `ProtectionDomain`.
3. Get the location of the JAR file from the `... | 38,624 | [
{
"from": "human",
"value": "My code runs inside a JAR file, say foo.jar, and I need to know, in the code, in which folder the running foo.jar is.\nSo, if foo.jar is in C:\\FOO\\, I want to get that path no matter what my current working directory is.\n"
},
{
"from": "gpt",
"value": "To determin... |
How can I differentiate a Workflow system from a normal application that automates some work? Are there any specific feature a system must have to be categorized as a workflow system?
| Differentiating a workflow system from a standard application that automates certain tasks involves understanding the specific features and capabilities that characterize a workflow system. Here are some key distinctions and features that can help categorize a system as a workflow system:
### 1. **Definition of Workfl... | 36,341 | [
{
"from": "human",
"value": "How can I differentiate a Workflow system from a normal application that automates some work? Are there any specific feature a system must have to be categorized as a workflow system?\n"
},
{
"from": "gpt",
"value": "Differentiating a workflow system from a standard ... |
I'm trying to get the zoom controls to show up in a mapview, the following code almost works, but the zoom controls appear in the top left of the mapview, not the bottom center like I'm specifying via setGravity(). Can someone enlighten me as to what I'm missing?
zoomView = (LinearLayout) mapView.getZoomControls();
zo... | The issue you're experiencing with the zoom controls appearing in the top-left of the `MapView` instead of the bottom center is likely due to how you're setting the layout parameters and gravity. To achieve the desired placement, you need to ensure that you're setting the appropriate layout parameters that influence th... | 31,582 | [
{
"from": "human",
"value": "I'm trying to get the zoom controls to show up in a mapview, the following code almost works, but the zoom controls appear in the top left of the mapview, not the bottom center like I'm specifying via setGravity(). Can someone enlighten me as to what I'm missing?\nzoomView = (L... |
I have a typebuilder that is generating two identical .ctors one that is has no method body and the other that has all the init code.
I am defining a field from another type and a property to access the type and therefore need to init it in the .ctor
Where should I start looking
Code as follows
Public Sub ctor(ByVal ty... | From your description, it sounds like you're encountering an issue where two constructors (`.ctor`) are being generated: one without a body and another that contains the initialization code. This duplication typically happens when multiple method definitions are being made for the same constructor, and the reason could... | 36,831 | [
{
"from": "human",
"value": "I have a typebuilder that is generating two identical .ctors one that is has no method body and the other that has all the init code.\nI am defining a field from another type and a property to access the type and therefore need to init it in the .ctor\nWhere should I start looki... |
We are running our Junit 4 test suite against Weblogic 9 in front of an Oracle 10 database (using Hudson as a continuous integration server) and occasionally we will get an ORA-12519 crash during script teardown. However, the error is very intermittent:
It usually happens for the same Test class
It doesn't always... | The ORA-12519 error you are encountering indicates that the Oracle database is unable to allocate the required resources to establish a connection, usually due to the maximum number of processes allowed being reached. This error can be quite frustrating, especially since it occurs intermittently during your JUnit tests... | 35,787 | [
{
"from": "human",
"value": "We are running our Junit 4 test suite against Weblogic 9 in front of an Oracle 10 database (using Hudson as a continuous integration server) and occasionally we will get an ORA-12519 crash during script teardown. However, the error is very intermittent: \n\nIt usually happens ... |
I'm in the process of making my PHP site Unicode-aware. I'm wondering if anyone has experience with the mbstring.func_overload setting, which replaces the normal string functions (e.g. strlen) with their multi-byte equivalents (mb_strlen). There aren't any comments on the PHP manual page.
Are there any potential proble... | Using `mbstring.func_overload` can be tempting when you want to ensure that your PHP application handles multi-byte character encodings correctly. However, there are some important considerations and potential pitfalls you should be aware of.
### Potential Problems with `mbstring.func_overload`
1. **Compatibility wit... | 36,179 | [
{
"from": "human",
"value": "I'm in the process of making my PHP site Unicode-aware. I'm wondering if anyone has experience with the mbstring.func_overload setting, which replaces the normal string functions (e.g. strlen) with their multi-byte equivalents (mb_strlen). There aren't any comments on the PHP ma... |
I have an issue with nested jquery tabs and needs some help/pointer.
Currently I have 5 Parent tabs and have few sub tabs under each parent tabs.
When page gets loaded I want to show a particular Parent tab and one of its child tab active.
I am able to activate a particular parent tab but same is not working with ch... | When dealing with nested jQuery tabs, it's important to ensure that you properly initialize both the parent tabs and the child tabs. If you want to show a specific parent tab and its corresponding child tab upon page load, you will need to ensure that both the parent tab and the child tab are activated in your JavaScri... | 37,431 | [
{
"from": "human",
"value": "I have an issue with nested jquery tabs and needs some help/pointer.\nCurrently I have 5 Parent tabs and have few sub tabs under each parent tabs. \nWhen page gets loaded I want to show a particular Parent tab and one of its child tab active. \nI am able to activate a particula... |
I am invoking a C library via JNI that prints to stdout. How can I redirect this output to System.out?
| Redirecting the output from a C library that prints to `stdout` to `System.out` in a Java application using JNI can be accomplished by using the `freopen` function in C to redirect `stdout` to a file descriptor that points to Java's `System.out`. Below are the steps to achieve this.
### Step 1: Write a C function to r... | 35,041 | [
{
"from": "human",
"value": "I am invoking a C library via JNI that prints to stdout. How can I redirect this output to System.out?\n"
},
{
"from": "gpt",
"value": "Redirecting the output from a C library that prints to `stdout` to `System.out` in a Java application using JNI can be accomplishe... |
For example:
public class A : A.B
{
public class B { }
}
Which generates this error from the compiler:
Circular base class dependency
involving 'A' and 'A.B'
I always figured a nested class behaved just like a regular class except with special rules concerning accessing the outer class's private members, but I... | Yes, your understanding is partially correct. In C#, nested classes do behave like regular classes, but there are additional rules regarding their relationship with the outer class. The key point that leads to the circular base class dependency error in your example is that a nested class is implicitly associated with ... | 40,082 | [
{
"from": "human",
"value": "For example:\npublic class A : A.B\n{\n public class B { }\n}\n\nWhich generates this error from the compiler:\n\nCircular base class dependency\n involving 'A' and 'A.B'\n\nI always figured a nested class behaved just like a regular class except with special rules concernin... |
Delegates look like such a powerful language feature, but I've yet to find an opportunity to use them in anger (apart from in DALs I must say).
How often do you use them, and under what circumstances do you find them most useful?
| Delegates are indeed a powerful feature in languages like C# that allow for flexible method referencing and event handling. Here are several scenarios where delegates are particularly useful:
1. **Event Handling**: Delegates are extensively used in event-driven programming. For instance, in GUI applications (like thos... | 38,735 | [
{
"from": "human",
"value": "Delegates look like such a powerful language feature, but I've yet to find an opportunity to use them in anger (apart from in DALs I must say).\nHow often do you use them, and under what circumstances do you find them most useful? \n"
},
{
"from": "gpt",
"value": "De... |
I've recently updated an application to the 3.5 framework (from 2.0). The app links to Reporting Services (2005) remotely via an URL. This all works fine locally but when deployed to the dev server (win 2003) I'm getting a 403 error when attempting to call the report server.
"You are not authorized to view this page
..... | The HTTP 403 - Forbidden error you're encountering indicates that the server understood the request but refuses to authorize it. Since this issue started after upgrading to the .NET Framework 3.5, it is likely related to changes in security settings or authentication methods.
Here are some steps to troubleshoot and re... | 38,954 | [
{
"from": "human",
"value": "I've recently updated an application to the 3.5 framework (from 2.0). The app links to Reporting Services (2005) remotely via an URL. This all works fine locally but when deployed to the dev server (win 2003) I'm getting a 403 error when attempting to call the report server.\n\"... |
I need to deploy a few .net dlls. They need to be put in the GAC and the required entries need to be in the registry. On my machine I have both the SDK and Visual Studio running, so currently I am utilizing .net sdk tools like gacutil and regasm. However, when I need to install these dlls on a customer machine, how sho... | To deploy .NET assemblies that need to be placed in the Global Assembly Cache (GAC) and require registry entries, you typically follow these steps:
### 1. **Requirements on the Customer Machine**
- Ensure that the .NET Framework version your assemblies target (in this case, .NET Framework 2.0) is installed on the cust... | 39,210 | [
{
"from": "human",
"value": "I need to deploy a few .net dlls. They need to be put in the GAC and the required entries need to be in the registry. On my machine I have both the SDK and Visual Studio running, so currently I am utilizing .net sdk tools like gacutil and regasm. However, when I need to install ... |
I have an ASP.NET GridView which has columns that look like this:
| Foo | Bar | Total1 | Total2 | Total3 |
Is it possible to create a header on two rows that looks like this?
| | Totals |
| Foo | Bar | 1 | 2 | 3 |
The data in each row will remain unchanged as this is just to pretty up the header and ... | Creating a multi-row header in an ASP.NET GridView is certainly possible, and you've made great progress by implementing it in a custom control. I'll expand a bit on the event handler approach, as well as clean up the code and provide some additional suggestions.
### Using the DataBound Event Handler
If you choose to... | 37,281 | [
{
"from": "human",
"value": "I have an ASP.NET GridView which has columns that look like this:\n| Foo | Bar | Total1 | Total2 | Total3 |\n\nIs it possible to create a header on two rows that looks like this?\n| | Totals | \n| Foo | Bar | 1 | 2 | 3 |\n\nThe data in each row will remain unchan... |
I have a php page that displays rows from a mysql db as a table. One of the fields contains HTML markup, and I would like to amke this row clickable and the html would open in a new popup window. What is the best way to do it, and is there a way to do it without writing the html to a file?
edit: this php page is actua... | To achieve your goal of displaying HTML from your MySQL database in a popup window without writing it to a file, you can follow these steps. Since your application is an AJAX app, you can utilize a JavaScript function to handle the popup.
Here's a solution that addresses the requirements you've mentioned:
1. Fetch th... | 38,593 | [
{
"from": "human",
"value": "I have a php page that displays rows from a mysql db as a table. One of the fields contains HTML markup, and I would like to amke this row clickable and the html would open in a new popup window. What is the best way to do it, and is there a way to do it without writing the htm... |
Is it possible to re-assign the Win+L hotkey to another executable/shortcut?
Use-case - I would like to switch off the monitor of my laptop as soon as it is locked. I know of a executable which can lock and turn off the monitor but I do not want to change the way the system is locked (by running the program explicitly ... | Yes, it is possible to reassign the Win+L hotkey to run another executable or shortcut, but it requires a bit of work because Windows does not natively allow you to override system shortcuts like Win+L. Here are a few approaches you could take:
### Method 1: Using AutoHotkey
1. **Install AutoHotkey:**
Download and... | 37,168 | [
{
"from": "human",
"value": "Is it possible to re-assign the Win+L hotkey to another executable/shortcut?\nUse-case - I would like to switch off the monitor of my laptop as soon as it is locked. I know of a executable which can lock and turn off the monitor but I do not want to change the way the system is ... |
I've been reading up on conditional-style expressions in ruby. However I came across one I couldn't quite understand to define the classic FizzBuzz problem. I understand the FizzBuzz problem and even wrote my own before finding the following quick solution utilising the ternary operator. If someone can explain to me ho... | Certainly! Let's break down the Ruby code you provided that implements the FizzBuzz problem using nested ternary operators.
First, let's clarify what the FizzBuzz problem is: For each number from 0 to 99 (inclusive), you need to print:
- "Fizz" if the number is divisible by 3,
- "Buzz" if the number is divisible by 5,... | 33,946 | [
{
"from": "human",
"value": "I've been reading up on conditional-style expressions in ruby. However I came across one I couldn't quite understand to define the classic FizzBuzz problem. I understand the FizzBuzz problem and even wrote my own before finding the following quick solution utilising the ternary ... |
I've had a couple of complaints that one of our managed apps is using 20-25Mb of RAM. I normally push back and say that memory's cheap; get over it.
Is this reasonable for a Windows Forms app?
| When evaluating memory usage for a Windows Forms application, it's important to consider several factors:
1. **Typical Memory Usage**: A Windows Forms app can vary widely in memory usage based on its functionality, complexity, and the components it uses. Generally, a simple Windows Forms app can use anywhere from a fe... | 39,639 | [
{
"from": "human",
"value": "I've had a couple of complaints that one of our managed apps is using 20-25Mb of RAM. I normally push back and say that memory's cheap; get over it.\nIs this reasonable for a Windows Forms app?\n"
},
{
"from": "gpt",
"value": "When evaluating memory usage for a Windo... |
I'm new to developing applications for the iPhone and iPod touch. Is it possible to communicate directly between 2 devices in the same room by using WiFi or perhaps even BlueTooth on the iPhone?
I've seen a demo of a fire application where one iPhone "lights" other iPhone when they get close to each other. How is thi... | Welcome to iOS development! Yes, it is indeed possible to enable communication between two iOS devices in the same room using Wi-Fi or Bluetooth. Here are some options for accomplishing this, particularly in the context of developing a game that can be played with another person nearby:
### 1. **Multipeer Connectivity... | 37,538 | [
{
"from": "human",
"value": "I'm new to developing applications for the iPhone and iPod touch. Is it possible to communicate directly between 2 devices in the same room by using WiFi or perhaps even BlueTooth on the iPhone?\nI've seen a demo of a fire application where one iPhone \"lights\" other iPhone wh... |
I'm writing a little web-based utility for my brother who needs to merge columns in a CSV file. I know things like this surely exist somewhere, but a large part of this is that is a fun little exercise.
Anyways, I'm trying to figure out the best/neatest way to present the part of the UI where he reorders the columns an... | It sounds like a fun project! To create a user interface that allows your brother to reorder and merge columns in a way that's both intuitive and efficient, you can implement a nested structure with jQuery UI's selectable functionality. Here's a potential approach to achieve this:
### Steps to Create the UI
1. **Base... | 35,833 | [
{
"from": "human",
"value": "I'm writing a little web-based utility for my brother who needs to merge columns in a CSV file. I know things like this surely exist somewhere, but a large part of this is that is a fun little exercise.\nAnyways, I'm trying to figure out the best/neatest way to present the part ... |
I need to use encryption (and signature) for a web-service (server side). I use axis2 and successfully added the rampart module (for WS-Security implementation).
But rampart page (http://ws.apache.org/axis2/modules/rampart/1_2/security-module.html) is missing examples and the sample file are not really documented.
So ... | To add encryption and digital signatures to your web service using Apache Axis2 with the Rampart module, you'll need to perform a few configuration steps. Below is a simplified guide to help you through the process.
### Step 1: Configure `services.xml`
In your Axis2 service's `services.xml` file, you need to configur... | 36,008 | [
{
"from": "human",
"value": "I need to use encryption (and signature) for a web-service (server side). I use axis2 and successfully added the rampart module (for WS-Security implementation).\nBut rampart page (http://ws.apache.org/axis2/modules/rampart/1_2/security-module.html) is missing examples and the s... |
The program that I am currently assigned to has a requirement that I copy the contents of a table to a backup table, prior to the real processing.
During code review, a coworker pointed out that
INSERT INTO BACKUP_TABLE
SELECT *
FROM PRIMARY_TABLE
is unduly risky, as it is possible for the tables to have different col... | To copy the contents of a `PRIMARY_TABLE` to a `BACKUP_TABLE` while avoiding the risks of column mismatches and different orders, you can use a dynamic SQL approach that builds the `INSERT` statement at runtime. This way, you can select the columns of `PRIMARY_TABLE` explicitly from its schema and insert them into `BAC... | 38,301 | [
{
"from": "human",
"value": "The program that I am currently assigned to has a requirement that I copy the contents of a table to a backup table, prior to the real processing.\nDuring code review, a coworker pointed out that\nINSERT INTO BACKUP_TABLE\nSELECT *\nFROM PRIMARY_TABLE\n\nis unduly risky, as it i... |
When generating graphs and showing different sets of data it usually a good idea to difference the sets by color. So one line is red and the next is green and so on. The problem is then that when the number of datasets is unknown one needs to randomly generate these colors and often they end up very close to each other... | Generating distinctly different colors programmatically can be a challenge, especially when you want to ensure that colors are easily distinguishable from one another. Here are several strategies you can use to generate a set of colors that are distinct enough for effective visualization:
### 1. Color Wheel Approach
... | 35,902 | [
{
"from": "human",
"value": "When generating graphs and showing different sets of data it usually a good idea to difference the sets by color. So one line is red and the next is green and so on. The problem is then that when the number of datasets is unknown one needs to randomly generate these colors and o... |
I'd like to display a stack trace in an error dialog in Delphi 2007 (Win32).
Ideally, I'd like something like this:
try
//do something
except on e : exception do
begin
//rollback a transaction or whatever i need to do here
MessageDlg('An error has occurred!' + #13#10 +
e.Message + #13... | In Delphi 2007 (Win32), the `Exception` class does not have a built-in `StackTrace` property. However, you can obtain a stack trace using the `SysUtils` unit and some additional code to capture the call stack when an exception occurs.
Here’s how you can create a simple function to capture the stack trace, and then us... | 33,517 | [
{
"from": "human",
"value": "I'd like to display a stack trace in an error dialog in Delphi 2007 (Win32).\nIdeally, I'd like something like this:\ntry\n //do something\nexcept on e : exception do\n begin\n //rollback a transaction or whatever i need to do here \n MessageDlg('An error has occur... |
I've a web service running on server which return data either in XML format or JSON format.
I wanted to request a JSON format but using HTTP Post method.
| To request data in JSON format from a web service using the HTTP POST method, you will typically need to set the `Content-Type` header to `application/json`. Additionally, you may need to provide a body for the POST request, depending on the API specifications. Here is an example of how to make such a request using var... | 37,466 | [
{
"from": "human",
"value": "I've a web service running on server which return data either in XML format or JSON format.\nI wanted to request a JSON format but using HTTP Post method.\n"
},
{
"from": "gpt",
"value": "To request data in JSON format from a web service using the HTTP POST method, y... |
Generally speaking what do you get out of extending an artificial neural net by adding more nodes to a hidden layer or more hidden layers?
Does it allow for more precision in the mapping, or does it allow for more subtlety in the relationships it can identify, or something else?
| Extending an artificial neural network (ANN) by adding more nodes to a hidden layer or adding more hidden layers has several effects on the network's capabilities, which can lead to various improvements in learning and performance. Here are the main benefits:
1. **Increased Capacity**: Adding more nodes or layers incr... | 39,805 | [
{
"from": "human",
"value": "Generally speaking what do you get out of extending an artificial neural net by adding more nodes to a hidden layer or more hidden layers?\nDoes it allow for more precision in the mapping, or does it allow for more subtlety in the relationships it can identify, or something else... |
Question: Is exception handling in Java actually slow?
Conventional wisdom, as well as a lot of Google results, says that exceptional logic shouldn't be used for normal program flow in Java. Two reasons are usually given,
it is really slow - even an order of magnitude slower than regular code (the reasons given vary... | The perception that exception handling in Java is inherently slow can stem from several factors, but it's essential to consider the context in which exceptions are used and the implications of their performance. Here are some points to clarify the topic:
1. **Throwing Exceptions vs. Handling Exceptions**:
- Throwin... | 38,249 | [
{
"from": "human",
"value": "Question: Is exception handling in Java actually slow?\nConventional wisdom, as well as a lot of Google results, says that exceptional logic shouldn't be used for normal program flow in Java. Two reasons are usually given,\n\nit is really slow - even an order of magnitude slow... |
I've used several apps now that launch the itunes store directly from the app. I'm even using some on my 2.1 iPod 2G.
I know there's a bug in 2.1 that prevents appstore links from working in safari, but somehow people are launching the appstore directly, not even through safari.
How do you do this? Is it an undocumente... | Yes, you are correct! Apps can use a special URL scheme to launch the App Store directly from within the app itself, which is a feature provided by Apple. The method to do this involves using the `openURL` method in the app’s code to open a URL that is formatted specifically for the App Store.
For example, developers ... | 40,270 | [
{
"from": "human",
"value": "I've used several apps now that launch the itunes store directly from the app. I'm even using some on my 2.1 iPod 2G.\nI know there's a bug in 2.1 that prevents appstore links from working in safari, but somehow people are launching the appstore directly, not even through safari... |
Edit: The code here still has some bugs in it, and it could do better in the performance department, but instead of trying to fix this, for the record I took the problem over to the Intel discussion groups and got lots of great feedback, and if all goes well a polished version of Atomic float will be included in a nea... | Your implementation of an atomic float using Intel's Threading Building Blocks (TBB) is a good attempt at creating a lightweight and lock-free solution for atomic operations on floating-point numbers. However, there are a few important considerations and potential issues in your code that need to be addressed:
### Iss... | 32,590 | [
{
"from": "human",
"value": "\nEdit: The code here still has some bugs in it, and it could do better in the performance department, but instead of trying to fix this, for the record I took the problem over to the Intel discussion groups and got lots of great feedback, and if all goes well a polished version... |
i'm trying to use the GeoKit plugin to calculate the distance between 2 points. So the idea is, i do a search for an article, and the results i want to order by distance. So i have a form where I enter the article (that im looking for) and my address. Then rails must find all articles that match with my query and order... | To order your `Article` objects by distance based on the latitude and longitude fields from the associated `User`, you need to modify your query to ensure that it references the correct columns. Since `Article` does not have `lat` and `lng` fields, you should directly use the columns from the `users` table in your orde... | 38,863 | [
{
"from": "human",
"value": "i'm trying to use the GeoKit plugin to calculate the distance between 2 points. So the idea is, i do a search for an article, and the results i want to order by distance. So i have a form where I enter the article (that im looking for) and my address. Then rails must find all ar... |
We're in the process of replacing a legacy system. There is going to be a period of time with both the applications running in tandem. Users will be able to use either system and the challenge is to be able to keep their databases in sync with each other.
The new system is ASP.NET and the legacy is VB6. Both are run... | When considering the challenge of keeping two disparate systems (an ASP.NET application and a legacy VB6 application) in sync during a transitional phase, it's crucial to weigh the options carefully based on the specific constraints, such as the requirement for a low latency of updates (ideally no more than 2 seconds).... | 30,723 | [
{
"from": "human",
"value": "We're in the process of replacing a legacy system. There is going to be a period of time with both the applications running in tandem. Users will be able to use either system and the challenge is to be able to keep their databases in sync with each other.\nThe new system is AS... |
If I send this request to a page:
http://www.server.com/show.xml?color=red&number=two
Can I do something like this?:
I like the color <xsl:url-param name="color" /> and the number <xsl:url-param name="number" />.
If you need clarification of the question, lemme know
Thanks for any answers,
Chrelad
| Yes, you can use XSLT to extract URL parameters and use them in your XML output, but the approach you've suggested—using `<xsl:url-param>`—is not standard in XSLT. Instead, you would typically use a different method to access the parameters.
In XSLT, to access query string parameters from the URL, you'll need to ensur... | 39,995 | [
{
"from": "human",
"value": "If I send this request to a page:\nhttp://www.server.com/show.xml?color=red&number=two\n\nCan I do something like this?:\nI like the color <xsl:url-param name=\"color\" /> and the number <xsl:url-param name=\"number\" />.\n\n\nIf you need clarification of the question, lemme kno... |
well i have this messages table with sample values like these:
msg_id recipient_id read locked new
0 1 N Y Y
2 1 Y N N
ok, so lets just say this is a messaging table, and i want to reset all messages addressed to recipient with id=1
i was wondering... | It seems like you're trying to reset specific columns in your `messages` table for a particular recipient with `recipient_id = 1`. However, if your query is returning 0 affected rows, that means there are no rows meeting the condition specified in your `WHERE` clause. Here are some potential reasons and troubleshooting... | 38,727 | [
{
"from": "human",
"value": "well i have this messages table with sample values like these:\nmsg_id recipient_id read locked new\n 0 1 N Y Y\n 2 1 Y N N\n\nok, so lets just say this is a messaging table, and i want to reset all messages ad... |
I have a key that appears to be an empty string, however using unset($array[""]); does not remove the key/value pair. I don't see another function that does what I want, so I'm guessing it's more complicated that just calling a function.
The line for the element on a print_r is [] => 1, which indicates to me that the k... | It seems like you're encountering an issue with an associative array in PHP where you have an empty string as a key. The key being an empty string can indeed cause confusion. However, using the `unset` function should normally work to remove the key-value pair from the array.
Here are a few things to try to troublesho... | 39,762 | [
{
"from": "human",
"value": "I have a key that appears to be an empty string, however using unset($array[\"\"]); does not remove the key/value pair. I don't see another function that does what I want, so I'm guessing it's more complicated that just calling a function.\nThe line for the element on a print_r ... |
I am having a listbox in ASP.net. I am populating the listbox values from another listbox in a page dynamically. During postbacks the values of output listbox are not persisted.
(while going to another page and come back to this page).
Please suggest some good answer. EnableViewstate = "true" is not working.
| When working with ASP.NET and dynamically populating controls such as a ListBox, it's common to encounter issues with maintaining state across postbacks or navigating away and back to the page. Here are some approaches you can take to ensure that the values in your ListBox persist as expected.
### 1. Maintain State Us... | 32,230 | [
{
"from": "human",
"value": "I am having a listbox in ASP.net. I am populating the listbox values from another listbox in a page dynamically. During postbacks the values of output listbox are not persisted.\n(while going to another page and come back to this page).\nPlease suggest some good answer. EnableVi... |
How can I open a web-page and receive its cookies using PHP?
The motivation: I am trying to use feed43 to create an RSS feed from the non-RSS-enabled HighLearn website (remote learning website). I found the web-page that contains the feed contents I need to parse, however, it requires to login first.
Luckily, logging i... | To achieve what you want — logging into a website, capturing the cookies, and then redirecting the client with those cookies — you can use PHP's `curl` library. `curl` allows you to make HTTP requests, manage cookies, and handle sessions.
Here’s a step-by-step guide on how to log in to the website, capture cookies, an... | 37,825 | [
{
"from": "human",
"value": "How can I open a web-page and receive its cookies using PHP?\nThe motivation: I am trying to use feed43 to create an RSS feed from the non-RSS-enabled HighLearn website (remote learning website). I found the web-page that contains the feed contents I need to parse, however, it r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.