instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I am working on a project that resizes images using PHP's GD library. I would like to be able to add the option to use seam carving to resize images but don't want to require something like ImageMagick (which can do seam carving with its liquid rescale feature) to accomplish this. Since there are no built-in seam carvi...
Seam carving is an advanced image resizing technique that allows for content-aware scaling by removing seams of pixels, either horizontally or vertically. Unfortunately, the GD library does not support seam carving out of the box, and there are no built-in functions in PHP to perform this operation. While GD is a pow...
17,236
[ { "from": "human", "value": "I am working on a project that resizes images using PHP's GD library. I would like to be able to add the option to use seam carving to resize images but don't want to require something like ImageMagick (which can do seam carving with its liquid rescale feature) to accomplish thi...
I am wondering how to naturally sort a DataView... I really need help on this. I found articles out there that can do lists with IComparable, but I need to sort the numbers in my dataview. They are currently alpha sorted because they are numbers with 'commas' in them. Please help me out. I would like to find somethi...
To perform a natural sort on a `DataView` that contains numerical values represented as strings with commas, you need to convert those strings into actual numbers for sorting. Unfortunately, the built-in sorting methods like `Sort` on `DataView` will indeed sort the data alphabetically, as you've noticed. To achieve a...
12,478
[ { "from": "human", "value": "I am wondering how to naturally sort a DataView... I really need help on this. I found articles out there that can do lists with IComparable, but I need to sort the numbers in my dataview.\nThey are currently alpha sorted because they are numbers with 'commas' in them. Please...
I have a strange bug with WPF Interop and an Excel Addin. I'm using .Net 3.5 SP1. I'm using Add-in Express to create a Custom Task Pane for Excel 2003. Within that taskpane I'm using ElementHost to host a WPF UserControl. The UserControl simply contains a Grid with a TextBox and ComboBox. My problem is that whilst ever...
The issues you're encountering with the WPF ComboBox in a Custom Task Pane within Excel are indeed known challenges that arise from the integration of WPF and WinForms, especially in the context of a host application like Excel that is not a WPF application. Here are some steps you can take to troubleshoot and potentia...
16,227
[ { "from": "human", "value": "I have a strange bug with WPF Interop and an Excel Addin. I'm using .Net 3.5 SP1.\nI'm using Add-in Express to create a Custom Task Pane for Excel 2003. Within that taskpane I'm using ElementHost to host a WPF UserControl. The UserControl simply contains a Grid with a TextBox an...
Let's say: <div> pre text <div class="remove-just-this"> <p>child foo</p> <p>child bar</p> nested text </div> post text </div> to this: <div> pre text <p>child foo</p> <p>child bar</p> nested text post text </div> I've been figuring out using Mootools, jQuery and even (raw) JavaScript, b...
To achieve the desired outcome of moving the contents of a specific `<div>` (with the class `remove-just-this`) outside of it while removing the `<div>` itself, you can use either jQuery or plain JavaScript. ### Using jQuery If you're using jQuery, you can do it like this: ```javascript $(document).ready(function() ...
18,659
[ { "from": "human", "value": "Let's say:\n<div>\n pre text\n <div class=\"remove-just-this\">\n <p>child foo</p>\n <p>child bar</p>\n nested text\n </div>\n post text\n</div>\n\nto this:\n<div>\n pre text\n <p>child foo</p>\n <p>child bar</p>\n nested text\n post text\n</div>\n\nI've been f...
Does anyone have any advice for a consistent way to unit test a multithreaded application? I have done one application where our mock "worker threads" had a thread.sleep with a time that was specified by a public member variable. We would use this so we could set how long a particular thread would take to complete it...
Unit testing multithreaded applications can be challenging due to the non-deterministic nature of thread scheduling and execution. However, there are several strategies and tools that can help you test multithreaded code more effectively. Here are some tips and techniques: ### 1. **Use Synchronization Primitives** Ins...
13,775
[ { "from": "human", "value": "Does anyone have any advice for a consistent way to unit test a multithreaded application? I have done one application where our mock \"worker threads\" had a thread.sleep with a time that was specified by a public member variable. We would use this so we could set how long a ...
I have been coding exclusively for a while now on Linux with C++. In my current job, it's a Windows shop with C# as main language. I've retrained myself to use Visual Studio instead of emacs ( main reason is the integrated debugger in VC, emacs mode in VC helps ), setup Cygwin ( since I cannot live without a shell ) an...
Transitioning from C++ on Linux to C# on Windows is a significant shift, but there are plenty of resources and tools that can help you become more efficient in your new environment. Here are some suggestions for tools, books, websites, and common pitfalls to avoid: ### Tools 1. **Visual Studio Extensions**: - **Re...
16,425
[ { "from": "human", "value": "I have been coding exclusively for a while now on Linux with C++. In my current job, it's a Windows shop with C# as main language. I've retrained myself to use Visual Studio instead of emacs ( main reason is the integrated debugger in VC, emacs mode in VC helps ), setup Cygwin (...
Those of us who use multiple languages to solve problems can combine them in a lot of ways. Personally I use PL/SQL, XSLT, JavaScript, and Java plus the pseudo languages HTML, XML, CSS, Ant, and Bash. What do you use?
As an AI language model, I don't "use" programming languages in the same way that humans do. However, I can generate, analyze, and assist with code in many languages. Some of the most commonly used programming and markup languages that I can help with include: 1. **Python** - Popular for data analysis, machine learnin...
17,305
[ { "from": "human", "value": "Those of us who use multiple languages to solve problems can combine them in a lot of ways. Personally I use PL/SQL, XSLT, JavaScript, and Java plus the pseudo languages HTML, XML, CSS, Ant, and Bash. What do you use? \n" }, { "from": "gpt", "value": "As an AI lang...
has anyone been able to serve a word doc using metro (webservices) as a mtom stream? Does anyone have example, or know where there is example code please for client and server?
To serve a Word document using MTOM (Message Transmission Optimization Mechanism) in a WCF (Windows Communication Foundation) service, you can follow these steps to create a simple example with both client and server code. ### Server Side 1. **Create a WCF Service:** You need to create a WCF service that can send a ...
12,556
[ { "from": "human", "value": "has anyone been able to serve a word doc using metro (webservices) as a mtom stream? Does anyone have example, or know where there is example code please for client and server?\n" }, { "from": "gpt", "value": "To serve a Word document using MTOM (Message Transmission...
Part of the setup routine for the product I'm working on installs a database update utility. The utility checks the current version of the users database and (if necessary) executes a series of SQL statements that upgrade the database to the current version. Two key features of this routine: Once initiated, it runs wi...
You've encountered a common dilemma in software development, especially when dealing with database migrations and ensuring data integrity for non-technical users. Here are some approaches you can consider to strike a balance between automation and user-friendly design: 1. **Data Assessment and Reporting:** - Before...
17,215
[ { "from": "human", "value": "Part of the setup routine for the product I'm working on installs a database update utility. The utility checks the current version of the users database and (if necessary) executes a series of SQL statements that upgrade the database to the current version.\nTwo key features of...
When you use composition, then you can mock the other objects from which your class-under-test depends, but when you use inheritance, you can't mock the base class. (Or can you?) I generally try to prefer composition over inheritance, but sometimes inheritance really seems like the best tool for the job - well, at leas...
Testing inheritance in object-oriented programming can sometimes be challenging, especially if you are trying to apply strict isolation in unit testing. However, it's entirely possible to test inherited classes effectively while using PHPUnit in PHP or other testing frameworks in different languages. Here are several s...
9,888
[ { "from": "human", "value": "When you use composition, then you can mock the other objects\nfrom which your class-under-test depends, but when you use\ninheritance, you can't mock the base class. (Or can you?)\nI generally try to prefer composition over inheritance,\nbut sometimes inheritance really seems l...
Assuming the you are implementing a user story that requires changes in all layers from UI (or service facade) to DB. In what direction do you move? From UI to Business Layer to Repository to DB? From DB to Repository to Business Layer to UI? It depends. (On what ?)
The direction you choose for implementing a user story that requires changes across all layers—from the UI to the database—depends on several factors, including the complexity of the changes, the nature of the user story, and the development methodology you are using. Here are the considerations for each direction: ##...
15,100
[ { "from": "human", "value": "Assuming the you are implementing a user story that requires changes in all layers from UI (or service facade) to DB. \nIn what direction do you move?\n\nFrom UI to Business Layer to Repository to DB?\nFrom DB to Repository to Business Layer to UI?\nIt depends. (On what ?)\n\n" ...
I am working on a Rails application that needs to handle dates and times in users' time zones. We have recently migrated it to Rails 2.1 and added time zone support, but there are numerous situations in which we use Time#utc and then compare against that time. Wouldn't that be the same as comparing against the original...
In Rails 2.1, the introduction of Active Support's time zone support enhances how you handle dates and times in your application. However, when dealing with `Time` objects and the `utc` method, it’s essential to understand how they interact with time zones to avoid pitfalls in your comparisons and calculations. ### Wh...
15,400
[ { "from": "human", "value": "I am working on a Rails application that needs to handle dates and times in users' time zones. We have recently migrated it to Rails 2.1 and added time zone support, but there are numerous situations in which we use Time#utc and then compare against that time. Wouldn't that be t...
I doubt it can be done portably, but are there any solutions out there? I think it could be done by creating an alternate stack and reseting SP,BP, and IP on function entry, and having yield save IP and restore SP+BP. Destructors and exception safety seem tricky but solvable. Has it been done? Is it impossible?
What you're describing sounds like a form of coroutines or cooperative multitasking in a programming context. The idea of using an alternate stack and managing the stack pointer (SP), base pointer (BP), and instruction pointer (IP) manually for yielding execution and resuming it is indeed a low-level way of implementin...
12,082
[ { "from": "human", "value": "I doubt it can be done portably, but are there any solutions out there? I think it could be done by creating an alternate stack and reseting SP,BP, and IP on function entry, and having yield save IP and restore SP+BP. Destructors and exception safety seem tricky but solvable.\...
I'm getting confused with the include/exclude jargon, and my actual SVN client doesn't seem to have (or I've been unable to find it easily) a simple option to add or remove a certain type of files for version control. Let's say for example I've added the entire Visual Studio folder, with its solutions, projects, debug ...
To manage which files are included or excluded from version control in Subversion (SVN), you will typically use the `svn:ignore` property. This property allows you to specify patterns for files and directories that you don't want to include in version control. Here's how you can set up your SVN ignore patterns to exc...
17,067
[ { "from": "human", "value": "I'm getting confused with the include/exclude jargon, and my actual SVN client doesn't seem to have (or I've been unable to find it easily) a simple option to add or remove a certain type of files for version control.\nLet's say for example I've added the entire Visual Studio fo...
Is a new (or different) instance of TestCase object is used to run each test method in a JUnit test case? Or one instance is reused for all the tests? public class MyTest extends TestCase { public void testSomething() { ... } public void testSomethingElse() { ... } } While running this test, how many instances of...
In JUnit, for each test method in a test class, a new instance of the test class is created. This means that when you run multiple test methods in a single test case, each test method is executed in a separate instance of the test case class. So, in your example with the class `MyTest`, if you have two test methods (...
18,608
[ { "from": "human", "value": "Is a new (or different) instance of TestCase object is used to run each test method in a JUnit test case? Or one instance is reused for all the tests?\npublic class MyTest extends TestCase {\n public void testSomething() { ... }\n public void testSomethingElse() { ... }\n}\n\...
I have a ASP.NET application running on a remote web server and I just started getting this error. I can't seem to reproduce it in my development environment: Method not found: 'Void System.Collections.Generic.ICollection`1..ctor()'. Could this be due to some misconfiguration of .NET Framework or IIS 6? Update: I dis...
The error you're encountering, "Method not found: 'Void System.Collections.Generic.ICollection`1..ctor()'", along with the behavior you've described, suggests that there may be a mismatch between the runtime environment and the code you're executing. This is particularly plausible given that you're running the applicat...
11,570
[ { "from": "human", "value": "I have a ASP.NET application running on a remote web server and I just started getting this error. I can't seem to reproduce it in my development environment:\nMethod not found: 'Void System.Collections.Generic.ICollection`1..ctor()'.\n\nCould this be due to some misconfigurati...
I'm the only developer supporting a website that's a mix of classic asp and .NET. I had to add some .net pages to a classic asp application. This application requires users to login. The login page, written in classic asp, creates a cookie that .net pages use to identify the logged in user and stores information in ses...
It sounds like you're experiencing an intermittent issue with cookie handling between your classic ASP and .NET components, particularly in IE7. This can be challenging to diagnose due to the nature of how cookies can be managed differently across browsers and settings. Here are some potential causes and troubleshootin...
16,306
[ { "from": "human", "value": "I'm the only developer supporting a website that's a mix of classic asp and .NET. I had to add some .net pages to a classic asp application. This application requires users to login. The login page, written in classic asp, creates a cookie that .net pages use to identify the log...
I have a form with many input fields. When I catch the submit form event with jQuery, is it possible to get all the input fields of that form in an associative array?
Yes, it is indeed possible to collect all the input fields of a form in an associative array using jQuery when you catch the submit event. You can achieve this by serializing the form data into an object. Here's an example of how to do this: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> ...
16,996
[ { "from": "human", "value": "I have a form with many input fields.\nWhen I catch the submit form event with jQuery, is it possible to get all the input fields of that form in an associative array?\n" }, { "from": "gpt", "value": "Yes, it is indeed possible to collect all the input fields of a fo...
I'm using Test/Unit with a standard rails 2.1 project. I would like to be able to test Partial Views in isolation from any particular controller / action. It seemed as though ZenTest's Test::Rails::ViewTestCase would help, but I couldn't get it working, similarly with view_test http://www.continuousthinking.com/tags/vi...
Testing partial views in isolation can be a bit challenging with Rails 2.1, but you can definitely do it without relying on external libraries. Here’s a simple approach you can follow using the built-in testing framework. ### Step 1: Set Up the Test Case You can create a test case for your partial views directly in ...
16,078
[ { "from": "human", "value": "I'm using Test/Unit with a standard rails 2.1 project. I would like to be able to test Partial Views in isolation from any particular controller / action.\nIt seemed as though ZenTest's Test::Rails::ViewTestCase would help, but I couldn't get it working, similarly with view_test...
Given some JS code like that one here: for (var i = 0; i < document.getElementsByName('scale_select').length; i++) { document.getElementsByName('scale_select')[i].onclick = vSetScale; } Would the code be faster if we put the result of getElementsByName into a variable before the loop and then use the variable ...
Yes, storing the result of `document.getElementsByName('scale_select')` in a variable before the loop can improve the performance of your code, even if the effect might be minimal with a small number of items. Here's why: ### Explanation of the Mechanics 1. **DOM Queries**: - `document.getElementsByName('scale_se...
13,216
[ { "from": "human", "value": "Given some JS code like that one here:\n for (var i = 0; i < document.getElementsByName('scale_select').length; i++) {\n document.getElementsByName('scale_select')[i].onclick = vSetScale;\n }\n\nWould the code be faster if we put the result of getElementsByName into a varia...
In my project I need to connect to an intra-net web service but we need SSL connection between the two machines. Because this is an intra-net site the certificate of the web service might be a self-signed certificate. The web service and the web page that loads my Flex application resides on the same web server (tomcat...
Connecting to a web service over HTTPS using a self-signed certificate can be a challenge with Adobe Flex, as Flash Player has its own security model that is somewhat separate from the web browser. Flash Player generally does not trust self-signed certificates by default, which can lead to connection issues when trying...
18,524
[ { "from": "human", "value": "In my project I need to connect to an intra-net web service but we need SSL connection between the two machines.\nBecause this is an intra-net site the certificate of the web service might be a self-signed certificate.\nThe web service and the web page that loads my Flex applica...
I'm currently evaluating CodeRush and one thing that I liked most when reading the featurelist was the "Export type to new file" or similar functionality. Now that CodeRush runs within my IDE, I cannot find this functionality. Is there a plug-in required for it or am I just missing something?
The "Export type to new file" feature in CodeRush is typically part of its code refactoring capabilities, allowing you to extract a class or a struct into its own file. If you cannot find this functionality, here are some steps to help you troubleshoot: 1. **Check Version**: Ensure you are using a version of CodeRush ...
20,145
[ { "from": "human", "value": "I'm currently evaluating CodeRush and one thing that I liked most when reading the featurelist was the \"Export type to new file\" or similar functionality. Now that CodeRush runs within my IDE, I cannot find this functionality. Is there a plug-in required for it or am I just mi...
i am working on a Sharepoint Server 2007 Statemachine Workflow. Until now i have a few states and an custom Association/InitiationForm which i created with InfoPath 2007. At the moment i have a Problem with Modification forms. The modification link in the state page of my workflow is shown and leads on click to my Info...
To use multiple modification forms in a SharePoint Server 2007 State Machine Workflow, you'll need to follow some specific steps to ensure that both forms are properly configured and recognized by the workflow. Here’s a step-by-step approach to troubleshoot and set up the second modification form: ### Step-by-Step Gui...
11,001
[ { "from": "human", "value": "i am working on a Sharepoint Server 2007 Statemachine Workflow. Until now i have a few states and an custom Association/InitiationForm which i created with InfoPath 2007.\nAt the moment i have a Problem with Modification forms. The modification link in the state page of my workf...
I've got a C# class with a Dispose function via IDisposable. It's intended to be used inside a using block so the expensive resource it handles can be released right away. The problem is that a bug occurred when an exception was thrown before Dispose was called, and the programmer neglected to use using or finally. In ...
In C#, you have to manage resource disposal explicitly, which can sometimes lead to issues if you forget to use `using` or handle exceptions properly. Unlike C++, C#'s garbage collection does not guarantee that resources will be released as soon as an object goes out of scope. However, there are ways to encourage the u...
14,598
[ { "from": "human", "value": "I've got a C# class with a Dispose function via IDisposable. It's intended to be used inside a using block so the expensive resource it handles can be released right away.\nThe problem is that a bug occurred when an exception was thrown before Dispose was called, and the program...
I have a webpage that pulls information from a database, converts it to .csv format, and writes the file to the HTTPResponse. string csv = GetCSV(); Response.Clear(); Response.ContentType = "text/csv"; Response.Write(csv); This works fine, and the file is sent to the client with no problems. However, when the file ...
To specify a custom filename when sending a CSV file as a response, you can use the `Content-Disposition` header. This header allows you to suggest a filename to the browser when the file is downloaded. Here’s how you can modify your code: ```csharp string csv = GetCSV(); Response.Clear(); Response.ContentType = "text...
19,111
[ { "from": "human", "value": "I have a webpage that pulls information from a database, converts it to .csv format, and writes the file to the HTTPResponse. \nstring csv = GetCSV();\nResponse.Clear();\nResponse.ContentType = \"text/csv\";\nResponse.Write(csv);\n\nThis works fine, and the file is sent to the ...
I have an application A with a domain-model which is mapped to a database using Hibernate. I have another application B that uses exactly the same domain-model-classes as A and adds some additional classes. My goal is to read data from database A in application B and transfer that data into the database of B (to make ...
Your scenario presents an interesting challenge in terms of transferring data between two applications while maintaining a clean architecture and loose coupling. Here are two possible strategies to accomplish your goal: ### 1. Use Two Session Factories with `Session.replicate()` Using two separate session factories f...
14,041
[ { "from": "human", "value": "I have an application A with a domain-model which is mapped to a database using Hibernate. I have another application B that uses exactly the same domain-model-classes as A and adds some additional classes. \nMy goal is to read data from database A in application B and transfer ...
Hopefully, I can explain this issue properly. I have 3 classes that deals with my entities. @MappedSuperclass public abstract class Swab implements ISwab { ... private Collection<SwabAccounts> accounts; ... } @Entity @Table(name="switches") @DiscriminatorColumn(name="type") @DiscriminatorValue(value="DMS500") pub...
The error message you are encountering indicates that the `DmsSwab` class is not being recognized as an entity. Since the `DmsSwab` class is annotated with `@Entity`, we can troubleshoot the issue by examining a few potential causes: 1. **Check package visibility**: Ensure that the `DmsSwab` class is in a package that...
18,192
[ { "from": "human", "value": "Hopefully, I can explain this issue properly. I have 3 classes that deals with my entities.\n@MappedSuperclass\npublic abstract class Swab implements ISwab {\n...\n private Collection<SwabAccounts> accounts;\n...\n}\n\n@Entity\n@Table(name=\"switches\")\n@DiscriminatorColumn...
I know this sounds like a really obvious question, but it's proving harder to figure out than I thought. I'm developing in Flash 8/ActionScript 2.0. I have a label component, and I'm dynamically assigning it text from an xml document. For example: label.text = "<b>" + xml_node.firstChild + "</b>"; This successfully ch...
In ActionScript 2.0 with Flash 8, when you're using a Label component and you want to change the font size, you have to use the properties of the component rather than relying on HTML tags. The HTML tags can be used to format text like bold or italics, but they don’t control the font size. To change the font size of t...
19,435
[ { "from": "human", "value": "I know this sounds like a really obvious question, but it's proving harder to figure out than I thought. I'm developing in Flash 8/ActionScript 2.0.\nI have a label component, and I'm dynamically assigning it text from an xml document. For example:\nlabel.text = \"<b>\" + xml_no...
We have a customer requesting data in XML format. Normally this is not required as we usually just hand off an Access database or csv files and that is sufficient. However in this case I need to automate the exporting of proper XML from a dozen tables. If I can do it out of SQL Server 2005, that would be preferred. How...
To export your SQL Server 2005 data to XML format that represents the structure of the tables, you'll want to create an XML schema that reflects your data's relationships and structure. While SQL Server has built-in functionality to produce XML output, it may not always be structured exactly the way you want. Here are...
14,250
[ { "from": "human", "value": "We have a customer requesting data in XML format. Normally this is not required as we usually just hand off an Access database or csv files and that is sufficient. However in this case I need to automate the exporting of proper XML from a dozen tables.\nIf I can do it out of SQL...
I would like to keep the overhead at a minimum. Right now I have: // Launch a Message Box with advice to the user DialogResult result = MessageBox::Show("This may take awhile, do you wish to continue?", "Warning", MessageBoxButtons::YesNo, MessageBoxIcon::Exclamation); // The test will only be launched if the user has...
To customize the button text in a `MessageBox`, you can't directly replace the text of the existing buttons (`Yes`, `No`, etc.) in the standard `MessageBox` class provided by Windows Forms. However, you can create your own custom dialog using a `Form` that will allow you to use your preferred button text. Here's a simp...
14,355
[ { "from": "human", "value": "I would like to keep the overhead at a minimum. Right now I have:\n// Launch a Message Box with advice to the user\nDialogResult result = MessageBox::Show(\"This may take awhile, do you wish to continue?\", \"Warning\", MessageBoxButtons::YesNo, MessageBoxIcon::Exclamation);\n\n...
I have got a python script which is creating an ODBC connection. The ODBC connection is generated with a connection string. In this connection string I have to include the username and password for this connection. Is there an easy way to obscure this password in the file (just that nobody can read the password when ...
Yes, there are several strategies you can use to obscure or secure sensitive information, like passwords, in your Python script. Here are a few options: ### 1. Environment Variables Store the username and password as environment variables. You can then retrieve them in your script using the `os` module. #### Example:...
13,610
[ { "from": "human", "value": "I have got a python script which is creating an ODBC connection. The ODBC connection is generated with a connection string. In this connection string I have to include the username and password for this connection. \nIs there an easy way to obscure this password in the file (ju...
Expanding on Free install wizard software I am looking for a cross platform installer. We support something like 27 platform variations and most of the installers mentioned in the other question are windows only. We are looking for something portable, possibly java based but I suppose any scripting language would als...
For your requirements of a cross-platform installer that can support a wide variety of operating systems, including various Linux distributions, Solaris, Windows, and UNIX variants like HP-UX, AIX, and zLinux, you might want to consider a few options. Here are some suggestions that fit the criteria of being portable an...
10,900
[ { "from": "human", "value": "Expanding on Free install wizard software I am looking for a cross platform installer. We support something like 27 platform variations and most of the installers mentioned in the other question are windows only. We are looking for something portable, possibly java based but I...
JPEG, GIF and PNG can be displayed with the img tag and will work in all browsers, the object element can be use for displaying images specifying its MIME type, but what other graphic formats are supported by img or object tag in most browsers without installing plugins? (TIF, SVG, PCX, PICT, etc..)
In addition to JPEG, GIF, and PNG, the following graphic formats are generally supported by the `<img>` tag in most modern browsers without the need for additional plugins: 1. **SVG (Scalable Vector Graphics)**: This is a vector image format that is widely supported in all modern browsers. It allows for scalability wi...
19,421
[ { "from": "human", "value": "JPEG, GIF and PNG can be displayed with the img tag and will work in all browsers, the object element can be use for displaying images specifying its MIME type, but what other graphic formats are supported by img or object tag in most browsers without installing plugins? (TIF, S...
My boss thinks the VS 2008 IDE Window Manager(autohiding, docking of Solution Explorer, Properties, etc) is the best thing since sliced bread. I can't find a control that resembles that functionality in the Toolbox. Is there a control like that available that you know of? Or should I go ahead and implement it myself...
In Visual Studio 2008, the window management functionality that you see in the IDE (such as the docking and autohiding of panels like Solution Explorer, Properties, etc.) is part of the built-in features of the Visual Studio environment itself, and there is no direct equivalent control available in the Toolbox for use ...
19,565
[ { "from": "human", "value": "My boss thinks the VS 2008 IDE Window Manager(autohiding, docking of Solution Explorer, Properties, etc) is the best thing since sliced bread. I can't find a control that resembles that functionality in the Toolbox. Is there a control like that available that you know of? Or ...
The following JavaScript supposes to read the popular tags from an XML file and applies the XSL Stylesheet and output to the browser as HTML. function ShowPopularTags() { xml = XMLDocLoad("http://localhost/xml/tags/popular.xml?s=94987898"); xsl = XMLDocLoad("http://localhost/xml/xsl/popular-tags.xsl"); if (win...
The issue you are experiencing could stem from several factors, including the XML and XSL files not being loaded correctly, cross-origin issues, or problems with the transformation process. Below are some suggestions to help troubleshoot and potentially fix the problem: 1. **Check XML and XSL Loading**: Ensure that th...
9,869
[ { "from": "human", "value": "The following JavaScript supposes to read the popular tags from an XML file and applies the XSL Stylesheet and output to the browser as HTML.\nfunction ShowPopularTags() {\n xml = XMLDocLoad(\"http://localhost/xml/tags/popular.xml?s=94987898\");\n xsl = XMLDocLoad(\"http://l...
Seems so basic, I can't believe I don't know this! I just need a scratch folder to dump some temporary files to. I don't care if it gets wiped out between usages or not, and I don't think I should have to go through the hassle of creating one and maintaining it myself from within my application. Is that too much to ask...
Not at all! Most operating systems provide a simple way to access temporary file storage without the need to manually create and maintain a scratch folder. Here's how you can do it depending on the platform you're using: ### Windows You can use the system's temporary directory. In most programming languages, you can a...
18,616
[ { "from": "human", "value": "Seems so basic, I can't believe I don't know this! I just need a scratch folder to dump some temporary files to. I don't care if it gets wiped out between usages or not, and I don't think I should have to go through the hassle of creating one and maintaining it myself from withi...
Is there a way to disable Intellisense in the XAML editor in Visual Studio 2008? It is often a big performance drain while typing, and sometimes I'll sit for ten or more seconds waiting while the list automatically popups up. It appears that in Options->Text Editors->XAML, the Intellisense section is section is unavail...
In Visual Studio 2008, there is no straightforward option to completely disable Intellisense specifically for XAML editing through the options menu, as you've noted. However, you can try a couple of workarounds to improve performance while editing XAML files. 1. **Disable the XML Editor**: You can change the default e...
13,870
[ { "from": "human", "value": "Is there a way to disable Intellisense in the XAML editor in Visual Studio 2008? It is often a big performance drain while typing, and sometimes I'll sit for ten or more seconds waiting while the list automatically popups up.\nIt appears that in Options->Text Editors->XAML, the ...
Is it possible, in Java, to enforce that a class have a specific set of subclasses and no others? For example: public abstract class A {} public final class B extends A {} public final class C extends A {} public final class D extends A {} Can I somehow enforce that no other subclasses of A can ever be created?
In Java, there is no direct mechanism to enforce that only a specific set of subclasses can extend an abstract class or to prevent additional subclasses from being created. However, there are a few strategies you can use to achieve a similar effect: ### 1. Use Package-Private Constructors One common approach is to ma...
17,589
[ { "from": "human", "value": "Is it possible, in Java, to enforce that a class have a specific set of subclasses and no others? For example:\npublic abstract class A {}\npublic final class B extends A {}\npublic final class C extends A {}\npublic final class D extends A {}\n\nCan I somehow enforce that no ot...
When you use Apache proxying (using either ProxyPass or RewriteRule), if the destination returns an error (500 series status) then Apache won't proxy any more requests for 30 seconds. I know there's a way to disable this by setting that value to 0 second, but I can't remember how. I think it involves a semicolon and s...
To disable the proxying timeout behavior in Apache, you can set the `ProxyErrorOverride` directive along with the `ProxyPass` or `RewriteRule` options. Specifically, you can set the `timeout` value to 0 by using the `retry=0` parameter in the `ProxyPass` directive. Here’s how you can do it: ### Using ProxyPass If yo...
18,842
[ { "from": "human", "value": "When you use Apache proxying (using either ProxyPass or RewriteRule), if the destination returns an error (500 series status) then Apache won't proxy any more requests for 30 seconds. \nI know there's a way to disable this by setting that value to 0 second, but I can't remember ...
I'm new to MSBuild, and am learning as I need to know how to do things. Currently, I am working form the MSBuild file that is generated from the Web Deployment Project extension for Visual Studio. I have been ab;e to access and manipulate files which are directly in my Web project by creating properties form this block...
Certainly! In MSBuild, you can define properties just like you have in the `<PropertyGroup>` section of your XML. To manipulate files or define paths for other projects in your solution, you can create additional `<PropertyGroup>` sections or add properties to existing ones. Here’s how you can do it: ### Creating New ...
16,717
[ { "from": "human", "value": "I'm new to MSBuild, and am learning as I need to know how to do things. Currently, I am working form the MSBuild file that is generated from the Web Deployment Project extension for Visual Studio. I have been ab;e to access and manipulate files which are directly in my Web proje...
I have always been for documenting code, but when it comes to AJAX + PHP, it's not always easy: the code is really spread out! Logic, data, presentation - you name it - are split and mixed between server-side and client-side code. Sometimes there's also database-side code (stored procedures, views, etc) doing part of t...
Documenting code, especially in a multi-layered architecture like AJAX + PHP (or similar client-server models), can indeed be challenging. However, there are several strategies and best practices that can help you create a more coherent and efficient documentation system. Here are some suggestions: ### 1. **Use a Cent...
14,919
[ { "from": "human", "value": "I have always been for documenting code, but when it comes to AJAX + PHP, it's not always easy: the code is really spread out! Logic, data, presentation - you name it - are split and mixed between server-side and client-side code. Sometimes there's also database-side code (store...
I recently was working with a subversion project that checked out code not only from the repository I was working with, but also from a separate repository on a different server. How can I configure my repository to do this? I'm using the subversion client version 1.3.2 on Linux, and I also have access to TortoiseSVN v...
In Subversion, you can achieve checking out code from multiple repositories using the concept of "svn:externals." This feature allows you to define external references in your main repository that point to other repositories. Here's how you can set this up: ### Step 1: Set Up the External Repository 1. **Identify the...
14,342
[ { "from": "human", "value": "I recently was working with a subversion project that checked out code not only from the repository I was working with, but also from a separate repository on a different server.\nHow can I configure my repository to do this?\nI'm using the subversion client version 1.3.2 on Lin...
Okay this question is coming from someone who has never written any code beyond CSS, HTML and some php... Pretty much I'm using Word all day and constantly needing to refer to just a couple of sites and resources on the web. I would like to create a little add-in to go in the Ribbon in Word. I have the full VB 2008 Pro...
Creating a simple Word add-in with buttons that link to specific URLs is definitely possible, especially if you're using Visual Basic (VB) with Office development tools. However, automating the login process can be more complicated, especially if the websites require complex authentication methods. Here's a high-level ...
12,064
[ { "from": "human", "value": "Okay this question is coming from someone who has never written any code beyond CSS, HTML and some php...\nPretty much I'm using Word all day and constantly needing to refer to just a couple of sites and resources on the web.\nI would like to create a little add-in to go in the ...
I am a firm believer in the idea that one of the most important things you get from learning a new language is not how to use a new language, but the knowledge of concepts that you get from it. I am not asking how important or useful you think Assembly is, nor do I care if I never use it in any of my real projects. Wh...
Learning Assembly can provide valuable insights into computer architecture, memory management, and how high-level programming constructs are translated into machine-level instructions. Here are some important concepts that general programmers can benefit from by learning Assembly, even if they don't use it directly: #...
12,680
[ { "from": "human", "value": "I am a firm believer in the idea that one of the most important things you get from learning a new language is not how to use a new language, but the knowledge of concepts that you get from it. I am not asking how important or useful you think Assembly is, nor do I care if I nev...
I've created a seperate assembly with a class that is intended to be published through wmi. Then I've created a windows forms app that references that assembly and attempts to publish the class. When I try to publish the class, I get an exception of type System.Management.Instrumentation.WmiProviderInstallationExc...
The `WmiProviderInstallationException` you're encountering indicates that there is a problem during the installation process of your WMI provider. This can happen for a variety of reasons, so let’s go through a few common troubleshooting steps and things to check: ### 1. **Check the WMI Namespace** Make sure that the ...
14,011
[ { "from": "human", "value": "I've created a seperate assembly with a class that is intended to be \npublished through wmi. Then I've created a windows forms app that \nreferences that assembly and attempts to publish the class. When I try to \npublish the class, I get an exception of type \nSystem.Manageme...
I need a short code snippet to get a directory listing from an HTTP server. Thanks
You can use Python's `requests` library to make an HTTP request and then parse the response to get a directory listing. Below is a short code snippet that demonstrates how to do this: ```python import requests from bs4 import BeautifulSoup def get_directory_listing(url): try: response = requests.get(url) ...
19,456
[ { "from": "human", "value": "I need a short code snippet to get a directory listing from an HTTP server.\nThanks\n" }, { "from": "gpt", "value": "You can use Python's `requests` library to make an HTTP request and then parse the response to get a directory listing. Below is a short code snippet ...
How are folks integrating various static analysis tools such as PMD, Checkstyle, and FindBugs so that they are used together in some uniform way? In particular, I'm interested in generating a single uniform report that includes warnings from all tools. Also, I want to be able to mark-up my code with reasonably consiste...
Integrating multiple static analysis tools like PMD, Checkstyle, and FindBugs (now known as SpotBugs) in a way that provides a unified experience can be achieved through a combination of build automation, reporting, and consistent suppression mechanisms. Here are some strategies to help you achieve this: ### 1. Unifie...
9,979
[ { "from": "human", "value": "How are folks integrating various static analysis tools such as PMD, Checkstyle, and FindBugs so that they are used together in some uniform way? In particular, I'm interested in generating a single uniform report that includes warnings from all tools. Also, I want to be able to...
I've recently come across this piece of JavaScript code: if (",>=,<=,<>,".indexOf("," + sCompOp + ",") != -1) I was intrigued, because to write this test I would have done: if (/(>=|<=|<>)/.test(sCompOp)) Is this just a stylistic difference, or does the author of the other code know something about optimization that ...
The two approaches you've described for checking if `sCompOp` matches one of several operators (`>=`, `<=`, `<>`) indeed serve the same purpose but come with different trade-offs in terms of readability, performance, and maintainability. ### Readability - **Regex approach**: Your method with regex (`if (/(>=|<=|<>)/.t...
16,517
[ { "from": "human", "value": "I've recently come across this piece of JavaScript code:\nif (\",>=,<=,<>,\".indexOf(\",\" + sCompOp + \",\") != -1)\n\nI was intrigued, because to write this test I would have done:\nif (/(>=|<=|<>)/.test(sCompOp))\n\nIs this just a stylistic difference, or does the author of t...
I am using sybase database to query the daily transaction report. I had subquery within my script. Here as it goes: SELECT orders.accountid ,items.x,etc (SELECT charges.mistotal FROM charges where items.id = charges.id) FROM items,orders WHERE date = '2008-10-02' Here I am getting the error message as: Subquery cann...
To achieve your goal of returning the second value (25.00) from the subquery, you need to modify your subquery to explicitly filter or order the results in such a way that it returns the desired value. If you want to get the second highest or any specific value from the results, you can use ordering and filtering techn...
17,298
[ { "from": "human", "value": "I am using sybase database to query the daily transaction report. I had subquery within my script. \nHere as it goes:\nSELECT orders.accountid ,items.x,etc\n(SELECT charges.mistotal FROM charges where items.id = charges.id)\nFROM items,orders\nWHERE date = '2008-10-02'\n\nHere I...
What is a typical estimate for coding unit tests given an estimate for coding new functionality? Is this different for estimates to maintain code?
Estimating the time required to write unit tests in relation to coding new functionality can vary based on several factors, including the complexity of the functionality, the team's experience with testing, and the codebase's quality. However, a common heuristic is as follows: ### For New Functionality - **Typical Rat...
19,948
[ { "from": "human", "value": "What is a typical estimate for coding unit tests given an estimate for coding new functionality? Is this different for estimates to maintain code?\n" }, { "from": "gpt", "value": "Estimating the time required to write unit tests in relation to coding new functionalit...
I am trying to figure out a crash in my application. WinDbg tells me the following: (using dashes in place of underscores) LAST-CONTROL-TRANSFER: from 005f5c7e to 6e697474 DEFAULT-BUCKET-ID: BAD_IP BUGCHECK-STR: ACCESS-VIOLATION It is obvious to me that 6e697474 is NOT a valid address. I have three questions: 1) Doe...
Let's address your questions one by one: 1. **Does the "BAD_IP" bucket ID mean "Bad Instruction Pointer?"** Yes, the "BAD_IP" (Bad Instruction Pointer) bucket ID indicates that an invalid instruction pointer was encountered during execution. This can occur when the application attempts to execute code at a memory a...
14,321
[ { "from": "human", "value": "I am trying to figure out a crash in my application. \nWinDbg tells me the following: (using dashes in place of underscores)\nLAST-CONTROL-TRANSFER: from 005f5c7e to 6e697474\nDEFAULT-BUCKET-ID: BAD_IP\nBUGCHECK-STR: ACCESS-VIOLATION\nIt is obvious to me that 6e697474 is NOT a...
In Google Chrome, I can provide the command-line argument --user-data-dir="..." to have Chrome use a different directory for state like cookies, cache, and so forth. This makes it possible to trivially load web pages from a "fresh" browser and simulate multiple independent users. How can I do the same thing with Inter...
Internet Explorer (IE) does not have a built-in command-line option like Chrome's `--user-data-dir` to specify different user data directories for browser profiles. Instead, it relies on the current user's Windows profile for storing its data, including cookies, cache, and other settings. Since Internet Explorer is de...
19,257
[ { "from": "human", "value": "In Google Chrome, I can provide the command-line argument --user-data-dir=\"...\" to have Chrome use a different directory for state like cookies, cache, and so forth. This makes it possible to trivially load web pages from a \"fresh\" browser and simulate multiple independent ...
We've got a scenario that requires us to parse lots of e-mail (plain text), each e-mail 'type' is the result of a script being run against various platforms. Some are tab delimited, some are space delimited, some we simply don't know yet. We'll need to support more 'formats' in the future too. Do we go for a solution u...
Given your requirements and the constraints of working with multiple, potentially unknown formats in email parsing, here are considerations for each approach: ### 1. **Regex (Regular Expressions)** **Pros:** - Powerful for pattern matching, making it suitable for varied formats. - Can handle complex scenarios, such as...
16,212
[ { "from": "human", "value": "We've got a scenario that requires us to parse lots of e-mail (plain text), each e-mail 'type' is the result of a script being run against various platforms. Some are tab delimited, some are space delimited, some we simply don't know yet.\nWe'll need to support more 'formats' in...
.NET developers out there! Need your opinion here! I am now using Visual Assist X, a decent piece of software, indeed. But the .NET bloggers seem to prefer Resharper more. I might want to consider a switch over, but before that I want your guys opinion first.
As a .NET developer, the choice between Visual Assist X and ReSharper often comes down to personal preference and specific development needs. Here are some considerations to help you decide: ### Visual Assist X: **Pros:** - **Performance:** Generally, Visual Assist X is known for being lightweight and fast. It typical...
16,964
[ { "from": "human", "value": ".NET developers out there! Need your opinion here!\nI am now using Visual Assist X, a decent piece of software, indeed. But the .NET bloggers seem to prefer Resharper more. I might want to consider a switch over, but before that I want your guys opinion first.\n" }, { "f...
I have an upcoming project which will have to be able to print simple reports from its data. It'll be WPF-based, and I'm wondering which way to go. I know that WPF introduces its own printing technology (based on XPS) which looks quite easy to use. However, part of me wonders whether it would just be easier to use the ...
When it comes to printing and reporting in a WPF application, both approaches you mentioned have their own merits and considerations. Here’s a detailed comparison to help you decide the best route for your project: ### WPF Printing **Advantages:** 1. **Integration with WPF**: WPF's printing capabilities are natively ...
17,654
[ { "from": "human", "value": "I have an upcoming project which will have to be able to print simple reports from its data. It'll be WPF-based, and I'm wondering which way to go.\nI know that WPF introduces its own printing technology (based on XPS) which looks quite easy to use. However, part of me wonders w...
How do i delete all the tables in the schema on Apache Derby DB using JDBC?
To delete all tables in a schema using JDBC in Apache Derby, you typically need to execute a series of SQL statements to drop each table. Apache Derby does not support dropping all tables in one command directly, so you have to retrieve the list of tables first and then drop them individually. Here's a step-by-step gui...
15,118
[ { "from": "human", "value": "How do i delete all the tables in the schema on Apache Derby DB using JDBC?\n" }, { "from": "gpt", "value": "To delete all tables in a schema using JDBC in Apache Derby, you typically need to execute a series of SQL statements to drop each table. Apache Derby does no...
How to disable standard ASP.NET handling of 401 response code (redirecting to login page) for AJAX/JSON requests? For web-pages it's okay, but for AJAX I need to get right 401 error code instead of good looking 302/200 for login page. Update: There are several solutions from Phil Haack, PM of ASP.NET MVC - http://haack...
To disable the standard ASP.NET handling of the 401 response code for AJAX/JSON requests, you will want to prevent the automatic redirection to the login page when the user is unauthorized. Instead, you want the application to return a 401 status code directly so that your AJAX calls can handle it appropriately. Here ...
15,330
[ { "from": "human", "value": "How to disable standard ASP.NET handling of 401 response code (redirecting to login page) for AJAX/JSON requests?\nFor web-pages it's okay, but for AJAX I need to get right 401 error code instead of good looking 302/200 for login page.\nUpdate:\nThere are several solutions from ...
I'm doing a sitemap producer in Object Pascal and need a good function or lib to emulate the parse_url function on PHP. Does anyone know of any good ones?
In Object Pascal (often used with Delphi or Free Pascal), you can create a function to parse URLs similarly to PHP's `parse_url` function. While there's no built-in function that directly matches `parse_url`, you can implement a custom function to break down a URL into its components. Here's a simple implementation of...
16,428
[ { "from": "human", "value": "I'm doing a sitemap producer in Object Pascal and need a good function or lib to emulate the parse_url function on PHP.\nDoes anyone know of any good ones?\n" }, { "from": "gpt", "value": "In Object Pascal (often used with Delphi or Free Pascal), you can create a fun...
i work with sql server, but i must migrate to an application with Oracle DB. for trace my application queries, in Sql Server i use wonderful Profiler tool. is there something of equivalent for Oracle?
Yes, Oracle provides several tools and methods to trace and monitor queries in a similar way to SQL Server Profiler. Here are some options you can use to trace your application queries in an Oracle Database: 1. **Oracle SQL Developer**: This is a free graphical tool provided by Oracle that can help you manage your dat...
16,837
[ { "from": "human", "value": "i work with sql server, but i must migrate to an application with Oracle DB.\nfor trace my application queries, in Sql Server i use wonderful Profiler tool. is there something of equivalent for Oracle?\n" }, { "from": "gpt", "value": "Yes, Oracle provides several too...
I have an application that seems to throw exceptions only after the program has been closed. And it is very inconsistent. (We all know how fun inconsistent bugs are...) My guess is there is an error during the clean up process. But these memory read/write errors seem to indicate something wrong in my "unsafe" code us...
Debugging inconsistent bugs, especially those related to memory access violations after the program has closed, can be challenging. Here are steps and methods to help you diagnose and resolve these issues: ### 1. **Analyze the Error Messages:** - The error messages indicate that your application is attempting to ac...
15,944
[ { "from": "human", "value": "I have an application that seems to throw exceptions only after the program has been closed. And it is very inconsistent. (We all know how fun inconsistent bugs are...)\nMy guess is there is an error during the clean up process. But these memory read/write errors seem to indic...
What is the proper way to minimize a WinForms app to the system tray? Note: minimize to system tray; on the right side of the taskbar by the clock. I'm not asking about minimizing to taskbar, which is what happens when you hit the "minus" button on the window. I've seen hackish solutions like, "minimize, set ShowInTas...
To minimize a WinForms application to the system tray properly, you can utilize the `NotifyIcon` class in conjunction with handling the form's `Resize` event and using the `FormClosing` event appropriately. This will allow your application to minimize to the system tray in a clean way. Here's a step-by-step guide on h...
14,370
[ { "from": "human", "value": "What is the proper way to minimize a WinForms app to the system tray? \nNote: minimize to system tray; on the right side of the taskbar by the clock. I'm not asking about minimizing to taskbar, which is what happens when you hit the \"minus\" button on the window.\nI've seen hac...
I have a website laid out in tables. (a long mortgage form) in each table cell is one HTML object. (text box, radio buttons, etc) What can I do so when each table cell is "tabbed" into it highlights the cell with a very light red (not to be obtrusive, but tell the user where they are)?
You can achieve this effect using a combination of CSS and JavaScript. The idea is to apply a style to the table cell (e.g., changing its background color) when one of the input elements inside it receives focus. You can do this with a simple JavaScript event listener for the `focus` event. Here's a step-by-step guide ...
13,119
[ { "from": "human", "value": "I have a website laid out in tables. (a long mortgage form)\nin each table cell is one HTML object. (text box, radio buttons, etc)\nWhat can I do so when each table cell is \"tabbed\" into it highlights the cell with a very light red (not to be obtrusive, but tell the user where...
HyperTerminal is a program that you can use to connect to other computers, Telnet sites, bulletin board systems (BBSs), online services, and host computers, using either your modem, a null modem cable or Ethernet connection. But My main usage of Hyperterminal is to communicate with hardware through local (v...
Yes, there are several alternatives to HyperTerminal that can be used for serial communication, including connecting to hardware through COM ports. Some popular options are: 1. **PuTTY**: A free and open-source terminal emulator that supports various network protocols, including SSH, Telnet, and serial connections. Pu...
15,628
[ { "from": "human", "value": "\nHyperTerminal is a program that you can use to connect to other\n computers, Telnet sites, bulletin\n board systems (BBSs), online services,\n and host computers, using either your\n modem, a null modem cable or Ethernet\n connection.\n\nBut My main usage of Hyperterminal...
I use Tortoise SVN usuallly, but I have been looking into Mercurial since it is a distributed revision control system. What I am looking for, in both systems, is a tool that let me pick only parts of a file and commit them. If I want to do this now, I have to copy to a temp version of the file and keep only the change...
Yes, Git does support a feature called "interactive staging" that allows you to selectively commit parts of a file rather than committing the entire file. This is one of the key advantages of using Git over some other version control systems, including Tortoise SVN and Mercurial. In Git, you can use the `git add -p` c...
17,085
[ { "from": "human", "value": "I use Tortoise SVN usuallly, but I have been looking into Mercurial since it is a distributed revision control system. \nWhat I am looking for, in both systems, is a tool that let me pick only parts of a file and commit them. If I want to do this now, I have to copy to a temp ve...
Been running into this problem lately... When debugging an app in VS.Net 2005, breakpoints are not connected. Error indicates that the compiled code is not the same as the running version and therefore there's a mismatch that causes the breakpoint to be disconnected. Cleaned solution of all bin file and re-compile do...
It sounds like you're dealing with a frustrating issue that's not uncommon when working with Visual Studio, especially with an older version like VS.NET 2005. Here are some steps and considerations that might help resolve your breakpoint issue: ### 1. **Ensure Debug Configuration:** - Make sure that your project is...
16,237
[ { "from": "human", "value": "Been running into this problem lately... When debugging an app in VS.Net 2005, breakpoints are not connected. Error indicates that the compiled code is not the same as the running version and therefore there's a mismatch that causes the breakpoint to be disconnected.\nCleaned ...
We run full re-indexes every 7 days (i.e. creating the index from scratch) on our Lucene index and incremental indexes every 2 hours or so. Our index has around 700,000 documents and a full index takes around 17 hours (which isn't a problem). When we do incremental indexes, we only index content that has changed in the...
The decision to call `IndexWriter.optimize()` in Apache Lucene, particularly in the context of your use case, should carefully consider the trade-offs between write performance, read performance, and overall system resource utilization. ### Understanding Index Optimization 1. **Index Structure**: Lucene maintains its ...
12,708
[ { "from": "human", "value": "We run full re-indexes every 7 days (i.e. creating the index from scratch) on our Lucene index and incremental indexes every 2 hours or so. Our index has around 700,000 documents and a full index takes around 17 hours (which isn't a problem).\nWhen we do incremental indexes, we ...
I am trying to leverage ORM given the following requirements: 1) Using .NET Framework (latest Framework is okay) 2) Must be able to use Sybase, Oracle, MSSQL interchangeably 3) The schema is mostly static, BUT there are dynamic parts. I am somewhat familiar with SubSonic and NHibernate, but not deeply. I get the naggin...
Based on your requirements and constraints, it sounds like you're looking for an ORM solution that allows for dynamic schema handling while maintaining compatibility with multiple database platforms. Given your familiarity with NHibernate, I will focus on that, as it offers the extensibility and flexibility you may nee...
15,626
[ { "from": "human", "value": "I am trying to leverage ORM given the following requirements:\n1) Using .NET Framework (latest Framework is okay)\n2) Must be able to use Sybase, Oracle, MSSQL interchangeably\n3) The schema is mostly static, BUT there are dynamic parts.\nI am somewhat familiar with SubSonic and...
I would like to create a folder that users who do not have privileges to view the rest of the site can see. This user group would be granted access to the site, but I only want them to be able to view one particular page. Is this possible to do without going to every single page and removing the new user group's access...
Yes, it is definitely possible to create a specific folder or page that is accessible to a certain user group while restricting their access to the rest of the site. The exact method to achieve this will depend on the content management system (CMS) or platform you are using, but here are some general approaches you ca...
11,138
[ { "from": "human", "value": "I would like to create a folder that users who do not have privileges to view the rest of the site can see. This user group would be granted access to the site, but I only want them to be able to view one particular page.\nIs this possible to do without going to every single pag...
When I try this with a generic class where this.value is T: if (this.value.GetType() == typeof(int)) { ((int)this.value)++; } else { throw new InvalidOperationException ("T must be an int to perform this operation"); } I get a compile-time error: "Cannot convert type 'T' to 'int'" What should I do ...
In C#, you cannot directly cast a generic type parameter `T` to a specific type (like `int`) because the compiler does not know at compile time what `T` is, and thus it cannot guarantee that such a cast is valid. If you want to perform operations that are specific to certain types within a generic class, you can use o...
15,912
[ { "from": "human", "value": "When I try this with a generic class where this.value is T:\nif (this.value.GetType() == typeof(int))\n{\n ((int)this.value)++;\n}\nelse\n{\n throw new InvalidOperationException\n (\"T must be an int to perform this operation\");\n}\n\nI get a compile-time error...
I have a WPF application and I want to be able to save the output of the application to a PDF document, the item I want to save can be a Visual a Drawing or a FixedDocument (I can create it as any of those options, and it's easy to convert between them). Is there any library that can convert directly from WPF to PDF (w...
Yes, there are several libraries available that can help you convert WPF visuals directly to PDF without having to manually walk the visual tree and recreate the visuals using PDF primitives. Here are a few popular options: 1. **MigraDoc / PDFsharp**: - **PDFsharp** is a library for creating and processing PDF docu...
16,133
[ { "from": "human", "value": "I have a WPF application and I want to be able to save the output of the application to a PDF document, the item I want to save can be a Visual a Drawing or a FixedDocument (I can create it as any of those options, and it's easy to convert between them).\nIs there any library th...
Before anyone suggests scrapping the table tags altogether, I'm just modifying this part of a very large system, so it really wouldn't be wise for me to revise the table structure (the app is filled with similar tables). This is a webapp in C# .NET - data comes in from a webservice and is displayed onscreen in a table....
It sounds like you have a complex scenario with your web application, and modifying the existing structure of your ASP.NET Repeater is a reasonable approach given your constraints. To achieve your goal of having a collapsible section for each date with sub-headers and data rows, you can indeed work with the Repeater co...
13,189
[ { "from": "human", "value": "Before anyone suggests scrapping the table tags altogether, I'm just modifying this part of a very large system, so it really wouldn't be wise for me to revise the table structure (the app is filled with similar tables).\nThis is a webapp in C# .NET - data comes in from a webser...
Perl has several built-in functions for accessing /etc/passwd on Unix systems (and elsewhere when supported) for user and group information. For instance, my $name = getpwuid($uid); will return the user name given the user ID, or undef if there is no such user. If a Perl script needs to be portable and run on Unices a...
For accessing user and group information in a portable way across Unix-like systems and Windows in Perl, you have a few options: 1. **Using CPAN Modules**: The `User::pwent` and `User::grent` modules are indeed available in ActivePerl and provide a way to read user and group information similar to the Unix `/etc/passw...
16,616
[ { "from": "human", "value": "Perl has several built-in functions for accessing /etc/passwd on Unix systems (and elsewhere when supported) for user and group information. For instance,\nmy $name = getpwuid($uid);\n\nwill return the user name given the user ID, or undef if there is no such user.\nIf a Perl sc...
I'm looking for a good, well designed flow of a UK postcode lookup process as part of registration for an eCommerce account. We're redesigning ours and want to see what is out there and how I can make it as friendly as possible. --Update-- Basically our current design was a manual entry form (worked pretty well) which ...
Redesigning your postcode lookup process for eCommerce account registration is a great opportunity to enhance user experience and streamline the form completion process. Here’s a flow that you can consider, alongside some design principles and examples to improve usability: ### Suggested Flow for Postcode Lookup durin...
14,526
[ { "from": "human", "value": "I'm looking for a good, well designed flow of a UK postcode lookup process as part of registration for an eCommerce account.\nWe're redesigning ours and want to see what is out there and how I can make it as friendly as possible.\n--Update--\nBasically our current design was a m...
I have an application that uses Forms Authentication to authenticate one type of user. There is a section in this application that needs to be authenticated for another type of user using a different table in the database. The problem happens if the second type of user's session times out, she is taken to the login pag...
Using Forms Authentication for two different user types in the same application can be challenging, especially when both user types need to be redirected to different login pages upon session timeout. Here are a few options to resolve this issue: ### 1. Use Multiple Forms Authentication Instances One approach is to im...
17,086
[ { "from": "human", "value": "I have an application that uses Forms Authentication to authenticate one type of user. There is a section in this application that needs to be authenticated for another type of user using a different table in the database. The problem happens if the second type of user's session...
I have been given a requirement where I need to support multiple databases in the same instance, to support multi-tenancy. Each DB has an identical schema. The user logs into a specific database by choosing from a list, and all subsequent calls will go to that DB until they log out. I want to hot swap the session facto...
To implement multi-tenancy in a Hibernate-based application while being able to hot-swap `SessionFactory` instances based on a tenant selection, you can utilize a combination of Spring's `AbstractRoutingDataSource` and Hibernate's `SessionFactory`. Here's a general approach and a code sample to help you achieve this: ...
12,767
[ { "from": "human", "value": "I have been given a requirement where I need to support multiple databases in the same instance, to support multi-tenancy. Each DB has an identical schema. The user logs into a specific database by choosing from a list, and all subsequent calls will go to that DB until they log ...
What is the best way to get started with programming things outside of your computer? I don't mean mainstream things like cell phones with APIs. Please assume working knowledge of C/C++
If you're looking to get started with programming hardware and devices outside of your computer, there are several interesting avenues you can explore. Here are some popular options that can utilize your knowledge of C/C++ and allow you to create engaging projects: ### 1. Microcontroller Programming Microcontrollers a...
12,608
[ { "from": "human", "value": "What is the best way to get started with programming things outside of your computer? \nI don't mean mainstream things like cell phones with APIs.\nPlease assume working knowledge of C/C++\n" }, { "from": "gpt", "value": "If you're looking to get started with program...
I've somehow managed to get an SVN repository into a bad state. I've moved a directory and now I can't commit it in its new location. As far as svn status is concerned, the directory is unknown (the name of the directory is type). $ svn status ? type When I try to add the directory, the server says it already ex...
It sounds like you've run into a common issue that can occur when manipulating files and directories within an SVN repository, particularly when using an external tool like Eclipse that may not handle version control operations as clearly as the command line. ### Explanation of the Error Messages 1. **`svn status` sh...
14,389
[ { "from": "human", "value": "I've somehow managed to get an SVN repository into a bad state. I've moved a directory and now I can't commit it in its new location.\nAs far as svn status is concerned, the directory is unknown (the name of the directory is type).\n\n$ svn status\n? type\n\nWhen I try to a...
I am using Forms authentication in my asp.net (3.5) application. I am also using roles to define what user can access which subdirectories of the app. Thus, the pertinent sections of my web.config file look like this: <system.web> <authentication mode="Forms"> <forms loginUrl="Default.aspx" path="/" protection="A...
It looks like you are encountering an issue with role-based authentication in your ASP.NET application, specifically with the `Context.User` object not retaining the roles after being set in the `Application_AuthenticateRequest` method in `Global.asax`. To resolve this, there are a couple of things you should consider...
15,664
[ { "from": "human", "value": "I am using Forms authentication in my asp.net (3.5) application. I am also using roles to define what user can access which subdirectories of the app. Thus, the pertinent sections of my web.config file look like this:\n<system.web>\n <authentication mode=\"Forms\">\n <forms ...
Interested if anyone has used VSTS Database Edition extensively and, if so, which features did you find the most useful over the standard Visual Studio database projects? What are the most compelling features as opposed to alternative schema management options or tools like RedGate's SqlCompare etc? Edit: Microsoft jus...
The VSTS Database Edition (now known as SQL Server Data Tools or SSDT) has been well-regarded for its advanced features compared to standard Visual Studio database projects. Here are some of the most compelling features that users have found beneficial, particularly in relation to alternatives like Redgate's SQL Compar...
18,060
[ { "from": "human", "value": "Interested if anyone has used VSTS Database Edition extensively and, if so, which features did you find the most useful over the standard Visual Studio database projects?\nWhat are the most compelling features as opposed to alternative schema management options or tools like Red...
Consider a hypothetical method of an object that does stuff for you: public class DoesStuff { BackgroundWorker _worker = new BackgroundWorker(); ... public void CancelDoingStuff() { _worker.CancelAsync(); //todo: Figure out a way to wait for BackgroundWorker to be cancelled. } } ...
To wait for a `BackgroundWorker` to finish while also handling the potential deadlocks and re-entrancy issues you've mentioned, you can leverage `TaskCompletionSource` to facilitate waiting on the completion of the `BackgroundWorker` without blocking the UI thread. Here's how you could implement it: 1. Use a `TaskComp...
15,187
[ { "from": "human", "value": "Consider a hypothetical method of an object that does stuff for you:\npublic class DoesStuff\n{\n BackgroundWorker _worker = new BackgroundWorker();\n\n ...\n\n public void CancelDoingStuff()\n {\n _worker.CancelAsync();\n\n //todo: Figure out a way to ...
In Linux environment, when getting "glibc detected *** free(): invalid pointer" errors, how do I identify which line of code is causing it? Is there a way to force an abort? I recall there being an ENV var to control this? How to set a breakpoint in gdb for the glibc error?
When you encounter a "glibc detected *** free(): invalid pointer" error in a Linux environment, it typically indicates that your program is trying to free a pointer that was either not allocated by `malloc`/`calloc`/`realloc`, has already been freed, or has been corrupted. Here’s how you can identify the source of the ...
17,022
[ { "from": "human", "value": "In Linux environment, when getting \"glibc detected *** free(): invalid pointer\" errors, how do I identify which line of code is causing it?\nIs there a way to force an abort? I recall there being an ENV var to control this?\nHow to set a breakpoint in gdb for the glibc error?\...
I'm currently using the sun preverifier to preverify my MIDlet. I'm finding that it can be a bit slow, doesnt give any decent error messages and is only available as a windows exe. Are there any better preverifiers around that will work cross platform (linux specifically)
If you're looking for alternatives to the Sun preverify tool for MIDlet verification that are more cross-platform friendly, you might consider the following options: 1. **KVM (Kernel Virtual Machine)**: The KVM implementation supports preverification and can be run on various platforms, including Linux. It might requi...
19,172
[ { "from": "human", "value": "I'm currently using the sun preverifier to preverify my MIDlet. I'm finding that it can be a bit slow, doesnt give any decent error messages and is only available as a windows exe.\nAre there any better preverifiers around that will work cross platform (linux specifically)\n" ...
How do i store a directory / hierarchy / tree structure in the database? Namely MSSQL Server. @olavk: Doesn't look like you've seen my own answer. The way i use is way better than recursive queries :) p.p.s. This is the way to go!
Storing a directory or tree structure in a database like SQL Server can be accomplished using several approaches. Here are a few common methods: ### 1. Adjacency List Model This is one of the simplest models where each node (directory or file) has a reference to its parent node. **Table Structure:** ```sql CREATE TAB...
12,296
[ { "from": "human", "value": "How do i store a directory / hierarchy / tree structure in the database? Namely MSSQL Server.\n@olavk: Doesn't look like you've seen my own answer. The way i use is way better than recursive queries :)\np.p.s. This is the way to go!\n" }, { "from": "gpt", "value": "S...
I want to take html, including the text and images and turn it into one image containing everything. Is there a free way to do it? This is using .net 3.5. See also: Server Generated web screenshots? What is the best way to create a web page thumbnail?
Creating a single image from HTML content that includes text and images can be a bit challenging, especially with .NET 3.5. However, there are some approaches you can take. Here are a few methods you could consider: ### 1. Use a Headless Browser You can use a headless browser to render the HTML and then capture a scr...
12,927
[ { "from": "human", "value": "I want to take html, including the text and images and turn it into one image containing everything. Is there a free way to do it?\nThis is using .net 3.5.\nSee also:\nServer Generated web screenshots?\nWhat is the best way to create a web page thumbnail?\n" }, { "from"...
In the following code, both amp_swap() and star_swap() seems to be doing the same thing. So why will someone prefer to use one over the other? Which one is the preferred notation and why? Or is it just a matter of taste? #include <iostream> using namespace std; void amp_swap(int &x, int &y) { int temp = x; x ...
The two functions `amp_swap()` and `star_swap()` effectively accomplish the same task of swapping the values of two integers, but they do so using different mechanisms: references and pointers. ### Differences and Preferences 1. **Syntax and Readability**: - **References (`amp_swap`)**: - The syntax is genera...
17,600
[ { "from": "human", "value": "In the following code, both amp_swap() and star_swap() seems to be doing the same thing. So why will someone prefer to use one over the other? Which one is the preferred notation and why? Or is it just a matter of taste?\n#include <iostream>\n\nusing namespace std;\n\nvoid amp_s...
I have a problem with a data-bound DataGrid control, in that despite each column having its Wrap property set to false, the text still wraps. It seems to only do this on IE, and not FF.
It sounds like you're encountering an issue with the `DataGrid` control's behavior in Internet Explorer (IE) regarding text wrapping, even when the `Wrap` property is set to `false`. This issue may be due to how different browsers render HTML and CSS, especially with table layouts. Here are a few suggestions to trouble...
17,874
[ { "from": "human", "value": "I have a problem with a data-bound DataGrid control, in that despite each column having its Wrap property set to false, the text still wraps. It seems to only do this on IE, and not FF.\n" }, { "from": "gpt", "value": "It sounds like you're encountering an issue wit...
Instead of having to remember to initialize a simple 'C' structure, I might derive from it and zero it in the constructor like this: struct MY_STRUCT { int n1; int n2; }; class CMyStruct : public MY_STRUCT { public: CMyStruct() { memset(this, 0, sizeof(MY_STRUCT)); } }; This trick is often...
Using a constructor to zero out a structure by deriving from it and using `memset` can lead to issues and is generally not considered a safe or recommended practice in C++. Here are some key points to consider: 1. **Object Slicing**: When you derive from a struct (or class), you are creating a new type that has additi...
17,028
[ { "from": "human", "value": "Instead of having to remember to initialize a simple 'C' structure, I might derive from it and zero it in the constructor like this:\nstruct MY_STRUCT\n{\n int n1;\n int n2;\n};\n\nclass CMyStruct : public MY_STRUCT\n{\npublic:\n CMyStruct()\n {\n memset(this,...
In one of my ASP.NET Web Applications, I am using a BulkEditGridView (a GridView which allows all rows to be edited at the same time) to implement an order form. In my grid, I have a column which calculates the total for each item (cost x quantity) and a grand total field at the bottom of the page. Currently, however, ...
To dynamically update totals in your BulkEditGridView without causing post-back issues or interfering with the focus on the page, you can utilize JavaScript or jQuery for a client-side solution. Here's a step-by-step guide to implement this: ### Step 1: Setup Your GridView Make sure your GridView has the necessary HT...
13,225
[ { "from": "human", "value": "In one of my ASP.NET Web Applications, I am using a BulkEditGridView (a GridView which allows all rows to be edited at the same time) to implement an order form. In my grid, I have a column which calculates the total for each item (cost x quantity) and a grand total field at the...
I need to implement red eye reduction for an application I am working on. Googling mostly provides links to commercial end-user products. Do you know a good red eye reduction algorithm, which could be used in a GPL application?
Yes! Red-eye reduction is a common problem in image processing, and there are several algorithms and methods that can be implemented in a GPL application. Here's a simple outline of an algorithm you could use for red-eye reduction: ### Algorithm Outline 1. **Image Acquisition**: Load the image into your application. ...
14,610
[ { "from": "human", "value": "I need to implement red eye reduction for an application I am working on.\nGoogling mostly provides links to commercial end-user products.\nDo you know a good red eye reduction algorithm, which could be used in a GPL application?\n" }, { "from": "gpt", "value": "Yes!...
What I have now (which successfully loads the plug-in) is this: Assembly myDLL = Assembly.LoadFrom("my.dll"); IMyClass myPluginObject = myDLL.CreateInstance("MyCorp.IMyClass") as IMyClass; This only works for a class that has a constructor with no arguments. How do I pass in an argument to a constructor?
To create an instance of a class from a loaded assembly while passing arguments to its constructor, you need to use the `Activator.CreateInstance` method instead of `CreateInstance`. The `Activator.CreateInstance` method allows you to specify an array of constructor arguments. Here is how you can modify your code to a...
17,363
[ { "from": "human", "value": "What I have now (which successfully loads the plug-in) is this:\nAssembly myDLL = Assembly.LoadFrom(\"my.dll\");\nIMyClass myPluginObject = myDLL.CreateInstance(\"MyCorp.IMyClass\") as IMyClass;\n\nThis only works for a class that has a constructor with no arguments. How do I pa...
I'm interested in how java organizes memory and executes code (like what gets put in the stack or the heap), from the start of main, to assigning variables, calling functions, passing parameters, returning values, instantiating objects, etc. Has anyone found a good, beginner-friendly article/reference on it?
Understanding how Java organizes memory and executes code is fundamental to programming in the language. Here’s an overview of how memory is structured in Java, specifically in terms of the stack and heap, as well as some related concepts. ### Memory Organization in Java 1. **Java Memory Areas**: - **Heap**: This ...
14,834
[ { "from": "human", "value": "I'm interested in how java organizes memory and executes code (like what gets put in the stack or the heap), from the start of main, to assigning variables, calling functions, passing parameters, returning values, instantiating objects, etc. Has anyone found a good, beginner-fri...
I know that Sql Server has some handy built-in quarterly stuff, but what about the .Net native DateTime object? What is the best way to add, subtract, and traverse quarters? Is it a bad thing™ to use the VB-specific DateAdd() function? e.g.: Dim nextQuarter As DateTime = DateAdd(DateInterval.Quarter, 1, DateTime.Now) ...
Your exploration of quarter-related functions in .NET using the `DateTime` object looks great! Let's discuss the use of `DateAdd`, and then I'll provide additional insights and refinements to the functions you've shared. ### Use of DateAdd Using the VB-specific `DateAdd` function can be convenient if you’re developin...
10,692
[ { "from": "human", "value": "I know that Sql Server has some handy built-in quarterly stuff, but what about the .Net native DateTime object? What is the best way to add, subtract, and traverse quarters?\nIs it a bad thing™ to use the VB-specific DateAdd() function? e.g.:\nDim nextQuarter As DateTime = DateA...
I am in the process of designing a Web Services course for students in an Information Technology program. Some students stop after getting a two-year associates degree, but other students in the program go on to a four-year bachelor's degree. This course would be for students going on to the four-year degree. My init...
It sounds like you’re designing an engaging and practical course for students who are pursuing a four-year degree in Information Technology. Given your goals and the background of your students, here are some additional topics and considerations to enhance your course on web programming: ### Suggested Topics for Your ...
12,633
[ { "from": "human", "value": "I am in the process of designing a Web Services course for students in an Information Technology program. Some students stop after getting a two-year associates degree, but other students in the program go on to a four-year bachelor's degree. This course would be for students ...
So my build machine spits out a new executable and I would like to update my test machine with the new build. In order to do this I would need to somehow kill the process on the remote machine, copy over the new binary and start it running. And for some reason pskill and psexec don't work due to some weird IT setup. Wh...
If you cannot use `pskill` or `psexec`, there are other approaches you can take to remotely manage your test machine, update the executable, and restart the process. Here are some options: ### 1. **Using Remote Desktop Protocol (RDP)** 1. **Connect via RDP**: Log into the test machine using RDP. 2. **Kill the Process...
16,055
[ { "from": "human", "value": "So my build machine spits out a new executable and I would like to update my test machine with the new build. In order to do this I would need to somehow kill the process on the remote machine, copy over the new binary and start it running.\nAnd for some reason pskill and psexec...
Im using delphi's ttreeview as an 'options' menu. how would i go upon selecting the next node at runtime like a previous and next button? i tried the getprev and getnext methods but no luck.
In Delphi, to select the next or previous node in a `TTreeView`, you can navigate through the nodes using the `Selected` property to keep track of the currently selected node. The `GetPrev` and `GetNext` methods should work as long as you provide the correct `TTreeNode` instance. Here's how you can implement "Previous"...
14,922
[ { "from": "human", "value": "Im using delphi's ttreeview as an 'options' menu. how would i go upon selecting the next node at runtime like a previous and next button? i tried the getprev and getnext methods but no luck.\n" }, { "from": "gpt", "value": "In Delphi, to select the next or previous n...
One of my DBs have grown closer to permitted size. Inorder to find out the table containing the max data, i used the following query: exec sp_MSforeachtable @command1="print '?' exec sp_spaceused '?'" It returned the culprit table comprising the max data. As a next step, i want to cleanup the rows based on the size. F...
To clean up rows based on their size in a SQL Server database, you typically need to first identify the rows that take up the most space in the table. While SQL Server does not provide a built-in way to sort rows based on their actual size in storage, you can still achieve this by creating a query that approximates row...
12,246
[ { "from": "human", "value": "One of my DBs have grown closer to permitted size.\nInorder to find out the table containing the max data, i used the following query:\nexec sp_MSforeachtable @command1=\"print '?' exec sp_spaceused '?'\"\n\nIt returned the culprit table comprising the max data.\nAs a next step,...
I want to update a list of storage devices as the user inserts USB keys, adds external disks and mounts disk images. IOKit's IOServiceAddInterestNotification looks like the way to go, but the obvious use of registering general interest in kIOMediaClass only gives you notifications for unmounting of volumes and then onl...
To properly monitor USB device insertion, external disk addition, and disk image mounting on macOS, you can utilize IOKit and register for notifications on specific device classes and events. While `kIOMediaClass` allows you to monitor volumes, it is often better to use `kIOUSBDeviceClass` for USB devices and a combina...
15,239
[ { "from": "human", "value": "I want to update a list of storage devices as the user inserts USB keys, adds external disks and mounts disk images. IOKit's IOServiceAddInterestNotification looks like the way to go, but the obvious use of registering general interest in kIOMediaClass only gives you notificatio...
I learned to use "exists" instead of "in". BAD select * from table where nameid in ( select nameid from othertable where otherdesc = 'SomeDesc' ) GOOD select * from table t where exists ( select nameid from othertable o where t.nameid = o.nameid and otherdesc = 'SomeDesc' ) The explanation was: ...
Let's break down your questions one by one: ### 1. Difference Between `IN` and `EXISTS` The distinction you made between using `IN` and `EXISTS` is valid in many situations. The primary difference lies in how the two constructs are evaluated: - **`IN`**: The subquery runs first, and if it returns a list of values, t...
17,302
[ { "from": "human", "value": "I learned to use \"exists\" instead of \"in\".\nBAD\nselect * from table where nameid in ( \n select nameid from othertable where otherdesc = 'SomeDesc' )\n \n\nGOOD\nselect * from table t where exists ( \n select nameid from othertable o where t.nameid = o.nameid and ot...
So, one commonly heard comment when talking about performance is that you write your code with whatever language gets the job done fastest. If performance in specific areas is a problem, then rewrite those bits in C/C++. But, what if you're starting with a native C++ app? What options do you have if you want to write t...
Integrating a more accessible language with your native C++ application can streamline development and allow for faster prototyping and iteration. Here are several approaches you can take to facilitate this integration: ### 1. **Interfacing via API or DLL** You can expose your C++ functionality through a C-style API. ...
13,271
[ { "from": "human", "value": "So, one commonly heard comment when talking about performance is that you write your code with whatever language gets the job done fastest. If performance in specific areas is a problem, then rewrite those bits in C/C++.\nBut, what if you're starting with a native C++ app? What ...
I'm trying to create newspaper style columns using a block of text. I would like the text to be evenly spread out across 2 columns which could react to change of length in the text. Is this possible using just HTML/CSS, if not could javascript be used? Thanks
Yes, you can create newspaper-style columns using just HTML and CSS! CSS provides a property called `column-count` which allows you to easily divide a block of text into multiple columns. This approach is responsive to changes in the text length and will automatically adjust the column layout. Here’s a simple example ...
15,318
[ { "from": "human", "value": "I'm trying to create newspaper style columns using a block of text. I would like the text to be evenly spread out across 2 columns which could react to change of length in the text.\nIs this possible using just HTML/CSS, if not could javascript be used?\nThanks\n" }, { ...