instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
You can do it in .NET by using the keyword "ref". Is there any way to do so in Java?
In Java, the concept of "ref" as in .NET does not exist in the same way. The `ref` keyword in .NET allows you to pass arguments by reference, which enables a method to modify the value of the argument passed to it. In Java, all objects are passed by reference, meaning that when you pass an object to a method, you are ...
48,948
[ { "from": "human", "value": "You can do it in .NET by using the keyword \"ref\". Is there any way to do so in Java?\n" }, { "from": "gpt", "value": "In Java, the concept of \"ref\" as in .NET does not exist in the same way. The `ref` keyword in .NET allows you to pass arguments by reference, whi...
I wanted to use T4 to generate properties for a partial class. I'm running into a configuration problem where my .TT file is in the same project as the class file I want to extend. So if I have to include the assembly in the .TT file it get's locked. I tried to do a command line in the pre-build but the problem there i...
You're encountering a common scenario when using T4 templates in the same project as the partial classes you want to extend. The locking issue arises because Visual Studio attempts to compile everything in the project, including the generated files from your T4 template, while you're also trying to generate files dynam...
47,392
[ { "from": "human", "value": "I wanted to use T4 to generate properties for a partial class. I'm running into a configuration problem where my .TT file is in the same project as the class file I want to extend. So if I have to include the assembly in the .TT file it get's locked. I tried to do a command line...
I attempted to update sql server 2005 with SP2. I get a failure due to not starting vss writer. When I go into services, I see that vss writer is not installed. (not even listed in services). When I check my other redundant servers, I see that vss writer service is installed. How do I add the service?
The Volume Shadow Copy Service (VSS) is a Windows service that is required for taking consistent snapshots of data, especially for backup operations. If the VSS Writer is not showing up in your SQL Server 2005 installation, it may indicate an issue with your operating system installation or configuration. Here are som...
46,445
[ { "from": "human", "value": "I attempted to update sql server 2005 with SP2. I get a failure due to not starting vss writer. When I go into services, I see that vss writer is not installed. (not even listed in services). When I check my other redundant servers, I see that vss writer service is installed...
I try to keep my fingers on home row as much as possible. Typing all the parentheses makes me move away from there a fair bit. I use Emacs; the parentheses themselves are no issue, I'm comfortable with them. And I don't like modes that type them for me automatically. I've thought about remapping the square brackets t...
Remapping square brackets to parentheses can be a viable solution to reduce finger movement while typing in Emacs, especially if you're comfortable with the idea and your workflow primarily involves using parentheses more frequently than square brackets. Here are some considerations and alternative solutions: ### Pros...
49,237
[ { "from": "human", "value": "I try to keep my fingers on home row as much as possible.\nTyping all the parentheses makes me move away from there a fair bit. \nI use Emacs; the parentheses themselves are no issue, I'm comfortable with them. And I don't like modes that type them for me automatically. \nI've t...
I'm just wondering how other developers tackle this issue of getting 2 or 3 answers from a method. 1) return a object[] 2) return a custom class 3) use an out or ref keyword on multiple variables 4) write or borrow (F#) a simple Tuple<> generic class http://slideguitarist.blogspot.com/2008/02/whats-f-tuple.html I'm wo...
When it comes to returning multiple values from a method in .NET, there are several common approaches, each with its own pros and cons. Here’s a breakdown of the options you've mentioned, along with some additional insights: ### 1. Returning an `object[]` - **Pros**: Simple and quick to implement; no need for a custom...
47,815
[ { "from": "human", "value": "I'm just wondering how other developers tackle this issue of getting 2 or 3 answers from a method.\n1) return a object[]\n2) return a custom class\n3) use an out or ref keyword on multiple variables\n4) write or borrow (F#) a simple Tuple<> generic class\nhttp://slideguitarist.b...
All, I'd like to check Django out and maybe hack together some web pages to see how it feels - but after having a look at a few tutorials like this one I am starting to wonder if there is any way of getting it up and runinng without typying cmd line stuff for 1/2 hour. Can people point out some good straightforward res...
Getting Django up and running on Windows can indeed feel daunting at first, but with the right resources, you can streamline the process. Here are some straightforward resources and steps to help you get started with minimal command line interaction: ### Step-by-Step Guide 1. **Install Python:** - Download the lat...
41,104
[ { "from": "human", "value": "All,\nI'd like to check Django out and maybe hack together some web pages to see how it feels - but after having a look at a few tutorials like this one I am starting to wonder if there is any way of getting it up and runinng without typying cmd line stuff for 1/2 hour.\nCan peo...
I was trying to raise a post back event by div tag. I don't know how to do that. AL I could think of is javascript, but that is not what I want. I need to call function of a class inside a event handler.
If you're working within a web application and want to trigger a postback event in ASP.NET Web Forms using a `div` element, you typically would use a server control or use JavaScript, as you mentioned. However, you can trigger postbacks with a `div` without JavaScript by wrapping it in a server-side control like a `Lin...
45,095
[ { "from": "human", "value": "I was trying to raise a post back event by div tag.\nI don't know how to do that. AL I could think of is javascript, but that is not what I want.\nI need to call function of a class inside a event handler. \n" }, { "from": "gpt", "value": "If you're working within a...
Or more generally, how do I remove an item from a colon-separated list in a Bash environment variable? I thought I had seen a simple way to do this years ago, using the more advanced forms of Bash variable expansion, but if so I've lost track of it. A quick search of Google turned up surprisingly few relevant results ...
Certainly! You can manipulate a colon-separated list in a Bash environment variable using a variety of techniques, and it's great to hear that you've explored different methods. Here's a concise way to achieve the removal of an item from a colon-separated list without needing external tools like `sed` or `awk`. You can...
48,509
[ { "from": "human", "value": "Or more generally, how do I remove an item from a colon-separated list in a Bash environment variable?\nI thought I had seen a simple way to do this years ago, using the more advanced forms of Bash variable expansion, but if so I've lost track of it. A quick search of Google tu...
Can someone share a simple example of using the foreach keyword with custom objects?
Certainly! The `foreach` keyword is commonly used in programming languages like C# and PHP to iterate over collections or arrays. Below is a simple example in C# using custom objects. ### Example in C# Let's say we have a custom class called `Person`. We will create a list of `Person` objects and then use the `foreac...
44,473
[ { "from": "human", "value": "Can someone share a simple example of using the foreach keyword with custom objects?\n" }, { "from": "gpt", "value": "Certainly! The `foreach` keyword is commonly used in programming languages like C# and PHP to iterate over collections or arrays. Below is a simple e...
We have a SQL Server 2005 database, and currently all our users are connecting to the database via the TCP/IP protocol. The SQL Server Configuration Manager allows you to "enable" both Named Pipes, and TCP/IP connections at the same time. Is this a good idea? My question is not whether we should use named pipes instea...
Enabling both Named Pipes and TCP/IP protocols in SQL Server does not inherently limit the bandwidth that either protocol can use. Each protocol operates independently, and SQL Server will handle connections over both protocols based on the client's requests. Here’s a breakdown of the key points regarding this scenar...
48,055
[ { "from": "human", "value": "We have a SQL Server 2005 database, and currently all our users are connecting to the database via the TCP/IP protocol. \nThe SQL Server Configuration Manager allows you to \"enable\" both Named Pipes, and TCP/IP connections at the same time. Is this a good idea? My question is ...
Does anyone know how function indexes work in databases?
Yes, function indexes, also known as expression indexes or function-based indexes, are a powerful feature in databases that allow you to create indexes based on the result of a function or expression rather than just on the raw column values. This can significantly improve the performance of queries that involve comple...
46,726
[ { "from": "human", "value": "Does anyone know how function indexes work in databases?\n" }, { "from": "gpt", "value": "Yes, function indexes, also known as expression indexes or function-based indexes, are a powerful feature in databases that allow you to create indexes based on the result of a ...
I'm having an issue setting up one of my projects in TeamCity (v4.0), specifically when it comes to using Object Initializers. The project builds fine normally, however it would seem that TeamCity transforms the build file into something it likes (some MSBuild mutation) and when it comes to compiling the code for a par...
You're correct in your assessment that object initializers are a feature introduced in .NET 3.0, and they cannot be compiled using the .NET 2.0 compiler (CSC.exe located in `C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\`). The errors you're encountering stem from the fact that the build process in TeamCity is picking ...
46,752
[ { "from": "human", "value": "I'm having an issue setting up one of my projects in TeamCity (v4.0), specifically when it comes to using Object Initializers.\nThe project builds fine normally, however it would seem that TeamCity transforms the build file into something it likes (some MSBuild mutation) and whe...
[This question is somewhat related to this question, but the answers are not...] I have always used relative paths in HTML and scripting languages (PHP/ASP/JSP) to refer to EVERYTHING. I think the justification had to do with 'what if the website gets hosted in some weird subdirectory.' But my coworker has started thro...
Using relative paths versus absolute paths in web development can depend on several factors, including the specific needs of your project, the server environment, and the development practices of your team. Here are some considerations to help you decide whether to use relative or absolute paths: ### Advantages of Rel...
48,685
[ { "from": "human", "value": "[This question is somewhat related to this question, but the answers are not...]\nI have always used relative paths in HTML and scripting languages (PHP/ASP/JSP) to refer to EVERYTHING. I think the justification had to do with 'what if the website gets hosted in some weird subdi...
If I create a UserControl and add some objects to it, how can I grab the HTML it would render? ex. UserControl myControl = new UserControl(); myControl.Controls.Add(new TextBox()); // ...something happens return strHTMLofControl; I'd like to just convert a newly built UserControl to a string of HTML.
To convert a `UserControl` to its HTML representation in ASP.NET, you can use the `HtmlTextWriter` class in combination with a `StringWriter` to render the control and capture the output as a string. Here's how you can do that: ### Step-by-Step Approach 1. **Create a StringWriter and HtmlTextWriter**: Use these to ca...
46,762
[ { "from": "human", "value": "If I create a UserControl and add some objects to it, how can I grab the HTML it would render?\nex.\nUserControl myControl = new UserControl();\nmyControl.Controls.Add(new TextBox());\n\n// ...something happens\n\nreturn strHTMLofControl;\n\nI'd like to just convert a newly buil...
I have this code: if (file.exists()) { Document doc = builder.parse(file); NodeList list = doc.getElementsByTagName("property"); System.out.println("XML Elements: "); for (int ii = 0; ii < list.getLength(); ii++) { line 2 gives following exception E:\workspace\test\testDomain\src\com\test\ins\nxg\maps\Right.h...
The exception you're encountering, `java.net.SocketException: Operation timed out: connect: could be due to invalid address`, suggests that the XML parser (or some underlying library it's using) is trying to access a resource over the network (like an external schema or DTD) but is failing due to a timeout. ### Possib...
48,301
[ { "from": "human", "value": "I have this code:\nif (file.exists()) {\n Document doc = builder.parse(file);\n NodeList list = doc.getElementsByTagName(\"property\");\n System.out.println(\"XML Elements: \");\n for (int ii = 0; ii < list.getLength(); ii++) {\n\nline 2 gives following exception\n\nE:\\work...
One of my pages of my site is behaving really weird in IE6. One element is ignoring its background color and border. The other element is invisible (textcolor same as foreground color?) The elements are not always showing this behaviour, but about 50% of the loads without any pattern. When the browser window is resized...
Debugging issues in Internet Explorer 6 can be particularly challenging due to its outdated rendering engine and various quirks. Here are some steps you can take to diagnose and potentially fix the issues you’re encountering: ### 1. **Use Developer Tools:** - While IE6 doesn't have advanced developer tools like mod...
47,163
[ { "from": "human", "value": "One of my pages of my site is behaving really weird in IE6.\nOne element is ignoring its background color and border.\nThe other element is invisible (textcolor same as foreground color?)\nThe elements are not always showing this behaviour, but about 50% of the loads without any...
I have Visual Studio 2008 with SP1 installed and it is crashing when I'm using lambda expressions in the Moq Framework. At first I thought the problem was Resharper...but now that I have uninstalled it, VS 2008 still crashes. I'm able to replicate the issue every time. I'm thinking perhaps it may be some other plugin t...
Visual Studio 2008 does not have built-in crash logging similar to newer versions of Visual Studio or modern IDEs. However, you can try a few methods to gather information regarding the crashes. ### Check the Windows Event Viewer 1. **Open Event Viewer**: - Press `Win + R`, type `eventvwr`, and hit `Enter`. - T...
46,957
[ { "from": "human", "value": "I have Visual Studio 2008 with SP1 installed and it is crashing when I'm using lambda expressions in the Moq Framework.\nAt first I thought the problem was Resharper...but now that I have uninstalled it, VS 2008 still crashes. I'm able to replicate the issue every time.\nI'm thi...
I'm trying to complete the last part of my Haskell homework and I'm stuck, my code so far: data Entry = Entry (String, String) class Lexico a where (<!), (=!), (>!) :: a -> a -> Bool instance Lexico Entry where Entry (a,_) <! Entry (b,_) = a < b Entry (a,_) =! Entry (b,_) = a == b Entry (a,_) >! Entr...
To implement the binary search function as described in your homework assignment, you can follow these steps: 1. **Understand the function signature**: The `binsearch` function takes three parameters: the word you want to search for (as a `String`), and two integers that represent the lower and upper bounds of the sea...
44,823
[ { "from": "human", "value": "I'm trying to complete the last part of my Haskell homework and I'm stuck, my code so far:\ndata Entry = Entry (String, String)\n\nclass Lexico a where\n (<!), (=!), (>!) :: a -> a -> Bool\n\ninstance Lexico Entry where\n Entry (a,_) <! Entry (b,_) = a < b\n Entry (a,_...
I'm slowly moving from PHP5 to Python on some personal projects, and I'm currently loving the experience. Before choosing to go down the Python route I looked at Ruby. What I did notice from the ruby community was that monkey-patching was both common and highly-regarded. I also came across a lot of horror stories regar...
You've raised an interesting topic that often sparks debate among developers. Let's break down the concerns around monkey-patching in Python, its relationship with Object-Oriented principles, and when it might be appropriate to use. ### Understanding Monkey-Patching Monkey-patching refers to the practice of modifying...
44,772
[ { "from": "human", "value": "I'm slowly moving from PHP5 to Python on some personal projects, and I'm currently loving the experience. Before choosing to go down the Python route I looked at Ruby. What I did notice from the ruby community was that monkey-patching was both common and highly-regarded. I also ...
I have a SSRS report and using PL/SQL for the dataset creation. My report needs two tables 1 one gives detailed view.(dataset 1) 2 one below that gives a summary table (data should come from the calculations based on the data in 1 table) I am using a temporary table for the dataset one. What are the methods to get...
In SQL Server Reporting Services (SSRS), when you need to create multiple datasets (like your detailed view and summary table) and your detailed dataset relies on a temporary table, there are a few considerations and methods to achieve your goal. Here are some options to get the summary data from your first dataset. #...
47,890
[ { "from": "human", "value": "I have a SSRS report and using PL/SQL for the dataset creation.\nMy report needs two tables \n1 one gives detailed view.(dataset 1)\n2 one below that gives a summary table (data should come from the calculations based on the data in 1 table) \nI am using a temporary table for t...
I've been having an agruement with a friend that Mason (Perl) is not a framework, but a templating language. I feel Mason for Perl does what JSP does for Java (as an analogy, not pure technical comparison). From what I know, JSP is not a framework and I feel neither is Mason. When I looked up wikipedia Mason (Perl), I ...
The debate over whether Mason for Perl is a framework or a templating language largely hinges on how one defines "framework" and "templating language." Here's a breakdown of the concepts to clarify the distinction: ### Definitions 1. **Templating Language**: A templating language is primarily focused on generating dy...
45,242
[ { "from": "human", "value": "I've been having an agruement with a friend that Mason (Perl) is not a framework, but a templating language. I feel Mason for Perl does what JSP does for Java (as an analogy, not pure technical comparison). From what I know, JSP is not a framework and I feel neither is Mason. Wh...
I'm trying to create a LINQ to SQL class that represents the "latest" version of itself. Right now, the table that this entity represents has a single auto-incrementing ID, and I was thinking that I would add a version number to the primary key. I've never done anything like this, so I'm not sure how to proceed. I woul...
To create a LINQ to SQL class that represents the "latest" version of an entity, while managing versioning effectively, you'll need to take a few steps. Below, I outline a strategy that allows you to encapsulate the versioning logic, so that consumers of your class can interact with the latest version without being awa...
47,137
[ { "from": "human", "value": "I'm trying to create a LINQ to SQL class that represents the \"latest\" version of itself.\nRight now, the table that this entity represents has a single auto-incrementing ID, and I was thinking that I would add a version number to the primary key. I've never done anything like ...
One for the mathematicians. This has gone around the office and we want to see who can come up with a better optimised version. (((a+p) <= b) && (a == 0 || a > 1) && (b >= p)) && ((b - (a + p) == 0) || (b - (a + p) > 1)) Edit: all data is positive int's Edit: Better == simpler
To simplify and optimize the given logical expression, we can analyze the conditions step by step. The original expression is: \[ (((a+p) \leq b) \land (a = 0 \lor a > 1) \land (b \geq p)) \land ((b - (a + p) = 0) \lor (b - (a + p) > 1)) \] 1. **Condition Breakdown**: - The first part `((a+p) \leq b)` checks if `...
47,368
[ { "from": "human", "value": "One for the mathematicians. This has gone around the office and we want to see who can come up with a better optimised version.\n(((a+p) <= b) && (a == 0 || a > 1) && (b >= p)) && \n ((b - (a + p) == 0) || (b - (a + p) > 1))\n\nEdit: all data is positive int's\nEdit: Better =...
In my domain model I have an abstract class CommunicationChannelSpecification, which has child classes like FTPChannelSpecification, EMailChannelSpecification and WebserviceChannelSpecification. Now I want to create an HQL query which contains a where clause that narrows down the result to certain types of channel spec...
In NHibernate, when you want to query an abstract class and filter based on its subclass types, you can use the `TYPE()` function in HQL to specify which subclasses you want to include in your query. Since you're using a table-per-subclass inheritance strategy, each subclass corresponds to a specific table. Given your...
49,634
[ { "from": "human", "value": "In my domain model I have an abstract class CommunicationChannelSpecification, which has child classes like FTPChannelSpecification, EMailChannelSpecification and WebserviceChannelSpecification. Now I want to create an HQL query which contains a where clause that narrows down th...
I am very new to VB.net. I have written these objects in VB6 before. I'm just lost in VB.net, but (kicking and screaming) I have to learn how to do this. I've been googling for hours with only minor steps forward. Can anyone post a link that explains start to finish how to do this? I have managed to write the class obj...
Welcome to the world of VB.NET! Transitioning from VB6 to VB.NET can indeed be challenging, but with a bit of guidance, you'll get the hang of it. Here’s a step-by-step guide to help you understand how to create and register a .NET assembly (DLL) so that you can use it with `CreateObject`. ### Step 1: Create a Class L...
45,697
[ { "from": "human", "value": "I am very new to VB.net. I have written these objects in VB6 before. I'm just lost in VB.net, but (kicking and screaming) I have to learn how to do this. I've been googling for hours with only minor steps forward. Can anyone post a link that explains start to finish how to do th...
How to UDP Broadcast with C in Linux?
To perform a UDP broadcast in C on a Linux system, you need to use sockets. Here's a simple example demonstrating how to create a UDP socket, set it up for broadcasting, and send a broadcast message. ### Steps to Implement UDP Broadcast in C 1. **Create a Socket**: Use `socket()` to create a UDP socket. 2. **Set Sock...
44,440
[ { "from": "human", "value": "How to UDP Broadcast with C in Linux?\n" }, { "from": "gpt", "value": "To perform a UDP broadcast in C on a Linux system, you need to use sockets. Here's a simple example demonstrating how to create a UDP socket, set it up for broadcasting, and send a broadcast messa...
i made another post here where I asked how to create the 26 neighbors of a cubic-voxel-node in 3-d space. I got a very good answer and implemented it. To that I added some MIN MAX Position checking. I would like to know if there is way, in relationship to the 3 for loops and 4 if used, to improve the execution time of...
Your function `Create26Neighbor` creates the 26 neighbors of a voxel in 3D space while ensuring the generated positions remain within specified minimum and maximum bounds. There are a few optimizations you can consider to improve the execution time. ### Key Points for Optimization: 1. **Avoiding Redundant Checks**: Y...
44,689
[ { "from": "human", "value": "i made another post\nhere where I asked how to create the 26 neighbors of a cubic-voxel-node in 3-d space. I got a very good answer and implemented it. \nTo that I added some MIN MAX Position checking.\nI would like to know if there is way, in relationship to the 3 for loops and...
I have a TreeView control showing multiple TreeNodes in an organised heirarchy. I want to stop the user selecting the highest level Nodes (this was achieved by using the BeforeSelect Event). I also want to stop the TreeView from highlighting the top level nodes if the user selects them i.e. stop the TreeView from chang...
To prevent the user from selecting the top-level nodes in a WinForms TreeView without the flash effect, you can handle the `NodeMouseClick` event in addition to `BeforeSelect`. This approach allows you to intercept mouse clicks and control the visual feedback more effectively. Here’s how you can implement this: 1. In...
49,637
[ { "from": "human", "value": "I have a TreeView control showing multiple TreeNodes in an organised heirarchy. I want to stop the user selecting the highest level Nodes (this was achieved by using the BeforeSelect Event). I also want to stop the TreeView from highlighting the top level nodes if the user selec...
I need to be able to use https to connect to a server and I'm wondering if there's recommended way of doing this on the iPhone that's NOT: - an undocumented api call - does not require manually storing certificates in the app bundle Thanks all.
To establish an HTTPS connection to a server on iOS without using undocumented APIs or manually storing certificates in your app bundle, you can follow the standard approach using Apple's `URLSession` API. Here's a simple outline of how to implement a secure HTTPS connection: ### Step-by-Step Guide 1. **Use `URLSessi...
45,265
[ { "from": "human", "value": "I need to be able to use https to connect to a server and I'm wondering if there's recommended way of doing this on the iPhone that's NOT:\n- an undocumented api call\n- does not require manually storing certificates in the app bundle\nThanks all.\n" }, { "from": "gpt", ...
Fun with enums in C#. Take one generic list that is created to store some Enum that you had defined previously and add few items in it. Iterate with foreach or GetEnumerator<T>() but specify some other enum then the original and see what happens. I was expecting InvalidCastException or something like that but it perfec...
In C#, enums are indeed a special type that is based on a primitive type, typically `int`, but they also have a distinct type identity. However, because of how C# handles enums under the hood, this peculiar behavior you are observing can be explained. ### Understanding the Behavior 1. **Underlying Type**: When you de...
47,003
[ { "from": "human", "value": "Fun with enums in C#. Take one generic list that is created to store some Enum that you had defined previously and add few items in it. Iterate with foreach or GetEnumerator<T>() but specify some other enum then the original and see what happens. I was expecting InvalidCastExcep...
I have an abstract base class called Shape from which both Circle and Rectangle are derived, but when I execute the following code in VS 2005 I get the error Debug assertion failed. At the same time I have not overloaded == operator in any class Expression:Vector iterator not dereferencable, what is the reason for this...
The error you're encountering is related to how you're using the `std::find` function with a vector of pointers to objects of an abstract base class (`Shape`). Here's a breakdown of the problem: 1. **Dynamic Memory Allocation and Pointer Comparison**: When you do `new Circle(point(1,2),3)`, you are creating a new...
46,091
[ { "from": "human", "value": "I have an abstract base class called Shape from which both Circle and Rectangle are derived, but when I execute the following code in VS 2005 I get the error Debug assertion failed. At the same time I have not overloaded == operator in any class\nExpression:Vector iterator not d...
Java 1.5, Linux I do have a screen which contains different textareas and textfields. I do have acess to the application frame, but not to the components inside the frame, because i only get an implementation of an interface. When i try to add german umlauts i see a rectangle in the text component, because the characte...
To properly support German umlauts (ä, ö, ü) and other special characters in a Java Swing application on Linux, you need to ensure that you're using a font that supports these characters. Here are steps you can take to resolve the issue: ### 1. Check Font Support Make sure that the font being used in the Java applicat...
44,041
[ { "from": "human", "value": "Java 1.5, Linux\nI do have a screen which contains different textareas and textfields.\nI do have acess to the application frame, but not to the components inside the frame, because i only get an implementation of an interface.\nWhen i try to add german umlauts i see a rectangle...
I am developing a multi-threaded application in Cocoa. The main thread takes values from the user, and when a button is clicked I invoke a secondary thread in which a long calculation takes place. Now from this thread I have to return the output of every step of the calculation to the main thread. I want to periodicall...
In a Cocoa application, you can use Grand Central Dispatch (GCD) or `NSThread` with `NSOperationQueue` to manage threading and communication between threads. A common approach is to perform the long-running calculations on a background thread and periodically send updates back to the main thread using a completion hand...
45,484
[ { "from": "human", "value": "I am developing a multi-threaded application in Cocoa. The main thread takes values from the user, and when a button is clicked I invoke a secondary thread in which a long calculation takes place. Now from this thread I have to return the output of every step of the calculation ...
How can I use Connection pool in Java+MySQL+Tomcat 6? I've read this article http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html but it is still not quite clear for me. Where do I use the Connector/J? Do I put it in a static variable? Do I use a SessionListener? Does it need any confi...
Using a connection pool in a Java application running on Tomcat 6 with MySQL involves several steps. Here’s a simplified process to set it up, including how to use MySQL Connector/J and configure a connection pool. ### Step 1: Add MySQL Connector/J to Your Project 1. **Download Connector/J**: You can get it from [th...
44,505
[ { "from": "human", "value": "How can I use Connection pool in Java+MySQL+Tomcat 6? \nI've read this article http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html but it is still not quite clear for me. \nWhere do I use the Connector/J? Do I put it in a static variable? Do I us...
I would like to override the default behavior of the offsetParent member of all html elements. I would like to do something like this if it's possible: // For <div id="foo"></div> var oFooElem = document.getElementById("foo"); oFooElem._offsetParent = oFooElem.offsetParent; oFooElem.prototype.offsetParent = function() ...
In JavaScript, you cannot directly override properties of the DOM prototype or the default behavior of built-in methods in the way you've attempted in your sample code. Instead, you can create a wrapper function or a custom method on your element to achieve the desired behavior. However, if your goal is to provide a c...
49,586
[ { "from": "human", "value": "I would like to override the default behavior of the offsetParent member of all html elements. I would like to do something like this if it's possible:\n// For <div id=\"foo\"></div>\nvar oFooElem = document.getElementById(\"foo\");\noFooElem._offsetParent = oFooElem.offsetParen...
I have an MVC Controller that runs through a process, sets some View Data, and then returns the results of this data back to the user in a View. The process time is dependent on the amount of data that is being processed. I need a good way to display an animated .gif within the View while the process is running, lett...
To achieve the functionality you’re looking for, it would be best to employ AJAX in combination with a loading animation while processing data in your MVC Controller. You cannot directly return a view or partial view during the `OnActionExecuting` event as the execution pipeline does not work that way; however, you can...
46,169
[ { "from": "human", "value": "I have an MVC Controller that runs through a process, sets some View Data, and then returns the results of this data back to the user in a View. The process time is dependent on the amount of data that is being processed. I need a good way to display an animated .gif within th...
I have an Eclipse RCP application that displays a lot (10k+) of small images next to each other, like a film strip. For each image, I am using a SWT Image object. This uses an excessive amount of memory and resources. I am looking for a more efficient way. I thought of taking all of these images and concatenating t...
Displaying a large number of small images efficiently in an Eclipse RCP application can indeed be a challenge, especially when dealing with memory constraints. Concatenating images into a single `ImageData` can work, but handling the palette and image data can be tricky. Here are some strategies that can help you to di...
44,314
[ { "from": "human", "value": "I have an Eclipse RCP application that displays a lot (10k+) of small images next to each other, like a film strip. For each image, I am using a SWT Image object. This uses an excessive amount of memory and resources. I am looking for a more efficient way. I thought of takin...
I have a .NET 3.5 WinForms project that uses several 3rd party controls and a couple of home-grown components that are compiled for the 1.1 framework. Is there a performance hit for using 1.1 components?
Using components compiled for .NET Framework 1.1 within a .NET Framework 3.5 application is generally supported, but there are some considerations you should be aware of regarding performance and compatibility: 1. **Runtime Compatibility**: .NET Framework 3.5 is designed to be backward compatible with earlier versions...
46,999
[ { "from": "human", "value": "I have a .NET 3.5 WinForms project that uses several 3rd party controls and a couple of home-grown components that are compiled for the 1.1 framework.\nIs there a performance hit for using 1.1 components?\n" }, { "from": "gpt", "value": "Using components compiled for...
I have a ListBox which is populated from a collection of ViewModels, which uses in place editing, which I do by having a couple of styles which I can apply to parts of the DataTemplate which make them visible/collapsed as required. These look something like: <Style x:Key="UnselectedVisibleStyle" TargetType="{x:...
To achieve the desired behavior where the `TextBox` automatically gains focus when its associated `ListBoxItem` is selected, you can utilize the `Focus` method in a way that minimizes the need for extensive code-behind. One approach is to use the `Interaction` class from the `System.Windows.Interactivity` or the newer...
46,056
[ { "from": "human", "value": "I have a ListBox which is populated from a collection of ViewModels, which uses in place editing, which I do by having a couple of styles which I can apply to parts of the DataTemplate which make them visible/collapsed as required. These look something like:\n<Style\n x:Key=\...
Rails introduced some core extensions to Ruby like 3.days.from_now which returns, as you'd expect a date three days in the future. With extension methods in C# we can now do something similar: static class Extensions { public static TimeSpan Days(this int i) { return new TimeSpan(i, 0, 0, 0, 0); } ...
The use of extension methods in C# to create more readable and expressive code can certainly be a good idea, especially in the context of building frameworks or libraries where usability and developer experience are paramount. Let's analyze your examples and discuss when it may be appropriate to use such patterns. ###...
49,126
[ { "from": "human", "value": "Rails introduced some core extensions to Ruby like 3.days.from_now which returns, as you'd expect a date three days in the future. With extension methods in C# we can now do something similar:\nstatic class Extensions\n{\n public static TimeSpan Days(this int i)\n {\n ...
I have the following line in a JSP page: <c:if test="${postAuditBean.postAudit.authority == authority.value}"> I would like change this comparison to first trim leading and trailing spaces from both the left and right hand expressions prior to comparison... as in something like this: <c:if test="${trim(postAuditBean.p...
In JSP using JSTL, you can use the `fn:trim` function to trim whitespace from strings, but you need to ensure that you've properly declared the JSTL functions in your JSP page. You might have encountered a parsing error because the JSTL functions aren't being recognized. Here's how you can do this correctly: 1. Ensur...
48,901
[ { "from": "human", "value": "I have the following line in a JSP page:\n<c:if test=\"${postAuditBean.postAudit.authority == authority.value}\">\n\nI would like change this comparison to first trim leading and trailing spaces from both the left and right hand expressions prior to comparison... as in something...
I have written a LINQ to XML query that does what I want, but it looks pretty ugly. I am wondering, how would you guys format the following query in a way that doesn't look quite so garish? Apologies if my example is a bit verbose. The XML documents I am querying have the following structure: <?xml version="1.0" encod...
Your LINQ to XML query can certainly be formatted for better readability and maintainability. One way to improve the formatting is to use method chaining with well-defined variables and comments to explain each part of the query. Here's a more readable version of your LINQ query: ```csharp XElement dummy = new XElemen...
49,946
[ { "from": "human", "value": "I have written a LINQ to XML query that does what I want, but it looks pretty ugly. I am wondering, how would you guys format the following query in a way that doesn't look quite so garish?\nApologies if my example is a bit verbose.\nThe XML documents I am querying have the fol...
How can I evaluate an expression, given a list of values for the variables it contains? eval::[(Variable,Integer)]->Expr->Integer Example: eval[("x",2), ("y",4)](Mult(Plus(Var "x") (Const))(Var "y"))= 12
To evaluate an expression given a list of variable values, you can implement the function `eval` in a programming language like Python, Haskell, or any other language that supports functional programming paradigms. Below, I'll provide a conceptual framework for how you can define the `eval` function, and then I will pr...
40,865
[ { "from": "human", "value": "How can I evaluate an expression, given a list of values for the variables it contains?\neval::[(Variable,Integer)]->Expr->Integer\n\nExample:\neval[(\"x\",2), (\"y\",4)](Mult(Plus(Var \"x\") (Const))(Var \"y\"))= 12\n\n" }, { "from": "gpt", "value": "To evaluate an ...
I have a version resource in my resources in a C++ project which contains version number, copyright and build details. Is there an easy way to access this at run-time to populate my help/about dialog as I am currently maintaining seperate const values of this information. Ideally, the solution should work for Windows...
Yes, you can access the version information defined in a version resource at runtime in your C++ application. This allows you to avoid maintaining separate constants for version numbers, copyright, and build details. Here's a general approach to retrieve version information from a version resource on Windows, compatib...
44,732
[ { "from": "human", "value": "I have a version resource in my resources in a C++ project which contains version number, copyright and build details. Is there an easy way to access this at run-time to populate my help/about dialog as I am currently maintaining seperate const values of this information. Idea...
I see there are a few. Which ones are maintained and easy to use? What are their pros and cons?
It looks like you might be referring to programming libraries, frameworks, or tools related to a specific field, but you haven't specified which ones. Below, I'll provide a general overview of popular libraries and frameworks in software development, including their maintenance status, ease of use, and pros and cons. I...
43,039
[ { "from": "human", "value": "I see there are a few. Which ones are maintained and easy to use? What are their pros and cons? \n" }, { "from": "gpt", "value": "It looks like you might be referring to programming libraries, frameworks, or tools related to a specific field, but you haven't specifie...
Is it possible using Java to convert a real time audio stream from the mixer to MP3? It has to be converted chunk by chunk otherwise the memory will be exhausted. I already know how to record but only to lossless formats such as wav and aiff. I need conversion as the audio comes in.
Yes, it is possible to convert a real-time audio stream from a mixer to MP3 in Java by processing the audio data chunk by chunk to avoid memory exhaustion. To achieve this, you'll typically use libraries that can handle audio capturing and MP3 encoding. Below are the key components you will need: 1. **Audio Capture**:...
47,201
[ { "from": "human", "value": "Is it possible using Java to convert a real time audio stream from the mixer to MP3? \n\nIt has to be converted chunk by chunk otherwise the memory will be exhausted. \nI already know how to record but only to lossless formats such as wav and aiff. \nI need conversion as the au...
Any one succeeded in integrating Quick Test Pro (QTP) automated test scripts in Cruisecontrol.net. if any one have an idea to run them unattended , in a schedule task or cruisecontrol.net will be more useful.#
Integrating Quick Test Professional (QTP), now known as Unified Functional Testing (UFT), with CruiseControl.NET (CC.NET) for automated test script execution is achievable, although it may require some setup. Here’s a general approach on how to accomplish this: ### Steps to Integrate QTP/UFT with CruiseControl.NET 1....
44,986
[ { "from": "human", "value": "Any one succeeded in integrating Quick Test Pro (QTP) automated test scripts in Cruisecontrol.net.\nif any one have an idea to run them unattended , in a schedule task or cruisecontrol.net \nwill be more useful.#\n" }, { "from": "gpt", "value": "Integrating Quick Tes...
I have this marked as PHP but only because I'll be using PHP code to show my problem. So I have some code like this for the controller: switch ($page) { case "home": require "views/home.php"; break; case "search": require "views/search.php"; break; } Obviously there's more pages...
Your intuition is correct; while your approach with multiple `require` statements will work, it's not the most efficient way to manage common elements like headers, navigation, and footers across multiple pages. A cleaner approach is to structure your code to avoid redundancy. ### Suggested Approach You can refactor ...
44,755
[ { "from": "human", "value": "I have this marked as PHP but only because I'll be using PHP code to show my problem.\nSo I have some code like this for the controller:\nswitch ($page)\n{\n case \"home\":\n require \"views/home.php\";\n break;\n case \"search\":\n require \"views/sea...
This is my setup: SQL server 2005 UserA already setup as user on the server but not on databaseA. GRANT Execute ON [GetOrders] TO [UserA] AS [dbo] As you can see, i have missed out a step. I haven't added UserA to the database yet. This doesn't fail and lets me grant execute on the object. I believe in 2000 it woul...
In SQL Server 2005, the behavior you’re observing is due to changes in how permissions and logins are handled compared to SQL Server 2000. In SQL Server 2000, attempting to grant permissions to a user who does not exist in the database would result in an error. In SQL Server 2005 and later versions, the server allows y...
47,341
[ { "from": "human", "value": "This is my setup:\n\nSQL server 2005\nUserA already setup as user on the server but not on databaseA.\nGRANT Execute ON [GetOrders] TO [UserA] AS [dbo]\n\nAs you can see, i have missed out a step. I haven't added UserA to the database yet. This doesn't fail and lets me grant e...
Does there exist a third party component which lets you seamless integrate your calendar application with MS Exchange? Are there any open source components who do that? This is about calendar, not mail.
Yes, there are third-party components that allow for the seamless integration of calendar applications with Microsoft Exchange. Some of these solutions can help you access, create, and manage calendar events on an Exchange server. ### Third-Party Components: 1. **CalDAV and Exchange**: There are CalDAV clients and lib...
48,299
[ { "from": "human", "value": "Does there exist a third party component which lets you seamless integrate your calendar application with MS Exchange?\nAre there any open source components who do that?\nThis is about calendar, not mail.\n" }, { "from": "gpt", "value": "Yes, there are third-party co...
I am a Delphi novice, but I'm trying to understand the relationship between TApplication and TfrmMain windows using Spy++. It seems that the TfrmMain window is the real window that has proper screen coordinates, but the TApplication window is the one that appears in the Windows taskbar. Also, they don't seem to be rela...
In Delphi, particularly when working with VCL (Visual Component Library) applications, the `TApplication` and your main form (in this case, `TfrmMain`) have distinct roles and responsibilities, which can indeed be a bit confusing for newcomers. ### Understanding TApplication and TfrmMain 1. **TApplication**: This cla...
45,318
[ { "from": "human", "value": "I am a Delphi novice, but I'm trying to understand the relationship between TApplication and TfrmMain windows using Spy++. It seems that the TfrmMain window is the real window that has proper screen coordinates, but the TApplication window is the one that appears in the Windows ...
What is the best method to determine if a user has viewed a piece of data, ie like an update to a comment. The two solutions I have thought about are these.... Use a separate table that has a row for each user and the data id that is being viewed and inserting into when the item was last viewed. Use the same table and...
Both methods you've described have their pros and cons, and the best approach can depend on your specific use case, such as performance, ease of implementation, and how critical it is to track when an item was viewed. Let's analyze both methods in detail: ### Method 1: Separate Table for View Tracking **Structure**: ...
39,021
[ { "from": "human", "value": "What is the best method to determine if a user has viewed a piece of data, ie like an update to a comment. The two solutions I have thought about are these....\n\nUse a separate table that has a row for each user and the data id that is being viewed and inserting into when the i...
I'm trying to connect my stock standard, default ASP.NET MVC (web) application to the Vista IIS7 localhost web server instead of using Cassini. I'm trying to find some steps to set this up, etc. I've installed Vista IIS7 and of course MVC beta, VS2008 & Sp1. Lastly, i'm hoping to also have multiple solutions use the Vi...
To connect your ASP.NET MVC application to the IIS7 on your Windows Vista machine instead of using the built-in web server (Cassini), you can follow these steps. This guide assumes that you've installed IIS7, MVC, and Visual Studio 2008 SP1 on your system. ### Step 1: Enable IIS Features Make sure your IIS installatio...
40,846
[ { "from": "human", "value": "I'm trying to connect my stock standard, default ASP.NET MVC (web) application to the Vista IIS7 localhost web server instead of using Cassini.\nI'm trying to find some steps to set this up, etc.\nI've installed Vista IIS7 and of course MVC beta, VS2008 & Sp1.\nLastly, i'm hopin...
MSIE v7 does not (in my hands) open a Modeless Dialog or trigger an onLoad event if there is a Javascript alert in the target page. The following fails in MSIE v7 but is OK in v6 (zip file of full source available if required). Would appreciate others confirming this and discussing why this should be so. index.htm (on...
The issue you're encountering with Internet Explorer (IE) v7 and the `onLoad` event being interrupted by the JavaScript `alert` function is indeed a known behavior in that version of the browser, differing from previous versions such as IE6. Here's a detailed explanation of what is happening: ### Explanation: 1. **Mo...
47,276
[ { "from": "human", "value": "MSIE v7 does not (in my hands) open a Modeless Dialog or trigger an onLoad event if there is a Javascript alert in the target page. The following fails in MSIE v7 but is OK in v6 (zip file of full source available if required). \nWould appreciate others confirming this and discu...
I'm looking for a way to display multiple colors in a single C#/.NET label. E.g the label is displaying a series of csv separated values that each take on a color depending on a bucket they fall into. I would prefer not to use multiple labels, as the values are variable length and I don't want to play with dynamic la...
In standard WinForms or WPF, a `Label` control does not natively support displaying multiple colors within a single text string. However, there are workarounds that you can use to achieve this effect. Here are a couple of approaches: ### 1. Custom Drawing in WinForms You can create a custom control by inheriting from...
41,680
[ { "from": "human", "value": "I'm looking for a way to display multiple colors in a single C#/.NET label. E.g the label is displaying a series of csv separated values that each take on a color depending on a bucket they fall into. I would prefer not to use multiple labels, as the values are variable length...
How do I make a backup of a PLSQL db?
Backing up a PL/SQL database generally refers to backing up an Oracle database, as PL/SQL is Oracle's procedural extension of SQL. There are several methods to perform a backup of an Oracle database. Here are some of the most common methods: ### 1. Using RMAN (Recovery Manager) RMAN is Oracle's built-in tool for back...
45,595
[ { "from": "human", "value": "How do I make a backup of a PLSQL db?\n" }, { "from": "gpt", "value": "Backing up a PL/SQL database generally refers to backing up an Oracle database, as PL/SQL is Oracle's procedural extension of SQL. There are several methods to perform a backup of an Oracle databa...
I'm wondering if storing the data in viewstate is a good idea for this given problem. He's a simplified example of what I am trying to achieve, firstly we have a Repeater control: <asp:Repeater id="Repeater1" runat="server"> <ItemTemplate> <asp:TextBox id="Name" runat="server" /> <asp:TextBox id="Age" runat="server" />...
Using ViewState to store data for this scenario can be a reasonable approach, especially when you want to maintain the state of the entries added by the user without immediately committing them to a database. However, it's essential to consider the amount of data being stored and the potential impact on page size and p...
42,575
[ { "from": "human", "value": "I'm wondering if storing the data in viewstate is a good idea for this given problem.\nHe's a simplified example of what I am trying to achieve, firstly we have a Repeater control:\n<asp:Repeater id=\"Repeater1\" runat=\"server\">\n<ItemTemplate>\n<asp:TextBox id=\"Name\" runat=...
Does anyone know any resources (books/websites/whatever) related to parsing. I'm not so much interested in specific technologies such as yacc, XML or regular expressions, but something more general about best practices, stream vs. pull, error reporting and recovery, gotchas to look out for etc.
Certainly! Here are some general resources related to parsing that cover best practices, methodologies, and considerations beyond specific technologies: ### Books: 1. **"Compilers: Principles, Techniques, and Tools" by Alfred V. Aho, Monica S. Lam, Ravi Sethi, and Jeffrey D. Ullman** - Often referred to as the "Dragon...
45,746
[ { "from": "human", "value": "Does anyone know any resources (books/websites/whatever) related to parsing. I'm not so much interested in specific technologies such as yacc, XML or regular expressions, but something more general about best practices, stream vs. pull, error reporting and recovery, gotchas to l...
I am making a small C# application and would like to extract a tag cloud from a simple plain text. Is there a function that could do that for me?
Creating a tag cloud from plain text in C# involves extracting keywords and counting their occurrences. You can write a simple function to achieve this. Below is a basic example of how to do this using C#: ```csharp using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions...
43,505
[ { "from": "human", "value": "I am making a small C# application and would like to extract a tag cloud from a simple plain text. Is there a function that could do that for me?\n" }, { "from": "gpt", "value": "Creating a tag cloud from plain text in C# involves extracting keywords and counting the...
I need an equivalent to c++'s std::multimap<K, V, Comp, Alloc> in C-sharp. Does it exist in the standard library?
In C#, there is no direct equivalent to C++'s `std::multimap<K, V, Comp, Alloc>` in the standard library. However, you can achieve similar functionality using a combination of collections or third-party libraries. 1. **Using `Dictionary<TKey, List<TValue>>`:** You can use a `Dictionary` where the key maps to a list...
47,182
[ { "from": "human", "value": "I need an equivalent to c++'s std::multimap<K, V, Comp, Alloc> in C-sharp. Does it exist in the standard library?\n" }, { "from": "gpt", "value": "In C#, there is no direct equivalent to C++'s `std::multimap<K, V, Comp, Alloc>` in the standard library. However, you c...
Duplicate from : String output: format or concat in C#? Especially in C# world using String.Format for everything is really common, normally as VB.NET developer unless I have to* I don't String.Format, I prefer normal string concatenation, such as: V1 = V2 & "test-x" & V3 & "-;" to me it's better than this: V1 = Stri...
Your question touches on a topic that many developers encounter when working with strings in C#. Both `String.Format` and string concatenation (using the `+` operator or the `&` operator) have their pros and cons. Let's break down some considerations regarding both approaches: ### String Concatenation 1. **Simplicity*...
47,560
[ { "from": "human", "value": "Duplicate from : String output: format or concat in C#?\nEspecially in C# world using String.Format for everything is really common, normally as VB.NET developer unless I have to* I don't String.Format, \nI prefer normal string concatenation, such as:\nV1 = V2 & \"test-x\" & V3 ...
I'm working on a CakePHP 1.2 application. I have a model "User" defined with a few HABTM relationships with other tables through a join table. I'm now tasked with finding User information based on the data stored in one of these HABTM tables. Unfortunately, when the query executes, my condition is rejected with an erro...
The issue you are encountering is due to the way CakePHP 1.2 handles HABTM (Has And Belongs To Many) relationships in queries. When you reference a field from a related model (in this case, `School.name`) in your `WHERE` clause, you need to ensure that the relevant join table is included in the query. By default, Cake...
42,338
[ { "from": "human", "value": "I'm working on a CakePHP 1.2 application. I have a model \"User\" defined with a few HABTM relationships with other tables through a join table.\nI'm now tasked with finding User information based on the data stored in one of these HABTM tables. Unfortunately, when the query exe...
Does routed events in WPF store strong reference to the handler that is attached to them?
In WPF (Windows Presentation Foundation), routed events do not store strong references to the event handlers that are attached to them. Instead, WPF uses a concept called "weak event patterns" for many of its events, especially for routed events associated with user interface elements. When you attach a handler to a r...
48,774
[ { "from": "human", "value": "Does routed events in WPF store strong reference to the handler that is attached to them?\n" }, { "from": "gpt", "value": "In WPF (Windows Presentation Foundation), routed events do not store strong references to the event handlers that are attached to them. Instead,...
We are currently working with Flex creating a web application. We are having trouble taking Arabic text from the user and displaying correctly (like in a chat feature). While presumably Flash 10 will solve this problem, we don't want to force our users to upgrade. Flash flips the order of the sentence's words. so if I ...
Handling Right-to-Left (RTL) languages like Arabic in Flash can be challenging, especially if you want to ensure that text displays correctly in all contexts, including when mixed with Left-to-Right (LTR) languages like English. Since you are working with an older version of Flash (pre-Flash 10), you will need to imple...
44,551
[ { "from": "human", "value": "We are currently working with Flex creating a web application. We are having trouble taking Arabic text from the user and displaying correctly (like in a chat feature). While presumably Flash 10 will solve this problem, we don't want to force our users to upgrade.\nFlash flips t...
I have a CSS rule like this: a:hover { background-color: #fff; } But this results in a bad-looking gap at the bottom on image links, and what's even worse, if I have transparent images, the link's background color can be seen through the image. I have stumbled upon this problem many times before, but I always solved i...
You can achieve the desired effect without resorting to the "quick-and-dirty" approach of using a specific class for image links. The main goal is to ensure that your image links only take up as much space as the image itself while also preventing the background color from showing through transparent images. Here are...
46,241
[ { "from": "human", "value": "I have a CSS rule like this:\na:hover { background-color: #fff; }\n\nBut this results in a bad-looking gap at the bottom on image links, and what's even worse, if I have transparent images, the link's background color can be seen through the image.\nI have stumbled upon this pro...
In my (Win32) application, I am displaying Crystal Reports. I set the login information at runtime. However, Crystal kindly decided to refer to the database name by several different names, depending on how the report connects. For instance, if the report connects through an ODBC connection, then it is called "Data S...
To determine the connection method used by a Crystal Reports XI report at runtime, you can inspect the `ConnectionProperties` of the database tables within the report. However, the specific `ConnectMethod` you are referring to may not be directly exposed in the ActiveX interface. Nevertheless, you can leverage the conn...
49,633
[ { "from": "human", "value": "In my (Win32) application, I am displaying Crystal Reports.\nI set the login information at runtime. However, Crystal kindly decided to refer to the database name by several different names, depending on how the report connects. For instance, if the report connects through an ...
My reuirement: Input File: 1,abc,xyx 2,def,mno 3,ghi,suv DB Table Structure: Col1 char col2 char col3 char col4 char col5 char Data in Table after BCP: col1 col2 col3 col4 col5 1 abc xyz ab xy 2 def mno de mn 3 ghi suv gh su Basically the col4 and col5 are calculated values from col2 and col3 va...
The SQL Server BCP (Bulk Copy Program) utility is designed primarily for bulk copying data between a SQL Server instance and a data file. It doesn't support any transformation or calculations on the data being imported; it simply inserts the data as it is. If you need to calculate additional fields (like `col4` and `c...
46,255
[ { "from": "human", "value": "My reuirement:\nInput File:\n1,abc,xyx\n2,def,mno\n3,ghi,suv\nDB Table Structure:\nCol1 char\ncol2 char\ncol3 char\ncol4 char\ncol5 char\nData in Table after BCP:\ncol1 col2 col3 col4 col5\n1 abc xyz ab xy\n2 def mno de mn\n3 ghi suv gh su\nBasically the ...
I'm doing some design (initially for Java) (but may extend to .NET in the future?) and I'm getting confused between the terms "cache" and "pool". As far as I can see, the main point of difference is what is contained in them? Any guidelines as to which should be used when? And what then is a "cache pool" which is refer...
You're correct that the terms "cache" and "pool" refer to different concepts, and understanding these differences can help you make better design decisions. Let's break down the definitions and usage scenarios for each term: ### Cache **Definition:** A cache is a temporary storage layer that holds frequently accessed ...
46,632
[ { "from": "human", "value": "I'm doing some design (initially for Java) (but may extend to .NET in the future?) and I'm getting confused between the terms \"cache\" and \"pool\".\nAs far as I can see, the main point of difference is what is contained in them?\nAny guidelines as to which should be used when?...
I think I understand unit testing. But I was wondering: is there a way to automate something visual, like making sure anti-aliasing works or that the rounded corners on a web site look how they are supposed to? I have a feeling that it just isn't practical, but I have little experience in the QA world.
Yes, automating visual testing is definitely possible, and it's a common practice in quality assurance (QA) for web applications. Here are some approaches and tools that can help you automate visual testing to check aspects like anti-aliasing, rounded corners, and overall visual integrity: ### 1. **Visual Regression T...
46,354
[ { "from": "human", "value": "I think I understand unit testing. But I was wondering: is there a way to automate something visual, like making sure anti-aliasing works or that the rounded corners on a web site look how they are supposed to? I have a feeling that it just isn't practical, but I have little e...
Environment: win2003 running IIS6 serving asp pages that call delphi code. Delphi code contacts a c# webservice for which it needs to login (login.asmx). Webservice logs show login is successful. Debug results show that Context.User.Identity.IsAuthenticated returns true. After login, delphi code doublechecks if it i...
The issue you're experiencing seems to stem from how authentication cookies are managed in your setup with IIS6 and the interaction between the Delphi code and the C# web service. Here are several steps to help you identify the root cause of the problem and suggest some configuration changes that might resolve the issu...
46,301
[ { "from": "human", "value": "Environment: \n\nwin2003 running IIS6 serving asp pages that call delphi code.\n\nDelphi code contacts a c# webservice for which it needs to login (login.asmx). Webservice logs show login is successful. Debug results show that Context.User.Identity.IsAuthenticated returns true.\...
One of the most common dilemmas I have when commenting code is how to mark-up argument names. I'll explain what I mean: def foo(vector, widht, n=0): """ Transmogrify vector to fit into width. No more than n elements will be transmogrified at a time """ Now, my problem with this is that the argument names ve...
When it comes to commenting code and documenting function arguments, clarity is key. While there are no hard and fast rules, different conventions can be adopted based on personal preference or team standards. Here are a few considerations for each of the options you mentioned, as well as some additional suggestions: ...
47,075
[ { "from": "human", "value": "One of the most common dilemmas I have when commenting code is how to mark-up argument names. I'll explain what I mean:\ndef foo(vector, widht, n=0):\n \"\"\" Transmogrify vector to fit into width. No more than n \n elements will be transmogrified at a time\n \"\"\"\n\nNo...
When using topfunky's RStakeout, the color in the result of the spec command is lost. This happens even when adding the --color flag.
If you're using topfunky's RStakeout and you're losing color output even with the `--color` flag, there could be a few reasons for this behavior. Here are some suggestions to troubleshoot and potentially resolve the issue: 1. **Ensure Terminal Compatibility**: Make sure your terminal supports color output. Some termin...
49,961
[ { "from": "human", "value": "When using topfunky's RStakeout, the color in the result of the spec command is lost. This happens even when adding the --color flag.\n" }, { "from": "gpt", "value": "If you're using topfunky's RStakeout and you're losing color output even with the `--color` flag, th...
I am on a shared host and can not change the symbolic link to Python2.4, it defaults to 2.3. I tried creating a sym link in the director I would be working on to 2.4, but it seems the the 'global' python interpreter under /usr/bin/python take presedence unless I run it as ./python. What alternative ways are there to ov...
When you're on a shared hosting environment and unable to change the default Python version through symbolic links at the system level, you still have a few alternative options to use a different version of Python, like Python 2.4. Here are several approaches you can take: ### 1. Use a Virtual Environment Creating a v...
49,167
[ { "from": "human", "value": "I am on a shared host and can not change the symbolic link to Python2.4, it defaults to 2.3. I tried creating a sym link in the director I would be working on to 2.4, but it seems the the 'global' python interpreter under /usr/bin/python take presedence unless I run it as ./pyth...
sorry but I do not have the actual code with me, but I will try to explain: I have a servlet mapped to the following: /admin/* So, this goes to a servlet: public class AdminController extends MainController { public void doPost(HttpServletRequest request, HttpServletResponse response) { // Do stuf here ...
The issue you're facing with your servlet being called twice likely stems from how you've overridden the `service` method in the `MainController`. When you override the `service` method in your servlet, you need to ensure that you're not inadvertently calling the `doPost` method in a way that leads to infinite recursio...
49,142
[ { "from": "human", "value": "sorry but I do not have the actual code with me, but I will try to explain:\nI have a servlet mapped to the following: \n/admin/* \n\nSo, this goes to a servlet: \npublic class AdminController extends MainController {\n public void doPost(HttpServletRequest request, HttpServl...
One of the web pages on our site is extremely long. Although the page itself does not call any javascript or jquery functions, its base page registers the JQuery source script (jquery-1.2.6.js) and this seems to cause IE7 to display the "A script on this page is causing Internet Explorer to run slowly." message when yo...
The issue you are experiencing with Internet Explorer 7 displaying the "A script on this page is causing Internet Explorer to run slowly." message can often arise from a combination of several factors, particularly with very long web pages and older versions of jQuery (like 1.2.6). Here are some suggestions to help mit...
47,644
[ { "from": "human", "value": "One of the web pages on our site is extremely long. Although the page itself does not call any javascript or jquery functions, its base page registers the JQuery source script (jquery-1.2.6.js) and this seems to cause IE7 to display the \"A script on this page is causing Interne...
does anyone know is there a way to implement Windows Live ID authentication into your ASP.NET MVC site. There is some info about OpenID implementations and it uses some libraries. So is there a way to implement Live ID or it is not yet supported. Thank you
As of my last knowledge update in October 2023, Microsoft has moved away from Windows Live ID, which was replaced by Microsoft Account. Microsoft Account now serves as the identity platform for services such as Outlook, OneDrive, and Xbox. To implement Microsoft Account authentication in your ASP.NET MVC application, ...
46,401
[ { "from": "human", "value": "does anyone know is there a way to implement Windows Live ID authentication into your ASP.NET MVC site. There is some info about OpenID implementations and it uses some libraries.\nSo is there a way to implement Live ID or it is not yet supported.\nThank you\n" }, { "fro...
I have an MS-Word VSTO Document with a code-behind dll named WordDocument1.dll Project folder D:\Work\Seven\WordAutomation\ContentControls\WordDocument1\bin\Debug I've copied some custom code into a MyAppExecs folder under that. The DLL has a private bin path specified so that code in MyAppExecs is reachable. So on sta...
It sounds like you've encountered a complex issue with loading assemblies, especially when dealing with unmanaged dependencies in a VSTO (Visual Studio Tools for Office) environment. Here are some insights and possible solutions based on the information you've provided: ### Issues with Assembly Resolution 1. **Assembl...
45,496
[ { "from": "human", "value": "I have an MS-Word VSTO Document with a code-behind dll named WordDocument1.dll\nProject folder D:\\Work\\Seven\\WordAutomation\\ContentControls\\WordDocument1\\bin\\Debug\nI've copied some custom code into a MyAppExecs folder under that. The DLL has a private bin path specified ...
I am getting a strange error on a remote windows clients (WinForm application using C# 2.0) Error Message: Access to the path 'c:\ApplicationFolder' is denied. Stack Trace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess ac...
The error message you're encountering indicates that your application is trying to access the `C:\ApplicationFolder` directory, but it does not have the necessary permissions to do so. Here are several potential solutions and troubleshooting steps you can take: ### 1. Check Directory Permissions Ensure that the user a...
44,813
[ { "from": "human", "value": "I am getting a strange error on a remote windows clients (WinForm application using C# 2.0)\nError Message: Access to the path 'c:\\ApplicationFolder' is denied.\nStack Trace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\n at System.IO.FileStream.I...
Since I've started using NetBeans, I've learned of some powerful ways to abstract away the process of creating Java database applications with automatically generated UI, beans bindings, and a bunch of other stuff I only vaguely understand the workings of at the moment (I hate being a newb). Problem is, how do I do th...
It's great to hear you're diving into Java database applications using NetBeans! While abstraction can be a bit overwhelming at first, understanding the basics will empower you to use these tools effectively. Here are some resources and concepts you can explore to get a better grasp on database connections and operatio...
45,497
[ { "from": "human", "value": "Since I've started using NetBeans, I've learned of some powerful ways to abstract away the process of creating Java database applications with automatically generated UI, beans bindings, and a bunch of other stuff I only vaguely understand the workings of at the moment (I hate b...
I created an admin page for a web application, and it's mostly ajax. Almost all the events in the page update one of the UpdatePanels on the page. How can I save each UpdatePanel state in the user's history so when the user pushes the browser "back" button they wont get redirected to the login screen ?
To maintain the state of your UpdatePanels and ensure that users can navigate back to their previous states after logging in, you can utilize the browser's history API along with AJAX. Here’s a step-by-step guide on how to implement this: ### 1. **Utilize the Browser History API** The browser history API allows you to...
45,261
[ { "from": "human", "value": "I created an admin page for a web application, and it's mostly ajax. Almost all the events in the page update one of the UpdatePanels on the page.\nHow can I save each UpdatePanel state in the user's history so when the user pushes the browser \"back\" button they wont get redir...
It seems to me that if you are writing in an interpreted language that it must be difficult to sell software, because anyone who buys it can edit it/change it/resell it without much difficulty. How do you get around this? I have a couple of PHP apps that I'm reluctant to sell to people as it seems that it's too simple ...
Selling software written in an interpreted language, like PHP, does present some unique challenges when it comes to protecting your intellectual property. Here are several strategies you can use to mitigate the risks associated with distributing your PHP applications: ### 1. **Code Obfuscation** - **Obfuscators**: ...
46,591
[ { "from": "human", "value": "It seems to me that if you are writing in an interpreted language that it must be difficult to sell software, because anyone who buys it can edit it/change it/resell it without much difficulty.\nHow do you get around this? I have a couple of PHP apps that I'm reluctant to sell t...
So here's what I'm looking to achieve. I would like to give my users a single google-like textbox where they can type their queries. And I would like them to be able to express semi-natural language such as "view all between 1/1/2008 and 1/2/2008" it's ok if the syntax has to be fairly structured and limited to this...
Creating a query parser that accepts semi-natural language input and translates it into an expression tree can be achieved using a combination of techniques in C#. Below are the steps and a basic example to help you build a simple query parser for your specific domain. ### Step 1: Define Your Domain Before parsing, i...
45,990
[ { "from": "human", "value": "So here's what I'm looking to achieve. I would like to give my users a single google-like textbox where they can type their queries. And I would like them to be able to express semi-natural language such as\n\"view all between 1/1/2008 and 1/2/2008\"\n\nit's ok if the syntax h...
There are various samples available for how to host Python or Ruby running on the DLR, inside your own AppDomain. Are you able to do this yet with VB? There have been mentions of this since the DLR was announced 18 months ago, but I can't find a code sample for it. Maybe with the PDC VS10 CTP? If so, what assembly cont...
As of my last knowledge update in October 2023, hosting VB.NET in a custom AppDomain using the Dynamic Language Runtime (DLR) is not as straightforward as hosting Python or Ruby. The DLR was primarily designed for dynamic languages like Python (IronPython) and Ruby (IronRuby), and the tooling and libraries available fo...
42,959
[ { "from": "human", "value": "There are various samples available for how to host Python or Ruby running on the DLR, inside your own AppDomain.\nAre you able to do this yet with VB? There have been mentions of this since the DLR was announced 18 months ago, but I can't find a code sample for it.\nMaybe with ...
I have been using PRETTY_FUNCTION to output the current function name, however I have reimplemented some functions and would like to find out which functions are calling them. In C++ how can I get the function name of the calling routine?
In C++, there isn't a standard way to directly retrieve the name of the calling function. However, you can achieve this using a combination of macros and compiler-specific features. Below are a few approaches you might consider: ### 1. Use Macros with `PRETTY_FUNCTION` You can create a macro that captures the current...
49,430
[ { "from": "human", "value": "I have been using PRETTY_FUNCTION to output the current function name, however I have reimplemented some functions and would like to find out which functions are calling them.\nIn C++ how can I get the function name of the calling routine?\n" }, { "from": "gpt", "val...
This is a question regarding Unix shell scripting (any shell), but any other "standard" scripting language solution would also be appreciated: I have a directory full of files where the filenames are hash values like this: fd73d0cf8ee68073dce270cf7e770b97 fec8047a9186fdcc98fdbfc0ea6075ee These files have different ori...
Certainly! You can use a shell script that utilizes the `file` command to determine the MIME type of each file and rename it accordingly with the appropriate file extension. Here's a simple Bash script to achieve this: ```bash #!/bin/bash # Change to the directory where your files are located cd /path/to/your/directo...
46,825
[ { "from": "human", "value": "This is a question regarding Unix shell scripting (any shell), but any other \"standard\" scripting language solution would also be appreciated:\nI have a directory full of files where the filenames are hash values like this:\nfd73d0cf8ee68073dce270cf7e770b97\nfec8047a9186fdcc98...
I have a list of input words separated by comma. I want to sort these words by alphabetical and length. How can I do this without using the built-in sorting functions?
You can sort a list of words by both alphabetical order and length without using built-in sorting functions by implementing your own sorting algorithm. Here, I'll provide a simple example using the bubble sort algorithm to achieve this. ### Steps: 1. **Parse the Input**: Convert the comma-separated string of words in...
48,312
[ { "from": "human", "value": "I have a list of input words separated by comma. I want to sort these words by alphabetical and length. How can I do this without using the built-in sorting functions?\n" }, { "from": "gpt", "value": "You can sort a list of words by both alphabetical order and leng...
Case in point: I'm a on mac with bash v3.2.17, I'm using git installed via macports with the bash_completion variant. When I type git checkout m<tab>. for example, I get it completed to master. However, I've got an alias to git checkout, gco. When I type gco m<tab>, I don't get the branch name autocompleted. Ideally I...
Bash completion for aliases can be a little tricky since the default completion system is designed to work with the original command, not its aliases. However, there are ways to enable it for your aliases. ### Option 1: Enabling Autocompletion for All Aliases You can define a function that allows the completion syste...
45,409
[ { "from": "human", "value": "Case in point: \nI'm a on mac with bash v3.2.17, I'm using git installed via macports with the bash_completion variant.\nWhen I type git checkout m<tab>. for example, I get it completed to master.\nHowever, I've got an alias to git checkout, gco. When I type gco m<tab>, I don't ...
I'm looking at this control, and it seems to be lacking the standard .net "datasource" and "datamember" properties for databinding. Is this control not bindable? I can write some custom function that populates the treeview from a given data source, I suppose, and embed data objects as necessary, but is that the 'best...
When dealing with a standard .NET TreeView control, you're correct that it doesn't natively support the `DataSource` and `DataMember` properties like some other controls do, such as DataGridView or ListView. This means that the TreeView control does not provide out-of-the-box data binding capabilities for hierarchical ...
46,199
[ { "from": "human", "value": "I'm looking at this control, and it seems to be lacking the standard .net \"datasource\" and \"datamember\" properties for databinding. Is this control not bindable? I can write some custom function that populates the treeview from a given data source, I suppose, and embed dat...
I've seen some variable declare in VB.net in several way like: print("dim _Foo as string"); and print("dim m_Foo as string"); and print("dim foo as string"); I will like to know what's the standard for VB.net coding.
In VB.NET, variable naming conventions can vary based on personal or team preferences, but there are some common practices that many developers follow to improve code readability and maintainability. Here are some general guidelines regarding variable naming in VB.NET: ### 1. **Use Meaningful Names** - Choose names...
48,809
[ { "from": "human", "value": "I've seen some variable declare in VB.net in several way like:\nprint(\"dim _Foo as string\");\n\nand \n print(\"dim m_Foo as string\");\nand\n print(\"dim foo as string\");\nI will like to know what's the standard for VB.net coding.\n" }, { "from": "gpt", "val...
am having trouble with visible attribute of an asp.net panel. Basically I have a page that calls a database table and returns the results in a detailsview. However, some of the values that are returned are null and if so I need to hide the image thats next to it. I am using a panel to determine whether to hide or show...
In ASP.NET Web Forms, when you're using data binding expressions within a control like `Panel`, you should be careful with the syntax you use. The `Visible` property cannot directly use complex expressions such as comparison to `DBNull.Value`. However, you can handle this logic effectively with a helper method. Here's...
47,547
[ { "from": "human", "value": "am having trouble with visible attribute of an asp.net panel. Basically I have a page that calls a database table and returns the results in a detailsview. However, some of the values that are returned are null and if so I need to hide the image thats next to it. \nI am using a ...
I am using sfOpenID plugin for Symfony, which doesn't support OpenID 2.0. That means, for example, that people using Yahoo! OpenID can't login to my site. There is an OpenID 2.0 plugin that works with sfGuard, but I am not using nor planning to use sfGuard. Plus, it requires to install Zend framework, too, which is an ...
It sounds like you're facing a challenge with OpenID 2.0 support in your Symfony application. Let's address your questions one by one. ### 1. Is there another OpenID plugin for Symfony supporting OpenID 2.0? While many Symfony projects primarily focused on OpenID 1.0 and later OAuth, you may still find some community...
46,947
[ { "from": "human", "value": "I am using sfOpenID plugin for Symfony, which doesn't support OpenID 2.0. That means, for example, that people using Yahoo! OpenID can't login to my site.\nThere is an OpenID 2.0 plugin that works with sfGuard, but I am not using nor planning to use sfGuard. Plus, it requires to...
How would I go about creating a virtual drive with which I can programmatically and dynamically change the contents? For instance, program A starts running and creates a virtual drive. When program B looks in the drive, it sees an error log and starts reading/processing it. In the middle of all this program A gets a ...
Creating a virtual drive in a way that allows one program to update a log file while another program reads it can be a complex task, especially if you need to maintain the illusion that the file size is much larger than it actually is. Here’s a high-level overview of how you could approach this problem on both Windows ...
45,489
[ { "from": "human", "value": "How would I go about creating a virtual drive with which I can programmatically and dynamically change the contents?\nFor instance, program A starts running and creates a virtual drive. When program B looks in the drive, it sees an error log and starts reading/processing it. I...
i wind up having about 20 different parameters in the constructor of the model class, one for each service? Is this normal or a sign that something is off.
Having a constructor with around 20 parameters is generally considered a sign that something might be off in your design. While it’s not inherently wrong, it can lead to several issues, such as: 1. **Complexity**: A constructor with many parameters can be complex and hard to manage. It becomes challenging to understan...
49,284
[ { "from": "human", "value": "i wind up having about 20 different parameters in the constructor of the model class, one for each service? Is this normal or a sign that something is off.\n" }, { "from": "gpt", "value": "Having a constructor with around 20 parameters is generally considered a sign...
I would like to implement a payment solution with my Rails site using Paypal Website Payments Standard. (See https://www.paypal.com/IntegrationCenter/ic_standard_home.html). I don't want fancy gateways, and I don't want to go through the hassles related to storing credit card information. I also want to use Paypal IPN ...
To implement PayPal Website Payments Standard with your Rails application, you can follow a few steps to integrate it efficiently without needing a complex setup. Below are some guidance points and resources: ### Steps to Implement PayPal Website Payments Standard: 1. **Create a PayPal Account**: - If your busines...
41,723
[ { "from": "human", "value": "I would like to implement a payment solution with my Rails site using Paypal Website Payments Standard. (See https://www.paypal.com/IntegrationCenter/ic_standard_home.html). I don't want fancy gateways, and I don't want to go through the hassles related to storing credit card in...
I've got a third-party program that's making WMI queries to local WMI providers (so it's not using DCOM, so packet-sniffers are out). I'd like to find out what queries these are. It's also on XP, so the new Vista WMI tracing infrastructure is out, as well, unfortunately. Any pointers?
To capture WMI queries on Windows XP, you have a couple of options since the built-in tracing and logging features available in later versions of Windows are not present in XP. Here are some methods you might consider: ### 1. **WMI Event Consumers (Event Subscriptions)** You can create an event consumer that listens f...
47,648
[ { "from": "human", "value": "I've got a third-party program that's making WMI queries to local WMI providers (so it's not using DCOM, so packet-sniffers are out). I'd like to find out what queries these are.\nIt's also on XP, so the new Vista WMI tracing infrastructure is out, as well, unfortunately.\nAny p...
I've done some delving into AppleScript but I'm interested in how difficult and long it would take to make semi-useful Mac apps. What really good resources besides Apple Documentation?
Creating semi-useful Mac apps with AppleScript can be a rewarding experience, and the level of difficulty and time it takes can vary depending on the complexity of the app you want to create. Here are some resources that go beyond Apple’s official documentation: ### 1. **Books** - **“AppleScript: The Definitive Guide”...
48,201
[ { "from": "human", "value": "I've done some delving into AppleScript but I'm interested in how difficult and long it would take to make semi-useful Mac apps.\nWhat really good resources besides Apple Documentation?\n" }, { "from": "gpt", "value": "Creating semi-useful Mac apps with AppleScript c...
If I have a large set of continuous ranges ( e.g. [0..5], [10..20], [7..13],[-1..37] ) and can arrange those sets into any data-structure I like, what's the most efficient way to test which sets a particular test_number belongs to? I've thought about storing the sets in a balanced binary tree based on the low number of...
What you're dealing with is a classic range query problem, and there are a number of efficient data structures that can be employed to address it. Your intuition about using a balanced binary tree is a good starting point, but there are specialized structures that may work even better for range queries. Here are a few ...
47,780
[ { "from": "human", "value": "If I have a large set of continuous ranges ( e.g. [0..5], [10..20], [7..13],[-1..37] ) and can arrange those sets into any data-structure I like, what's the most efficient way to test which sets a particular test_number belongs to?\nI've thought about storing the sets in a balan...
What's the best way to extract the key and value from a string like this: var myString = 'A1234=B1234'; I originally had something like this: myString.split('='); And that works fine, BUT an equal (=) sign could be used as a key or value within the string plus the string could have quotes, like this: var myString = '...
You can achieve this by using a regular expression to extract the key and value from the string while accounting for the various scenarios you've described (quotes, spaces, and possible presence of additional equal signs). Here’s a solution using JavaScript: ```javascript function extractKeyValue(myString) { // Tr...
48,823
[ { "from": "human", "value": "What's the best way to extract the key and value from a string like this:\nvar myString = 'A1234=B1234';\n\nI originally had something like this:\nmyString.split('=');\n\nAnd that works fine, BUT an equal (=) sign could be used as a key or value within the string plus the string...
I've been always thinking that DOMNodeInsertedIntoDocument/DOMNodeRemovedFromDocument events should not bubble, and for me that made enough sence. However, just recently I looked into specification once again and found out that in one location it says these events should not bubble (Complete list of event types), while...
The behavior of `DOMNodeInsertedIntoDocument` and `DOMNodeRemovedFromDocument` events has historically been a source of confusion due to inconsistent specifications and implementations across different browsers and frameworks. ### Should These Events Bubble? In general, the discussion about whether certain events sho...
47,071
[ { "from": "human", "value": "I've been always thinking that DOMNodeInsertedIntoDocument/DOMNodeRemovedFromDocument events should not bubble, and for me that made enough sence. However, just recently I looked into specification once again and found out that in one location it says these events should not bub...
How do I translate something like this into SQLAlchemy? select x - y as difference... I know how to do: x.label('foo') ...but I'm not sure where to put the ".label()" method call below: select ([table.c.x - table.c.y], ...
In SQLAlchemy, you can perform arithmetic operations directly on the column objects, and you can use the `.label()` method to give a name to the resulting expression. To translate a SQL query like `SELECT x - y AS difference` into SQLAlchemy, you can follow the structure below. Assuming you have a table with columns `...
48,726
[ { "from": "human", "value": "How do I translate something like this into SQLAlchemy?\nselect x - y as difference...\n\nI know how to do:\nx.label('foo')\n\n...but I'm not sure where to put the \".label()\" method call below:\nselect ([table.c.x - table.c.y], ...\n\n" }, { "from": "gpt", "value":...