instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I am starting a new job on Monday. The company has a home grown enterprise case management application written in ASP.NET/VB.NET. They are attempting to implement an Agile development process. They have gone so far as to get two people Scrum Master certified and hire an Agile coach. They are currently focused on 6-9 mo...
Congratulations on your new job! Getting familiar with a legacy codebase and adjusting to Agile practices can be a rewarding challenge. Here are some approaches and tooling suggestions that can help you quickly become productive in your new environment: ### 1. **Understand the Domain:** - **Documentation:** Look fo...
20,065
[ { "from": "human", "value": "I am starting a new job on Monday. The company has a home grown enterprise case management application written in ASP.NET/VB.NET. They are attempting to implement an Agile development process. They have gone so far as to get two people Scrum Master certified and hire an Agile co...
Is there a way to deploy a Java program in a format that is not reverse-engineerable? I know how to convert my application into an executable JAR file, but I want to make sure that the code cannot be reverse engineered, or at least, not easily. Obfuscation of the source code doesn't count... it makes it harder to und...
While it's important to understand that no solution can make Java bytecode completely reverse-engineerable, there are strategies to make it significantly more difficult. Here are some methods you can consider for protecting your Java application: ### 1. **Obfuscation** You mentioned that obfuscation does not completel...
22,532
[ { "from": "human", "value": "Is there a way to deploy a Java program in a format that is not reverse-engineerable? \nI know how to convert my application into an executable JAR file, but I want to make sure that the code cannot be reverse engineered, or at least, not easily. \nObfuscation of the source code...
In an asp.net application, i would like to use a webservice to return the username associated with the session id passed as a parameter. We're currently using InProc session store. Is it possible to do this ? Edit: what i'm trying to do is get information about another session than the current one. I'm not trying to ge...
In an ASP.NET application using InProc session state, each session's data is stored in memory on the server. This means that session data is typically isolated to the current application instance and is not directly accessible from another session. However, since you are trying to retrieve information about another ses...
22,376
[ { "from": "human", "value": "In an asp.net application, i would like to use a webservice to return the username associated with the session id passed as a parameter. We're currently using InProc session store.\nIs it possible to do this ?\nEdit: what i'm trying to do is get information about another session...
Where I work, we maintain an FTP site that needs occasional cleanup. Are there any tools out there to create a site map of an FTP site? It would greatly simplify clean up tasks. Thanks!
Yes, there are several tools and methods you can use to create a site map of an FTP site, which can help simplify your cleanup tasks. Here are a few options: 1. **FileZilla**: - FileZilla is a popular FTP client that allows you to connect to your FTP server and browse its contents. You can manually export the direc...
22,662
[ { "from": "human", "value": "Where I work, we maintain an FTP site that needs occasional cleanup.\nAre there any tools out there to create a site map of an FTP site? It would greatly simplify clean up tasks.\nThanks!\n" }, { "from": "gpt", "value": "Yes, there are several tools and methods you c...
I can't seem to find an easy to use, .net native way to get Comboboxes on .net winforms to display one value and return another based on the selection without creating my own helper class, with the knowledge that winforms is going to display the ToString method on the object that you put in it. This is how I'm doing it...
In WinForms, it's common to encounter the need to display different information in a `ComboBox` while returning a different value upon selection. Your current approach with a helper class (`ListItem`) is a valid solution, but there are a few alternative techniques you might consider that can streamline your code. ### ...
20,878
[ { "from": "human", "value": "I can't seem to find an easy to use, .net native way to get Comboboxes on .net winforms to display one value and return another based on the selection without creating my own helper class, with the knowledge that winforms is going to display the ToString method on the object tha...
How do I stop a Java process gracefully in Linux and Windows? When does Runtime.getRuntime().addShutdownHook get called, and when does it not? What about finalizers, do they help here? Can I send some sort of signal to a Java process from a shell? I am looking for preferably portable solutions.
Stopping a Java process gracefully, as well as understanding how shutdown hooks and finalizers work, involves several aspects. Let's break down your questions step by step. ### Stopping a Java Process Gracefully **On Linux:** To stop a Java process gracefully, you can send it a `SIGTERM` signal. This can be done usin...
21,116
[ { "from": "human", "value": "How do I stop a Java process gracefully in Linux and Windows?\nWhen does Runtime.getRuntime().addShutdownHook get called, and when does it not?\nWhat about finalizers, do they help here?\nCan I send some sort of signal to a Java process from a shell?\nI am looking for preferably...
I want to convert a number between 0 and 4096 ( 12-bits ) to its 3 character hexadecimal string representation in C#. Example: 2748 to "ABC"
To convert a number between 0 and 4096 to its 3-character hexadecimal string representation in C#, you can use the `ToString` method with the appropriate format specifier. Here's how you can do that: ```csharp using System; class Program { static void Main() { int number = 2748; // Example number ...
22,560
[ { "from": "human", "value": "I want to convert a number between 0 and 4096 ( 12-bits ) to its 3 character hexadecimal string representation in C#. \nExample:\n\n2748 to \"ABC\"\n\n" }, { "from": "gpt", "value": "To convert a number between 0 and 4096 to its 3-character hexadecimal string represe...
I often have nothing more than an FTP access to a server on which the application is placed. What I usually use now is "Keeping remote directory up to date" feature of WinSCP. Files of the local copy (in theory at least) keep being uploaded to a remote server as soon as they get saved and then all I need is to refresh ...
Your current approach of using WinSCP's "Keeping remote directory up to date" feature is indeed a straightforward way to manage file uploads via FTP, but there are certainly more efficient workflows and tools that can improve your development experience. Here are some alternatives and suggestions: ### 1. **Use a More ...
19,370
[ { "from": "human", "value": "I often have nothing more than an FTP access to a server on which the application is placed.\nWhat I usually use now is \"Keeping remote directory up to date\" feature of WinSCP. Files of the local copy (in theory at least) keep being uploaded to a remote server as soon as they ...
Does a new SessionFactory and Session object have to be created for each database? I have a data store for my application data, and a separate data store for my employee security, which is used to validate users. Do I have to create a new SessionFactory ans Session object for calls to the 2 different databases?
Yes, when you are working with multiple databases in a Hibernate application, you typically need to create a separate `SessionFactory` for each database. Each `SessionFactory` is designed to work with a specific database configuration, which includes the database URL, username, password, and other properties. Therefore...
18,617
[ { "from": "human", "value": "Does a new SessionFactory and Session object have to be created for each database? I have a data store for my application data, and a separate data store for my employee security, which is used to validate users. Do I have to create a new SessionFactory ans Session object for ca...
It seems like this should be straightforward but I'm boggling. I've got my listview all setup and bound to my LINQ datasource. The source is dependent on a dropdown list which decides which branch information to show in the listview. My edit template works fine but my insert template won't work because it wants the ...
To bind the value of a dropdown list outside of your ListView to the InsertItemTemplate of your ListView, you'll need to follow a couple of steps. Here's how you can accomplish this: 1. **Define your DropDownList**: Ensure you have a DropDownList control with a method to select the branch and handle its selected value...
20,245
[ { "from": "human", "value": "It seems like this should be straightforward but I'm boggling. I've got my listview all setup and bound to my LINQ datasource. The source is dependent on a dropdown list which decides which branch information to show in the listview. My edit template works fine but my insert ...
Taking over some code from my predecessor and I found a query that uses the Like operator: SELECT * FROM suppliers WHERE supplier_name like '%'+name+%'; Trying to avoid SQL Injection problem and parameterize this but I am not quite sure how this would be accomplished. Any suggestions ? note, I need a solution for clas...
To parameterize your SQL query in ADO.NET and avoid SQL injection vulnerabilities, you need to use parameters in your command instead of concatenating strings directly into your SQL query. Here's how you can do it for the `LIKE` operator in your scenario. Assuming `name` is a variable holding the search term, you can ...
22,372
[ { "from": "human", "value": "Taking over some code from my predecessor and I found a query that uses the Like operator:\nSELECT * FROM suppliers\nWHERE supplier_name like '%'+name+%';\n\nTrying to avoid SQL Injection problem and parameterize this but I am not quite sure how this would be accomplished. Any s...
I want to create an alias for a class name. The following syntax would be perfect: public class LongClassNameOrOneThatContainsVersionsOrDomainSpecificName { ... } public class MyName = LongClassNameOrOneThatContainsVersionOrDomainSpecificName; but it won't compile. Example Note This example is provided for conven...
You are correct that C# does not allow the creation of aliases for class names in the way you described (i.e., using `public class MyName = LongClassName;`). In C#, class names are fixed and cannot be directly aliased. Here's a summary of the approaches to your problem, along with their limitations: 1. **Inheritance...
25,178
[ { "from": "human", "value": "I want to create an alias for a class name. The following syntax would be perfect:\npublic class LongClassNameOrOneThatContainsVersionsOrDomainSpecificName\n{\n ...\n}\n\npublic class MyName = LongClassNameOrOneThatContainsVersionOrDomainSpecificName;\n\nbut it won't compile.\...
i have several common elements (components), that will generate some html. it seems my options are creating a taglib, or just putting that logic into a jsp page and including the jsp. whats the difference? positives vs negatives?
When deciding between creating a tag library (taglib) or including JSPs in your pages for generating HTML from common elements, you have to consider several factors, including maintainability, reusability, clarity, and performance. Let's break down the differences, along with their pros and cons. ### Tag Library (Tagl...
21,601
[ { "from": "human", "value": "i have several common elements (components), that will generate some html. it seems my options are creating a taglib, or just putting that logic into a jsp page and including the jsp.\nwhats the difference? positives vs negatives?\n" }, { "from": "gpt", "value": "Whe...
I need to create at runtime instances of a class that uses generics, like class<T>, without knowing previously the type T they will have, I would like to do something like that: public Dictionary<Type, object> GenerateLists(List<Type> types) { Dictionary<Type, object> lists = new Dictionary<Type, object>(); fo...
In C#, you can't use a `Type` object directly as a generic parameter for creating instances of generic types like `List<T>`. However, you can achieve your goal using reflection. To create instances of a generic type at runtime, you can use `Activator.CreateInstance` in combination with `MakeGenericType` method. Here'...
23,420
[ { "from": "human", "value": "I need to create at runtime instances of a class that uses generics, like class<T>, without knowing previously the type T they will have, I would like to do something like that:\npublic Dictionary<Type, object> GenerateLists(List<Type> types)\n{\n Dictionary<Type, object> lis...
I have found that when I execute the show() method for a contextmenustrip (a right click menu), if the position is outside that of the form it belongs to, it shows up on the taskbar also. I am trying to create a right click menu for when clicking on the notifyicon, but as the menu hovers above the system tray and not i...
The issue you're experiencing with the `ContextMenuStrip` showing up on the taskbar when it is displayed from a `NotifyIcon` can often be attributed to the fact that when the `ContextMenuStrip` is shown at the cursor's position, it can sometimes behave differently compared to when it is shown in the context of a form. ...
23,789
[ { "from": "human", "value": "I have found that when I execute the show() method for a contextmenustrip (a right click menu), if the position is outside that of the form it belongs to, it shows up on the taskbar also.\nI am trying to create a right click menu for when clicking on the notifyicon, but as the m...
I have a Stored Procedure that rolls-back a series of operations. I want to call this from within another SP. The problem is that the inner SP returns a record set with a single value that indicates the degree of success. This approach worked well and has some advantages in our context, but in retrospect, I would hav...
You can indeed call a stored procedure (SP) that returns a result set and capture that result in another stored procedure, even if the inner stored procedure returns a single value in a result set. Below, I will outline a couple of approaches you could take in SQL Server to achieve this. ### Option 1: Using `INSERT IN...
24,139
[ { "from": "human", "value": "I have a Stored Procedure that rolls-back a series of operations. I want to call this from within another SP.\nThe problem is that the inner SP returns a record set with a single value that indicates the degree of success. \n This approach worked well and has some advantages in ...
Recently I've been thinking about finite state machines (FSMs), and how I would implement them in software (programming language doesn't matter). My understanding is that deterministic state machines are in widespread use (parses/lexers, compilers and so on), but what's the matter with non-deterministic state machines?...
Your understanding of finite state machines (FSMs) is correct in that deterministic finite automata (DFAs) are more commonly used in practical applications due to their simplicity and efficiency in execution. Non-deterministic finite automata (NFAs), on the other hand, can be more complicated but do have their own use ...
22,405
[ { "from": "human", "value": "Recently I've been thinking about finite state machines (FSMs), and how I would implement them in software (programming language doesn't matter).\nMy understanding is that deterministic state machines are in widespread use (parses/lexers, compilers and so on), but what's the mat...
Which Inversion of control (IoC) containers support .NET 1.1?
Inversion of Control (IoC) containers provide a way to manage dependencies and implement the dependency injection pattern in applications. For .NET Framework 1.1, which is quite old, the options for IoC containers are limited compared to later versions. However, a few containers that were available and supported .NET 1...
26,991
[ { "from": "human", "value": "Which Inversion of control (IoC) containers support .NET 1.1?\n" }, { "from": "gpt", "value": "Inversion of Control (IoC) containers provide a way to manage dependencies and implement the dependency injection pattern in applications. For .NET Framework 1.1, which is ...
I am trying to insert about 50,000 objects (and therefore 50,000 keys) into a java.util.HashMap<java.awt.Point, Segment>. However, I keep getting an OutOfMemory exception. (Segment is my own class - very light weight - one String field, and 3 int fields). Exception in thread "main" java.lang.OutOfMemoryError: Java heap...
The `OutOfMemoryError` you're encountering indicates that your Java application is exceeding the default heap space allocated by the Java Virtual Machine (JVM). By default, the maximum heap size for the JVM is quite limited, especially on older versions like Java 5. ### Increasing Heap Size To increase the heap size,...
24,272
[ { "from": "human", "value": "I am trying to insert about 50,000 objects (and therefore 50,000 keys) into a java.util.HashMap<java.awt.Point, Segment>. However, I keep getting an OutOfMemory exception. (Segment is my own class - very light weight - one String field, and 3 int fields).\nException in thread \"...
I'm building an app in Ruby on Rails, and I'm including 3 of my models (and their migration scripts) to show what I'm trying to do, and what isn't working. Here's the rundown: I have users in my application that belong to teams, and each team can have multiple coaches. I want to be able to pull a list of the coaches ...
Based on the information you've provided, it looks like you're attempting to create a many-to-many relationship between Users, Teams, and Coaches using the appropriate associations. However, there are a few issues with your current setup that are leading to the error you're seeing. ### Issues with your current setup: ...
24,466
[ { "from": "human", "value": "I'm building an app in Ruby on Rails, and I'm including 3 of my models (and their migration scripts) to show what I'm trying to do, and what isn't working. Here's the rundown: I have users in my application that belong to teams, and each team can have multiple coaches. I want ...
I want something like this: <msxsl:script language="C#"> ??? getNodes() { ... return ... } </msxsl:script> <xsl:for-each select="user:getNodes()"> ... </xsl:for-each> What return type should i use for getNodes() and what should i put in it's body?
In XSLT, when you define a function in C# using `<msxsl:script>`, the function needs to return a value that can be utilized in your XSLT context. In your example, it looks like you're looking to return a sequence of nodes. The appropriate return type for the `getNodes()` function would be `XmlNodeList` or `IEnumerable`...
25,265
[ { "from": "human", "value": "I want something like this:\n<msxsl:script language=\"C#\">\n ??? getNodes() { ... return ... }\n</msxsl:script>\n\n<xsl:for-each select=\"user:getNodes()\">\n ...\n</xsl:for-each>\n\nWhat return type should i use for getNodes() and what should i put in it's body?\n" }, ...
I have a new application written in WPF that needs to support an old API that allows it to receive a message that has been posted to a hidden window. Typically another application uses FindWindow to identify the hidden window using the name of its custom window class. 1) I assume to implement a custom window class I n...
To create a hidden window in WPF without writing unmanaged code, you can still rely on the Windows API, but you'll be interacting with it via Platform Invocation Services (P/Invoke) in C#. Here's a step-by-step guide to achieve this, including a sample implementation. ### Step 1: Define the necessary P/Invoke signatur...
18,440
[ { "from": "human", "value": "I have a new application written in WPF that needs to support an old API that allows it to receive a message that has been posted to a hidden window. Typically another application uses FindWindow to identify the hidden window using the name of its custom window class.\n1) I ass...
I asked this question a while back and basically the project almost consists of reproducing excel in the browser. We want people to input data in an excel-like way. The question i have is, what is the best control to use? Should i use a regular table, and then append columns to it, or should i use a datagrid and fli...
Creating an Excel-like interface in the browser can be a complex task, and the choice of control largely depends on your specific requirements, including performance, flexibility, and usability. Here are a few approaches to consider: ### 1. **HTML Table** - **Pros:** - Simple to implement using standard HTML, CSS, a...
23,695
[ { "from": "human", "value": "I asked this question a while back and basically the project almost consists of reproducing excel in the browser. We want people to input data in an excel-like way. The question i have is, what is the best control to use? Should i use a regular table, and then append columns ...
The project I'm working is using n-tier architecture. Our layers are as follows: Data Access Business Logic Business Entities Presentation The Business Logic calls down into the data access layer, and the Presentation layer calls down into the Business Logic layer, and the Business entities are referenced by all of t...
Given your scenario, you're dealing with a common challenge in n-tier architectures: the need to manage relationships between entities without tightly coupling your business logic and data access layers. Here are several approaches you might consider for implementing loading (eager or lazy) of related entities while ma...
21,885
[ { "from": "human", "value": "The project I'm working is using n-tier architecture. Our layers are as follows:\n\nData Access\nBusiness Logic\nBusiness Entities\nPresentation\n\nThe Business Logic calls down into the data access layer, and the Presentation layer calls down into the Business Logic layer, and ...
I'm writting a simple prototype front end using a GridView that is populated via function, rather than being linked directly to a SqlServer data source. So I can delete a row/record from grid/underlying database I am currently Setting the AutoGenerateDeleteButton = true Displaying the unique record ids in the first co...
You're on the right track with using `DataKeyNames` to store the unique record identifiers without displaying them in the GridView. This is a common practice in ASP.NET Web Forms that allows you to manage data without exposing sensitive or confusing information to users. Here’s a quick recap and explanation of the ste...
23,694
[ { "from": "human", "value": "I'm writting a simple prototype front end using a GridView that is populated via function, rather than being linked directly to a SqlServer data source.\nSo I can delete a row/record from grid/underlying database I am currently\n\nSetting the AutoGenerateDeleteButton = true\nDis...
I'm trying to run this script to assign Application Pool to web site running under IIS 6 Set oWebAdmin = GetObject("winmgmts:root\WebAdministration") Set oSite = oWebAdmin.Get("Site.Name='Site'") oSite.ApplicationDefaults.ApplicationPool = "NewAppPool" oSite.Put_ This script can't run under IIS 6... Is there is someth...
Yes, the script you provided uses WMI (Windows Management Instrumentation) and the `WebAdministration` namespace, which is not available in IIS 6. The `WebAdministration` namespace is specific to IIS 7 and later. IIS 6 uses a different management model based on metabase.xml and does not support the same level of scri...
24,414
[ { "from": "human", "value": "I'm trying to run this script to assign Application Pool to web site running under IIS 6\nSet oWebAdmin = GetObject(\"winmgmts:root\\WebAdministration\")\nSet oSite = oWebAdmin.Get(\"Site.Name='Site'\")\noSite.ApplicationDefaults.ApplicationPool = \"NewAppPool\"\noSite.Put_\n\nT...
I'm having trouble dynamically adding controls inside an update panel with partial postbacks. I've read many articles on dynamic controls and I understand how to add and maintain them with postbacks but most of that information doesn't apply and won't work for partial postbacks. I can't find any useful information abou...
Dynamically adding controls to an `UpdatePanel` and maintaining their state during partial postbacks can indeed be tricky. The main reason is that the ASP.NET page lifecycle behaves differently with partial postbacks. Here’s a breakdown of how you can achieve this. ### Steps to Dynamically Add Controls Inside an Updat...
21,273
[ { "from": "human", "value": "I'm having trouble dynamically adding controls inside an update panel with partial postbacks. I've read many articles on dynamic controls and I understand how to add and maintain them with postbacks but most of that information doesn't apply and won't work for partial postbacks....
Where would you write an error log file, say ErrorLog.txt, in Windows? Keep in mind the path would need to be open to basic users for file write permissions. I know the eventlog is a possible location for writing errors, but does it work for "user" level permissions? EDIT: I am targeting Windows 2003, but I was posing...
When deciding where to write an error log file on Windows, especially for applications targeting environments like Windows Server 2003, it’s important to choose a location that balances accessibility, security, and ease of use. Here are some general guidelines: ### Recommended Locations for Error Log Files 1. **Appli...
22,524
[ { "from": "human", "value": "Where would you write an error log file, say ErrorLog.txt, in Windows? Keep in mind the path would need to be open to basic users for file write permissions.\nI know the eventlog is a possible location for writing errors, but does it work for \"user\" level permissions?\nEDIT: ...
Is there a way to add a custom prefix/URI that is not http or https? The HTTPListener.Prefixes.Add method only accepts http:// and https:// prefixes. I just don't want to recreate the functionality of this class if I don't have to.
The `HttpListener` class in .NET is specifically designed to handle HTTP and HTTPS requests, and it is tightly coupled with the HTTP protocol. Unfortunately, it does not support custom prefixes or URIs that do not follow the HTTP(S) schema, which means you can't register a prefix with protocols like `ftp://`, `ws://`, ...
25,864
[ { "from": "human", "value": "Is there a way to add a custom prefix/URI that is not http or https? The HTTPListener.Prefixes.Add method only accepts http:// and https:// prefixes.\nI just don't want to recreate the functionality of this class if I don't have to. \n" }, { "from": "gpt", "value": "...
I need to test some HTTP interaction with a client I'd rather not modify. What I need to test is the behavior of the server when the client's requests include a certain, static header. I'm thinking the easiest way to run this test is to set up an HTTP proxy that inserts the header on every request. What would be the si...
Setting up an HTTP proxy to insert a specific header into every request is a common approach for testing and can be done using various tools. One of the simplest ways to achieve this is by using **mitmproxy**, which is a powerful interactive man-in-the-middle proxy that can modify requests and responses. Here’s a step...
21,595
[ { "from": "human", "value": "I need to test some HTTP interaction with a client I'd rather not modify. What I need to test is the behavior of the server when the client's requests include a certain, static header.\nI'm thinking the easiest way to run this test is to set up an HTTP proxy that inserts the hea...
In a page, on the load event, I am dynamically creating controls for display on the page. This is all working properly. the trouble I am having is when adding extenders from the AJAX control toolkit, specifically I am trying to add rounded corners to a button control. No errors are thrown, but the AJAX Extension functi...
It looks like you are dynamically creating controls on the server side, which can be tricky when using AJAX Control Toolkit extenders, as they usually require the controls to be fully rendered and registered correctly. Here are some considerations and potential fixes that may help you achieve your goal of applying the ...
20,764
[ { "from": "human", "value": "In a page, on the load event, I am dynamically creating controls for display on the page. This is all working properly. the trouble I am having is when adding extenders from the AJAX control toolkit, specifically I am trying to add rounded corners to a button control. No errors ...
I want to install a "pastie" in our local intranet. What are the alternatives to RaPaste and pastie.org? (the latter can't even be installed locally b/c it doesn't seem to be open source?) Edit: Doesn't have to be Ruby btw. Edit: What I mean with pastie is an app where you can share source code pastes instead of pastin...
There are several alternatives to RaPaste and pastie.org that you can consider for sharing code snippets on your local intranet. Here are some open-source options that you might find useful: 1. **Pastebin**: There are open-source alternatives to Pastebin, such as **Pygments** or **Pastebin Clone**, which you can set u...
24,666
[ { "from": "human", "value": "I want to install a \"pastie\" in our local intranet. What are the alternatives to RaPaste and pastie.org? (the latter can't even be installed locally b/c it doesn't seem to be open source?)\nEdit: Doesn't have to be Ruby btw.\nEdit: What I mean with pastie is an app where you c...
What does the following code do? A link to something in the PHP manual would also be nice. if ($_SERVER['SERVER_PORT'] <> 443) { doSomething(); }
The provided code snippet is a conditional statement in PHP that checks whether the current server port is not equal to 443. Port 443 is the default port used for HTTPS connections. Here’s a breakdown of what the code does: 1. `$_SERVER['SERVER_PORT']` retrieves the port number on which the current script is being exe...
26,435
[ { "from": "human", "value": "What does the following code do? A link to something in the PHP manual would also be nice.\nif ($_SERVER['SERVER_PORT'] <> 443) {\n doSomething();\n}\n\n" }, { "from": "gpt", "value": "The provided code snippet is a conditional statement in PHP that checks whether...
Does anyone know if IE6 ever misrenders pages with hidden divs? We currently have several divs which we display in the same space on the page, only showing one at a time and hiding all others. The problem is that the hidden divs components (specifically option menus) sometimes show through. If the page is scrolled, rem...
Internet Explorer 6 (IE6) is notorious for its quirks and rendering issues, especially when it comes to handling hidden elements and CSS. The problem you're facing with hidden `<div>` elements sometimes displaying through may be caused by a few different factors. Here are some tips and potential solutions you can try t...
20,355
[ { "from": "human", "value": "Does anyone know if IE6 ever misrenders pages with hidden divs? We currently have several divs which we display in the same space on the page, only showing one at a time and hiding all others.\nThe problem is that the hidden divs components (specifically option menus) sometimes ...
During my work with databases I noticed that I write query strings and in this strings I have to put several restrictions in the where-clause from a list/array/collection. Should look like this: select * from customer where customer.id in (34, 26, ..., 2); You can simplify this by reducing this to the question that y...
Your current approach works, but there are indeed more elegant and efficient ways to create a comma-separated list from a collection of strings in Java. Below are a few alternatives that improve readability and performance. ### 1. Using `String.join` If you're using Java 8 or later, you can use the `String.join()` met...
25,873
[ { "from": "human", "value": "During my work with databases I noticed that I write query strings and in this strings I have to put several restrictions in the where-clause from a list/array/collection. Should look like this:\nselect * from customer \nwhere customer.id in (34, 26, ..., 2);\n\nYou can simplify...
I am sequentially processing a large file and I'd like to keep a large chunk of it in memory, 16gb ram available on a 64 bit system. A quick and dirty way is to do this, is simply wrap the input stream into a buffered input stream, unfortunately, this only gives me a 2gb buffer. I'd like to have more of it in memory, w...
If you're looking to manage a larger in-memory buffer for processing a large file beyond the typical limits of a BufferedInputStream, there are several alternatives you can consider. Here are some approaches: 1. **Custom Byte Array**: Instead of using `BufferedInputStream`, you can read larger chunks of data into a cu...
23,010
[ { "from": "human", "value": "I am sequentially processing a large file and I'd like to keep a large chunk of it in memory, 16gb ram available on a 64 bit system.\nA quick and dirty way is to do this, is simply wrap the input stream into a buffered input stream, unfortunately, this only gives me a 2gb buffer...
I mean, is there a coded language with human style coding? For example: Create an object called MyVar and initialize it to 10; Take MyVar and call MyMethod() with parameters. . . I know it's not so useful, but it can be interesting to create such a grammar.
Creating a coded language with a more human-readable style is an interesting idea! It can help people who are not familiar with traditional programming languages better understand basic coding concepts. Below is a simplified version of such a language, which I'll call "HumanScript". The language will resemble natural l...
19,342
[ { "from": "human", "value": "I mean, is there a coded language with human style coding?\nFor example:\nCreate an object called MyVar and initialize it to 10;\nTake MyVar and call MyMethod() with parameters. . .\n\nI know it's not so useful, but it can be interesting to create such a grammar.\n" }, { ...
From within a DLL that's being called by a C#.NET web app, how do you find the base url of the web app?
To find the base URL of a C#.NET web application from within a DLL, you typically want to access the `HttpContext` object. The `HttpContext` contains information about the current HTTP request, including the scheme, host, and path. However, keep in mind that this approach assumes that the DLL is being called in the con...
25,045
[ { "from": "human", "value": "From within a DLL that's being called by a C#.NET web app, how do you find the base url of the web app?\n" }, { "from": "gpt", "value": "To find the base URL of a C#.NET web application from within a DLL, you typically want to access the `HttpContext` object. The `Ht...
I have heard mention that some desktop applications are pretty much just wrappers for websites now. I have even had the occasional problem that has been best solved this way in the past and I can see it being really useful for current applications development. However, one problem I always seemed to run into was that t...
You're correct that many modern desktop applications are built using web technologies, and some frameworks effectively wrap web browsers to create these applications. Indeed, using a more modern rendering engine than Trident can yield better compatibility and consistent rendering across platforms. Here's a breakdown of...
17,778
[ { "from": "human", "value": "I have heard mention that some desktop applications are pretty much just wrappers for websites now.\nI have even had the occasional problem that has been best solved this way in the past and I can see it being really useful for current applications development.\nHowever, one pro...
What is a good error handling practice for an asp.net site? Examples? Thanks!
Error handling is an essential part of developing robust ASP.NET applications. Good error handling practices not only help in diagnosing issues but also improve user experience by providing meaningful feedback. Here are some best practices for error handling in ASP.NET: ### 1. Use Global Error Handling Implement glob...
19,590
[ { "from": "human", "value": "What is a good error handling practice for an asp.net site? Examples? Thanks!\n" }, { "from": "gpt", "value": "Error handling is an essential part of developing robust ASP.NET applications. Good error handling practices not only help in diagnosing issues but also imp...
I have a web application that syncs Outlook contacts to a database (and back) via CDO. The DB contains every contact only once (at least theoretically, of course doublets happen), providing a single point of change for a contact, regardless of how many users have that particular contact in Outlook (like Interaction or ...
The problem you're facing is indeed a common challenge when synchronizing contact information across systems, especially when you want to maintain a unique identifier for contacts. Given the limitations of using properties like `PR_ENTRYID` or relying on your database IDs, here are several strategies that you can consi...
20,476
[ { "from": "human", "value": "I have a web application that syncs Outlook contacts to a database (and back) via CDO. The DB contains every contact only once (at least theoretically, of course doublets happen), providing a single point of change for a contact, regardless of how many users have that particular...
I've got a Visual Basic App that tends to get severely messed up if the installation runs more than once. It seems the occasionally client mistakes the installer for the shortcut to it later on down the road, runs the installer again and it messes everything up. I can't for the life of me figure out why so I decided ...
To prevent your Visual Basic application from being run more than once simultaneously on the same machine, you can implement a mechanism using a Mutex (mutual exclusion) object. A Mutex is a synchronization primitive that can be used to manage access to a resource, ensuring that only one instance of the application can...
21,433
[ { "from": "human", "value": "I've got a Visual Basic App that tends to get severely messed up if the installation runs more than once. It seems the occasionally client mistakes the installer for the shortcut to it later on down the road, runs the installer again and it messes everything up. I can't for th...
I have a simple, real life problem I want to solve using an OO approach. My harddrive is a mess. I have 1.500.000 files, duplicates, complete duplicate folders, and so on... The first step, of course, is parsing all the files into my database. No problems so far, now I got a lot of nice entries which are kind of "natur...
It sounds like you're dealing with a complex problem that requires dynamic grouping of files based on various heuristics and strategies. To solve this problem with an Object-Oriented (OO) approach, we can utilize several design patterns and strategies to model and structure your solution effectively. Below are some sug...
15,272
[ { "from": "human", "value": "I have a simple, real life problem I want to solve using an OO approach. My harddrive is a mess. I have 1.500.000 files, duplicates, complete duplicate folders, and so on...\nThe first step, of course, is parsing all the files into my database. No problems so far, now I got a lo...
I need some help from the shell-script gurus out there. I have a .txt file (log) that traces the IP addresses of clients on several lines, in a format similar to this one: Line1 - Client IP [192.168.0.1] Other data Line2 - Client IP [192.168.0.2] Other data Line3 - Client IP [192.168.0.3] Other data Line4 - Client IP [...
You can achieve this using a simple shell script or a combination of Unix commands like `grep`, `sort`, and `uniq`. Here's a step-by-step guide to extract, group, and output the unique IP addresses from your log file. ### Using Unix Commands If you have a log file named `log.txt`, you can run the following command in...
21,870
[ { "from": "human", "value": "I need some help from the shell-script gurus out there.\nI have a .txt file (log) that traces the IP addresses of clients on several lines, in a format similar to this one:\nLine1 - Client IP [192.168.0.1] Other data\nLine2 - Client IP [192.168.0.2] Other data\nLine3 - Client IP...
I would like to add graphing to my User Controls in ASP.NET MVC. I am hoping for some ideas or a guide on how to approach this issue. I have searched around and found no helpful answers to resolve this issue. I was thinking of doing crystal reports but they don't boat over well in ASP.NET from my previous experience. I...
Adding graphing capabilities to your ASP.NET MVC application can be accomplished in several ways, even without relying on heavy tools like Crystal Reports. Here are some popular libraries and approaches you can consider: ### 1. Chart.js **Chart.js** is a simple yet flexible JavaScript charting library for designers an...
16,232
[ { "from": "human", "value": "I would like to add graphing to my User Controls in ASP.NET MVC. I am hoping for some ideas or a guide on how to approach this issue. I have searched around and found no helpful answers to resolve this issue. I was thinking of doing crystal reports but they don't boat over well ...
Is it possible to produce an alert similar to JavaScript's alert("message") in python, with an application running as a daemon. This will be run in Windows, Most likely XP but 2000 and Vista are also very real possibilities. Update: This is intended to run in the background and alert the user when certain conditions ar...
Yes, it is possible to produce a pop-up alert in Python that works similarly to JavaScript's `alert()` function, even when your application is running as a daemon in the background. For Windows environments, you can use libraries such as `ctypes`, `win32api`, or `tkinter` to create a simple pop-up message box. Here ar...
25,202
[ { "from": "human", "value": "Is it possible to produce an alert similar to JavaScript's alert(\"message\") in python, with an application running as a daemon.\nThis will be run in Windows, Most likely XP but 2000 and Vista are also very real possibilities.\nUpdate:\nThis is intended to run in the background...
Is there a good way to have a Map<String, ?> get and put ignoring case?
In Java, the standard `Map` implementations (like `HashMap` or `TreeMap`) are case-sensitive when it comes to their keys. If you want to create a `Map<String, ?>` that ignores case when getting or putting values, you can use `TreeMap` with a custom comparator that ignores case. Here’s how you can create a case-insensi...
20,605
[ { "from": "human", "value": "Is there a good way to have a Map<String, ?> get and put ignoring case?\n" }, { "from": "gpt", "value": "In Java, the standard `Map` implementations (like `HashMap` or `TreeMap`) are case-sensitive when it comes to their keys. If you want to create a `Map<String, ?>`...
I've got build server running CruiseControl.NET and recently it started throwing this error on one of my projects (.NET 2.0, C#): MSB3176: Specified minimum required version is greater than the current publish version. Please specify a version less than or equal to the current publish version. in Microsoft.Common.targ...
The error you're encountering, `MSB3176: Specified minimum required version is greater than the current publish version`, is related to the project’s publish settings in your `.csproj` file, particularly in the context of ClickOnce deployment. This error indicates that the minimum required version specified in the proj...
22,362
[ { "from": "human", "value": "I've got build server running CruiseControl.NET and recently it started throwing this error on one of my projects (.NET 2.0, C#):\n\nMSB3176: Specified minimum required version is greater than the current publish version. Please specify a version less than or equal to the curren...
I got the acts_as_taggable_on_steroids plugin to work fine. The tag_cloud method in my view create and formats the cloud properly however the tags are listed in order of 'count desc'. How to I present my tags in the cloud in alphabetical order?
To present your tags in alphabetical order while using the `acts_as_taggable_on_steroids` plugin, you'll need to modify how you're retrieving and displaying the tags. Here's how you can do it: 1. **Retrieve Tags**: First, make sure you retrieve the tags in alphabetical order. You can do this using the `tag_counts` me...
23,329
[ { "from": "human", "value": "I got the acts_as_taggable_on_steroids plugin to work fine. The tag_cloud method in my view create and formats the cloud properly however the tags are listed in order of 'count desc'.\nHow to I present my tags in the cloud in alphabetical order?\n" }, { "from": "gpt", ...
Is there anyway in XAML only to have a linebreak in a TextBox? I know I can set myTextBox.Text = "something\r\nsomething2" in Code, but I can't do this: <TextBox x:Name="myTextBox"> <TextBox.Text> Something <Linebreak/> Something2 </TextBox.Text> </TextBox> or this <TextBox x:Name="myTe...
In XAML, the `TextBox` control does not support direct line breaks in its text content using markup like `<LineBreak />`. However, you can achieve a line break in a `TextBox` by using the `TextWrapping` property and specifying the text with line breaks in a different way. One common approach is to use a `String` that...
23,142
[ { "from": "human", "value": "Is there anyway in XAML only to have a linebreak in a TextBox?\nI know I can set myTextBox.Text = \"something\\r\\nsomething2\" in Code, but I can't do this:\n<TextBox x:Name=\"myTextBox\">\n <TextBox.Text>\n Something\n <Linebreak/>\n Something2\n </T...
My clients application exports and imports quite a few variables of type real through a text file using writeln and readln. I've tried to increase the width of the fields written so the code looks like: writeln(file, exportRealvalue:30); //using excess width of field .... readln(file, importRealvalue); When I export...
The issue you're encountering is likely related to the way floating-point numbers are represented and handled in programming, particularly when using text-based representations. When you write a floating-point value to a text file using `writeln`, it gets converted into a string format, and this conversion can lead to ...
23,033
[ { "from": "human", "value": "My clients application exports and imports quite a few variables of type real through a text file using writeln and readln. I've tried to increase the width of the fields written so the code looks like: \nwriteln(file, exportRealvalue:30); //using excess width of field\n....\nr...
I would like to know if there are general rules for creating an index or not. How do I choose which fields I should include in this index or when not to include them? I know its always depends on the environment and the amount of data, but I was wondering if we could make some globally accepted rules about making index...
Creating indexes in Oracle (or any relational database management system) is a crucial task that can significantly affect the performance of your database. While the optimal indexing strategy can depend on the specific use case, environment, and data characteristics, there are some generally accepted rules and guidelin...
20,247
[ { "from": "human", "value": "I would like to know if there are general rules for creating an index or not.\nHow do I choose which fields I should include in this index or when not to include them?\nI know its always depends on the environment and the amount of data, but I was wondering if we could make some...
Using Java swing, what is the string that correspond to a correct email mask when using the MaskFormatter? Is that possible at all to actually use a MaskFormatter for emails?
Using `MaskFormatter` to enforce a specific email format is quite challenging and not recommended because email addresses can vary significantly in structure. However, you can create a rudimentary approach using `MaskFormatter`, but it will not cover all valid email formats due to the complexity of email validation. ...
19,903
[ { "from": "human", "value": "Using Java swing, what is the string that correspond to a correct email mask when using the MaskFormatter?\nIs that possible at all to actually use a MaskFormatter for emails?\n" }, { "from": "gpt", "value": "Using `MaskFormatter` to enforce a specific email format i...
I am trying to use directory services to add a directory entry to an openldap server. The examples I have seen look pretty simple, but I keep getting the error "There is an naming violation". What does this message mean? How do I resolve it? I have included the code, ldif file used to create the person container. Publ...
The "naming violation" error in OpenLDAP typically indicates that the Distinguished Name (DN) you are trying to use to add a new entry is not valid within the context of your LDAP directory structure. This can occur for several reasons, including: 1. **Incorrect Parent Entry**: The parent entry under which you are try...
16,367
[ { "from": "human", "value": "I am trying to use directory services to add a directory entry to an openldap server. The examples I have seen look pretty simple, but I keep getting the error \"There is an naming violation\". What does this message mean? How do I resolve it?\nI have included the code, ldif fi...
I'm trying to determine the best way of having a PHP script determine which server the script/site is currently running on. At the moment I have a switch() that uses $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] to determine which server it's on. It then sets a few paths, db connection parameters, SMTP paramt...
It sounds like you have a valid use case for server configuration management, and you're looking for an efficient and scalable way to handle it. Here are a few approaches you might consider that could address your concerns: ### 1. Environment Variables Using environment variables is a common practice for managing conf...
22,177
[ { "from": "human", "value": "I'm trying to determine the best way of having a PHP script determine which server the script/site is currently running on.\nAt the moment I have a switch() that uses $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] to determine which server it's on. It then sets a few pa...
I have a .asp application where image files (.PDF) are stored in a directory (fed by a copier/scanner). The created file names are stored in a database table. When a query is launched from the web page a link to the file is created. When clicked the image should be displayed. This functionality works 100% in Internet...
The issue you’re encountering stems from the fact that Firefox (and most modern browsers) implement strict security policies that prevent accessing local or network file paths using the `file://` protocol from web pages. Here are some suggestions to enable access to your PDF files in Firefox: ### 1. **Serve the Files ...
23,712
[ { "from": "human", "value": "I have a .asp application where image files (.PDF) are stored in a directory (fed by a copier/scanner). The created file names are stored in a database table. When a query is launched from the web page a link to the file is created. When clicked the image should be displayed.\...
In one of his blog articles, the proprietor of this web site posed this question to the reader, "You're automatically measuring all the queries that flow through your software, right?" How do you do this? Every line of code that makes a query against the database is followed by a line of code that increments a counter...
Automatically measuring all the queries that flow through your software can be accomplished through several approaches, rather than manually adding a counter after each query. Here are some common methods and tools that can help you achieve this: ### 1. **Database Middleware or Proxy:** - Tools like **pgBouncer** (...
23,747
[ { "from": "human", "value": "In one of his blog articles, the proprietor of this web site posed this question to the reader, \"You're automatically measuring all the queries that flow through your software, right?\"\nHow do you do this? Every line of code that makes a query against the database is followed...
One of our providers are sometimes sending XML feeds that are tagged as UTF-8 encoded documents but includes characters that are not included in the UTF-8 charset. This causes the parser to throw an exception and stop building the DOM object when these characters are encountered: DocumentBuilder.parse(ByteArrayInputStr...
Handling incorrectly encoded XML documents can be challenging, especially when you want to prevent exceptions during parsing. Here's a general strategy you can apply to "capture" and clean up such documents before passing them to the parser: ### Approach: Pre-Processing the Input Stream 1. **Read the Input as Bytes**...
21,907
[ { "from": "human", "value": "One of our providers are sometimes sending XML feeds that are tagged as UTF-8 encoded documents but includes characters that are not included in the UTF-8 charset. This causes the parser to throw an exception and stop building the DOM object when these characters are encountered...
Is http/1.0 able to handle deflated and gzip content? I've finished to implement deflate and gzip in my minimalist web server and I don't really know if browsers with http/1.0 are capable to handle deflate and gzip compressed content.
HTTP/1.0 does not natively support the `Content-Encoding` header, which is necessary for indicating that a response body is compressed (either with `gzip` or `deflate`). Therefore, while it is technically possible to send compressed content to an HTTP/1.0 client, it is not standard practice, and many HTTP/1.0 clients m...
26,271
[ { "from": "human", "value": "Is http/1.0 able to handle deflated and gzip content?\nI've finished to implement deflate and gzip in my minimalist web server and I don't really know if browsers with http/1.0 are capable to handle deflate and gzip compressed content.\n" }, { "from": "gpt", "value":...
I'm creating a site where the user unfortunately has to provide a regex to be used in a MySQL WHERE clause. And of course I have to validate the user input to prevent SQL injection. The site is made in PHP, and I use the following regex to check my regex: /^([^\\\\\']|\\\.)*$/ This is double-escaped because of PHP's w...
Validating user input, especially when it involves regex that will be used in a SQL query, is a critical aspect of preventing SQL injection and ensuring the security of your application. Let's break down your regex and discuss its safety and effectiveness. ### Your Regex Breakdown The regex you provided is: ```regex...
21,518
[ { "from": "human", "value": "I'm creating a site where the user unfortunately has to provide a regex to be used in a MySQL WHERE clause. And of course I have to validate the user input to prevent SQL injection. The site is made in PHP, and I use the following regex to check my regex:\n/^([^\\\\\\\\\\']|\\\\...
At work we have 4 people working together on a few different projects. For each project we each have a local copy we work on and then there is a development, staging, and live deployment, along with any branches we have (we use subversion). Our database is MySQL. So my question is, what is a good way to manage which re...
Managing database schema changes and ensuring consistency across different environments can be challenging, especially when multiple developers are involved. To effectively manage database revisions in a Subversion (SVN) environment, consider adopting a dedicated database migration strategy and using a migration tool. ...
22,849
[ { "from": "human", "value": "At work we have 4 people working together on a few different projects. For each project we each have a local copy we work on and then there is a development, staging, and live deployment, along with any branches we have (we use subversion). Our database is MySQL.\nSo my question...
I have a button that adds an already defined usercontrol programtically. I am rebuilding each control on Postback and they show up fine. If I put text in the textbox it shows up fine, however my images are losing their url. Any idea why or how I can fix this? I tried adding AJAX updatepanel to see if that would help,...
You're correct in your diagnosis. The issue arises from the way ASP.NET handles postbacks and the lifecycle of server controls. When you change the `src` attribute of an `<img>` tag using JavaScript, this change is made on the client side and is not persisted on the server side. Upon postback, ASP.NET re-renders the pa...
21,841
[ { "from": "human", "value": "I have a button that adds an already defined usercontrol programtically. I am rebuilding each control on Postback and they show up fine. If I put text in the textbox it shows up fine, however my images are losing their url. Any idea why or how I can fix this?\nI tried adding A...
As a developer who spent many years working within Visual C++ 6, I'm used to working with the String Table resource to store unicode strings for localization. Is there a resource within Visual Studio 2005 that provides the same? Are there any third party libraries or tools?
In Visual Studio 2005, you can still use resource files to manage strings for localization, similar to what you did in Visual C++ 6. However, there are improvements and changes to how localization and Unicode handling are done in newer versions of Visual Studio. ### Using Resource Files in Visual Studio 2005: 1. **St...
23,352
[ { "from": "human", "value": "As a developer who spent many years working within Visual C++ 6, I'm used to working with the String Table resource to store unicode strings for localization. Is there a resource within Visual Studio 2005 that provides the same? Are there any third party libraries or tools?\n" ...
In the GNOME Terminal, Bash does smart auto-completion. For example apt-get in<TAB> becomes apt-get install In Emacs shell-mode, this auto-completion doesn't work, even after I explicitly source /etc/bash_completion. The above example sticks as in or auto-completes with a filename in the current directory rather than...
In Emacs, the default shell-mode may not have the same advanced completion features as the GNOME Terminal, particularly when it comes to Bash command completion. However, you can enable smart auto-completion in shell-mode by configuring a couple of things. ### Steps to Enable Smart Auto-completion in Emacs shell-mode ...
23,377
[ { "from": "human", "value": "In the GNOME Terminal, Bash does smart auto-completion. For example\napt-get in<TAB>\n\nbecomes\napt-get install\n\nIn Emacs shell-mode, this auto-completion doesn't work, even after I explicitly source /etc/bash_completion. The above example sticks as in or auto-completes with ...
I can't figure out how to compile thrift files for C#. I've read, "thrift files which can then be compiled down to language-specific interfaces for a wide variety of different programming platforms (Java, PHP, C/C++, Cocoa, Perl, C#, Ruby, etc.)." I was looking here: http://www.markhneedham.com/blog/2008/08/29/c-thrift...
To compile Thrift files for C#, you typically need to have the Thrift compiler installed and then use it to generate the appropriate C# code from your Thrift definitions. Here's a step-by-step guide to help you through this process: ### Step 1: Install Apache Thrift 1. **Download Apache Thrift**: You can download the...
23,972
[ { "from": "human", "value": "I can't figure out how to compile thrift files for C#. I've read, \"thrift files which can then be compiled down to language-specific interfaces for a wide variety of different programming platforms (Java, PHP, C/C++, Cocoa, Perl, C#, Ruby, etc.).\"\nI was looking here: http://w...
Is it possible to change the connection string of a published sql reporting services report? I can see the binary field called DataSource in the ReportServer database, but since it's stored as binary I don't think it's easily updatable. Do I need to republish the report with the correct data source? I'm hoping not sinc...
In SQL Server Reporting Services (SSRS) 2000, the connection strings for data sources are indeed stored in a binary format in the `ReportServer` database. If you want to change the connection string for a published report, you generally have a few options: 1. **Update the Data Source in Report Manager:** - If you a...
25,427
[ { "from": "human", "value": "Is it possible to change the connection string of a published sql reporting services report? I can see the binary field called DataSource in the ReportServer database, but since it's stored as binary I don't think it's easily updatable.\nDo I need to republish the report with th...
I have these two CREATE TABLE statements: CREATE TABLE GUEST ( id int(15) not null auto_increment PRIMARY KEY, GuestName char(25) not null ); CREATE TABLE PAYMENT ( id int(15) not null auto_increment Foreign Key(id) references GUEST(id), BillNr int(15) not null ); What is the problem in the second statemen...
The `CREATE TABLE` statement for the `PAYMENT` table has a couple of issues that need to be addressed in order for it to execute correctly. 1. **Missing Comma**: You need a comma at the end of the `auto_increment` line in the `PAYMENT` table definition. Each column definition (except the last one) should be followed ...
26,145
[ { "from": "human", "value": "I have these two CREATE TABLE statements: \nCREATE TABLE GUEST (\n id int(15) not null auto_increment PRIMARY KEY,\n GuestName char(25) not null\n);\n\nCREATE TABLE PAYMENT (\n id int(15) not null auto_increment\n Foreign Key(id) references GUEST(id),\n BillNr int(15) not n...
I'm trying to select a random 10% sampling from a small table. I thought I'd just use the RAND() function and select those rows where the random number is less than 0.10: SELECT * FROM SomeTable WHERE SomeColumn='SomeCondition' AND RAND() < 0.10 But I soon discovered that RAND() always returns the same number! ...
You're correct in noting that the behavior of the `RAND()` function can be tricky in SQL Server. The main issue is that when you call `RAND()` without an input seed in your query, it generates a random number that remains constant for the duration of that query execution. The method you're trying (using `RAND()` comb...
23,436
[ { "from": "human", "value": "I'm trying to select a random 10% sampling from a small table. I thought I'd just use the RAND() function and select those rows where the random number is less than 0.10:\nSELECT * FROM SomeTable\nWHERE SomeColumn='SomeCondition' AND\n RAND() < 0.10\n\nBut I soon discovere...
I have a hidden embedded QuickTime object on my page that I'm trying to control via JavaScript, but it's not working. The object looks like this: <object id="myPlayer" data="" type="audio/mpeg" pluginspage="http://www.apple.com/quicktime/download" width="0" height="0"> <param name="autoPlay" value="false" /> <p...
It sounds like you're dealing with some quirks of the QuickTime plugin and its integration with JavaScript, especially considering different browser behavior. Here are a few things to check and some potential solutions: 1. **Check Object Type**: Ensure that your `<object>` tag is correctly set up. The `data` attribute...
24,417
[ { "from": "human", "value": "I have a hidden embedded QuickTime object on my page that I'm trying to control via JavaScript, but it's not working. The object looks like this:\n<object id=\"myPlayer\" data=\"\" type=\"audio/mpeg\" pluginspage=\"http://www.apple.com/quicktime/download\" width=\"0\" height=\"0...
I am developing a mobile app to run on a pocketpc. We have a mobile printer and card swipe that uses com1 to send and get info. I'm using the device emulator and want to test without the printer. How do I create a virtual com1 port to right to and read from? I tried com0com but the device emulator will not set that...
Creating a virtual COM port for testing purposes can be useful when you are working with hardware emulators and want to simulate the behavior of a real device like a printer. Since you've mentioned that you are using the Device Emulator for Pocket PC, you may need to follow these steps to create and use a virtual COM p...
21,464
[ { "from": "human", "value": "I am developing a mobile app to run on a pocketpc. We have a mobile printer and card swipe that uses com1 to send and get info. I'm using the device emulator and want to test without the printer. How do I create a virtual com1 port to right to and read from? I tried com0com ...
Note: The code in this question is part of deSleeper if you want the full source. One of the things I wanted out of commands was a baked design for asynchronous operations. I wanted the button pressed to disable while the command was executing, and come back when complete. I wanted the actual work to be performed in ...
Your implementation of `AsyncCommand` provides a structure for handling asynchronous command execution in a way that integrates well with WPF's data-binding and UI thread model. Let's break down your concerns about necessity, built-in support, and the parameter question. ### Is all this necessary? 1. **Button Disable...
19,691
[ { "from": "human", "value": "Note: The code in this question is part of deSleeper if you want the full source.\nOne of the things I wanted out of commands was a baked design for asynchronous operations. I wanted the button pressed to disable while the command was executing, and come back when complete. I ...
Similar to this question... What are the worst practices you actually found in Java code? Mine are: using instance variables in servlets (it's not just bad practice but bug, actually) using Collection implementations like HashMap, and not using the appropriate interfaces using seemingly cryptic class names like SmsMak...
Here are some additional worst practices often found in Java code: 1. **Ignoring Exception Handling**: Catching generic exceptions (like `Exception` or `Throwable`) without any meaningful handling or logging can lead to silent failures and make debugging difficult. 2. **Overusing Static Methods/Variables**: Relying h...
24,210
[ { "from": "human", "value": "Similar to this question...\nWhat are the worst practices you actually found in Java code?\nMine are:\n\nusing instance variables in servlets (it's not just bad practice but bug, actually)\nusing Collection implementations like HashMap, and not using the appropriate interfaces\n...
I have a site that is using x509 client certificates (2 way SSL) to authenticate users and an LDAP directory that contains authorization information. I would like to use one of the certificate attributes to query the directory ( SSL_CLIENT_S_DN_CN to be exact ). I see how to use mod_ssl to use the user's client certif...
To use an attribute from the client's x509 certificate to query an LDAP directory in an Apache environment, you can achieve this by leveraging some Apache modules in combination. Since you've already set up client certificate authentication using `mod_ssl` and are familiar with `mod_auth_ldap`, you'll be using a combin...
23,556
[ { "from": "human", "value": "I have a site that is using x509 client certificates (2 way SSL) to authenticate users and an LDAP directory that contains authorization information. I would like to use one of the certificate attributes to query the directory ( SSL_CLIENT_S_DN_CN to be exact ). I see how to us...
I need to find a good Lua to JavaScript converter; lua2js on luaforge.org is out of date (3 or so years old and looks like it doesn't work on Lua 5.1) and I haven't yet found anything on Google. Does anyone have any experience with any other converters out there? It should work on Lua 5.1 and preferably be .NET based, ...
If you're looking for a Lua to JavaScript converter or a JavaScript interpreter for Lua, there are a few options you can consider: 1. **Fengari**: Fengari is a Lua VM implemented in JavaScript. It allows you to run Lua code directly in the browser or in a JavaScript environment. It supports Lua 5.1 and has good compat...
25,291
[ { "from": "human", "value": "I need to find a good Lua to JavaScript converter; lua2js on luaforge.org is out of date (3 or so years old and looks like it doesn't work on Lua 5.1) and I haven't yet found anything on Google.\nDoes anyone have any experience with any other converters out there? It should work...
I just need a simple JSON or YAML (or other) text based format for recording the time I spend on tasks. I prefer to do as much work as possible in my text editor (e text editor) so it is more natural to me to stay in the editor and not switch back and forth to programs like Excel (plus this way I retain portable and "...
Using JSON or YAML for logging your tasks is a great idea! Both formats are lightweight and human-readable, making them easy to use in a text editor. Below, I'll provide an example schema in both JSON and YAML formats for recording your tasks. These schemas also include a mechanism to mark tasks as "internal" or "exter...
20,627
[ { "from": "human", "value": "I just need a simple JSON or YAML (or other) text based format for recording the time I spend on tasks. I prefer to do as much work as possible in my text editor (e text editor) so it is more natural to me to stay in the editor and not switch back and forth to programs like Exc...
Is there a best-practice or common way in JavaScript to have class members as event handlers? Consider the following simple example: <head> <script language="javascript" type="text/javascript"> ClickCounter = function(buttonId) { this._clickCount = 0; document.getElementById(buttonI...
You're encountering a common issue in JavaScript related to how the `this` keyword behaves in different contexts. In your example, when `buttonClicked` is called as an event handler, `this` refers to the DOM element that triggered the event (in this case, the button), not the instance of `ClickCounter`. To solve this ...
22,833
[ { "from": "human", "value": "Is there a best-practice or common way in JavaScript to have class members as event handlers?\nConsider the following simple example:\n<head>\n <script language=\"javascript\" type=\"text/javascript\">\n\n ClickCounter = function(buttonId) {\n this._clickCou...
I'm working in a web application using VB.NET. There is also VisualBasic code mixed in it, in particular the Date variable and the Month function of VB. The problem is this part: Month("10/01/2008") On the servers, I get 10 (October) as the month (which is supposed to be correct). On my machine, I get 1 (January) (whi...
The inconsistency you're experiencing with the `Month` function in VB.NET is primarily due to the way the VB runtime interprets date strings based on the current culture and regional settings of the environment in which the code is executing. Here are some factors to consider: 1. **Date Format Interpretation**: The `M...
20,492
[ { "from": "human", "value": "I'm working in a web application using VB.NET. There is also VisualBasic code mixed in it, in particular the Date variable and the Month function of VB.\nThe problem is this part:\nMonth(\"10/01/2008\")\n\nOn the servers, I get 10 (October) as the month (which is supposed to be ...
I am using the ADONetAppender to (try) to log data via a stored procedure (so that I may inject logic into the logging routine). My configuration settings are listed below. Can anybody tell what I'm doing wrong? <appender name="ADONetAppender_SqlServer" type="log4net.Appender.ADONetAppender"> <bufferSize value="1" />...
Your configuration for the `ADONetAppender` to log via a stored procedure looks mostly correct, but there are a few things you should check and consider to ensure that it's working as expected. 1. **Connection String**: Ensure that your `<MyConnectionString>` is valid and contains the correct credentials and server in...
22,959
[ { "from": "human", "value": "I am using the ADONetAppender to (try) to log data via a stored procedure (so that I may inject logic into the logging routine).\nMy configuration settings are listed below. Can anybody tell what I'm doing wrong?\n<appender name=\"ADONetAppender_SqlServer\" type=\"log4net.Append...
I've got some VB code (actually VBA) which is basically the same except for the type on which it operates. Since I think the DRY principle is a good guiding principle for software development, I want to write one routine for all of the different types which need to be operated on. For example if I had two snippets of...
You are correct that VBA does not support generics or templates like you would find in C++. However, you can still achieve a similar outcome using a couple of different strategies. Here are a few approaches you might consider: ### 1. Using Interfaces If `Obj1` and `Obj2` share a common interface, you can use that inte...
14,422
[ { "from": "human", "value": "I've got some VB code (actually VBA) which is basically the same except for the type on which it operates. Since I think the DRY principle is a good guiding principle for software development, I want to write one routine for all of the different types which need to be operated ...
Is there a portable way of getting thread and/or process identifier (string, int, ...) with C++?
Yes, you can obtain the thread and process identifiers in a portable way using the C++ Standard Library along with some platform-specific features. However, the C++ Standard Library does not provide a built-in way to get thread or process IDs. Instead, you need to use platform-specific APIs. Here’s how you can get the...
20,881
[ { "from": "human", "value": "Is there a portable way of getting thread and/or process identifier (string, int, ...) with C++?\n" }, { "from": "gpt", "value": "Yes, you can obtain the thread and process identifiers in a portable way using the C++ Standard Library along with some platform-specific...
At work I have a standard desk (4 legs, flat surface, you get the picture). For a while now I've been thinking about converting to a standing desk. What would be the best way to go about this on a limited budget? Are there some good laptop/keyboard stands I could place on my existing desk? Which ones are the best? ...
Converting your standard desk into a standing desk on a budget is definitely doable! Here are some practical solutions, including laptop and keyboard stands that can help you achieve a standing desk setup: ### 1. **Desktop Converter** One of the simplest solutions is to use a desktop converter that sits on top of yo...
23,125
[ { "from": "human", "value": "At work I have a standard desk (4 legs, flat surface, you get the picture). For a while now I've been thinking about converting to a standing desk. What would be the best way to go about this on a limited budget? Are there some good laptop/keyboard stands I could place on my ...
I need to find occurrences of ~ 25 000 words within a text. What is the most suitable algorithm/library for this purpose? target language is C++
To find occurrences of approximately 25,000 words within a text in C++, there are several approaches and libraries you can use. The choice of algorithm and library depends on the specific requirements, such as performance, complexity, and ease of use. Here are some suitable approaches and libraries: ### 1. **Using St...
21,291
[ { "from": "human", "value": "I need to find occurrences of ~ 25 000 words within a text. What is the most suitable algorithm/library for this purpose?\ntarget language is C++\n" }, { "from": "gpt", "value": "To find occurrences of approximately 25,000 words within a text in C++, there are severa...
How do I pass a parameter from a page's useBean in JSP to a servlet in Java? I have some data in a form that gets passed no problem with a submit button, but no way to send anything else. Please help? Here is my code: <input name = "deleteGameButton" type = "submit" value = "Delete" onclick = "submitToServlet('DeleteG...
To pass parameters from a JSP `useBean` to a servlet, you typically need to do this through a form submission. Since you're already using a form and the `submitToServlet` function, you can add the properties of the `userBean` to the request before submitting the form. Here’s a step-by-step solution: 1. **Add the para...
23,455
[ { "from": "human", "value": "How do I pass a parameter from a page's useBean in JSP to a servlet in Java? I have some data in a form that gets passed no problem with a submit button, but no way to send anything else. Please help? Here is my code:\n<input name = \"deleteGameButton\" type = \"submit\" value =...
Has anyone used the noweb literate programming tool on a large Java project, where several source code files must be generated in different subdirectories? How did you manage this with noweb? Are there any resources and/or best practices out there?
Yes, several developers have successfully used the noweb literate programming tool on large Java projects. While noweb is often more associated with languages like C or Python, it can definitely be utilized for Java projects as well. Here are some insights on how to manage a large Java project with noweb, particularly ...
21,091
[ { "from": "human", "value": "Has anyone used the noweb literate programming tool on a large Java project, where several source code files must be generated in different subdirectories? How did you manage this with noweb? Are there any resources and/or best practices out there?\n" }, { "from": "gpt",...
I've been asked to create a fairly straightforward website for a friend. Essentially a user will log in, fill in a set of information, and submit it. This data will then need to written to a database (and read from/presented at a future point). I'm not really a web developer (I do mostly Java/C++), but about 3 years ag...
Using WAMP (Windows, Apache, MySQL, PHP) is still a solid choice for developing a straightforward website like the one you described. It's a well-established stack, widely supported, and works well for small to medium-sized applications. Since you already have some familiarity with WAMP and PHP, leveraging your past ex...
24,754
[ { "from": "human", "value": "I've been asked to create a fairly straightforward website for a friend. Essentially a user will log in, fill in a set of information, and submit it. This data will then need to written to a database (and read from/presented at a future point).\nI'm not really a web developer (I...
When placing email addresses on a webpage do you place them as text like this: joe.somebody@company.com or use a clever trick to try and fool the email address harvester bots? For example: HTML Escape Characters: &#106;&#111;&#101;&#46;&#115;&#111;&#109;&#101;&#98;&#111;&#100;&#121;&#64;&#99;&#111;&#109;&#112;&#97;&#1...
When it comes to placing email addresses on a webpage, there are a few strategies you can consider to protect the addresses from being harvested by bots. Each method has its own pros and cons: 1. **Plain Text**: Simply writing the email address as text (e.g., `joe.somebody@company.com`) is the most straightforwar...
23,471
[ { "from": "human", "value": "When placing email addresses on a webpage do you place them as text like this:\njoe.somebody@company.com\n\nor use a clever trick to try and fool the email address harvester bots? For example:\nHTML Escape Characters:\n&#106;&#111;&#101;&#46;&#115;&#111;&#109;&#101;&#98;&#111;&#...
I have a couple Perl scripts I'm taking public soon, and I want to make sure they'll run under mod_fcgid in order to keep the server load as low as possible. Previously, I've only ever run scripts that test FastCGI (ie, while ( my $q = new CGI::Fast ) { $count++; echo $count;}) or taken advantage of larger Perl packag...
To get your Perl scripts running under mod_fcgid with Apache, there are several steps to follow beyond just changing the file suffix to `.fcgi`. Here’s a detailed checklist to help you ensure that your scripts will work correctly: 1. **Change the File Extension**: Rename your script files to have a `.fcgi` suffix. Thi...
19,177
[ { "from": "human", "value": "I have a couple Perl scripts I'm taking public soon, and I want to make sure they'll run under mod_fcgid in order to keep the server load as low as possible. Previously, I've only ever run scripts that test FastCGI (ie, while ( my $q = new CGI::Fast ) { $count++; echo $count;})...
How do you capture the mouse events, move and click over top of a Shockwave Director Object (not flash) in Firefox, via JavaScript. The code works in IE but not in FF. The script works on the document body of both IE and Moz, but mouse events do not fire when mouse is over a shockwave director object embed. Update: ...
Capturing mouse events over a Shockwave Director object can be tricky because such embedded objects can often intercept mouse events, preventing them from being propagated to the underlying document. This issue tends to be more pronounced in Firefox than in Internet Explorer. Here are some strategies you can employ to...
20,820
[ { "from": "human", "value": "How do you capture the mouse events, move and click over top of a Shockwave Director Object (not flash) in Firefox, via JavaScript. The code works in IE but not in FF. \nThe script works on the document body of both IE and Moz, but mouse events do not fire when mouse is over a s...
I've got a BPG file that I've modified to use as a make file for our company's automated build server. In order to get it to work I had to change Uses * Uses unit1 in 'unit1.pas' * unit1 unit2 in 'unit2.pas' * unit2 ... * ... in the DPR file to get it ...
It sounds like you're dealing with a Delphi project that has been converted to use a makefile system and you're running into issues with how units are referenced in the DPR file. The key issue seems to be how Delphi expects the units to be declared in the DPR file compared to how they are being generated in the BPG fil...
16,046
[ { "from": "human", "value": "I've got a BPG file that I've modified to use as a make file for our company's automated build server. In order to get it to work I had to change \n\nUses * Uses\n unit1 in 'unit1.pas' * unit1\n unit2 in 'unit2.pas' * unit2\n ... ...
I have two points (a line segment) and a rectangle. I would like to know how to calculate if the line segment intersects the rectangle.
To determine if a line segment intersects a rectangle, you can follow these steps: ### Step 1: Define Your Points and Rectangle - Let the endpoints of the line segment be \( P1(x1, y1) \) and \( P2(x2, y2) \). - Define the rectangle using its bottom-left corner \( R(x_{\text{min}}, y_{\text{min}}) \) and top-right cor...
11,140
[ { "from": "human", "value": "I have two points (a line segment) and a rectangle. I would like to know how to calculate if the line segment intersects the rectangle. \n" }, { "from": "gpt", "value": "To determine if a line segment intersects a rectangle, you can follow these steps:\n\n### Step 1:...
Our organization started on the SharePoint path about two years ago. Before that, we (the developers) wrote mostly asp.net front ends for SQL back ends. Now it seems like every time a new project comes up, we are asked to “make” it fit in SharePoint; and we have stuffed some things into SharePoint that probably shoul...
Drawing the line between using SharePoint and developing standalone web or WinForms applications can be nuanced, particularly in organizations that have recently adopted SharePoint as a primary development platform. Here are some key considerations to help you decide when to use SharePoint and how to effectively commun...
22,083
[ { "from": "human", "value": "Our organization started on the SharePoint path about two years ago. Before that, we (the developers) wrote mostly asp.net front ends for SQL back ends. Now it seems like every time a new project comes up, we are asked to “make” it fit in SharePoint; and we have stuffed some t...
What is the lowest SQL Server 2005 edition to support SSIS?
SQL Server Integration Services (SSIS) is included with SQL Server starting from SQL Server 2005. Therefore, the lowest edition of SQL Server 2005 that supports SSIS is SQL Server 2005 Standard Edition. SSIS is not available in the SQL Server 2005 Express Edition.
28,774
[ { "from": "human", "value": "What is the lowest SQL Server 2005 edition to support SSIS?\n" }, { "from": "gpt", "value": "SQL Server Integration Services (SSIS) is included with SQL Server starting from SQL Server 2005. Therefore, the lowest edition of SQL Server 2005 that supports SSIS is SQL S...
Does anyone know how to programmaticly find out where the java classloader actually loads the class from? I often work on large projects where the classpath gets very long and manual searching is not really an option. I recently had a problem where the classloader was loading an incorrect version of a class because ...
To programmatically determine where a Java class is loaded from, you can use the `ClassLoader` and the `Class` APIs in Java. Here is a simple method to achieve this: ```java public class ClassLoaderUtil { public static String getClassFilePath(String className) { try { Class<?> clazz = Class.for...
23,969
[ { "from": "human", "value": "Does anyone know how to programmaticly find out where the java classloader actually loads the class from? \nI often work on large projects where the classpath gets very long and manual searching is not really an option. I recently had a problem where the classloader was loadin...
Say I have the following string: "I am the most foo h4ck3r ever!!" I'm trying to write a makeSpecial(foo) function where the foo substring would be wrapped in a new span element, resulting in: "I am the most <span class="special">foo></span> h4ck3r ever!!" BeautifulSoup seemed like the way to go, but I haven't been a...
You can definitely accomplish this in Python using BeautifulSoup! However, to clarify your desired output, it seems you have a typo in your expected output. It should be `<span class="special">foo</span>` instead of `<span class="special">foo></span>`. Here’s how you can implement the `makeSpecial(foo)` function to wra...
23,542
[ { "from": "human", "value": "Say I have the following string:\n\"I am the most foo h4ck3r ever!!\"\n\nI'm trying to write a makeSpecial(foo) function where the foo substring would be wrapped in a new span element, resulting in:\n\"I am the most <span class=\"special\">foo></span> h4ck3r ever!!\"\n\nBeautifu...
I have a class proposing translations utilities. The translations themselves should be reloaded every 30 minutes. I use Spring Timer support for that. Basically, my class looks like : public interface Translator { public void loadTranslations(); public String getTranslation(String key); } loadTranslations() ca...
To achieve the desired behavior of preventing multiple threads from executing the `loadTranslations()` method simultaneously, you can use a simple locking mechanism with a boolean flag. Given that you're using Java 1.4, you don't have access to the `java.util.concurrent` package, but you can use `synchronized` blocks c...
21,006
[ { "from": "human", "value": "I have a class proposing translations utilities. The translations themselves should be reloaded every 30 minutes. I use Spring Timer support for that. Basically, my class looks like :\npublic interface Translator {\n public void loadTranslations();\n public String getTrans...
I'm a newbie on Ant so instead of posting this on the official buglist(because its probably not a bug), I decided to post here: When I run my Ant build.xml file everything works well except for the build directory, that instead of translating the property ${classes.dir} into build/ver_2.0.0/classes it creates a file ${...
The issue you're experiencing with Ant is related to the order in which properties are defined and resolved. In your Ant build script, you're trying to use the property `${cv.build.dir}` to define `${classes.dir}`, but `${cv.build.dir}` itself relies on `${build.dir}`, which hasn't been resolved yet. To fix the proble...
23,444
[ { "from": "human", "value": "I'm a newbie on Ant so instead of posting this on the official buglist(because its probably not a bug), I decided to post here:\nWhen I run my Ant build.xml file everything works well except for the build directory, that instead of translating the property ${classes.dir} into bu...
I would like to know how to make use of an Axiom database resource inside a Safe function. Right now I'm just handling the connection manually but I know it would be better to use the already defined resources.
To use an Axiom database resource within a Safe function in your application, you will typically want to leverage the existing connection pools or resource management that Axiom provides. A Safe function is typically used in contexts where you want to ensure that the database operations are secure and do not interfere ...
21,289
[ { "from": "human", "value": "I would like to know how to make use of an Axiom database resource inside a Safe function. \nRight now I'm just handling the connection manually but I know it would be better to use the already defined resources.\n" }, { "from": "gpt", "value": "To use an Axiom datab...
What is the difference between a URL, a URI, and a URN?
The terms URL, URI, and URN are related concepts in the context of web addressing and resource identification, but they have distinct meanings: 1. **URI (Uniform Resource Identifier)**: - A URI is a generic string of characters that identifies a particular resource. It can be further classified into URLs and URNs. ...
25,305
[ { "from": "human", "value": "What is the difference between a URL, a URI, and a URN?\n" }, { "from": "gpt", "value": "The terms URL, URI, and URN are related concepts in the context of web addressing and resource identification, but they have distinct meanings:\n\n1. **URI (Uniform Resource Iden...
I am having the worst luck with this. We bought a template to update our own website (don't have enough time to start our own from scratch!) but when I make simple changes in the Flash CS4 native file and re-export the swf, it doesn't work correctly! I am wondering if anyone has run across the same problems with a Temp...
It sounds like you’re experiencing some challenges with the Template Monster Flash template. Here are a few common issues and troubleshooting tips you might consider: 1. **Check ActionScript Errors**: Sometimes, modifications can inadvertently cause ActionScript errors. Make sure to check the Output panel in Flash for...
24,496
[ { "from": "human", "value": "I am having the worst luck with this. We bought a template to update our own website (don't have enough time to start our own from scratch!) but when I make simple changes in the Flash CS4 native file and re-export the swf, it doesn't work correctly!\nI am wondering if anyone ha...
I need to validate the email address of my users. Unfortunately, making a validator that conforms to standards is hard. Here is an example of a regex expression that tries to conform to the standard. Is there a PHP library (preferably, open-source) that validates an email address?
Yes, there are several PHP libraries available that can help you validate email addresses while conforming to standards. Here are a few popular open-source options: 1. **PHP Email Validator**: - **Library**: [egulias/email-validator](https://github.com/egulias/EmailValidator) - **Description**: This is a robust ...
24,921
[ { "from": "human", "value": "I need to validate the email address of my users. Unfortunately, making a validator that conforms to standards is hard.\nHere is an example of a regex expression that tries to conform to the standard.\nIs there a PHP library (preferably, open-source) that validates an email addr...