instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I'm trying to speed up a data load which is controlled via a PL/SQL stored procedure. I've programmatically altered the indexes for the table I want to refresh to be unusable. I want Oracle to ignore these unusable indexes. I can issue the statement:
ALTER SESSION SET skip_unusable_indexes = TRUE
but I subsequently ... | In Oracle, the `ALTER SESSION SET skip_unusable_indexes = TRUE;` setting is effective for certain operations, such as when Oracle is building or updating indexes. However, when you're performing data manipulation that directly affects a table with unusable indexes, you might still encounter the `ORA-01502` error, as th... | 28,837 | [
{
"from": "human",
"value": "I'm trying to speed up a data load which is controlled via a PL/SQL stored procedure. I've programmatically altered the indexes for the table I want to refresh to be unusable. I want Oracle to ignore these unusable indexes. I can issue the statement:\nALTER SESSION SET skip_un... |
My application runs under CF 2.0 locally and i would like to know how to connect and send something to print in the embedded printer of a http://www.milliontech.com/home/content/view/195/95/'>Bluebird BIP-1300 device.
Ideally i would like an example in C#.
Thank you in advance.
| To connect and send print commands to the embedded printer of a Bluebird BIP-1300 device using C#, you typically would utilize the printer's specific SDK or API documentation. However, many thermal printers, including those used in mobile devices like the Bluebird BIP-1300, accept commands based on the ESC/POS command ... | 21,507 | [
{
"from": "human",
"value": "My application runs under CF 2.0 locally and i would like to know how to connect and send something to print in the embedded printer of a http://www.milliontech.com/home/content/view/195/95/'>Bluebird BIP-1300 device.\nIdeally i would like an example in C#.\nThank you in advance... |
I am trying to fix a bug with SSL in a product and noticed that although the code sets SSL to be true, in the next line in the code SSL is still at false. I wrote a unit test for this and the unit test confirms my suspicions.
[TestMethod]
public void SecureSocketLayerSetToTrue( )
{
var ldapConnection = new ... | The issue you're encountering might stem from how the `SecureSocketLayer` property is implemented in the `LdapConnection` class. The property could be getting reset or not correctly reflected after you set it, possibly due to the order of operations or the implementation details of the `SessionOptions` object.
Here ar... | 29,832 | [
{
"from": "human",
"value": "I am trying to fix a bug with SSL in a product and noticed that although the code sets SSL to be true, in the next line in the code SSL is still at false. I wrote a unit test for this and the unit test confirms my suspicions. \n [TestMethod]\n public void SecureSocketLayerSetT... |
Why would someone want to use a linked-list over an array?
Coding a linked-list is, no doubt, a bit more work than using an array and one may wonder what would justify the additional effort.
I think insertion of new elements is trivial in a linked-list but it's a major chore in an array. Are there other advantages to u... | You’re correct that linked lists can offer several advantages over arrays, and while coding them may require more effort, there are specific scenarios where their use is justified. Here are some advantages of using linked lists over arrays:
1. **Dynamic Size**: Linked lists can grow and shrink in size as needed. This ... | 22,555 | [
{
"from": "human",
"value": "Why would someone want to use a linked-list over an array?\nCoding a linked-list is, no doubt, a bit more work than using an array and one may wonder what would justify the additional effort.\nI think insertion of new elements is trivial in a linked-list but it's a major chore i... |
I keep reading that, in C, using pointer arithmetic is generally faster than subscripting for array access. Is this true even with modern (supposedly-optimizing) compilers?
If so, is this still the case as I begin to move away from learning C into Objective-C and Cocoa on Macs?
Which is the preferred coding style for a... | The idea that pointer arithmetic is faster than array subscripting in C has its roots in the way compilers translate both forms of access. However, modern optimizing compilers are quite adept at recognizing both forms of array access and optimizing them to produce very similar (if not identical) machine code. This mean... | 28,929 | [
{
"from": "human",
"value": "I keep reading that, in C, using pointer arithmetic is generally faster than subscripting for array access. Is this true even with modern (supposedly-optimizing) compilers?\nIf so, is this still the case as I begin to move away from learning C into Objective-C and Cocoa on Macs?... |
I'd like to track down a possible bug in Visual Studio, but that's awfully hard without the debug symbols for Visual Studio itself. Does Microsoft make these available?
| Yes, Microsoft provides debug symbols for its Visual Studio products. These symbols can be quite helpful for diagnosing issues, including bugs, as they allow you to see the function names and variable names associated with the binary code.
To access the symbols, you can:
1. **Use Microsoft Symbol Server**: Visual Stu... | 31,373 | [
{
"from": "human",
"value": "I'd like to track down a possible bug in Visual Studio, but that's awfully hard without the debug symbols for Visual Studio itself. Does Microsoft make these available?\n"
},
{
"from": "gpt",
"value": "Yes, Microsoft provides debug symbols for its Visual Studio produ... |
I am having an ASP.net Membership I need to verify the User Question and Answer.
I dont need to use Password Because its Hashed we cannot validate it
MembershipUser msUser = Membership.GetUser("Rasel");
thanks,
Lalithambigai
| To verify a user's question and answer in an ASP.NET Membership application, you can utilize the `MembershipUser` object. However, the Membership provider typically stores the security question and answer in a hashed format, which means you cannot directly validate the answer unless you hash the input answer and compar... | 28,315 | [
{
"from": "human",
"value": "I am having an ASP.net Membership I need to verify the User Question and Answer.\nI dont need to use Password Because its Hashed we cannot validate it\nMembershipUser msUser = Membership.GetUser(\"Rasel\");\nthanks,\nLalithambigai\n"
},
{
"from": "gpt",
"value": "To ... |
I have a few databases that I always use SQL Server Management Studio with. I'd like to be able to create a toolbar button or keyboard shortcut that automatically opens a new query window (in the current SSMS instance) and connects to a given (registered, perhaps) database. That's it. That's all I need. And this ash... | Creating a custom toolbar button or keyboard shortcut in SQL Server Management Studio (SSMS) to open a new query window and connect directly to a specific database is a bit tricky since SSMS doesn't have a built-in feature to create such shortcuts directly. However, you can achieve your goal through a combination of us... | 25,158 | [
{
"from": "human",
"value": "I have a few databases that I always use SQL Server Management Studio with. I'd like to be able to create a toolbar button or keyboard shortcut that automatically opens a new query window (in the current SSMS instance) and connects to a given (registered, perhaps) database. Tha... |
How would you model booked hotel room to guests relationship (in PostgreSQL, if it matters)? A room can have several guests, but at least one.
Sure, one can relate guests to bookings with a foreign key booking_id. But how do you enforce on the DBMS level that a room must have at least one guest?
May be it's just imposs... | In a relational database like PostgreSQL, enforcing that a hotel room must have at least one guest can be a bit tricky since standard foreign key constraints do not allow you to enforce a minimum count of related records in another table.
However, you can implement this logic using a combination of design choices and ... | 26,422 | [
{
"from": "human",
"value": "How would you model booked hotel room to guests relationship (in PostgreSQL, if it matters)? A room can have several guests, but at least one.\nSure, one can relate guests to bookings with a foreign key booking_id. But how do you enforce on the DBMS level that a room must have a... |
I'm using the SqlMembershipProvider to carry out my ASP.NET website's user management. In particular, the site needs to be multi-lingual (globalized!).
When I create users using Membership.CreateUser it's good that I get exceptions for things like duplicate emails, duplicate usernames etc. But what I want is to re-use ... | The .NET Framework does support globalization, but not all exception messages are localized, including those generated by the `Membership.CreateUser` method. The default exception messages thrown by `SqlMembershipProvider` may not be localized even if you have the appropriate language pack installed.
Here are some ste... | 27,995 | [
{
"from": "human",
"value": "I'm using the SqlMembershipProvider to carry out my ASP.NET website's user management. In particular, the site needs to be multi-lingual (globalized!).\nWhen I create users using Membership.CreateUser it's good that I get exceptions for things like duplicate emails, duplicate us... |
What is the best way to implement the page view counter like the ones they have here on the site where each question has a "Views" counter?
Factoring in Performance and Scalability issues.
| Implementing a page view counter requires careful consideration of performance and scalability to ensure it can handle a large volume of traffic without becoming a bottleneck. Here’s a step-by-step guide on how to achieve this effectively:
### 1. Database Design
#### a. Schema
You can create a simple table to store v... | 27,991 | [
{
"from": "human",
"value": "What is the best way to implement the page view counter like the ones they have here on the site where each question has a \"Views\" counter?\nFactoring in Performance and Scalability issues.\n"
},
{
"from": "gpt",
"value": "Implementing a page view counter requires ... |
I have a web application that has many faces and so far I've implemented this through creating themes. A theme is a set of html, css and images to be used with the common back end.
Things are laid out like so:
code/
themes/theme1
themes/theme2
And each instance of the web application has a configuration file that sta... | Your situation is fairly common when developing web applications with multiple themes or variations, and it can indeed become complex when you start having to manage both front-end and back-end differences. Here are some strategies to consider for organizing your application and handling the code effectively:
### Dire... | 27,079 | [
{
"from": "human",
"value": "I have a web application that has many faces and so far I've implemented this through creating themes. A theme is a set of html, css and images to be used with the common back end.\nThings are laid out like so:\ncode/\nthemes/theme1\nthemes/theme2\n\nAnd each instance of the we... |
I am trying to start WebLogic within Eclipse
When it starts it complains like this.
Unable to load performance pack. Using Java I/O instead. Please ensure that wlntio.dll is in: 'C:\bea81\jdk142_04\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\bea81\jdk142_04\jre\bin;C:\Program Files\Java\jre1.6.0\bin\client;C:\Program Files... | The error message you're encountering indicates that WebLogic Server is trying to load a native performance pack DLL file (`wlntio.dll`), but it is unable to find it in the specified paths. This issue is often related to the configuration of your WebLogic installation or environment.
Here are some steps you can take t... | 27,743 | [
{
"from": "human",
"value": "I am trying to start WebLogic within Eclipse\nWhen it starts it complains like this.\nUnable to load performance pack. Using Java I/O instead. Please ensure that wlntio.dll is in: 'C:\\bea81\\jdk142_04\\bin;.;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\bea81\\jdk142_04\\jre\\bin;C:\\P... |
So, I have a form in VB which is visible except when the program is started silently, in which case the form is still loaded but the interactions are done programmatically. However, in a tiny number of cases I want forms created within the invisible form to be visible. What is the best way to accomplish this, ideally... | It sounds like you're facing a challenging problem regarding the visibility and reusability of UI components in a VB application. Here are a few ideas to consider that might help strike a balance between maintaining clean code and avoiding unnecessary complexity:
1. **Modal Forms**: Instead of making the entire form v... | 30,197 | [
{
"from": "human",
"value": "So, I have a form in VB which is visible except when the program is started silently, in which case the form is still loaded but the interactions are done programmatically. However, in a tiny number of cases I want forms created within the invisible form to be visible. What is... |
I'm having problems with Iterator.remove() called on a HashSet.
I've a Set of time stamped objects. Before adding a new item to the Set, I loop through the set, identify an old version of that data object and remove it (before adding the new object). the timestamp is included in hashCode and equals(), but not equalsD... | It sounds like you’ve already made significant progress in debugging the issue. The core of the problem seems to be related to the mutability of the objects involved in your `HashSet`, specifically with the `DataResult` object and possibly its internal state or a referenced object.
From your description, the `DataResu... | 30,396 | [
{
"from": "human",
"value": "I'm having problems with Iterator.remove() called on a HashSet.\nI've a Set of time stamped objects. Before adding a new item to the Set, I loop through the set, identify an old version of that data object and remove it (before adding the new object). the timestamp is included... |
I have an MSDE2000 database which appears to be approaching it's 2Gb limit.
What tools can I use to determine where all the space is being used?
Ideally think TreesizePro for SQL Databases
| To analyze the space usage of your MSDE2000 (Microsoft SQL Server Desktop Engine) database, you can use several tools and techniques to get insights similar to what TreeSize Pro offers for file systems. Here are some options to help you determine where the space is being used in your database:
### 1. **SQL Server Mana... | 25,250 | [
{
"from": "human",
"value": "I have an MSDE2000 database which appears to be approaching it's 2Gb limit.\nWhat tools can I use to determine where all the space is being used?\nIdeally think TreesizePro for SQL Databases\n"
},
{
"from": "gpt",
"value": "To analyze the space usage of your MSDE2000... |
I am having problems converting a string in the format "yyyy-MM-ddZ" using VB.net.
For example I have the string "2007-10-21Z".
Using CDate or TryParse it comes out to 10/20/2007 instead of 10/21/2007.
I'm not understanding how the Z affects the date string so that when it is parsed it results in the day before.
From w... | In the context of date and time representation, the "Z" at the end of the string "2007-10-21Z" indicates that the date is in UTC (Coordinated Universal Time) format. When you attempt to convert this string to a date using functions like `CDate` or `DateTime.TryParse`, it is interpreting the date as being in UTC but the... | 26,706 | [
{
"from": "human",
"value": "I am having problems converting a string in the format \"yyyy-MM-ddZ\" using VB.net.\nFor example I have the string \"2007-10-21Z\".\nUsing CDate or TryParse it comes out to 10/20/2007 instead of 10/21/2007.\nI'm not understanding how the Z affects the date string so that when i... |
I've created an Entity Data Model and imported several stored procedures as Function Imports. I'm exposing the EDM through ADO.NET Data Services (ANDS). Does ANDS automatically expose the functions through its REST API, or do I need to manually add operations to the service?
| When you expose an Entity Data Model (EDM) through ADO.NET Data Services (ANDS), the stored procedures that you imported as Function Imports are not automatically exposed as REST API endpoints.
To expose these function imports through the REST API, you need to manually add operations to the service. You do this by mo... | 31,944 | [
{
"from": "human",
"value": "I've created an Entity Data Model and imported several stored procedures as Function Imports. I'm exposing the EDM through ADO.NET Data Services (ANDS). Does ANDS automatically expose the functions through its REST API, or do I need to manually add operations to the service?\n... |
I have a java webapp that has to be deployed on either Win or Linux machines. I now want to add log4j for logging and I'd like to use a relative path for the log file as I don't want to change the file path on every deployment. The container will most likely be Tomcat but not necessarily.
What's the best way of doing t... | Using Log4j in a Java web application deployed on different operating systems and environments is a common requirement. To set up Log4j with a relative path for your log files, you can follow these steps:
### 1. Add Log4j Dependency
Make sure to include Log4j in your project. If you're using Maven, you can add the fo... | 21,827 | [
{
"from": "human",
"value": "I have a java webapp that has to be deployed on either Win or Linux machines. I now want to add log4j for logging and I'd like to use a relative path for the log file as I don't want to change the file path on every deployment. The container will most likely be Tomcat but not ne... |
Where I can download sample database which can be used for data warehouse creation? It should't be sample from Microsoft (Northwind etc.).
EDIT: Sorry for not clarifying my question. At my university we have class where we must create some data warehouse and since Northwind is so popular over net then professor told us... | If you're looking for sample databases other than Microsoft's Northwind for your data warehouse project, there are several options available:
1. **AdventureWorks**: Although this is another Microsoft sample database, it is more complex and realistic than Northwind. You can find it on the official Microsoft GitHub repo... | 30,082 | [
{
"from": "human",
"value": "Where I can download sample database which can be used for data warehouse creation? It should't be sample from Microsoft (Northwind etc.).\nEDIT: Sorry for not clarifying my question. At my university we have class where we must create some data warehouse and since Northwind is ... |
I am writing a console application which makes use of the F1 key (for help). Unfortunately, while Konsole (of KDE) doesn't use this key, Gnome Terminal does, so the F1 key becomes inaccessible to my application. I don't think there's a way to detect whether the F1 key is already mapped in the GUI side of things (Gnom... | Detecting whether your Ruby application is running inside a Gnome Terminal can be achieved through a couple of different methods. Below are some approaches you can take, primarily focusing on environment variables and process details.
### Method 1: Check the `TERM` Environment Variable
Gnome Terminal usually sets the... | 30,212 | [
{
"from": "human",
"value": "I am writing a console application which makes use of the F1 key (for help). Unfortunately, while Konsole (of KDE) doesn't use this key, Gnome Terminal does, so the F1 key becomes inaccessible to my application. I don't think there's a way to detect whether the F1 key is alrea... |
Can an abstract class have a constructor?
If so, how can it be used and for what purposes?
| Yes, an abstract class can have a constructor. In object-oriented programming, an abstract class is a class that cannot be instantiated directly and is intended to be a base class for other classes. The primary purpose of an abstract class is to provide a common interface and some shared functionality for its subclasse... | 27,631 | [
{
"from": "human",
"value": "Can an abstract class have a constructor?\nIf so, how can it be used and for what purposes?\n"
},
{
"from": "gpt",
"value": "Yes, an abstract class can have a constructor. In object-oriented programming, an abstract class is a class that cannot be instantiated direct... |
Is it possible to restore a backup of a SQL Server 2005 database onto an instance of SQL Server 2008?
I need to rebuild a server as it's getting rather crufty, so I plan to take this opportunity to upgrade to SQL 2008 and wondered if I'll be able to restore my backups OK.
| Yes, it is possible to restore a backup of a SQL Server 2005 database onto an instance of SQL Server 2008. SQL Server 2008 is designed to support backward compatibility, which means it can handle backups from earlier versions, including SQL Server 2005.
Here are a few points to keep in mind:
1. **Backup Compatibility... | 30,193 | [
{
"from": "human",
"value": "Is it possible to restore a backup of a SQL Server 2005 database onto an instance of SQL Server 2008?\nI need to rebuild a server as it's getting rather crufty, so I plan to take this opportunity to upgrade to SQL 2008 and wondered if I'll be able to restore my backups OK.\n"
... |
Anyone have an idea of what this means for MS SQL Server? I'm also calling this from ColdFusion, although I'm guessing that doesn't make any difference.
| It seems like you might be referring to a specific issue or error related to MS SQL Server and ColdFusion, but you haven't provided the exact context or details of the problem you're facing.
To better assist you, please provide:
1. **Error Message or Issue Description**: Any specific error messages you're encounteri... | 32,609 | [
{
"from": "human",
"value": "Anyone have an idea of what this means for MS SQL Server? I'm also calling this from ColdFusion, although I'm guessing that doesn't make any difference.\n"
},
{
"from": "gpt",
"value": "It seems like you might be referring to a specific issue or error related to MS ... |
I'm using IXMLDOM in MSXML 6 to build an XML file in a C++ MFC application. Is there a way to see the contents of the xml document while it is in memory?
For example, an XPATH query is failing about halfway through creating the file. How would I view the entire contents of the xml doc?
Thanks!
| In your C++ MFC application, you can use the MSXML library to create and manipulate XML documents. To view the contents of an `IXMLDOMDocument` in memory, you can serialize the document to a string or output it to a file. Here's how you can do this:
### Method 1: Output to a String
You can use the `IXMLDOMDocument::s... | 28,371 | [
{
"from": "human",
"value": "I'm using IXMLDOM in MSXML 6 to build an XML file in a C++ MFC application. Is there a way to see the contents of the xml document while it is in memory? \nFor example, an XPATH query is failing about halfway through creating the file. How would I view the entire contents of ... |
I run a small php/mysql website for a camera club where users can upload photos. I have recently started storing email addresses for doing password resets.
My question is what is the best practice for dealing with users' personal information: are there any laws/legislation regarding what I can do with personal informa... | When handling personal information, especially in the context of a website that stores email addresses and potentially other personal data, it is essential to understand and comply with applicable privacy laws and regulations. Here are key points to consider:
### 1. Data Protection Laws
Depending on your location and ... | 28,804 | [
{
"from": "human",
"value": "I run a small php/mysql website for a camera club where users can upload photos. I have recently started storing email addresses for doing password resets. \nMy question is what is the best practice for dealing with users' personal information: are there any laws/legislation reg... |
How can I make my std::fstream object start reading a text file from the second line?
| To start reading a text file from the second line using an `std::fstream` object in C++, you can follow these steps:
1. Open the file using `std::fstream`.
2. Read and discard the first line.
3. Start reading from the second line.
Here's a simple code example demonstrating this process:
```cpp
#include <iostream>
#i... | 29,538 | [
{
"from": "human",
"value": "How can I make my std::fstream object start reading a text file from the second line?\n"
},
{
"from": "gpt",
"value": "To start reading a text file from the second line using an `std::fstream` object in C++, you can follow these steps:\n\n1. Open the file using `std:... |
I am using ASP.NET to transmit a .jar file. This code works perfectly on IE. However on Firefox the file downloads, corrupt. What is the best way to fix it? Below is the code I am using.
private void TransferFile()
{
try
{
string filePath = Server.MapPath("SomeJarFIle.jar");
FileInfo file =... | When you experience issues with file downloads that work fine in Internet Explorer but appear corrupted in Firefox, it's often related to how the response is being constructed, particularly when it comes to content disposition and content type headers. Here are several approaches you can take to troubleshoot and fix th... | 27,534 | [
{
"from": "human",
"value": "I am using ASP.NET to transmit a .jar file. This code works perfectly on IE. However on Firefox the file downloads, corrupt. What is the best way to fix it? Below is the code I am using.\nprivate void TransferFile()\n{\n try\n {\n string filePath = Server.MapPat... |
I don't know how much information you need for this, but WP-ContactForm-7 is a contact form for WordPress. By default it has one server response message for all forms on the website. I have multiple forms and would like a different server response messages for each one.
How can I create different server response messag... | To customize the server response messages for different forms when using the WP Contact Form 7 plugin in WordPress, you'll need to modify the way the plugin handles responses based on each form's unique identifier.
Here’s a step-by-step approach to accomplish this:
### Step 1: Create Custom Messages
First, define t... | 27,970 | [
{
"from": "human",
"value": "I don't know how much information you need for this, but WP-ContactForm-7 is a contact form for WordPress. By default it has one server response message for all forms on the website. I have multiple forms and would like a different server response messages for each one.\nHow can... |
This article gives a good overview on why structured exception handling is bad. Is there a way to get the robustness of stopping your server from crashing, while getting past the problems mentioned in the article?
I have a server software that runs about 400 connected users concurrently. But if there is a crash all 4... | It sounds like you're facing a challenging problem with your server software. It's crucial to ensure robustness and reliability while minimizing the impact of errors on your users. Here are several strategies you can consider to improve the situation:
### 1. **Isolation and Process Separation**
- **Microservices Archi... | 29,721 | [
{
"from": "human",
"value": "This article gives a good overview on why structured exception handling is bad. Is there a way to get the robustness of stopping your server from crashing, while getting past the problems mentioned in the article?\nI have a server software that runs about 400 connected users co... |
I am using an ASP page where I have to read a CSV file and insert it into DB table "Employee". I am creating an object of TestReader. How can I write a loop to execute up to the number of rows/records of the CSV file which is being read?
| To read a CSV file in an ASP page and insert the data into a database table named "Employee," you'll first need to read the CSV file, parse its content, and then execute a loop to insert each row into the database.
Below is a sample code snippet to demonstrate how to read a CSV file, assuming you have a `TestReader` o... | 26,035 | [
{
"from": "human",
"value": "I am using an ASP page where I have to read a CSV file and insert it into DB table \"Employee\". I am creating an object of TestReader. How can I write a loop to execute up to the number of rows/records of the CSV file which is being read?\n"
},
{
"from": "gpt",
"val... |
Anyone have a good resource or provide a sample of a natural order sort in C# for an FileInfo array? I am implementing the IComparer interface in my sorts.
| Certainly! If you want to perform a natural order sort on an array of `FileInfo` objects in C#, you can implement the `IComparer<FileInfo>` interface. Natural sorting means that it sorts in a way that humans typically expect, which takes into account both numerical and alphabetical order.
Below is an example of how yo... | 25,724 | [
{
"from": "human",
"value": "Anyone have a good resource or provide a sample of a natural order sort in C# for an FileInfo array? I am implementing the IComparer interface in my sorts.\n"
},
{
"from": "gpt",
"value": "Certainly! If you want to perform a natural order sort on an array of `FileIn... |
I have an abstract generic class BLL<T> where T : BusinessObject. I need to open an assembly that contains a set of concrete BLL classes, and return the tuples (businessObjectType, concreteBLLType) inside a Dictionary. There is the part of the method I could do until now, but I'm having problems to discover T.
protecte... | To determine the type parameter `T` from your generic class `BLL<T>` within your `DefineBLLs` method, you need to look at the generic type definitions of the `Type` instance you are iterating over. Specifically, you can use the `GetGenericArguments` method.
Here's how you can modify your `DefineBLLs` method to extrac... | 29,133 | [
{
"from": "human",
"value": "I have an abstract generic class BLL<T> where T : BusinessObject. I need to open an assembly that contains a set of concrete BLL classes, and return the tuples (businessObjectType, concreteBLLType) inside a Dictionary. There is the part of the method I could do until now, but I'... |
Been having a "heated debate" with a colleague about his practice of wrapping most of his functions in a try/catch but the catch has JUST a "throw" in it e.g.
Private sub foo()
try
'Do something'
catch
throw 'And nothing else!'
End Try
End Sub
My thought was to not even bother (assuming you... | You're raising a good point about the use of try/catch blocks in your colleague's code, especially when they are wrapped around code that simply throws the exception again without any additional context or handling. Here are some considerations regarding this practice:
### 1. **Purpose of Try/Catch**
- **Error Hand... | 26,166 | [
{
"from": "human",
"value": "Been having a \"heated debate\" with a colleague about his practice of wrapping most of his functions in a try/catch but the catch has JUST a \"throw\" in it e.g.\nPrivate sub foo()\n try\n 'Do something'\n catch\n throw 'And nothing else!'\n End Try\nEnd ... |
I am looking at using a custom template for a set of categories. Is it possible to use a category template (like category-4.php) on a parent category and have the children use that template as well?
So based on the answer so far, is there a way to accomplish this? I want to add text and images to all categories within ... | Yes, it is possible to create a custom category template in WordPress that applies to both a parent category and all its child categories, but it requires a bit of custom coding. Here’s how you can achieve this:
### Step 1: Create a Custom Category Template
1. **Create a Template File**:
- Create a template file i... | 20,858 | [
{
"from": "human",
"value": "I am looking at using a custom template for a set of categories. Is it possible to use a category template (like category-4.php) on a parent category and have the children use that template as well?\nSo based on the answer so far, is there a way to accomplish this? I want to add... |
I'm trying to create a TCP connection and send/read data that uses SSL, but I haven't been able to successfully accomplish this.
What I'd like to do is something like this:
TcpClient _tcpClient = new TcpClient("host", 110);
BinaryReader reader =
new BinaryReader(new System.Net.Security.SslStream(_tcpCl... | To create a secure TCP connection using SSL/TLS in C#, you need to ensure that you correctly wrap the network stream with an `SslStream`. The key point here is that `SslStream` does not directly support `BinaryReader` as a constructor parameter. Instead, you'll first need to authenticate the server and then create a `S... | 26,076 | [
{
"from": "human",
"value": "I'm trying to create a TCP connection and send/read data that uses SSL, but I haven't been able to successfully accomplish this.\nWhat I'd like to do is something like this:\n TcpClient _tcpClient = new TcpClient(\"host\", 110);\n\n BinaryReader reader = \n new Binar... |
When you create an instance of a class with the new operator, memory gets allocated on the heap. When you create an instance of a struct with the new operator where does the memory get allocated, on the heap or on the stack ?
| When you create an instance of a struct using the `new` operator in languages like C# or C++, memory is allocated on the heap, just like when you create an instance of a class with `new`.
Here's a quick comparison:
- **Classes**: When you create a class instance with `new`, the memory for the instance is allocated o... | 26,219 | [
{
"from": "human",
"value": "When you create an instance of a class with the new operator, memory gets allocated on the heap. When you create an instance of a struct with the new operator where does the memory get allocated, on the heap or on the stack ?\n"
},
{
"from": "gpt",
"value": "When you... |
I have a JSP that allows users to dynamically create additional form fields to create multiple objects. Perhaps I want to allow users to be able to submit as many line items as they want when submitting an invoice form.
How do I create a Struts 2 Action that will be able to take in an ArrayList populated with objects c... | To handle dynamic form fields in Struts 2, you can use a combination of Java classes to represent the objects being submitted, an action class to process the request, and JSP/HTML to generate the form. Here’s a step-by-step guide to creating a Struts 2 Action that will accept an `ArrayList` of objects populated with da... | 17,226 | [
{
"from": "human",
"value": "I have a JSP that allows users to dynamically create additional form fields to create multiple objects. Perhaps I want to allow users to be able to submit as many line items as they want when submitting an invoice form.\nHow do I create a Struts 2 Action that will be able to tak... |
I know about SortedSet, but in my case I need something that implements List, and not Set. So is there an implementation out there, in the API or elsewhere?
It shouldn't be hard to implement myself, but I figured why not ask people here first?
| If you're looking for a data structure that maintains order like a `SortedSet` but implements the `List` interface, you can consider using the `java.util.TreeMap` or `java.util.TreeSet` in combination with a `List`. However, there is no direct implementation in the Java standard library that behaves exactly like a sort... | 28,252 | [
{
"from": "human",
"value": "I know about SortedSet, but in my case I need something that implements List, and not Set. So is there an implementation out there, in the API or elsewhere?\nIt shouldn't be hard to implement myself, but I figured why not ask people here first?\n"
},
{
"from": "gpt",
... |
Ok, the more I use LINQ, the more I like it! I recently found myself working in some legacy code at work. It is your classic DataSet and DataTable rich application. Well, when adding a bit of functionality I found myself really wanting to just query the rows of a DataTable for the results I was looking for.
Let me repe... | It's great to hear that you're enjoying LINQ! Your instincts about its readability and expressiveness in querying collections, including `DataTable` and `DataRow`, are spot on. Let's break down the advantages and considerations of using LINQ in the context of legacy code with `DataSet` and `DataTable`.
### Advantages ... | 29,177 | [
{
"from": "human",
"value": "Ok, the more I use LINQ, the more I like it! I recently found myself working in some legacy code at work. It is your classic DataSet and DataTable rich application. Well, when adding a bit of functionality I found myself really wanting to just query the rows of a DataTable for t... |
I have a very painful library which, at the moment, is accepting a C# string as a way to get arrays of data; apparently, this makes marshalling for pinvokes easier.
So how do I make a ushort array into a string by bytes? I've tried:
int i;
String theOutData = "";
ushort[] theImageData = inImageData.DataArray;
//thi... | To convert a `ushort[]` array into a `string` representation by bytes efficiently in C#, rather than using string concatenation (which is slow because strings are immutable in .NET), you can use a `StringBuilder` to build the string more efficiently. However, if you need the string to represent the byte values directly... | 30,036 | [
{
"from": "human",
"value": "I have a very painful library which, at the moment, is accepting a C# string as a way to get arrays of data; apparently, this makes marshalling for pinvokes easier. \nSo how do I make a ushort array into a string by bytes? I've tried:\nint i;\nString theOutData = \"\";\nushort... |
I have been experimenting with Lambda expressions in Oxygene. Very simple recursive lambda expression to calculate a fibonacci number :
var fib : Func<int32, int32>;
fib := n -> iif(n > 1, fib(n - 1) + fib(n - 2), n);
fib(3);
When I run this code I get a nullreferenceexception. Any ideas as to what I'm doing wrong?
| The issue you're encountering is due to the fact that the recursive lambda expression cannot reference itself directly, as it's not fully defined at the point where it tries to use itself. In Oxygene (which is a variant of Object Pascal), lambda expressions are treated as closures, but they do not have a name until the... | 29,896 | [
{
"from": "human",
"value": "I have been experimenting with Lambda expressions in Oxygene. Very simple recursive lambda expression to calculate a fibonacci number :\nvar fib : Func<int32, int32>;\nfib := n -> iif(n > 1, fib(n - 1) + fib(n - 2), n);\nfib(3);\n\nWhen I run this code I get a nullreferenceexcep... |
The HR department at the company that I am currently working for has requested that I provide a system for storing employee social security numbers in our company database. The reason for this is to streamline payroll completion, as we use in-house software for employee timesheets but have to integrate with third-party... | Storing sensitive information like Social Security Numbers (SSNs) requires careful consideration of security practices to minimize the risk of data breaches and unauthorized access. Here are some best practices and recommendations for securely storing SSNs:
### 1. **Use Strong Encryption:**
- **AES (Advanced Encryp... | 26,501 | [
{
"from": "human",
"value": "The HR department at the company that I am currently working for has requested that I provide a system for storing employee social security numbers in our company database. The reason for this is to streamline payroll completion, as we use in-house software for employee timeshee... |
I get a "UUID mismatch" warning at the console when I try to build and run my app on my iPhone.
warning: UUID mismatch detected with
the loaded library - on disk is:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk/usr/lib/liblockdown.dylib
=uuid-mismatch-with-loaded-file,file="/Developer/Pl... | The "UUID mismatch" warning you're encountering generally indicates that there is a discrepancy between the UUIDs of the debug symbols of a library (in this case, `liblockdown.dylib`) that is currently loaded and the one found on disk. This can happen when there are mismatches between the SDK versions or updates to the... | 28,432 | [
{
"from": "human",
"value": "I get a \"UUID mismatch\" warning at the console when I try to build and run my app on my iPhone.\n\nwarning: UUID mismatch detected with\n the loaded library - on disk is:\n /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk/usr/lib/liblockdown.dylib\n =uu... |
If you were allowed to add another coding guideline to the 101 guidelines of the "C++ coding standards" (Herb Sutter and Andrei Alexandrescu), which would you add?
| If I were to propose an additional coding guideline to the existing 101 guidelines of "C++ Coding Standards" by Herb Sutter and Andrei Alexandrescu, it would be:
**"Embrace constexpr for compile-time computation."**
### Explanation:
C++ has evolved significantly, especially with the introduction of `constexpr` in C+... | 30,141 | [
{
"from": "human",
"value": "If you were allowed to add another coding guideline to the 101 guidelines of the \"C++ coding standards\" (Herb Sutter and Andrei Alexandrescu), which would you add?\n"
},
{
"from": "gpt",
"value": "If I were to propose an additional coding guideline to the existing ... |
This question is related to a previous post of mine Here. Basically, I want to inject a DAO into an entity i.e.
public class User
{
IUserDAO userDAO;
public User()
{
userDAO = IoCContainer.Resolve<IUserDAO>;
}
public User(IUserDAO userDAO)
{
this.userDAO = userDAO;
}
//Wrapped ... | What you're trying to achieve is an interesting use of the decorator pattern and proxy design to enhance your `User` class with additional functionality provided by your DAO (Data Access Object). While C# doesn't have built-in support for mixins like some other languages (e.g., Ruby or Python), you can use several appr... | 23,814 | [
{
"from": "human",
"value": "This question is related to a previous post of mine Here. Basically, I want to inject a DAO into an entity i.e. \npublic class User\n{\n IUserDAO userDAO;\n public User()\n {\n userDAO = IoCContainer.Resolve<IUserDAO>;\n }\n public User(IUserDAO userDAO)\n {\n... |
If, like me, you shiver at the site of a While (True) loop, then you too must have thought long and hard about the best way to refactor it away. I've seen several different implementations, none really better than any other, such as the timer & delegate combination.
So what's the best way you've come up with or seen t... | Refactoring an infinite loop like `while (true)` into a more manageable and maintainable construct is a common challenge, especially in scenarios like creating a Windows Service. Here are several approaches you can consider, each with its own advantages and use cases:
### 1. **Using a Cancellation Token**
Instead of a... | 25,344 | [
{
"from": "human",
"value": "If, like me, you shiver at the site of a While (True) loop, then you too must have thought long and hard about the best way to refactor it away. I've seen several different implementations, none really better than any other, such as the timer & delegate combination.\nSo what's ... |
I have a scenario where I'm not really sure my approach is the best one, and I would appreciate feedback / suggestions.
scenario:
I have a bunch of flash based (swf) 'modules' which are hosted in my aspnet application. Each flash has it's own directory on the filesystem, which contains assets for the flash. Consider th... | Your scenario is a common one where you need to protect static assets like SWF files and their associated resources. Your initial thoughts about using an `HttpModule` or `HttpHandler` are valid, but you’re right about the limitations and drawbacks of each approach in handling static files with different extensions. Her... | 19,453 | [
{
"from": "human",
"value": "I have a scenario where I'm not really sure my approach is the best one, and I would appreciate feedback / suggestions.\nscenario:\nI have a bunch of flash based (swf) 'modules' which are hosted in my aspnet application. Each flash has it's own directory on the filesystem, which... |
I have a form with a textbox and a button. IE is the only browser that will not submit the form when Enter is pressed (works in FF, Opera, Safari, Chrome, etc.). I found this javascript function to try to coax IE into behaving; but no avail:
function checkEnter(e){
var characterCode
if (e && e.which) {
... | The issue you're experiencing with Internet Explorer (IE) not submitting forms when the Enter key is pressed is a common one. Your provided JavaScript function for handling the Enter key looks mostly correct, but let's refine it to ensure better cross-browser compatibility, especially for older versions of IE.
Here’s ... | 30,058 | [
{
"from": "human",
"value": "I have a form with a textbox and a button. IE is the only browser that will not submit the form when Enter is pressed (works in FF, Opera, Safari, Chrome, etc.). I found this javascript function to try to coax IE into behaving; but no avail:\nfunction checkEnter(e){\n var ch... |
According to the help file that comes with the Spring.NET framework, you can inject a dependancy defined in the local file by using an 'idref' tag along with a 'local' attribute.
I have been trying to do this with no success and was hoping someone had the experience to help me out.
Below I have a snippet from the c... | It looks like you are using Spring.NET's dependency injection with the `idref` tag, and there seems to be an issue with how you are trying to reference the dependency. The error message you are getting indicates that Spring.NET is having trouble resolving the `theTargetObject` as a dependency for `theClientObject`.
He... | 28,842 | [
{
"from": "human",
"value": "According to the help file that comes with the Spring.NET framework, you can inject a dependancy defined in the local file by using an 'idref' tag along with a 'local' attribute. \nI have been trying to do this with no success and was hoping someone had the experience to help m... |
I have been bitten by something unexpected recently. I wanted to make something like that:
try :
thing.merge(iterable) # this is an iterable so I add it to the list
except TypeError :
thing.append(iterable) # this is not iterable, so I add it
Well, It was working fine until I passed an object inheriting from... | The behavior you're observing is due to the fact that in Python, instances of built-in exception classes (like `Exception`) are iterable. When you create an instance of an exception class, it typically represents a single error state, but its base class is designed to be iterable because it allows you to access the arg... | 30,918 | [
{
"from": "human",
"value": "I have been bitten by something unexpected recently. I wanted to make something like that:\ntry :\n thing.merge(iterable) # this is an iterable so I add it to the list\nexcept TypeError :\n thing.append(iterable) # this is not iterable, so I add it\n\nWell, It was workin... |
Our app is made up of several Modules, and we would like to take advantage of the XP feature that would allow these to be grouped together. For example all windows in "Module A" would be grouped together, separately from windows in "Module B".
I've tried setting the AssemblyTitle attribute in the
project's AssemblyIn... | In Windows XP, the way that windows are grouped in the Taskbar is influenced by the window titles, as well as other attributes like the application’s process and window class. In a WinForms application where you want to group different modules under distinct categories, you can manage the window titles and other proper... | 28,644 | [
{
"from": "human",
"value": "Our app is made up of several Modules, and we would like to take advantage of the XP feature that would allow these to be grouped together. For example all windows in \"Module A\" would be grouped together, separately from windows in \"Module B\". \nI've tried setting the Assemb... |
In C I know about the recursive function but I heard about the re-entrant function.What is that? And whats the difference between them?
| In C programming, the terms "recursive function" and "reentrant function" refer to two different concepts, each serving a unique purpose in programming. Let's break down each term and then highlight the differences between them.
### Recursive Function
A recursive function is one that calls itself in order to solve a p... | 28,056 | [
{
"from": "human",
"value": "In C I know about the recursive function but I heard about the re-entrant function.What is that? And whats the difference between them? \n"
},
{
"from": "gpt",
"value": "In C programming, the terms \"recursive function\" and \"reentrant function\" refer to two differ... |
I am trying to use a StreamReader to read a file, but it is always in use by another process so I get this error:
The process cannot access the file
'\arfjwknasgmed17\C$\FLAG
CONDITION\CP-ARFJN-FLAG.XLS' because
it is being used by another process.
Is there a way I can read this without copying it? Or is that ... | When you encounter the "file in use" error while trying to access a file with `StreamReader` in C#, it typically indicates that another application has locked the file for exclusive access. Unfortunately, this means that you cannot read the file until the other process releases its hold on it.
Here are a few options y... | 27,378 | [
{
"from": "human",
"value": "I am trying to use a StreamReader to read a file, but it is always in use by another process so I get this error:\n\nThe process cannot access the file\n '\\arfjwknasgmed17\\C$\\FLAG\n CONDITION\\CP-ARFJN-FLAG.XLS' because\n it is being used by another process.\n\nIs there a ... |
Here's the problem I'm having, I've got a set of logs that can grow fairly quickly. They're split into individual files every day, and the files can easily grow up to a gig in size. To help keep the size down, entries older than 30 days or so are cleared out.
The problem is when I want to search these files for a certa... | To improve the search performance for your log files, especially given the constraints that you can't integrate external applications and need a solution that can scale with the growth of your logs, implementing an efficient indexing mechanism would be the most viable approach. Below are some strategies and algorithms ... | 24,542 | [
{
"from": "human",
"value": "Here's the problem I'm having, I've got a set of logs that can grow fairly quickly. They're split into individual files every day, and the files can easily grow up to a gig in size. To help keep the size down, entries older than 30 days or so are cleared out.\nThe problem is whe... |
I've got an ASP.NET page that has a bunch of controls that need to be populated (e.g. dropdown lists).
I'd like to make a single trip to the db and bring back multiple recordsets instead of making a round-trip for each control.
I could bring back multiple tables in a DataSet, or I could bring back a DataReader and use ... | When it comes to retrieving data in ASP.NET, both `DataSet` and `DataReader` have their merits. The choice between them typically hinges on your specific use case, the volume of data you're working with, and the expected performance.
### `DataSet` vs `DataReader`
1. **DataSet**:
- **Pros**:
- Supports multipl... | 24,956 | [
{
"from": "human",
"value": "I've got an ASP.NET page that has a bunch of controls that need to be populated (e.g. dropdown lists).\nI'd like to make a single trip to the db and bring back multiple recordsets instead of making a round-trip for each control.\nI could bring back multiple tables in a DataSet, ... |
In the database I have a field named 'body' that has an XML in it. The
method I created in the model looks like this:
def self.get_personal_data_module(person_id)
person_module = find_by_person_id(person_id)
item_module = Hpricot(person_module.body)
personal_info = Array.new
personal_info = {:studi... | To modify your method so that it returns an object instead of a hash (which is essentially what you're currently returning), you can create a simple class to encapsulate the personal information. This will allow you to access the properties using dot notation.
Here’s how you can do it:
1. Create a simple class to rep... | 29,578 | [
{
"from": "human",
"value": "In the database I have a field named 'body' that has an XML in it. The \nmethod I created in the model looks like this:\ndef self.get_personal_data_module(person_id) \n person_module = find_by_person_id(person_id) \n item_module = Hpricot(person_module.body) \n personal... |
Ok, strange setup, strange question. We've got a Client and an Admin web application for our SaaS app, running on asp.net-2.0/iis-6. The Admin application can change options displayed on the Client application. When those options are saved in the Admin we call a Webservice on the Client, from the Admin, to flush our ca... | In IIS 6.0, each application pool can be configured to run with one or more worker processes (known as "web garden"). However, targeting individual worker processes directly via a web request is not a straightforward task. IIS abstracts the management of worker processes, so there's no built-in mechanism to address a s... | 28,634 | [
{
"from": "human",
"value": "Ok, strange setup, strange question. We've got a Client and an Admin web application for our SaaS app, running on asp.net-2.0/iis-6. The Admin application can change options displayed on the Client application. When those options are saved in the Admin we call a Webservice on th... |
Some years ago I was told about a study into code reuse. Apparently it was found that, on average, programmers have a 7 minute window when searching for code to reuse. If they don't find code that suits their needs within that window they'll write their own.
This was presented in the context of needing to carefully man... | Managing source code for reuse is a crucial aspect of software development, as it can significantly enhance productivity and maintainability. Below are some strategies for individuals and organizations to facilitate code reuse and ensure that developers can efficiently find what they need.
### Strategies for Managing ... | 28,649 | [
{
"from": "human",
"value": "Some years ago I was told about a study into code reuse. Apparently it was found that, on average, programmers have a 7 minute window when searching for code to reuse. If they don't find code that suits their needs within that window they'll write their own.\nThis was presented ... |
I am playing with the new stuff of C#3.0 and I have this code (mostly taken from MSDN) but I can only get true,false,true... and not the real value :
int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };
var oddNumbers = numbers.Select(n => n % 2 == 1);
Console.WriteLine("Numbers < 5:");
f... | The issue with your code is that the `Select` method is being used to create a sequence of Boolean values, where each value indicates whether the corresponding number in the `numbers` array is odd or not. Instead, you want to filter the numbers and only select the odd ones. To achieve this, you should use the `Where` m... | 31,685 | [
{
"from": "human",
"value": "I am playing with the new stuff of C#3.0 and I have this code (mostly taken from MSDN) but I can only get true,false,true... and not the real value :\n int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };\n\n var oddNumbers = numbers.Select(n => n % 2 == 1);\n\n ... |
Should we use Generic Collection to improve safety and performance?
| Yes, using generic collections can significantly improve both safety and performance in programming, especially in languages that support generics, such as C#, Java, and others. Here are some reasons why you should consider using generic collections:
### Safety
1. **Type Safety**: Generic collections enforce type con... | 31,349 | [
{
"from": "human",
"value": "Should we use Generic Collection to improve safety and performance?\n"
},
{
"from": "gpt",
"value": "Yes, using generic collections can significantly improve both safety and performance in programming, especially in languages that support generics, such as C#, Java, ... |
I have some C code for an ARM926 target. I am trying to debug it using "Arm Xtended Debugger" (AXD). The main() of this code, takes 14 command line arguments which are mentioned in the code warrior project settings at proper place and behavior of the code is as expected.
But when I try to use the same AXF (Arm eXecut... | The issue you're encountering with the command line arguments (argc value) when switching between debugging sessions using AXD and RVDEBUG could stem from several factors. Here are some considerations to help you troubleshoot and understand the difference in behavior:
1. **Environment Configuration**: Ensure that both... | 26,871 | [
{
"from": "human",
"value": "I have some C code for an ARM926 target. I am trying to debug it using \"Arm Xtended Debugger\" (AXD). The main() of this code, takes 14 command line arguments which are mentioned in the code warrior project settings at proper place and behavior of the code is as expected. \nBu... |
I'm looking for a way to programmatically recreate the following effect:
Give an input image:
input http://www.shiny.co.il/shooshx/ConeCarv/q_input.png
I want to iteratively apply the "stroke" effect.
The first step looks like this:
step 1 http://www.shiny.co.il/shooshx/ConeCarv/q_step1.png
The second step like this:
a... | To achieve the "stroke" effect you are looking for, you can follow a series of image processing steps, typically involving edge detection and then creating a stroke outline based on those edges. Below is an outline of an approach that you can implement programmatically using libraries such as OpenCV in Python.
### Ste... | 26,484 | [
{
"from": "human",
"value": "I'm looking for a way to programmatically recreate the following effect:\nGive an input image:\ninput http://www.shiny.co.il/shooshx/ConeCarv/q_input.png\nI want to iteratively apply the \"stroke\" effect.\nThe first step looks like this:\nstep 1 http://www.shiny.co.il/shooshx/C... |
I have developed an asp.net application and when using the publish tool in Visual Studio 2008, my changes don't get uploaded to the server (ie new css files). I made a thread about this on asp.net and was told to clear my local settings folder in my documents/application data, but because I am on a networked pc at work... | If you're having issues with the publish tool in Visual Studio 2008 not updating your ASP.NET application on the server (e.g., not uploading new CSS files), here are a few approaches you can consider:
### 1. **Check Publish Settings:**
Make sure that the publish settings in your project are configured correctly. You c... | 28,213 | [
{
"from": "human",
"value": "I have developed an asp.net application and when using the publish tool in Visual Studio 2008, my changes don't get uploaded to the server (ie new css files). I made a thread about this on asp.net and was told to clear my local settings folder in my documents/application data, b... |
I am new to PHP and trying to get the following code to work:
<?php
include 'config.php';
include 'opendb.php';
$query = "SELECT name, subject, message FROM contact";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "Name :{$row['name']} <br>" .
"Subject : {$row... | It looks like you have a couple of issues in your PHP code. Let’s address them one by one and also talk about how you can make your code cleaner.
### 1. Syntax Error Fix
You need to concatenate your strings properly within your echo statement. The error in your code comes from an incomplete string (missing a concatena... | 27,262 | [
{
"from": "human",
"value": "I am new to PHP and trying to get the following code to work:\n<?php\ninclude 'config.php';\ninclude 'opendb.php';\n\n$query = \"SELECT name, subject, message FROM contact\";\n$result = mysql_query($query);\n\nwhile($row = mysql_fetch_array($result, MYSQL_ASSOC))\n{\n echo \"... |
I have a block of product images we received from a customer. Each product image is a picture of something and it was taken with a white background. I would like to crop all the surrounding parts of the image but leave only the product in the middle. Is this possible?
As an example: [http://www.5dnet.de/media/catalo... | Yes, it's possible to crop an image to keep only the product while removing the surrounding white background. To achieve this in C#, you can use the `System.Drawing` namespace, which provides classes for working with images.
Here's an example of how you can implement this:
```csharp
using System;
using System.Drawing... | 25,424 | [
{
"from": "human",
"value": "I have a block of product images we received from a customer. Each product image is a picture of something and it was taken with a white background. I would like to crop all the surrounding parts of the image but leave only the product in the middle. Is this possible?\nAs an ... |
We're releasing a new set of resource bundles for a large open source project, and I'd like to make some good recommendations for cross platform resource bundle editors to translators.
The only useful candidates I can find include:
RBManager
Eclipse ResourceBundle Editor
| Here are some additional cross-platform resource bundle editors that could be useful for translators working on your open-source project:
1. **Poedit**: Primarily designed for editing Gettext (.po) files, Poedit can also handle resource bundles with some configuration. It's cross-platform and offers a simple, user-fri... | 30,688 | [
{
"from": "human",
"value": "We're releasing a new set of resource bundles for a large open source project, and I'd like to make some good recommendations for cross platform resource bundle editors to translators.\nThe only useful candidates I can find include:\n\nRBManager\nEclipse ResourceBundle Editor\n\... |
I'm working on a database design for groups hierarchy used as the foundation of a larger system. Each group can contain other groups, and also 'devices' as leaf objects (nothing goes below device).
The database being used is MS SQL 2005. (Though working in MS SQL 2000 would be a bonus; a solution requiring MS SQL 2008 ... | Designing a database schema for a hierarchical structure like the one you described, with dynamic attributes and relationships, poses several challenges. Below is a potential schema design considering your requirements, along with some pros and cons.
### Proposed Schema Design
1. **Groups Table**
```sql
CREATE ... | 12,857 | [
{
"from": "human",
"value": "I'm working on a database design for groups hierarchy used as the foundation of a larger system. Each group can contain other groups, and also 'devices' as leaf objects (nothing goes below device).\nThe database being used is MS SQL 2005. (Though working in MS SQL 2000 would be ... |
[Of course, the question is not restricted to a specific "friend" implementation, feel free though to point out implementation specifics if relevant]
Reading through the unanswered questions, I stumbled upon the InternalsVisibleTo attribute:
Specifies that types that are
ordinarily visible only within the
current ... | Using the `InternalsVisibleTo` attribute to allow unit tests access to internal types and members in a production assembly can be a double-edged sword. Below are some pros and cons based on experiences and best practices:
### Pros:
1. **Fine-Grained Testing**: As you mentioned, you can test internal implementations w... | 27,996 | [
{
"from": "human",
"value": "[Of course, the question is not restricted to a specific \"friend\" implementation, feel free though to point out implementation specifics if relevant]\nReading through the unanswered questions, I stumbled upon the InternalsVisibleTo attribute:\n\nSpecifies that types that are\n... |
I've been researching modules for Nginx (my preferred webserver) to serve a Lisp webapp, but I haven't been able to find anything.
Is there modules for Nginx, or is there better ways to serve Lisp webapps? If so, what are they?
| Serving a Lisp web application using Nginx can be done, but there are no specific Nginx modules designed exclusively for Lisp. However, there are common approaches to integrate Nginx with Lisp-based web applications. Here are some strategies:
### 1. Reverse Proxying with Nginx
The most common way to serve a Lisp web ... | 28,652 | [
{
"from": "human",
"value": "I've been researching modules for Nginx (my preferred webserver) to serve a Lisp webapp, but I haven't been able to find anything.\nIs there modules for Nginx, or is there better ways to serve Lisp webapps? If so, what are they?\n"
},
{
"from": "gpt",
"value": "Servi... |
How to make ASP.NET file upload control with resume, without file size limitation and with secure connection?
Any idea?
| Creating a file upload control in ASP.NET that allows users to resume uploads, has no file size limitations, and uses a secure connection involves several steps. Here’s a high-level guide on how to achieve this.
### Key Components
1. **Front-End HTML/JavaScript for File Upload**: This includes a file input and JavaSc... | 20,185 | [
{
"from": "human",
"value": "How to make ASP.NET file upload control with resume, without file size limitation and with secure connection?\nAny idea?\n"
},
{
"from": "gpt",
"value": "Creating a file upload control in ASP.NET that allows users to resume uploads, has no file size limitations, and ... |
I always try to avoid to return string literals, because I fear they aren't defined outside of the function. But I'm not sure if this is the case. Let's take, for example, this function:
const char *
return_a_string(void)
{
return "blah";
}
Is this correct code? It does work for me, but maybe it only works for my ... | Yes, your code is correct, and the behavior you're observing is consistent across standard C compilers, including GCC.
In C, string literals are static in duration and have a lifetime that lasts for the duration of the program. This means that when you create a string literal like `"blah"`, it is stored in a read-only... | 29,555 | [
{
"from": "human",
"value": "I always try to avoid to return string literals, because I fear they aren't defined outside of the function. But I'm not sure if this is the case. Let's take, for example, this function:\nconst char *\nreturn_a_string(void)\n{\n return \"blah\";\n}\n\nIs this correct code? It... |
I'm developing a simple Qt 4 app and making my own dialog. I subclassed QDialog, inserted the Q_OBJECT macro in the class declaration block, and... I get
[Linker error] undefined reference to `vtable for MyDialog' and there is no
moc_MyDialog.cpp generated by the moc compiler.
I am using Qt 4.1.3 on Windows XP and... | The issue you're experiencing with the linker error `undefined reference to 'vtable for MyDialog'` and the absence of the `moc_MyDialog.cpp` file is typically related to how the `moc` (Meta-Object Compiler) processes your QObject-derived classes.
Here are some steps and checks you can perform to troubleshoot and resol... | 25,855 | [
{
"from": "human",
"value": "I'm developing a simple Qt 4 app and making my own dialog. I subclassed QDialog, inserted the Q_OBJECT macro in the class declaration block, and... I get\n\n[Linker error] undefined reference to `vtable for MyDialog' and there is no \n moc_MyDialog.cpp generated by the moc comp... |
I have got the following problem since the server has safe mode turned on, and directories are being created under different users:
I upload my script to the server, it shows as belonging to 'user1'. All it is doing is making a new directory when a new user is created so it can store files in it.
New directory is crea... | Your understanding of the problem and the restrictions imposed by PHP's safe mode is generally correct. Safe mode was designed to help mitigate security risks in shared hosting environments, but it is deprecated as of PHP 5.3.0 and removed in PHP 5.4.0, so if you're using a version of PHP where safe mode is still activ... | 26,421 | [
{
"from": "human",
"value": "I have got the following problem since the server has safe mode turned on, and directories are being created under different users:\n\nI upload my script to the server, it shows as belonging to 'user1'. All it is doing is making a new directory when a new user is created so it c... |
My web application allows users to upload images of items they are planning on selling. I'm trying to find a good compromise between having the images large enough and detailed enough for buyers to get an idea of the condition of the item and having the images small enough so that they don't slow down the site substan... | Storing both the original and resized versions of images is a common practice in web applications, particularly for e-commerce platforms where image quality is essential for user experience. Here are some key considerations and guidelines to help you find a good compromise between image quality and file size:
### 1. *... | 28,212 | [
{
"from": "human",
"value": "My web application allows users to upload images of items they are planning on selling. I'm trying to find a good compromise between having the images large enough and detailed enough for buyers to get an idea of the condition of the item and having the images small enough so t... |
I would like to hear opinions or peoples experiences regarding Rel. Is it destined for the dustbin, or is it the next big thing in programming? I haven't tried doing anything with it yet (and it looks like you really can't at this point), but I'm intrigued by a few of the concepts discussed in it. Notably:
Removal ... | Rel is an intriguing programming language that has garnered interest due to its unique approach to handling data and its innovative concepts. Here are some thoughts based on the concepts you mentioned and broader community perspectives:
### 1. Removal of Nulls
The removal of nulls addresses a long-standing pain point ... | 29,791 | [
{
"from": "human",
"value": "I would like to hear opinions or peoples experiences regarding Rel. Is it destined for the dustbin, or is it the next big thing in programming? I haven't tried doing anything with it yet (and it looks like you really can't at this point), but I'm intrigued by a few of the conc... |
Looking for a bit of regex help.
I'd like to design an expression that matches a string with "foo" OR "bar", but not both "foo" AND "bar"
If I do something like...
/((foo)|(bar))/
It'll match "foobar". Not what I'm looking for. So, how can I make regex match only when one term or the other is present?
Thanks!
| To achieve the desired functionality of matching a string that contains either "foo" or "bar" but not both, you can use a negative lookahead assertion in your regex pattern. Here's how you can construct it:
```regex
^(?:(?=.*\bfoo\b)(?!.*\bbar\b)|(?=.*\bbar\b)(?!.*\bfoo\b)).*$
```
### Breakdown of the regex:
- `^`: A... | 29,521 | [
{
"from": "human",
"value": "Looking for a bit of regex help.\nI'd like to design an expression that matches a string with \"foo\" OR \"bar\", but not both \"foo\" AND \"bar\"\nIf I do something like...\n/((foo)|(bar))/\n\nIt'll match \"foobar\". Not what I'm looking for. So, how can I make regex match only... |
I have some complex stored procedures that may return many thousands of rows, and take a long time to complete.
Is there any way to find out how many rows are going to be returned before the query executes and fetches the data?
This is with Visual Studio 2005, a Winforms application and SQL Server 2005.
| In SQL Server 2005, there's no direct way to determine the exact number of rows a stored procedure will return without executing it. However, there are several strategies you can use to estimate or get an idea of the number of rows without fetching all the data:
### 1. **Use a SELECT COUNT(*) Statement**:
Before execu... | 28,690 | [
{
"from": "human",
"value": "I have some complex stored procedures that may return many thousands of rows, and take a long time to complete.\nIs there any way to find out how many rows are going to be returned before the query executes and fetches the data?\nThis is with Visual Studio 2005, a Winforms appli... |
I am refactoring a stack of ASP.NET pages. I'd like to compile and test the ones I've completed. However, Visual Studio won't let me run the Web Site with compile errors on the non-refactored pages. How can I temporarily exclude them without removing them from the project itself? Can you do so through configuration... | Yes, you can temporarily exclude certain files or folders from being compiled in an ASP.NET Web Site project without removing them from the project. Here's how you can accomplish this:
### Option 1: Using the `.csproj` file
1. **Convert your Web Site project to a Web Application project**:
- This way, you can manag... | 30,265 | [
{
"from": "human",
"value": "I am refactoring a stack of ASP.NET pages. I'd like to compile and test the ones I've completed. However, Visual Studio won't let me run the Web Site with compile errors on the non-refactored pages. How can I temporarily exclude them without removing them from the project its... |
I've decided to integrate NUnit with VWD2008.
I did the following-
1) Installed NUnit - Ran a Sample project that was included with the installation all the tests were fine.
2) Installed TestDriven.Net 2.0 - Personal distribution.
3) I have written on an MVC Project a test and when I try to right click the context and ... | Integrating NUnit with Visual Web Developer (VWD) 2008 can sometimes be tricky. Here are a few common issues and solutions to help you troubleshoot why your NUnit tests might not be running as expected:
1. **Check Test Configuration**:
Ensure that your test class is properly set up with the necessary attributes. Ea... | 27,086 | [
{
"from": "human",
"value": "I've decided to integrate NUnit with VWD2008.\nI did the following-\n1) Installed NUnit - Ran a Sample project that was included with the installation all the tests were fine.\n2) Installed TestDriven.Net 2.0 - Personal distribution.\n3) I have written on an MVC Project a test a... |
In VB.NET (or C#) how can I determine programmatically if a public variable in class helper.vb is used anywhere within a project?
| In VB.NET (and C#), programmatically checking if a public variable in a class is used anywhere within a project can be a complex task since it involves analyzing code and understanding the structure of your project. Unfortunately, the .NET runtime does not provide built-in methods to analyze code usage like an integrat... | 17,177 | [
{
"from": "human",
"value": "In VB.NET (or C#) how can I determine programmatically if a public variable in class helper.vb is used anywhere within a project?\n"
},
{
"from": "gpt",
"value": "In VB.NET (and C#), programmatically checking if a public variable in a class is used anywhere within a ... |
When I create a zip Archive via java.util.zip.*, is there a way to split the resulting archive in multiple volumes?
Let's say my overall archive has a filesize of 24 MB and I want to split it into 3 files on a limit of 10 MB per file.
Is there a zip API which has this feature? Or any other nice ways to achieve this?
... | The standard `java.util.zip` package does not provide built-in support for creating multi-volume ZIP files directly. However, you can achieve the desired outcome by writing custom logic to split the archive manually. Below are the steps and a sample approach to create a ZIP archive and split it into multiple volumes.
... | 24,869 | [
{
"from": "human",
"value": "When I create a zip Archive via java.util.zip.*, is there a way to split the resulting archive in multiple volumes? \nLet's say my overall archive has a filesize of 24 MB and I want to split it into 3 files on a limit of 10 MB per file.\nIs there a zip API which has this featur... |
In my project I have functionality that is being used as a web application and as a console application (to be started from the task scheduler). To do that I put the common code in a DLL that is being used by both the web application and the console application. This works fine.
However, the console and web application... | Yes, you can centralize configuration settings in a DLL so that both your web application and console application can use them. However, there are some considerations and approaches to achieve this.
### Options to Centralize Configuration
1. **Use a Shared Configuration File**:
- You can create a common configura... | 27,697 | [
{
"from": "human",
"value": "In my project I have functionality that is being used as a web application and as a console application (to be started from the task scheduler). To do that I put the common code in a DLL that is being used by both the web application and the console application. This works fine.... |
This will require a little setup. Trust me that this is for a good cause.
The Background
A friend of mine has run a non-profit public interest website for two years. The site is designed to counteract misinformation about a certain public person. Of course, over the last two years those of us who support what he is ... | It sounds like you're dealing with a challenging situation. Here are several strategies you can use to help Google recognize the new domain and differentiate it from the old one:
1. **Use Google Search Console**:
- Ensure that the new domain is verified in Google Search Console. This will allow you to monitor inde... | 29,321 | [
{
"from": "human",
"value": "This will require a little setup. Trust me that this is for a good cause.\nThe Background\nA friend of mine has run a non-profit public interest website for two years. The site is designed to counteract misinformation about a certain public person. Of course, over the last tw... |
I'm working on a WinForms app and I have a user control in it. The buttons in the user control raise events up to the form to be handled by other code. One of the buttons starts some processses that will cause problems if they run simultaneously. I have logic in the code to manage the state so typically a user can't... | To handle the issue of preventing multiple rapid clicks on the button in your WinForms user control, there are a few strategies you can employ. Here are some effective approaches that won't require a radical rewrite of your application:
### 1. Disable the Button Temporarily
While you've mentioned that disabling the bu... | 26,646 | [
{
"from": "human",
"value": "I'm working on a WinForms app and I have a user control in it. The buttons in the user control raise events up to the form to be handled by other code. One of the buttons starts some processses that will cause problems if they run simultaneously. I have logic in the code to m... |
This is the error Dependency Walker gives me on an executable that I am building with VC++ 2005 Express Edition. When trying to run the .exe, I get:
This application has failed to start because the application configuration
is incorrect. Reinstalling the application may fix this problem.
(I am new to the manifest/SxS/... | The error message you're encountering suggests that there is an issue with the application manifest or the Side-by-Side (SxS) assemblies related to the executable you've built with VC++ 2005 Express Edition. This is a common problem when dealing with applications that depend on the Visual C++ runtime libraries, particu... | 28,923 | [
{
"from": "human",
"value": "This is the error Dependency Walker gives me on an executable that I am building with VC++ 2005 Express Edition. When trying to run the .exe, I get:\nThis application has failed to start because the application configuration\nis incorrect. Reinstalling the application may fix th... |
I have a DataList like so:
<asp:DataList ID="dlMyList" runat="server" RepeatColumns="5"
RepeatDirection="Horizontal" CellSpacing="5" >
<ItemTemplate>
<asp:CheckBox ID="cbMyBox" Runat="server" Text='<%# Container.DataItem%>' ToolTip=''></asp:CheckBox>
</ItemTemplate>
</asp:DataList>
I'm binding... | To set the `Text` property of the checkbox to the key of the dictionary and the `ToolTip` property to the value of the dictionary, you'll need to modify the `ItemTemplate` in your DataList. You can achieve this by using the `Eval` method to access the properties of the dictionary items. However, since you're working wi... | 25,445 | [
{
"from": "human",
"value": "I have a DataList like so:\n<asp:DataList ID=\"dlMyList\" runat=\"server\" RepeatColumns=\"5\" \n RepeatDirection=\"Horizontal\" CellSpacing=\"5\" >\n <ItemTemplate>\n <asp:CheckBox ID=\"cbMyBox\" Runat=\"server\" Text='<%# Container.DataItem%>' ToolTip=''></asp... |
Is it possible in C# to see the traces in a separate console. For example, I am having a window based application in which there are trace statements that will write the currently executed method name in to the console. When I run this application, it should automatically open a console and start the traces. Is this po... | Yes, it is possible to create a separate console window in a C# Windows Forms application (or any other GUI application) to display trace messages. You can do this by using the `AllocConsole` function from the Windows API, which allows you to allocate a new console for your application. You can then redirect your trace... | 27,924 | [
{
"from": "human",
"value": "Is it possible in C# to see the traces in a separate console. For example, I am having a window based application in which there are trace statements that will write the currently executed method name in to the console. When I run this application, it should automatically open a... |
Is it possible to obtain the maximum column length for a VARCHAR, CHAR etc?
| Yes, it is possible to obtain the maximum column length for data types like `VARCHAR` and `CHAR` in various database management systems (DBMS). The maximum length typically depends on the specific DBMS you are using. Here's a brief overview for some popular databases:
### MySQL
- `VARCHAR`: The maximum length is 65,53... | 28,798 | [
{
"from": "human",
"value": "Is it possible to obtain the maximum column length for a VARCHAR, CHAR etc?\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to obtain the maximum column length for data types like `VARCHAR` and `CHAR` in various database management systems (DBMS). The maximum le... |
In VS2008, I have a web-site project. When I use find in files and search for a string, the find results window will list every occurence twice.
What could be causing this?
[EDIT]
Below is the screen capture from VS. I was searching for the work CommissionBucketProductID within my website project. Notice that each line... | The issue you're experiencing, where the "Find in Files" feature in Visual Studio 2008 is returning duplicate results, could be caused by a few different factors. Here are some potential reasons and solutions to consider:
1. **File Types in the Project**: Ensure that you are not inadvertently searching through multipl... | 28,928 | [
{
"from": "human",
"value": "In VS2008, I have a web-site project. When I use find in files and search for a string, the find results window will list every occurence twice.\nWhat could be causing this?\n[EDIT]\nBelow is the screen capture from VS. I was searching for the work CommissionBucketProductID with... |
I hope this is "close enough to programming" to pass the bar :)
Is there any way to monitor SSL transactions / sec on Sun Webproxy? Preferably with SNMP, but anything goes :)
| Monitoring SSL transactions on a Sun Web Proxy (now known as Oracle Web Cache) can be done, although specific capabilities can vary based on the version you are using. Here are some strategies you might consider:
### 1. **SNMP Monitoring**
If you are interested in monitoring via SNMP, you need to ensure that your Web ... | 29,719 | [
{
"from": "human",
"value": "I hope this is \"close enough to programming\" to pass the bar :)\nIs there any way to monitor SSL transactions / sec on Sun Webproxy? Preferably with SNMP, but anything goes :)\n"
},
{
"from": "gpt",
"value": "Monitoring SSL transactions on a Sun Web Proxy (now know... |
I have written C# command window application. I'm running bunch of processes on command line inside the main(). For e.g.
void main()
{
process p1 = new process()
set p1 properties
p1.start()
-->p1.StandardInput.WriteLine("start /WAIT cmd.exe /c BUILD -cZP");
}
This line will execute some program in a new ... | When you start a process in C# and execute a command that involves an external application (like `cmd.exe` in your case), using `ctrl+c` to interrupt the execution can complicate the process management. The `p1.WaitForExit()` will wait indefinitely if the command running in the spawned process does not terminate as exp... | 16,655 | [
{
"from": "human",
"value": "I have written C# command window application. I'm running bunch of processes on command line inside the main(). For e.g.\nvoid main()\n{\n process p1 = new process()\n set p1 properties\n p1.start()\n -->p1.StandardInput.WriteLine(\"start /WAIT cmd.exe /c BUILD -cZP\");... |
I'm looking for a Report Designer that will allow me to connect to a RESTful webservice. Ideally I would like one that has a royalty-free End-User Report Designer. WE will be hosting it in an ASP.NET web site. So something compatable with that would be ideal ;)
We used to use Data Dynamics Active Reports. However this ... | There are several reporting tools that can connect to RESTful web services and provide a royalty-free end-user report designer suitable for ASP.NET applications. Here are a few options you might consider:
1. **Stimulsoft Reports.Net**:
- **Features**: Stimulsoft offers a web-based report designer that can connect t... | 28,870 | [
{
"from": "human",
"value": "I'm looking for a Report Designer that will allow me to connect to a RESTful webservice. Ideally I would like one that has a royalty-free End-User Report Designer. WE will be hosting it in an ASP.NET web site. So something compatable with that would be ideal ;)\nWe used to use D... |
I have several similar methods, say eg. CalculatePoint(...) and CalculateListOfPoints(...). Occasionally, they may not succeed, and need to indicate this to the caller. For CalculateListOfPoints, which returns a generic List, I could return an empty list and require the caller to check this; however Point is a value ty... | In situations where you want to indicate success or failure without using exceptions, there are several best practice patterns you can use. Here are a few options that maintain consistency between the methods while providing clear signaling for success or failure:
### 1. **Try Pattern with Out Parameters**
The "Try" p... | 28,102 | [
{
"from": "human",
"value": "I have several similar methods, say eg. CalculatePoint(...) and CalculateListOfPoints(...). Occasionally, they may not succeed, and need to indicate this to the caller. For CalculateListOfPoints, which returns a generic List, I could return an empty list and require the caller t... |
I am testing some weird-looking CSS code that I wrote (I'm using a mix of percentages and pixel values for width of DIVs, basically). While I'm not convinced that it's right, it works perfectly on all screen sizes on IE 5.5, IE 6.0 (thanks to these guys!), IE 7.0, Firefox 3.0 and Safari 3.12... all on Windows XP. Do I ... | It's great to hear that your CSS is working well across several browsers on Windows XP! However, when it comes to testing your CSS on Mac and Linux, there are a few considerations to keep in mind.
1. **Browser Consistency**: As you mentioned, both Safari and Firefox tend to be quite consistent across platforms. So if ... | 29,104 | [
{
"from": "human",
"value": "I am testing some weird-looking CSS code that I wrote (I'm using a mix of percentages and pixel values for width of DIVs, basically). While I'm not convinced that it's right, it works perfectly on all screen sizes on IE 5.5, IE 6.0 (thanks to these guys!), IE 7.0, Firefox 3.0 an... |
Using VBA i have a set of functions that return an ADODB.Recordset where all the columns as adVarChar. Unfortunately this means numerics get sorted as text. So 1,7,16,22 becomes 1,16,22,7
Is there any methods that can sort numerics as text columns without resorting to changing the type of the column?
Sub TestSortVarCha... | In your scenario, you need a way to sort numeric values represented as text in a way that they are treated as numbers during the sorting operation. One way to achieve this without changing the data type of the columns in your ADODB.Recordset is to use a temporary field to convert the text values to their numeric counte... | 23,371 | [
{
"from": "human",
"value": "Using VBA i have a set of functions that return an ADODB.Recordset where all the columns as adVarChar. Unfortunately this means numerics get sorted as text. So 1,7,16,22 becomes 1,16,22,7\nIs there any methods that can sort numerics as text columns without resorting to changing ... |
Could anyone show me a sample about how to use these two commands in Windbg please? I read the document in debugger.chm, but confused. I did search in Google and MSDN, but not find an easy to learn sample.
| Certainly! Windbg is a powerful debugger used for analyzing Windows applications and system issues. Let’s focus on two common commands: `!analyze` and `!process`. I'll provide a simple example of how to use these commands.
### Sample 1: Using `!analyze`
The `!analyze -v` command is commonly used to get a detailed ana... | 28,479 | [
{
"from": "human",
"value": "Could anyone show me a sample about how to use these two commands in Windbg please? I read the document in debugger.chm, but confused. I did search in Google and MSDN, but not find an easy to learn sample.\n"
},
{
"from": "gpt",
"value": "Certainly! Windbg is a power... |
Here's a very simple question. I have an SP that inserts a row into a table and at the end there's the statement RETURN @@IDENTITY. What I can't seem to find is a way to retrieve this value in C#. I'm using the Enterprise library and using the method:
db.ExecuteNonQuery(cmd);
I've tried cmd.Parameters[0].Value to get ... | When you use `RETURN @@IDENTITY` in a stored procedure, the value returned by `@@IDENTITY` is a status return value, not an output parameter. This means it won't be captured in the way you are trying to do with `cmd.Parameters[0].Value`.
To retrieve the inserted identity value from your stored procedure in C#, you ha... | 28,878 | [
{
"from": "human",
"value": "Here's a very simple question. I have an SP that inserts a row into a table and at the end there's the statement RETURN @@IDENTITY. What I can't seem to find is a way to retrieve this value in C#. I'm using the Enterprise library and using the method:\ndb.ExecuteNonQuery(cmd);\n... |
I would like to see the threads currently active in my application while debugging it.
How can I do this using Visual Studio?
| In Visual Studio, you can view the currently active threads in your application while debugging by following these steps:
1. **Start Debugging**: First, ensure your application is running in debug mode. You can do this by pressing `F5` or by selecting `Debug` > `Start Debugging` from the menu.
2. **Open the Threads W... | 31,153 | [
{
"from": "human",
"value": "I would like to see the threads currently active in my application while debugging it.\nHow can I do this using Visual Studio?\n"
},
{
"from": "gpt",
"value": "In Visual Studio, you can view the currently active threads in your application while debugging by followin... |
I've never used SOAP before and I'm sort of new to Python. I'm doing this to get myself acquainted with both technologies. I've installed SOAPlib and I've tried to read their Client documentation, but I don't understand it too well. Is there anything else I can look into which is more suited for being a SOAP Client ... | Since you're using Python 2.6 and looking for a more user-friendly SOAP client library than `SOAPlib`, you might want to consider the following alternatives:
1. **Sudsy**: Sudsy is an alternative that offers a simple way to make SOAP requests. It's easy to use and has a straightforward interface.
To install it, yo... | 29,722 | [
{
"from": "human",
"value": "I've never used SOAP before and I'm sort of new to Python. I'm doing this to get myself acquainted with both technologies. I've installed SOAPlib and I've tried to read their Client documentation, but I don't understand it too well. Is there anything else I can look into whic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.