instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Let X be the set of all sets that do not contain themselves. Is X a member of X?
| This question pertains to a famous paradox in set theory known as Russell's Paradox, which arises from considering sets that can or cannot contain themselves.
Let \( X \) be defined as the set of all sets that do not contain themselves. Now, we need to examine whether \( X \) is a member of itself, i.e., whether \( X ... | 4,113 | [
{
"from": "human",
"value": "Let X be the set of all sets that do not contain themselves. Is X a member of X?\n"
},
{
"from": "gpt",
"value": "This question pertains to a famous paradox in set theory known as Russell's Paradox, which arises from considering sets that can or cannot contain themse... |
Does Google Reader have an API and if so, how can I get the count of the number of unread posts for a specific user knowing their username and password?
| Google Reader was discontinued in July 2013, and as such, it no longer has an API or any functionality. When it was operational, Google Reader did offer an API that allowed developers to access and manipulate feeds, but since its shutdown, there are no available services or APIs related to Google Reader.
If you are lo... | 5,009 | [
{
"from": "human",
"value": "Does Google Reader have an API and if so, how can I get the count of the number of unread posts for a specific user knowing their username and password?\n"
},
{
"from": "gpt",
"value": "Google Reader was discontinued in July 2013, and as such, it no longer has an API... |
I specifically want to add the style of background-color to the <body> tag of a master page, from the code behind (C#) of a content page that uses that master page.
I have different content pages that need to make the master page has different colors depending on which content page is loaded, so that the master page ... | To change the background color of the `<body>` tag in a master page from a content page, you can access the master page from the content page and then modify the appropriate control or attribute directly. However, you should be careful about how you're applying the style. Instead of using `Master.Attributes.Add`, which... | 2,057 | [
{
"from": "human",
"value": "I specifically want to add the style of background-color to the <body> tag of a master page, from the code behind (C#) of a content page that uses that master page. \nI have different content pages that need to make the master page has different colors depending on which conten... |
I'm generating ICalendar (.ics) files.
Using the UID and SEQUENCE fields I can update existing events in Google Calendar and in Windows Calendar BUT NOT in MS Outlook 2007 - it just creates a second event
How do I get them to work for Outlook ?
Thanks
Tom
| When working with iCalendar (.ics) files, ensuring compatibility with various calendar applications, especially older versions like Outlook 2007, can be tricky. Here are some strategies to make sure that your events update correctly in Outlook:
### 1. Correctly Manage UID and SEQUENCE
- **UID**: Each calendar event s... | 2,005 | [
{
"from": "human",
"value": "I'm generating ICalendar (.ics) files.\nUsing the UID and SEQUENCE fields I can update existing events in Google Calendar and in Windows Calendar BUT NOT in MS Outlook 2007 - it just creates a second event\nHow do I get them to work for Outlook ?\nThanks\nTom\n"
},
{
"fr... |
I want to catch the NavigationService.Navigating event from my Page, to prevent the user from navigating forward. I have an event handler defined thusly:
void PreventForwardNavigation(object sender, NavigatingCancelEventArgs e)
{
if (e.NavigationMode == NavigationMode.Forward)
{
e.Cancel = true;
}
}... | When dealing with the `NavigationService.Navigating` event in a WPF application, it's essential to ensure that you subscribe to the event only once and at the right point in the lifecycle of the page where the `NavigationService` is already initialized.
### Best Practices for Handling Event Subscription
1. **Avoid M... | 931 | [
{
"from": "human",
"value": "I want to catch the NavigationService.Navigating event from my Page, to prevent the user from navigating forward. I have an event handler defined thusly:\nvoid PreventForwardNavigation(object sender, NavigatingCancelEventArgs e)\n{\n if (e.NavigationMode == NavigationMode.For... |
I'm trying to let an <input type="text"> (henceforth referred to as “textbox”) fill a parent container by settings its width to 100%. This works until I give the textbox a padding. This is then added to the content width and the input field overflows. Notice that in Firefox this only happens when rendering the content ... | To have the `<input>` element fill the parent container while accounting for padding, you can use the CSS `box-sizing` property. By setting `box-sizing` to `border-box`, the width of the input will include the padding, preventing overflow from occurring. Here's how you can adjust your CSS:
```css
#x {
background: sa... | 3,706 | [
{
"from": "human",
"value": "I'm trying to let an <input type=\"text\"> (henceforth referred to as “textbox”) fill a parent container by settings its width to 100%. This works until I give the textbox a padding. This is then added to the content width and the input field overflows. Notice that in Firefox th... |
I'm trying to install Laconica, an open-source Microblogging application on my Windows development server using XAMPP as per the instructions provided.
The website cannot find PEAR, and throws the below errors:
Warning: require_once(PEAR.php) [function.require-once]: failed to open stream: No such file or directory in... | It seems that your Laconica installation is unable to locate the PEAR library, even though it appears to be set up correctly in your XAMPP installation. Here are some steps you can take to troubleshoot and resolve the issue:
1. **Verify PEAR Installation**:
Ensure that PEAR is installed correctly and that `PEAR.php... | 1,826 | [
{
"from": "human",
"value": "I'm trying to install Laconica, an open-source Microblogging application on my Windows development server using XAMPP as per the instructions provided.\nThe website cannot find PEAR, and throws the below errors:\n\nWarning: require_once(PEAR.php) [function.require-once]: failed ... |
When I try to do any svn command and supply the --username and/or --password options, it prompts me for my password anyways, and always will attempt to use my current user instead of the one specified by --username. Neither --no-auth-cache nor --non-interactive have any effect on this. This is a problem because I'm try... | The issue you're encountering with Subversion (SVN) seems to stem from a couple of factors inherent to the version you are using (1.3.2) and its handling of authentication.
### Potential Causes of the Problem:
1. **SVN Version Limitations**: Version 1.3.2 of SVN is quite old and may have limitations or bugs related t... | 1,216 | [
{
"from": "human",
"value": "When I try to do any svn command and supply the --username and/or --password options, it prompts me for my password anyways, and always will attempt to use my current user instead of the one specified by --username. Neither --no-auth-cache nor --non-interactive have any effect o... |
Need to parse some basic XML (one root element, 3-4 subelements, 1-3 attributes each) from a ksh script (ideally stick to ksh, given the script already exists and it's just trying to read some extra configuration created in XML by another program).
I know I can use sed and do pattern matching, but it's not foolproof gi... | If you're looking to extract specific attributes from XML in a `ksh` (Korn shell) script without relying on external libraries or heavy solutions like Oracle, you can consider using `xmlstarlet`. While `xmlstarlet` is an external tool, it is lightweight and specifically designed for parsing and manipulating XML files, ... | 1,786 | [
{
"from": "human",
"value": "Need to parse some basic XML (one root element, 3-4 subelements, 1-3 attributes each) from a ksh script (ideally stick to ksh, given the script already exists and it's just trying to read some extra configuration created in XML by another program).\nI know I can use sed and do p... |
How can I figure out the size of a file, in bytes?
#include <stdio.h>
unsigned int fsize(char* file){
//what goes here?
}
| To determine the size of a file in bytes in C, you can use the `fopen` function to open the file, the `fseek` function to move to the end of the file, and `ftell` to get the current position of the file pointer (which will be the size of the file). Finally, you should close the file after you're done.
Here's how you c... | 2,093 | [
{
"from": "human",
"value": "How can I figure out the size of a file, in bytes?\n#include <stdio.h>\n\nunsigned int fsize(char* file){\n //what goes here?\n}\n\n"
},
{
"from": "gpt",
"value": "To determine the size of a file in bytes in C, you can use the `fopen` function to open the file, the ... |
I was wondering if InputManagers are still part of Leopard and if there is a good example that would show me what are the use of it?
| Yes, InputManagers are still part of macOS Leopard (Mac OS X 10.5) and can be used to modify the behavior of input methods and keyboard inputs. InputManagers are essentially plug-ins that allow developers to extend or change the behavior of existing applications, particularly in how they handle input events.
### Uses ... | 2,837 | [
{
"from": "human",
"value": "I was wondering if InputManagers are still part of Leopard and if there is a good example that would show me what are the use of it? \n"
},
{
"from": "gpt",
"value": "Yes, InputManagers are still part of macOS Leopard (Mac OS X 10.5) and can be used to modify the beh... |
In the linux file system, where should user scripts be placed?
I'm thinking specifically python scripts to be called by cron.
| In a Linux file system, there are several common locations where you can place user scripts, including Python scripts that you want to be called by `cron`. Here are some recommended locations:
1. **User's Home Directory**:
- You can create a dedicated directory within your home directory, such as `~/scripts` or `~/... | 1,217 | [
{
"from": "human",
"value": "In the linux file system, where should user scripts be placed?\nI'm thinking specifically python scripts to be called by cron.\n"
},
{
"from": "gpt",
"value": "In a Linux file system, there are several common locations where you can place user scripts, including Pyth... |
>>> import time
>>> time.strptime("01-31-2009", "%m-%d-%Y")
(2009, 1, 31, 0, 0, 0, 5, 31, -1)
>>> time.mktime((2009, 1, 31, 0, 0, 0, 5, 31, -1))
1233378000.0
>>> 60*60*24 # seconds in a day
86400
>>> 1233378000.0 / 86400
14275.208333333334
time.mktime should return the number of seconds since the epoch. Since I'm givi... | The confusion arises from how time zones are handled and the specific details of the `time.mktime` function.
The `time.mktime` function converts a time tuple in local time (not UTC) to the number of seconds since the epoch (which is defined as January 1, 1970, 00:00:00 UTC). The output of `time.mktime` represents the ... | 3,209 | [
{
"from": "human",
"value": ">>> import time\n>>> time.strptime(\"01-31-2009\", \"%m-%d-%Y\")\n(2009, 1, 31, 0, 0, 0, 5, 31, -1)\n>>> time.mktime((2009, 1, 31, 0, 0, 0, 5, 31, -1))\n1233378000.0\n>>> 60*60*24 # seconds in a day\n86400\n>>> 1233378000.0 / 86400\n14275.208333333334\n\ntime.mktime should retur... |
I've tried several things already,
std::stringstream m;
m.empty();
m.clear();
both of which don't work.
| It seems like you are trying to determine if a `std::stringstream` is empty or to clear its contents. Let's clarify a few points:
1. **Checking if a `std::stringstream` is empty:**
There is no direct method like `m.empty()` for `std::stringstream`. However, you can check if the stream has any content by examining ... | 3,280 | [
{
"from": "human",
"value": "I've tried several things already,\nstd::stringstream m;\nm.empty();\nm.clear();\n\nboth of which don't work.\n"
},
{
"from": "gpt",
"value": "It seems like you are trying to determine if a `std::stringstream` is empty or to clear its contents. Let's clarify a few po... |
If Java application requires certain JRE version then how can I check its availability on Mac OS X during installation?
| To check if a certain version of the Java Runtime Environment (JRE) is available on Mac OS X during the installation of a Java application, you can use a shell script or a simple command in the terminal. Here’s how to do this:
### Method 1: Using the Terminal
1. **Open Terminal**: You can find Terminal in `Applicatio... | 2,417 | [
{
"from": "human",
"value": "If Java application requires certain JRE version then how can I check its availability on Mac OS X during installation?\n"
},
{
"from": "gpt",
"value": "To check if a certain version of the Java Runtime Environment (JRE) is available on Mac OS X during the installati... |
I want to introduce some tracing to a C# application I am writing. Sadly, I can never really remember how it works and would like a tutorial with reference qualities to check up on every now and then. It should include:
App.config / Web.config stuff to add for registering TraceListeners
how to set it up in the calling... | Sure! Here's a comprehensive tutorial on setting up tracing in a C# application using `System.Diagnostics`. This guide will help you get started and serve as a reference for future use.
### Tutorial: Setting Up Tracing in a C# Application
#### Step 1: Configure the App.config or Web.config
To enable tracing in your ... | 487 | [
{
"from": "human",
"value": "I want to introduce some tracing to a C# application I am writing. Sadly, I can never really remember how it works and would like a tutorial with reference qualities to check up on every now and then. It should include:\n\nApp.config / Web.config stuff to add for registering Tra... |
The company I work for has an old Access 2000 application that was using a SQL Server 2000 back-end. We were tasked with moving the back-end to a SQL Server 2005 database on a new server. Unfortunately, the application was not functioning correctly while trying to do any inserts or updates. My research has found man... | You are correct that Microsoft Access 2000 with SQL Server 2005 may present compatibility issues, particularly since both products are quite old and not actively supported. While Microsoft does not provide exhaustive documentation explicitly stating that Access 2000 is unsupported with SQL Server 2005, there are a few ... | 556 | [
{
"from": "human",
"value": "The company I work for has an old Access 2000 application that was using a SQL Server 2000 back-end. We were tasked with moving the back-end to a SQL Server 2005 database on a new server. Unfortunately, the application was not functioning correctly while trying to do any inser... |
I'm currently in the process of setting up a continuous integration environment at work. We are using VisualSVN Server and CrusieControl.NET. Occasionally a build will fail and a symptom is that there are conflicts in the CruiseControl.NET working copy. I believe this is due to the way I've setup the Visual Studio solu... | Deleting the working copy as a part of your continuous integration (CI) build process is a valid strategy, especially when you're experiencing conflicts that prevent successful builds. This can help ensure that you start with a clean slate for each build, avoiding issues related to leftover artifacts or changes from pr... | 1,879 | [
{
"from": "human",
"value": "I'm currently in the process of setting up a continuous integration environment at work. We are using VisualSVN Server and CrusieControl.NET. Occasionally a build will fail and a symptom is that there are conflicts in the CruiseControl.NET working copy. I believe this is due to ... |
I am learning Python for a class now, and we just covered tuples as one of the data types. I read the Wikipedia page on it, but, I could not figure out where such a data type would be useful in practice. Can I have some examples, perhaps in Python, where an immutable set of numbers would be needed? How is this differen... | Great to hear you're learning Python! Tuples are indeed an interesting data type, and understanding when to use them can be quite beneficial.
### Key Differences between Tuples and Lists
1. **Immutability**: The most significant difference is that tuples are immutable, meaning once you create a tuple, you cannot chan... | 1,083 | [
{
"from": "human",
"value": "I am learning Python for a class now, and we just covered tuples as one of the data types. I read the Wikipedia page on it, but, I could not figure out where such a data type would be useful in practice. Can I have some examples, perhaps in Python, where an immutable set of numb... |
I know this might be a no-brainer, but please read on.
I also know it's generally not considered a good idea, maybe the worst, to let a browser run and interact with local apps, even in an intranet context.
We use Citrix for home-office, and people really like it. Now, they would like the same kind of environment at wo... | You have rightly identified several significant concerns regarding the use of ActiveX controls, especially when it comes to allowing web browsers to interact with local applications, even in an intranet context. Here are some strong arguments to support your stance against this approach:
### 1. **Security Risks**:
... | 785 | [
{
"from": "human",
"value": "I know this might be a no-brainer, but please read on.\nI also know it's generally not considered a good idea, maybe the worst, to let a browser run and interact with local apps, even in an intranet context.\nWe use Citrix for home-office, and people really like it. Now, they wo... |
My Rails-app has a sign in box with a "remember me" checkbox. Users who check that box should remain logged in even after closing their browser. I'm keeping track of whether users are logged in by storing their id in the user's session.
But sessions are implemented in Rails as session cookies, which are not persistent... | In Rails 2, handling user sessions and implementing "remember me" functionality can be accomplished in a more conventional way without relying on manipulating session expiration directly. Instead, consider using persistent cookies alongside session cookies for the "remember me" feature.
Here’s a straightforward approa... | 2,298 | [
{
"from": "human",
"value": "My Rails-app has a sign in box with a \"remember me\" checkbox. Users who check that box should remain logged in even after closing their browser. I'm keeping track of whether users are logged in by storing their id in the user's session. \nBut sessions are implemented in Rails ... |
How do you handle database exceptions in your application?
Are you trying to validate data prior passing it to DB or just relying on DB schema validation logic?
Do you try to recover from some kind of DB errors (e.g. timeouts)?
Here are some approaches:
Validate data prior passing it to DB
Left validation to DB and ha... | Handling database exceptions and validating data in an application involves multiple strategies, each with its own advantages and considerations. Here's a comprehensive breakdown based on the approaches you listed, along with best practices for dealing with database-related errors:
### Data Validation Approaches
1. *... | 437 | [
{
"from": "human",
"value": "How do you handle database exceptions in your application?\nAre you trying to validate data prior passing it to DB or just relying on DB schema validation logic?\nDo you try to recover from some kind of DB errors (e.g. timeouts)?\nHere are some approaches:\n\nValidate data prior... |
I have a costumer showing Notepad with a large set of data that looks totally misaligned if word wrap is on and I want to force it off. Is there a command switch to do this?
| Notepad does not have a command-line switch specifically for turning off word wrap when you open a file. However, you can manually disable word wrap after opening Notepad by going to the "Format" menu and unchecking "Word Wrap".
If you are looking for a way to open a file in Notepad and ensure that word wrap is off ev... | 3,163 | [
{
"from": "human",
"value": "I have a costumer showing Notepad with a large set of data that looks totally misaligned if word wrap is on and I want to force it off. Is there a command switch to do this?\n"
},
{
"from": "gpt",
"value": "Notepad does not have a command-line switch specifically for... |
Let me preface this question by saying I use TextMate on Mac OSX for my text needs and I am in love with it. Anything comparable on the Linux platform? I'll mostly use it for coding python/ruby.
Doing a google search yielded outdated answers.
Edit: Since there has been some concern about the 'merit' of this question... | If you're looking for a TextMate-like experience on Linux, there are several text editors that you might find enjoyable for coding in Python and Ruby. Here are some modern alternatives that have features similar to TextMate:
1. **Sublime Text**: This is a popular cross-platform text editor known for its speed and simp... | 2,534 | [
{
"from": "human",
"value": "Let me preface this question by saying I use TextMate on Mac OSX for my text needs and I am in love with it. Anything comparable on the Linux platform? I'll mostly use it for coding python/ruby.\nDoing a google search yielded outdated answers.\nEdit: Since there has been some... |
Since both a Table Scan and a Clustered Index Scan essentially scan all records in the table, why is a Clustered Index Scan supposedly better?
As an example - what's the performance difference between the following when there are many records?:
declare @temp table(
SomeColumn varchar(50)
)
insert into @temp
select... | The performance difference between a Table Scan and a Clustered Index Scan comes down to how the data is organized and accessed in SQL Server. Let's break this down with the context of your examples.
### Table Scan vs. Clustered Index Scan
1. **Table Scan**: This occurs when the SQL Server engine has to read through ... | 1,500 | [
{
"from": "human",
"value": "Since both a Table Scan and a Clustered Index Scan essentially scan all records in the table, why is a Clustered Index Scan supposedly better?\nAs an example - what's the performance difference between the following when there are many records?:\ndeclare @temp table(\n SomeCo... |
This happened to me in Visual Studio 2008 pre and post 2008 sp1 on more than one computer and to someone else I know, so it can't be an isolated incident.
Seemingly random, every so often I lose all syntax highlighting in my aspx page (the html) so that Visual Studio now looks like a really expensive version of notepad... | Losing syntax highlighting in Visual Studio 2008, especially for ASPX pages, can be quite frustrating. Here are several potential reasons for this issue and some suggested solutions you can try:
### Possible Causes:
1. **Corrupted User Settings**: Sometimes, the Visual Studio user settings may become corrupted, which ... | 2,706 | [
{
"from": "human",
"value": "This happened to me in Visual Studio 2008 pre and post 2008 sp1 on more than one computer and to someone else I know, so it can't be an isolated incident.\nSeemingly random, every so often I lose all syntax highlighting in my aspx page (the html) so that Visual Studio now looks ... |
I have a "Status" class in C#, used like this:
Status MyFunction()
{
if(...) // something bad
return new Status(false, "Something went wrong")
else
return new Status(true, "OK");
}
You get the idea.
All callers of MyFunction should check the returned Status:
Status myStatus = MyFunction();
if ( ! mySta... | In C#, there is no built-in way to enforce a check on returned values from a method. However, you can employ a design that encourages proper usage of your `Status` class and helps mitigate the risk of it being ignored.
While you can't create a perfect mechanism like in C++ where you can enforce checks through the dest... | 1,122 | [
{
"from": "human",
"value": "I have a \"Status\" class in C#, used like this:\nStatus MyFunction()\n{\n if(...) // something bad\n return new Status(false, \"Something went wrong\")\n else\n return new Status(true, \"OK\");\n}\n\nYou get the idea.\nAll callers of MyFunction should check the retu... |
Does anyone have any experience with a tool that generates test strings from a BNF grammar that could then be fed into a unit test?
| Yes, there are several tools and libraries that can generate test strings from a BNF (Backus-Naur Form) grammar. Here are some popular options you can consider:
1. **ANTLR (ANother Tool for Language Recognition)**: ANTLR is a powerful parser generator that can take a grammar written in its syntax and generate parsers ... | 2,058 | [
{
"from": "human",
"value": "Does anyone have any experience with a tool that generates test strings from a BNF grammar that could then be fed into a unit test?\n"
},
{
"from": "gpt",
"value": "Yes, there are several tools and libraries that can generate test strings from a BNF (Backus-Naur Form... |
has anyone else seen this error message. a quick check with google doesn't show me much.
| I can help you troubleshoot! However, I'll need to know more details about the error message you're encountering. Could you please provide the exact text of the error message and any context about when it occurs? This information will help me assist you better. | 4,415 | [
{
"from": "human",
"value": "has anyone else seen this error message. a quick check with google doesn't show me much.\n"
},
{
"from": "gpt",
"value": "I can help you troubleshoot! However, I'll need to know more details about the error message you're encountering. Could you please provide the ex... |
I have a problem using the Java search function in Eclipse on a particular project.
When using the Java search on one particular project, I get an error message saying Class file name must end with .class (see stack trace below). This does not seem to be happening on all projects, just one particular one, so perhaps th... | It sounds like you were experiencing a frustrating issue with Eclipse's Java search functionality, particularly related to a specific project. Based on the error message you provided, it seems that Eclipse was encountering a problem with the class file names during the search operation. Here are some steps to troublesh... | 1,835 | [
{
"from": "human",
"value": "I have a problem using the Java search function in Eclipse on a particular project.\nWhen using the Java search on one particular project, I get an error message saying Class file name must end with .class (see stack trace below). This does not seem to be happening on all projec... |
I'm trying to install a .NET service I wrote. As recommended by MSDN, I'm using InstallUtil. But I have missed how I can set the default service user on the command-line or even in the service itself. Now, when InstallUtil is run, it will display a dialog asking the user for the credentials for a user. I'm trying t... | When you are using `InstallUtil.exe` to install a .NET service, it does not directly allow you to specify the user account under which the service will run via command-line arguments. Instead, you typically set the service account in the service installer code.
To avoid the prompt for user credentials during installat... | 1,525 | [
{
"from": "human",
"value": "I'm trying to install a .NET service I wrote. As recommended by MSDN, I'm using InstallUtil. But I have missed how I can set the default service user on the command-line or even in the service itself. Now, when InstallUtil is run, it will display a dialog asking the user for ... |
As a novice in practicing test-driven development, I often end up in a quandary as to how to unit test persistence to a database.
I know that technically this would be an integration test (not a unit test), but I want to find out the best strategies for the following:
Testing queries.
Testing inserts. How do I know t... | Testing persistence layers effectively, especially in the context of test-driven development (TDD) can be challenging, especially with the complexities of ORMs like NHibernate. However, there are established practices that can help you structure your tests and maintain confidence in your persistence logic. Here’s a bre... | 1,236 | [
{
"from": "human",
"value": "As a novice in practicing test-driven development, I often end up in a quandary as to how to unit test persistence to a database.\nI know that technically this would be an integration test (not a unit test), but I want to find out the best strategies for the following:\n\nTestin... |
Yes, Podcasts, those nice little Audiobooks I can listen to on the way to work. With the current amount of Podcasts, it's like searching a needle in a haystack, except that the haystack happens to be the Internet and is filled with too many of these "Hot new Gadgets" stuff :(
Now, even though I am mainly a .NET develop... | You're right that the podcast landscape can be overwhelming! Since you're focused on software development, especially in the context of the software lifecycle, here are some podcasts that cover various aspects like unit testing, continuous integration, documentation, and deployment:
### General Software Engineering / ... | 445 | [
{
"from": "human",
"value": "Yes, Podcasts, those nice little Audiobooks I can listen to on the way to work. With the current amount of Podcasts, it's like searching a needle in a haystack, except that the haystack happens to be the Internet and is filled with too many of these \"Hot new Gadgets\" stuff :(\... |
I am new to C# and am doing some work in an existing application. I have a DirectX viewport that has components in it that I want to be able to position using arrow keys.
Currently I am overriding ProcessCmdKey and catching arrow input and send an OnKeyPress event. This works, but I want to be able to use modifiers(ALT... | To handle arrow key inputs along with modifier keys in a DirectX viewport or any application using Windows Forms, you'll want to ensure that you are using the proper event handling mechanism. Since `ProcessCmdKey` is mainly for command processing, you might want to handle the `KeyDown` event instead. This allows you to... | 1,437 | [
{
"from": "human",
"value": "I am new to C# and am doing some work in an existing application. I have a DirectX viewport that has components in it that I want to be able to position using arrow keys.\nCurrently I am overriding ProcessCmdKey and catching arrow input and send an OnKeyPress event. This works, ... |
I wrote an O(n!) sort for my amusement that can't be trivially optimized to run faster without replacing it entirely. [And no, I didn't just randomize the items until they were sorted].
How might I write an even worse Big-O sort, without just adding extraneous junk that could be pulled out to reduce the time complex... | Creating a sorting algorithm with a worse time complexity than O(n!) while adhering to the requirement of not just adding extraneous junk or optimizing it away can be a fun challenge. One common approach to achieve this would be to introduce unnecessary complexity through additional operations that do not affect the fi... | 671 | [
{
"from": "human",
"value": "I wrote an O(n!) sort for my amusement that can't be trivially optimized to run faster without replacing it entirely. [And no, I didn't just randomize the items until they were sorted]. \nHow might I write an even worse Big-O sort, without just adding extraneous junk that coul... |
C# doesn't require you to specify a generic type parameter if the compiler can infer it, for instance:
List<int> myInts = new List<int> {0,1,1,
2,3,5,8,13,21,34,55,89,144,233,377,
610,987,1597,2584,4181,6765};
//this statement is clunky
List<string> myStrings = myInts.
Select<int,string>( i => i.ToString()... | C# does not support type inference for class-level generic type parameters in the same way that it does for method-level generic type parameters primarily due to design decisions made for type safety, clarity, and maintainability.
### Key Reasons for This Design Choice:
1. **Explicitness in Type Parameters**:
- C#... | 2,732 | [
{
"from": "human",
"value": "C# doesn't require you to specify a generic type parameter if the compiler can infer it, for instance:\nList<int> myInts = new List<int> {0,1,1,\n 2,3,5,8,13,21,34,55,89,144,233,377,\n 610,987,1597,2584,4181,6765};\n\n//this statement is clunky\nList<string> myStrings = my... |
Stack Overflow has a subversion version number at the bottom:
svn revision: 679
I want to use such automatic versioning with my .NET Web Site/Application, Windows Forms, WPD projects/solutions.
How do I implement this?
| To implement automatic versioning using Subversion (SVN) in your .NET projects, you can follow these steps:
### Step 1: Add a Version Information File
1. **Create a Version Information File**:
Create a new file in your project (for example, `VersionInfo.cs`) where you will store your version information.
```cshar... | 1,299 | [
{
"from": "human",
"value": "Stack Overflow has a subversion version number at the bottom:\n\nsvn revision: 679\n\nI want to use such automatic versioning with my .NET Web Site/Application, Windows Forms, WPD projects/solutions.\nHow do I implement this?\n"
},
{
"from": "gpt",
"value": "To imple... |
I wish Subversion had a better way of moving tags. The only way that I know to move a tag is to remove the file from the tag and then copy it again. Revision tree browsers don't seem to handle that very well. This also requires keeping the directory structure under the trunk and tag in sync.
Use case: We have thousands... | Moving tags in Subversion (SVN) can indeed be cumbersome since tags are essentially just branches that are meant to be immutable. To address your use case of tagging versions of maps, here are a few alternative strategies you might consider:
### 1. Use a Directory Structure for Tags
Instead of managing tags directly ... | 1,763 | [
{
"from": "human",
"value": "I wish Subversion had a better way of moving tags. The only way that I know to move a tag is to remove the file from the tag and then copy it again. Revision tree browsers don't seem to handle that very well. This also requires keeping the directory structure under the trunk and... |
I need to have a summary field in each page of the report and in page 2 and forward the same summary has to appear at the top of the page. Anyone know how to do this?
Ex:
>
> Page 1
>
> Name Value
> a 1
> b 3
> Total 4
>
> Page 2
> Name Value
> Total Before 4
> c 5
> d ... | To achieve the desired layout for your report where a summary field appears on each page (specifically, the total value from the previous page), you can follow these general steps depending on the reporting tool or software you are using (e.g., Microsoft Word, Excel, or report generation libraries in programming). Belo... | 1,647 | [
{
"from": "human",
"value": "I need to have a summary field in each page of the report and in page 2 and forward the same summary has to appear at the top of the page. Anyone know how to do this?\n Ex:\n> \n> Page 1\n> \n> Name Value \n> a 1 \n> b 3 \n> Total 4\n> \n> Page 2 \n> Name V... |
I converted a Smart Form output into PDF using the function module SX_OBJECT_CONVERT_OTF_PDF.
My problem is that when the language is PL (Polish) the PDF file is 10 times bigger comparing to EN language. Why?
| The issue you are experiencing with the generated PDF file size being significantly larger for Polish (PL) compared to English (EN) when using the function module `SX_OBJECT_CONVERT_OTF_PDF` can be attributed to several factors. Here are some possibilities to consider:
1. **Font Embedding**: When generating PDFs, diff... | 2,719 | [
{
"from": "human",
"value": "I converted a Smart Form output into PDF using the function module SX_OBJECT_CONVERT_OTF_PDF.\nMy problem is that when the language is PL (Polish) the PDF file is 10 times bigger comparing to EN language. Why?\n"
},
{
"from": "gpt",
"value": "The issue you are experi... |
How can I open a cmd window in a specific location without having to navigate all the way to the directory I want?
| You can open a Command Prompt (cmd) window directly in a specific directory by using one of the following methods:
### Method 1: Using File Explorer
1. Open **File Explorer** and navigate to the directory where you want to open Command Prompt.
2. Once you are in the desired folder, click on the address bar (where the ... | 2,663 | [
{
"from": "human",
"value": "How can I open a cmd window in a specific location without having to navigate all the way to the directory I want?\n"
},
{
"from": "gpt",
"value": "You can open a Command Prompt (cmd) window directly in a specific directory by using one of the following methods:\n\n#... |
Yahoo has separate map for India ( which has more details than the regular maps.yahoo.com) at http://in.maps.yahoo.com/ . But when I use the API it goes to default map. How do I get API access to YMaps India?
| As of my last knowledge update in October 2023, Yahoo's mapping services, including Yahoo Maps, have been discontinued. This means that access to specific Yahoo Maps APIs, including those tailored for India, is no longer available.
If you're looking for mapping services for a project or application, there are several ... | 4,523 | [
{
"from": "human",
"value": "Yahoo has separate map for India ( which has more details than the regular maps.yahoo.com) at http://in.maps.yahoo.com/ . But when I use the API it goes to default map. How do I get API access to YMaps India?\n"
},
{
"from": "gpt",
"value": "As of my last knowledge u... |
What is actually the difference between these two casts?
SomeClass sc = (SomeClass)SomeObject;
SomeClass sc2 = SomeObject as SomeClass;
Normally, shouldn't they both be explicit casts to the specified type?
| The two cast expressions you've provided are both ways to convert an object to a specific type in C#, but they behave differently in terms of error handling and type safety.
### Explicit Cast:
```csharp
SomeClass sc = (SomeClass)SomeObject;
```
- This is an explicit cast.
- If `SomeObject` is not of type `SomeClass` (... | 2,260 | [
{
"from": "human",
"value": "What is actually the difference between these two casts?\nSomeClass sc = (SomeClass)SomeObject;\nSomeClass sc2 = SomeObject as SomeClass;\n\nNormally, shouldn't they both be explicit casts to the specified type?\n"
},
{
"from": "gpt",
"value": "The two cast expressio... |
Is there any list of blog engines, written in Django?
| Yes, there are several blog engines and platforms that are built using Django. Here are some popular ones:
1. **Django Blog Zinnia**: A simple and powerful blogging application for Django. It supports tags, categories, comments, and more. It's relatively easy to integrate with existing Django projects.
- GitHub: [... | 2,890 | [
{
"from": "human",
"value": "Is there any list of blog engines, written in Django?\n"
},
{
"from": "gpt",
"value": "Yes, there are several blog engines and platforms that are built using Django. Here are some popular ones:\n\n1. **Django Blog Zinnia**: A simple and powerful blogging application ... |
One may not always know the Type of an object at compile-time, but may need to create an instance of the Type.
How do you get a new object instance from a Type?
| In C#, if you have a `Type` object and you need to create a new instance of that type at runtime, you can use the `Activator.CreateInstance` method. This method allows you to create an instance of a type dynamically.
Here’s an example of how to use `Activator.CreateInstance`:
```csharp
using System;
class Program
{
... | 3,007 | [
{
"from": "human",
"value": "One may not always know the Type of an object at compile-time, but may need to create an instance of the Type. \nHow do you get a new object instance from a Type?\n"
},
{
"from": "gpt",
"value": "In C#, if you have a `Type` object and you need to create a new instan... |
Is there a .NET variable that returns the "All Users" directory?
| Yes, in .NET, you can retrieve the "All Users" directory path using the `Environment.GetFolderPath` method with the `Environment.SpecialFolder` enumeration. The special folder that corresponds to the "All Users" directory is `Environment.SpecialFolder.CommonApplicationData` or `Environment.SpecialFolder.CommonProfile`,... | 3,010 | [
{
"from": "human",
"value": "Is there a .NET variable that returns the \"All Users\" directory?\n"
},
{
"from": "gpt",
"value": "Yes, in .NET, you can retrieve the \"All Users\" directory path using the `Environment.GetFolderPath` method with the `Environment.SpecialFolder` enumeration. The spec... |
We use QuickBooks for financial management, and feed it from a variety of sources. I now need to hook it up to BizTalk, and I'd hate to reinvent the wheel. I've done searches, and as far as I can tell there's no QuickBooks adapter for BizTalk. Does anyone know of anything that'll do the job, preferably something that d... | Connecting QuickBooks to BizTalk can indeed be a challenge due to the lack of a dedicated QuickBooks adapter for BizTalk. However, there are several approaches you can consider that do not involve reinventing the wheel:
### 1. **QuickBooks Web Connector**
The QuickBooks Web Connector is a tool that allows web-based ap... | 3,139 | [
{
"from": "human",
"value": "We use QuickBooks for financial management, and feed it from a variety of sources. I now need to hook it up to BizTalk, and I'd hate to reinvent the wheel. I've done searches, and as far as I can tell there's no QuickBooks adapter for BizTalk. Does anyone know of anything that'l... |
I have a site running in a Windows shared hosting environment. In their control panel for the shared hosting account I have it set to use ASP.NET version 3.0 but it doesn't say 3.5 SP1 specifically.
How can I view the installed version running on the server where my website is hosted in an asp.net page?
| To check the installed version of ASP.NET on your server from an ASP.NET page, you can access the `Environment.Version` property or read the version from the `System.Reflection.Assembly` of the ASP.NET runtime.
Here’s a simple ASP.NET page that demonstrates how to check the ASP.NET version being used:
### Code Exampl... | 1,395 | [
{
"from": "human",
"value": "I have a site running in a Windows shared hosting environment. In their control panel for the shared hosting account I have it set to use ASP.NET version 3.0 but it doesn't say 3.5 SP1 specifically.\nHow can I view the installed version running on the server where my website is ... |
Ok, I've seen a few posts that mention a few other posts about not using SP wikis because they suck.
Since we are looking at doing our wiki in SP, I need to know why we shouldn't do it for a group of 6 automation-developers to document the steps in various automated processes and the changes that have to be made from t... | Using SharePoint (SP) as a wiki can have its advantages and disadvantages, especially when it comes to documentation for a specific group like automation developers. Here are some potential reasons why some people may advise against using SharePoint wikis:
### Disadvantages of Using SharePoint for a Wiki
1. **Limited... | 1,983 | [
{
"from": "human",
"value": "Ok, I've seen a few posts that mention a few other posts about not using SP wikis because they suck.\nSince we are looking at doing our wiki in SP, I need to know why we shouldn't do it for a group of 6 automation-developers to document the steps in various automated processes a... |
We have a number of users with Windows Mobile 6 and need to apply minor changes. eg. update a registry setting. One option is push and execute an executable file using our device management software.
I'd like this to be a little more friendly for the admins who are familiar with scripting in VBScript/JScript etc. What ... | On Windows Mobile 6, you have several options for scripting that can help your admins make minor changes like updating registry settings. Here are some methods you can consider:
1. **VBScript and JScript**:
- Windows Mobile 6 supports scripting through the Windows Script Host (WSH). You can create scripts in VBScri... | 2,222 | [
{
"from": "human",
"value": "We have a number of users with Windows Mobile 6 and need to apply minor changes. eg. update a registry setting. One option is push and execute an executable file using our device management software.\nI'd like this to be a little more friendly for the admins who are familiar wit... |
Is there anything built into the core C# libraries that can give me an immutable Dictionary?
Something along the lines of Java's:
Collections.unmodifiableMap(myMap);
And just to clarify, I am not looking to stop the keys / values themselves from being changed, just the structure of the Dictionary. I want something t... | Yes, in C#, you can create an immutable dictionary using the `ImmutableDictionary` class from the `System.Collections.Immutable` namespace, which is part of the `System.Collections.Immutable` NuGet package. This class provides an immutable version of a dictionary, where the structure (keys and values) cannot be changed... | 2,519 | [
{
"from": "human",
"value": "Is there anything built into the core C# libraries that can give me an immutable Dictionary? \nSomething along the lines of Java's:\nCollections.unmodifiableMap(myMap);\n\nAnd just to clarify, I am not looking to stop the keys / values themselves from being changed, just the str... |
Is it possible to capture Python interpreter's output from a Python script?
Is it possible to capture Windows CMD's output from a Python script?
If so, which librar(y|ies) should I look into?
| Yes, it is possible to capture the output of the Python interpreter and the Windows Command Prompt (CMD) from a Python script. Here are the methods you can use for each case:
### Capturing Python Interpreter's Output
To capture the output of print statements and other standard output (stdout) in a Python script, you ... | 2,577 | [
{
"from": "human",
"value": "\nIs it possible to capture Python interpreter's output from a Python script?\nIs it possible to capture Windows CMD's output from a Python script?\n\nIf so, which librar(y|ies) should I look into?\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to capture the o... |
If you have two versions of the same report (.rpt) and you want to establish what the exact differences are, what is the best way to go about this? I've seen some commercial tools to do this, but I'm not too interested in forking out cash for something that should be relatively straight forward. Can I hook into the Cry... | When comparing two versions of Crystal Reports (.rpt files), there are several approaches you can take to identify differences, including using available libraries or APIs. Here are some methods you can consider:
### 1. **Using Crystal Reports API:**
Crystal Reports offers APIs that can be used to programmatically int... | 1,831 | [
{
"from": "human",
"value": "If you have two versions of the same report (.rpt) and you want to establish what the exact differences are, what is the best way to go about this? I've seen some commercial tools to do this, but I'm not too interested in forking out cash for something that should be relatively ... |
While going through university and from following the development of SO, I've heard a lot about the Model-View-Controller architectural design pattern. I inadvertently used the MVC pattern even before I knew what it was, and still use it in my everyday job. From what I've seen, it's probably the most popular pattern us... | The Model-View-Controller (MVC) architectural pattern has indeed become one of the most widely used patterns in software development, especially in web applications. However, there are several alternative architectural patterns that you might consider depending on your project requirements, team structure, and specific... | 829 | [
{
"from": "human",
"value": "While going through university and from following the development of SO, I've heard a lot about the Model-View-Controller architectural design pattern. I inadvertently used the MVC pattern even before I knew what it was, and still use it in my everyday job. From what I've seen, ... |
I am deploying new versions of java servlets with JRun as the host. I am having difficulty finding good sources for information about JRun and tutorials about how to configure and manage it.
After installing JRun and opening the launcher it can't start the admin server that it creates by default...so obviously I'm runn... | Finding resources for JRun, especially since it’s somewhat outdated, can be challenging. However, here are several avenues and resources that may help you get up to speed on configuring and managing JRun:
### Official Documentation
1. **Adobe (Macromedia) Documentation**: Since JRun is a product from Macromedia (now A... | 1,736 | [
{
"from": "human",
"value": "I am deploying new versions of java servlets with JRun as the host. I am having difficulty finding good sources for information about JRun and tutorials about how to configure and manage it.\nAfter installing JRun and opening the launcher it can't start the admin server that it ... |
Does it make sense, having all of the C#-managed-bliss, to go back to Petzold's Programming Windows and try to produce code w/ pure WinAPI?
What can be learn from it? Isn't it just too outdated to be useful?
| Reading Charles Petzold's *Programming Windows* can still provide valuable insights and a deeper understanding of Windows programming, despite being written for older versions of the Windows API. Here are some reasons why it can still be relevant:
1. **Understanding the Foundations**: Learning about the WinAPI helps y... | 3,180 | [
{
"from": "human",
"value": "Does it make sense, having all of the C#-managed-bliss, to go back to Petzold's Programming Windows and try to produce code w/ pure WinAPI?\nWhat can be learn from it? Isn't it just too outdated to be useful?\n"
},
{
"from": "gpt",
"value": "Reading Charles Petzold's... |
Imagine an object you are working with has a collection of other objects associated with it, for example, the Controls collection on a WinForm. You want to check for a certain object in the collection, but the collection doesn't have a Contains() method. There are several ways of dealing with this.
Implement your ow... | Using a try-catch block to determine if an object exists in a collection, as shown in your second example, is generally considered a poor programming practice. Here are several reasons why this approach is not advisable, along with a comparison of its performance to a more traditional loop:
### 1. **Performance Concer... | 2,134 | [
{
"from": "human",
"value": "Imagine an object you are working with has a collection of other objects associated with it, for example, the Controls collection on a WinForm. You want to check for a certain object in the collection, but the collection doesn't have a Contains() method. There are several ways... |
I'm wondering how the few Delphi Programming users here are doing unit testing, if any? Is there anything that integrates with the Delphi IDE that you've found works well? If not, what tools are you using and do you have or know of example mini-projects that demonstrate how it all works?
Update:
I forgot to mention t... | Unit testing in Delphi, particularly with older versions like Borland Developer Studio 2006 and Delphi 7, can be a bit of a challenge due to the lack of built-in support. However, there are several frameworks and tools that you can use to facilitate unit testing. Here are a few options, along with some resources to hel... | 370 | [
{
"from": "human",
"value": "I'm wondering how the few Delphi Programming users here are doing unit testing, if any? Is there anything that integrates with the Delphi IDE that you've found works well? If not, what tools are you using and do you have or know of example mini-projects that demonstrate how it... |
It is supposed to be backwards compatible with HTML4 and XHTML. John Resig posted about some of the benefits.
As long as we don't use any of the new and not supported yet features, would there be any downside to start building sites with this doctype?
| Using a doctype that is backwards compatible with HTML4 and XHTML (such as HTML5) can bring several advantages, especially in terms of modern web development practices. However, there are some considerations to keep in mind:
### Advantages:
1. **Simplified Syntax**: HTML5 has a simpler doctype declaration (`<!DOCTYPE ... | 3,453 | [
{
"from": "human",
"value": "\nIt is supposed to be backwards compatible with HTML4 and XHTML. John Resig posted about some of the benefits.\nAs long as we don't use any of the new and not supported yet features, would there be any downside to start building sites with this doctype?\n"
},
{
"from": ... |
How do I write the results from a mysql query to file? I just need something quick. Output can be CSV, XML, HTML, etc.
| You can write the results of a MySQL query to a file using various methods, including command-line options and SQL commands. Here are a few quick ways to do it in different formats:
### 1. Using the MySQL Command Line
If you have access to the MySQL command line, you can use the `INTO OUTFILE` command to write the res... | 2,401 | [
{
"from": "human",
"value": "How do I write the results from a mysql query to file? I just need something quick. Output can be CSV, XML, HTML, etc.\n"
},
{
"from": "gpt",
"value": "You can write the results of a MySQL query to a file using various methods, including command-line options and SQ... |
I was reading More Joel on Software when I came across Joel Spolsky saying something about a particular type of programmer knowing the difference between an int and an Integer in Java/C# (Object-Oriented Programming Languages).
So, what is the difference?
| In Java and C#, the distinction between `int` (or `int32` in C#) and `Integer` (or `Int32` in C#) primarily revolves around the concepts of primitive types versus their corresponding wrapper classes. Here’s a breakdown of the differences:
### Java
1. **`int`**:
- It is a primitive data type.
- It represents a 3... | 2,687 | [
{
"from": "human",
"value": "I was reading More Joel on Software when I came across Joel Spolsky saying something about a particular type of programmer knowing the difference between an int and an Integer in Java/C# (Object-Oriented Programming Languages).\nSo, what is the difference?\n"
},
{
"from"... |
I'm tired of opening Dia and creating a database diagram at the beginning of every project. Is there a tool out there that will let me select specific tables and then create a database diagram for me based on a MySQL database? Preferably it would allow me to edit the diagram afterward since none of the foreign keys are... | It sounds like you are looking for a tool that can generate database diagrams automatically from a MySQL database and allow for editing afterward. Here are some options that you can consider:
1. **MySQL Workbench**:
- MySQL Workbench is an official tool from MySQL that provides a comprehensive set of tools for data... | 2,351 | [
{
"from": "human",
"value": "I'm tired of opening Dia and creating a database diagram at the beginning of every project. Is there a tool out there that will let me select specific tables and then create a database diagram for me based on a MySQL database? Preferably it would allow me to edit the diagram aft... |
Short version: What is the cleanest and most maintainable technique for consistant presentation and AJAX function across all browsers used by both web developers and web developers' end-users?
IE 6, 7, 8
Firefox 2, 3
Safari
Google Chrome
Opera
Long version: I wrote a web app aimed at other web developers. I want my a... | To achieve a consistent presentation and AJAX functionality across multiple browsers, especially given the older versions you mentioned (IE 6, 7, 8, Firefox 2, 3, Safari, Google Chrome, Opera), you should consider a few best practices and modern approaches:
### 1. **Use a CSS Framework:**
- Employ a robust CSS fram... | 1,622 | [
{
"from": "human",
"value": "Short version: What is the cleanest and most maintainable technique for consistant presentation and AJAX function across all browsers used by both web developers and web developers' end-users?\n\nIE 6, 7, 8\nFirefox 2, 3\nSafari\nGoogle Chrome\nOpera\n\nLong version: I wrote a w... |
Given the constraint of only using T-Sql in Sql Server 2005, is there a better way to remove the decimal point from a money datatype than a conversion to a varchar (here implicitly) and then a replace of the decimal point?
Here is what I have currently.
SELECT REPLACE(1.23, '.', ''), REPLACE(19.99, '.', '')
Which retu... | In SQL Server 2005, when dealing with the `money` datatype and the need to remove the decimal point, you're already using a common approach by converting it to a string and then using `REPLACE`. However, if you want to avoid string manipulation and achieve the same result directly with numeric operations, you can multi... | 3,896 | [
{
"from": "human",
"value": "Given the constraint of only using T-Sql in Sql Server 2005, is there a better way to remove the decimal point from a money datatype than a conversion to a varchar (here implicitly) and then a replace of the decimal point?\nHere is what I have currently.\nSELECT REPLACE(1.23, '.... |
I have an NHibernate session. In this session, I am performing exactly 1 operation, which is to run this code to get a list:
public IList<Customer> GetCustomerByFirstName(string customerFirstName)
{
return _session.CreateCriteria(typeof(Customer))
.Add(new NHibernate.Expression.EqExpression("FirstName", customerFir... | The issue you're experiencing seems to be related to NHibernate's session management and the automatic dirty checking feature. When you call `Flush()`, NHibernate tries to synchronize changes made in the session with the database. If there are any entities that have been modified, NHibernate will generate update statem... | 2,272 | [
{
"from": "human",
"value": "I have an NHibernate session. In this session, I am performing exactly 1 operation, which is to run this code to get a list:\npublic IList<Customer> GetCustomerByFirstName(string customerFirstName)\n{\nreturn _session.CreateCriteria(typeof(Customer))\n .Add(new NHibernate.Exp... |
What is the best source of free Vista style graphics for application development? I want 32x32 and 16x16 that I can use in a Winforms application.
| When looking for free Vista style graphics (also known as "Windows Aero" icons) for application development, there are several sources where you can find 32x32 and 16x16 icons suitable for WinForms applications. Here are some of the best options:
1. **Icons8**: Icons8 provides a large collection of free icons in vario... | 2,085 | [
{
"from": "human",
"value": "What is the best source of free Vista style graphics for application development? I want 32x32 and 16x16 that I can use in a Winforms application.\n"
},
{
"from": "gpt",
"value": "When looking for free Vista style graphics (also known as \"Windows Aero\" icons) for ... |
I need to get the default printer name. I'll be using C# but I suspect this is more of a framework question and isn't language specific.
| To get the default printer name in C#, you can use the `System.Drawing.Printing` namespace, which is part of the .NET Framework. Here’s a simple way to retrieve the name of the default printer:
```csharp
using System;
using System.Drawing.Printing;
class Program
{
static void Main()
{
// Get the defau... | 3,957 | [
{
"from": "human",
"value": "I need to get the default printer name. I'll be using C# but I suspect this is more of a framework question and isn't language specific.\n"
},
{
"from": "gpt",
"value": "To get the default printer name in C#, you can use the `System.Drawing.Printing` namespace, which... |
I'm working on a web service at the moment and there is the potential that the returned results could be quite large ( > 5mb).
It's perfectly valid for this set of data to be this large and the web service can be called either sync or async, but I'm wondering what people's thoughts are on the following:
If the connec... | When dealing with large result sets in web services, it's important to consider both the efficiency of data transmission and the user experience. Here are some thoughts on your questions:
### Resume Capabilities
1. **Partial Responses and Range Requests**:
- Depending on the protocol and the data format, you might... | 2,863 | [
{
"from": "human",
"value": "I'm working on a web service at the moment and there is the potential that the returned results could be quite large ( > 5mb). \nIt's perfectly valid for this set of data to be this large and the web service can be called either sync or async, but I'm wondering what people's tho... |
I know that MAC OS X 10.5 comes with Apache installed but I would like to install the latest Apache without touching the OS Defaults incase it causes problems in the future with other udpates. So I have used the details located at: http://diymacserver.com/installing-apache/compiling-apache-on-leopard/ But I'm unsure ho... | To compile a 64-bit version of Apache on Mac OS X 10.5 (Leopard), you’ll need to ensure that you specify the correct flags during the compilation process. Here's a general guide to help you compile Apache in 64-bit mode:
1. **Install Required Tools**: Make sure you have the Xcode development tools installed. You can u... | 1,558 | [
{
"from": "human",
"value": "I know that MAC OS X 10.5 comes with Apache installed but I would like to install the latest Apache without touching the OS Defaults incase it causes problems in the future with other udpates. So I have used the details located at: http://diymacserver.com/installing-apache/compi... |
I'm using namespaces in a project and Eclipse PDT, my IDE of choice, recognizes them as syntax errors. Not only it renders its convenient error checking unusable, but it also ruins Eclipse's PHP explorer.
5.3 features are coming to PDT 2.0 scheduled for release in December. Are there any alternatives for the present mo... | If you're experiencing issues with namespaces in Eclipse PDT (PHP Development Tools) due to its limited support for PHP 5.3, you have a few alternatives to consider for improving your development experience:
1. **Upgrade to a Newer Version of PDT:** If you haven't already, check if you can update to a newer version of... | 3,552 | [
{
"from": "human",
"value": "I'm using namespaces in a project and Eclipse PDT, my IDE of choice, recognizes them as syntax errors. Not only it renders its convenient error checking unusable, but it also ruins Eclipse's PHP explorer.\n5.3 features are coming to PDT 2.0 scheduled for release in December. Are... |
How can I figure out the state of the files in my client, I want to know if the file needs an updated, or patched, or modified etc. In CVS, I used to simply run "cvs -n -q update . > file". Later look for M,U,P,C attributes to get the current status of the file.
In perforce, "p4 sync -n" doesn't give output like "cvs -... | In Perforce, you can check the status of files in a way similar to how you would with CVS, but the commands and output formatting will be different. While `p4 sync -n` does give you information about what files would be updated, it does not show the same level of detail as the `cvs -n -q update` command.
To get the st... | 2,729 | [
{
"from": "human",
"value": "How can I figure out the state of the files in my client, I want to know if the file needs an updated, or patched, or modified etc. In CVS, I used to simply run \"cvs -n -q update . > file\". Later look for M,U,P,C attributes to get the current status of the file.\nIn perforce, ... |
I am prototyping some C# 3 collection filters and came across this.
I have a collection of products:
public class MyProduct
{
public string Name { get; set; }
public Double Price { get; set; }
public string Description { get; set; }
}
var MyProducts = new List<MyProduct>
{
new MyProduct
... | Both the query syntax (using `from` ... `where` ... `select`) and the method syntax (using extension methods like `Where`) in LINQ are ways to achieve the same goal: filtering collections. However, there are some differences between the two that can help you decide which one to use based on the situation and your prefe... | 2,363 | [
{
"from": "human",
"value": "I am prototyping some C# 3 collection filters and came across this.\nI have a collection of products:\npublic class MyProduct\n{\n public string Name { get; set; }\n public Double Price { get; set; }\n public string Description { get; set; }\n}\n\nvar MyProducts = new ... |
Why would you do an automatic HTML post rather than a simple redirect?
Is this so developers can automatically generate a login form that posts directory to the remote server when the OpenID is known?
eg.
User is not logged in and visits your login page.
You detect the user's openID from a cookie.
Form is generated th... | When implementing OpenID authentication, the choice between a simple redirect and an automatic HTML form post often depends on specific use cases, browser behavior, and the capabilities required by the authentication protocol being used.
Here are the main reasons for choosing an automatic HTML form post (especially fo... | 872 | [
{
"from": "human",
"value": "Why would you do an automatic HTML post rather than a simple redirect?\nIs this so developers can automatically generate a login form that posts directory to the remote server when the OpenID is known?\neg.\n\nUser is not logged in and visits your login page.\nYou detect the use... |
How do you turn a Visual Studio build that you'd perform in the IDE into a script that you can run from the command line?
| To turn a Visual Studio build that you would perform in the IDE into a script that can be run from the command line, you can use the `MSBuild` tool or the `devenv` command line. Here’s a detailed guide on both methods:
### Method 1: Using MSBuild
`MSBuild` is the build tool used by Visual Studio to compile projects. ... | 1,129 | [
{
"from": "human",
"value": "How do you turn a Visual Studio build that you'd perform in the IDE into a script that you can run from the command line?\n"
},
{
"from": "gpt",
"value": "To turn a Visual Studio build that you would perform in the IDE into a script that can be run from the command l... |
So for my text parsing in C# question, I got directed at YAML. I'm hitting a wall with this library I was recommended, so this is a quickie.
heading:
name: A name
taco: Yes
age: 32
heading:
name: Another name
taco: No
age: 27
And so on. Is that valid?
| The YAML snippet you provided is almost valid, but there are a couple of issues that need to be addressed for it to be well-formed YAML.
In YAML, you cannot have multiple mappings with the same key (`heading` in your case) at the same level of indentation. Instead, you should structure it as a sequence (an array) of m... | 4,277 | [
{
"from": "human",
"value": "So for my text parsing in C# question, I got directed at YAML. I'm hitting a wall with this library I was recommended, so this is a quickie.\nheading:\n name: A name\n taco: Yes\n age: 32\n\nheading:\n name: Another name\n taco: No\n age: 27\n\nAnd so on. Is that valid?\n"
},
... |
I'm trying to compile over 100 java classes from different packages from a clean
directory (no incremental compiles) using the following ant tasks:
<target name="-main-src-depend">
<depend srcdir="${src.dir}"
destdir="${bin.dir}"
cache="${cache.dir}"
closure="true"/>
</target> ... | The `StackOverflowError` during a full compile typically indicates that the Java compiler is hitting some sort of limit while processing your code. This can happen when you have a large number of classes with complex interdependencies, which might lead to recursive calls or an overly deep call stack.
Here are a few st... | 2,255 | [
{
"from": "human",
"value": "I'm trying to compile over 100 java classes from different packages from a clean\ndirectory (no incremental compiles) using the following ant tasks:\n<target name=\"-main-src-depend\">\n <depend srcdir=\"${src.dir}\" \n destdir=\"${bin.dir}\" \n cache=\"... |
When I am running the following statement:
@filtered = map {s/ //g} @outdata;
it is returning an empty list instead of the filtered list that I expected. What I am trying to do is remove every occurrence of from an array of string (which is an XML file).
Obviously, I am not understanding something. Can a... | The issue with your statement arises from the way you are using the `map` function in Perl. The `map` function is meant to transform elements of a list by applying a block of code (or an expression) to each element. However, your current code uses the substitution operator (`s///`), which modifies the strings in place ... | 3,504 | [
{
"from": "human",
"value": "When I am running the following statement:\n@filtered = map {s/ //g} @outdata;\n\nit is returning an empty list instead of the filtered list that I expected. What I am trying to do is remove every occurrence of from an array of string (which is an XML file).\nObviou... |
What are some macros that you have found useful in Visual Studio for code manipulation and automation?
| Visual Studio doesn't have a built-in macro feature in newer versions (after 2012). However, many developers still find ways to automate tasks and manipulate code using extensions, custom scripts, or by leveraging the capabilities of Visual Studio's automation model through macros in the earlier versions. If you are us... | 548 | [
{
"from": "human",
"value": "What are some macros that you have found useful in Visual Studio for code manipulation and automation? \n"
},
{
"from": "gpt",
"value": "Visual Studio doesn't have a built-in macro feature in newer versions (after 2012). However, many developers still find ways to au... |
I want to print the first 10000 prime numbers.
Can anyone give me the most efficient code for this?
Clarifications:
It does not matter if your code is inefficient for n >10000.
The size of the code does not matter.
You cannot just hard code the values in any manner.
| To generate the first 10,000 prime numbers efficiently, you can use the Sieve of Eratosthenes algorithm, which is well-known for its efficiency in finding all prime numbers up to a specified integer. Since we want the first 10,000 primes and we don’t know the upper bound for which to run the sieve, we can start with an... | 2,780 | [
{
"from": "human",
"value": "I want to print the first 10000 prime numbers.\nCan anyone give me the most efficient code for this?\nClarifications:\n\nIt does not matter if your code is inefficient for n >10000.\nThe size of the code does not matter.\nYou cannot just hard code the values in any manner.\n\n"
... |
The company I work for makes hardware that communicates to the computer though a serial port. Third party companies write software that communicates with our hardware.
There are times when I need to diagnose our hardware. However, a third party software app connects to the serial port when Windows starts up, blocking ... | When dealing with serial port communication in Windows, it's not possible to "steal" a connection from another application, as the operating system manages access to these resources to prevent data corruption and ensure stability. However, you can investigate what applications are currently using a specific serial port... | 1,707 | [
{
"from": "human",
"value": "The company I work for makes hardware that communicates to the computer though a serial port. Third party companies write software that communicates with our hardware. \nThere are times when I need to diagnose our hardware. However, a third party software app connects to the ser... |
In C# I can use the FileSystemWatcher object to watch for a specific file and raise an event when it is created, modified, etc.
The problem I have with this class is that it raises the event the moment the file becomes created, even if the process which created the file is still in the process of writing. I have found ... | In .NET 2.0, the `FileSystemWatcher` class indeed raises events based on file system changes, such as the creation and modification of files. However, as you noticed, this can lead to issues when the file is still being written to, particularly with structured formats like XML.
Unfortunately, there isn't a built-in wa... | 292 | [
{
"from": "human",
"value": "In C# I can use the FileSystemWatcher object to watch for a specific file and raise an event when it is created, modified, etc.\nThe problem I have with this class is that it raises the event the moment the file becomes created, even if the process which created the file is stil... |
When we create stored procedures in Visual Studio (with the extension .sql) the file encoding is automatically set to 'Unicode (UTF-8 with signature) - Codepage 65001'.
This causes ours DBA's problems as their scripts don't like it.
We have to manually go in and change them to 'Western European (windows) - Codepage 125... | The issue you're encountering with Visual Studio 2008 automatically using UTF-8 encoding for SQL files (with the `.sql` extension) can be frustrating, especially when your DBAs prefer a different encoding such as Windows-1252. This behavior change from Visual Studio 2005 to 2008 can be attributed to changes in how Visu... | 2,001 | [
{
"from": "human",
"value": "When we create stored procedures in Visual Studio (with the extension .sql) the file encoding is automatically set to 'Unicode (UTF-8 with signature) - Codepage 65001'.\nThis causes ours DBA's problems as their scripts don't like it.\nWe have to manually go in and change them to... |
In postgis, is the ST_GeomFromText call very expensive? I ask mostly because I have a frequently called query that attempts to find the point that is nearest another point that matches some criteria, and which is also within a certain distance of that other point, and the way I currently wrote it, it's doing the same ... | Using `ST_GeomFromText` multiple times in a query can indeed lead to unnecessary computation overhead, especially if the function is called frequently within a single query. Each call to `ST_GeomFromText` needs to process the WKT (Well-Known Text) string to create a geometry object, which can be a bit expensive. Instea... | 788 | [
{
"from": "human",
"value": "In postgis, is the ST_GeomFromText call very expensive? I ask mostly because I have a frequently called query that attempts to find the point that is nearest another point that matches some criteria, and which is also within a certain distance of that other point, and the way I... |
I am starting to build a new web application that will require user accounts. Now that I have an OpenID that I am using for this site I thought it would be cool if I could use OpenID for authentication in my application. Are there any good tutorials on how to integrate OpenID with an ASP.NET site?
| Integrating OpenID into an ASP.NET application can be a great way to handle user authentication without requiring users to create new accounts. Below, I've outlined steps and resources that can help you get started with integrating OpenID into your ASP.NET web application.
### Steps to Integrate OpenID with ASP.NET
1... | 1,419 | [
{
"from": "human",
"value": "I am starting to build a new web application that will require user accounts. Now that I have an OpenID that I am using for this site I thought it would be cool if I could use OpenID for authentication in my application. Are there any good tutorials on how to integrate OpenID w... |
Get the following error periodically in an IIS application:
Failed to load resources from resource file.
The full error message in the Application Event Log is:
Event Type: Error
Event Source: .NET Runtime
Event Category: None
Event ID: 0
Date: 8/8/2008
Time: 8:8:8 AM
User: N/A
C... | The error you are encountering, specifically "Failed to load resources from resource file," along with the context you provided, indicates that your application running on .NET Framework 1.1 is trying to access resources or configurations that are either not available or not correctly set up.
Given that you have both ... | 2,488 | [
{
"from": "human",
"value": "Get the following error periodically in an IIS application:\n\nFailed to load resources from resource file.\n\nThe full error message in the Application Event Log is:\n\nEvent Type: Error\n Event Source: .NET Runtime\n Event Category: None\n Event ID: 0\n Date: ... |
I am running into an issue I had before; can't find my reference on how to solve it.
Here is the issue. We encrypt the connection strings section in the app.config for our client application using code below:
config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
If config.Conne... | The error you are encountering indicates that the `RsaProtectedConfigurationProvider` is trying to encrypt the `connectionStrings` section, but it seems to be using the keys associated with the old user's profile. When the old salesperson left and the laptop was reassigned, the encryption keys are no longer available t... | 1,257 | [
{
"from": "human",
"value": "I am running into an issue I had before; can't find my reference on how to solve it.\nHere is the issue. We encrypt the connection strings section in the app.config for our client application using code below:\n config = ConfigurationManager.OpenExeConfiguration(Configura... |
Let's say I have a web page that currently accepts a single ID value via a url parameter:
http://example.com/mypage.aspx?ID=1234
I want to change it to accept a list of ids, like this:
http://example.com/mypage.aspx?IDs=1234,4321,6789
So it's available to my code as a string via context.Request.QueryString["IDs"]. Wha... | In .NET 2.0, you can achieve the conversion from a list of strings to a list of integers without using lambdas. You can use `String.Split` to split the string by commas and then convert each substring to an integer. Here's an example of how you can do this:
```csharp
using System;
using System.Collections.Generic;
pu... | 2,538 | [
{
"from": "human",
"value": "Let's say I have a web page that currently accepts a single ID value via a url parameter:\nhttp://example.com/mypage.aspx?ID=1234\nI want to change it to accept a list of ids, like this:\nhttp://example.com/mypage.aspx?IDs=1234,4321,6789\nSo it's available to my code as a string... |
I am writing an application that needs to bring window of an external app to the foreground, and not necessarily steal focus (there is a setting the user can toggle to steal/not steal focus).
What is the best way to go about this using the win32 API? I have tried SetForeground() but it always steals focus and does not... | To bring a window of an external application to the foreground without necessarily stealing focus, you can use a combination of the Windows API functions. The key functions you'll want to utilize are `SetWindowPos`, `ShowWindow`, and potentially `UpdateWindow`.
Here's a general approach you could take:
1. **Find the... | 2,567 | [
{
"from": "human",
"value": "I am writing an application that needs to bring window of an external app to the foreground, and not necessarily steal focus (there is a setting the user can toggle to steal/not steal focus).\nWhat is the best way to go about this using the win32 API? I have tried SetForeground... |
Is there a maximum number of inodes in a single directory?
I have a directory of over 2 million files and can't get the ls command to work against that directory. So now I'm wondering if I've exceeded a limit on inodes in Linux. Is there a limit before a 2^64 numerical limit?
| In Linux, the number of inodes (and thus the number of files) in a single directory can be subject to several limitations, which depend on the filesystem in use. Here's a breakdown:
1. **Filesystem-Specific Limits**:
- Each filesystem has its own limitations on the number of entries a directory can have. For exampl... | 1,808 | [
{
"from": "human",
"value": "Is there a maximum number of inodes in a single directory? \nI have a directory of over 2 million files and can't get the ls command to work against that directory. So now I'm wondering if I've exceeded a limit on inodes in Linux. Is there a limit before a 2^64 numerical limit?\... |
What is the best way to create redundant subversion repositories?
I have a subversion repository (linked through apache2 and WebDAV) and would like to create a mirror repository on a different server in the event of outages, but I am not certain of the best way to proceed.
I am thinking that post-commit scripts could b... | Creating redundant Subversion repositories can be achieved in several ways, and using post-commit hooks to propagate changes is indeed a common and effective approach. Here are several methods to consider for setting up redundancy for your Subversion repositories:
### Method 1: Post-Commit Hook
1. **Post-Commit Scrip... | 2,110 | [
{
"from": "human",
"value": "What is the best way to create redundant subversion repositories?\nI have a subversion repository (linked through apache2 and WebDAV) and would like to create a mirror repository on a different server in the event of outages, but I am not certain of the best way to proceed.\nI a... |
I'm using Windows Vista x64 with SP1, and I'm developing an ASP.NET app with IIS7 as the web server. I've got a problem where my cookies aren't "sticking" to the session, so I had a Google and found that there was a known issue with duplicate response headers overwriting instead of being added to the session. This prob... | The issue you're encountering with cookies not "sticking" to the session in your ASP.NET application could have several potential causes. Here are a few troubleshooting steps and considerations that might help you resolve the issue:
### Troubleshooting Cookie Issues:
1. **Check Cookie Path and Domain**:
- Ensure t... | 1,406 | [
{
"from": "human",
"value": "I'm using Windows Vista x64 with SP1, and I'm developing an ASP.NET app with IIS7 as the web server. I've got a problem where my cookies aren't \"sticking\" to the session, so I had a Google and found that there was a known issue with duplicate response headers overwriting inste... |
When writing production-quality VC++ code, is the use of recursion acceptable? Why or why not?
| Using recursion in production-quality Visual C++ (VC++) code is acceptable, but it comes with several considerations that should be carefully evaluated. Here are some reasons for and against the use of recursion:
### Reasons Why Recursion Can Be Acceptable:
1. **Simplicity and Clarity**: Recursive solutions can be mo... | 1,714 | [
{
"from": "human",
"value": "When writing production-quality VC++ code, is the use of recursion acceptable? Why or why not?\n"
},
{
"from": "gpt",
"value": "Using recursion in production-quality Visual C++ (VC++) code is acceptable, but it comes with several considerations that should be careful... |
I don't like the AutoSize property of the Label control. I have a custom Label that draws a fancy rounded border among other things. I'm placing a AutoSize = false in my constructor, however, when I place it in design mode, the property always is True.
I have overridden other properties with success but this one is ha... | In Windows Forms, the `AutoSize` property of the `Label` control is indeed set to `true` by default, and the designer does not allow you to set it to `false` programmatically in the constructor of a derived control like `RoundedLabel`. This is a quirk of the designer behavior for certain controls and is generally expec... | 3,941 | [
{
"from": "human",
"value": "I don't like the AutoSize property of the Label control. I have a custom Label that draws a fancy rounded border among other things. I'm placing a AutoSize = false in my constructor, however, when I place it in design mode, the property always is True. \nI have overridden other ... |
I'd like to get the Tree icon to use for a homegrown app. Does anyone know how to extract the images out as .icon files? I'd like both the 16x16 and 32x32, or I'd just do a screen capture.
| Extracting icons from an application or operating system can vary depending on the source and the platform you're using. However, I can provide some general methods you can use to extract the Tree icon as .icon files:
### For Windows:
1. **Using Resource Hacker:**
- Download and install Resource Hacker.
- Open ... | 2,170 | [
{
"from": "human",
"value": "I'd like to get the Tree icon to use for a homegrown app. Does anyone know how to extract the images out as .icon files? I'd like both the 16x16 and 32x32, or I'd just do a screen capture.\n"
},
{
"from": "gpt",
"value": "Extracting icons from an application or oper... |
You'll notice that Preview 5 includes the following in their release notes:
Added support for custom model binders. Custom binders allow you to define complex types as parameters to an action method. To use this feature, mark the complex type or the parameter declaration with [ModelBinder(…)].
So how do you go about ... | To use custom model binders in an ASP.NET MVC application, you will first need to define a custom model binder class and then associate it with your complex type or the action method parameter using the `[ModelBinder]` attribute. Here's a step-by-step guide on how to set this up for your `Contact` model in the `Insert`... | 1,461 | [
{
"from": "human",
"value": "You'll notice that Preview 5 includes the following in their release notes:\n\nAdded support for custom model binders. Custom binders allow you to define complex types as parameters to an action method. To use this feature, mark the complex type or the parameter declaration with... |
What is the difference between the EXISTS and IN clause in SQL?
When should we use EXISTS, and when should we use IN?
| The `EXISTS` and `IN` clauses are both used in SQL to filter records based on a subquery, but they have some key differences in terms of functionality, performance, and typical use cases. Here's a breakdown of their differences:
### EXISTS Clause
1. **Definition**: The `EXISTS` clause is used to check if a subquery r... | 2,576 | [
{
"from": "human",
"value": "What is the difference between the EXISTS and IN clause in SQL?\nWhen should we use EXISTS, and when should we use IN?\n"
},
{
"from": "gpt",
"value": "The `EXISTS` and `IN` clauses are both used in SQL to filter records based on a subquery, but they have some key di... |
In Flex, I have an xml document such as the following:
var xml:XML = <root><node>value1</node><node>value2</node><node>value3</node></root>
At runtime, I want to create a TextInput control for each node under root, and have the values bound to the values in the XML. As far as I can tell I can't use BindingUtils to bin... | In ActionScript (the language used in Flex), the closure mechanism does not create a new scope for variables within the function. This means that by the time the event handler is executed, the variable `node` will have the value of the last iteration of the loop, which is why you're seeing the behavior where all event ... | 2,397 | [
{
"from": "human",
"value": "In Flex, I have an xml document such as the following:\nvar xml:XML = <root><node>value1</node><node>value2</node><node>value3</node></root>\n\nAt runtime, I want to create a TextInput control for each node under root, and have the values bound to the values in the XML. As far a... |
In the PHP manual, to show the syntax for functions with optional parameters, they use brackets around each set of dependent optional parameter. For example, for the date() function, the manual reads:
string date ( string $format [, int $timestamp = time() ] )
Where $timestamp is an optional parameter, and when left b... | In PHP, you can create optional parameters in a function by providing a default value for those parameters in the function declaration. This way, when the function is called without specifying the optional parameter, PHP will use the provided default value.
Here's how you can define a custom function with optional par... | 2,288 | [
{
"from": "human",
"value": "In the PHP manual, to show the syntax for functions with optional parameters, they use brackets around each set of dependent optional parameter. For example, for the date() function, the manual reads:\nstring date ( string $format [, int $timestamp = time() ] )\n\nWhere $timesta... |
I'm looking for a clear, concise and accurate answer.
Ideally as the actual answer, although links to good explanations welcome.
| Of course! Please let me know the question you have in mind, and I will provide a clear and concise answer. | 5,735 | [
{
"from": "human",
"value": "I'm looking for a clear, concise and accurate answer. \nIdeally as the actual answer, although links to good explanations welcome.\n"
},
{
"from": "gpt",
"value": "Of course! Please let me know the question you have in mind, and I will provide a clear and concise an... |
I have some code that gives a user id to a utility that then send email to that user.
emailUtil.sendEmail(userId, "foo");
public void sendEmail(String userId, String message) throws MailException {
/* ... logic that could throw a MailException */
}
MailException could be thrown for a number of reasons, problems w... | When designing exception handling for cases like email sending failures, there are several approaches you can take. The choice largely depends on the specific requirements of your application, such as how granular you need your error handling to be and how much complexity you're willing to manage in your codebase. Here... | 1,347 | [
{
"from": "human",
"value": "I have some code that gives a user id to a utility that then send email to that user.\nemailUtil.sendEmail(userId, \"foo\");\n\npublic void sendEmail(String userId, String message) throws MailException {\n /* ... logic that could throw a MailException */\n}\n\nMailException c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.