instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I just saw Clone Detective linked on YCombinator news, and the idea heavily appeals to me. It seems like it would be useful for many languages, not just C#, but I haven't seen anything similar elsewhere.
Edit: For those who don't want to follow the link, Clone Detective scans the codebase for duplicate code that may wa... | Clone Detective is indeed a valuable tool for identifying duplicate code in a codebase, which can help developers refactor and improve code quality. Duplicate code, often referred to as "code smells," can lead to maintenance challenges, bugs, and increased effort in updating code across multiple locations.
While Clone... | 2,695 | [
{
"from": "human",
"value": "I just saw Clone Detective linked on YCombinator news, and the idea heavily appeals to me. It seems like it would be useful for many languages, not just C#, but I haven't seen anything similar elsewhere.\nEdit: For those who don't want to follow the link, Clone Detective scans t... |
I'd like to provide some way of creating dynamically loadable plugins in my software.
Typical way to do this is using the LoadLibrary WinAPI function to load a dll and calling GetProcAddress to get an pointer to a function inside that dll.
My question is how do I dynamically load a plugin in C#/.Net application?
| Dynamically loading plugins in a C#/.NET application can be achieved using reflection and the `Assembly` class. The .NET framework provides a way to load DLLs and invoke methods within them, which is very similar to using `LoadLibrary` and `GetProcAddress` in a C/C++ context.
Here's a step-by-step guide to dynamically... | 2,150 | [
{
"from": "human",
"value": "I'd like to provide some way of creating dynamically loadable plugins in my software.\nTypical way to do this is using the LoadLibrary WinAPI function to load a dll and calling GetProcAddress to get an pointer to a function inside that dll.\nMy question is how do I dynamically l... |
#include <stdio.h>
int main() {
unsigned long long int num = 285212672; //FYI: fits in 29 bits
int normalInt = 5;
printf("My number is %d bytes wide and its value is %ul. A normal number is %d.\n", sizeof(num), num, normalInt);
return 0;
}
Output:
My number is 8 bytes wide and its value is 285212672l. ... | The issue you're encountering in your `printf` statement is related to the format specifier you are using for printing the `unsigned long long int`. You are currently using `%ul`, which is incorrect. Instead, you should use the format specifier `%llu` to properly print an `unsigned long long int`.
Here's the corrected... | 2,512 | [
{
"from": "human",
"value": "#include <stdio.h>\nint main() {\n unsigned long long int num = 285212672; //FYI: fits in 29 bits\n int normalInt = 5;\n printf(\"My number is %d bytes wide and its value is %ul. A normal number is %d.\\n\", sizeof(num), num, normalInt);\n return 0;\n}\n\nOutput:\nMy... |
When using jQuery's ajax method to submit form data, what is the best way to handle errors?
This is an example of what a call might look like:
$.ajax({
url: "userCreation.ashx",
data: { u:userName, p:password, e:email },
type: "POST",
beforeSend: function(){disableSubmitButton();},
complete: functio... | When working with AJAX in jQuery and handling errors, especially in the context of a server-side handler like `ashx`, it is generally better to avoid relying on unhandled exceptions. Instead, you should return explicit status codes and structured error messages from your server-side code. This approach gives you better... | 277 | [
{
"from": "human",
"value": "When using jQuery's ajax method to submit form data, what is the best way to handle errors?\nThis is an example of what a call might look like:\n$.ajax({\n url: \"userCreation.ashx\",\n data: { u:userName, p:password, e:email },\n type: \"POST\",\n beforeSend: functi... |
What is the complete and correct syntax for the SQL Case expression?
| The SQL `CASE` expression is used to create conditional logic within SQL statements. There are two types of `CASE` expressions: the simple `CASE` expression and the searched `CASE` expression. Here’s the complete and correct syntax for both.
### 1. Simple CASE Expression
The simple `CASE` expression compares an expre... | 517 | [
{
"from": "human",
"value": "What is the complete and correct syntax for the SQL Case expression?\n"
},
{
"from": "gpt",
"value": "The SQL `CASE` expression is used to create conditional logic within SQL statements. There are two types of `CASE` expressions: the simple `CASE` expression and the ... |
I would like to have all developers on my team to use the same rules for formatting several types of code (ASPX, CSS, JavaScript, C#). Can I have visual studio look to a common place for these rules?
I would like to not rely on export/import settings as that brings many settings along. I (for example) don't care what... | Yes, you can enforce consistent formatting rules for your development team in Visual Studio without relying on the export/import settings feature, which includes many other configurations you may not want to synchronize.
Here are some strategies to achieve consistent code formatting across your team:
### 1. **EditorC... | 745 | [
{
"from": "human",
"value": "I would like to have all developers on my team to use the same rules for formatting several types of code (ASPX, CSS, JavaScript, C#). Can I have visual studio look to a common place for these rules?\nI would like to not rely on export/import settings as that brings many settin... |
In coding a traditional MVC application, what is the best practice for coding server-side form validations? Does the code belong in the controller, or the model layer? And why?
| In a traditional MVC (Model-View-Controller) application, the best practice for coding server-side form validations is to implement them in the model layer rather than the controller. Here are the reasons why this approach is generally preferred:
### 1. **Separation of Concerns**:
- **Model**: The model represents ... | 1,124 | [
{
"from": "human",
"value": "In coding a traditional MVC application, what is the best practice for coding server-side form validations? Does the code belong in the controller, or the model layer? And why?\n"
},
{
"from": "gpt",
"value": "In a traditional MVC (Model-View-Controller) application,... |
The company I used to work with has two developers working fulltime, and a handful of freelancers. They're in the process of hiring a new lead developer to try to bring order and management to the development.
But, currently, one of the developers has seen the light of Django (the company has only developed in PHP to d... | Introducing a new technology like Django and Python to a team that has primarily been using PHP can be a challenging process, especially with a small team and varied levels of experience. Here are some approaches they can take to navigate this transition:
### 1. **Evaluate the Current Needs and Future Goals**
- **A... | 1,225 | [
{
"from": "human",
"value": "The company I used to work with has two developers working fulltime, and a handful of freelancers. They're in the process of hiring a new lead developer to try to bring order and management to the development.\nBut, currently, one of the developers has seen the light of Django (... |
Since I started studying object-oriented programming, I frequently read articles/blogs saying functions are better, or not all problems should be modeled as objects. From your personal programming adventures, when do you think a problem is better solved by OOP?
| Object-oriented programming (OOP) offers several advantages, particularly for specific types of problems. Here are some scenarios where OOP might be more beneficial:
1. **Complex Systems**: OOP is particularly effective when dealing with complex systems that require modularity and encapsulation. The ability to model r... | 1,438 | [
{
"from": "human",
"value": "Since I started studying object-oriented programming, I frequently read articles/blogs saying functions are better, or not all problems should be modeled as objects. From your personal programming adventures, when do you think a problem is better solved by OOP?\n"
},
{
... |
In a macro for Visual Studio 6, I wanted to run an external program, so I typed:
shell("p4 open " + ActiveDocument.FullName)
Which gave me a type mismatch runtime error. What I ended up having to type was this:
Dim wshShell
Set wshShell = CreateObject("WScript.Shell")
strResult = wshShell.Run("p4 open " + ActiveDocume... | In Visual Studio 6 (which uses VBA-like syntax for its macros), the `Shell` function is quite limited compared to the more versatile `WScript.Shell` object that you used in your second example. Here's a breakdown of what's happening:
### Differences Between `Shell` and `WScript.Shell`
1. **Shell Function**:
- The... | 2,329 | [
{
"from": "human",
"value": "In a macro for Visual Studio 6, I wanted to run an external program, so I typed:\nshell(\"p4 open \" + ActiveDocument.FullName)\n\nWhich gave me a type mismatch runtime error. What I ended up having to type was this:\nDim wshShell\nSet wshShell = CreateObject(\"WScript.Shell\")\... |
I find myself to be a visual person and sometimes it's easier to learn something if I can draw diagram/pictures out of it. My question is which tool do I use if I want to map a programming framework (for example .net) visually and see the relationship between all entities (such as classes and members).
| If you're looking to visually map a programming framework like .NET and illustrate the relationships between entities such as classes and members, there are several tools that can help you create diagrams and visual representations. Here are some popular options:
1. **Visual Studio**:
- **Class Diagram**: Visual St... | 1,295 | [
{
"from": "human",
"value": "I find myself to be a visual person and sometimes it's easier to learn something if I can draw diagram/pictures out of it. My question is which tool do I use if I want to map a programming framework (for example .net) visually and see the relationship between all entities (such ... |
At work we are being asked to create XML files to pass data to another offline application that will then create a second XML file to pass back in order to update some of our data. During the process we have been discussing with the team of the other application about the structure of the XML file.
The sample I came u... | The debate between using XML attributes versus elements is indeed a nuanced topic, and it often depends on the context of the data, the intended use of the XML, and the preferences of the stakeholders involved. Here are some key considerations that can help guide your decision-making when structuring XML documents:
##... | 1,422 | [
{
"from": "human",
"value": "At work we are being asked to create XML files to pass data to another offline application that will then create a second XML file to pass back in order to update some of our data. During the process we have been discussing with the team of the other application about the struct... |
My current development project has two aspects to it. First, there is a public website where external users can submit and update information for various purposes. This information is then saved to a local SQL Server at the colo facility.
The second aspect is an internal application which employees use to manage those ... | You have an interesting setup, and indeed, there are several approaches you could take to synchronize the data between the two systems. Let's dive a bit deeper into the options you've mentioned, as well as some considerations for each.
### 1. Bi-Directional Replication
**Pros:**
- This can provide near real-time synch... | 290 | [
{
"from": "human",
"value": "My current development project has two aspects to it. First, there is a public website where external users can submit and update information for various purposes. This information is then saved to a local SQL Server at the colo facility.\nThe second aspect is an internal applic... |
I'm having problems using textures that are larger than the OpenGL window or the display size as non-display render targets.
What's the solution for this problem?
| When working with textures larger than the OpenGL window or display size, you might encounter issues, especially when trying to render offscreen or use such textures as non-display render targets. Here are several strategies and considerations that can help you work around this problem:
### 1. **Texture Atlases**
-... | 2,285 | [
{
"from": "human",
"value": "I'm having problems using textures that are larger than the OpenGL window or the display size as non-display render targets.\nWhat's the solution for this problem?\n"
},
{
"from": "gpt",
"value": "When working with textures larger than the OpenGL window or display si... |
Another discussion (we've been having a lot of them these days!) in our work is whether data binding is a bad idea or not.
Personally, I think it is a Bad Thing™.
My reasons are thrice:
It circumvents my well architectured MVP framework - with databinding, the view communicates bi-directionally with a model. Ewww.
It... | You raise some valid concerns about data binding, especially when it comes to maintaining a clean architecture and ensuring code readability and testability. Here are some additional thoughts and considerations that might add depth to your discussion:
### Pros and Cons of Data Binding
#### Pros:
1. **Reduced Boilerpl... | 966 | [
{
"from": "human",
"value": "Another discussion (we've been having a lot of them these days!) in our work is whether data binding is a bad idea or not.\nPersonally, I think it is a Bad Thing™.\nMy reasons are thrice:\n\nIt circumvents my well architectured MVP framework - with databinding, the view communic... |
What I have so far is
#!/bin/sh
php_syntax_check()
{
retval=0
for i in $(git-diff-index --name-only --cached HEAD -- | grep -e '\.php$'); do
if [ -f $i ]; then
output=$(php -l $i)
retval=$?
if [ $retval -gt 0 ]; then
echo "===========================... | Your script appears to be a pre-commit hook that checks the syntax of PHP files in a Git repository before they are committed. If it finds any syntax errors, it unstages the file and prints out the error messages. Here are a few improvements and enhancements you could consider implementing:
1. **Quoting Variable Expan... | 1,250 | [
{
"from": "human",
"value": "What I have so far is \n#!/bin/sh\n\nphp_syntax_check()\n{\n retval=0\n for i in $(git-diff-index --name-only --cached HEAD -- | grep -e '\\.php$'); do\n if [ -f $i ]; then\n output=$(php -l $i)\n retval=$?\n if [ $retval -gt 0 ]; th... |
What is the meaning of the Java warning?
Type safety: The cast from Object to List<Integer> is actually checking against the erased type List
I get this warning when I try to cast an Object to a type with generic information, such as in the following code:
Object object = getMyList();
List<Integer> list = (List<Integ... | The warning you are encountering in Java relates to type safety and generics. In your specific code:
```java
Object object = getMyList();
List<Integer> list = (List<Integer>) object;
```
### Explanation of the Warning
1. **Type Erasure**: Java uses a feature called type erasure for generics. When you compile generic... | 2,290 | [
{
"from": "human",
"value": "What is the meaning of the Java warning?\n\nType safety: The cast from Object to List<Integer> is actually checking against the erased type List\n\nI get this warning when I try to cast an Object to a type with generic information, such as in the following code:\nObject object =... |
We've embedded an OSGi runtime (Equinox) into out custom client-server application to facilitate plugin development and so far things are going great. We've been using Eclipse to build plugins due to the built-in manifest editor, dependency management, and export wizard. Using Eclipse to manager builds isn't very condu... | Managing OSGi dependencies and build orders for your plugins can indeed be tricky, especially when you're trying to integrate it with continuous integration systems like Hudson (now Jenkins). There are several tools and approaches that can help you streamline the build process, and a few of them might align well with y... | 812 | [
{
"from": "human",
"value": "We've embedded an OSGi runtime (Equinox) into out custom client-server application to facilitate plugin development and so far things are going great. We've been using Eclipse to build plugins due to the built-in manifest editor, dependency management, and export wizard. Using E... |
I'm debugging a production application that has a rash of empty catch blocks sigh:
try {*SOME CODE*}
catch{}
Is there a way of seeing what the exception is when the debugger hits the catch in the IDE?
| Yes, if you encounter an empty `catch` block during debugging in your IDE (like Visual Studio, IntelliJ, or others), you can enhance the visibility of exceptions by modifying your approach to debugging. Here are some strategies you can use:
### 1. **Modify the Catch Block**
If you have control over the source code, c... | 844 | [
{
"from": "human",
"value": "I'm debugging a production application that has a rash of empty catch blocks sigh:\ntry {*SOME CODE*}\ncatch{}\n\nIs there a way of seeing what the exception is when the debugger hits the catch in the IDE?\n"
},
{
"from": "gpt",
"value": "Yes, if you encounter an emp... |
Following my question regarding a .NET YAML Library... as there doesn't seem to be great support for YAML in .NET, are there and good open source really simple .NET XML libraries. I just want something where I can pass it a section name and a key and it gives me the value as well as being able to give me a list of all... | If you're looking for a simple XML library for .NET that allows you to manage sections and keys, there are several open-source options that are quite straightforward to use. Here are a few suggestions:
1. **System.Xml**: This is part of the .NET Framework and .NET Core libraries. It provides built-in functionality for... | 1,323 | [
{
"from": "human",
"value": "Following my question regarding a .NET YAML Library... as there doesn't seem to be great support for YAML in .NET, are there and good open source really simple .NET XML libraries. I just want something where I can pass it a section name and a key and it gives me the value as we... |
Has anybody managed to get the Android Emulator working behind a proxy that requires authentication?
I've tried setting the -http-proxy argument to
http://DOMAIN/USERNAME:PASSWORD@IP:PORT
but am having no success.
I've tried following the docs to no avail. I've also tried the -verbose-proxy setting but this no longer ... | Getting the Android Emulator to work behind a proxy that requires authentication can be challenging. Here's a step-by-step guide that might help you resolve the issues you're facing:
### 1. Use Environment Variables
Sometimes, setting environment variables for proxy configurations can help. You can set these variable... | 1,744 | [
{
"from": "human",
"value": "Has anybody managed to get the Android Emulator working behind a proxy that requires authentication?\nI've tried setting the -http-proxy argument to\nhttp://DOMAIN/USERNAME:PASSWORD@IP:PORT\n\nbut am having no success.\nI've tried following the docs to no avail. I've also tried ... |
I'm a firm believer of the heretic thought of tight coupling between the backend and frontend: I want existing, implied knowledge about a backend to be automatically made use of when generating user interfaces. E.g., if a VARCHAR column has a maximum with of 20 characters, there GUIs should automatically constrain the ... | Your vision for a tightly-coupled backend and frontend, where the user interface adapts dynamically to the database schema, is an interesting approach that can indeed improve developer productivity and user experience. While there might not be a single framework that fulfills all your requirements out of the box, sever... | 1,249 | [
{
"from": "human",
"value": "I'm a firm believer of the heretic thought of tight coupling between the backend and frontend: I want existing, implied knowledge about a backend to be automatically made use of when generating user interfaces. E.g., if a VARCHAR column has a maximum with of 20 characters, there... |
How do I escape the underscore character?
I am writing something like the following where clause and want to be able to find actual entries with _d at the end.
Where Username Like '%_d'
| In SQL, the underscore character (`_`) is a wildcard that matches exactly one character in a `LIKE` pattern. If you want to find entries that actually contain the underscore character, you need to escape it.
Most SQL dialects allow you to specify an escape character using the `ESCAPE` keyword. Here's how you can do it... | 3,710 | [
{
"from": "human",
"value": "How do I escape the underscore character?\nI am writing something like the following where clause and want to be able to find actual entries with _d at the end.\nWhere Username Like '%_d'\n\n"
},
{
"from": "gpt",
"value": "In SQL, the underscore character (`_`) is a ... |
Could someone recommend any good resources for creating Graphics User Interfaces, preferably in C/C++?
Currently my biggest influence is 3DBuzz.com's C++/OpenGL VTMs (Video Training Modules). While they are very good, they cover a large area of graphics programming, so only skim the surface of GUI programming.
This que... | Creating your own graphical user interface (GUI) system can be an exciting yet challenging project, especially if you’re aiming for cross-platform compatibility, including a homebrew environment like the Sony PSP. Below are some resources and guidelines that may help you in building your own GUI framework in C/C++.
##... | 863 | [
{
"from": "human",
"value": "Could someone recommend any good resources for creating Graphics User Interfaces, preferably in C/C++?\nCurrently my biggest influence is 3DBuzz.com's C++/OpenGL VTMs (Video Training Modules). While they are very good, they cover a large area of graphics programming, so only ski... |
What is the best way to convert a UTC datetime into local datetime. It isn't as simple as a getutcdate() and getdate() difference because the difference changes depending on what the date is.
CLR integration isn't an option for me either.
The solution that I had come up with for this problem a few months back was to ha... | Converting UTC datetime to local datetime can indeed be complicated due to daylight saving time (DST) changes and different time zone rules. Since you cannot use CLR integration, maintaining a daylight savings time (DST) table is a reasonable solution. However, it can be simplified or improved in a few ways:
### Optio... | 1,820 | [
{
"from": "human",
"value": "What is the best way to convert a UTC datetime into local datetime. It isn't as simple as a getutcdate() and getdate() difference because the difference changes depending on what the date is.\nCLR integration isn't an option for me either.\nThe solution that I had come up with f... |
http://en.wikipedia.org/wiki/ICalendar
I'm working to implement an export feature for events. The link above lists tons of clients that support the ICalendar standard, but the "three big ones" I can see are Apple's iCal, Microsoft's Outlook, and Google's Gmail.
I'm starting to get the feeling that each of these client ... | When implementing an export feature for events using the iCalendar standard, you want to achieve a balance that maximizes compatibility across the major calendar clients (Apple's iCal, Microsoft's Outlook, and Google's Gmail) while still meeting the needs of your users. Here are some key points to consider:
### Key iC... | 381 | [
{
"from": "human",
"value": "http://en.wikipedia.org/wiki/ICalendar\nI'm working to implement an export feature for events. The link above lists tons of clients that support the ICalendar standard, but the \"three big ones\" I can see are Apple's iCal, Microsoft's Outlook, and Google's Gmail.\nI'm starting ... |
How can I check the existence of an element in jQuery?
The current code that I have is this:
if ($(selector).length > 0) {
// Do something
}
Is there a more elegant way to approach this? Perhaps a plugin or a function?
| Your current approach using `$(selector).length > 0` is a common and effective way to check for the existence of an element in jQuery. While it is straightforward, if you're looking for a more elegant or reusable solution, you can create a custom jQuery function or a plugin to streamline this check. Here's how you can ... | 3,134 | [
{
"from": "human",
"value": "How can I check the existence of an element in jQuery?\nThe current code that I have is this:\nif ($(selector).length > 0) {\n // Do something\n}\n\nIs there a more elegant way to approach this? Perhaps a plugin or a function?\n"
},
{
"from": "gpt",
"value": "Your... |
Is there an easy way in C# to create Ordinals for a number? For example:
1 returns 1st
2 returns 2nd
3 returns 3rd
...etc
Can this be done through String.Format() or are there any functions available to do this?
| Yes, you can easily create ordinal numbers in C# by writing a method that formats the numbers appropriately. While `String.Format()` does not have built-in support for ordinals, you can achieve this by implementing your own method to append the correct ordinal suffix based on the number. Below is an example of how to d... | 2,067 | [
{
"from": "human",
"value": "Is there an easy way in C# to create Ordinals for a number? For example:\n\n1 returns 1st\n2 returns 2nd\n3 returns 3rd\n...etc\n\nCan this be done through String.Format() or are there any functions available to do this?\n"
},
{
"from": "gpt",
"value": "Yes, you can ... |
We need to move off traditional FTP for security purposes (it transmits it's passwords unencrypted). I am hearing SSH touted as the obvious alternative. However I have been driving FTP from an ASP.NET program interface to automate my web-site development, which is now quite a highly web-enabled process.
Can anyone rec... | Yes, using SSH (specifically SFTP, which is FTP over SSH) is a great alternative for secure file transfers. SFTP encrypts both the commands and the data, providing a secure channel for file transfer.
Here are some options you can consider for implementing secure file transfers in your ASP.NET application:
### 1. **Us... | 39 | [
{
"from": "human",
"value": "We need to move off traditional FTP for security purposes (it transmits it's passwords unencrypted). I am hearing SSH touted as the obvious alternative. However I have been driving FTP from an ASP.NET program interface to automate my web-site development, which is now quite a hi... |
I want to get started doing some game development using Microsoft's XNA. Part of that is Shader development, but I have no idea how to get started. I know that nVidia's FX Composer is a great tool to develop shaders, but I did not find much useful and updated content on how to actually get started.
What tutorials would... | Getting started with shader development in XNA can be both exciting and challenging. While XNA itself is not actively maintained anymore, there are still resources that can help you learn how to create shaders effectively. Here are some recommended tutorials and resources to help you get started:
### Online Tutorials
... | 1,856 | [
{
"from": "human",
"value": "I want to get started doing some game development using Microsoft's XNA. Part of that is Shader development, but I have no idea how to get started. I know that nVidia's FX Composer is a great tool to develop shaders, but I did not find much useful and updated content on how to a... |
How can I test the same regex against different regular expression engines?
| Testing the same regex against different regular expression engines can be done through various methods. Here's a structured approach to achieve that:
### 1. **Online Regex Testers:**
Many online regex testing tools support multiple regex flavors (e.g., PCRE, JavaScript, Python, etc.). Some popular options include:... | 1,578 | [
{
"from": "human",
"value": "How can I test the same regex against different regular expression engines?\n"
},
{
"from": "gpt",
"value": "Testing the same regex against different regular expression engines can be done through various methods. Here's a structured approach to achieve that:\n\n### ... |
If you want to use a queuing product for durable messaging under Windows, running .NET 2.0 and above, which alternatives to MSMQ exist today? I know of ActiveMQ (http://activemq.apache.org/), and I've seen references to WSMQ (pointing to http://wsmq.net), but the site seems to be down.
Are there any other alternatives?... | Yes, there are several alternatives to Microsoft Message Queuing (MSMQ) that you can consider for durable messaging in .NET applications. Here are some options you may want to explore:
1. **RabbitMQ**: An open-source message broker that supports multiple messaging protocols. It has a .NET client library, which makes i... | 1,913 | [
{
"from": "human",
"value": "If you want to use a queuing product for durable messaging under Windows, running .NET 2.0 and above, which alternatives to MSMQ exist today? I know of ActiveMQ (http://activemq.apache.org/), and I've seen references to WSMQ (pointing to http://wsmq.net), but the site seems to b... |
I have a MySQL table with approximately 3000 rows per user. One of the columns is a datetime field, which is mutable, so the rows aren't in chronological order.
I'd like to visualize the time distribution in a chart, so I need a number of individual datapoints. 20 datapoints would be enough.
I could do this:
select tim... | You can achieve this more efficiently with a single SQL query using a combination of the `ORDER BY`, `LIMIT`, and `OFFSET` clauses in a clever way. Here’s how to do it in one query:
You can use the `ROW_NUMBER()` window function to assign a unique number to each row based on the ordering of the `timefield`. Then you c... | 2,529 | [
{
"from": "human",
"value": "I have a MySQL table with approximately 3000 rows per user. One of the columns is a datetime field, which is mutable, so the rows aren't in chronological order.\nI'd like to visualize the time distribution in a chart, so I need a number of individual datapoints. 20 datapoints wo... |
I'm working on a internal web based tool for my company. Part of this tool is another application (The Cruise Control Dashboard) that runs in its own Virtual Directory under my root application.
I wanted to limit access to this internal application by setting up Forms Authentication on it, and having a login form in th... | It looks like you have the right idea for restricting access to the "ccnet" application using Forms Authentication, but there seems to be some confusion with the `<allow>` and `<deny>` tags in your `<authorization>` section.
In the configuration you've posted, you're allowing unauthenticated users (`<allow users="?"/>... | 3,338 | [
{
"from": "human",
"value": "I'm working on a internal web based tool for my company. Part of this tool is another application (The Cruise Control Dashboard) that runs in its own Virtual Directory under my root application.\nI wanted to limit access to this internal application by setting up Forms Authentic... |
I have developed a high speed transactional server for transfering data over the internet so I do not need to rely upon a database implementation like MySQL to provide this. That opens up the question of which SQL version to use?
I really like SQLite, but I am not convinced it is industrial strength yet
What I do like ... | When choosing a SQL database to complement your high-speed transactional server, several factors need to be considered, including performance, memory usage, reliability, and your specific use case. Here's a breakdown based on your queries:
### SQLite
- **Pros**: Lightweight, serverless, no configuration, and easy to u... | 959 | [
{
"from": "human",
"value": "I have developed a high speed transactional server for transfering data over the internet so I do not need to rely upon a database implementation like MySQL to provide this. That opens up the question of which SQL version to use?\nI really like SQLite, but I am not convinced it ... |
I'm struggling to find the right terminology here, but if you have jQuery object...
$('#MyObject')
...is it possible to extract the base element? Meaning, the equivalent of this:
document.getElementById('MyObject')
| Yes, you can extract the base DOM element from a jQuery object. When you use jQuery to select an element (like `$('#MyObject')`), it returns a jQuery object that wraps the corresponding DOM element. If you want to get the underlying DOM element itself, you can access the first element in the jQuery object using the `.g... | 3,713 | [
{
"from": "human",
"value": "I'm struggling to find the right terminology here, but if you have jQuery object...\n$('#MyObject')\n\n...is it possible to extract the base element? Meaning, the equivalent of this:\ndocument.getElementById('MyObject')\n\n"
},
{
"from": "gpt",
"value": "Yes, you can... |
Using C# .NET 3.5 and WCF, I'm trying to write out some of the WCF configuration in a client application (the name of the server the client is connecting to).
The obvious way is to use ConfigurationManager to load the configuration section and write out the data I need.
var serviceModelSection = ConfigurationManager.Ge... | When you are working with WCF and using the `ConfigurationManager` to access the WCF configuration section, it is essential to ensure that you are using the correct section name and that your application has the appropriate configuration file structure.
In your case, it seems you're having trouble retrieving the `syst... | 1,184 | [
{
"from": "human",
"value": "Using C# .NET 3.5 and WCF, I'm trying to write out some of the WCF configuration in a client application (the name of the server the client is connecting to).\nThe obvious way is to use ConfigurationManager to load the configuration section and write out the data I need.\nvar se... |
Following on from my recent question on Large, Complex Objects as a Web Service Result. I have been thinking about how I can ensure all future child classes are serializable to XML.
Now, obviously I could implement the IXmlSerializable interface and then chuck a reader/writer to it but I would like to avoid that since ... | It sounds like you're looking for a way to enforce the use of XML serialization attributes on your classes to ensure they are serializable to XML, and you want to catch this at compile time or during tests rather than at runtime.
While there isn’t a direct way to enforce attribute decoration at compile time within the... | 826 | [
{
"from": "human",
"value": "Following on from my recent question on Large, Complex Objects as a Web Service Result. I have been thinking about how I can ensure all future child classes are serializable to XML.\nNow, obviously I could implement the IXmlSerializable interface and then chuck a reader/writer t... |
We are working on a winforms app in Visual Studio 2005 and the setup project we created output both an MSI and an EXE. We aren't sure what the EXE file is used for because we are able to install without the EXE.
| In Visual Studio 2005, when you create a setup project for a WinForms application, it typically generates two output files: an MSI (Microsoft Installer) file and an EXE (Executable) file.
Here's the distinction between the two:
1. **MSI File**: This is the standard Windows Installer package. It contains all the nece... | 2,647 | [
{
"from": "human",
"value": "We are working on a winforms app in Visual Studio 2005 and the setup project we created output both an MSI and an EXE. We aren't sure what the EXE file is used for because we are able to install without the EXE.\n"
},
{
"from": "gpt",
"value": "In Visual Studio 2005... |
I have the Xming X Window Server installed on a laptop running Windows XP to connect to some UNIX development servers.
It works fine when I connect directly to the company network in the office. However, it does not work when I connect to the network remotely over a VPN.
When I start Xming when connected remotely none... | When using Xming with a VPN, you are correct that the `DISPLAY` environment variable may need to be configured properly for X11 forwarding to work. Here are some steps to ensure that Xming works properly over your VPN connection:
1. **Check the DISPLAY Variable**: When you connect to your UNIX servers over the VPN, yo... | 69 | [
{
"from": "human",
"value": "I have the Xming X Window Server installed on a laptop running Windows XP to connect to some UNIX development servers. \nIt works fine when I connect directly to the company network in the office. However, it does not work when I connect to the network remotely over a VPN.\nWhen... |
I was reading the example chapter from the book by Ayende and on the website of the Boo language I saw a reference to the Specter BDD Framework.
I am wondering if anybody is using it in their project, how that works out and if there are more examples and/or suggested readings.
Just in case you are wondering, I'm a C# d... | It sounds like you're exploring behavior-driven development (BDD) frameworks in the context of C# and .NET. While you mentioned the Specter BDD Framework and its association with Boo, many C# developers tend to gravitate towards more widely adopted tools. Let's take a look at some of the popular BDD frameworks used in ... | 1,021 | [
{
"from": "human",
"value": "I was reading the example chapter from the book by Ayende and on the website of the Boo language I saw a reference to the Specter BDD Framework.\nI am wondering if anybody is using it in their project, how that works out and if there are more examples and/or suggested readings.\... |
NSInteger/NSUInteger are Cocoa-defined replacements for the regular built-in types.
Is there any benefit to using the NS* types over the built-ins? Which do you prefer and why? Are NSInteger and int the same width on 32-bit / 64-bit platforms?
| `NSInteger` and `NSUInteger` are defined in Cocoa as type aliases for integer types that are guaranteed to be large enough to store pointer values, making them more suitable for certain applications in Cocoa and Objective-C, especially when dealing with collections and memory.
### Benefits of Using `NSInteger` and `NS... | 918 | [
{
"from": "human",
"value": "NSInteger/NSUInteger are Cocoa-defined replacements for the regular built-in types.\nIs there any benefit to using the NS* types over the built-ins? Which do you prefer and why? Are NSInteger and int the same width on 32-bit / 64-bit platforms?\n"
},
{
"from": "gpt",
... |
Typically I develop my websites on trunk, then merge changes to a testing branch where they are put on a 'beta' website, and then finally they are merged onto a live branch and put onto the live website.
With a Facebook application things are a bit tricky. As you can't view a Facebook application through a normal web b... | Developing and testing a Facebook application while maintaining a stable live version can indeed be challenging due to the unique nature of Facebook's platform. Here are some best practices you can follow to effectively organize the development and testing of your Facebook application:
### 1. **Use a Version Control S... | 436 | [
{
"from": "human",
"value": "Typically I develop my websites on trunk, then merge changes to a testing branch where they are put on a 'beta' website, and then finally they are merged onto a live branch and put onto the live website.\nWith a Facebook application things are a bit tricky. As you can't view a F... |
How do you rewrite this in Linq?
SELECT Id, Name FROM TableA WHERE TableA.Id IN (SELECT xx from TableB INNER JOIN Table C....)
So in plain english, I want to select Id and Name from TableA where TableA's Id is in a result set from a second query.
| You can achieve the equivalent of the SQL query using LINQ in C#. Below is an example of how you can rewrite your SQL query using LINQ syntax, assuming you have the entity classes set up for `TableA`, `TableB`, and `TableC`. This example assumes you are using Entity Framework or a similar ORM:
```csharp
var result = f... | 2,931 | [
{
"from": "human",
"value": "How do you rewrite this in Linq?\nSELECT Id, Name FROM TableA WHERE TableA.Id IN (SELECT xx from TableB INNER JOIN Table C....)\n\nSo in plain english, I want to select Id and Name from TableA where TableA's Id is in a result set from a second query.\n"
},
{
"from": "gpt... |
I've read the Wikipedia articles for both procedural programming and functional programming, but I'm still slightly confused. Could someone boil it down to the core?
| Absolutely! Here’s a simplified breakdown of the core concepts of procedural programming and functional programming:
### Procedural Programming:
- **Focus**: Procedures (or routines, functions) and the control flow of a program.
- **Structure**: Programs are organized around a series of procedures or functions that op... | 3,096 | [
{
"from": "human",
"value": "I've read the Wikipedia articles for both procedural programming and functional programming, but I'm still slightly confused. Could someone boil it down to the core?\n"
},
{
"from": "gpt",
"value": "Absolutely! Here’s a simplified breakdown of the core concepts of pr... |
This is related to the this question and the answer maybe the same but
I'll ask anyways.
I understand that we can start managed executables from the network from .NET
3.5 SP1 but what about assemblies loaded from inside the executable?
Does the same thing apply?
| Starting from .NET Framework 3.5 SP1, there are mechanisms in place that allow managed executables to be run directly from network locations. This change also extended to assemblies loaded from inside those executables, but there are important considerations regarding security and permissions.
### Key Points:
1. **Ex... | 2,778 | [
{
"from": "human",
"value": "This is related to the this question and the answer maybe the same but\nI'll ask anyways.\nI understand that we can start managed executables from the network from .NET\n3.5 SP1 but what about assemblies loaded from inside the executable?\nDoes the same thing apply?\n"
},
{
... |
I have a wcf application hosted in a windows service running a local windows account. Do I need to set an SPN for this account? If so, what's the protocol the SPN needs to be set under? I know how to do this for services over HTTP, but have never done it for net.tcp.
| When hosting a WCF application that uses net.tcp binding, you typically need to configure a Service Principal Name (SPN) for the Windows account under which your service is running, especially if you want to use Kerberos authentication.
### Do You Need to Set an SPN?
If your WCF service is accessing resources that re... | 0 | [
{
"from": "human",
"value": "I have a wcf application hosted in a windows service running a local windows account. Do I need to set an SPN for this account? If so, what's the protocol the SPN needs to be set under? I know how to do this for services over HTTP, but have never done it for net.tcp.\n"
},
{... |
What is a good Hash function? I saw a lot of hash function and applications in my data structures courses in college, but I mostly got that it's pretty hard to make a good hash function. As a rule of thumb to avoid collisions my professor said that:
function Hash(key)
return key mod PrimeNumber
end
(mod is the % ope... | A good hash function is crucial for creating efficient hash tables, and it significantly impacts performance by minimizing collisions and ensuring that keys are distributed uniformly across the hash table. Let's break down some principles for designing good hash functions, and discuss considerations for different types... | 647 | [
{
"from": "human",
"value": "What is a good Hash function? I saw a lot of hash function and applications in my data structures courses in college, but I mostly got that it's pretty hard to make a good hash function. As a rule of thumb to avoid collisions my professor said that:\nfunction Hash(key)\n return... |
I'm setting up replication for a server which runs a bunch of databases (one per client) and plan on adding more all the time, on my.cnf, Instead of having:
binlog-do-db = databasename 1
binlog-do-db = databasename 2
binlog-do-db = databasename 3
...
binlog-do-db = databasename n
can I rather just have
binlog-ign... | In MySQL, the configuration options for binary logging (`binlog-do-db` and `binlog-ignore-db`) control which databases get included or excluded in the binary logs, and this can affect replication behavior on your slave servers.
### Configuration Overview:
1. **`binlog-do-db`**: This option specifies which databases to... | 1,893 | [
{
"from": "human",
"value": "I'm setting up replication for a server which runs a bunch of databases (one per client) and plan on adding more all the time, on my.cnf, Instead of having:\nbinlog-do-db = databasename 1\nbinlog-do-db = databasename 2\nbinlog-do-db = databasename 3\n...\nbinlog-do-db = data... |
Moving through the maze forward is pretty easy, but I can't seem to figure out how to back up through the maze to try a new route once you hit a dead end without going back too far?
| Navigating a maze can indeed be tricky, especially when trying to find your way back after hitting a dead end. Here are some tips for backing up and trying new routes without going too far back:
1. **Keep Track of Your Path**: Use a method to keep track of the path you've taken. You can do this by marking walls (if it... | 2,545 | [
{
"from": "human",
"value": "Moving through the maze forward is pretty easy, but I can't seem to figure out how to back up through the maze to try a new route once you hit a dead end without going back too far?\n"
},
{
"from": "gpt",
"value": "Navigating a maze can indeed be tricky, especially w... |
I often use webservice this way
public void CallWebservice()
{
mywebservice web = new mywebservice();
web.call();
}
but sometimes I do this
private mywebservice web;
public Constructor()
{
web = new mywebservice();
}
public void CallWebservice()
{
web.call();
}
The second approach likes me very much... | It's not advisable to set a web service timeout to "forever" because it can lead to a number of issues, including resource exhaustion on the server, hanging requests, and degraded performance. Instead, you should focus on implementing a more robust and efficient approach to handle timeouts and connection management.
H... | 1,468 | [
{
"from": "human",
"value": "I often use webservice this way\npublic void CallWebservice()\n\n{\n\n mywebservice web = new mywebservice();\n\n web.call();\n\n}\n\nbut sometimes I do this\nprivate mywebservice web;\n\npublic Constructor()\n{\n\n web = new mywebservice();\n\n}\n\npublic void CallWebservice... |
I'm comparing it Java where you can start your application server in debug mode, then attach your IDE to the server. And you can change your code "on the fly" without restarting the server. As long as your changes don't affect any method signatures or fields you can just hit recompile for a class and the application se... | Debugging ASP.NET applications, especially within the context of SharePoint, can indeed present unique challenges compared to environments like Java where hot-swapping code is easier. Here are several strategies you can use to make debugging your ASP.NET applications less time-consuming:
### 1. **Use a Local Developme... | 970 | [
{
"from": "human",
"value": "I'm comparing it Java where you can start your application server in debug mode, then attach your IDE to the server. And you can change your code \"on the fly\" without restarting the server. As long as your changes don't affect any method signatures or fields you can just hit r... |
Sorry for this not being a "real" question, but Sometime back i remember seeing a post here about randomizing a randomizer randomly to generate truly random numbers, not just pseudo random. I dont see it if i search for it.
Does anybody know about that article?
| It sounds like you might be referring to discussions around improving the randomness of random number generators (RNGs) by combining different sources of entropy or using multiple algorithms. This concept can sometimes be described as "randomizing a randomizer" to enhance the quality of randomness.
While I can't point... | 3,294 | [
{
"from": "human",
"value": "Sorry for this not being a \"real\" question, but Sometime back i remember seeing a post here about randomizing a randomizer randomly to generate truly random numbers, not just pseudo random. I dont see it if i search for it.\nDoes anybody know about that article?\n"
},
{
... |
It seems like every time I try to create a pure CSS layout it takes me much longer than if I'd use a table or two. Getting three columns to be equal lengths with different amounts of data seems to require particular fancy hacks, especially when dealing with cross-browser issues.
My Question:
Who are these few tables go... | Your question touches on a common debate in web design about the use of tables versus CSS for layout purposes. While tables are indeed effective for displaying tabular data, there are several reasons why using them for layout is generally discouraged in modern web development:
1. **Semantic HTML**: HTML is designed to... | 2,906 | [
{
"from": "human",
"value": "It seems like every time I try to create a pure CSS layout it takes me much longer than if I'd use a table or two. Getting three columns to be equal lengths with different amounts of data seems to require particular fancy hacks, especially when dealing with cross-browser issues.... |
I did some tests a while ago and never figured out how to make this work.
The ingredients:
COM+ transactional object (developed in VB6)
.Net web application (with transaction) in IIS that...
makes a call to the COM+ component
updates a row in a SQL database
Testing:
Run the .Net application and force an exceptio... | Integrating .NET applications with COM+ components can be tricky, especially when it comes to managing transactions across the two technologies. In your case, it seems like the transaction initiated by your .NET application does not encompass the changes made by the COM+ object, which explains why the updates made by t... | 1,057 | [
{
"from": "human",
"value": "I did some tests a while ago and never figured out how to make this work. \nThe ingredients:\n\nCOM+ transactional object (developed in VB6) \n.Net web application (with transaction) in IIS that...\nmakes a call to the COM+ component\nupdates a row in a SQL database\n\nTesting... |
Has anyone worked much with Microsoft's Managed Extensibility Framework (MEF)? Kinda sounds like it's trying to be all things to all people - It's an add-in manager! It's duck typing! I'm wondering if anyone has an experience with it, positive or negative.
We're currently planning on using an generic IoC implementation... | Microsoft's Managed Extensibility Framework (MEF) is indeed designed to simplify the creation of extensible applications by enabling developers to compose parts in a flexible manner. It provides a way to discover and load components at runtime, which can be useful for creating add-ins or modular architectures. Here's a... | 2,037 | [
{
"from": "human",
"value": "Has anyone worked much with Microsoft's Managed Extensibility Framework (MEF)? Kinda sounds like it's trying to be all things to all people - It's an add-in manager! It's duck typing! I'm wondering if anyone has an experience with it, positive or negative.\nWe're currently plann... |
Is there a way to hide radio buttons inside a RadioButtonList control programmatically?
| Yes, you can hide radio buttons inside a `RadioButtonList` control programmatically in ASP.NET. While you cannot directly hide individual radio buttons within a `RadioButtonList` because they are rendered as a single HTML element by default, you can achieve this by using CSS to hide specific items.
Here’s how you can ... | 299 | [
{
"from": "human",
"value": "Is there a way to hide radio buttons inside a RadioButtonList control programmatically?\n"
},
{
"from": "gpt",
"value": "Yes, you can hide radio buttons inside a `RadioButtonList` control programmatically in ASP.NET. While you cannot directly hide individual radio bu... |
Is there a way to always have LF line endings in Visual Studio? I can never seem to find it!
| Yes, you can configure Visual Studio to use LF (Line Feed, or Unix-style) line endings instead of CRLF (Carriage Return + Line Feed, or Windows-style). Here’s how to do it:
### Method 1: Set Line Endings in Visual Studio
1. **Open your project in Visual Studio.**
2. **Go to `File > Advanced Save Options`.**
3. In the... | 1,584 | [
{
"from": "human",
"value": "Is there a way to always have LF line endings in Visual Studio? I can never seem to find it!\n"
},
{
"from": "gpt",
"value": "Yes, you can configure Visual Studio to use LF (Line Feed, or Unix-style) line endings instead of CRLF (Carriage Return + Line Feed, or Windo... |
In the past we declared properties like this:
public class MyClass
{
private int _age;
public int Age
{
get{ return _age; }
set{ _age = value; }
}
}
Now we can do:
public class MyClass
{
public int Age {get; set;}
}
My question is, how can I access the private variable that ... | In C#, when you define a property using the shorthand notation (like `public int Age { get; set; }`), the compiler automatically generates a private backing field for that property, but it does not provide direct access to this backing field outside of the property itself.
You cannot access this generated private bac... | 3,105 | [
{
"from": "human",
"value": "In the past we declared properties like this:\npublic class MyClass\n{\n private int _age;\n\n public int Age\n {\n get{ return _age; }\n set{ _age = value; }\n }\n}\n\nNow we can do:\npublic class MyClass\n{\n public int Age {get; set;} \n}\n\n... |
Can you suggest some good MVC framework for perl -- one I am aware of is catalyst
The need is to be able to expose services on the perl infrastructure which can be called by Java/.Net applications seamlessly.
| Certainly! Perl has several MVC frameworks that can help you build web applications and expose services that can be called by Java or .NET applications. Aside from Catalyst, here are some other notable Perl frameworks you might consider:
1. **Mojolicious**:
- A modern web framework for Perl that allows you to creat... | 2,026 | [
{
"from": "human",
"value": "Can you suggest some good MVC framework for perl -- one I am aware of is catalyst\nThe need is to be able to expose services on the perl infrastructure which can be called by Java/.Net applications seamlessly.\n"
},
{
"from": "gpt",
"value": "Certainly! Perl has seve... |
I have a collection of objects to which I'd like to just add a new property. How do I do that with LINQ?
| If you have a collection of objects and you want to add a new property to each object, you need to keep in mind that properties cannot be dynamically added to instances of classes in C#. However, you can create a new anonymous type or a new type that includes the additional property.
Here's how you can achieve this u... | 1,158 | [
{
"from": "human",
"value": "I have a collection of objects to which I'd like to just add a new property. How do I do that with LINQ?\n"
},
{
"from": "gpt",
"value": "If you have a collection of objects and you want to add a new property to each object, you need to keep in mind that properties c... |
While setting up CruiseControl, I added a buildpublisher block to the publisher tasks:
<buildpublisher>
<sourceDir>C:\MyBuild\</sourceDir>
<publishDir>C:\MyBuildPublished\</publishDir>
<alwaysPublish>false</alwaysPublish>
</buildpublisher>
This works, but it copies the entire file contents of the build, I only ... | In CruiseControl, the `buildpublisher` block does not natively support file filtering based on extensions. If you only want to publish specific file types like DLLs and .aspx files, you will indeed need to implement a workaround, as the `buildpublisher` will copy everything in the `sourceDir`.
There are a couple of op... | 1,975 | [
{
"from": "human",
"value": "While setting up CruiseControl, I added a buildpublisher block to the publisher tasks:\n<buildpublisher>\n <sourceDir>C:\\MyBuild\\</sourceDir>\n <publishDir>C:\\MyBuildPublished\\</publishDir>\n <alwaysPublish>false</alwaysPublish>\n</buildpublisher> \n\nThis works, but it c... |
It seems like drag and drop upload widgets disappeared from the face of Web 2.0. The last one of these I remember using was an activex widget, and inability of using it in anything other than IE doomed it. Have you used or seen one of these recently?
| Drag-and-drop file upload widgets have certainly evolved since the days of ActiveX controls and their limitations, particularly in browser compatibility. While the specific ActiveX implementations you mentioned have largely faded from use, drag-and-drop file upload functionality is now quite common and widely supported... | 4,289 | [
{
"from": "human",
"value": "It seems like drag and drop upload widgets disappeared from the face of Web 2.0. The last one of these I remember using was an activex widget, and inability of using it in anything other than IE doomed it. Have you used or seen one of these recently?\n"
},
{
"from": "gpt... |
System.Data.SqlClient.SqlException: Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.
Anybody ever get this error and/or have any idea on it's cause and/or solution?
This link may have relevant information.
Update
The connecti... | The error message you're seeing, **"Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance"**, typically indicates an issue related to the SQL Server User Instances feature. User Instances allow users to run SQL Server Express as a local database instance that is... | 1,993 | [
{
"from": "human",
"value": "System.Data.SqlClient.SqlException: Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.\nAnybody ever get this error and/or have any idea on it's cause and/or solution?\nThis link may hav... |
I have somewhat interesting development situation. The client and deployment server are inside a firewall without access to the Subversion server. But the developers are outside the firewall and are able to use the Subversion server. Right now the solution I have worked out is to update my local copy of the code and th... | It sounds like you have a unique workflow, and your solution for extracting updated files from Subversion (SVN) using TortoiseSVN is definitely effective. Just to summarize and expand on what you've already found, here are a couple of approaches to consider for getting only the recently changed files from your SVN repo... | 2,011 | [
{
"from": "human",
"value": "I have somewhat interesting development situation. The client and deployment server are inside a firewall without access to the Subversion server. But the developers are outside the firewall and are able to use the Subversion server. Right now the solution I have worked out is t... |
What steps I need to perform in order to convert asp.net 2 application from IIS7 classic to integrated mode?
| Converting an ASP.NET 2.0 application from Classic mode to Integrated mode in IIS 7 involves several steps. This transition allows the application to take advantage of the features and enhancements of Integrated mode, such as enhanced request handling and pipeline integration. Below are the key steps to achieve this co... | 744 | [
{
"from": "human",
"value": "What steps I need to perform in order to convert asp.net 2 application from IIS7 classic to integrated mode?\n"
},
{
"from": "gpt",
"value": "Converting an ASP.NET 2.0 application from Classic mode to Integrated mode in IIS 7 involves several steps. This transition a... |
What is the best way to iterate through a strongly-typed generic List in C#.NET and VB.NET?
| Iterating through a strongly-typed generic `List<T>` in both C#.NET and VB.NET can be done efficiently using different methods. Below are the commonly used methods in both languages.
### C#.NET
1. **Using `foreach` Loop**: This is the most concise and readable way to iterate through a list.
```csharp
using System;
u... | 1,427 | [
{
"from": "human",
"value": "What is the best way to iterate through a strongly-typed generic List in C#.NET and VB.NET?\n"
},
{
"from": "gpt",
"value": "Iterating through a strongly-typed generic `List<T>` in both C#.NET and VB.NET can be done efficiently using different methods. Below are the ... |
Recently I had to develop a SharePoint workflow, and I found the experience quite honestly the most painful programming task I've ever had to tackle. One big problem I had was the problems I encountered when I had to step through it in the debugger.
There's an article on how to debug a SharePoint workflow here that tel... | Debugging SharePoint workflows can indeed be quite challenging due to the complexities involved in deployment and versioning. Here are some alternative methods and tips that might help you simplify the debugging process:
### 1. Use Visual Studio with Remote Debugging
Instead of deploying directly to the GAC and attach... | 2,438 | [
{
"from": "human",
"value": "Recently I had to develop a SharePoint workflow, and I found the experience quite honestly the most painful programming task I've ever had to tackle. One big problem I had was the problems I encountered when I had to step through it in the debugger.\nThere's an article on how to... |
I have a couple of files containing a value in each line.
EDIT :
I figured out the answer to this question while in the midst of writing the post and didn't realize I had posted it by mistake in its incomplete state.
I was trying to do:
paste -d ',' file1 file2 file 3 file 4 > file5.csv
and was getting a weird output.... | It sounds like you encountered an issue related to line endings in your files while using the `paste` command. Mixing line endings (carriage return `\r` and newline `\n`) can definitely lead to unexpected behavior in commands that process text files.
To ensure consistent line endings, you can use tools like `dos2unix`... | 3,991 | [
{
"from": "human",
"value": "I have a couple of files containing a value in each line.\nEDIT :\nI figured out the answer to this question while in the midst of writing the post and didn't realize I had posted it by mistake in its incomplete state.\nI was trying to do:\npaste -d ',' file1 file2 file 3 file 4... |
I've been using some basic AOP style solutions for cross-cutting concerns like security, logging, validation, etc. My solution has revolved around Castle Windsor and DynamicProxy because I can apply everything using a Boo based DSL and keep my code clean of Attributes. I was told at the weekend to have a look at PostS... | Both Castle Windsor with DynamicProxy and PostSharp are popular tools for implementing Aspect-Oriented Programming (AOP) in .NET applications, and each has its own advantages and trade-offs. Here's a comparison based on various aspects that might help you in making a decision:
### Castle Windsor with DynamicProxy
**P... | 1,985 | [
{
"from": "human",
"value": "I've been using some basic AOP style solutions for cross-cutting concerns like security, logging, validation, etc. My solution has revolved around Castle Windsor and DynamicProxy because I can apply everything using a Boo based DSL and keep my code clean of Attributes. I was to... |
I am a broke college student. I have built a small web app in PHP5 and MySQL, and I already have a domain. What is an affordable way to get it online? A few people have suggested amazon's cloud services, but that seems equivalent to slitting my wrists and watching money slowly trickle out. So suggestions? Hosting compa... | As a broke college student with a small web app, there are definitely affordable options for getting your application online. Here are a few suggestions that could work for you:
1. **Shared Hosting Providers**: These are typically the most cost-effective options for hosting a small website or web app. Providers like *... | 1,383 | [
{
"from": "human",
"value": "I am a broke college student. I have built a small web app in PHP5 and MySQL, and I already have a domain. What is an affordable way to get it online? A few people have suggested amazon's cloud services, but that seems equivalent to slitting my wrists and watching money slowly t... |
Let's say that you want to output or concat strings. Which of the following styles do you prefer?
var p = new { FirstName = "Bill", LastName = "Gates" };
Console.WriteLine("{0} {1}", p.FirstName, p.LastName);
Console.WriteLine(p.FirstName + " " + p.LastName);
Do you rather use format or do you simply concat strings? ... | When it comes to string output and concatenation in C#, both methods have their pros and cons. Let’s break down the two options you presented:
1. **Using String Formatting**:
```csharp
Console.WriteLine("{0} {1}", p.FirstName, p.LastName);
```
**Pros**:
- **Readability**: For more complex strings, form... | 834 | [
{
"from": "human",
"value": "Let's say that you want to output or concat strings. Which of the following styles do you prefer?\n\nvar p = new { FirstName = \"Bill\", LastName = \"Gates\" };\nConsole.WriteLine(\"{0} {1}\", p.FirstName, p.LastName);\nConsole.WriteLine(p.FirstName + \" \" + p.LastName);\n\nDo ... |
I've recently come to maintain a large amount of scientific calculation-intensive FORTRAN code. I'm having difficulties getting a handle on all of the, say, nuances, of a forty year old language, despite google & two introductory level books. The code is rife with "performance enhancing improvements". Does anyone ha... | Working with older FORTRAN code, particularly FORTRAN 77 and FORTRAN 90, can be quite a challenge, especially if you're coming from a background in more modern programming languages. Here are some practical tips and insights to help you navigate the code and understand its nuances, as well as to potentially "de-optimiz... | 312 | [
{
"from": "human",
"value": "I've recently come to maintain a large amount of scientific calculation-intensive FORTRAN code. I'm having difficulties getting a handle on all of the, say, nuances, of a forty year old language, despite google & two introductory level books. The code is rife with \"performanc... |
I read this PHP RegEx page, but either I'm missing something, misreading something, or it doesn't work the way they say. I'm guessing it's one of the first two.
$str = preg_replace("([|]\d*)", "\1;", $str);
| It looks like you're trying to use `preg_replace` to replace occurrences of a pattern in a string. However, there are a few issues with the regex pattern and the replacement string in your example. Let's break it down:
### Issues with the provided code:
1. **Pattern Delimiters**: In PHP, regex patterns need delimiter... | 1,574 | [
{
"from": "human",
"value": "I read this PHP RegEx page, but either I'm missing something, misreading something, or it doesn't work the way they say. I'm guessing it's one of the first two.\n$str = preg_replace(\"([|]\\d*)\", \"\\1;\", $str);\n\n"
},
{
"from": "gpt",
"value": "It looks like you'... |
Sometimes a labeled break or continue can make code a lot more readable.
OUTERLOOP: for ( ;/*stuff*/; ) {
//...lots of code
if ( isEnough() ) break OUTERLOOP;
//...more code
}
I was wondering what the common convention for the labels was. All caps? first cap?
| In many programming languages, there is no strict convention for labeling loops, but there are some common practices that developers tend to follow for readability and consistency.
1. **All Caps**: Some developers prefer using all uppercase letters for labels to make them stand out. This is similar to constants in man... | 3,482 | [
{
"from": "human",
"value": "Sometimes a labeled break or continue can make code a lot more readable. \nOUTERLOOP: for ( ;/*stuff*/; ) {\n //...lots of code\n\n if ( isEnough() ) break OUTERLOOP;\n //...more code\n}\n\nI was wondering what the common convention for the labels was. All caps? first c... |
What methods are there for automatically getting a stack trace on Unix systems? I don't mean just getting a core file or attaching interactively with GDB, but having a SIGSEGV handler that dumps a backtrace to a text file.
Bonus points for the following optional features:
Extra information gathering at crash time (eg... | To automatically capture a stack trace on Unix systems when a program crashes (e.g., due to a SIGSEGV signal), you can implement a signal handler that captures the backtrace and logs it to a file. Below are methods and techniques for achieving this, along with optional features you may consider:
### Basic Implementati... | 351 | [
{
"from": "human",
"value": "What methods are there for automatically getting a stack trace on Unix systems? I don't mean just getting a core file or attaching interactively with GDB, but having a SIGSEGV handler that dumps a backtrace to a text file. \nBonus points for the following optional features:\n\nE... |
I have a form with 2 tree views, the user can drag and drop a node from one to another. After a node has been dragged and dropped, I change the color[highlight] of the source node in the Drag-Drop event handles.The color of the node changes fine.
But when the users hovers the mouse over the source tree view after that,... | It sounds like you're experiencing an issue with the visual state of the nodes in your tree view control after dragging and dropping, particularly with the highlighting color reverting back to its original state when hovering over the node. This type of flickering often occurs due to how the control manages visual stat... | 2,069 | [
{
"from": "human",
"value": "I have a form with 2 tree views, the user can drag and drop a node from one to another. After a node has been dragged and dropped, I change the color[highlight] of the source node in the Drag-Drop event handles.The color of the node changes fine.\nBut when the users hovers the m... |
I need to call into a Win32 API to get a series of strings, and I would like to return an array of those strings to JavaScript. This is for script that runs on local machine for administration scripts, not for the web browser.
My IDL file for the COM object has the interface that I am calling into as:
HRESULT GetArray... | When you are working with a COM object in JavaScript, particularly in a local environment (such as in Windows Script Host or similar scenarios), you need to ensure you properly handle the returned SAFEARRAY of BSTR strings. The process involves calling the COM function and then extracting the contents of the SAFEARRAY ... | 1,543 | [
{
"from": "human",
"value": "I need to call into a Win32 API to get a series of strings, and I would like to return an array of those strings to JavaScript. This is for script that runs on local machine for administration scripts, not for the web browser.\nMy IDL file for the COM object has the interface th... |
LINQ to SQL allows table mappings to automatically convert back and forth to Enums by specifying the type for the column - this works for strings or integers.
Is there a way to make the conversion case insensitive or add a custom mapping class or extenstion method into the mix so that I can specify what the string shou... | LINQ to SQL does allow for basic conversion between database columns and enums, but it doesn't support case-insensitive string conversions or custom mappings out of the box. However, you can achieve your goals by creating a custom property in your entity class that handles the conversion logic. Here are a few ways to a... | 1,641 | [
{
"from": "human",
"value": "LINQ to SQL allows table mappings to automatically convert back and forth to Enums by specifying the type for the column - this works for strings or integers.\nIs there a way to make the conversion case insensitive or add a custom mapping class or extenstion method into the mix ... |
I have several "ASP:TextBox" controls on a form (about 20).
When the form loads, the text boxes are populated from a database.
The user can change the populated values, and when they submit the form, I take the values posted to the server and conditionally save them (determined by some business logic).
All but 1 of the... | The issue you're encountering with the `ASP:TextBox` control likely stems from the fact that ASP.NET handles the state of controls differently based on their types. Since you're specifically dealing with a multi-line text box, which is rendered as an HTML `<textarea>` element, there are a few key points that could be c... | 1,839 | [
{
"from": "human",
"value": "I have several \"ASP:TextBox\" controls on a form (about 20).\nWhen the form loads, the text boxes are populated from a database.\nThe user can change the populated values, and when they submit the form, I take the values posted to the server and conditionally save them (determi... |
For example, http://developer.apple.com/cocoa/pyobjc.html is still for OS X 10.4 Tiger, not 10.5 Leopard.. And that's the official Apple documentation for it..
The official PyObjC page is equally bad, http://pyobjc.sourceforge.net/
It's so bad it's baffling.. I'm considering learning Ruby primarily because the RubyCoco... | I understand your frustration with the documentation for PyObjC. It can indeed be challenging to find comprehensive and accessible resources for learning how to create Cocoa applications using Python. Here are some suggestions for finding better tutorials and resources:
1. **Official PyObjC Documentation**: Although y... | 2,667 | [
{
"from": "human",
"value": "For example, http://developer.apple.com/cocoa/pyobjc.html is still for OS X 10.4 Tiger, not 10.5 Leopard.. And that's the official Apple documentation for it..\nThe official PyObjC page is equally bad, http://pyobjc.sourceforge.net/\nIt's so bad it's baffling.. I'm considering l... |
Most of time we represent concepts which can never be less than 0. For example to declare length, we write:
int length;
The name expresses its purpose well but you can assign negative values to it. It seems that for some situations, you can represent your intent more clearly by writing it this way instead:
uint length... | You raise an interesting point regarding the use of unsigned types (like `uint`, `ulong`, and `ushort`) to represent non-negative values, such as length. Here are some additional considerations to complement your thoughts:
### Advantages of Using Unsigned Types
1. **Intent Clarity**: As you mentioned, using unsigned ... | 1,624 | [
{
"from": "human",
"value": "Most of time we represent concepts which can never be less than 0. For example to declare length, we write:\nint length;\n\nThe name expresses its purpose well but you can assign negative values to it. It seems that for some situations, you can represent your intent more clearly... |
How do you branch and merge with Apache Subversion using the TortoiseSVN client?
| Branching and merging with Apache Subversion (SVN) using the TortoiseSVN client is a straightforward process. Below are step-by-step instructions for both creating a branch and merging changes back to the trunk (or another branch).
### Creating a Branch
1. **Right-click the Project Folder:**
- Navigate to the fold... | 714 | [
{
"from": "human",
"value": "How do you branch and merge with Apache Subversion using the TortoiseSVN client? \n"
},
{
"from": "gpt",
"value": "Branching and merging with Apache Subversion (SVN) using the TortoiseSVN client is a straightforward process. Below are step-by-step instructions for bo... |
I am reading a binary file into a parsing program. I will need to iterate through the file and look for certain markers so I can split the file up and pass those parts into their respective object’s constructors.
Is there an advantage to holding the file as a stream, either MemoryStream or FileStream, or should it be ... | When deciding whether to use a `MemoryStream` or `FileStream` versus converting a binary file into a `byte[]` array for parsing, there are several factors to consider:
### Advantages of Using Streams:
1. **Memory Efficiency**:
- Using a `FileStream` allows you to read and process the file in chunks, which can be ... | 2,256 | [
{
"from": "human",
"value": "I am reading a binary file into a parsing program. I will need to iterate through the file and look for certain markers so I can split the file up and pass those parts into their respective object’s constructors.\nIs there an advantage to holding the file as a stream, either Me... |
I know 'best' is subjective, so according to you, what is the best solution for the following problem:
Given a string of length n (say "abc"), generate all proper subsets of the string. So, for our example, the output would be {}, {a}, {b}, {c}, {ab}, {bc}, {ac}. {abc}.
What do you think?
| Generating all proper subsets of a string is a combinatorial problem, and you're correct that the term "best" can be subjective depending on the context (readability, performance, etc.). However, I'll provide a clear and efficient solution using Python, which is often favored for its readability and ease of use.
To ge... | 1,724 | [
{
"from": "human",
"value": "I know 'best' is subjective, so according to you, what is the best solution for the following problem:\nGiven a string of length n (say \"abc\"), generate all proper subsets of the string. So, for our example, the output would be {}, {a}, {b}, {c}, {ab}, {bc}, {ac}. {abc}.\nWhat... |
For those of us that like to use the graphical version of Vim or Emacs, instead of the console version, which version do you recommend?
For Vim, there's Mac OS X Vim, MacVim, Vim-Cocoa.
For Emacs, CarbonEmacs, XEmacs, and Aquamacs.
Are there more? Which of these are ready for prime-time? If it's a tough call, what are ... | When considering graphical versions of Vim and Emacs for macOS, there are a few notable options for each. Here's a rundown of the most prominent choices and their trade-offs.
### Vim Options:
1. **MacVim**:
- **Status**: Actively maintained.
- **Overview**: This is a popular version of Vim that provides a user-... | 280 | [
{
"from": "human",
"value": "For those of us that like to use the graphical version of Vim or Emacs, instead of the console version, which version do you recommend?\nFor Vim, there's Mac OS X Vim, MacVim, Vim-Cocoa.\nFor Emacs, CarbonEmacs, XEmacs, and Aquamacs.\nAre there more? Which of these are ready for... |
I know the following libraries for drawing charts in an SWT/Eclipse RCP application:
Eclipse BIRT Chart Engine (Links to an article on how to use it)
JFreeChart
Which other libraries are there for drawing pretty charts with SWT? Or charts in Java generally? After all, you can always display an image...
| In addition to Eclipse BIRT Chart Engine and JFreeChart, there are several other libraries and options available for drawing charts in SWT/Eclipse RCP applications or more generally in Java. Here are some notable ones:
1. **XChart**:
- A light-weight Java library for plotting data. It is easy to use and can produce... | 1,065 | [
{
"from": "human",
"value": "I know the following libraries for drawing charts in an SWT/Eclipse RCP application:\n\nEclipse BIRT Chart Engine (Links to an article on how to use it)\nJFreeChart\n\nWhich other libraries are there for drawing pretty charts with SWT? Or charts in Java generally? After all, you... |
I'm trying to determine if there's a way in Visual Basic 2008 (Express edition if that matters) to do inline collection initialization, a la JavaScript or Python:
Dim oMapping As Dictionary(Of Integer, String) = {{1,"First"}, {2, "Second"}}
I know Visual Basic 2008 supports array initialization like this, but I can't ... | In Visual Basic 2008, inline collection initialization as you described (similar to JavaScript or Python) is not supported directly for collections like `Dictionary`. You can't initialize a `Dictionary` with curly braces like you would with an array.
However, you can initialize a `Dictionary` using an initializer in a... | 3,780 | [
{
"from": "human",
"value": "I'm trying to determine if there's a way in Visual Basic 2008 (Express edition if that matters) to do inline collection initialization, a la JavaScript or Python:\nDim oMapping As Dictionary(Of Integer, String) = {{1,\"First\"}, {2, \"Second\"}}\n\nI know Visual Basic 2008 suppo... |
I want to show HTML content inside Flash. Is there some way to do this?
I am talking about full blown HTML (with JavaScript if possible).
| Embedding full HTML content with JavaScript inside Flash is not straightforward and is generally not recommended due to several limitations and the declining support for Flash. Flash has been largely phased out in favor of modern web technologies like HTML5, CSS3, and JavaScript.
However, if you are working in a conte... | 1,723 | [
{
"from": "human",
"value": "I want to show HTML content inside Flash. Is there some way to do this?\nI am talking about full blown HTML (with JavaScript if possible).\n"
},
{
"from": "gpt",
"value": "Embedding full HTML content with JavaScript inside Flash is not straightforward and is generall... |
How can you do a streaming read on a large XML file that contains a xs:sequence just below root element, without loading the whole file into a XDocument instance in memory?
| To perform a streaming read of a large XML file without loading the entire document into memory, you can use the `XmlReader` class in .NET. The `XmlReader` provides a forward-only, read-only cursor for reading XML data, which makes it suitable for handling large XML files efficiently.
Here's how you can do it:
1. **U... | 2,036 | [
{
"from": "human",
"value": "How can you do a streaming read on a large XML file that contains a xs:sequence just below root element, without loading the whole file into a XDocument instance in memory?\n"
},
{
"from": "gpt",
"value": "To perform a streaming read of a large XML file without loadi... |
I'm trying to locate an open source business rules engine that has a decent interface for building the rules.
OR at least one that works well on the .Net platform and has been updated sometime in the past 12 months.
Thanks,
| There are several open-source business rules engines that work well with the .NET platform and have been actively maintained. Here are a few options you might consider:
1. **NRules**:
- **Description**: NRules is a .NET-based rules engine that allows you to define business rules using LINQ expressions. It supports ... | 1,747 | [
{
"from": "human",
"value": "I'm trying to locate an open source business rules engine that has a decent interface for building the rules.\nOR at least one that works well on the .Net platform and has been updated sometime in the past 12 months. \nThanks,\n"
},
{
"from": "gpt",
"value": "There a... |
Is it possible to cache database connections when using PHP like you would in a J2EE container? If so, how?
| Yes, it is possible to cache database connections in PHP, similar to how you might do it in a J2EE container. While PHP does not have built-in connection pooling like J2EE, you can implement caching mechanisms using various techniques or libraries. Here are a few approaches to cache database connections in PHP:
### 1.... | 759 | [
{
"from": "human",
"value": "Is it possible to cache database connections when using PHP like you would in a J2EE container? If so, how?\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to cache database connections in PHP, similar to how you might do it in a J2EE container. While PHP does ... |
There are numerous libraries providing Linq capabilities to C# code interacting with a MySql database. Which one of them is the most stable and usable on Mono?
Background (mostly irrelevant): I have a simple C# (.Net 2.0) program updating values in a MySql database. It is executed nightly via a cron job and runs on a P... | When it comes to using LINQ with a MySQL database on Mono, you have a few options, but one of the most stable and usable libraries is **Entity Framework (EF)**. Although Entity Framework is primarily associated with .NET Framework, it has support for Mono, particularly in its simpler forms.
Here are some of the option... | 1,908 | [
{
"from": "human",
"value": "There are numerous libraries providing Linq capabilities to C# code interacting with a MySql database. Which one of them is the most stable and usable on Mono?\nBackground (mostly irrelevant): I have a simple C# (.Net 2.0) program updating values in a MySql database. It is execu... |
If I inherit from a base class and want to pass something from the constructor of the inherited class to the constructor of the base class, how do I do that?
For example, if I inherit from the Exception class I want to do something like this:
class MyExceptionClass : Exception
{
public MyExceptionClass(string mess... | In C#, when you inherit from a base class and want to pass parameters from the derived class constructor to the base class constructor, you can do this using the `: base(...)` syntax. This allows you to call a specific constructor of the base class.
Here's how you can modify your `MyExceptionClass` to pass the `messag... | 3,428 | [
{
"from": "human",
"value": "If I inherit from a base class and want to pass something from the constructor of the inherited class to the constructor of the base class, how do I do that?\nFor example, if I inherit from the Exception class I want to do something like this:\nclass MyExceptionClass : Exception... |
A mutex is a programming concept that is frequently used to solve multi-threading problems. My question to the community:
What is a mutex and how do you use it?
| A mutex, short for "mutual exclusion," is a synchronization primitive used in programming to prevent multiple threads from simultaneously accessing a shared resource. This is crucial in multi-threaded applications to avoid race conditions, which can occur when two or more threads attempt to read from or write to a shar... | 586 | [
{
"from": "human",
"value": "A mutex is a programming concept that is frequently used to solve multi-threading problems. My question to the community: \nWhat is a mutex and how do you use it?\n"
},
{
"from": "gpt",
"value": "A mutex, short for \"mutual exclusion,\" is a synchronization primitiv... |
Google is not being my friend - it's been a long time since my stats class in college...I need to calculate the start and end points for a trendline on a graph - is there an easy way to do this? (working in C# but whatever language works for you)
| Certainly! If you're looking to calculate the start and end points for a trendline in a graph, you'll typically want to determine these points based on your data points. The simplest way to do this is to first compute a linear regression (if you're looking for a linear trendline) and then calculate the predicted values... | 632 | [
{
"from": "human",
"value": "Google is not being my friend - it's been a long time since my stats class in college...I need to calculate the start and end points for a trendline on a graph - is there an easy way to do this? (working in C# but whatever language works for you)\n"
},
{
"from": "gpt",
... |
Possible Duplicate:
.NET - What’s the best way to implement a “catch all exceptions handler”
I have a .NET console app app that is crashing and displaying a message to the user.
All of my code is in a try{<code>} catch(Exception e){<stuff>} block, but still errors are occasionally displayed.
In a Win32 app, you can... | In .NET, you can handle unhandled exceptions globally for your console application by subscribing to the `AppDomain.CurrentDomain.UnhandledException` event, as well as using `TaskScheduler.UnobservedTaskException` for unhandled exceptions in tasks.
Here's how you can set it up:
1. **Handling Unhandled Exceptions**: ... | 2,747 | [
{
"from": "human",
"value": "\nPossible Duplicate:\n.NET - What’s the best way to implement a “catch all exceptions handler” \n\nI have a .NET console app app that is crashing and displaying a message to the user. \nAll of my code is in a try{<code>} catch(Exception e){<stuff>} block, but still errors are o... |
Creating a patch is very easy in SubVersion, With Tortoise, you right-click and select Create Patch. But for the life of me, I can't find this functionality in TFS. Is this possible?
If not, what's the standard way to submit patches in open source TFS hosted projects (a la CodePlex)?
| In TFS (Team Foundation Server), the functionality to create patches similar to how it's done in Subversion with TortoiseSVN is not directly available. However, you can achieve similar results through a few different methods.
### Standard Methods to Submit Patches in TFS:
1. **Using Workspace Changesets:**
- Make... | 2,192 | [
{
"from": "human",
"value": "Creating a patch is very easy in SubVersion, With Tortoise, you right-click and select Create Patch. But for the life of me, I can't find this functionality in TFS. Is this possible?\nIf not, what's the standard way to submit patches in open source TFS hosted projects (a la Code... |
Does anyone have any experience getting MSTest to copy hibernate.cfg.xml properly to the output directory? All my MSTests fail with a cannot find hibernate.cfg.xml error (I have it set to Copy Always), but my MBUnit tests pass.
| It sounds like you're experiencing an issue where your `hibernate.cfg.xml` file is not being copied to the output directory when running MSTest, even though you've set it to "Copy Always" in your project settings.
Here are a few steps you can follow to troubleshoot and potentially resolve this issue:
1. **Ensure Prop... | 2,079 | [
{
"from": "human",
"value": "Does anyone have any experience getting MSTest to copy hibernate.cfg.xml properly to the output directory? All my MSTests fail with a cannot find hibernate.cfg.xml error (I have it set to Copy Always), but my MBUnit tests pass.\n"
},
{
"from": "gpt",
"value": "It so... |
This is not a question with a precise answer (strictly speaking the answer would be best captured by a poll, but that functionality is not available), but I am genuinely interested in the answer, so I will ask it anyway.
Over the course of your career, how much time have you spent on greenfield development compared wit... | The balance between greenfield and brownfield development can vary significantly among professionals, depending on their industry, role, and specific projects they've worked on.
In many software development environments, particularly in large companies, brownfield projects (which involve modifying or adding to existi... | 4,420 | [
{
"from": "human",
"value": "This is not a question with a precise answer (strictly speaking the answer would be best captured by a poll, but that functionality is not available), but I am genuinely interested in the answer, so I will ask it anyway.\nOver the course of your career, how much time have you sp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.