instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I'm using the lines functionality to take an input and split up many variables before sending it off to a function. Please look at the run function and tell me why I get the following error. It seems like it should just assign the first string in ln to seq, but I get an error.
ERROR:dishonest.hs:33:11:
Couldn't ... | The error you are encountering is due to the way you are trying to extract elements from the list `ln`, which is derived from the `lines` function. In Haskell, when you retrieve an element from a list using indexing, the resulting type of that element is not a list but rather the type of the element itself. In your cas... | 46,182 | [
{
"from": "human",
"value": "I'm using the lines functionality to take an input and split up many variables before sending it off to a function. Please look at the run function and tell me why I get the following error. It seems like it should just assign the first string in ln to seq, but I get an error.... |
This is very interesting to me... This image displays perfectly well in Safari, but not at all in Firefox! Here's the relevant code:
<div id="ad">
<p>Advertisment</p>
<img src="/ADS/fakead1.gif" />
</div>
With CSS:
#ad{color: #666;}
#ad p{
font-size: .5em;
text-align: center;
padding: 0;
margi... | There could be a few reasons why the image isn't displaying in Firefox but works perfectly in Safari. Let's go through some potential issues and solutions:
1. **File Path**: Ensure that the path to the image is correct. If you're using a relative path (like `/ADS/fakead1.gif`), it's possible that it points to a differ... | 43,618 | [
{
"from": "human",
"value": "This is very interesting to me... This image displays perfectly well in Safari, but not at all in Firefox! Here's the relevant code:\n<div id=\"ad\">\n <p>Advertisment</p>\n <img src=\"/ADS/fakead1.gif\" />\n</div>\n\nWith CSS:\n#ad{color: #666;}\n#ad p{\n font-size: .... |
exampl:
new Thread(new Runnable() {
public void run() {
while(condition) {
*code that must not be interrupted*
*some more code*
}
}
}).start();
SomeOtherThread.start();
YetAntherThread.start();
How can you ensure that code that must not be interrupted won't be interrupted?
| In Java, to ensure that a block of code is not interrupted or interrupted only in a controlled manner, you can use synchronization techniques. The most common approach is to use the `synchronized` keyword or other concurrency controls provided in the `java.util.concurrent` package. Here are some strategies:
### 1. Usi... | 47,801 | [
{
"from": "human",
"value": "exampl:\nnew Thread(new Runnable() {\n public void run() {\n while(condition) {\n\n *code that must not be interrupted*\n\n *some more code*\n }\n }\n}).start();\n\nSomeOtherThread.start();\n\nYetAntherThread.start();\n\nHow can you ensure that code that must n... |
I'm working on automating the configuration of several JBoss servers, which involves editing a substantial number of XML files.
I'd like to script all these changes as much as possible. But the "standard" tools (sed, grep et al) do not work well with XML. Without necessarily resorting to a higher-level language, how ca... | For XML manipulation in a shell script without resorting to a high-level programming language, one practical approach is to use `xmlstarlet`, a command-line XML toolkit that provides a way to parse and manipulate XML data. It's a good alternative to traditional text-processing tools like `sed` and `grep` when dealing w... | 44,630 | [
{
"from": "human",
"value": "I'm working on automating the configuration of several JBoss servers, which involves editing a substantial number of XML files.\nI'd like to script all these changes as much as possible. But the \"standard\" tools (sed, grep et al) do not work well with XML. Without necessarily ... |
How do I check if a variable, specifically a pointer, is defined in C++? Suppose I have a class:
class MyClass {
public:
MyClass();
~MyClass() {
delete pointer; // if defined!
}
initializePointer() {
pointer = new OtherClass();
}
private:
OtherClass* pointer;
};
| In C++, a pointer itself cannot be "undefined" in the same way as variables can in some higher-level languages; however, it can be "null" or "dangling". To properly manage your pointer and check if it has been initialized or allocated memory, you can set it to `nullptr` when it is declared and then check against `nullp... | 48,003 | [
{
"from": "human",
"value": "How do I check if a variable, specifically a pointer, is defined in C++? Suppose I have a class:\nclass MyClass { \npublic:\n\n MyClass();\n\n ~MyClass() {\n delete pointer; // if defined!\n }\n\n initializePointer() {\n pointer = new OtherClass();\n ... |
I am using Scribd API (www.scribd.com) to display the PDF files in my website. I just want to know is there any other PDF API which i can use to embed the PDF in my website. FASTER and MORE customizable than Scribd, Mainly i want to put my company logo in that API, whereas in scribd they are displaying there logo.
So j... | There are several options for embedding and displaying PDFs on your website that allow for customization and do not prominently feature a third-party logo like Scribd. Here are some options:
### 1. **PDF.js**
- **Description**: PDF.js is a JavaScript library developed by Mozilla for rendering PDFs in a web browser usi... | 45,175 | [
{
"from": "human",
"value": "I am using Scribd API (www.scribd.com) to display the PDF files in my website. I just want to know is there any other PDF API which i can use to embed the PDF in my website. FASTER and MORE customizable than Scribd, Mainly i want to put my company logo in that API, whereas in sc... |
How do I increase the maxPoolSize in Grails when using mysql? It appears to be using a default connection pool only 8 connections.
| In a Grails application, the default connection pooling is typically managed by a library called HikariCP or by the built-in connection pooling that comes with DataSource configurations. If you want to increase the `maxPoolSize` for a MySQL database, you will typically configure this in the `application.yml` or `DataSo... | 47,634 | [
{
"from": "human",
"value": "How do I increase the maxPoolSize in Grails when using mysql? It appears to be using a default connection pool only 8 connections. \n"
},
{
"from": "gpt",
"value": "In a Grails application, the default connection pooling is typically managed by a library called Hi... |
Is there a problem with using IEnumerable<T> as a return type?
FxCop complains about returning List<T> (it advises returning Collection<T> instead).
Well, I've always been guided by a rule "accept the least you can, but return the maximum."
From this point of view, returning IEnumerable<T> is a bad thing, but what shou... | The choice of return type in your methods can have a significant impact on both usability and performance. Let's break down your considerations:
### IEnumerable<T> as a Return Type
Returning `IEnumerable<T>` is often a good practice when you want to provide a sequence of items without exposing the underlying collecti... | 47,646 | [
{
"from": "human",
"value": "Is there a problem with using IEnumerable<T> as a return type?\nFxCop complains about returning List<T> (it advises returning Collection<T> instead).\nWell, I've always been guided by a rule \"accept the least you can, but return the maximum.\"\nFrom this point of view, returnin... |
Is it possible, using actionscript 3 to disable the right click menu?
Any help greatly appreciated!
| Yes, you can disable the right-click context menu in ActionScript 3 by using the `Mouse` class to listen for right-click events and preventing the default behavior. Here's a simple example of how to achieve this:
```actionscript
import flash.events.MouseEvent;
// Add event listener for right click
stage.addEventListe... | 48,275 | [
{
"from": "human",
"value": "Is it possible, using actionscript 3 to disable the right click menu?\nAny help greatly appreciated!\n"
},
{
"from": "gpt",
"value": "Yes, you can disable the right-click context menu in ActionScript 3 by using the `Mouse` class to listen for right-click events and p... |
I'm trying to create a "workflow" bar on a web page.
The items in the workflow might be of different lengths.
There might be enough items to fill the width of the screen, hence the flow needs to wrap onto the next line.
I'm using left floating divs to do this.
However, I'd like the divs to take an appropriate amount o... | Using tables for layout purposes is generally discouraged in modern web development, as they are not semantic for layout and can cause issues with accessibility and responsiveness. Instead, you can achieve the desired layout using CSS Flexbox or CSS Grid. Both of these approaches are more flexible and easier to maintai... | 39,117 | [
{
"from": "human",
"value": "I'm trying to create a \"workflow\" bar on a web page.\nThe items in the workflow might be of different lengths.\nThere might be enough items to fill the width of the screen, hence the flow needs to wrap onto the next line.\nI'm using left floating divs to do this. \nHowever, I'... |
Does anyone know of any method in Rails by which an associated object may be frozen. The problem I am having is that I have an order model with many line items which in turn belong to a product or service. When the order is paid for, I need to freeze the details of the ordered items so that when the price is changed, t... | In Rails, freezing an object typically refers to preventing any further modifications to that object, which can be useful in scenarios where you need to ensure that the state of an object does not change after it has been finalized (for example, after an order has been paid).
In your case, where you want to preserve t... | 44,496 | [
{
"from": "human",
"value": "Does anyone know of any method in Rails by which an associated object may be frozen. The problem I am having is that I have an order model with many line items which in turn belong to a product or service. When the order is paid for, I need to freeze the details of the ordered i... |
I have a windows service I am trying to debug.
Is it a bad idea to add error logging in the Catch() clause?
My logging is using a database to log the errors btw.
| Adding error logging in the `catch` clause of your Windows service is not a bad idea; in fact, it's often essential for diagnosing issues in a production environment. However, there are several best practices and considerations to keep in mind to ensure that your logging approach is effective and does not introduce new... | 46,683 | [
{
"from": "human",
"value": "I have a windows service I am trying to debug.\nIs it a bad idea to add error logging in the Catch() clause?\nMy logging is using a database to log the errors btw.\n"
},
{
"from": "gpt",
"value": "Adding error logging in the `catch` clause of your Windows service is ... |
I need to be able to allow a user to enter Vietnamese text into a text box.
I have been instructed to use VNI-Times and provided a sample word document with Vietnamese text.
When I paste the text from the sample document into the textbox it is encoded incorrectly. I have tried installing the font (VNI-Times) on both my... | To support Vietnamese text correctly in an ASP.NET application using `asp:TextBox`, you need to ensure that the proper encoding is used throughout the application, from input to output. Here are several steps you can follow to address the issues:
### 1. Set the Correct Encoding in Your Web Page
Ensure that your web p... | 47,587 | [
{
"from": "human",
"value": "I need to be able to allow a user to enter Vietnamese text into a text box.\nI have been instructed to use VNI-Times and provided a sample word document with Vietnamese text.\nWhen I paste the text from the sample document into the textbox it is encoded incorrectly. I have tried... |
Sorry for the slightly rubbish title. I could not think how to describe this one better.
I am trying to implement the Google Friend Connect members gadget on my site, (just got into the scheme and want to put it in without a major redesign, at least for testing sake).
My problem is as follows:
I have a container div t... | It sounds like you want to create a layout where you have a Google Friend Connect members gadget on the right side of a container, and you want another div to fill the remaining space on the left. You can definitely mix pixel (`px`) and percentage (`%`) widths in CSS, but you'll need to ensure that the container div ha... | 47,912 | [
{
"from": "human",
"value": "Sorry for the slightly rubbish title. I could not think how to describe this one better.\nI am trying to implement the Google Friend Connect members gadget on my site, (just got into the scheme and want to put it in without a major redesign, at least for testing sake).\nMy prob... |
Are there major advantages to InnoDB hot backup vs ZRM snapshots in terms of disruption to the running site, the size of compressed backup files, and speed of backup/restore on a medium-sized to largish all-InnoDB database?
My understanding is that InnoDB's approach is more reliable, faster, does not cause a significan... | When comparing InnoDB hot backup to ZRM (Zmanda Recovery Manager) snapshots, it's essential to understand the characteristics and benefits of both approaches, especially in the context of a medium to large InnoDB database. Here’s a breakdown of the advantages and trade-offs concerning disruption, backup file sizes, and... | 39,036 | [
{
"from": "human",
"value": "Are there major advantages to InnoDB hot backup vs ZRM snapshots in terms of disruption to the running site, the size of compressed backup files, and speed of backup/restore on a medium-sized to largish all-InnoDB database?\nMy understanding is that InnoDB's approach is more rel... |
Is there any way to find all references to an object while debugging?
| Yes, there are ways to find all references to an object while debugging, though the method may vary depending on the programming language, debugging tools, and environment you are using. Below are some approaches for common programming environments:
### 1. **Using IDE Features**
Many Integrated Development Environment... | 47,107 | [
{
"from": "human",
"value": "Is there any way to find all references to an object while debugging?\n"
},
{
"from": "gpt",
"value": "Yes, there are ways to find all references to an object while debugging, though the method may vary depending on the programming language, debugging tools, and envi... |
I have made some changes to a site and need to re-host it as the current host is ceasing to exist. My client has received the following from the current host:
"The best thing to tell them is that, due to the fact that we are withdrawing our service completely, we would look to fully transfer the web site address acros... | It sounds like your current hosting provider is transitioning away from their services and is offering to transfer your website's domain to a new host. Here’s a breakdown of what they mean and how to proceed:
1. **Full Transfer vs. Pointing**:
- **Full Transfer**: This means that the domain registration will be tra... | 44,699 | [
{
"from": "human",
"value": "I have made some changes to a site and need to re-host it as the current host is ceasing to exist. My client has received the following from the current host:\n\"The best thing to tell them is that, due to the fact that we are withdrawing our service completely, we would look t... |
As you can see here and here I'm not a good friend of asp.net MVC's SelectList.
This time I'm wondering how to count the items in it. I want to show a label instead of a dropdown if the possible items don't offer any choice (items.count <2).
--EDIT--
Although Will's answer probably works too, the easy way to go is cal... | In ASP.NET MVC, if you're using `SelectList` and you want to determine the number of items in it to conditionally display either a dropdown or a label, you're right in considering using `.GetListItems().Count()`. However, it’s important to clarify how to properly work with `SelectList`.
Here's an example of how you ca... | 45,818 | [
{
"from": "human",
"value": "As you can see here and here I'm not a good friend of asp.net MVC's SelectList.\nThis time I'm wondering how to count the items in it. I want to show a label instead of a dropdown if the possible items don't offer any choice (items.count <2).\n--EDIT-- \nAlthough Will's answer p... |
I know that some big players have embraced it and are actually exposing some of their services in APP compliant way, already. However, I haven't found many other (smaller) players in this field. Do you know any web application/service that uses APP as its public API protocol? What is your own take on AtomPub? Do you ha... | Atom Publishing Protocol (AtomPub or APP) was introduced as a standard protocol for publishing and editing web resources, primarily built on the Atom syndication format. It allows for a RESTful interface that enables clients to create, update, and delete resources on a server. Some notable services that have embraced A... | 45,534 | [
{
"from": "human",
"value": "I know that some big players have embraced it and are actually exposing some of their services in APP compliant way, already. However, I haven't found many other (smaller) players in this field. Do you know any web application/service that uses APP as its public API protocol? Wh... |
During development (and for debugging) it is very useful to run a Java class' public static void main(String[] argv) method directly from inside Eclipse (using the Run As context menu).
Is there a similarily quick way to specify command line parameters for the run?
What I do now is go to the "Run Dialog", click throug... | Eclipse does not have a built-in feature that directly allows you to run a Java application with command-line arguments in a prompt style like you're describing. However, there are some workarounds and tools you can use to make the process easier.
### Option 1: Run Configurations
While you want to avoid the "Run Dial... | 46,706 | [
{
"from": "human",
"value": "During development (and for debugging) it is very useful to run a Java class' public static void main(String[] argv) method directly from inside Eclipse (using the Run As context menu).\nIs there a similarily quick way to specify command line parameters for the run?\nWhat I do ... |
I was wondering if anyone has seen this issue before.
I have two button on a webpage. When I navigate away from the page and hit the back button to return the value of one button is placed in the value of the other.
E.g
<input class="SmallData" type="submit" id="logButton" value="Log In" tabindex="93"></input>
<input ... | It sounds like you are experiencing an issue with the browser's caching behavior when navigating away from a page and then using the back button to return to it. There are a few things you can investigate to understand and potentially fix this problem:
1. **Browser Caching**: Browsers cache web pages for performance r... | 46,412 | [
{
"from": "human",
"value": "I was wondering if anyone has seen this issue before.\nI have two button on a webpage. When I navigate away from the page and hit the back button to return the value of one button is placed in the value of the other.\nE.g\n<input class=\"SmallData\" type=\"submit\" id=\"logButto... |
Since I kicked off the process of inserting 7M rows from one table into two others, I'm wondering now if there's a faster way to do this. The process is expected to finish in an hour, that's 24h of processing.
Here's how it goes:
The data from this table
RAW (word VARCHAR2(4000), doc VARCHAR2(4000), count NUMBER);
sho... | Inserting 7 million rows from one table to two others in a database can be time-consuming, especially if you're doing it through Java inserts with manual commits. Here are some strategies that could help speed up your process:
### 1. Batch Inserts
Instead of executing each insert statement separately, consider batchin... | 45,330 | [
{
"from": "human",
"value": "Since I kicked off the process of inserting 7M rows from one table into two others, I'm wondering now if there's a faster way to do this. The process is expected to finish in an hour, that's 24h of processing.\nHere's how it goes:\nThe data from this table\nRAW (word VARCHAR2(40... |
I'm trying to figure out what would be the simplest way to validate required fields without having to do an if statement for each element's name. Perhaps just with a loop and verify its class.
What I'm trying to accomplish is to check only the ones that have the class name as "required"
<input name="a1" class="required... | You can achieve this validation using JavaScript by selecting all input fields with the class name "required" and then checking whether they are empty. This can be done efficiently with a loop. Here’s a simple example to illustrate how you can do this:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=... | 40,502 | [
{
"from": "human",
"value": "I'm trying to figure out what would be the simplest way to validate required fields without having to do an if statement for each element's name. Perhaps just with a loop and verify its class.\nWhat I'm trying to accomplish is to check only the ones that have the class name as \... |
I've got an own control with a calendar popup and other functionality.
I've placed that Control into a grid in the content of another Page.
My problem now is, that the Calendar Control is cut. So i only see half of the calendar. How can i bring it to the Front? Like the normal DatePicker Control does??
Update:
What I'm... | To achieve the desired behavior of having your custom calendar control displayed as an overlay (similar to how a standard DatePicker works), you can follow these steps:
### 1. **Use a Popup Control:**
Instead of directly embedding your calendar control in the grid or content area, consider using a `Popup` control (or ... | 47,174 | [
{
"from": "human",
"value": "I've got an own control with a calendar popup and other functionality.\nI've placed that Control into a grid in the content of another Page.\nMy problem now is, that the Calendar Control is cut. So i only see half of the calendar. How can i bring it to the Front? Like the normal... |
All,
When my gridview binds to its datasource (set programmatically) and generates the HTML, the row ID's are coming out in the HTML as the same for every row ... i.e. they are not unique. I expect this:
<select name="ctl00$ContentHolder$list$ctl03$EquipmentTypeList" id="ctl00_ContentHolder_list_ctl03_EquipmentTypeList... | It sounds like you're experiencing issues with IDs not being generated uniquely for the controls inside a GridView row. This is a common scenario when using user controls or when the control structure does not properly account for the hierarchical nature of ASP.NET Web Forms.
Here are some steps and suggestions to add... | 47,945 | [
{
"from": "human",
"value": "All,\nWhen my gridview binds to its datasource (set programmatically) and generates the HTML, the row ID's are coming out in the HTML as the same for every row ... i.e. they are not unique. I expect this:\n<select name=\"ctl00$ContentHolder$list$ctl03$EquipmentTypeList\" id=\"ct... |
I am trying to have a tooltip on multiple lines. how do i do this?
| To create a tooltip that displays content over multiple lines, you can use CSS for styling along with HTML for structure. There are several ways to implement this, depending on the technology stack you're using. Below are examples using pure HTML and CSS, as well as using JavaScript if you need additional control.
###... | 43,231 | [
{
"from": "human",
"value": "I am trying to have a tooltip on multiple lines. how do i do this?\n"
},
{
"from": "gpt",
"value": "To create a tooltip that displays content over multiple lines, you can use CSS for styling along with HTML for structure. There are several ways to implement this, de... |
While dabbling in Clojure I've written a very basic program to echo whatever the user types into it. However, it doesn't run in a way that I'm perceiving to be natural. Here's the code:
(defn goo []
(print "echo> ")
(def resp (read-line))
(print resp)
)
I would expect the code to run like this (for me typing in ... | The behavior you're observing in your original Clojure code is primarily due to how output buffering works in many programming environments, including the REPL (Read-Eval-Print Loop) used by Clojure.
### Explanation:
When you use `(print "echo> ")`, the output may not immediately appear in the terminal because the ou... | 48,925 | [
{
"from": "human",
"value": "While dabbling in Clojure I've written a very basic program to echo whatever the user types into it. However, it doesn't run in a way that I'm perceiving to be natural. Here's the code:\n(defn goo []\n (print \"echo> \")\n (def resp (read-line))\n (print resp)\n)\n\nI would e... |
I finally got to work with canvas only to find out that it is not implemented in IE. I tried explore canvas from google to use it in Internet Explorer, but it's not working for my code (http://uptowar.com/test.php - little bug though that it is not removing the old image when rotating).
So, is there an other way to smo... | If you're looking for a way to rotate an image smoothly in Internet Explorer and handle the canvas issues you're encountering, you have a few alternatives:
### 1. Using CSS Transforms
If you're targeting modern browsers, you can achieve smooth image rotations using CSS transforms. While Internet Explorer does not supp... | 45,553 | [
{
"from": "human",
"value": "I finally got to work with canvas only to find out that it is not implemented in IE. I tried explore canvas from google to use it in Internet Explorer, but it's not working for my code (http://uptowar.com/test.php - little bug though that it is not removing the old image when ro... |
In one of my current side projects, I am scanning through some text looking at the frequency of word triplets. In my first go at it, I used the default dictionary three levels deep. In other words, topDict[word1][word2][word3] returns the number of times these words appear in the text, topDict[word1][word2] returns a... | To reduce the memory overhead of your implementation while still maintaining efficient lookups for word triplets, you might want to consider the following strategies:
### 1. Use a `defaultdict` with `Counter`
Instead of using a nested dictionary, you can use `collections.defaultdict` with `collections.Counter`. This w... | 42,740 | [
{
"from": "human",
"value": "In one of my current side projects, I am scanning through some text looking at the frequency of word triplets. In my first go at it, I used the default dictionary three levels deep. In other words, topDict[word1][word2][word3] returns the number of times these words appear in ... |
Here's my current SQL statement:
SEARCH_ALBUMS_SQL = "SELECT * FROM albums WHERE title LIKE ? OR artist LIKE ?;";
It's returning exact matches to the album or artist names, but not anything else. I can't use a '%' in the statement or I get errors.
How do I add wildcards to a prepared statement?
(I'm using Java5 and My... | In SQL, when you want to use wildcards in a prepared statement, you need to include the wildcards directly in the parameters that you pass to the prepared statement. In your case, you want to search for titles or artists that match a pattern, so you should include the wildcard characters (`%`) around the search term be... | 47,674 | [
{
"from": "human",
"value": "Here's my current SQL statement:\nSEARCH_ALBUMS_SQL = \"SELECT * FROM albums WHERE title LIKE ? OR artist LIKE ?;\";\n\nIt's returning exact matches to the album or artist names, but not anything else. I can't use a '%' in the statement or I get errors.\nHow do I add wildcards t... |
I get the name of a variable from the script user as the first argument and I echo the value of said variable back to the console:
#!/bin/bash
variablename=$1
echo "The value of $variablename is: " ${!variablename}
This works great!
What I can't get to work is if I want to change that variable into the value of the se... | In Bash, you can use indirect referencing to read and write to a variable whose name is stored in another variable. You were close in your attempt, but there was a small syntax error in your assignment line.
To set the value of a variable using its name stored in another variable, you can use the `eval` command or the... | 46,222 | [
{
"from": "human",
"value": "I get the name of a variable from the script user as the first argument and I echo the value of said variable back to the console:\n#!/bin/bash\nvariablename=$1\necho \"The value of $variablename is: \" ${!variablename}\n\nThis works great!\nWhat I can't get to work is if I want... |
What I'm trying to accomplish
My app generates some tabular data
I want the user to be able to launch Excel and click "paste" to place the data as cells in Excel
Windows accepts a format called "CommaSeparatedValue" that is used with it's APIs so this seems possible
Putting raw text on the clipboard works, but trying ... | It sounds like you're encountering a common issue when trying to use the `Clipboard.SetText()` method with the `TextDataFormat.CommaSeparatedValue` format. The behavior you've observed, where Excel only receives garbage text, suggests that the format is not being handled correctly.
Here's some clarification regarding ... | 46,277 | [
{
"from": "human",
"value": "What I'm trying to accomplish\n\nMy app generates some tabular data\nI want the user to be able to launch Excel and click \"paste\" to place the data as cells in Excel\nWindows accepts a format called \"CommaSeparatedValue\" that is used with it's APIs so this seems possible\nPu... |
I was wondering if there is an iterator in the STL that dereferences the object pointed before returning it. This could be very useful when manipulating containers aggregating pointers. Here's an example of what I would like to be able to do:
#include <vector>
#include <iterator>
#include <algorithm>
using namespace s... | In the C++ Standard Library (STL), there isn't a built-in iterator that directly dereferences pointers stored in a container. However, you can create a custom iterator called `deref_iterator` that does exactly what you want. This iterator can wrap around any iterator that points to a pointer type and provide the derefe... | 46,963 | [
{
"from": "human",
"value": "I was wondering if there is an iterator in the STL that dereferences the object pointed before returning it. This could be very useful when manipulating containers aggregating pointers. Here's an example of what I would like to be able to do:\n#include <vector>\n#include <iterat... |
I have ask this kind of question before, but it seems my previous question is a bit misleading due to my poor English. I'm asking again to make clear. I am really confused about it. Thanks in advance.
Suppose I have a function A for generating the state of a cell in a certain rule, and I have another function which gen... | I understand that you're looking to apply a function (let's call it `first_function`) repeatedly on a matrix to generate a new state for a specified number of times. You also want to implement this in a second function (let's call it `second_function`).
Below is an example implementation in Python to help clarify how... | 45,458 | [
{
"from": "human",
"value": "I have ask this kind of question before, but it seems my previous question is a bit misleading due to my poor English. I'm asking again to make clear. I am really confused about it. Thanks in advance.\nSuppose I have a function A for generating the state of a cell in a certain r... |
I am using a makefile system with the pvcs compiler (using Microsoft Visual C++, 2008 compiler) and I am getting several link errors of the form:
error LNK2019: unresolved external symbol __imp__RegisterFilter@8 referenced in function _main
This is happening DESPITE using the extern "C" declaration, viz.:
extern "C" ... | Hi Joseph,
It sounds like you're encountering a linker error due to unresolved symbols when migrating your codebase from an older version of Microsoft Visual C++ to 2008. The error message `LNK2019: unresolved external symbol __imp__RegisterFilter@8` suggests that the linker is unable to find the definition of the `Re... | 47,484 | [
{
"from": "human",
"value": "I am using a makefile system with the pvcs compiler (using Microsoft Visual C++, 2008 compiler) and I am getting several link errors of the form:\n\nerror LNK2019: unresolved external symbol __imp__RegisterFilter@8 referenced in function _main\n\nThis is happening DESPITE using ... |
I have a file with n lines. (n above 100 millions)
I want to output a file with only 1 of 10 lines, I can't split the file in ten part and keep only one part, as it must be a little more random. later I have to do a statistical analysis I can't afford to create a strong bias in the data).
I was thinking of reading the ... | It seems you're trying to achieve a task in a constrained environment with Windows batch scripting. The solution you provided from Paul using `findstr` is indeed a viable approach for your requirements. Below, I'll provide a complete batch file solution with explanations for clarity.
### Batch File Solution
```batch
... | 44,368 | [
{
"from": "human",
"value": "I have a file with n lines. (n above 100 millions)\nI want to output a file with only 1 of 10 lines, I can't split the file in ten part and keep only one part, as it must be a little more random. later I have to do a statistical analysis I can't afford to create a strong bias in... |
I have set up a version control system using TortoiseSVN at my home to manage my pet projects, school projects etc...and it works locally.
Now I need to be able to access my code repository remotely, like from school, so that I will be able to update the source at school from the repository, and commit it again once I ... | To access your local SVN (Subversion) repository remotely, you'll need to expose it to the internet and set up the appropriate network configuration. Here are the steps to achieve this:
### Step 1: Set Up the SVN Server
1. **Install an SVN Server**: You need to install an SVN server on your machine that can handle inc... | 45,219 | [
{
"from": "human",
"value": "I have set up a version control system using TortoiseSVN at my home to manage my pet projects, school projects etc...and it works locally.\nNow I need to be able to access my code repository remotely, like from school, so that I will be able to update the source at school from t... |
How do I check to see if a column exists in a SqlDataReader object? In my data access layer, I have create a method that builds the same object for multiple stored procedures calls. One of the stored procedures has an additional column that is not used by the other stored procedures. I want to modified the method to... | To check if a column exists in a `SqlDataReader` object in C#, you can loop through the `SqlDataReader`'s schema information using the `GetSchemaTable` method or you can use the `SqlDataReader.GetOrdinal` method within a try-catch block.
### Using GetSchemaTable
One way to achieve this is to use the `GetSchemaTable` ... | 46,541 | [
{
"from": "human",
"value": "How do I check to see if a column exists in a SqlDataReader object? In my data access layer, I have create a method that builds the same object for multiple stored procedures calls. One of the stored procedures has an additional column that is not used by the other stored proc... |
I get this error when using c:>route add <route_and_interface_here>
This happens on a RRAS server that has a PPTP site-to-site VPN setup with demand-dialing static route. This route shows in RRAS routing table but does not show in c:>route print table which might be the first source of the problem.
Anyone seen this bef... | It sounds like you're dealing with a routing issue on a Windows Server 2003 machine with Routing and Remote Access Service (RRAS) configured, especially in a setup with a PPTP site-to-site VPN.
### Potential Solutions to Your Issue:
1. **Ensure Routing and Remote Access Service is Running**: Double-check that the RRA... | 44,151 | [
{
"from": "human",
"value": "I get this error when using c:>route add <route_and_interface_here>\nThis happens on a RRAS server that has a PPTP site-to-site VPN setup with demand-dialing static route. This route shows in RRAS routing table but does not show in c:>route print table which might be the first s... |
What is the shortest chunk of C++ you can come up with to safely clean up a std::vector or std::list of pointers? (assuming you have to call delete on the pointers?)
list<Foo*> foo_list;
I'd rather not use Boost or wrap my pointers with smart pointers.
| If you want to safely clean up a `std::vector` or `std::list` of raw pointers in C++, you need to iterate over the container, delete each pointer, and then clear the container to avoid dangling pointers. Here's a minimal example that demonstrates how to do this for a `std::list` of pointers.
### Example for `std::list... | 43,989 | [
{
"from": "human",
"value": "What is the shortest chunk of C++ you can come up with to safely clean up a std::vector or std::list of pointers? (assuming you have to call delete on the pointers?)\nlist<Foo*> foo_list;\n\nI'd rather not use Boost or wrap my pointers with smart pointers.\n"
},
{
"from... |
I have a small calculator that I am creating in C# (Sharp Develop). The user enters two values and the code returns the third. I am having trouble rounding the third value once it is returned. I have been through a couple of forums and the msdn site and I understand the code that is posted there, but I cant seem to mak... | Certainly! It looks like you are attempting to compute a value `z`, and then you want to round that value before displaying it in the `tb2_kva` text box. To round a decimal in C#, you can use the `Math.Round` method.
Here's how you could modify your existing code to round `z` to, for example, two decimal places before... | 45,305 | [
{
"from": "human",
"value": "I have a small calculator that I am creating in C# (Sharp Develop). The user enters two values and the code returns the third. I am having trouble rounding the third value once it is returned. I have been through a couple of forums and the msdn site and I understand the code tha... |
I have created a custom UserControl in Managed C++ that wraps some native code controls. I have confirmed the control works at runtime, and have been trying to make the control work with the Visual Studio designer by allowing drag and drop of the control from the designer toolbox.
While I have successfully added the Us... | When dealing with custom UserControls in Managed C++ (C++/CLI) and ensuring that they work correctly with the Visual Studio designer, there are several steps you can take to troubleshoot and potentially resolve the `FileNotFoundException` you're encountering. Here are some approaches you might consider:
### 1. Assembl... | 43,563 | [
{
"from": "human",
"value": "I have created a custom UserControl in Managed C++ that wraps some native code controls. I have confirmed the control works at runtime, and have been trying to make the control work with the Visual Studio designer by allowing drag and drop of the control from the designer toolbo... |
I've been hitting a java.lang.OutOfMemoryError: PermGen error when compiling a project with ant under Linux with jdk 1.5.0_11. the same project compiles under windows without problem.
Usually this relates to the MaxPermSize allocated to the JVM. Irakli Nadareishvili has one of the best explanations of PermGen errors an... | Yes, setting the `ANT_OPTS` environment variable to include `-XX:MaxPermSize=128m` is a common and effective solution for addressing the `java.lang.OutOfMemoryError: PermGen` issue when running Ant tasks, including `bpelc`. By setting this variable, you instruct the Java Virtual Machine (JVM) used by Ant to allocate a ... | 45,604 | [
{
"from": "human",
"value": "I've been hitting a java.lang.OutOfMemoryError: PermGen error when compiling a project with ant under Linux with jdk 1.5.0_11. the same project compiles under windows without problem.\nUsually this relates to the MaxPermSize allocated to the JVM. Irakli Nadareishvili has one of ... |
I am loading JSON data to my page and using appendTo() but I am trying to fade in my results, any ideas?
$("#posts").fadeIn();
$(content).appendTo("#posts");
I saw that there is a difference between append and appendTo, on the documents.
I tried this as well:
$("#posts").append(content).fadeIn();
I got it, the above ... | It's great that you found a solution for fading in your content after appending it. However, if you're encountering "undefined" in your JSON values, it likely means that there's an issue with how you're accessing or processing the JSON data.
Here's a checklist of things you can look into to resolve the "undefined" iss... | 46,731 | [
{
"from": "human",
"value": "I am loading JSON data to my page and using appendTo() but I am trying to fade in my results, any ideas?\n$(\"#posts\").fadeIn();\n$(content).appendTo(\"#posts\");\n\nI saw that there is a difference between append and appendTo, on the documents.\nI tried this as well:\n$(\"#pos... |
I love to Extend my Assert.AreEqual to many different classes, the known one is the CollectionAssert of course, but I can think of some more such as: ImageAssert, XmlAssert etc..
Did you Create your own Assert classes? and what kind of new would you like to create?
| Creating custom assertion classes can significantly enhance testing capabilities, especially when dealing with specific data types or structures that are not well covered by standard assertions. Here are some ideas for custom assertion classes, along with a brief explanation of each:
1. **ImageAssert**: This class cou... | 47,810 | [
{
"from": "human",
"value": "I love to Extend my Assert.AreEqual to many different classes, the known one is the CollectionAssert of course, but I can think of some more such as: ImageAssert, XmlAssert etc..\nDid you Create your own Assert classes? and what kind of new would you like to create?\n"
},
{
... |
I'm trying to map a joined-subclass scenario using Fluent NHibernate.
I have a class Entity defined in the namespace Core, and a class
SubClass : Entity in the namespace SomeModule
Now I obviously don't want class Entity to know about its derived
types, the SomeModules namespace references Core - not the other way
arou... | In Fluent NHibernate, mapping a joined subclass while adhering to your design constraints can be achieved using the `JoinedSubClass` method, but it requires a slightly different approach to keep the `Entity` class unaware of its derived classes.
To achieve this, you can define the mapping for the `Entity` class withou... | 45,512 | [
{
"from": "human",
"value": "I'm trying to map a joined-subclass scenario using Fluent NHibernate.\nI have a class Entity defined in the namespace Core, and a class\nSubClass : Entity in the namespace SomeModule\nNow I obviously don't want class Entity to know about its derived\ntypes, the SomeModules names... |
Are there any performance benchmarks for Mono compared to say Java in GNU/Linux?
Have you ever tested Mono's performance?
| Yes, there have been various performance benchmarks comparing Mono and Java, particularly in the context of GNU/Linux. However, it's important to note that the performance of both platforms can vary widely depending on the specific use case, application architecture, and workload.
### General Observations:
1. **Execut... | 47,265 | [
{
"from": "human",
"value": "Are there any performance benchmarks for Mono compared to say Java in GNU/Linux?\nHave you ever tested Mono's performance?\n"
},
{
"from": "gpt",
"value": "Yes, there have been various performance benchmarks comparing Mono and Java, particularly in the context of GNU... |
I want to allow only users with a 3G phone to use a particular GPS function. How do I run a check on the device before allowing that feature to be used?
| To restrict access to a GPS feature for only users with a 3G phone, you need to check the device's network capabilities before allowing the feature to be used. Here's a general approach to achieve this:
### For Android:
1. **Check Network Type**: You can use the `ConnectivityManager` to determine the network type.
``... | 47,346 | [
{
"from": "human",
"value": "I want to allow only users with a 3G phone to use a particular GPS function. How do I run a check on the device before allowing that feature to be used?\n"
},
{
"from": "gpt",
"value": "To restrict access to a GPS feature for only users with a 3G phone, you need to ... |
I have a ticks value of 28000000000 which should be 480 minutes but how can I be sure? How do I convert a ticks value to minutes?
| Ticks are often used as a unit of time in programming, particularly in environments like .NET, where one tick represents 100 nanoseconds (or 0.1 milliseconds).
To convert ticks to minutes, you can use the following steps:
1. **Understand the relationship**:
- 1 tick = 100 nanoseconds
- 1 millisecond = 10,000 ti... | 48,613 | [
{
"from": "human",
"value": "I have a ticks value of 28000000000 which should be 480 minutes but how can I be sure? How do I convert a ticks value to minutes?\n"
},
{
"from": "gpt",
"value": "Ticks are often used as a unit of time in programming, particularly in environments like .NET, where one... |
Both of these appservers are at least in part OSGI based. One (Glassfish) is obviously Java EE while the other isn't. Now I'm at the stage of choosing a platform for a new project and the natural choice is Glassfish v3 Prelude. This does raise the issue of perhaps we should be using S2AP instead.
The question then i... | Choosing between GlassFish (specifically v3 Prelude) and the SpringSource DM Server involves considering several factors related to your project’s requirements, development philosophy, and future scalability. Here are some key points for each platform that might help you in your decision:
### GlassFish v3 Prelude
1. *... | 47,593 | [
{
"from": "human",
"value": "Both of these appservers are at least in part OSGI based. One (Glassfish) is obviously Java EE while the other isn't. Now I'm at the stage of choosing a platform for a new project and the natural choice is Glassfish v3 Prelude. This does raise the issue of perhaps we should b... |
I have multiple controller actions that takes an id
public ActionResult Get(int? id) {
...
}
public ActionResult Delete(int id) {
...
}
public JsonResult GetJson(int? id) {
...
}
I'm thinking its best practice to use a ModelBinder (SomeObjectFromIDModelBinder) on each action, so the obtaining of the object is separa... | Your approach to using custom ModelBinders in this scenario is well thought out and aligns with good practices in ASP.NET MVC. Here are some thoughts on your plan:
1. **Separation of Concerns**: By creating a custom ModelBinder like `SomeObjectFromIDModelBinder`, you are effectively separating the responsibility of re... | 47,295 | [
{
"from": "human",
"value": "I have multiple controller actions that takes an id\npublic ActionResult Get(int? id) {\n...\n}\n\npublic ActionResult Delete(int id) {\n...\n}\n\npublic JsonResult GetJson(int? id) {\n...\n}\n\nI'm thinking its best practice to use a ModelBinder (SomeObjectFromIDModelBinder) on... |
As our PHP5 OO application grew (in both size and traffic), we decided to revisit the __autoload() strategy.
We always name the file by the class definition it contains, so class Customer would be contained within Customer.php. We used to list the directories in which a file can potentially exist, until the right .php ... | You have outlined some reasonable approaches for improving the autoloading mechanism in your PHP5 OO application. Here are a few additional solutions and considerations that you might find useful:
### 1. PSR-4 Autoloading
One of the most popular solutions for autoloading in PHP is to adhere to the PSR-4 standard, whic... | 44,419 | [
{
"from": "human",
"value": "As our PHP5 OO application grew (in both size and traffic), we decided to revisit the __autoload() strategy.\nWe always name the file by the class definition it contains, so class Customer would be contained within Customer.php. We used to list the directories in which a file ca... |
I have inherited a visual studio 2003 project which uses some custom build steps. I'm having some trouble with the path to the tool. Where does visual studio get its PATH? I've echoed out %PATH% in the custom build step and it has no resemblance to the system path. I did find a value in the registry
HKEY_LOCAL_MACH... | Visual Studio 2003, like other versions of Visual Studio, manages its own environment for build processes, which can include a specific set of paths that may differ from the system environment variables you see when you echo `%PATH%`. Here are a few ways to troubleshoot and adjust the environment for your custom build ... | 44,178 | [
{
"from": "human",
"value": "I have inherited a visual studio 2003 project which uses some custom build steps. I'm having some trouble with the path to the tool. Where does visual studio get its PATH? I've echoed out %PATH% in the custom build step and it has no resemblance to the system path. I did fin... |
I have two running processes in Windows, and each process has a pipe to the other.
I want to serialize a complicated class and transmit it from one process to the other. I already have the serialization procedure worked out, and I understand that the pipes are sending binary streams. How should I go about sending my se... | Sending serialized data between processes using pipes in Windows can be achieved with a straightforward approach. You have a couple of important considerations, including how to serialize and deserialize your data, how to manage communication effectively, and whether to develop a custom protocol.
### Key Consideration... | 44,908 | [
{
"from": "human",
"value": "I have two running processes in Windows, and each process has a pipe to the other.\nI want to serialize a complicated class and transmit it from one process to the other. I already have the serialization procedure worked out, and I understand that the pipes are sending binary st... |
I'm developing a new ASP .NET website which is effectively a subset of the pages in another site we've just released. Two or three of the pages will need minor tweaks but nothing significant.
The obvious answer is to simply copy all of the code and markup files into the new project, make the aforementioned tweaks, and ... | You're right to be cautious about duplicating code when developing a new ASP.NET site that shares functionality with an existing one. Here are some strategies you can consider to achieve a clean solution:
### 1. **Create a Shared Class Library**
- Move the common logic and data access code to a separate class libra... | 46,809 | [
{
"from": "human",
"value": "I'm developing a new ASP .NET website which is effectively a subset of the pages in another site we've just released. Two or three of the pages will need minor tweaks but nothing significant.\nThe obvious answer is to simply copy all of the code and markup files into the new pro... |
I'm trying to grab an image from a web site using simpleXML and am getting a PHP error saying that I'm trying to call to a member function xpath() on a non-object.
Below are the lines I'm trying to use to get the image's source tag:
$xpath = '/html/body/div/div/div[5]/div/div/div[2]/div/div[2]/img';
$html = ... | The error you're encountering indicates that `$xml` is not an object that can call the `xpath()` function. The problem arises because you're using `simplexml_import_dom()` which does not work with HTML documents that have a structure like a typical XML document.
Instead of using `simplexml_import_dom()`, you can work ... | 46,356 | [
{
"from": "human",
"value": "I'm trying to grab an image from a web site using simpleXML and am getting a PHP error saying that I'm trying to call to a member function xpath() on a non-object.\nBelow are the lines I'm trying to use to get the image's source tag: \n$xpath = '/html/body/div/div/div[5]/div/div... |
I would like to connect to a MySQL DB using SSH from Aptana Studio, does anyone know what the connection string should be?
| To connect to a MySQL database over SSH from Aptana Studio, you will typically need to set up an SSH tunnel manually and then connect to your database using the local endpoint created by the tunnel. Aptana Studio does not natively support SSH tunneling, so you'll have to use an external tool (like an SSH client) to est... | 49,669 | [
{
"from": "human",
"value": "I would like to connect to a MySQL DB using SSH from Aptana Studio, does anyone know what the connection string should be?\n"
},
{
"from": "gpt",
"value": "To connect to a MySQL database over SSH from Aptana Studio, you will typically need to set up an SSH tunnel man... |
In my SQL Server backend for my app, I want to create history tables for a bunch of my key tables, which will track a history of changes to the rows.
My entire application uses Stored Procedures, there is no embedded SQL.
The only connection to the database to modify these tables will be through the application and the... | When deciding between using Stored Procedures and Triggers for managing history tables in SQL Server, both approaches have their own pros and cons. Below, I'll outline the advantages and disadvantages of each method to help you make an informed choice.
### Stored Procedures
**Advantages:**
1. **Explicit Control**: Yo... | 46,975 | [
{
"from": "human",
"value": "In my SQL Server backend for my app, I want to create history tables for a bunch of my key tables, which will track a history of changes to the rows.\nMy entire application uses Stored Procedures, there is no embedded SQL.\nThe only connection to the database to modify these tab... |
What is the difference between the value and itemValue attribute of the radiobutton in Jsf?
| In JavaServer Faces (JSF), both the `value` and `itemValue` attributes of a radio button have specific roles, but they serve different purposes depending on the context.
### `value` Attribute
- The `value` attribute is used to bind the selected value of the radio button group to a backing bean property. When the form ... | 43,847 | [
{
"from": "human",
"value": "What is the difference between the value and itemValue attribute of the radiobutton in Jsf?\n"
},
{
"from": "gpt",
"value": "In JavaServer Faces (JSF), both the `value` and `itemValue` attributes of a radio button have specific roles, but they serve different purpose... |
I am having no problem converting a string to a byteArray of UTF-16 encoded characters, but the application I am trying to communicate with (written in Erlang) only understands Latin-1 encoding. Is there any way of producing a byteArray full of Latin-1 character codes from a string within Actionscript 3?
| In ActionScript 3, you can convert a string to a ByteArray of Latin-1 encoded characters by using the `ByteArray` class along with the `String` class. The Latin-1 encoding corresponds to ISO-8859-1, which is a single-byte encoding where each character corresponds to a byte value from 0 to 255.
Here's how you can achie... | 44,746 | [
{
"from": "human",
"value": "I am having no problem converting a string to a byteArray of UTF-16 encoded characters, but the application I am trying to communicate with (written in Erlang) only understands Latin-1 encoding. Is there any way of producing a byteArray full of Latin-1 character codes from a str... |
Need a function like:
function isGoogleURL(url) { ... }
that returns true iff URL belongs to Google. No false positives; no false negatives.
Luckily there's this as a reference:
.google.com .google.ad .google.ae .google.com.af .google.com.ag .google.com.ai .google.am .google.it.ao .google.com.ar .google.as .google.a... | To create a function that checks if a given URL belongs to one of the specified Google domains, you can follow these steps:
1. Store all the Google domains in a set for efficient lookup.
2. Parse the URL to get the hostname.
3. Check if the hostname ends with any of the Google domains.
Here's an implementation of the... | 39,393 | [
{
"from": "human",
"value": "Need a function like: \nfunction isGoogleURL(url) { ... }\n\nthat returns true iff URL belongs to Google. No false positives; no false negatives.\nLuckily there's this as a reference:\n\n.google.com .google.ad .google.ae .google.com.af .google.com.ag .google.com.ai .google.am .g... |
What number would you give someone who wants a concrete target number for API code coverage?
UPDATE: To clarify, statement/line code coverage. I realize concrete numbers don't make much sense, but this is for the situation where you tell people that concrete numbers don't make much sense and they still insist on gettin... | In the context of API or SDK code coverage, a commonly suggested target for statement or line coverage is **80%**. This percentage strikes a balance between maintaining high test quality while acknowledging that achieving 100% coverage can be impractical and may not significantly improve the reliability of the code.
... | 47,119 | [
{
"from": "human",
"value": "What number would you give someone who wants a concrete target number for API code coverage?\nUPDATE: To clarify, statement/line code coverage. I realize concrete numbers don't make much sense, but this is for the situation where you tell people that concrete numbers don't make ... |
Is there a idiomatic way of removing elements from PATH-like shell variables?
That is I want to take
PATH=/home/joe/bin:/usr/local/bin:/usr/bin:/bin:/path/to/app/bin:.
and remove or replace the /path/to/app/bin without clobbering the rest of the variable. Extra points for allowing me put new elements in arbitrary posi... | You can indeed manage `PATH` manipulation in a concise and idiomatic way in Bash (or other shells). Below, I'll provide a method to remove an entry based on a recognizable substring and then insert new paths at arbitrary positions.
### Removing a Substring from `PATH`
You can use parameter expansion in Bash to remov... | 45,756 | [
{
"from": "human",
"value": "Is there a idiomatic way of removing elements from PATH-like shell variables?\nThat is I want to take\nPATH=/home/joe/bin:/usr/local/bin:/usr/bin:/bin:/path/to/app/bin:.\n\nand remove or replace the /path/to/app/bin without clobbering the rest of the variable. Extra points for a... |
I have Application, and I can't modify it. This Application contain IEControl (WebBrowser control), which display some URLs and open some txt files. How can I get IWebBrowser2 and redirect this control to specified URL? For example, I need redirect this control to http://stackoverflow.com every time control trying to o... | To redirect the `WebBrowser` control (which is a wrapper around the `IWebBrowser2` interface) to a specified URL whenever it attempts to open a text file, you can use the `WebBrowser` control's events to intercept the navigation attempts. Specifically, you can handle the `BeforeNavigate2` event to redirect the navigati... | 47,211 | [
{
"from": "human",
"value": "I have Application, and I can't modify it. This Application contain IEControl (WebBrowser control), which display some URLs and open some txt files. How can I get IWebBrowser2 and redirect this control to specified URL? For example, I need redirect this control to http://stackov... |
I new to Scrum and while I understand the team concept behind the Sprints, I imagine there still needs to be a guardian for the team who minimizes the interference from Product Owners who are not conversant in software development. What are your successes, and what horror stories have you lived through?
Update:
I am l... | Welcome to the world of Scrum! It sounds like you're grappling with some very real challenges that many teams face when working with Product Owners (POs) who may not have a technical background. Balancing the needs of the business with the technical realities of software development can certainly be tricky.
### Succes... | 45,622 | [
{
"from": "human",
"value": "I new to Scrum and while I understand the team concept behind the Sprints, I imagine there still needs to be a guardian for the team who minimizes the interference from Product Owners who are not conversant in software development. What are your successes, and what horror stori... |
I'm doing some tests with nhibernate and I'm modifying batch_size to get bulk inserts.
I'm using mssql2005 and using the northwind db.
I created 1000 object and insert them to the database. I've changed the values of batch_size from 5 to 100 but found no change in the performance. I'm getting value of around 300ms. Usi... | It seems that you're experiencing an issue where NHibernate is not batching your inserts as expected. The `adonet.batch_size` setting should allow NHibernate to group multiple insert statements into a single batch, but there are a couple of factors that could influence this behavior. Below are several suggestions and b... | 41,766 | [
{
"from": "human",
"value": "I'm doing some tests with nhibernate and I'm modifying batch_size to get bulk inserts.\nI'm using mssql2005 and using the northwind db.\nI created 1000 object and insert them to the database. I've changed the values of batch_size from 5 to 100 but found no change in the performa... |
I'm new to RhinoMock's just been doing state unit testing up till now.
How do you test void functions?
Getting the following complie error when setting up expectation,
Expression does not produce a value
Basically I want to test that a certain mock's method is called a certain amount of times.
Cheers
| In Rhino Mocks, testing void methods requires you to set up expectations differently than you would for methods that return a value. Since void methods do not return a value, you need to use the `Expect.Call` method specifically for void functions and then set up your assertions using `Assert` methods after invoking th... | 44,424 | [
{
"from": "human",
"value": "I'm new to RhinoMock's just been doing state unit testing up till now.\nHow do you test void functions?\nGetting the following complie error when setting up expectation,\nExpression does not produce a value\nBasically I want to test that a certain mock's method is called a certa... |
How can I initialize a list containing generic objects whose types can be different?
For example, I have the following:
this.Wheres = new List<Where<>>();
As you know, <> is not valid syntax. However, sometimes the type passed to Where will be a string and sometimes it will be DateTime, etc. I tried using object as th... | To initialize a list containing generic objects of different types in C#, you can use a non-generic base class or an interface that can accommodate the various types you're working with.
In your case, since you are using a generic `Where<T>`, but `T` can vary (for example, `string`, `DateTime`, etc.), you can take ad... | 48,700 | [
{
"from": "human",
"value": "How can I initialize a list containing generic objects whose types can be different?\nFor example, I have the following:\nthis.Wheres = new List<Where<>>();\n\nAs you know, <> is not valid syntax. However, sometimes the type passed to Where will be a string and sometimes it will... |
Recently, my Eclipse 3.4 installation started complaining while trying to update installed software.
I normally have Automatic Updates switched on, so this is particularly annoying.
Updates are found, but I am unable to install them because eclipse is unable to satisfy version dependencies.
From the .log file:
!ENTRY o... | It sounds like you're experiencing dependency issues in your Eclipse 3.4 installation while trying to update installed software. This can often happen if the update sites or plugins you’re using have changed, or if there are conflicting versions of dependencies. Here are a few steps you can take to troubleshoot and res... | 45,762 | [
{
"from": "human",
"value": "Recently, my Eclipse 3.4 installation started complaining while trying to update installed software.\nI normally have Automatic Updates switched on, so this is particularly annoying.\nUpdates are found, but I am unable to install them because eclipse is unable to satisfy version... |
I've been reading and researching this for a couple of days
now, and decided I need some outside assistance!
(and this site seemed like a nice place, so I thought I'd
post my question here and see how it goes)
our little company hasn't built our applications on AIX
for several years, and I've been assigned this task (g... | You're dealing with a couple of issues related to dynamic vs. static linking on AIX, as well as compatibility between different versions of AIX. Let’s break down the problem and suggest steps you can take.
### 1. Dynamic vs. Static Linking
When you link an application dynamically (without `-static`), it relies on shar... | 45,050 | [
{
"from": "human",
"value": "I've been reading and researching this for a couple of days\nnow, and decided I need some outside assistance!\n(and this site seemed like a nice place, so I thought I'd\npost my question here and see how it goes)\nour little company hasn't built our applications on AIX\nfor seve... |
How do you identify the file content as being in ASCII or binary using C++?
| To identify whether a file's content is in ASCII or binary in C++, you can follow a few steps. The general idea is to read the file in binary mode and check the characters. ASCII files typically consist of printable characters (including control characters) and usually don't contain any null (0x00) bytes or extended AS... | 47,458 | [
{
"from": "human",
"value": "How do you identify the file content as being in ASCII or binary using C++?\n"
},
{
"from": "gpt",
"value": "To identify whether a file's content is in ASCII or binary in C++, you can follow a few steps. The general idea is to read the file in binary mode and check t... |
Is there a way to select all classes within a folder and assign a namespace to each of them in visual studio?
If there is no tool to do it, is there a regex pattern that will match everything before the class declatarion, but after the imports?
| As of my last knowledge update in October 2023, Visual Studio itself does not have a built-in tool specifically designed to bulk assign namespaces to all classes within a folder. However, you can achieve this using a combination of tools and techniques.
### Using a Script or Tool
One common approach to modify multipl... | 45,232 | [
{
"from": "human",
"value": "Is there a way to select all classes within a folder and assign a namespace to each of them in visual studio?\nIf there is no tool to do it, is there a regex pattern that will match everything before the class declatarion, but after the imports?\n"
},
{
"from": "gpt",
... |
I'm trying to get the label of some network resources mapped as drives. When I use DriveInfo.GetDrives(), local volumes have the VolumeLabel filled parameter as expected, but in network drives it is an empty string. How can I get those labels?
| When working with network drives in C#, the `DriveInfo.GetDrives()` method can indeed return empty `VolumeLabel` values for network drives due to how these drives are mapped and accessed.
To retrieve the volume labels of network drives, you can use the `ManagementObject` class from the `System.Management` namespace t... | 48,144 | [
{
"from": "human",
"value": "I'm trying to get the label of some network resources mapped as drives. When I use DriveInfo.GetDrives(), local volumes have the VolumeLabel filled parameter as expected, but in network drives it is an empty string. How can I get those labels?\n"
},
{
"from": "gpt",
... |
I'm using JPA (Hibernate's implementation) to annotate entity classes to persist to a relational database (MySQL or SQL Server). Is there an easy way to auto generate the database schema (table creation scripts) from the annotated classes?
I'm still in the prototyping phase and anticipate frequent schema changes. I wou... | Yes, Hibernate provides a way to automatically generate the database schema from your JPA entity classes through a feature known as "schema generation." You can control this behavior using Hibernate's configuration properties. This can be particularly useful during prototyping when you expect frequent changes to your d... | 42,037 | [
{
"from": "human",
"value": "I'm using JPA (Hibernate's implementation) to annotate entity classes to persist to a relational database (MySQL or SQL Server). Is there an easy way to auto generate the database schema (table creation scripts) from the annotated classes?\nI'm still in the prototyping phase and... |
Today one of my friends said:
if (typeof isoft == "undefined") var isoft = new Object();
is such kind of code is writted by a freshman and writes
if(!isoft) var isoft = new Object();
I originally consider there must be some difference. But I can't find the difference. Is
there any? Or are the two examples the same?... | The two code snippets you've provided do have some differences, and they can lead to different behavior depending on the context in which they are used. Let's examine each one:
1. **First snippet:**
```javascript
if (typeof isoft == "undefined") var isoft = new Object();
```
- This snippet checks if the v... | 42,601 | [
{
"from": "human",
"value": "Today one of my friends said: \nif (typeof isoft == \"undefined\") var isoft = new Object();\n\nis such kind of code is writted by a freshman and writes\nif(!isoft) var isoft = new Object();\n\nI originally consider there must be some difference. But I can't find the difference.... |
I have a rather legacy application EXE written in VB6 and running on a Windows 2000 server that uses RDS (Remote Data Services) to access a business object DLL (also written in VB6) running on a Windows 2003 server. The DLL has never run on this server (we're moving the component off the old W2K server), but it is reg... | Error 8209 in the context of RDS (Remote Data Services) typically points to an issue where the server cannot find the specified object or module. This can be due to several reasons, including but not limited to permissions, the registration of components, or even configuration settings of the RDS itself. Here are some ... | 43,267 | [
{
"from": "human",
"value": "I have a rather legacy application EXE written in VB6 and running on a Windows 2000 server that uses RDS (Remote Data Services) to access a business object DLL (also written in VB6) running on a Windows 2003 server. The DLL has never run on this server (we're moving the compone... |
I'm trying to run a 3d array but the code just crashes in windows when i run it, here's my code;
#include <iostream>
using namespace std;
int main(){
int myArray[10][10][10];
for (int i = 0; i <= 9; ++i){
for (int t = 0; t <=9; ++t){
for (int x = 0; x <= 9; ++t){
... | Your code has a small but critical error that is causing it to crash. Specifically, you have a typo in your inner loop where you are supposed to iterate over `x`, but you mistakenly used `++t` instead of `++x`.
Here's a breakdown of the issues and the corrected code:
1. **Loop Control Variable**: In your innermost l... | 45,264 | [
{
"from": "human",
"value": "I'm trying to run a 3d array but the code just crashes in windows when i run it, here's my code;\n#include <iostream>\n\nusing namespace std;\n\nint main(){\n\n int myArray[10][10][10];\n\n for (int i = 0; i <= 9; ++i){\n for (int t = 0; t <=9; ++t){ \n ... |
In MS SQL Server Management Studio 2005:
If you have the setting Tools|Options|Scripting|"Include IF NOT EXISTS clause" set to true, modifying a stored procedure will create a strange script that doesn't even work. It looks something like the following: (ellipsis used for brevity)
SET QUOTED_IDENTIFIER ON
GO
IF NO... | The issue you're encountering with SQL Server Management Studio (SSMS) 2005 is a known behavior when the "Include IF NOT EXISTS clause" option is set to true for scripting stored procedures. Unfortunately, the generated script for altering a stored procedure does not appropriately accommodate the conditional logic, as ... | 46,399 | [
{
"from": "human",
"value": "In MS SQL Server Management Studio 2005: \nIf you have the setting Tools|Options|Scripting|\"Include IF NOT EXISTS clause\" set to true, modifying a stored procedure will create a strange script that doesn't even work. It looks something like the following: (ellipsis used for br... |
I've just upgraded a native C++ project from VS2005-SP1 to VS2008-SP1
The first thing I tested was a very basic functionality test of the application and the first thing I noticed is that the main number-crunching algorithm performs three times slower in the VS2008 binary.
I tested again the VS2005 binary to make sure ... | Performance differences between different versions of Visual Studio can sometimes occur due to various factors related to compiler optimizations, changes in the standard library, and how the code is generated. Here are some suggestions and steps you can take to identify and potentially resolve the performance issue wit... | 46,960 | [
{
"from": "human",
"value": "I've just upgraded a native C++ project from VS2005-SP1 to VS2008-SP1\nThe first thing I tested was a very basic functionality test of the application and the first thing I noticed is that the main number-crunching algorithm performs three times slower in the VS2008 binary.\nI t... |
I am using UIImagePicker to take photo and save the photo. But appears the photo it takes was truncated on top and bottom, which was top and bottom menu when UIImagePicker taking the photo. I am wondering how to take the whole screen of the photo.
Thanks.
| When using `UIImagePickerController` in iOS to capture photos, it's important to note that the interface includes a toolbar and navigation bar, which can lead to the captured image appearing cropped. To ensure that you capture the full image without any UI elements appearing in the final photo, you need to follow a few... | 43,024 | [
{
"from": "human",
"value": "I am using UIImagePicker to take photo and save the photo. But appears the photo it takes was truncated on top and bottom, which was top and bottom menu when UIImagePicker taking the photo. I am wondering how to take the whole screen of the photo.\nThanks.\n"
},
{
"from"... |
Let's say I have the following code:
IBOutlet UITextField* nameTextField;
IBOutlet UILabel* greetingLabel;
I'd like the greetingLabel to read "Hello [nameTextField]" as soon as the user presses any key.
What I need basically is the iPhone equivalent of the Cocoa delegate method controlTextDidChange.
The textField:shou... | You're right in noting that the `textField:shouldChangeCharactersInRange:replacementString:` delegate method is called before the text field's value is updated. Therefore, the `textField`'s text doesn't reflect the changes immediately when this delegate method is invoked.
To achieve the desired behavior where the `gr... | 49,071 | [
{
"from": "human",
"value": "Let's say I have the following code:\nIBOutlet UITextField* nameTextField;\nIBOutlet UILabel* greetingLabel;\n\nI'd like the greetingLabel to read \"Hello [nameTextField]\" as soon as the user presses any key.\nWhat I need basically is the iPhone equivalent of the Cocoa delegate... |
How do I remove html elements in a text field from SQL Server?
| To remove HTML elements from a text field in SQL Server, you can use a combination of string manipulation functions. However, it's important to note that SQL Server doesn't have built-in functions specifically designed for parsing HTML, so you'll have to rely on string functions to achieve this.
Here are a few methods... | 47,148 | [
{
"from": "human",
"value": "How do I remove html elements in a text field from SQL Server?\n"
},
{
"from": "gpt",
"value": "To remove HTML elements from a text field in SQL Server, you can use a combination of string manipulation functions. However, it's important to note that SQL Server doesn'... |
Let's say I'm developing a new desktop application for Windows. Is there a list somewhere that I can consult (either from Microsoft or a 3rd party) of keyboard shortcuts that all Windows applications should support?
(Note: When I say "all Windows applications" here, I really mean "all Windows applications where a part... | Yes, there are several resources and guidelines available to help developers establish common keyboard shortcuts and mouse behaviors for Windows applications. While there isn't a single comprehensive official list from Microsoft that covers every possible shortcut across all applications, there are several references a... | 42,373 | [
{
"from": "human",
"value": "Let's say I'm developing a new desktop application for Windows. Is there a list somewhere that I can consult (either from Microsoft or a 3rd party) of keyboard shortcuts that all Windows applications should support?\n(Note: When I say \"all Windows applications\" here, I really... |
I am primarily a fluent .NET developer (as can be seen from the amount of posts and threads I make about .NET), but I thought it would be good to learn RoR.
In doing so, I have a few questions about the architecture of the language (Ruby) and the framework (RoR):
1) In .NET, every object is derived from System but inhe... | Welcome to Ruby on Rails (RoR)! It's great that you're expanding your skill set. Let's address your questions:
### 1) Object Hierarchy in Ruby
Ruby does indeed have an object hierarchy, but it's a bit different from .NET. In Ruby, every object is derived from the `Object` class, which in turn is derived from the `Bas... | 48,628 | [
{
"from": "human",
"value": "I am primarily a fluent .NET developer (as can be seen from the amount of posts and threads I make about .NET), but I thought it would be good to learn RoR.\nIn doing so, I have a few questions about the architecture of the language (Ruby) and the framework (RoR):\n1) In .NET, e... |
I'm relatively new to .NET programming (and OOP in general) and I want to make sure I'm not developing bad beginner habits when designing my applications.
If you were hiring a new .NET developer and had to get him up to speed relatively quickly, but also wanted to make sure he adopts best practices (e.g., single respon... | It's great that you're already thinking about best practices and want to avoid bad habits as a beginner in .NET programming and OOP. Here’s a structured learning path that covers fundamental concepts, best practices, and practical experience to help you get up to speed effectively.
### Recommended Learning Path
#### ... | 44,248 | [
{
"from": "human",
"value": "I'm relatively new to .NET programming (and OOP in general) and I want to make sure I'm not developing bad beginner habits when designing my applications.\nIf you were hiring a new .NET developer and had to get him up to speed relatively quickly, but also wanted to make sure he ... |
Is there a way to create a Zip archive that contains multiple files, when the files are currently in memory? The files I want to save are really just text only and are stored in a string class in my application. But I would like to save multiple files in a single self-contained archive. They can all be in the root o... | Yes, you can create a Zip archive that contains multiple files stored in memory using the SharpZipLib library. This library allows you to easily create and manipulate zip files programmatically. Below is an example of how to do this in C#.
First, make sure you have the SharpZipLib package installed. You can install it... | 46,948 | [
{
"from": "human",
"value": "Is there a way to create a Zip archive that contains multiple files, when the files are currently in memory? The files I want to save are really just text only and are stored in a string class in my application. But I would like to save multiple files in a single self-containe... |
How do you set a break points in server tags in .aspx pages. e.g.
<% dim breakhere =new object() %>
The web application is running in debug mode with the <compilation debug="true" ... in the web.config. But the page says:
The break point will not currently be
hit. No symbols have been loaded for
this document.
... | When working with ASP.NET Web Forms (.aspx) pages, setting breakpoints in server-side code can sometimes present challenges. If you're encountering the error message "The breakpoint will not currently be hit. No symbols have been loaded for this document," there are several steps you can take to troubleshoot and ensure... | 43,835 | [
{
"from": "human",
"value": "How do you set a break points in server tags in .aspx pages. e.g.\n<% dim breakhere =new object() %>\n\nThe web application is running in debug mode with the <compilation debug=\"true\" ... in the web.config. But the page says:\n\nThe break point will not currently be\n hit. ... |
Can anyone help me to convert a C# .NET program to PowerShell cmdlet? I am very new to this area. Please help me to get out of this checkpoint!
Regards,
Arun
| Hi Arun,
Converting a C# .NET program to a PowerShell cmdlet involves understanding both the C# code and how to structure a PowerShell cmdlet. Below, I'll provide you with a general guide on how to approach this conversion. If you can share specific C# code, I can help tailor the PowerShell cmdlet more precisely.
###... | 46,831 | [
{
"from": "human",
"value": "Can anyone help me to convert a C# .NET program to PowerShell cmdlet? I am very new to this area. Please help me to get out of this checkpoint!\nRegards,\nArun\n"
},
{
"from": "gpt",
"value": "Hi Arun,\n\nConverting a C# .NET program to a PowerShell cmdlet involves u... |
I have a friend who is finishing up his masters degree in aerospace engineering. For his final project, he is on a small team tasked with writing a program for tracking weather balloons, rockets and satellites. The program receives input from a GPS device, does calculations with the data, and uses the results of those ... | Sure! It sounds like you're on the right track using Python for your friend's project. To extract the required information from the GPS data, we can use Python's built-in `re` module, which allows us to work with regular expressions.
Based on the example inputs you provided, it seems like you're looking to extract the... | 44,333 | [
{
"from": "human",
"value": "I have a friend who is finishing up his masters degree in aerospace engineering. For his final project, he is on a small team tasked with writing a program for tracking weather balloons, rockets and satellites. The program receives input from a GPS device, does calculations with... |
I have a database with two main tables notes and labels. They have a many-to-many relationship (similar to how stackoverflow.com has questions with labels). What I am wondering is how can I search for a note using multiple labels using SQL?
For example if I have a note "test" with three labels "one", "two", and "th... | To search for notes associated with multiple labels in a many-to-many relationship, you typically use a junction table that connects the `notes` and `labels` tables. Assuming you have the following structure:
1. `notes` table:
- `note_id`
- `note_content`
2. `labels` table:
- `label_id`
- `label_name`
... | 47,014 | [
{
"from": "human",
"value": "I have a database with two main tables notes and labels. They have a many-to-many relationship (similar to how stackoverflow.com has questions with labels). What I am wondering is how can I search for a note using multiple labels using SQL? \nFor example if I have a note \"te... |
How can I determine if I'm in the final loop of a For Each statement in VB.NET?
| In VB.NET, you can determine if you are in the final iteration of a `For Each` loop by keeping track of the current index of the item being processed. However, since the `For Each` loop does not natively expose an index, you'll need to implement a workaround.
One common approach is to convert the collection you are it... | 47,422 | [
{
"from": "human",
"value": "How can I determine if I'm in the final loop of a For Each statement in VB.NET?\n"
},
{
"from": "gpt",
"value": "In VB.NET, you can determine if you are in the final iteration of a `For Each` loop by keeping track of the current index of the item being processed. How... |
Does anyone know the query the last synchronization date from sql server (2008).
It is the same information displayed in replication monitor, but I want to be able to get that date from a query.
| You can obtain the last synchronization date for SQL Server replication using a SQL query against the system tables. The following query can help you retrieve the last synchronization date for a transactional replication publication:
```sql
USE [YourPublicationDB]; -- Replace with your publication database name
SELEC... | 48,266 | [
{
"from": "human",
"value": "Does anyone know the query the last synchronization date from sql server (2008).\nIt is the same information displayed in replication monitor, but I want to be able to get that date from a query.\n"
},
{
"from": "gpt",
"value": "You can obtain the last synchronizatio... |
Could somebody tell me wich new dynamic tools analysis for C-code are there like valdgrind?
| As of my last update in October 2023, there are several dynamic analysis tools for C code, in addition to Valgrind. Here’s a list of some notable ones:
1. **AddressSanitizer (ASan)**: A fast memory error detector that helps identify various memory-related issues, such as buffer overflows and use-after-free errors. It'... | 45,091 | [
{
"from": "human",
"value": "Could somebody tell me wich new dynamic tools analysis for C-code are there like valdgrind?\n"
},
{
"from": "gpt",
"value": "As of my last update in October 2023, there are several dynamic analysis tools for C code, in addition to Valgrind. Here’s a list of some nota... |
I have markup like this:
<p>one two three four</p>
And I want to use javascript to convert it to this:
<p>one <span>two three<span> four</p>
I have the offset and length of the section I want to wrap in a span, in this case offset = 4 and length = 9. If using jQuery can make it easier, that is preferable.
| You can achieve this using jQuery by first selecting the `<p>` element, then splitting the text content based on the specified offset and length, and finally wrapping the desired portion in a `<span>`. Here’s how you can do it:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="... | 48,022 | [
{
"from": "human",
"value": "I have markup like this:\n<p>one two three four</p>\n\nAnd I want to use javascript to convert it to this:\n<p>one <span>two three<span> four</p>\n\nI have the offset and length of the section I want to wrap in a span, in this case offset = 4 and length = 9. If using jQuery can ... |
I have a WCF RESTFul service declared thus:
[ServiceContract]
public interface IGasPriceService
{
[OperationContract]
[WebGet
(ResponseFormat = WebMessageFormat.Xml,
BodyStyle = WebMessageBodyStyle.Bare,
UriTemplate = "/GetGasPrice/For/ZipCode/{zipCode}"
)]
GasPriceData GetPr... | The issues you are facing with your WCF RESTful service have to do with the way HTTP methods and the URI template are being handled. Here are some steps to help you resolve the problems you are experiencing.
### 1. **Check HTTP Method**:
Since you have defined `SetPriceDataForZipCode` with the `WebInvoke` attribute an... | 48,083 | [
{
"from": "human",
"value": "I have a WCF RESTFul service declared thus:\n[ServiceContract]\npublic interface IGasPriceService\n{\n [OperationContract]\n [WebGet\n (ResponseFormat = WebMessageFormat.Xml,\n BodyStyle = WebMessageBodyStyle.Bare,\n UriTemplate = \"/GetGasPrice/For/Zi... |
I'm having a hard time with the setup statement in Python's timeit.Timer(stmt, setup_stmt). I appreciate any help to get me out of this tricky problem:
So my sniplet looks like this:
def compare(string1, string2):
# compare 2 strings
if __name__ = '__main__':
str1 = "This string has \n several new lines \n in ... | The issue you're encountering arises because the strings `str1` and `str2` contain characters that are special in Python string literals, such as the newline character (`\n`) and the single quote (`'`). When you try to format them into the `setup` statement, they can cause syntax errors if not properly escaped.
To cor... | 48,799 | [
{
"from": "human",
"value": "I'm having a hard time with the setup statement in Python's timeit.Timer(stmt, setup_stmt). I appreciate any help to get me out of this tricky problem:\nSo my sniplet looks like this:\ndef compare(string1, string2):\n # compare 2 strings\n\nif __name__ = '__main__':\n str1... |
I'm trying to show in the screen a table...
Basically I create a custom UITableViewController with the methods needed for the UITableView delegate and data source which is self since UITableViewController does it for you.
When I put it in the -initWithRootView: controller, and add the nav's bar view to the window it do... | It sounds like you're trying to create a `UITableViewController` and present it using a navigation controller, but the delegate and data source methods aren't being called. Here are a few common issues and things to check to help you debug the situation:
1. **Setting Up the Navigation Controller**: Ensure that your `U... | 45,566 | [
{
"from": "human",
"value": "I'm trying to show in the screen a table...\nBasically I create a custom UITableViewController with the methods needed for the UITableView delegate and data source which is self since UITableViewController does it for you.\nWhen I put it in the -initWithRootView: controller, and... |
I want to get virtual path of a web page from a web service. Is there any way to do this?.
suppose i have an aspx page like aa, i want to get full path as a url for that page from my web service.
Regards,
Harsh Suman
| To get the virtual path (URL) of a specific ASPX page from a web service in an ASP.NET application, you can use the following methods:
### Method 1: Use `HttpContext`
If your web service is part of the same application and you want to construct the URL of a specific page, you can use the `HttpContext` to build the UR... | 47,378 | [
{
"from": "human",
"value": "I want to get virtual path of a web page from a web service. Is there any way to do this?.\nsuppose i have an aspx page like aa, i want to get full path as a url for that page from my web service.\nRegards,\nHarsh Suman\n"
},
{
"from": "gpt",
"value": "To get the vir... |
I have a ASP.NET 3.5 App and trying to update a Update Panel which has a nested custom control. In that custom control is a ComponentArt Gird, which gets filled by almost 13MB of Data (Yes, I could chunck that...) at this Update.
I have a hidden button wihtin the update Panel, which I trigger by JS from client side, wh... | Handling large amounts of data in an ASP.NET Web Forms application, especially with UpdatePanels and asynchronous postbacks, can be challenging. Here are several suggestions and approaches you can consider to address the issue with the `JsonSerializer` when dealing with large datasets:
1. **Increase the Max Request Le... | 43,187 | [
{
"from": "human",
"value": "I have a ASP.NET 3.5 App and trying to update a Update Panel which has a nested custom control. In that custom control is a ComponentArt Gird, which gets filled by almost 13MB of Data (Yes, I could chunck that...) at this Update.\nI have a hidden button wihtin the update Panel, ... |
I'm trying to use a generic list as a property of the users profile. I'll admit this is probably just making my life harder than it needs to be but I don't want to change the programming model just because the data store struggles.
I have this in my web.config
</providers>
<properties>
...... | Using generic types in a web.config file can be tricky, especially when it comes to types that are not built-in like `List<int>` and `List<MyNamespace.Web.UI.MyReallySimpleClass>`. Here are answers to your questions:
### 1. Documentation for Declaring Types in web.config
Unfortunately, there isn't comprehensive docum... | 45,555 | [
{
"from": "human",
"value": "I'm trying to use a generic list as a property of the users profile. I'll admit this is probably just making my life harder than it needs to be but I don't want to change the programming model just because the data store struggles.\nI have this in my web.config\n\n\n </pr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.