instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I'm building small web shop with asp.net mvc and Structuremap ioc/di. My Basket class uses session object for persistence, and I want use SM to create my basket object through IBasket interface. My basket implementation need HttpSessionStateBase (session state wrapper from mvc) in constructor, which is available inside... | To provide `HttpSessionStateBase` (the session state wrapper from MVC) to your `StoreBasketService` implementation while using StructureMap, you can make use of StructureMap's context and request-based lifecycle management to supply the correct dependencies when they are needed.
Here are the steps you can follow to ac... | 38,813 | [
{
"from": "human",
"value": "I'm building small web shop with asp.net mvc and Structuremap ioc/di. My Basket class uses session object for persistence, and I want use SM to create my basket object through IBasket interface. My basket implementation need HttpSessionStateBase (session state wrapper from mvc) ... |
Greetings.
I have been looking at Literate Programming a bit now, and I do like the idea behind it: you basically write a little paper about your code and write down as much of the design decisions, the code probably surrounding the module, the inner workins of the module, assumptions and conclusions resulting from the... | Greetings, Tetha!
You've touched on several important points regarding Literate Programming (LP) and its potential challenges when scaling to larger systems. Let's delve into your concerns and your proposed solution.
### Challenges of Literate Programming in Larger Systems
1. **Complexity Management**: As systems gr... | 38,403 | [
{
"from": "human",
"value": "Greetings.\nI have been looking at Literate Programming a bit now, and I do like the idea behind it: you basically write a little paper about your code and write down as much of the design decisions, the code probably surrounding the module, the inner workins of the module, assu... |
I am writing a Firefox extension. I would like to search the current webpage for a set of words, and count how many times each occurs. This activity is only performed when the user asks, but it must still happen reasonably quickly.
I am currently using indexOf on the BODY tag's innerHTML element, but am finding it too ... | Great to see that you're developing a Firefox extension! When searching for multiple keywords in the text of a webpage, it's important to implement a solution that balances speed and efficiency. Below, I'll provide an approach that should improve performance and maintain a good user experience. Given that you've alread... | 42,079 | [
{
"from": "human",
"value": "I am writing a Firefox extension. I would like to search the current webpage for a set of words, and count how many times each occurs. This activity is only performed when the user asks, but it must still happen reasonably quickly.\nI am currently using indexOf on the BODY tag's... |
is there a managed code (without adding COM component or wrapped called to C++ routines) way to add integrated security to a C# Managed code assembly?
i.e. I want to write a client-server system where the server uses Remoting instead of IIS, but I want the client to automatically pass it's credentials to the server j... | Yes, you can achieve integrated security for a client-server system in C# using .NET Remoting without needing to add COM components or call C++ routines. Although .NET Remoting is largely considered a legacy technology in favor of more modern approaches like WCF or gRPC, you can still implement the functionality you de... | 42,425 | [
{
"from": "human",
"value": "is there a managed code (without adding COM component or wrapped called to C++ routines) way to add integrated security to a C# Managed code assembly? \ni.e. I want to write a client-server system where the server uses Remoting instead of IIS, but I want the client to automatic... |
Screenshot of the problem:
The yellow block is the logo and the blue box is the nav links (I have blanked them out). I would like to align the links at the bottom so they are stuck to the top of the body content (white box). How would I do this?
Here is the relevant CSS and HTML.
#header {
height: 42px;
}
#logo {
... | To align the navigation links at the bottom of the header so that they stick to the top of the body content (white box), you can utilize CSS Flexbox. Here’s how you can modify your CSS to achieve this:
1. Set the `#header` to use Flexbox.
2. Align items to the baseline or center vertically.
3. Adjust margins and paddi... | 45,073 | [
{
"from": "human",
"value": "Screenshot of the problem:\n\nThe yellow block is the logo and the blue box is the nav links (I have blanked them out). I would like to align the links at the bottom so they are stuck to the top of the body content (white box). How would I do this?\nHere is the relevant CSS and ... |
Can i (for example) use mod_proxy of version 2.2.10 with an otherwise unchanged 2.2.8 apache distribution under windows?
| In general, it is not recommended to mix and match different versions of Apache modules (like `mod_proxy`) with different versions of the Apache HTTP Server itself. Each module is compiled against a specific version of the Apache API, and using a module compiled for a newer version (like 2.2.10) with an older server (l... | 46,236 | [
{
"from": "human",
"value": "Can i (for example) use mod_proxy of version 2.2.10 with an otherwise unchanged 2.2.8 apache distribution under windows?\n"
},
{
"from": "gpt",
"value": "In general, it is not recommended to mix and match different versions of Apache modules (like `mod_proxy`) with d... |
I'm looking for an efficient way of searching through a dataset to see if an item exists. I have an arraylist of ~6000 items and I need to determine which of those doesn't exist in the dataset by comparing each item within the arraylist with data in a particular column of the dataset.
I attempted to loop through each ... | To optimize your search for items in an `ArrayList` against a dataset, instead of using nested loops or filters on a `DataView`, you can employ a more efficient approach by utilizing data structures that provide quicker lookups. One common method is to use a `HashSet`, which allows for O(1) average time complexity for ... | 41,235 | [
{
"from": "human",
"value": "I'm looking for an efficient way of searching through a dataset to see if an item exists. I have an arraylist of ~6000 items and I need to determine which of those doesn't exist in the dataset by comparing each item within the arraylist with data in a particular column of the d... |
I've been trying to trace down why I have 100% iowait on my box. If I do something like a mysql select query, system goes to 100% iowait (on more than one cpu on my server,) which kills my watchdogs and sometimes kills httpd itself.
In vmstat I see that every 8 seconds or so, there's a 5MB disk write. And that causes ... | It sounds like you're experiencing high I/O wait times on your server due to the large number of files in your ext3 filesystem. Here are some steps and suggestions to help you diagnose and potentially resolve the issue:
### Diagnosing the Issue
1. **Identify Disk Activity**:
- Use `iostat` to see detailed disk I/O... | 41,634 | [
{
"from": "human",
"value": "I've been trying to trace down why I have 100% iowait on my box. If I do something like a mysql select query, system goes to 100% iowait (on more than one cpu on my server,) which kills my watchdogs and sometimes kills httpd itself. \nIn vmstat I see that every 8 seconds or so, ... |
In jQuery, if I assign class=auto_submit_form to a form, it will be submitted whenever any element is changed, with the following code:
/* automatically submit if any element in the form changes */
$(function() {
$(".auto_submit_form").change(function() {
this.submit();
});
});
However, if I want to the form t... | Your current approach to submit the form when elements with the class `auto_submit_item` are changed is almost correct, but there are some improvements you could make for clarity and performance.
1. **Use `.closest()`**: Instead of using `.parents().filter("form")`, you can use `.closest("form")`. This is more efficie... | 45,059 | [
{
"from": "human",
"value": "In jQuery, if I assign class=auto_submit_form to a form, it will be submitted whenever any element is changed, with the following code:\n/* automatically submit if any element in the form changes */\n$(function() {\n $(\".auto_submit_form\").change(function() {\n this.submit... |
I've seen a related question on this website regarding a Linux system. I have the same question on a Windows XP OS. I bought a Winchester USB external HD, and found out from technical support that the sleep feature is in the firmware and cannot be turned off. I'm looking for an application that will automatically re... | To prevent your external hard drive from going to sleep on Windows XP, you can use a simple utility that periodically accesses the drive. Here are a couple of options:
### Option 1: Using a Script
You can create a simple batch script that runs periodically to read or write to the external hard drive. Here’s how to do... | 43,926 | [
{
"from": "human",
"value": "I've seen a related question on this website regarding a Linux system. I have the same question on a Windows XP OS. I bought a Winchester USB external HD, and found out from technical support that the sleep feature is in the firmware and cannot be turned off. I'm looking for ... |
I am working on some sort of CRM application which has huge sales data with all the customer leads etc (ASP.NET 2.0/Ajax)
I want to create a dashboard which will have four separate data containers each container will have different sort of data and each container has to update it self after some configured time interv... | In your scenario, you have two main options for creating a dashboard with four separate data containers that refresh independently after a configured time interval. Let's explore the two options you mentioned: ASP.NET UpdatePanel and jQuery AJAX, including their performance considerations and use cases.
### Option 1: ... | 43,009 | [
{
"from": "human",
"value": "I am working on some sort of CRM application which has huge sales data with all the customer leads etc (ASP.NET 2.0/Ajax)\nI want to create a dashboard which will have four separate data containers each container will have different sort of data and each container has to update ... |
I looked around and found some ideas about how to do this, but no definitive best way. One of the ideas was to use sp_start_job to kick off an SQL Server Agent job that runs the DTS package. If this is the best way to do it, then the next question would be, "How do I schedule a DTS package from a job and make it non-... | To run a SQL Server DTS (Data Transformation Services) package using SQL Server Agent, you can indeed use the `sp_start_job` stored procedure to kick off a job that runs the DTS package. This method is common and can be quite effective. Here’s a step-by-step guide on how to accomplish this, including scheduling the job... | 37,811 | [
{
"from": "human",
"value": "I looked around and found some ideas about how to do this, but no definitive best way. One of the ideas was to use sp_start_job to kick off an SQL Server Agent job that runs the DTS package. If this is the best way to do it, then the next question would be, \"How do I schedule... |
I have a need to evaluate user-defined logical expressions of arbitrary complexity on some PHP pages. Assuming that form fields are the primary variables, it would need to:
substitute"varibles" for form
fields values;
handle comparison operators,
minimally ==, <, <=, >= and > by
symbol, name (eg eq, lt, le, ge, gt
re... | When it comes to evaluating user-defined logical expressions in PHP, there are a few libraries and approaches you might consider. Given the requirements you've outlined, here are some suggestions:
### 1. **Using a Library for Expression Parsing**
#### a. **PHP-Parser or similar libraries**
- **PHP-Parser**: This is a... | 42,358 | [
{
"from": "human",
"value": "I have a need to evaluate user-defined logical expressions of arbitrary complexity on some PHP pages. Assuming that form fields are the primary variables, it would need to:\n\nsubstitute\"varibles\" for form\nfields values;\nhandle comparison operators,\nminimally ==, <, <=, >=... |
I am using oracle wallet to store the oracle database passwords,
the batch file to create the wallet asks for password when you run it.
is there any way to modify the batch file , and provide the password before hand
so that i can avoid inputtting the password every time i run that.
so to generalize the problem, is th... | To automate interactions with command-line programs that require password input, you have a few potential approaches. However, be cautious with handling passwords, as exposing them can lead to security vulnerabilities. Here are some methods you could consider for your specific case with Oracle Wallet:
### 1. Use a Pas... | 42,883 | [
{
"from": "human",
"value": "I am using oracle wallet to store the oracle database passwords,\nthe batch file to create the wallet asks for password when you run it.\nis there any way to modify the batch file , and provide the password before hand \nso that i can avoid inputtting the password every time i r... |
How do I get the div from within this (the last) list item?
Currently I have this, which is just plain ugly...any suggestions on a cleaner selector/ solution?
var div = ul.append("<li><div></div></li>").contents("li:last-child")[0].children[0];
Thanks!
| To obtain the `<div>` from the last list item in a more elegant way, you can utilize jQuery's chaining and more specific selectors. Here’s a cleaner approach:
```javascript
var div = ul.find("li:last-child > div");
```
### Explanation:
- `ul.find("li:last-child > div")` selects the `<div>` directly from the last `<li... | 45,870 | [
{
"from": "human",
"value": "How do I get the div from within this (the last) list item?\nCurrently I have this, which is just plain ugly...any suggestions on a cleaner selector/ solution?\nvar div = ul.append(\"<li><div></div></li>\").contents(\"li:last-child\")[0].children[0];\n\nThanks!\n"
},
{
"... |
The code I have pasted below is meant to display images on the middle 2 links without text and go back to text on the reset and fourth link. I have set display:none for the span tag only, but it does nothing. Is there anyway to do what I am after simply, without using a framework?
edit: example
<html>
<head>
... | Your current approach with the CSS is almost correct, but there are a couple of improvements you can make to ensure that the spans are not displayed in the middle two classes while maintaining the text in the first and last class.
Here’s a simple solution to achieve your requirements. I made the following changes:
1.... | 42,429 | [
{
"from": "human",
"value": "The code I have pasted below is meant to display images on the middle 2 links without text and go back to text on the reset and fourth link. I have set display:none for the span tag only, but it does nothing. Is there anyway to do what I am after simply, without using a framewor... |
There is even a standard for IP in IP encapsulation. What is the use case here? I can understand stuff like TCP over DNS, where IP might be unavailable, but if you can do IP in IP, couldn't you simply do regular IP?
| IP-in-IP encapsulation is a technique that allows you to encapsulate one IP packet within another IP packet. This method is defined in RFC 2003 and has several use cases, despite the apparent redundancy of using IP over IP. Here are some common scenarios where IP-in-IP encapsulation can be beneficial:
1. **Tunneling**... | 44,739 | [
{
"from": "human",
"value": "There is even a standard for IP in IP encapsulation. What is the use case here? I can understand stuff like TCP over DNS, where IP might be unavailable, but if you can do IP in IP, couldn't you simply do regular IP?\n"
},
{
"from": "gpt",
"value": "IP-in-IP encapsula... |
Are these two terms interchangeable?
| Could you please specify the two terms you are referring to? That way, I can provide a more accurate answer regarding their interchangeability. | 49,821 | [
{
"from": "human",
"value": "Are these two terms interchangeable?\n"
},
{
"from": "gpt",
"value": "Could you please specify the two terms you are referring to? That way, I can provide a more accurate answer regarding their interchangeability."
}
] |
Could someone simply explain the 3 phases in the Flash Event framework, please?
By event phases, I mean:
CAPTURING_PHASE
AT_TARGET
BUBBLING_PHASE
To be clear, I'm talking about flash.events.Event and subclasses.
An in-depth example would be fantastic. What happens when you click on a nested MovieClip?
| Sure! In ActionScript (the programming language for Flash), events are processed in three distinct phases: **CAPTURING_PHASE**, **AT_TARGET**, and **BUBBLING_PHASE**. Understanding these phases is crucial for event handling, especially when dealing with nested display objects like MovieClips. Let's break it down with a... | 42,745 | [
{
"from": "human",
"value": "Could someone simply explain the 3 phases in the Flash Event framework, please? \nBy event phases, I mean:\n\nCAPTURING_PHASE\nAT_TARGET\nBUBBLING_PHASE\n\nTo be clear, I'm talking about flash.events.Event and subclasses.\nAn in-depth example would be fantastic. What happens whe... |
I am looking at the performance suggestions lots of pages have about asp.net. Specifically the remove unused httpmodules part:
<httpModules>
<add name="OutputCache" type="System.Web.Caching.OutputCacheModule"/>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
<add name="WindowsAuthentic... | Certainly! Below is a brief description of each of the HTTP modules listed in your configuration, along with their purpose. This should help you identify which modules might be unused in your application.
1. **OutputCache**:
- Caches the output of pages and controls to improve response times and reduce server load... | 42,933 | [
{
"from": "human",
"value": "I am looking at the performance suggestions lots of pages have about asp.net. Specifically the remove unused httpmodules part:\n <httpModules>\n <add name=\"OutputCache\" type=\"System.Web.Caching.OutputCacheModule\"/>\n <add name=\"Session\" type=\"System.Web.SessionState.... |
I am currently researching an exception handling architecture for our App.
We will be using UpdatePanels extensively and we will also be calling Webservices.
I want to know if there is any real need to implement a ScriptManager.OnAsyncPostBackError handler compared to, the Page_Error event which seems to catch all exc... | In ASP.NET applications that use UpdatePanels and asynchronous postbacks, handling exceptions can become a bit nuanced. Let's break down the differences between using `ScriptManager.OnAsyncPostBackError` and the `Page_Error` event.
### Page_Error Event
The `Page_Error` event is a global error handling mechanism for th... | 39,529 | [
{
"from": "human",
"value": "I am currently researching an exception handling architecture for our App. \nWe will be using UpdatePanels extensively and we will also be calling Webservices.\nI want to know if there is any real need to implement a ScriptManager.OnAsyncPostBackError handler compared to, the Pa... |
I know it's probably not the right way to structure a database but does the database perform faster if the data is put in one huge table instead of breaking it up logically in other tables?
I want to design and create the database properly using keys to create relational integrity across tables but when quering, is JOI... | When designing a database, it's important to find a balance between normalization (breaking data into related tables) and performance (how quickly data can be accessed and manipulated). Here are several considerations regarding your question about using one large table versus multiple related tables:
### Benefits of N... | 42,754 | [
{
"from": "human",
"value": "I know it's probably not the right way to structure a database but does the database perform faster if the data is put in one huge table instead of breaking it up logically in other tables?\nI want to design and create the database properly using keys to create relational integr... |
SELECT pe.prodtree_element_id prodID, pe.prodtree_element_name_s, li.line_name, av2.value
FROM prodtree_element pe
LEFT JOIN prodtree_link pl
ON pe.prodtree_element_id = pl.to_prodtree_node_id
LEFT JOIN line li
ON pe.line_code = li.line_code
INNER JOIN attribute_values av
ON av.a... | Optimizing SQL queries, especially with large datasets, can involve multiple strategies. Here are several suggestions that you can apply to your query to improve performance:
### 1. **Indexing**
- Ensure that appropriate indexes are applied to the columns involved in `JOIN` operations and `WHERE` clauses.
- Con... | 42,778 | [
{
"from": "human",
"value": "SELECT pe.prodtree_element_id prodID, pe.prodtree_element_name_s, li.line_name, av2.value\n FROM prodtree_element pe\n LEFT JOIN prodtree_link pl\n ON pe.prodtree_element_id = pl.to_prodtree_node_id\n LEFT JOIN line li\n ON pe.line_code = li.line_code\n ... |
I am trying to write Reversi game in Python. Can anyone give me some basic ideas and strategy which are simple, good and easy to use?
I would appreciate for any help because I've gone to a little far but is stucked between codes and it became more complex too. I think I overdid in some part that should be fairly simple... | Writing a Reversi (also known as Othello) game in Python can be a fun project! To help you simplify your code and improve your implementation, here are some basic ideas, strategies, and a simple structure you can follow:
### 1. Basic Structure
Start with a clear structure for your code. You can break it down into seve... | 39,225 | [
{
"from": "human",
"value": "I am trying to write Reversi game in Python. Can anyone give me some basic ideas and strategy which are simple, good and easy to use?\nI would appreciate for any help because I've gone to a little far but is stucked between codes and it became more complex too. I think I overdid... |
I was browsing through the questions and noticed this:
SELECT prodid, issue
FROM Sales
WHERE custid = @custid
AND datesold = SELECT MAX(datesold)
FROM Sales s
WHERE s.prodid = Sales.prodid
AND s.issue = Sales.issue
AND s.custid = @custid
I was wondering... | The "@" symbol in front of `custid` indicates that it is a parameter, commonly used in the context of SQL queries, particularly in stored procedures or prepared statements. It signifies that `@custid` is a variable that will hold a value at runtime, allowing you to filter the records based on a specific customer ID tha... | 47,290 | [
{
"from": "human",
"value": "I was browsing through the questions and noticed this:\nSELECT prodid, issue\nFROM Sales \nWHERE custid = @custid \nAND datesold = SELECT MAX(datesold) \n FROM Sales s \n WHERE s.prodid = Sales.prodid\n AND s.issue = Sales.issue\n ... |
how can access the binary data file(.DAT). i am using geonames API. can anyone help me?
| To access the binary data file (.DAT) from the GeoNames database, you can follow these general steps:
1. **Visit the GeoNames Website**: Go to the official GeoNames website ([www.geonames.org](http://www.geonames.org/)). Here you can find information about their available data files.
2. **Download the .DAT Files**: N... | 44,233 | [
{
"from": "human",
"value": "how can access the binary data file(.DAT). i am using geonames API. can anyone help me? \n"
},
{
"from": "gpt",
"value": "To access the binary data file (.DAT) from the GeoNames database, you can follow these general steps:\n\n1. **Visit the GeoNames Website**: Go to... |
I would like to create a Delphi application for Windows XP which allows dropping of files dragged from Windows Explorer (the Desktop or folder windows) or other applications which support this operation (such as Total Commander). What about vice-versa? When the user drags an icon from my application, I should be able t... | Creating a Delphi application that supports drag-and-drop functionality, both for dropping files into the application and dragging files or icons from it, is a great way to enhance user interaction. Here's a step-by-step guide to help you achieve your goal of creating a custom application toolbar on Windows XP.
### St... | 36,389 | [
{
"from": "human",
"value": "I would like to create a Delphi application for Windows XP which allows dropping of files dragged from Windows Explorer (the Desktop or folder windows) or other applications which support this operation (such as Total Commander). What about vice-versa? When the user drags an ico... |
I need a map that has two keys, e.g.
Map2<String /*ssn*/, String /*empId*/, Employee> _employees;
So that I can
_employees.put(e.ssn(), e.empId(), e)
And later
_employees.get1(someSsn);
_employees.get2(someImpId);
Or even
_employees.remove1(someImpId);
I am not sure why I want to stop at two, why not more, probably... | Implementing a map with multiple keys (in your case, two keys: SSN and employee ID) can be achieved using a custom data structure that encapsulates the logic needed to handle these keys. While Java's standard libraries do not directly support multi-key maps, you can build your own class to manage this requirement.
Her... | 37,607 | [
{
"from": "human",
"value": "I need a map that has two keys, e.g.\nMap2<String /*ssn*/, String /*empId*/, Employee> _employees;\n\nSo that I can\n_employees.put(e.ssn(), e.empId(), e)\n\nAnd later\n_employees.get1(someSsn);\n_employees.get2(someImpId);\n\nOr even\n_employees.remove1(someImpId);\n\nI am not ... |
I have a POM for my ejb project. In it I have added a maven-antrun-plugin execution step to build websphere ejb stubs during the verify phase. This works but is quite verbose, and as I need to add similiar steps to a number of other ejb projects I want to move the common section to a parent POM for all our ejbs.
My fi... | When dealing with Maven multi-module projects, you might encounter challenges when trying to execute certain build processes, such as generating EJB stubs with the `maven-antrun-plugin`, particularly when you want to centralize configuration in a parent POM. The key is to make sure that specific execution steps are pro... | 37,301 | [
{
"from": "human",
"value": "I have a POM for my ejb project. In it I have added a maven-antrun-plugin execution step to build websphere ejb stubs during the verify phase. This works but is quite verbose, and as I need to add similiar steps to a number of other ejb projects I want to move the common section... |
Is there a way to get a list of all the GMarkers that have been added to a map?
| In the context of using Google Maps JavaScript API, if you want to keep track of all the `GMarkers` (or `google.maps.Marker` objects) that have been added to a map, you can maintain your own array or list of markers. The Google Maps API does not provide a built-in method to retrieve all markers from the map, so you'll ... | 44,430 | [
{
"from": "human",
"value": "Is there a way to get a list of all the GMarkers that have been added to a map? \n"
},
{
"from": "gpt",
"value": "In the context of using Google Maps JavaScript API, if you want to keep track of all the `GMarkers` (or `google.maps.Marker` objects) that have been add... |
I'm looking at upgrading the Borland/Codegear/Embarcadero C++ builder suite we use for some of our code. I would like to see 64-bit support but that doesn't seem to be a feature in the 2009 edition. I swear I saw a roadmap suggesting that there would be a new release in mid-2009 which would include x64, but now that ... | It seems you might be mixing up some details related to Borland and its subsequent iterations (CodeGear and Embarcadero). As for your inquiry regarding the C++ Builder and its support for 64-bit:
C++Builder 2009 did not include 64-bit support. The first version of C++Builder that offered 64-bit compiler support was C+... | 48,956 | [
{
"from": "human",
"value": "I'm looking at upgrading the Borland/Codegear/Embarcadero C++ builder suite we use for some of our code. I would like to see 64-bit support but that doesn't seem to be a feature in the 2009 edition. I swear I saw a roadmap suggesting that there would be a new release in mid-20... |
Parser Error Message: The entry 'SiteSqlServer' has already been added.
Source Error:
Line 23: providerName="System.Data.SqlClient"/> -->
Line 24: < ! -- Connection String for SQL Server 2000/2005 -->
Line 25: <add name="SiteSqlServer" connectionString="Server=(local);
abase=DotNetNuke2; uid=nukeuser;pwd=dotnetnuk... | The error message "The entry 'SiteSqlServer' has already been added" indicates that there are multiple declarations of the same connection string in your configuration file (likely in `Web.config` or `App.config`). In your case, it seems there is already an existing entry for `SiteSqlServer`, and you are attempting to ... | 44,402 | [
{
"from": "human",
"value": "Parser Error Message: The entry 'SiteSqlServer' has already been added.\nSource Error:\n\nLine 23: providerName=\"System.Data.SqlClient\"/> -->\n\nLine 24: < ! -- Connection String for SQL Server 2000/2005 -->\n\nLine 25: <add name=\"SiteSqlServer\" connectionString=\"Server=(lo... |
What are some helpful things that ASP.NET MVC developers could suggest that would help us ASP.NET WebForms developers to write better code/web apps?
I'm a WebForms guy but with all the new hype around MVC I'd value some comments on helpful tips, tricks and strategies that might be able to be used in a webforms app.
| Transitioning from ASP.NET WebForms to MVC can indeed be daunting, especially if you are accustomed to the event-driven model of WebForms. However, there are several concepts and best practices that ASP.NET MVC developers often recommend, which can be applied to WebForms to improve your code quality and enhance your we... | 41,890 | [
{
"from": "human",
"value": "What are some helpful things that ASP.NET MVC developers could suggest that would help us ASP.NET WebForms developers to write better code/web apps?\nI'm a WebForms guy but with all the new hype around MVC I'd value some comments on helpful tips, tricks and strategies that might... |
How do I integrate AJAX toolkit into MVC applications in .net?
| Integrating the AJAX Control Toolkit into an ASP.NET MVC application involves a few steps. The AJAX Control Toolkit is a collection of components and extensions that help enhance the functionality of ASP.NET applications. However, keep in mind that the AJAX Control Toolkit is primarily designed for Web Forms. To use si... | 40,777 | [
{
"from": "human",
"value": "How do I integrate AJAX toolkit into MVC applications in .net?\n"
},
{
"from": "gpt",
"value": "Integrating the AJAX Control Toolkit into an ASP.NET MVC application involves a few steps. The AJAX Control Toolkit is a collection of components and extensions that help ... |
Is it possible to checkout only those files from a SVN repository that were modified in a revision or range of revisions, without checking out any files that were not modified?
| Yes, it is possible to check out only the files that were modified in a specific revision or range of revisions from an SVN repository, but it requires a bit of manual work as SVN doesn't provide a direct command for this.
Here’s a step-by-step method you can use:
1. **Identify Modified Files**: First, you need to id... | 45,702 | [
{
"from": "human",
"value": "Is it possible to checkout only those files from a SVN repository that were modified in a revision or range of revisions, without checking out any files that were not modified? \n"
},
{
"from": "gpt",
"value": "Yes, it is possible to check out only the files that wer... |
I'm trying to debug a workflow project that's using the default WF SQL persistence schema. Does anyone know of a good explanation for what the data in each table represents?
| Certainly! The Windows Workflow Foundation (WF) uses a SQL persistence store to save the state of workflows so they can be rehydrated and resumed later. The default SQL persistence schema consists of several tables, each serving a specific purpose in managing the workflow's state and metadata. Below is a summary of the... | 44,317 | [
{
"from": "human",
"value": "I'm trying to debug a workflow project that's using the default WF SQL persistence schema. Does anyone know of a good explanation for what the data in each table represents?\n"
},
{
"from": "gpt",
"value": "Certainly! The Windows Workflow Foundation (WF) uses a SQL ... |
What needs to happen before we can open Web Application Projects hosted in IIS7 with Visual Studio 2008 without running as Administrator? Are we talking about waiting for the next version of Visual Studio? Are there any existing workarounds?
I think it's implied by the above, but this pertains to Vista.
Thanks.
| Running Visual Studio 2008 on Windows Vista while trying to open Web Application Projects that are hosted in IIS7 requires administrative privileges due to the way that user account control (UAC) is implemented in Vista. Here are a few points regarding this issue:
### Requirements
1. **Run Visual Studio as Administrat... | 46,080 | [
{
"from": "human",
"value": "What needs to happen before we can open Web Application Projects hosted in IIS7 with Visual Studio 2008 without running as Administrator? Are we talking about waiting for the next version of Visual Studio? Are there any existing workarounds?\nI think it's implied by the above,... |
On the Stackoverflow podcast this week, Jeff mentioned that in 2004 he wrote a script which queried Google with 110,000 English words and collected a database containing the number of hits for each word. They use this on Stackoverflow e.g. for the "Related" list on the right-hand side of each question page.
Since creat... | If you're looking for a more up-to-date database of word frequencies, especially in the context of technology and programming terminology, there are a few options you can consider:
1. **Google Books Ngram Viewer**: This tool allows you to search for the frequency of words and phrases in a vast dataset of books. While ... | 43,957 | [
{
"from": "human",
"value": "On the Stackoverflow podcast this week, Jeff mentioned that in 2004 he wrote a script which queried Google with 110,000 English words and collected a database containing the number of hits for each word. They use this on Stackoverflow e.g. for the \"Related\" list on the right-h... |
Ive decided that I really dont like microsoft and their ways. Please could you give me directions on how to handle winmail.dat in emails, is there a jython library or a java library that will allow me to handle this.
Ive just completed a email processing program, written in jython 2.2.1 on java 5. During the final load... | Certainly! Let’s dive into the details regarding `winmail.dat`, the challenges it poses, and how you might handle it in your email processing program.
### What is winmail.dat?
`winmail.dat` is a file that Microsoft Outlook creates when sending emails using the Rich Text Format (RTF) instead of standard MIME (Multipur... | 41,511 | [
{
"from": "human",
"value": "Ive decided that I really dont like microsoft and their ways. Please could you give me directions on how to handle winmail.dat in emails, is there a jython library or a java library that will allow me to handle this.\nIve just completed a email processing program, written in jyt... |
I have a WPF ListView which repeats the data vertically. I cannot figure out how to make it repeat horizontally, like the slideshow view in Windows Explorer. My current ListView definition is:
<ListView ItemsSource="{StaticResource MyDataList}" ItemTemplate="{StaticResource ListViewTemplate}">
</ListView>
The DataTemp... | To change the layout of a WPF `ListView` so that it displays its items horizontally instead of the default vertical orientation, you can utilize the `ItemsPanel` property of the `ListView`. This property allows you to define how the items in the `ListView` are arranged. For a horizontal arrangement, you can use a `Wrap... | 43,906 | [
{
"from": "human",
"value": "I have a WPF ListView which repeats the data vertically. I cannot figure out how to make it repeat horizontally, like the slideshow view in Windows Explorer. My current ListView definition is:\n<ListView ItemsSource=\"{StaticResource MyDataList}\" ItemTemplate=\"{StaticResource ... |
I have this code that generates markets I want to be clickable with a pop up info window.
for (i = 0; i < marker_array.length; i++) {
var point = new GLatLng(marker_array[i][0], marker_array[i][1]);
var marker = new GMarker(point, markerOptions);
GEvent.addListener(marker, "click", function() {
m... | The issue you're encountering is a common problem in JavaScript closures when used in loops. In your case, all the click listeners are being registered with the last value of `marker` due to how closures work. When the click event is triggered, it will always reference the last marker, which is why you only see the inf... | 45,074 | [
{
"from": "human",
"value": "I have this code that generates markets I want to be clickable with a pop up info window. \nfor (i = 0; i < marker_array.length; i++) {\n var point = new GLatLng(marker_array[i][0], marker_array[i][1]);\n var marker = new GMarker(point, markerOptions);\n\n GEvent.addLi... |
You could very well leave out "as a technical lead", but I think it puts the situation into context. I'm a technical lead, we're building a new app, and I have an idea of the language I would like the team to use. If one or more want to use a different language (out of personal preference), is it appropriate for me to ... | As a technical lead, it's important to balance team dynamics, individual preferences, and the overall goals of the project. Here are a few considerations to help you navigate this situation:
1. **Project Requirements**: Assess whether the language you prefer aligns with the project requirements, technical constraints,... | 45,611 | [
{
"from": "human",
"value": "You could very well leave out \"as a technical lead\", but I think it puts the situation into context. I'm a technical lead, we're building a new app, and I have an idea of the language I would like the team to use. If one or more want to use a different language (out of persona... |
I am currently doing the front end for a site with looooads of forms, all styled up and looking pretty in IE, but I've just noticed that in Firefox the file input fields aren't responding to any of my styles, all the other types of input fields are fine. I've checked it in Firebug and its associating the correct styles... | It's not a brain fart! You're encountering a common issue with the styling of `<input type="file">` elements in web browsers, particularly in Firefox. The appearance of file input fields is largely determined by the browser, and they tend to have default styles that are not easily overridden.
Here are a few points to ... | 44,166 | [
{
"from": "human",
"value": "I am currently doing the front end for a site with looooads of forms, all styled up and looking pretty in IE, but I've just noticed that in Firefox the file input fields aren't responding to any of my styles, all the other types of input fields are fine. I've checked it in Fireb... |
We are using NHibernate to manage our persistence in a complex modular windows forms application - but one thought keeps bothering me. We currently open a session on launch and open all objects through that session. I am worried that all loaded objects get loaded into the NHibernate session cache, so that they cant be ... | Your concerns about the NHibernate session cache potentially leading to excessive memory usage in a long-running Windows Forms application are valid. When you keep a session open for the lifetime of the application and continually load objects, you risk keeping all those objects in memory, making them unavailable for g... | 42,002 | [
{
"from": "human",
"value": "We are using NHibernate to manage our persistence in a complex modular windows forms application - but one thought keeps bothering me. We currently open a session on launch and open all objects through that session. I am worried that all loaded objects get loaded into the NHiber... |
I have a couple of tables that I want to map to classes. The tables look like this:
Asset
---------
AssetId
AssetName
Product
---------
ProductId
ProductName
AssetId
Disposal
---------
DisposalId
AssetId
DisposalDate
Basically what I want to do is join the Product Table to the Disposal table on AssetId so that my Pr... | It looks like you're trying to map a relationship between the `Product` and `Disposal` entities using NHibernate. However, the current mapping you've provided has some issues, especially with the use of the `<bag>` element and the foreign key definition.
To correctly establish the relationship, you should use the `<s... | 44,262 | [
{
"from": "human",
"value": "I have a couple of tables that I want to map to classes. The tables look like this:\nAsset\n---------\nAssetId\nAssetName\n\nProduct\n---------\nProductId\nProductName\nAssetId\n\nDisposal\n---------\nDisposalId\nAssetId\nDisposalDate\n\nBasically what I want to do is join the P... |
I have Swing java application with network communications to several "Players" that are represented as player objects, each with their own communication thread. The app has a "Team" object managing all player objects. Several UI components listen to events passed from the players through the Team object.
In my design,... | Testing GUI-related components, especially when dealing with threading issues, can indeed be quite challenging. Your approach to simplify threading by using `invokeLater` on the Swing thread is a good design decision for maintaining a responsive UI, but it complicates unit testing.
### Suggestions to Address the Testi... | 41,775 | [
{
"from": "human",
"value": "I have Swing java application with network communications to several \"Players\" that are represented as player objects, each with their own communication thread. The app has a \"Team\" object managing all player objects. Several UI components listen to events passed from the pl... |
I'm working with a existing database and trying to write a sql query to get out all the account information including permission levels. This is for a security audit. We want to dump all of this information out in a readible fashion to make it easy to compare. My problem is that there is a bridge/link table for the per... | To achieve the desired output where each user has their permissions listed on a single line, you'll need to use a combination of SQL techniques, including aggregation with conditional logic. One way to approach this is to use `GROUP BY` combined with `MAX` or other aggregation functions. However, since you want a flexi... | 41,553 | [
{
"from": "human",
"value": "I'm working with a existing database and trying to write a sql query to get out all the account information including permission levels. This is for a security audit. We want to dump all of this information out in a readible fashion to make it easy to compare. My problem is that... |
i've got some binary data which i want to save as an image. When i try to save the image, it throws an exception if the memory stream used to create the image, was closed before the save. The reason i do this is because i'm dynamically creating images and as such .. i need to use a memory stream.
this is the code:
[Tes... | The issue you're encountering arises because the `Bitmap` constructor you are using relies on the underlying stream remaining open for the lifetime of the `Bitmap` object. When the stream is disposed (i.e., closed), the `Bitmap` object is no longer able to access the pixel data, which results in a GDI+ exception when y... | 41,210 | [
{
"from": "human",
"value": "i've got some binary data which i want to save as an image. When i try to save the image, it throws an exception if the memory stream used to create the image, was closed before the save. The reason i do this is because i'm dynamically creating images and as such .. i need to us... |
I would like to execute multiple commands in a row:
i.e. (just to illustrate my need):
cmd (the shell)
then
cd dir
and
ls
and read the result of the ls.
Any idea with subprocess module?
Update:
cd dir and ls are just an example. I need to run complex commands (following a particular order, without any pipelining). In f... | To execute multiple commands in a row in a shell-like environment using the `subprocess` module in Python, you can use `subprocess.Popen` to create a persistent shell session. This allows you to run multiple commands while maintaining the same environment (like changing directories).
Here’s an example of how you can ... | 44,069 | [
{
"from": "human",
"value": "I would like to execute multiple commands in a row:\ni.e. (just to illustrate my need):\ncmd (the shell)\nthen\ncd dir\nand\nls\nand read the result of the ls.\nAny idea with subprocess module?\nUpdate:\ncd dir and ls are just an example. I need to run complex commands (followin... |
What is the best way to extract RSS/ATOM URLs from HTML LINK tags? I know regex is not the best way to do this, so I'm wondering what alternatives I have. Surely some kind of horrible string munging using .Contains after loading the HTML into a string is not optimal either. Anyone got a decent strategy for this?
| Extracting RSS or Atom feed URLs from HTML `<link>` tags can be done much more reliably and efficiently using an HTML parser. Regular expressions may work for simple cases, but they can fail with complex HTML structures or malformed tags. Instead, using a dedicated library will help you handle various edge cases and en... | 40,287 | [
{
"from": "human",
"value": "What is the best way to extract RSS/ATOM URLs from HTML LINK tags? I know regex is not the best way to do this, so I'm wondering what alternatives I have. Surely some kind of horrible string munging using .Contains after loading the HTML into a string is not optimal either. Anyo... |
I am having a problem retrieving the parameters from the URL section of a JSON store for a combobox in EXTJS from my code behind page in C#. The following is the code in the store:
var ColorStore = new Ext.data.JsonStore({
autoLoad: true,
url: '/proxies/ReturnJSON.aspx?view=rm_colour_view',
root: 'Rows',
... | To retrieve the `view` parameter from the URL on your code-behind page, it's important to understand how the query string is formed and how ASP.NET accesses these parameters. When you construct the URL in your JavaScript code, you have:
```javascript
url: '/proxies/ReturnJSON.aspx?view=rm_colour_view'
```
In this URL... | 44,257 | [
{
"from": "human",
"value": "I am having a problem retrieving the parameters from the URL section of a JSON store for a combobox in EXTJS from my code behind page in C#. The following is the code in the store:\nvar ColorStore = new Ext.data.JsonStore({\n autoLoad: true,\n url: '/proxies/ReturnJSON.asp... |
How can I create a regex for a string such as this:
<SERVER> <SERVERKEY> <COMMAND> <FOLDERPATH> <RETENTION> <TRANSFERMODE> <OUTPUTPATH> <LOGTO> <OPTIONAL-MAXSIZE> <OPTIONAL-OFFSET>
Most of these fields are just simple words, but some of them can be paths, such as FOLDERPATH, OUTPUTPATH, these paths can also be paths w... | Creating a regex that accurately parses your command line structure, especially considering paths that may contain spaces, requires careful construction. Your current regex has some issues that can be refined to improve accuracy, especially around handling optional parameters and paths.
### Here's an updated version o... | 42,248 | [
{
"from": "human",
"value": "How can I create a regex for a string such as this:\n<SERVER> <SERVERKEY> <COMMAND> <FOLDERPATH> <RETENTION> <TRANSFERMODE> <OUTPUTPATH> <LOGTO> <OPTIONAL-MAXSIZE> <OPTIONAL-OFFSET>\n\nMost of these fields are just simple words, but some of them can be paths, such as FOLDERPATH,... |
I have a IBAction such as:
- (IBAction)showPicker:(id)sender;
How can I get the name of the control from the sender variable?
I am typically a c# coder so have tried the following to no avail
senderName = ((UIButton *)sender).name;
I need something more descriptive than the control id (not the button title either). I... | In Objective-C, the `sender` parameter in an `IBAction` is typically a reference to the control that triggered the action (e.g., a UIButton). Unfortunately, there isn't a built-in `name` property on UIKit controls like there is in some other programming languages such as C#. However, you can achieve your goal by using ... | 44,046 | [
{
"from": "human",
"value": "I have a IBAction such as:\n- (IBAction)showPicker:(id)sender;\n\nHow can I get the name of the control from the sender variable?\nI am typically a c# coder so have tried the following to no avail\nsenderName = ((UIButton *)sender).name;\n\nI need something more descriptive than... |
Do languages become more verbose as they mature? It feels like each new version of VB.net gains more syntax. Is it possible to trim down some fat like the keyword "Dim"? C# also feels like it is getting more syntax since version 1.
| The trend of languages becoming more verbose as they mature can often be observed, and there are several factors that contribute to this phenomenon:
1. **Feature Expansion**: As programming languages evolve, they typically gain new features to support emerging programming paradigms, tools, and practices. This can lead... | 43,970 | [
{
"from": "human",
"value": "Do languages become more verbose as they mature? It feels like each new version of VB.net gains more syntax. Is it possible to trim down some fat like the keyword \"Dim\"? C# also feels like it is getting more syntax since version 1.\n"
},
{
"from": "gpt",
"value": "... |
If I create an ADO .Net Data Service, can I access it from Silverlight across domains as long as I don't use the ADO .Net Silverlight Client helpers and I have a proper crossdomain.xml file in place? (I would essentially just get the raw xml and parse it myself)
Asked another way, is it the ADO .Net Data Services Silve... | To clarify your question regarding ADO.NET Data Services and cross-domain access from Silverlight applications:
1. **Cross-Domain Requests in Silverlight**: By default, Silverlight applications are restricted to make requests only to the same domain from which they were downloaded. To enable cross-domain requests, a `... | 42,402 | [
{
"from": "human",
"value": "If I create an ADO .Net Data Service, can I access it from Silverlight across domains as long as I don't use the ADO .Net Silverlight Client helpers and I have a proper crossdomain.xml file in place? (I would essentially just get the raw xml and parse it myself)\nAsked another w... |
How to create a WCF application without using the svcutil.exe tool?
| Creating a Windows Communication Foundation (WCF) application without using the `svcutil.exe` tool involves several steps, including defining your service contracts, implementing the service, configuring the service in a configuration file, and hosting the service. Below are the steps you can follow:
### 1. Create a W... | 42,239 | [
{
"from": "human",
"value": "How to create a WCF application without using the svcutil.exe tool?\n"
},
{
"from": "gpt",
"value": "Creating a Windows Communication Foundation (WCF) application without using the `svcutil.exe` tool involves several steps, including defining your service contracts, ... |
Say I have the following in my models.py:
class Company(models.Model):
name = ...
class Rate(models.Model):
company = models.ForeignKey(Company)
name = ...
class Client(models.Model):
name = ...
company = models.ForeignKey(Company)
base_rate = models.ForeignKey(Rate)
I.e. there are multiple Compani... | To achieve the desired behavior where the `ClientForm` only allows the selection of rates that belong to a specific company (and to also omit the company field), you can customize the form by overriding the `__init__` method to limit the choices for the `base_rate` field based on the selected company.
Here's how to do... | 43,045 | [
{
"from": "human",
"value": "Say I have the following in my models.py:\nclass Company(models.Model):\n name = ...\n\nclass Rate(models.Model):\n company = models.ForeignKey(Company)\n name = ...\n\nclass Client(models.Model):\n name = ...\n company = models.ForeignKey(Company)\n base_rate = mode... |
The two key event argument classes KeyEventArgs and PreviewKeyDownEventArgs each have two properties, KeyCode and KeyData, which are both of the enumeration type Keys.
What is the difference between these two properties? Do the values in them ever differ from each other? If so, when and why?
| In the context of key events in Windows Forms applications, both `KeyEventArgs` and `PreviewKeyDownEventArgs` contain the properties `KeyCode` and `KeyData`, which are of the enumeration type `Keys`. However, there are important differences between these two properties, particularly regarding their meanings and when th... | 45,975 | [
{
"from": "human",
"value": "The two key event argument classes KeyEventArgs and PreviewKeyDownEventArgs each have two properties, KeyCode and KeyData, which are both of the enumeration type Keys.\nWhat is the difference between these two properties? Do the values in them ever differ from each other? If so... |
I have my type "x" of type varchar(50). How can I alter it to varchar(100)? It seems I can't!
| To alter a column in a SQL table from `varchar(50)` to `varchar(100)`, you can use the `ALTER TABLE` statement. However, the specific syntax can vary slightly depending on the database management system (DBMS) you are using (e.g., MySQL, PostgreSQL, SQL Server, etc.).
Here’s a general example that should work in most ... | 44,874 | [
{
"from": "human",
"value": "I have my type \"x\" of type varchar(50). How can I alter it to varchar(100)? It seems I can't!\n"
},
{
"from": "gpt",
"value": "To alter a column in a SQL table from `varchar(50)` to `varchar(100)`, you can use the `ALTER TABLE` statement. However, the specific synt... |
I am developing a wrapper for a third party function library that is interfacing with some special hardware. So basically, I want to encapsulate the dll functions (bool Connect(), void Disconnect() etc) in a MyHardwareObject with connect- and disconnect methods.
The Connect function from the dll can throw some specific... | When designing your wrapper around the third-party library functions, you have two primary considerations: user experience and error handling. The choice between returning a boolean indicating success or failure versus throwing exceptions can impact how the rest of your application interacts with this wrapper. Let's ex... | 40,825 | [
{
"from": "human",
"value": "I am developing a wrapper for a third party function library that is interfacing with some special hardware. So basically, I want to encapsulate the dll functions (bool Connect(), void Disconnect() etc) in a MyHardwareObject with connect- and disconnect methods.\nThe Connect fun... |
I'm build an UserControl and I'm not sure how to handle exceptions, the Control itself is not very complicated, the User chose an image from disk so they can authorize it, I don't know exactly how the control will be used so if I use a MessageBox I might block the application, and if I just re-throw it I might crash it... | Handling exceptions in a UserControl gracefully is important, as you want to ensure that the application remains responsive and stable. Here are several strategies you could employ for handling exceptions in your UserControl while managing the user experience effectively:
### 1. **Use Try-Catch and Logging**:
Wrap pot... | 40,838 | [
{
"from": "human",
"value": "I'm build an UserControl and I'm not sure how to handle exceptions, the Control itself is not very complicated, the User chose an image from disk so they can authorize it, I don't know exactly how the control will be used so if I use a MessageBox I might block the application, a... |
I am writing one web chat program using AJAX (a little bit). It is working when both users open a chat page, but I want to open a window when one user send data to others.
| To create a web chat application where a new window or notification opens when one user sends a message, you'll need to leverage AJAX for real-time communication along with JavaScript to handle the user interface and events. Here's a general approach to achieving this:
### High-Level Steps:
1. **Setup Your HTML Struc... | 40,720 | [
{
"from": "human",
"value": "I am writing one web chat program using AJAX (a little bit). It is working when both users open a chat page, but I want to open a window when one user send data to others.\n"
},
{
"from": "gpt",
"value": "To create a web chat application where a new window or notific... |
I have a class with two methods defined in it.
public class Routines {
public static method1() {
/* set of statements */
}
public static method2() {
/* another set of statements.*/
}
}
Now I need to call method1() from method2()
Which one the following approaches is better? Or is this... | In your scenario, both approaches to calling `method1()` from `method2()` will work correctly, as both refer to the same static method in the `Routines` class. However, there are some nuances to consider regarding clarity and readability of your code.
1. **First approach:**
```java
public static method2() {
... | 46,772 | [
{
"from": "human",
"value": "I have a class with two methods defined in it.\npublic class Routines {\n\n public static method1() {\n /* set of statements */\n }\n\n public static method2() {\n /* another set of statements.*/\n }\n}\n\nNow I need to call method1() from method2()\nWh... |
I don't have too much experience with C# so if someone could point me in the right direction I would greatly appreciate it. I have a foreach loop that references a variable of an object. I wish to make another foreach loop inside the main one that compares (or performs actions on) the current variable to the rest of ... | It looks like you're trying to implement a gravitational force calculation between multiple rigid bodies in a physics simulation. The idea is to loop over each body, and for each body, loop over the rest of the bodies to calculate the gravitational force exerted on it. Below is an example of how you can implement this ... | 38,808 | [
{
"from": "human",
"value": "I don't have too much experience with C# so if someone could point me in the right direction I would greatly appreciate it. I have a foreach loop that references a variable of an object. I wish to make another foreach loop inside the main one that compares (or performs actions... |
When I try to programmatically access a Word object model, I get an error saying no document is active. This appears to be because I am loading the document as not visible using Word automation, and I have to keep it invisible.
How would I code the open macro so that it does nothing in this case?
If Not ActiveDocume... | When working with Word automation and trying to access the object model with a document opened as invisible, you can't rely on `ActiveDocument` since there may be no active document in that context. Instead, you can use the `ThisDocument` object, which refers to the document that contains the macro.
If you want your ... | 46,020 | [
{
"from": "human",
"value": "When I try to programmatically access a Word object model, I get an error saying no document is active. This appears to be because I am loading the document as not visible using Word automation, and I have to keep it invisible.\nHow would I code the open macro so that it does n... |
In an ASP.NET 3.5 site we have a relatively standard payment checkout progess that contains a number of pages that need to be visited in sequence (shopping basket, payment details etc)
Each page has a "Continue" button that redirects to the next page in the sequence.
I would like a way of managing the page sequence so ... | To implement a sequential checkout process in your ASP.NET 3.5 site, you can leverage a Master Page, enums for defining the sequence, and some code-behind logic to handle redirections. Below are the steps you can follow to achieve your requirements:
### Step 1: Define an Enum for Page Sequence
Start by defining an en... | 38,925 | [
{
"from": "human",
"value": "In an ASP.NET 3.5 site we have a relatively standard payment checkout progess that contains a number of pages that need to be visited in sequence (shopping basket, payment details etc)\nEach page has a \"Continue\" button that redirects to the next page in the sequence.\nI would... |
I'm pretty green with web services and WCF, and I'm using Windows integrated authentication - how do I get the username on the server-side interface? I believe that I'm supposed to implement a custom Behavior, or perhaps something with WCF Sessions? Any clues would be super-handy.
| In WCF (Windows Communication Foundation), when you are using Windows integrated authentication, you can easily access the user's identity on the server side. You don't necessarily need to implement a custom behavior or manage sessions for this purpose. You can retrieve the user's identity directly from the `OperationC... | 44,095 | [
{
"from": "human",
"value": "I'm pretty green with web services and WCF, and I'm using Windows integrated authentication - how do I get the username on the server-side interface? I believe that I'm supposed to implement a custom Behavior, or perhaps something with WCF Sessions? Any clues would be super-hand... |
What would the purpose of this construct in a c file be?:
#define _TIMERC
#include "timer.h"
#undef _TIMERC
I am aware of the guard for preventing multiple inclusion of a header file. This doesn't appear to be whats happening though.
thanks!
| The construct you've posted:
```c
#define _TIMERC
#include "timer.h"
#undef _TIMERC
```
is likely being used to conditionally include certain parts of the "timer.h" header file based on whether `_TIMERC` is defined or not. Here’s a detailed explanation of how this could be functioning:
1. **Temporary Definitio... | 42,661 | [
{
"from": "human",
"value": "What would the purpose of this construct in a c file be?: \n#define _TIMERC \n#include \"timer.h\" \n#undef _TIMERC \n\nI am aware of the guard for preventing multiple inclusion of a header file. This doesn't appear to be whats happening though.\nthanks!\n"
},
{
"from... |
I've got a rather large flex app that we've just built for a client. Now, the bossman tells me that more clients are interested in the app. However, their implementations will need a few small tweaks (don't they always!).
We're using Cairngorm and from what I can tell thus far, the only things that will be different be... | To build a flexible system in Flex that allows you to override default components with client-specific components, you can follow a strategy using a combination of a Factory pattern and Dependency Injection. This way, you can dynamically choose which component to instantiate at runtime based on the client's configurati... | 40,392 | [
{
"from": "human",
"value": "I've got a rather large flex app that we've just built for a client. Now, the bossman tells me that more clients are interested in the app. However, their implementations will need a few small tweaks (don't they always!).\nWe're using Cairngorm and from what I can tell thus far,... |
Is there any existing project or incubator to manage user administratable lists of options? We have several 100 lists (most populate dropdowns in our application), many are quite short < 50 items, several with a few hundred items and a handful with thousands (<30,000) entries.
What we are looking for is a database base... | There are several existing solutions and projects that can help you manage user-editable lists of options in a database-backed way, complete with user interfaces. Here are a few options you might consider:
### 1. **Airtable**
Airtable is a flexible and user-friendly database tool that allows users to create custom tab... | 44,290 | [
{
"from": "human",
"value": "Is there any existing project or incubator to manage user administratable lists of options? We have several 100 lists (most populate dropdowns in our application), many are quite short < 50 items, several with a few hundred items and a handful with thousands (<30,000) entries.\n... |
I have several input and option elements on my page, each (well almost) have an event attached to update some text on the page once they change. I use jQuery which is really really cool :)
I also use Microsofts Ajax framework, utilizing the UpdatePanel. The reason why I do that is that certain elements are created on ... | You can indeed handle the rebinding of your jQuery events after an ASP.NET UpdatePanel update without needing to add additional JavaScript files. The key is to use the `Sys.WebForms.PageRequestManager` that comes with ASP.NET AJAX. This allows you to hook into specific events such as when an UpdatePanel is updated.
He... | 41,152 | [
{
"from": "human",
"value": "I have several input and option elements on my page, each (well almost) have an event attached to update some text on the page once they change. I use jQuery which is really really cool :) \nI also use Microsofts Ajax framework, utilizing the UpdatePanel. The reason why I do tha... |
I am implementing an installer for one of our products that requires MySQL as a prerequisite. I would like to have a bootstrap program that queries the user for any information needed for any prerequisite products and our product. Once the user has entered in all the necessary information they can press next and walk... | For a silent installation of MySQL on Windows using the Windows Installer package (MSI), you can pass various properties to `msiexec` via the command line. Below are the common properties that can be used to customize your MySQL installation:
### Common `msiexec` Properties for MySQL Installation
1. **INSTALLDIR**: S... | 40,525 | [
{
"from": "human",
"value": "I am implementing an installer for one of our products that requires MySQL as a prerequisite. I would like to have a bootstrap program that queries the user for any information needed for any prerequisite products and our product. Once the user has entered in all the necessary... |
How do I mock the method GetValues() in System.Data.IDataReader?
This method changes the array of objects passed to it, so it can’t simply return a mocked value.
private void UpdateItemPropertyValuesFromReader( object item, IDataReader reader )
{
object[] fields = new object[ reader.FieldCount ];
reader.GetVal... | Mocking the `GetValues` method of the `IDataReader` interface can be a bit tricky since it fills an array of objects instead of returning a value. However, you can achieve this by using a mocking framework that allows you to set up the behavior of your mock object accordingly.
If you're using a mocking library like Mo... | 39,891 | [
{
"from": "human",
"value": "How do I mock the method GetValues() in System.Data.IDataReader? \nThis method changes the array of objects passed to it, so it can’t simply return a mocked value.\nprivate void UpdateItemPropertyValuesFromReader( object item, IDataReader reader )\n{\n object[] fields = new o... |
I use Tapestry 4, and whenever we push a release that changes any assets (image, style sheet, JS library), we get problems because users still have the old version of the asset in their browser cache. I'd like to set up some easy way to allow caching, but force a new asset download when we update the application. Simpl... | To manage asset caching effectively in Tapestry 4, you can append a version number or build number to your asset URLs. This approach forces the browser to fetch a new version of the asset when the version changes, while still allowing for caching when the assets remain unchanged.
Here's a step-by-step guide on how to ... | 43,542 | [
{
"from": "human",
"value": "I use Tapestry 4, and whenever we push a release that changes any assets (image, style sheet, JS library), we get problems because users still have the old version of the asset in their browser cache. I'd like to set up some easy way to allow caching, but force a new asset downl... |
I'm just wondering if there is a quick way to echo undefined variables without getting a warning? (I can change error reporting level but I don't want to.) The smallest I have so far is:
isset($variable)?$variable:''
I dislike this for a few reasons:
It's a bit "wordy" and complex
$variable is repeated
The echoing of ... | If you want to echo an undefined variable without getting a warning and prefer a cleaner syntax, you can use the null coalescing operator (`??`) in PHP. This operator allows you to provide a default value if the variable is not set or is null, and it is much more concise than the `isset()` method you described.
Here's... | 47,795 | [
{
"from": "human",
"value": "I'm just wondering if there is a quick way to echo undefined variables without getting a warning? (I can change error reporting level but I don't want to.) The smallest I have so far is:\nisset($variable)?$variable:''\nI dislike this for a few reasons:\n\nIt's a bit \"wordy\" an... |
I have a c# struct where I need to forbid calling the no args constructor on it.
MyStruct a;
/// init a by members // OK
MyStruct b = MyStruct.Fact(args); // OK, inits by memebers
MyStruct s = new MyStruct(); // can't have that
I'm doing this mostly to force explicet values for all members as there are no valid def... | In C#, structs cannot have private constructors, which limits the options for enforcing constraints on how they are initialized. However, you can achieve a similar effect by using a couple of different approaches:
### 1. Use a Nested Class to Create Instances
You can define a nested class inside the struct that acts a... | 44,686 | [
{
"from": "human",
"value": "I have a c# struct where I need to forbid calling the no args constructor on it.\nMyStruct a;\n/// init a by members // OK\nMyStruct b = MyStruct.Fact(args); // OK, inits by memebers\n\nMyStruct s = new MyStruct(); // can't have that\n\nI'm doing this mostly to force explicet ... |
I have a nice and lovely Django site up and running, but have noticed that my error.log file was getting huge, over 150 MB after a couple of months of being live. Turns out a bunch of spambots are looking for well known URL vulnerabilities (or something) and hitting a bunch of sub-directories like http://mysite.com/ie ... | Yes, you have a couple of options to address the issue of excessive logging due to spambots hitting invalid URLs on your Django site. Here are some strategies you can use to mitigate the problem:
### 1. Ignore Specific Errors in Logging
If you want to suppress specific error messages (like `TemplateDoesNotExist`), yo... | 38,819 | [
{
"from": "human",
"value": "I have a nice and lovely Django site up and running, but have noticed that my error.log file was getting huge, over 150 MB after a couple of months of being live. Turns out a bunch of spambots are looking for well known URL vulnerabilities (or something) and hitting a bunch of s... |
How would you append an integer to a char* in c++?
| To append an integer to a `char*` in C++, you need to convert the integer to a string format and then concatenate it to the existing character string.
Here's an example of how you can achieve this using `sprintf` or `snprintf`, which is a safer alternative, along with basic dynamic memory management.
Here is a compl... | 43,310 | [
{
"from": "human",
"value": "How would you append an integer to a char* in c++?\n"
},
{
"from": "gpt",
"value": "To append an integer to a `char*` in C++, you need to convert the integer to a string format and then concatenate it to the existing character string. \n\nHere's an example of how you... |
Looking to get a list of all the files (commit comments would be nice too) of a user in cvs.
| To retrieve a list of all files and their commit comments for a specific user in a CVS (Concurrent Versions System) repository, you can follow these general steps. Note that CVS doesn't provide a built-in command to extract commit comments by user directly, so you'll need to use some scripting to achieve this.
Here’s ... | 43,370 | [
{
"from": "human",
"value": "Looking to get a list of all the files (commit comments would be nice too) of a user in cvs. \n"
},
{
"from": "gpt",
"value": "To retrieve a list of all files and their commit comments for a specific user in a CVS (Concurrent Versions System) repository, you can foll... |
for the following:
( a != b ) ? cout<<"not equal" : cout<<"equal";
suppose I don't care if it's equal, how can I use the above statement by substituting cout<<"equal" with a no-op.
| If you want to replace `cout << "equal"` with a no-op (no operation) in the conditional (ternary) operator, you can use an empty statement as the 'else' part. In C++, you can achieve this by using a semicolon (`;`) as the no-op. Here's how you can rewrite your statement:
```cpp
(a != b) ? cout << "not equal" : ;
```
... | 48,973 | [
{
"from": "human",
"value": "for the following:\n( a != b ) ? cout<<\"not equal\" : cout<<\"equal\";\n\nsuppose I don't care if it's equal, how can I use the above statement by substituting cout<<\"equal\" with a no-op.\n"
},
{
"from": "gpt",
"value": "If you want to replace `cout << \"equal\"` ... |
I'm going to try out turbogears however I'm on windows vista.
however due to firewall proxy problems, it seems i can't download .egg files which is required for setup turbogears to get installed in my windows environment.
I do have a bootable, or I can make a bootable Linux USB, I can try cygwin but I am not sure where... | Installing TurboGears under challenging network conditions can be tricky, especially when dealing with firewalls and proxies. Here are several options you could consider:
### Option 1: Manual Download of TurboGears
1. **Download TurboGears Source Manually**:
- If you can access a machine with a good internet conne... | 40,383 | [
{
"from": "human",
"value": "I'm going to try out turbogears however I'm on windows vista.\nhowever due to firewall proxy problems, it seems i can't download .egg files which is required for setup turbogears to get installed in my windows environment.\nI do have a bootable, or I can make a bootable Linux US... |
I've been using cmd.Parameters.AddWithValue, and not specifying a DBType (int, varchar,...) to run queries. After looking at SQL Profiler, it seems that queries run with this method run a lot slower than when you specify the data type.
To give you an idea of how much slower it is, here's an example. The query is a ... | The issue you're experiencing relates to how SQL Server handles parameter sniffing and how it generates execution plans based on the types of parameters you provide. When you use `cmd.Parameters.AddWithValue`, it infers the type of the parameter from the .NET type. This can lead to the generation of suboptimal executio... | 42,171 | [
{
"from": "human",
"value": "I've been using cmd.Parameters.AddWithValue, and not specifying a DBType (int, varchar,...) to run queries. After looking at SQL Profiler, it seems that queries run with this method run a lot slower than when you specify the data type. \nTo give you an idea of how much slower ... |
I need to ensure that an application I am developing is accessable and also works with JavaScript turned off. I just need a pointer to assist with the following.
I had 3 'chained' select boxes and I wanted JavaScript enabled clients to have a nice Ajax experience. I can easily write the required functionality to popula... | To create an application that works seamlessly for both JavaScript-enabled and non-JavaScript clients in ASP.NET MVC, you can follow these general steps:
### 1. Use Progressive Enhancement
Design your application such that it works with a basic HTML form without JavaScript and enhances the experience with JavaScript ... | 38,283 | [
{
"from": "human",
"value": "I need to ensure that an application I am developing is accessable and also works with JavaScript turned off. I just need a pointer to assist with the following.\nI had 3 'chained' select boxes and I wanted JavaScript enabled clients to have a nice Ajax experience. I can easily ... |
I was wondering how to unit test abstract classes, and classes that extend abstract classes.
Should I test the abstract class by extending it, stubbing out the abstract methods, and then test all the concrete methods? Then only test the methods I override, and test the abstract methods in the unit tests for objects tha... | Unit testing abstract classes can be a bit tricky since they can't be instantiated directly. However, there are effective strategies you can use to ensure that both the abstract class and its concrete subclasses are thoroughly tested.
Here are some best practices for unit testing abstract classes and the concrete clas... | 41,239 | [
{
"from": "human",
"value": "I was wondering how to unit test abstract classes, and classes that extend abstract classes.\nShould I test the abstract class by extending it, stubbing out the abstract methods, and then test all the concrete methods? Then only test the methods I override, and test the abstract... |
When working with some open source projects (in my case Joomla and Moodle), I've often had to delve into the core code to make some alterations, but the problem is keeping track of these changes so I know which files to update on the production server, as well as which files to keep a special eye on when upgrading to a... | Yes, there are several strategies and tools you can use to track changes to a few files in large open source projects like Joomla or Moodle without the overhead of fully setting up a version control system. Here are some practical options:
### 1. **Local Version Control Systems**
While it may seem like overkill to use... | 43,255 | [
{
"from": "human",
"value": "When working with some open source projects (in my case Joomla and Moodle), I've often had to delve into the core code to make some alterations, but the problem is keeping track of these changes so I know which files to update on the production server, as well as which files to ... |
Say we have a TestClass with the 2 methods, -getSomeString and -getAnotherString, and we are editing the following code and the cursor is in the location shown:
NSString *aString = [TestClass get<cursorIsHere>SomeString];
Say I want to change it to use -getAnotherString. If I bring up the auto-completion popup and sel... | In many code editors and integrated development environments (IDEs), there are indeed specific keystrokes or settings that can help you replace the existing text when using auto-completion. While the exact behavior can vary by IDE, here are some general tips you can try based on popular editors:
1. **Xcode (for Object... | 42,991 | [
{
"from": "human",
"value": "Say we have a TestClass with the 2 methods, -getSomeString and -getAnotherString, and we are editing the following code and the cursor is in the location shown:\nNSString *aString = [TestClass get<cursorIsHere>SomeString];\n\nSay I want to change it to use -getAnotherString. If ... |
I have my WCF service defined as follows
[ServiceContract]
public interface IService1
{
[OperationContract]
IList GetMyTable();
[OperationContract]
void SendMyTable(List<RatePositions> ratePositions);
[OperationContract]
void SendString(string value);
}
When I call GetMyTabl... | The `404 Not Found` error you're encountering when calling the `SendMyTable(List<RatePositions> ratePositions)` method could be caused by several factors. Here are some potential reasons and solutions to troubleshoot the issue:
1. **Check Service Configuration**:
Ensure that your WCF service is correctly configured... | 41,349 | [
{
"from": "human",
"value": "I have my WCF service defined as follows\n [ServiceContract]\n public interface IService1\n {\n [OperationContract]\n IList GetMyTable();\n [OperationContract]\n void SendMyTable(List<RatePositions> ratePositions);\n\n [OperationContract]\n void... |
I have noticed jQuery (or is it Firefox) will turn some of my <span class="presentational"></span> into <span class="presentational" />
Now my question is, is this okay to write my markup like this? Will any browsers choke on it?
Personally, I think it looks cleaner to do <span class="presentational" /> if it's going t... | Using `<span class="presentational" />` as a self-closing tag is technically incorrect in HTML, even though it might be rendered correctly by some browsers. In HTML, the `<span>` element is a non-void element, meaning it is meant to have an opening tag and a closing tag. The correct syntax for an empty `<span>` is:
``... | 43,721 | [
{
"from": "human",
"value": "I have noticed jQuery (or is it Firefox) will turn some of my <span class=\"presentational\"></span> into <span class=\"presentational\" />\nNow my question is, is this okay to write my markup like this? Will any browsers choke on it?\nPersonally, I think it looks cleaner to do ... |
I have a sorted list that contains the column headers, how do I rearrange my datagridview so it is in the same order as my sorted list?
I've tried the code below but this doesn't always work, some columns are not sorted correctly. Thanks for any help with this.
sortedColumnNames.Sort();
foreach (DataGridViewColumn... | To rearrange the `DataGridView` columns according to a sorted list of column headers, you should ensure that you are properly setting the `DisplayIndex` for each column based on its position in the sorted list. The code you've provided should generally work, but it is important to handle cases where a column might not ... | 42,490 | [
{
"from": "human",
"value": "I have a sorted list that contains the column headers, how do I rearrange my datagridview so it is in the same order as my sorted list?\nI've tried the code below but this doesn't always work, some columns are not sorted correctly. Thanks for any help with this.\nsortedColumnNam... |
I'm using MDaemon as out mail server and the last days I get an error "554 Message does not conform to standards" for emails sent from one of the machines. Any idea what may be causing it? Other machines work fine.
More info....this is the log file:
Mon 2008-10-20 16:11:37: Session 7831; child 1; thread 3908
Mon 2008-... | The "554 Message does not conform to standards" error generally indicates that the email being sent is not adhering to the standards set by the Simple Mail Transfer Protocol (SMTP). Here are some potential reasons and steps to diagnose the issue:
1. **Malformed Email Headers**: The email headers may be malformed or in... | 43,250 | [
{
"from": "human",
"value": "I'm using MDaemon as out mail server and the last days I get an error \"554 Message does not conform to standards\" for emails sent from one of the machines. Any idea what may be causing it? Other machines work fine.\nMore info....this is the log file:\n\nMon 2008-10-20 16:11:37... |
I'm building a vanilla JSF app, and I'm having some difficulty understanding how forms work in this framework.
If I make a JavaScript form submission ...
document.myForm.submit();
... on this JSF form ...
<h:form id="myForm">
...
<h:commandButton value="Continue" action="#{foo.continueButton}"></h:commandButton>
<... | In a JSF (JavaServer Faces) application, forms and their associated actions are typically handled through JSF's component model rather than using traditional JavaScript form submission. When you use `document.myForm.submit();`, you're invoking the native HTML form submission behavior, which bypasses JSF's lifecycle and... | 41,970 | [
{
"from": "human",
"value": "I'm building a vanilla JSF app, and I'm having some difficulty understanding how forms work in this framework.\nIf I make a JavaScript form submission ...\ndocument.myForm.submit();\n\n... on this JSF form ...\n<h:form id=\"myForm\">\n ...\n <h:commandButton value=\"Continue\"... |
I remember that in the late 1990s and early 2000s Aspect Oriented Programming (AOP) was supposed to be the "Next Big Thing". Nowadays I see some AOP still around, but it seems to have faded into the background.
| You're correct that Aspect-Oriented Programming (AOP) gained significant attention in the late 1990s and early 2000s as a way to address cross-cutting concerns in software development, such as logging, security, and error handling. AOP provides a way to separate these concerns from the main business logic, which can le... | 42,572 | [
{
"from": "human",
"value": "I remember that in the late 1990s and early 2000s Aspect Oriented Programming (AOP) was supposed to be the \"Next Big Thing\". Nowadays I see some AOP still around, but it seems to have faded into the background.\n"
},
{
"from": "gpt",
"value": "You're correct that A... |
I'm just learning Perl.
When is it advisable to use OO Perl instead of non-OO Perl?
My tendency would be to always prefer OO unless the project is just a code snippet of < 10 lines.
TIA
| When learning and deciding between object-oriented (OO) Perl and non-OO Perl, there are several factors to consider. Here are some guidelines to help you determine when it's advisable to use OO Perl:
### When to Use OO Perl:
1. **Complexity and Scalability**: If your project is complex or likely to grow over time, us... | 41,486 | [
{
"from": "human",
"value": "I'm just learning Perl.\nWhen is it advisable to use OO Perl instead of non-OO Perl?\nMy tendency would be to always prefer OO unless the project is just a code snippet of < 10 lines.\nTIA\n"
},
{
"from": "gpt",
"value": "When learning and deciding between object-ori... |
I'm working on a sheet that accesses a legacy data source via MS Query. I'm trying to alias some of the ridiculously ugly column names but the data source doesn't support wrapping alias names with quotes. Since excel is automatically wrapping aliases in quotes the query errors/fails. I seem to be stuck.
How do I stop ... | In Excel, especially with older versions like Excel 2007, the automatic quoting of aliases in MS Query can be frustrating when working with data sources that don’t support them. Unfortunately, there's limited control over this behavior directly in the Excel interface or MS Query settings, particularly if you're looking... | 45,848 | [
{
"from": "human",
"value": "I'm working on a sheet that accesses a legacy data source via MS Query. I'm trying to alias some of the ridiculously ugly column names but the data source doesn't support wrapping alias names with quotes. Since excel is automatically wrapping aliases in quotes the query errors/f... |
using ASP.NET I need to update an excel template.
Our server is running Windows 2008 in 64 bit mode.
I am using the following code to access the excel file:
...
string connection =
@"Provider=MSDASQL;Driver={Microsoft Excel Driver (*.xls)};DBQ=" + path + ";";
...
IF the application pool is set to Enable 3... | This issue arises from the fact that you're trying to mix 32-bit and 64-bit components in your ASP.NET application. The Excel OLE DB driver you are using (`Microsoft Excel Driver (*.xls)`) is only available in 32-bit, while your Oracle driver is only available in 64-bit. To resolve this, you have a few potential soluti... | 43,590 | [
{
"from": "human",
"value": "using ASP.NET I need to update an excel template.\nOur server is running Windows 2008 in 64 bit mode.\nI am using the following code to access the excel file:\n ...\n string connection = \n@\"Provider=MSDASQL;Driver={Microsoft Excel Driver (*.xls)};DBQ=\" + path + \";\";\n... |
This question comes up occasionally, but I haven't seen a satisfactory answer.
A typical pattern is (row is a DataRow):
if (row["value"] != DBNull.Value)
{
someObject.Member = row["value"];
}
My first question is which is more efficient (I've flipped the condition):
row["value"] == DBNull.Value; // Or
row... | Your exploration of performance regarding `DBNull` checks and caching in a `DataRow` context is quite insightful. Let's address your questions one at a time.
### 1. Efficiency of Checking for `DBNull`
Based on your benchmarking, here's what we can summarize about the different methods to check for `DBNull`:
- `row["... | 43,941 | [
{
"from": "human",
"value": "This question comes up occasionally, but I haven't seen a satisfactory answer.\nA typical pattern is (row is a DataRow):\n if (row[\"value\"] != DBNull.Value)\n {\n someObject.Member = row[\"value\"];\n }\n\nMy first question is which is more efficient (I've flipped the con... |
I am trying to put some distributed caching into play, I'm using this indeXus.Net Shared Cache .
It Requires that the object being cached is serializable, which it is here is the class object.
[Serializable]
public class Members
{
public Members()
{}
public Members(string aspnetusername, string aspnetpass... | The issue you're encountering is related to the `LazyList<T>` class or the specific LINQ-to-SQL data type being used for your properties within the `Members` class. The error message indicates that a type derived from `System.Data.Linq.DataQuery<T>` is not serializable.
Here's a breakdown of the problem and some poten... | 36,698 | [
{
"from": "human",
"value": "I am trying to put some distributed caching into play, I'm using this indeXus.Net Shared Cache .\nIt Requires that the object being cached is serializable, which it is here is the class object.\n[Serializable]\npublic class Members \n{\n public Members()\n {}\n\n public... |
What is the preferred naming convention for Django model classes?
| In Django, the preferred naming convention for model classes is to use the **PascalCase** (also known as CamelCase) format. This means that each word in the class name starts with a capital letter and there are no underscores or spaces. Additionally, model class names are typically singular to represent a single instan... | 48,369 | [
{
"from": "human",
"value": "What is the preferred naming convention for Django model classes?\n"
},
{
"from": "gpt",
"value": "In Django, the preferred naming convention for model classes is to use the **PascalCase** (also known as CamelCase) format. This means that each word in the class name ... |
I need to convert a passed in argument (single object or collection) to an Array. I don't know what the argument is. If it is an Array already, I want to leave it, otherwise create a one-element array from it. I'm looking to allow both method(:objs => obj) and method(:objs => [obj1, obj2])
This seems to be the best way... | You're correct that using `Array#to_a` is a common pattern for converting a single object or a collection into an array. However, since `Object#to_a` is being deprecated, you can achieve the same goal without using it.
The idiomatic way to convert an argument to an array in Ruby is to use the `Array()` method. This me... | 48,378 | [
{
"from": "human",
"value": "I need to convert a passed in argument (single object or collection) to an Array. I don't know what the argument is. If it is an Array already, I want to leave it, otherwise create a one-element array from it. I'm looking to allow both method(:objs => obj) and method(:objs => [o... |
I have a C++ DLL including bitmap resources created by Visual Studio.
Though I can load the DLL in VB6 using LoadLibrary, I cannot load the image resources either by using LoadImage or by using LoadBitmap. When I try to get the error using GetLastError(), it doesnot return any errors.
I have tried using LoadImage and L... | When working with bitmap resources in a C++ DLL and trying to access them from VB6, there are a few considerations to keep in mind to ensure that everything works correctly. Here are some suggestions to help you troubleshoot and access the bitmap resources:
### 1. Check Resource Identifiers
Make sure you are using the... | 41,909 | [
{
"from": "human",
"value": "I have a C++ DLL including bitmap resources created by Visual Studio.\nThough I can load the DLL in VB6 using LoadLibrary, I cannot load the image resources either by using LoadImage or by using LoadBitmap. When I try to get the error using GetLastError(), it doesnot return any ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.