instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Does adding a Web Service to my ASP.NET MVC project break the whole concept of MVC?
That Web Service (WCF) depends on the Model layer from my MVC project to communicate with the back-end (so it looks to me like it needs to be part of the MVC solution).
Should I add this to the Controller or Model layer?
| Adding a Web Service (like WCF) to your ASP.NET MVC project does not inherently break the MVC architectural pattern; rather, it can be a complementary component depending on how it is integrated and utilized within your application.
### Understanding MVC and Web Services
1. **MVC Framework**:
- **Model**: Represe... | 12,971 | [
{
"from": "human",
"value": "Does adding a Web Service to my ASP.NET MVC project break the whole concept of MVC?\nThat Web Service (WCF) depends on the Model layer from my MVC project to communicate with the back-end (so it looks to me like it needs to be part of the MVC solution).\nShould I add this to the... |
i have a number of jsp files under web-inf folder. Inside my web.xml i specify an errorppage for 404 amd 403 and java.lang.exception. Do i need to include a page directive for each of my jsp's or will they automatically get forwarded to the exception handling page because they are under web-inf?
If this is true does th... | When it comes to JSP files located in the `WEB-INF` folder and how they interact with error handling in a web application defined by `web.xml`, there are some key points to understand.
### 1. **Understanding `WEB-INF`:**
- The `WEB-INF` directory is a special folder in Java web applications. It is not accessible di... | 11,649 | [
{
"from": "human",
"value": "i have a number of jsp files under web-inf folder. Inside my web.xml i specify an errorppage for 404 amd 403 and java.lang.exception. Do i need to include a page directive for each of my jsp's or will they automatically get forwarded to the exception handling page because they a... |
I am working on a large C++ project in Visual Studio 2008, and there are a lot of files with unnecessary #include directives. Sometimes the #includes are just artifacts and everything will compile fine with them removed, and in other cases classes could be forward declared and the #include could be moved to the .cpp fi... | Managing `#include` directives in a large C++ project can indeed be a tedious task, especially in older environments like Visual Studio 2008. However, there are some tools and strategies that can help you detect unnecessary `#include` statements and improve your project’s structure. Here are some suggestions:
1. **Inc... | 13,571 | [
{
"from": "human",
"value": "I am working on a large C++ project in Visual Studio 2008, and there are a lot of files with unnecessary #include directives. Sometimes the #includes are just artifacts and everything will compile fine with them removed, and in other cases classes could be forward declared and t... |
Say for example you're getting a web app project that interacts with a database.
How do you start your development? Do you start by designing your database, drawing simple ERD and writting a create scripts? Do you start by designing the look of your of web app, maybe using photoshop, then create a master page for it? ... | When starting a web app project that interacts with a database, the approach can vary based on the project’s requirements, team structure, and the development methodology you’re following (like Agile, Waterfall, etc.). However, a structured approach is usually beneficial to ensure all aspects of the project are conside... | 12,106 | [
{
"from": "human",
"value": "Say for example you're getting a web app project that interacts with a database. \nHow do you start your development? Do you start by designing your database, drawing simple ERD and writting a create scripts? Do you start by designing the look of your of web app, maybe using pho... |
I recently encountered an odd problem with RSACryptoServiceProvider.VerifyHash.
I have a web application using it for decryption. When users running the web service were doing so over our VPN it became very very slow. When they had no connection or a internet connection they were fine.
After much digging I found that ... | It sounds like you've encountered an issue related to the way the `RSACryptoServiceProvider` class interacts with security contexts and potentially the Active Directory environment in your network setup. Let's delve into your concerns and suggest some workarounds.
### Explanation
1. **Why is it checking the domain co... | 15,558 | [
{
"from": "human",
"value": "I recently encountered an odd problem with RSACryptoServiceProvider.VerifyHash. \nI have a web application using it for decryption. When users running the web service were doing so over our VPN it became very very slow. When they had no connection or a internet connection they w... |
I have a project where a .master page was created without a code behind page. Now I want to add a code behind page for this .master page and move the "in page" code to the code behind file. What is the best/easiest way to go about doing this? I'm using Visual Studio 2008.
| To add a code-behind file to your existing .master page in Visual Studio 2008 and move the inline code to the code-behind file, follow these steps:
### Step 1: Create the Code-Behind File
1. **Open the .master page**: In your Solution Explorer, locate and open your `.master` page.
2. **Add Code-Behind**:
- Right-... | 14,374 | [
{
"from": "human",
"value": "I have a project where a .master page was created without a code behind page. Now I want to add a code behind page for this .master page and move the \"in page\" code to the code behind file. What is the best/easiest way to go about doing this? I'm using Visual Studio 2008.\n"
... |
I would like to encrypt strings which could potentially only be about three or four characters but run to about twenty characters. A hashing function (md5, sha1, crypt etc) is not suitable as I would like to be able to decrypt the information as well. The mcrypt extension has a thoroughly daunting array of possibilitie... | When you need to encrypt strings that can vary in length and want to be able to decrypt them later, you’ll typically want to use a symmetric encryption algorithm. Here are some steps and recommendations to help you safely encrypt and decrypt short strings:
### Recommended Encryption Approach
1. **Use a Strong Symmetr... | 12,312 | [
{
"from": "human",
"value": "I would like to encrypt strings which could potentially only be about three or four characters but run to about twenty characters. A hashing function (md5, sha1, crypt etc) is not suitable as I would like to be able to decrypt the information as well. The mcrypt extension has a ... |
There are a lot of webs still using classic ASP instead of ASP.NET but that is not the question - "never change a running project".
The question is if it is still a first choice as a base for a new web-project or would it be worth to switch to ASP.NET? Would you recommend a classic ASP programmer another language to sw... | Classic ASP (Active Server Pages) was a significant technology in its time, enabling server-side scripting for web applications using languages like VBScript and JScript. However, it has several limitations compared to modern frameworks. While some companies continue to use Classic ASP for new projects, this choice com... | 15,129 | [
{
"from": "human",
"value": "There are a lot of webs still using classic ASP instead of ASP.NET but that is not the question - \"never change a running project\".\nThe question is if it is still a first choice as a base for a new web-project or would it be worth to switch to ASP.NET? Would you recommend a c... |
I am writing an iPhone application and need to essentially implement something equivalent to the 'eyedropper' tool in photoshop, where you can touch a point on the image and capture the RGB values for the pixel in question to determine and match its color. Getting the UIImage is the easy part, but is there a way to co... | Yes, you can achieve this in an iOS application by converting a `UIImage` to a bitmap representation and then extracting the RGB values of a pixel at a specified location. Below is a step-by-step approach, along with a sample code snippet that demonstrates how to do this.
### Step 1: Convert UIImage to Bitmap
You can... | 12,221 | [
{
"from": "human",
"value": "I am writing an iPhone application and need to essentially implement something equivalent to the 'eyedropper' tool in photoshop, where you can touch a point on the image and capture the RGB values for the pixel in question to determine and match its color. Getting the UIImage i... |
My Tomcat instance is listening to multiple IP addresses, but I want to control which source IP address is used when opening a URLConnection.
How can I specify this?
| To control which source IP address is used when creating a `URLConnection` in Java, you typically need to bind the connection to a specific local address. This can be done by using the `Socket` API directly to create a socket that binds to your desired local IP address, and then using that socket with the `URLConnectio... | 12,352 | [
{
"from": "human",
"value": "My Tomcat instance is listening to multiple IP addresses, but I want to control which source IP address is used when opening a URLConnection. \nHow can I specify this?\n"
},
{
"from": "gpt",
"value": "To control which source IP address is used when creating a `URLCon... |
We try to use Java and UTF-8 on Windows. The application writes logs on the console, and we would like to use UTF-8 for the logs as our application has internationalized logs.
It is possible to configure the JVM so it generates UTF-8, using -Dfile.encoding=UTF-8 as arguments to the JVM. It works fine, but the output on... | Using UTF-8 in a Windows console with Java can be a bit tricky due to how Windows handles code pages and encoding. You're experiencing issues where switching to the UTF-8 code page (65001) causes your `.bat` script not to execute correctly. Here are some hints and alternatives you can try to resolve this issue:
### 1.... | 13,598 | [
{
"from": "human",
"value": "We try to use Java and UTF-8 on Windows. The application writes logs on the console, and we would like to use UTF-8 for the logs as our application has internationalized logs.\nIt is possible to configure the JVM so it generates UTF-8, using -Dfile.encoding=UTF-8 as arguments to... |
I am using MySQL and PHP for a project I am working. I have created separate users for carrying out different functions (one for running select queries, one for running update queries, etc.) to provide an extra layer of security. This way, I figure if someone does manage to carry out an injection attack (which is unl... | Creating separate MySQL users for different types of operations (e.g., SELECT, UPDATE, INSERT, DELETE) is indeed a good security practice, often referred to as the principle of least privilege. Here are a few key points regarding this practice:
### Advantages
1. **Limit Damage in Case of Breaches**: By having distinc... | 15,472 | [
{
"from": "human",
"value": "I am using MySQL and PHP for a project I am working. I have created separate users for carrying out different functions (one for running select queries, one for running update queries, etc.) to provide an extra layer of security. This way, I figure if someone does manage to ca... |
Here's a question that's been haunting me for a year now. The root question is how do I set the size of an element relative to its parent so that it is inset by N pixels from every edge? Setting the width would be nice, but you don't know the width of the parent, and you want the elements to resize with the window. (Yo... | To achieve the layout you described, where you have a parent element that is 25% wide and 100% of the viewport height, and a child element that is inset by N pixels from each edge without affecting the layout, you can use CSS `calc()` to define the size of the child element. This allows you to set a specific pixel valu... | 16,316 | [
{
"from": "human",
"value": "Here's a question that's been haunting me for a year now. The root question is how do I set the size of an element relative to its parent so that it is inset by N pixels from every edge? Setting the width would be nice, but you don't know the width of the parent, and you want th... |
I have a large quantity of clearcase data which needs to be migrated into perforce. The revisions span the better part of a decade and I need to preserve as much branch and tag information as possible. Additionally we make extensive use of symbolic links, supported in clearcase but not in perforce. What advice or to... | Migrating from ClearCase to Perforce can be a complex task, especially when dealing with a long history of revisions, branches, tags, and the specific challenges posed by symbolic links. Here are some steps and tools you can consider to facilitate this migration process:
### 1. Pre-Migration Planning
- **Analyze Clear... | 13,773 | [
{
"from": "human",
"value": "I have a large quantity of clearcase data which needs to be migrated into perforce. The revisions span the better part of a decade and I need to preserve as much branch and tag information as possible. Additionally we make extensive use of symbolic links, supported in clearcas... |
What are the most common memory optimizations in csharp, dotnet 2.0. Wanted to see if there common things that people may not be doing by default in winform app
| When developing WinForms applications in C# with .NET Framework 2.0, there are several memory optimization techniques you can employ to ensure your application runs efficiently. Here are some common memory optimization strategies that might not be implemented by default:
### 1. **Use of Value Types vs. Reference Types... | 13,899 | [
{
"from": "human",
"value": "What are the most common memory optimizations in csharp, dotnet 2.0. Wanted to see if there common things that people may not be doing by default in winform app\n"
},
{
"from": "gpt",
"value": "When developing WinForms applications in C# with .NET Framework 2.0, the... |
How many rows should be in the (main) buffer of a virtual Listview control?
I am witting an application in pure 'c' to the Win32 API. There is an ODBC connection to a database which will retrieve the items (actually rows).
The MSDN sample code implies a fixed size buffer of 30 for the end cache (Which would almost c... | When designing a virtual ListView control in a Win32 application, especially when working with a database, you need to strike a balance between memory usage, performance, and responsiveness. Here are some considerations for determining the size of your buffers:
### Factors to Consider
1. **Visible Items**: Calculate ... | 14,418 | [
{
"from": "human",
"value": "How many rows should be in the (main) buffer of a virtual Listview control?\nI am witting an application in pure 'c' to the Win32 API. There is an ODBC connection to a database which will retrieve the items (actually rows). \nThe MSDN sample code implies a fixed size buffer of... |
I'm trying to write a super-simple podcast-to-device downloading service to use for running. I imagine that it'll like this:
Whenever a particular device is plugged in (via USB), it:
Deletes everything from the device
Checks for all the latest entries in a number of RSS Podcast feeds
Downloads those to the device
No... | Creating a simple podcast-to-device downloading service is a great project! To detect when a USB device is plugged in using .NET/C#, you can utilize the `ManagementEventWatcher` class from the `System.Management` namespace. This class allows you to subscribe to WMI (Windows Management Instrumentation) events, which can... | 11,675 | [
{
"from": "human",
"value": "I'm trying to write a super-simple podcast-to-device downloading service to use for running. I imagine that it'll like this:\nWhenever a particular device is plugged in (via USB), it: \n\nDeletes everything from the device\nChecks for all the latest entries in a number of RSS P... |
Ever since I started using .NET, I've just been creating Helper classes or Partial classes to keep code located and contained in their own little containers, etc.
What I'm looking to know is the best practices for making ones code as clean and polished as it possibly could be.
Obviously clean code is subjective, but I... | You're asking great questions about software design principles, and there are indeed several resources and best practices you can explore to improve the cleanliness and maintainability of your code. Below are some guidelines and resources that can help you make better design decisions as you continue your journey with ... | 13,701 | [
{
"from": "human",
"value": "Ever since I started using .NET, I've just been creating Helper classes or Partial classes to keep code located and contained in their own little containers, etc. \nWhat I'm looking to know is the best practices for making ones code as clean and polished as it possibly could be.... |
I have an error occuring frequently from our community server installation whenever the googlesitemap.ashx is traversed on a specific sectionID. I suspect that a username has been amended but the posts havn't recached to reflect this.
Is there a way a can check the data integruity by performing a select statement on th... | To address issues with your community server installation, specifically related to the `googlesitemap.ashx` and potential username changes, you can take several approaches to check data integrity and refresh the cache.
### 1. Check Data Integrity
You can perform SQL queries to inspect the user-related data in your da... | 12,928 | [
{
"from": "human",
"value": "I have an error occuring frequently from our community server installation whenever the googlesitemap.ashx is traversed on a specific sectionID. I suspect that a username has been amended but the posts havn't recached to reflect this.\nIs there a way a can check the data integru... |
I've been trying to implement unit testing and currently have some code that does the following:
query external database, loading
into a feed table
query a view,
which is a delta of my feed and data
tables, updating data table to match
feed table
my unit testing strategy is this:
I have a testing database that I am ... | Your current approach to unit testing, where you manipulate a testing database and assert the outcomes, is valid. However, it can become cumbersome as the complexity of your tests increases. Here are several suggestions to make your unit testing process more efficient and manageable:
### 1. **Use Test Fixtures**:
-... | 14,511 | [
{
"from": "human",
"value": "I've been trying to implement unit testing and currently have some code that does the following:\n\nquery external database, loading\ninto a feed table \nquery a view,\nwhich is a delta of my feed and data\ntables, updating data table to match\nfeed table\n\nmy unit testing stra... |
I'm trying to use TestDriven.Net not only to test my code, but to call a function on my code whose purpose is to print out the internal state of the code to the Debug window.
Here's a very simplified example of what I'm trying to do..
<TestFixture()> _
Public Class UnitTest
<Test()> _
Public Sub TestDebug()
... | To view the output from `Debug.WriteLine` in the context of your unit tests using TestDriven.Net and NUnit, you need to ensure that you're running your tests in a way that captures the debug output correctly.
Here are several tips to help you view the debug output from your unit tests:
1. **Ensure Debug Output is En... | 15,040 | [
{
"from": "human",
"value": "I'm trying to use TestDriven.Net not only to test my code, but to call a function on my code whose purpose is to print out the internal state of the code to the Debug window.\nHere's a very simplified example of what I'm trying to do..\n<TestFixture()> _\nPublic Class UnitTest\n... |
Here's the problem:
In C# I'm getting information from a legacy ACCESS database. .NET converts the content of the database (in the case of this problem a string) to Unicode before handing the content to me.
How do I convert this Unicode string back to it's ASCII equivalent?
Edit
Unicode char 710 is indeed MODIFIER LET... | To convert a Unicode string back to its ASCII equivalent in cases where you have characters like `ê` (which may be represented in Unicode as a combination of a modifier and the letter itself), you can follow these steps in C#:
1. Identify the characters in the Unicode string and check if they can be represented as sin... | 11,855 | [
{
"from": "human",
"value": "Here's the problem:\nIn C# I'm getting information from a legacy ACCESS database. .NET converts the content of the database (in the case of this problem a string) to Unicode before handing the content to me.\nHow do I convert this Unicode string back to it's ASCII equivalent?\n\... |
Background
Normal rails eager-loading of collections works like this:
Person.find(:all, :include=>:companies)
This generates some sql which does
LEFT OUTER JOIN companies ON people.company_id = companies.id
Question
However, I need a custom join (this could also arise if I was using find_by_sql) so I can't use the va... | To achieve your goal of performing a custom SQL query while still allowing ActiveRecord to treat the results as associated objects, you can use a combination of a custom query and manually setting the associations. Here's a step-by-step approach to how you can do this:
### Step 1: Define a Custom SQL Query
First, wri... | 13,388 | [
{
"from": "human",
"value": "Background\nNormal rails eager-loading of collections works like this:\nPerson.find(:all, :include=>:companies)\n\nThis generates some sql which does\nLEFT OUTER JOIN companies ON people.company_id = companies.id\n\nQuestion\nHowever, I need a custom join (this could also arise ... |
I'm trying to have my Struts2 app redirect to a generated URL. In this case, I want the URL to use the current date, or a date I looked up in a database. So /section/document becomes /section/document/2008-10-06
What's the best way to do this?
| In a Struts2 application, you can achieve dynamic URL redirection using action classes and a combination of the `ActionSupport` class and the `Action` interface. To redirect to a URL that includes the current date or a date fetched from a database, you can follow these steps:
### Step 1: Create a Struts2 Action
Creat... | 15,250 | [
{
"from": "human",
"value": "I'm trying to have my Struts2 app redirect to a generated URL. In this case, I want the URL to use the current date, or a date I looked up in a database. So /section/document becomes /section/document/2008-10-06\nWhat's the best way to do this?\n"
},
{
"from": "gpt",
... |
Has anyone used C# with a Sales Logix database?
| Yes, many developers have used C# to interact with a SalesLogix database (now known as Infor CRM). SalesLogix typically utilizes a SQL Server database, and C# provides robust tools for database access and manipulation, such as ADO.NET, Entity Framework, or Dapper.
Here are some common approaches and considerations whe... | 15,296 | [
{
"from": "human",
"value": "Has anyone used C# with a Sales Logix database?\n"
},
{
"from": "gpt",
"value": "Yes, many developers have used C# to interact with a SalesLogix database (now known as Infor CRM). SalesLogix typically utilizes a SQL Server database, and C# provides robust tools for d... |
Is there a way to assign a process to a core (or more than one core) on a multi-core system running Windows XP?
An answer using a GUI is acceptable.
| Yes, you can assign a process to a specific core on a multi-core system running Windows XP using the built-in Task Manager. Here’s how you can do it using the GUI:
1. **Open Task Manager**: You can do this by right-clicking on the taskbar and selecting "Task Manager" or by pressing `Ctrl + Shift + Esc`.
2. **Go to th... | 17,231 | [
{
"from": "human",
"value": "Is there a way to assign a process to a core (or more than one core) on a multi-core system running Windows XP?\nAn answer using a GUI is acceptable.\n"
},
{
"from": "gpt",
"value": "Yes, you can assign a process to a specific core on a multi-core system running Wind... |
Looking for a tool to calculate the # of lines of code in an asp.net (vb.net) application.
The tricky part is that it needs to figure out the inline code in aspx files also.
So it will be lines of code in vb files (minus comments) plus the inline code in aspx files (not all the lines of aspx files, just the code betwee... | Calculating lines of code (LOC) for an ASP.NET application, especially one that includes inline code in .aspx files, can be a bit tricky. However, you can create a custom script or use existing tools with some modifications. Here are two approaches you could take:
### Option 1: Custom PowerShell Script
You can write ... | 14,795 | [
{
"from": "human",
"value": "Looking for a tool to calculate the # of lines of code in an asp.net (vb.net) application.\nThe tricky part is that it needs to figure out the inline code in aspx files also.\nSo it will be lines of code in vb files (minus comments) plus the inline code in aspx files (not all th... |
I know that the .NET framework looks for referenced DLLs in several locations
Global assembly cache (GAC)
Any private paths added to the AppDomain
The current directory of the executing assembly
What order are those locations searched? Is the search for a DLL ceased if a match is found or does it continue through all... | Your understanding of the .NET assembly resolution process is mostly correct, but let’s clarify the order of the search locations, how conflicts are resolved, and any other relevant locations involved.
### Order of Assembly Resolution
1. **Application Base Directory**: This is the directory where the application is r... | 17,347 | [
{
"from": "human",
"value": "I know that the .NET framework looks for referenced DLLs in several locations\n\nGlobal assembly cache (GAC)\nAny private paths added to the AppDomain\nThe current directory of the executing assembly\n\nWhat order are those locations searched? Is the search for a DLL ceased if a... |
I've just started using Java's enums in my own projects (I have to use JDK 1.4 at work) and I am confused as to the best practice of using JavaDoc for an enum.
I have found that this method works, but the resultant code is a little unrefined:
/**
* Doc for enum
*/
public enum Something {
/**
* First thing
*/
FIRST_THIN... | In Java, especially when using enums, you do have to follow the syntax requirements for enumerations. Since JDK 1.4 doesn't support some of the features of later versions (like enum declarations that can have methods or fields), you'll need to stick with a format that maintains the proper structure.
The standard appro... | 18,737 | [
{
"from": "human",
"value": "I've just started using Java's enums in my own projects (I have to use JDK 1.4 at work) and I am confused as to the best practice of using JavaDoc for an enum.\nI have found that this method works, but the resultant code is a little unrefined:\n/**\n* Doc for enum\n*/\npublic en... |
Are there any good configuration file reading libraries for C\C++ that can be used for applications written on the linux platform. I would like to have a simple configuration file for my application. At best i would like to steer clear of XML files that might potentially confuse users.
| Yes, there are several libraries available for reading configuration files in C/C++ that are user-friendly and suitable for applications on Linux. Here are some options that you might find useful:
1. **INIh**:
- **Description**: A simple C/C++ library to read/write .ini files. The INI format is easy to read and wri... | 15,104 | [
{
"from": "human",
"value": "Are there any good configuration file reading libraries for C\\C++ that can be used for applications written on the linux platform. I would like to have a simple configuration file for my application. At best i would like to steer clear of XML files that might potentially confu... |
How do I apply the MarshalAsAttribute to the return type of the code below?
public ISomething Foo()
{
return new MyFoo();
}
| In C#, the `MarshalAsAttribute` is used to control the marshaling of data between managed and unmanaged code, particularly when dealing with interop scenarios. The attribute is typically applied to method parameters and return types when using P/Invoke or COM Interop.
However, applying `MarshalAsAttribute` directly to... | 15,830 | [
{
"from": "human",
"value": "How do I apply the MarshalAsAttribute to the return type of the code below?\npublic ISomething Foo()\n{\n return new MyFoo();\n}\n\n"
},
{
"from": "gpt",
"value": "In C#, the `MarshalAsAttribute` is used to control the marshaling of data between managed and unmana... |
I have a Silverlight 1.0 application that I edit with Blend 2.5. Whenever I touch a UIElement in the designer that has a Canvas attribute such as Canvas.ZIndex="1", when it updates the XAML, it changes the Canvas prefix to Panel, leaving Panel.ZIndex="1", causing the page to fail to load.
How do I make it stop the ins... | The issue you are experiencing with Blend 2.5 changing the `Canvas` prefix to `Panel` is a known quirk when working with Silverlight 1.0 applications in that version of Blend. Unfortunately, this behavior can be quite frustrating, particularly since it leads to XAML that fails to load correctly due to the incorrect nam... | 11,249 | [
{
"from": "human",
"value": "I have a Silverlight 1.0 application that I edit with Blend 2.5. Whenever I touch a UIElement in the designer that has a Canvas attribute such as Canvas.ZIndex=\"1\", when it updates the XAML, it changes the Canvas prefix to Panel, leaving Panel.ZIndex=\"1\", causing the page t... |
Anyone know of a good memory/disk caching library for AIR? Extra points for being compatible with Flash CS3, and being free (as in beer).
I'd like to cache results of http requests: both binary and text (xml).
| For caching data in Adobe AIR, you have a few options that can work well for your needs, especially since you're looking for compatibility with Flash CS3 and a free solution.
1. **AS3 Common Library**: This is a collection of reusable ActionScript 3 components that include caching mechanisms. It's open-source and can ... | 17,135 | [
{
"from": "human",
"value": "Anyone know of a good memory/disk caching library for AIR? Extra points for being compatible with Flash CS3, and being free (as in beer).\nI'd like to cache results of http requests: both binary and text (xml).\n"
},
{
"from": "gpt",
"value": "For caching data in Ado... |
Do you know any easy or simple way to make a map object (from the STL library) persistent (i.e. write it to a file) so that you can recover its state later when the program in run later ??
Thanks for your help
| Yes, making a `std::map` persistent in C++ can be accomplished by serializing its contents and writing them to a file. Serialization is the process of converting an object into a format that can be easily stored and reconstructed later.
Here's a simple example of how you could do this:
1. **Serialize the `std::map`**... | 10,816 | [
{
"from": "human",
"value": "Do you know any easy or simple way to make a map object (from the STL library) persistent (i.e. write it to a file) so that you can recover its state later when the program in run later ??\nThanks for your help\n"
},
{
"from": "gpt",
"value": "Yes, making a `std::map... |
How is possible to set some special column values when update/insert entities via NHibernate without extending domain classes with special properties?
E.g. every table contains audit columns like CreatedBy, CreatedDate, UpdatedBy, UpdatedDate. But I dont want to add these poperties to the domain classes. I want to keep... | To maintain the persistence ignorance of your domain model while still populating audit columns (like `CreatedBy`, `CreatedDate`, `UpdatedBy`, and `UpdatedDate`), you can leverage NHibernate's event listeners or interceptors. Here’s how you can achieve this without adding properties to your domain classes:
### Using N... | 9,889 | [
{
"from": "human",
"value": "How is possible to set some special column values when update/insert entities via NHibernate without extending domain classes with special properties?\nE.g. every table contains audit columns like CreatedBy, CreatedDate, UpdatedBy, UpdatedDate. But I dont want to add these poper... |
Is there a way through the .net framework to determine if a folder is shared or not?
Neither Diretory, DirectoryInfo or FileAttributes seem to have any corresponding field.
One thing I forgot to mention was that I want to be checking for network shares. But I'll investigate the WMI stuff.
| Yes, you can determine if a folder is shared on a Windows system using the .NET Framework, but it requires leveraging Windows Management Instrumentation (WMI) or the System.DirectoryServices namespace.
Here's a simple way to check if a folder is shared using WMI:
1. **Using WMI**:
You can query the `Win32_Share` ... | 16,323 | [
{
"from": "human",
"value": "Is there a way through the .net framework to determine if a folder is shared or not?\nNeither Diretory, DirectoryInfo or FileAttributes seem to have any corresponding field.\nOne thing I forgot to mention was that I want to be checking for network shares. But I'll investigate t... |
I'm trying to retrieve numeric values from a DataGridView. So far, the only way I've found is to retrieve them as a string and convert them to numeric.
Convert.ToDouble(MyGrid.SelectedRows[0].Cells[0].Value.ToString());
There must be an easier way. The cell is originally populated from a DataSet with a numeric field v... | In a `DataGridView`, the values of cells are indeed stored as objects, and when you retrieve them, you often need to cast them or convert them to the desired type. However, since you're populating your `DataGridView` from a `DataSet` with numeric values, you can simplify the conversion process by directly casting the c... | 15,543 | [
{
"from": "human",
"value": "I'm trying to retrieve numeric values from a DataGridView. So far, the only way I've found is to retrieve them as a string and convert them to numeric.\nConvert.ToDouble(MyGrid.SelectedRows[0].Cells[0].Value.ToString());\n\nThere must be an easier way. The cell is originally pop... |
Trying to perform a single boolean NOT operation, it appears that under MS SQL Server 2005, the following block does not work
DECLARE @MyBoolean bit;
SET @MyBoolean = 0;
SET @MyBoolean = NOT @MyBoolean;
SELECT @MyBoolean;
Instead, I am getting more successful with
DECLARE @MyBoolean bit;
SET @MyBoolean = 0;
SET @MyBoo... | In SQL Server, particularly in older versions like SQL Server 2005, the `NOT` operator behaves differently than in many programming languages. The `NOT` operator does not directly work on `bit` data types for assignment in the way you might expect.
When you perform `SET @MyBoolean = NOT @MyBoolean;`, SQL Server attem... | 16,696 | [
{
"from": "human",
"value": "Trying to perform a single boolean NOT operation, it appears that under MS SQL Server 2005, the following block does not work\nDECLARE @MyBoolean bit;\nSET @MyBoolean = 0;\nSET @MyBoolean = NOT @MyBoolean;\nSELECT @MyBoolean;\n\nInstead, I am getting more successful with\nDECLAR... |
Even when BorderStyle is set to 0, it is possible to force a window to show up on the taskbar either by turning on the ShowInTaskbar property or by using the windows api directly: SetWindowLong Me.hwnd, GWL_EXSTYLE, GetWindowLong(Me.hwnd, Win.GWL_EXSTYLE) Or Win.WS_EX_APPWINDOW. However, such taskbar entries lack a r... | When you create a window that appears on the taskbar using the `SetWindowLong` function and the `WS_EX_APPWINDOW` extended style, it behaves differently compared to standard windows that have a title bar. The context menu (the right-click menu) associated with taskbar items is managed by the Windows taskbar itself, and... | 13,299 | [
{
"from": "human",
"value": "Even when BorderStyle is set to 0, it is possible to force a window to show up on the taskbar either by turning on the ShowInTaskbar property or by using the windows api directly: SetWindowLong Me.hwnd, GWL_EXSTYLE, GetWindowLong(Me.hwnd, Win.GWL_EXSTYLE) Or Win.WS_EX_APPWINDOW... |
Why is it wrong to use std::auto_ptr<> with standard containers?
| Using `std::auto_ptr` with standard containers in C++ is generally considered wrong due to the way `std::auto_ptr` manages ownership and its semantics, which can lead to unexpected behavior, particularly with copying and assignment.
Here are the main reasons why using `std::auto_ptr` with standard containers is proble... | 12,176 | [
{
"from": "human",
"value": "Why is it wrong to use std::auto_ptr<> with standard containers?\n"
},
{
"from": "gpt",
"value": "Using `std::auto_ptr` with standard containers in C++ is generally considered wrong due to the way `std::auto_ptr` manages ownership and its semantics, which can lead to... |
I have a couple of header files, which boil down to:
tree.h:
#include "element.h"
typedef struct tree_
{
struct *tree_ first_child;
struct *tree_ next_sibling;
int tag;
element *obj;
....
} tree;
and element.h:
#include "tree.h"
typedef struct element_
{
tree *tree_parent;
char *name;
... | You are correct that your `tree.h` and `element.h` files have a circular dependency problem because both structures refer to each other. To resolve this, you can use forward declarations, which allow you to inform the compiler that a type exists without requiring its full definition immediately.
Here's how you can adj... | 12,271 | [
{
"from": "human",
"value": "I have a couple of header files, which boil down to:\ntree.h:\n#include \"element.h\"\n\ntypedef struct tree_\n{\n struct *tree_ first_child;\n struct *tree_ next_sibling;\n int tag;\n element *obj;\n ....\n} tree;\n\nand element.h:\n#include \"tree.h\"\n\ntypedef... |
What is the difference, what is the official terms, are any terms obsolete in ASP.NET 3.5?
| ASP.NET 3.5 introduced several features and enhancements over its predecessors. While many terms and concepts have remained consistent, some may have evolved or become less relevant with subsequent versions. Here's a breakdown of key terms and concepts in ASP.NET 3.5, highlighting any potential obsolescence:
### Key T... | 13,897 | [
{
"from": "human",
"value": "What is the difference, what is the official terms, are any terms obsolete in ASP.NET 3.5?\n"
},
{
"from": "gpt",
"value": "ASP.NET 3.5 introduced several features and enhancements over its predecessors. While many terms and concepts have remained consistent, some ma... |
Can someone explain what exactly the string "0 but true" means in Perl? As far as I understand, it equals zero in an integer comparison, but evaluates to true when used as a boolean. Is this correct? Is this a normal behavior of the language or is this a special string treated as a special case in the interpreter?
| In Perl, the string `"0 but true"` is indeed an interesting case when it comes to its behavior in boolean and numerical contexts.
1. **Numeric Context**: When Perl evaluates this string in a numeric context, it treats it as 0. This is because Perl tries to extract a numeric value from the string, and since the string ... | 12,642 | [
{
"from": "human",
"value": "Can someone explain what exactly the string \"0 but true\" means in Perl? As far as I understand, it equals zero in an integer comparison, but evaluates to true when used as a boolean. Is this correct? Is this a normal behavior of the language or is this a special string treated... |
movie id tt0438097 can be found at http://www.imdb.com/title/tt0438097/
What's the url for its poster image?
| The URL for the poster image of the movie with ID tt0438097 can typically be found by visiting the IMDb page for the movie and checking the poster section. However, I can't browse the internet or retrieve real-time data.
As of my last knowledge update, you could generally construct the URL for the poster image by loo... | 17,023 | [
{
"from": "human",
"value": "movie id tt0438097 can be found at http://www.imdb.com/title/tt0438097/\nWhat's the url for its poster image?\n"
},
{
"from": "gpt",
"value": "The URL for the poster image of the movie with ID tt0438097 can typically be found by visiting the IMDb page for the movie a... |
In .NET (VB), how can I take all of the items in one collection, and add them to a second collection (without losing pre-existing items in the second collection)? I'm looking for something a little more efficient than this:
For Each item As Host In hostCollection1
hostCollection2.Add(item)
Next
My collections are ... | To add all items from one collection to another in .NET (VB) without losing the pre-existing items in the second collection, you can make use of the `AddRange` method if your collection supports it. However, since you mentioned that you're using `Collection(Of T)` (which does not provide an `AddRange` method), a more e... | 13,328 | [
{
"from": "human",
"value": "In .NET (VB), how can I take all of the items in one collection, and add them to a second collection (without losing pre-existing items in the second collection)? I'm looking for something a little more efficient than this:\nFor Each item As Host In hostCollection1\n hostColl... |
How do you iterate over each file in a directory with a .bat or .cmd file?
For simplicity please provide an answer that just echoes the filename or file path.
| You can iterate over each file in a directory using a `.bat` or `.cmd` file by using a `for` loop. Below is a simple example that echoes the filename (including the path) for each file in a specified directory.
```batch
@echo off
setlocal
rem Specify the directory you want to iterate over
set "directory=C:\path\to\yo... | 17,652 | [
{
"from": "human",
"value": "How do you iterate over each file in a directory with a .bat or .cmd file?\nFor simplicity please provide an answer that just echoes the filename or file path.\n"
},
{
"from": "gpt",
"value": "You can iterate over each file in a directory using a `.bat` or `.cmd` fil... |
What is the most efficient way to get the default constructor (i.e. instance constructor with no parameters) of a System.Type?
I was thinking something along the lines of the code below but it seems like there should be a simplier more efficient way to do it.
Type type = typeof(FooBar)
BindingFlags flags = BindingFlags... | To efficiently retrieve the default constructor of a `System.Type`, you can use the `Type.GetConstructor` method directly. This approach is more efficient than getting all constructors and filtering them because it directly requests the default constructor, avoiding unnecessary enumeration.
Here's how you can do it:
... | 18,386 | [
{
"from": "human",
"value": "What is the most efficient way to get the default constructor (i.e. instance constructor with no parameters) of a System.Type?\nI was thinking something along the lines of the code below but it seems like there should be a simplier more efficient way to do it.\nType type = typeo... |
I have a situation where I might have multiple instances of a program running at once, and it's important that just one specific function not be executing in more than one of these instances at once.
Is this the proper way to use a mutex to prevent this from happening?
lock (this.GetType()) {
_log.Info("Doing Sync"... | Using a mutex (or lock in this case) to prevent concurrent execution of a specific function across multiple instances of a program is a good approach. However, there are a few important points to note regarding your implementation:
1. **Lock Scope**: The lock statement you are using (`lock (this.GetType())`) locks on ... | 14,366 | [
{
"from": "human",
"value": "I have a situation where I might have multiple instances of a program running at once, and it's important that just one specific function not be executing in more than one of these instances at once.\nIs this the proper way to use a mutex to prevent this from happening?\nlock (t... |
Up until recently, I've been storing multiple values into different hashes with the same keys as follows:
%boss = (
"Allan" => "George",
"Bob" => "George",
"George" => "lisa" );
%status = (
"Allan" => "Contractor",
"Bob" => "Part-time",
"George" => "Full-time" );
and then I can referen... | Yes, there is a more elegant way to handle this scenario in Perl! Instead of using multiple hashes with the same keys, you can store the values as a hash of arrays or a hash of hashes. This allows you to keep related data together in a structured way.
### Option 1: Hash of Hashes
This is a straightforward approach whe... | 17,549 | [
{
"from": "human",
"value": "Up until recently, I've been storing multiple values into different hashes with the same keys as follows:\n%boss = (\n \"Allan\" => \"George\",\n \"Bob\" => \"George\",\n \"George\" => \"lisa\" );\n\n%status = (\n \"Allan\" => \"Contractor\",\n \"Bob\" => ... |
How do I get the modified date/time of a file in Python?
| In Python, you can get the modified date/time of a file using the `os` module or the `pathlib` module. Here are examples using both methods:
### Method 1: Using `os` module
```python
import os
import time
# Specify the file path
file_path = 'example.txt'
# Get the modified time in seconds since the epoch
modified_t... | 17,980 | [
{
"from": "human",
"value": "How do I get the modified date/time of a file in Python?\n"
},
{
"from": "gpt",
"value": "In Python, you can get the modified date/time of a file using the `os` module or the `pathlib` module. Here are examples using both methods:\n\n### Method 1: Using `os` module\n... |
I am adding a service reference to one of my projects in Visual Studio 2008. On the "Service Reference Settings" screen I am selecting the default option which says "Reuse types in all referenced assemblies". I have referenced the project for which I want to reuse a type. That type is being passed in as a parameter t... | When adding a service reference in Visual Studio 2008 and selecting the option to "Reuse types in all referenced assemblies," it is intended to prevent the creation of duplicate types in the generated proxy file. However, there are some conditions that need to be met for this to work correctly. Here are a few things to... | 15,093 | [
{
"from": "human",
"value": "I am adding a service reference to one of my projects in Visual Studio 2008. On the \"Service Reference Settings\" screen I am selecting the default option which says \"Reuse types in all referenced assemblies\". I have referenced the project for which I want to reuse a type. ... |
I need to create a multi-dimensional (nested) hashtable/dictionary so that I can use syntax like
val = myHash("Key").("key")
I know I need to use Generics but I can't figure out the correct syntax using VB in ASP.NET 2.0, there are plenty of c# examples on the net but they aren't helping much.
Cheers!
| To create a multi-dimensional (nested) hashtable in VB.NET for use in ASP.NET, you can use `Hashtable` collections. In VB.NET, you can create a nested hashtable structure that allows you to access values using a syntax similar to the one you described. Here is how you can do it:
### Example of Creating a Nested Hashta... | 14,793 | [
{
"from": "human",
"value": "I need to create a multi-dimensional (nested) hashtable/dictionary so that I can use syntax like \nval = myHash(\"Key\").(\"key\")\n\nI know I need to use Generics but I can't figure out the correct syntax using VB in ASP.NET 2.0, there are plenty of c# examples on the net but t... |
In .NET, under which circumstances should I use GC.SuppressFinalize()?
What advantage(s) does using this method give me?
| In .NET, the `GC.SuppressFinalize()` method is used in the context of implementing the Dispose pattern when working with unmanaged resources or managing the lifetime of objects that require cleanup. Here are the circumstances in which you should use `GC.SuppressFinalize()` and its advantages:
### Circumstances for Usi... | 15,455 | [
{
"from": "human",
"value": "In .NET, under which circumstances should I use GC.SuppressFinalize()?\nWhat advantage(s) does using this method give me?\n"
},
{
"from": "gpt",
"value": "In .NET, the `GC.SuppressFinalize()` method is used in the context of implementing the Dispose pattern when work... |
I need an API that can make menus like Win32API,
But something simpler and better than WinAPI.
That can make GUI, with text zones, buttons etc...like an average Windows program.(Windows GUI Style)
Can anyone recommand on one like it? Thanks.
| If you're looking for a simpler and more modern alternative to the Win32 API for creating GUI applications in a Windows style, here are some great options to consider:
### 1. **Qt**
- **Description**: Qt is a powerful cross-platform GUI toolkit that is widely used for developing applications with rich user interfaces.... | 14,602 | [
{
"from": "human",
"value": "I need an API that can make menus like Win32API,\nBut something simpler and better than WinAPI.\nThat can make GUI, with text zones, buttons etc...like an average Windows program.(Windows GUI Style)\nCan anyone recommand on one like it? Thanks.\n"
},
{
"from": "gpt",
... |
I want to be able to list only the directories inside some folder.
This means I don't want filenames listed, nor do I want additional sub-folders.
Let's see if an example helps. In the current directory we have:
>>> os.listdir(os.getcwd())
['cx_Oracle-doc', 'DLLs', 'Doc', 'include', 'Lib', 'libs', 'LICENSE.txt', 'mod_p... | If you want to list only the top-level directories in a folder without using `os.walk`, you can achieve this with `os.listdir` in combination with `os.path.isdir`. This way, you can filter out files and only keep directories. Here's how you can do it:
```python
import os
# Get the current working directory
current_di... | 17,690 | [
{
"from": "human",
"value": "I want to be able to list only the directories inside some folder.\nThis means I don't want filenames listed, nor do I want additional sub-folders.\nLet's see if an example helps. In the current directory we have:\n>>> os.listdir(os.getcwd())\n['cx_Oracle-doc', 'DLLs', 'Doc', 'i... |
I have a Publishing Portal site and I need to add some announcements to some of the pages. I've read an article which says that i have to create an announcement list to be able add an announcement web part but i can't seem to find any resources on how i can add an announcement list.
Any help will be greatly appreciate... | Creating an announcements list in SharePoint is a straightforward process. Here are the steps to create an announcement list that you can then use to add an Announcements web part to your Publishing Portal site:
### Step 1: Create an Announcement List
1. **Navigate to Your Site**: Go to your Publishing Portal site wh... | 10,960 | [
{
"from": "human",
"value": "I have a Publishing Portal site and I need to add some announcements to some of the pages. I've read an article which says that i have to create an announcement list to be able add an announcement web part but i can't seem to find any resources on how i can add an announcement ... |
I'm sure this is a newbie question, but every time I've compiled/dl'ed a new version of vim for os x, running vim on the command-line opens up the gvim app. I just want to upgrade the console version (so I can, for example, have python compiled in to use omnicomplete).
| It sounds like you might be running into a situation where the `vim` command in your terminal is actually pointing to the graphical version of Vim (GVim) instead of the console version. This can happen if the installation path of GVim is prioritized in your shell's PATH variable.
Here's how you can resolve this and en... | 15,434 | [
{
"from": "human",
"value": "I'm sure this is a newbie question, but every time I've compiled/dl'ed a new version of vim for os x, running vim on the command-line opens up the gvim app. I just want to upgrade the console version (so I can, for example, have python compiled in to use omnicomplete).\n"
},
... |
What is the best way to replace all '<' with < in a given database column? Basically perform s/<[^;]/</gi
Notes:
must work in MS SQL Server 2000
Must be repeatable (and not end up with <;;;;;;;;;)
| To replace all occurrences of `<` with `<` in a specific column in a table in MS SQL Server 2000, you can use the `REPLACE` function. Given your requirement that this should be repeatable and should not result in additional unwanted characters, you'll want to ensure that it only replaces `<` that is not already ... | 15,398 | [
{
"from": "human",
"value": "What is the best way to replace all '<' with < in a given database column? Basically perform s/<[^;]/</gi\nNotes:\n\nmust work in MS SQL Server 2000\nMust be repeatable (and not end up with <;;;;;;;;;)\n\n"
},
{
"from": "gpt",
"value": "To replace all oc... |
I tried this in mysql:
mysql> alter table region drop column country_id;
And got this:
ERROR 1025 (HY000): Error on rename of './product/#sql-14ae_81' to
'./product/region' (errno: 150)
Any ideas? Foreign key stuff?
| Yes, the error you're encountering (errno: 150) typically indicates a foreign key constraint issue in MySQL. When you try to drop a column that is part of a foreign key relationship, MySQL prevents you from doing so to maintain referential integrity.
Here are the steps you can take to resolve this issue:
1. **Identif... | 16,790 | [
{
"from": "human",
"value": "I tried this in mysql:\nmysql> alter table region drop column country_id;\n\nAnd got this:\nERROR 1025 (HY000): Error on rename of './product/#sql-14ae_81' to\n'./product/region' (errno: 150)\n\nAny ideas? Foreign key stuff?\n"
},
{
"from": "gpt",
"value": "Yes, the ... |
I haven't done work in C/C++ for a little bit and was just wondering what people's favorite cross platform libraries are to use.
I'm looking for something that is a good quick and dirty library as well as a library that is a little more robust. Often those are two different libraries and that's okay.
| When it comes to cross-platform development in C/C++, there are several libraries that cater to different needs, from quick-and-dirty solutions to more robust frameworks. Here are some popular ones in each category:
### Quick and Dirty Libraries:
1. **SDL (Simple DirectMedia Layer)**:
- **Use case**: Game developm... | 12,982 | [
{
"from": "human",
"value": "I haven't done work in C/C++ for a little bit and was just wondering what people's favorite cross platform libraries are to use. \nI'm looking for something that is a good quick and dirty library as well as a library that is a little more robust. Often those are two different ... |
How do I select one or more random rows from a table using SQLAlchemy?
| To select one or more random rows from a table using SQLAlchemy, you can use the `order_by` method combined with the `func.random()` function from SQLAlchemy. Here's how you can do it:
1. First, make sure you have your database session and your model defined.
2. Use the `order_by` method to sort the rows randomly.
3. ... | 15,314 | [
{
"from": "human",
"value": "How do I select one or more random rows from a table using SQLAlchemy? \n"
},
{
"from": "gpt",
"value": "To select one or more random rows from a table using SQLAlchemy, you can use the `order_by` method combined with the `func.random()` function from SQLAlchemy. Her... |
I have a datagridview assigned a datasource to it. now how to add a new row to that grid and remove a row from it?
| To add and remove rows from a DataGridView that is bound to a data source, you typically manipulate the data source rather than the DataGridView directly. Here's how to do it depending on the type of data source you're using.
### If you're using a DataTable as your data source:
1. **Adding a new row:**
```csharp
... | 13,700 | [
{
"from": "human",
"value": "I have a datagridview assigned a datasource to it. now how to add a new row to that grid and remove a row from it?\n"
},
{
"from": "gpt",
"value": "To add and remove rows from a DataGridView that is bound to a data source, you typically manipulate the data source rat... |
I'm trying to tar up all the *.class files only on a Solaris box under a certain directory.
Reading the man pages for tar made it seem like the -I option is what I wanted.
This is what I've tried from the dir in question:
find . -name "*.class" >> ~/includes.txt
tar cvf ~/classfiles.tar -I ~/includes.txt
From that I ... | It looks like you're trying to create a tar archive of all `*.class` files in a directory using a list of files in a text file, but the `-I` option in `tar` is not quite what you need in this situation. The `-I` option is used for specifying a command to read the list of files from, while you want to use a list of file... | 17,682 | [
{
"from": "human",
"value": "I'm trying to tar up all the *.class files only on a Solaris box under a certain directory. \nReading the man pages for tar made it seem like the -I option is what I wanted.\nThis is what I've tried from the dir in question:\nfind . -name \"*.class\" >> ~/includes.txt\ntar cvf ~... |
If a file is set to read only mode, how do I change it to write mode and vice versa from within Emacs?
| In Emacs, you can change the read-only status of a file from within the editor using the following methods:
1. **To Toggle Read-Only Mode**:
- You can toggle the read-only status of the current buffer by using the command:
```
M-x toggle-read-only
```
- This command will switch the buffer between ... | 18,042 | [
{
"from": "human",
"value": "If a file is set to read only mode, how do I change it to write mode and vice versa from within Emacs?\n"
},
{
"from": "gpt",
"value": "In Emacs, you can change the read-only status of a file from within the editor using the following methods:\n\n1. **To Toggle Read-... |
I'm looking for an overview over different source code control policies. I only came across the Main-Line policy and would like to better know others before committing to one with the team.
Can someone provide a link to an overview or even give me some names of policies so I can launch google on it?
| Certainly! Source code control policies help teams manage changes to code in a structured way. Here’s an overview of some common version control policies, along with a brief description of each:
1. **Main-Line Development** (or "Trunk-Based Development"):
- A single branch (the mainline or trunk) is used for all de... | 14,048 | [
{
"from": "human",
"value": "I'm looking for an overview over different source code control policies. I only came across the Main-Line policy and would like to better know others before committing to one with the team.\nCan someone provide a link to an overview or even give me some names of policies so I ca... |
It is discouraged to simply catch System.Exception. Instead, only the "known" exceptions should be caught.
Now, this sometimes leads to unnecessary repetitive code, for example:
try
{
WebId = new Guid(queryString["web"]);
}
catch (FormatException)
{
WebId = Guid.Empty;
}
catch (OverflowException)
{
WebId = ... | Yes, you can definitely catch multiple specific exceptions in C# and handle them in a single catch block. One effective way to do this is to use a `when` clause to filter the exceptions, or you can catch the exceptions in a common base class if applicable.
For your specific case with the `FormatException` and `Overflo... | 14,027 | [
{
"from": "human",
"value": "It is discouraged to simply catch System.Exception. Instead, only the \"known\" exceptions should be caught.\nNow, this sometimes leads to unnecessary repetitive code, for example:\ntry\n{\n WebId = new Guid(queryString[\"web\"]);\n}\ncatch (FormatException)\n{\n WebId = G... |
Take a .Net Winforms App.. mix in a flakey wireless network connection, stir with a few users who like to simply pull the blue plug out occasionally and for good measure, add a Systems Admin that decides to reboot the SQL server box without warning now and again just to keep everyone on their toes.
What are the suggest... | Handling a .NET WinForms application in an environment with unreliable network connections and unpredictable server reboots requires a thoughtful approach to both error handling and application management. Below are some strategies and suggestions for managing such scenarios.
### Error Handling Strategies
1. **Use Tr... | 11,765 | [
{
"from": "human",
"value": "Take a .Net Winforms App.. mix in a flakey wireless network connection, stir with a few users who like to simply pull the blue plug out occasionally and for good measure, add a Systems Admin that decides to reboot the SQL server box without warning now and again just to keep eve... |
This is a php example, but an algorithm for any language would do. What I specifically want to do is bubble up the United States and Canada to the top of the list. Here is an example of the array shortened for brevity.
array(
0 => '-- SELECT --',
1 => 'Afghanistan',
2 => 'Albania',
3 => 'Algeria',
4 => 'Amer... | To accomplish the task of moving the United States and Canada to the top of a list (while keeping their IDs intact), you can create a custom sorting function. Below is a PHP example demonstrating this approach:
```php
<?php
$countries = array(
0 => '-- SELECT --',
1 => 'Afghanistan',
2 => 'Albania',
3... | 11,901 | [
{
"from": "human",
"value": "This is a php example, but an algorithm for any language would do. What I specifically want to do is bubble up the United States and Canada to the top of the list. Here is an example of the array shortened for brevity. \narray(\n 0 => '-- SELECT --',\n 1 => 'Afghanistan',\n 2... |
How do you compress Script Resources of ASP.Net? I saw a file there reached up to 255 KB! I tried finding solutions, but so far it only talks about scripting dynamic and static files. I checked the compression temp folder of IIS and found no compressed scripted resource there. That led me to the conclusion that these f... | Compressing script resources in ASP.NET can significantly improve page load times and reduce bandwidth usage, especially when dealing with large files like JavaScript libraries. Here are several ways you can enable compression for script resources in an ASP.NET application:
### 1. **Enable GZip Compression in IIS:**
... | 12,071 | [
{
"from": "human",
"value": "How do you compress Script Resources of ASP.Net? I saw a file there reached up to 255 KB! I tried finding solutions, but so far it only talks about scripting dynamic and static files. I checked the compression temp folder of IIS and found no compressed scripted resource there. T... |
I am using WPF and I have an image of an 8.5" * 11" piece of paper on a Canvas. I am then rotating the image using a RotateTransform, with the axis being in the middle of the page (that is, RotateTransformOrigin="0.5,0.5"). How can I find the actual location on the canvas of the corners of the image?
| To calculate the actual locations of the corners of the rotated image in a WPF Canvas, you need to consider several factors, including the original dimensions of the image, its transformation, and the canvas position. Below is a step-by-step guide to help you determine the coordinates of the corners after applying the ... | 8,638 | [
{
"from": "human",
"value": "I am using WPF and I have an image of an 8.5\" * 11\" piece of paper on a Canvas. I am then rotating the image using a RotateTransform, with the axis being in the middle of the page (that is, RotateTransformOrigin=\"0.5,0.5\"). How can I find the actual location on the canvas ... |
I'm a pretty inexperienced programmer (can make tk apps, text processing, sort of understand oop), but Python is so awesome that I would like to help the community. What's the best way for a beginner to contribute?
| It's great to hear that you want to contribute to the Python community! There are several ways for beginners to get involved, and each can be rewarding in its own way. Here are some suggestions:
1. **Contribute to Open Source Projects**:
- Look for beginner-friendly projects on platforms like [GitHub](https://githu... | 10,432 | [
{
"from": "human",
"value": "I'm a pretty inexperienced programmer (can make tk apps, text processing, sort of understand oop), but Python is so awesome that I would like to help the community. What's the best way for a beginner to contribute?\n"
},
{
"from": "gpt",
"value": "It's great to hear... |
After solving my flicker issue, I wonder if there is a better closable Tabbed Pane, then the one that pops up on top by googling for closabletappedpane?
(you recognize it by its processMouseEvents Method)
I especially need one, that never flickers :-)
Please post your experience, links with your own closable Tabbed Pa... | Flickering in UI components like tabbed panes can be an annoyance, and finding a solution that is both functional and visually appealing is important. While I can't provide direct links, I can suggest some options and approaches based on common practices in Java Swing for creating closable tabbed panes.
### Alternativ... | 14,887 | [
{
"from": "human",
"value": "After solving my flicker issue, I wonder if there is a better closable Tabbed Pane, then the one that pops up on top by googling for closabletappedpane?\n(you recognize it by its processMouseEvents Method)\nI especially need one, that never flickers :-) \nPlease post your experi... |
I am putting together a proposal for a large multinational company for our licenced solution. Problem is I've never put together something this big before and so I don't know what is acceptable. Ignoring hosting or support (or even the functionality of the app) for the moment and just concentrating the licence - do yo... | Creating a licensing proposal for a large multinational company can indeed be a complex task, especially when considering the different pricing models that could apply. Here are some insights into the common practices and considerations in licensing:
### Licensing Models
1. **Per User Licensing**:
- This model cha... | 13,332 | [
{
"from": "human",
"value": "I am putting together a proposal for a large multinational company for our licenced solution. Problem is I've never put together something this big before and so I don't know what is acceptable. Ignoring hosting or support (or even the functionality of the app) for the moment a... |
I am trying to configure Reporting Services 2005SP2 on a machine with SQL 2008 on another hosting the ReportServer DB.
When I create the ReportServerDB the DB is created as version C.0.9.45:
When, afterwards, I try to initialise Reporting Services, I get an error about an incorrect version number. Reporting Services cr... | The issue you’re facing arises from a version mismatch between SQL Server Reporting Services (SSRS) and the Report Server database (ReportServerDB). Since you're running SQL Server 2008 and using Reporting Services 2005 SP2, it's expected that the version of the Report Server database may not be compatible with SSRS 20... | 12,959 | [
{
"from": "human",
"value": "I am trying to configure Reporting Services 2005SP2 on a machine with SQL 2008 on another hosting the ReportServer DB.\nWhen I create the ReportServerDB the DB is created as version C.0.9.45:\nWhen, afterwards, I try to initialise Reporting Services, I get an error about an inco... |
I have noticed that some browsers (in particular, Firefox and Opera) are very zealous in using cached copies of .css and .js files, even between browser sessions. This leads to a problem when you update one of these files, but the user's browser keeps on using the cached copy.
What is the most elegant way of forcing th... | To efficiently manage browser caching for CSS and JavaScript files while ensuring that users receive updated versions when changes occur, you can utilize a technique known as cache busting or auto-versioning. Here are some effective strategies:
### 1. Query String Versioning
One of the most common methods is to appen... | 12,852 | [
{
"from": "human",
"value": "I have noticed that some browsers (in particular, Firefox and Opera) are very zealous in using cached copies of .css and .js files, even between browser sessions. This leads to a problem when you update one of these files, but the user's browser keeps on using the cached copy.\n... |
Do you have a common base class for Hibernate entities, i.e. a MappedSuperclass with id, version and other common properties? Are there any drawbacks?
Example:
@MappedSuperclass()
public class BaseEntity {
private Long id;
private Long version;
...
@Id @GeneratedValue(strategy = GenerationType.AUTO)
... | Yes, using a common base class for Hibernate entities, typically defined as a `@MappedSuperclass`, is a common practice. It allows you to centralize common fields and behavior (like `id`, `version`, timestamps, etc.) across multiple entity classes, which promotes code reusability and consistency.
Here’s a refined exam... | 12,929 | [
{
"from": "human",
"value": "Do you have a common base class for Hibernate entities, i.e. a MappedSuperclass with id, version and other common properties? Are there any drawbacks?\nExample:\n@MappedSuperclass()\npublic class BaseEntity {\n\n private Long id;\n private Long version;\n ...\n\n @Id... |
Here is a sample code to retrieve data from a database using the yield keyword that I found in a few place while googling around :
public IEnumerable<object> ExecuteSelect(string commandText)
{
using (IDbConnection connection = CreateConnection())
{
using (IDbCommand cmd = CreateCommand(commandText, con... | You are correct in your understanding that in the provided code, if the `ExecuteSelect` method is called and the returned `IEnumerable<object>` is not fully iterated over, the `using` statement for the `IDbConnection` may not complete, and the connection may remain open. This is because the `yield return` statement def... | 14,509 | [
{
"from": "human",
"value": "Here is a sample code to retrieve data from a database using the yield keyword that I found in a few place while googling around :\npublic IEnumerable<object> ExecuteSelect(string commandText)\n{\n using (IDbConnection connection = CreateConnection())\n {\n using (I... |
I am trying to improve the performance of a web application. I have metrics that I can use to optimize the time taken to return the main HTML page, but I'm concerned about the external CSS and JavaScript files that are included from these HTML pages. These are served statically, with HTTP Expires headers, but are sha... | Optimizing the performance of a web application involves several strategies, especially when it comes to managing external CSS and JavaScript files. Here are some considerations and tools that can help you determine the best approach:
### Considerations for CSS and JavaScript Management
1. **Bundle and Minify**: If y... | 14,380 | [
{
"from": "human",
"value": "I am trying to improve the performance of a web application. I have metrics that I can use to optimize the time taken to return the main HTML page, but I'm concerned about the external CSS and JavaScript files that are included from these HTML pages. These are served staticall... |
I've been impressed by the screencasts for Rails that demonstrate the built-in web server, and database to allow development and testing to occur on the local machine. How can I get an instance of Apache to execute a project directory as its DocumentRoot, and maybe serve up the files on port 8080 (or something similar)... | To set up Apache to serve a specific project directory on a non-standard port (like 8080) in macOS, you can follow these steps:
### 1. Configure Apache
1. **Open the Apache configuration file**:
The default Apache configuration file is located at `/etc/apache2/httpd.conf`. You can edit it using your preferred text... | 11,535 | [
{
"from": "human",
"value": "I've been impressed by the screencasts for Rails that demonstrate the built-in web server, and database to allow development and testing to occur on the local machine. How can I get an instance of Apache to execute a project directory as its DocumentRoot, and maybe serve up the ... |
I've got a Win32 C++ app with a suite of unit tests. After the unit tests have finished running, I'd like a human-readable report on any unfreed memory to be automatically generated. Ideally, the report will have a stack with files & line number info for each unfreed allocation. It would be nice to have them generat... | To achieve the functionality you want on Windows for tracking memory leaks and generating human-readable reports, you can use the **Visual Studio built-in tools** or a third-party library such as **Google's AddressSanitizer**. Below, I will outline both approaches, focusing primarily on native solutions you can integra... | 15,691 | [
{
"from": "human",
"value": "I've got a Win32 C++ app with a suite of unit tests. After the unit tests have finished running, I'd like a human-readable report on any unfreed memory to be automatically generated. Ideally, the report will have a stack with files & line number info for each unfreed allocatio... |
I am receiving a 3rd party feed of which I cannot be certain of the namespace so I am currently having to use the local-name() function in my XSLT to get the element values. However I need to get an attribute from one such element and I don't know how to do this when the namespaces are unknown (hence need for local-nam... | To retrieve the attribute value of an element (like `term`) from an XML structure when namespaces are unknown, you can continue using the `local-name()` function in your XSLT to ensure you are properly accessing the elements without being restricted by namespaces.
In your case, you want to fetch the `term` attribute ... | 8,477 | [
{
"from": "human",
"value": "I am receiving a 3rd party feed of which I cannot be certain of the namespace so I am currently having to use the local-name() function in my XSLT to get the element values. However I need to get an attribute from one such element and I don't know how to do this when the namespa... |
All,
I have built a nifty demo application that displays data about our internal systems as a full-screen "billboard" style display. You could think of this as something like an application displaying the national deficit - rapidly increasing numbers, animating very quickly, all day.
The problem is that the demo works ... | Hi RF,
It sounds like you have an exciting project ahead of you! Given your requirements and preferences, here are a few options that might work well for you:
### 1. **Qt**
- **Language**: C++
- **Description**: Qt is a powerful cross-platform toolkit that makes it relatively easy to create GUI applications. It suppo... | 16,245 | [
{
"from": "human",
"value": "All,\nI have built a nifty demo application that displays data about our internal systems as a full-screen \"billboard\" style display. You could think of this as something like an application displaying the national deficit - rapidly increasing numbers, animating very quickly, ... |
I have tried:
Xdebug and Eclipse. Eclipse launches a web browser, but the browser tries to access a non-existent file in Eclipse's .app bundle.
Xdebug and NetBeans. It does a little bit better; a browser opens a page in /tmp which says "Launching. Please wait…" but nothing happens beyond that.
Xdebug and debugclient, ... | Debugging PHP on macOS can indeed be tricky, especially when dealing with Xdebug and various IDEs or text editors. Here’s a breakdown of how you can set up Xdebug effectively without relying on Eclipse or Zend Studio, and I will also touch upon some lightweight editors you might consider.
### Step-by-Step Setup for Xd... | 11,626 | [
{
"from": "human",
"value": "I have tried:\n\nXdebug and Eclipse. Eclipse launches a web browser, but the browser tries to access a non-existent file in Eclipse's .app bundle.\nXdebug and NetBeans. It does a little bit better; a browser opens a page in /tmp which says \"Launching. Please wait…\" but nothing... |
According to MSDN
form.RightToLeftLayout = True;
form.RightToLeft = ifWeWantRTL() ? RightToLeft.True : RightToLeft.False;
is enough to mirrow the form content for RTL languages.
But controls placement gets mirrowed only for controls immediately on the form,
those inside a GroupBox or a Panel are not mirrowed, unless ... | When working with Windows Forms and Right-to-Left (RTL) layout, it can indeed be tedious to manually adjust the layout for each container control, such as `GroupBox` or `Panel`. To address your concerns, here are a few strategies you might consider to simplify the mirroring process for your controls in RTL layouts:
##... | 14,406 | [
{
"from": "human",
"value": "According to MSDN \nform.RightToLeftLayout = True;\nform.RightToLeft = ifWeWantRTL() ? RightToLeft.True : RightToLeft.False;\n\nis enough to mirrow the form content for RTL languages.\nBut controls placement gets mirrowed only for controls immediately on the form,\nthose inside ... |
When I try to send an HTTP GET request through XMLHttpRequest it works on non-secure HTTP.
But when sent over HTTPS, different browsers gave different results:
On Firefox 3.0.2:
- The GET request doesn't reach the web server.
On IE 7:
- The GET request reached the web server.
Does this have something to do with Firefox... | It seems like you’re encountering issues with making XMLHttpRequest calls over HTTPS in Firefox, particularly with untrusted certificates. Let's break down the possible reasons and solutions.
### 1. **Certificate Trust Issues:**
- **Firefox's Certificate Policy:** Firefox may be stricter than Internet Explorer when... | 11,312 | [
{
"from": "human",
"value": "When I try to send an HTTP GET request through XMLHttpRequest it works on non-secure HTTP.\nBut when sent over HTTPS, different browsers gave different results:\nOn Firefox 3.0.2:\n- The GET request doesn't reach the web server.\nOn IE 7:\n- The GET request reached the web serve... |
I recently began profiling an osgi java application that I am writing using VisualVM. One thing I have noticed is that when the application starts sending data to a client (over JMS), the number of loaded classes starts increasing at a steady rate. The Heap size and the PermGen size remains constant, however. The nu... | It sounds like you're observing an increase in the number of loaded classes in your OSGi application as it sends data over JMS, which raises some interesting questions about the behavior of class loading and memory management in Java.
Here are a few points to consider regarding your observation:
1. **Class Loading in... | 15,883 | [
{
"from": "human",
"value": "I recently began profiling an osgi java application that I am writing using VisualVM. One thing I have noticed is that when the application starts sending data to a client (over JMS), the number of loaded classes starts increasing at a steady rate. The Heap size and the PermGe... |
I'm trying to display a series of titles varying from 60 characters to 160 or so and the capitalization varies, some of it all caps, some half caps. When it's mostly lowercase the whole 160 characters of text fits in the width I want, but when it starts getting more caps (they must be wider), it starts over flowing.
I... | When dealing with varying text lengths and capitalization that affects the layout, you have several approaches to ensure the text fits within a fixed width while maintaining an attractive display. Here are some options you can consider:
### 1. Use a Monospaced Font
Monospaced fonts ensure that each character takes up ... | 15,410 | [
{
"from": "human",
"value": "I'm trying to display a series of titles varying from 60 characters to 160 or so and the capitalization varies, some of it all caps, some half caps. When it's mostly lowercase the whole 160 characters of text fits in the width I want, but when it starts getting more caps (they ... |
I realize there is a somewhat related thread on this here:
Loading assemblies and its dependencies
But I am modifying something and this doesn't exactly apply.
string path = Path.GetDirectoryName( pathOfAssembly );
Environment.CurrentDirectory = path;
Assembly.Load(Path.GetFileNameWithoutExtension(pastOfAssembly));
... | The two methods you're considering, `Assembly.Load` and `Assembly.LoadFile`, have distinct behaviors that can impact the way assemblies and their dependencies are loaded in your application. Let's break down the differences and discuss the implications of each method.
### 1. `Assembly.Load`
- **Purpose**: This method ... | 14,024 | [
{
"from": "human",
"value": "I realize there is a somewhat related thread on this here: \nLoading assemblies and its dependencies\nBut I am modifying something and this doesn't exactly apply. \nstring path = Path.GetDirectoryName( pathOfAssembly ); \nEnvironment.CurrentDirectory = path;\nAssembly.Load(Path.... |
I'm taking a course in computational complexity and have so far had an impression that it won't be of much help to a developer.
I might be wrong but if you have gone down this path before, could you please provide an example of how the complexity theory helped you in your work? Tons of thanks.
| It's a common sentiment among developers that the theoretical aspects of computational complexity may not directly impact their day-to-day work. However, understanding complexity theory can significantly enhance your ability to analyze and optimize algorithms, make informed design decisions, and solve problems more eff... | 11,455 | [
{
"from": "human",
"value": "I'm taking a course in computational complexity and have so far had an impression that it won't be of much help to a developer. \nI might be wrong but if you have gone down this path before, could you please provide an example of how the complexity theory helped you in your work... |
I have written a lot of code in Python, and I am very used to the syntax, object structure, and so forth of Python because of it.
What is the best online guide or resource site to provide me with the basics, as well as a comparison or lookup guide with equivalent functions/features in VBA versus Python.
For example, I ... | Transitioning from Python to VBA can indeed be challenging due to the differences in syntax, object structures, and paradigms. Here are some resources that can help you understand the similarities and differences between Python and VBA, along with practical examples:
### Online Guides and Resources:
1. **W3Schools VB... | 12,224 | [
{
"from": "human",
"value": "I have written a lot of code in Python, and I am very used to the syntax, object structure, and so forth of Python because of it.\nWhat is the best online guide or resource site to provide me with the basics, as well as a comparison or lookup guide with equivalent functions/feat... |
In SQL Server 2005, are there any disadvantages to making all character fields nvarchar(MAX) rather than specifying a length explicitly, e.g. nvarchar(255)? (Apart from the obvious one that you aren't able to limit the field length at the database level)
| Using `nvarchar(MAX)` instead of specifying a fixed length (e.g., `nvarchar(255)`) in SQL Server 2005 comes with several potential disadvantages beyond simply lacking the ability to limit the field length at the database level:
1. **Storage Efficiency**:
- `nvarchar(MAX)` can consume more space than necessary. Whi... | 16,247 | [
{
"from": "human",
"value": "In SQL Server 2005, are there any disadvantages to making all character fields nvarchar(MAX) rather than specifying a length explicitly, e.g. nvarchar(255)? (Apart from the obvious one that you aren't able to limit the field length at the database level)\n"
},
{
"from": ... |
After I call getpwuid(uid), I have a reference to a pointer. Should I free that pointer when I don't use it anymore? Reading the man pages, it says that it makes reference to some static area, that may be overwritten by subsequent calls to the same functions, so I'm not sure if I should touch that memory area.
Thanks.
| When you call the `getpwuid(uid)` function in C, it returns a pointer to a `struct passwd` that points to a statically allocated area. This means that the data is stored in a fixed memory location, and you do not need to free this pointer. In fact, attempting to free it would lead to undefined behavior.
Since the `get... | 17,140 | [
{
"from": "human",
"value": "After I call getpwuid(uid), I have a reference to a pointer. Should I free that pointer when I don't use it anymore? Reading the man pages, it says that it makes reference to some static area, that may be overwritten by subsequent calls to the same functions, so I'm not sure if ... |
From what I've seen the tag is ignored when hosting a WCF service in IIS. I understand that when self-hosting this is required but is this harmful or even used when operating under IIS?
ex.
<system.serviceModel>
<service blah blah blah>
<host>
<baseAddresses>
<add baseAddress="http://localhost/bla... | When hosting a WCF (Windows Communication Foundation) service in IIS (Internet Information Services), the `<host>` element, particularly the `<baseAddresses>` section, is typically not needed and often ignored. This is primarily due to how IIS manages the endpoint addressing for WCF services.
### Explanation
1. **IIS... | 15,430 | [
{
"from": "human",
"value": "From what I've seen the tag is ignored when hosting a WCF service in IIS. I understand that when self-hosting this is required but is this harmful or even used when operating under IIS?\nex.\n<system.serviceModel>\n <service blah blah blah>\n <host>\n <baseAddresses>\... |
Can I simulate in C#/C++ code Control+Alt+Delete sequence in Vista?
When UAC enabled/disabled?
How it is done in XP?
Can you provide a code sample that works in Vista?
| Simulating the Control + Alt + Delete (Ctrl + Alt + Del) sequence programmatically is not allowed in Windows for security reasons. This is designed to prevent malicious software from simulating this keystroke sequence, which is often associated with secure operations like accessing the Task Manager, logging out, or swi... | 18,059 | [
{
"from": "human",
"value": "Can I simulate in C#/C++ code Control+Alt+Delete sequence in Vista? \nWhen UAC enabled/disabled?\nHow it is done in XP?\nCan you provide a code sample that works in Vista?\n"
},
{
"from": "gpt",
"value": "Simulating the Control + Alt + Delete (Ctrl + Alt + Del) seque... |
I'm building a Thunderbird extension and would like to add my own header to all outgoing email (e.g. <myext-version: 1.0> ). Any idea how to do this? I know it's possible since this is done in the OpenPGP Enigmail extension. Thanks!
| To add a custom header to all outgoing emails in a Thunderbird extension, you'll need to use the Thunderbird WebExtensions API. Although Thunderbird extensions have evolved to align more closely with modern web technologies, the core functionalities for mail handling are still accessible.
Here's a general outline of t... | 13,910 | [
{
"from": "human",
"value": "I'm building a Thunderbird extension and would like to add my own header to all outgoing email (e.g. <myext-version: 1.0> ). Any idea how to do this? I know it's possible since this is done in the OpenPGP Enigmail extension. Thanks!\n"
},
{
"from": "gpt",
"value": "T... |
I'm working on a little test application at the minute and I have multiple window objects floating around and they each call RegisterWindowEx with the same WNDCLASSEX structure (mainly because they are all an instance of the same class).
The first one registers ok, then multiple ones fail, saying class already register... | Yes, your observation is correct—if you attempt to register the same window class multiple times using `RegisterClassEx`, Windows will return an error for subsequent attempts to register a class with the same name. Specifically, you'll get an error code of `ERROR_CLASS_ALREADY_EXISTS`.
### Is it bad to register the sa... | 14,844 | [
{
"from": "human",
"value": "I'm working on a little test application at the minute and I have multiple window objects floating around and they each call RegisterWindowEx with the same WNDCLASSEX structure (mainly because they are all an instance of the same class).\nThe first one registers ok, then multipl... |
Exception Thrown: "System.ComponentModel.ReflectPropertyDescriptor is not marked as Serializable"
Does this mean I missed marking something as serializable myself, or is this something beyond my control?
| The exception you are encountering, "System.ComponentModel.ReflectPropertyDescriptor is not marked as Serializable," indicates that the `ReflectPropertyDescriptor` class itself is not marked as serializable, which means that it cannot be serialized by the .NET framework.
This issue typically arises when you are trying... | 15,995 | [
{
"from": "human",
"value": "Exception Thrown: \"System.ComponentModel.ReflectPropertyDescriptor is not marked as Serializable\"\nDoes this mean I missed marking something as serializable myself, or is this something beyond my control?\n"
},
{
"from": "gpt",
"value": "The exception you are encou... |
Where did the idea of design patterns come from, who decided what is and isn't a pattern and gave them their names? Is there an official organisation that defines them, or do they exist through some community consensus?
| The concept of design patterns in software engineering was popularized by the book "Design Patterns: Elements of Reusable Object-Oriented Software," published in 1994 by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, collectively known as the "Gang of Four" (GoF). This book categorized common solutions t... | 15,379 | [
{
"from": "human",
"value": "Where did the idea of design patterns come from, who decided what is and isn't a pattern and gave them their names? Is there an official organisation that defines them, or do they exist through some community consensus?\n"
},
{
"from": "gpt",
"value": "The concept of... |
I want to discover all xml files that my ClassLoader is aware of using a wildcard pattern. Is there any way to do this?
| To discover XML files (or any files) that your `ClassLoader` is aware of, using a wildcard pattern isn't directly supported by the `ClassLoader` API itself, as it doesn't provide a built-in method to list resources based on patterns. However, you can implement a workaround to achieve this by enumerating the resources i... | 13,316 | [
{
"from": "human",
"value": "I want to discover all xml files that my ClassLoader is aware of using a wildcard pattern. Is there any way to do this?\n"
},
{
"from": "gpt",
"value": "To discover XML files (or any files) that your `ClassLoader` is aware of, using a wildcard pattern isn't directly... |
Is there any way to list all the files that have changed between two tags in CVS?
Every time we do a release we apply a tag to all the files in that release. I want to find all the files that changed between releases.
It would also work if I could find all files that had changed between two dates.
| In CVS (Concurrent Versions System), you can use the `cvs rdiff` command to compare two tags (or branches) and get a list of files that have changed. Here's how you can do it:
### Comparing Two Tags
To list all files that have changed between two tags, you can use the following command:
```bash
cvs rdiff -n -u -r TA... | 14,548 | [
{
"from": "human",
"value": "Is there any way to list all the files that have changed between two tags in CVS?\nEvery time we do a release we apply a tag to all the files in that release. I want to find all the files that changed between releases.\nIt would also work if I could find all files that had chang... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.