instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
What is the easiest way of finding out what version of the iPhone SDK is installed on my OS X?
When you log into the Apple's iPhone Developer Center, you can see the build number of the current available version of the SDK, but you have to remember if you have already downloaded that version or not.
What is the easies... | To find out what version of the iPhone SDK (now known as the iOS SDK) is installed on your macOS, you can use the following methods:
### 1. Using Xcode
If you have Xcode installed, it typically includes the SDK:
- Open Xcode.
- Go to the menu bar and select **Xcode > About Xcode**. This will display the version of Xc... | 24,562 | [
{
"from": "human",
"value": "What is the easiest way of finding out what version of the iPhone SDK is installed on my OS X?\nWhen you log into the Apple's iPhone Developer Center, you can see the build number of the current available version of the SDK, but you have to remember if you have already downloade... |
I have an web application using asp.net 2.0 and vb.net I wrote a bat file to use GPG to encryt a file and call it whithin asp.net shell(pathname & filename).
when I double click on the bat file from cmd windows it works fine but when I call it in the application everything command that I pass is executed perfectly exce... | When dealing with issues where a batch file runs perfectly from the command line but fails silently when invoked from an ASP.NET application, there are several factors to consider. Here are steps and considerations to troubleshoot the issue:
### 1. **Permissions and User Context**
- **Application Pool Identity**: Ensu... | 19,438 | [
{
"from": "human",
"value": "I have an web application using asp.net 2.0 and vb.net I wrote a bat file to use GPG to encryt a file and call it whithin asp.net shell(pathname & filename).\nwhen I double click on the bat file from cmd windows it works fine but when I call it in the application everything comm... |
I have done this:
$ z() { echo 'hello world'; }
How do I get rid of it?
| To remove or unset a shell function like `z()`, you can use the `unset` command followed by the `-f` option. Here’s how you can do it:
```bash
unset -f z
```
This command will remove the function `z` from your shell environment, effectively getting rid of it.
If you want to check that it has been removed, you can t... | 26,879 | [
{
"from": "human",
"value": "I have done this:\n$ z() { echo 'hello world'; }\n\nHow do I get rid of it?\n"
},
{
"from": "gpt",
"value": "To remove or unset a shell function like `z()`, you can use the `unset` command followed by the `-f` option. Here’s how you can do it:\n\n```bash\nunset -f z\... |
I'm trying to do some async stuff in a webservice method. Let say I have the following API call: http://www.example.com/api.asmx
and the method is called GetProducts().
I this GetProducts methods, I do some stuff (eg. get data from database) then just before i return the result, I want to do some async stuff (eg. send ... | The behavior you're observing is related to the lifecycle of the threads in ASP.NET. When you run an asynchronous operation in a web service (or any ASP.NET request), the request may complete before your asynchronous operation has finished. This is because ASP.NET is designed to respond to requests quickly, and the wor... | 22,633 | [
{
"from": "human",
"value": "I'm trying to do some async stuff in a webservice method. Let say I have the following API call: http://www.example.com/api.asmx\nand the method is called GetProducts().\nI this GetProducts methods, I do some stuff (eg. get data from database) then just before i return the resul... |
I am learning WPF and was wondering if there is a way to show a WPF Window from an existing C# WinForm without 'hosting' WinForm in WPF?
I tried using myWPFWindow.show() on button click event for displaying the Window. The window is getting displayed but the textboxes displayed in the window are preventing me from t... | Yes, you can show a WPF window from a WinForms application without hosting WinForms in WPF. However, you might be encountering issues with window focus or input handling, which can happen when both WinForms and WPF are involved.
To properly show a WPF window from a WinForms application, you need to ensure that the WPF... | 19,385 | [
{
"from": "human",
"value": "I am learning WPF and was wondering if there is a way to show a WPF Window from an existing C# WinForm without 'hosting' WinForm in WPF? \nI tried using myWPFWindow.show() on button click event for displaying the Window. The window is getting displayed but the textboxes displa... |
I need to create a unique ID for a given location, and the location's ID must be sequential. So its basically like a primary key, except that it is also tied to the locationID. So 3 different locations will all have ID's like 1,2,3,4,5,...,n
What is the best way to do this?
I also need a safe way of getting the next... | Creating a unique sequential ID for each location that behaves like a primary key can be achieved through various strategies. Here’s a general approach along with considerations for concurrency and safety when generating the next ID.
### Database Schema
You could have a schema that looks like this:
```sql
CREATE TAB... | 21,508 | [
{
"from": "human",
"value": "I need to create a unique ID for a given location, and the location's ID must be sequential. So its basically like a primary key, except that it is also tied to the locationID. So 3 different locations will all have ID's like 1,2,3,4,5,...,n\nWhat is the best way to do this? \... |
I am trying to include a value from a database table within the value element of an input field.
This is what I have, but it is not working:
?><input type="text" size="10" value="<?= date("Y-m-d",
strtotime($rowupd['upcoming_event_featured_date'])) ?>" name="upcoming_event_featured_date"
id="keys"/><?php
I have done... | In your code, you're using PHP short tags (<?= ... ?>) to output a value directly within an HTML element, which is perfectly acceptable. However, if it's not working as expected, there are a few things you might want to check.
### Check 1: Ensure Short Tags are Enabled
Make sure that your PHP configuration allows shor... | 25,009 | [
{
"from": "human",
"value": "I am trying to include a value from a database table within the value element of an input field.\nThis is what I have, but it is not working:\n?><input type=\"text\" size=\"10\" value=\"<?= date(\"Y-m-d\", \nstrtotime($rowupd['upcoming_event_featured_date'])) ?>\" name=\"upcomin... |
Can anyone explain what this mod_rewrite rule is doing?
I'm trying to comment the file, but the code seems to state the opposite of what I think it's doing
# Enable rewriting of URLs
RewriteEngine on
# Allow specified file types to be accessed
# Thing to test = URL
# Condition = not starting with
RewriteCond $1 !^(... | Let's break down the provided `mod_rewrite` rules step by step to clarify what each part is doing.
1. **Enable Rewriting of URLs**
```apache
RewriteEngine on
```
This line turns on the rewrite engine, allowing the server to process the subsequent rewrite rules.
2. **Allow Specified File Types to be Access... | 19,941 | [
{
"from": "human",
"value": "Can anyone explain what this mod_rewrite rule is doing?\nI'm trying to comment the file, but the code seems to state the opposite of what I think it's doing\n# Enable rewriting of URLs\nRewriteEngine on\n\n\n# Allow specified file types to be accessed\n# Thing to test = URL\n# C... |
I wonder what's the best deployment directory for Rails apps? Some developers use directories such as /u/apps/#{appname}. Are there any advantages when using /u/apps/#{appname} instead of /var/www/#{appname} or other OS default directories?
Obviously I want to pick the directory with the best security properties and th... | Choosing the right deployment directory for your Rails applications is an important decision that can impact security, maintainability, and best practices. Let's compare some common directory structures:
### Common Directories
1. **/u/apps/#{appname}** (or similar):
- This is a custom path often used by developers... | 19,273 | [
{
"from": "human",
"value": "I wonder what's the best deployment directory for Rails apps? Some developers use directories such as /u/apps/#{appname}. Are there any advantages when using /u/apps/#{appname} instead of /var/www/#{appname} or other OS default directories?\nObviously I want to pick the director... |
Two main ways to deploy a J2EE/Java Web app (in a very simplistic sense):
Deploy assembled artifacts to production box
Here, we create the .war (or whatever) elsewhere, configure it for production (possibly creating numerous artifacts for numerous boxes) and place the resulting artifacts on the production servers.
Pro... | You've presented a common dilemma faced in the deployment of Java EE applications, particularly regarding the choice between building artifacts in a controlled environment versus building directly on the production server. Your concrete example with OSCache demonstrates the complexities that can arise in managing confi... | 20,744 | [
{
"from": "human",
"value": "Two main ways to deploy a J2EE/Java Web app (in a very simplistic sense):\nDeploy assembled artifacts to production box\nHere, we create the .war (or whatever) elsewhere, configure it for production (possibly creating numerous artifacts for numerous boxes) and place the resultin... |
what is a good way to select a random element from a map? C++. It is my understanding that maps don't have random access iterators. The key is a long long and the map is sparsely populated.
| You are correct that C++ `std::map` does not support random access iterators, which makes selecting a random element from it a bit more involved than selecting from a vector or an array. However, you can still achieve this by following a few simple steps.
### Method 1: Using a vector
One effective approach is to stor... | 14,156 | [
{
"from": "human",
"value": "what is a good way to select a random element from a map? C++. It is my understanding that maps don't have random access iterators. The key is a long long and the map is sparsely populated. \n"
},
{
"from": "gpt",
"value": "You are correct that C++ `std::map` doe... |
Ok, if I have this right, my code can get cookies at a specific url, but then once I get the cookie, into the container, how can I send it to the client via socket? Like the code directly below does here for regular http-page requests.
byte[] buffer = new byte[bz];
rebu = responsestream.Read(buffer, 0, bz);
while (rebu... | To send cookies to the client via socket in your proxy server code, you will need to extract the cookies from the `HttpWebResponse` and then include them in the HTTP response headers you send back to the client.
Here’s how you can modify your existing code to achieve this:
1. **Extract Cookies**: After getting the `H... | 22,202 | [
{
"from": "human",
"value": "Ok, if I have this right, my code can get cookies at a specific url, but then once I get the cookie, into the container, how can I send it to the client via socket? Like the code directly below does here for regular http-page requests.\nbyte[] buffer = new byte[bz];\nrebu = resp... |
Can you suggest how to create a test environment to simulate various types of bandwidths and traffic in a web app?
Or maybe an open source program which does this against localhost?
I think this is a very important subject when programming web apps but it is not a usual topic, the only way i can imagine to create such ... | Creating a test environment to simulate various bandwidths and network traffic scenarios is indeed a crucial part of web app development, especially for performance testing. Here are a few methods and tools you can use to create such an environment:
### Methods
1. **Network Emulation with Tools**: You can use special... | 21,100 | [
{
"from": "human",
"value": "Can you suggest how to create a test environment to simulate various types of bandwidths and traffic in a web app?\nOr maybe an open source program which does this against localhost?\nI think this is a very important subject when programming web apps but it is not a usual topic,... |
Here is my function (updated):
Public Shared Function shortenUrl(ByVal URL As String) As String
Return shortenUrl(URL, 32)
End Function
Public Shared Function shortenUrl(ByVal URL As String, ByVal maxLength As Integer) As String
If URL.Length > maxLength Then
String.Format("{0}...{1}", URL.Substring(0, ... | Your function for shortening URLs is a good start, but there are a few improvements you can make to simplify it and ensure it behaves as expected. Here are some suggestions:
1. **Return the formatted string**: You forgot to return the formatted string in the case where the URL exceeds the maximum length.
2. **Proper ... | 23,630 | [
{
"from": "human",
"value": "Here is my function (updated):\nPublic Shared Function shortenUrl(ByVal URL As String) As String\n Return shortenUrl(URL, 32)\nEnd Function\nPublic Shared Function shortenUrl(ByVal URL As String, ByVal maxLength As Integer) As String\n If URL.Length > maxLength Then\n ... |
I want to take an action in an Excel workbook macro after a period of inactivity (hide/protect some worksheets). What is the best/simplest way to achieve this?
Í'm assuming I'll use Application.OnTime to periodically check if the user has been active. But what events should I handle to see if the user was "active" (i... | Your approach to using the `Application.OnTime` method to periodically check for user activity is a valid and effective way to implement this functionality in Excel VBA. The events you've identified—`Workbook_SheetActivate`, `Workbook_SheetSelectionChange`, and `Workbook_WindowActivate`—are indeed good choices for trac... | 20,143 | [
{
"from": "human",
"value": "I want to take an action in an Excel workbook macro after a period of inactivity (hide/protect some worksheets). What is the best/simplest way to achieve this?\nÍ'm assuming I'll use Application.OnTime to periodically check if the user has been active. But what events should I... |
I'm working on a method that accepts an expression tree as a parameter, along with a type (or instance) of a class.
The basic idea is that this method will add certain things to a collection that will be used for validation.
public interface ITestInterface
{
//Specify stuff here.
}
private static void DoSomething<... | Your approach to using expression trees for strongly-typed property access is quite common in C#. Instead of trying to manually manipulate the `expression.Body`, you can directly extract the `PropertyInfo` from the expression tree using type-checking and casting. This will allow you to avoid cumbersome string manipulat... | 21,637 | [
{
"from": "human",
"value": "I'm working on a method that accepts an expression tree as a parameter, along with a type (or instance) of a class.\nThe basic idea is that this method will add certain things to a collection that will be used for validation.\npublic interface ITestInterface\n{\n //Specify st... |
I know this won't be a popular question, because a lot of web designers want to assume that their craft is difficult and valuable.
IT IS. But I do not believe that it is difficult because HTML and CSS are difficult to master, I believe its difficult because being a good creative designer is difficult. Please resist the... | Your perspective on the simplicity of HTML and CSS, especially from the standpoint of coding and implementation, is certainly valid to an extent. Here are some points to consider regarding your claims:
1. **Learning Curve vs. Mastery**: It is true that HTML and CSS are relatively straightforward languages to learn for... | 22,293 | [
{
"from": "human",
"value": "I know this won't be a popular question, because a lot of web designers want to assume that their craft is difficult and valuable.\nIT IS. But I do not believe that it is difficult because HTML and CSS are difficult to master, I believe its difficult because being a good creativ... |
In this particular case I'm trying to discover if a mylib.a file is 32 or 64 bit compatible. I'm familiar with ldd for shared objects (mylib.so) but how do I inspect a regular .a archive?
| To determine whether a static library (like `mylib.a`) is 32-bit or 64-bit, you can use the `file` command in Unix-based systems. The `file` command inspects the binary format of files and provides information about the architecture, whether it's 32-bit or 64-bit. Here's how to do it:
1. Open your terminal.
2. Run the... | 24,945 | [
{
"from": "human",
"value": "In this particular case I'm trying to discover if a mylib.a file is 32 or 64 bit compatible. I'm familiar with ldd for shared objects (mylib.so) but how do I inspect a regular .a archive? \n"
},
{
"from": "gpt",
"value": "To determine whether a static library (like `... |
Within your organization, is every developer required to lock his workstation when leaving it?
What do you see a risks when workstations are left unlocked, and how do you think such risks are important compared to "over-wire" (network hacking) security risks?
What policies do you think are most efficient to enforce loc... | **Locking Workstations and Security Risks**
### Risks of Leaving Workstations Unlocked
1. **Data Theft**: Unlocked workstations can lead to unauthorized access to sensitive information. An intruder could easily access confidential documents, intellectual property, or personal data.
2. **Insider Threats**: Employee... | 19,726 | [
{
"from": "human",
"value": "Within your organization, is every developer required to lock his workstation when leaving it?\nWhat do you see a risks when workstations are left unlocked, and how do you think such risks are important compared to \"over-wire\" (network hacking) security risks?\nWhat policies d... |
Has anyone ever had the issue where trying to "View Designer" on a windows form in Visual Studio .NET causes the error: "Could not load file or assembly…" ?
In this case, the assembly in question was XYZ.dll. I managed to fix this by adding XYZ.dll and all its references to my project's references (even though my proje... | The "Could not load file or assembly" error when trying to open the designer for a Windows Form in Visual Studio can be a common issue and is often related to how Visual Studio handles assemblies and dependencies. Here’s a deeper look at the possible causes and solutions:
### Possible Causes
1. **Shadow Copying**: As ... | 22,082 | [
{
"from": "human",
"value": "Has anyone ever had the issue where trying to \"View Designer\" on a windows form in Visual Studio .NET causes the error: \"Could not load file or assembly…\" ?\nIn this case, the assembly in question was XYZ.dll. I managed to fix this by adding XYZ.dll and all its references to... |
Which search engine would you recommend for a Commerce website?
We have millions of products in a catalog and we want it to be as quick as possible.
We would also want to make sure that the marketing driven through the search engine will be fast and effective.
What are your opinions?
| For a commerce website with millions of products, you want a search engine that is optimized for speed, scalability, and relevancy. Here are a few popular search engine options that can meet your requirements:
1. **Elasticsearch**:
- **Scalability**: Elasticsearch is built on Apache Lucene and is designed for horiz... | 20,501 | [
{
"from": "human",
"value": "Which search engine would you recommend for a Commerce website?\nWe have millions of products in a catalog and we want it to be as quick as possible.\nWe would also want to make sure that the marketing driven through the search engine will be fast and effective.\nWhat are your o... |
i'm having a problem to create a text_field without a method association. Maybe i even don't need it :-)
I have two radio_buttons associated to the same method:
<%= radio_button :comment, :author, "anonymous" %> Anonymous <br>
<%= radio_button :comment, :author, "real_name" %> Name <br>
What i would like to do is to h... | Certainly, Victor! You can achieve this by using JavaScript to control the visibility of a text field based on the selected radio button. Here's a step-by-step approach to implement the functionality you described:
1. **Update Your Form**: Add a text field that will be shown or hidden based on the radio button selecti... | 19,449 | [
{
"from": "human",
"value": "i'm having a problem to create a text_field without a method association. Maybe i even don't need it :-)\nI have two radio_buttons associated to the same method:\n<%= radio_button :comment, :author, \"anonymous\" %> Anonymous <br>\n<%= radio_button :comment, :author, \"real_name... |
I'm looking at developing a device which will need to support Ethernet over USB (hosted in Linux, XP, and Vista). As I understand it, Vista and Linux support the industry standard USB CDC. However, in classic Windows style, XP only supports it's own Remote NDIS. So, now I'm thinking of just bowing down and doing it ove... | Developing a device that needs to support Ethernet over USB can indeed be challenging, especially when dealing with the varied support for USB protocols across different operating systems. You are correct in noting that Windows XP primarily relies on the Remote NDIS (RNDIS) protocol for Ethernet over USB support, while... | 20,707 | [
{
"from": "human",
"value": "I'm looking at developing a device which will need to support Ethernet over USB (hosted in Linux, XP, and Vista). As I understand it, Vista and Linux support the industry standard USB CDC. However, in classic Windows style, XP only supports it's own Remote NDIS. So, now I'm thin... |
I have a couple of solutions, but none of them work perfectly.
Platform
ASP.NET / VB.NET / .NET 2.0
IIS 6
IE6 (primarily), with some IE7; Firefox not necessary, but useful
Allowed 3rd Party Options
Flash
ActiveX (would like to avoid)
Java (would like to avoid)
Current Attempts
Gmail Style: You can use javascript to... | Given your constraints and the technologies you're using, finding a suitable file uploader solution that works seamlessly without prompting for authentication can be quite challenging. Here are a few options you could consider:
### 1. **XHR File Upload with Fallback**
- **Implementation**: Use a combination of HTML an... | 19,086 | [
{
"from": "human",
"value": "I have a couple of solutions, but none of them work perfectly.\nPlatform\n\nASP.NET / VB.NET / .NET 2.0\nIIS 6\nIE6 (primarily), with some IE7; Firefox not necessary, but useful\n\nAllowed 3rd Party Options\n\nFlash\nActiveX (would like to avoid)\nJava (would like to avoid)\n\nC... |
The client connects to the server using GenuineChannels (we are considering switching to DotNetRemoting). What I mean by find is obtain the IP and port number of a server to connect to.
It seems like a brute-force approach would be try every IP on the network try the active ports (not even sure if that's possible) but... | Finding the IP address and port number of a server to connect to can be done more efficiently than a brute-force approach. Here are some strategies you can consider:
### 1. **Service Discovery Protocols**
Using service discovery protocols can help clients find the server's IP and port without needing to guess. Some co... | 22,902 | [
{
"from": "human",
"value": "The client connects to the server using GenuineChannels (we are considering switching to DotNetRemoting). What I mean by find is obtain the IP and port number of a server to connect to.\nIt seems like a brute-force approach would be try every IP on the network try the active po... |
Is there a standard way of dealing with globally scoped variables in PHP? Session scoped?
From the research I've done, it looks like the options are mostly add-ons or external. APC might work, but would be limited to a single PHP instance and not so useful for a farm of servers. Memcached seems like it would work, but... | In PHP, managing global state or sharing data across requests can be somewhat challenging due to its stateless nature. There isn’t a built-in, standard mechanism specifically for globally scoped variables like you might find in other programming languages. However, there are several approaches to managing shared state ... | 21,153 | [
{
"from": "human",
"value": "Is there a standard way of dealing with globally scoped variables in PHP? Session scoped? \nFrom the research I've done, it looks like the options are mostly add-ons or external. APC might work, but would be limited to a single PHP instance and not so useful for a farm of server... |
What is the most efficient way in C# 2.0 to check each character in a string and return true if they are all valid hexadecimal characters and false otherwise?
Example
void Test()
{
OnlyHexInString("123ABC"); // Returns true
OnlyHexInString("123def"); // Returns true
OnlyHexInString("123g"); // Returns false... | To efficiently check if all characters in a string are valid hexadecimal characters in C# 2.0, you can iterate through each character in the string and verify whether each character falls within the valid ranges for hexadecimal characters, which are '0'-'9', 'A'-'F', and 'a'-'f'.
Here's one way to implement this in y... | 24,135 | [
{
"from": "human",
"value": "What is the most efficient way in C# 2.0 to check each character in a string and return true if they are all valid hexadecimal characters and false otherwise?\nExample\nvoid Test()\n{\n OnlyHexInString(\"123ABC\"); // Returns true\n OnlyHexInString(\"123def\"); // Returns ... |
What good profilers do you know?
What is a good way to measure and tweak the performance of a C++ MFC application?
Is Analysis of algorithms really neccesary? http://en.wikipedia.org/wiki/Algorithm_analysis
| ### Good Profilers for C++ Applications
1. **Visual Studio Profiler**: Integrated with Visual Studio, it provides CPU and memory profiling, call graphs, and a wealth of other performance insights.
2. **gprof**: A GNU profiler that works well with applications compiled with GCC. It provides a simple way to measure t... | 20,327 | [
{
"from": "human",
"value": "What good profilers do you know? \nWhat is a good way to measure and tweak the performance of a C++ MFC application?\nIs Analysis of algorithms really neccesary? http://en.wikipedia.org/wiki/Algorithm_analysis\n"
},
{
"from": "gpt",
"value": "### Good Profilers for C... |
I was just tinkering around with calling GetPrivateProfileString and GetPrivateProfileSection in kernel32 from .NET and came across something odd I don't understand.
Let's start with this encantation:
Private Declare Unicode Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringW" ( _
By... | It sounds like you're encountering a quirk of how `GetPrivateProfileString` handles the reading of INI files, particularly when it comes to the formatting of those files. Here are a few things to consider that could clarify the behavior you are observing:
1. **INI File Format**: The INI file format is expected to foll... | 21,161 | [
{
"from": "human",
"value": "I was just tinkering around with calling GetPrivateProfileString and GetPrivateProfileSection in kernel32 from .NET and came across something odd I don't understand.\nLet's start with this encantation:\n Private Declare Unicode Function GetPrivateProfileString Lib \"kernel32\... |
In c# (3.0 or 3.5, so we can use lambdas), is there an elegant way of sorting a list of dates in descending order? I know I can do a straight sort and then reverse the whole thing,
docs.Sort((x, y) => x.StoredDate.CompareTo(y.StoredDate));
docs.Reverse();
but is there a lambda expression to do it one step?
In the abo... | Yes, you can sort a list of dates in descending order in a more elegant way using a lambda expression in C#. With the `List<T>.Sort` method, you can directly specify the comparison in descending order without needing to sort and then reverse the list. Here's how you can do it:
```csharp
docs.Sort((x, y) => y.StoredDat... | 25,133 | [
{
"from": "human",
"value": "In c# (3.0 or 3.5, so we can use lambdas), is there an elegant way of sorting a list of dates in descending order? I know I can do a straight sort and then reverse the whole thing, \ndocs.Sort((x, y) => x.StoredDate.CompareTo(y.StoredDate));\ndocs.Reverse();\n\nbut is there a la... |
I'm required to provide a handover to our content editors for the update corporate website I've just released. Apparently a training session with notes isn't sufficient. Fair enough.
So more dreaded documentation looms. After a fairly brief trawl over Google, I'm unable to find any relevant and usable template to us... | Creating a comprehensive handover document for your content editors is a great way to ensure they have all the information they need to manage and update the website effectively. Here’s a more detailed outline that you can consider incorporating into your handover document, along with some suggestions for cloud-based t... | 22,168 | [
{
"from": "human",
"value": "I'm required to provide a handover to our content editors for the update corporate website I've just released. Apparently a training session with notes isn't sufficient. Fair enough.\nSo more dreaded documentation looms. After a fairly brief trawl over Google, I'm unable to f... |
Say you have 100 directories and for each directory you have a file named .pdf stored somewhere else. If you want to move/copy each file into the directory with the same name, can this be done on the Windows command line?
| Yes, you can move or copy files to directories with the same name using the Windows command line. Here’s how to do it:
Assuming you have 100 directories named `Dir1`, `Dir2`, ..., `Dir100`, and the corresponding PDF files named `Dir1.pdf`, `Dir2.pdf`, ..., `Dir100.pdf` located in a specific source directory, you can u... | 21,078 | [
{
"from": "human",
"value": "Say you have 100 directories and for each directory you have a file named .pdf stored somewhere else. If you want to move/copy each file into the directory with the same name, can this be done on the Windows command line?\n"
},
{
"from": "gpt",
"value": "Yes, you can... |
Is OpenID a secure method of authentication users on a website?
And, if not, what are the security risks associated with OpenID?
| OpenID is a decentralized authentication protocol that allows users to log in to multiple websites without having to create a separate username and password for each one. While it offers several advantages, such as convenience and reduced password fatigue, it is important to recognize that it also has some security ris... | 21,412 | [
{
"from": "human",
"value": "Is OpenID a secure method of authentication users on a website?\nAnd, if not, what are the security risks associated with OpenID?\n"
},
{
"from": "gpt",
"value": "OpenID is a decentralized authentication protocol that allows users to log in to multiple websites witho... |
I am just starting out with Silverlight (2 RC0) and can’t seem to get the following to work. I want to create a simple image button user control.
My xaml for the user control is as follows:
<Button>
<Button.Template>
<ControlTemplate>
<Image Source="{TemplateBinding ImageSource}... | To create a simple image button user control in Silverlight that correctly binds an image source to your custom control, there are a few adjustments you need to make.
### 1. Modify the XAML for the ControlTemplate
You should define a `DependencyProperty` of type `ImageSource`, rather than an `Image`, since `Image` i... | 22,097 | [
{
"from": "human",
"value": "I am just starting out with Silverlight (2 RC0) and can’t seem to get the following to work. I want to create a simple image button user control.\nMy xaml for the user control is as follows:\n <Button>\n <Button.Template> \n <ControlTemplate>\n ... |
I'm a PHP developer who knows a little bit of Ruby. I want to learn Ruby on Rails, but most of the resources I've come across treat RoR functionality as "magic" -- i.e., it has a certain internal consistency, but don't bother asking how it works in terms of Ruby, MySQL, etc.
Anyway, I want a deep understanding of how R... | It's great that you want to dive deep into Ruby on Rails (RoR) and understand its inner workings! Here are some resources and advice that can help you achieve a deeper understanding of RoR, ActiveRecord, and the design decisions behind the framework.
### Books
1. **"The Rails 5 Way" by Obie Fernandez** - This book off... | 19,705 | [
{
"from": "human",
"value": "I'm a PHP developer who knows a little bit of Ruby. I want to learn Ruby on Rails, but most of the resources I've come across treat RoR functionality as \"magic\" -- i.e., it has a certain internal consistency, but don't bother asking how it works in terms of Ruby, MySQL, etc.\n... |
Platform: Windows XP
Development Platform: VB6
When trying to set an application title via the Project Properties dialog on the Make tab, it seems to silently cut off the title at a set number of characters. Also tried this via the App.Title property and it seems to suffer from the same problem. I wouldn't care about... | It sounds like you've encountered a common limitation in VB6 when it comes to the application title length. While the exact character limit can sometimes vary, many developers have noted that the title is often cut off at around 40 characters in various Windows environments.
Unfortunately, there is no straightforward ... | 21,997 | [
{
"from": "human",
"value": "Platform: Windows XP\nDevelopment Platform: VB6\nWhen trying to set an application title via the Project Properties dialog on the Make tab, it seems to silently cut off the title at a set number of characters. Also tried this via the App.Title property and it seems to suffer fr... |
I'd like to have an HTML page which displays a single PNG or JPEG image. I want the image to take up the whole screen but when I do this:
<img src="whatever.jpeg" width="100%" height="100%" />
It just stretches the image and messes up the aspect ratio. How do I solve this so the image has the correct aspect ratio whil... | To create an HTML page that displays a PNG or JPEG image while maintaining its aspect ratio and scaling to the maximum size possible, we can improve on the provided code. The solution you posted almost meets your requirements, but there are some enhancements we can make for better readability and usability.
Here’s an ... | 20,034 | [
{
"from": "human",
"value": "I'd like to have an HTML page which displays a single PNG or JPEG image. I want the image to take up the whole screen but when I do this:\n<img src=\"whatever.jpeg\" width=\"100%\" height=\"100%\" />\n\nIt just stretches the image and messes up the aspect ratio. How do I solve t... |
In a project which uses restful_authentication with acts_as_state_machine and email activation, I get a double render error whenever a user does the activation action from the email link.
I'm using the default
def activate
self.current_user = params[:activation_code].blank? ? false : User.find_by_activation_code(par... | The double render error you’re encountering usually indicates that a controller action is attempting to render or redirect more than once, which is not allowed in Rails. Based on the provided code snippets, it looks like there could be a scenario where your `activate` method might end up rendering a view in addition to... | 23,900 | [
{
"from": "human",
"value": "In a project which uses restful_authentication with acts_as_state_machine and email activation, I get a double render error whenever a user does the activation action from the email link.\nI'm using the default\ndef activate\n self.current_user = params[:activation_code].blank... |
Is there a better way than simply trying to open the file?
int exists(const char *fname)
{
FILE *file;
if ((file = fopen(fname, "r")))
{
fclose(file);
return 1;
}
return 0;
}
| Yes, while the approach you're using (attempting to open the file) is a common way to check for a file's existence in C, there are alternative methods you could use which might be more straightforward or efficient, especially if you want to avoid opening the file unnecessarily.
### Using `stat()` function
One alterna... | 23,843 | [
{
"from": "human",
"value": "Is there a better way than simply trying to open the file?\nint exists(const char *fname)\n{\n FILE *file;\n if ((file = fopen(fname, \"r\")))\n {\n fclose(file);\n return 1;\n }\n return 0;\n}\n\n"
},
{
"from": "gpt",
"value": "Yes, whil... |
We have several websites on different domains and I'd like to be able to track users' movements on these sites.
Obviously cookies are not feasable, because they don't cross domain borders.
I could look at a combination of IP address and User Agent, but there are some cases where that does not work.
I don't want to us... | Tracking users across different domains can be challenging, especially given the restrictions on cookies and privacy concerns. Here are some alternatives and methods you can consider:
### 1. **Server-Side Tracking**
Set up server-side tracking where you collect data about user interactions on each domain. You can use ... | 21,566 | [
{
"from": "human",
"value": "We have several websites on different domains and I'd like to be able to track users' movements on these sites.\n\nObviously cookies are not feasable, because they don't cross domain borders. \nI could look at a combination of IP address and User Agent, but there are some cases ... |
I am trying to display object data members in a generic way. I started by using PropertyGrid, which satisfies my needs as far as simple properties are concerned. However, it doesn't let the user drill-down into data members. It allows browsing into collections, but the interface is a bit awkward.
I'm basically looki... | If you're looking for a way to display object data members in a drill-down fashion, similar to the QuickWatch feature in Visual Studio, there are a few libraries and approaches that might meet your needs:
1. **Dynamic Data Display Libraries**:
- **DynamicObject** or **ExpandoObject**: If you have control over the o... | 23,292 | [
{
"from": "human",
"value": "I am trying to display object data members in a generic way. I started by using PropertyGrid, which satisfies my needs as far as simple properties are concerned. However, it doesn't let the user drill-down into data members. It allows browsing into collections, but the interf... |
I am having huge lines data which could accomdate in Textbox.
While I am exporting to excel the wrapping up of data occurs and the data
is being cut off.
When i manually change the textbox height i can see the full data but i need the full data to be
displayed in the first time itself.
| To ensure that all the data in a textbox is fully visible when exporting to Excel, there are several strategies you can consider. Below are some approaches that you can implement based on your specific scenario:
### 1. Dynamic Height Adjustment
You can programmatically set the height of the textbox based on the conten... | 19,396 | [
{
"from": "human",
"value": "I am having huge lines data which could accomdate in Textbox.\nWhile I am exporting to excel the wrapping up of data occurs and the data\nis being cut off. \nWhen i manually change the textbox height i can see the full data but i need the full data to be \ndisplayed in the first... |
http://developer.yahoo.com/javascript/howto-proxy.html
Are there disadvantages to this technique? The advantage is obvious, that you can use a proxy to get XML or JavaScript on another domain with XMLHttpRequest without running into same-origin restrictions. However, I do not hear about disadvantages over other methods... | Using a proxy server to bypass the same-origin policy has several advantages, such as enabling cross-domain requests in scenarios where CORS (Cross-Origin Resource Sharing) is not supported. However, there are also several disadvantages and challenges associated with this technique:
1. **Increased Latency**: Routing r... | 21,310 | [
{
"from": "human",
"value": "http://developer.yahoo.com/javascript/howto-proxy.html\nAre there disadvantages to this technique? The advantage is obvious, that you can use a proxy to get XML or JavaScript on another domain with XMLHttpRequest without running into same-origin restrictions. However, I do not h... |
I'm wondering what the best practices are for storing a relational data structure in XML. Particulary, I am wondering about best practices for enforcing node order. For example, say I have three objects: School, Course, and Student, which are defined as follows:
class School
{
List<Course> Courses;
List<Student... | Storing relational data in XML can indeed be challenging, especially when you need to maintain a specific order for parsing and object references. Here are some best practices and considerations to help you effectively manage your relational data in XML.
### 1. Enforcing Order
One way to enforce the correct order of ... | 20,091 | [
{
"from": "human",
"value": "I'm wondering what the best practices are for storing a relational data structure in XML. Particulary, I am wondering about best practices for enforcing node order. For example, say I have three objects: School, Course, and Student, which are defined as follows:\nclass School\n{... |
I have been thinking a lot about unit testing and how to improve the readability of the unit tests. I thought why not give a character to the classes in the unit test to clarify what they do.
Here is a simple unit test that I wrote:
[TestFixture]
public class when_dave_transfers_money_from_wamu_account_to_the_woo... | Your idea of giving characters to the classes in your unit tests is a great way to make them more readable and relatable. It adds a narrative aspect, which can often help with understanding what the tests are doing at a glance. However, you’ve identified a valid concern: as you encapsulate more logic into your characte... | 20,255 | [
{
"from": "human",
"value": "I have been thinking a lot about unit testing and how to improve the readability of the unit tests. I thought why not give a character to the classes in the unit test to clarify what they do. \nHere is a simple unit test that I wrote: \n[TestFixture]\n public class when_dave_... |
I have two queries saved on my SQL Server 2005 and I would like to have them running at certain intervals, e.g. every 24 hours. Is there a way to automate these queries and schedule them via SQL Server Management Studio?
| Yes, you can automate the execution of your queries in SQL Server 2005 by creating a SQL Server Agent Job in SQL Server Management Studio (SSMS). Here's a step-by-step guide on how to do that:
### Step 1: Open SQL Server Management Studio
1. Launch SQL Server Management Studio and connect to your SQL Server instance.
... | 18,929 | [
{
"from": "human",
"value": "I have two queries saved on my SQL Server 2005 and I would like to have them running at certain intervals, e.g. every 24 hours. Is there a way to automate these queries and schedule them via SQL Server Management Studio?\n"
},
{
"from": "gpt",
"value": "Yes, you can ... |
I have a pictures table that has the following columns:
PICTURE_ID int IDENTITY(1000,1) NOT NULL,
CATEGORY_ID int NOT NULL,
IMGDATA image NOT NULL,
CAPTION1 text COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
MIME_TYPE nchar(20) NOT NULL DEFAULT ('image/jpeg'),
IMGTHDATA image NOT NULL
In my code-behind I have this:
strin... | To display images stored in your SQL Server database in a `GridView` control, you'll need to take a few additional steps. Since you're working with image data in your SQL database, simply binding the `GridView` to the dataset won't automatically render the images. You'll need to create a template for those columns in t... | 21,944 | [
{
"from": "human",
"value": "I have a pictures table that has the following columns:\nPICTURE_ID int IDENTITY(1000,1) NOT NULL,\nCATEGORY_ID int NOT NULL,\nIMGDATA image NOT NULL,\nCAPTION1 text COLLATE SQL_Latin1_General_CP1_CI_AS NULL,\nMIME_TYPE nchar(20) NOT NULL DEFAULT ('image/jpeg'),\nIMGTHDATA image... |
I can run the server on my local machine and connect to it on the same machine, but when I try to connect to it from a different computer over the internet, there is not sign of activity on my server, nor a response from the server on the computer I'm testing it on. I've tried both XP and Vista, turn off firewalls, ope... | It looks like you are trying to set up a TCP server that listens for incoming connections on a specified port. You're having trouble connecting to the server from a different computer over the internet. Let's troubleshoot a few potential issues and provide some steps you can take to resolve them.
### Checklist and Tro... | 20,953 | [
{
"from": "human",
"value": "I can run the server on my local machine and connect to it on the same machine, but when I try to connect to it from a different computer over the internet, there is not sign of activity on my server, nor a response from the server on the computer I'm testing it on. I've tried b... |
In order to fine tune allocation of PDQ resources depending on the time of day that batch jobs run, we have a utility that sets PDQPRIORITY based on some day of week / hour of day rules, eg:
PDQPRIORITY=$(throttle); export PDQPRIORITY
However, this is fixed at the time the script starts, so long running jobs never get... | Your problem stems from the fact that the `SET PDQPRIORITY` command in Informix is session-wide and can only be set at the session level. When you call it within the stored procedure, it only affects the local context of that procedure and does not change the session-level setting for the entire database access session... | 20,680 | [
{
"from": "human",
"value": "In order to fine tune allocation of PDQ resources depending on the time of day that batch jobs run, we have a utility that sets PDQPRIORITY based on some day of week / hour of day rules, eg:\nPDQPRIORITY=$(throttle); export PDQPRIORITY\n\nHowever, this is fixed at the time the s... |
What are my options when it comes to implementing page compression is asp.net.Right now I have a custom home grown httpmodule and its not very mature.
Google links me to MbCompression. The project has few views and downloads which discourages me a bit.
Edit: I am under shared hosting, which limits my access to IIS sett... | Implementing page compression in an ASP.NET application, especially under shared hosting where you have limited control over server settings, can be a bit tricky but there are still several options available to you. Below are some alternatives you can consider for achieving compression in your ASP.NET application:
###... | 17,325 | [
{
"from": "human",
"value": "What are my options when it comes to implementing page compression is asp.net.Right now I have a custom home grown httpmodule and its not very mature.\nGoogle links me to MbCompression. The project has few views and downloads which discourages me a bit.\nEdit: I am under shared ... |
While working on SVG implementation for Internet Explorer to be based on its own VML format I came to a problem of translation of an SVG elliptical arc to an VML elliptical arc.
In VML an arc is given by: two angles for two points on ellipse and lengths of radiuses,
In SVG an arc is given by: two pairs of coordinates f... | To translate SVG elliptical arcs to VML elliptical arcs, we need to understand how to derive coordinates and angles based on a specified ellipse. Let's break this down into manageable parts:
### 1. Finding the Center of the Ellipse
Given two points on the curve of an ellipse, \( P_1(x_1, y_1) \) and \( P_2(x_2, y_2) ... | 20,410 | [
{
"from": "human",
"value": "While working on SVG implementation for Internet Explorer to be based on its own VML format I came to a problem of translation of an SVG elliptical arc to an VML elliptical arc.\nIn VML an arc is given by: two angles for two points on ellipse and lengths of radiuses,\nIn SVG an ... |
My code is in c# asp.net 3.5
In the following code the "Msg" has many words with spaces and characters (eg:Failed to prepare Sync Favorites : Directory does not exist: \STL-FNP-02\ryounes$\Sync\Favorites). This "Msg" is pulled from database to a gridview. I am not able to create hyperlink for this "Msg" in gridview. Si... | To handle the spaces and special characters in your `Msg` field when creating hyperlinks in a GridView in ASP.NET, you'll want to URL encode the message. The `HttpUtility.UrlEncode` method can be used for this purpose.
Since you want to URL encode the message before it is used in the hyperlink, you can make use of a ... | 21,971 | [
{
"from": "human",
"value": "My code is in c# asp.net 3.5\nIn the following code the \"Msg\" has many words with spaces and characters (eg:Failed to prepare Sync Favorites : Directory does not exist: \\STL-FNP-02\\ryounes$\\Sync\\Favorites). This \"Msg\" is pulled from database to a gridview. I am not able ... |
Assume parentNode exists and I want to add an element "Child" to it. Following intutive code won't work:
$("<Child>").appendTo(parentNode);
Because jQuery will create a node and append to parentNode.
So I am wondering, how do you add xml child node in jQuery?
p.s. Following ugly code will work, but it is really real... | To add an XML child node to an existing XML document node using jQuery, you will need to use the native DOM methods instead of jQuery directly. The reason for this is that jQuery's handling of the `<Child>` string attempts to create an HTML element rather than an XML element.
Here's a cleaner way to achieve the addit... | 25,522 | [
{
"from": "human",
"value": "Assume parentNode exists and I want to add an element \"Child\" to it. Following intutive code won't work:\n$(\"<Child>\").appendTo(parentNode);\n\nBecause jQuery will create a node and append to parentNode. \nSo I am wondering, how do you add xml child node in jQuery?\np.s. Fo... |
I'd like a loop that uses a UInt16 (ushort) to loop through all of its values. However, this doesn't do it:
for( ushort i = 0; i < UInt16.MaxValue; i++ )
{
// do something
}
The problem is that the loop will quit when i == 0xFFFF and not "do something".
If I change the 'for' statement to "for(ushort i = 0; i <= U... | You're correct in identifying that the loop you attempted will not execute for `i == UInt16.MaxValue` (0xFFFF) because you are using a less-than comparison (`<`). Additionally, using `<=` will lead to an infinite loop since `i` cannot exceed `UInt16.MaxValue`.
To properly loop through all possible values of `UInt16`, ... | 25,033 | [
{
"from": "human",
"value": "I'd like a loop that uses a UInt16 (ushort) to loop through all of its values. However, this doesn't do it:\nfor( ushort i = 0; i < UInt16.MaxValue; i++ )\n{\n // do something\n}\n\nThe problem is that the loop will quit when i == 0xFFFF and not \"do something\".\nIf I chang... |
Possible Duplicate:
Internationalization in SSRS
We use SQL Server Reporting Services for our web reports. At the moment, our clients are all in the UK, so for each report, we set the Language property for the report to "English (United Kingdom)".
But now we have US and French clients. So, we'll need to change the l... | To create a single set of reports in SQL Server Reporting Services (SSRS) that can cater to different languages and cultures, you can use the following approaches:
### 1. Parameterized Language
Create a report parameter for the language, which allows users to select their preferred language when running the report. He... | 22,799 | [
{
"from": "human",
"value": "\nPossible Duplicate:\nInternationalization in SSRS \n\nWe use SQL Server Reporting Services for our web reports. At the moment, our clients are all in the UK, so for each report, we set the Language property for the report to \"English (United Kingdom)\".\nBut now we have US an... |
After reading this discussion and this discussion about using CrashRpt to generate a crash dump and email it to the developers, I've been having a difficult time finding any instructions/tutorials for configuring the email settings used by the library to send the email.
When you call the install() function to initializ... | It seems like you're encountering issues with sending crash reports using the CrashRpt library. To clarify how CrashRpt handles email sending, here’s a brief overview:
1. **Email Sending Mechanism**: CrashRpt does not send emails directly using the user's email client or account settings. Instead, it typically uses an... | 21,445 | [
{
"from": "human",
"value": "After reading this discussion and this discussion about using CrashRpt to generate a crash dump and email it to the developers, I've been having a difficult time finding any instructions/tutorials for configuring the email settings used by the library to send the email.\nWhen yo... |
Is there a way to use Enum values inside a JSP without using scriptlets.
e.g.
package com.example;
public enum Direction {
ASC,
DESC
}
so in the JSP I want to do something like this
<c:if test="${foo.direction ==<% com.example.Direction.ASC %>}">...
| Yes, you can use Enum values in a JSP without resorting to scriptlets. Instead of using scriptlets, you can utilize the JSTL core library and EL (Expression Language) to achieve this.
### Steps to use Enum values in JSP:
1. **Expose the Enum in the request**: Before forwarding to the JSP, you should ensure that the E... | 22,389 | [
{
"from": "human",
"value": "Is there a way to use Enum values inside a JSP without using scriptlets.\ne.g. \npackage com.example;\n\npublic enum Direction {\n ASC,\n DESC\n}\n\nso in the JSP I want to do something like this\n<c:if test=\"${foo.direction ==<% com.example.Direction.ASC %>}\">...\n\n"
... |
I was asked implement a licensing schema for our product. They are very expensive products with few customers sparsely distributed around the world and basically every one of them has a design environment (a windows application installed on single windows machines, from 1 to 150 client machines per customer) and a web... | Your licensing schema design seems reasonable given your requirements and constraints. However, there are several considerations and potential improvements to ensure a robust and user-friendly licensing mechanism. Here are some suggestions:
### Potential Problems
1. **Single Point of Failure**: If the USB key contain... | 18,807 | [
{
"from": "human",
"value": "I was asked implement a licensing schema for our product. They are very expensive products with few customers sparsely distributed around the world and basically every one of them has a design environment (a windows application installed on single windows machines, from 1 to 15... |
Someone told me that it's faster to concatenate strings with StringBuilder. I have changed my code but I do not see any Properties or Methods to get the final build string.
How can I get the string?
| When using `StringBuilder` in C#, you can get the final concatenated string by using the `ToString()` method. This method converts the contents of the `StringBuilder` instance to a `string`.
Here's a simple example to illustrate how to use `StringBuilder` and retrieve the final string:
```csharp
using System;
using S... | 25,223 | [
{
"from": "human",
"value": "Someone told me that it's faster to concatenate strings with StringBuilder. I have changed my code but I do not see any Properties or Methods to get the final build string. \nHow can I get the string?\n"
},
{
"from": "gpt",
"value": "When using `StringBuilder` in C#,... |
Whoops, I need some info from a file I deleted, a while ago. In CVS I would just go to the ATTIC to find it, how do I find a file in SVN without having to go back to a revision where it existed (especially annoying since I have no idea really when I deleted -- one week ago, two weeks ago...)
| In Subversion (SVN), when a file is deleted, it is not removed from the repository's history, and you can recover it even if you do not know the exact revision where it was deleted. Here's how you can find and restore a deleted file:
1. **Find the Revision Where It Was Deleted**:
You can use the `svn log` command t... | 23,971 | [
{
"from": "human",
"value": "Whoops, I need some info from a file I deleted, a while ago. In CVS I would just go to the ATTIC to find it, how do I find a file in SVN without having to go back to a revision where it existed (especially annoying since I have no idea really when I deleted -- one week ago, two... |
I'm working on an application that consists of an overall Quartz-based scheduler and "CycledJob" run using CronTriggers. The purpose of the application is to process inputs from different email inboxes based on the source country.
Based on the country that it comes in from (i.e. US, UK, FR, etc.) the application trigg... | This is a common challenge when dealing with logging in multithreaded applications, especially when you want to segregate logs based on thread context, such as in your case where logs need to be differentiated by country. Here are a few approaches you could consider to solve this problem without extending the Quartz li... | 22,795 | [
{
"from": "human",
"value": "I'm working on an application that consists of an overall Quartz-based scheduler and \"CycledJob\" run using CronTriggers. The purpose of the application is to process inputs from different email inboxes based on the source country. \nBased on the country that it comes in from (... |
Looking at tooltip support in Flex, I've seen you can apply colors and styles to modify the appearance.
Is it possible to do cooler stuff like make tool tips appear with a simple animation like how menus work on modern Windows apps?
| Yes, it is possible to create animated tooltips in Adobe Flex. While Flex does not provide built-in support for animated tooltips out of the box, you can achieve this effect by using custom components and animations.
Here are some steps and tips to help you create animated tooltips:
1. **Custom Tooltip Component**: C... | 22,365 | [
{
"from": "human",
"value": "Looking at tooltip support in Flex, I've seen you can apply colors and styles to modify the appearance.\nIs it possible to do cooler stuff like make tool tips appear with a simple animation like how menus work on modern Windows apps?\n"
},
{
"from": "gpt",
"value": "... |
I am having an ASP.net page in my page i am having this as my code behind files.
on first access the page the page preinit, init, load methods are called. on postbacks
the preinit, init, load methods are called.
My question is LoadViewstate and control state events (Overridden methods) are not firing after postbacks al... | The behavior you're experiencing regarding the `LoadViewState` and `LoadControlState` methods not firing after postbacks is not unusual, but there are a few points to consider to understand how view state and control state work in ASP.NET.
1. **View State**: The `ViewState` is used to preserve page and control values ... | 18,884 | [
{
"from": "human",
"value": "I am having an ASP.net page in my page i am having this as my code behind files.\non first access the page the page preinit, init, load methods are called. on postbacks\nthe preinit, init, load methods are called.\nMy question is LoadViewstate and control state events (Overridde... |
I've been having a lot of problems trying to figure out how to use scanf(). It seems to work fine with integers, being fairly straight forward scanf("%d", &i).
Where I am running into issues is using scanf() in loops trying to read input. For example:
do {
printf("counter: %d: ", counter);
scanf("%c %c%d", &comma... | The issue you are encountering with `scanf` in your loop is related to how it handles input, particularly with whitespace characters (like spaces and newlines) and the format specifiers you are using.
When you use `scanf`, it expects to read exactly what you specify in the format string. In your case, the format strin... | 22,077 | [
{
"from": "human",
"value": "I've been having a lot of problems trying to figure out how to use scanf(). It seems to work fine with integers, being fairly straight forward scanf(\"%d\", &i).\nWhere I am running into issues is using scanf() in loops trying to read input. For example:\ndo {\n printf(\"coun... |
I find System.Monitor very confusing, although I understand threading, locks, deadlocks, race conditions, dining philosophers and all that jazz. Normally I use a ManualResetEvent() to do inter-thread co-ordination, but I know that that's a heavyweight kernel object, and that System.Monitor (Enter/Pulse, etc.) is much ... | Certainly! Let's dive into `System.Threading.Monitor` and how it works for thread synchronization in C#.
### Overview of System.Monitor
`System.Monitor` is a class that provides a mechanism to synchronize access to objects. It helps manage locks on objects to ensure that only one thread can access a certain section ... | 22,745 | [
{
"from": "human",
"value": "I find System.Monitor very confusing, although I understand threading, locks, deadlocks, race conditions, dining philosophers and all that jazz. Normally I use a ManualResetEvent() to do inter-thread co-ordination, but I know that that's a heavyweight kernel object, and that Sy... |
I've seen that a Processor Pack is available for Visual Studio 6, however it appears to only be available for users with SP5 and I am already using SP6:
In addition, the Visual C++ Processor Pack (VCPP) was removed from Service Pack 6. If you have the VCPP installed, installing SP6 will remove it from your machine. If ... | The Visual C++ Processor Pack (VCPP) is specifically designed to add support for newer processor features and optimizations in Visual Studio 6. However, as you noted, the VCPP was removed from Service Pack 6 (SP6). This means that if you're currently using Visual Studio 6 with SP6, you cannot use the Processor Pack, as... | 19,792 | [
{
"from": "human",
"value": "I've seen that a Processor Pack is available for Visual Studio 6, however it appears to only be available for users with SP5 and I am already using SP6:\nIn addition, the Visual C++ Processor Pack (VCPP) was removed from Service Pack 6. If you have the VCPP installed, installing... |
I'd like to add scrolling capability to a javax.swing.JDesktopPane. But wrapping in a javax.swing.JScrollPane does not produce the desired behavior.
Searching the web shows that this has been an issue for quite some time. There are some solutions out there, but they seem to be pretty old, and I'm not not completely sat... | Adding scrolling capability to a `javax.swing.JDesktopPane` can indeed be a bit tricky, as the standard `JScrollPane` doesn’t provide the desired behavior directly. Since `JDesktopPane` is meant for managing internal frames (`JInternalFrame`), it doesn't behave like a typical component that can be scrolled.
To impleme... | 17,052 | [
{
"from": "human",
"value": "I'd like to add scrolling capability to a javax.swing.JDesktopPane. But wrapping in a javax.swing.JScrollPane does not produce the desired behavior.\nSearching the web shows that this has been an issue for quite some time. There are some solutions out there, but they seem to be ... |
What are the key use cases for the use of virtualization -- that is, running one or more "virtual PCs" using software such as VMWare and Microsoft Virtual PC -- for software development?
Also -- are there other instances/uses of virtualization that aren't covered by my definition above (use of a tool like MS Virtual PC... | One key use case for virtualization in software development is **environment consistency**. Developers can create virtual machines (VMs) that replicate the production environment, ensuring that everyone on the team is developing and testing code under the same conditions. This eliminates issues related to "it works on ... | 27,004 | [
{
"from": "human",
"value": "What are the key use cases for the use of virtualization -- that is, running one or more \"virtual PCs\" using software such as VMWare and Microsoft Virtual PC -- for software development?\nAlso -- are there other instances/uses of virtualization that aren't covered by my defini... |
I have a table in SQL server that has the normal tree structure of Item_ID, Item_ParentID.
Suppose I want to iterate and get all CHILDREN of a particular Item_ID (at any level).
Recursion seems an intuitive candidate for this problem and I can write an SQL Server function to do this.
Will this affect performance if my... | When dealing with hierarchical data structures in SQL Server, using recursion can be an intuitive approach, but it might not always be the best option for performance, especially with large datasets. Recursive methods, like using a Common Table Expression (CTE), can be slower because they might involve multiple passes ... | 21,114 | [
{
"from": "human",
"value": "I have a table in SQL server that has the normal tree structure of Item_ID, Item_ParentID.\nSuppose I want to iterate and get all CHILDREN of a particular Item_ID (at any level).\nRecursion seems an intuitive candidate for this problem and I can write an SQL Server function to d... |
I've seen some developers put instance variable declarations at the end of classes though I mostly see them placed at the top. The only reasons I can think of for doing this are stylistic preference or maybe it somehow makes them easier to work with in an IDE. Is there a more legitimate reason for choosing this style... | The placement of instance variable declarations in a class (whether at the top or the bottom) often comes down to coding style preferences and team conventions. However, there are some potential reasons and considerations for placing them at the end of the class:
1. **Readability and Flow**: Some developers believe th... | 25,295 | [
{
"from": "human",
"value": "I've seen some developers put instance variable declarations at the end of classes though I mostly see them placed at the top. The only reasons I can think of for doing this are stylistic preference or maybe it somehow makes them easier to work with in an IDE. Is there a more ... |
I'm looking for the equivalent of right clicking on the drive in windows and seeing the disk space used and remaining info.
| In Windows, to check the disk space used and remaining on a drive, you can do the following:
1. **Using File Explorer:**
- Open **File Explorer** (you can do this by pressing `Windows + E`).
- In the left pane, click on **This PC** (or My Computer, depending on your version).
- You will see all your drives li... | 24,128 | [
{
"from": "human",
"value": "I'm looking for the equivalent of right clicking on the drive in windows and seeing the disk space used and remaining info.\n"
},
{
"from": "gpt",
"value": "In Windows, to check the disk space used and remaining on a drive, you can do the following:\n\n1. **Using Fil... |
I'm looking for metrics on how many ASP.NET developers are actively using ASP.NET.
If you have links to reliable metrics I would be interested to see them.
| As of my last update in October 2023, specific metrics on how many ASP.NET developers are actively using ASP.NET can be difficult to pinpoint precisely, as they can vary based on the source and methodology of data collection. However, here are some reliable resources that often provide insights into developer usage sta... | 19,322 | [
{
"from": "human",
"value": "I'm looking for metrics on how many ASP.NET developers are actively using ASP.NET. \nIf you have links to reliable metrics I would be interested to see them.\n"
},
{
"from": "gpt",
"value": "As of my last update in October 2023, specific metrics on how many ASP.NET d... |
I found this PECL package called threads, but there is not a release yet. And nothing is coming up on the PHP website.
| The `threads` extension for PHP is a PECL extension that provides multithreading support in PHP. As of my last update in October 2023, the `pthreads` extension has been historically used for creating and managing threads in PHP applications, but it's important to note that it is not supported on web server environments... | 21,886 | [
{
"from": "human",
"value": "I found this PECL package called threads, but there is not a release yet. And nothing is coming up on the PHP website.\n"
},
{
"from": "gpt",
"value": "The `threads` extension for PHP is a PECL extension that provides multithreading support in PHP. As of my last upda... |
A few questions on MS Access databases -
Size: Are there limits to the size of an access database? The reason i ask is that we have an access database that has a few simple tables. The size of the db is about 1GB. When I do a query on it, i see it taking over 10 minutes to run.
With proper indexing, should MS Acces... | Yes, there are limits to the size of an Access database. In Microsoft Access 2002 (XP) and later versions, the maximum database size limit is 2GB. However, this includes not only the data but also any associated objects, such as forms, reports, and modules. Once the database approaches this limit, you may encounter per... | 21,867 | [
{
"from": "human",
"value": "A few questions on MS Access databases -\nSize: Are there limits to the size of an access database? The reason i ask is that we have an access database that has a few simple tables. The size of the db is about 1GB. When I do a query on it, i see it taking over 10 minutes to ru... |
I have a very large codebase (read: thousands of modules) that has code shared across numerous projects that all run on different operating systems with different C++ compilers. Needless to say, maintaining the build process can be quite a chore.
There are several places in the codebase where it would clean up the cod... | The challenge you're facing with managing conditional includes in a large C++ codebase across multiple projects is common, and you're right that it can lead to cumbersome code if not handled well. Unfortunately, the C++ preprocessor itself does not have a direct way to conditionally include headers based on the existen... | 23,020 | [
{
"from": "human",
"value": "I have a very large codebase (read: thousands of modules) that has code shared across numerous projects that all run on different operating systems with different C++ compilers. Needless to say, maintaining the build process can be quite a chore. \nThere are several places in th... |
Will learning C++ help me build native applications with good speed? Will it help me as a programmer, and what are the other benefits?
The reason why I want to learn C++ is because I'm disappointed with the UI performances of applications built on top of JVM and .NET. They feel slow, and start slow too. Of course, a re... | Learning C++ can definitely help you build native applications with good performance, as it allows for fine-grained control over system resources and memory management. Here are some points to consider regarding your interest in C++:
### Performance
1. **Native Code**: C++ compiles to native code, which can lead to f... | 19,725 | [
{
"from": "human",
"value": "Will learning C++ help me build native applications with good speed? Will it help me as a programmer, and what are the other benefits?\nThe reason why I want to learn C++ is because I'm disappointed with the UI performances of applications built on top of JVM and .NET. They feel... |
I need to create XML in Perl. From what I read, XML::LibXML is great for parsing and using XML that comes from somewhere else. Does anyone have any suggestions for an XML Writer? Is XML::Writer still maintained? Does anyone like/use it?
In addition to feature-completeness, I am interested an easy-to-use syntax, so ... | One great option for writing XML in Perl is `XML::Writer`. It is relatively easy to use and offers a straightforward syntax for generating XML documents.
### XML::Writer
**Features:**
- Provides a simple and clean way to create XML elements and attributes.
- Supports pretty printing, which can be useful for debugging... | 16,205 | [
{
"from": "human",
"value": "I need to create XML in Perl. From what I read, XML::LibXML is great for parsing and using XML that comes from somewhere else. Does anyone have any suggestions for an XML Writer? Is XML::Writer still maintained? Does anyone like/use it?\nIn addition to feature-completeness, ... |
I use Lucene.Net to index some documents. I want to show the user a couple of lines as to why that document is in the result set. just like when you use google to search and it shows the link and followed by the link there are a few lines with the keywords highlighted.
any ideas?
| Certainly! When you're working with Lucene.Net for indexing and searching documents, providing snippets with highlighted keywords can enhance the user experience significantly. Here's a general approach to achieve this:
### 1. Indexing Documents
When you index your documents, make sure you also keep track of their con... | 17,840 | [
{
"from": "human",
"value": "I use Lucene.Net to index some documents. I want to show the user a couple of lines as to why that document is in the result set. just like when you use google to search and it shows the link and followed by the link there are a few lines with the keywords highlighted.\nany idea... |
What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
| `System.Array.CopyTo()` and `System.Array.Clone()` are both methods provided by the .NET Framework for working with arrays, but they serve different purposes and have different behaviors. Here's a breakdown of their differences:
### `System.Array.CopyTo()`
- **Purpose**: The `CopyTo` method is used to copy the elemen... | 21,790 | [
{
"from": "human",
"value": "What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?\n"
},
{
"from": "gpt",
"value": "`System.Array.CopyTo()` and `System.Array.Clone()` are both methods provided by the .NET Framework for working with arrays, but they serve different pur... |
My project is split up into a typical 3 layer structure for a Silverlight app. That is:
A base layer, which is a class library that contains all my business objects, logic, data access etc.
A middle layer which is a WCF service which communicates with;
My Silverlight front end
The problem I have is that currently the... | In your Silverlight application architecture using a 3-layer structure (business layer, WCF service, and Silverlight frontend), you want to expose your business objects (BOs) with their properties and methods rather than just the private variables. Here's how you can achieve this:
### 1. Data Contracts and Data Member... | 20,636 | [
{
"from": "human",
"value": "My project is split up into a typical 3 layer structure for a Silverlight app. That is:\n\nA base layer, which is a class library that contains all my business objects, logic, data access etc.\nA middle layer which is a WCF service which communicates with;\nMy Silverlight front ... |
I'm running my first project that I'm compiling with flex builder. Before I used to compile with flash or flash develop.
For a while it worked pretty neatly. But as soon as it start throwing typeerrors, I can't seem to compile the updated and saved actionscript files. It seems as if it keeps stuck in time and compiles ... | It sounds like you might be encountering issues with Flex Builder (now known as Adobe Flash Builder) not recognizing changes to your ActionScript files or possibly issues with the build process. Here are some steps you can take to troubleshoot and ensure your project compiles correctly:
1. **Clean and Build the Projec... | 22,037 | [
{
"from": "human",
"value": "I'm running my first project that I'm compiling with flex builder. Before I used to compile with flash or flash develop.\nFor a while it worked pretty neatly. But as soon as it start throwing typeerrors, I can't seem to compile the updated and saved actionscript files. It seems ... |
The way you would normally include a script is with "source"
eg:
main.sh:
#!/bin/bash
source incl.sh
echo "The main script"
incl.sh:
echo "The included script"
The output of executing "./main.sh" is:
The included script
The main script
... Now, if you attempt to execute that shell script from another location, it ... | To ensure that your script can always find the included script (like `incl.sh`) regardless of the current working directory, you can use a method that dynamically determines the path of the directory where the main script is located. This way, you can construct the full path to the include file based on the location of... | 23,785 | [
{
"from": "human",
"value": "The way you would normally include a script is with \"source\"\neg:\nmain.sh:\n#!/bin/bash\n\nsource incl.sh\n\necho \"The main script\"\n\nincl.sh:\necho \"The included script\"\n\nThe output of executing \"./main.sh\" is:\nThe included script\nThe main script\n\n... Now, if yo... |
How can I send an email from C++? Is there a good cross-platform (MS Windows, Linux etc) library that I can use? I'm using GCC (cygwin on MS Windows).
| To send an email from C++, you can use a variety of libraries that support cross-platform development. Here are a few options:
### 1. **libcurl**
libcurl is a widely used library for transferring data with URLs. It supports many protocols, including SMTP for sending emails. To use libcurl to send an email, you will ne... | 19,354 | [
{
"from": "human",
"value": "How can I send an email from C++? Is there a good cross-platform (MS Windows, Linux etc) library that I can use? I'm using GCC (cygwin on MS Windows).\n"
},
{
"from": "gpt",
"value": "To send an email from C++, you can use a variety of libraries that support cross-pl... |
I've seen some code where a Class is imported, instead of a namespace, making all the static members/methods of that class available. Is this a feature of VB? Or do other languages do this as well?
TestClass.vb
public class TestClass
public shared function Somefunc() as Boolean
return true
end functio... | What you're encountering in VB.NET is a feature that allows you to import specific classes, thereby making their shared (static) members and methods directly accessible without needing to qualify them with the class name. This behavior is specific to VB.NET and is not commonly found in many other programming languages.... | 24,828 | [
{
"from": "human",
"value": "I've seen some code where a Class is imported, instead of a namespace, making all the static members/methods of that class available. Is this a feature of VB? Or do other languages do this as well?\nTestClass.vb\npublic class TestClass\n public shared function Somefunc() as... |
I would like to access the Rails session secret programmatically (I am using it to generate a sign-on token).
Here's what I've come up with:
ActionController::Base.session.first[:secret]
This returns the session secret. However, every time you call ActionController::Base.session it adds another entry to an array so yo... | Accessing the session secret in Rails is a bit more nuanced than directly using `ActionController::Base.session`. The `ActionController::Base.session` method is intended for use in the context of handling sessions and, as you've noticed, leads to an accumulating array of session configurations.
Instead, you can access... | 23,744 | [
{
"from": "human",
"value": "I would like to access the Rails session secret programmatically (I am using it to generate a sign-on token).\nHere's what I've come up with:\nActionController::Base.session.first[:secret]\n\nThis returns the session secret. However, every time you call ActionController::Base.se... |
In our environment we have a Lib folder which contains various third party assemblies referenced by our projects. For example, Enterprise Libary and Elmah.
Sometimes a dev doesn't do a get latest on that folder. When the dev then loads a project which can't find the assembly in the expected folder, Visual Studio auto... | To prevent Visual Studio 2008 from automatically resolving references to assemblies when they are missing, you can try a few approaches. However, it's important to note that Visual Studio 2008 does not have a built-in setting to completely disable this behavior. Instead, consider the following strategies:
### 1. **Use... | 23,821 | [
{
"from": "human",
"value": "In our environment we have a Lib folder which contains various third party assemblies referenced by our projects. For example, Enterprise Libary and Elmah.\nSometimes a dev doesn't do a get latest on that folder. When the dev then loads a project which can't find the assembly ... |
In a project I am working on, we have an ongoing discussion amongst the dev team - should the production environment be deployed as a checkout from the SVN repository or as an export?
The development environment is obviously a checkout, since it is constantly updated.
For the production, I'm personally for checking out... | Your question raises important points about deployment strategies for a production environment, especially concerning the use of SVN (Subversion). Let's break down the considerations and explore some strategies.
### Checkout vs. Export
#### Checkout
- **Pros**:
- **Easy Updates**: As you mentioned, using a checkout... | 20,675 | [
{
"from": "human",
"value": "In a project I am working on, we have an ongoing discussion amongst the dev team - should the production environment be deployed as a checkout from the SVN repository or as an export?\nThe development environment is obviously a checkout, since it is constantly updated.\nFor the ... |
I'm checking for existing of a row in in_fmd, and the ISBN I look up can be the ISBN parameter, or another ISBN in a cross-number table that may or may not have a row.
select count(*)
from in_fmd i
where (description='GN')
and ( i.isbn in
(
select bwi_isbn from bw_isbn where orig_isbn = ?
union ... | To check for the existence of at least one row rather than counting the rows, you can use the `EXISTS` clause, which can be more efficient than counting. The `EXISTS` clause stops evaluating as soon as it finds the first matching row, making it generally faster when you're only interested in whether at least one row ex... | 25,318 | [
{
"from": "human",
"value": "I'm checking for existing of a row in in_fmd, and the ISBN I look up can be the ISBN parameter, or another ISBN in a cross-number table that may or may not have a row.\nselect count(*)\nfrom in_fmd i\nwhere (description='GN')\n and ( i.isbn in\n (\n select bwi_isbn ... |
I am interacting with an Oracle DB using SQL over an ODBC connection. Is there an SQL command I can use to get the MAC address of the server, or something that uniquely identifies the server hardware or software installation. This is so I can be sure (or at least fairly sure) that I'm talking to the same database all... | In Oracle databases, there is no built-in SQL command to directly retrieve the MAC address of the server or a unique identifier for the hardware. However, you can obtain some unique identifiers about the database instance and the host it runs on.
Here are a few options you might consider:
1. **Using `v$instance`:** ... | 22,225 | [
{
"from": "human",
"value": "I am interacting with an Oracle DB using SQL over an ODBC connection. Is there an SQL command I can use to get the MAC address of the server, or something that uniquely identifies the server hardware or software installation. This is so I can be sure (or at least fairly sure) ... |
I've been searching on SO on how to do i18n support on my little application...
I know that Microsoft offers 'culture' classes, but you have to re-compile your application to include any new string you add. So, all I'm trying to do is to put all my strings in a external file and offers users the choice to translate the... | For internationalization (i18n) in a C# application while allowing for external string resources that don't require recompilation, using resource files (.resx) can be cumbersome since you need to compile them. Instead, you can opt for simpler formats like JSON, XML, or INI files. Here, I’ll outline a basic approach usi... | 18,291 | [
{
"from": "human",
"value": "I've been searching on SO on how to do i18n support on my little application...\nI know that Microsoft offers 'culture' classes, but you have to re-compile your application to include any new string you add. So, all I'm trying to do is to put all my strings in a external file an... |
I am working on a web application and I have run into the following situation.
Dim a as Object
Dim i as Integer = 0
Try
For i=1 to 5
a = new Object()
'Do stuff '
a = Nothing
Next
Catch
Finally
a = Nothing
End Try
Do i need to do the a=Nothing in the loop or will the garbage... | In the context of your web application and the code snippet you provided, it's important to understand how memory management and garbage collection work in .NET.
### Explanation:
1. **Garbage Collection**: In .NET, the garbage collector (GC) is responsible for automatically reclaiming memory occupied by objects that ... | 23,504 | [
{
"from": "human",
"value": "I am working on a web application and I have run into the following situation.\nDim a as Object\nDim i as Integer = 0\n\nTry\n\n For i=1 to 5\n\n a = new Object()\n\n 'Do stuff '\n\n a = Nothing\n\n Next\n\nCatch\n\nFinally\n\n a = Nothing\n\nEnd Try... |
I have a single image with 9 different states and the appropriate background-position rules set up as classes to show the different states. I can't use the :hover pseudo-selector because the background image being changed is not the same element that is being hovered over. I have defined the classes this way:
#chooser_... | It looks like you're facing a peculiar issue with CSS background images not updating correctly in Internet Explorer 6, despite the class changes being correctly applied. Here are a few potential solutions and workarounds that you can try:
### 1. **Force Repaint**
IE6 can sometimes be finicky about rendering changes. O... | 21,041 | [
{
"from": "human",
"value": "I have a single image with 9 different states and the appropriate background-position rules set up as classes to show the different states. I can't use the :hover pseudo-selector because the background image being changed is not the same element that is being hovered over. I hav... |
What are ways to draw animations in C++? GDI+? OpenGL? Would you recommend a class pattern in particular to get the drawing and redrawing done?
Do you know of any open source project where animations are made so I can take a peek at the code?
Where would you start if you wanted to code geometrical animations? Do you k... | When it comes to drawing animations in C++, there are several graphics libraries and APIs you can use. Here are some common options:
### Graphics Libraries and APIs
1. **GDI+ (Windows)**:
- GDI+ is a part of the Windows API that allows for basic 2D graphics. It's suitable for simple animations but may not be ideal... | 20,855 | [
{
"from": "human",
"value": "What are ways to draw animations in C++? GDI+? OpenGL? Would you recommend a class pattern in particular to get the drawing and redrawing done? \nDo you know of any open source project where animations are made so I can take a peek at the code?\nWhere would you start if you want... |
I have a problem similar to the one found here : JSF selectItem label formatting.
What I want to do is to accept a double as a value for my and display it with two decimals. Can this be done in an easy way?
I've tried using but that seems to be applied on the value from the inputText that is sent to the server and ... | It looks like you've already found a solution to your problem with displaying a double value with two decimal places in a JSF input field using `<f:convertNumber>`. Just to clarify and provide a bit more context for others who might have a similar issue, here’s a brief explanation of how to use the `<f:convertNumber>` ... | 22,666 | [
{
"from": "human",
"value": "I have a problem similar to the one found here : JSF selectItem label formatting. \nWhat I want to do is to accept a double as a value for my and display it with two decimals. Can this be done in an easy way? \nI've tried using but that seems to be applied on the value from th... |
My current project uses NUnit for unit tests and to drive UATs written with Selenium. Developers normally run tests using ReSharper's test runner in VS.Net 2003 and our build box kicks them off via NAnt.
We would like to run the UAT tests in parallel so that we can take advantage of Selenium Grid/RCs so that they will... | Running Selenium tests in parallel and managing test execution across multiple browser environments can significantly improve the speed and efficiency of your test suite. Below are some suggestions and best practices to achieve this:
### 1. **Use Selenium Grid**
Using Selenium Grid is a great way to run tests in para... | 20,808 | [
{
"from": "human",
"value": "My current project uses NUnit for unit tests and to drive UATs written with Selenium. Developers normally run tests using ReSharper's test runner in VS.Net 2003 and our build box kicks them off via NAnt.\nWe would like to run the UAT tests in parallel so that we can take advant... |
I have found that there is generally a singe type or namespace that takes in any particular enum as a parameter and as a result I have always defined those enums there. Recently though, I had a co-worker make a big deal about how that was a stupid thing to do, and you should always have an enum namespace at the root of... | The best place to locate enum types in a project can depend on various factors, including the size and structure of the project, team conventions, and how the enums are used. Here are a few considerations to help you determine the best placement:
1. **Related to Functionality**: If an enum is closely related to a spec... | 21,440 | [
{
"from": "human",
"value": "I have found that there is generally a singe type or namespace that takes in any particular enum as a parameter and as a result I have always defined those enums there. Recently though, I had a co-worker make a big deal about how that was a stupid thing to do, and you should alw... |
I created an app for a small business. Some of the employees in the office can not see the form correctly. The reason is they have their DPI setting set to above 96dpi. Does anybody know of a way to control this?
For all of you who have experience with winforms apps, how do you control your form layout so that DPI do... | When developing WinForms applications, it's essential to ensure that your application displays correctly across different DPI settings. Here are several strategies you can use to manage DPI scaling and improve your application's appearance on high-DPI displays:
### 1. DPI Awareness:
Set your application to be DPI-awar... | 18,602 | [
{
"from": "human",
"value": "I created an app for a small business. Some of the employees in the office can not see the form correctly. The reason is they have their DPI setting set to above 96dpi. Does anybody know of a way to control this?\nFor all of you who have experience with winforms apps, how do y... |
Currently we have a table that we use to track inivitations. We have an email field that is indexed but we also have three optional keys that the user can specify when adding new record emails. We don't allow duplicates so we have to query if the email plus the optional keys already exists. Currently the keys are only ... | When considering the addition of indexes in a database, especially with optional fields like the keys you're dealing with, there are several factors to weigh regarding performance:
### Option 1: Create Multiple Indexes
Creating separate indexes for each combination of email and the keys (like `email, key1`, `email, ke... | 21,702 | [
{
"from": "human",
"value": "Currently we have a table that we use to track inivitations. We have an email field that is indexed but we also have three optional keys that the user can specify when adding new record emails. We don't allow duplicates so we have to query if the email plus the optional keys alr... |
I've looked at the java documentation and scoured the net for information on java's support for international characters with specific fonts (such as Monospace), but haven't been able to get a clear concrete answer.
There has been a change between java 1.4 and java 1.5/1.6. For example, in java 1.4 if you set the font ... | Java's support for international characters has evolved over different versions, particularly from Java 1.4 to Java 1.5 and 1.6. Here’s a summary of the changes and improvements, as well as where to find relevant documentation:
### Key Changes
1. **Font Rendering Improvements**:
- In Java 1.4, the handling of int... | 21,713 | [
{
"from": "human",
"value": "I've looked at the java documentation and scoured the net for information on java's support for international characters with specific fonts (such as Monospace), but haven't been able to get a clear concrete answer.\nThere has been a change between java 1.4 and java 1.5/1.6. For... |
I have several long running report type transactions that take 5-10 minutes. Would I see any performance increase by using stored procs? Would it be significant?
each query runs once a night.
| Using stored procedures can provide some performance benefits, especially for long-running report-type transactions, but the magnitude of the performance improvement may vary based on several factors. Here are some key points to consider:
### Benefits of Using Stored Procedures:
1. **Reduced Network Traffic**: With s... | 22,958 | [
{
"from": "human",
"value": "I have several long running report type transactions that take 5-10 minutes. Would I see any performance increase by using stored procs? Would it be significant?\neach query runs once a night.\n"
},
{
"from": "gpt",
"value": "Using stored procedures can provide some ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.