instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
if i have a standard ASP.NET application, is there any difference between making an object static as opposed to putting the object instance in the Application state?
from my understanding, both objects exist ONCE for the app domain.
Secondly, what happens if you have a static object in a referenced dll, for an ASP.NET ... | Great questions! In ASP.NET applications, understanding the difference between static members and Application state is crucial for effective resource management and application design. Let's explore both concepts.
### Static vs. Application State
1. **Static Members**:
- A static member (like a static class or sta... | 47,807 | [
{
"from": "human",
"value": "if i have a standard ASP.NET application, is there any difference between making an object static as opposed to putting the object instance in the Application state?\nfrom my understanding, both objects exist ONCE for the app domain.\nSecondly, what happens if you have a static ... |
Hey, I am trying to write a command to print todays date on the front page of a report using the textsc command, but the today date capitalize December.
Any help will be appreciated.
| To print today's date on the front page of a report using LaTeX, while ensuring the month is capitalized (specifically for December), you can use the `textsc` command in conjunction with the `datetime` or `date` packages. Here’s a simple way to achieve this:
1. Ensure you have the `datetime` package in your preamble.
... | 48,604 | [
{
"from": "human",
"value": "Hey, I am trying to write a command to print todays date on the front page of a report using the textsc command, but the today date capitalize December.\nAny help will be appreciated.\n"
},
{
"from": "gpt",
"value": "To print today's date on the front page of a repor... |
I need a collection that works just like a Dictionary/Hashtable in a sense that it will only contain 1 instance of a given object at any time. A generic class would be preferable, but I'll take what I can get. Does this collection live somewhere in the framework?
| In the .NET Framework, there isn't a built-in collection that specifically enforces uniqueness of object instances as you describe, like a combination of a dictionary and a set. However, you can achieve this behavior using a `HashSet<T>`, which is designed to store unique elements, combined with a dictionary if you wan... | 45,958 | [
{
"from": "human",
"value": "I need a collection that works just like a Dictionary/Hashtable in a sense that it will only contain 1 instance of a given object at any time. A generic class would be preferable, but I'll take what I can get. Does this collection live somewhere in the framework?\n"
},
{
... |
I am working on a database that usually uses GUIDs as primary keys.
By default SQL Server places a clustered index on primary key columns. I understand that this is a silly idea for GUID columns, and that non-clustered indexes are better.
What do you think - should I get rid of all the clustered indexes and replace the... | Using GUIDs (Globally Unique Identifiers) as primary keys in SQL Server can indeed lead to performance issues when a clustered index is placed on them. This is primarily because GUIDs are random and can result in fragmented indexes, causing inefficient disk I/O and poor performance for insert operations as SQL Server c... | 48,283 | [
{
"from": "human",
"value": "I am working on a database that usually uses GUIDs as primary keys.\nBy default SQL Server places a clustered index on primary key columns. I understand that this is a silly idea for GUID columns, and that non-clustered indexes are better.\nWhat do you think - should I get rid o... |
I am looking for a custom control which could enable me to call message of following type.
http://extjs.com/deploy/dev/examples/message-box/msg-box.html
Is there a control which function like a .NET desktop application messagebox?
I know, exactly similar may not be possible but main features I am looking for here is re... | Creating a custom message box in Ext JS that behaves similarly to a .NET desktop application message box is definitely achievable. While Ext JS provides built-in components for dialogs and message boxes, you may want to extend them or create your own custom implementation to meet your specific needs.
### Step-by-Step ... | 49,251 | [
{
"from": "human",
"value": "I am looking for a custom control which could enable me to call message of following type.\nhttp://extjs.com/deploy/dev/examples/message-box/msg-box.html\nIs there a control which function like a .NET desktop application messagebox?\nI know, exactly similar may not be possible b... |
I am working on an ASP.NET MVC application where I need to export data to an excel spreadsheet. Previously, in webforms apps, I used some code I found to render a GridView as an excel-compatible file. This was quite handy. I was wondering what the quickest/most effective method would be to do this in MVC. Thanks.
| Exporting data to Excel in an ASP.NET MVC application can be accomplished in several ways. Below, I will detail a straightforward method using the `EPPlus` library, which is widely used for generating Excel files in .NET applications, and it allows for a more robust solution than simply rendering HTML as an Excel file.... | 46,272 | [
{
"from": "human",
"value": "I am working on an ASP.NET MVC application where I need to export data to an excel spreadsheet. Previously, in webforms apps, I used some code I found to render a GridView as an excel-compatible file. This was quite handy. I was wondering what the quickest/most effective metho... |
In my Spring MVC based applications i use Freemarker and i like it very much, but it's lacking advantages provided by Composite View pattern.
I'm thinking of trying to use Tiles2 together with Freemarker - does anyone know where do i find a simple example of SpringMVC together with Tiles2+Freemarker?
| Using Apache Tiles with Spring MVC and FreeMarker is a great way to implement the Composite View pattern, allowing you to create reusable templates and layouts. Below is a simple example to help you set up Spring MVC with Tiles2 and FreeMarker.
### Step 1: Maven Dependencies
Make sure you have the required dependenci... | 42,224 | [
{
"from": "human",
"value": "In my Spring MVC based applications i use Freemarker and i like it very much, but it's lacking advantages provided by Composite View pattern. \nI'm thinking of trying to use Tiles2 together with Freemarker - does anyone know where do i find a simple example of SpringMVC together... |
I have 2 objects, both from different Model classes, and want to show a form containing some fields from each one. How can I do this?
| To display a form containing fields from two different model classes in a web application, you typically have a few different approaches depending on the framework or language you are using. Here's a general approach that you can adapt to your specific context. I'll illustrate this using a common MVC framework pattern,... | 44,925 | [
{
"from": "human",
"value": "I have 2 objects, both from different Model classes, and want to show a form containing some fields from each one. How can I do this?\n"
},
{
"from": "gpt",
"value": "To display a form containing fields from two different model classes in a web application, you typic... |
I'm getting the error in the subject line. I'm running vs2k8 on server 2k3sp2. I've tried deleting the pdbs, cache directories, verifying that debugging is set up on the specific page. The interesting thing is other pages debug just fine. Just when I go to this one page. Must be a configuration issue but the page direc... | It sounds like you're experiencing a challenging debugging issue in your ASP.NET application with Visual Studio 2008. Here are several suggestions you can try to help resolve the problem with the specific page not debugging properly:
### 1. Check Compilation Mode
Ensure that your ASP.NET web application is set to comp... | 49,709 | [
{
"from": "human",
"value": "I'm getting the error in the subject line. I'm running vs2k8 on server 2k3sp2. I've tried deleting the pdbs, cache directories, verifying that debugging is set up on the specific page. The interesting thing is other pages debug just fine. Just when I go to this one page. Must be... |
I have a windows service that runs fine, but I have to have it run under a special user account.
Currently I go into services and change the logon as section, but for deployment this has to be done more professionally.
Is there a way for me to have it logon as a custom user account programatically, or during the instal... | Yes, you can configure a Windows service to run under a custom user account programmatically during the installation process. There are several ways to achieve this, but a common method is to use the **InstallShield** or **WiX Toolset** for creating installers, or you can write a custom installer using `System.Configur... | 49,525 | [
{
"from": "human",
"value": "I have a windows service that runs fine, but I have to have it run under a special user account.\nCurrently I go into services and change the logon as section, but for deployment this has to be done more professionally.\nIs there a way for me to have it logon as a custom user ac... |
A bit of a neophyte haskell question, but I came across this example in Haskell's tutorial examples. For "find the last element of a list" there are some obvious versions, like
last' [x] = x
last' (_:xs) = last' xs
But I can't make sense of an alternate version presented:
myLast' = foldr1 (const id)
So, in trying ... | Let's break down the provided Haskell expression `myLast' = foldr1 (const id)` and clarify how it works and how the `const` function interacts with `id`.
First, we need to understand what `foldr1` does. The `foldr1` function takes a binary function and a non-empty list, and it folds (reduces) the list from the right u... | 45,181 | [
{
"from": "human",
"value": "A bit of a neophyte haskell question, but I came across this example in Haskell's tutorial examples. For \"find the last element of a list\" there are some obvious versions, like \nlast' [x] = x\nlast' (_:xs) = last' xs\n\nBut I can't make sense of an alternate version presente... |
How can I access the apache basic-auth username in a PHP script?
| To access the Apache basic authentication username in a PHP script, you can use the `$_SERVER` superglobal array. When Apache is configured to use basic authentication, it populates certain server variables that can be accessed in your PHP code. Specifically, the username can be accessed via the `PHP_AUTH_USER` variabl... | 49,628 | [
{
"from": "human",
"value": "How can I access the apache basic-auth username in a PHP script?\n"
},
{
"from": "gpt",
"value": "To access the Apache basic authentication username in a PHP script, you can use the `$_SERVER` superglobal array. When Apache is configured to use basic authentication, ... |
So I've return View(object);'d, and I press submit on that page, how do I get that object back in the controller? any ideas?
my viewpage is
public partial class Index : ViewPage<List<Models.Pricing>>
and
public ActionResult Index(int id, FormCollection datesForm,
[Bind(Prefix="")]List... | When you're returning a view with a model in ASP.NET MVC, and then submitting that form back to the controller, you need to ensure that your model is properly bound back to the controller action. Based on your provided code, it looks like you're trying to pass a list of `Pricing` models from your view back to your cont... | 44,847 | [
{
"from": "human",
"value": "So I've return View(object);'d, and I press submit on that page, how do I get that object back in the controller? any ideas?\nmy viewpage is\npublic partial class Index : ViewPage<List<Models.Pricing>>\n\nand \n public ActionResult Index(int id, FormCollection datesForm,\n ... |
I'm writing some data analysis software and decided to use such approach:
epn:
model/data.py <- Model definition
model/reader.py <- How to read data into model
view/gui.py <- main gui frame (wx)
view/dialogs.py <- different dialogs (wx)
epn.py <- controller
For communication between gui and data I used wx.lib.pubsub. S... | Hi Chriss,
Your approach to structuring the data analysis software looks well-organized, and it's great that you are considering both encapsulation and testability in your design choices. Let's break down the trade-offs between the two implementations of `getModulationIndex` that you've presented.
### Option 1: Encap... | 48,624 | [
{
"from": "human",
"value": "I'm writing some data analysis software and decided to use such approach:\nepn:\nmodel/data.py <- Model definition\nmodel/reader.py <- How to read data into model\nview/gui.py <- main gui frame (wx)\nview/dialogs.py <- different dialogs (wx)\nepn.py <- controller\nFor communicat... |
As a glutton for unproven sexy techniques I've adopted System.Web.Routing in my Web Forms application to manage navigation and such. Further, I'm hoping to move role-based security from web.config to the route definitions itself so I can say "this route is only available to roles x, y".
So I've got the class that impl... | In your custom `IRouteHandler` implementation, if the user is not in the allowed roles, you can perform a redirect to the login page by using the `HttpResponse` object available in the `RequestContext`. You can utilize the `Response.Redirect` method to redirect the user and include the "return to" parameter in the quer... | 44,895 | [
{
"from": "human",
"value": "As a glutton for unproven sexy techniques I've adopted System.Web.Routing in my Web Forms application to manage navigation and such. Further, I'm hoping to move role-based security from web.config to the route definitions itself so I can say \"this route is only available to rol... |
JBoss 5 has just come out of beta after 2 years, giving us a Java EE 5 compliant container several months before the release of Java EE 6 (JavaOne in May or thereabouts 2009). We've had GlassFish v2 for awhile and now have GlassFish v3 Prelude.
Is there any reason to JBoss 5 over these? I've had the feeling for the l... | JBoss 5, released in 2009, was indeed significant as it brought a Java EE 5 compliant application server to the market. It provided a robust platform for enterprise applications and was widely used in various projects. However, the landscape of Java application servers has evolved considerably since then, especially wi... | 47,435 | [
{
"from": "human",
"value": "JBoss 5 has just come out of beta after 2 years, giving us a Java EE 5 compliant container several months before the release of Java EE 6 (JavaOne in May or thereabouts 2009). We've had GlassFish v2 for awhile and now have GlassFish v3 Prelude.\nIs there any reason to JBoss 5 o... |
Our whole system is being designed around REST and are now considering how processes which are quite clearly RPC in intent can be mapped to RESTful resources without using verbs in the URL. Our remote procedure call is used to rebuild our search index when a content listing has been modified elsewhere.
What we are thin... | Hi Chris,
Your scenario is a common challenge when transitioning from RPC-style APIs to a RESTful design. Let's break down the considerations you’ve raised regarding RESTfulness and your specific use case of updating an index.
### RESTful Principles
1. **Resources vs. Actions**: In REST, everything is centered aroun... | 48,354 | [
{
"from": "human",
"value": "Our whole system is being designed around REST and are now considering how processes which are quite clearly RPC in intent can be mapped to RESTful resources without using verbs in the URL. Our remote procedure call is used to rebuild our search index when a content listing has ... |
Is it possible to build a good medium to full sized application using just silverlight as a host?
A few things that would be needed:
- dynamic pages (one silverlight "screen" can switch between screens, like a normal app.
- similar to a java applet which launches from the browser
I see that Telerik sells RadControls fo... | Silverlight, which was developed by Microsoft, was designed as a browser plugin that enabled developers to create rich internet applications (RIAs) with features similar to Adobe Flash. However, as of October 2021, Microsoft officially ended support for Silverlight, which raises several considerations for building appl... | 49,681 | [
{
"from": "human",
"value": "Is it possible to build a good medium to full sized application using just silverlight as a host?\nA few things that would be needed:\n- dynamic pages (one silverlight \"screen\" can switch between screens, like a normal app.\n- similar to a java applet which launches from the b... |
Can anyone think of a good solution for getting IOC into a console application?
At the moment we are just using a static class with the following method:
public static T Resolve<T>()
{
return dependencyResolver.Resolve<T>();
}
I would like the experience to be seamless but cannot think of a way of achieving this f... | In a console application, managing Inversion of Control (IoC) and Dependency Injection (DI) can indeed be a bit different from traditional web applications, mainly due to the lack of a built-in framework for handling the lifecycle of components and dependencies. However, you can create a seamless experience for resolvi... | 42,997 | [
{
"from": "human",
"value": "Can anyone think of a good solution for getting IOC into a console application?\nAt the moment we are just using a static class with the following method:\npublic static T Resolve<T>()\n{\n return dependencyResolver.Resolve<T>();\n}\n\nI would like the experience to be seamle... |
Once it is compiled, is there a difference between:
delegate { x = 0; }
and
() => { x = 0 }
?
| Yes, there is a difference between the two constructs you've mentioned: `delegate { x = 0; }` and `() => { x = 0; }`.
1. **Delegate (Anonymous Method)**:
- `delegate { x = 0; }` is an example of an anonymous method in C#.
- It creates an instance of a delegate type that can encapsulate a method (in this case,... | 44,309 | [
{
"from": "human",
"value": "Once it is compiled, is there a difference between:\ndelegate { x = 0; }\n\nand\n() => { x = 0 }\n\n?\n"
},
{
"from": "gpt",
"value": "Yes, there is a difference between the two constructs you've mentioned: `delegate { x = 0; }` and `() => { x = 0; }`. \n\n1. **Deleg... |
Say I wanted to have a project, and one-to-many with to-do items, and wanted to re-order the to-do items arbitrarily?
In the past, I've added a numbered order field, and when someone wants to change the order, had to update all the items with their new order numbers. This is probably the worst approach, since it's no... | When dealing with a one-to-many relationship like projects and to-do items, and needing to allow for arbitrary reordering of the to-do items, there are several approaches you can consider. Here are a few common strategies, along with their pros and cons:
### 1. **Using an Integer Order Field with Shifts**
This is the... | 49,609 | [
{
"from": "human",
"value": "Say I wanted to have a project, and one-to-many with to-do items, and wanted to re-order the to-do items arbitrarily? \nIn the past, I've added a numbered order field, and when someone wants to change the order, had to update all the items with their new order numbers. This is ... |
I am quite confused by looking at the boost library, and stl, and then looking at people's examples. It seems that capitalized type names are interspersed with all lowercase, separated by underscores.
What exactly is the way things should be done these days? I know the .NET world has their own set of conventions, but i... | In C++, there is a lack of a universally accepted naming convention, and practices can vary across libraries, frameworks, and even individual developers. That said, there are some common conventions that have emerged within the C++ community, and understanding these can help you write code that is more consistent and r... | 49,856 | [
{
"from": "human",
"value": "I am quite confused by looking at the boost library, and stl, and then looking at people's examples. It seems that capitalized type names are interspersed with all lowercase, separated by underscores.\nWhat exactly is the way things should be done these days? I know the .NET wor... |
I see that in the SQL Server Reporting Services 2005 Report Manager there is the capability to schedule reports for specific times (i.e. every weekday at a particular time).
What I would like though is more control -- i.e. every weekday, but only between certain dates of the year -- for example, getting sales figure... | In SQL Server Reporting Services (SSRS) 2005, scheduling reports is somewhat limited in terms of flexibility for specific date ranges. However, you can achieve your requirement of scheduling reports for every weekday between certain dates by following these steps:
### Option 1: Use a Custom SQL Query
1. **Create a Da... | 48,018 | [
{
"from": "human",
"value": "I see that in the SQL Server Reporting Services 2005 Report Manager there is the capability to schedule reports for specific times (i.e. every weekday at a particular time). \nWhat I would like though is more control -- i.e. every weekday, but only between certain dates of the ... |
I have a problem. I built a script to make a request to an internal link that sends back a response. This is what the script looks like:
jQuery.get(callUrl, function(data) {
console.log(typeof data);
jQuery.each(data.items, function(i, item) {
console.log(i);
});
}, 'json');
and the response that the server... | The issue you're experiencing likely stems from the way the server is sending the JSON response and how jQuery is interpreting it based on the `Content-Type` header.
Here are a few points to consider and troubleshoot your problem:
1. **Content-Type Header**: While you mentioned that your server is sending the same `C... | 49,455 | [
{
"from": "human",
"value": "I have a problem. I built a script to make a request to an internal link that sends back a response. This is what the script looks like:\njQuery.get(callUrl, function(data) {\n console.log(typeof data);\n jQuery.each(data.items, function(i, item) {\n\n console.log(i);\n })... |
I want to open a save file dialog, have the user enter a filename, and if they forget the .csv extension, have it tacked on.
It would seem that the SaveFileDialog AddExtension property would work, but its doesn't. I've even set the DefaultExt property to .csv, and still nothing gets tacked on. My file gets saved just f... | The `SaveFileDialog` class in Windows Forms can help you easily prompt the user for a filename, and you can ensure that the `.csv` extension is appended if the user doesn't include it. However, it seems you may have a small misunderstanding with the `DefaultExt` and `Filter` properties.
Here’s how you can make sure t... | 49,584 | [
{
"from": "human",
"value": "I want to open a save file dialog, have the user enter a filename, and if they forget the .csv extension, have it tacked on.\nIt would seem that the SaveFileDialog AddExtension property would work, but its doesn't. I've even set the DefaultExt property to .csv, and still nothing... |
The last GUI programming I have done was with Visual Basic, which included objects like Winsock and Inet to easily connect to the internet and retrieve the source from webpages.
I just got started into XCode, and was wondering if there is a similar component. I see that there is a Webkit option in the Library, but I ha... | Certainly! If you're coming from a Visual Basic background and are looking to replicate similar functionality for internet connectivity and web page retrieval in Xcode, using the WebKit framework is indeed a good choice. WebKit is a powerful rendering engine that can handle web content, including HTML, CSS, and JavaScr... | 47,922 | [
{
"from": "human",
"value": "The last GUI programming I have done was with Visual Basic, which included objects like Winsock and Inet to easily connect to the internet and retrieve the source from webpages.\nI just got started into XCode, and was wondering if there is a similar component. I see that there i... |
Do you have pseudocode for field validation of the following items in the UK? I am from the USA, so I only know the ones in the USA right now.
Address Line 1
Phone Number
Mobile Number (in case they have a special rule for this, which they might not)
Post Code
| Certainly! Below is the pseudocode for field validation of address line 1, phone number, mobile number, and post code in the UK context. Each field will have its own set of validation rules.
### Pseudocode for Field Validation
```plaintext
FUNCTION validateAddressLine1(addressLine1):
IF addressLine1 IS EMPTY THE... | 44,528 | [
{
"from": "human",
"value": "Do you have pseudocode for field validation of the following items in the UK? I am from the USA, so I only know the ones in the USA right now.\n\nAddress Line 1\nPhone Number\nMobile Number (in case they have a special rule for this, which they might not)\nPost Code\n\n"
},
... |
I am currently playing around with the HybridSessionBuilder class found on Jeffrey Palermo's blog post:
http://jeffreypalermo.com/blog/use-this-nhibernate-wrapper-to-keep-your-repository-classes-simple/
Using this class, my repository looks like this:
public class UserRepository : IUserRepository
{
private readonly... | Your current implementation of the `UserRepository` and the use of `ISessionBuilder` to manage the NHibernate session is a common approach, but it's important to understand its implications and potential pitfalls, especially in the context of a web application.
### Key Considerations
1. **Session Management**:
- I... | 45,027 | [
{
"from": "human",
"value": "I am currently playing around with the HybridSessionBuilder class found on Jeffrey Palermo's blog post:\nhttp://jeffreypalermo.com/blog/use-this-nhibernate-wrapper-to-keep-your-repository-classes-simple/\nUsing this class, my repository looks like this:\npublic class UserReposit... |
I would like to have an app include a custom font for rendering text, load it, and then use it with standard UIKit elements like UILabel. Is this possible?
| Yes, it is definitely possible to include a custom font in your iOS app and use it with standard UIKit elements like `UILabel`. Here’s how you can do it step by step:
### Step 1: Add the Custom Font to Your Project
1. **Obtain the Font File**: Get the custom font file you wish to use (usually in `.ttf` or `.otf` form... | 47,164 | [
{
"from": "human",
"value": "I would like to have an app include a custom font for rendering text, load it, and then use it with standard UIKit elements like UILabel. Is this possible?\n"
},
{
"from": "gpt",
"value": "Yes, it is definitely possible to include a custom font in your iOS app and us... |
My page has two components that depend on JavaScript. On the left-hand side, there is attribute-based navigation (abn). And the right-hand side is the Result of the abn.
There is an event handler for abn and an event handler for the result (both are on clicks)
Whenever the user clicks on the abn, I do an Ajax call whic... | The behavior you are experiencing is a common issue related to event delegation and how JavaScript binds event handlers to DOM elements.
When you bind an event handler to elements, those handlers are only attached to the elements that exist in the DOM at the time the JavaScript runs. When you make an Ajax call and rep... | 44,258 | [
{
"from": "human",
"value": "My page has two components that depend on JavaScript. On the left-hand side, there is attribute-based navigation (abn). And the right-hand side is the Result of the abn.\nThere is an event handler for abn and an event handler for the result (both are on clicks)\nWhenever the use... |
I have a Tab bar bases project (along with navigation control), inside a particular tab there is a tableViewLoaded , when i click on the table rows it shoud open another view , ie it pushes another controller , i have a view controller in the MainWindow.nib for this view also with some items like buttons labels , but w... | It sounds like you're working with a tab bar application that contains a table view, and upon selecting a row in the table view, you want to push another view controller but are encountering a blank page instead of the expected content. Let's walk through some common issues that could cause this behavior and how to res... | 44,021 | [
{
"from": "human",
"value": "I have a Tab bar bases project (along with navigation control), inside a particular tab there is a tableViewLoaded , when i click on the table rows it shoud open another view , ie it pushes another controller , i have a view controller in the MainWindow.nib for this view also wi... |
Everyday I receive thousands of emails and I want to parse the content/body of these emails to load them into a database.
My problem is that nowadays I am parsing the email body manually and I would like to change the logic to a Regular Expression in C#.
Here is the body of the emails:
Gentilissima Agenzia Nexity Resi... | To parse the body of the email and extract the relevant fields using Regular Expressions in C#, you can create a pattern that matches each line of interest. Based on the email structure you provided, you can extract the user's name, email, phone number, and other characteristics related to the property they are looking... | 45,526 | [
{
"from": "human",
"value": "Everyday I receive thousands of emails and I want to parse the content/body of these emails to load them into a database.\nMy problem is that nowadays I am parsing the email body manually and I would like to change the logic to a Regular Expression in C#.\nHere is the body of th... |
I'm having troubles finding resources on the net on how to create a plugin for IE (6 & 7). Do you happen to know good sites/tutorials on this subject?
BTW, here's why I want to do this: we have a web app here that's linked with another; i.e. when on a certain page, you could launch a bookmarklet (bookmark with javascri... | Creating a plugin for Internet Explorer 6 and 7 can be quite challenging given their age and the limited resources available. However, here’s a brief outline of how you might approach this project, along with some suggestions for resources.
### Creating an IE Plugin
1. **Understand the Plugin Architecture**:
- IE ... | 49,885 | [
{
"from": "human",
"value": "I'm having troubles finding resources on the net on how to create a plugin for IE (6 & 7). Do you happen to know good sites/tutorials on this subject?\nBTW, here's why I want to do this: we have a web app here that's linked with another; i.e. when on a certain page, you could la... |
I have written a game that uses GLUT, OpenGL and FMOD. The problem is that the binary won't run, unless Visual Studio 2008 is installed on the computer.
Why is this?
| The issue you're experiencing is likely related to the Visual C++ runtime libraries that your application relies on. When you compile a program in Visual Studio, it links to specific versions of the C runtime libraries. If these libraries are not present on the system where you are trying to run the binary, the program... | 44,669 | [
{
"from": "human",
"value": "I have written a game that uses GLUT, OpenGL and FMOD. The problem is that the binary won't run, unless Visual Studio 2008 is installed on the computer.\nWhy is this?\n"
},
{
"from": "gpt",
"value": "The issue you're experiencing is likely related to the Visual C++ r... |
I want to gather data from different data servers located in Europe and Asia. Rather than running a plain data query task that will clog up the undersea network I am thinking of a couple of machines that will be available for me at the local sites.
I am thinking to design the master package so that I can:
run remote s... | To simplify and enhance the robustness of your design for gathering data from different servers in Europe and Asia, you can consider the following approaches:
### 1. **Centralized Configuration Management**
- **Use Configuration Files:** Instead of hardcoding parameters in your script, use configuration files (e.g., J... | 45,112 | [
{
"from": "human",
"value": "I want to gather data from different data servers located in Europe and Asia. Rather than running a plain data query task that will clog up the undersea network I am thinking of a couple of machines that will be available for me at the local sites.\nI am thinking to design the m... |
I have a listbox control. I have created an ItemTemplate for this listbox which has two controls within it.
Toggle Button
Listbox Control
Structure
<Listbox x:Key="Listbox1" ItemTemplate={StaticResource ListBox1ParentItemTemplate}>
</Listbox>
<Datatemplate x:Key="ListBox1ParentItemTemplate">
<ToggleButton></Tog... | To achieve the functionality you described with your ListBox and ToggleButton setup in WPF, you need to implement a few things:
1. **Data Binding**: Bind the `ToggleButton` to the selected item in `ListBox1`.
2. **Event Handling**: Add event handlers to manage the interactions between `ToggleButton` and `CheckBox` con... | 40,968 | [
{
"from": "human",
"value": "I have a listbox control. I have created an ItemTemplate for this listbox which has two controls within it.\n\nToggle Button\nListbox Control\n\nStructure\n<Listbox x:Key=\"Listbox1\" ItemTemplate={StaticResource ListBox1ParentItemTemplate}>\n\n</Listbox>\n\n<Datatemplate x:Key=... |
Extension method is a really helpful feature that you can add a lot of functions you want in any class. But I am wondering if there is any disadvantage that might bring troubles to me. Any comments or suggestions?
| Extension methods in C# are indeed a powerful feature that allows developers to add new methods to existing types without modifying the original type or creating a new derived type. However, while they offer a lot of flexibility, there are some potential disadvantages and considerations to keep in mind:
1. **Namespace... | 49,878 | [
{
"from": "human",
"value": "Extension method is a really helpful feature that you can add a lot of functions you want in any class. But I am wondering if there is any disadvantage that might bring troubles to me. Any comments or suggestions?\n"
},
{
"from": "gpt",
"value": "Extension methods in... |
My code opens more than 256 file handles, So When I run it on solaris machines I am ending up in "Exceeding file handlers limit" error.
I have two questions regarding this
1) Is this limit is only for 32 bit softwares or 64 bit softwares also suffer from it. I googled about it and came to know that 64 bit softwares do... | Hi D. L. Kumar,
Let's address your questions one at a time:
### 1. File Handle Limit on 32-bit vs. 64-bit Software
The limitation on file descriptors you mentioned (256 in this case) is not strictly related to whether the software is 32-bit or 64-bit. The file descriptor limit is often tied to the system configuratio... | 48,876 | [
{
"from": "human",
"value": "My code opens more than 256 file handles, So When I run it on solaris machines I am ending up in \"Exceeding file handlers limit\" error. \nI have two questions regarding this\n1) Is this limit is only for 32 bit softwares or 64 bit softwares also suffer from it. I googled about... |
My question revolves around CSS Fixed Layout vs a Float Layout that extends to fill the width of the browser.
Right now the issue I'm running into is to have the masthead resize depending on the width of the page (something that I understand isn't possible given current browser implementation of CSS3's background-image... | When deciding between a fixed layout and a float-based layout that fills the browser width, there are several factors to consider, including design requirements, user experience, and responsiveness. Let's break down the two approaches and their pros and cons.
### Fixed Layout
#### Pros:
1. **Consistency**: Fixed layo... | 46,075 | [
{
"from": "human",
"value": "My question revolves around CSS Fixed Layout vs a Float Layout that extends to fill the width of the browser.\nRight now the issue I'm running into is to have the masthead resize depending on the width of the page (something that I understand isn't possible given current browser... |
I need to do transactions (begin, commit or rollback), locks (select for update).
How can I do it in a document model db?
Edit:
The case is this:
I want to run an auctions site.
And I think how to direct purchase as well.
In a direct purchase I have to decrement the quantity field in the item record, but only if the q... | CouchDB is a document-oriented NoSQL database that follows the principles of eventual consistency and doesn't natively support transactions and locking mechanisms like traditional relational databases do. However, you can implement patterns that approximate the functionality you need for your auction site, particularly... | 44,607 | [
{
"from": "human",
"value": "I need to do transactions (begin, commit or rollback), locks (select for update).\nHow can I do it in a document model db?\nEdit:\nThe case is this:\n\nI want to run an auctions site.\nAnd I think how to direct purchase as well.\nIn a direct purchase I have to decrement the quan... |
The code below always return an empty array from GetModifiedMembers(object)
but dx.GetChangeSet().Updates.Contains( foo ) returns true.
DataContext dx = new DataContext( string.Empty );
MockLinqDataObject foo = new MockLinqDataObject();
dx.GetTable( foo.GetType() ).Attach( foo );
foo.PK = Guid.NewGuid();
// always re... | The issue you're experiencing with the `GetModifiedMembers(object)` method returning an empty array while `dx.GetChangeSet().Updates.Contains(foo)` returns true is likely due to the way LINQ to SQL tracks changes to attached objects. Here are a few points to consider that might help resolve the issue:
1. **Attaching v... | 41,282 | [
{
"from": "human",
"value": "The code below always return an empty array from GetModifiedMembers(object)\nbut dx.GetChangeSet().Updates.Contains( foo ) returns true.\nDataContext dx = new DataContext( string.Empty );\nMockLinqDataObject foo = new MockLinqDataObject();\ndx.GetTable( foo.GetType() ).Attach( f... |
I am newbie to Spring Webflow, I have am using Custom FlowHandler
I can reach the respective Controller, but if set an attribute in a request Object I don't get it in JSP that is View state.
How can I proceed in this?
| When using Spring Web Flow, managing the flow of data between your controller and the JSP view can be a little different than traditional Spring MVC. In Spring Web Flow, instead of adding attributes directly to the request object, you work with the flow scope, view scope, and other scoped variables provided by the fram... | 48,871 | [
{
"from": "human",
"value": "I am newbie to Spring Webflow, I have am using Custom FlowHandler \nI can reach the respective Controller, but if set an attribute in a request Object I don't get it in JSP that is View state.\nHow can I proceed in this?\n"
},
{
"from": "gpt",
"value": "When using Sp... |
For one of the projects I'm doing right now, I need to look at the performance (amongst other things) of different concurrent enabled programming languages.
At the moment I'm looking into comparing stackless python and C++ PThreads, so the focus is on these two languages, but other languages will probably be tested lat... | When benchmarking concurrent programming languages, especially Stackless Python and C++ with PThreads, you'll want to select a problem that effectively demonstrates the strengths and weaknesses of each language's concurrency model. Here are some suggestions for problems that can serve as good benchmarks:
### 1. **Prod... | 42,369 | [
{
"from": "human",
"value": "For one of the projects I'm doing right now, I need to look at the performance (amongst other things) of different concurrent enabled programming languages.\nAt the moment I'm looking into comparing stackless python and C++ PThreads, so the focus is on these two languages, but o... |
I'm have a ADO DataSet that I'm loading from its XML file via ReadXml. The data and the schema are in separate files.
Right now, it takes close to 13 seconds to load this DataSet. I can cut this to 700 milliseconds if I don't read the DataSet's schema and just let ReadXml infer the schema, but then the resulting Data... | It seems you're facing performance issues when loading data into a DataSet while enforcing a schema defined in an external XML schema file. Given that you've already experimented with turning off constraints with `BeginLoadData()` and `EndLoadData()`, but still notice a significant slowdown, here are a few suggestions ... | 46,890 | [
{
"from": "human",
"value": "I'm have a ADO DataSet that I'm loading from its XML file via ReadXml. The data and the schema are in separate files.\nRight now, it takes close to 13 seconds to load this DataSet. I can cut this to 700 milliseconds if I don't read the DataSet's schema and just let ReadXml inf... |
Well, I must be brain-damaged, because I can't find the java source for Sun's persistence.jar or JBoss's ejb3-persistence.jar JPA package. They are open-source aren't they?
I looked all over the java.sun.com site as well as the GlassFish wiki, but came up empty.
I'd like a src.zip or folder like Sun delivers with Java... | You're correct that many of the Java Persistence API (JPA) implementations are open source, but finding the source code for specific JAR files like `persistence.jar` or `ejb3-persistence.jar` can sometimes be tricky since they might not be bundled with the JDK like some other libraries.
### For Sun's (now Oracle's) JP... | 49,990 | [
{
"from": "human",
"value": "Well, I must be brain-damaged, because I can't find the java source for Sun's persistence.jar or JBoss's ejb3-persistence.jar JPA package. They are open-source aren't they?\nI looked all over the java.sun.com site as well as the GlassFish wiki, but came up empty.\nI'd like a sr... |
JavaFX is now out, and there are promises that Swing will improve along with JavaFX. Gone will be the days of ugly default UI, and at long last we can create engaging applications that are comparable to Flash, Air, and Silverlight in terms of quality.
Will this mean that Java Applets that hail from 1990's are dead and... | JavaFX indeed brought a significant advancement in UI design and capabilities compared to its predecessor, Swing. It introduced a modern, rich set of features for building engaging and visually appealing applications, moving away from the limitations of Swing and the older Java Applet model.
### 1. Decline of Java Ap... | 48,879 | [
{
"from": "human",
"value": "JavaFX is now out, and there are promises that Swing will improve along with JavaFX. Gone will be the days of ugly default UI, and at long last we can create engaging applications that are comparable to Flash, Air, and Silverlight in terms of quality.\n\nWill this mean that Java... |
Is there a way to use JQuery to cloak or encrypt email addresses on an HTML page without changing the syntax in the href?
| Yes, you can use jQuery to cloak or obfuscate email addresses on an HTML page while still maintaining the correct syntax in the `href` attribute. One common approach is to replace certain characters in the email address to make it less readable to bots while still keeping it functional for users.
Here's a simple exam... | 5,853 | [
{
"from": "human",
"value": "Is there a way to use JQuery to cloak or encrypt email addresses on an HTML page without changing the syntax in the href?\n"
},
{
"from": "gpt",
"value": "Yes, you can use jQuery to cloak or obfuscate email addresses on an HTML page while still maintaining the correc... |
I am writing a JSR-168 portlet that can be added to a container multiple times. Each container (Liferay, JBoss, etc.) has its own internal way of differentiating between multiple instantiations of the same portlet.
I, however, would like to uniquely identify my portlet instance inside the doView() method itself.
Is the... | In JSR-168, there is no standardized method to directly retrieve a unique identifier for each instance of a portlet in the `doView()` method. However, there are a few common approaches that you can consider to uniquely identify each portlet instance.
### 1. Use the Portlet Window ID
While JSR-168 does not provide a b... | 49,218 | [
{
"from": "human",
"value": "I am writing a JSR-168 portlet that can be added to a container multiple times. Each container (Liferay, JBoss, etc.) has its own internal way of differentiating between multiple instantiations of the same portlet.\nI, however, would like to uniquely identify my portlet instance... |
I have a manager class that produces tasks for a threadpool, and each thread is supposed to do a call back once they are finished.
I use locks to handle variables and fields, and signals to handle interthread communications. What I'm looking for is a way of exiting the current lock() and wait for a signal atomically, s... | You're encountering a common issue when dealing with locks and inter-thread communication using events. The problem arises because `WaitOne()` is called while holding a lock, which prevents other threads from acquiring the lock to call the callback, leading to a deadlock scenario.
One common solution is to use a diffe... | 46,092 | [
{
"from": "human",
"value": "I have a manager class that produces tasks for a threadpool, and each thread is supposed to do a call back once they are finished.\nI use locks to handle variables and fields, and signals to handle interthread communications. What I'm looking for is a way of exiting the current ... |
The full error is - "Value cannot be null. Parameter name: virtualPath". This is occurring in our QA and Training environments (Win 2003 Server & IIS6) but of course defies recreation in a debugger. To make matters worse, despite a reasonable global error handler, no stack trace accompanies the error and nothing is wri... | The error message you're encountering, "Value cannot be null. Parameter name: virtualPath," suggests that the application is trying to retrieve a resource using a null or empty virtual path, which leads to the failure you're experiencing. The fact that this error does not produce a stack trace or log entry can make it ... | 49,161 | [
{
"from": "human",
"value": "The full error is - \"Value cannot be null. Parameter name: virtualPath\". This is occurring in our QA and Training environments (Win 2003 Server & IIS6) but of course defies recreation in a debugger. To make matters worse, despite a reasonable global error handler, no stack tra... |
For "best" I intend that the code shouldn't need, or need very few, platform specific tweaks.
| When aiming for code that is portable and requires minimal platform-specific tweaks, there are several best practices to consider. Here’s a general guideline along with code examples across different languages:
### General Guidelines
1. **Use Standard Libraries**: Always prefer standard libraries that are available a... | 49,575 | [
{
"from": "human",
"value": "For \"best\" I intend that the code shouldn't need, or need very few, platform specific tweaks.\n"
},
{
"from": "gpt",
"value": "When aiming for code that is portable and requires minimal platform-specific tweaks, there are several best practices to consider. Here’s ... |
I am trying to make a small, data-driven widget that is populated with data from a database on the fly. I can load it initially just fine, but when the index of an ASP DropDownMenu is changed, the widget returns a 404.
This could be a symptom of how I am using the Javascript, or how I am using the ASP. I honestly don... | To troubleshoot your issue with the DropDownMenu causing a 404 error when its index is changed, we can go through a few common scenarios that could lead to this problem.
### Potential Issues to Check:
1. **Incorrect URL Handling**: Make sure that the URL you're trying to call via JavaScript is correct when the DropDo... | 47,779 | [
{
"from": "human",
"value": "I am trying to make a small, data-driven widget that is populated with data from a database on the fly. I can load it initially just fine, but when the index of an ASP DropDownMenu is changed, the widget returns a 404.\nThis could be a symptom of how I am using the Javascript, ... |
I want to capture all the requests going to *.jpg files on my server. To do so, I have created an HttpHandler whose code is as follows:
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.IO;
using System.Globalization;
namespace MyHandler
{
public class NewHandler : I... | It looks like you're trying to set up an `HttpHandler` to capture requests for `.jpg` files and log them. However, there are a few potential issues and considerations to address to help resolve the problem of logging requests to the `C:\requestLog.txt` file.
### 1. File Permissions
The most likely reason for the loggi... | 48,401 | [
{
"from": "human",
"value": "I want to capture all the requests going to *.jpg files on my server. To do so, I have created an HttpHandler whose code is as follows:\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Web;\nusing System.IO;\nusing System.Globalization;\n\nname... |
I am writing a managed custom action. I am using the DTF Framework from Windows Installer Xml to wrap the managed dll into a usable CA dll. The CA does what it is supposed to, but I am still having trouble with error handling:
Dim record As New Record(1)
' Field 0 intentionally left blank
' Field 1 contains error numb... | When you're working with Windows Installer and custom actions, especially managed code using the DTF (Deployment Tools Foundation) framework, handling errors and displaying messages appropriately can sometimes be tricky. The behavior you're experiencing—where a dialog is not displayed for the error—can be attributed to... | 48,382 | [
{
"from": "human",
"value": "I am writing a managed custom action. I am using the DTF Framework from Windows Installer Xml to wrap the managed dll into a usable CA dll. The CA does what it is supposed to, but I am still having trouble with error handling:\nDim record As New Record(1)\n\n' Field 0 intentiona... |
I am trying to add a UIButton at runtime however it is not visible. What am I doing wrong?
- (id)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
UIButton *btn = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
btn.frame = CGRectMake(0, 0, 100, 25);
btn.back... | The issue with your UIButton not being visible could be caused by several factors. Let's go through some possible reasons and solutions:
1. **Button's Parent View's Frame**: Ensure that the `frame` you are using in the `initWithFrame:` method has dimensions that allow the button to be visible within it. If the frame i... | 49,989 | [
{
"from": "human",
"value": "I am trying to add a UIButton at runtime however it is not visible. What am I doing wrong?\n- (id)initWithFrame:(CGRect)frame {\n if (self = [super initWithFrame:frame]) {\n UIButton *btn = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];\n btn.frame ... |
Can someone put in perspective the difference between JPA and Hibernate.
Or are these complementary concepts, to be used together?
| Certainly! JPA (Java Persistence API) and Hibernate are related but serve different purposes in the context of Java applications, especially for managing database operations.
### JPA (Java Persistence API)
- **Specification**: JPA is a Java specification for accessing, persisting, and managing data between Java object... | 49,874 | [
{
"from": "human",
"value": "Can someone put in perspective the difference between JPA and Hibernate.\nOr are these complementary concepts, to be used together?\n"
},
{
"from": "gpt",
"value": "Certainly! JPA (Java Persistence API) and Hibernate are related but serve different purposes in the co... |
I'm looking to rewrite a pretty intensive CRUD type ASP.NET page to utilize ajax calls (specifically jQuery ajax). My concern in doing this is that the user may be on this page longer than the forms authentication timeout. Because of this, I'm thinking that I should extend the forms authentication ticket with each aj... | Your concern about the forms authentication timeout when using AJAX calls in an ASP.NET application is valid. When users stay on a page for an extended period and make AJAX requests, they could potentially exceed the timeout period for their authentication ticket, which would result in an unauthorized request.
### 1. ... | 48,681 | [
{
"from": "human",
"value": "I'm looking to rewrite a pretty intensive CRUD type ASP.NET page to utilize ajax calls (specifically jQuery ajax). My concern in doing this is that the user may be on this page longer than the forms authentication timeout. Because of this, I'm thinking that I should extend the... |
I'm trying to do the following in my Django template:
{% for embed in embeds %}
{% embed2 = embed.replace("<", "<") %}
{{embed2}}<br />
{% endfor %}
However, I always get an invalid block or some syntax error when I do anything like that (by that I mean {% %} code inside a loop). Pytho... | In Django templates, you cannot define or manipulate variables directly inside the template logic, which is why you are encountering the "Invalid block tag" error when trying to use `{% embed2 = embed.replace("<", "<") %}`. Template syntax is intentionally limited to encourage separation of logic and presentation.
... | 47,326 | [
{
"from": "human",
"value": "I'm trying to do the following in my Django template:\n {% for embed in embeds %}\n {% embed2 = embed.replace(\"<\", \"<\") %}\n {{embed2}}<br />\n {% endfor %}\n\nHowever, I always get an invalid block or some syntax error when I do anything like th... |
I'm dealing with game dialogue files (conversation between player and non-playable-characters) where dialogue choices and their outcome depend on certain conditions and result in certain actions. Now, I could write a simple parser to handle some sort of language for specifying the pre and post-conditions, but a friend ... | Using XML to define dialogue trees in your game can be a pragmatic choice, especially when you're looking for a way to store complex data in a structured format that can be easily manipulated and edited. However, there are several factors to consider before proceeding with this approach:
### Pros of Using XML:
1. **S... | 46,253 | [
{
"from": "human",
"value": "I'm dealing with game dialogue files (conversation between player and non-playable-characters) where dialogue choices and their outcome depend on certain conditions and result in certain actions. Now, I could write a simple parser to handle some sort of language for specifying t... |
I have a page that spits out db data in long horizontal tables.
I need to print it nicely so it does not cut off. Any tips ?
| When dealing with long horizontal tables, especially when printing, it's important to ensure that the data is presented clearly and that none of the content is cut off. Here are some tips to format your tables for better printing:
### 1. **Landscape Orientation**
- Change the page orientation from portrait to lands... | 46,826 | [
{
"from": "human",
"value": "I have a page that spits out db data in long horizontal tables. \nI need to print it nicely so it does not cut off. Any tips ?\n"
},
{
"from": "gpt",
"value": "When dealing with long horizontal tables, especially when printing, it's important to ensure that the data ... |
In this tutorial I am reading, Dave Ward creates a page that shows the server date in a label without using the update panel.
I am trying to learn how to create servercontrols that use ajax for partial postbacks where methods within the control are called from clientscript generated by the same control, and I think tha... | To address the error you're encountering, it seems that you're trying to use `PageMethods` to call your static WebMethod from client-side JavaScript, but the setup isn't fully configured. This is a common issue when integrating ASP.NET AJAX with custom server controls.
To enable `PageMethods` correctly, follow these s... | 47,842 | [
{
"from": "human",
"value": "In this tutorial I am reading, Dave Ward creates a page that shows the server date in a label without using the update panel.\nI am trying to learn how to create servercontrols that use ajax for partial postbacks where methods within the control are called from clientscript gene... |
I have a repeater that should show a bound field value only if it exists. Having read this post I decided to do it by using a literal within my repeater and using the OnItemDatabound trigger to populate my literal but my literal doesn't seem to be accessible from the c# code behind and I don't understand why!
Heres the... | It looks like you are trying to access a `Literal` control within a `Repeater` in the `OnItemDataBound` event handler. Based on your description, the `Literal` control is returning `null`, which can occur for several reasons.
Here’s a checklist and an updated approach to troubleshoot and fix your issue:
1. **Check fo... | 49,345 | [
{
"from": "human",
"value": "I have a repeater that should show a bound field value only if it exists. Having read this post I decided to do it by using a literal within my repeater and using the OnItemDatabound trigger to populate my literal but my literal doesn't seem to be accessible from the c# code beh... |
This should be easy for many of you, but for me it's just another bit of rust needing to be chipped away as I get back into basic Java coding. Using bloody associative arrays for so long in other languages have turned me nice and spoiled. :P
My problem is simple: I'm storing a set of objects, each containing a string ... | Welcome back to Java coding! It sounds like you're looking for a structure that can both maintain a sorted order based on a string and allow for efficient retrieval by that string. Java's standard libraries provide several options that can achieve this.
### Option 1: Using `TreeMap`
One of the best ways to achieve bot... | 44,000 | [
{
"from": "human",
"value": "This should be easy for many of you, but for me it's just another bit of rust needing to be chipped away as I get back into basic Java coding. Using bloody associative arrays for so long in other languages have turned me nice and spoiled. :P\nMy problem is simple: I'm storing a... |
A question mainly for web developers.
When you develop web applications and add an admin area to it, how do you name it? Leaving it 'admin' is a bit out of fashion and insecure.
Mind sharing any other nouns, verbs, adjectives or whatnot, that holds the title of any websites you know/can think of.
| Choosing a name for the admin area of a web application can indeed influence both security and user perception. While "admin" is a common term, using alternative names can help obscure the area from malicious users and can also make it sound more modern or user-friendly. Here are some suggestions for naming the admin a... | 48,830 | [
{
"from": "human",
"value": "A question mainly for web developers. \nWhen you develop web applications and add an admin area to it, how do you name it? Leaving it 'admin' is a bit out of fashion and insecure. \nMind sharing any other nouns, verbs, adjectives or whatnot, that holds the title of any websites ... |
I need to store of 100-200 data in mysql, the data which would be separated by pipes..
any idea how to store it on mysql? should I use a single column or should I make many multiple columns? I don't know exactly how many data users will input.
I made a form, it halted at the part where multiple data needs to be stored... | When it comes to storing multiple values in a MySQL database, there are a few different approaches you can take, depending on your specific requirements. Here are some options to consider:
### 1. **Using a Single Column with Delimited Values**
You can store multiple values in a single column by concatenating them with... | 46,659 | [
{
"from": "human",
"value": "I need to store of 100-200 data in mysql, the data which would be separated by pipes..\nany idea how to store it on mysql? should I use a single column or should I make many multiple columns? I don't know exactly how many data users will input. \nI made a form, it halted at the ... |
I have several service classes that have static methods and offer a service to the rest of my program. Most of these services involve accessing an instance of SqlDataContext (linq2sql).
First I tried instantiating this connection as a static private member per service class.
This works, but it also generates a bunch of... | The situation you describe is a common one when dealing with database access in a multithreaded application or even a single-threaded one where performance and resource management are important. Using static members can lead to concurrency issues, while creating a new instance of `SqlDataContext` (or any database conte... | 49,216 | [
{
"from": "human",
"value": "I have several service classes that have static methods and offer a service to the rest of my program. Most of these services involve accessing an instance of SqlDataContext (linq2sql).\nFirst I tried instantiating this connection as a static private member per service class.\nT... |
I'm trying to checkout a repository via command line (the 'svn co' command), using the svn+ssh protocol. I need to checkout as a different user than what I currently am. The command svn co svn+ssh://username@server/repo/ would make sense, however when it prompts for a password, it never accepts it.
How do I checkout a ... | When using `svn co` with the `svn+ssh` protocol, the `username` in the URL specifies the user that you are trying to authenticate as. However, if you are having issues with the password prompt not accepting the password, here are a few things you could try to troubleshoot and ensure you're able to checkout as a differe... | 47,696 | [
{
"from": "human",
"value": "I'm trying to checkout a repository via command line (the 'svn co' command), using the svn+ssh protocol. I need to checkout as a different user than what I currently am. The command svn co svn+ssh://username@server/repo/ would make sense, however when it prompts for a password, ... |
I'm sending a file from a z/OS system to a Linux ftp sever using sftp.
I want to append the date to the filename once the file resides on the linux box.
(Ex: filename.txt becomes filename122308.txt)
I have tried the 'rename' command using 'date +%m%d%y' - the file was renamed but the flags were not executed (The filena... | When you use SFTP to transfer files, it's important to note that SFTP commands are executed in the context of the SFTP session and won't interpret shell commands like `date +%m%d%y` because they are not executed in a shell environment. Here’s how you can work around this limitation:
### Option 1: Rename After Transfer... | 49,791 | [
{
"from": "human",
"value": "I'm sending a file from a z/OS system to a Linux ftp sever using sftp.\nI want to append the date to the filename once the file resides on the linux box.\n(Ex: filename.txt becomes filename122308.txt)\nI have tried the 'rename' command using 'date +%m%d%y' - the file was renamed... |
I find myself doing 2 things quite often in JS, at the moment using jQuery:
The first is the populating of an HTML element, which might look like:
$.get('http://www.example.com/get_result.php', { id: 1 }, function (data) {
$('#elementId').html(data);
});
The second is populating a select element with a JSON result... | If you're looking to streamline your AJAX operations in jQuery and avoid code duplication, you can create reusable functions for your common tasks like populating HTML elements and populating select options. Below, I’ll provide examples of how you could create these functions, as well as some enhancements for better us... | 45,740 | [
{
"from": "human",
"value": "I find myself doing 2 things quite often in JS, at the moment using jQuery:\nThe first is the populating of an HTML element, which might look like:\n$.get('http://www.example.com/get_result.php', { id: 1 }, function (data) {\n $('#elementId').html(data);\n});\n\nThe second is... |
This is more an observation than a real question: MS-Access (and VBA in general) is desperately missing a tool where error handling code can be generated automatically, and where the line number can be displayed when an error occurs. Did you find a solution? What is it? I just realized how many hundreds of hours I spar... | Error handling in MS Access and VBA is indeed a topic that can consume a lot of time if not approached systematically. You're right that built-in tools for automatically generating error handling code are lacking. However, there are strategies and techniques that can help streamline error handling in VBA, making it eas... | 45,504 | [
{
"from": "human",
"value": "This is more an observation than a real question: MS-Access (and VBA in general) is desperately missing a tool where error handling code can be generated automatically, and where the line number can be displayed when an error occurs. Did you find a solution? What is it? I just r... |
I need to reinstall IIS 7.0 on Vista due to some unsolved configuration issues.
I thought it was easy: I uninstalled all IIS-related stuff in Programs/Features, restarted system, installed all IIS modules again (installation cd wasn't needed) and hmm.. everything looks the same - I mean wrong. I see all configured webs... | To perform a clean reinstallation of IIS 7.0 on Windows Vista without reinstalling the entire operating system, you can follow these steps:
### Step 1: Uninstall IIS
1. **Uninstall IIS Components:**
- Go to `Control Panel` > `Programs and Features`.
- Click on `Turn Windows features on or off`.
- Uncheck all... | 47,063 | [
{
"from": "human",
"value": "I need to reinstall IIS 7.0 on Vista due to some unsolved configuration issues.\nI thought it was easy: I uninstalled all IIS-related stuff in Programs/Features, restarted system, installed all IIS modules again (installation cd wasn't needed) and hmm.. everything looks the same... |
I am looking to using Google Chromium for my MFC app as an HTML renderer. I found this test bed application and I am wondering if anyone knows how or of a resource that I can make sense of it so that I could extract the Webkit/Webview stuff into my application. Thanks.
~/webkit/tools/test_shell
~/webkit/tools/test/r... | To integrate Google Chromium into your MFC application for HTML rendering, you might want to look into using **Chromium Embedded Framework (CEF)**, which is a framework that allows you to embed a Chromium-based web browser in your application. While you mentioned the Webkit test bed, it's important to note that Webkit ... | 41,215 | [
{
"from": "human",
"value": "I am looking to using Google Chromium for my MFC app as an HTML renderer. I found this test bed application and I am wondering if anyone knows how or of a resource that I can make sense of it so that I could extract the Webkit/Webview stuff into my application. Thanks. \n~/web... |
I m doing a stuf in JAVA, as it is working fine.. now i need it to display in a browser using JSP, the following is my code..
Hashtable<String, Hashtable<String, Integer>> hash =
categoryCountManager.getFunctionWithSubFunctionCount(1L);
setCategoryDetails(categoryCountManager.getFunctionWithSubFun... | To display the contents of your Java code in a web browser using JSP (JavaServer Pages), you'll need to replace the `System.out.println` calls with JSP output statements. Below is a step-by-step guide on how to convert your existing Java code to JSP:
### Step 1: Set Up Your JSP Page
1. **Create a new JSP file** (e.g.... | 47,183 | [
{
"from": "human",
"value": "I m doing a stuf in JAVA, as it is working fine.. now i need it to display in a browser using JSP, the following is my code.. \nHashtable<String, Hashtable<String, Integer>> hash =\n categoryCountManager.getFunctionWithSubFunctionCount(1L);\n\n setCategoryDetai... |
Every PHP programmer likely uses at least some form of a template engine and a database abstraction layer, but apart from those what extras do you consider essential or would recommend your fellow programmers try out?
| As a PHP programmer, beyond the widely used template engines and database abstraction layers, there are several other tools and libraries that can enhance development, improve efficiency, and help maintain clean code. Here are some recommendations:
1. **Frameworks**:
- **Laravel**: Offers a robust set of features,... | 49,337 | [
{
"from": "human",
"value": "Every PHP programmer likely uses at least some form of a template engine and a database abstraction layer, but apart from those what extras do you consider essential or would recommend your fellow programmers try out?\n"
},
{
"from": "gpt",
"value": "As a PHP progra... |
Steps:
- Installed Mysql Server 2005
- Downloaded Mysql++, built both debug and release version.
- Ran install.hta and selected a directory
- Added library/include directory in MSVC++ 2008
- Included mysql++.h in my application
- Moved .dll files (libMYSQL.dll and mysqlpp.dll and mysqlpp_d.dll) to Debug folder.
Releva... | Your implementation has a couple of issues that may contribute to the failure in connecting to the MySQL database. Let's address them step by step.
1. **Check Connection Parameters**: Ensure that you are passing the right parameters to your `Connect` function. The IP address, username, password, and database name shou... | 48,531 | [
{
"from": "human",
"value": "Steps:\n- Installed Mysql Server 2005 \n- Downloaded Mysql++, built both debug and release version.\n- Ran install.hta and selected a directory\n- Added library/include directory in MSVC++ 2008\n- Included mysql++.h in my application\n- Moved .dll files (libMYSQL.dll and mysqlpp... |
When I call this function, everything works, as long as I don't try to recursively call the function again. In other words if I uncomment the line:
GetChilds rsData("AcctID"), intLevel + 1
Then the function breaks.
<%
Function GetChilds(ParentID, intLevel)
Set rsData= Server.CreateObject("ADODB.Recordset... | Your approach to recursively retrieving child accounts in your ASP function seems logical, but the error you are encountering (`Error Type: (0x80020009) Exception occurred`) might arise from a few factors, including database connection issues, or issues related to how you're handling the recordset.
Here are some sugge... | 46,090 | [
{
"from": "human",
"value": "When I call this function, everything works, as long as I don't try to recursively call the function again. In other words if I uncomment the line:\nGetChilds rsData(\"AcctID\"), intLevel + 1 \n\nThen the function breaks. \n<%\n Function GetChilds(ParentID, intLevel)\n ... |
I found the following code to create a tinyurl.com url:
http://tinyurl.com/api-create.php?url=http://myurl.com
This will automatically create a tinyurl url. Is there a way to do this using code, specifically C# in ASP.NET?
| Yes, you can create a TinyURL using C# in an ASP.NET application by making an HTTP request to the TinyURL API. Below is an example of how you can implement this using `HttpClient` to send a GET request to the TinyURL API and get the shortened URL.
### Step-by-step Implementation:
1. **Create a new ASP.NET project** (... | 46,225 | [
{
"from": "human",
"value": "I found the following code to create a tinyurl.com url:\nhttp://tinyurl.com/api-create.php?url=http://myurl.com\n\nThis will automatically create a tinyurl url. Is there a way to do this using code, specifically C# in ASP.NET?\n"
},
{
"from": "gpt",
"value": "Yes, y... |
Trying to do an insert, I have:
jdbcTemplate.update("insert into....", new Object[]{foo.getId(), foo.getName()})
foo.getId() returns a long, and getName() a String.
I have "NUMBER" as the id type in Oracle, and varchar2 for the name field.
I'm getting SQLtype unknown problem.
the update method has a version where I do ... | The `jdbcTemplate.update` method in Spring JDBC is designed to handle various types of parameters automatically, including basic data types like `long` and `String`. However, if you encounter a SQL type unknown problem, it might be due to how the JDBC driver or the underlying database is interpreting the parameters.
H... | 49,116 | [
{
"from": "human",
"value": "Trying to do an insert, I have:\njdbcTemplate.update(\"insert into....\", new Object[]{foo.getId(), foo.getName()})\nfoo.getId() returns a long, and getName() a String.\nI have \"NUMBER\" as the id type in Oracle, and varchar2 for the name field.\nI'm getting SQLtype unknown pro... |
I've begun playing with MBeans for exposing some information about an app. Pretty much the totality of HOWTOs / Tutorials / Blog posts / Samples online teach you how to implement an MBean and register it with an MBean Server, but never mention (or only cursorily) unregistering the MBean from the server.
I'm concerned a... | In Java Management Extensions (JMX), when you register an MBean with the MBean server, it does indeed keep a strong reference to the MBean. This means that as long as the MBean server holds a reference to your MBean, it will not be eligible for garbage collection, regardless of whether you still hold a reference to it ... | 49,684 | [
{
"from": "human",
"value": "I've begun playing with MBeans for exposing some information about an app. Pretty much the totality of HOWTOs / Tutorials / Blog posts / Samples online teach you how to implement an MBean and register it with an MBean Server, but never mention (or only cursorily) unregistering t... |
I have a set of five boolean values. If more than one of these are true I want to excecute a particular function. What is the most elegant way you can think of that would allow me to check this condition in a single if() statement? Target language is C# but I'm interested in solutions in other languages as well (as lon... | You can accomplish the task of checking if more than one boolean value is true in a clean and elegant way without resorting to bit manipulation. Here are a few options in C#, as well as approaches in other languages.
### C# Solution
1. **Using Array and LINQ:**
You can use an array to hold the boolean values and t... | 49,410 | [
{
"from": "human",
"value": "I have a set of five boolean values. If more than one of these are true I want to excecute a particular function. What is the most elegant way you can think of that would allow me to check this condition in a single if() statement? Target language is C# but I'm interested in sol... |
Short version:
Could anyone suggest or provide a sample in LINQ to XML for VB, or in an XSLT of how to change one XML element into another (without hardcoding an element-by-element copy of all the unchanged elements)?
Background:
I have an XML file, that I think is properly formed, that contains a root entry that is <... | Certainly! Below are two approaches for transforming the given XML: one using LINQ to XML in VB.NET and the other using XSLT. Both will add `<Genre>` elements based on the `<Tag>` elements in the XML provided.
### 1. Using LINQ to XML in VB.NET
This LINQ to XML example will parse the XML, look for `<Tag>` elements, a... | 48,024 | [
{
"from": "human",
"value": "Short version: \nCould anyone suggest or provide a sample in LINQ to XML for VB, or in an XSLT of how to change one XML element into another (without hardcoding an element-by-element copy of all the unchanged elements)?\nBackground:\nI have an XML file, that I think is properly ... |
I have a bunch of compile time asserts, such as:
CASSERT(isTrue) or CASSERT2(isTrue, prefix_)
When compiling with GCC I get many warnings like 'prefix_LineNumber' defined but not used. Is there a way I can hide warnings for compile time asserts? I had no luck searching the GCC documentation. I thought I might have the... | To suppress the unused variable warnings in GCC for your compile-time assertions (`CASSERT` or `CASSERT2`), you can modify your macro definitions to utilize the variable in such a way that GCC will consider it "used". Here are a couple of common approaches to do this.
### Method 1: Use `volatile`
One way to silence t... | 48,552 | [
{
"from": "human",
"value": "I have a bunch of compile time asserts, such as:\nCASSERT(isTrue) or CASSERT2(isTrue, prefix_)\n\nWhen compiling with GCC I get many warnings like 'prefix_LineNumber' defined but not used. Is there a way I can hide warnings for compile time asserts? I had no luck searching the G... |
Our shop designs and create custom software applications for a vareity of vertical industies. We currently use a modified version of the Csla framework for most of our development.
It's a great framework, supports a vareity of ways to communicate with a database, directly, remoting, WCF and so on. It offers a ton o... | Your consideration to switch from the modified CSLA framework to LINQ to SQL (or any alternative framework) is certainly not crazy, but it does warrant careful consideration. There are several factors you should weigh as you contemplate this transition:
### Pros of Transitioning to LINQ to SQL:
1. **Simplicity and Ea... | 49,596 | [
{
"from": "human",
"value": "Our shop designs and create custom software applications for a vareity of vertical industies. We currently use a modified version of the Csla framework for most of our development. \nIt's a great framework, supports a vareity of ways to communicate with a database, directly, r... |
It seems like Groovy was forgotten in this thread so I'll just ask the same question for Groovy.
Try to limit answers to Groovy core
One feature per answer
Give an example and short description of the feature, not just a link to documentation
Label the feature using bold title as the first line
See also:
Hidden feat... | **Dynamic Typing**
In Groovy, you don't have to explicitly declare the type of a variable. Groovy supports dynamic typing, which means you can assign any type of value to a variable without having to specify its type at compile-time. This makes the code more flexible and often more concise.
**Example:**
```groovy
de... | 45,677 | [
{
"from": "human",
"value": "It seems like Groovy was forgotten in this thread so I'll just ask the same question for Groovy.\n\nTry to limit answers to Groovy core\nOne feature per answer\nGive an example and short description of the feature, not just a link to documentation\nLabel the feature using bold t... |
I have form that displays several keywords (standard set of choice lists that changes rarely). There are about 4 such fields and each have about 20 choices or so.
I'm thinking if caching the keywords will be helpful for performance / best practice? Is there a strategy for determining when to cache?
| Caching keywords in your application can indeed enhance performance, especially when the data doesn't change frequently and is used multiple times. Here are some considerations and strategies for determining when to cache:
### Benefits of Caching Keywords
1. **Reduced Load Times**: If you're fetching keywords from a ... | 49,944 | [
{
"from": "human",
"value": "I have form that displays several keywords (standard set of choice lists that changes rarely). There are about 4 such fields and each have about 20 choices or so.\nI'm thinking if caching the keywords will be helpful for performance / best practice? Is there a strategy for deter... |
I'm using LINQ to SQL to pull records from a database, sort them by a string field, then perform some other work on them. Unfortunately the Name field that I'm sorting by comes out of the database like this
Name
ADAPT1
ADAPT10
ADAPT11
...
ADAPT2
ADAPT3
I'd like to sort the Name field in numerical order. Right now I'... | The issue you're facing is that LINQ to SQL does not support the `Regex.Replace` method in its translation to SQL. This is why you encounter the `NotSupportedException`. To achieve the sorting you desire, you can use a different approach that does not require regular expressions.
Instead of modifying the `Name` field ... | 49,502 | [
{
"from": "human",
"value": "I'm using LINQ to SQL to pull records from a database, sort them by a string field, then perform some other work on them. Unfortunately the Name field that I'm sorting by comes out of the database like this\nName\nADAPT1\nADAPT10\nADAPT11\n...\nADAPT2\nADAPT3\n\nI'd like to sor... |
Is it possible to create an XML Schema which imposes a co-occurrence constraint to an attribute/element pair?
<primitive-list>
<primitive name="P1">
<definition><!-- primitive specification --></definition>
</primitive>
<primitive name="P2">
<definition><!-- primitive specification --></defi... | To create an XML Schema (XSD) that imposes the constraints you mentioned, we can make use of a combination of complex types, `xs:choice`, and `xs:sequence` to differentiate the rules for `primitive` elements within `primitive-list` versus those within `composite` elements. However, XML Schema does not support direct co... | 45,701 | [
{
"from": "human",
"value": "Is it possible to create an XML Schema which imposes a co-occurrence constraint to an attribute/element pair?\n<primitive-list>\n <primitive name=\"P1\">\n <definition><!-- primitive specification --></definition>\n </primitive>\n <primitive name=\"P2\">\n ... |
I am having a problem setting the Authorize attribute Role value from a variable. The error message says it requires a const variable. When I create a const type variable it works fine but I am trying to load the value from the Web.Config file or anything else that will allow the end user to set this. I'm using integ... | The issue you're encountering is due to the fact that the `Roles` property of the `Authorize` attribute requires a compile-time constant. Since you're trying to load the role from a variable at runtime (like from the Web.config), it won't work directly in the attribute.
Instead of using the `Authorize` attribute with ... | 47,843 | [
{
"from": "human",
"value": "I am having a problem setting the Authorize attribute Role value from a variable. The error message says it requires a const variable. When I create a const type variable it works fine but I am trying to load the value from the Web.Config file or anything else that will allow t... |
Supposedly installing erubis is as simple as:
gem install erubis
# And in environment.rb:
require 'erubis/helpers/rails_helper'
But I haven't found this to be so. Note that there are no evident errors in my code; it runs just fine and dandy with ERB.
Where do I put this line? Directly after the boot.rb inclusion i... | If you're trying to use Erubis as a replacement for ERB in a Ruby on Rails application, the installation and setup process can be a little tricky. Here are some steps and considerations to help you get Erubis working:
### 1. Installation
First, ensure that you have installed the Erubis gem correctly. You can do this b... | 49,654 | [
{
"from": "human",
"value": "Supposedly installing erubis is as simple as:\ngem install erubis\n\n# And in environment.rb:\nrequire 'erubis/helpers/rails_helper'\n\nBut I haven't found this to be so. Note that there are no evident errors in my code; it runs just fine and dandy with ERB.\n\nWhere do I put t... |
I have the following code in a SQL Server 2005 trigger:
CREATE TRIGGER [myTrigger] ON [myTable]
FOR UPDATE,DELETE
AS
BEGIN
DECLARE @OperationType VARCHAR(6)
IF EXISTS(SELECT 1 FROM INSERTED)
BEGIN
SET @OperationType='Update'
END
ELSE
BEGIN
SET @OperationType='Delete'
END
My question: is there a situation in... | In SQL Server, triggers are designed to operate in the context of set-based operations, which means that they can be fired as a result of a single action that affects multiple rows. The logic you currently have in the trigger to determine whether it was fired by an `UPDATE` or `DELETE` statement could lead to inaccurac... | 49,932 | [
{
"from": "human",
"value": "I have the following code in a SQL Server 2005 trigger: \n\nCREATE TRIGGER [myTrigger] ON [myTable]\nFOR UPDATE,DELETE\nAS\nBEGIN\n\nDECLARE @OperationType VARCHAR(6)\nIF EXISTS(SELECT 1 FROM INSERTED)\nBEGIN\n SET @OperationType='Update'\nEND\nELSE\nBEGIN\n SET @Operation... |
Is there some command line or AppleScript that I can write/run to make the machine go to sleep automatically or even better, into hibernate mode?
I can run the program as root.
| Yes, you can put a Mac into sleep or hibernate mode using both command line and AppleScript. Here’s how to do it:
### Using Command Line
You can use the `pmset` command to control sleep settings and sleep your Mac. Here are a couple of options:
1. **Put the Mac to Sleep:**
You can run the following command in the... | 49,915 | [
{
"from": "human",
"value": "Is there some command line or AppleScript that I can write/run to make the machine go to sleep automatically or even better, into hibernate mode? \nI can run the program as root.\n"
},
{
"from": "gpt",
"value": "Yes, you can put a Mac into sleep or hibernate mode usi... |
i have got an 32bit (hexadecimal)word 0xaabbccdd and have to swap the 2. and the 3. byte. in the end it should look like 0xaaccbbdd
how can i "mask" the 2nd and the 3rd byte to first load them up to register r1 and r2 and the swap them..
i also know that i have to work with lsl and lsr commands but dont know how to sta... | Hi Sebastian,
You're on the right track with your approach! To swap the 2nd and 3rd bytes in a 32-bit word (like `0xaabbccdd`), you can indeed use logical shifts (`LSL` and `LSR`) and bitwise operations to mask and swap the bytes. Here's a step-by-step explanation of how to do this in assembly language.
### Steps to ... | 44,887 | [
{
"from": "human",
"value": "i have got an 32bit (hexadecimal)word 0xaabbccdd and have to swap the 2. and the 3. byte. in the end it should look like 0xaaccbbdd\nhow can i \"mask\" the 2nd and the 3rd byte to first load them up to register r1 and r2 and the swap them..\ni also know that i have to work with ... |
We use Sharepoint as CMS for our webpages at work. I know how to create controls that can be only visible if you have logged in in SharePoint with:
<Sharepoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl1" runat="server" PermissionsString="AddAndCustomizePages"><br />
<Sharepoint:CssLink ID="CssLink1" runat=... | In SharePoint, to programmatically control the visibility of your controls based on user permissions, you can leverage the `SPContext.Current.Web` object to check for user permissions. Here's how you can implement this:
1. **Access the current user and the SharePoint context.**
2. **Check the specific permissions of t... | 47,298 | [
{
"from": "human",
"value": "We use Sharepoint as CMS for our webpages at work. I know how to create controls that can be only visible if you have logged in in SharePoint with:\n<Sharepoint:SPSecurityTrimmedControl ID=\"SPSecurityTrimmedControl1\" runat=\"server\" PermissionsString=\"AddAndCustomizePages\">... |
I wanted to know, while deciding which language or technology to use for implementing an idea; a design, what are the factors involved in making a decision? Specifically talking about popular scripting languages, why would one choose to use ruby over python or perl or vice-versa? All these scripting languages have prov... | Choosing a programming language or technology for implementing an idea or design involves several factors. Here’s a breakdown of key considerations that can guide the decision-making process, especially when comparing popular scripting languages like Ruby, Python, and Perl:
### 1. **Project Requirements**
- **Domai... | 48,277 | [
{
"from": "human",
"value": "I wanted to know, while deciding which language or technology to use for implementing an idea; a design, what are the factors involved in making a decision? Specifically talking about popular scripting languages, why would one choose to use ruby over python or perl or vice-versa... |
There is a similar question here but it only covers some of the issues below.
We have a client who requires web services using REST.
We have tons of experience using SOAP and over time have gathered together a really good set of tools for SOAP development and testing e.g.
soapUI
Eclipse plugins
wsdl2java
WSStudio
By... | Certainly! While the tooling ecosystem for REST services may not be as mature as SOAP, there are several tools available for development, testing, and monitoring of RESTful services. Here’s a comprehensive overview of some tools you can use for working with REST APIs, particularly for C# and Java:
### Development Tool... | 48,864 | [
{
"from": "human",
"value": "There is a similar question here but it only covers some of the issues below.\nWe have a client who requires web services using REST.\nWe have tons of experience using SOAP and over time have gathered together a really good set of tools for SOAP development and testing e.g.\n\ns... |
In the Linux kernel, given the task_struct's mm I can access the process's list of vm_area_structs. Given these vm_area_structs, how do I get the struct pages which actually correspond to this vma?
I tried looking for functions in mm/memory.c and the like, but I was at a loss.
Edit: the idea is to find which pages in ... | To access the `struct page` objects that correspond to a specific `vm_area_struct` (VMA) in the Linux kernel, you'll need to understand how the virtual memory system works and how page tables map virtual addresses to physical pages.
### General Steps:
1. **Understand the VMA:** Each `vm_area_struct` has a start and e... | 44,604 | [
{
"from": "human",
"value": "In the Linux kernel, given the task_struct's mm I can access the process's list of vm_area_structs. Given these vm_area_structs, how do I get the struct pages which actually correspond to this vma? \nI tried looking for functions in mm/memory.c and the like, but I was at a loss.... |
I'm trying to abstract out all database code into a separate library and then use that library in all my code. All database connections are done using typed TableAdapters that I create by dragging and dropping in datasets in VS2005, using a connection string from the appSettings.
The problem that I haven't been able to... | When dealing with a .NET library that needs to access application settings, particularly connection strings, it's important to understand how configuration files work in the .NET ecosystem. The issue you're experiencing arises because settings defined in a class library do not automatically propagate to the configurati... | 48,315 | [
{
"from": "human",
"value": "I'm trying to abstract out all database code into a separate library and then use that library in all my code. All database connections are done using typed TableAdapters that I create by dragging and dropping in datasets in VS2005, using a connection string from the appSettings... |
I need to POST data to a url in the middle of a script.
User fills out form:
Form submits to process.asp: I need to POST data to a 3rd Party integration at this point.
process.asp finishes and directs user to thank you page.
| To achieve the desired functionality where a form submission leads to posting data to a third-party integration before redirecting the user to a thank you page, you can follow these steps. Below is a simple implementation using ASP (Active Server Pages):
1. **HTML Form Submission**: Create a form that the user fills o... | 47,931 | [
{
"from": "human",
"value": "I need to POST data to a url in the middle of a script.\n\nUser fills out form:\nForm submits to process.asp: I need to POST data to a 3rd Party integration at this point.\nprocess.asp finishes and directs user to thank you page.\n\n"
},
{
"from": "gpt",
"value": "To... |
Here's the deal. I have a hash map containing data I call "program codes", it lives in an object, like so:
Class Metadata
{
private HashMap validProgramCodes;
public HashMap getValidProgramCodes() { return validProgramCodes; }
public void setValidProgramCodes(HashMap h) { validProgramCodes = h; }
}
I have... | Your approach to handling the `validProgramCodes` in a concurrent environment raises some valid considerations, but it also carries risks associated with visibility and safety when dealing with shared mutable data. Let’s break it down:
### 1. Memory Visibility:
Java has a memory model that allows for multiple threads ... | 49,747 | [
{
"from": "human",
"value": "Here's the deal. I have a hash map containing data I call \"program codes\", it lives in an object, like so:\nClass Metadata\n{\n private HashMap validProgramCodes;\n public HashMap getValidProgramCodes() { return validProgramCodes; }\n public void setValidProgramCodes... |
I have a dynamic query that returns around 590,000 records. It runs successfully the first time, but if I run it again, I keep getting a System.OutOfMemoryException. What are some reasons this could be happening?
The error is happening here:
public static DataSet GetDataSet(string databaseName,string
... | The `System.OutOfMemoryException` you're encountering when running your dynamic query multiple times, especially when it returns around 590,000 records, can occur due to a few reasons related to how memory is managed in your application. Here are some potential causes and solutions:
### Potential Causes
1. **Large Da... | 48,967 | [
{
"from": "human",
"value": "I have a dynamic query that returns around 590,000 records. It runs successfully the first time, but if I run it again, I keep getting a System.OutOfMemoryException. What are some reasons this could be happening?\nThe error is happening here:\n public static DataSet GetDataSe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.