instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I can understand that imposing a minimum length on passwords makes a lot of sense (to save users from themselves), but my bank has a requirement that passwords are between 6 and 8 characters long, and I started wondering... Wouldn't this just make it easier for brute force attacks? (Bad) Does this imply that my passwo...
Your concerns about a bank imposing a password length restriction of 6 to 8 characters are valid and highlight some of the complexities in password security practices. ### 1. **Minimum vs. Maximum Length:** - **Minimum Length**: Longer passwords are generally more secure because they take longer to crack using brute f...
12,477
[ { "from": "human", "value": "I can understand that imposing a minimum length on passwords makes a lot of sense (to save users from themselves), but my bank has a requirement that passwords are between 6 and 8 characters long, and I started wondering...\n\nWouldn't this just make it easier for brute force at...
I'm work on project with django framework and use control version system to synchronize my code with other peoples. But i don't know how organize work with database. In django, any people, worked on project, may changes django models, and tell 'syncdb' to synchronize model objects with db. But other people don't about...
Your English is perfectly fine, and it's great that you're using version control with Django! Managing database migrations in a team setting can indeed be tricky. Here are some best practices and approaches you can use to organize work with the database in Django while collaborating with others: ### 1. Use Django Migr...
18,113
[ { "from": "human", "value": "I'm work on project with django framework and use control version system to synchronize my code with other peoples. But i don't know how organize work with database.\nIn django, any people, worked on project, may changes django models, and tell 'syncdb' to synchronize model obje...
Suppose I have the following declaration: class Over1 { protected: class Under1 { }; }; I know that I could do the following: class Over2 : public Over1 { protected: class Under2 : public Under1 { }; }; But is there a way to declare Under2 without Over2? Since you woul...
In C++, nested classes have access to the enclosing class's members but can't be declared outside of that class unless you make them public. Since `Under1` is declared as a protected member of `Over1`, you will need to be in a derived class of `Over1` to create subclasses of `Under1`. However, if you want to define s...
18,038
[ { "from": "human", "value": "Suppose I have the following declaration:\nclass Over1\n{\n protected:\n class Under1\n {\n };\n};\n\nI know that I could do the following:\nclass Over2 : public Over1\n{\n protected:\n class Under2 : public Under1\n {\n };\n};\n\nBut is t...
I'm processing some data files that are supposed to be valid UTF-8 but aren't, which causes the parser (not under my control) to fail. I'd like to add a stage of pre-validating the data for UTF-8 well-formedness, but I've not yet found a utility to help do this. There's a web service at W3C which appears to be dead, an...
To pre-validate your data files for UTF-8 well-formedness and identify problematic lines or characters, you can use several approaches. Below are a couple of options, including a Ruby script and a Perl script that can help you with your task. ### Option 1: Ruby Script Here's a simple Ruby script that reads a file and...
15,699
[ { "from": "human", "value": "I'm processing some data files that are supposed to be valid UTF-8 but aren't, which causes the parser (not under my control) to fail. I'd like to add a stage of pre-validating the data for UTF-8 well-formedness, but I've not yet found a utility to help do this.\nThere's a web s...
I just want a simple tool that will help me quickly write scripts/packages that I can schedule to run. My transform requirements are pretty simple (changing column names, merging/splitting tables, and date conversions). I'll sacrifice flexibility for speed of development on this one. Any come to mind?
If you're looking for a tool that allows you to quickly write scripts for data transformations with a focus on speed and simplicity, here are a few options you might consider: 1. **Python with Pandas**: - **Pandas** is a powerful library for data manipulation and analysis. You can easily perform tasks like changing...
15,911
[ { "from": "human", "value": "I just want a simple tool that will help me quickly write scripts/packages that I can schedule to run. My transform requirements are pretty simple (changing column names, merging/splitting tables, and date conversions). I'll sacrifice flexibility for speed of development on this...
<flavor> I want to create a spelling test program for my grade schoolers that would let them enter and record their spelling words then test them on them through out the week.</flavor> What's a good Delphi API with which I could select a recording device, capture and save sound files, then play them back? I'm also toyi...
Creating a spelling test program that includes sound recording and playback is a great idea for engaging grade schoolers. Below are suggestions for APIs you can use for both Delphi and C#. ### Delphi API For Delphi, one commonly used library for audio capturing and playback is **BASS Audio Library**. BASS is a powerf...
15,797
[ { "from": "human", "value": "<flavor> I want to create a spelling test program for my grade schoolers that would let them enter and record their spelling words then test them on them through out the week.</flavor>\nWhat's a good Delphi API with which I could select a recording device, capture and save sound...
I really don't like the VS2008 Start Page. I don't need the RSS reader, Getting started or Headlines. The only thing useful is "Recent Projects" Is there a way to customize it or replace with a better one? It will be nice that the page contains Favorites Projects and Recent projects. P.S. I know that I can disabled it ...
If you find the Visual Studio 2008 Start Page cluttered and unhelpful, there are a few ways you can customize it or improve your workflow for better productivity, especially focusing on recent and favorite projects. Here are some options you can consider: ### 1. **Disable the Start Page** If you really don’t need the ...
15,985
[ { "from": "human", "value": "I really don't like the VS2008 Start Page. I don't need the RSS reader, Getting started or Headlines. The only thing useful is \"Recent Projects\"\nIs there a way to customize it or replace with a better one?\nIt will be nice that the page contains Favorites Projects and Recent ...
I have an array of hashes, and I want the unique values out of it. Calling Array.uniq doesn't give me what I expect. a = [{:a => 1},{:a => 2}, {:a => 1}] a.uniq # => [{:a => 1}, {:a => 2}, {:a => 1}] Where I expected: [{:a => 1}, {:a => 2}] In searching around on the net, I didn't come up with a solution that I was ...
To achieve uniqueness in an array of hashes without redefining the behavior of the `Hash` class globally, you can use `Enumerable#each_with_object` combined with a `Set` or use `Enumerable#inject` (also known as `reduce`). Here’s a clean and straightforward solution that doesn't require modifying the `Hash` class: ###...
18,467
[ { "from": "human", "value": "I have an array of hashes, and I want the unique values out of it. Calling Array.uniq doesn't give me what I expect.\na = [{:a => 1},{:a => 2}, {:a => 1}]\na.uniq # => [{:a => 1}, {:a => 2}, {:a => 1}]\n\nWhere I expected:\n[{:a => 1}, {:a => 2}]\n\nIn searching around on the n...
Application has an auxiliary thread. This thread is not meant to run all the time, but main process can call it very often. So, my question is, what is more optimal in terms of CPU performance: suspend thread when it is not being used or keep it alive and use WaitForSingleObject function in order to wait for a signal f...
In terms of CPU performance, keeping the auxiliary thread alive and using `WaitForSingleObject` to wait for a signal from the main process is generally more optimal than suspending and resuming the thread. Here’s why: 1. **Thread Suspension Overhead**: Suspending and resuming threads can introduce significant overhead...
18,294
[ { "from": "human", "value": "Application has an auxiliary thread. This thread is not meant to run all the time, but main process can call it very often.\nSo, my question is, what is more optimal in terms of CPU performance: suspend thread when it is not being used or keep it alive and use WaitForSingleObjec...
Is there a general rule of thumb to follow when storing web application data to know what database backend should be used? Is the number of hits per day, number of rows of data, or other metrics that I should consider when choosing? My initial idea is that the order for this would look something like the following (bu...
When choosing a database backend for a web application, there are several key factors and metrics to consider beyond just the number of hits per day or the number of rows of data. Here are some general guidelines and considerations that can help you make a more informed decision: ### 1. **Data Structure and Complexity...
13,459
[ { "from": "human", "value": "Is there a general rule of thumb to follow when storing web application data to know what database backend should be used? Is the number of hits per day, number of rows of data, or other metrics that I should consider when choosing?\nMy initial idea is that the order for this w...
Setting up an integration server, I’m in doubt about the best approach regarding using multiple tasks to complete the build. Is the best way to set all in just one big-job or make small dependent ones?
When setting up an integration server and deciding between a single large job versus multiple smaller, dependent tasks, there are several factors to consider. Here’s a breakdown of the pros and cons of each approach to help you determine the best way for your use case: ### Single Large Job **Pros:** 1. **Simplicity**...
10,109
[ { "from": "human", "value": "Setting up an integration server, I’m in doubt about the best approach regarding using multiple tasks to complete the build. Is the best way to set all in just one big-job or make small dependent ones?\n" }, { "from": "gpt", "value": "When setting up an integration s...
I'm considering building a framework for VB.NET, and using the My namespace to plug it into VB seems like a reasonable idea. What is "My" used for?
In VB.NET, the `My` namespace is a special feature that provides a simplified interface to access various system features and functionalities without needing to write complex code. It acts as a bridge between the VB.NET application and various components of the .NET Framework and Windows API, making it easier for devel...
19,367
[ { "from": "human", "value": "I'm considering building a framework for VB.NET, and using the My namespace to plug it into VB seems like a reasonable idea. What is \"My\" used for?\n" }, { "from": "gpt", "value": "In VB.NET, the `My` namespace is a special feature that provides a simplified interf...
Is it better to have a field in the database that stores the customers account balance or use views and queries to generate the information.
Whether to store a customer's account balance directly in the database or to compute it dynamically using views and queries depends on several factors, including performance, data integrity, and the specific use case of your application. Here are some considerations for both approaches: ### Storing the Account Balance...
17,742
[ { "from": "human", "value": "Is it better to have a field in the database that stores the customers account balance or use views and queries to generate the information.\n" }, { "from": "gpt", "value": "Whether to store a customer's account balance directly in the database or to compute it dynam...
Let me start with a specific example of what I'm trying to do. I have an array of year, month, day, hour, minute, second and millisecond components in the form [ 2008, 10, 8, 00, 16, 34, 254 ]. I'd like to instantiate a Date object using the following standard constructor: new Date(year, month, date [, hour, minute, se...
You are correct that the intrinsic JavaScript objects, such as `Date`, `Array`, and `RegExp`, have constructors that cannot be easily manipulated using `.apply()` or `.call()` in the way you attempted. However, you can achieve your goal of instantiating a `Date` object using an array of components without using `eval()...
19,068
[ { "from": "human", "value": "Let me start with a specific example of what I'm trying to do.\nI have an array of year, month, day, hour, minute, second and millisecond components in the form [ 2008, 10, 8, 00, 16, 34, 254 ]. I'd like to instantiate a Date object using the following standard constructor:\nnew...
I'm a big subversion fan and am just about to take over a big site (200mb approx.) I've trimmed down the main site from an original size of 500MB!! I'm about to check this site into a new subversion repository. The problem is, my subversion repository is remotely hosted so that another colleague can also work on the si...
Subversion (SVN) is designed to be efficient in terms of how it handles data. When you check out a repository, it downloads the latest revision of the files and folders you specify. However, here are a few key points to understand about how SVN handles updates: 1. **Checkouts**: When you perform a fresh checkout of a ...
19,618
[ { "from": "human", "value": "I'm a big subversion fan and am just about to take over a big site (200mb approx.) I've trimmed down the main site from an original size of 500MB!!\nI'm about to check this site into a new subversion repository. The problem is, my subversion repository is remotely hosted so that...
I have an existing Windows C++ application that links to ATL. I need to open an existing Excel file and access some properties. One of the things I need to do is determine if the user is currently viewing the Excel file. We can assume that the user has Excel installed, although not sure which version. What is the C++...
To interact with an existing instance of Excel from a C++ application using COM, you will need to utilize the Microsoft Excel Object Library. Below is an example of how you can achieve this using C++. This example does not require MFC or ATL, although you will need to use the appropriate COM library functions. ### Ste...
14,144
[ { "from": "human", "value": "I have an existing Windows C++ application that links to ATL. I need to open an existing Excel file and access some properties. One of the things I need to do is determine if the user is currently viewing the Excel file.\nWe can assume that the user has Excel installed, althou...
I'm trying to call a web service from Excel 2003 module. The way i've implemented it is creating a .NET COM library with all the classes/methods i need to be exposed. When i try to call a method that queries a web service from Excel the execution just stops on that line without any error. May be it has to do with refer...
When dealing with calling a web service from Excel 2003 using a .NET COM library, especially using `Microsoft.Web.Services2.dll`, there are several considerations and troubleshooting steps you can take to resolve the issue: ### 1. Check the COM Registration Ensure that your .NET assembly is properly registered as a CO...
16,229
[ { "from": "human", "value": "I'm trying to call a web service from Excel 2003 module.\nThe way i've implemented it is creating a .NET COM library with all the classes/methods i need to be exposed.\nWhen i try to call a method that queries a web service from Excel the execution just stops on that line withou...
Possible Duplicate: How do I serialize an enum value as an int? Hi, all! I'm wondering if there's a way to force the serialization of an enum value into its integer value, instead of its string representation. To put you into context: We're using, in a web application that heavily relies on web services, a single ba...
To serialize an enum value as its integer representation in C#, you can use the `XmlEnum` attribute along with the `XmlElement` attribute. However, if your goal is to serialize the enum directly to its underlying integer value without any string representation, you can achieve this by using a property that returns the ...
17,809
[ { "from": "human", "value": "\nPossible Duplicate:\nHow do I serialize an enum value as an int? \n\nHi, all!\nI'm wondering if there's a way to force the serialization of an enum value into its integer value, instead of its string representation.\nTo put you into context:\nWe're using, in a web application ...
I use a home-grown system where the application updates itself from a web service. However, I seem to remember something in the original .NET sales pitch about auto-updating of components being a built-in feature of .NET. What are the best practices for having an application update itself and/or the assemblies it use...
Auto-updating applications, especially those built using the .NET framework, can be achieved through various methodologies. While there isn't a built-in "auto-update" feature in the .NET framework itself, there are established best practices and libraries that can help facilitate this process effectively. Here are some...
15,375
[ { "from": "human", "value": "I use a home-grown system where the application updates itself from a web service. However, I seem to remember something in the original .NET sales pitch about auto-updating of components being a built-in feature of .NET. What are the best practices for having an application u...
We have a class library where we keep a lot of the stuff that we often use when doing sharepoint development. How would you go around deploying this? Right now our best bet is to have it in a separate solution, and deploy that so that the assembly is deployed to GAC. That way we ensure that the assembly is deployed to ...
Deploying a class library for SharePoint development can indeed be approached in several ways, depending on your requirements for versioning, maintainability, and ease of deployment. Here are a few strategies you could consider: ### 1. **GAC Deployment (Current Approach)** Your current method of deploying to the Glob...
13,755
[ { "from": "human", "value": "We have a class library where we keep a lot of the stuff that we often use when doing sharepoint development. How would you go around deploying this? Right now our best bet is to have it in a separate solution, and deploy that so that the assembly is deployed to GAC. That way we...
I am trying to do a Windows Forms application in an MVP style and - not having done much with threading before - am getting all confused. My UI is a set of very simple forms. Each of the forms implements an interface and contains a reference to a mediator class which lives in the Business Logic Layer and vice versa. S...
Your architecture using MVP (Model-View-Presenter) is a solid foundation for building a decoupled and testable application. However, threading in Windows Forms can indeed introduce complexities, especially when it comes to UI updates, since Windows Forms controls are not thread-safe. ### Answer to Your First Question ...
15,804
[ { "from": "human", "value": "I am trying to do a Windows Forms application in an MVP style and - not having done much with threading before - am getting all confused.\nMy UI is a set of very simple forms. Each of the forms implements an interface and contains a reference to a mediator class which lives in ...
I have a website (ASP.NET) and some winforms(.Net 2.0) for a project (written in C#). I use the webservice (IIS6) for task that both require like sending email inside the business. I think Webservice is nice but I would like from your experience what should and what should not be in a webservice?
When designing a web service, especially for a business application that interacts with various clients like ASP.NET and WinForms applications, it’s essential to focus on good practices for both functionality and maintainability. Here are some considerations on what should and should not be included in a web service: ...
16,371
[ { "from": "human", "value": "I have a website (ASP.NET) and some winforms(.Net 2.0) for a project (written in C#). I use the webservice (IIS6) for task that both require like sending email inside the business. \nI think Webservice is nice but I would like from your experience what should and what should not...
When I try to bind port 80 to a socket in c, i always get the error, that I don't have permission to use this port. is there an easy way to get this permission?
The issue you're encountering when trying to bind to port 80 is due to the fact that on most Unix-like operating systems, ports below 1024 are considered "privileged" ports. This means that only the root user (or processes with elevated permissions) can bind to them. Here are a few options to run your program that nee...
15,877
[ { "from": "human", "value": "When I try to bind port 80 to a socket in c, i always get the error, that I don't have permission to use this port. is there an easy way to get this permission?\n" }, { "from": "gpt", "value": "The issue you're encountering when trying to bind to port 80 is due to th...
Should a method that implements an interface method be annotated with @Override? The javadoc of the Override annotation says: Indicates that a method declaration is intended to override a method declaration in a superclass. If a method is annotated with this annotation type but does not override a superclass method, ...
In Java, interfaces are not considered superclasses in the traditional sense, but they do define a contract that classes can implement. When a class implements an interface, it is essentially agreeing to provide concrete implementations for the methods declared in that interface. The `@Override` annotation can indeed ...
20,633
[ { "from": "human", "value": "Should a method that implements an interface method be annotated with @Override?\nThe javadoc of the Override annotation says: \n\nIndicates that a method declaration is intended to override a method declaration in a superclass. If a method is annotated with this annotation type...
I recall there is a difference between some methods/properties called directly on the DataTable class, and the identically named methods/properties on the DataTable.Rows property. (Might have been the RowCount/Count property for which I read this.) The difference is one of them disregards DataRow.RowState, and the othe...
Yes, there is a significant difference between `DataTable.Clear` and `DataTable.Rows.Clear`, especially in the context of .NET 1.1. ### `DataTable.Clear` - **Behavior**: When you call `DataTable.Clear()`, it removes all rows from the `DataTable` and also resets any schema information (such as the constraints) that ma...
19,158
[ { "from": "human", "value": "I recall there is a difference between some methods/properties called directly on the DataTable class, and the identically named methods/properties on the DataTable.Rows property. (Might have been the RowCount/Count property for which I read this.) The difference is one of them ...
In my urls.py file, I have: from myapp import views ... (r'^categories/$', views.categories) Where categories is a view function inside myapp/views.py. No other URLconf lines reference views.categories. In a unit test file, I’m trying to grab this URL using django.core.urlresolvers.reverse(), instead of just copying '...
In Django, the `reverse()` function is primarily designed to look up URLs based on the name of the URL pattern rather than directly from the view function itself. That's why when you tried to reverse the URL using the view function `views.categories`, you encountered the `NoReverseMatch` error. The reason you're getti...
18,309
[ { "from": "human", "value": "In my urls.py file, I have:\nfrom myapp import views\n...\n(r'^categories/$', views.categories)\n\nWhere categories is a view function inside myapp/views.py. No other URLconf lines reference views.categories.\nIn a unit test file, I’m trying to grab this URL using django.core.ur...
Using MS SQL Server Management Studio 2005 - To Restore a Database: Restore Database (*) From Device: Click "..." Button Backup media: File Click "Add" Button Popup Window: "Locate Backup File" That window Defaults to C:\Program Files\Microsoft SQL Server\MSSQL.1\Backup How do I configure MS SQL Server Management ...
In SQL Server Management Studio (SSMS), the default path for backup files is often determined by the settings of your SQL Server instance. To change the default backup directory that SSMS looks in when you're restoring or backing up databases, you'll need to modify the SQL Server settings directly. Here’s how you can ...
16,336
[ { "from": "human", "value": "Using MS SQL Server Management Studio 2005 - To Restore a Database:\n\nRestore Database\n(*) From Device:\nClick \"...\" Button\nBackup media: File \nClick \"Add\" Button\nPopup Window: \"Locate Backup File\"\n\nThat window Defaults to C:\\Program Files\\Microsoft SQL Server\\...
I would like to write a plug-in that will allow a custom written CRM to read and write to their local Outlook client. I know that this poses a security concern. But, my clients are asking that their CRM "be connected" to Outlook. They would like to be able to do the following: A) When a contact sends them an email (...
Creating a plug-in to allow a custom CRM to interact with Microsoft Outlook can be quite challenging, especially considering the security and compatibility aspects. Here’s a structured approach to help you get started: ### Step 1: Understand the Environment 1. **Outlook Version**: Given your clients are primarily usi...
14,465
[ { "from": "human", "value": "I would like to write a plug-in that will allow a custom written CRM to read and write to their local Outlook client. I know that this poses a security concern. But, my clients are asking that their CRM \"be connected\" to Outlook. They would like to be able to do the followi...
What is this error? cannot find symbol, symbol: method getstring(java.lang.String) Location: class InternalFrameDemo if <!windowTitleField.getText().equals(getstring("InternalFrameDemo.frame_label")))
The error message you're seeing indicates that there is a problem with calling a method named `getstring` in your code. Specifically, the error message breaks down as follows: - **cannot find symbol**: The Java compiler cannot find a method or variable with the name you specified. - **symbol: method getstring(java.lan...
17,766
[ { "from": "human", "value": "What is this error? \ncannot find symbol, symbol: method getstring(java.lang.String) \nLocation: class InternalFrameDemo \nif <!windowTitleField.getText().equals(getstring(\"InternalFrameDemo.frame_label\")))\n\n" }, { "from": "gpt", "value": "The error message you'r...
I am developing an auto-builder that will run a series of steps in our build process and build our target application. We used to use a batch file which set up a bunch of environment variables or called tools that setup environment variables and ultimately runs a 'make'. I've been using the 'Process' class which works...
When you run external processes from a C# application using the `Process` class, each process has its own environment block. This means that any changes made to environment variables within one process do not persist into another process, as you've noticed. Unfortunately, there isn't a straightforward way to maintain t...
15,814
[ { "from": "human", "value": "I am developing an auto-builder that will run a series of steps in our build process and build our target application. We used to use a batch file which set up a bunch of environment variables or called tools that setup environment variables and ultimately runs a 'make'. \nI've ...
I have a form element that I want to address via javascript, but it doesn't like the syntax. <form name="mycache"> <input type="hidden" name="cache[m][2]"> <!-- ... --> </form> I want to be able to say: document.mycache.cache[m][2] but obviously I need to indicate that cache[m][2] is the whole name, and not an ar...
When dealing with form elements in JavaScript, especially when their names include special characters like brackets (`[]`), you cannot access them using the dot notation directly. Instead, you have to use the `elements` property of the form and refer to the input by its name as a string. Here’s how you can access the...
21,138
[ { "from": "human", "value": "I have a form element that I want to address via javascript, but it doesn't like the syntax.\n<form name=\"mycache\">\n <input type=\"hidden\" name=\"cache[m][2]\">\n <!-- ... -->\n</form>\n\nI want to be able to say:\ndocument.mycache.cache[m][2]\n\nbut obviously I need to in...
The source database is quite large. The target database doesn't grow automatically. They are on different machines. I'm coming from a MS SQL Server, MySQL background and IDS11 seems overly complex (I am sure, with good reason).
IBM Informix Dynamic Server (IDS) can indeed seem complex, especially if you're transitioning from more familiar environments like MS SQL Server and MySQL. Here are some points to consider when working with a large source database and a target database that doesn't automatically grow, especially in a cross-machine envi...
13,441
[ { "from": "human", "value": "The source database is quite large. The target database doesn't grow automatically. They are on different machines.\nI'm coming from a MS SQL Server, MySQL background and IDS11 seems overly complex (I am sure, with good reason).\n" }, { "from": "gpt", "value": "IBM I...
I am using the jQuery library to implement drag and drop. How do I get at the element that is being dragged when it is dropped? I want to get the id of the image inside the div. The following element is dragged: <div class="block"> <asp:Image ID="Image9" AlternateText="10/12/2008 - Retina" Width=81 Height=84 Image...
In jQuery UI's `droppable` widget, when you use the `drop` event, you can access the dragged item using the `ui` object, specifically through `ui.draggable`. Since you want to get the `id` of the image inside the dragged `div`, you will need to navigate to the `img` element from the `ui.draggable`. Here's how you can ...
20,207
[ { "from": "human", "value": "I am using the jQuery library to implement drag and drop. \nHow do I get at the element that is being dragged when it is dropped?\nI want to get the id of the image inside the div. The following element is dragged:\n<div class=\"block\">\n <asp:Image ID=\"Image9\" AlternateTe...
My .NET application fails when run from a network drive even when the very same executable runs perfectly fine from a local hard drive? I tried checking for "Full trust" like so: try { // Demand full trust permissions PermissionSet fullTrust = new PermissionSet( PermissionState.Unrestricted ); fullTrust.Dem...
When running a .NET application from a network drive, you may encounter security restrictions due to the .NET security model, especially with regards to code access security (CAS). By default, applications executed from network locations often run with more restricted permissions than those executed from local drives, ...
17,356
[ { "from": "human", "value": "My .NET application fails when run from a network drive even when the very same executable runs perfectly fine from a local hard drive?\nI tried checking for \"Full trust\" like so:\ntry\n{\n // Demand full trust permissions\n PermissionSet fullTrust = new PermissionSet( P...
In Linq to SQL it is possible to generate the database from the dbml file. Is it possible to generate a database from the Entity Data Model ? I wish to accomplish the same thing using the edmx file.
Yes, it is possible to generate a database from an Entity Data Model (EDM) using the .edmx file in Entity Framework. This process is commonly referred to as "database generation" or "database initialization." Here are the typical steps to accomplish this: ### Option 1: Using Entity Framework Migrations 1. **Enable Mi...
15,377
[ { "from": "human", "value": "In Linq to SQL it is possible to generate the database from the dbml file.\nIs it possible to generate a database from the Entity Data Model ? I wish to accomplish the same thing using the edmx file.\n" }, { "from": "gpt", "value": "Yes, it is possible to generate a...
I have read several places that the difference between c_str() and data() (in STL and other implementations) is that c_str() is always null terminated while data() is not. As far as I have seen in actual implementations, they either do the same or data() calls c_str(). What am I missing here? Which one is more correct ...
You are correct that there is a distinction between `c_str()` and `data()` in C++ Standard Library containers, particularly with `std::string`. 1. **Null Termination**: - `std::string::c_str()`: This function returns a pointer to a null-terminated character array representing the string's content. This is useful wh...
18,461
[ { "from": "human", "value": "I have read several places that the difference between c_str() and data() (in STL and other implementations) is that c_str() is always null terminated while data() is not.\nAs far as I have seen in actual implementations, they either do the same or data() calls c_str().\nWhat am...
I have some WCF methods that are used to transmit information from a server application to a website frontend for use in binding. I'm sending the result as an XElement that is a root of an XML tree containing the data I want to bind against. I'd like to create some tests that examine the data and ensure it comes acros...
Your approach of using XSD files to validate the XML returned by your WCF methods is indeed a good idea. It provides a clear contract for what the XML should look like and enables you to validate that your methods are producing the expected results. Here are some insights and steps you can follow to implement this appr...
14,710
[ { "from": "human", "value": "I have some WCF methods that are used to transmit information from a server application to a website frontend for use in binding. I'm sending the result as an XElement that is a root of an XML tree containing the data I want to bind against.\nI'd like to create some tests that ...
Are there any major differences in performance between http and https? I seem to recall reading that HTTPS can be a fifth as fast as HTTP. Is this valid with the current generation webservers/browsers? If so, are there any whitepapers to support it?
Historically, HTTPS (Hypertext Transfer Protocol Secure) was often considered slower than HTTP (Hypertext Transfer Protocol) due to the overhead of establishing a secure connection. This overhead includes the time taken for the SSL/TLS handshake, which involves encrypting and decrypting data, and additional computation...
17,555
[ { "from": "human", "value": "Are there any major differences in performance between http and https? I seem to recall reading that HTTPS can be a fifth as fast as HTTP. Is this valid with the current generation webservers/browsers? If so, are there any whitepapers to support it?\n" }, { "from": "g...
I have a webapp that uses JNDI lookups to get a connection to the database. The connection works fine and returns the query no problems. The issue us that the connection does not close properly and is stuck in the 'sleep' mode (according to mysql administrator). This means that they become unusable nad then I run out o...
It seems like you're dealing with an issue where database connections are not being closed properly, leading to exhausted connection pools. Here are a few pointers and best practices to help you manage your database connections more effectively: ### 1. **Ensure Prepared Statements are Closed** You're using a `Prepare...
5,953
[ { "from": "human", "value": "I have a webapp that uses JNDI lookups to get a connection to the database.\nThe connection works fine and returns the query no problems. The issue us that the connection does not close properly and is stuck in the 'sleep' mode (according to mysql administrator). This means that...
Our investigations have shown us that not all browsers respect the HTTP cache directives in a uniform manner. For security reasons we do not want certain pages in our application to be cached, ever, by the web browser. This must work for at least the following browsers: Internet Explorer 6+ Firefox 1.5+ Safari 3+ Oper...
To prevent web browsers from caching specific pages and to ensure that users cannot view cached pages after logging out, you can implement the following HTTP response headers. These headers are widely supported by modern browsers and should meet your requirements: 1. **Cache-Control**: This header controls the caching...
13,777
[ { "from": "human", "value": "Our investigations have shown us that not all browsers respect the HTTP cache directives in a uniform manner.\nFor security reasons we do not want certain pages in our application to be cached, ever, by the web browser. This must work for at least the following browsers:\n\nInte...
Could you please show me the C# Equivalent of this VB.NET code: Public Partial Class Index Inherits System.Web.Mvc.Viewpage(Of List(Of Task)) End Class I am not sure where/how to add it in for C#: public partial class DirList : System.Web.Mvc.ViewPage { } The code is suppose to tell the class to expect a list ...
In C#, you can achieve the equivalent of your VB.NET class by specifying the generic type in the `ViewPage` class declaration. In your case, you want the C# class to expect a `List<Task>`. Here's how you can do that: ### VB.NET Code ```vb.net Public Partial Class Index Inherits System.Web.Mvc.ViewPage(Of List(Of T...
17,107
[ { "from": "human", "value": "Could you please show me the C# Equivalent of this VB.NET code:\nPublic Partial Class Index\n Inherits System.Web.Mvc.Viewpage(Of List(Of Task))\n\n\nEnd Class\n\nI am not sure where/how to add it in for C#:\npublic partial class DirList : System.Web.Mvc.ViewPage\n{\n\n}\n\nT...
I am using Visual Studio 2005 with Team Foundation Server. When I right click a file under the source control and choose "compare" VS appears to freeze until I hit escape. My guess is that the window that is supposed to be popping up is somewhere I can't get to. I tried minimizing all the windows that I can and it is...
The issue you're experiencing with Visual Studio 2005 and Team Foundation Server (TFS) may be related to the IDE's handling of modal dialog boxes. Here are a few suggestions to help you troubleshoot and potentially resolve the problem: 1. **Check for Modal Dialogs:** - Sometimes, modal dialogs can appear off-screen...
15,534
[ { "from": "human", "value": "I am using Visual Studio 2005 with Team Foundation Server.\nWhen I right click a file under the source control and choose \"compare\" VS appears to freeze until I hit escape. My guess is that the window that is supposed to be popping up is somewhere I can't get to. I tried min...
What is the right place to store program data files which are the same for every user but have to be writeable for the program? What would be the equivalent location on MS Windows XP? I have read that C:\ProgramData is not writeable after installation by normal users. Is that true? How can I retrieve that directory pro...
In general, when dealing with program data files that are the same for every user and need to be writable by the program, there are different recommended locations depending on the operating system. ### For Windows: 1. **Windows Vista and Later**: - The recommended location for shared application data that needs t...
16,831
[ { "from": "human", "value": "What is the right place to store program data files which are the same for every user but have to be writeable for the program? What would be the equivalent location on MS Windows XP? I have read that C:\\ProgramData is not writeable after installation by normal users. Is that t...
Is it possible to reference a .NET Assembly from a SQL Server Stored procedure or function, or otherwise access the clr code from SQL Server? EDIT Whilst this solution will require to be somewhat generic, I am fairly confident expecting SQL 2005+
Yes, it is indeed possible to reference a .NET Assembly from a SQL Server stored procedure or function starting from SQL Server 2005. This feature is part of the SQL Server's support for CLR (Common Language Runtime) integration, which allows you to write stored procedures, functions, triggers, and user-defined types i...
17,151
[ { "from": "human", "value": "Is it possible to reference a .NET Assembly from a SQL Server Stored procedure or function, or otherwise access the clr code from SQL Server?\nEDIT Whilst this solution will require to be somewhat generic, I am fairly confident expecting SQL 2005+\n" }, { "from": "gpt",...
Using Ws2007HttpBinding and securing the service, the WSDL file generated shows in the policy section that all the ws-addressing headers and the body will be signed, and that the body will be encrypted. <sp:SignedParts> <sp:Body /> <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" /> <sp:Hea...
When using `Ws2007HttpBinding` in a WCF (Windows Communication Foundation) service, the security policies (such as which headers to sign and encrypt) are usually determined by the binding configuration. Unfortunately, WCF does not provide a straightforward way to selectively sign or encrypt specific WS-Addressing heade...
17,534
[ { "from": "human", "value": "Using Ws2007HttpBinding and securing the service, the WSDL file generated shows in the policy section that all the ws-addressing headers and the body will be signed, and that the body will be encrypted.\n<sp:SignedParts>\n <sp:Body /> \n <sp:Header Name=\"To\" Namespace=\"http...
I've recently acquired a second monitor and now run VS2008 SP1 maximized on my secondary (and bigger) monitor. This theoretically has the benefit of opening the application under development on the primary monitor, where -- as it seems to me -- all newly started applications go. So far, so good. The problem though is n...
It sounds like you are experiencing a known issue related to multiple monitor setups with Visual Studio 2008, particularly with the Exception Helper dialog. Here are some steps and workarounds that you can try to alleviate the issue: ### 1. Change Primary Monitor Settings Sometimes the behavior of dialogs can be influ...
18,264
[ { "from": "human", "value": "I've recently acquired a second monitor and now run VS2008 SP1 maximized on my secondary (and bigger) monitor. This theoretically has the benefit of opening the application under development on the primary monitor, where -- as it seems to me -- all newly started applications go....
I keep hearing this term tossed around in several different contexts. What is it?
It seems like you may be referring to a specific term, but you didn't mention what it is. If you could clarify the term you're asking about, I would be more than happy to provide you with information regarding its meaning and the contexts in which it is used!
23,145
[ { "from": "human", "value": "I keep hearing this term tossed around in several different contexts. What is it?\n" }, { "from": "gpt", "value": "It seems like you may be referring to a specific term, but you didn't mention what it is. If you could clarify the term you're asking about, I would be ...
I have a webapp that I am in the middle of doing some load/performance testing on, particularily on a feature where we expect a few hundred users to be accessing the same page and hitting refresh about every 10 seconds on this page. One area of improvement that we found we could make with this function was to cache the...
Your issue with concurrent access to the cache arises from how you are synchronizing on the cache key, which is a `String` object. Strings in Java are interned, meaning that the same string value will point to the same object in memory if it has been created previously. This behavior is why you see multiple threads ent...
15,011
[ { "from": "human", "value": "I have a webapp that I am in the middle of doing some load/performance testing on, particularily on a feature where we expect a few hundred users to be accessing the same page and hitting refresh about every 10 seconds on this page. One area of improvement that we found we could...
How do I go about the [HandleError] filter in asp.net MVC Preview 5? I set the customErrors in my Web.config file <customErrors mode="On" defaultRedirect="Error.aspx"> <error statusCode="403" redirect="NoAccess.htm"/> <error statusCode="404" redirect="FileNotFound.htm"/> </customErrors> and put [HandleError] above...
In ASP.NET MVC Preview 5, you were on the right track by using the `[HandleError]` attribute and configuring custom error pages in your `Web.config`. However, since you are facing issues with error handling after migrating from Preview 3 to Preview 5, there are a few things you can check and possibly adjust to ensure t...
16,419
[ { "from": "human", "value": "How do I go about the [HandleError] filter in asp.net MVC Preview 5?\nI set the customErrors in my Web.config file\n<customErrors mode=\"On\" defaultRedirect=\"Error.aspx\">\n <error statusCode=\"403\" redirect=\"NoAccess.htm\"/>\n <error statusCode=\"404\" redirect=\"FileNotF...
I fear this is probably a bit of a dummy question, but it has me pretty stumped. I'm looking for the simplest way possible to pass a method of an object into a procedure, so that the procedure can call the object's method (e.g. after a timeout, or maybe in a different thread). So basically I want to: Capture a refere...
Your question is quite valid, and it touches on a common challenge when working with methods of object instances in Delphi (or similar Pascal-based languages). You're trying to pass a method of an instance to a procedure, which is indeed possible, but you need to correctly reference the method and its context. In Delp...
17,289
[ { "from": "human", "value": "I fear this is probably a bit of a dummy question, but it has me pretty stumped.\nI'm looking for the simplest way possible to pass a method of an object into a procedure, so that the procedure can call the object's method (e.g. after a timeout, or maybe in a different thread). ...
Is there a way in Visual Studio (a hotkey) to automatically import a type (or choosing between known namespaces) like the Ctrl + O in Eclipse?
In Visual Studio, there isn’t an exact equivalent to Eclipse's `Ctrl + O` for auto-importing types directly, but there are similar functionalities available that can help streamline the process of importing namespaces. 1. **IntelliSense and Quick Actions**: When you type a class or type that isn’t recognized (e.g., it...
20,231
[ { "from": "human", "value": "Is there a way in Visual Studio (a hotkey) to automatically import a type (or choosing between known namespaces) like the Ctrl + O in Eclipse?\n" }, { "from": "gpt", "value": "In Visual Studio, there isn’t an exact equivalent to Eclipse's `Ctrl + O` for auto-importin...
In my vb.net program, I am using a webbrowser to show the user an HTML preview. I was previously hitting a server to grab the HTML, then returning on an asynchronous thread and raising an event to populate the WebBrowser.DocumentText with the HTML string I was returning. Now I set it up to grab all of the information ...
When working with the `WebBrowser` control in VB.NET, setting `DocumentText` to a string should update the displayed content. If you're seeing the `DocumentText` remain as `"<HTML></HTML>"`, here are several potential reasons and suggestions to resolve the issue: 1. **Threading Issues**: The `WebBrowser` control has t...
15,574
[ { "from": "human", "value": "In my vb.net program, I am using a webbrowser to show the user an HTML preview. I was previously hitting a server to grab the HTML, then returning on an asynchronous thread and raising an event to populate the WebBrowser.DocumentText with the HTML string I was returning.\nNow I...
I'm currently working with PHPUnit to try and develop tests alongside what I'm writing, however, I'm currently working on writing the Session Manager, and am having issues doing so... The constructor for the Session handling class is private function __construct() { if (!headers_sent()) { session_start(...
You're encountering an issue because PHPUnit sends output to the browser (like the headers) before your session management class's constructor can execute `session_start()`. This is a common issue when dealing with session management in a testing environment where headers have already been sent. Here are some approach...
17,447
[ { "from": "human", "value": "I'm currently working with PHPUnit to try and develop tests alongside what I'm writing, however, I'm currently working on writing the Session Manager, and am having issues doing so...\nThe constructor for the Session handling class is\nprivate function __construct()\n{\n if (...
When running one of our software, a tester was faced with the data execution prevention dialog of Windows. We try to reproduce this situation on a developer computer for debugging purposes : with no success. Does anyone know how to find what may cause the DEP protection to kill the application? Is there any existing to...
Data Execution Prevention (DEP) is a security feature in Windows that helps prevent damage from viruses and other security threats by monitoring your programs and ensuring that they use system memory safely. If a program tries to execute code from a memory location that is marked as non-executable, Windows will termina...
15,498
[ { "from": "human", "value": "When running one of our software, a tester was faced with the data execution prevention dialog of Windows.\nWe try to reproduce this situation on a developer computer for debugging purposes : with no success.\nDoes anyone know how to find what may cause the DEP protection to kil...
I'm setting up a number sites right now and many of them have multiple domains. The question is: do I alias the domain (with ServerAlias) or do I Redirect the request? Obviously ServerAlias is better/easier from a readability or scripting perspective. I have heard however that Google likes it better if everything re...
When setting up multiple domains for a website, it is generally considered best practice to redirect all alternative domains to a single primary domain. This approach not only helps to avoid potential duplicate content issues in the eyes of search engines but also consolidates your SEO efforts, ensuring that all inboun...
16,174
[ { "from": "human", "value": "I'm setting up a number sites right now and many of them have multiple domains. The question is: do I alias the domain (with ServerAlias) or do I Redirect the request? \nObviously ServerAlias is better/easier from a readability or scripting perspective. I have heard however th...
Or would a conventional client-server VCS be more appropriate? I'm currently using TortoiseSVN, but I'm interested in a DVCS, but I'm not sure if it's even a good idea to try to use something like that solo.
Choosing between a conventional client-server Version Control System (VCS) like SVN (Subversion) and a Distributed Version Control System (DVCS) like Git depends on your specific needs, work style, and future plans. ### Benefits of Using a DVCS (like Git): 1. **Local Repositories**: In a DVCS, you have a complete cop...
18,603
[ { "from": "human", "value": "Or would a conventional client-server VCS be more appropriate? I'm currently using TortoiseSVN, but I'm interested in a DVCS, but I'm not sure if it's even a good idea to try to use something like that solo.\n" }, { "from": "gpt", "value": "Choosing between a convent...
I want to combine these: keys = ['name', 'age', 'food'] values = ['Monty', 42, 'spam'] into a single dictionary: {'name': 'Monty', 'age': 42, 'food': 'spam'} How can I do this?
You can combine the two lists into a dictionary using the `zip()` function along with the `dict()` constructor in Python. Here's how you can do it: ```python keys = ['name', 'age', 'food'] values = ['Monty', 42, 'spam'] # Combine keys and values into a dictionary result = dict(zip(keys, values)) print(result) ``` T...
22,018
[ { "from": "human", "value": "I want to combine these:\nkeys = ['name', 'age', 'food']\nvalues = ['Monty', 42, 'spam']\n\ninto a single dictionary:\n{'name': 'Monty', 'age': 42, 'food': 'spam'}\n\nHow can I do this?\n" }, { "from": "gpt", "value": "You can combine the two lists into a dictionary ...
Seeing as Java doesn't have nullable types, nor does it have a TryParse(), how do you handle input validation without throwing an exceptions? The usual way: String userdata = /*value from gui*/ int val; try { val = Integer.parseInt(userdata); } catch (NumberFormatException nfe) { // bad data - set to sentinel ...
In Java, since there are no built-in nullable types and exceptions are not intended for control flow, you can adopt a couple of strategies for input validation without throwing exceptions. Here are some common approaches: ### 1. Using a Helper Method You can create a helper method that attempts to parse the input and...
15,723
[ { "from": "human", "value": "Seeing as Java doesn't have nullable types, nor does it have a TryParse(),\nhow do you handle input validation without throwing an exceptions?\nThe usual way:\nString userdata = /*value from gui*/\nint val;\ntry\n{\n val = Integer.parseInt(userdata);\n}\ncatch (NumberFormatExc...
Trying to understand an fft (Fast Fourier Transform) routine I'm using (stealing)(recycling) Input is an array of 512 data points which are a sample waveform. Test data is generated into this array. fft transforms this array into frequency domain. Trying to understand relationship between freq, period, sample rate and...
To relate the index of the peak in the FFT array to the frequency, we can use some fundamental concepts of sampling, the Nyquist theorem, and the FFT itself. ### Key Concepts: 1. **Sampling Rate (\( f_s \))**: This is the rate at which your signal is sampled. It is measured in samples per second (Hz). 2. **Number of...
12,059
[ { "from": "human", "value": "Trying to understand an fft (Fast Fourier Transform) routine I'm using (stealing)(recycling)\nInput is an array of 512 data points which are a sample waveform. \nTest data is generated into this array. fft transforms this array into frequency domain.\nTrying to understand relati...
I am developing a collection of plugins on Eclipse 3.4 (official) on both mac and a PC. At present (I'm aware it is not the best practice) some of my common plugins export all of their packages. The problem is this: many of the listed packages are empty because subpackages are not, for example: prefix.core may be empt...
The issue you’re experiencing with your Eclipse plugins and package exports likely stems from how Eclipse resolves and detects packages in your Java environment across different platforms. Here are some potential causes and solutions: 1. **Build Configurations**: Ensure that your Eclipse projects are configured the sa...
14,277
[ { "from": "human", "value": "I am developing a collection of plugins on Eclipse 3.4 (official) on both mac and a PC.\nAt present (I'm aware it is not the best practice) some of my common plugins export all of their packages. \nThe problem is this: many of the listed packages are empty because subpackages ar...
I have PHP configured so that magic quotes are on and register globals are off. I do my best to always call htmlentities() for anything I am outputing that is derived from user input. I also occasionally seach my database for common things used in xss attached such as... <script What else should I be doing and how can...
It's great that you're already taking steps to secure your PHP application against XSS (Cross-Site Scripting) attacks by using `htmlentities()` and being mindful of user input. Here are some additional strategies and best practices to enhance the security of your application: ### 1. **Use Prepared Statements** When in...
16,593
[ { "from": "human", "value": "I have PHP configured so that magic quotes are on and register globals are off.\nI do my best to always call htmlentities() for anything I am outputing that is derived from user input.\nI also occasionally seach my database for common things used in xss attached such as...\n<scr...
I use emacs for viewing and editing code and other text files. I wanted to know if there is a way to search forward or backward for text which is marked in the current buffer. Similar to what I can do in notepad or wordpad. As in can I mark some text in the buffer and do a C-s or C-r and be able to search with the mark...
Yes, you can achieve similar functionality in Emacs by using a feature called `marking` combined with `isearch`. Here’s how you can do it: 1. **Mark the Text**: First, you need to mark the text you want to search for. You can do this by placing the cursor at the beginning of the text you want to mark, pressing `C-SPC`...
19,373
[ { "from": "human", "value": "I use emacs for viewing and editing code and other text files. I wanted to know if there is a way to search forward or backward for text which is marked in the current buffer. Similar to what I can do in notepad or wordpad. As in can I mark some text in the buffer and do a C-s o...
FYI: I am running on dotnet 3.5 SP1 I am trying to retrieve the value of an identity column into my dataset after performing an update (using a SqlDataAdapter and SqlCommandBuilder). After performing SqlDataAdapter.Update(myDataset), I want to be able to read the auto-assigned value of myDataset.tables(0).Rows(0)("ID")...
To retrieve the value of an identity column after performing an update in a `DataSet` using `SqlDataAdapter` and `SqlCommandBuilder` in .NET 3.5 SP1, you can indeed modify the `InsertCommand` of the `SqlDataAdapter` to include a `SELECT` statement that retrieves the identity value. However, you need to ensure that you ...
16,322
[ { "from": "human", "value": "FYI: I am running on dotnet 3.5 SP1\nI am trying to retrieve the value of an identity column into my dataset after performing an update (using a SqlDataAdapter and SqlCommandBuilder).\nAfter performing SqlDataAdapter.Update(myDataset), I want to be able to read the auto-assigned...
I'm currently planning out a project involving creating a shell replacement for Windows (based on Blackbox, bblean specifically). However I wish to leverage the power of .NET to do so. Many of the API calls I'll need are housed within the User32 library. I can of course use P/Invoke and create a static class to hand...
The .NET Framework does provide a range of functionality for managing processes, windows, and other system-level interactions through various namespaces, but certain low-level Windows API functionalities, especially those related to window management (like `SetForegroundWindow`), are not directly exposed in the framewo...
14,813
[ { "from": "human", "value": "I'm currently planning out a project involving creating a shell replacement for Windows (based on Blackbox, bblean specifically). However I wish to leverage the power of .NET to do so. Many of the API calls I'll need are housed within the User32 library. I can of course use P...
I was looking into the possibility of using CouchDB. I heard that it was similar to Lotus Notes which everyone loves to hate. Is this true?
CouchDB and Lotus Notes do share some similarities, particularly in their approach to data management and the way they handle document-based storage. Here are some key points of comparison: 1. **Document-Oriented Database**: Both CouchDB and Lotus Notes utilize a document-oriented approach to data storage. In CouchDB,...
15,613
[ { "from": "human", "value": "I was looking into the possibility of using CouchDB. I heard that it was similar to Lotus Notes which everyone loves to hate. Is this true?\n" }, { "from": "gpt", "value": "CouchDB and Lotus Notes do share some similarities, particularly in their approach to data ...
I have some C# code in an ASP.Net application that does this: Bitmap bmp = new Bitmap(1184, 1900); And occasionally it throws an exception "Parameter is not valid". Now i've been googling around and apparently GDI+ is infamous for throwing random exceptions, and lots of people have had this problem, but nobody has a so...
The "Parameter is not valid" exception from GDI+ can indeed be quite frustrating, and as you mentioned, it is often thrown for reasons that aren't immediately clear. Here are several steps and suggestions you can take to diagnose and potentially fix the issue: ### 1. **Check Graphics Initialization:** Ensure that GDI+...
14,886
[ { "from": "human", "value": "I have some C# code in an ASP.Net application that does this:\nBitmap bmp = new Bitmap(1184, 1900);\nAnd occasionally it throws an exception \"Parameter is not valid\". Now i've been googling around and apparently GDI+ is infamous for throwing random exceptions, and lots of peop...
I'm working on a drop in assembly that has predefined pages and usable controls. I am having no difficulties with creating server controls, but I'm wondering what the "best practices" are with dealing with pages in an assembly. Can you compile a page into an assembly and release it as just a dll? How would this be a...
When working with ASP.NET and building a web application with server controls and pages contained within a class library (DLL), there are several best practices and considerations to keep in mind, especially when it comes to deploying and accessing pages. ### Compiling Pages into an Assembly 1. **Web User Controls or...
11,023
[ { "from": "human", "value": "I'm working on a drop in assembly that has predefined pages and usable controls. I am having no difficulties with creating server controls, but I'm wondering what the \"best practices\" are with dealing with pages in an assembly. Can you compile a page into an assembly and rel...
Now I have seen this question in another forum but it didn't had an acceptable answer. Suppose I have two tables, the Groups table and the Elements table. The tables have no defined relationships. The Elements table has an IdGroup field that refers to the IdGroup (PK) field of the Groups table. I use the following quer...
In ADO, the behavior you’re experiencing is due to the way that it handles records in a joined dataset. When you use the `Delete` method on an ADO Recordset that contains joined tables, it can lead to unexpected deletions if not handled carefully. This is because ADO does not inherently differentiate between records in...
15,692
[ { "from": "human", "value": "Now I have seen this question in another forum but it didn't had an acceptable answer.\nSuppose I have two tables, the Groups table and the Elements table. The tables have no defined relationships. The Elements table has an IdGroup field that refers to the IdGroup (PK) field of ...
I recently read this Phil Haack post (The Most Useful .NET Utility Classes Developers Tend To Reinvent Rather Than Reuse) from last year, and thought I'd see if anyone has any additions to the list.
Phil Haack's post highlights several utility classes in .NET that are often reinvented by developers instead of utilizing the existing libraries. If you're looking for additions to that list, here are some commonly used utility classes and methods that developers frequently recreate: 1. **String Extensions**: Many dev...
17,803
[ { "from": "human", "value": "I recently read this Phil Haack post (The Most Useful .NET Utility Classes Developers Tend To Reinvent Rather Than Reuse) from last year, and thought I'd see if anyone has any additions to the list.\n" }, { "from": "gpt", "value": "Phil Haack's post highlights severa...
I am in a project where we are starting refactoring some massive code base. One problem that immediately sprang up is that each file imports a lot of other files. How do I in an elegant way mock this in my unit test without having to alter the actual code so I can start to write unit-tests? As an example: The file with...
It sounds like you've made great progress in tackling the challenges of unit testing within a complex codebase. Here are some general strategies and tips for effectively managing your imports and writing unit tests, especially when dealing with a massive code base with numerous dependencies. ### 1. Use Mocking Librari...
17,735
[ { "from": "human", "value": "I am in a project where we are starting refactoring some massive code base. One problem that immediately sprang up is that each file imports a lot of other files. How do I in an elegant way mock this in my unit test without having to alter the actual code so I can start to write...
I search an implementation of a network (or distributed) file system like NFS in Java. The goal is to extend it and do some research stuff with it. On the web I found some implementation e.g. DJ NFS, but the open question is how mature and fast they are. Can anyone purpose a good starting point, has anyone experience w...
If you're looking for a network or distributed file system implementation in Java to extend and modify, there are a few projects you might consider. Based on your requirements, here are some recommendations: 1. **DJ NFS**: - DJ NFS is a Java implementation of the NFS protocol. It's designed to provide a simple, str...
16,784
[ { "from": "human", "value": "I search an implementation of a network (or distributed) file system like NFS in Java. The goal is to extend it and do some research stuff with it. On the web I found some implementation e.g. DJ NFS, but the open question is how mature and fast they are.\nCan anyone purpose a go...
I have a desktop application written in C#. It is trying to manage a socket connection and fails. The same application is successful if it is attached to the Visual Studio debugger. How can it be debugged?
Debugging a desktop application that behaves differently when running under the Visual Studio debugger can be a challenge, especially with socket connections. Here are some steps you can take to identify and resolve the issue: ### 1. **Use Debug Output** Add logging statements in your code, especially around the areas...
14,353
[ { "from": "human", "value": "I have a desktop application written in C#. It is trying to manage a socket connection and fails. The same application is successful if it is attached to the Visual Studio debugger. \nHow can it be debugged?\n" }, { "from": "gpt", "value": "Debugging a desktop applic...
What is the easiest way to encode a PHP string for output to a JavaScript variable? I have a PHP string which includes quotes and newlines. I need the contents of this string to be put into a JavaScript variable. Normally, I would just construct my JavaScript in a PHP file, à la: <script> var myvar = "<?php echo $my...
When you need to safely pass a PHP string that may contain quotes, newlines, or other special characters into a JavaScript variable, you need to ensure that the string is properly escaped so that it doesn't break your JavaScript code. A robust way to do this is to use the `json_encode` function in PHP, which correctly...
19,298
[ { "from": "human", "value": "What is the easiest way to encode a PHP string for output to a JavaScript variable?\nI have a PHP string which includes quotes and newlines. I need the contents of this string to be put into a JavaScript variable.\nNormally, I would just construct my JavaScript in a PHP file, à...
In IE when I insert text into a <pre> tag the newlines are ignored: <pre id="putItHere"></pre> <script> function putText() { document.getElementById("putItHere").innerHTML = "first line\nsecond line"; } </script> Using \r\n instead of a plain \n does not work. <br/> does work but inserts an extra blank line in FF...
When dealing with `<pre>` tags in HTML, it's important to note that they maintain white space and line breaks. However, when you use JavaScript to set the `innerHTML` property, the newline characters (`\n`) in the string do not translate to visible line breaks in HTML. If you want to preserve the line breaks while usi...
19,101
[ { "from": "human", "value": "In IE when I insert text into a <pre> tag the newlines are ignored:\n<pre id=\"putItHere\"></pre>\n\n<script>\nfunction putText() {\n document.getElementById(\"putItHere\").innerHTML = \"first line\\nsecond line\";\n}\n</script>\n\nUsing \\r\\n instead of a plain \\n does not ...
Is there any way (in Java Servlet) to determine whether a HTTP POST or GET request is a result from a submission from a HTML form or otherwise?
In a Java Servlet, there is no direct way to unequivocally determine if a HTTP POST or GET request originated from an HTML form submission versus another source (such as an API client or a direct URL entry). However, there are a few approaches you can use to make educated guesses based on typical characteristics of for...
16,830
[ { "from": "human", "value": "Is there any way (in Java Servlet) to determine whether a HTTP POST or GET request is a result from a submission from a HTML form or otherwise?\n" }, { "from": "gpt", "value": "In a Java Servlet, there is no direct way to unequivocally determine if a HTTP POST or GET...
Coming from a Classic ASP background, I'm used to multiple forms on a page, but this clearly limited in a ASP.NET page. However, I have a situation where I have a form that gathers input from the user, saves the data to a DB, and afterwards I want to render (and tweak the values of) a special form that posts to the Pay...
You're right in thinking that working with multiple forms on a single ASP.NET page is not straightforward due to the way ASP.NET manages postbacks and view state. However, you have a few good options to accomplish your goal of processing a user input form and then dynamically rendering a PayPal form based on the input....
10,969
[ { "from": "human", "value": "Coming from a Classic ASP background, I'm used to multiple forms on a page, but this clearly limited in a ASP.NET page.\nHowever, I have a situation where I have a form that gathers input from the user, saves the data to a DB, and afterwards I want to render (and tweak the value...
I've got a c# application that plays simple wav files through directsound. With the test data I had, the code worked fine. However when I used real-world data, it produced a very unhelpful error on creation of the secondary buffer: "ArgumentException: Value does not fall within the expected range." The test wavs had ...
It sounds like you're encountering issues with WAV file compatibility, particularly due to differences in bit depth, sample rate, and potentially extra chunks (like the "bext" chunk). DirectSound requires that the audio format is compatible with what it can handle when creating a `SecondaryBuffer`. Here's how you can a...
9,762
[ { "from": "human", "value": "I've got a c# application that plays simple wav files through directsound. With the test data I had, the code worked fine. However when I used real-world data, it produced a very unhelpful error on creation of the secondary buffer: \"ArgumentException: Value does not fall with...
When logging with Log4Net it's very easy to put class that called the log into the log file. I've found in the past that this makes it very easy to trace through the code and see the flow through the classes. In Log4Net I use the %logger property in the conversion pattern like so: <conversionPattern value="%date [%t...
In the Enterprise Library Logging Application Block (EHLAB), the approach to capture the calling class for logging purposes is a bit different than with Log4Net. The Logging Application Block does not directly provide a simple `%logger` equivalent to capture the class name. However, you can still achieve this using a c...
16,567
[ { "from": "human", "value": "When logging with Log4Net it's very easy to put class that called the log into the log file. I've found in the past that this makes it very easy to trace through the code and see the flow through the classes. In Log4Net I use the %logger property in the conversion pattern like...
How can I horizontally center a <div> within another <div> using CSS? <div id="outer"> <div id="inner">Foo foo</div> </div>
To horizontally center a `<div>` within another `<div>` using CSS, you can use several methods. Here are a few common approaches: ### Method 1: Using Flexbox Flexbox is a modern and powerful layout system in CSS that makes centering elements easy. ```html <div id="outer"> <div id="inner">Foo foo</div> </div> ``` `...
11,129
[ { "from": "human", "value": "How can I horizontally center a <div> within another <div> using CSS?\n<div id=\"outer\">\n <div id=\"inner\">Foo foo</div>\n</div>\n\n" }, { "from": "gpt", "value": "To horizontally center a `<div>` within another `<div>` using CSS, you can use several methods. Her...
I'm trying to send messages to Objective-C objects in gdb. (gdb) p $esi $2 = (void *) 0x1268160 (gdb) po $esi <NSArray: 0x1359c0> (gdb) po [$esi count] Target does not respond to this message selector. I can't send any message to it. Am I missing something? Do I really need the symbols, or something else?
In GDB (GNU Debugger), when working with Objective-C objects, you need to ensure that GDB is properly set up to handle Objective-C messages. The error message "Target does not respond to this message selector" indicates that GDB is unable to interpret the Objective-C syntax you're using with `po [$esi count]`. This typ...
17,596
[ { "from": "human", "value": "I'm trying to send messages to Objective-C objects in gdb.\n(gdb) p $esi\n$2 = (void *) 0x1268160\n(gdb) po $esi\n<NSArray: 0x1359c0>\n(gdb) po [$esi count]\nTarget does not respond to this message selector.\n\nI can't send any message to it. Am I missing something? Do I really ...
I am making extensive use of boost:shared_ptr in my code. In fact, most of the objects that are allocated on the heap are held by a shared_ptr. Unfortunately this means that I can't pass this into any function that takes a shared_ptr. Consider this code: void bar(boost::shared_ptr<Foo> pFoo) { ... } void Foo::some...
The issue you're encountering is a common one when using `boost::shared_ptr` (or `std::shared_ptr`, if you're using C++11 or later) with objects that are already managed by a shared pointer. You are correct that you cannot pass `this` directly to a function that expects a `shared_ptr`, as it would either not compile or...
18,697
[ { "from": "human", "value": "I am making extensive use of boost:shared_ptr in my code. In fact, most of the objects that are allocated on the heap are held by a shared_ptr. Unfortunately this means that I can't pass this into any function that takes a shared_ptr. Consider this code:\nvoid bar(boost::shared_...
I've had nothing but good luck from SO, so why not try again? I have an application that needs to show a different image based on the season of the year (spring, summer, winter, fall). I have very specific start and end dates for these seasons. What I would like from you geniuses is a method called GetSeason that tak...
Certainly! Below is a simple implementation of the `GetSeason` method in Java that determines the season based on the specified date ranges you provided. ```java import java.time.LocalDate; import java.time.Month; public class SeasonFinder { public static String GetSeason(LocalDate date) { // Check for S...
17,983
[ { "from": "human", "value": "I've had nothing but good luck from SO, so why not try again?\nI have an application that needs to show a different image based on the season of the year (spring, summer, winter, fall). I have very specific start and end dates for these seasons.\nWhat I would like from you gen...
Well, it seems simple enough, but I can't find a way to add a caption to an equation. The caption is needed to explain the variables used in the equation, so some kind of table-like structure to keep it all aligned and pretty would be great.
To add a caption to an equation in LaTeX while maintaining a neat and aligned structure, you can use the `align` environment to display the equation and the `array` or `tabular` environment to create a table-like structure for the variables' explanations. Below is a general example of how you can achieve this. ```late...
18,823
[ { "from": "human", "value": "Well, it seems simple enough, but I can't find a way to add a caption to an equation.\nThe caption is needed to explain the variables used in the equation, so some kind of table-like structure to keep it all aligned and pretty would be great.\n" }, { "from": "gpt", "...
Is Oracle Application Express suitable for Intranet client/server application? If so, what should I do to enable client access to application? Well, I am working as a PowerBuilder/Oracle developer, so I am familiar with client/server architecture. I have recently read an article about APEX so I would like to develop A...
Oracle Application Express (APEX) is indeed suitable for developing Intranet client/server applications. APEX is a web-based development environment that allows you to create applications that run on Oracle databases. It is designed to be flexible, and applications built with APEX can be deployed in an intranet or inte...
15,457
[ { "from": "human", "value": "Is Oracle Application Express suitable for Intranet client/server application?\nIf so, what should I do to enable client access to application?\n\nWell, I am working as a PowerBuilder/Oracle developer, so I am familiar with client/server architecture. I have recently read an art...
It seems that DrawFrameControl() creates Font and Brush objects, select them into dc, and doesn't delete them. (according to BoundsChecker messages). Does anyone faced such thing?
Yes, it is generally considered a bad practice in Windows programming to create GDI (Graphics Device Interface) objects like fonts and brushes without properly managing their lifecycle. If `DrawFrameControl()` creates these objects and does not delete them afterwards, it could lead to resource leaks, which can cause pe...
19,121
[ { "from": "human", "value": "It seems that DrawFrameControl() creates Font and Brush objects, select them into dc, and doesn't delete them. (according to BoundsChecker messages). Does anyone faced such thing?\n" }, { "from": "gpt", "value": "Yes, it is generally considered a bad practice in Wind...
I want to know how to set the height property for the HTML <select> in code. I tried setting .Attribute.Add("Style","Height:120px") just to see if I could get it to change but to no avail.
Setting the height of an HTML `<select>` element can indeed be tricky due to how different browsers handle form elements. Using inline styles via the `style` attribute is usually the right approach. However, there are some nuances to keep in mind. Here’s how you can set the height property for a `<select>` element bot...
17,993
[ { "from": "human", "value": "I want to know how to set the height property for the HTML <select> in code.\nI tried setting .Attribute.Add(\"Style\",\"Height:120px\") just to see if I could get it to change but to no avail.\n" }, { "from": "gpt", "value": "Setting the height of an HTML `<select>`...
Is there an elegant way to have performant, natural sorting in a MySQL database? For example if I have this data set: Final Fantasy Final Fantasy 4 Final Fantasy 10 Final Fantasy 12 Final Fantasy 12: Chains of Promathia Final Fantasy Adventure Final Fantasy Origins Final Fantasy Tactics Any other elegant solution tha...
Achieving natural sorting in MySQL, especially for strings containing numbers, can indeed be challenging without splitting the strings into separate components. However, there are a few approaches you can take to implement natural sorting without the need for extensive preprocessing. ### 1. Using a Custom Sort Functio...
17,700
[ { "from": "human", "value": "Is there an elegant way to have performant, natural sorting in a MySQL database?\nFor example if I have this data set:\n\nFinal Fantasy\nFinal Fantasy 4\nFinal Fantasy 10\nFinal Fantasy 12\nFinal Fantasy 12: Chains of Promathia\nFinal Fantasy Adventure\nFinal Fantasy Origins\nFi...
I'm building few command-line utilities in Xcode (plain C, no Cocoa). I want all of them to use my customized version of libpng, and I want to save space by sharing one copy of the library among all executables (I don't mind re-distributing .dylib with them). Do I need to do some magic to get libpng export symbols? Doe...
It looks like you’ve already made significant progress in understanding how to configure your Xcode project for using your custom version of libpng. Let’s clarify some points and add a bit of detail to ensure everything works smoothly. ### Exporting Symbols from libpng To ensure that libpng exports the symbols you nee...
18,317
[ { "from": "human", "value": "I'm building few command-line utilities in Xcode (plain C, no Cocoa). I want all of them to use my customized version of libpng, and I want to save space by sharing one copy of the library among all executables (I don't mind re-distributing .dylib with them).\nDo I need to do so...
Does anyone have any tips for dealing with ConstraintExceptions thrown by XSD datasets? This is the exception with the cryptic message: System.Data.ConstraintException : Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
Dealing with `ConstraintExceptions` in XSD datasets can be challenging, but here are several steps and tips to help you identify and resolve the issues causing the exception: ### 1. **Understanding the Error** The `ConstraintException` occurs when you attempt to enable constraints on a DataSet that contains data viola...
4,482
[ { "from": "human", "value": "Does anyone have any tips for dealing with ConstraintExceptions thrown by XSD datasets?\nThis is the exception with the cryptic message:\nSystem.Data.ConstraintException : Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key co...
I like to read about new and clever algorithms. And I like to think out of the box, so all kinds of algorithms from all fields of computation are welcome. From time to time I read research papers to keep up with the current research and expand my horizon. I also like to learn new tricks. Unfortunately I tend to concent...
It's great to hear that you're interested in expanding your knowledge beyond your primary field! Here are a few interesting algorithms from various areas of computation that may inspire you: 1. **The A* (A-Star) Search Algorithm**: A* is a pathfinding and graph traversal algorithm used widely in AI, especially in g...
15,788
[ { "from": "human", "value": "I like to read about new and clever algorithms. And I like to think out of the box, so all kinds of algorithms from all fields of computation are welcome.\nFrom time to time I read research papers to keep up with the current research and expand my horizon. I also like to learn n...
I'm trying to modify the class of an element if an ajax call based on that element is successful <script type='text/javascript'> $("#a.toggle").click(function(e){ $.ajax({ url: '/changeItem.php', dataType: 'json', type: 'POST', success: function(data,text){ if(data.error=...
You're correct that the context of `this` changes within the success callback of the AJAX function. In JavaScript, `this` refers to the context in which a function is called. In your case, inside the `success` function, `this` does not refer to the clicked element, but rather to the AJAX settings. To solve this issue,...
19,258
[ { "from": "human", "value": "I'm trying to modify the class of an element if an ajax call based on that element is successful\n<script type='text/javascript'>\n$(\"#a.toggle\").click(function(e){\n $.ajax({\n url: '/changeItem.php',\n dataType: 'json',\n type: 'POST',\n succes...
What are my options? I tried MonoDevelop over a year ago but it was extremely buggy. Is the latest version a stable development environment?
As of my last update in October 2023, MonoDevelop has historically had some stability issues, but newer versions may have improved in this regard. However, development on MonoDevelop has slowed down significantly, and the project hasn't been actively maintained as much as other IDEs. If you're looking for alternatives...
17,468
[ { "from": "human", "value": "What are my options? I tried MonoDevelop over a year ago but it was extremely buggy. Is the latest version a stable development environment?\n" }, { "from": "gpt", "value": "As of my last update in October 2023, MonoDevelop has historically had some stability issue...
What's your preferred method of providing a search facility on a website? Currently I prefer to use Lucene.net over Indexing Service / SQL Server full-text search (as there's nothing to set up server-side), but what other ways are being used out there?
There are several methods to implement search functionality on a website, each with its own advantages and use cases. Here are some popular alternatives to Lucene.net, Indexing Service, and SQL Server full-text search: 1. **Elasticsearch**: A powerful, distributed search engine built on Apache Lucene. It offers full-t...
17,310
[ { "from": "human", "value": "What's your preferred method of providing a search facility on a website? Currently I prefer to use Lucene.net over Indexing Service / SQL Server full-text search (as there's nothing to set up server-side), but what other ways are being used out there?\n" }, { "from": "g...
I and two others are working on a project at the university. In the project we are making a prototype of a MMORPG. We have decided to use PostgreSQL as our database. The other databases we considered were MS SQL-server and MySQL. Does somebody have a good reference which will justify our choice? (preferably written du...
While I don't have access to the latest articles or publications beyond October 2023, I can provide you with some general reasons why PostgreSQL is often chosen for projects like MMORPGs, along with some recent trends and documentation sources that could justify your choice: 1. **Performance and Scalability**: Postgre...
19,000
[ { "from": "human", "value": "I and two others are working on a project at the university. \nIn the project we are making a prototype of a MMORPG.\nWe have decided to use PostgreSQL as our database. The other databases we considered were MS SQL-server and MySQL.\nDoes somebody have a good reference which wil...
If you have an NSMutableArray, how do you shuffle the elements randomly? (I have my own answer for this, which is posted below, but I'm new to Cocoa and I'm interested to know if there is a better way.) Update: As noted by @Mukesh, as of iOS 10+ and macOS 10.12+, there is an -[NSMutableArray shuffledArray] method that...
In Objective-C, if you want to shuffle the elements of an `NSMutableArray`, you can implement your own shuffle method if you're working with versions of iOS/macOS prior to the introduction of the `-shuffledArray` method. Here’s one way to do it using the Fisher-Yates shuffle algorithm: ```objc #import <Foundation/Foun...
18,847
[ { "from": "human", "value": "If you have an NSMutableArray, how do you shuffle the elements randomly?\n(I have my own answer for this, which is posted below, but I'm new to Cocoa and I'm interested to know if there is a better way.)\n\nUpdate: As noted by @Mukesh, as of iOS 10+ and macOS 10.12+, there is an...
I'm looking into writing an Eclipse plugin for FlexUnit and was wondering where I could get the sources for the JUnit Eclipse plugin. I checked the JUnit sources at sourceforge but couldn't spot any code that looked like the plugin code. Any idea where this code is available?
The JUnit Eclipse plugin code is not hosted on SourceForge, as the development has largely moved to the Eclipse Foundation. The JUnit plugin for Eclipse is part of the Eclipse IDE and can typically be found within the Eclipse IDE repository. To get the source code for the JUnit Eclipse plugin, you can follow these ste...
18,436
[ { "from": "human", "value": "I'm looking into writing an Eclipse plugin for FlexUnit and was wondering where I could get the sources for the JUnit Eclipse plugin. I checked the JUnit sources at sourceforge but couldn't spot any code that looked like the plugin code.\nAny idea where this code is available?\n...
We are running MOSS 2007 with profiles coming from our active directory. One feature we use is "Audiences" which get compiled based on specific AD groups. We have problems with very few of the accounts where they do not get included in the audience. We have for example AD group of "Procurement" where 15 out of 16 users...
When dealing with issues related to user accounts not being included in SharePoint audiences based on Active Directory (AD) groups, there are several factors you may want to consider: 1. **Active Directory Attributes**: Check the user attributes in AD. The account may be missing some required attributes that are neede...
17,043
[ { "from": "human", "value": "We are running MOSS 2007 with profiles coming from our active directory. One feature we use is \"Audiences\" which get compiled based on specific AD groups. We have problems with very few of the accounts where they do not get included in the audience. We have for example AD grou...
I'm working on a qnx device, and I want to be able to ssh into it. Does anyone have a primer on getting something like openSSH up and running?
Setting up SSH on a QNX device involves a few steps. Here's a primer to help you get started with OpenSSH or a similar SSH server on your QNX system. Note that QNX does not ship with OpenSSH by default, so you may need to compile it or use an alternative SSH server if available. ### Step-by-Step Guide to Setting Up SS...
13,958
[ { "from": "human", "value": "I'm working on a qnx device, and I want to be able to ssh into it. Does anyone have a primer on getting something like openSSH up and running?\n" }, { "from": "gpt", "value": "Setting up SSH on a QNX device involves a few steps. Here's a primer to help you get start...
Using .NET 2.0 with WinForms, I'd like to create a custom, multi-columned menu (similiar to the word 2007 look&feel, but without the ribbon). My approach was creating a control, and using a left/right docked toolstrip, I have constructed a similar look&feel of a menu. However, there are a few shortcomings of this solut...
Creating a custom multi-column menu in WinForms that behaves similarly to the Word 2007 menu but without the ribbon can be a fun challenge. Given your requirements, you can utilize a combination of a `Form` and a `Panel` or a custom control to mimic a menu system. Here’s a step-by-step approach that you can take: ### ...
14,757
[ { "from": "human", "value": "Using .NET 2.0 with WinForms, I'd like to create a custom, multi-columned menu (similiar to the word 2007 look&feel, but without the ribbon).\nMy approach was creating a control, and using a left/right docked toolstrip, I have constructed a similar look&feel of a menu. However, ...
I am supposed to provide my users a really simple way of capturing video clips out of my OpenGL application's main window. I am thinking of adding buttons and/or keyboard shortcuts for starting and stopping the capture; when starting, I could ask for a filename and other options, if any. It has to run in Windows (XP/Vi...
Capturing video from an OpenGL application can indeed be approached in several ways, each with its own advantages and disadvantages. Below are a few potential approaches tailored to your requirements, alongside some libraries that might be useful: ### 1. Using a Video Encoding Library This approach involves manually c...
15,960
[ { "from": "human", "value": "I am supposed to provide my users a really simple way of capturing video clips out of my OpenGL application's main window. I am thinking of adding buttons and/or keyboard shortcuts for starting and stopping the capture; when starting, I could ask for a filename and other options...