instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Does anyone know if the JBoss 4.2.3 release that is compiled for Java 6 still supports EJB 2? I'm having issues where it can't cast a class to a certain interface where I never had this problem before and the code hasn't changed.
| Yes, JBoss 4.2.3, which is indeed compatible with Java 6, still supports EJB 2. However, there could be various reasons for the casting issue you're encountering. Here are some potential factors to consider:
1. **Classloader Changes**: JBoss uses a modular classloading architecture, and upgrading Java versions or JBos... | 12,189 | [
{
"from": "human",
"value": "Does anyone know if the JBoss 4.2.3 release that is compiled for Java 6 still supports EJB 2? I'm having issues where it can't cast a class to a certain interface where I never had this problem before and the code hasn't changed.\n"
},
{
"from": "gpt",
"value": "Yes... |
I have a collection of non-overlapping rectangles that cover an enclosing rectangle. What is the best way to find the containing rectangle for a mouse click?
The obvious answer is to have an array of rectangles and to search them in sequence, making the search O(n). Is there some way to order them by position so that t... | To efficiently find the rectangle containing a mouse click, you can use a spatial data structure that allows for quicker querying than a simple linear search. Here are a few methods that can achieve better than O(n) performance:
### 1. **R-Tree**
An R-tree is a balanced tree data structure used for indexing multi-dime... | 10,498 | [
{
"from": "human",
"value": "I have a collection of non-overlapping rectangles that cover an enclosing rectangle. What is the best way to find the containing rectangle for a mouse click?\nThe obvious answer is to have an array of rectangles and to search them in sequence, making the search O(n). Is there so... |
class Tag(models.Model):
name = models.CharField(maxlength=100)
class Blog(models.Model):
name = models.CharField(maxlength=100)
tags = models.ManyToManyField(Tag)
Simple models just to ask my question.
I wonder how can i query blogs using tags in two different ways.
Blog entries that are tagged with "tag1" o... | To query your `Blog` model using the `Tag` model in the ways you've described, you can utilize Django's ORM methods effectively. Here's how to achieve the different queries you mentioned:
### 1. Blog entries that are tagged with "tag1" or "tag2":
You can use the `filter()` method with the `Q` object to perform an OR q... | 8,664 | [
{
"from": "human",
"value": "class Tag(models.Model):\n name = models.CharField(maxlength=100)\n\nclass Blog(models.Model):\n name = models.CharField(maxlength=100)\n tags = models.ManyToManyField(Tag)\n\nSimple models just to ask my question.\nI wonder how can i query blogs using tags in two different ... |
I have a query that I would like to filter in different ways at different times. The way I have done this right now by placing parameters in the criteria field of the relevant query fields, however there are many cases in which I do not want to filter on a given field but only on the other fields. Is there any way in... | Yes, you can handle this scenario effectively by using parameters in your query with the ability to bypass filtering when needed. Here’s how you can approach this:
### Option 1: Use a Placeholder or Wildcard
You can modify your query to handle a wildcard value that represents "no filter." For instance, if you're usin... | 9,745 | [
{
"from": "human",
"value": "I have a query that I would like to filter in different ways at different times. The way I have done this right now by placing parameters in the criteria field of the relevant query fields, however there are many cases in which I do not want to filter on a given field but only ... |
What is the best way to use multiple EVAL fields in a GridView ItemTemplate?
Looking to have some control over formatting for appearance as well as setting up hyperlinks/javascript etc.
| Using multiple EVAL fields in a `GridView` `ItemTemplate` allows you to customize the formatting and functionality of the data displayed in the grid. Here are some best practices and techniques to achieve this:
### 1. Use ItemTemplate
Use the `ItemTemplate` of the `GridView` to add various controls and apply formatti... | 10,332 | [
{
"from": "human",
"value": "What is the best way to use multiple EVAL fields in a GridView ItemTemplate?\nLooking to have some control over formatting for appearance as well as setting up hyperlinks/javascript etc.\n"
},
{
"from": "gpt",
"value": "Using multiple EVAL fields in a `GridView` `Ite... |
I thought that there was some way in .net 3.0 to give an array list a type so that it didnt just return Object's but I'm having trouble doing so. Is it possible? If so, how?
| In .NET 3.0, you can use generics to create a strongly-typed collection, which is typically preferred over using an `ArrayList`. `ArrayList` is a non-generic collection that stores items as `Object`, which means you'll have to cast them back to their original type when you retrieve them.
Instead of `ArrayList`, you ca... | 12,449 | [
{
"from": "human",
"value": "I thought that there was some way in .net 3.0 to give an array list a type so that it didnt just return Object's but I'm having trouble doing so. Is it possible? If so, how?\n"
},
{
"from": "gpt",
"value": "In .NET 3.0, you can use generics to create a strongly-typed... |
I'm working with DotNetNuke's scheduler to schedule tasks and I'm looking to get the physical file path of a email template that I created. The problem is that HttpContext is NULL because the scheduled task is on a different thread and there is not http request. How would you go about getting the file's physical path?
| When working with DotNetNuke (DNN) and trying to access a physical file path from a scheduled task, you are correct that `HttpContext.Current` may be null since scheduled tasks run outside of the context of an HTTP request. Instead, you can use the application's root path to locate your email templates.
Here's a way t... | 10,715 | [
{
"from": "human",
"value": "I'm working with DotNetNuke's scheduler to schedule tasks and I'm looking to get the physical file path of a email template that I created. The problem is that HttpContext is NULL because the scheduled task is on a different thread and there is not http request. How would you go... |
in Javascript, the following:
var test = '"the quick" "brown fox" "jumps over" "the lazy dog"';
var result = test.match(/".*?"/g);
alert(result);
yields "the quick","brown fox","jumps over","the lazy dog"
I want each matched element to be unquoted: the quick,brown fox,jumps over,the lazy dog
what regexp will do this?
| To remove the quotes from each matched element while still using regular expressions, you can modify your approach. One way to do this is to use a `replace` method on the matched result to remove the quotes.
Here's how you can achieve this:
```javascript
var test = '"the quick" "brown fox" "jumps over" "the lazy dog... | 14,135 | [
{
"from": "human",
"value": "in Javascript, the following:\nvar test = '\"the quick\" \"brown fox\" \"jumps over\" \"the lazy dog\"';\nvar result = test.match(/\".*?\"/g);\nalert(result);\n\nyields \"the quick\",\"brown fox\",\"jumps over\",\"the lazy dog\"\nI want each matched element to be unquoted: the q... |
Using Visual Studio 2008 Team Edition, is it possible to assign a shortcut key that switches between markup and code? If not, is it possible to assign a shortcut key that goes from code to markup?
| In Visual Studio 2008, you cannot directly assign a keyboard shortcut to switch between markup and code view (such as for ASP.NET pages) since there isn't a built-in command that specifically handles this toggle. However, you can assign shortcuts for individual views.
To switch from code to markup or vice versa, you t... | 12,516 | [
{
"from": "human",
"value": "Using Visual Studio 2008 Team Edition, is it possible to assign a shortcut key that switches between markup and code? If not, is it possible to assign a shortcut key that goes from code to markup?\n"
},
{
"from": "gpt",
"value": "In Visual Studio 2008, you cannot dir... |
In my rails app I use the validation helpers in my active record objects and they are great. When there is a problem I see the standard "3 errors prohibited this foobar from being saved" on my web page along with the individual problems.
Is there any way I can override this default message with my own?
| Yes, you can customize the default error messages in your Rails application. The default message you see, such as "3 errors prohibited this foobar from being saved," is generated by the `errors` method in your Active Record models. You can override it by defining your own message in your model or by using I18n localiza... | 10,371 | [
{
"from": "human",
"value": "In my rails app I use the validation helpers in my active record objects and they are great. When there is a problem I see the standard \"3 errors prohibited this foobar from being saved\" on my web page along with the individual problems. \nIs there any way I can override this ... |
Is it possible to make a site with ASP.NET MVC Framework using .NET 2.0? I am limited to using .NET 2.0 (we use VS 2008, but we have to use the 2.0 Framework) and I really want to try out the MVC Framework.
| The ASP.NET MVC Framework was introduced with version 1.0 of ASP.NET MVC, which requires at least .NET Framework 3.5. Therefore, it is not possible to use ASP.NET MVC with .NET Framework 2.0 directly.
If you are constrained to using .NET 2.0, you will not be able to utilize the MVC pattern as implemented in the ASP.N... | 14,688 | [
{
"from": "human",
"value": "Is it possible to make a site with ASP.NET MVC Framework using .NET 2.0? I am limited to using .NET 2.0 (we use VS 2008, but we have to use the 2.0 Framework) and I really want to try out the MVC Framework.\n"
},
{
"from": "gpt",
"value": "The ASP.NET MVC Framework ... |
I am trying to access a Windows Media Player library from ASP.NET.
The following code:
WMPLib.WindowsMediaPlayer mplayer = new WMPLib.WindowsMediaPlayer();
WMPLib.IWMPStringCollection list = mplayer.mediaCollection.getAttributeStringCollection("artist", "audio");
Returns an non-empty list when run using the VS2005 deve... | Accessing the Windows Media Player library via ASP.NET while hosted on IIS can be problematic due to permission and security context issues. The `WMPLib` library is generally tied to the user's profile, which may not be fully available in the context of an IIS application. Here are some approaches you can try to work a... | 11,643 | [
{
"from": "human",
"value": "I am trying to access a Windows Media Player library from ASP.NET.\nThe following code:\nWMPLib.WindowsMediaPlayer mplayer = new WMPLib.WindowsMediaPlayer();\nWMPLib.IWMPStringCollection list = mplayer.mediaCollection.getAttributeStringCollection(\"artist\", \"audio\");\nReturns... |
In ASP.NET MVC it's possible to choice between having a typed view were you define in the codebehind what kind of data the view can should expect. But it's also possible to not define this and just pass any kind of data to view in a ViewData container.
What would the best model here or should I mix depending on what ki... | In ASP.NET MVC, you have two primary ways to pass data to your views: using a strongly typed model (by specifying a model type in your view) or using the `ViewData` dictionary (which is a loosely typed way of passing data). Each approach has its own advantages and trade-offs, and the best choice often depends on your s... | 11,324 | [
{
"from": "human",
"value": "In ASP.NET MVC it's possible to choice between having a typed view were you define in the codebehind what kind of data the view can should expect. But it's also possible to not define this and just pass any kind of data to view in a ViewData container.\nWhat would the best model... |
I need to create a nice installer for a Mac application. I want it to be a disk image (DMG), with a predefined size, layout and background image.
I need to do this programmatically in a script, to be integrated in an existing build system (more of a pack system really, since it only create installers. The builds are do... | Creating a custom layout for a DMG installer on macOS, including specifying a background image and icon arrangement, can be accomplished with some additional command-line tools and steps after you create the DMG with `hdiutil`. Below are the steps you can follow to automate the layout and background customization of yo... | 9,914 | [
{
"from": "human",
"value": "I need to create a nice installer for a Mac application. I want it to be a disk image (DMG), with a predefined size, layout and background image.\nI need to do this programmatically in a script, to be integrated in an existing build system (more of a pack system really, since it... |
We're seeing a crash when instantiating an instance of the System.Xml.Serialization.XmlSerializer class in a C# library. The crash occurs in the constructor, when it tries to add a duplicate key to a dictionary. I've included a stack trace below.
This crash is only occurring on one machine, and repairing our installa... | The issue you're encountering with `System.Xml.Serialization.XmlSerializer` is related to the internal compilation process of XML serialization in .NET. The `ArgumentException` indicates that there is a duplicate key being added to a `Hashtable`, which can happen in the context of XML serialization under certain condit... | 9,357 | [
{
"from": "human",
"value": "We're seeing a crash when instantiating an instance of the System.Xml.Serialization.XmlSerializer class in a C# library. The crash occurs in the constructor, when it tries to add a duplicate key to a dictionary. I've included a stack trace below.\nThis crash is only occurring ... |
I have a PHP script that runs as a CGI program and the HTTP Authenticate header gets eaten and spit out. So I would like to implement some kind of FORM based authentication. As an added constraint, there is no database so no session data can be stored.
I am very open to having a master username and password. I just nee... | You can implement a basic form-based authentication system using PHP without a database by utilizing cookies for maintaining the session state. Below is a step-by-step guide to achieve this:
### Step 1: Create a Simple Authentication Form
Create an HTML form for users to log in. When they submit the form, it will sen... | 5,059 | [
{
"from": "human",
"value": "I have a PHP script that runs as a CGI program and the HTTP Authenticate header gets eaten and spit out. So I would like to implement some kind of FORM based authentication. As an added constraint, there is no database so no session data can be stored.\nI am very open to having ... |
I am having problems submitting forms which contain UTF-8 strings with Ajax. I am developing a Struts web application which runs in a Tomcat server. This is the environment I set up to work with UTF-8:
I have added the attributes URIEncoding="UTF-8" useBodyEncodingForURI="true" into the Connector tag to Tomcat's conf/... | It looks like you are facing issues when submitting forms containing UTF-8 strings using Ajax in your Struts web application running on a Tomcat server. Let's break down the possible causes and solutions for your problem.
### Common Issues and Solutions
1. **Character Encoding Configuration**:
You have correctly s... | 8,752 | [
{
"from": "human",
"value": "I am having problems submitting forms which contain UTF-8 strings with Ajax. I am developing a Struts web application which runs in a Tomcat server. This is the environment I set up to work with UTF-8:\n\nI have added the attributes URIEncoding=\"UTF-8\" useBodyEncodingForURI=\"... |
The Database Tuning Advisor is recommending that I create a bunch of statistics in my Database. I'm something of a SQL n00b, so this was the first time I'd ever come across such a creature. The entry in MSDN was a little obtuse - could someone explain what exactly this does, and why it's a good idea?
| Sure! Let's break down what statistics are in a database context and why they are important for performance tuning.
### What are Statistics?
In a relational database, statistics are metadata that describe the distribution of data in a table or an index. They provide the query optimizer with information about the data... | 11,342 | [
{
"from": "human",
"value": "The Database Tuning Advisor is recommending that I create a bunch of statistics in my Database. I'm something of a SQL n00b, so this was the first time I'd ever come across such a creature. The entry in MSDN was a little obtuse - could someone explain what exactly this does, a... |
Scenario:
A stored procedure receives from code a DateTime with, let's say DateTime.Now value, as a datetime parameter.
The stored procedure needs to store only the date part of the datetime on the row, but preserving all date related arithmetics for, to say, do searches over time intervals and doing reports based on... | When it comes to storing only the date part of a `DateTime` value in a database, while still allowing for effective date-related arithmetic and searches, there are several options to consider. The choice depends on the specific database system you are using (e.g., SQL Server, PostgreSQL, MySQL) and the requirements of ... | 10,015 | [
{
"from": "human",
"value": "Scenario:\n A stored procedure receives from code a DateTime with, let's say DateTime.Now value, as a datetime parameter.\n The stored procedure needs to store only the date part of the datetime on the row, but preserving all date related arithmetics for, to say, do searches ove... |
What's the best way to serialize a HashTable (or a data best navigated through a string indexer) with SOAP/XML?
Let's say I have a Foo that has an property Bar[] Bars. A Bar object has a key and a value. By default, this serializes to the following XML:
<Foo>
<Bars>
<Bar key="key0" value="value0"/>
...
</Ba... | To achieve a more customized XML serialization of your `Foo` class, where the `Bars` property is represented as key-value pairs in a flattened structure, you can leverage the `XmlSerializer` class in .NET along with implementing a custom XML serialization mechanism.
### Custom XML Serialization Approach
Instead of us... | 7,678 | [
{
"from": "human",
"value": "What's the best way to serialize a HashTable (or a data best navigated through a string indexer) with SOAP/XML?\nLet's say I have a Foo that has an property Bar[] Bars. A Bar object has a key and a value. By default, this serializes to the following XML:\n<Foo>\n <Bars>\n <B... |
I'm looking for a good server/client protocol supported in Python for making data requests/file transfers between one server and many clients. Security is also an issue - so secure login would be a plus. I've been looking into XML-RPC, but it looks to be a pretty old (and possibly unused these days?) protocol.
| If you're looking for a robust server/client protocol in Python for data requests and file transfers, with security considerations, there are several modern options that you can consider:
### 1. **HTTP/REST with Flask or FastAPI**
- **Description**: Using HTTP/RESTful APIs is one of the most common approaches. Librari... | 7,016 | [
{
"from": "human",
"value": "I'm looking for a good server/client protocol supported in Python for making data requests/file transfers between one server and many clients. Security is also an issue - so secure login would be a plus. I've been looking into XML-RPC, but it looks to be a pretty old (and poss... |
I have two threads, one needs to poll a bunch of separate static resources looking for updates. The other one needs to get the data and store it in the database. How can thread 1 tell thread 2 that there is something to process?
| In a multi-threaded application, you can use various synchronization mechanisms to allow one thread (Thread 1) to notify another thread (Thread 2) when there is something to process. Here are several common approaches to achieve this:
### 1. Using a BlockingQueue
A `BlockingQueue` is a thread-safe data structure that ... | 7,230 | [
{
"from": "human",
"value": "I have two threads, one needs to poll a bunch of separate static resources looking for updates. The other one needs to get the data and store it in the database. How can thread 1 tell thread 2 that there is something to process?\n"
},
{
"from": "gpt",
"value": "In a... |
How can you implement trackbacks on a custom-coded blog (written in C#)?
| Implementing trackbacks on a custom-coded blog in C# involves several steps, from designing the data structure to handling incoming trackbacks and responding to them. Here’s a general guide to help you implement trackbacks on your C# blog:
### Step 1: Understand Trackbacks
Before implementing, it’s important to know ... | 6,762 | [
{
"from": "human",
"value": "How can you implement trackbacks on a custom-coded blog (written in C#)?\n"
},
{
"from": "gpt",
"value": "Implementing trackbacks on a custom-coded blog in C# involves several steps, from designing the data structure to handling incoming trackbacks and responding to ... |
I don't seem to be able to close the OledbDataReader object after reading data from it. Here is the relevant code -
Dim conSyBase As New OleDb.OleDbConnection("Provider=Sybase.ASEOLEDBProvider.2;Server Name=xx.xx.xx.xx;Server Port Address=5000;Initial Catalog=xxxxxxxxxx;User ID=xxxxxxxx;Password=xxxxxxxxx;")
conSyBase... | If your application hangs when trying to close the `OleDbDataReader`, there are a few potential issues to investigate:
1. **Reader is still being used**: Ensure that there are no other threads or asynchronous operations still accessing the `OleDbDataReader`. The reader must be fully consumed before closing it. In your... | 11,212 | [
{
"from": "human",
"value": "I don't seem to be able to close the OledbDataReader object after reading data from it. Here is the relevant code -\nDim conSyBase As New OleDb.OleDbConnection(\"Provider=Sybase.ASEOLEDBProvider.2;Server Name=xx.xx.xx.xx;Server Port Address=5000;Initial Catalog=xxxxxxxxxx;User I... |
GWT's serializer has limited java.io.Serializable support, but for security reasons there is a whitelist of types it supports. The documentation I've found, for example this FAQ entry says that any types you want to serialize "must be included in the serialization policy whitelist", and that the list is generated at c... | In GWT (Google Web Toolkit), the serialization policy is indeed generated at compile time, and it determines which classes can be serialized based on a whitelist. Classes that are to be serialized need to be explicitly listed in this whitelist. Unfortunately, not all `Serializable` classes from the standard library are... | 11,470 | [
{
"from": "human",
"value": "GWT's serializer has limited java.io.Serializable support, but for security reasons there is a whitelist of types it supports. The documentation I've found, for example this FAQ entry says that any types you want to serialize \"must be included in the serialization policy white... |
Everyone is aware of Dijkstra's Letters to the editor: go to statement considered harmful (also here .html transcript and here .pdf) and there has been a formidable push since that time to eschew the goto statement whenever possible. While it's possible to use goto to produce unmaintainable, sprawling code, it neverthe... | The debate around the `goto` statement and its implications in programming has a rich history, and both Dijkstra and Knuth contribute important perspectives to this discourse. Let's break down the questions regarding the appropriate use of `goto`, its potential pitfalls, and the specific case of C's `setjmp()` and `lon... | 8,906 | [
{
"from": "human",
"value": "Everyone is aware of Dijkstra's Letters to the editor: go to statement considered harmful (also here .html transcript and here .pdf) and there has been a formidable push since that time to eschew the goto statement whenever possible. While it's possible to use goto to produce un... |
What would be the best way to develop a text box that remembers the last x number of entries that were put into it. This is a standalone app written with C#.
| To develop a text box in a standalone C# application that remembers the last `x` number of entries, you can follow these steps. This example will use a Windows Forms application for illustration. The key components will include a `TextBox`, a `List` to hold the entries, and some method to save and retrieve the entries.... | 7,221 | [
{
"from": "human",
"value": "What would be the best way to develop a text box that remembers the last x number of entries that were put into it. This is a standalone app written with C#.\n"
},
{
"from": "gpt",
"value": "To develop a text box in a standalone C# application that remembers the las... |
I am a .Net developer that has been tasked with upgrading a classic asp website to asp.net. The website is currently running on luck and bubble gum but there is not enough time or money to stop progress and do a full rewrite. Of course I will still need to be able to deliver new features while I am upgrading.
What stra... | Upgrading a classic ASP website to ASP.NET can be a significant challenge, especially when balancing the need for new features with the demands of an upgrade. Below are some strategies that can help you achieve a smooth, gradual transition:
### 1. Assess the Current Application
- **Code Audit**: Perform an audit of th... | 9,095 | [
{
"from": "human",
"value": "I am a .Net developer that has been tasked with upgrading a classic asp website to asp.net. The website is currently running on luck and bubble gum but there is not enough time or money to stop progress and do a full rewrite. Of course I will still need to be able to deliver new... |
Keep in mind that I'm not looking for a list of current browsers to support, I'm looking for logical ways to make that list, backed by some kind of hard statistics.
Since it's been a while since my last web job, I decided to do this latest site up from scratch. Now I have to decide again what to support in terms of br... | Determining which browsers to support for your website is a crucial decision that can impact user experience, accessibility, and development time. Here are some logical approaches to help you formulate a list based on reliable data and statistics:
### 1. **Browser Market Share Analysis**
- **Use Analytics Tools**: ... | 7,510 | [
{
"from": "human",
"value": "Keep in mind that I'm not looking for a list of current browsers to support, I'm looking for logical ways to make that list, backed by some kind of hard statistics. \nSince it's been a while since my last web job, I decided to do this latest site up from scratch. Now I have to d... |
The Query Optimizer is estimating that the results of a join will have only one row, when the actual number of rows is 2000. This is causing later joins on the dataset to have an estimated result of one row, when some of them go as high as 30,000.
With a count of 1, the QO is choosing a loop join/index seek strategy fo... | The issues you're facing with the Query Optimizer in SQL Server 2000 can often stem from inaccurate cardinality estimates after joins, especially in a highly normalized database. Given that you've observed significant performance improvements by constraining join strategies, it’s clear that the QO's estimates are leadi... | 9,898 | [
{
"from": "human",
"value": "The Query Optimizer is estimating that the results of a join will have only one row, when the actual number of rows is 2000. This is causing later joins on the dataset to have an estimated result of one row, when some of them go as high as 30,000.\nWith a count of 1, the QO is c... |
I'm currently using ImageMagick to determine the size of images uploaded to the website. By calling ImageMagick's "identify" on the command line it takes about 0.42 seconds to determine a 1MB JPEG's dimensions along with the fact that it's a JPEG. I find that a bit slow.
Using the Imagick PHP library is even slower as ... | If you're looking for a faster solution for determining the dimensions and type of JPEG and PNG images using PHP, you can consider a few alternatives to ImageMagick. Here are some options you can explore:
### 1. **Use `exiftool`**
`exiftool` is a powerful command-line tool for reading and writing meta information in v... | 9,141 | [
{
"from": "human",
"value": "I'm currently using ImageMagick to determine the size of images uploaded to the website. By calling ImageMagick's \"identify\" on the command line it takes about 0.42 seconds to determine a 1MB JPEG's dimensions along with the fact that it's a JPEG. I find that a bit slow.\nUsin... |
I want to check for the existence of a table with a given ID in a word document in C# (VS 2008) Visual Studio Tools for Office (version 3).
Obviously I can iterate through the document's Tables collection and check every ID, but this seems inefficient; the document will end up having a few dozen tables after I'm done w... | In the context of Microsoft Office Interop in C# (specifically with Word), you're correct that there isn't a direct way to check for the existence of a table by its ID without iterating through the `Tables` collection. Unfortunately, the Word Interop API does not provide a built-in method to check for the existence of ... | 10,541 | [
{
"from": "human",
"value": "I want to check for the existence of a table with a given ID in a word document in C# (VS 2008) Visual Studio Tools for Office (version 3).\nObviously I can iterate through the document's Tables collection and check every ID, but this seems inefficient; the document will end up ... |
I have written a simple HTTP Proxy server in C# that I would like to integration/functional test. Is there a product already created that I could use to do this? If not, what is the best way to write my own tests for this (I already have unit tests)?
| Integrating and functional testing an HTTP proxy server can be approached in a few different ways, and there are tools available that could help you conduct these tests, as well as strategies to create your own tests.
### Existing Tools for Integration/Functional Testing:
1. **Postman:**
- You can use Postman to ... | 8,889 | [
{
"from": "human",
"value": "I have written a simple HTTP Proxy server in C# that I would like to integration/functional test. Is there a product already created that I could use to do this? If not, what is the best way to write my own tests for this (I already have unit tests)?\n"
},
{
"from": "g... |
There's a diagram depicting the difference between traditional MVC and Cocoa MVC here:
Cocoa Design Patterns: The Model-View-Controller Design Pattern
Are there any benefits of doing it the "Cocoa" way in .NET using Visual Studio?
| The Cocoa MVC (Model-View-Controller) pattern differs from the traditional MVC pattern in a few key ways, primarily in how responsibilities are distributed among the components. Adopting a Cocoa-style MVC in a .NET environment using Visual Studio can bring several benefits, especially if you are developing applications... | 9,071 | [
{
"from": "human",
"value": "There's a diagram depicting the difference between traditional MVC and Cocoa MVC here:\nCocoa Design Patterns: The Model-View-Controller Design Pattern\nAre there any benefits of doing it the \"Cocoa\" way in .NET using Visual Studio?\n"
},
{
"from": "gpt",
"value": ... |
i've created a Form Panel, and i'm rendering couple of Combo Boxes in the panel with a store which is populated via an response handler.
the problem if i want to render the panel again it renders the combo boxes without the store, though i'm re-constructing the panel.
i tried to debug to figure out the cause and surpri... | It sounds like you're encountering issues with the lifecycle of your ComboBoxes and their associated stores in ExtJS (or a similar framework). When a component is rendered, it checks its state (specifically the `isRendered` property) before performing certain operations, like adding a store, which is why you're experie... | 8,981 | [
{
"from": "human",
"value": "i've created a Form Panel, and i'm rendering couple of Combo Boxes in the panel with a store which is populated via an response handler.\nthe problem if i want to render the panel again it renders the combo boxes without the store, though i'm re-constructing the panel.\ni tried ... |
I am trying to publish an Asp.net MVC web application locally using the NAnt and MSBuild. This is what I am using for my NAnt target;
<target name="publish-artifacts-to-build">
<msbuild project="my-solution.sln" target="Publish">
<property name="Configuration" value="debug" />
<property name="OutDir" va... | Publishing an ASP.NET MVC web application using MSBuild and NAnt is indeed possible, but the error message you are encountering, "Skipping unpublishable project," suggests that the project you are trying to publish is not set up properly for publishing. There are a few considerations and modifications you might want to... | 6,732 | [
{
"from": "human",
"value": "I am trying to publish an Asp.net MVC web application locally using the NAnt and MSBuild. This is what I am using for my NAnt target;\n<target name=\"publish-artifacts-to-build\">\n <msbuild project=\"my-solution.sln\" target=\"Publish\">\n <property name=\"Configuration... |
Ok, I get the basics of video format - there are some container formats and then you have core video/audio formats. I would like to write a web based application that determines what video/audio codec a file is using.
How best can I programmatically determine a video codec? Would it be best to use a standard library vi... | To programmatically determine the video/audio codec of a file in a web-based application, using a standard library or tool that handles multimedia files is indeed a common and effective approach. Here are a few methods you can consider:
### 1. Use FFmpeg Library (ffprobe)
**FFmpeg** is one of the most widely used mul... | 8,029 | [
{
"from": "human",
"value": "Ok, I get the basics of video format - there are some container formats and then you have core video/audio formats. I would like to write a web based application that determines what video/audio codec a file is using.\nHow best can I programmatically determine a video codec? Wou... |
How do you show your clients/employers that you understood their requirements?
What do you recommend to use? Use-Case diagrams? Flow-Charts? Data-Flow-Diagrams? Decision Trees?
I'm not really asking for a very detailed answer. Just something simple to help me communicate with the person who wrote the requirements and t... | To effectively demonstrate your understanding of client or employer requirements, you can use several visual tools. Here are some recommendations:
1. **Use Case Diagrams**: These are great for illustrating the interactions between users (actors) and the system. They help clarify user requirements and ensure you unders... | 14,188 | [
{
"from": "human",
"value": "How do you show your clients/employers that you understood their requirements?\nWhat do you recommend to use? Use-Case diagrams? Flow-Charts? Data-Flow-Diagrams? Decision Trees?\nI'm not really asking for a very detailed answer. Just something simple to help me communicate with ... |
What can be a practical solution to center vertically and horizontally content in HTML that works in Firefox, IE6 and IE7?
Some details:
I am looking for solution for the entire page.
You need to specify only width of the element to be centered. Height of the element is not known in design time.
When minimizing window... | To achieve vertical and horizontal centering of an element using HTML that is compatible with Firefox, IE6, and IE7, we can use a combination of a table layout and CSS styling. Here's a practical solution to center a dynamic-height element while ensuring proper whitespace management:
```html
<!DOCTYPE html>
<html lang... | 10,625 | [
{
"from": "human",
"value": "What can be a practical solution to center vertically and horizontally content in HTML that works in Firefox, IE6 and IE7?\nSome details:\n\nI am looking for solution for the entire page.\nYou need to specify only width of the element to be centered. Height of the element is not... |
I have a list of things (I'll call it L), an index(N) and a new thing(NEW). If I want to replace the thing in L at N with NEW, what is the best way to do this? Should I get the sublist up to N and from N to the end of the list and then glue together a new list from the first part, NEW, and the last part using list? Or ... | In Python, the most straightforward and efficient way to replace an element in a list at a specific index with a new value is to directly assign the new value to that index. You don't need to create sublists or concatenate them. Here's how you can do it:
```python
L = ['a', 'b', 'c', 'd'] # Example list
N = 2 # Inde... | 14,545 | [
{
"from": "human",
"value": "I have a list of things (I'll call it L), an index(N) and a new thing(NEW). If I want to replace the thing in L at N with NEW, what is the best way to do this? Should I get the sublist up to N and from N to the end of the list and then glue together a new list from the first par... |
When multiple scanf() statements are encountered in the code, then, except the first scanf() statement, all others are skipped, that is, there is no prompt for input for those scanf() statements when the code is run.
I have a tried a few suggestions. For eg, use of flushall() was suggested on some site, but that gives ... | The issue you're experiencing with `scanf()` statements being skipped often arises from how input is handled in C. A common cause for this is leftover newline characters in the input buffer when using `scanf()` with `%d`, `%f`, or similar format specifiers.
When you read input with `scanf()`, if you enter a number an... | 12,293 | [
{
"from": "human",
"value": "When multiple scanf() statements are encountered in the code, then, except the first scanf() statement, all others are skipped, that is, there is no prompt for input for those scanf() statements when the code is run.\nI have a tried a few suggestions. For eg, use of flushall() w... |
It has always been best practice to open links in the same window. Should that still be the rule now that most common browsers use tabs? Personally i prefer closing a tab/window over hitting the backbutton. What are your thoughts?
| The best practice regarding how links should open—whether in the same window or a new tab—has evolved with user preferences and browser behavior. Here are a few considerations:
1. **User Control**: Many users prefer to have control over how links open. By default, opening links in the same window can be less disruptiv... | 13,083 | [
{
"from": "human",
"value": "It has always been best practice to open links in the same window. Should that still be the rule now that most common browsers use tabs? Personally i prefer closing a tab/window over hitting the backbutton. What are your thoughts?\n"
},
{
"from": "gpt",
"value": "The... |
Do I have to restart IIS if I drop a new DLL in the bin of my virtual directory?
| In Internet Information Services (IIS), when you drop a new DLL into the `bin` directory of your virtual directory, the application domain associated with that application will be automatically recycled, which means that the application will restart. This is because changes in the `bin` folder, including adding or modi... | 14,485 | [
{
"from": "human",
"value": "Do I have to restart IIS if I drop a new DLL in the bin of my virtual directory?\n"
},
{
"from": "gpt",
"value": "In Internet Information Services (IIS), when you drop a new DLL into the `bin` directory of your virtual directory, the application domain associated wit... |
I'm working on a MS CRM server for a project at my university.
What I'm trying to do is to let the user of the CRM to tag some contacts, I thought of creating an entity to archive the tags an to create an N:N relationship between the tag entity and the contact one.
I've created and published the new entity and the rela... | It sounds like you’re on the right track with creating a tag entity and establishing a many-to-many (N:N) relationship with the contact entity in Microsoft Dynamics CRM. To add a lookup field or sub-grid to the contact form for the tags, follow these steps:
### Step 1: Access the Form Editor
1. **Navigate to Customiza... | 9,048 | [
{
"from": "human",
"value": "I'm working on a MS CRM server for a project at my university.\nWhat I'm trying to do is to let the user of the CRM to tag some contacts, I thought of creating an entity to archive the tags an to create an N:N relationship between the tag entity and the contact one.\nI've create... |
I'm using firefox3 to run a Java Applet (on Linux). normally, when the JVM launches the Java Console window opens so I can see output from the Applet (stack traces etc.).
However, if I close the console there appears to be no way of getting it back short of restarting Firefox (I have to close the console because it mak... | In Firefox 3 on Linux, particularly on Ubuntu, the Java Console might not have a direct option under the menu as it does on some other platforms. However, you can still reopen the Java Console manually. Here are some steps you can follow:
1. **Launch Java Console Manually:**
You can try launching the Java Console f... | 12,309 | [
{
"from": "human",
"value": "I'm using firefox3 to run a Java Applet (on Linux). normally, when the JVM launches the Java Console window opens so I can see output from the Applet (stack traces etc.).\nHowever, if I close the console there appears to be no way of getting it back short of restarting Firefox (... |
What would be better practice when giving a function the original variable to work with:
unsigned long x = 4;
void func1(unsigned long& val) {
val = 5;
}
func1(x);
or:
void func2(unsigned long* val) {
*val = 5;
}
func2(&x);
IOW: Is there any reason to pick one over another?
| Both approaches you provided—using a reference (`unsigned long&`) versus using a pointer (`unsigned long*`)—are valid for passing a variable to a function in C++. However, there are some differences in usage, readability, and the conventions that can guide the choice between them.
### Using a Reference (`unsigned long... | 9,365 | [
{
"from": "human",
"value": "What would be better practice when giving a function the original variable to work with:\nunsigned long x = 4;\n\nvoid func1(unsigned long& val) {\n val = 5; \n}\nfunc1(x);\n\nor:\nvoid func2(unsigned long* val) {\n *val = 5;\n}\nfunc2(&x);\n\nIOW: Is there an... |
I want to be able to generate a highly graphical (with lots of text content as well) PDF file from data that I might have in a database or xml or any other structured form.
Currently our graphic designer creates these PDF files in Photoshop manually after getting the content as a MS Word Document. But usually, there ar... | To automate the generation of highly graphical PDF files from structured data like a database or XML, you can use various tools and techniques that combine templating, data integration, and PDF generation. Here’s a step-by-step approach to set up a system that will allow you to achieve this:
### Step 1: Define the Tem... | 9,619 | [
{
"from": "human",
"value": "I want to be able to generate a highly graphical (with lots of text content as well) PDF file from data that I might have in a database or xml or any other structured form.\nCurrently our graphic designer creates these PDF files in Photoshop manually after getting the content as... |
Obviously I can use BCP but here is the issue. If one of the records in a Batch have an invalid date I want to redirect that to a separate table/file/whatever, but keep the batch processing running. I don't think SSIS can be installed on the server which would have helped.
| If you're unable to use SSIS and need to handle invalid records during a bulk data operation, you can use a combination of SQL Server features and T-SQL to accomplish this. Below are a few potential approaches you can consider to redirect invalid records to a separate destination while keeping the batch processing runn... | 8,410 | [
{
"from": "human",
"value": "Obviously I can use BCP but here is the issue. If one of the records in a Batch have an invalid date I want to redirect that to a separate table/file/whatever, but keep the batch processing running. I don't think SSIS can be installed on the server which would have helped.\n"
... |
I am currently working on (or at least planning) a couple of projects that work with large amounts of repetitive data. The kind of data that works well in a spreadsheet or database, but is nasty in XML. :)
NetCDF seems like a great option for a file format. However, my work is in C# and there is no "official" NetCDF im... | Working with large amounts of repetitive data can indeed be challenging, and choosing the right format is crucial for both performance and ease of use. NetCDF is a great choice for many applications, especially in fields like scientific computing, where multidimensional data structures are common.
### Options for Usin... | 8,145 | [
{
"from": "human",
"value": "I am currently working on (or at least planning) a couple of projects that work with large amounts of repetitive data. The kind of data that works well in a spreadsheet or database, but is nasty in XML. :)\nNetCDF seems like a great option for a file format. However, my work is ... |
ex: <a><strike>example data in here</strike></a>
I want everything inside the a tag, to the end
/<a>([^<]*)<\/a>/
It works when there are no additional tags within the <a> tag, but what if there are?
I want to know if you can tell it to grab everything up to [^</a>] instead of [^<] only.
Doing it with /<a>(.*)<\/a>... | To capture everything inside an `<a>` tag, including any nested tags, you can use a regex pattern that allows for more flexibility. The issue with using `.*` is that it is greedy and will match as much as possible, which can lead to unexpected results when there are nested tags.
Instead, you can use a non-greedy appro... | 12,892 | [
{
"from": "human",
"value": "ex: <a><strike>example data in here</strike></a> \nI want everything inside the a tag, to the end \n/<a>([^<]*)<\\/a>/\n\nIt works when there are no additional tags within the <a> tag, but what if there are? \nI want to know if you can tell it to grab everything up to [^</a>] in... |
In Sitecore 6, one of my templates contains a "Droplink" field bound to the results of a particular sitecore query. This query currently returns approximately 200 items.
When I look at an item that implements this template in the content editor, I can only see the first 50 items in the field's dropdown list.
How do I d... | In Sitecore 6, the default behavior for fields like "Droplink" is to limit the number of items displayed in the dropdown to improve performance. However, if you want to display all items returned by your query, you'll need to modify the field's behavior.
Here are a few steps you can follow to display all the items in... | 8,894 | [
{
"from": "human",
"value": "In Sitecore 6, one of my templates contains a \"Droplink\" field bound to the results of a particular sitecore query. This query currently returns approximately 200 items.\nWhen I look at an item that implements this template in the content editor, I can only see the first 50 it... |
I am developing a C++ class library containing domain model classes, and I would like to add support for instantiating these classes from various persistence mechanisms, i.e. databases and file. The user of the class library should be given an interface(?) against which to program a class that can transfer the data fro... | When designing a C++ class library that needs to support various persistence mechanisms for your domain model classes, you're correct in thinking about design patterns that can help with separation of concerns and abstraction. Here are a few approaches you can consider:
### 1. Data Access Object (DAO) Pattern
The DAO... | 8,093 | [
{
"from": "human",
"value": "I am developing a C++ class library containing domain model classes, and I would like to add support for instantiating these classes from various persistence mechanisms, i.e. databases and file. The user of the class library should be given an interface(?) against which to progr... |
In the process of updating a web app from ASP to ASP.NET, I want to insert one of the new files into the old app to test something - is this an offence against reason?
| Inserting a new ASP.NET file into an old ASP application can lead to potential issues, but whether it is an "offense against reason" depends on the context and your goals. Here are some considerations:
1. **Compatibility**: ASP and ASP.NET are fundamentally different technologies. Mixing them without a proper architec... | 13,595 | [
{
"from": "human",
"value": "In the process of updating a web app from ASP to ASP.NET, I want to insert one of the new files into the old app to test something - is this an offence against reason?\n"
},
{
"from": "gpt",
"value": "Inserting a new ASP.NET file into an old ASP application can lead ... |
How does one invoke a groovy method that prints to stdout, appending the output to a string?
| In Groovy, you can invoke a method that prints to stdout and capture its output by redirecting the standard output stream. One common approach is to use a `ByteArrayOutputStream` to capture the output from `System.out`. Here's how you can do it:
1. Create a `ByteArrayOutputStream` to hold the output.
2. Set the standa... | 11,514 | [
{
"from": "human",
"value": "How does one invoke a groovy method that prints to stdout, appending the output to a string?\n"
},
{
"from": "gpt",
"value": "In Groovy, you can invoke a method that prints to stdout and capture its output by redirecting the standard output stream. One common approac... |
Eg. can I write something like this code:
public void InactiveCustomers(IEnumerable<Guid> customerIDs)
{
//...
myAdoCommand.CommandText =
"UPDATE Customer SET Active = 0 WHERE CustomerID in (@CustomerIDs)";
myAdoCommand.Parameters["@CustomerIDs"].Value = customerIDs;
//...
}
The only way I know... | The approach you've outlined won't work directly because SQL parameters don't support passing in a collection (like `IEnumerable<Guid>`) as a single parameter. Instead, you have to construct a SQL string that includes each `CustomerID` in the `IN` clause.
While string concatenation can work, it poses security risks su... | 11,044 | [
{
"from": "human",
"value": "Eg. can I write something like this code:\npublic void InactiveCustomers(IEnumerable<Guid> customerIDs)\n{\n //...\n myAdoCommand.CommandText =\n \"UPDATE Customer SET Active = 0 WHERE CustomerID in (@CustomerIDs)\";\n myAdoCommand.Parameters[\"@CustomerIDs\"].Va... |
Anyone familiar with specific security issues in the current version of DotNetNuke?
(I've already checked out their site, securityfocus, etc...)
I've reopened the question, since my client developed their system using DotNetNuke - hence it is a programming question. I just need to know some issues regarding this platfo... | As of my last update, DotNetNuke (now known as DNN) is a web content management system and web application framework. Security issues can vary significantly across versions, and vulnerabilities often emerge based on how the platform is used and configured. Here are some common security considerations and issues associa... | 11,531 | [
{
"from": "human",
"value": "Anyone familiar with specific security issues in the current version of DotNetNuke?\n(I've already checked out their site, securityfocus, etc...)\nI've reopened the question, since my client developed their system using DotNetNuke - hence it is a programming question. I just nee... |
Being stuck with a legacy database schema that no longer reflects your data model is every developer's nightmare. Yet with all the talk of refactoring code for maintainability I have not heard much of refactoring outdated database schemas.
What are some tips on how to transition to a better schema without breaking a... | Refactoring a legacy database schema without breaking existing code can be a daunting task, especially when it involves fundamental changes like consolidating separate tables into a more logical structure. However, with careful planning and gradual implementation, you can transition to a new schema more smoothly. Here ... | 9,353 | [
{
"from": "human",
"value": "Being stuck with a legacy database schema that no longer reflects your data model is every developer's nightmare. Yet with all the talk of refactoring code for maintainability I have not heard much of refactoring outdated database schemas. \nWhat are some tips on how to transi... |
I have a SQL Server 2005 database that could only be restored using
Restore Database The_DB_Name
From Disk = 'C:\etc\etc'
With Continue_After_Error
I am told the source database was fine. The restore reports
Warning: A column nullability
inconsistency was detected in the
metadata of index
"IDX_Comp_CompanyId" (... | You are in a significant amount of trouble with your SQL Server 2005 database. The errors you are encountering indicate that there are serious integrity issues with your database that need to be addressed immediately. Here’s a breakdown of the situation based on the errors:
1. **Warning about Column Nullability**: The... | 6,453 | [
{
"from": "human",
"value": "I have a SQL Server 2005 database that could only be restored using\nRestore Database The_DB_Name\nFrom Disk = 'C:\\etc\\etc'\nWith Continue_After_Error\n\nI am told the source database was fine. The restore reports\n\nWarning: A column nullability\n inconsistency was detected ... |
I'm writing a simple photo album app using ASP.NET Ajax.
The app uses async Ajax calls to pre-load the next photo in the album, without changing the URL in the browser.
The problem is that when the user clicks the back button in the browser, the app doesn't go back to the previous photo, instead, it navigates to the ho... | Yes, you can manage the browser's history and ensure that each photo displayed through your AJAX calls is added to the history stack. This way, when users click the back button, they can navigate to the previous photo rather than being redirected to the home page. You can achieve this using the `History API` available ... | 9,180 | [
{
"from": "human",
"value": "I'm writing a simple photo album app using ASP.NET Ajax.\nThe app uses async Ajax calls to pre-load the next photo in the album, without changing the URL in the browser.\nThe problem is that when the user clicks the back button in the browser, the app doesn't go back to the prev... |
The only experience I have so far with a touchscreen interface was one where everything was custom drawn, and I get the feeling it's not the most efficient way of doing it (even the most basic layout change is hell to make). I know plenty of GUI toolkits intended at keyboard & mouse interfaces, but can you advise somet... | For developing touchscreen interfaces, you have several GUI toolkits and frameworks that are designed with touch interactions in mind. Here are some recommendations suitable for Windows and potentially cross-platform development:
1. **Qt**:
- **Overview**: Qt is a powerful and versatile framework that supports touc... | 8,435 | [
{
"from": "human",
"value": "The only experience I have so far with a touchscreen interface was one where everything was custom drawn, and I get the feeling it's not the most efficient way of doing it (even the most basic layout change is hell to make). I know plenty of GUI toolkits intended at keyboard & m... |
I have recently inherited a brownfield application that is currently live. Through response, or a response with a link, how and what is the best method to make changes to a site and deploy them to a live ASP .NET website.
| Managing a brownfield ASP.NET application can be challenging, especially when it comes to making changes and deploying them to a live environment. Here’s a comprehensive guide on the best methods to make changes and deploy them:
### 1. **Understand the Existing Application**
- **Documentation**: Review any existing... | 9,408 | [
{
"from": "human",
"value": "I have recently inherited a brownfield application that is currently live. Through response, or a response with a link, how and what is the best method to make changes to a site and deploy them to a live ASP .NET website.\n"
},
{
"from": "gpt",
"value": "Managing a b... |
How do you implement autocomplete on ASP.Net Gridview? Can anyone point me where to go to achieve this? I'm willing to use non-.Net ajax controls if that what it takes.
| Implementing an autocomplete feature in an ASP.NET GridView can enhance user experience by allowing them to quickly find and select items within a data entry field. Below is a step-by-step approach that will guide you through implementing autocomplete functionality using AJAX (with jQuery) in combination with an ASP.NE... | 5,356 | [
{
"from": "human",
"value": "How do you implement autocomplete on ASP.Net Gridview? Can anyone point me where to go to achieve this? I'm willing to use non-.Net ajax controls if that what it takes.\n"
},
{
"from": "gpt",
"value": "Implementing an autocomplete feature in an ASP.NET GridView can e... |
I want to see all the different ways you can come up with, for a factorial subroutine, or program. The hope is that anyone can come here and see if they might want to learn a new language.
Ideas:
Procedural
Functional
Object Oriented
One liners
Obfuscated
Oddball
Bad Code
Polyglot
Basically I want to see an example, ... | # Python: Procedural
- Simple and straightforward
- Uses recursion for clarity
```python
def factorial(n):
if n == 0 or n == 1:
return 1
return n * factorial(n - 1)
print(factorial(5)) # Output: 120
```
This implementation uses a classic recursive approach to calculate the factorial, which is easy ... | 4,544 | [
{
"from": "human",
"value": "I want to see all the different ways you can come up with, for a factorial subroutine, or program. The hope is that anyone can come here and see if they might want to learn a new language.\nIdeas:\n\nProcedural\nFunctional\nObject Oriented\nOne liners\nObfuscated\nOddball\nBad C... |
I have a XULRunner application that needs to copy image data to the clipboard. I have figured out how to handle copying text to the clipboard, and I can paste PNG data from the clipboard. What I can't figure out is how to get data from a data URL into the clipboard so that it can be pasted into other applications.
This... | To copy an image (like a PNG) to the clipboard in a XULRunner application, you need to convert the data URL of the image into binary data and then set this binary data into the clipboard using the appropriate format for images. Below is an example of how you can accomplish this.
### Steps to Copy a PNG Image from a Da... | 7,589 | [
{
"from": "human",
"value": "I have a XULRunner application that needs to copy image data to the clipboard. I have figured out how to handle copying text to the clipboard, and I can paste PNG data from the clipboard. What I can't figure out is how to get data from a data URL into the clipboard so that it ca... |
We have a graphics intensive application that seems to be experiencing problems on AMD 64 bit Dual Core platforms that are not apparent on Intel platforms.
Running the application causes the CPU to run at 100%, in particular when using code for shadows and lighting (Open GL).
Does anyone know of specific issues with AM... | When it comes to graphics-intensive applications, particularly those using OpenGL for shadows and lighting, there are several factors that can lead to performance discrepancies between AMD and Intel platforms. Here are some potential reasons for the high CPU usage you're observing, particularly with AMD Dual Core CPUs,... | 10,078 | [
{
"from": "human",
"value": "We have a graphics intensive application that seems to be experiencing problems on AMD 64 bit Dual Core platforms that are not apparent on Intel platforms.\nRunning the application causes the CPU to run at 100%, in particular when using code for shadows and lighting (Open GL).\n... |
I'm working on a WinCE 6.0 system with a touchscreen that stores its calibration data (x-y location, offset, etc.) in the system registry (HKLM\HARDWARE\TOUCH). Right now, I'm placing the cal values into registry keys that get put into the OS image at build time. That works fine for the monitor that I get the origina... | To save touchscreen calibration data to the Windows CE 6.0 registry such that it persists after a power cycle, you’ll need to ensure that you write the new calibration values to the correct registry keys. You can achieve this in C# by using the `Microsoft.Win32.Registry` namespace. Below is a method that demonstrates h... | 8,110 | [
{
"from": "human",
"value": "I'm working on a WinCE 6.0 system with a touchscreen that stores its calibration data (x-y location, offset, etc.) in the system registry (HKLM\\HARDWARE\\TOUCH). Right now, I'm placing the cal values into registry keys that get put into the OS image at build time. That works ... |
I currentyl have no clue on how to sort an array which contains UTF-8 encoded strings in PHP. The array comes from a LDAP server so sorting via a database (would be no problem) is no solution.
The following does not work on my windows development machine (although I'd think that this should be at least a possible solu... | Sorting UTF-8 strings in a locale-aware manner can be a bit tricky in PHP, especially on Windows due to limitations with the `setlocale` function and its lack of proper UTF-8 support. However, you can achieve the desired result using the `collator` extension provided by the `intl` (Internationalization) extension.
Her... | 12,940 | [
{
"from": "human",
"value": "I currentyl have no clue on how to sort an array which contains UTF-8 encoded strings in PHP. The array comes from a LDAP server so sorting via a database (would be no problem) is no solution. \nThe following does not work on my windows development machine (although I'd think th... |
The following two C# code snippets produce different results (assuming the variable level is used both before and after the recursive call). Why?
public DoStuff(int level)
{
// ...
DoStuff(level++);
// ...
}
,
public DoStuff(int level)
{
// ...
DoStuff(level+1);
// ...
}
After reading some of the response... | The difference in behavior between `DoStuff(level++)`, `DoStuff(++level)`, and `DoStuff(level + 1)` in your C# examples is due to how the post-increment (`level++`), pre-increment (`++level`), and addition (`level + 1`) operations work in terms of variable evaluation and scope.
Let's break down each of the three cases... | 10,720 | [
{
"from": "human",
"value": "The following two C# code snippets produce different results (assuming the variable level is used both before and after the recursive call). Why?\npublic DoStuff(int level)\n{\n // ...\n DoStuff(level++);\n // ...\n}\n\n,\npublic DoStuff(int level)\n{\n // ...\n DoStuff(lev... |
On my desktop I have written a small Pylons app that connects to Oracle. I'm now trying to deploy it to my server which is running Win2k3 x64. (My desktop is 32-bit XP) The Oracle installation on the server is also 64-bit.
I was getting errors about loading the OCI dll, so I installed the 32 bit client into C:\oracle... | To run your Pylons app as a service on Windows Server 2003 with a 32-bit Oracle client without modifying the global `PATH` environment variable, you can use the `subprocess` module to set the environment variables temporarily for your service. Here’s a basic approach to achieve this:
1. **Modify Your Service Script**:... | 9,234 | [
{
"from": "human",
"value": "On my desktop I have written a small Pylons app that connects to Oracle. I'm now trying to deploy it to my server which is running Win2k3 x64. (My desktop is 32-bit XP) The Oracle installation on the server is also 64-bit.\nI was getting errors about loading the OCI dll, so I ... |
I am looking for best practices for detecting and preventing DOS in the service implementation (not external network monitoring). The service handles queries for user, group and attribute information.
What is your favorite source of information on dealing with DOS?
| Detecting and preventing Denial of Service (DoS) attacks at the service implementation level involves a variety of strategies, techniques, and best practices. Here are some best practices and valuable resources for further information:
### Best Practices
1. **Rate Limiting:**
- Implement rate limiting to control t... | 8,554 | [
{
"from": "human",
"value": "I am looking for best practices for detecting and preventing DOS in the service implementation (not external network monitoring). The service handles queries for user, group and attribute information. \nWhat is your favorite source of information on dealing with DOS?\n"
},
... |
I've inherited a network spread out over a warehouse/front office consisting of approximately 50 desktop PCs, various servers, network printers, and routers/switches.
The "intelligent" routers live in the server room. As the company has grown, we've annexed additional space and not very elegantly run various lengths of... | To analyze and discover the network topology in your situation, where you are dealing with unmanaged switches and hubs that do not support SNMP, you have to rely on a more manual approach combined with network scanning tools. Here’s a step-by-step method you can use to map out your network topology:
### Step-by-Step A... | 9,323 | [
{
"from": "human",
"value": "I've inherited a network spread out over a warehouse/front office consisting of approximately 50 desktop PCs, various servers, network printers, and routers/switches.\nThe \"intelligent\" routers live in the server room. As the company has grown, we've annexed additional space a... |
I have a rails form with a datetime_select field. When I try to submit the form, I get the following exception:
ActiveRecord::MultiparameterAssignmentErrors in WidgetsController#update
1 error(s) on assignment of multiparameter attributes
If it's a validation error, why don't I see an error on the page?
This is in Ra... | The `ActiveRecord::MultiparameterAssignmentErrors` exception you're encountering in Rails 2.0.2 typically occurs when there is an issue with the parameters being submitted to the controller, particularly when you're using `datetime_select` fields. This error suggests that the parameters are not being correctly parsed i... | 10,185 | [
{
"from": "human",
"value": "I have a rails form with a datetime_select field. When I try to submit the form, I get the following exception:\nActiveRecord::MultiparameterAssignmentErrors in WidgetsController#update \n1 error(s) on assignment of multiparameter attributes\n\nIf it's a validation error, why do... |
I've had a lot of trouble trying to come up with the best way to properly follow TDD principles while developing UI in JavaScript. What's the best way to go about this?
Is it best to separate the visual from the functional? Do you develop the visual elements first, and then write tests and then code for functionality... | Test-Driven Development (TDD) can be challenging in the context of UI development, especially with JavaScript. However, by following some best practices and principles, you can effectively implement TDD in your UI projects. Here are some tips to help you with that:
### 1. **Separate Concerns:**
- **Visual vs. Funct... | 9,279 | [
{
"from": "human",
"value": "I've had a lot of trouble trying to come up with the best way to properly follow TDD principles while developing UI in JavaScript. What's the best way to go about this?\nIs it best to separate the visual from the functional? Do you develop the visual elements first, and then w... |
I have created a web project which references a class library project. When deployed to the local machine the web/classes all work fine but deployed on a ‘shared’ IIS site, the class DLLs exist in the /bin directory, but the web page generates the following error:
can’t find file “Documents and settings/….”
when tryi... | It sounds like you're encountering an issue related to assembly resolution in your ASP.NET application when deployed on a shared IIS site. Here are some steps and considerations to help you resolve this problem:
### 1. Check Assembly References
Make sure that all the referenced DLLs (including your class library) are ... | 9,366 | [
{
"from": "human",
"value": "I have created a web project which references a class library project. When deployed to the local machine the web/classes all work fine but deployed on a ‘shared’ IIS site, the class DLLs exist in the /bin directory, but the web page generates the following error:\ncan’t find ... |
I have a piece of an application that is written in C, it spawns a JVM and uses JNI to interact with a Java application. My memory footprint via Process Explorer gets upto 1GB and runs out of memory. Now as far as I know it should be able to get upto 2GB. One thing I believe is that the memory the JVM is using isn't... | In a mixed C and Java application that utilizes JNI, tracking down the memory usage can be challenging because the memory usage reported by tools like Process Explorer can reflect not just your application memory, but also other components such as the JVM, native libraries, and system overhead. Below are several areas ... | 9,475 | [
{
"from": "human",
"value": "I have a piece of an application that is written in C, it spawns a JVM and uses JNI to interact with a Java application. My memory footprint via Process Explorer gets upto 1GB and runs out of memory. Now as far as I know it should be able to get upto 2GB. One thing I believe ... |
I would like to write all meta data (including advanced summary properties) for my files in a windows folder to a csv file. Is there a way to collect all the attributes? I see mp3 files have a different set of attributes compared to jpg files. (c#)
This can also be a script (vb, perl)
Update: by looking at libextract... | To extract all available metadata from files in a Windows folder, especially if you're dealing with various file types (like MP3 and JPEG), you can utilize C# along with the `TagLib#` library, which supports a variety of multimedia file formats. Below is a simple example of how you might implement this in C# to gather ... | 6,962 | [
{
"from": "human",
"value": "I would like to write all meta data (including advanced summary properties) for my files in a windows folder to a csv file. Is there a way to collect all the attributes? I see mp3 files have a different set of attributes compared to jpg files. (c#)\nThis can also be a script (... |
I have a list of more than 15 thousand latitude and longitude coordinates. Given any X,Y coordinates, what is the fastest way to find the closest coordinates on the list?
| To find the closest coordinates from a list of over 15,000 latitude and longitude points given any X, Y coordinates, you can use several methods. Here are a few efficient approaches:
### 1. **K-D Tree (k-dimensional tree)**
A K-D tree is a space-partitioning data structure that is particularly useful for organizing po... | 8,323 | [
{
"from": "human",
"value": "I have a list of more than 15 thousand latitude and longitude coordinates. Given any X,Y coordinates, what is the fastest way to find the closest coordinates on the list?\n"
},
{
"from": "gpt",
"value": "To find the closest coordinates from a list of over 15,000 lat... |
In cake 1.2 there is a feature that allows the developer to no have to create models, but rather have cake do the detective work at run time and create the model for you. This process happens each time and is neat but in my case very hazardous. I read about this somewhere and now I'm experiencing the bad side of this.
... | In CakePHP 1.2, the auto model feature is a convenience that allows the framework to dynamically create models based on the database schema. However, it can lead to issues, especially when you want precise control over your models, particularly when dealing with associations and specific model logic.
To disable the au... | 8,416 | [
{
"from": "human",
"value": "In cake 1.2 there is a feature that allows the developer to no have to create models, but rather have cake do the detective work at run time and create the model for you. This process happens each time and is neat but in my case very hazardous. I read about this somewhere and no... |
I've just coded a 700 line class. Awful. I hang my head in shame. It's as opposite to DRY as a British summer.
It's full of cut and paste with minor tweaks here and there. This makes it's a prime candidate for refactoring. Before I embark on this, I'd thought I'd ask when you have lots of repetition, what are the fi... | It's great that you're seeking to refactor your code! Refactoring is an essential practice for maintaining clean and maintainable code. Here are some additional refactoring opportunities you can consider when dealing with a class that has lots of repetition:
1. **Extract Method**: If you see repeated code blocks, cons... | 8,808 | [
{
"from": "human",
"value": "I've just coded a 700 line class. Awful. I hang my head in shame. It's as opposite to DRY as a British summer.\nIt's full of cut and paste with minor tweaks here and there. This makes it's a prime candidate for refactoring. Before I embark on this, I'd thought I'd ask when yo... |
If I hit a page which calls session_start(), how long would I have to wait before I get a new session ID when I refresh the page?
| In PHP, when you call `session_start()`, the session ID is maintained based on cookies (by default) or URL parameters. The session will remain active as long as the session data exists on the server, and the session cookie is present and valid in the user's browser.
Typically, a session can expire based on two main c... | 12,948 | [
{
"from": "human",
"value": "If I hit a page which calls session_start(), how long would I have to wait before I get a new session ID when I refresh the page?\n"
},
{
"from": "gpt",
"value": "In PHP, when you call `session_start()`, the session ID is maintained based on cookies (by default) or U... |
Ruby on Rails has magic timestamping fields that are automatically updated when a record is created or updated. I'm trying to find similar functionality in Entity Framework. I've considered database triggers and a SavingChanges event handler. Is there a more obvious method I'm overlooking?
| In Entity Framework, you can achieve automatic timestamping of `CreatedAt` and `UpdatedAt` fields without relying solely on database triggers or saving changes event handlers. A common approach is to use the `DbContext` class and override the `SaveChanges` method to automatically set these timestamps whenever an entity... | 11,256 | [
{
"from": "human",
"value": "Ruby on Rails has magic timestamping fields that are automatically updated when a record is created or updated. I'm trying to find similar functionality in Entity Framework. I've considered database triggers and a SavingChanges event handler. Is there a more obvious method I'm o... |
In a web application, is it acceptable to use HTML in your code (non-scripted languages, Java, .NET)?
There are two major sub questions:
Should you use code to print HTML, or otherwise directly create HTML that is displayed?
Should you mix code within your HTML pages?
| When developing web applications, especially in non-scripted languages like Java or .NET, it’s common to incorporate HTML into your code, but there are best practices and considerations to keep in mind. Let’s address your questions:
### 1. Should you use code to print HTML, or otherwise directly create HTML that is di... | 10,315 | [
{
"from": "human",
"value": "In a web application, is it acceptable to use HTML in your code (non-scripted languages, Java, .NET)?\nThere are two major sub questions:\n\nShould you use code to print HTML, or otherwise directly create HTML that is displayed?\nShould you mix code within your HTML pages?\n\n"
... |
In a CakePHP 1.2 app, I'm using
<?php $session->flash();?>
to output messages like "Record edited". It's working great.
However, I want to add a link called "Dismiss" that will fade out the message. I know how to construct the link, but I don't know how to insert into the output of the flass message.
The flash messag... | In CakePHP 1.2, the `flash` method outputs the flash messages wrapped in a `<div>` tag, but it doesn't provide a direct way to modify the content of that flash message. However, you can achieve this by customizing the flash message output in your view file or using a custom component.
Here’s a straightforward way to i... | 11,165 | [
{
"from": "human",
"value": "In a CakePHP 1.2 app, I'm using \n<?php $session->flash();?>\n\nto output messages like \"Record edited\". It's working great.\nHowever, I want to add a link called \"Dismiss\" that will fade out the message. I know how to construct the link, but I don't know how to insert into ... |
In JavaScript, you can use Lazy Function Definitions to optimize the 2nd - Nth call to a function by performing the expensive one-time operations only on the first call to the function.
I'd like to do the same sort of thing in PHP 5, but redefining a function is not allowed, nor is overloading a function.
Effectively w... | In PHP 5, since you can't redefine or overload functions, one approach to optimize the function and avoid unnecessary checks on subsequent calls is to use static variables. Static variables are preserved between function calls, so you can keep track of whether the function has been called before without needing a globa... | 12,264 | [
{
"from": "human",
"value": "In JavaScript, you can use Lazy Function Definitions to optimize the 2nd - Nth call to a function by performing the expensive one-time operations only on the first call to the function.\nI'd like to do the same sort of thing in PHP 5, but redefining a function is not allowed, no... |
Whats the most efficient way of selecting total number of records from a large table? Currently, Im simply doing
$result = mysql_query("SELECT id FROM table");
$total = mysql_num_rows($result)
I was told this was not very efficient or fast, if you have a lot of records in the table.
| Yes, the method you're currently using to get the total number of records in a large table can be inefficient. When you run `SELECT id FROM table`, the database needs to read all the rows in the table to count them, which can take a significant amount of time and resources for large datasets.
A more efficient way to c... | 13,071 | [
{
"from": "human",
"value": "Whats the most efficient way of selecting total number of records from a large table? Currently, Im simply doing\n$result = mysql_query(\"SELECT id FROM table\");\n$total = mysql_num_rows($result)\n\nI was told this was not very efficient or fast, if you have a lot of records in... |
How do I do a diff of two strings or arrays in Ruby?
| In Ruby, you can compare two strings or arrays to find their differences using several methods. Below are examples for both strings and arrays.
### Diffing Two Strings
For strings, you can compare them directly or use the `String#diff` method available in some libraries like `diff-lcs`. Here is an example without any... | 10,799 | [
{
"from": "human",
"value": "How do I do a diff of two strings or arrays in Ruby?\n"
},
{
"from": "gpt",
"value": "In Ruby, you can compare two strings or arrays to find their differences using several methods. Below are examples for both strings and arrays.\n\n### Diffing Two Strings\n\nFor str... |
I've googled around and found most people advocating the use of kmalloc, as you're guaranteed to get contiguous physical blocks of memory. However, it also seems as though kmalloc can fail if a contiguous physical block that you want can't be found.
What are the advantages of having a contiguous block of memory? Specif... | When working with memory allocation in kernel development, understanding the differences between `kmalloc` and `vmalloc`, as well as when to use specific GFP (Get Free Pages) flags like `GFP_ATOMIC` or `GFP_KERNEL`, is crucial. Let's break down your questions.
### Advantages of Contiguous Physical Memory
1. **Perform... | 10,116 | [
{
"from": "human",
"value": "I've googled around and found most people advocating the use of kmalloc, as you're guaranteed to get contiguous physical blocks of memory. However, it also seems as though kmalloc can fail if a contiguous physical block that you want can't be found.\nWhat are the advantages of h... |
I'm supposed to learn how to use LabVIEW for my new job, and I'm wondering if anybody can recommend some good books or reference/tutorial web sites.
I'm a senior developer with lots of Java/C#/C++ experience.
I realize that this question is perhaps more vague than is intended on stack overflow, so how about this? Pleas... | One highly recommended resource for learning LabVIEW is the book **"LabVIEW for Everyone: Graphical Programming Made Easy and Fun" by Jeffrey Travis and Jim Kring**.
### Description:
This book is an excellent introduction to LabVIEW, designed for both beginners and experienced programmers. It covers the basics of gra... | 14,372 | [
{
"from": "human",
"value": "I'm supposed to learn how to use LabVIEW for my new job, and I'm wondering if anybody can recommend some good books or reference/tutorial web sites.\nI'm a senior developer with lots of Java/C#/C++ experience.\nI realize that this question is perhaps more vague than is intended ... |
if you uses Mono Remoting on Linux, what's your work-around for DateTime marshalling incompatibility between Mono and .NET Remoting?
i'm using WinForms on Windows using .NET 2.0 runtime, using Remoting on Linux using Mono. i cannot yet use Mono runtime on both ends as Mono's DataGridView isn't yet working.
[UPDATE]
i ... | If you're encountering DateTime marshalling incompatibility issues between Mono and .NET Remoting, and you've mentioned that using Mono 1.9 caused these issues, here are a few workarounds you could consider, especially if you're still unable to update your Mono runtime:
1. **Custom Serialization**: Implement a custom ... | 8,514 | [
{
"from": "human",
"value": "if you uses Mono Remoting on Linux, what's your work-around for DateTime marshalling incompatibility between Mono and .NET Remoting?\ni'm using WinForms on Windows using .NET 2.0 runtime, using Remoting on Linux using Mono. i cannot yet use Mono runtime on both ends as Mono's D... |
I am working a project where I need to generate a series of classes to represent/access data in the database. Third party projects such as hibernate or subsonic are not an option. I am new in this subject domain, so I am looking for information on the topic. The project is in .net and I am using MyGeneration. I am prim... | For information on code generation for data access, I recommend the following resource:
[Code Generation in .NET - A Detailed Overview](https://docs.microsoft.com/en-us/dotnet/architecture/microservices/modeling-application/code-generation)
This Microsoft documentation covers various aspects of code generation in .NE... | 16,163 | [
{
"from": "human",
"value": "I am working a project where I need to generate a series of classes to represent/access data in the database. Third party projects such as hibernate or subsonic are not an option. I am new in this subject domain, so I am looking for information on the topic. The project is in .n... |
How can i check (and additionally create) PDF-A 1b compliant PDF documents using open source tools? Does anybody know an open source tool?
Thanks in advance...
| To check and create PDF/A-1b compliant PDF documents using open source tools, you can use the following options:
### Checking PDF/A-1b Compliance
1. **PDF/A Validator:**
- **veraPDF:** This is a widely-used open-source tool that can validate PDF/A documents. It supports multiple versions, including PDF/A-1b. You c... | 9,384 | [
{
"from": "human",
"value": "How can i check (and additionally create) PDF-A 1b compliant PDF documents using open source tools? Does anybody know an open source tool?\nThanks in advance...\n"
},
{
"from": "gpt",
"value": "To check and create PDF/A-1b compliant PDF documents using open source to... |
Let's say I have a string holding a mess of text and (x)HTML tags. I want to remove all instances of a given tag (and any attributes of that tag), leaving all other tags and text along. What's the best Regex to get this done?
Edited to add: Oh, I appreciate that using a Regex for this particular issue is not the best... | Certainly! If you need to remove all instances of a specific tag along with its attributes using a regex, you can craft a regular expression that captures the opening tag, the content it may contain (if desired), and the closing tag.
For example, if you want to remove all instances of the `<tagname>` (replace "tagname... | 10,134 | [
{
"from": "human",
"value": "Let's say I have a string holding a mess of text and (x)HTML tags. I want to remove all instances of a given tag (and any attributes of that tag), leaving all other tags and text along. What's the best Regex to get this done?\nEdited to add: Oh, I appreciate that using a Regex... |
I'm failing at finding the commands I need to send to authenticate to a SMTP server using NTLM.
I think it goes something like:
AUTH NTLM <bae64encode something>
334
<bae64encode something>
235
| To authenticate to an SMTP server using NTLM, you'll need to follow a specific sequence of commands that includes both the negotiation and authentication phases. Below is a simplified step-by-step breakdown of how to perform NTLM authentication over SMTP:
1. **Initiate Authentication**: Start by sending the `AUTH NTLM... | 10,229 | [
{
"from": "human",
"value": "I'm failing at finding the commands I need to send to authenticate to a SMTP server using NTLM. \nI think it goes something like:\nAUTH NTLM <bae64encode something>\n334\n<bae64encode something>\n235\n\n"
},
{
"from": "gpt",
"value": "To authenticate to an SMTP serve... |
How do I open multiple pages in Internet Explorer 7 with a single DOS command? Is a batch file the only way to do this?
Thanks!
| To open multiple pages in Internet Explorer 7 using a single DOS command, you can use a simple command in the Command Prompt. While a batch file is one way to achieve this, you can also execute a single command directly from the Command Prompt.
### Using Command Prompt Directly
Open the Command Prompt and type the fo... | 12,588 | [
{
"from": "human",
"value": "How do I open multiple pages in Internet Explorer 7 with a single DOS command? Is a batch file the only way to do this?\nThanks!\n"
},
{
"from": "gpt",
"value": "To open multiple pages in Internet Explorer 7 using a single DOS command, you can use a simple command in... |
Is the a VS2005 C++ compiler flag like the Xmx???M java flag so I can limit the heap size of my application running on Windows.
I need to limit the heap size so I can fill the memory to find out the current free memory. (The code also runs on an embedded system where this is the best method to get the memory usage)
| In Visual Studio 2005 (VS2005) and C++, there isn't a direct equivalent to the `-Xmx` flag from Java, which is used to set the maximum heap size for a Java application. C++ manages memory differently than Java, and the heap size isn't typically limited in the same way.
However, there are some ways you can indirectly c... | 11,496 | [
{
"from": "human",
"value": "Is the a VS2005 C++ compiler flag like the Xmx???M java flag so I can limit the heap size of my application running on Windows. \nI need to limit the heap size so I can fill the memory to find out the current free memory. (The code also runs on an embedded system where this is t... |
Does iPhone support XML-RPC, Is their any open source framework which I can use?
| Yes, iPhones and iOS devices can support XML-RPC since XML-RPC is a protocol that can be implemented in any programming language capable of sending and receiving HTTP requests, and iOS apps can certainly make HTTP requests.
For implementing XML-RPC in your iOS app, there are a few open-source libraries you can conside... | 12,911 | [
{
"from": "human",
"value": "Does iPhone support XML-RPC, Is their any open source framework which I can use?\n"
},
{
"from": "gpt",
"value": "Yes, iPhones and iOS devices can support XML-RPC since XML-RPC is a protocol that can be implemented in any programming language capable of sending and r... |
Is the sorting algorithm used by .NET's Array.Sort() method a stable algorithm?
| As of .NET 6, the `Array.Sort()` method uses the introspective sort algorithm (Introsort) which is not stable. A stable sort maintains the relative order of records with equal keys (i.e., values). In contrast, an unstable sort may not preserve this order.
However, if you require a stable sort in .NET, you can use `Lis... | 15,598 | [
{
"from": "human",
"value": "Is the sorting algorithm used by .NET's Array.Sort() method a stable algorithm?\n"
},
{
"from": "gpt",
"value": "As of .NET 6, the `Array.Sort()` method uses the introspective sort algorithm (Introsort) which is not stable. A stable sort maintains the relative order ... |
I've developed a Visual C#.NET 2008 Express Edition solution containing three projects. I am cleaning it up to commit it into a CVS repository.
There are several files that are created during the build process that are not necessary to be placed in the repository since they will be regenerated automatically.
The questi... | Certainly! When working with Visual C#.NET 2008 Express Edition, there are specific types of files and folders generated during the build process that you typically want to ignore in your CVS repository. Below is a sample list of patterns that you can use in your `.cvsignore` file to achieve this:
```plaintext
# Ignor... | 13,377 | [
{
"from": "human",
"value": "I've developed a Visual C#.NET 2008 Express Edition solution containing three projects. I am cleaning it up to commit it into a CVS repository.\nThere are several files that are created during the build process that are not necessary to be placed in the repository since they wil... |
I have a bunch a values I would like to add together which are entered into a form. Right now, the form has 11 lines but it could get larger in the future. I can easily add all the values together with something like:
$total = $value1 + $value2 + ... + $value11;
All the values I want to add together are coming from an... | Yes, you can achieve this in PHP using an array to store your values instead of individual variables. By doing this, you can easily loop through the array to calculate the total without running into "undefined variable" errors. Here’s an example of how to modify your code:
```php
<?php
$tempTotal = 0;
// Store your ... | 13,357 | [
{
"from": "human",
"value": "I have a bunch a values I would like to add together which are entered into a form. Right now, the form has 11 lines but it could get larger in the future. I can easily add all the values together with something like:\n$total = $value1 + $value2 + ... + $value11;\n\nAll the valu... |
does the TableLayoutPanel exist in VS 2005?
| Yes, the `TableLayoutPanel` control does exist in Visual Studio 2005. It is part of the Windows Forms controls in the .NET Framework 2.0 and later. The `TableLayoutPanel` allows you to create a flexible grid layout, where you can arrange child controls in a table-like structure, defining rows and columns. You can set t... | 15,787 | [
{
"from": "human",
"value": "does the TableLayoutPanel exist in VS 2005?\n"
},
{
"from": "gpt",
"value": "Yes, the `TableLayoutPanel` control does exist in Visual Studio 2005. It is part of the Windows Forms controls in the .NET Framework 2.0 and later. The `TableLayoutPanel` allows you to creat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.