instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I have run into a bit of a tricky problem in some C++ code, which is most easily described using code. I have classes that are something like: class MyVarBase { } class MyVar : public MyVarBase { int Foo(); } class MyBase { public: MyBase(MyVarBase* v) : m_var(v) {} virtual MyVarBase* GetVar() { return m...
You're facing a common design issue in C++ that relates to inheritance and type safety. Let's break down your question and explore some potential solutions to achieve what you need without introducing risks like memory leaks or violating the principles of object-oriented design. ### Option 1: Your Current Approach Yo...
40,319
[ { "from": "human", "value": "I have run into a bit of a tricky problem in some C++ code, which is most easily described using code. I have classes that are something like:\nclass MyVarBase\n{\n}\n\nclass MyVar : public MyVarBase\n{\n int Foo();\n}\n\nclass MyBase\n{\npublic: \n MyBase(MyVarBase* v) : ...
We've just been given the following code as a solution for a complicated search query in a new application provided by offshore developers. I'm skeptical of the use of dynamic SQL because I could close the SQL statement using '; and then excute a nasty that will be performed on the database! Any ideas on how to fix the...
You are right to be concerned about the potential for SQL injection in the provided stored procedure. Using dynamic SQL without proper handling can expose your database to injection attacks. Here are several steps to mitigate these risks and improve the overall safety of the stored procedure: ### 1. Use Parameterized ...
33,579
[ { "from": "human", "value": "We've just been given the following code as a solution for a complicated search query in a new application provided by offshore developers. I'm skeptical of the use of dynamic SQL because I could close the SQL statement using '; and then excute a nasty that will be performed on ...
I have a domain and a group of sub-domains that require authentication to access. I am currently using mod_auth to authenticate users (mod_auth basic) at the domain.tld level. My goal is for single sign-on between the domain and all the sub-domains. Will these credentials carry on to the sub-domains automatically, or w...
To achieve single sign-on (SSO) between your main domain and its sub-domains using `mod_auth_basic`, you need to make some adjustments. By default, HTTP Basic Authentication credentials are tied to the specific domain or sub-domain from which the request originates. This means that if you authenticate users on `domain....
40,514
[ { "from": "human", "value": "I have a domain and a group of sub-domains that require authentication to access. I am currently using mod_auth to authenticate users (mod_auth basic) at the domain.tld level. My goal is for single sign-on between the domain and all the sub-domains.\nWill these credentials carry...
Subversion lets you embed working copies of other repositories using externals, allowing easy version control of third-party library software in your project. While these seem ideal for the reuse of libraries and version control of vendor software, they aren't without their critics: Please don't use Subversion externa...
Using Subversion (SVN) externals can certainly provide certain conveniences when managing third-party libraries or dependencies. However, there are several reasons why some developers consider them an anti-pattern, and there are hidden risks associated with their use. Here are some of the key concerns: ### 1. **Tight ...
40,160
[ { "from": "human", "value": "Subversion lets you embed working copies of other repositories using externals, allowing easy version control of third-party library software in your project.\nWhile these seem ideal for the reuse of libraries and version control of vendor software, they aren't without their cri...
I would like to know what would be the impact of modifying web.config file while an ASP.NET application is running. Here's my exact scenario. I have two hosts running the same application on IIS6. Both hosts have the exact same machine.config files, meaning they share same machine keys. | |...
Modifying the `web.config` file for an ASP.NET application running on IIS will indeed trigger an application restart. This is true for both single-host and multi-host (web farm) environments like yours. Here’s what happens during this process and its implications for user sessions: ### Immediate Impacts of Modifying `...
38,443
[ { "from": "human", "value": "I would like to know what would be the impact of modifying web.config file while an ASP.NET application is running. \nHere's my exact scenario. I have two hosts running the same application on IIS6. Both hosts have the exact same machine.config files, meaning they share same mac...
I have a right outer join, that almost does what I want... SELECT users_usr.firstname_usr, users_usr.lastname_usr, credit_acc.given_credit_acc, users_usr.created_usr, users_usr.sitenum_usr, users_usr.original_aff_usr, users_usr.id_usr FROM credit_acc right Outer Join users_usr ON credit_acc.uid_usr = users_usr.id_usr ...
You can achieve the desired outcome by using a `RIGHT JOIN` with an additional condition in the `ON` clause instead of the `WHERE` clause. This way, you can keep all users from the `users_usr` table, even if they do not have a matching row in the `credit_acc` table. You can also use `COALESCE` to handle the cases where...
41,445
[ { "from": "human", "value": "I have a right outer join, that almost does what I want...\nSELECT\nusers_usr.firstname_usr,\nusers_usr.lastname_usr,\ncredit_acc.given_credit_acc,\nusers_usr.created_usr,\nusers_usr.sitenum_usr,\nusers_usr.original_aff_usr,\nusers_usr.id_usr\nFROM\ncredit_acc\nright Outer Join ...
How can I create a method that has optional parameters in it in Visual Basic?
In Visual Basic (VB.NET), you can create methods with optional parameters by using the `Optional` keyword in the method definition. Optional parameters allow you to call the method without providing values for those parameters, in which case a default value will be used. Here’s the basic syntax for defining a method w...
43,689
[ { "from": "human", "value": "How can I create a method that has optional parameters in it in Visual Basic?\n" }, { "from": "gpt", "value": "In Visual Basic (VB.NET), you can create methods with optional parameters by using the `Optional` keyword in the method definition. Optional parameters allo...
I have a MS-access database. But it is on the shared drive. And it is required that only some selected number of people can use it. Is there a way to authenticate the user?
Yes, there are several ways to authenticate users for an MS Access database, especially when it's on a shared drive. Here are some options you can consider: ### 1. **User-Level Security (for older Access versions)** User-level security was a feature in older versions of Access (up to Access 2003) that allowed you to ...
38,619
[ { "from": "human", "value": "I have a MS-access database. But it is on the shared drive. And it is required that only some selected number of people can use it. Is there a way to authenticate the user?\n" }, { "from": "gpt", "value": "Yes, there are several ways to authenticate users for an MS A...
In C#, if I declare an auto-implemented property, why do I have to declare BOTH the get and set part? i.e. public string ThisWorks { get; set; } public string ThisDoesnt { get; } Isn't this just syntactic sugar - i.e. the compiler inserts a private field for the property? So why the problem? Curious.
In C#, auto-implemented properties are indeed a form of syntactic sugar that allows you to define a property without having to explicitly declare a backing field. When you declare an auto-implemented property, the C# compiler automatically creates a private backing field for you. However, there are some rules regardin...
41,851
[ { "from": "human", "value": "In C#, if I declare an auto-implemented property, why do I have to declare BOTH the get and set part? \ni.e.\npublic string ThisWorks { get; set; }\n\npublic string ThisDoesnt { get; }\n\nIsn't this just syntactic sugar - i.e. the compiler inserts a private field for the proper...
What's the best way to use Bazaar (bzr) as the version control system in Visual Studio 2008?
To use Bazaar (bzr) as the version control system in Visual Studio 2008, you'll need to follow a few steps to set up your environment and integrate Bazaar with Visual Studio. Here’s a guide to get you started: ### 1. Install Bazaar - **Download and Install Bazaar**: You can download Bazaar from [Bazaar's official sit...
40,093
[ { "from": "human", "value": "What's the best way to use Bazaar (bzr) as the version control system in Visual Studio 2008?\n" }, { "from": "gpt", "value": "To use Bazaar (bzr) as the version control system in Visual Studio 2008, you'll need to follow a few steps to set up your environment and int...
Ok guys any idea how i may go about creating an answers file for an unattended install for say WinAmp? So far all my research points to is doing an unattended install for windows or some other OS. What I want to do is create an unattended install for a 3rd party software. Are there tools to do this? Or is unattended in...
Creating an unattended installation for third-party software like WinAmp is definitely possible, although it may require some specific steps depending on how the software is packaged. Here’s a general guide on how to achieve this: ### Step 1: Check for Silent Installation Options Most installers for third-party applic...
39,528
[ { "from": "human", "value": "Ok guys any idea how i may go about creating an answers file for an unattended install for say WinAmp?\nSo far all my research points to is doing an unattended install for windows or some other OS. What I want to do is create an unattended install for a 3rd party software. Are t...
with XStream, how can I ignore the serialization of a defined Type (for instance, when serializing a GUI, i want to ignore all swing types)? Or if i want to ignore all javax.* types? Thanks in advance, Burkhard
To ignore serialization of specific types or packages in XStream, you can make use of the `XStream` class's `alias` and `omitField` methods to control what gets serialized. However, for more general cases, such as ignoring all types from a specific package (like `javax.*`), you can implement a custom `Converter`. Here...
41,014
[ { "from": "human", "value": "with XStream, how can I ignore the serialization of a defined Type (for instance, when serializing a GUI, i want to ignore all swing types)?\nOr if i want to ignore all javax.* types?\nThanks in advance,\nBurkhard\n" }, { "from": "gpt", "value": "To ignore serializat...
I am currently faced with a difficult sorting problem. I have a collection of events that need to be sorted against each other (a comparison sort) and against their relative position in the list. In the simplest terms I have list of events that each have a priority (integer), a duration (seconds), and an earliest occur...
It sounds like you're tackling a complex scheduling problem that requires careful consideration of priorities and timing constraints. The idea of using an insertion sort approach is indeed suitable here, especially since you need to accommodate real-time constraints with the scheduling of events based on their earliest...
38,890
[ { "from": "human", "value": "I am currently faced with a difficult sorting problem. I have a collection of events that need to be sorted against each other (a comparison sort) and against their relative position in the list.\nIn the simplest terms I have list of events that each have a priority (integer), a...
I am trying to filter an IEnumerable object of the duplicate values, so I would like to get the distinct values from it, for example, lets say that it holds days: monday tuesday wednesday wednesday I would like to filter it and return: monday tuesday wednesday What is the most efficient way to do this in .net 2.0?
In .NET 2.0, you can achieve this by using a combination of `ArrayList` and a `Hashtable` to filter out duplicate values efficiently. Here's how you can do it: 1. Use a `Hashtable` to keep track of the items that you've already seen. 2. Use an `ArrayList` to store the distinct values. Here's a sample code snippet dem...
41,379
[ { "from": "human", "value": "I am trying to filter an IEnumerable object of the duplicate values, so I would like to get the distinct values from it, for example, lets say that it holds days:\nmonday\ntuesday\nwednesday\nwednesday\nI would like to filter it and return:\nmonday \ntuesday\nwednesday\nWhat is ...
I am working on a ASP.net project created with local file system settings. I am using MVC and Jquery. Jquery is working fine when I run the application in debug mode i.e. in ASP.net Development server. I am trying to host the application in IIS 7. In hosted mode, it does not recognize Jquery and gives scripting error '...
The issue you're experiencing—where jQuery is recognized in your ASP.NET Development Server but not when hosted in IIS 7—could be due to several reasons. Here are a few steps you can follow to troubleshoot and resolve the problem: 1. **Script Path Issues**: - Ensure that the paths to your script files are correct a...
40,629
[ { "from": "human", "value": "I am working on a ASP.net project created with local file system settings. I am using MVC and Jquery. Jquery is working fine when I run the application in debug mode i.e. in ASP.net Development server. I am trying to host the application in IIS 7. In hosted mode, it does not rec...
With SQL Server 2005 and transactional replication, can I remove the primary key constraints on the subscriber, while leaving the primary key constraints on the publisher? Primary I want to do this because I want to cluster on different columns than the existing clustered constraints. I don't think I can convert a con...
In SQL Server transactional replication, primary keys (or unique constraints) are essential for the replication process, as they are used to identify rows uniquely. If you want to change the structure of the clustered index or the primary key on the subscriber while leaving it intact on the publisher, you must be cauti...
40,650
[ { "from": "human", "value": "With SQL Server 2005 and transactional replication, can I remove the primary key constraints on the subscriber, while leaving the primary key constraints on the publisher?\nPrimary I want to do this because I want to cluster on different columns than the existing clustered const...
I am ASP.NET developer from last 5 years and still loving it. There are lots of good voices in air about Ruby on Rails. I want to ask to community, Is there any worth trying to learn Ruby On Rails as a ASP.NET web developer on following point of view. Scalability Documentation Community Support Hosting Solutions Deplo...
As an experienced ASP.NET developer considering a shift to Ruby on Rails, it’s important to evaluate the framework through various lenses. Here’s a breakdown based on the criteria you mentioned: ### Scalability - **Ruby on Rails:** Rails applications can be scaled, but historically, it has faced criticism regarding pe...
40,994
[ { "from": "human", "value": "I am ASP.NET developer from last 5 years and still loving it. There are lots of good voices in air about Ruby on Rails. I want to ask to community, Is there any worth trying to learn Ruby On Rails as a ASP.NET web developer on following point of view.\n\nScalability\nDocumentati...
I've been working a little with DevExpress CodeRush and Refactor! Pro this week, and I picked up a commentor plug-in that will automatically generate comments as you type code. I don't want to go into how good a job it does of picking out basic meaning (pretty good, actually) but it's default implementation does raise ...
The practice of adding comments like `// using` at the closing brace of a block can be a topic of debate among developers. Here are some considerations and perspectives regarding this type of comment: ### Pros: 1. **Clarity in Complex Code**: In situations where the code is deeply nested or there are multiple scopes (...
38,656
[ { "from": "human", "value": "I've been working a little with DevExpress CodeRush and Refactor! Pro this week, and I picked up a commentor plug-in that will automatically generate comments as you type code.\nI don't want to go into how good a job it does of picking out basic meaning (pretty good, actually) b...
When debugging I need to start an external program from the target directory of a build and am wondering if it can be accomplished using relative paths. As a post-build event I have the following: IF NOT "$(ConfigurationName)"=="Debug" GOTO End :CopyExecutable copy "$(SolutionDir)\Source\Lib\MyExecutable.exe" "$(Targe...
When you set the "Start external program" in the debug properties of Visual Studio, it typically requires a full path to the executable. However, you can use some workarounds to make it work with relative paths. Here are two common approaches: ### 1. Use Command-Line Arguments to Set the Working Directory You can se...
42,662
[ { "from": "human", "value": "When debugging I need to start an external program from the target directory of a build and am wondering if it can be accomplished using relative paths.\nAs a post-build event I have the following:\n\nIF NOT \"$(ConfigurationName)\"==\"Debug\" GOTO End\n:CopyExecutable\ncopy \"$...
I want to create a List of KeyValuePairs in a managed C++ project. Here is the syntax I'm using List<KeyValuePair<String^, String^>^>^ thing; but I'm getting the following error: error C3225: generic type argument for 'T' cannot be 'System::Collections::Generic::KeyValuePair ^', it must be a value type or a handle to...
In managed C++, especially when working with .NET 2.0, the syntax you are using has a small issue. In C++, value types and reference types are handled differently compared to C#. The `KeyValuePair` struct is a value type, so when you are declaring a `List<KeyValuePair<String^, String^>>`, you should not be using a hand...
42,483
[ { "from": "human", "value": "I want to create a List of KeyValuePairs in a managed C++ project. Here is the syntax I'm using\nList<KeyValuePair<String^, String^>^>^ thing;\n\nbut I'm getting the following error:\n\nerror C3225: generic type argument for 'T' cannot be 'System::Collections::Generic::KeyValueP...
I've got a minidump file from a crash in one of our apps. It's a 32-bit native app, and it was running on 64-bit Windows. If I load the minidump file into WinDbg, WinDbg won't load the symbols for the system DLLs. I've got my symbol paths configured correctly: _NT_SYMBOL_PATH=SRV*C:\WebSymbols*http://msdl.microsoft.com...
It looks like you're experiencing issues with loading symbols for the 32-bit system DLLs on a 64-bit Windows environment when debugging your application's minidump file. The fact that the `!sym noisy` command indicates "Couldn't map image from disk" suggests that the debugger is unable to find the corresponding DLLs to...
38,508
[ { "from": "human", "value": "I've got a minidump file from a crash in one of our apps. It's a 32-bit native app, and it was running on 64-bit Windows.\nIf I load the minidump file into WinDbg, WinDbg won't load the symbols for the system DLLs. I've got my symbol paths configured correctly:\n_NT_SYMBOL_PATH=...
I'm working on a .Net application which uses Asp.net 3.5 and Lucene.Net I am showing search results given by Lucene.Net in an asp.net datagrid. I need to implement Paging (10 records on each page) for this aspx page. How do I get this done using Lucene.Net?
Implementing paging in an ASP.NET application that uses Lucene.Net involves managing how many records you display per page and then requesting the appropriate subset of records from Lucene based on the current page number. Here's a step-by-step guide on how to achieve this. ### Steps to Implement Paging with Lucene.Ne...
37,942
[ { "from": "human", "value": "I'm working on a .Net application which uses Asp.net 3.5 and Lucene.Net I am showing search results given by Lucene.Net in an asp.net datagrid. I need to implement Paging (10 records on each page) for this aspx page.\nHow do I get this done using Lucene.Net?\n" }, { "fro...
If I have srand(2) declared in my main of my driver file, do I need to declare srand(2) in my code file which is being linked with my driver? Thanks. edit (from user's comment below) If I do, srand(2); srand(2); will I get the seed as 2? or something else?
In C, the function `srand()` is used to set the seed for the pseudo-random number generator used by the `rand()` function. Once you call `srand()` with a specific seed value, that seed remains in effect until `srand()` is called again with a new seed value. ### Answer to Your Questions: 1. **Do I need to declare `sr...
41,251
[ { "from": "human", "value": "If I have srand(2) declared in my main of my driver file,\ndo I need to declare srand(2) in my code file which is being linked with my driver?\nThanks.\nedit\n(from user's comment below)\nIf I do,\nsrand(2);\nsrand(2);\n\nwill I get the seed as 2? or something else?\n" }, { ...
I seemed to get the following exception when trying to deploy my application: Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions java.util.List is an interface, and JAXB can't handle interfaces. this problem is related to the following location: at java.u...
The exception you are encountering with JAXB is primarily due to the fact that it cannot serialize or deserialize Java interfaces directly, such as `java.util.List`. When you change your return type from `List` to `List<List<RelationCanonical>>`, you are effectively introducing a nested structure that JAXB is unable to...
41,704
[ { "from": "human", "value": "I seemed to get the following exception when trying to deploy my application:\nCaused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions\njava.util.List is an interface, and JAXB can't handle interfaces.\nthis problem is rela...
Is there a way short of writing a seperate batch file or adding a system call to pause or getch or a breakpoint right before the end of the main function to keep a command window open after a command line application has finished running? Put differently, is there a way in the project properties to run another command ...
To keep a command window open after running a command-line application like `foo.exe` without using a separate batch file or system calls such as `getch()`, you can configure the project settings in some IDEs, although the specific options available depend on the development environment you're using. ### Visual Studio...
40,984
[ { "from": "human", "value": "Is there a way short of writing a seperate batch file or adding a system call to pause or getch or a breakpoint right before the end of the main function to keep a command window open after a command line application has finished running?\nPut differently, is there a way in the ...
Let's say I have the three following lists A1 A2 A3 B1 B2 C1 C2 C3 C4 C5 I'd like to combine them into a single list, with the items from each list as evenly distributed as possible sorta like this: C1 A1 C2 B1 C3 A2 C4 B2 A3 C5 I'm using .NET 3.5/C# but I'm looking more for how to approach it then specific code. E...
To combine the lists you've described while keeping the order of elements from the original lists, you can approach the problem using an interleaving technique. Here's a high-level approach to achieve the desired distribution: ### Steps to Combine the Lists: 1. **Determine the Total Count**: First, determine the tota...
41,770
[ { "from": "human", "value": "Let's say I have the three following lists\nA1\nA2\nA3 \nB1\nB2\nC1\nC2\nC3\nC4\nC5 \nI'd like to combine them into a single list, with the items from each list as evenly distributed as possible sorta like this:\nC1\nA1\nC2\nB1\nC3\nA2\nC4\nB2\nA3\nC5\nI'm using .NET 3.5/C# bu...
In firefox, the error messages display as should. Just to the right of the element being validated. In IE. No matter what I do with the sizing of the labels/elements/errors, the error is always posted below the element, causing every other element to be pushed down. <p> <label for="handle"><strong>User Name</stro...
It sounds like you're facing an issue with how error messages are displayed in Internet Explorer (IE) compared to Firefox. The typical problem you’re encountering is due to the way different browsers handle layout and positioning of elements, especially form validation messages. Here are some potential solutions to en...
38,247
[ { "from": "human", "value": "In firefox, the error messages display as should. Just to the right of the element being validated. In IE. No matter what I do with the sizing of the labels/elements/errors, the error is always posted below the element, causing every other element to be pushed down.\n<p>\n ...
Given two 3D vectors A and B, I need to derive a rotation matrix which rotates from A to B. This is what I came up with: Derive cosine from acos(A . B) Derive sine from asin(|A x B| / (|A| * |B|)) Use A x B as axis of rotation Use matrix given near the bottom of this page (axis angle) This works fine except for rotat...
To create a rotation matrix that rotates vector A to vector B in Direct3D (D3D), you can leverage the `D3DXMatrixRotationAxis` function, which simplifies the process. This function constructs a rotation matrix given an axis of rotation and an angle, which can be derived from the cross product and the dot product of the...
35,664
[ { "from": "human", "value": "Given two 3D vectors A and B, I need to derive a rotation matrix which rotates from A to B.\nThis is what I came up with:\n\nDerive cosine from acos(A . B)\nDerive sine from asin(|A x B| / (|A| * |B|))\nUse A x B as axis of rotation\nUse matrix given near the bottom of this page...
Even before telling my question, will tell you that this is a very vague question. But please let me know if you have any similar ideas. I am actually trying to write a website of my own locally using ASP.Net. I actually wanted to try and simulate a website with trading and stock details. I wanted to actually fetch th...
Creating a website that simulates trading and displays stock details is an exciting project! Here’s a general guide to help you get started, including how to fetch data, some parameters to consider, and ideas to enhance your project. ### 1. Fetching Stock Data You can retrieve stock market data from various APIs. Her...
36,643
[ { "from": "human", "value": "Even before telling my question, will tell you that this is a very vague question. But please let me know if you have any similar ideas. \nI am actually trying to write a website of my own locally using ASP.Net. I actually wanted to try and simulate a website with trading and st...
How can I tell when Windows is changing a monitors power state?
To determine when Windows is changing a monitor's power state, you can utilize several methods, including checking system logs, monitoring specific events, and using third-party tools. Here are some approaches: ### 1. **Event Viewer** Windows logs various system events, including those related to power management. Yo...
38,856
[ { "from": "human", "value": "How can I tell when Windows is changing a monitors power state?\n" }, { "from": "gpt", "value": "To determine when Windows is changing a monitor's power state, you can utilize several methods, including checking system logs, monitoring specific events, and using thir...
I'm supporting/enhancing a web application written in Classic ASP/VBScript. It has been about 10 years since I have used either in a day to day capacity. I just ran across an issue that I would consider a "gotcha" and was wondering if others had similar things that I should learn to be aware of. My issue: I had to co...
Certainly! Working with Classic ASP and VBScript can present various quirks and "gotchas," especially if you're returning to it after a long break. Here are some common issues and nuances that you might encounter: 1. **Variable Types**: - VBScript is loosely typed, which means you don't have to explicitly declare ...
38,837
[ { "from": "human", "value": "I'm supporting/enhancing a web application written in Classic ASP/VBScript. It has been about 10 years since I have used either in a day to day capacity. I just ran across an issue that I would consider a \"gotcha\" and was wondering if others had similar things that I should ...
As being quite a newbie in linux, I have the follwing question. I have list of files (this time resulting from svn status) and i want to create a script to loop them all and replace tabs with 4 spaces. So I want from .... D HTML/templates/t_bla.tpl M HTML/templates/t_list_markt.tpl M HTML/templates/t_vi...
To create a script that replaces tabs with 4 spaces in a list of files you obtained from the `svn status`, you can follow the steps outlined below. ### Step 1: Prepare Your List of Files Assuming you have the output of `svn status` stored in a file, let's say `svn_status.txt`, you can filter the filenames by ignoring...
40,336
[ { "from": "human", "value": "As being quite a newbie in linux, I have the follwing question.\nI have list of files (this time resulting from svn status) and i want to create a script to loop them all and replace tabs with 4 spaces.\nSo I want from \n....\nD HTML/templates/t_bla.tpl\nM HTML/templat...
I'm trying to create a Python script that opens several databases and compares their contents. In the process of creating that script, I've run into a problem in creating a list whose contents are objects that I've created. I've simplified the program to its bare bones for this posting. First I create a new class, cre...
The issue you're encountering arises from the fact that you are not creating a new instance of `SimpleClass` in your loop. Instead, you're modifying the same class reference `x` each time, which results in all elements in your list pointing to the same object. To solve this problem, you need to create a new instance ...
41,828
[ { "from": "human", "value": "I'm trying to create a Python script that opens several databases and compares their contents. In the process of creating that script, I've run into a problem in creating a list whose contents are objects that I've created.\nI've simplified the program to its bare bones for thi...
I have recently written a dynamic querying tool using expression trees and as I went the power of expression trees began to dawn on me. My querying tool could also form the basis of a reporting tool, a dynamic decision engine and maybe other cases where you need to work with dynamic objects in abstract ways. The proce...
Yes, expression trees are indeed a powerful feature in .NET, allowing for the construction of dynamic queries and enabling various use cases such as reporting tools, dynamic decision engines, and more. While you mentioned PredicateBuilder, there are several other libraries and tools that leverage expression trees and c...
40,485
[ { "from": "human", "value": "I have recently written a dynamic querying tool using expression trees and as I went the power of expression trees began to dawn on me. My querying tool could also form the basis of a reporting tool, a dynamic decision engine and maybe other cases where you need to work with dyn...
SQL Server procedure can return result sets. I have a table emp(emp__id, emp__name, ...). The procedure below will return a list of employees that matched with the name provided. CREATE OR REPLACE PROCEDURE get_employee_by_name ( @name VARCHAR(100) ) AS SELECT emp_id, emp_name FROM emp WHERE emp_name = @name; So in th...
In PL/SQL, you can create a procedure that returns a result set in a similar manner, but it requires a different approach compared to SQL Server. In Oracle, you generally use a `REF CURSOR` to return result sets from a stored procedure. Below is a PL/SQL equivalent of your SQL Server procedure. ### Step 1: Create the ...
35,780
[ { "from": "human", "value": "SQL Server procedure can return result sets. I have a table emp(emp__id, emp__name, ...). The procedure below will return a list of employees that matched with the name provided.\nCREATE OR REPLACE PROCEDURE get_employee_by_name ( @name VARCHAR(100) )\nAS\nSELECT emp_id, emp_nam...
Python 2.6 was basically a stepping stone to make converting to Python 3 easier. A lot of the features destined for Python 3 were implemented in 2.6 if they didn't break backward compatibility with syntax and the class libs. Why weren't set literals ({1, 2, 3}), set comprehensions ({v for v in l}), or dict comprehensi...
Your observation about Python 2.6 serving as a transition phase towards Python 3 is correct, and your specific questions about set literals, set comprehensions, and dict comprehensions are quite insightful. The main reason these features were not included in Python 2.6 boils down to the design philosophy and the timel...
42,196
[ { "from": "human", "value": "Python 2.6 was basically a stepping stone to make converting to Python 3 easier. A lot of the features destined for Python 3 were implemented in 2.6 if they didn't break backward compatibility with syntax and the class libs.\nWhy weren't set literals ({1, 2, 3}), set comprehens...
I need to signal a running application (Windows service) when certain things happen in SQL Server (2005). Is there a possibility to send a message from a trigger to an external application on the same system?
Yes, you can signal a running application (like a Windows service) when certain events occur in SQL Server 2005 by using a combination of triggers, Service Broker, or even by executing external commands through SQL Server Agent. However, SQL Server 2005 has some limitations, so here are a few methods you can use to ach...
37,688
[ { "from": "human", "value": "I need to signal a running application (Windows service) when certain things happen in SQL Server (2005). Is there a possibility to send a message from a trigger to an external application on the same system?\n" }, { "from": "gpt", "value": "Yes, you can signal a run...
Working with a traditional listener callback model. I have several listeners that collect various stuff. Each listener's collected stuff is inside the listener in internal structures. The problem is that I want some of the listeners to be aware of some of the "stuff" in the other listeners. I enforce listener registrat...
The design you're currently using, where listeners have explicit references to each other, can indeed lead to tightly coupled code that is hard to maintain and extend. Instead, you might want to consider more decoupled patterns that can still allow communication between listeners. Here are a few design patterns and app...
37,916
[ { "from": "human", "value": "Working with a traditional listener callback model. I have several listeners that collect various stuff. Each listener's collected stuff is inside the listener in internal structures.\nThe problem is that I want some of the listeners to be aware of some of the \"stuff\" in the o...
I have an application that allows different users to update some data that is then published to a website. The application uses JPA as a persistence layer. I now want to add a bit of workflow management to this scenario so that when users with junior roles update data, it is not directly published but rather waits for ...
Implementing a workflow management system within your application, especially one that manages approval processes for updates, can indeed be quite challenging. However, it can be accomplished without significant duplication of your entities. Here are some patterns and strategies you could consider: ### 1. **Versioning...
37,374
[ { "from": "human", "value": "I have an application that allows different users to update some data that is then published to a website. The application uses JPA as a persistence layer. I now want to add a bit of workflow management to this scenario so that when users with junior roles update data, it is not...
In C and C++ a variable can be marked as volatile, which means the compiler will not optimize it because it may be modified external to the declaring object. Is there an equivalent in Delphi programming? If not a keyword, maybe a work around? My thought was to use Absolute, but I wasn't sure, and that may introduce o...
In Delphi, there isn't a direct equivalent to the `volatile` keyword found in C and C++. However, there are ways to achieve similar functionality. ### Using the `volatile` Concept in Delphi 1. **Use `volatile` Data Types**: In Delphi, you can define variables that may be accessed by different threads or hardware and ...
41,409
[ { "from": "human", "value": "In C and C++ a variable can be marked as volatile, which means the compiler will not optimize it because it may be modified external to the declaring object. Is there an equivalent in Delphi programming? If not a keyword, maybe a work around?\nMy thought was to use Absolute, b...
I am starting to learn the Clojure programming language. Are there any recommendations for Clojure editors/IDEs on Mac OS X? Update 2009-09-23: The Clojure space has changed tremendously since I originally posted this question. Many of the links below, especially those that refer to clojure-mode with Emacs, are out-of-...
As of your last updates, there have indeed been many developments in the Clojure ecosystem regarding editors and IDEs. Here are some current recommendations for Clojure development on macOS: 1. **CIDER with Emacs**: CIDER is a powerful interactive development environment for Clojure, built on top of Emacs. It provides...
41,444
[ { "from": "human", "value": "I am starting to learn the Clojure programming language. Are there any recommendations for Clojure editors/IDEs on Mac OS X?\nUpdate 2009-09-23: The Clojure space has changed tremendously since I originally posted this question. Many of the links below, especially those that ref...
Data table structure is: id1,id2,id3,id4,... (some other fields). I want to create summary query to find out how many times some ID value is used in every column. Data 1,2,3,4,2008 2,3,5,1,2008 1,3,2,5,2007 1,2,3,6,2007 3,1,2,5,2007 For value 1, the result should be 1,0,0,1,2008 2,1,0,0,2007 How to accomplish this with...
To achieve the desired output in MySQL, you can use a combination of `UNION ALL`, `GROUP BY`, and `COUNT` to summarize how many times the value `1` appears in each column. Here is how you can construct your query: ```sql SELECT id1 AS id_value, COUNT(*) AS count_id1, 0 AS count_id2, 0 AS count_id3, 0 AS count_id4, yea...
42,722
[ { "from": "human", "value": "Data table structure is:\nid1,id2,id3,id4,... (some other fields).\nI want to create summary query to find out how many times some ID value is used in every column.\nData\n1,2,3,4,2008\n2,3,5,1,2008\n1,3,2,5,2007\n1,2,3,6,2007\n3,1,2,5,2007\nFor value 1, the result should be\n1,...
I am attempting to build a simple method that creates an XML file from a database in ruby on rails. I feel like my code is right but I am not seeing all of the users in the XML. I am a complete newbie to RoR. Here's my code: def create_file @users = User.find(:all) file = File.new('dir.xml','w') doc = Docume...
The issue in your code arises from the way you're adding elements to the XML document. When you call `make.add_element "name"` or `make.add_element "description"`, you're always adding a new element, but you are trying to set the text for a specific element using `make.elements["name"]` and `make.elements["description"...
40,728
[ { "from": "human", "value": "I am attempting to build a simple method that creates an XML file from a database in ruby on rails. I feel like my code is right but I am not seeing all of the users in the XML.\nI am a complete newbie to RoR.\nHere's my code:\ndef create_file \n @users = User.find(:all)\n ...
I have a Java file TestThis.java like the following: class A { public void foo() { System.out.println("Executing foo"); } } class B { public void bar() { System.out.println("Executing bar"); } } The above code file is compiling fine without any warnings/errors. Is there any wa...
In Java, every file is allowed to contain multiple classes, and you can have top-level classes that are not designated as public. However, according to the Java language specification, there can be only one public class per file, and the file name must match the public class name. If a file contains non-public classes ...
41,728
[ { "from": "human", "value": "I have a Java file TestThis.java like the following:\nclass A\n{\n public void foo() \n {\n System.out.println(\"Executing foo\");\n }\n}\n\nclass B\n{\n public void bar()\n {\n System.out.println(\"Executing bar\");\n }\n}\n\nThe above code file ...
I have a combobox at the top of a form that loads editable data into fields below. If the user has made changes, but not saved, and tries to select a different option from the combobox, I want to warn them and give them a chance to cancel or save. I am in need of a "BeforeValueChange" event with a cancelable event arg...
To achieve the functionality you described, you will need to implement a mechanism that checks for unsaved changes when the user interacts with the combobox. Although there may not be a direct `BeforeValueChange` event in all frameworks, you can use a combination of event handlers to implement this behavior. Here's a g...
37,030
[ { "from": "human", "value": "I have a combobox at the top of a form that loads editable data into fields below. If the user has made changes, but not saved, and tries to select a different option from the combobox, I want to warn them and give them a chance to cancel or save.\nI am in need of a \"BeforeVal...
Does .NET have a way to pull email from a POP3 server out of the box or you have to code/buy a 3rd party component?
.NET does not provide built-in support for accessing POP3 email servers directly out of the box. If you want to pull email from a POP3 server using .NET, you would typically need to use a third-party library or component. Here are some popular third-party libraries you can use to work with POP3 in a .NET application: ...
42,471
[ { "from": "human", "value": "Does .NET have a way to pull email from a POP3 server out of the box or you have to code/buy a 3rd party component?\n" }, { "from": "gpt", "value": ".NET does not provide built-in support for accessing POP3 email servers directly out of the box. If you want to pull e...
We have a application that should always be running. Does anyone know of a way to create an automated way of monitoring to see if this application is running (possibly using a batch file)? If it is not running, then send an email notification and start the application?
You can certainly achieve this by creating a batch file that checks if your application is running, sends an email notification if it's not, and then starts the application if necessary. Here's how you can set this up: ### Step 1: Create a Batch File You can create a batch file (`monitor_application.bat`) with the fo...
39,631
[ { "from": "human", "value": "We have a application that should always be running. Does anyone know of a way to create an automated way of monitoring to see if this application is running (possibly using a batch file)? If it is not running, then send an email notification and start the application?\n" }, ...
Since yesterday, I am analyzing one of our project with Ndepend (free for most of its features) and more I am using it, and more I have doubt about the real value of this type of software (code-analysis software). Let me explain, The system build a report about the health of the system and class by Rank every metric. I...
It's great that you're exploring static code analysis tools like NDepend to evaluate your project's code quality. These tools can provide valuable insights, but they also require careful interpretation of the results. Here are some thoughts on your questions: ### Value of Code Analysis Tools 1. **Consistency**: Code ...
40,780
[ { "from": "human", "value": "Since yesterday, I am analyzing one of our project with Ndepend (free for most of its features) and more I am using it, and more I have doubt about the real value of this type of software (code-analysis software).\nLet me explain, The system build a report about the health of th...
I have a triangle mesh that has no texture, but a set color (sort of blue) and alpha (0.7f). This mesh is run time generated and the normals are correct. I find that with lighting on, the color of my object changes as it moves around the level. Also, the lighting doesn't look right. When I draw this object, this is the...
It sounds like you are facing a few issues with your OpenGL rendering setup, particularly with lighting, materials, and the way you're handling state changes. Let's break down the situation and address your questions and concerns one by one: 1. **Lighting Changes with Object Position**: This behavior is expected due t...
39,761
[ { "from": "human", "value": "I have a triangle mesh that has no texture, but a set color (sort of blue) and alpha (0.7f). This mesh is run time generated and the normals are correct. I find that with lighting on, the color of my object changes as it moves around the level. Also, the lighting doesn't look ri...
Strange performance outcome, I have a LINQ to SQL query which uses several let statements to get various info it looks like this public IQueryable<SystemNews> GetSystemNews() { using (var t = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = System.Tra...
The performance discrepancy you are observing between the LINQ to SQL query and the SQL View can be attributed to several factors. Let's break down the possible reasons: 1. **Execution Plan Differences**: When you execute a LINQ query, it gets translated into SQL and the database generates an execution plan based on t...
39,052
[ { "from": "human", "value": "Strange performance outcome, I have a LINQ to SQL query which uses several let statements to get various info it looks like this\n public IQueryable<SystemNews> GetSystemNews()\n{\n using (var t = new TransactionScope(TransactionScopeOption.Required,\n new Tra...
I have a website where clients pay for a service but have to out the money upfront via escrow, I'm very proficient with PHP (this is what the website is coded in) how would I go about implementing an escrow system that would work automatically?
Implementing an automated escrow system in PHP requires several steps, and it's essential to approach the process carefully to ensure security and compliance with legal regulations. Below are general steps you can follow to set up an escrow system for your website. Keep in mind that this is a high-level overview and yo...
26,273
[ { "from": "human", "value": "I have a website where clients pay for a service but have to out the money upfront via escrow, I'm very proficient with PHP (this is what the website is coded in) how would I go about implementing an escrow system that would work automatically?\n" }, { "from": "gpt", ...
How can I get a PHP function go to a specific website when it is done running? For example: <?php //SOMETHING DONE GOTO(http://example.com/thankyou.php); ?> I would really like the following... <?php //SOMETHING DONE GOTO($url); ?> I want to do something like this: <?php //SOMETHING DONE THAT SETS $url he...
In PHP, you can use the `header()` function to redirect the user to a specific URL after your script has finished running some code. However, the correct way to use the `header()` function is to concatenate the variable without quotes, as enclosing the variable in quotes will not evaluate it. Here's how you can do it:...
42,595
[ { "from": "human", "value": "How can I get a PHP function go to a specific website when it is done running?\nFor example:\n<?php\n //SOMETHING DONE\n GOTO(http://example.com/thankyou.php);\n?>\n\nI would really like the following...\n<?php\n //SOMETHING DONE\n GOTO($url);\n?>\n\nI want to do something l...
Somewhere in the code, a waitHandle is used to perfom some actions. However the thing with waithandle is that the form freezes while waiting for some action to complete. So the following code would not work: frmProgressBar.show(); int successOrFail = PerformSynchronousActionUsingWaitHandle(); frmProgressBar.close(); fr...
To address the issue of UI freezing while performing a synchronous operation, you can use a background worker or a Task to run your operation on a different thread, allowing the UI to remain responsive. This way, you can still show the progress bar while performing the operation. Here is a way to implement this using...
41,644
[ { "from": "human", "value": "Somewhere in the code, a waitHandle is used to perfom some actions. However the thing with waithandle is that the form freezes while waiting for some action to complete. So the following code would not work:\nfrmProgressBar.show();\nint successOrFail = PerformSynchronousActionUs...
I'm an application packager trying to make sense of how the COM registry keys (SelfReg) interrelate to the given .dll in Windows. ProgID's, AppID's, TypeLibs, Extensions & Verbs are all tied around the CLSID right? Do CLSID's always use Prog/App IDs or could you just have a file extension class? Which bits are optional...
Understanding the interrelationships between various COM components in the Windows Registry can be complex. Here’s a breakdown of the main components you mentioned and how they interrelate, particularly in the context of application packaging and COM registration. ### Key COM Concepts 1. **CLSID (Class ID)**: - A...
31,407
[ { "from": "human", "value": "I'm an application packager trying to make sense of how the COM registry keys (SelfReg) interrelate to the given .dll in Windows.\nProgID's, AppID's, TypeLibs, Extensions & Verbs are all tied around the CLSID right?\nDo CLSID's always use Prog/App IDs or could you just have a fi...
We have been using the Client Access ODBC drivers when accessing AS/400 data from our .net applications and SQL DTS/SSIS packages. Are there third party drivers that provide better performance or functionality?
Yes, there are several third-party ODBC drivers that you can consider for accessing AS/400 data (IBM i) from your .NET applications and SQL DTS/SSIS packages. These drivers can offer better performance, additional functionality, and improved compatibility compared to the default IBM Client Access ODBC drivers. Here are...
40,680
[ { "from": "human", "value": "We have been using the Client Access ODBC drivers when accessing AS/400 data from our .net applications and SQL DTS/SSIS packages. Are there third party drivers that provide better performance or functionality?\n" }, { "from": "gpt", "value": "Yes, there are several ...
Our client gets Excel files in Excel's HTML format.(That's the way it arrives; nobody has any control over that.) We then need to run a report based on the data in the file. Using ADO.NET (OleDbReader) results in a "External file not in expected format" exception. If the data is converted to regular Excel format it get...
To address the issues you're encountering with reading Excel files in HTML format and your preference for efficiency without using Excel Automation, here are some alternatives that can help you achieve your goal: ### 1. Read HTML as DataTable Directly Since your files are in HTML format, you can parse the HTML tables...
41,357
[ { "from": "human", "value": "Our client gets Excel files in Excel's HTML format.(That's the way it arrives; nobody has any control over that.) We then need to run a report based on the data in the file. Using ADO.NET (OleDbReader) results in a \"External file not in expected format\" exception.\nIf the data...
I'm trying to load spring beans using XmlWebApplicationContext setConfigLocations method. However, I keep getting a BeanIsAbstractException I know that the bean is abstract, I have it configured this way, so Spring should know not to try to instantiate it. I'm using Spring2.0.8.jar with jetspeed2.1. Spring bean: <be...
The `BeanIsAbstractException` in Spring occurs when you try to get an instance of a bean that has been marked as abstract. This is expected behavior, as abstract beans are not supposed to be instantiated directly. In your configuration, you have defined a bean with the `abstract` attribute set to `true`: ```xml <bean...
42,265
[ { "from": "human", "value": "I'm trying to load spring beans using XmlWebApplicationContext setConfigLocations method. However, I keep getting a \nBeanIsAbstractException\n\nI know that the bean is abstract, I have it configured this way, so Spring should know not to try to instantiate it.\nI'm using Sprin...
I'm reading ScottGu's blog about ASP.NET MVC, and found a lot of code cannot compile or doesn't work as expected. http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx So, did ASP.NET MVC go th...
Yes, ASP.NET MVC has undergone significant changes since Scott Guthrie's initial blog posts in 2007. The framework has evolved considerably, with multiple versions being released, each introducing new features, improvements, and breaking changes. The ASP.NET MVC framework has also been integrated into ASP.NET Core, whi...
41,339
[ { "from": "human", "value": "I'm reading ScottGu's blog about ASP.NET MVC, and found a lot of code cannot compile or doesn't work as expected. \nhttp://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx\nhttp://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2...
I have a WPF ListView that is bound to a BindingList<T>. The binding works like a charm, but I have to tab out of the cell to get the bound property to update....this is an issue because most users don't tab out of the last column before clicking the save button. How do I force the list view to "persist" the changes t...
In WPF, when you edit a cell in a `ListView` that is bound to a `BindingList<T>`, the default behavior is that changes are committed when the control loses focus (e.g., when you tab out). However, you can modify this behavior to force the update of the bound properties when the user clicks a button (like a save button)...
37,990
[ { "from": "human", "value": "I have a WPF ListView that is bound to a BindingList<T>. The binding works like a charm, but I have to tab out of the cell to get the bound property to update....this is an issue because most users don't tab out of the last column before clicking the save button.\nHow do I forc...
I have a collection of items that the user needs to group/categorize in several ways. For the sake of an example, let's say it's a collection of cars and the user wants to categorize them in the following ways: Color (red, silver, blue, black, etc.) Body shape (hatch, sedan, coupe, stationwagon, etc.) Seats (2, 4, 5, ...
The challenge you're describing involves creating a flexible categorization system that allows users to define their own categories and values for items while maintaining an intuitive and efficient user experience. Here are a few approaches that can provide a solution to this problem, along with design considerations: ...
37,637
[ { "from": "human", "value": "I have a collection of items that the user needs to group/categorize in several ways. For the sake of an example, let's say it's a collection of cars and the user wants to categorize them in the following ways:\n\nColor (red, silver, blue, black, etc.)\nBody shape (hatch, sedan,...
Consider the following code: <a href="#label2">GoTo Label2</a> ... [content here] ... <a name="label0"></a>More content <a name="label1"></a>More content <a name="label2"></a>More content <a name="label3"></a>More content <a name="label4"></a>More content Is there a way to emulate clicking on the "GoTo Label2" link to...
Yes, you can programmatically scroll to an anchor tag using JavaScript. You can achieve this by using the `scrollIntoView` method. If you'd like to emulate clicking on the "GoTo Label2" link, you can use the following JavaScript code: ```javascript document.addEventListener("DOMContentLoaded", function() { // Find...
41,762
[ { "from": "human", "value": "Consider the following code:\n<a href=\"#label2\">GoTo Label2</a>\n... [content here] ...\n<a name=\"label0\"></a>More content\n<a name=\"label1\"></a>More content\n<a name=\"label2\"></a>More content\n<a name=\"label3\"></a>More content\n<a name=\"label4\"></a>More content\n\nI...
What tag libraries you know for Java EE - JSP, something like displaytag ?
In Java EE, particularly for JSP (JavaServer Pages), there are several tag libraries that can help simplify the development of web applications by providing reusable components and facilitating the presentation layer. Here are some well-known tag libraries: 1. **JSTL (JavaServer Pages Standard Tag Library)**: - A ...
41,495
[ { "from": "human", "value": "What tag libraries you know for Java EE - JSP, something like displaytag ?\n" }, { "from": "gpt", "value": "In Java EE, particularly for JSP (JavaServer Pages), there are several tag libraries that can help simplify the development of web applications by providing re...
Doesn't an ORM usually involve doing something like a select *? If I have a table, MyThing, with column A, B, C, D, etc, then there typically would be an object, MyThing with properties A, B, C, D. It would be evil if that object were incompletely instantiated by a select statement that looked like this, only fetchi...
Your question touches on a common concern in Object-Relational Mapping (ORM) frameworks regarding data retrieval and object instantiation. Let's break down the issues at hand: 1. **Selectivity in Queries**: You raise a valid point about the use of `SELECT *` versus selective queries. While using `SELECT *` can lead to...
42,712
[ { "from": "human", "value": "Doesn't an ORM usually involve doing something like a select *?\nIf I have a table, MyThing, with column A, B, C, D, etc, then there typically would be an object, MyThing with properties A, B, C, D. \nIt would be evil if that object were incompletely instantiated by a select s...
I am designing a WCF service which a client will call to get a list of GUID's from a server. How should I define my endpoint contract? Should I just return an Array? If so, will the array just be serialized by WCF?
When designing a WCF (Windows Communication Foundation) service to return a list of GUIDs, you have a couple of options for defining your endpoint contract. Here’s how to approach it: ### 1. Defining the Service Contract You should define a service contract using an interface with a method that returns a collection o...
42,479
[ { "from": "human", "value": "I am designing a WCF service which a client will call to get a list of GUID's from a server.\nHow should I define my endpoint contract?\nShould I just return an Array? \nIf so, will the array just be serialized by WCF?\n" }, { "from": "gpt", "value": "When designing...
I am testing against the following test document: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>hi there</title> </head> ...
You're correct that the issue arises due to the handling of XML namespaces. When you parse an XML document using `lxml.etree`, elements that are defined within a namespace, such as your `img` tag in the XHTML document, must be queried with that namespace in mind. In your XHTML document, the `img` element is in the `ht...
40,891
[ { "from": "human", "value": "I am testing against the following test document:\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">...
I am currently trying to create an Exception handler built into my windows service that, on an unhandled exception, sends a message to another program. I have built the method and gotten the communication working, but it seems that every time my program throws the error, (I have a raise call in the code to force it.) ...
The issue you're facing is related to how exception handling is configured in Delphi (or similar Pascal-based environments). When you raise an exception in a console application, it needs to be handled properly to avoid being caught by Windows as an unhandled exception, which leads to the application terminating instea...
39,570
[ { "from": "human", "value": "I am currently trying to create an Exception handler built into my windows service that, on an unhandled exception, sends a message to another program. I have built the method and gotten the communication working, but it seems that every time my program throws the error, (I hav...
If you have a particular line of C code in mind to examine in the machine output, how would you locate it in objdump output. Here is an example if (cond) foo; bar(); and I want to see if bar was inlined as I'd like. Or would you use some alternative tool instead of objdump?
To examine whether a specific line of C code, such as the call to `bar()` in your example, has been inlined in the compiled binary, you can indeed use `objdump`, but there are more efficient and informative tools available for this purpose. ### Using `objdump` 1. **Compile with Debug Information**: First, ensure your...
40,106
[ { "from": "human", "value": "If you have a particular line of C code in mind to examine in the machine output, how would you locate it in objdump output. Here is an example\nif (cond)\n foo;\n bar();\n\nand I want to see if bar was inlined as I'd like.\nOr would you use some alternative tool instead of...
I have a question regarding a symptom of my misuse of CreateProcess. I'm using the lpcommandline parameter to feed the path to my executable and parameters. My misuse is that I have not surrounded the path to the exe with quotes. My question is, why does the CreateProcess work just fine on most computers and not oth...
The behavior you're experiencing with `CreateProcess` and the `lpCommandLine` parameter can be attributed to how command-line parsing works in Windows and differences in system configurations. ### Command-Line Parsing in Windows When you call `CreateProcess`, the system needs to parse the command line to determine th...
40,697
[ { "from": "human", "value": "I have a question regarding a symptom of my misuse of CreateProcess. I'm using the lpcommandline parameter to feed the path to my executable and parameters. My misuse is that I have not surrounded the path to the exe with quotes. \nMy question is, why does the CreateProcess wo...
So I am wondering if there is a definitive answer to this question. Also, does it matter if the index is clustered vs. non-clustered. Is it the same in all RDBMS implementations or is the exact behavior going to be proprietary?
The answer to your question depends on several factors related to the context of the question, particularly in the realm of database management systems (RDBMS). Here are some considerations that can help clarify your inquiry: ### 1. **Definitive Answer and Context** - **Definitive Answer**: In some cases, there may b...
40,593
[ { "from": "human", "value": "So I am wondering if there is a definitive answer to this question.\nAlso, does it matter if the index is clustered vs. non-clustered.\nIs it the same in all RDBMS implementations or is the exact behavior going to be proprietary?\n" }, { "from": "gpt", "value": "The ...
I'm working on a project where a program running on the mobile phone needs to communicate with a program running on the PC it's connected to. Ideally, I'd like to use USB, WiFi, whatever to communicate. The two programs should be able to communicate things like battery life, text messages, etc... But I can work on th...
To enable communication between a mobile phone and a PC for your project, there are several options you can consider, depending on your requirements and environment. Here’s a breakdown of the most common methods: ### 1. USB Communication - **ADB (Android Debug Bridge)**: If you're working with an Android device, you c...
41,178
[ { "from": "human", "value": "I'm working on a project where a program running on the mobile phone needs to communicate with a program running on the PC it's connected to. Ideally, I'd like to use USB, WiFi, whatever to communicate.\nThe two programs should be able to communicate things like battery life, t...
I want to do something like this from within Eclipse: http://svn.collab.net/viewvc/svn?view=rev&revision=33845 I use Subversive 0.7.5 with the Native JavaHL 1.5.3 (r33570) Connector. I tried to change something in a my working copy of a branch i'd like to tag and creating a Tag with Team -> Tag... But I got the error m...
It seems you're encountering two separate issues related to SVN operations, one within Eclipse using Subversive and the other on the command line. ### Issue in Eclipse with Subversive: The error message "A path under version control is needed for this operation" suggests that Eclipse does not recognize the path you'r...
40,878
[ { "from": "human", "value": "I want to do something like this from within Eclipse: http://svn.collab.net/viewvc/svn?view=rev&revision=33845\nI use Subversive 0.7.5 with the Native JavaHL 1.5.3 (r33570) Connector.\nI tried to change something in a my working copy of a branch i'd like to tag and creating a Ta...
I have a class storing the name of a WS method to call and the type and value of the only parameter that service receives (it will be a collection of parameters but lets keep it simple for the example): public class MethodCall { public string Method { get; set; } public Type ParType { get; set; } public string Pa...
The issue you're facing is primarily due to the inability to directly cast a string representation of a value to the specified type at runtime. The type of the parameter is determined dynamically at runtime, so you cannot perform direct casts with static typing like in your original examples. Here's how you can modify...
42,623
[ { "from": "human", "value": "I have a class storing the name of a WS method to call and the type and value of the only parameter that service receives (it will be a collection of parameters but lets keep it simple for the example):\npublic class MethodCall\n{\n public string Method { get; set; }\n public ...
I need to generate calibration files* for the Gartrip program. Does anyone known where I can find the file format it uses or, better yet, code for generating them? I'm not to picky on the language. If no one point me at anything better, I'm working on getting some examples to reverse engineer. Shouldn't be to bad as I ...
Generating calibration files for the Gartrip program can be a bit tricky without specific documentation, but since you mentioned that you're working on reverse engineering some examples, that's a good starting point. ### General Steps to Create Calibration Files 1. **Locate Existing Calibration Files:** If you have a...
39,725
[ { "from": "human", "value": "I need to generate calibration files* for the Gartrip program. Does anyone known where I can find the file format it uses or, better yet, code for generating them?\nI'm not to picky on the language.\nIf no one point me at anything better, I'm working on getting some examples to ...
sorry about the title :) Here is my basic problem, I trying to implement an SEO type query for a location. Here are my examples /Leeds /Leeds_England /Hampshire_England /England_Leeds /Europe_England I am trying to get the location, now I am splitting on the '_', then doing a LINQ lookup through my List's for each pa...
Hi Sarkie! It sounds like you're trying to parse location data from a URL-like structure and determine the hierarchy or relationship between the different components of the locations. Let's break down a potential approach to solving this problem. ### Approach 1. **Data Structure**: Define a simple data structure for ...
38,460
[ { "from": "human", "value": "sorry about the title :)\nHere is my basic problem, I trying to implement an SEO type query for a location.\nHere are my examples\n\n/Leeds\n/Leeds_England\n/Hampshire_England\n/England_Leeds\n/Europe_England\n\nI am trying to get the location, now I am splitting on the '_', the...
I'm trying to take advantage of the constant memory, but I'm having a hard time figuring out how to nest arrays. What I have is an array of data that has counts for internal data but those are different for each entry. So based around the following simplified code I have two problems. First I don't know how to alloc...
You're trying to take advantage of constant memory in CUDA while managing a structure that contains pointers to dynamically allocated arrays. I'll help you with both of your problems: ### Problem 1: Allocating Memory for Pointer Members of the Struct Since you want each `data` structure to point to its own dynamicall...
33,716
[ { "from": "human", "value": "I'm trying to take advantage of the constant memory, but I'm having a hard time figuring out how to nest arrays. What I have is an array of data that has counts for internal data but those are different for each entry. So based around the following simplified code I have two p...
I am just getting started creating an AJAX application using server side push. I am using Grizzly Comet on Glassfish V2. Almost all the sample applications use IFrames for updating content on the client side. I want to stick to using JavaScript only. Are there any such sample applications (preferably ones that do not u...
Creating an AJAX application that uses server-side push with Grizzly Comet on Glassfish without relying on IFrames or any JavaScript libraries is definitely achievable. Below, I'll outline a simple approach and provide an example that demonstrates how to do this. ### Basic Concept In this case, you can use the `Event...
38,042
[ { "from": "human", "value": "I am just getting started creating an AJAX application using server side push. I am using Grizzly Comet on Glassfish V2. Almost all the sample applications use IFrames for updating content on the client side. I want to stick to using JavaScript only. Are there any such sample ap...
I'm looking for a good online resource of software patterns. Preferably something with a comprehensive selection and concise well written explanations, not just a collection of links. .Net examples would be nice, but not essential.
There are several excellent online resources for software design patterns that provide comprehensive selections and well-written explanations. Here are a few that you might find particularly useful: 1. **Refactoring.Guru**: - Website: [Refactoring.Guru](https://refactoring.guru/design-patterns) - This site offer...
40,371
[ { "from": "human", "value": "I'm looking for a good online resource of software patterns. Preferably something with a comprehensive selection and concise well written explanations, not just a collection of links. .Net examples would be nice, but not essential.\n" }, { "from": "gpt", "value": "Th...
We've got a Windows 2000 server with WebDAV enabled and are told it's insecure so we should remove it. However, we've got several developer using Interdev and Interdev-enabled sites, so we're concerned they won't be able to work anymore. Are there alternatives that will allow them to use Interdev securely, or must we d...
WebDAV can indeed introduce security vulnerabilities, especially on older systems like Windows 2000 Server. If you're concerned about security, it is a good idea to look for alternatives to using WebDAV. ### Alternatives to WebDAV for Interdev-Enabled Sites 1. **Use FTP/SFTP:** - While you mentioned considering FT...
43,776
[ { "from": "human", "value": "We've got a Windows 2000 server with WebDAV enabled and are told it's insecure so we should remove it. However, we've got several developer using Interdev and Interdev-enabled sites, so we're concerned they won't be able to work anymore.\nAre there alternatives that will allow t...
I want to create 4 rectangles stacked to one row. |----|--|------|------------| The width of every rectangle is binded to value in %. I decided to group rectangles to horizontal StackPanel. To calculate the width of the rectangle I want to write convertor. What I don't know is how to create converter that must be bind...
To create a converter in WPF (or similar XAML-based frameworks) that calculates the width of each rectangle based on a percentage value and the parent's width, you can follow these steps: ### 1. Create the Value Converter First, you need to create a class that implements the `IValueConverter` interface. This class wi...
38,293
[ { "from": "human", "value": "I want to create 4 rectangles stacked to one row. \n|----|--|------|------------|\nThe width of every rectangle is binded to value in %.\nI decided to group rectangles to horizontal StackPanel. To calculate the width of the rectangle I want to write convertor.\nWhat I don't know...
The performance of a Direct3D application seems to be significantly better in full screen mode compared to windowed mode. What are the technical reasons behind this? I guess it has something to do with the fact that a full screen application can gain exclusive control for the display. But why the application cannot gai...
The performance differences between full-screen and windowed modes in a Direct3D application can be attributed to several technical factors: ### 1. **Exclusive Mode vs. Shared Mode:** - **Full-Screen Exclusive Mode:** In full-screen mode, applications can take exclusive control over the graphics hardware and the en...
35,904
[ { "from": "human", "value": "The performance of a Direct3D application seems to be significantly better in full screen mode compared to windowed mode. What are the technical reasons behind this?\nI guess it has something to do with the fact that a full screen application can gain exclusive control for the d...
In Rails Migrations, what does the number specified for the :limit parameter on an integer represent? Is it the number of bytes or the number of digits? i.e. If I were to specify the following: t.integer :coefficient, :limit => 2 Does that mean the SQL database will reserve two bytes for each integer, or that each in...
In Rails migrations, the `:limit` parameter for an integer specifies the storage size of the integer in bytes, not the number of digits. The `:limit` value indicates how much storage space the database will allocate for the integer column, which in turn determines the range of values that can be stored. Here's a quick...
43,168
[ { "from": "human", "value": "In Rails Migrations, what does the number specified for the :limit parameter on an integer represent? Is it the number of bytes or the number of digits?\ni.e. If I were to specify the following:\nt.integer :coefficient, :limit => 2\n\nDoes that mean the SQL database will reserv...
Why are there not more opensource easy to use charting libraries for Java?. The only successful opensource project in this area seems to be jfreechart, and it doesn't even have any documentation or examples available.
The landscape of open-source charting libraries for Java, while not as expansive as in some other programming languages (like JavaScript with libraries like D3.js or Chart.js), does include a few notable projects, although their popularity and ease of use can vary. Here are some reasons why there may not be as many eas...
41,811
[ { "from": "human", "value": "Why are there not more opensource easy to use charting libraries for Java?. The only successful opensource project in this area seems to be jfreechart, and it doesn't even have any documentation or examples available.\n" }, { "from": "gpt", "value": "The landscape of...
This is not a really technical question but is required for a system I am building. I am after a UK suburb/postcode database. I haven't been able to find this anywhere and wonder if it is available (freely). I know in Australia is is freely downloadable from Australia Post. Also a US suburb/zip database is required as ...
In the UK, there are several resources where you can find postcode and suburb data, although free options may have limitations. Here are some suggestions: ### UK Postcode and Suburb Data 1. **Office for National Statistics (ONS)**: - The ONS provides various datasets that include geographical data for postcodes. Y...
39,992
[ { "from": "human", "value": "This is not a really technical question but is required for a system I am building. I am after a UK suburb/postcode database. I haven't been able to find this anywhere and wonder if it is available (freely). I know in Australia is is freely downloadable from Australia Post. Also...
How do you determine what to put in .rhosts file in an VAX openvms system when trying to remotely access the server using a remote shell from Cygwin on windows XP ? .rlogin and rsh are the only methods that can be used to access the VAX server and it must be using Cygwin to remote in to the VAX server. SSH is not an op...
When configuring the `.rhosts` file on a VAX OpenVMS system for remote access using `rlogin` or `rsh`, you need to ensure that the remote host (in this case, your Cygwin environment on Windows XP) is properly authorized to connect. The `.rhosts` file specifies which users from which hosts can log in without needing a p...
38,144
[ { "from": "human", "value": "How do you determine what to put in .rhosts file in an VAX openvms system when trying to remotely access the server using a remote shell from Cygwin on windows XP ? .rlogin and rsh are the only methods that can be used to access the VAX server and it must be using Cygwin to remo...
I've experienced rather strange behavior of JSTL forEach tag. I have some bean called SessionBean: public class SessionBean { private Collection<MyObject> objects; public Collection<MyObject> getObjects() {return objects;} ... } And a simple JSP page like that: <%@page contentType="text/html"%> <%@page pageEncod...
The behavior you're observing when using JSTL (JavaServer Pages Standard Tag Library) with JSF (JavaServer Faces) in J2EE 1.4 relates to how each of these technologies handles EL (Expression Language) and how they integrate with each other. ### Explanation of the Issues 1. **EL Syntax Differences**: - In JSF, you ...
38,763
[ { "from": "human", "value": "I've experienced rather strange behavior of JSTL forEach tag.\nI have some bean called SessionBean:\npublic class SessionBean {\n private Collection<MyObject> objects;\n public Collection<MyObject> getObjects() {return objects;}\n ...\n}\n\nAnd a simple JSP page like that:\n<...
Is it possible to manipulate the controls tree of a WPF window programatically? I have a string that contains an arbitrary WPF XAML code. I show the content in a content control. No Problem so far. Additionally I want to decorate every Grid control that's contained within the XAML snippet with let's say a special Bord...
Yes, it's possible to manipulate the controls tree of a WPF window programmatically, including decorating every `Grid` control within an arbitrary XAML snippet. To achieve this, you can follow these steps: 1. **Parse the XAML**: You can load the string containing the XAML into a `FrameworkElement` using `XamlReader.Lo...
35,740
[ { "from": "human", "value": "Is it possible to manipulate the controls tree of a WPF window programatically?\nI have a string that contains an arbitrary WPF XAML code. I show the content in a content control. No Problem so far. \nAdditionally I want to decorate every Grid control that's contained within the...
When opening a window, I register a Deleted-event-handler on my business object. It is passed to the constructor as business: business.Deleted += new EventHandler<EventArgs>(business_Deleted); Now the user can click a button to delete it (removing the record, you know). The event handler is registered to capture delet...
It sounds like you're encountering a common issue with event handling in C#. When you register an event handler, it's important to ensure that you unregister it correctly and that you're referencing the same instance of the event handler when you do so. Here's a step-by-step guide to help you resolve the issue: 1. **...
35,788
[ { "from": "human", "value": "When opening a window, I register a Deleted-event-handler on my business object. It is passed to the constructor as business:\nbusiness.Deleted += new EventHandler<EventArgs>(business_Deleted);\n\nNow the user can click a button to delete it (removing the record, you know). The ...
Python 3.0 breaks backwards compatibility with previous versions and splits the language into two paths (at least temporarily). Do you know of any other language that went through such a major design phase while in maturity? Also, do you believe that this is how programming languages should evolve or is the price to pa...
Yes, several programming languages have gone through significant design changes that resulted in breaking backward compatibility with previous versions, similar to what Python 3.0 did. Here are a few examples: 1. **Java**: While Java generally maintains backward compatibility, certain significant changes, like the int...
41,649
[ { "from": "human", "value": "Python 3.0 breaks backwards compatibility with previous versions and splits the language into two paths (at least temporarily). Do you know of any other language that went through such a major design phase while in maturity?\nAlso, do you believe that this is how programming lan...
There's a web services I want to call in my application, I can use it with importing the WSDL or by just use "HTTP GET" with the URL and parameters, so I prefer the later because it's simple thing. I know I can use indy idhttp.get, to do the job, but this is very simple thing and I don't want to add complex indy code t...
If you're looking for a lightweight way to make an HTTP GET request without using complex Indy components, you can use the built-in `TNetHTTPClient` in Delphi, which is simpler and does not require you to add any additional components. Here's a simple example of how to perform an HTTP GET request with `TNetHTTPClient`....
41,778
[ { "from": "human", "value": "There's a web services I want to call in my application, I can use it with importing the WSDL or by just use \"HTTP GET\" with the URL and parameters, so I prefer the later because it's simple thing.\nI know I can use indy idhttp.get, to do the job, but this is very simple thing...
I am implementing long running processes that require to a process bar - or progress percentage - to be displayed. The overall logic of the long running process is complex (various paged data retrieval), and as a result, I end up hardcoding lots of percentages in various places within the code. What are considered as t...
When designing a system to update a completion percentage for long-running processes, using design patterns can significantly enhance the maintainability and flexibility of your implementation. Here are several design patterns and best practices that are considered effective in such scenarios: ### 1. **Observer Patter...
38,211
[ { "from": "human", "value": "I am implementing long running processes that require to a process bar - or progress percentage - to be displayed. The overall logic of the long running process is complex (various paged data retrieval), and as a result, I end up hardcoding lots of percentages in various places ...
What is your suggested solution for the threat of website UI spoofing?
Website UI spoofing, also known as phishing, occurs when a malicious actor creates a fake interface that mimics a legitimate website to deceive users into entering sensitive information. Here are several suggested solutions to mitigate the threat of website UI spoofing: 1. **User Education and Awareness**: - Conduc...
41,539
[ { "from": "human", "value": "What is your suggested solution for the threat of website UI spoofing?\n" }, { "from": "gpt", "value": "Website UI spoofing, also known as phishing, occurs when a malicious actor creates a fake interface that mimics a legitimate website to deceive users into entering...
Is there any way to monitor/log thread interactions in the .NET runtime much like VisualVM does for Java? I don't have a specific need at the moment but I think it would be nice to see how all the threads in my application interact.
Yes, there are several ways to monitor and log thread interactions in .NET applications, similar to how VisualVM works for Java. Here are some tools and techniques you can use to get insights into thread interactions and performance in .NET: ### 1. **Visual Studio Diagnostics Tools** - **Thread Window**: When debug...
40,172
[ { "from": "human", "value": "Is there any way to monitor/log thread interactions in the .NET runtime much like VisualVM does for Java? I don't have a specific need at the moment but I think it would be nice to see how all the threads in my application interact.\n\n" }, { "from": "gpt", "value":...
The Reporting Database in Project Server 2007 has about 7 "User Views" based on Assignment, Resource, Task, and Project. They all have fields for Work, OvertimeWork, ActualWork, MaterialWork, BudgetWork, ActualRegularWork. How do all these fields relate in terms of a formula. I can't find a good resource on it. Than...
In Project Server 2007, the fields you've mentioned—Work, OvertimeWork, ActualWork, MaterialWork, BudgetWork, and ActualRegularWork—are used to track different aspects of project management concerning resources and assignments. Here's a brief explanation of each of these fields and how they relate to one another: 1. *...
42,181
[ { "from": "human", "value": "The Reporting Database in Project Server 2007 has about 7 \"User Views\" based on Assignment, Resource, Task, and Project. They all have fields for Work, OvertimeWork, ActualWork, MaterialWork, BudgetWork, ActualRegularWork. How do all these fields relate in terms of a formula...
I need to compare build outputs of VS2005 in order to be sure I can reproduce the exact same product. when I do two builds one after the other in release and compare the produced files I get different files, doing text comparison it seems that more than just the datetime is different how can I build in order to reprodu...
To reproduce the exact same build output in Visual Studio 2005 (VS2005), there are several factors you need to consider to ensure that the build environment is consistent. Here are some strategies to help you achieve reproducible builds: ### 1. **Ensure the Same Source Code** - Make sure you are using the exact sam...
38,078
[ { "from": "human", "value": "I need to compare build outputs of VS2005 in order to be sure I can reproduce the exact same product.\nwhen I do two builds one after the other in release and compare the produced files I get different files, doing text comparison it seems that more than just the datetime is dif...
Is there a way to 'pre-build' a snippet of HTML before adding it to the DOM? For example: $mysnippet.append("<h1>hello</h1>"); $mysnippet.append("<h1>world</h1>"); $("destination").append($mysnippet); where $mysnippet doesnt exist in the DOM. I'd like to dynamically build up some lumps of html and then insert them int...
Yes, you can pre-build an HTML snippet in jQuery (or vanilla JavaScript) without it needing to exist in the DOM until you are ready to insert it. You can create a jQuery object to hold your HTML and append elements to it, and then insert it into the DOM later. Here’s how you can do it using jQuery: ```javascript // ...
42,907
[ { "from": "human", "value": "Is there a way to 'pre-build' a snippet of HTML before adding it to the DOM?\nFor example:\n$mysnippet.append(\"<h1>hello</h1>\");\n$mysnippet.append(\"<h1>world</h1>\");\n$(\"destination\").append($mysnippet);\n\nwhere $mysnippet doesnt exist in the DOM. I'd like to dynamically...
I am trying to get a header that will work with Apache, IIS 6, and IIS 7. I won't go into the reason for that here. Let's just say that it's not as easy as I thought it would be :-) Anyway, the problem has something to do with NPH. In our code (originally written for IIS 6) we have use CGI qw(:standard); print "HTT...
To achieve compatibility across Apache, IIS 6, and IIS 7 using Perl CGI scripts, particularly with regard to the handling of NPH (Non-Parsed Headers), you need to ensure that the correct HTTP headers are sent in all cases. Here's how you can adjust your CGI scripts to handle this in a way that works across the differ...
39,878
[ { "from": "human", "value": "I am trying to get a header that will work with Apache, IIS 6, and IIS 7. I won't go into the reason for that here. Let's just say that it's not as easy as I thought it would be :-)\nAnyway, the problem has something to do with NPH. In our code (originally written for IIS 6) ...
Context Take a look at Wordle: http://www.wordle.net/ It's much better looking than any other word cloud generators I've seen Note: the source is not available - read the FAQ: http://www.wordle.net/faq#code My Questions Is there an algorithm available that does what Wordle does? If no, what are some alternatives tha...
### Word Cloud Generation Algorithms **Is there an algorithm available that does what Wordle does?** While the exact algorithm used by Wordle is proprietary and not publicly available, there are several common algorithms and techniques for generating word clouds: 1. **Frequency Count**: The primary method is to count...
43,171
[ { "from": "human", "value": "Context\n\nTake a look at Wordle: http://www.wordle.net/\nIt's much better looking than any other word cloud generators I've seen\nNote: the source is not available - read the FAQ: http://www.wordle.net/faq#code\n\nMy Questions\n\nIs there an algorithm available that does what W...
I'm designing a multi-tiered database driven web application – SQL relational database, Java for the middle service tier, web for the UI. The language doesn't really matter. The middle service tier performs the actual querying of the database. The UI simply asks for certain data and has no concept that it's backed by a...
Handling large datasets in a multi-tiered web application is a common challenge. The two solutions you've already mentioned—lazy loading and pagination—are both valid approaches, but let's discuss them in more detail, along with additional design patterns commonly used in industry to address this issue. ### 1. Paginat...
39,660
[ { "from": "human", "value": "I'm designing a multi-tiered database driven web application – SQL relational database, Java for the middle service tier, web for the UI. The language doesn't really matter.\nThe middle service tier performs the actual querying of the database. The UI simply asks for certain dat...
Is there any provable reason why I should always specify the SQL data type for SqlCommand paramenters?
Yes, there are several important reasons for specifying the SQL data type for parameters in an `SqlCommand`. Here are some key points that support this practice: 1. **Type Safety**: By explicitly defining the data type, you ensure that the values being passed to the SQL command match the expected types in the database...
42,152
[ { "from": "human", "value": "Is there any provable reason why I should always specify the SQL data type for SqlCommand paramenters?\n" }, { "from": "gpt", "value": "Yes, there are several important reasons for specifying the SQL data type for parameters in an `SqlCommand`. Here are some key poin...
What is the preferred way to use stored procedures between the following two methods and why: One general SP such as 'GetOrders' which returns all the columns for the table Order. Several different parts of the application will use the same SP. OR Several more specific SPs such as 'GetOrdersForUse1' and 'GetOrdersForU...
When deciding between a general stored procedure (SP) that returns all columns from a table and several specific stored procedures that return only a subset of columns, there are several factors to consider. Each approach has its pros and cons, and the best choice often depends on your application's specific requiremen...
40,689
[ { "from": "human", "value": "What is the preferred way to use stored procedures between the following two methods and why:\nOne general SP such as 'GetOrders' which returns all the columns for the table Order. Several different parts of the application will use the same SP.\nOR\nSeveral more specific SPs s...