instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
i'm using the Win32 progress dialog. The damnest thing is that when i call: progressDialog.StopProgressDialog(); it doesn't disappear. It stays on screen until the user moves her mouse over it - then it suddenly disappers. The call to StopProgressDialog returns right away (i.e. it's not a synchronous call). i can pro...
It sounds like you're encountering a common issue related to the way progress dialogs are being managed and the message queue in Windows. The behavior you're describing, where the progress dialog does not disappear until the mouse is moved over it, is often related to the fact that the application’s message loop is not...
49,831
[ { "from": "human", "value": "i'm using the Win32 progress dialog. The damnest thing is that when i call:\nprogressDialog.StopProgressDialog();\n\nit doesn't disappear. It stays on screen until the user moves her mouse over it - then it suddenly disappers. \nThe call to StopProgressDialog returns right away ...
I'm working on creating a domain layer in Zend Framework that is separate from the data access layer. The Data Access Layer is composed to two main objects, a Table Data Gateway and a Row Data Gateway. As per Bill Karwin's reply to this earlier question I now have the following code for my domain Person object: class M...
Your approach to separating the domain layer from the data access layer in Zend Framework is a good starting point, but there are a few improvements and adjustments you might consider to enhance the design and maintainability of your code. Here are some suggestions: ### 1. Use Factory Methods for Object Creation Inste...
46,561
[ { "from": "human", "value": "I'm working on creating a domain layer in Zend Framework that is separate from the data access layer. The Data Access Layer is composed to two main objects, a Table Data Gateway and a Row Data Gateway. As per Bill Karwin's reply to this earlier question I now have the following ...
function holiday_hitlist($tablename, $hit_user){ global $host, $user, $pass, $dbname; $link = mysql_connect($host, $user, $pass, $dbname); print "<div class=\"hit_list\"> <h3>My Holiday Hitlist</h3> <p>Five things I want the most, based on my desirability ratings.<br/>You can't go...
The issue you're encountering, where the "1" appears immediately after the closing `div` tag, stems from how the `print` statement is being used within your `while` loop and the `return` statement at the end of your function. In PHP, the `print` statement outputs its value directly to the browser, but if you try to as...
48,572
[ { "from": "human", "value": "function holiday_hitlist($tablename, $hit_user){\n\n global $host, $user, $pass, $dbname;\n\n $link = mysql_connect($host, $user, $pass, $dbname);\n\n print \"<div class=\\\"hit_list\\\">\n <h3>My Holiday Hitlist</h3>\n <p>Five things I want the mo...
How do you draw the following dynamic 3D array with OpenGL glDrawPixels()? You can find the documentation here: http://opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/drawpixels.html float ***array3d; void InitScreenArray() { int i, j; int screenX = scene.camera.vres; int screenY = scene.came...
To draw a dynamic 3D array using OpenGL's `glDrawPixels()`, we need to understand how to represent the 3D data in a 2D manner because `glDrawPixels()` operates on 2D images (i.e., 2D pixel data). One common way to visualize a 3D array is to represent slices of that array as 2D images. Here’s a step-by-step outline to ...
40,763
[ { "from": "human", "value": "How do you draw the following dynamic 3D array with OpenGL glDrawPixels()?\nYou can find the documentation here: http://opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/drawpixels.html\nfloat ***array3d;\n\nvoid InitScreenArray()\n{\n int i, j;\n\n int screenX ...
I need to write a 'simple' util to convert from ASCII to EBCDIC? The Ascii is coming from Java, Web and going to an AS400. I've had a google around, can't seem to find a easy solution (maybe coz there isn't one :( ). I was hoping for an opensource util or paid for util that has already been written. Like this mayb...
Converting between ASCII and EBCDIC (Extended Binary Coded Decimal Interchange Code) can be tricky due to the differences in character encoding used between systems like Java web applications and AS400 systems. However, there are libraries and utilities that can help you achieve this conversion. ### Java Libraries for...
45,135
[ { "from": "human", "value": "I need to write a 'simple' util to convert from ASCII to EBCDIC? \nThe Ascii is coming from Java, Web and going to an AS400. I've had a google around, can't seem to find a easy solution (maybe coz there isn't one :( ). I was hoping for an opensource util or paid for util that ha...
I work on a program in Delphi that holds a lot of data, and I wonder which method is the best to save it to file. Now we use records and "file of" to save it but I think it should be better methods. I would prefer a system that makes it easy to migrate from the system we use now. EDIT: The application is a sort of a da...
In Delphi, if you're looking for a more modern and flexible way to handle data storage that allows for easier migration from your current method (using records and "file of"), there are several approaches you can consider. Here are a few options that are commonly used for database applications: ### 1. **Using Structur...
46,128
[ { "from": "human", "value": "I work on a program in Delphi that holds a lot of data, and I wonder which method is the best to save it to file. Now we use records and \"file of\" to save it but I think it should be better methods. I would prefer a system that makes it easy to migrate from the system we use n...
I would like to manipulate the HTML inside an iframe using jQuery. I thought I'd be able to do this by setting the context of the jQuery function to be the document of the iframe, something like: $(function(){ //document ready $('some selector', frames['nameOfMyIframe'].document).doStuff() }); However this doesn't...
Manipulating the HTML inside an iframe using jQuery can be tricky, especially when dealing with cross-origin restrictions. Here are a few points to consider along with possible solutions: ### Understanding Cross-Origin Restrictions 1. **Same-Origin Policy**: You can only access an iframe's content if the iframe's sour...
45,186
[ { "from": "human", "value": "I would like to manipulate the HTML inside an iframe using jQuery.\nI thought I'd be able to do this by setting the context of the jQuery function to be the document of the iframe, something like:\n$(function(){ //document ready\n $('some selector', frames['nameOfMyIframe'].d...
I have third-party workflow software (Captaris Teamplate) that's referencing an assembly from my project that's referencing other assemblies from our project solution all through the GAC. When our application executes, it invokes a Captaris Teamplate method to create a workflow process which in turn uses project assem...
Dealing with assembly resolution issues, especially in complex setups like yours with multiple dependencies, can indeed be challenging. Below are some strategies and techniques that can help you diagnose the issues and clean up your environment: ### 1. Extract More Information from the Exception To get more informati...
45,877
[ { "from": "human", "value": "I have third-party workflow software (Captaris Teamplate) that's referencing an assembly from my project that's referencing other assemblies from our project solution all through the GAC. \nWhen our application executes, it invokes a Captaris Teamplate method to create a workflo...
On PHP, they have a way to restrict file size AFTER uploading, but not BEFORE uploading. I use the Malsup jQuery Form Plugin for my form posting, and it supports image file posting. I was wondering if perhaps there's a restriction where I can set how many bytes can pass through that AJAX stream up to the server? That c...
To restrict file size on the client side before uploading using the Malsup jQuery Form Plugin (or with regular jQuery), you can check the file size using JavaScript. This method can help you prevent large files from being uploaded, thereby improving the user experience and reducing server load. Here's how you can do i...
49,883
[ { "from": "human", "value": "On PHP, they have a way to restrict file size AFTER uploading, but not BEFORE uploading. I use the Malsup jQuery Form Plugin for my form posting, and it supports image file posting.\nI was wondering if perhaps there's a restriction where I can set how many bytes can pass through...
I would like to assign a global hotkey to my Python application, running in Gnome. How do I do that? All I can find are two year old posts saying, well, pretty much nothing :-)
To assign a global hotkey to your Python application in GNOME, you can follow these steps. Below, I'll outline how to set this up using `xdotool`, which allows you to trigger actions when the hotkey is pressed. Additionally, we'll use GNOME's built-in keyboard settings to bind the hotkey to a script that runs your Pyth...
48,360
[ { "from": "human", "value": "I would like to assign a global hotkey to my Python application, running in Gnome. How do I do that? All I can find are two year old posts saying, well, pretty much nothing :-)\n" }, { "from": "gpt", "value": "To assign a global hotkey to your Python application in G...
The following XAML (below) defines a custom collection in resources and attempts to populate it with a custom object; <UserControl x:Class="ImageListView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="300" Height="300" xmlns:l...
The issue you're encountering is related to the way you are defining the `ContentProperty` in your `MyCustomCollection` class. In WPF, when you're creating a collection that will contain items of a specific type, you typically want to set the `ContentProperty` to the collection's item type. In your case, since `MyCusto...
49,173
[ { "from": "human", "value": "The following XAML (below) defines a custom collection in resources and attempts to populate it with a custom object;\n<UserControl x:Class=\"ImageListView\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x=\"http://schemas.microsoft.com/winf...
i've got regex which was alright, but as it camed out doesn't work well in some situations Keep eye on message preview cause message editor do some tricky things with "\" [\[]?[\^%#\$\*@\-;].*?[\^%#\$\*@\-;][\]] its task is to find pattern which in general looks like that [ABA] A - char from set ^,%,#,$,*,@,-,; B...
To address your requirements, let's break down the solution into two parts: finding the specified pattern and excluding unwanted patterns. ### Part 1: Finding the Correct Pattern Your original regex appears to be overly permissive, allowing characters that shouldn't be included after the first character from the defi...
49,072
[ { "from": "human", "value": "i've got regex which was alright, but as it camed out doesn't work well in some situations \nKeep eye on message preview cause message editor do some tricky things with \"\\\"\n\n[\\[]?[\\^%#\\$\\*@\\-;].*?[\\^%#\\$\\*@\\-;][\\]]\n\nits task is to find pattern which in general l...
I am working on a basic Struts based application that is experience major spikes in memory. We have a monitoring tool that will notice one request per user adding 3MB to the JVM heap memory. Are there any tips to encourage earlier garbage collection, free up memory or improve performance? The application is a bas...
It sounds like you are experiencing high memory usage in your Struts application due to the large amount of data being held in memory for each user's session, particularly the list of objects created from the database query. Here are several tips to help you manage memory more effectively and encourage earlier garbage ...
47,067
[ { "from": "human", "value": "I am working on a basic Struts based application that is experience major spikes in memory. We have a monitoring tool that will notice one request per user adding 3MB to the JVM heap memory. Are there any tips to encourage earlier garbage collection, free up memory or improve ...
I have an HTTPHandler that is reading in a set of CSS files and combining them and then GZipping them. However, some of the CSS files contain a Byte Order Mark (due to a bug in TFS 2005 auto merge) and in FireFox the BOM is being read as part of the actual content so it's screwing up my class names etc. How can I str...
Yes, you can strip out the Byte Order Mark (BOM) from your CSS files programmatically without needing to manually look for the BOM characters. The BOM for UTF-8 is represented by the byte sequence `0xEF, 0xBB, 0xBF`. When dealing with strings in C#, you can easily remove it by checking if the string starts with the BOM...
44,118
[ { "from": "human", "value": "I have an HTTPHandler that is reading in a set of CSS files and combining them and then GZipping them. However, some of the CSS files contain a Byte Order Mark (due to a bug in TFS 2005 auto merge) and in FireFox the BOM is being read as part of the actual content so it's screw...
I have a function which gets a key from the user and generates a Hashtable (on a pattern specified by the key). After creating a Hashtable, I would like to populate a JTable so that each each column represents a key and every rows represents the values associated with the key. I tried everything but couldn't get this w...
To populate a `JTable` with data from a `Hashtable` after receiving input from the user, you need to follow these general steps: 1. **Obtain Input:** Get the key from the user and generate the `Hashtable`. 2. **Prepare Data for JTable:** Convert the `Hashtable` into a format suitable for a `JTable`, typically a 2D arr...
44,477
[ { "from": "human", "value": "I have a function which gets a key from the user and generates a Hashtable (on a pattern specified by the key). After creating a Hashtable, I would like to populate a JTable so that each each column represents a key and every rows represents the values associated with the key. I...
I am attempting to mock a call to an indexed property. I.e. I would like to moq the following: object result = myDictionaryCollection["SomeKeyValue"]; and also the setter value myDictionaryCollection["SomeKeyValue"] = myNewValue; I am doing this because I need to mock the functionality of a class my app uses. Does a...
Yes, you can mock an indexed property using Moq, but it's important to understand that an indexed property is not just a simple getter and setter. Instead, you can use the `Setup` and `Returns` methods to define how the mock should behave when accessing the indexed property. Assuming `myDictionaryCollection` is an int...
49,276
[ { "from": "human", "value": "I am attempting to mock a call to an indexed property. I.e. I would like to moq the following:\nobject result = myDictionaryCollection[\"SomeKeyValue\"];\n\nand also the setter value\nmyDictionaryCollection[\"SomeKeyValue\"] = myNewValue;\n\nI am doing this because I need to moc...
I have this input text: <html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body><table cellspacing="0" cellpadding="0" border="0" align="center" width="603"> <tbody><tr> <td><table cellspacing="0" cellpadding="0" border="0" width="603"> <tbody><tr> <td width="314"...
To process a chunk of HTML without newlines and extract image links while replacing them with new paths in a more elegant way, we can indeed streamline your Perl code. Instead of treating each line separately, we can read the entire HTML content as a single string and apply the replacements globally. The primary focus ...
49,350
[ { "from": "human", "value": "I have this input text:\n<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"></head><body><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"center\" width=\"603\"> <tbody><tr> <td><table cellspacing=\"0\" cellpadding=\"0\" borde...
I have an requirement that, in my application on clicking an button I have to load one more application with the same template which I was using for my application. So, on clicking the button in my application I have used one intermediate page in that using iframe I passed that URL of an external application. Its worki...
To achieve your requirement of hiding a button in your application based on the URL of an external application loaded in an iframe, you can use JavaScript to access the iframe's URL and implement some conditions. However, there are some important points to consider regarding cross-origin restrictions. ### Cross-Origin...
47,214
[ { "from": "human", "value": "I have an requirement that, in my application on clicking an button I have to load one more application with the same template which I was using for my application.\nSo, on clicking the button in my application I have used one intermediate page in that using iframe I passed that...
I'm running an Apache server (v2.2.10) with mod_python, Python 2.5 and Django. I have a small web app that will show the current projects we have in CVS and allow users to make a build of the different projects (the build checks out the project, and copies certain files over with the source stripped out). On the Djang...
It looks like you're trying to execute a CVS command using `subprocess.Popen` in a Python web application running under Apache. The error message you're seeing (`The credentials supplied to the package were not recognized`) indicates that there might be an issue with how Apache is handling the authentication for the CV...
47,689
[ { "from": "human", "value": "I'm running an Apache server (v2.2.10) with mod_python, Python 2.5 and Django. I have a small web app that will show the current projects we have in CVS and allow users to make a build of the different projects (the build checks out the project, and copies certain files over wi...
[SoapRpcMethod(Action = "http://cyberindigo/TempWebService/InsertXML", RequestNamespace = "http://cyberindigo/TempWebService/Request", RequestElementName = "InsertXMLRequest", ResponseNamespace = "http://cyberindigo/TempWebService/Response", ResponseElementName = "InsertXMLResponse", Use = System...
The error message you're encountering indicates that the SOAPAction in the HTTP headers of your XMLHttpRequest does not match the expected value on the server. This mismatch can occur for a variety of reasons, including casing issues, incorrect URL formatting, or other configuration errors. Here are some troubleshooti...
46,987
[ { "from": "human", "value": " [SoapRpcMethod(Action = \"http://cyberindigo/TempWebService/InsertXML\",\n RequestNamespace = \"http://cyberindigo/TempWebService/Request\",\n RequestElementName = \"InsertXMLRequest\",\n ResponseNamespace = \"http://cyberindigo/TempWebService/Response\",\n Respon...
So, I've had a fair amount of experience programming database driven web apps using php and coldfusion (not together, at different times) and I'm starting to look into the asp.net world (I have a project coming up at work that is all asp.net/c#.) My question is: there seems to be a lot of stuff to get mired in and if I...
It sounds like you're transitioning into ASP.NET and want to focus on the key areas that will help you build CRUD web applications effectively. Given your experience with PHP and ColdFusion, you'll find some familiar concepts, but also a different ecosystem and patterns in ASP.NET. Here's a concise list of topics and t...
49,899
[ { "from": "human", "value": "So, I've had a fair amount of experience programming database driven web apps using php and coldfusion (not together, at different times) and I'm starting to look into the asp.net world (I have a project coming up at work that is all asp.net/c#.)\nMy question is: there seems to ...
I have a C linux application (A) that spawns another process (P) when it is started. When I want to debug P I start A as usual and I connect with ddd/gdb to P. Problems appear when I want to debug the entry-point (start of main) of P. If I follow the usual approach when I connect the debugger to P is already to late. T...
If you want to debug the entry point of the process `P` without modifying the code of applications `A` and `P`, there are a few approaches you can take: ### 1. Use `gdb` with `set follow-fork-mode` You can run `A` directly with `gdb` and then set `gdb` to follow forks. By doing this, you'll be able to attach to proces...
48,537
[ { "from": "human", "value": "I have a C linux application (A) that spawns another process (P) when it is started. When I want to debug P I start A as usual and I connect with ddd/gdb to P.\nProblems appear when I want to debug the entry-point (start of main) of P. If I follow the usual approach when I conne...
I have a Java app running on Tomcat, and I would like to monitor counters using Windows Performance Monitor. Is this possible using a JMX adapter for the Java MBeans or by some other means?
Yes, it is indeed possible to monitor Java applications running on Tomcat using Windows Performance Monitor (PerfMon) by leveraging JMX (Java Management Extensions) and a suitable adapter. Here’s how you can set it up: ### Using JMX with a JMX Adapter 1. **Enable JMX in Tomcat**: You will need to configure Tomcat ...
48,164
[ { "from": "human", "value": "I have a Java app running on Tomcat, and I would like to monitor counters using Windows Performance Monitor. Is this possible using a JMX adapter for the Java MBeans or by some other means?\n" }, { "from": "gpt", "value": "Yes, it is indeed possible to monitor Java ...
If you are going to start the development of an API for your web application. Is there any kind of guidelines, best practices or standard to build web services. I have seen a few discussions in this topic and I will like to get more information. At least get pointers on where to get the information. Thanks in advanc...
Absolutely! Developing a robust API for your web application is critical for ensuring that your services are scalable, maintainable, and easy to use for clients. Here are some guidelines, best practices, and standards for building web services, along with pointers for further reading. ### 1. **Design Principles** -...
48,253
[ { "from": "human", "value": "If you are going to start the development of an API for your web application. Is there any kind of guidelines, best practices or standard to build web services. I have seen a few discussions in this topic and I will like to get more information. \nAt least get pointers on wher...
I have a Page with a UserControl on it. If the user presses Esc while anywhere on Page I want to handle. I thought this would be as easy as hooking up the PreviewKeyDown event, testing for the Esc key, and then handling it. However, when I placed I breakpoint in the event handler I found it was never getting called. ...
In WPF (Windows Presentation Foundation), handling key events like `PreviewKeyDown` can sometimes be tricky due to focus and event routing. The `PreviewKeyDown` event is a tunneling event, which means it starts from the root element and tunnels down to the target element. However, if the focus is on a control that does...
44,642
[ { "from": "human", "value": "I have a Page with a UserControl on it. If the user presses Esc while anywhere on Page I want to handle.\nI thought this would be as easy as hooking up the PreviewKeyDown event, testing for the Esc key, and then handling it. However, when I placed I breakpoint in the event han...
I have a database of companies. My application receives data that references a company by name, but the name may not exactly match the value in the database. I need to match the incoming data to the company it refers to. For instance, my database might contain a company with name "A. B. Widgets & Co Ltd." while my inco...
To match company names while considering variations in naming conventions and the importance of certain words, you can implement a multi-step approach in Java. Here's a structured way to approach this problem: ### Steps for Matching Company Names 1. **Normalize the Names**: Convert both the incoming names and databas...
49,141
[ { "from": "human", "value": "I have a database of companies. My application receives data that references a company by name, but the name may not exactly match the value in the database. I need to match the incoming data to the company it refers to.\nFor instance, my database might contain a company with na...
I need to read records containing name and email from a file or database and add them to an existing Oulook distribution list (from the private contacts, not from the GAL). I just saw examples of reading from OL using LINQ to DASL which I have working for mail and appointments, but I can't figure out how to list the co...
To work with Outlook distribution lists (DLs) using the Outlook Object Model in C#, you'll need to do a few things to iterate through the members and to add new members to an existing distribution list. Below, I will provide an example of how to read the members of a distribution list and how to add new members based o...
49,260
[ { "from": "human", "value": "I need to read records containing name and email from a file or database and add them to an existing Oulook distribution list (from the private contacts, not from the GAL).\nI just saw examples of reading from OL using LINQ to DASL which I have working for mail and appointments,...
I'm importing Brazilian stock market data to a SQL Server database. Right now I have a table with price information from three kind of assets: stocks, options and forwards. I'm still in 2006 data and the table has over half million records. I have more 12 years of data to import so the table will exceed a million recor...
Optimizing the performance of your SQL Server table for stock market data is a multi-faceted approach. You already have a good foundation, but let's expand on your strategies and introduce some additional considerations. ### 1. Clustered Index Your understanding of the clustered index is correct: since you have creat...
47,487
[ { "from": "human", "value": "I'm importing Brazilian stock market data to a SQL Server database. Right now I have a table with price information from three kind of assets: stocks, options and forwards. I'm still in 2006 data and the table has over half million records. I have more 12 years of data to import...
I've got a fairly large MFC application that has just been migrated from VS6.0 to VS2008. It was a pretty painful process, but now I'd like to explore any managed-code options that may be available. I was able to successfully build the project using the /clr switch which seems to give me access to managed types. I'd l...
Great to hear that you've successfully migrated your MFC application to VS2008 and are exploring managed code options! Let's take a closer look at your questions about the conversion between `System::String^` and `CString` in the context of managed and unmanaged code. ### Managed and Unmanaged Strings `System::String^...
49,728
[ { "from": "human", "value": "I've got a fairly large MFC application that has just been migrated from VS6.0 to VS2008. It was a pretty painful process, but now I'd like to explore any managed-code options that may be available. I was able to successfully build the project using the /clr switch which seems t...
I'm trying to achieve something google isn't able to give answer. I'm trying to create an asp.net usercontrol that when I put content into it's open close tag will include it for me to be still able to acess it's content by ID from the Parent. Here is an exemple of what I want to achieve. Usercontrol: <%@ Control Langu...
In order to achieve the functionality you're looking for with an ASP.NET UserControl, you can use a combination of properties and the `ControlCollection` of the UserControl. While it's true that using `ITemplate` gives you the flexibility to insert markup, it also introduces challenges when accessing the child controls...
48,758
[ { "from": "human", "value": "I'm trying to achieve something google isn't able to give answer. I'm trying to create an asp.net usercontrol that when I put content into it's open close tag will include it for me to be still able to acess it's content by ID from the Parent. Here is an exemple of what I want t...
I am working on an internal web based application for storing and cataloging photos. How should I retrieve, and save these files to the server? Note: I want to save the files to the file system, not to a database. Similar to How can I handle HTTP file uploads?
To build an internal web-based application for storing and cataloging photos, where files are saved to the server's file system, you'll need to implement a workflow that includes file upload handling, validation, storage, and retrieval. Below is a basic outline of how you can achieve this, including examples using a po...
45,417
[ { "from": "human", "value": "I am working on an internal web based application for storing and cataloging photos. How should I retrieve, and save these files to the server?\nNote: I want to save the files to the file system, not to a database.\nSimilar to How can I handle HTTP file uploads?\n" }, { ...
I want to do a simple role authentication in .NET - but am lost in the profusion of apis... I would like to have a web.config per directory with role access like: <authorization> <allow roles="admin"/> <deny users="*"/> </authorization> And in my login page, where I do FormsAuthentication.RedirectFromLoginPage...
To implement simple role-based authentication in a .NET application without using the built-in Role Management Providers, you can follow a straightforward approach using the ASP.NET membership system and custom role management. Here's a basic guide on how to implement role-based authentication using `FormsAuthenticati...
40,535
[ { "from": "human", "value": "I want to do a simple role authentication in .NET - but am lost in the profusion of apis...\nI would like to have a web.config per directory with role access like:\n<authorization>\n <allow roles=\"admin\"/>\n <deny users=\"*\"/>\n</authorization>\n\nAnd in my login page, ...
I am creating sharepoint custom solution that will show number of drop down in page. The drop down data is shared in may pages. I want to persist selected values of the user such that when ever he visit that page or any other page that have same drop down, he should be able to see is saved value pre selected in drop d...
When it comes to persisting user-selected values in SharePoint across pages and ensuring that these values are pre-selected in dropdowns, you have a few options to consider. Each of the options you mentioned has its pros and cons, but some are more suited to SharePoint's architecture and capabilities than others. Let's...
49,481
[ { "from": "human", "value": "I am creating sharepoint custom solution that will show number of drop down in page. The drop down data is shared in may pages. \nI want to persist selected values of the user such that when ever he visit that page or any other page that have same drop down, he should be able to...
I'm having trouble with a web application that will deadlock occasionally There are 3 queries involved. 2 are trying to update a table UPDATE AttendanceRoll SET ErrorFlag = 0 WHERE ContractID = @ContractID AND DATEPART(month,AttendanceDate) = DATEPART(month,@Month_Beginning) AND DATEPART(year,AttendanceDate) = DATEPART...
Deadlocks occur in databases when two or more transactions are waiting for each other to release resources, creating a situation where none of the transactions can proceed. In your case, it seems you have two update operations and one insert operation that are competing for locks on the same resources, leading to a dea...
44,963
[ { "from": "human", "value": "I'm having trouble with a web application that will deadlock occasionally\nThere are 3 queries involved. 2 are trying to update a table\nUPDATE AttendanceRoll\nSET ErrorFlag = 0\nWHERE ContractID = @ContractID\nAND DATEPART(month,AttendanceDate) = DATEPART(month,@Month_Beginning...
I have a menu of report links in my master page. I need to append an ID to the end of each whenever the user changes a value on the child page. What's a good way to accomplish this? UPDATE: I should have mentioned that the child update is happening inside an UpdatePanel, meaning the master page is not reloaded when the...
To append an ID to the end of each report link in your master page when the user changes a value on the child page (within an UpdatePanel), you can follow these steps: ### Step 1: Setup Your Master Page Ensure that your report links in the master page are defined in such a way that they can be easily accessed and upd...
47,759
[ { "from": "human", "value": "I have a menu of report links in my master page. I need to append an ID to the end of each whenever the user changes a value on the child page. What's a good way to accomplish this?\nUPDATE: I should have mentioned that the child update is happening inside an UpdatePanel, meanin...
I'm looking for a benchmark (and results on other PCs) which would give me an idea of the development performance gain I could get by upgrading my PC, also the benchmark could be used to justify the upgrade to my boss. I use Visual Studio 2008 for my development, so I'd like to get an idea of by what factor the build t...
To benchmark development performance, especially in a Visual Studio 2008 environment, you would want to consider several key factors, including CPU, RAM, disk speed, and the overall architecture of your system. Here’s a breakdown of what to consider when you’re looking for benchmarks and performance gains for your upgr...
46,096
[ { "from": "human", "value": "I'm looking for a benchmark (and results on other PCs) which would give me an idea of the development performance gain I could get by upgrading my PC, also the benchmark could be used to justify the upgrade to my boss.\nI use Visual Studio 2008 for my development, so I'd like to...
Coming from C++, I find generic programming indispensable. I wonder how people approach that in Haskell? Say how do write generic swap function in Haskell? Is there an equivalent concept of partial specialization in Haskell? In C++, I can partially specialize the generic swap function with a special one for a generic m...
In Haskell, generic programming is typically handled through the use of type classes, which allow you to define functions that can operate on a variety of types. Unlike C++, Haskell's type system does not have the same concept of partial specialization, but there are alternative approaches to achieve similar results. ...
48,356
[ { "from": "human", "value": "Coming from C++, I find generic programming indispensable. I wonder how people approach that in Haskell?\nSay how do write generic swap function in Haskell?\nIs there an equivalent concept of partial specialization in Haskell?\nIn C++, I can partially specialize the generic swap...
i've been asked to generate some demographic reports (crime rates, birth/deaths, etc) based on state and cities for the USA. I have all the demographic data (provided by our client) but can't seem to find any places which have the boundaries (read: LAT/LONG's) of the USA States and their cities. Our data are Lat/Long p...
Certainly! If you're looking for boundary data for U.S. states and cities, you can find shapefiles and other geographic data formats from various sources, including the U.S. Census Bureau. Here are some steps and resources to help you obtain the necessary data: ### 1. U.S. Census Bureau The U.S. Census Bureau provides...
44,103
[ { "from": "human", "value": "i've been asked to generate some demographic reports (crime rates, birth/deaths, etc) based on state and cities for the USA. I have all the demographic data (provided by our client) but can't seem to find any places which have the boundaries (read: LAT/LONG's) of the USA States ...
I have some data. I want to go through that data and change cells (for example - Background color), if that data meets a certain condition. Somehow, I've not been able to figure it out how to do this seemingly easy thing in Silverlight.
In Silverlight, you can change the background color of cells in a DataGrid based on certain conditions by using data binding and styles. Here's a simple approach you can follow: ### Step 1: Define Your Data Assuming you have a collection of data that you want to bind to a DataGrid, make sure your data model has the p...
48,272
[ { "from": "human", "value": "I have some data. I want to go through that data and change cells (for example - Background color), if that data meets a certain condition. Somehow, I've not been able to figure it out how to do this seemingly easy thing in Silverlight.\n" }, { "from": "gpt", "value"...
I am creating a database using MySQL 5 for an eCommerce web site. I want the database to be as flexible as possible so that the owners of the web site can add custom attributes for various types of products. For instance, they can have a product which has 4 shirt sizes and 3 colors for each size available, or a produ...
To handle flexible attributes for your eCommerce database and allow for quantity management based on these attributes without having to create separate tables for each type of product, you can adopt a more normalized and relational database design. Here’s a suggested structure: ### Database Structure 1. **Products Ta...
48,257
[ { "from": "human", "value": "I am creating a database using MySQL 5 for an eCommerce web site. I want the database to be as flexible as possible so that the owners of the web site can add custom attributes for various types of products. For instance, they can have a product which has 4 shirt sizes and 3 c...
What mainstream frameworks, patterns, and tools would you choose to develop two projects in parallel, one in C#, one in Java, in order to minimize the total effort. (Disregard the obvious cases of interchangeable or equivalent tools, like SCC, Unit Testing, etc. Also assume generic broad RDBMS support.) "Mainstream" me...
When developing two projects in parallel, one in C# and one in Java, with the goal of minimizing total effort and maintaining mainstream acceptance, you can leverage common frameworks, patterns, and tools that promote code reuse and parallel development. Here’s a structured approach: ### 1. **Architecture and Design P...
40,302
[ { "from": "human", "value": "What mainstream frameworks, patterns, and tools would you choose to develop two projects in parallel, one in C#, one in Java, in order to minimize the total effort. (Disregard the obvious cases of interchangeable or equivalent tools, like SCC, Unit Testing, etc. Also assume gene...
I'm trying to perform a once-through read of a large file (~4GB) using Java 5.0 x64 (on Windows XP). Initially the file read rate is very fast, but gradually the throughput slows down substantially, and my machine seems very unresponsive as time goes on. I've used ProcessExplorer to monitor the File I/O statistics, and...
It sounds like you're experiencing performance degradation when reading large files in Java, and that can be attributed to several factors, especially when using `RandomAccessFile`. Here are some strategies and modifications you can make to your code to help maintain a consistent file read rate. ### Potential Issues a...
45,766
[ { "from": "human", "value": "I'm trying to perform a once-through read of a large file (~4GB) using Java 5.0 x64 (on Windows XP).\nInitially the file read rate is very fast, but gradually the throughput slows down substantially, and my machine seems very unresponsive as time goes on.\nI've used ProcessExplo...
I am looking for a tool/framework to (automatically) generate a Swing user interface to perform CRUD operations on an underlying database. I would also like to configure the database fields that should be exposed. Something like django (via modelforms) or ruby on rails features, but in a Java desktop environment.
Generating a Swing user interface for CRUD (Create, Read, Update, Delete) operations automatically based on an underlying database can indeed streamline the development process, similar to what frameworks like Django and Ruby on Rails provide for web development. While Java Swing doesn't have a built-in tool specifical...
44,569
[ { "from": "human", "value": "I am looking for a tool/framework to (automatically) generate a Swing user interface to perform CRUD operations on an underlying database.\nI would also like to configure the database fields that should be exposed. Something like django (via modelforms) or ruby on rails feature...
I have a page, where I want to dynamically add asp.net user controls. The scenario is that we want that on specific event of a control, It disposes itself and loads another control in the page. I am not able to have solution about how to do this? Anyone have decent idea?
In ASP.NET Web Forms, dynamically adding and removing user controls can be achieved by creating and managing these controls in the page's lifecycle events. Here’s a basic example to illustrate how you might accomplish this. ### Steps to Dynamically Add/Remove User Controls 1. **Create User Controls**: Create two user...
48,191
[ { "from": "human", "value": "I have a page, where I want to dynamically add asp.net user controls.\nThe scenario is that we want that on specific event of a control, It disposes itself and loads another control in the page.\nI am not able to have solution about how to do this?\nAnyone have decent idea?\n" ...
I have used checkbox column in gridview. I want to check status of that checkboxes. On click of a button it should be checked that if any checkbox is checked or not. If none checkbox is checked then it should display alert message that check checkbox first.
To achieve the functionality you described, you can follow these steps to check the status of checkboxes in a GridView when a button is clicked. This example assumes you are using ASP.NET with a Web Forms application. ### Step-by-Step Implementation 1. **Create your ASP.NET Web Forms page with a GridView and Button.*...
45,233
[ { "from": "human", "value": "I have used checkbox column in gridview. I want to check status of that checkboxes. On click of a button it should be checked that if any checkbox is checked or not. If none checkbox is checked then it should display alert message that check checkbox first.\n" }, { "from...
There is ConnectionManager which waits for incoming connections. For each incoming connection it creates a Connection instance which handles the inbound and outbound traffic on this connection. Each Connection has a Watchdog which handles "bad connection" conditions and calls registered "Listerners". One "Listener" is ...
It sounds like you are dealing with a classic case of circular dependency, where the Watchdog ends up directly or indirectly calling back into the ConnectionManager, leading to an awkward situation where one component ends up managing the lifecycle of another in a way that could create issues, such as potential deadloc...
47,002
[ { "from": "human", "value": "There is ConnectionManager which waits for incoming connections. For each incoming connection it creates a Connection instance which handles the inbound and outbound traffic on this connection. Each Connection has a Watchdog which handles \"bad connection\" conditions and calls ...
I am trying to debug an intermittent error on the iPhone, a crash with a trace that looks like: objc_message_send __invoking__ [NSInvocation invoke] HandleDelegateSource MainRunLoop .... When GDB stops, I'd like to be able to determine details about what selector the system is attempting to be invoked - I've set a bre...
To debug the crash you are encountering, you can use the GDB (or LLDB) debugging tools to examine the state of your program at the point where it stops in the `[NSInvocation invoke]` method. Specifically, you want to inspect the NSInvocation object to understand what selector it is trying to invoke. Here are the steps ...
48,464
[ { "from": "human", "value": "I am trying to debug an intermittent error on the iPhone, a crash with a trace that looks like:\nobjc_message_send\n__invoking__\n[NSInvocation invoke]\nHandleDelegateSource\nMainRunLoop\n....\n\nWhen GDB stops, I'd like to be able to determine details about what selector the sy...
I am working on Conway's Game of Life currently and have gotten stuck. My code doesn't work. When I run my code in GUI, it says: [[0 0 0 0] [0 1 1 0] [0 1 0 0] [0 0 0 0]] Traceback (most recent call last): File "C:\Users\Documents\Physics\Python\MainProject\conway.py", line 53, in b= apply_rules(a) File ...
The error you are encountering, `UnboundLocalError: local variable 'neighbours' referenced before assignment`, suggests that there is a path in your code where the variable `neighbours` is referenced before it is given a value. In your code, the issue arises in the function `apply_rules`, specifically with how you ar...
47,010
[ { "from": "human", "value": "I am working on Conway's Game of Life currently and have gotten stuck. My code doesn't work.\nWhen I run my code in GUI, it says:\n \n[[0 0 0 0]\n [0 1 1 0]\n [0 1 0 0]\n [0 0 0 0]]\n\nTraceback (most recent call last):\n File \"C:\\Users\\Documents\\Physics\\Python\\MainProjec...
i have a question about configuration fo search pages in sharepoint. There are two types of searches: contextual which searches just in current page or list (they are labelled like: This site: Name of site or This list: Name of list), they point to OSSSearchResults.aspx page custom searches which can be user defined,...
In SharePoint, contextual search results are typically tied to the specific site or list and are designed to provide results relevant to the context in which the search was initiated. However, if you want all search queries to redirect to a centralized search center, there are a few options you can explore. ### 1. **C...
44,657
[ { "from": "human", "value": "i have a question about configuration fo search pages in sharepoint. There are two types of searches:\n\ncontextual which searches just in current page or list (they are labelled like: This site: Name of site or This list: Name of list), they point to OSSSearchResults.aspx page...
What are some good examples of coding guidelines. I'm not really looking for anything specific to a single language. But what should I be doing/evaluating as I write coding guidelines? Such as how flexible should the guidelines and how much should decisions be left to the programmer or to someone else or even pre-decid...
Creating effective coding guidelines is essential for fostering a consistent and maintainable codebase, especially in collaborative environments. Here are some broad principles and examples to consider as you draft your guidelines: ### 1. Clarity and Simplicity - **Guideline**: Write clear and simple code. - **Examp...
47,134
[ { "from": "human", "value": "What are some good examples of coding guidelines. I'm not really looking for anything specific to a single language.\nBut what should I be doing/evaluating as I write coding guidelines? Such as how flexible should the guidelines and how much should decisions be left to the progr...
I have .NET app with a floating point value that I want to adjust up and down by a user adjustable increment with something like a spinner control. Before I go off and build my own, does something like this already exist?
Yes, in .NET applications, particularly when using Windows Forms or WPF, there are built-in controls that can help you achieve the functionality of adjusting a floating-point value with user-defined increments. ### For Windows Forms: You can use the `NumericUpDown` control, which supports decimal values and allows you...
45,598
[ { "from": "human", "value": "I have .NET app with a floating point value that I want to adjust up and down by a user adjustable increment with something like a spinner control. Before I go off and build my own, does something like this already exist?\n" }, { "from": "gpt", "value": "Yes, in .NET...
Hey, I'm really new to Haskell and have been using more classic programming languages my whole life. I have no idea what is going on here. I'm trying to make a very simple Viterbi algorithm implementation, but for only two states (honest and dishonest casino) I have a problem where I want to address my array, but I d...
Welcome to Haskell! Let's address your concerns and see if we can improve your implementation of the Viterbi algorithm. Your code has several issues related to type and array handling, and I'll help you fix them. ### Issues in your Code 1. **Array Creation**: You seem to be trying to create arrays in several places,...
42,230
[ { "from": "human", "value": "Hey, I'm really new to Haskell and have been using more classic programming languages my whole life. I have no idea what is going on here. I'm trying to make a very simple Viterbi algorithm implementation, but for only two states (honest and dishonest casino)\nI have a problem...
I'm tackling project euler's problem 220 (looked easy, in comparison to some of the others - thought I'd try a higher numbered one for a change!) So far I have: D = "Fa" def iterate(D,num): for i in range (0,num): D = D.replace("a","A") D = D.replace("b","B") D = D.replace("A","aRbFR") ...
You're encountering a `MemoryError` because the string grows exponentially with each iteration of your `iterate` function. In project Euler's problem 220, the goal is to work with a specific sequence of instructions (or an L-system) but generate very large strings through the substitution process, which can quickly con...
49,285
[ { "from": "human", "value": "I'm tackling project euler's problem 220 (looked easy, in comparison to some of the \nothers - thought I'd try a higher numbered one for a change!)\nSo far I have:\nD = \"Fa\"\n\ndef iterate(D,num):\n for i in range (0,num):\n D = D.replace(\"a\",\"A\")\n D = D....
I am working on a ASP.NET app and i have a need to post back to the server after a file is chosen in a FileUpload control without having to have the user explicitly click a 'submit' button. Is this possible? and if so, how?
Yes, it is possible to trigger a postback in an ASP.NET application automatically when a file is selected using a `FileUpload` control without requiring the user to explicitly click a 'submit' button. You can achieve this using JavaScript (or jQuery) to listen for changes on the `FileUpload` control and then trigger a ...
49,039
[ { "from": "human", "value": "I am working on a ASP.NET app and i have a need to post back to the server after a file is chosen in a FileUpload control without having to have the user explicitly click a 'submit' button. Is this possible? and if so, how?\n" }, { "from": "gpt", "value": "Yes, it is...
I was wondering if there was a way to bind an ArrayList (or any kind of List, for that matter) to a PreparedStatement which will eventually be used to access an Oracle database. I found: PreparedStatement IN clause alternatives? And that seems similar to my issue, but this question is more specific: I'd like to bind a...
Binding a list (like an `ArrayList`) to a `PreparedStatement` for use in an SQL `IN` clause can be challenging since JDBC does not allow you to directly bind a collection to a single placeholder. However, you can dynamically build the SQL statement based on the size of your list and set the appropriate parameters for e...
43,691
[ { "from": "human", "value": "I was wondering if there was a way to bind an ArrayList (or any kind of List, for that matter) to a PreparedStatement which will eventually be used to access an Oracle database. I found:\nPreparedStatement IN clause alternatives?\nAnd that seems similar to my issue, but this qu...
My code works (yeah!) which sends json to a server.. would appreciate any thoughts on refactoring 1) My C# code sends this json to the server {\"firstName\":\"Bill\",\"lastName\":\"Gates\",\"email\":\"asdf@hotmail.com\",\"deviceUUID\":\"abcdefghijklmnopqrstuvwxyz\"} Which I have to get rid of the slashes on the server ...
Your C# code can definitely be refactored to improve clarity and to use `application/json` for sending your data, which will eliminate the need to strip slashes on the server side. Here’s how you can refactor your code: 1. **Use `application/json` Content-Type**: Instead of sending your JSON data as a form-encoded str...
48,795
[ { "from": "human", "value": "My code works (yeah!) which sends json to a server.. would appreciate any thoughts on refactoring\n1) My C# code sends this json to the server\n{\\\"firstName\\\":\\\"Bill\\\",\\\"lastName\\\":\\\"Gates\\\",\\\"email\\\":\\\"asdf@hotmail.com\\\",\\\"deviceUUID\\\":\\\"abcdefghij...
I've just done my first little webapp in django and I love it. I'm about to start on converting an old production PHP site into django and as part its template, there is a navigation bar. In PHP, I check each nav option's URL against the current URL, in the template code and apply a CSS class if they line up. It's horr...
Congratulations on your first Django web app! When it comes to handling navigation and applying a CSS class to the active link in a Django template, you can achieve this in a cleaner way than in PHP. Django templates provide a more structured approach, and you can create custom template tags or use simple logic in your...
49,590
[ { "from": "human", "value": "I've just done my first little webapp in django and I love it. I'm about to start on converting an old production PHP site into django and as part its template, there is a navigation bar.\nIn PHP, I check each nav option's URL against the current URL, in the template code and ap...
I get this error: System.Reflection.TargetException: Object does not match target type. when trying to bind a List<IEvent> where an IEvent can be an appointment, a birthday, or a few other calendar related event types.
The `System.Reflection.TargetException: Object does not match target type` error typically occurs when you're trying to access a member on an object whose type doesn't match the expected type. This can happen when using reflection or when binding data in a context where the expected type differs from the actual type. ...
49,000
[ { "from": "human", "value": "I get this error:\nSystem.Reflection.TargetException: Object does not match target type.\nwhen trying to bind a List<IEvent> where an IEvent can be an appointment, a birthday, or a few other calendar related event types.\n" }, { "from": "gpt", "value": "The `System.R...
Python, C++, Scheme, and others all let you define functions that take a variable number of arguments at the end of the argument list... def function(a, b, *args): #etc... ...that can be called as followed: function(1, 2) function(1, 2, 5, 6, 7, 8) etc... Are there any languages that allow you to do variadic func...
Yes, there are programming languages that allow the flexibility of variadic functions with arguments placed in various positions within the argument list, including before and after the variadic parameter. However, the syntax and semantics vary widely from one language to another. Here are a few examples: ### 1. **Kot...
49,152
[ { "from": "human", "value": "Python, C++, Scheme, and others all let you define functions that take a variable number of arguments at the end of the argument list...\ndef function(a, b, *args):\n #etc...\n\n...that can be called as followed:\nfunction(1, 2)\nfunction(1, 2, 5, 6, 7, 8)\n\netc... Are there...
With SMO objects using Server.JobServer.jobs to get a list of jobs, I can find the status of each job. For those that are currently executing I would like to find the SPID it is executing on. I can also get a list of the server's processes using Server.EnumProcesses(). This gives me a list of currently active SPIDs. ...
Using SQL Server Management Objects (SMO) to retrieve the currently executing SQL Server Agent jobs and their associated session IDs (SPIDs) can be a bit tricky, as the SMO API does not directly expose a straightforward way to link job execution to SPIDs. However, you can take a cleaner approach without relying on str...
46,935
[ { "from": "human", "value": "With SMO objects using Server.JobServer.jobs to get a list of jobs, I can find the status of each job. For those that are currently executing I would like to find the SPID it is executing on. I can also get a list of the server's processes using Server.EnumProcesses(). This gi...
Is there any way for a DBA to peek in on the execution plan of a long-running query in SQL Server 2000? I know how to get the SQL being run using fn_get_sql(). And yes, theoretically if open a new connection and set the environment flags the same, it should generate the same plan for the SQL. However, I'm in a data ...
In SQL Server 2000, there are limitations compared to later versions of SQL Server when it comes to monitoring the execution plans of currently running queries. However, there are still a few approaches you can take to gather information about what the long-running query is doing: 1. **Dynamic Management Views (DMVs)*...
49,162
[ { "from": "human", "value": "Is there any way for a DBA to peek in on the execution plan of a long-running query in SQL Server 2000? I know how to get the SQL being run using fn_get_sql(). And yes, theoretically if open a new connection and set the environment flags the same, it should generate the same p...
I have a multi-threaded application that is hanging on a call to _dl_sysinfo_int80(). According to gdb, all threads are stuck in this call. The top of the stack trace looks like: #0 0x002727a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 #1 0x004f23de in __lll_mutex_lock_wait () from /lib/tls/libpthread.so.0 #2 ...
The situation you're describing, where multiple threads are hanging in `_dl_sysinfo_int80()` and ultimately in the pthread mutex lock, is indicative of a deadlock or contention issue in your multi-threaded application. Here's a breakdown of what's likely going on: ### Analysis 1. **Thread State**: Since all threads ar...
49,516
[ { "from": "human", "value": "I have a multi-threaded application that is hanging on a call to _dl_sysinfo_int80(). According to gdb, all threads are stuck in this call.\nThe top of the stack trace looks like:\n#0 0x002727a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2\n#1 0x004f23de in __lll_mutex_loc...
Since I started learning F# and OCaml last year, I've read a huge number of articles which insist that design patterns (especially in Java) are workarounds for the missing features in imperative languages. One article I found makes a fairly strong claim: Most people I've met have read the Design Patterns book by th...
The claim that functional programming (FP) can eliminate the need for certain object-oriented (OO) design patterns has some merit, but it's important to unpack this idea carefully. ### Key Differences Between OO and FP 1. **State Management**: In OO, design patterns often deal with managing state and behavior togethe...
48,993
[ { "from": "human", "value": "Since I started learning F# and OCaml last year, I've read a huge number of articles which insist that design patterns (especially in Java) are workarounds for the missing features in imperative languages. One article I found makes a fairly strong claim:\n\nMost people I've met ...
I accumulated a quite a lot of data in a raw form (csv and binary) - 4GB per day for a few months to be precise. I decided to join the civilized world and use database to access the data and I wondered what would be the correct layout; the format is quite simple: a few rows for every time tick (bid, ask, timestamp, etc...
Given your requirements and the nature of the data you’re working with, you'll want to design a database schema that optimizes for read performance, particularly since you’ll be doing time series analysis and filtering based on specific instruments and dates. Here are some recommendations for your MySQL database layout...
49,988
[ { "from": "human", "value": "I accumulated a quite a lot of data in a raw form (csv and binary) - 4GB per day for a few months to be precise.\nI decided to join the civilized world and use database to access the data and I wondered what would be the correct layout; the format is quite simple: a few rows for...
How do I achieve authorization with MVC asp.net?
Achieving authorization in an ASP.NET MVC application typically involves implementing user authentication and defining roles and permissions for users. Here’s a step-by-step guide to help you set up authorization in an ASP.NET MVC application: ### Step 1: Set Up Authentication You can use ASP.NET Identity or another ...
44,437
[ { "from": "human", "value": "How do I achieve authorization with MVC asp.net?\n" }, { "from": "gpt", "value": "Achieving authorization in an ASP.NET MVC application typically involves implementing user authentication and defining roles and permissions for users. Here’s a step-by-step guide to he...
Does anyone know how I can prevent the text in a table cell from wrapping? This is for the header of a table, and the heading is a lot longer than the data under it, but I need it to display on only one line. It is okay if the column is very wide. The HTML of my (simplified) table looks like this: <table> <thead> ...
To prevent the text in your table header from wrapping, you can use CSS to control the behavior of the `<th>` elements. Here are a few techniques you can apply: 1. **Set `white-space` Property**: You can use the `white-space` CSS property to prevent the text from wrapping. Specifically, you can set it to `nowrap`. ...
48,997
[ { "from": "human", "value": "Does anyone know how I can prevent the text in a table cell from wrapping? This is for the header of a table, and the heading is a lot longer than the data under it, but I need it to display on only one line. It is okay if the column is very wide.\nThe HTML of my (simplified) ...
I'm building a winForms app in NET3.5SP1 using VS2008Express. Am trying to deserialize an object using the System.Web.Script.Serialization library. The error is: Type 'jsonWinForm.Category' is not supported for deserialization of an array. Cheers! using System; using System.Collections.Generic; using System.ComponentM...
The error message you are encountering, "Type 'jsonWinForm.Category' is not supported for deserialization of an array," suggests that the JSON response you are receiving from the specified URL (`http://www.davemateer.com/ig/genius/category.php`) is an array of objects rather than a single object. In your current code,...
49,912
[ { "from": "human", "value": "I'm building a winForms app in NET3.5SP1 using VS2008Express. Am trying to deserialize an object using the System.Web.Script.Serialization library.\nThe error is: Type 'jsonWinForm.Category' is not supported for deserialization of an array.\nCheers!\nusing System;\nusing System...
Can someone suggest a small webserver implementation that will illustrate the concepts of what a webserver does? It should be in a language that is easily read, and understood, and should implement security and cgi, maybe javascript?
Certainly! A simple web server can be created using Python, which is known for its readability and ease of use. We can use the built-in `http.server` module to illustrate basic web server concepts, including serving HTML pages and handling CGI (Common Gateway Interface) for dynamic content. For security, we can impleme...
40,790
[ { "from": "human", "value": "Can someone suggest a small webserver implementation that will illustrate the concepts of what a webserver does? It should be in a language that is easily read, and understood, and should implement security and cgi, maybe javascript? \n" }, { "from": "gpt", "value"...
I'd like to create an abstraction in OpenGL of the environment settings(blending, stenciling, depth, etc.) that works like the matrix stack. Push onto the stack, make any changes you need, draw your objects, then pop the stack and go back to the prior settings. For example, currently you might have drawing code like th...
To implement an environment settings stack in OpenGL while ensuring that you can track and manage changes made by other parts of your application (or third-party libraries), you can follow a few strategies without needing to modify OpenGL's internal functions directly. ### Option 1: Create a Wrapper for OpenGL Calls ...
49,616
[ { "from": "human", "value": "I'd like to create an abstraction in OpenGL of the environment settings(blending, stenciling, depth, etc.) that works like the matrix stack. Push onto the stack, make any changes you need, draw your objects, then pop the stack and go back to the prior settings.\nFor example, cur...
I'm writing an MFC App to automatically configure Postgresql with ODBC for use by another app. The idea being that the user runs the app and it automatically creates the database and the tables within it. My problem is that when I set up the File DSN it seems to require the name of the database it will access. This app...
In ODBC, a Data Source Name (DSN) is essentially a set of configuration options that specify how to connect to a particular database. The `DATABASE` parameter is crucial because it defines which database the DSN will connect to. Unfortunately, you cannot leave it blank or omit it entirely if you expect to connect to Po...
46,274
[ { "from": "human", "value": "I'm writing an MFC App to automatically configure Postgresql with ODBC for use by another app. The idea being that the user runs the app and it automatically creates the database and the tables within it. My problem is that when I set up the File DSN it seems to require the name...
I use svn:externals to reference several open source projects. I then make some local changes to one of these external projects. Obviously I cannot check these changes back into the external repository. How do I keep these changes in my repository while still maintaining the ability to easily incorporate external chang...
When using Subversion (SVN) and `svn:externals` to reference external projects, managing local changes while still keeping track of upstream changes can be tricky. Here are a few strategies you can use to maintain your local modifications while still being able to update to newer versions of the external project. ### ...
45,324
[ { "from": "human", "value": "I use svn:externals to reference several open source projects. I then make some local changes to one of these external projects. Obviously I cannot check these changes back into the external repository. How do I keep these changes in my repository while still maintaining the abi...
I have this .NET web app that draws a table in Page_Load. Then after that it handles the events, which should change the table drawn in Page_Load. This is very inefficient. Is there a way to execute the code (which draws the table) after it finishes handling all events? (instead of doing it in Page_Load) Thank you in a...
Yes, you can achieve this in a .NET Web Forms application by using the `Page.PreRender` event instead of the `Page_Load` event to draw your table. The `PreRender` event occurs after all events have been processed and just before the rendering of the page is completed. This allows you to handle any events and then rende...
48,794
[ { "from": "human", "value": "I have this .NET web app that draws a table in Page_Load.\nThen after that it handles the events, which should change the table drawn in Page_Load.\nThis is very inefficient.\nIs there a way to execute the code (which draws the table) after it finishes handling all events? (inst...
I know that the compiler will sometimes initialize memory with certain patterns such as 0xCD and 0xDD. What I want to know is when and why this happens. When Is this specific to the compiler used? Do malloc/new and free/delete work in the same way with regard to this? Is it platform specific? Will it occur on other op...
Your questions about memory initialization patterns like `0xCD` and `0xDD` are pertinent to understanding debugging techniques in C/C++ and how they may vary across different compilers, platforms, and operating systems. Below, I'll address each of your questions systematically: ### When 1. **Is this specific to the c...
48,889
[ { "from": "human", "value": "I know that the compiler will sometimes initialize memory with certain patterns such as 0xCD and 0xDD. What I want to know is when and why this happens.\nWhen\nIs this specific to the compiler used?\nDo malloc/new and free/delete work in the same way with regard to this?\nIs it...
To me at least, the Pair class is a very multi-purpose class. So why did Microsoft put it into the System.Web.UI namespace? Is there a reason that my tiny brain cannot comprehend? Thanks.
The `Pair` class in the .NET Framework is indeed located in the `System.Web.UI` namespace, which can seem a bit confusing at first, especially considering its versatile nature. The primary reason for this is historical context and intended use. ### Reasons for Placement in `System.Web.UI` 1. **Web Forms Design**: The...
49,570
[ { "from": "human", "value": "To me at least, the Pair class is a very multi-purpose class. So why did Microsoft put it into the System.Web.UI namespace?\nIs there a reason that my tiny brain cannot comprehend?\nThanks.\n" }, { "from": "gpt", "value": "The `Pair` class in the .NET Framework is i...
I'm using python and I need to map locations like "Bloomington, IN" to GPS coordinates so I can measure distances between them. What Geocoding libraries/APIs do you recommend? Solutions in other languages are also welcome.
There are several libraries and APIs in Python and other languages that can help you geocode addresses (like "Bloomington, IN") into GPS coordinates (latitude and longitude). Here are some popular options: ### Python Libraries: 1. **Geopy** - **Description**: A Python client for several popular geocoding web servi...
46,764
[ { "from": "human", "value": "I'm using python and I need to map locations like \"Bloomington, IN\" to GPS coordinates so I can measure distances between them.\nWhat Geocoding libraries/APIs do you recommend? Solutions in other languages are also welcome.\n" }, { "from": "gpt", "value": "There ar...
I'm trying to learn how to do passphrase-based encryption with Java. I'm finding several examples online, but none (yet) on Stack Overflow. The examples are a little light on explanation for me, particularly regarding algorithm selection. There seems to be a lot of passing strings around to say what algorithms to us...
Certainly! To implement passphrase-based encryption and decryption in Java, you can use Java's built-in libraries without needing any third-party packages. Below is a straightforward introduction along with example code for encrypting and decrypting data using the Java Cryptography Architecture (JCA). ### Overview of ...
45,846
[ { "from": "human", "value": "I'm trying to learn how to do passphrase-based encryption with Java. I'm finding several examples online, but none (yet) on Stack Overflow. The examples are a little light on explanation for me, particularly regarding algorithm selection. There seems to be a lot of passing st...
Here's the deal. My WinApp is running, right? in let's say process 'A'.It creates a file and keeps the handle (keeps the file open for writing, this is a must). Then it starts other msbuild process, let's call it 'B'. This process is started with the System.Diagnostic.Process class. At some point, my WinApp (A) needs...
You're encountering a situation where a file handle created in one process is preventing that file from being deleted by another process due to the file being in use. Here's a breakdown of your questions and potential solutions: ### 1. Preventing Process B from Using File Handles When you start another process (Proce...
49,676
[ { "from": "human", "value": "Here's the deal. \nMy WinApp is running, right? in let's say process 'A'.It creates a file and keeps the handle (keeps the file open for writing, this is a must).\nThen it starts other msbuild process, let's call it 'B'. This process is started with the System.Diagnostic.Proces...
I'm looking to inspect SQL statements in Java/jdbc code to ensure that the SQL to be executed is of acceptable quality. Neither PMD not Findbugs appears to have JDBC or sql rules. I could use p6spy to log the SQL and look at that way, but this is manual. I'm wondering if the strategy of of using PMD/Findbugs/etc to c...
Creating a custom static analysis rule to check for parameterized SQL statements in Java code using tools like PMD or FindBugs (now known as SpotBugs) is an interesting idea, but it would require a bit of work. Here's how you can approach this: ### Steps to Create a Custom Rule 1. **Understand the Tools:** - **PMD...
46,842
[ { "from": "human", "value": "I'm looking to inspect SQL statements in Java/jdbc code to ensure that the SQL to be executed is of acceptable quality. Neither PMD not Findbugs appears to have JDBC or sql rules. I could use p6spy to log the SQL and look at that way, but this is manual. \nI'm wondering if the ...
Ok here's what I'm trying to do I want to write a class that inherits everything from the class ListItem class RealListItem : ListItem { public string anExtraStringINeed; } For some reason or another .net is treating all the members like they are private when I try to do this so my class is worthless. I tried to d...
Based on your description, it sounds like you're trying to create a subclass (`RealListItem`) that inherits from a class called `ListItem`. You mentioned that all members are treated as private, which suggests that the properties or fields in the `ListItem` class are not accessible due to their access modifiers. ### P...
47,676
[ { "from": "human", "value": "Ok here's what I'm trying to do I want to write a class that inherits everything from the class ListItem\nclass RealListItem : ListItem\n{\n\n public string anExtraStringINeed;\n\n}\n\nFor some reason or another .net is treating all the members like they are private when I try ...
I have written my program in c# .net. I want to convert it in to a powershell cmdlet. I was instructed to use pssnapin and getproc programs. Can anyone plz help me out.. Regards Arun
Creating a PowerShell cmdlet from a C# .NET application involves a few steps. Since you're specifically instructed to use PSSnapin and the `getproc` programs, I'll guide you through the general process. Note that PSSnapins are an older method of extending PowerShell; for new projects, you might want to consider using P...
49,017
[ { "from": "human", "value": "I have written my program in c# .net. I want to convert it in to a powershell cmdlet. I was instructed to use pssnapin and getproc programs. Can anyone plz help me out..\nRegards\nArun\n" }, { "from": "gpt", "value": "Creating a PowerShell cmdlet from a C# .NET appli...
Ok, I'm doing a bunch of RIA/AJAX stuff and need to create a "pretty", custom confirm box which is a DIV (not the built-in javascript confirm). I'm having trouble determining how to accomplish a pause in execution to give the user a chance to accept or decline the condition before either resuming or halting execution. ...
Creating a custom confirm dialog that allows for pausing execution in a sequence of checks can be a bit tricky since JavaScript runs in a single-threaded manner. However, you can achieve this using promises to handle the asynchronous nature of user interaction. Here's a conceptual way to implement this using Promises ...
48,658
[ { "from": "human", "value": "Ok, I'm doing a bunch of RIA/AJAX stuff and need to create a \"pretty\", custom confirm box which is a DIV (not the built-in javascript confirm). I'm having trouble determining how to accomplish a pause in execution to give the user a chance to accept or decline the condition be...
I have a main form and as sub form. I need the main Form to display the sub Form and pass into the constructor an object. When the sub Form is done it needs to destroy itself so the cycle can be repeated. Currently I declared the sub form globaly Public GlobalWindowBookmark As WindowEditBookmark I then create the f...
It sounds like you're trying to manage a scenario where a main form can open a subform, pass data to it via its constructor, and ensure that the subform is properly disposed of after it's done being used, avoiding issues with multiple instances of the subform. Instead of using a global variable to hold the reference ...
47,799
[ { "from": "human", "value": "I have a main form and as sub form. I need the main Form to display the sub Form and pass into the constructor an object. When the sub Form is done it needs to destroy itself so the cycle can be repeated.\nCurrently I declared the sub form globaly \nPublic GlobalWindowBookmark...
I asked the question: What's with those Do-Not-Use Javascript People and many people said that Javascript allows security exploits through client-side attacks. So I need to follow up and understand the how bad the nature of these attacks are: I'd like to hear some detailed descriptions of actual attacks or damage caus...
While I don't have personal experiences or anecdotes to share, I can provide you with a general understanding of how JavaScript can be exploited and the potential damage that can result from such attacks. Here are some types of attacks that can occur through JavaScript, along with their implications: ### 1. **Cross-Si...
47,563
[ { "from": "human", "value": "I asked the question:\nWhat's with those Do-Not-Use Javascript People and many people said that Javascript allows security exploits through client-side attacks. \nSo I need to follow up and understand the how bad the nature of these attacks are:\nI'd like to hear some detailed d...
I’m working on an in-house app that tracks a bunch of tasks. I wanted to have a simple task monitor that would list the task name and the task’s status. I need this to look just a little nice, I’m no designer so whatever I do is going to suck, but a basic text display won’t work for the project requirements. What I am ...
Creating a task monitor that visually represents the status of tasks in a way that is both appealing and functional can be achieved using a combination of Swing components in Java. It sounds like you want a custom component that can handle the display of multiple tasks with their progress and allow for selection of the...
49,701
[ { "from": "human", "value": "I’m working on an in-house app that tracks a bunch of tasks. I wanted to have a simple task monitor that would list the task name and the task’s status. I need this to look just a little nice, I’m no designer so whatever I do is going to suck, but a basic text display won’t work...
I am trying to learn & create Visual Studio templates and as per this MSDN article, The simplest type of template to create is an item template. To do so, simply open a project that includes the file you want to use as a template and then chooses File | Export Template to run the Export Template Wizard N...
The "Export Template" option in Visual Studio 2005 should generally be available in the Team Suite edition. However, if you are not seeing the option, here are some steps and suggestions to troubleshoot the issue: ### Steps to Enable the "Export Template" Option 1. **Ensure the Correct Environment**: - Make sure t...
44,764
[ { "from": "human", "value": "I am trying to learn & create Visual Studio templates and as per this MSDN article, \n\nThe simplest type of template to\n create is an item template. To do so,\n simply open a project that includes\n the file you want to use as a template\n and then chooses File | Export\n ...
It seems with the built in friendly routing library in .NET MVC, it would allow us to do something like this. In case it's not obvious what I want to with the built in stuff in .NET MVC, I want to a url starting with www to be automatically redirected to a non-www url using the MVC framework.
To redirect requests from a URL starting with "www" to a non-www version in an ASP.NET MVC application, you can achieve this using URL rewriting or a custom action filter. Below, I'll describe a few approaches to accomplish this. ### Approach 1: Using URL Rewriting in `web.config` One of the simplest ways to enforce ...
48,737
[ { "from": "human", "value": "It seems with the built in friendly routing library in .NET MVC, it would allow us to do something like this.\nIn case it's not obvious what I want to with the built in stuff in .NET MVC, I want to a url starting with www to be automatically redirected to a non-www url using the...
I've got some P/Invoke code that invokes DBGHELP.DLL. I'll add the signatures to pinvoke.net later. The version of DBGHELP.DLL that ships with Windows 2003 is too old, and my code requires the version of DBGHELP.DLL that shipped with "Debugging Tools for Windows" version 6.9. How do I do one of the following? Ensure t...
To address your question about using P/Invoke with `DBGHELP.DLL`, particularly in ensuring that a specific version is used, you can follow a two-step approach: 1. **Determine the Loaded DLL Version:** You can use `FileVersionInfo` in combination with the `GetModuleHandle` and `GetModuleFileName` Win32 API functions...
45,415
[ { "from": "human", "value": "I've got some P/Invoke code that invokes DBGHELP.DLL. I'll add the signatures to pinvoke.net later.\nThe version of DBGHELP.DLL that ships with Windows 2003 is too old, and my code requires the version of DBGHELP.DLL that shipped with \"Debugging Tools for Windows\" version 6.9....
I've isolated the behaviour into the following test case. I'd be grateful to anyone who can tell me how to expect/verify a property set for a List<T> property - it appears there's something going on inside It.Is<T>(predicate) that isn't making a whole lot of sense to me right now. Sample code will run as a console app ...
In the code you've provided, you're trying to set up expectations for a property that is of type `List<string>`, but you're encountering issues with verifying those expectations using Moq. The problem lies in how Moq handles property sets, especially when it comes to generic collections. Here are the adjustments neede...
48,577
[ { "from": "human", "value": "I've isolated the behaviour into the following test case. I'd be grateful to anyone who can tell me how to expect/verify a property set for a List<T> property - it appears there's something going on inside It.Is<T>(predicate) that isn't making a whole lot of sense to me right no...
I need to invoke getoptlong multiple times, but after the first time ARGV is empty.
The `getopt_long` function (and similar `getopt` functions) modifies the `argv` array as it processes command-line options. Specifically, it removes the options that it consumes, which can leave `argv` with fewer entries after the first invocation. If you need to call `getopt_long` multiple times in the same program, y...
47,092
[ { "from": "human", "value": "I need to invoke getoptlong multiple times, but after the first time ARGV is empty.\n" }, { "from": "gpt", "value": "The `getopt_long` function (and similar `getopt` functions) modifies the `argv` array as it processes command-line options. Specifically, it removes t...
I have a problem with the form I'm using in my webpage. It allows the recaptcha but It also sends the email without validating the fields in the recaptcha box. This form is using Ajax and PHP. I've pasted the code next: <br> <br> <div id="fields"> <form action="javascript:alert('success!');"> <label>Nombre</label><IN...
It looks like you're trying to implement a reCAPTCHA validation in your form, but you're currently checking the reCAPTCHA server-side, without making sure the fields are validated before the AJAX call is made. Since the form is using AJAX, we need to ensure that the validation occurs before attempting to send the form ...
46,059
[ { "from": "human", "value": "I have a problem with the form I'm using in my webpage. \nIt allows the recaptcha but It also sends the email without validating the fields in the recaptcha box. This form is using Ajax and PHP.\nI've pasted the code next:\n<br> <br> <div id=\"fields\">\n\n<form action=\"javascr...
In an application I need to execute other programs with another user's credentials. Currently I use System.Diagnostics.Process.Start to execute the program: public static Process Start( string fileName, string arguments, string userName, SecureString password, string domain ) However this function does ...
To start a process with another user's credentials and ensure that the roaming profile is loaded, you generally have a few different options. Using `runas` is a common approach but, as you pointed out, it requires the user to enter their password. To achieve this programmatically while maintaining the security of the c...
41,404
[ { "from": "human", "value": "In an application I need to execute other programs with another user's credentials. Currently I use System.Diagnostics.Process.Start to execute the program:\npublic static Process Start(\n string fileName,\n string arguments,\n string userName,\n SecureString password,\n...
I'm having an extremely weird problem with a PHP script of mine. I'm uploading a couple of files and having PHP put them all in one folder. I've have trouble with random files being sent and random ones not being sent. So I debugged it and I got a very weird result from the $_FILES[] array. I tried it with 3 files. $_F...
It looks like you're experiencing issues with handling multiple file uploads using the `$_FILES` superglobal in PHP. The primary issue appears to be related to how you're accessing the files in the `$_FILES` array. When uploading multiple files, you should ensure that your HTML form is set up correctly to handle file ...
43,804
[ { "from": "human", "value": "I'm having an extremely weird problem with a PHP script of mine.\nI'm uploading a couple of files and having PHP put them all in one folder.\nI've have trouble with random files being sent and random ones not being sent. So I debugged it and I got a very weird result from the $_...
private int DBUpdate() { DAL dal = new DAL(); string upd = "UPDATE [RPform] SET [ProjectName] = '@pname', [ProjectCode] = '@pcode', [Country] = @cnt, "; upd += "[StartDate] = '@startdate', [FinishDate] = '@finishdate', [TotalParticipants] = @totpart, [ArrivalDate] = '@arrivedate', "; upd += "[AirportTransfer] = @ai...
The issue you're encountering, where the query returns 0 rows affected despite working correctly when executed directly in MS Access, often arises from the way parameters are handled in your SQL string, especially with respect to string formatting and the handling of single quotes. Let's address a few potential problem...
49,364
[ { "from": "human", "value": "private int DBUpdate()\n {\nDAL dal = new DAL();\nstring upd = \"UPDATE [RPform] SET [ProjectName] = '@pname', [ProjectCode] = '@pcode', [Country] = @cnt, \";\nupd += \"[StartDate] = '@startdate', [FinishDate] = '@finishdate', [TotalParticipants] = @totpart, [ArrivalDate] = '...
What are the basic steps for Agile software development? And how you start a new project with agile methodology?
Agile software development is a flexible and iterative approach to software development that emphasizes collaboration, customer feedback, and rapid releases. Here are the basic steps involved in Agile software development: ### Basic Steps for Agile Software Development: 1. **Concept/Initiation**: - Identify the p...
48,738
[ { "from": "human", "value": "What are the basic steps for Agile software development?\nAnd how you start a new project with agile methodology? \n" }, { "from": "gpt", "value": "Agile software development is a flexible and iterative approach to software development that emphasizes collaboration,...
I currently have code in my ApplicationController to check if a user is logged in and has the required access to perform a given action (the tests take place in a before_filter). I require the same functionality in the views to decide if I should be showing the admin links in a list view, but how do I best avoid duplic...
To avoid code duplication while maintaining clarity and organization in your Rails application, you can follow these approaches: ### 1. Use a Policy Object (Pundit or similar) Instead of defining access methods in both the User model and the ApplicationController, you can use a policy object pattern. If you're using ...
48,535
[ { "from": "human", "value": "I currently have code in my ApplicationController to check if a user is logged in and has the required access to perform a given action (the tests take place in a before_filter).\nI require the same functionality in the views to decide if I should be showing the admin links in a...
I keep a cache of transactions to flush (to persistent storage) on the event of a watermark or object finalization. Since __del__ is no longer guaranteed to be called on every object, is the appropriate approach to hook a similar function (or __del__ itself) into atexit.register (during initialization)? If I'm not mist...
You're correct that relying on `__del__` for resource cleanup can lead to issues, especially given that it's not guaranteed to be called under all circumstances. Using `atexit.register` to handle cleanup tasks is indeed a more robust approach, but as you mentioned, it does come with the implication that the object (and...
48,970
[ { "from": "human", "value": "I keep a cache of transactions to flush (to persistent storage) on the event of a watermark or object finalization. Since __del__ is no longer guaranteed to be called on every object, is the appropriate approach to hook a similar function (or __del__ itself) into atexit.register...
How do I calculate distance between two GPS coordinates (using latitude and longitude)?
To calculate the distance between two GPS coordinates specified by their latitude and longitude, you can use the Haversine formula. This formula accounts for the curvature of the Earth, making it a great choice for calculating distances between two points on the globe. ### Haversine Formula The Haversine formula is g...
45,816
[ { "from": "human", "value": "How do I calculate distance between two GPS coordinates (using latitude and longitude)?\n" }, { "from": "gpt", "value": "To calculate the distance between two GPS coordinates specified by their latitude and longitude, you can use the Haversine formula. This formula a...
I have a J2EE-based system which is running currently on Apache Tomcat. We are in discussions to move our production servers to the Glassfish server. Can someone share their experiences with either of them?
Both Apache Tomcat and GlassFish are popular choices for deploying Java EE (now Jakarta EE) applications, but they cater to different needs and scenarios. Below are some experiences and considerations for each: ### Apache Tomcat **Pros:** 1. **Lightweight and Simple**: Tomcat is a servlet container, not a full Java E...
47,932
[ { "from": "human", "value": "I have a J2EE-based system which is running currently on Apache Tomcat. We are in discussions to move our production servers to the Glassfish server.\nCan someone share their experiences with either of them?\n" }, { "from": "gpt", "value": "Both Apache Tomcat and Gla...
What's the best way to authenticate and track user authentication state from page to page? Some say session state, some say cookies? Could I just use a session variable that has the ID of the user and upon authentication, instatiate a custom User class that has the User's information. Then, on every page, verify the s...
When it comes to authenticating users and tracking their authentication state across different pages, there are various methods you can use, each with its advantages and disadvantages. The approach you choose often depends on the specific needs of your application, such as security requirements, user experience, and sc...
47,643
[ { "from": "human", "value": "What's the best way to authenticate and track user authentication state from page to page? Some say session state, some say cookies? \nCould I just use a session variable that has the ID of the user and upon authentication, instatiate a custom User class that has the User's info...
I'm looking for a high performance Java library for fuzzy string search. There are numerous algorithms to find similar strings, Levenshtein distance, Daitch-Mokotoff Soundex, n-grams etc. What Java implementations exists? Pros and cons for them? I'm aware of Lucene, any other solution or Lucene is best? I found these, ...
When it comes to fuzzy string searching in Java, there are several libraries and implementations you can consider beyond Apache Lucene. Each has its strengths and weaknesses depending on your specific use case and requirements. Here's an overview of some popular Java libraries and their pros and cons: ### 1. Apache Lu...
44,597
[ { "from": "human", "value": "I'm looking for a high performance Java library for fuzzy string search.\nThere are numerous algorithms to find similar strings, Levenshtein distance, Daitch-Mokotoff Soundex, n-grams etc.\nWhat Java implementations exists? Pros and cons for them? I'm aware of Lucene, any other ...