instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
Can anbyody tell me how to include a certain folder when running unit tests in visual studio. In the folder are xml-files needed by the tests. I can't seem to find anymore where I need to add this folder. Thx, Lieven Cardoen aka Johlero
To include a specific folder with XML files (or any other resources) needed by your unit tests in Visual Studio, you can follow these steps: ### Step 1: Add the Folder to Your Project 1. **Right-click on your project** in the Solution Explorer. 2. Select **Add** > **Existing Item**. 3. Navigate to the folder where you...
30,581
[ { "from": "human", "value": "Can anbyody tell me how to include a certain folder when running unit tests in visual studio. In the folder are xml-files needed by the tests. I can't seem to find anymore where I need to add this folder.\nThx, Lieven Cardoen aka Johlero\n" }, { "from": "gpt", "value...
Something like this one on the Stackoverflow site would be nice! Or something non-jQuery that doesn't conflict with jQuery $() tags would be great.
If you're looking for a JavaScript solution that can function similarly to jQuery without conflicts, consider using Vanilla JavaScript or a lightweight library that does not use the `$` symbol. Here are a couple of approaches you can use: ### Vanilla JavaScript You can use native JavaScript functions to accomplish ma...
35,008
[ { "from": "human", "value": "Something like this one on the Stackoverflow site would be nice! \nOr something non-jQuery that doesn't conflict with jQuery $() tags would be great.\n" }, { "from": "gpt", "value": "If you're looking for a JavaScript solution that can function similarly to jQuery wi...
I have read that it is possible to build GTK+ on MacOS X. I know that it's possible to create a bundle of a GTK+ application on MacOS. I also know that it's possible to create widgets that look sort of native. However, searching around I am not really clear on how to create a bundle that includes the native theme st...
Creating a GTK+ application bundle for macOS using Python can be accomplished through a combination of installing the necessary dependencies, creating your application, and then packaging it into a macOS application bundle. Below, I'll guide you step-by-step on how to achieve this. ### Step 1: Install Required Tools a...
24,191
[ { "from": "human", "value": "I have read that it is possible to build GTK+ on MacOS X. I know that it's possible to create a bundle of a GTK+ application on MacOS. I also know that it's possible to create widgets that look sort of native. However, searching around I am not really clear on how to create a...
I'm fairly new to MVC coming from a php background where I designed by view and created pages when I needed something like say a login form. I'd have a file called login. This only sucked when I needed a new login form to login a different type of user. Say an admin. I'd then have to create a new page called login-...
In an MVC (Model-View-Controller) architecture, structuring your controllers can indeed be a bit of a challenge when you're transitioning from a more file-based approach like in traditional PHP development. Here are some key practices and considerations to help you determine how to structure your controllers effectivel...
30,565
[ { "from": "human", "value": "I'm fairly new to MVC coming from a php background where I designed by view and created pages when I needed something like say a login form. I'd have a file called login. This only sucked when I needed a new login form to login a different type of user. Say an admin. I'd the...
Do you generate your data dictionary? If so, how? I use extended procedures in SQL Server 2005 to hold onto table and field information. I have some queries that create a dictionary out of them, but it's ... meh. Do you have a particular query or tool you use? Do you generate it off of your database diagrams? Googling...
Generating a data dictionary for your SQL Server database is a useful practice for maintaining documentation and ensuring that users understand the structure and relationships within your database. While SQL Server 2005 does not have built-in tools specifically for generating a data dictionary, you can create your own ...
32,336
[ { "from": "human", "value": "Do you generate your data dictionary? If so, how?\nI use extended procedures in SQL Server 2005 to hold onto table and field information. I have some queries that create a dictionary out of them, but it's ... meh. Do you have a particular query or tool you use? Do you generate ...
How can I parse the query string (GET / POST parameters) sent to an application's manifest in .NET ? From one application, I am calling MyApp.application which needs to install my .NET application (if not installed) and in any case it should call the application which should parse the GET parameters. Later edit: I hav...
To parse query string parameters in a .NET application that is launched via a ClickOnce deployment, you will need to handle the parameters in the application's main entry point. However, there are some important points to clarify: 1. **ClickOnce Applications**: When a ClickOnce application is launched, it typically ...
30,638
[ { "from": "human", "value": "How can I parse the query string (GET / POST parameters) sent to an application's manifest in .NET ?\nFrom one application, I am calling MyApp.application which needs to install my .NET application (if not installed) and in any case it should call the application which should pa...
All the examples I see are for Java SE applications by passing your JAR file at the command line. Can JConsole attach to a WAR or EAR and monitor application performance?
JConsole is a monitoring tool that can be used to monitor Java applications, including those packaged as WAR (Web Application Archive) or EAR (Enterprise Archive) files, but there are some key points to understand: 1. **JVM Process**: JConsole attaches to a running Java Virtual Machine (JVM). Therefore, it can monitor...
36,002
[ { "from": "human", "value": "All the examples I see are for Java SE applications by passing your JAR file at the command line. Can JConsole attach to a WAR or EAR and monitor application performance?\n" }, { "from": "gpt", "value": "JConsole is a monitoring tool that can be used to monitor Java ...
I just can't remember the terminology used for this and other related properties. EDIT - Maybe such a concept doesn't exist but I remember reading something in Effective C++ (or More Effective C++) where he advocated using swaps to commit changes last in the function because the vector swap functions were guaranteed no...
What you're referring to is often called the **"strong exception safety guarantee"**. In the context of C++ and the Effective C++ series by Scott Meyers, using the `swap()` function is a technique to provide a strong exception guarantee for operations that could potentially throw exceptions. ### Explanation of the Con...
34,882
[ { "from": "human", "value": "I just can't remember the terminology used for this and other related properties.\nEDIT - Maybe such a concept doesn't exist but I remember reading something in Effective C++ (or More Effective C++) where he advocated using swaps to commit changes last in the function because th...
I am working on an application where I have an images folder relative to my application root. I want to be able to specify this relative path in the Properties -> Settings designer eg. "\Images\". The issue I am running into is in cases where the Environment.CurrentDirectory gets changed via an OpenFileDialog the relat...
In your application, if you want to store a relative path in the application settings and ensure that it always resolves from the application's directory (not the current directory), you can achieve this by leveraging the `AppDomain.CurrentDomain.BaseDirectory` property or `Application.StartupPath` property. Unfortunat...
35,185
[ { "from": "human", "value": "I am working on an application where I have an images folder relative to my application root. I want to be able to specify this relative path in the Properties -> Settings designer eg. \"\\Images\\\". The issue I am running into is in cases where the Environment.CurrentDirectory...
I'm thinking of creating a generic message queue to handle various inter-process messages. (WCF is not an option at this point.) So, rather than have 10-15 different queues for specific messages I'd have 1 queue that is a 'catch-all'. Obviously sending messages to this queue is a not a problem. Each recipient woul...
Creating a generic message queue that serves multiple types of messages while allowing recipients to only process relevant messages can be challenging, but it's certainly achievable with the right design. Here’s a structured approach to achieve this while keeping the implementation clean and efficient. ### Key Concept...
28,860
[ { "from": "human", "value": "I'm thinking of creating a generic message queue to handle various inter-process messages. (WCF is not an option at this point.) So, rather than have 10-15 different queues for specific messages I'd have 1 queue that is a 'catch-all'. \nObviously sending messages to this queu...
I have an existing Stored Procedure which I am trying to now call with LINQ to SQL, here is the stored procedure: ALTER procedure [dbo].[sp_SELECT_Security_ALL] ( @UID Varchar(15) ) as DECLARE @A_ID int If ISNULL(@UID,'') = '' SELECT DISTINCT App_ID, App_Name, App_Description, ...
In LINQ to SQL, when you call a stored procedure that returns multiple result sets or conditional result sets, it can sometimes be difficult to access all the data due to how the ORM maps the results to objects. In your case, it seems like your stored procedure returns different types of results based on the value of `...
35,517
[ { "from": "human", "value": "I have an existing Stored Procedure which I am trying to now call with LINQ to SQL, here is the stored procedure:\nALTER procedure [dbo].[sp_SELECT_Security_ALL] (\n@UID Varchar(15)\n)\nas\nDECLARE @A_ID int\n\nIf ISNULL(@UID,'') = ''\n SELECT DISTINCT\n App_ID...
So here's my current code: List<string> rowGroups = GetFileGroups((int)row.Cells["document_security_type"].Value); bool found = false; System.Security.Principal.WindowsPrincipal p = new System.Security.Principal.WindowsPrincipal(System.Security.Principal.WindowsIdentity.GetCurrent()); foreach (string group in rowGroup...
Based on the description of your issue, there are a few key points to consider when dealing with the `IsInRole` function and domain changes: ### 1. **Domain Context** When a machine is connected to multiple domains, the security context for the current user is determined by the domain they are authenticated against. I...
35,479
[ { "from": "human", "value": "So here's my current code:\nList<string> rowGroups = GetFileGroups((int)row.Cells[\"document_security_type\"].Value);\nbool found = false;\nSystem.Security.Principal.WindowsPrincipal p = new System.Security.Principal.WindowsPrincipal(System.Security.Principal.WindowsIdentity.Get...
There seem to be a decent number of mod_rewrite threads floating around lately with a bit of confusion over how certain aspects of it work. As a result I've compiled a few notes on common functionality, and perhaps a few annoying nuances. What other features / common issues have you run across using mod_rewrite?
Mod_rewrite is a powerful and flexible module in Apache that allows for URL rewriting. However, it can be confusing due to its complexity and the many options it provides. Here are some common features and issues that users often encounter when working with mod_rewrite: ### Common Features 1. **Redirecting URLs**: ...
33,364
[ { "from": "human", "value": "There seem to be a decent number of mod_rewrite threads floating around lately with a bit of confusion over how certain aspects of it work. As a result I've compiled a few notes on common functionality, and perhaps a few annoying nuances.\nWhat other features / common issues hav...
We are using jQuery thickbox to dynamically display an iframe when someone clicks on a picture. In this iframe, we are using galleria a javascript library to display multiple pictures. The problem seems to be that $(document).ready in the iframe seems to be fired too soon and the iframe content isn't even loaded yet, ...
To ensure that your code runs when the iframe is fully loaded, you should bind to the `load` event of the iframe's content window, rather than relying solely on `$(document).ready()`. The `load` event is fired when the entire content of the iframe, including images and other resources, is completely loaded. Here’s ho...
35,139
[ { "from": "human", "value": "We are using jQuery thickbox to dynamically display an iframe when someone clicks on a picture. In this iframe, we are using galleria a javascript library to display multiple pictures.\nThe problem seems to be that $(document).ready in the iframe seems to be fired too soon and ...
What's the Hi/Lo algorithm? I've found this in the NHibernate documentation (it's one method to generate unique keys, section 5.1.4.2), but I haven't found a good explanation of how it works. I know that Nhibernate handles it, and I don't need to know the inside, but I'm just curious.
The Hi/Lo algorithm is a strategy for generating unique identifiers (IDs) for database entities in a way that is efficient and scalable. It's particularly useful in environments where you need to generate a large number of unique keys without incurring the overhead of querying the database for each key generation. ###...
33,230
[ { "from": "human", "value": "What's the Hi/Lo algorithm?\nI've found this in the NHibernate documentation (it's one method to generate unique keys, section 5.1.4.2), but I haven't found a good explanation of how it works.\nI know that Nhibernate handles it, and I don't need to know the inside, but I'm just ...
Guys, I’ve been writing code for 15+ years, but managed to avoid “Web Development” until 3 months ago. I have inherited a legacy Asp.net application (started in .net 1.1, we’re now on .Net 2.0), it’s the administration tool for our product. In several places the admin tool simply maintains long lists of values. The lis...
To address your issue of returning the user to the specific item they just edited in a GridView after saving changes on the edit page, you are correct that there isn’t a built-in feature in ASP.NET Web Forms (especially in .NET 2.0) that directly handles this behavior. However, there are several approaches you can take...
34,389
[ { "from": "human", "value": "Guys, I’ve been writing code for 15+ years, but managed to avoid “Web Development” until 3 months ago.\nI have inherited a legacy Asp.net application (started in .net 1.1, we’re now on .Net 2.0), it’s the administration tool for our product.\nIn several places the admin tool sim...
The line where this error was called from is this: $celkova_suma=mysql_result($c_res, 0, 0)+mysql_result($d_res, 0, 0)-$zlava_suma+$arr[$_POST['sp_platby']]; Can someone tell me what I should be looking for??
The line of code you've provided seems to be attempting to calculate a total sum (`$celkova_suma`) by fetching results from two MySQL result sets (`$c_res` and `$d_res`), performing arithmetic operations on them, and adjusting the value with variables like `$zlava_suma` and an element from an array `$arr`. Here are so...
35,311
[ { "from": "human", "value": "The line where this error was called from is this:\n\n$celkova_suma=mysql_result($c_res, 0,\n 0)+mysql_result($d_res, 0,\n 0)-$zlava_suma+$arr[$_POST['sp_platby']];\n\nCan someone tell me what I should be looking for??\n" }, { "from": "gpt", "value": "The line of c...
Has anyone started making Unicode Apps or converting Existing Apps into Unicode? How are you tweaking Firebird to have the least problems, especially the CHARSET attribute? Is there any problem encountered? Any thing else that I should be aware of? I'm just preparing myself so that I get less surprises, before jumping ...
Transitioning applications to support Unicode can be a significant undertaking, especially if you're working with legacy systems or databases like Firebird. Here are some key considerations and steps to help you prepare for this transition: ### 1. Understanding Unicode: - **What is Unicode?**: Unicode is a standard fo...
31,615
[ { "from": "human", "value": "Has anyone started making Unicode Apps or converting Existing Apps into Unicode?\nHow are you tweaking Firebird to have the least problems, especially the CHARSET attribute?\nIs there any problem encountered? Any thing else that I should be aware of?\nI'm just preparing myself s...
The point of this question is to create the shortest not abusively slow Sudoku solver. This is defined as: don't recurse when there are spots on the board which can only possibly be one digit. Here is the shortest I have so far in python: r=range(81) s=range(1,10) def R(A): bzt={} for i in r: if A[i]!=0...
Here’s a Python implementation that follows the requirement of minimizing recursion in a Sudoku solver. This implementation uses a technique where it continuously fills in cells that can only contain a single digit until no more such cells are left, before resorting to recursion. Here's the code: ```python def R(A): ...
33,527
[ { "from": "human", "value": "The point of this question is to create the shortest not abusively slow Sudoku solver. This is defined as: don't recurse when there are spots on the board which can only possibly be one digit.\nHere is the shortest I have so far in python:\nr=range(81)\ns=range(1,10)\ndef R(A):\...
I have read that to send email in Java I need to obtain my ISP's SMTP address, but if I am intending to host my web app online, will this be my hosts ISP SMTP address? EDIT: So I need to find out my clients ISP's SMTP address and send via this?
When sending emails from a Java application, you generally need to specify an SMTP server through which your application can relay the email. Here are some points to clarify your confusion: 1. **SMTP Server**: This is a server that you use to send emails. If you're hosting a web application, you usually have access to...
34,509
[ { "from": "human", "value": "I have read that to send email in Java I need to obtain my ISP's SMTP address, but if I am intending to host my web app online, will this be my hosts ISP SMTP address?\nEDIT: So I need to find out my clients ISP's SMTP address and send via this?\n" }, { "from": "gpt", ...
I have a GridView defined like this: <asp:GridView ID="myGridView" ruant="server"> <asp:BoundField DataField="myField" /> <asp:CommandField ShowDeleteButton="true" ShowEditButton="true" /> </asp:GridView> After I put a row into edit mode with the Edit button, how do I capture the Enter key and trigger the resu...
To capture the Enter key and trigger the Update action on a GridView row in edit mode, you can use JavaScript (or jQuery) to handle the keydown event. You need to ensure that when the Enter key is pressed, the Update button for the row in edit mode is triggered. Here’s how you can accomplish this: 1. Assign a JavaScr...
33,176
[ { "from": "human", "value": "I have a GridView defined like this:\n<asp:GridView ID=\"myGridView\" ruant=\"server\">\n <asp:BoundField DataField=\"myField\" />\n <asp:CommandField ShowDeleteButton=\"true\" ShowEditButton=\"true\" />\n</asp:GridView>\n\nAfter I put a row into edit mode with the Edit bu...
I've got a somewhat dated Java EE application running on Sun Application Server 8.1 (aka SJSAS, precursor to Glassfish). With 500+ simultaneous users the application becomes unacceptably slow and I'm trying to assist in identifying where most of the execution time is spent and what can be done to speed it up. So far,...
Given the scenario you’ve described, where requests for static files within the same Java EE application server (SJSAS) process are exceedingly slow while requests for the same files outside the application server are fast, it’s crucial to focus on aspects specifically related to the server’s handling of those requests...
34,702
[ { "from": "human", "value": "I've got a somewhat dated Java EE application running on Sun Application Server 8.1 (aka SJSAS, precursor to Glassfish). With 500+ simultaneous users the application becomes unacceptably slow and I'm trying to assist in identifying where most of the execution time is spent and ...
I'm using the Apache Commons EqualsBuilder to build the equals method for a non-static Java inner class. For example: import org.apache.commons.lang.builder.EqualsBuilder; public class Foo { public class Bar { private Bar() {} public Foo getMyFoo() { return Foo.this } ...
In Java, when you have a non-static inner class, the inner class automatically has a reference to its enclosing outer class (in your case, `Foo`). This reference can be accessed via the `OuterClassName.this` syntax, as you have done with the `getMyFoo()` method. Unfortunately, there is no direct way to refer to the en...
36,229
[ { "from": "human", "value": "I'm using the Apache Commons EqualsBuilder to build the equals method for a non-static Java inner class. For example:\nimport org.apache.commons.lang.builder.EqualsBuilder;\n\npublic class Foo {\n public class Bar {\n private Bar() {}\n\n public Foo getMyFoo() {...
Is there a max length for an array in C++? Is it a C++ limit or does it depend on my machine? Is it tweakable? Does it depend on the type the array is made of? Can I break that limit somehow or do I have to search for a better way of storing information? And what should be the simplest way? What I have to do is storing...
In C++, the maximum length of an array is not a fixed limit imposed by the language itself; rather, it is influenced by several factors, including: 1. **Type of Array**: The type of elements you store in the array can affect the total size of the array. For example, an array of `long long int` (which is typically 8 by...
34,756
[ { "from": "human", "value": "Is there a max length for an array in C++?\nIs it a C++ limit or does it depend on my machine? Is it tweakable? Does it depend on the type the array is made of?\nCan I break that limit somehow or do I have to search for a better way of storing information? And what should be the...
Pretty self explanatory. I just need to export lists easily to xml format. Are there any tools that accomplish this?
Yes, there are several tools and methods available to help you export lists to XML format easily. Here are some options you might consider: ### 1. **Spreadsheet Software (Excel, Google Sheets)** - **Excel**: You can create your list in Excel and then use the "Save As" option to export it as an XML file. However, yo...
33,651
[ { "from": "human", "value": "Pretty self explanatory. I just need to export lists easily to xml format. Are there any tools that accomplish this?\n" }, { "from": "gpt", "value": "Yes, there are several tools and methods available to help you export lists to XML format easily. Here are some optio...
Suppose I have following string: String asd = "this is test ass this is test" and I want to split the string using "ass" character sequence. I used: asd.split("ass"); It doesn't work. What do I need to do?
The `String.split()` method in Java uses regular expressions, and the string "ass" does not require any special handling in this case. However, if you are facing issues, make sure you are using the method correctly. Here's how you can split the string "this is test ass this is test" by the substring "ass": ```java p...
33,729
[ { "from": "human", "value": "Suppose I have following string:\nString asd = \"this is test ass this is test\"\n\nand I want to split the string using \"ass\" character sequence.\nI used:\nasd.split(\"ass\");\n\nIt doesn't work. What do I need to do?\n" }, { "from": "gpt", "value": "The `String.s...
I need to do the following for hundreds of files: Append the name of the file (which may contain spaces) to the end of each line in the file. It seems to me there should be some way to do this: sed -e 's/$/FILENAME/' * where FILENAME represents the name of the current file. Is there a sed variable representing the cu...
You can achieve this task using a simple `bash` loop along with `sed`. While `sed` does not have a built-in variable to directly reference the current filename, you can use a loop to read through each file and pass its name to `sed`. Here's how you can do it: ```bash for file in *; do # Check if it is a regular fi...
36,111
[ { "from": "human", "value": "I need to do the following for hundreds of files:\nAppend the name of the file (which may contain spaces) to the end of each line in the file.\nIt seems to me there should be some way to do this:\nsed -e 's/$/FILENAME/' *\n\nwhere FILENAME represents the name of the current file...
I use Apache POI to write excel sheets. I'm very happy with it, but I have the following problem: my program is multi-currency and internationalized. In the excel sheet I write, I want my currency cells to be properly formatted. For that, I need a routine that would build the right Excel currency format (eg: "[$$-409]...
To create a proper Excel currency format based on `java.util.Currency` and `java.util.Locale`, you can use the following custom implementation. While there isn't a dedicated library for this specific task, you can build your own method that constructs the format string using the currency symbol and locale information. ...
35,160
[ { "from": "human", "value": "I use Apache POI to write excel sheets. I'm very happy with it, but I have the following problem: my program is multi-currency and internationalized. In the excel sheet I write, I want my currency cells to be properly formatted. For that, \nI need a routine that would build the ...
I need to create a function that will produce a balloon popup in the taskbar using javascript. Is it possible? Whats the shortest and easiest way to do this? or else what will be the available method.. Thanks.
Creating a balloon popup in the taskbar is not directly possible using standard JavaScript in a web environment due to security restrictions and browser limitations. Web browsers do not have access to the operating system's notification system or taskbar functionality. However, if you are developing a desktop applicat...
31,843
[ { "from": "human", "value": "I need to create a function that will produce a balloon popup in the\ntaskbar using javascript. \nIs it possible? Whats the shortest and easiest way to do this?\nor else what will be the available method.. \nThanks.\n" }, { "from": "gpt", "value": "Creating a balloon...
I'm working on scripts that apply database schema updates. I've setup all my SQL update scripts using start transaction/commit. I pass these scripts to psql on the command line. I now need to apply multiple scripts at the same time, and in one transaction. So far the only solution I've come up with is to remove the sta...
In PostgreSQL, true nested transactions are not supported as you might find in some other database systems. However, you can simulate this behavior using **savepoints**. Savepoints allow you to create points within a transaction that you can roll back to, without rolling back the entire transaction. Here's how you can...
32,251
[ { "from": "human", "value": "I'm working on scripts that apply database schema updates. I've setup all my SQL update scripts using start transaction/commit. I pass these scripts to psql on the command line.\nI now need to apply multiple scripts at the same time, and in one transaction. So far the only solut...
I have a few listview controls on a windows form and i've assigned a common contextmenustrip to them all using the properties grid in VS2005. Now when a selection is made from the contextmenu in any listview, is there a way i can get the correct hosting control of the raised menu?
Yes, you can determine which `ListView` control is hosting the context menu when a menu item is selected. The `ContextMenuStrip` has an event called `ItemClicked`, which you can use to find out which `ListView` initiated the context menu. Here’s how you can set it up: 1. **Add the `ItemClicked` Event**: You'll need ...
35,930
[ { "from": "human", "value": "I have a few listview controls on a windows form and i've assigned a common contextmenustrip to them all using the properties grid in VS2005.\nNow when a selection is made from the contextmenu in any listview, is there a way i can get the correct hosting control of the raised me...
I am using the functions strpos(string, string) in javascript. In Firefox, Opera and IE the page loads fine, but in Chrome I get the error: Uncaught ReferenceError: strpos is not defined. The page I am working on is http://seniorproject.korykirk.com/0xpi2.php
The `strpos` function you are trying to use is not a built-in JavaScript function; instead, it's a function from PHP. In JavaScript, you can achieve the same functionality using the `String.prototype.indexOf` method. Here’s how you can replicate the `strpos` functionality in JavaScript: ```javascript function strpos(...
37,103
[ { "from": "human", "value": "I am using the functions strpos(string, string) in javascript. In Firefox, Opera and IE the page loads fine, but in Chrome I get the error: Uncaught ReferenceError: strpos is not defined. The page I am working on is http://seniorproject.korykirk.com/0xpi2.php\n" }, { "fr...
When considering using performance counters as my companies' .NET based site, I was wondering how big the overhead is of using them. Do I want to have my site continuously update it's counters or am I better off to only do when I measure?
When considering using performance counters in your .NET-based site, it's important to evaluate the overhead they may introduce and how to best implement them for your specific use case. Here are some key points to consider: ### Overhead of Performance Counters 1. **Minimal Impact**: Generally, the overhead of using ...
34,910
[ { "from": "human", "value": "When considering using performance counters as my companies' .NET based site, I was wondering how big the overhead is of using them. \nDo I want to have my site continuously update it's counters or am I better off to only do when I measure?\n" }, { "from": "gpt", "va...
I need to take a BufferedImage and convert it to YCbCr format so that I can do a more efficient Brightness/contrast manipulation on it, but I can't figure out how to do this. I've tried ColorConvertOp but there doesn't seem to be an appropriate ColorSpace for YCbCr (though there is a type for it?). I could do the co...
To convert a `BufferedImage` to the YCbCr color space in Java for more efficient brightness and contrast manipulation, you're correct that the `ColorConvertOp` class does not directly support YCbCr as a color space. However, you can still perform this conversion manually while keeping performance in mind. If you're l...
29,438
[ { "from": "human", "value": "I need to take a BufferedImage and convert it to YCbCr format so that I can do a more efficient Brightness/contrast manipulation on it, but I can't figure out how to do this. I've tried ColorConvertOp but there doesn't seem to be an appropriate ColorSpace for YCbCr (though ther...
I'm looking for best practices for performing strict (whitelist) validation/filtering of user-submitted HTML. Main purpose is to filter out XSS and similar nasties that may be entered via web forms. Secondary purpose is to limit breakage of HTML content entered by non-technical users e.g. via WYSIWYG editor that has a...
When it comes to performing strict (whitelist) validation and filtering of user-submitted HTML to prevent XSS and other vulnerabilities, it's essential to balance security with usability. Here are some best practices, strategies, and pitfalls to consider: ### Best Practices for HTML Filtering 1. **Use Well-Establishe...
25,665
[ { "from": "human", "value": "I'm looking for best practices for performing strict (whitelist) validation/filtering of user-submitted HTML.\nMain purpose is to filter out XSS and similar nasties that may be entered via web forms. Secondary purpose is to limit breakage of HTML content entered by non-technica...
I've been working on a "big bang" rewrite for, literally, over two years. The management has consistently and relentlessly ignored and belittled my calls to allocate time / resources for performance measurement, capacity planning, and optimization before the app replaces their mega-millions money maker flagship web app...
It's great to hear that you've successfully influenced management to prioritize performance measurement and capacity planning, even if it took longer than ideal. Here are some suggestions for dealing with similar situations in the future and helping educate managers or clients about the importance of performance testin...
33,059
[ { "from": "human", "value": "I've been working on a \"big bang\" rewrite for, literally, over two years. The management has consistently and relentlessly ignored and belittled my calls to allocate time / resources for performance measurement, capacity planning, and optimization before the app replaces their...
I'm writing an image bank with Django, and I want to add a button to get a hi-res version of an image (the low-res is shown in the details page). If I put just an <a> link, the browser will open the image instead of downloading it. Adding an HTTP header like: Content-Disposition: attachment; filename="beach008.jpg" ...
To achieve the functionality you want—downloading a high-resolution image using Django and NGINX—you can follow these steps: ### Option 1: Serve Directly with NGINX You can leverage NGINX to serve the images with the correct `Content-Disposition` header for downloads. Here's how to set it up: 1. **Location Block in ...
28,528
[ { "from": "human", "value": "I'm writing an image bank with Django, and I want to add a button to get a hi-res version of an image (the low-res is shown in the details page). If I put just an <a> link, the browser will open the image instead of downloading it. Adding an HTTP header like:\nContent-Disposi...
I'm working on a program that searches entire drives for a given file. At the moment, I calculate an MD5 hash for the known file and then scan all files recursively, looking for a match. The only problem is that MD5 is painfully slow on large files. Is there a faster alternative that I can use while retaining a very sm...
When searching for files by comparing hashes, MD5 is indeed commonly used, but it can be relatively slow for large files due to its cryptographic nature. However, as you noted, disk I/O may be the limiting factor, especially when scanning large drives. ### Alternatives to Improve Performance: 1. **Use a Faster Hash ...
35,258
[ { "from": "human", "value": "I'm working on a program that searches entire drives for a given file. At the moment, I calculate an MD5 hash for the known file and then scan all files recursively, looking for a match.\nThe only problem is that MD5 is painfully slow on large files. Is there a faster alternativ...
I'm working on a project where we mix .NET code and native C++ code via a C++/CLI layer. In this solution I want to use Thread Local Storage via the __declspec(thread) declaration: __declspec(thread) int lastId = 0; However, at the first access of the variable, I get a NullReferenceException. To be more precise, the d...
When using C++/CLI to mix .NET code with native C++ code, it's important to understand how different threading and storage mechanisms interact between managed and unmanaged contexts. Your usage of `__declspec(thread)` for thread-local storage may not work as expected in a managed C++/CLI class. Here are a few points t...
32,538
[ { "from": "human", "value": "I'm working on a project where we mix .NET code and native C++ code via a C++/CLI layer. In this solution I want to use Thread Local Storage via the __declspec(thread) declaration:\n__declspec(thread) int lastId = 0;\n\nHowever, at the first access of the variable, I get a NullR...
I run a website where users can post items (e.g. pictures). The items are stored in a MySQL database. I want to query for the last ten posted items BUT with the constraint of a maximum of 3 items can come from any single user. What is the best way of doing it? My preferred solution is a constraint that is put on the ...
To achieve the desired behavior of retrieving the last ten posted items while enforcing a maximum of three items per user, you can use a combination of SQL queries. Unfortunately, there's no direct SQL clause that allows you to limit the number of rows per group in a single query without using subqueries or CTEs (Commo...
34,612
[ { "from": "human", "value": "I run a website where users can post items (e.g. pictures). The items are stored in a MySQL database. \nI want to query for the last ten posted items BUT with the constraint of a maximum of 3 items can come from any single user. \nWhat is the best way of doing it? My preferred s...
Specifically, I want to copy a link (with text and location) and then to be able to paste it, e.g., into Word as a link.
To copy a hyperlink (with both the text and the URL) and paste it into Microsoft Word as a clickable link, follow these steps: ### Method 1: Using a Web Browser 1. **Copy the Link:** - Highlight the text of the link you want to copy on the webpage. - Right-click on the highlighted text and select **Copy** or us...
24,886
[ { "from": "human", "value": "Specifically, I want to copy a link (with text and location) and then to be able to paste it, e.g., into Word as a link.\n" }, { "from": "gpt", "value": "To copy a hyperlink (with both the text and the URL) and paste it into Microsoft Word as a clickable link, follow...
I have this CheckBoxList on a page: <asp:checkboxlist runat="server" id="Locations" datasourceid="LocationsDatasource" datatextfield="CountryName" datavaluefield="CountryCode" /> I'd like to loop through the checkbox elements on the client using Javascript and grab the value of each checked checkbox, but the values...
In ASP.NET, when you use the `CheckBoxList` control, the `DataValueField` (in your case `CountryCode`) is not directly rendered as a value attribute in the HTML for the checkboxes. Instead, it is used server-side to manage the state of the checkboxes. However, you can still access the values on the client side by using...
24,639
[ { "from": "human", "value": "I have this CheckBoxList on a page:\n<asp:checkboxlist runat=\"server\" id=\"Locations\" datasourceid=\"LocationsDatasource\"\n datatextfield=\"CountryName\" datavaluefield=\"CountryCode\" />\n\nI'd like to loop through the checkbox elements on the client using Javascript and ...
What is the best way to use ListView and a set of GroupBoxes as an Options window? For example, Listview will have items such as General, Sounds, Shortcuts and there will be three groupboxes defining those same things. What would be the best programmatical way to navigate through them everytime an item in the listview ...
Using a `ListView` alongside `GroupBoxes` for an options window is a common pattern in GUI design, especially in applications that require user settings. Your approach of hiding all groupboxes and showing one based on the selected item in the `ListView` is a good way to manage the display. Here are some steps and best ...
32,731
[ { "from": "human", "value": "What is the best way to use ListView and a set of GroupBoxes as an Options window?\nFor example, Listview will have items such as General, Sounds, Shortcuts and there will be three groupboxes defining those same things.\nWhat would be the best programmatical way to navigate thro...
What are the best algorithms (and explanations) for representing and rotating the pieces of a tetris game? I always find the piece rotation and representation schemes confusing. Most tetris games seem to use a naive "remake the array of blocks" at each rotation: http://www.codeplex.com/Project/ProjectDirectory.aspx?Pr...
Representing and rotating Tetris pieces can indeed be confusing due to the need to manipulate their shapes effectively. Let's break down the main methods for representing the pieces and rotating them. ### Tetris Piece Representation Tetris pieces can be represented as 2D arrays, where each piece corresponds to a shap...
32,340
[ { "from": "human", "value": "What are the best algorithms (and explanations) for representing and rotating the pieces of a tetris game? I always find the piece rotation and representation schemes confusing.\nMost tetris games seem to use a naive \"remake the array of blocks\" at each rotation:\nhttp://www....
I'm doing some text rendering in Cocoa using NSAttributedString, and setting the font and underline properties, etc. However, I can't figure out how I can change the text's tracking. Any suggestions?
In Cocoa, you can adjust the tracking (letter spacing) of text rendered using `NSAttributedString` by using the `NSKernAttributeName` attribute. The `NSKernAttributeName` attribute allows you to specify the amount of space to be added between characters. Here’s how you can set the tracking for an `NSAttributedString`:...
34,890
[ { "from": "human", "value": "I'm doing some text rendering in Cocoa using NSAttributedString, and setting the font and underline properties, etc. However, I can't figure out how I can change the text's tracking. Any suggestions?\n" }, { "from": "gpt", "value": "In Cocoa, you can adjust the tra...
I am attempting to compose a style sheet that, given an XML input (obviously) and a parameter that specifies a "target", will produce a list of commands that match that target. Here is the style sheet as written: <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <x...
Your XSLT seems mostly correct, but the issue you're experiencing with the parameter not being set correctly is likely due to the way you're referencing the parameter in your XSLT. In XSLT, the way you define and use parameters can sometimes lead to confusion, especially with regards to how the parameters are passed ...
33,963
[ { "from": "human", "value": "I am attempting to compose a style sheet that, given an XML input (obviously) and a parameter that specifies a \"target\", will produce a list of commands that match that target. Here is the style sheet as written:\n<?xml version=\"1.0\"?>\n<xsl:stylesheet xmlns:xsl=\"http://ww...
When looking at the myriad types of software written at our company, I instantly jump to conclusions of the quality of the entire product based on the UI. If I find misspellings, weird tab orders, fields not lined up, odd colors, I assume that the entire application is of poor quality. I'm assuming that if the program...
Your perspective on evaluating software quality based on UI design is a common approach, but it's important to consider both the strengths and limitations of this viewpoint. ### Strengths of Evaluating Based on UI 1. **First Impressions Matter**: The UI is often the first interaction a user has with the software. A p...
35,333
[ { "from": "human", "value": "When looking at the myriad types of software written at our company, I instantly jump to conclusions of the quality of the entire product based on the UI. If I find misspellings, weird tab orders, fields not lined up, odd colors, I assume that the entire application is of poor ...
Is it possible to create a simple 3D model (for example in 3DS MAX) and then import it to Android?
Yes, it is definitely possible to create a simple 3D model in software like 3DS Max and then import it into an Android application. Here's a general workflow you can follow: ### 1. Create a 3D Model in 3DS Max - Design your 3D model using 3DS Max. - Once you’re satisfied with your model, export it in a format that is ...
31,354
[ { "from": "human", "value": "Is it possible to create a simple 3D model (for example in 3DS MAX) and then import it to Android?\n" }, { "from": "gpt", "value": "Yes, it is definitely possible to create a simple 3D model in software like 3DS Max and then import it into an Android application. Her...
I am trying to fill a form in a php application from a C# client (Outlook addin). I used Fiddler to see the original request from within the php application and the form is transmitted as a multipart/form. Unfortunately .Net does not come with native support for this type of forms (WebClient has only a method for uploa...
To create a multipart/form-data request in a C# application, such as your Outlook add-in, you can use the `HttpClient` class, which is part of the `System.Net.Http` namespace. This class provides a more modern way to work with HTTP requests compared to `WebClient`. Below is an example of how to create a multipart/form...
32,573
[ { "from": "human", "value": "I am trying to fill a form in a php application from a C# client (Outlook addin). I used Fiddler to see the original request from within the php application and the form is transmitted as a multipart/form. Unfortunately .Net does not come with native support for this type of for...
In my MFC program I am using a splitter to create two panes. I now want to split one of these panes in half again and put in another view, can someone talk me through how to do it or point me in the direction of some code? I would prefer to code it myself so I am not interested in custom derived classes unless they are...
To split a pane in an MFC application using a splitter, you can utilize the `CSplitterWnd` class. Since you already have a splitter with two panes, you will effectively need to add another splitter to one of these panes. Here’s a step-by-step guide on how to do this: ### Step 1: Add the Necessary Includes Ensure you...
32,256
[ { "from": "human", "value": "In my MFC program I am using a splitter to create two panes. I now want to split one of these panes in half again and put in another view, can someone talk me through how to do it or point me in the direction of some code?\nI would prefer to code it myself so I am not interested...
I am designing an Automatic text summarizer. One of the major modules in this project requires TRAINING CORPUS. Can someone please help me out by providing TRAINING CORPUS or referring some link to download it. Thanks in anticipation
Creating an automatic text summarizer requires a substantial amount of training data. Here are some resources and corpora that can be used for training summarization models: 1. **CNN/Daily Mail Dataset**: - This dataset consists of news articles and their corresponding summaries. - You can access it [here](https...
34,704
[ { "from": "human", "value": "I am designing an Automatic text summarizer. One of the major modules in this project requires TRAINING CORPUS. Can someone please help me out by providing TRAINING CORPUS or referring some link to download it. Thanks in anticipation\n" }, { "from": "gpt", "value": "...
How can I make: DELETE FROM foo WHERE id=1 AND bar not contains id==1 To elaborate, how can I remove a row with id = 1, from table foo, only if there is not a row in table bar with id = 1.
To achieve your requirement of deleting a row from the `foo` table where `id = 1`, but only if there is no corresponding row in the `bar` table with the same `id = 1`, you can use a combination of a `DELETE` statement and a subquery to check for the existence of the row in the `bar` table. Here’s how you can structure...
37,121
[ { "from": "human", "value": "How can I make:\nDELETE FROM foo WHERE id=1 AND bar not contains id==1\nTo elaborate, how can I remove a row with id = 1, from table foo, only if there is not a row in table bar with id = 1.\n" }, { "from": "gpt", "value": "To achieve your requirement of deleting a r...
Lots of frameworks let me expose an ejb as a webservice. But then 2 months after publishing the initial service I need to change the ejb or any part of its interface. I still have clients that need to access the old interface, so I obviously need to have 2 webservices with different signatures. Anyone have any suggest...
To handle versioning in your EJB web services effectively, you can employ several strategies and utilize frameworks that facilitate creating and managing multiple service versions. Here are some suggestions and recommendations for frameworks: ### 1. **Service Versioning Approach:** - **Namespace Versioning**: As yo...
31,650
[ { "from": "human", "value": "Lots of frameworks let me expose an ejb as a webservice. \nBut then 2 months after publishing the initial service I need to change the ejb or any part of its interface. I still have clients that need to access the old interface, so I obviously need to have 2 webservices with dif...
I am seeing following exception when I try to use dynamic proxy com.intellij.rt.execution.application.AppMain DynamicProxy.DynamicProxy Exception in thread "main" java.lang.IllegalArgumentException: interface Interfaces.IPerson is not visible from class loader at java.lang.reflect.Proxy.getProxyClass(Proxy.java:3...
The `IllegalArgumentException: interface Interfaces.IPerson is not visible from class loader` exception you're encountering indicates that the dynamic proxy you're trying to create cannot access the specified interface (`IPerson`). This typically happens due to visibility issues regarding class loaders and/or package v...
30,748
[ { "from": "human", "value": "I am seeing following exception when I try to use dynamic proxy \n com.intellij.rt.execution.application.AppMain DynamicProxy.DynamicProxy\nException in thread \"main\" java.lang.IllegalArgumentException: interface Interfaces.IPerson is not visible from class loader\n at java...
I want to save and restore the window position of my WPF application. I want to make the code robust to use with multiple monitors who's number and relative location can change (I want to avoid opening my application off-screen when the monitor configuration has changed inbetween invocations). I know of the Screen clas...
To save and restore the window position of your WPF application robustly, you can use the `System.Windows.Window` properties to manage the position and size of your window without relying on the `Screen` class from `System.Windows.Forms`. The key is to use the `System.Windows.Interop` namespace to access information ab...
31,620
[ { "from": "human", "value": "I want to save and restore the window position of my WPF application. I want to make the code robust to use with multiple monitors who's number and relative location can change (I want to avoid opening my application off-screen when the monitor configuration has changed inbetwee...
Clearly the following is incorrect. INSERT INTO `aTable` (`A`,`B`) VALUES((SELECT MAX(`A`) FROM `aTable`)*2),'name'); I get the value: SQL query: INSERT INTO `aTable` (`A`, `B` ) VALUES ( ( SELECT MAX(`A`) FROM `aTable` ) *2 , 'name' ) MySQL said: 1093 - You can't specify target table 'aTable' for update...
The error you are encountering (`1093 - You can't specify target table 'aTable' for update in FROM clause`) occurs in MySQL when you attempt to perform a subquery on the same table you are inserting into. In this case, you can't use `aTable` in the subquery to retrieve `MAX(A)` while also trying to insert a new row int...
36,169
[ { "from": "human", "value": "Clearly the following is incorrect.\nINSERT INTO `aTable` (`A`,`B`) VALUES((SELECT MAX(`A`) FROM `aTable`)*2),'name');\n\nI get the value:\nSQL query: \nINSERT INTO `aTable` (`A`, `B` )\nVALUES \n(\n (\n SELECT MAX(`A`)\n FROM `aTable`\n ) *2\n , 'name'\n)\n\nMySQL said:\n...
I've recently become aware that there's a distinction between IP multicasting (which apparently doesn't work that well on the public internet) and application multicasting (which is apparently used in IRC and PSYC, per http://en.wikipedia.org/wiki/Multicast). Is there a good tutorial on implementing application-level m...
You're correct that there are two different concepts regarding multicasting: IP multicasting and application-level multicasting. Let’s break these down a bit and then discuss resources for implementing application-level multicasting. ### IP Multicasting vs. Application-Level Multicasting 1. **IP Multicasting**: - ...
33,138
[ { "from": "human", "value": "I've recently become aware that there's a distinction between IP multicasting (which apparently doesn't work that well on the public internet) and application multicasting (which is apparently used in IRC and PSYC, per http://en.wikipedia.org/wiki/Multicast).\nIs there a good tu...
I have hit upon this problem about whether to use bignums in my language as a default datatype when there's numbers involved. I've evaluated this myself and reduced it to a convenience&comfort vs. performance -question. The answer to that question depends about how large the performance hit is in programs that aren't g...
The choice to use bignums (arbitrary-precision integers) as a default datatype in a programming language can have significant implications for performance, usability, and the overall design philosophy of the language. Here’s a breakdown of the considerations involved in your decision: ### Overhead of Bignums 1. **Mem...
29,961
[ { "from": "human", "value": "I have hit upon this problem about whether to use bignums in my language as a default datatype when there's numbers involved. I've evaluated this myself and reduced it to a convenience&comfort vs. performance -question. The answer to that question depends about how large the per...
Is there any way to reboot the JVM? As in don't actually exit, but close and reload all classes, and run main from the top?
Rebooting the JVM in the way you described—reloading all classes and starting from the `main` method again without actually exiting the JVM—is not directly supported in standard Java. The JVM is designed to run continuously until the program is terminated. However, there are some approaches you can consider, depending ...
35,243
[ { "from": "human", "value": "Is there any way to reboot the JVM? As in don't actually exit, but close and reload all classes, and run main from the top?\n" }, { "from": "gpt", "value": "Rebooting the JVM in the way you described—reloading all classes and starting from the `main` method again wi...
Is the SqlClient.SqlDataReader a .NET managed object or not? Why do we have to call the Close() method explicitly close an open connection? Shouldn't running out of scope for such an object automatically close this? Shouldn't garbage collector clean it up anyway? Please help me understand what is the best practise here...
### Understanding `SqlClient.SqlDataReader` 1. **Managed Object**: Yes, `SqlClient.SqlDataReader` is a .NET managed object. However, it is tightly coupled with the underlying database connection (an instance of `SqlConnection`), which is not a managed resource but a wrapper around a native resource (the connection to ...
34,413
[ { "from": "human", "value": "Is the SqlClient.SqlDataReader a .NET managed object or not?\nWhy do we have to call the Close() method explicitly close an open connection?\nShouldn't running out of scope for such an object automatically close this?\nShouldn't garbage collector clean it up anyway?\nPlease help...
I have a single user java program that I would like to have store data in a light weight database such as Derby or Sqlite. I would like to use a data abstraction layer in my program. Hibernate appears to require a lot of configuration and is overkill for what I need. What are light weight alternatives to Hibernate?
If you are looking for lightweight alternatives to Hibernate that can act as a data abstraction layer for a single-user Java program, here are some options you can consider: 1. **JOOQ (Java Object Oriented Querying)**: - JOOQ is a fluent API that allows you to construct SQL queries in a typesafe manner. - It's r...
34,760
[ { "from": "human", "value": "I have a single user java program that I would like to have store data in a light weight database such as Derby or Sqlite. I would like to use a data abstraction layer in my program. Hibernate appears to require a lot of configuration and is overkill for what I need. What are li...
So I know I can use #include in BIB and REG files to pull in other files like this: #include $(_PLATFORMROOT)\MYPLATFORM\FILES\MYBIB.BIB but it seems that I can’t get DAT files to behave the same way. Am I missing something here? I have a component that has a fairly large DAT file and I’d rather not have users force...
In the context of configuration and project files like BIB, REG, and DAT files, the `#include` directive works differently based on the file type and the tool or framework you are using. For BIB (Binary Information Base) and REG (Registry) files, the `#include` directive is supported and allows you to modularize your...
35,671
[ { "from": "human", "value": "So I know I can use #include in BIB and REG files to pull in other files like this:\n#include $(_PLATFORMROOT)\\MYPLATFORM\\FILES\\MYBIB.BIB\n\nbut it seems that I can’t get DAT files to behave the same way. Am I missing something here? I have a component that has a fairly lar...
I am building a simple Django app that will use scribd to display documents. I would like to have a page where the administrator can upload documents to scribd through the website, since I need to know a few things about it before it gets to scribd. What is the best/easiest way to do this, display an upload page and th...
Building a simple Django application that allows administrators to upload documents to Scribd via their API is a great way to get hands-on experience with Python, Django, and REST APIs. Below are the steps you can follow to achieve this: ### Prerequisites 1. **Django Installed**: Make sure you have Django installed i...
27,603
[ { "from": "human", "value": "I am building a simple Django app that will use scribd to display documents. I would like to have a page where the administrator can upload documents to scribd through the website, since I need to know a few things about it before it gets to scribd. What is the best/easiest way ...
I've set hibernate.generate_statistics=true and now need to register the mbeans so I can see the statistics in the jmx console. I can't seem to get anywhere and this doesn't seem like it should be such a difficult problem. Maybe I'm making things overcomplicated, but in any case so far I've tried: I copied EhCacheProv...
It sounds like you're having a bit of a challenging time integrating Hibernate's statistics with JMX and EhCache in a JBoss environment. Here are some steps and considerations that may help you resolve the issues you're facing: ### 1. Ensuring Correct Configuration First, ensure that you've correctly configured Hiber...
33,773
[ { "from": "human", "value": "I've set hibernate.generate_statistics=true and now need to register the mbeans so I can see the statistics in the jmx console. I can't seem to get anywhere and this doesn't seem like it should be such a difficult problem. Maybe I'm making things overcomplicated, but in any case...
I am writing code in VS2005 using its STL. I have one UI thread to read a vector, and a work thread to write to a vector. I use ::boost::shared_ptr as vector element. vector<shared_ptr<Class>> vec; but I find, if I manipulate the vec in both thread in the same time(I can guarantee they do not visit the same area, UI T...
Your problem seems to stem from concurrent access to the vector itself, particularly with the `std::vector` operations such as `clear()`, which can lead to undefined behavior if it's accessed simultaneously from multiple threads without proper synchronization. ### Key Points to Understand 1. **Undefined Behavior**: A...
33,494
[ { "from": "human", "value": "I am writing code in VS2005 using its STL.\nI have one UI thread to read a vector, and a work thread to write to a vector.\nI use ::boost::shared_ptr as vector element.\nvector<shared_ptr<Class>> vec;\n\nbut I find, if I manipulate the vec in both thread in the same time(I can g...
I need to implement some kind of metric space search in Postgres(*) (PL or PL/Python). So, I'm looking for good sources (or papers) with a very clear and crisp explanation of the machinery behind these ideas, in such way that I can implement it myself. I would prefer clarity over efficiency. (*) The need for that is de...
Implementing a metric space search in PostgreSQL can be a challenging but rewarding task. Here are some sources and concepts you might find helpful for a clearer understanding of the underlying mechanics, along with suggestions for implementing your search in PL/pgSQL or PL/Python. ### Key Concepts in Metric Spaces 1....
30,315
[ { "from": "human", "value": "I need to implement some kind of metric space search in Postgres(*) (PL or PL/Python). So, I'm looking for good sources (or papers) with a very clear and crisp explanation of the machinery behind these ideas, in such way that I can implement it myself.\nI would prefer clarity ov...
I'm trying to select the "used range". I get the worksheet's UsedRange, then I invoke the Select function on it. I receive HRESULT 0x800a03ec on the select call. Here's the code: COleVariant result; HRESULT hr = AutoWrap(DISPATCH_METHOD, &result, irange, L"Select", 0); I won't bother posting the code for the AutoWra...
The error code `HRESULT 0x800a03ec` that you're encountering typically indicates that there is an issue with the automation call you're making to Excel. This error can arise from various reasons, including but not limited to: 1. **Incorrect Object Reference**: Ensure that the `irange` (which represents the used range)...
33,996
[ { "from": "human", "value": "I'm trying to select the \"used range\". I get the worksheet's UsedRange, then I invoke the Select function on it. I receive HRESULT 0x800a03ec on the select call.\nHere's the code:\nCOleVariant result;\nHRESULT hr = AutoWrap(DISPATCH_METHOD, &result, irange, L\"Select\", 0); ...
I am updating my rig and I need to make a decision between staying with XP x64 or going to Vista x64. I do very little development, really just building products from my developers. The other 90% of my work is done with Google Apps, Skype, Office, etc... I want to upgrade to Vista not only because I will have 3x monito...
When considering an upgrade to Vista Ultimate x64 from XP x64, it's important to weigh the pros and cons, especially given your specific use case and the software tools you're using. ### Pros of Upgrading to Vista Ultimate x64: 1. **Support for DirectX 10**: As you mentioned, you would gain support for DirectX 10, wh...
35,298
[ { "from": "human", "value": "I am updating my rig and I need to make a decision between staying with XP x64 or going to Vista x64. I do very little development, really just building products from my developers. The other 90% of my work is done with Google Apps, Skype, Office, etc...\nI want to upgrade to Vi...
Based on all my reading there should be one GC thread to invoke all finalizers. Now, the question is what is the scope of this "one" thread - per process or per application domain, as the whole intention of domains is to separate and make "independent" different applications in one process space. I read here: If an un...
In the .NET Framework, the garbage collector (GC) and its finalizer thread operate at the **process level**, not the application domain level. This means that when multiple application domains run within the same process, they all share the same garbage collector and the same finalizer thread. ### Key Points Regarding...
30,060
[ { "from": "human", "value": "Based on all my reading there should be one GC thread to invoke all finalizers. Now, the question is what is the scope of this \"one\" thread - per process or per application domain, as the whole intention of domains is to separate and make \"independent\" different applications...
I have to read CSV files line by line which can be 10 to 20 Meg. file() is useless and I have to find the quickest way. I have tried with fgets(), which runs fine, but I don't know if it reads a small block each time I call it, or if it caches a bigger one and optimize file I/O. Do I have to try the fread() way, parsin...
When working with large CSV files, especially in the range of 10 to 20 MB, the way you read the file can significantly affect performance. Using `fgets()` is often a good choice because it reads a single line at a time, but you might have concerns about how it's implemented in terms of efficiency. Here’s a brief overv...
34,271
[ { "from": "human", "value": "I have to read CSV files line by line which can be 10 to 20 Meg. file() is useless and I have to find the quickest way.\nI have tried with fgets(), which runs fine, but I don't know if it reads a small block each time I call it, or if it caches a bigger one and optimize file I/O...
I see that in PL/SQL it is possible to set the session state of a particular variable for the remainder of the session's lifetime. For instance: ALTER SESSION SET CURRENT_SCHEMA=<schema> How do I query for the current state of this schema so I can revert back to it after performing some other statements?
In PL/SQL, you can query the current schema for the session by using the `USER` or `SYS_CONTEXT` functions. The `USER` function returns the name of the current user (which is the current schema in most cases), and `SYS_CONTEXT` can be used to fetch more detailed information. Here’s how you can retrieve the current sch...
34,651
[ { "from": "human", "value": "I see that in PL/SQL it is possible to set the session state of a particular variable for the remainder of the session's lifetime. For instance:\nALTER SESSION SET CURRENT_SCHEMA=<schema>\n\nHow do I query for the current state of this schema so I can revert back to it after pe...
I had made some questions regarding PHP-GTK (there are only 4 php-gtk tagged questions and three are mine) and I end up answering myself because no one answer them. I know it is a strange language selection but I was attracted to it because it runs on several OSs and the fact that I can reuse some of my code (also the ...
If you're looking for alternatives to PHP-GTK that are free and can run on multiple platforms, here are several options to consider: 1. **Python with Tkinter/PyQt/PySide**: - **Tkinter** is included with Python and provides a simple way to create GUIs. It's cross-platform and easy to use for smaller applications. ...
34,239
[ { "from": "human", "value": "I had made some questions regarding PHP-GTK (there are only 4 php-gtk tagged questions and three are mine) and I end up answering myself because no one answer them.\nI know it is a strange language selection but I was attracted to it because it runs on several OSs and the fact t...
Hi Guys could you please help me refactor this so that it is sensibly pythonic. import sys import poplib import string import StringIO, rfc822 import datetime import logging def _dump_pop_emails(self): self.logger.info("open pop account %s with username: %s" % (self.account[0], self.account[1])) self.popinstan...
Certainly! Your code can be refactored to be more Pythonic, making use of context managers, f-strings for string formatting, and more modern modules. Below is a refactored version of your code with these changes implemented: ```python import os import poplib import datetime import logging import re from io import Stri...
31,372
[ { "from": "human", "value": "Hi Guys could you please help me refactor this so that it is sensibly pythonic.\nimport sys\nimport poplib\nimport string\nimport StringIO, rfc822\nimport datetime\nimport logging\n\ndef _dump_pop_emails(self):\n self.logger.info(\"open pop account %s with username: %s\" % (s...
I am having an ASP.net page with userid and question and answer I need to verify the userid, answer is correct or not I no need to enablepasswordretrival and my password is hashed how to do
To verify a user's answer to a security question in an ASP.NET application without enabling password retrieval, you can follow a structured approach. Below are the steps you can take, including code examples to help you implement this functionality. ### Prerequisites 1. You have an ASP.NET application set up. 2. User...
28,787
[ { "from": "human", "value": "I am having an ASP.net page with userid and question and answer\nI need to verify the userid, answer is correct or not\nI no need to enablepasswordretrival\nand my password is hashed\nhow to do \n" }, { "from": "gpt", "value": "To verify a user's answer to a security...
Given a class: from django.db import models class Person(models.Model): name = models.CharField(max_length=20) Is it possible, and if so how, to have a QuerySet that filters based on dynamic arguments? For example: # Instead of: Person.objects.filter(name__startswith='B') # ... and: Person.objects.filter(nam...
Yes, it's absolutely possible to filter a Django QuerySet using dynamic arguments by utilizing the `**` operator to unpack a dictionary of keyword arguments. Instead of directly using a string as your filter argument, you can build a dictionary where the keys are the filter conditions. Here's how you can achieve that:...
37,227
[ { "from": "human", "value": "Given a class:\nfrom django.db import models\n\nclass Person(models.Model):\n name = models.CharField(max_length=20)\n\nIs it possible, and if so how, to have a QuerySet that filters based on dynamic arguments? For example:\n # Instead of:\n Person.objects.filter(name__start...
My only problem is making them line up three-across and have equal spacing. Apparently, spans can not have width and divs (and spans with display:block) don't appear horizontally next to each other. Suggestions? <div style='width:30%; text-align:center; float:left; clear:both;'> Is what I have now.
To achieve a layout with elements lined up three across and equal spacing using HTML and CSS, you have a few options. One common way is to use CSS Flexbox or CSS Grid, which provide more flexibility for creating responsive layouts. Below are examples of both methods. ### Method 1: Using Flexbox You can utilize CSS Fl...
31,932
[ { "from": "human", "value": "My only problem is making them line up three-across and have equal spacing. Apparently, spans can not have width and divs (and spans with display:block) don't appear horizontally next to each other. Suggestions?\n<div style='width:30%; text-align:center; float:left; clear:both;'...
I am currently refactoring an application that prints its status to the console window. At the moment I am doing something like this: Console.Write("Print some status.....") //some code Console.WriteLine("Done!") Now while this works fine, all the logic is hidden between console.writelines and I find makes it ver...
Refactoring console output for clarity and organization can make your code more readable and maintainable. Here are several strategies you can consider for printing application status more cleanly: ### 1. Use a Dedicated Method for Status Updates Create a method specifically for printing status updates. This way, you...
35,259
[ { "from": "human", "value": "I am currently refactoring an application that prints its status to the console window. At the moment I am doing something like this:\n Console.Write(\"Print some status.....\")\n //some code \n Console.WriteLine(\"Done!\")\n\nNow while this works fine, all the logic is hidden ...
Does any one know of an API that would allow me to draw something like this. It would need some interactivity to it zooming change second dimension axis angle I was looking at JFreeChart but I don't see any example of doing 2D overlap chart. Thanks
If you're looking for an API to create interactive 2D overlapping charts with features like zooming and changing the axis angle, there are several libraries you could consider. Here are a few popular options: 1. **Plotly.js**: - **Overview**: Plotly.js is a powerful JavaScript library for creating interactive char...
32,777
[ { "from": "human", "value": "Does any one know of an API that would allow me to draw something like this. It would need some interactivity to it\n\nzooming\nchange second dimension axis angle\n\nI was looking at JFreeChart but I don't see any example of doing 2D overlap chart. \nThanks\n\n" }, { "fr...
I sign up Spring courses tomorrow morning (transferring in to the Computer Science program). Since I'm a transfer student, I get the last pick of leftover classes not already taken. Emphasis on 'last pick' and 'leftover'. It's highly probable that whatever classes I intend on picking tomorrow, I might not even get beca...
Automating web interactions and logging the necessary data can be achieved through several methods, but it's important to approach this carefully, as capturing data such as keystrokes or form submissions can violate terms of service and potentially laws regarding privacy and data handling. ### Suggestions for Web Auto...
35,453
[ { "from": "human", "value": "I sign up Spring courses tomorrow morning (transferring in to the Computer Science program). Since I'm a transfer student, I get the last pick of leftover classes not already taken. Emphasis on 'last pick' and 'leftover'. It's highly probable that whatever classes I intend on pi...
This code works in a windows forms application (it shows the preview) but not in a WPF application. WMEncoder _encoder; WMEncDataView _preview; _encoder = new WMEncoder(); IWMEncSourceGroupCollection SrcGrpColl = _encoder.SourceGroupCollection; IWMEncSourceGroup2 sourceGroup = (IWMEncSourceGroup2)SrcGrpColl.Add("SG_1"...
To integrate the Windows Media Encoder with a WPF application, you need to ensure that you're correctly using the WindowsFormsHost control to display the preview. Here's how you can make the necessary adjustments to your code: 1. **Ensure you have the proper references**: Make sure that your WPF project has references...
33,490
[ { "from": "human", "value": "This code works in a windows forms application (it shows the preview) but not in a WPF application.\nWMEncoder _encoder;\nWMEncDataView _preview;\n_encoder = new WMEncoder();\n\nIWMEncSourceGroupCollection SrcGrpColl = _encoder.SourceGroupCollection;\nIWMEncSourceGroup2 sourceGr...
I need to implement the classic Factory Method pattern in ASP.NET to create server controls dynamically. The only way I've found to create .ascx controls is to use the LoadControl method of the Page/UserControl classes. I find it messy however to link my factory with a page or to pass a page parameter to the factory. D...
In ASP.NET Web Forms, creating user controls (.ascx) dynamically usually involves using the `LoadControl` method, which indeed requires a reference to a page or user control. However, you can still implement the Factory Method pattern without directly coupling your factory to the page or passing a page parameter. Here...
31,802
[ { "from": "human", "value": "I need to implement the classic Factory Method pattern in ASP.NET to create server controls dynamically.\nThe only way I've found to create .ascx controls is to use the LoadControl method of the Page/UserControl classes. I find it messy however to link my factory with a page or ...
I'm attempting to get my first ASP.NET web page working on windows using Mono and the XSP web server. I'm following this chaps example. The first part of his example works very well with the latest version of mono. however the web part seems to fall over with the following error '{Path Name}\Index.aspx.cs' is not a ...
The error message you’re seeing suggests that Mono is trying to resolve the physical path of your `Index.aspx.cs` file but is interpreting it as an invalid virtual path. This can happen if the application structure isn't set up as expected or if there are issues with how the .aspx pages and code-behind files are organi...
35,164
[ { "from": "human", "value": "I'm attempting to get my first ASP.NET web page working on windows using Mono and the XSP web server.\nI'm following this chaps example. The first part of his example works very well with the latest version of mono. however the web part seems to fall over with the following erro...
I am using VB.Net WinForms. I would like to call the Adobe Reader 9 ActiveX control to print some PDFs. I have added the ActiveX control to the VS toolbox (the dll is AcroPDF.dll, the COM name "Adobe PDF Reader". After some experiment the following code works. Dim files As String() = Directory.GetFiles(TextBoxPath.T...
Using the Adobe PDF Reader ActiveX control for printing can indeed be a bit tricky, especially because its methods may not be synchronous, which leads to issues when disposing of the control right after calling the printing methods. Since `printAll()` does not provide a callback or a blocking mechanism, managing the li...
32,330
[ { "from": "human", "value": "I am using VB.Net WinForms. I would like to call the Adobe Reader 9 ActiveX control to print some PDFs. I have added the ActiveX control to the VS toolbox (the dll is AcroPDF.dll, the COM name \"Adobe PDF Reader\". After some experiment the following code works.\nDim files As...
I know of is and as for instanceof, but what about the reflective isInstance() method?
In Java, the `isInstance()` method is part of the `java.lang.Class` class and provides a way to check if a given object is an instance of the class represented by the `Class` object. This method is a part of Java's reflection capabilities. ### Usage of `isInstance()` The `isInstance(Object obj)` method returns `true`...
35,895
[ { "from": "human", "value": "I know of is and as for instanceof, but what about the reflective isInstance() method?\n" }, { "from": "gpt", "value": "In Java, the `isInstance()` method is part of the `java.lang.Class` class and provides a way to check if a given object is an instance of the class...
Unit testing sounds great to me, but I'm not sure I should spend any time really learning it unless I can convince others that is has significant value. I have to convince the other programmers and, more importantly, the bean-counters in management, that all the extra time spent learning the testing framework, writing...
Convincing others, particularly management and non-technical stakeholders, of the value of unit testing requires a strategic approach. Here are some points, studies, and examples that can help build a case: ### 1. **Improved Code Quality** Unit testing leads to higher code quality by identifying bugs early in the dev...
33,126
[ { "from": "human", "value": "Unit testing sounds great to me, but I'm not sure I should spend any time really learning it unless I can convince others that is has significant value. I have to convince the other programmers and, more importantly, the bean-counters in management, that all the extra time spen...
I have a DataSet with a DataTable that correctly fills a single DataRow through a TableAdapter. I am able to pull data from the DataRow with code like this: dataFileID = (int)this.dataFileDataRow["DataFileID"]; dataFileName = (string)this.dataFileDataRow["DataFileName"]; dataFileDate = (DateTime)this.dataFileDataRow["D...
It sounds like you're on the right track with accessing the `varbinary(max)` data from your `DataRow`. Given that you've confirmed the data exists in the `ItemArray`, but you're having issues accessing it with the direct cast to `byte[]`, let's go over a few potential troubleshooting steps and considerations: 1. **Che...
33,864
[ { "from": "human", "value": "I have a DataSet with a DataTable that correctly fills a single DataRow through a TableAdapter.\nI am able to pull data from the DataRow with code like this:\ndataFileID = (int)this.dataFileDataRow[\"DataFileID\"];\ndataFileName = (string)this.dataFileDataRow[\"DataFileName\"];\...
Which one do you prefer to store text in your database? The original casing of the data, or some kind of normalization. Also, should I enforce this with triggers? or should I preprocess input data with client code? I ask you, because I'm not sure about if there is any difference, besides additional processing time to d...
Choosing whether to store text in its original casing or to normalize it (e.g., converting all text to lowercase or uppercase) depends on the specific requirements and use cases of your application. Here are some considerations to help you make an informed decision: ### Storing Original Casing vs. Normalized Casing 1...
35,373
[ { "from": "human", "value": "Which one do you prefer to store text in your database? The original casing of the data, or some kind of normalization. Also, should I enforce this with triggers? or should I preprocess input data with client code?\nI ask you, because I'm not sure about if there is any differenc...
In IIS I can configure my custom error pages. For each HTTP Error code I can say where to go. Several codes have a number of "sub" codes available. For example 404 has a regular 404, 404;1, 404;2 and so on.. What are they for? When are they returned? Should I make custom pages for these errors? Can I somehow easely con...
In Internet Information Services (IIS), custom error pages can be configured to provide a better user experience when errors occur. The sub-status codes you're referring to (like 404;1, 404;2, etc.) provide more detailed information about the nature of the HTTP error that occurred. ### What are Sub-Status Codes? - *...
33,699
[ { "from": "human", "value": "In IIS I can configure my custom error pages.\nFor each HTTP Error code I can say where to go. Several codes have a number of \"sub\" codes available. For example 404 has a regular 404, 404;1, 404;2 and so on..\nWhat are they for? When are they returned? Should I make custom pag...
I have googled quite a bit and I cannot find the answer. So how many characters can be stored in a Windows Installer property value. If you give an answer can you provide the source of the answer?
The maximum length for a Windows Installer (MSI) property value is 255 characters. This limit applies to standard property values, including those set by the user or through the installer process. The official Microsoft documentation states that property values are limited to 255 characters. For more detailed informat...
37,640
[ { "from": "human", "value": "I have googled quite a bit and I cannot find the answer. So how many characters can be stored in a Windows Installer property value. If you give an answer can you provide the source of the answer?\n" }, { "from": "gpt", "value": "The maximum length for a Windows Inst...
I have a database table on a development server that is now fully populated after I set it running with an import routine for a CSV file containing 1.4 million rows. I ran the Database Publishing Wizard on the table, and now I have a 286MB SQL script on my local machine. The problem is, I can't figure out how to run i...
Running large SQL scripts can sometimes cause issues due to various constraints, such as memory limits or the size of the script itself. Here are several strategies you can try to execute your 286MB SQL script in SQL Server Management Studio (SSMS): ### 1. **Use Command-Line Tools:** You can use `sqlcmd`, which is a c...
34,247
[ { "from": "human", "value": "I have a database table on a development server that is now fully populated after I set it running with an import routine for a CSV file containing 1.4 million rows.\nI ran the Database Publishing Wizard on the table, and now I have a 286MB SQL script on my local machine. The p...
I just read a post mentioning "full text search" in SQL. I was just wondering what the difference between FTS and LIKE are. I did read a couple of articles but couldn't find anything that explained it well.
Full Text Search (FTS) and the `LIKE` operator are both used to search for text within a database, but they operate in quite different ways and are suited for different use cases. Here’s a breakdown of the key differences: ### 1. **Functionality**: - **LIKE**: - The `LIKE` operator is used to search for a specified ...
32,059
[ { "from": "human", "value": "I just read a post mentioning \"full text search\" in SQL. \nI was just wondering what the difference between FTS and LIKE are. I did read a couple of articles but couldn't find anything that explained it well.\n" }, { "from": "gpt", "value": "Full Text Search (FTS...
Coming from a Ruby background, I'm used to writing all my code using classes with methods and such. I do know javascript quite well, but I'm new to jQuery and its best practices. Obviously there are a million ways to simulate classes in javascript. But, what is the actual jQuery community REALLY using in the real world...
In the jQuery community, while you can definitely use class-based structures to organize your code, you will often find that many developers favor a more functional approach, especially since jQuery is a library that enhances the capabilities of vanilla JavaScript. However, there are still practices in the community th...
32,226
[ { "from": "human", "value": "Coming from a Ruby background, I'm used to writing all my code using classes with methods and such. I do know javascript quite well, but I'm new to jQuery and its best practices.\nObviously there are a million ways to simulate classes in javascript. But, what is the actual jQuer...
I need a method to return a random string in the format: Letter Number Letter Number Letter Number
You can create a random string in the specified format ("Letter Number Letter Number Letter Number") using various programming languages. Below is an example using Python: ```python import random import string def generate_random_string(): # Generate a random string in the format: Letter Number Letter Number Lett...
35,743
[ { "from": "human", "value": "I need a method to return a random string in the format:\nLetter Number Letter Number Letter Number\n" }, { "from": "gpt", "value": "You can create a random string in the specified format (\"Letter Number Letter Number Letter Number\") using various programming lang...
I am having trouble understanding how the System Registry can help me convert a DateTime object into the a corresponding TimeZone. I have an example that I've been trying to reverse engineer but I just can't follow the one critical step in which the UTCtime is offset depending on Daylight Savings Time. I am using .NET...
To convert a `DateTime` object to a corresponding `TimeZone` in .NET, including consideration for Daylight Saving Time (DST), you can use the `TimeZoneInfo` class available in .NET Framework 3.5. Here's a step-by-step breakdown of how to do this: 1. **Get the DateTime Object**: Start with your `DateTime` object that...
33,902
[ { "from": "human", "value": "I am having trouble understanding how the System Registry can help me convert a DateTime object into the a corresponding TimeZone. I have an example that I've been trying to reverse engineer but I just can't follow the one critical step in which the UTCtime is offset depending ...
Anybody know of a plugin, or a built in function to make the columns in a table sortable? i.e. I click on the column header and it sorts the rows by that column?
Yes, there are several options for making table columns sortable, depending on the platform or technology you're using. Here are a few common solutions: ### 1. **JavaScript Libraries** - **DataTables**: This is a jQuery plugin that provides advanced interaction controls for HTML tables. It allows sorting, searching, p...
31,713
[ { "from": "human", "value": "Anybody know of a plugin, or a built in function to make the columns in a table sortable? i.e. I click on the column header and it sorts the rows by that column?\n" }, { "from": "gpt", "value": "Yes, there are several options for making table columns sortable, depen...
I'm looking for a way to create websites with the cool stylings of Windows Vista, like what is shown in this screenshot (taken from one of Microsoft's websites): Any suggestions? I'd prefer an integrated designer / IDE, but libraries or templates might also help.
Creating websites with the stylings reminiscent of Windows Vista can be an interesting project, especially since Vista had a distinctive design aesthetic characterized by its glassy interfaces, gradients, and soft shadows. While there might not be a dedicated IDE or tool specifically for Windows Vista styling, here are...
27,218
[ { "from": "human", "value": "I'm looking for a way to create websites with the cool stylings of Windows Vista, like what is shown in this screenshot (taken from one of Microsoft's websites):\n\nAny suggestions? I'd prefer an integrated designer / IDE, but libraries or templates might also help.\n" }, { ...
I'm working on a website that uses lots of png24 files, for transparency. I need to replace them with png8 files, as all the png fix style javascript workarounds for png24 cause IE6 to lock up randomly. See this link to get an idea of the symptoms IE6 displays - http://blogs.cozi.com/tech/2008/03/transparent-pngs-can-...
To replace PNG24 files with PNG8 files, you'll first need to identify which of your images are in PNG24 format. Unfortunately, there isn't a straightforward way to determine the color depth of a PNG file using Finder or basic file browsers. However, you can use command line tools and scripts to help you identify and co...
34,631
[ { "from": "human", "value": "I'm working on a website that uses lots of png24 files, for transparency.\nI need to replace them with png8 files, as all the png fix style javascript workarounds for png24 cause IE6 to lock up randomly. \nSee this link to get an idea of the symptoms IE6 displays - http://blogs....
How can I create an instance of the following annotation (with all fields set to their default value). @Retention( RetentionPolicy.RUNTIME ) public @interface Settings { String a() default "AAA"; String b() default "BBB"; String c() default "CCC"; } I tried new Settings(...
In Java, annotations are not instantiated using the `new` keyword like regular classes. Instead, you can create instances of annotations using a special syntax that utilizes the annotation’s default values. For the `Settings` annotation you provided, you can create an instance of it by utilizing the `@Settings` syntax...
34,230
[ { "from": "human", "value": "How can I create an instance of the following annotation (with all fields set to their default value).\n @Retention( RetentionPolicy.RUNTIME )\n public @interface Settings {\n String a() default \"AAA\";\n String b() default \"BBB\";\n Stri...
I'm writing a website in JSP using Struts and Hibernate. I'm looking for a way to implement a rich UI where you can have more than just buttons. For examples, drag and drops, drop down lists that updates itself in real time as you type more letters out etc. Is there a way to use something like Swing with Struts and Hib...
Creating a rich UI in a web application that uses JSP, Struts, and Hibernate can be challenging, especially if your organization has strict rules about the libraries and frameworks you can use. Swing, however, is not a viable option for web applications, as it is a Java GUI toolkit primarily for desktop applications. ...
35,636
[ { "from": "human", "value": "I'm writing a website in JSP using Struts and Hibernate. I'm looking for a way to implement a rich UI where you can have more than just buttons. For examples, drag and drops, drop down lists that updates itself in real time as you type more letters out etc. Is there a way to use...
I am trying to create wrapper functions for free and malloc in C to help notify me of memory leaks. Does anyone know how to declare these functions so when I call malloc() and free() it will call my custom functions and not the standards lib functions?
To create wrapper functions for `malloc` and `free` in C, you can define your own functions and then use preprocessor directives to replace calls to `malloc` and `free` with calls to your custom functions. Here's how you can do it: 1. **Define the Wrapper Functions**: You create functions such as `my_malloc` and `my_...
31,635
[ { "from": "human", "value": "I am trying to create wrapper functions for free and malloc in C to help notify me of memory leaks. Does anyone know how to declare these functions so when I call malloc() and free() it will call my custom functions and not the standards lib functions?\n" }, { "from": "g...