instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
Consider the following table structure... Appointment ----------- ID integer Description nvarchar StatusID smallint Status ------ ID smallint DisplayText nvarchar Now, for good or for evil, we want this situation to map to a class that looks like this class Appointment { public int ID {g;s;} public string D...
To create a mapping from the normalized `Status` table to the `Appointment` class while maintaining a straightforward structure for your `Appointment` entity, you can follow these general steps. I will use C# as an example language to demonstrate the mapping, assuming you're working within an environment that utilizes ...
46,623
[ { "from": "human", "value": "Consider the following table structure...\nAppointment\n-----------\nID integer\nDescription nvarchar\nStatusID smallint\n\nStatus\n------\nID smallint\nDisplayText nvarchar\n\nNow, for good or for evil, we want this situation to map to a class that looks like this\nclass Appoin...
Let's say you are a GM dba and you have to design around the GM models Is it better to do this? table_model type {cadillac, saturn, chevrolet} Or this? table_cadillac_model table_saturn_model table_chevrolet_model Let's say that the business lines have the same columns for a model and that there are over a m...
The decision to design your database schema using a single table for all models (with a `type` field to differentiate between brands) versus using separate tables for each brand can be influenced by various factors, especially considering the high CRUD activity and processor-intensive reporting needs you've mentioned. ...
49,418
[ { "from": "human", "value": "Let's say you are a GM dba and you have to design around the GM models\nIs it better to do this?\n\ntable_model\n\n\ntype {cadillac, saturn, chevrolet}\n\n\nOr this?\n\ntable_cadillac_model\ntable_saturn_model \ntable_chevrolet_model\n\nLet's say that the business lines have ...
I'd like to use sqlmetal to generate dbml data contexts for my project, but the data context and all classes created are marked as public. As this is supposed to be an API layer I'd like to instead mark many of these classes or at least the context itself as internal. Is there a way to do this in sqlmetal or some other...
`sqlmetal` is a command-line tool provided by Microsoft that is used to generate LINQ to SQL entity classes and data contexts from an existing database schema. By default, `sqlmetal` generates public classes and public data contexts. While `sqlmetal` itself does not provide direct options to mark the generated classes...
49,165
[ { "from": "human", "value": "I'd like to use sqlmetal to generate dbml data contexts for my project, but the data context and all classes created are marked as public. As this is supposed to be an API layer I'd like to instead mark many of these classes or at least the context itself as internal. Is there a...
I'm creating a WPF app and have a system tray icon with a context menu. For the menu items I want to use WPF commands but when I assign them they are always greyed out even though the (same) commands are enabled in other places. MenuItem menuItem = new MenuItem(); menuItem.Header = "Exit"; menuItem.Command = CustomComm...
It sounds like you're dealing with a common issue when using WPF commands in a system tray context menu. Commands can appear grayed out until the command manager determines whether they can be executed. This usually happens because the command manager caches the state of commands and may not recognize changes unless ex...
47,803
[ { "from": "human", "value": "I'm creating a WPF app and have a system tray icon with a context menu. For the menu items I want to use WPF commands but when I assign them they are always greyed out even though the (same) commands are enabled in other places.\nMenuItem menuItem = new MenuItem();\nmenuItem.Hea...
I use this line in my .htaccess file to automatically add a trailing slash if not present rewriteRule ^(([a-z0-9\-]+/)*[a-z0-9\-]+)$ /$1/ [NC,R=301] This works fine, until I use these lines to redirect all requests to not files or dirs to index.php RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-...
The issue you're facing is due to the order of the rules in your `.htaccess` file. The way mod_rewrite processes the rules can affect whether your trailing slash rule gets executed before or after the redirection to `index.php`. Here's a breakdown of how to structure your `.htaccess` file to ensure that the trailing s...
48,295
[ { "from": "human", "value": "I use this line in my .htaccess file to automatically add a trailing slash if not present\nrewriteRule ^(([a-z0-9\\-]+/)*[a-z0-9\\-]+)$ /$1/ [NC,R=301]\n\nThis works fine, until I use these lines to redirect all requests to not files or dirs to index.php\nRewriteCond %{REQUEST_F...
While trying to use LINQ to SQL I encountered several problems. I have table persons: int ID string firstName string lastName And table notes that has: int ID string noteText string createdBy datetime creationDate int PersonID PersonID is a foreign key and the relationship is 1:n I tried to use LINQ to SQL to creat...
You're correct that in LINQ to SQL, when you insert a new entity (in this case, a `Person`), it does not have an ID until after you call `SubmitChanges()`. This makes it tricky to set up relationships immediately since the foreign key (in your `Note` entity) will not yet be available. However, you can avoid multiple `...
49,835
[ { "from": "human", "value": "While trying to use LINQ to SQL I encountered several problems.\nI have table persons:\n\nint ID\nstring firstName\nstring lastName\n\nAnd table notes that has:\n\nint ID\nstring noteText\nstring createdBy\ndatetime creationDate\nint PersonID\n\nPersonID is a foreign key and the...
I have a situation where in a web application a user may need a variable list of PDFs to be printed. That is, given a large list of PDFs, the user may choose an arbitrary subset of that list to print. These PDFs are stored on the file system. I need a method to allow users to print these batches of PDFs relatively easi...
You have a couple of viable options for printing batches of PDFs in a web application, and you are correct to consider both the user experience and performance. Here are some potential solutions you can consider, along with their pros and cons: ### 1. **Combining PDFs on the Fly** Using a PDF library to combine multip...
45,105
[ { "from": "human", "value": "I have a situation where in a web application a user may need a variable list of PDFs to be printed. That is, given a large list of PDFs, the user may choose an arbitrary subset of that list to print. These PDFs are stored on the file system. I need a method to allow users to pr...
I have a query that runs super fast when executed in the sql editor (oracle): 1ms. The same query (as stored procedure) when executed by a DataSet-TableAdapter takes 2 seconds. I'm just retrieving 20rows. Since I'm using a TableAdapter, the return values are stored in a ref cursor. If I was fetching 2'000 rows I could ...
When dealing with performance issues in Oracle stored procedures, especially when you notice a significant discrepancy between execution times in an SQL editor and when executing through a DataSet-TableAdapter, there are several factors to consider. Here are some strategies you can employ to diagnose and potentially im...
48,329
[ { "from": "human", "value": "I have a query that runs super fast when executed in the sql editor (oracle): 1ms.\nThe same query (as stored procedure) when executed by a DataSet-TableAdapter takes 2 seconds. I'm just retrieving 20rows.\nSince I'm using a TableAdapter, the return values are stored in a ref cu...
It seems to me that the most common overly ambitious project that programmers (esp. Comp. Sci. grads) try to tackle is building your own operating system. (Trying to create your own programming language + compiler is probably even more common but not nearly as ambitious.) For those (like myself) foolish enough to try: ...
Creating your own operating system (OS) is indeed a highly ambitious project that can be both challenging and rewarding. While the sheer size and complexity of the task can be daunting, there are several specific gotchas and unexpected roadblocks that you may encounter along the way: ### Gotchas and Unexpected Roadblo...
47,504
[ { "from": "human", "value": "It seems to me that the most common overly ambitious project that programmers (esp. Comp. Sci. grads) try to tackle is building your own operating system. (Trying to create your own programming language + compiler is probably even more common but not nearly as ambitious.)\nFor t...
Our project is held in a SourceSafe database. We have an automated build, which runs every evening on a dedicated build machine. As part of our build process, we get the source and associated data for the installation from SourceSafe. This can take quite some time and makes up the bulk of the build process (which is ot...
Using the SourceSafe object model can offer several advantages and some disadvantages compared to using the command line tool (ss.exe) in your automated build process. Below are some points to consider regarding the object model: ### Advantages of Using the Object Model 1. **Easier Integration**: The object model can...
49,601
[ { "from": "human", "value": "Our project is held in a SourceSafe database. We have an automated build, which runs every evening on a dedicated build machine. As part of our build process, we get the source and associated data for the installation from SourceSafe. This can take quite some time and makes up t...
When working with Silverlight, I've noticed that Firefox will cache the XAP file, so if I do an update, a user may be stuck using an outdated version. Is there a way to force the browser to either re-download the XAP file every time, or maybe only force it to after an update has been published? Or is there a setting ...
Caching issues with Silverlight XAP files in browsers like Firefox can be problematic when you're deploying updates. There are a few strategies you can employ to ensure that users are getting the latest version of your application: ### 1. Versioning the XAP File One common approach is to include a version number in th...
49,907
[ { "from": "human", "value": "When working with Silverlight, I've noticed that Firefox will cache the XAP file, so if I do an update, a user may be stuck using an outdated version. Is there a way to force the browser to either re-download the XAP file every time, or maybe only force it to after an update ha...
I keep seeing people say that exceptions are slow, but I never see any proof. So, instead of asking if they are, I will ask how do exceptions work behind the scenes, so I can make decisions of when to use them and whether they are slow. From what I know, exceptions are the same as doing a return bunch of times, except ...
Exceptions in programming languages are indeed a complex mechanism that allows for error handling, but they can introduce overhead compared to regular control flow methods like return codes. The actual implementation details can vary significantly between languages and their runtime environments, but I can provide a ge...
48,761
[ { "from": "human", "value": "I keep seeing people say that exceptions are slow, but I never see any proof. So, instead of asking if they are, I will ask how do exceptions work behind the scenes, so I can make decisions of when to use them and whether they are slow.\nFrom what I know, exceptions are the same...
I want to embed a swf over a html page, like a floating video watching panel. I already have a swf file which will automatically adjust its size according to the browser size, and the swf file is partially transparent. I thought I can just add a div tag, make the position absolute and change z-index bigger, but that do...
It sounds like you're on the right track with using an absolute position and z-index to overlay your SWF file on your HTML page. However, the SWF might be rendering above or replacing other elements due to how Flash content interacts with the DOM. Here are a few adjustments and recommendations to help you achieve the ...
48,846
[ { "from": "human", "value": "I want to embed a swf over a html page, like a floating video watching panel. I already have a swf file which will automatically adjust its size according to the browser size, and the swf file is partially transparent. I thought I can just add a div tag, make the position absolu...
We all know and love Process.WaitForExit(). Given a pid of a process on a remote machine (created by WMI/psexec), how do I wait for it to end?
To wait for a process to end on a remote machine using its Process ID (PID), you cannot use `Process.WaitForExit()` directly because it works on local processes. Instead, you can achieve this using Windows Management Instrumentation (WMI) or PowerShell. Here’s how you can do it using WMI in C#: ### Using WMI in C# Y...
47,464
[ { "from": "human", "value": "We all know and love Process.WaitForExit().\nGiven a pid of a process on a remote machine (created by WMI/psexec), how do I wait for it to end?\n" }, { "from": "gpt", "value": "To wait for a process to end on a remote machine using its Process ID (PID), you cannot us...
I am making a waitlist application. I'd like to be able to send applications a unique confirmation code - and later on be able to find a user either by confirmation code or by username. Will Symfony be able to call Models to say either: Code->findUser($code_string); User->getCode(); I believe that the below schema ha...
Your schema design looks like a solid starting point for a waitlist application. In Symfony, you can indeed define relationships between entities (models) in a way that allows you to retrieve users by either their confirmation code or username. Here’s how you can achieve this using Doctrine, which is Symfony's default ...
47,937
[ { "from": "human", "value": "I am making a waitlist application. I'd like to be able to send applications a unique confirmation code - and later on be able to find a user either by confirmation code or by username.\nWill Symfony be able to call Models to say either:\nCode->findUser($code_string);\n\nUser->g...
Whenever I download an update to firefox and apply it Kaspersky Antivirus alerts me that the file FIREFOX.EXE has been modified. I want to know how do they do it. Is it possible to do a simple program to demonstrate this trick. Like the executable would initially display "Hello, World!" on the prompt and when I replace...
To demonstrate the concept of modifying an executable file and how it can change its behavior, you can create a simple program in C. The original executable will display "Hello, World!", and you can modify it to change the message to "Hello, World! Mod". This is a straightforward example of how an executable can be mod...
46,294
[ { "from": "human", "value": "Whenever I download an update to firefox and apply it Kaspersky Antivirus alerts me that the file FIREFOX.EXE has been modified. I want to know how do they do it. Is it possible to do a simple program to demonstrate this trick. Like the executable would initially display \"Hello...
I develop tools in Autodesk Maya. Many of the tools I build have simple windowed GUIs for the animators and modellers to use. These GUIs often contain what you'd normally expect to see in any basic window; labels, lists, menus, buttons, textfields, etc. However, there are limitations to the complexity of the UIs you...
Integrating wxPython with Autodesk Maya can indeed be challenging due to Maya’s single-threaded nature, particularly its reliance on a single event loop. However, you can achieve this integration with careful handling of the event loops and threading. ### Approaches to Integrate wxPython with Maya 1. **Use a Separate...
49,930
[ { "from": "human", "value": "I develop tools in Autodesk Maya. Many of the tools I build have simple windowed GUIs for the animators and modellers to use. These GUIs often contain what you'd normally expect to see in any basic window; labels, lists, menus, buttons, textfields, etc. However, there are lim...
I'm using a MOSS Publishing site with a custom master page. One of our requirements is to have a "Site Updated" footer. Currently we set this manually each time the site is updated. What i'm trying to do is reference a specific list item (from a custom list) that stores this date. I'm using sharepoint designer to ins...
It sounds like you’re on the right track trying to display the "Site Updated" date using a Data View Web Part (DVWP) on your custom master page. The error you're seeing is a common issue when using DVWPs across different sites or when attempting to reference lists that are not present in the current context. Here are ...
49,762
[ { "from": "human", "value": "I'm using a MOSS Publishing site with a custom master page. One of our requirements is to have a \"Site Updated\" footer. Currently we set this manually each time the site is updated. \nWhat i'm trying to do is reference a specific list item (from a custom list) that stores this...
Is there a good reference, or summary list, of new features in WCF 2.0/VS2010? I'm trying to do a justification proposal for a project, to migrate from Jabber to WCF.
Migrating from Jabber (often used for XMPP messaging) to Windows Communication Foundation (WCF) can bring several benefits, especially in terms of enhanced functionality, easier integration, and better support for various communication patterns. Below is a summary of some notable features and improvements introduced in...
49,976
[ { "from": "human", "value": "Is there a good reference, or summary list, of new features in WCF 2.0/VS2010?\nI'm trying to do a justification proposal for a project, to migrate from Jabber to WCF.\n" }, { "from": "gpt", "value": "Migrating from Jabber (often used for XMPP messaging) to Windows C...
I have a master page with a search box and button at the top. This search functionality is taking over the "enter" key for all my web forms that use this master page. That is, if I have a login page that uses this master page and the user enters in their username/password and hits "enter", instead of logging in the u...
To manage the default behavior of the "Enter" key in your ASP.NET web forms that use a master page with a search box, you have a couple of options to ensure that the appropriate button is triggered without having to wrap everything in `asp:Panel` controls with `DefaultButton` properties. Here are some approaches you ca...
48,741
[ { "from": "human", "value": "I have a master page with a search box and button at the top. This search functionality is taking over the \"enter\" key for all my web forms that use this master page. That is, if I have a login page that uses this master page and the user enters in their username/password an...
I am trying to reach methods and properties of ObjectFrame through vb.net. But when I declared this as Dim objOLEObject As ObjectFrame and then trying to instantiate it as ObjOLEObject = New ObjectFrame it shows error like: "429: Retriveing the COM class factory for component with CLSID {3806e95d-e47c-11-cd-8701-00...
The error code you're seeing (`80040154`) typically indicates a "Class not registered" error, which suggests that your .NET application cannot find or access the COM component associated with the specified CLSID. Here are several steps you can take to troubleshoot and resolve the issue when trying to use an `ObjectFram...
48,743
[ { "from": "human", "value": "I am trying to reach methods and properties of ObjectFrame through vb.net.\nBut when I declared this as \nDim objOLEObject As ObjectFrame\n\nand then trying to instantiate it as \nObjOLEObject = New ObjectFrame\n\nit shows error like:\n\"429: Retriveing the COM class factory for...
I have a small C library in a DLL and I need to call a handful of its methods. It uses pointers and a few structs but is otherwise quite simple. Problem is I'm not terribly knowledgable on .NET's interop with the unmanaged world and my attempts so far keep hitting memory access violation exceptions (presumably due to m...
To call your C library from .NET using P/Invoke, you need to correctly define your structures and manage memory allocation and deallocation between managed and unmanaged code. Below is a step-by-step guide on how to approach this, along with code snippets to illustrate the process. ### Step 1: Define the Structures in...
44,195
[ { "from": "human", "value": "I have a small C library in a DLL and I need to call a handful of its methods.\nIt uses pointers and a few structs but is otherwise quite simple. Problem is I'm not terribly knowledgable on .NET's interop with the unmanaged world and my attempts so far keep hitting memory access...
The idea is download a video in parts (from different servers) but starting to play before video file is complete. The issue is that VideoDisplay component doesn't read the video file if it is opened for writing and vice-versa: writing is impossible if VideoDisplay plays the video...
What you’re describing is a common challenge in streaming video data, where the goal is to download and display video content in a way that allows for seamless playback while also managing the download process. Here’s a general approach to achieve this: ### Approach Overview 1. **Segment the Video**: Split the video ...
49,572
[ { "from": "human", "value": "The idea is download a video in parts (from different servers) but starting to play before video file is complete.\nThe issue is that VideoDisplay component doesn't read the video file if it is opened for writing and vice-versa: writing is impossible if VideoDisplay plays the vi...
On Linux, how can I (programmatically) retrieve the following counters on a per-interface basis: Sent/received ethernet frames, Sent/received IPv4 packets, Sent/received IPv6 packets.
To retrieve network statistics on Linux, you can access system files and use command-line tools, but for a programmatic approach, particularly with programming languages such as Python, you may want to interact with the `/proc/net/dev` and `/proc/net/ipv4/netstat` files, as well as utilize `ip -s` commands to get the s...
47,061
[ { "from": "human", "value": "On Linux, how can I (programmatically) retrieve the following counters on a per-interface basis:\n\nSent/received ethernet frames,\nSent/received IPv4 packets,\nSent/received IPv6 packets.\n\n" }, { "from": "gpt", "value": "To retrieve network statistics on Linux, yo...
All, I am trying to load up a bmp file into a GLubyte array (without using aux). It is unbelievable how what I thought would have been a trivial task is sucking up hours of my time. Can't seem to find anything on Google! This is what I hacked together but it's not quite working: // load texture GLubyte *customTexture;...
It looks like you're on the right track trying to load a BMP file into a GLubyte array. However, your current approach has a couple of issues. Here are some points to consider and a more complete example to help you achieve your goal: 1. **LoadImage Usage**: The `LoadImage` function you've called is generally for load...
49,799
[ { "from": "human", "value": "All,\nI am trying to load up a bmp file into a GLubyte array (without using aux).\nIt is unbelievable how what I thought would have been a trivial task is sucking up hours of my time.\nCan't seem to find anything on Google!\nThis is what I hacked together but it's not quite work...
I have the following Clojure code and I'm not sure why it's not working: (defn match (x y &optional binds) (cond ((eql x y) (values binds t)) ((assoc x binds) (match (binding x binds) y binds)) ((assoc y binds) (match x (binding y binds) binds)) ((var? x) (values (cons (cons x y) binds) t)) ((var? y) (...
The error you're encountering suggests that there is an issue with how you're using the `match` function, especially in relation to how symbols and collections are being handled. The error specifically points out that the code is trying to create a sequence from a symbol, which indicates that somewhere you're passing i...
46,228
[ { "from": "human", "value": "I have the following Clojure code and I'm not sure why it's not working:\n(defn match (x y &optional binds)\n (cond\n ((eql x y) (values binds t))\n ((assoc x binds) (match (binding x binds) y binds))\n ((assoc y binds) (match x (binding y binds) binds))\n ((var? x) (va...
How do you build a hierarchical set of tags with data in PHP? For example, a nested list: <div> <ul> <li>foo </li> <li>bar <ul> <li>sub-bar </li> </ul> </li> </ul> </div> This would be build from flat data like this: nested...
To create a hierarchical set of tags in PHP from a flat array, you'll want to first transform your flat data structure into a nested representation. The provided flat data includes both the name and the depth, which indicates how many levels deep each element is in the hierarchy. Here's a step-by-step approach to achi...
49,478
[ { "from": "human", "value": "How do you build a hierarchical set of tags with data in PHP?\nFor example, a nested list:\n<div>\n <ul>\n <li>foo\n </li>\n <li>bar\n <ul>\n <li>sub-bar\n </li>\n </ul>\n </li>\n </ul>\n</div>...
We have a large enterprise consisting of many apps both old and new backed by Oracle 10G. When blocking sessions or deadlocks occur and we get trace reports it would be super handy to be able to have embedded some details in the sql so that we know both what app, and specifically where it was executed from. In additi...
Embedding application context within SQL statements can certainly help in diagnosing performance issues, including blocking sessions and deadlocks. Here are several approaches that organizations have taken to embed useful information in their SQL for better tracking and troubleshooting. ### 1. **Use of Application Co...
48,764
[ { "from": "human", "value": "We have a large enterprise consisting of many apps both old and new backed by Oracle 10G. When blocking sessions or deadlocks occur and we get trace reports it would be super handy to be able to have embedded some details in the sql so that we know both what app, and specifical...
Note: this is a different problem to https - it's related to privacy security I'm trying to figure out if there's a way to take load off our server [cache] by pushing information to the browser. Is there any technology that will provide secure caching that is bound to a session? We have privacy-sensitive data that's o...
To address your requirements for secure caching of privacy-sensitive data in a browser environment, you have several options, but there are some caveats with each one. Here are a few technologies that could be relevant to your needs: ### 1. **HTML5 Web Storage** - **sessionStorage**: This allows you to store data that...
49,926
[ { "from": "human", "value": "Note: this is a different problem to https - it's related to privacy security\nI'm trying to figure out if there's a way to take load off our server [cache] by pushing information to the browser. Is there any technology that will provide secure caching that is bound to a sessio...
I have the following JavaScript code: Link In which the function makewindows does not seem to be working. It does actual create a window, however the html either contains what is quotes, or if I change it to child1.document.write(json_encode($row2["ARTICLE_DESC"])); to create a blank html page. I moved this function t...
It sounds like you are encountering issues with JavaScript and possibly PHP as well. To help you better, let's break down the steps necessary to create a popup window that displays HTML content fetched from your backend (in this case, presumably from `test3.php`). ### Steps to Debug the Issue 1. **Ensure PHP is Fetch...
46,304
[ { "from": "human", "value": "I have the following JavaScript code:\nLink\nIn which the function makewindows does not seem to be working.\nIt does actual create a window, however the html either contains what is quotes, or if I change it to\nchild1.document.write(json_encode($row2[\"ARTICLE_DESC\"]));\n\nto ...
Is it possible to catch ASP errors in ASP.Net (setup custom error pages in IIS) and somehow gain access to the Err oject or something similar like you would using server.GetLastError() in VBScript? Thanks.
In ASP.NET, you can handle errors and set up custom error pages in IIS, but accessing the `Err` object directly like in classic ASP (VBScript) isn't possible. Instead, you can use different techniques to catch errors and customize the response. ### Custom Error Handling in ASP.NET To handle errors and set up custom e...
49,073
[ { "from": "human", "value": "Is it possible to catch ASP errors in ASP.Net (setup custom error pages in IIS) and somehow gain access to the Err oject or something similar like you would using server.GetLastError() in VBScript?\nThanks.\n" }, { "from": "gpt", "value": "In ASP.NET, you can handle ...
May be my title is not clear. I am looking for some kind of version control on database tables, like subversion does on files, like wiki does. I want to trace the changes log. I want to extract and run the diff in reverse. (undo like a "svn merge -r 101:100"). I may need a indexed search on the history. I've read the "...
Implementing version control for database tables, similar to how Subversion manages files, is a complex task, but there are established patterns and tools you can leverage to achieve this functionality. Below are some strategies and concepts that can help you create a solution for tracking changes, allowing for undo op...
46,823
[ { "from": "human", "value": "May be my title is not clear. I am looking for some kind of version control on database tables, like subversion does on files, like wiki does.\nI want to trace the changes log.\nI want to extract and run the diff in reverse. (undo like a \"svn merge -r 101:100\").\nI may need a ...
Is it possible to merge elements using XSLT. If I have the following XML <data> <item column="left" value="1" /> <item column="left" value="2" /> <item column="right" value="3" /> <item column="left" value="4" /> <item column="right" value="5" /> <item column="right" value="6" /> <item column="right" value="7" /> <item...
Yes, it is possible to transform the XML you provided into the desired output using XSLT. What you want to do is group the items based on their `column` attribute and then create a new structure that pairs up items with `column="left"` with those having `column="right"`. Here is an XSLT example that accomplishes this:...
47,473
[ { "from": "human", "value": "Is it possible to merge elements using XSLT.\nIf I have the following XML\n<data>\n<item column=\"left\" value=\"1\" />\n<item column=\"left\" value=\"2\" />\n<item column=\"right\" value=\"3\" />\n<item column=\"left\" value=\"4\" />\n<item column=\"right\" value=\"5\" />\n<ite...
I'm building an iPhone application that talks to a Ruby on Rails backend. The Ruby on Rails application will also service web users. The restful_authentication plugin is an excellent way to provide quick and customizable user authentication. However, I would like users of the iPhone application to have an account creat...
When modifying an authentication system to suit specific requirements, like automatically creating accounts for iPhone users based on the device's unique identifier, you have a few options. Here’s how you might approach this with both the `restful_authentication` plugin and `AuthLogic`, as well as some general best pra...
45,703
[ { "from": "human", "value": "I'm building an iPhone application that talks to a Ruby on Rails backend. The Ruby on Rails application will also service web users. The restful_authentication plugin is an excellent way to provide quick and customizable user authentication. However, I would like users of the iP...
What would be the fastest way, to merge 2 XML files, so I would locate a node in first one, empty it, take all children from the same tag (same node) in second XML and put it in the first one.
To merge two XML files by emptying a specific node in the first XML file and replacing its contents with the children of the same node from the second XML file, you can use programming languages that provide XML parsing capabilities, such as Python with the `xml.etree.ElementTree` module. Below is a step-by-step guide ...
48,667
[ { "from": "human", "value": "What would be the fastest way, to merge 2 XML files, so I would locate a node in first one, empty it, take all children from the same tag (same node) in second XML and put it in the first one.\n" }, { "from": "gpt", "value": "To merge two XML files by emptying a spec...
I have the following xml that's sent to me from a web service. I'm using .NET to deserialize it, but I'm getting an exception saying that its formatted wrong. There is an error in XML document (2, 2) Now, if I understand that correctly, it's not liking that it's finding the first <error> node. <?xml version="1.0" enc...
The issue you are encountering likely stems from the fact that your XML contains an XML namespace (`xmlns="http://www.w3.org/1999/xml"`), but the C# class `cResponseMessage` you are trying to deserialize into does not account for this namespace. To properly handle the namespace during deserialization, you will need t...
45,968
[ { "from": "human", "value": "I have the following xml that's sent to me from a web service. I'm using .NET to deserialize it, but I'm getting an exception saying that its formatted wrong. There is an error in XML document (2, 2) Now, if I understand that correctly, it's not liking that it's finding the fi...
I have a ListBox with a StackPanel that contains an image and label. <ListBox.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel Orientation="Horizontal" IsItemsHost="True" /> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Ver...
Yes, adding a second image behind the currently moused-over image and controlling its visibility based on mouse events is a suitable approach to achieve the desired hover effect. However, instead of using a `StackPanel`, which would stack the images vertically or horizontally, you might want to use a `Grid`. The `Grid`...
48,945
[ { "from": "human", "value": "I have a ListBox with a StackPanel that contains an image and label.\n<ListBox.ItemsPanel>\n <ItemsPanelTemplate>\n <VirtualizingStackPanel Orientation=\"Horizontal\" IsItemsHost=\"True\" />\n </ItemsPanelTemplate>\n</ListBox.ItemsPanel>\n<ListBox.ItemTemplate>\n ...
Compiling a C++ file takes a very long time when compared to C# and Java. It takes significantly longer to compile a C++ file than it would to run a normal size Python script. I'm currently using VC++ but it's the same with any compiler. Why is this? The two reasons I could think of were loading header files and runnin...
There are several reasons why compiling C++ files can take significantly longer than compiling C# or Java files, or even running a Python script. Here are some of the key factors that contribute to the longer compilation times in C++: 1. **Header Files and Preprocessing**: As you mentioned, the use of header files in ...
48,590
[ { "from": "human", "value": "Compiling a C++ file takes a very long time when compared to C# and Java. It takes significantly longer to compile a C++ file than it would to run a normal size Python script. I'm currently using VC++ but it's the same with any compiler. Why is this?\nThe two reasons I could thi...
When I drag a link that is inside a draggable div over an iframe in IE7, I get very strange results. Try the code below and let me know if you have any suggestions about how to fix this. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <he...
Dragging links over an iframe in Internet Explorer 7 can lead to unexpected behavior due to how the browser handles mouse events and iframe interactions. Below are a few suggestions to improve the experience and handle dragging more effectively. ### Suggested Solutions: 1. **Prevent Default Behavior:** When draggi...
46,193
[ { "from": "human", "value": "When I drag a link that is inside a draggable div over an iframe in IE7, I get very strange results. Try the code below and let me know if you have any suggestions about how to fix this.\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xh...
Good afternoon, I created an Excel .xla addin for Excel 2002. This weird behavior I am seeing from it happens only on my machine, but not on my coworkers. I would like to understand why. The add-in has a UDF function that gets called from many, many spreadsheets. My Add-in is set to open when Excel opens. When I op...
Good afternoon, Alan. It sounds like you're experiencing a peculiar issue with your Excel add-in that is not occurring on other machines. Here are several possible avenues you might explore to resolve the problem: 1. **Excel Startup Behavior**: Sometimes, Excel can behave differently depending on how it's launched. T...
49,463
[ { "from": "human", "value": "Good afternoon,\nI created an Excel .xla addin for Excel 2002. This weird behavior I am seeing from it happens only on my machine, but not on my coworkers. I would like to understand why.\nThe add-in has a UDF function that gets called from many, many spreadsheets.\n\nMy Add-i...
I create a TCP socket without bothering about the port number to bind to [socket.sin_port = 0]. However later on if I want to print the port number of client how do I do that? The client C application (on Linux) creates many clients which get connected to server. To debug issues I capture the traffic on ethereal. I tho...
To retrieve and print the port number that a TCP socket is bound to in your server application, you can use the `getsockname()` function after the socket is created and bound. This will allow you to obtain the address details of the socket, including the port number. Here’s a general approach you can follow: 1. Creat...
44,548
[ { "from": "human", "value": "I create a TCP socket without bothering about the port number to bind to [socket.sin_port = 0]. However later on if I want to print the port number of client how do I do that? The client C application (on Linux) creates many clients which get connected to server. To debug issues...
I have a defunct process on my system: abc 22093 19508 0 23:29 pts/4 00:00:00 grep ProcA abc 31756 1 0 Dec08 ? 00:00:00 [ProcA_my_collect] <defunct> How can I kill the above process, without a reboot of the machine? I have tried with kill -9 31756 sudo kill -9 31756
The process you are seeing with the status `<defunct>` is a zombie process. Zombie processes are those that have completed execution but still have an entry in the process table. They cannot be killed directly because they are already dead; they exist to allow their parent process to read their exit status. To remove ...
49,751
[ { "from": "human", "value": "I have a defunct process on my system:\nabc 22093 19508 0 23:29 pts/4 00:00:00 grep ProcA\nabc 31756 1 0 Dec08 ? 00:00:00 [ProcA_my_collect] <defunct>\n\nHow can I kill the above process, without a reboot of the machine? I have tried with\nkill -9 31756...
How can I easily implement queries in Zend framework?
Implementing queries in the Zend Framework can be accomplished in a few different ways, primarily through its Database component. Below are some steps and tips to help you get started with implementing queries in Zend Framework: ### Step 1: Setup Zend Framework Ensure that you have Zend Framework set up in your proje...
48,977
[ { "from": "human", "value": "How can I easily implement queries in Zend framework?\n" }, { "from": "gpt", "value": "Implementing queries in the Zend Framework can be accomplished in a few different ways, primarily through its Database component. Below are some steps and tips to help you get star...
I am working with a generic data structure, say MyGeneric<Type>. There is a case where I have to iterate over all the values it holds The code I am trying to do. for ( all the keys in myGeneric ) { // do lot of stuff here } Now the generic can hold base type as double and string and it can hold some user-defined...
In scenarios like the one you've described, leveraging polymorphism and design patterns can help eliminate type checks within your iteration logic while providing a cleaner and more maintainable solution. Here are some approaches you can consider: ### 1. Visitor Pattern The Visitor Pattern allows you to separate algo...
47,252
[ { "from": "human", "value": "I am working with a generic data structure, say MyGeneric<Type>.\nThere is a case where I have to iterate over all the values it holds \nThe code I am trying to do.\nfor ( all the keys in myGeneric ) {\n // do lot of stuff here \n}\n\nNow the generic can hold base type as dou...
On a site where 90% of the pages use the same libraries, should you just load the libraries all the time or only load them when needed? The other pages would be ajax or simple pages that don't have any real functionality. Also, should you only load the code when needed? If part way down a page you need a library, shoul...
When determining whether to load libraries and scripts conditionally or unconditionally, you should consider several factors, including user experience, performance, maintainability, and the specific requirements of your application. Here are some guidelines to help you make this decision: ### 1. **Frequency of Use:**...
46,320
[ { "from": "human", "value": "On a site where 90% of the pages use the same libraries, should you just load the libraries all the time or only load them when needed? The other pages would be ajax or simple pages that don't have any real functionality.\nAlso, should you only load the code when needed? If part...
I have some HTML that was inserted into a MySQL database from a CSV file, which in turn was exported from an access MDB file. The MDB file was exported as Unicode, and indeed is Unicode. I am however unsure as what encoding the MySQL database has. When I try to echo out html stored in a field however, there is no Unico...
To ensure proper handling of Unicode data in your MySQL database and when outputting it to HTML or JSON, you should follow these steps: ### 1. **Check MySQL Character Set:** Before inserting your data, check your MySQL database and tables' character set and collation. Use the following SQL queries: ```sql SHOW VARIAB...
47,345
[ { "from": "human", "value": "I have some HTML that was inserted into a MySQL database from a CSV file, which in turn was exported from an access MDB file. The MDB file was exported as Unicode, and indeed is Unicode. I am however unsure as what encoding the MySQL database has.\nWhen I try to echo out html st...
I'm looking to dynamically control a set of drop downs so that they'll filter their items after another drop down's index has been changed. I'm working in C#/ASP.net and it would be great if I could get the necessary data straight from Sql Server. I suppose I could generate an xml file whenever new data is uploaded to ...
Certainly! You can achieve dynamic filtering of dropdowns in an ASP.NET web application using Ajax and a combination of C# and SQL Server without needing to generate XML files. Below is a general approach to implementing this functionality. ### Overview of Steps 1. **Create a database with related data.** 2. **Create...
47,530
[ { "from": "human", "value": "I'm looking to dynamically control a set of drop downs so that they'll filter their items after another drop down's index has been changed.\nI'm working in C#/ASP.net and it would be great if I could get the necessary data straight from Sql Server. I suppose I could generate an ...
I've seen some methods of checking if a PEFile is a .NET assembly by examining the binary structure. Is that the fastest method to test multiple files? I assume that trying to load each file (e.g. via Assembly.ReflectionOnlyLoad) file might be pretty slow since it'll be loading file type information. Note: I'm looking ...
When checking if a Portable Executable (PE) file is a .NET assembly, there are a few methods you could consider. The fastest method, especially if you need to check multiple files, is to analyze the binary structure directly rather than loading the assemblies. ### 1. Checking the PE Header The simplest way to determi...
47,353
[ { "from": "human", "value": "I've seen some methods of checking if a PEFile is a .NET assembly by examining the binary structure.\nIs that the fastest method to test multiple files? I assume that trying to load each file (e.g. via Assembly.ReflectionOnlyLoad) file might be pretty slow since it'll be loading...
I'm writing a touch screen .net winforms application and need a combobox with a larger dropdown arrow. Is there any way to resize the arrow, or am I looking at writing a custom control?
In WinForms, the standard ComboBox control does not provide a built-in way to resize the dropdown arrow. If you want a larger dropdown arrow for a ComboBox, you will indeed need to create a custom control or subclass the existing ComboBox control to achieve this effect. Here’s a simple approach to create a custom Comb...
44,418
[ { "from": "human", "value": "I'm writing a touch screen .net winforms application and need a combobox with a larger dropdown arrow. Is there any way to resize the arrow, or am I looking at writing a custom control?\n" }, { "from": "gpt", "value": "In WinForms, the standard ComboBox control does...
Hey I was wondering if there were any way to upload images in ASP? I am working on my school's server and I don't really know what is installed and what isn't I Googled a little and came up with "Persits.Upload.1" I tried to instantiate the object with this line: Set Upload = Server.CreateObject("Persits.Upload.1") I...
It seems like the `Persits.Upload` component is not installed on your school's server, which is why you're encountering the error. This component is a third-party tool used for handling file uploads in classic ASP applications, and if it's not available, you'll need to use alternative methods. Here are a few options y...
44,740
[ { "from": "human", "value": "Hey I was wondering if there were any way to upload images in ASP? I am working on my school's server and I don't really know what is installed and what isn't I Googled a little and came up with \"Persits.Upload.1\" I tried to instantiate the object with this line:\nSet Upload...
I often get a PDF from our designer (built in Adobe InDesign) which is supposed to be sent out to thousands of people. I've got the list with all the people, and it's easy doing a mail merge in OpenOffice.org. However, OpenOffice.org doesn't support the advanced PDF. I just want to output some text onto each page and p...
Yes, you can achieve your goal using Python and some libraries to handle PDFs and mail merging. Below, I outline a basic approach using `PyPDF2` for handling PDF manipulation and `reportlab` for drawing the names and addresses onto the PDFs. This solution allows you to overlay text on existing PDF pages without the nee...
47,379
[ { "from": "human", "value": "I often get a PDF from our designer (built in Adobe InDesign) which is supposed to be sent out to thousands of people.\nI've got the list with all the people, and it's easy doing a mail merge in OpenOffice.org. However, OpenOffice.org doesn't support the advanced PDF. I just wan...
What advantages do either method offer for html, css and javascript files served by a LAMP server. Are there better alternatives? The server provides information to a map application using Json, so a high volume of small files. See also Is there any performance hit involved in choosing gzip over deflate for http compre...
When serving HTML, CSS, JavaScript files, and JSON data from a LAMP (Linux, Apache, MySQL, PHP) server, there are several considerations regarding file handling and compression methods. Here are the advantages of using Gzip and Deflate, as well as some alternatives that may offer better performance in certain contexts:...
49,325
[ { "from": "human", "value": "What advantages do either method offer for html, css and javascript files served by a LAMP server. Are there better alternatives?\nThe server provides information to a map application using Json, so a high volume of small files.\nSee also Is there any performance hit involved in...
I am trying to input data from a .txt file into a scheme structure. Each element is separated by a tab in the data file and each structure set is on a new line. I want to be able to read in the data from one line into a structure and make a list of each structure set in the file. Any suggestions?
To read data from a `.txt` file into a Scheme structure, you can follow a series of steps. First, ensure that you've defined the structure that corresponds to the data you're trying to read. Then, you'll use I/O procedures to read the data line by line, split each line by the tab character, and populate instances of yo...
49,800
[ { "from": "human", "value": "I am trying to input data from a .txt file into a scheme structure. Each element is separated by a tab in the data file and each structure set is on a new line. I want to be able to read in the data from one line into a structure and make a list of each structure set in the fi...
here's what I'm trying to do : On a page, I would have a LeftMenu that would be independent of the page, and a RightMenu that would depend on the page the user is currently on. I want to use MVC from asp.net. I could use RenderPartial to render the menus but on the other hand, the View shouldn't really handle this - so...
In an ASP.NET MVC application, handling menus in a clean and maintainable way can be approached effectively by utilizing the concept of a layout (or master page) along with ViewModels. Here's a suggested strategy: ### Strategy Overview 1. **Use a Layout View**: Define a layout view that includes your LeftMenu and Rig...
49,279
[ { "from": "human", "value": "here's what I'm trying to do :\nOn a page, I would have a LeftMenu that would be independent of the page, and a RightMenu that would depend on the page the user is currently on.\nI want to use MVC from asp.net. I could use RenderPartial to render the menus but on the other hand,...
i'm trying to create a ObjectDataSource which I can use to bind to a BindingSource which on his turn should be bound to a ComboBox. I've created a simple class and a simple list for this class (see below) The Times list class is not showing up at my toolbox, so I cannot drag it to the form so I can select it as the da...
It looks like you're trying to bind a list of your `Time` objects to a `ComboBox` using an `ObjectDataSource` and a `BindingSource`. Here are the steps to get it working: ### Step 1: Ensure Correct Namespace and Class Accessibility Make sure your `Time` class and `Times` class are declared as `Public` so that they ar...
43,846
[ { "from": "human", "value": "i'm trying to create a ObjectDataSource which I can use to bind to a BindingSource which on his turn should be bound to a ComboBox.\nI've created a simple class and a simple list for this class (see below)\n\nThe Times list class is not showing up at my toolbox, so I cannot drag...
We're building tools to mine information from the web. We have several pieces, such as Crawl data from the web Extract information based on templates & business rules Parse results into database Apply normalization & filtering rules Etc, etc. The problem is troubleshooting issues & having a good "high-level picture"...
Managing and troubleshooting complex systems with many interacting components can be challenging, but there are several techniques and tools that can help create a clearer high-level picture of your processes and facilitate effective management. Here are some strategies to consider: ### 1. **Workflow Visualization and...
49,887
[ { "from": "human", "value": "We're building tools to mine information from the web. We have several pieces, such as \n\nCrawl data from the web\nExtract information based on templates & business rules\nParse results into database\nApply normalization & filtering rules\nEtc, etc.\n\nThe problem is troublesho...
I want to implement in my MFC application project this logic, which written in C# looks like: XmlSerializer ser = new XmlSerializer(typeof(A_CLASS)); StringBuilder sb = new StringBuilder(); XmlWriterSettings sett = new XmlWriterSettings(); sett.Indent = true; sett.IndentChars = "\t"; using (XmlWriter sw = XmlWriter.Cre...
To implement the provided C# logic for XML serialization in your MFC C++ application, you'll need to use the `MSXML` library or `tinyxml2`, since C++ doesn't have built-in XML serialization like C#. Below, I'll provide a simple implementation using `MSXML`, which is commonly used for XML handling in Windows applicati...
48,781
[ { "from": "human", "value": "I want to implement in my MFC application project this logic, which written in C# looks like:\nXmlSerializer ser = new XmlSerializer(typeof(A_CLASS));\nStringBuilder sb = new StringBuilder();\nXmlWriterSettings sett = new XmlWriterSettings();\nsett.Indent = true;\nsett.IndentCha...
I've created a custom field type based on SPFieldLookup. When I use SharePoint's "Export to Spreadsheet" function, however, it's not rendered correctly. For normal lookup fields, only the Lookup Value is rendered. For my custom field, the string representation of the lookup value is used (i.e., "1;#My Lookup Value"). I...
When you create a custom field type based on `SPFieldLookup`, you may need to override certain methods to ensure that the field renders correctly during the "Export to Spreadsheet" process. The issue you're experiencing, where the custom field renders the full string representation (`"1;#My Lookup Value"`) instead of j...
49,827
[ { "from": "human", "value": "I've created a custom field type based on SPFieldLookup. When I use SharePoint's \"Export to Spreadsheet\" function, however, it's not rendered correctly.\nFor normal lookup fields, only the Lookup Value is rendered. For my custom field, the string representation of the lookup v...
I am wondering what is the best way to use workspaces in visual studio. We have 150+ webservices that are all part of the same team project $/MyTeamProject without being related at all. The reason for them all being part of the same team project as they are all maintained by the same group of people within our organiza...
In your situation, where you have a large number of web services that are part of a single Team Project in TFS, but are not related to each other, it's crucial to set up workspaces effectively to improve manageability and productivity. Here are some strategies you can consider: ### Option 1: Single Workspace for All S...
49,473
[ { "from": "human", "value": "I am wondering what is the best way to use workspaces in visual studio. We have 150+ webservices that are all part of the same team project $/MyTeamProject without being related at all. The reason for them all being part of the same team project as they are all maintained by the...
I'm implementing a JAX-WS webservice that will be consumed by external Java and PHP clients. The clients have to authenticate with a username and password stored in a database per client. What authentication mechanism is best to use to make sure that misc clients can use it?
When implementing authentication for a JAX-WS web service that will be consumed by both Java and PHP clients, you'll want to choose a mechanism that is both secure and easy for these clients to use. Here are some common approaches you might consider, along with their pros and cons: ### 1. **Basic Authentication** - **...
49,266
[ { "from": "human", "value": "I'm implementing a JAX-WS webservice that will be consumed by external Java and PHP clients.\nThe clients have to authenticate with a username and password stored in a database per client.\nWhat authentication mechanism is best to use to make sure that misc clients can use it?\n...
Can anyone point me in the right direction of some facial recognition libraries & algorithms ? I've tried searching/googling but i mostly find thesises and very little real software.
Sure! There are several popular libraries and algorithms for facial recognition that you can explore. Here are some of the most widely used ones: ### Libraries 1. **OpenCV** - Website: [opencv.org](https://opencv.org/) - Description: OpenCV is an open-source computer vision and machine learning software library...
49,808
[ { "from": "human", "value": "Can anyone point me in the right direction of some facial recognition libraries & algorithms ? I've tried searching/googling but i mostly find thesises and very little real software. \n" }, { "from": "gpt", "value": "Sure! There are several popular libraries and algo...
I am trying to create a countdown using javascript. I got some code from here and modified it slighly. <script type="text/javascript"> var c=10, t; function timedCount() { document.getElementById('txt').value=c; c=c-1; t=setInterval("timedCount()",1000); } function stopCount() { clearInterval(t); } </script> ...
It looks like you're on the right track, but there are a few adjustments that need to be made to achieve the desired functionality of a repeating countdown that resets when it reaches 0 or when the user clicks a link. Below is a modified version of your code that addresses these requirements: ```html <!DOCTYPE html> <...
46,513
[ { "from": "human", "value": "I am trying to create a countdown using javascript. I got some code from here and modified it slighly.\n<script type=\"text/javascript\">\nvar c=10, t;\n\nfunction timedCount() {\n document.getElementById('txt').value=c;\n c=c-1;\n t=setInterval(\"timedCount()\",1000);\n}\n\n...
I want to create the 26 neighbors of a cubic-voxel-node in 3-d space. The inputs are the x,y,z position of the node and the size of the cube side . I am trying to do this using a for loop but haven't managed yet. I am quite newbie in programming please help me.
To create the 26 neighbors of a cubic voxel node in 3D space, you can use a nested for loop to iterate through the possible offsets from the node's position. A cubic voxel node has 26 neighbors because it includes all the adjacent nodes in a 3x3x3 cube minus the center node itself. Here's a step-by-step explanation an...
42,025
[ { "from": "human", "value": "I want to create the 26 neighbors of a cubic-voxel-node in 3-d space. The inputs are the x,y,z position of the node and the size of the cube side . I am trying to do this using a for loop but haven't managed yet. I am quite newbie in programming please help me.\n" }, { "...
I'd like to store a simple key/value string dictionary in my web config file. Visual Studio makes it easy to store a string collection(see sample below) but I'm not sure how to do it with a dictionary collection. <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/...
In .NET applications, you can store a key/value dictionary in the web.config file using the `<appSettings>` section. However, the typical approach does not explicitly use a dictionary type, as it is not natively supported by the configuration system. Instead, you can represent a dictionary using a convention with a spe...
49,608
[ { "from": "human", "value": "I'd like to store a simple key/value string dictionary in my web config file. Visual Studio makes it easy to store a string collection(see sample below) but I'm not sure how to do it with a dictionary collection.\n <ArrayOfString xmlns:xsi=\"http://www.w3.org/2001/XMLSch...
My company uses a sales model of dealers, territory managers and regional managers, each with a different level of area scope (IE manage based on zips codes, states, or regions.) I want to create a slimmed down map that is similar to this US state map that would allow our users to manipulate who manages what. What are ...
Creating a slimmed-down map for visualizing the sales territories of dealers, territory managers, and regional managers can enhance understanding of your sales model and streamline management. Here are some resources and tools that can help you in designing such a map: ### Mapping Tools & Software 1. **Google Maps AP...
44,393
[ { "from": "human", "value": "My company uses a sales model of dealers, territory managers and regional managers, each with a different level of area scope (IE manage based on zips codes, states, or regions.)\nI want to create a slimmed down map that is similar to this US state map that would allow our users...
I would need to create a temp table for paging purposes. I would be selecting all records into a temp table and then do further processing with it. I am wondering which of the following is a better approach: 1) Select all the columns of my Primary Table into the Temp Table and then being able to select the rows I would...
When it comes to paging in SQL, both approaches you mentioned have their own pros and cons, and the best choice depends on your specific requirements, including performance, maintainability, and resource usage. ### Approach 1: Select All Columns into the Temp Table ```sql INSERT INTO #TempTable SELECT * FROM PrimaryTa...
48,330
[ { "from": "human", "value": "I would need to create a temp table for paging purposes. I would be selecting all records into a temp table and then do further processing with it.\nI am wondering which of the following is a better approach:\n1) Select all the columns of my Primary Table into the Temp Table and...
I would like to implement a post build event that performs the following actions A relative path copy of the DLL output (1 file, not all the debug jazz) A register the output DLL to GAC How is this done?
To implement a post-build event in a Visual Studio project that performs the specified actions—copying a DLL to a relative path and registering that DLL to the Global Assembly Cache (GAC)—you can follow these steps: ### Step 1: Identify Your Output DLL First, ensure you know the name of your output DLL and the relati...
49,869
[ { "from": "human", "value": "I would like to implement a post build event that performs the following actions\n\nA relative path copy of the DLL output (1 file, not all the debug jazz)\nA register the output DLL to GAC\n\nHow is this done?\n" }, { "from": "gpt", "value": "To implement a post-bui...
I hope my terminology is right. Edit if not. From my Linq2Sql classes I have a Color class. One of my controller's actions accepts an instance of this Color class. I want to create a link to this action so I use <%=Html.ActionLink<ColorController>(c=>c.Details(ViewData.Model.ActiveColor), "test")%> Where ViewData.Mod...
It sounds like you're encountering an issue with how your `Color` class is being serialized when generating a link with `Html.ActionLink`. The key thing to remember is that when you pass an object to `ActionLink`, it's attempting to use the properties of that object to generate query string parameters. The default beha...
45,439
[ { "from": "human", "value": "I hope my terminology is right. Edit if not.\nFrom my Linq2Sql classes I have a Color class.\nOne of my controller's actions accepts an instance of this Color class.\nI want to create a link to this action so I use \n<%=Html.ActionLink<ColorController>(c=>c.Details(ViewData.Mode...
I have a custom Jabber IM client and I'm having a problem with links. When something like http://something.com is entered I want it to show up as a link in the message window. The message window is a standard c# textbox. Is there a way to mark it as a link so that it can be clicked and open the webpage? Thanks
To make URLs clickable in a message window using a standard C# TextBox, you'll need to switch from using a regular `TextBox` to a control that supports rich text formatting or hyperlink functionality, such as a `RichTextBox` or a `WebBrowser` control. ### Using RichTextBox Here is how you can achieve this with a `Ric...
49,780
[ { "from": "human", "value": "I have a custom Jabber IM client and I'm having a problem with links. When something like http://something.com is entered I want it to show up as a link in the message window. The message window is a standard c# textbox. Is there a way to mark it as a link so that it can be c...
I'm trying to write an application that converts 48 bit-per-pixel PNG files to a proprietary (Bayer) format. The code (courtesy here) below works great for some PNG file formats, but when I try a bona fide 48 bit PNG the code throws an exception - is there an alternative? static public byte[] BitmapDataFromBitmap...
It looks like you're encountering an issue because the `Bitmap.Save` method does not support saving images with bit depths greater than 32 bits per pixel in BMP format. To convert a 48-bit PNG (which typically represents 16 bits per channel for RGB) to a proprietary Bayer format, you might need to handle the pixel data...
43,075
[ { "from": "human", "value": "I'm trying to write an application that converts 48 bit-per-pixel PNG files to a proprietary (Bayer) format. \nThe code (courtesy here) below works great for some PNG file formats, but when I try a bona fide 48 bit PNG the code throws an exception - is there an alternative?\n ...
I'm trying to write rules for detecting some errors in annotated multi-threaded java programs. As a toy example, I'd like to detect if any method annotated with @ThreadSafe calls a method without such an annotation, without synchronization. I'm looking for a tool that would allow me to write such a test. I've looked...
To create custom rules for detecting issues in annotated multi-threaded Java programs, you'll want a tool that can handle cross-class analysis and is easily extensible. Here are a few options you can consider: ### 1. **SonarQube / SonarLint** SonarQube and SonarLint allow you to create custom rules for code quality an...
48,641
[ { "from": "human", "value": "I'm trying to write rules for detecting some errors in annotated multi-threaded java programs. As a toy example, I'd like to detect if any method annotated with @ThreadSafe calls a method without such an annotation, without synchronization. I'm looking for a tool that would al...
I'm a complete n00b in j3d (but an expert in Java). Just starting out, I'm running into a problem playing with transparency. I've got a simple example which draws a rotating planar quad (disappears when showing the back face because I haven't disabled backface culling). With the Color3b and COLOR_3 lines uncommented (a...
The issue you're encountering with transparency in Java 3D is a common one that revolves around how rendering works with transparency settings, especially when you're dealing with `Color4b` and alpha values. In your code, you're trying to set up a quad with full transparency. However, it's important to remember that e...
45,775
[ { "from": "human", "value": "I'm a complete n00b in j3d (but an expert in Java). Just starting out, I'm running into a problem playing with transparency. I've got a simple example which draws a rotating planar quad (disappears when showing the back face because I haven't disabled backface culling).\nWith th...
I have a Windows form application written in C#. I update the title of the form frequently, but there's a substantial lag between the title changing and the title dislayed in the taskbar being updated. What's a clean way to force an update / redraw of the task bar's entry for my program? Failing that, how can I for...
The issue you're experiencing with the Windows taskbar not updating the title of your form in a timely manner is somewhat common, especially when updates are happening in quick succession. The operating system sometimes optimizes rendering updates to improve performance, which can introduce noticeable delays. To addre...
47,017
[ { "from": "human", "value": "I have a Windows form application written in C#. I update the title of the form frequently, but there's a substantial lag between the title changing and the title dislayed in the taskbar being updated. \nWhat's a clean way to force an update / redraw of the task bar's entry fo...
I've used MAPI to create emails with attachments from my application and it works very well on XP and Vista (without UAC). Of course, if you have UAC enabled, it just doesn't work (though it gives no errors, and doesn't prompt the user for permission to continue). I've done a bunch of reading and have found a lot of d...
Given your requirements and the context of your application, here are a few approaches to consider for handling UAC and elevation in a way that minimizes user inconvenience while allowing you to create and send emails with attachments using MAPI. ### 1. **Separate Process for Elevated Tasks** One of the cleaner appro...
49,972
[ { "from": "human", "value": "I've used MAPI to create emails with attachments from my application and it works very well on XP and Vista (without UAC). Of course, if you have UAC enabled, it just doesn't work (though it gives no errors, and doesn't prompt the user for permission to continue).\nI've done a ...
I'm using Drupal 5 and have a multitude of views that I want to alter the output of. Using the views wizard, I can create a different template for each instance, but I'm wanting to do the same changes across all my views and having 30 files in the themes directory seams like a hell of a lot of maintenance and code. D...
To apply consistent changes across multiple Views in Drupal 5 without having to maintain numerous template files, you can leverage a combination of a global template and the theme functions provided by Views. Here’s a streamlined approach that will allow you to manage a default template for your Views while still allo...
49,777
[ { "from": "human", "value": "I'm using Drupal 5 and have a multitude of views that I want to alter the output of. Using the views wizard, I can create a different template for each instance, but I'm wanting to do the same changes across all my views and having 30 files in the themes directory seams like a ...
I've recently bumped into facelift, an alternative to sIFR and I was wondering if those who have experience with both sIFR and FLIR could shed some light on their experience with FLIR. For those of you who've not yet read about how FLIR does it, FLIR works by taking the text from targeted elements using JavaScript to t...
Your observations about FLIR are quite comprehensive, and you've covered many of the pros and cons well. I'll address your specific concerns about scalability on shared hosting and search engine optimization (SEO) for both sIFR and FLIR. ### Scalability on Shared Hosting 1. **Performance of the GD Library**: - Th...
48,692
[ { "from": "human", "value": "I've recently bumped into facelift, an alternative to sIFR and I was wondering if those who have experience with both sIFR and FLIR could shed some light on their experience with FLIR.\nFor those of you who've not yet read about how FLIR does it, FLIR works by taking the text fr...
I would like to restrict access to my /admin URL to internal IP addresses only. Anyone on the open Internet should not be able to login to my web site. Since I'm using Lighttpd my first thought was to use mod_rewrite to redirect any outside request for the /admin URL back to my home page, but I don't know much about ...
To restrict access to your `/admin` URL based on IP addresses in Lighttpd, you can use the `url.rewrite-once` directive in combination with `url.access` to achieve the desired effect. Here's how to configure your Lighttpd server to restrict access to the `/admin` endpoint to internal IP addresses only. 1. **Check for ...
45,061
[ { "from": "human", "value": "I would like to restrict access to my /admin URL to internal IP addresses only. Anyone on the open Internet should not be able to login to my web site. Since I'm using Lighttpd my first thought was to use mod_rewrite to redirect any outside request for the /admin URL back to m...
Is it worth changing my code to be "more portable" and able to deal with the horror of magic quotes, or should I just make sure that it's always off via a .htaccess file? if (get_magic_quotes_gpc()) { $var = stripslashes($_POST['var']); } else { $var = $_POST['var']; } Versus php_flag magic_quotes_gpc off
In your scenario, it's generally better to ensure that `magic_quotes_gpc` is disabled through the server configuration (using `.htaccess`, for example) rather than modifying your code to handle the situation. Here's why: 1. **Deprecated Feature**: The `magic_quotes_gpc` feature has been deprecated since PHP 5.3.0 and ...
49,181
[ { "from": "human", "value": "Is it worth changing my code to be \"more portable\" and able to deal with the horror of magic quotes, or should I just make sure that it's always off via a .htaccess file?\nif (get_magic_quotes_gpc()) {\n $var = stripslashes($_POST['var']);\n} else {\n $var = $_POST['var'...
The Zend Framework based site I have been working on is now being migrated to its production server. This server turns out to be nginx (surprise!). Naturally the site does not work correctly as it was developed on Apache and relies on an htaccess file. My question is... anyone have any experience with this? Any ideas ...
Migrating a website from Apache to Nginx involves translating the directives in your `.htaccess` file into the Nginx configuration format. The `.htaccess` file you've provided has a few key directives that need to be converted to Nginx. Here’s how you can translate your current `.htaccess` rules to an Nginx configurati...
47,960
[ { "from": "human", "value": "The Zend Framework based site I have been working on is now being migrated to its production server. This server turns out to be nginx (surprise!). Naturally the site does not work correctly as it was developed on Apache and relies on an htaccess file. \nMy question is... anyone...
I am trying to implement a ListView data control for displaying and editing lookup table/ application level variables. There are multiple entity classes which can be bound to the ListView, so the ItemTemplate needs to be dynamically bound to the selected entity object. For example i have: AddressType { AddressTypeId, ...
To dynamically bind different entity classes with varying property names in a ListView, you can handle the `ItemDataBound` event of the ListView. This way, you can customize how each item is rendered based on the actual type of the data being bound. Here’s a step-by-step implementation: ### Step 1: Define your ListVi...
49,338
[ { "from": "human", "value": "I am trying to implement a ListView data control for displaying and editing lookup table/ application level variables. There are multiple entity classes which can be bound to the ListView, so the ItemTemplate needs to be dynamically bound to the selected entity object.\nFor exam...
I'm working on a new Wordpress site that is exhibiting some strange behaviour. I pass it a URL with GET parameters in it, and the $_GET parameter is not populated. I see in the $_SERVER parameter that the REQUEST_URI has the full URL there, completed with the ?var=value part, but no love in the $_GET variable. The URL...
The issue you're experiencing with the `$_GET` parameters not being populated in your WordPress site could be caused by a few factors, especially considering you mentioned that the URL is being redirected with `mod_rewrite`. Here are some possible reasons and troubleshooting steps: ### 1. Rewrite Rules Ensure that you...
41,963
[ { "from": "human", "value": "I'm working on a new Wordpress site that is exhibiting some strange behaviour. I pass it a URL with GET parameters in it, and the $_GET parameter is not populated. I see in the $_SERVER parameter that the REQUEST_URI has the full URL there, completed with the ?var=value part, b...
I see the following code in the attribute_fu plugin: module AttributeFu module Associations #:nodoc: def self.included(base) #:nodoc: ...
The issue you're encountering stems from the use of `alias_method_chain`, which is a method provided by ActiveSupport for aliasing methods in a way that allows you to extend their functionality. However, the argument you pass to `alias_method_chain` must be the name of an existing method, and it cannot be a method that...
47,088
[ { "from": "human", "value": "I see the following code in the attribute_fu plugin:\nmodule AttributeFu\n module Associations #:nodoc: \n def self.included(b...
I have a div 200 x 200 px. I want to place a 50 x 50 px image right in the middle of the div. How can it be done? I am able to get it centered horizontally by using text-align: center for the div. But vertical alignment is the issue..
To center a 50 x 50 px image in a 200 x 200 px div both horizontally and vertically, you can use different CSS techniques. Here are a few common approaches: ### 1. Flexbox Using Flexbox is one of the easiest ways to center an element both horizontally and vertically. Here's how you can do it: ```html <div class="con...
48,989
[ { "from": "human", "value": "I have a div 200 x 200 px. I want to place a 50 x 50 px image right in the middle of the div. \nHow can it be done?\nI am able to get it centered horizontally by using text-align: center for the div. But vertical alignment is the issue..\n" }, { "from": "gpt", "value...
There are some rumors floating around that the team at my company will soon be using web services for all future application development. The architecture is supposed to be something like this: Application --> Web Service --> Database The stated reasoning behind it is security. This sounds like a huge waste of time f...
Your concerns about the architectural shift to using web services for data access are valid, especially regarding potential complexities and the balance of security versus practicality. Let’s explore how web services can enhance security, as well as some of the challenges and limitations that you might face with this a...
46,187
[ { "from": "human", "value": "There are some rumors floating around that the team at my company will soon be using web services for all future application development. The architecture is supposed to be something like this:\nApplication --> Web Service --> Database\nThe stated reasoning behind it is securit...
How do I bind the value of radio button, generated with the Html.RadioButton() HTML helper, to a field that has a struct as type? Less abstract: CommonProject.Services.SearchBag.Effects: public enum Effects { Any, Solid, Effect } In the strongly typed ViewData: public class SearchBag{ public Effect...
When working with radio buttons in ASP.NET MVC, especially when binding to an enum, it's important to ensure that the values and the selected state are handled correctly. Your approach to generating the radio buttons using `Html.RadioButton()` is mostly correct, but there are a few nuances to keep in mind regarding how...
47,606
[ { "from": "human", "value": "How do I bind the value of radio button, generated with the Html.RadioButton() HTML helper, to a field that has a struct as type?\nLess abstract:\nCommonProject.Services.SearchBag.Effects:\npublic enum Effects\n{\n Any,\n Solid,\n Effect\n}\n\nIn the strongly typed View...
Both Session.Clear() and Session.Abandon() get rid of session variables. As I understand it, Abandon() ends the current session, and causes a new session to be created thus causing the End and Start events to fire. It seems preferable to call Abandon() in most cases, such as logging a user out. Are there scenarios wh...
You are correct that both `Session.Clear()` and `Session.Abandon()` are methods used in ASP.NET to manipulate session state, but they serve different purposes and have different implications. ### Differences Between `Session.Clear()` and `Session.Abandon()` 1. **Session.Clear()**: - This method removes all items f...
43,985
[ { "from": "human", "value": "Both Session.Clear() and Session.Abandon() get rid of session variables. As I understand it, Abandon() ends the current session, and causes a new session to be created thus causing the End and Start events to fire.\nIt seems preferable to call Abandon() in most cases, such as l...
I need to delete a temporary file from my C++ windows application (developed in Borland C++ Builder). Currently I use a simple: system("del tempfile.tmp"); This causes a console window to flash in front of my app and it doesn't look very professional. How do I do this without the console window?
To delete a file in your C++ Builder application without flashing a console window, you can use the Windows API function `DeleteFile`. This function allows you to delete a file directly without invoking a console command. Here’s a simple example of how you can do this: ```cpp #include <windows.h> // Function to delet...
48,765
[ { "from": "human", "value": "I need to delete a temporary file from my C++ windows application (developed in Borland C++ Builder). Currently I use a simple:\nsystem(\"del tempfile.tmp\");\n\nThis causes a console window to flash in front of my app and it doesn't look very professional. How do I do this with...
I'm recoding an old site that contains a chart similar to this: alt text http://dl.getdropbox.com/u/240752/rental-chart.gif How would this chart be represented with pure HTML? I'm loathed to just include it as an image. I'm thinking a table, just replaced with an image, or perhaps overlaid with absolutely positioned ta...
To represent a chart like the one in your provided image using pure HTML, a table is indeed a practical solution. You can use a combination of a table for structure and CSS for styling to make it visually appealing while maintaining accessibility. Here's an example of how you can create a chart using a table: ```html...
49,557
[ { "from": "human", "value": "I'm recoding an old site that contains a chart similar to this:\nalt text http://dl.getdropbox.com/u/240752/rental-chart.gif\nHow would this chart be represented with pure HTML? I'm loathed to just include it as an image.\nI'm thinking a table, just replaced with an image, or pe...
I wanted to add dynamic charts in the webpage. It goes like this... I get the start and end date from user and draw separate charts for each date bewteen the start and end date. I get the data from sql database and bind it with the chart like this: SqlConnection UsageLogConn = new SqlConnection(Configur...
To create dynamic charts in your ASP.NET webpage that can be generated at runtime based on the user's input for the start and end dates, you can follow these general steps: ### 1. Create a Method to Generate Charts Dynamically You'll want to create a method that accepts the start and end dates, fetches the necessary ...
49,107
[ { "from": "human", "value": "I wanted to add dynamic charts in the webpage. It goes like this...\nI get the start and end date from user and draw separate charts for each date bewteen the start and end date.\nI get the data from sql database and bind it with the chart like this:\n SqlConnection UsageLogCo...
We have a large collection of command-line utilities that we write ourselves and use frequently. At the moment, testing them is very cumbersome and consequently, we don't do as much testing as we aught to. I am wondering if anyone can suggest good techniques or tools for doing a good job of this kind of thing. This is ...
Testing command-line utilities can indeed be challenging, but there are several techniques and tools you can use to make the process easier and more effective. Here are some suggestions tailored for UNIX environments: ### Techniques 1. **Unit Testing**: Break down your utilities into smaller components and write unit...
49,680
[ { "from": "human", "value": "We have a large collection of command-line utilities that we write ourselves and use frequently. At the moment, testing them is very cumbersome and consequently, we don't do as much testing as we aught to.\nI am wondering if anyone can suggest good techniques or tools for doing ...
I have been building enterprise software for the last 10 years. In this time we have seen enterprise applications move from client server to thin clients. We have also seen the move to hosted solutions, albeit under a few names (asp, SaaS, cloud computing). With all these changes the impetuous has been mainly from d...
The evolution of enterprise software and the landscape of web programming has indeed seen significant transformations over the years. Let's delve into the points you've raised, especially focusing on Flex, Silverlight, and the broader implications for web programming and user experience. ### What Did Flex Do Different...
48,991
[ { "from": "human", "value": "I have been building enterprise software for the last 10 years. In this time we have seen enterprise applications move from client server to thin clients. We have also seen the move to hosted solutions, albeit under a few names (asp, SaaS, cloud computing). With all these cha...
I've got two tables that need to be joined via LINQ, but they live in different databases. Right now I'm returning the results of one table, then looping through and retrieving the results of the other, which as you can guess isn't terribly efficient. Is there any way to get them into a single LINQ statement? Is there ...
Joining two tables from different databases using LINQ in a single statement can be challenging, especially if you can't modify the databases or create views that combine them. However, here are a few approaches you can consider to improve efficiency and avoid looping: ### 1. Using a Third Database with Views As you'v...
48,128
[ { "from": "human", "value": "I've got two tables that need to be joined via LINQ, but they live in different databases. Right now I'm returning the results of one table, then looping through and retrieving the results of the other, which as you can guess isn't terribly efficient. Is there any way to get the...
I'm setting up an Internet-facing ASP.NET MVC application, on Windows 2008. It uses SQL Server 2008 for its database. I'm looking for best-practices for securing it. I found this article, but it's a bit dated now. How much of that advice is still valuable? Some background -- it's a personal site, behind my home NAT/fir...
Securing an Internet-facing ASP.NET MVC application, especially on an older platform like Windows Server 2008 and SQL Server 2008, requires careful consideration of multiple layers of security. Here are some best practices you should consider, which are still relevant today: ### 1. **Server Hardening** - **Remove U...
45,166
[ { "from": "human", "value": "I'm setting up an Internet-facing ASP.NET MVC application, on Windows 2008. It uses SQL Server 2008 for its database. I'm looking for best-practices for securing it.\nI found this article, but it's a bit dated now. How much of that advice is still valuable?\nSome background -- i...
All, so, I inventedmade up a simple protocol that I want to use for a client to talk to a server. It's the typical (I think) three-phase layout: Connection Establishment (will eventually include capability negotiation) Actual Data Exchange - packets are happily travelling to and fro', get interpreted by the respectiv...
Designing a state machine for a protocol that involves asynchronous communication can be challenging, particularly when you need to handle multiple inputs simultaneously (like reading, writing, and checking the connection status). Here are some steps and strategies to help you bridge the gap between theory and implemen...
49,552
[ { "from": "human", "value": "All,\nso, I inventedmade up a simple protocol that I want to use for a client to talk to a server. It's the typical (I think) three-phase layout:\n\nConnection Establishment (will eventually include capability negotiation)\nActual Data Exchange - packets are happily travelling ...
I was coding with 2 CStringList objects. Each has its own data, for eg one has name and other the phoneno, and both are in sync, i.e, if there is a phoneno there is a name and viceversa. Now, i have 2 combobox in which i show the names and the respective phonenos. The name combobox is sorted, hence the sync between th...
In your code, you are experiencing issues with accessing the correct phone numbers because of how you are using the `Find` function. Let's address your two questions: ### 1. Understanding the Behavior of `Find` The `Find` method on `CStringList` returns a position (`POSITION`) object that allows you to iterate throug...
48,186
[ { "from": "human", "value": "I was coding with 2 CStringList objects. Each has its own data, for eg one has name and other the phoneno, and both are in sync, i.e, if there is a phoneno there is a name and viceversa.\nNow, i have 2 combobox in which i show the names and the respective phonenos. The name com...
I'm trying to implement a dynamic OPTION list in JavaScript. Depending on other selections in the web form, some of the OPTIONS in a specific SELECT are not valid. Things I've tried that don't work in IE are: populate all options, then set the disabled property for those that are invalid populate all options and us...
Working with dynamic dropdowns in older versions of Internet Explorer (such as IE6) can indeed be challenging. Here are some strategies you can use to create a dynamic options list while maintaining compatibility with IE6 and up: ### 1. Disable Specific Options Unfortunately, disabling options may not always render c...
48,221
[ { "from": "human", "value": "I'm trying to implement a dynamic OPTION list in JavaScript. Depending on other selections in the web form, some of the OPTIONS in a specific SELECT are not valid. Things I've tried that don't work in IE are: \n\npopulate all options, then set the disabled property for those t...
I came up with a solution, but I wanted to see if anyone had a better way or more standard way of doing this. The main method demonstrates how I would use this class. In a production version of this I would keep the thread pool open and continue to reuse it rather than shut it down after the calls. public class MultiCa...
Your implementation of the `MultiCallManager` class is quite good and demonstrates how to handle multiple concurrent tasks using `ExecutorService` and `Callable` in Java. However, there are a few improvements and standard practices that you could consider to enhance the readability, efficiency, and robustness of the co...
49,122
[ { "from": "human", "value": "I came up with a solution, but I wanted to see if anyone had a better way or more standard way of doing this.\nThe main method demonstrates how I would use this class.\nIn a production version of this I would keep the thread pool open and continue to reuse it rather than shut it...
I'm creating a site that allows users to submit quotes. How would I go about creating a (relatively simple?) search that returns the most relevant quotes? For example, if the search term was "turkey" then I'd return quotes where the word "turkey" appears twice before quotes where it only appears once. (I would add a f...
Creating a simple search mechanism that returns the most relevant quotes based on the frequency of search terms is a great starting point. Here's a step-by-step guide on how to implement such a feature: ### 1. Data Structure Ensure your quotes are stored in a data structure that allows for easy searching. If you're us...
49,772
[ { "from": "human", "value": "I'm creating a site that allows users to submit quotes. How would I go about creating a (relatively simple?) search that returns the most relevant quotes?\nFor example, if the search term was \"turkey\" then I'd return quotes where the word \"turkey\" appears twice before quote...
I have the following two files and would like the second to extend the first: wwwroot\site\application.cfc wwwroot\site\dir\application.cfc However, when I go to declare the component for the second file, I'm not sure what to put in the extends attribute. My problem is that several dev sites (with a shared SVN repos...
In ColdFusion, extending a component in a dynamic way can be tricky due to the way that ColdFusion manages component paths and application scopes. However, there are a few strategies you can use to deal with your situation of having multiple sites running off the same instance of ColdFusion while still extending the ba...
47,788
[ { "from": "human", "value": "I have the following two files and would like the second to extend the first:\n\nwwwroot\\site\\application.cfc\nwwwroot\\site\\dir\\application.cfc\n\nHowever, when I go to declare the component for the second file, I'm not sure what to put in the extends attribute. My problem...
Given an instance x of Callable<T>, how can I run x in a separate process such that I can redirect the standard input and output of the process? For example, is there a way to build a Process from a Callable? Is there a standard Executor that gives control over input and output? [UPDATE] It's not important that the Cal...
To execute a `Callable<T>` instance in a separate process and redirect its standard input and output, you cannot directly use an `Executor` or `ExecutorService` from the Java Concurrency framework. Instead, you can achieve this by utilizing `ProcessBuilder` to create a separate process that can run a Java application t...
47,479
[ { "from": "human", "value": "Given an instance x of Callable<T>, how can I run x in a separate process such that I can redirect the standard input and output of the process? For example, is there a way to build a Process from a Callable? Is there a standard Executor that gives control over input and output?...