instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
Note: This question was asked at a time when C# did not yet support optional parameters (i.e. before C# 4). We're building a web API that's programmatically generated from a C# class. The class has method GetFooBar(int a, int b) and the API has a method GetFooBar taking query params like &a=foo &b=bar. The classes nee...
Before C# 4 introduced optional parameters, there are several approaches you could take to handle optional parameters in a web API scenario. Here are some recommended strategies: ### 1. Method Overloading You can define multiple overloads of the `GetFooBar` method. Each overload can accept a different combination of ...
21,395
[ { "from": "human", "value": "Note: This question was asked at a time when C# did not yet support optional parameters (i.e. before C# 4).\nWe're building a web API that's programmatically generated from a C# class. The class has method GetFooBar(int a, int b) and the API has a method GetFooBar taking query p...
It should be trivial, and it might even be in the help, but I can't figure out how to navigate it. How do I indent multiple lines quickly in vi?
In `vi` (or `vim`), you can indent multiple lines quickly using visual mode or a command. Here are two methods: ### Method 1: Using Visual Mode 1. Move the cursor to the first line you want to indent. 2. Press `V` (uppercase) to enter visual line mode. This will highlight the entire line. 3. Use the arrow keys (or `j`...
24,068
[ { "from": "human", "value": "It should be trivial, and it might even be in the help, but I can't figure out how to navigate it. How do I indent multiple lines quickly in vi?\n" }, { "from": "gpt", "value": "In `vi` (or `vim`), you can indent multiple lines quickly using visual mode or a command....
I have a ASP.Net page using ADO to query MS access database and as a learning exercise i would like to incorporate LINQ. I have one simple table called Quotes. The fields are: QuoteID, QuoteDescription, QuoteAuthor, QuoteDate. I would like to run simple queries like, "Give me all quotes after 1995". How would i inc...
LINQ (Language Integrated Query) is a powerful feature in .NET that allows you to query various data sources using a consistent syntax. However, LINQ directly does not work with MS Access databases. Instead, you would typically use an ORM (Object-Relational Mapping) like Entity Framework or LINQ to SQL, which provides ...
18,340
[ { "from": "human", "value": "I have a ASP.Net page using ADO to query MS access database and as a learning exercise i would like to incorporate LINQ. I have one simple table called Quotes.\nThe fields are: QuoteID, QuoteDescription, QuoteAuthor, QuoteDate. I would like to run simple queries like, \"Give m...
What version control systems have you used with MS Excel (2003/2007)? What would you recommend and Why? What limitations have you found with your top rated version control system? To put this in perspective, here are a couple of use cases: version control for VBA modules more than one person is working on a Excel spr...
When it comes to version control systems for Microsoft Excel (particularly versions 2003 and 2007), the options are somewhat limited compared to more traditional coding environments. However, there are a few approaches and tools that can help manage versions effectively, especially given your use cases. Below are some ...
16,528
[ { "from": "human", "value": "What version control systems have you used with MS Excel (2003/2007)? What would you recommend and Why? What limitations have you found with your top rated version control system?\nTo put this in perspective, here are a couple of use cases:\n\nversion control for VBA modules \nm...
The following SQL SELECT * FROM customers converted to this in LINQ var customers = from c in customers select c; Is their any good reasones why the from and select is swaped? The only logical reason I can think of is for intellisens? For the intellesens to get resolved, it needs to know what it is ...
The reason for the apparent difference in syntax between SQL and LINQ, specifically in the `from` and `select` keywords, is primarily related to the design of the two query languages and their respective paradigms. ### Key Differences and Considerations: 1. **Declarative vs. Comprehension Syntax**: - SQL is a decl...
20,093
[ { "from": "human", "value": "The following SQL\nSELECT * FROM customers\n\nconverted to this in LINQ\nvar customers = from c in customers \n select c;\n\nIs their any good reasones why the from and select is swaped? \nThe only logical reason I can think of is for intellisens? For the intelles...
I am writing some code and trying to speed it up using SIMD intrinsics SSE2/3. My code is of such nature that I need to load some data into an XMM register and act on it many times. When I'm looking at the assembler code generated, it seems that GCC keeps flushing the data back to the memory, in order to reload someth...
When dealing with SIMD intrinsics and optimizing code using registers, it's important to understand how compilers like GCC manage registers and optimizations. Here are some insights into your questions: ### Why is GCC using only two XMM registers? 1. **Register Pressure**: Even though x86-64 architecture has more reg...
18,463
[ { "from": "human", "value": "I am writing some code and trying to speed it up using SIMD intrinsics SSE2/3. My code is of such nature that I need to load some data into an XMM register and act on it many times. When I'm looking at the assembler code generated, it seems that GCC keeps flushing the data back...
I wanted to generate one fix view using interface builder, but the size of that view is exceeding the size of iphone screen,and I am not able to maximize screen. I wanted to show table view in that screen. I did enabled scrolling but that didn't work, Update 1: Actually I wanted to show thumbnail image inside cell and ...
To create a fixed view containing a table view that displays five static thumbnail images within cells, you can achieve this using either Interface Builder (Storyboard) or programmatically with Swift. Both methods are valid, but using Interface Builder might be easier for a straightforward layout, especially if you're ...
17,483
[ { "from": "human", "value": "I wanted to generate one fix view using interface builder, but the size of that view is exceeding the size of iphone screen,and I am not able to maximize screen. I wanted to show table view in that screen.\nI did enabled scrolling but that didn't work,\nUpdate 1:\nActually I wan...
I am looking for the cleanest way. I am tempted to use delegates not sure though.
When you mention wanting a "clean" way to achieve something and considering using delegates, it sounds like you're dealing with a programming task, possibly in a language that supports delegates, such as C#, or you're thinking about implementing a callback mechanism. To give you the best advice, it would help to know ...
23,339
[ { "from": "human", "value": "I am looking for the cleanest way. I am tempted to use delegates not sure though.\n" }, { "from": "gpt", "value": "When you mention wanting a \"clean\" way to achieve something and considering using delegates, it sounds like you're dealing with a programming task, po...
How to add offline access functionality to MoinMoin wiki? As a minimum, I would love to have browsing access to all pages on a server-based wiki (while being offline). Search and other things, which do not modify the content, are secondary. An added bonus would be if this solution allowed to update wiki content while ...
Adding offline access functionality to a MoinMoin wiki can indeed be a challenge, but it is possible with the right approach. Since MoinMoin stores its content in regular files, you have a good starting point. Below are steps and ideas that can help you achieve this functionality: ### Basic Offline Browsing 1. **Down...
22,793
[ { "from": "human", "value": "How to add offline access functionality to MoinMoin wiki?\nAs a minimum, I would love to have browsing access to all pages on a server-based wiki (while being offline). Search and other things, which do not modify the content, are secondary. An added bonus would be if this solu...
Even a simple Notepad application in C# consumes megabytes of RAM as seen in the task manager. On minimizing the application the memory size in the task manager goes down considerably and is back up when the application is maximized. I read somewhere that the .NET process reserves a lot of memory for runtime allocation...
Yes, you are correct in your understanding of how memory management works in .NET applications, especially in the context of a simple application like Notepad. ### Memory Consumption in .NET Applications 1. **Memory Footprint**: When you start a .NET application, the runtime (CLR - Common Language Runtime) allocates a...
22,474
[ { "from": "human", "value": "Even a simple Notepad application in C# consumes megabytes of RAM as seen in the task manager. On minimizing the application the memory size in the task manager goes down considerably and is back up when the application is maximized.\nI read somewhere that the .NET process reser...
I want to put users into an instance of ADAM so that ADAM looks similar to a typical, real, Active Directory server. I'm developing an application that integrates with LDAP. I've tested with OpenLDAP and its core.schema. Now I'd like to test with with Active Directory, but the closest I can get to that using my equ...
To set up Microsoft Active Directory Application Mode (ADAM) (now known as Active Directory Lightweight Directory Services or AD LDS) to resemble a typical Active Directory environment, you will need to follow a series of steps. Below is a detailed guide to help you get started with your setup, schema import, and popul...
14,639
[ { "from": "human", "value": "I want to put users into an instance of ADAM so that ADAM looks similar to a typical, real, Active Directory server.\nI'm developing an application that integrates with LDAP. I've tested with OpenLDAP and its core.schema. Now I'd like to test with with Active Directory, but ...
How can I make my window not have a title bar but appear in the task bar with some descriptive text? If you set the Form's .Text property then .net gives it a title bar, which I don't want. this.ControlBox = false; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Max...
If you want to create a Windows Form that does not have a title bar, but still appears in the taskbar with a specific text, you can achieve this by creating a borderless form and overriding the `CreateParams` property to remove the title bar. However, you'll also need to handle the form's client area size to account fo...
20,099
[ { "from": "human", "value": "How can I make my window not have a title bar but appear in the task bar with some descriptive text?\nIf you set the Form's .Text property then .net gives it a title bar, which I don't want.\n this.ControlBox = false;\n this.FormBorderStyle = System.Windows.Forms.F...
Let's say I have the following ruby code : def use_object(object) puts object.some_method end and , this will work on any object that responds to some_method,right? Assuming that the following java interface exists : interface TestInterface { public String some_method(); } Am I right to presume that interfaces...
Yes, you are correct! In Ruby, the `use_object` method can take any object that responds to `some_method`, thanks to Ruby's dynamic typing and duck typing philosophy. This means that as long as an object implements a method with the specified name, it can be passed to the method without needing to explicitly declare th...
24,239
[ { "from": "human", "value": "Let's say I have the following ruby code :\n\ndef use_object(object)\n puts object.some_method\nend\n\nand , this will work on any object that responds to some_method,right?\nAssuming that the following java interface exists :\n\ninterface TestInterface {\n public String some...
I am building an MS Access application in which all the forms are modal. However, after data change in a form, I want to refresh the parent form of this form with newer data. Is there any way to do it. To elaborate further : Consider there are two forms, Form A and Form B. Both are modal form. From Form A, I initiate F...
Yes, you can refresh the parent form (Form A) after closing the modal form (Form B) in your MS Access application. There are several ways to achieve this, but a common method involves using the `Form_Open` or `Form_Close` event of Form B to refresh Form A when Form B is closed. Here's a step-by-step guide to accomplis...
20,232
[ { "from": "human", "value": "I am building an MS Access application in which all the forms are modal. However, after data change in a form, I want to refresh the parent form of this form with newer data. Is there any way to do it. To elaborate further :\nConsider there are two forms, Form A and Form B. Both...
I would like to know how to loop through each line in a text file using a Windows batch file and process each line of text in succession.
You can loop through each line of a text file in a Windows batch file using the `for /f` command. Here’s a simple example to demonstrate how to read a text file line by line and process each line. ### Example Batch File Create a batch file named `process_lines.bat` with the following content: ```batch @echo off set...
22,068
[ { "from": "human", "value": "I would like to know how to loop through each line in a text file using a Windows batch file and process each line of text in succession.\n" }, { "from": "gpt", "value": "You can loop through each line of a text file in a Windows batch file using the `for /f` command...
One of the major advantages with Javascript is said to be that it is a prototype based language. But what does it mean that Javascript is prototype based, and why is that an advantage?
JavaScript being a prototype-based language means that it uses prototypes to enable inheritance and behavior sharing between objects. Unlike classical inheritance, which relies on classes and inheritance hierarchies (as seen in languages like Java or C#), JavaScript uses an object-oriented approach that is more flexibl...
20,228
[ { "from": "human", "value": "One of the major advantages with Javascript is said to be that it is a prototype based language. \nBut what does it mean that Javascript is prototype based, and why is that an advantage?\n" }, { "from": "gpt", "value": "JavaScript being a prototype-based language mea...
Which Oracle database role will allow a user to select from a table in another schema without specifying the schema identifier? i.e., as user A- Grant select on A.table to user B; B can then- "Select * from table" without specifying the 'A'. One of our databases allows this, the other returns a 'table or view does n...
In Oracle databases, if you want a user (e.g., User B) to select from a table in another schema (e.g., User A) without having to specify the schema name, you have to ensure the following: 1. **Permissions**: User A must grant the SELECT privilege on the table to User B. ```sql GRANT SELECT ON A.table TO B; ...
22,265
[ { "from": "human", "value": "Which Oracle database role will allow a user to select from a table in another schema without specifying the schema identifier? \ni.e., as user A- Grant select on A.table to user B;\nB can then- \"Select * from table\" without specifying the 'A'. \nOne of our databases allows t...
What type of stream I need to use to write a connect request message over a tcp socket, to jabber. I'mwriting a string with xml format. It should worked with the default socket stream or a dataoutputstream but it doesn't.
When working with TCP sockets in Java to send an XML-formatted connect request message to a Jabber (XMPP) server, you should typically use an `OutputStream` from a `Socket`. For sending XML data, you want to ensure that the data is sent correctly with the appropriate encoding (typically UTF-8 for XML). An `OutputStre...
21,547
[ { "from": "human", "value": "What type of stream I need to use to write a connect request message over a tcp socket, to jabber.\nI'mwriting a string with xml format. It should worked with the default socket stream or a dataoutputstream but it doesn't.\n" }, { "from": "gpt", "value": "When worki...
IIS is literally sending <?php ... ?> code to the browser rather then executing it. But, only for the root http://domain.com/index.php file. All other .php files in that folder and index.php files in subfolders execute as expected. How can I get my root index.php code to execute? Update: "index.php" is a Default Docu...
If your IIS server is sending PHP code as plain text instead of executing it, there are a few potential issues to check, especially since it's only happening for the `index.php` file at the root level. Here are steps you can take to troubleshoot and fix the problem: 1. **Ensure PHP is Installed and Configured Properl...
17,327
[ { "from": "human", "value": "IIS is literally sending <?php ... ?> code to the browser rather then executing it.\nBut, only for the root http://domain.com/index.php file.\nAll other .php files in that folder and index.php files in subfolders execute as expected.\nHow can I get my root index.php code to exec...
Exactly what the title says. Note, this is not about "subscriptable" objects.
It seems like you might be referring to an error message in Python, specifically the "TypeError: 'type' object is not subscriptable." This error typically arises when you try to use square brackets `[]` on a type itself rather than on an instance of a type or a collection (like a list or a dictionary). Here’s a brief...
22,128
[ { "from": "human", "value": "Exactly what the title says. Note, this is not about \"subscriptable\" objects.\n" }, { "from": "gpt", "value": "It seems like you might be referring to an error message in Python, specifically the \"TypeError: 'type' object is not subscriptable.\" This error typical...
I'm working on a Google App Engine project. My app is working and looking correct locally, but when I try to upload images in an image directory, they're not being displayed at appspot. As a little troubleshoot, I put a HTML page in "/images/page2.html" and I can load that page at the appspot, but my pages don't displ...
Based on the information you've provided, your `app.yaml` file appears mostly correct. However, there are a few potential issues and suggestions for troubleshooting the problem with loading images. ### Key Points to Check 1. **File Structure**: Ensure that the image you are trying to load (`img.gif`) is indeed locate...
20,236
[ { "from": "human", "value": "I'm working on a Google App Engine project. \nMy app is working and looking correct locally, but when I try to upload images in an image directory, they're not being displayed at appspot.\nAs a little troubleshoot, I put a HTML page in \"/images/page2.html\" and I can load that ...
When working on a VS2005 project that involves referencing Microsoft.SharePoint.dll, building the project causes Microsoft.SharePoint.Search.dll to be copied to my bin folder. Why is this? Okay, maybe it's just a bug, but I want to know the mechanism. [Edit: Copy local is most definitely turned off -- Microsoft.SharePo...
When working with Visual Studio 2005 and dealing with references to the `Microsoft.SharePoint.dll`, it's important to understand the way .NET's assembly resolution and dependency management works. Here are a few points to consider regarding why `Microsoft.SharePoint.Search.dll` might be getting copied to your bin folde...
20,932
[ { "from": "human", "value": "When working on a VS2005 project that involves referencing Microsoft.SharePoint.dll, building the project causes Microsoft.SharePoint.Search.dll to be copied to my bin folder. Why is this? Okay, maybe it's just a bug, but I want to know the mechanism.\n[Edit: Copy local is most ...
Right now I write expressions in the *scratch* buffer and test them by evaluating with C-x C-e. I would really appreciate having an interactive interpreter like SLIME or irb, in which I could test Emacs Lisp expressions.
If you're looking for an interactive environment to test Emacs Lisp expressions similar to SLIME for Common Lisp or irb for Ruby, you can use the built-in `ielm` (Interactive Emacs Lisp Mode). This provides an interactive REPL (Read-Eval-Print Loop) where you can evaluate Emacs Lisp expressions in a more interactive wa...
23,468
[ { "from": "human", "value": "Right now I write expressions in the *scratch* buffer and test them by evaluating with C-x C-e. I would really appreciate having an interactive interpreter like SLIME or irb, in which I could test Emacs Lisp expressions.\n" }, { "from": "gpt", "value": "If you're loo...
In MFC I'm trying to set a null handler timer (ie. no windows). But I'm unable to process the WM_TIMER event in the CWinApp MESSAGE_MAP. Is this possible? If so, how?
In a Microsoft Foundation Classes (MFC) application, if you want to set a timer without a window (a null handler timer), you won’t be able to use the normal `WM_TIMER` message handling, since `WM_TIMER` is designed to be dispatched to a window's message queue. However, you can still use a timer with a `CWinApp` class b...
21,008
[ { "from": "human", "value": "In MFC I'm trying to set a null handler timer (ie. no windows). But I'm unable to process the WM_TIMER event in the CWinApp MESSAGE_MAP. Is this possible? If so, how?\n" }, { "from": "gpt", "value": "In a Microsoft Foundation Classes (MFC) application, if you want to...
I've got a code like this : Dim Document As New mshtml.HTMLDocument Dim iDoc As mshtml.IHTMLDocument2 = CType(Document, mshtml.IHTMLDocument2) iDoc.write(html) iDoc.close() However when I load an HTML like this it executes all Javascripts in it as well as doing request to some resources from "html" code. I want to di...
To load HTML content without executing JavaScript or showing any popups using the `mshtml` library, you need to use a different approach since `mshtml` operates within the Internet Explorer rendering context, which executes scripts and shows alerts or popups by default. Here are a couple of alternative approaches: ###...
16,719
[ { "from": "human", "value": "I've got a code like this : \nDim Document As New mshtml.HTMLDocument\nDim iDoc As mshtml.IHTMLDocument2 = CType(Document, mshtml.IHTMLDocument2)\niDoc.write(html)\niDoc.close()\n\nHowever when I load an HTML like this it executes all Javascripts in it as well as doing request t...
I'm currently trying to pass a mono threaded program to multithread. This software do heavy usage of "refCounted" objects, which lead to some issues in multithread. I'm looking for some design pattern or something that might solve my problem. The main problem is object deletion between thread, normally deletion only de...
Your initial approach with `RefCountedObject` has a common issue in multithreaded environments: improper management of shared resources, which can lead to race conditions and use-after-free errors. Your realization that the mutex only protected the `refCount` pointer and not the reference count itself was critical in i...
19,143
[ { "from": "human", "value": "I'm currently trying to pass a mono threaded program to multithread. This software do heavy usage of \"refCounted\" objects, which lead to some issues in multithread. I'm looking for some design pattern or something that might solve my problem.\nThe main problem is object deleti...
I need generate thumbnails for a bunch of jpegs (200,000+) but I want to make sure all of my thumbs have a equal height and width. However, I don't want to change the proportions of the image so I need to add empty space to the shorter dimension to "square it up". The empty space's background color is variable. Here...
To achieve the desired behavior of generating square thumbnails while maintaining the aspect ratio of the original images, you can follow these steps: 1. **Determine the aspect ratio of the source image.** 2. **Calculate the target dimensions of the square thumbnail.** 3. **Center the original image within the square ...
20,747
[ { "from": "human", "value": "I need generate thumbnails for a bunch of jpegs (200,000+) but I want to make sure all of my thumbs have a equal height and width. However, I don't want to change the proportions of the image so I need to add empty space to the shorter dimension to \"square it up\". The empty s...
I have a third-party editor that basically comprises a textbox and a button (the DevExpress ButtonEdit control). I want to make a particular keystroke (Alt + Down) emulate clicking the button. In order to avoid writing this over and over, I want to make a generic KeyUp event handler that will raise the ButtonClick even...
To raise the `ButtonClick` event in a DevExpress `ButtonEdit` control using reflection, you can follow these steps: 1. Create a generic `KeyUp` event handler for the control that checks if the pressed keys are `Alt + Down`. 2. If the condition is met, use reflection to get the `ButtonClick` event and invoke it. Here'...
22,179
[ { "from": "human", "value": "I have a third-party editor that basically comprises a textbox and a button (the DevExpress ButtonEdit control). I want to make a particular keystroke (Alt + Down) emulate clicking the button. In order to avoid writing this over and over, I want to make a generic KeyUp event han...
In PHP, I want to read a file into a variable and process the PHP in the file at the same time without using output buffering. Is this possible? Essentially I want to be able to accomplish this without using ob_start(): <?php ob_start(); include 'myfile.php'; $xhtml = ob_get_clean(); ?> Is this possible in PHP? Update...
In PHP, if you want to include a file and process the PHP within that file without using output buffering (such as with `ob_start()`), you can utilize `create_function()` or `Closure`, although the latter is a more modern approach. However, since you specifically mentioned avoiding output buffering and implied that yo...
21,850
[ { "from": "human", "value": "In PHP, I want to read a file into a variable and process the PHP in the file at the same time without using output buffering. Is this possible?\nEssentially I want to be able to accomplish this without using ob_start():\n<?php\nob_start();\ninclude 'myfile.php';\n$xhtml = ob_ge...
I have developed my reports in SQL REporting services and deployed in my server. I need to display the reports in my java application page. I want to know is there any control (like .net report viewer control) to display this Thanks balaweblog
Displaying SQL Server Reporting Services (SSRS) reports within a Java application requires a different approach since there isn't a direct equivalent to the .NET Report Viewer control for Java. However, you can still achieve this using a couple of methods. Here are some options: ### 1. **Using a Web Browser Component*...
20,759
[ { "from": "human", "value": "I have developed my reports in SQL REporting services and deployed in my server. I need to display the reports in my java application page. I want to know is there any control (like .net report viewer control) to display this\nThanks\nbalaweblog\n" }, { "from": "gpt", ...
From http://en.wikipedia.org/wiki/AJAX, I get a fairly good grasp of what AJAX is. However, it looks like in order to learn it, I'd have to delve into multiple technologies at the same time to get any benefit out of it. So two questions: What are resources that can help me understand/use AJAX? What sort of website wou...
AJAX (Asynchronous JavaScript and XML) is a set of web development techniques that allows for the asynchronous loading of data, enabling a more interactive and dynamic user experience on web pages. Learning AJAX involves understanding several technologies, primarily JavaScript, HTML, CSS, and often some server-side lan...
12,957
[ { "from": "human", "value": "From http://en.wikipedia.org/wiki/AJAX, I get a fairly good grasp of what AJAX is. However, it looks like in order to learn it, I'd have to delve into multiple technologies at the same time to get any benefit out of it. So two questions:\n\nWhat are resources that can help me un...
I have an XmlDocument that already exists and is read from a file. I would like to add a chunk of Xml to a node in the document. Is there a good way to create and add all the nodes without cluttering my code with many .CreateNote and .AppendChild calls? I would like some way of making a string or stringBuilder of a va...
To efficiently add a chunk of XML to an existing `XmlDocument` without cluttering your code with many `.CreateElement` and `.AppendChild` calls, you can use the `XmlDocument`'s `LoadXml` method. This allows you to create an XML fragment as a string and insert it into your existing XML structure. Here's how you can ach...
18,607
[ { "from": "human", "value": "I have an XmlDocument that already exists and is read from a file. \nI would like to add a chunk of Xml to a node in the document. Is there a good way to create and add all the nodes without cluttering my code with many .CreateNote and .AppendChild calls?\nI would like some way ...
I don't want to change how the Status field works I just want to change the labels to the states that the old system uses. (the old systems consists of spreadsheets and paper :P We are using 3.0 * UNCONFIRMED --> PRELIMARY * NEW --> DESIGN REVIEW * ASSIGNED --> STR1 * RESOLVED --> STR2 * REOPEN * V...
To change the labels of the Status field in your system without altering how the field operates, you'll typically need to access the settings or configuration options in your application. Here's a general approach to how you can do this, keeping in mind that the exact steps may vary depending on the specific software y...
16,973
[ { "from": "human", "value": "I don't want to change how the Status field works I just want to change the labels to\nthe states that the old system uses. (the old systems consists of spreadsheets and paper :P\n\nWe are using 3.0\n\n* UNCONFIRMED --> PRELIMARY\n* NEW --> DESIGN REVIEW\n* ASSIGNED ...
For my server app, I need to check if an ip address is in our blacklist. What is the most efficient way of comparing ip addresses? Would converting the IP address to integer and comparing them efficient?
Comparing IP addresses for blacklisting is a common requirement in server applications, and converting IP addresses to integers is indeed a common and efficient method for performing these comparisons. Here’s a breakdown of the approach and some additional considerations: ### 1. Converting IP Addresses to Integers - ...
20,515
[ { "from": "human", "value": "For my server app, I need to check if an ip address is in our blacklist. \nWhat is the most efficient way of comparing ip addresses? Would converting the IP address to integer and comparing them efficient?\n" }, { "from": "gpt", "value": "Comparing IP addresses for b...
Where is a reliable registry key to find install location of Excel 2007?
To find the installation location of Microsoft Excel 2007 in the Windows Registry, you can check the following registry key: ```plaintext HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Common\InstallRoot ``` In this key, look for the `Path` value, which should indicate the installation directory of Microsoft Offic...
25,383
[ { "from": "human", "value": "Where is a reliable registry key to find install location of Excel 2007?\n" }, { "from": "gpt", "value": "To find the installation location of Microsoft Excel 2007 in the Windows Registry, you can check the following registry key:\n\n```plaintext\nHKEY_LOCAL_MACHINE\...
I’m trying to debug a memory leak problem. I’m using mtrace() to get a malloc/free/realloc trace. I’ve ran my prog and have now a huge log file. So far so good. But I have problems interpreting the file. Look at these lines: @ /usr/java/ibm-java2-x86_64-50/jre/bin/libj9prt23.so:[0x2b270a384a34] + 0x1502570 0x68 @ /usr/...
The situation you're encountering while analyzing your `mtrace()` output seems to suggest some unusual behavior in memory allocation, particularly around the use of `malloc()`. Here’s a breakdown of what might be happening and how to interpret the output: ### Multiple Allocations for the Same Call 1. **Same Return Ad...
19,407
[ { "from": "human", "value": "I’m trying to debug a memory leak problem. I’m using mtrace() to get a malloc/free/realloc trace. I’ve ran my prog and have now a huge log file. So far so good. But I have problems interpreting the file. Look at these lines:\n@ /usr/java/ibm-java2-x86_64-50/jre/bin/libj9prt23.so...
Ok so part two of I have no will power experiment is: Summary Question - Is there a way to set the CanStop property on a windows service dynamically? Whole Spiel - I have a service that is currently checking and killing processes (IE Games) I have told it to if it's day I'm not allowed. Great. I set the CanStop to fa...
To answer your question: No, you cannot dynamically change the `CanStop` property of a Windows Service once it is running. The `CanStop` property is a part of the service's definition and is set in the code when the service is created. If you set `CanStop` to `false`, it remains `false` while the service is running, re...
19,912
[ { "from": "human", "value": "Ok so part two of I have no will power experiment is:\nSummary Question -\nIs there a way to set the CanStop property on a windows service dynamically?\nWhole Spiel -\nI have a service that is currently checking and killing processes (IE Games) I have told it to if it's day I'm ...
I'm pretty new to both C++ and Block Cipher encryption, and I am currently in the process of writing a decryption function for AES (16 byte seed / 16 byte blocks). All is going well, but my total data size is not always a multiple of my block size. I'm wondering what the best way to handle leftover data at the end of m...
When working with block ciphers like AES, it's important to consider how you handle data that doesn't align perfectly with the block size. AES operates on 16-byte blocks, and when your data size is not a multiple of 16 bytes, you have a few options to handle the leftover data. Here are some common strategies: ### 1. *...
18,343
[ { "from": "human", "value": "I'm pretty new to both C++ and Block Cipher encryption, and I am currently in the process of writing a decryption function for AES (16 byte seed / 16 byte blocks). All is going well, but my total data size is not always a multiple of my block size. I'm wondering what the best wa...
I'm not sure if Jeff coined it but it's the joke/saying that people who say "oh, I know I'll use regular expressions!" now have two problems. I've always taken this to mean that people use regular expressions in very inappropriate contexts. However, under what circumstances are regular expressions really the best answ...
Regular expressions (regex) are powerful tools for pattern matching and text processing. While it is true that they can lead to complicated and hard-to-maintain code if misused, there are definitely scenarios where regular expressions are the best option. Here are some circumstances where regular expressions excel: 1....
23,979
[ { "from": "human", "value": "I'm not sure if Jeff coined it but it's the joke/saying that people who say \"oh, I know I'll use regular expressions!\" now have two problems. I've always taken this to mean that people use regular expressions in very inappropriate contexts. \nHowever, under what circumstances ...
Has anyone got this working in a web application? No matter what I do it seems that my appSettings section (redirected from web.config using appSettings file=".\Site\site.config") does not get reloaded. Am I doomed to the case of having to just restart the application? I was hoping this method would lead me to a more...
When you use an external configuration file to manage your application settings in ASP.NET (like using `appSettings file=".\Site\site.config"`), the configuration system is designed to cache those settings for performance reasons. As a result, changes made to the external configuration file will not trigger a reload of...
18,674
[ { "from": "human", "value": "Has anyone got this working in a web application? \nNo matter what I do it seems that my appSettings section (redirected from web.config using appSettings file=\".\\Site\\site.config\") does not get reloaded. \nAm I doomed to the case of having to just restart the application? I...
What are the main reasons personal projects (software apps etc) never get to the level of competing with your salary? To me one big problem is "on-the-fly" feature expansion, with this problem, the end only gets further and further away!
There are several reasons why personal projects, such as software applications, often struggle to reach a level where they can compete with a full-time salary. Here are some key factors, including the issue of "on-the-fly" feature expansion you mentioned: 1. **Feature Creep**: As you pointed out, the desire to constan...
21,369
[ { "from": "human", "value": "What are the main reasons personal projects (software apps etc) never get to the level of competing with your salary?\nTo me one big problem is \"on-the-fly\" feature expansion, with this problem, the end only gets further and further away!\n" }, { "from": "gpt", "va...
I am a complete beginner trying to develop for FCKeditor so please bear with me here. I have been tasked with developing a custom plugin that will allow users to browse a specific set of images that the user uploads. Essentially the user first attaches images, then uses the FCKeditor to insert those images. So I have m...
Developing a custom plugin for FCKeditor (now known as CKEditor) can be a rewarding experience. Here are some suggestions and strategies based on your questions: ### 1. Location of `mybrowser.asp` - **Recommendation**: It is common to keep dynamic scripts like `mybrowser.asp` outside the plugin directory, especially i...
20,425
[ { "from": "human", "value": "I am a complete beginner trying to develop for FCKeditor so please bear with me here. I have been tasked with developing a custom plugin that will allow users to browse a specific set of images that the user uploads. Essentially the user first attaches images, then uses the FCKe...
In SQL you can use SELECT * FROM INFORMATION_SCHEMA.TABLES etc to get information about the database structure. I need to know how to achieve the same thing for an Access database.
In Microsoft Access, you don't have a direct equivalent to SQL Server's `INFORMATION_SCHEMA` views, but you can achieve similar functionality using VBA (Visual Basic for Applications) or by querying the system tables directly. ### Option 1: Using VBA to List Tables You can use VBA to list all tables in an Access data...
22,775
[ { "from": "human", "value": "In SQL you can use \nSELECT * FROM INFORMATION_SCHEMA.TABLES \netc to get information about the database structure. I need to know how to achieve the same thing for an Access database.\n" }, { "from": "gpt", "value": "In Microsoft Access, you don't have a direct equi...
Are there any libraries, (third party is fine) that can help do network auto-discovery using SNMP and .NET? If not, have you ever rolled your own?
Yes, there are several third-party libraries available for .NET that can help with network auto-discovery using SNMP (Simple Network Management Protocol). Here are a few popular options: 1. **SnmpSharpNet**: This is a well-known and widely used library for SNMP in .NET. It allows you to perform SNMP operations such as...
21,863
[ { "from": "human", "value": "Are there any libraries, (third party is fine) that can help do network auto-discovery using SNMP and .NET?\nIf not, have you ever rolled your own?\n" }, { "from": "gpt", "value": "Yes, there are several third-party libraries available for .NET that can help with net...
How can you you insert a newline from your batch file output? I want to do something like: echo hello\nworld Which would output: hello world
In a Windows batch file, you can insert a newline character using the `echo` command, but it doesn't directly support escape sequences like `\n`. However, you can achieve the desired output by using the following methods: ### Method 1: Using Multiple `echo` Statements You can simply call `echo` twice, once for each l...
25,299
[ { "from": "human", "value": "\nHow can you you insert a newline from your batch file output?\nI want to do something like:\necho hello\\nworld\n\nWhich would output:\nhello\nworld\n\n" }, { "from": "gpt", "value": "In a Windows batch file, you can insert a newline character using the `echo` comm...
How can you change the href attribute (link target) for a hyperlink using jQuery?
To change the `href` attribute of a hyperlink using jQuery, you can use the `.attr()` method. Here’s a simple example: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Change href Example</title> <script...
21,540
[ { "from": "human", "value": "How can you change the href attribute (link target) for a hyperlink using jQuery?\n" }, { "from": "gpt", "value": "To change the `href` attribute of a hyperlink using jQuery, you can use the `.attr()` method. Here’s a simple example:\n\n```html\n<!DOCTYPE html>\n<htm...
I'm using a whole bunch of CALayers, creating a tile-based image not unlike GoogleMaps (different versions of the same image with more/less detail). The code I'm using to do this is: UIImage* image = [self loadImage:obj.fileName zoomLevel:obj.zoomLevel]; [CATransaction setValue:(id)kCFBooleanTrue forKe...
Using `UIImage` to load images can be convenient, but if you're looking to optimize performance, especially when dealing with a large number of `CALayers` in a tile-based image system (like a map), it’s often beneficial to work directly with `CGImage` or at least minimize unnecessary overhead from `UIImage`. ### Perfo...
19,364
[ { "from": "human", "value": "I'm using a whole bunch of CALayers, creating a tile-based image not unlike GoogleMaps (different versions of the same image with more/less detail).\nThe code I'm using to do this is:\nUIImage* image = [self loadImage:obj.fileName zoomLevel:obj.zoomLevel];\n[CATransaction setVal...
I have a master-detail scenario where I have 1 ComboBox listing companies from an ObjectDataSourceProvider. Under that I have 2 ComboBoxes binding to the Contacts property from the current Company object. I need to be able to select a different contact in each ComboBox; however, as soon as I change selection in one l...
In your scenario, it seems that the issue arises because both `ComboBox` controls (for `PrimaryContact` and `AdminContact`) are binding to the same property (the `Contacts` collection) of the currently selected `Company`. Since `SelectedValue` is bound directly to the same property for both `ComboBox` controls, changin...
20,253
[ { "from": "human", "value": "I have a master-detail scenario where I have 1 ComboBox listing companies from an ObjectDataSourceProvider. Under that I have 2 ComboBoxes binding to the Contacts property from the current Company object. I need to be able to select a different contact in each ComboBox; howeve...
In my winforms application, AppDomain.CurrentDomain.BaseDirectory is set to "C:\Projects\TestProject\bin\Debug\" In my unit tests it is "C:\Projects\TestProject\bin\Debug" (no final slash). Why is this? [Edit] @Will : I am asking why the test project's directory doesn't have a trailing slash?
The difference you're observing in the output of `AppDomain.CurrentDomain.BaseDirectory` between your WinForms application and your unit tests is related to how the .NET framework constructs the base directory string. ### Explanation: 1. **Base Directory Representation**: - The `BaseDirectory` property returns th...
19,469
[ { "from": "human", "value": "In my winforms application, AppDomain.CurrentDomain.BaseDirectory is set to \"C:\\Projects\\TestProject\\bin\\Debug\\\"\nIn my unit tests it is \"C:\\Projects\\TestProject\\bin\\Debug\" (no final slash). Why is this?\n[Edit] @Will : I am asking why the test project's directory ...
I'm writing code that looks similar to this: public IEnumerable<T> Unfold<T>(this T seed) { while (true) { yield return [next (T)object in custom sequence]; } } Obviously, this method is never going to return. (The C# compiler silently allows this, while R# gives me the warning "Function never retu...
Creating an `IEnumerable<T>` implementation that generates an infinite sequence can be a useful tool in some scenarios, but it does come with a range of considerations that you should account for, particularly in terms of design, performance, and user experience. ### General Considerations 1. **Infinite Sequences**: ...
19,680
[ { "from": "human", "value": "I'm writing code that looks similar to this:\npublic IEnumerable<T> Unfold<T>(this T seed)\n{\n while (true)\n {\n yield return [next (T)object in custom sequence];\n }\n}\n\nObviously, this method is never going to return. (The C# compiler silently allows this, ...
Our continuous integration system currently runs a perl script to parse our sln/proj files to set the following options: DebugInformationFormat="0" GenerateDebugInformation="FALSE" Preventing generation of pdbs allows us to increase the parallelization of the CIS compile. However, this method seems hacky and occasiona...
You are correct in assessing that manipulating the `.sln` or `.proj` files through a Perl script may be a hacky solution, and it can lead to maintenance issues or inconsistencies over time. Introducing a new configuration like `RELEASE_NOPDB` is one approach, but as you mentioned, it could complicate the maintenance of...
21,110
[ { "from": "human", "value": "Our continuous integration system currently runs a perl script to parse our sln/proj files to set the following options:\nDebugInformationFormat=\"0\" \nGenerateDebugInformation=\"FALSE\"\nPreventing generation of pdbs allows us to increase the parallelization of the CIS compile...
I have been using SourceMonitor on my project for a couple of years to keep records of source-code complexity and basic SLOC (including comments) for C# and C++ components. These are used for external reporting to our customer, so I'm not in a position to argue their merits or lack of. I've been working on a repositor...
If you are looking for a .NET native library that can analyze source code directly (rather than analyzing compiled assemblies like NDepend), your options might be limited, but there are a few libraries and approaches that you could consider: ### 1. **Roslyn (.NET Compiler Platform)** Roslyn provides rich APIs for anal...
14,611
[ { "from": "human", "value": "I have been using SourceMonitor on my project for a couple of years to keep records of source-code complexity and basic SLOC (including comments) for C# and C++ components. These are used for external reporting to our customer, so I'm not in a position to argue their merits or ...
Is there any advantage of using java.util.concurrent.CountdownLatch instead of java.util.concurrent.Semaphore? As far as I can tell the following fragments are almost equivalent: 1. Semaphore final Semaphore sem = new Semaphore(0); for (int i = 0; i < num_threads; ++ i) { Thread t = new Thread() { public void r...
You've correctly identified some of the key differences between `java.util.concurrent.CountDownLatch` and `java.util.concurrent.Semaphore`, as well as their respective advantages and disadvantages. Let's break down when one might be preferable over the other. ### Key Differences 1. **Reusability**: - **Semaphore**...
22,090
[ { "from": "human", "value": "Is there any advantage of using\njava.util.concurrent.CountdownLatch \ninstead of\njava.util.concurrent.Semaphore? \nAs far as I can tell the following fragments are almost equivalent:\n1. Semaphore\nfinal Semaphore sem = new Semaphore(0);\nfor (int i = 0; i < num_threads; ++ i)...
I'm refactoring "spaghetti code" C module to work in multitasking (RTOS) environment. Now, there are very long functions and many unnecessary global variables. When I try to replace global variables that exists only in one function with locals, I get into dilemma. Every global variable is behave like local "static" - e...
Refactoring spaghetti code, especially in the context of transitioning to a multitasking Real-Time Operating System (RTOS), can be challenging. If you're focusing on identifying functions that rely on preserving variable values across calls (reentrancy issues), there are several approaches you can take without having t...
17,282
[ { "from": "human", "value": "I'm refactoring \"spaghetti code\" C module to work in multitasking (RTOS) environment.\nNow, there are very long functions and many unnecessary global variables.\nWhen I try to replace global variables that exists only in one function with locals, I get into dilemma. Every glob...
Consider a standard ASP.NET web application where the user types in some numeric data on a form. On submitting, some business objects are spun up to operate on the numeric data. But server-side textbox controls in .Net return a value of type string. Question: Should the codebehind of the page take responsibility for...
When designing the interaction between an ASP.NET web application and its underlying business logic, you have a couple of options regarding how to handle the conversion of string input from user interfaces (like textboxes) into numeric data types. The decision on where to handle this conversion can impact both the clar...
20,221
[ { "from": "human", "value": "Consider a standard ASP.NET web application where the user types in some numeric data on a form. On submitting, some business objects are spun up to operate on the numeric data. But server-side textbox controls in .Net return a value of type string. Question: Should the codeb...
As the title: How would I tell NHibernate, once and for all, that all table and column names are to be quoted in the SQL it generates?
To configure NHibernate to always use quoted identifiers for table and column names in the SQL it generates, you can customize the dialect that NHibernate uses. Quoting the identifiers ensures that the database treats them as case-sensitive and helps avoid conflicts with reserved keywords. Here’s how you can achieve t...
22,407
[ { "from": "human", "value": "As the title: How would I tell NHibernate, once and for all, that all table and column names are to be quoted in the SQL it generates?\n" }, { "from": "gpt", "value": "To configure NHibernate to always use quoted identifiers for table and column names in the SQL it g...
I have a problem with a memory leak in a .NET CF application. Using RPM I identified that dynamically creating controls are not garbage collected as expected. Running the same piece of code in .NET Window Forms behave differently and disposes the control as I expected. See the output from RPM via PerfMon for the Pro...
It seems like you're encountering a memory leak issue in your .NET Compact Framework (CF) application. Here are some insights and potential solutions to address the memory leak that you're experiencing: ### Understanding the Issue 1. **Garbage Collection in .NET CF**: - The .NET Compact Framework implements garbag...
20,036
[ { "from": "human", "value": "I have a problem with a memory leak in a .NET CF application. \nUsing RPM I identified that dynamically creating controls are not garbage collected as expected. Running the same piece of code in .NET Window Forms behave differently and disposes the control as I expected.\nSee ...
I have a very large database table in PostgresQL and a column like "copied". Every new row starts uncopied and will later be replicated to another thing by a background programm. There is an partial index on that table "btree(ID) WHERE replicated=0". The background programm does a select for at most 2000 entries (LIMIT...
Given the constraints of PostgreSQL 7.4 and the large size of your database, it can be challenging to efficiently reset the `replicated` column for a substantial number of rows. Here are several strategies you can consider to achieve this without running into the issues you've described: ### 1. Batch Updates with a Lo...
18,500
[ { "from": "human", "value": "I have a very large database table in PostgresQL and a column like \"copied\". Every new row starts uncopied and will later be replicated to another thing by a background programm. There is an partial index on that table \"btree(ID) WHERE replicated=0\". The background programm ...
This is a bit of a lazyweb question but you get the rep so :-) I have a Java class that returns instances of itself to allow chaining (e.g. ClassObject.doStuff().doStuff()) For instance: public class Chainer { public Chainer doStuff() { /* Do stuff ... */ return this; } } I would like to ext...
Yes, you can achieve this using generics to allow for method chaining while enabling subclasses to return their own type. This pattern is often referred to as the "Curiously Recurring Template Pattern" (CRTP). Here’s how you can implement it in Java: 1. Modify your base `Chainer` class to accept a type parameter that ...
22,471
[ { "from": "human", "value": "This is a bit of a lazyweb question but you get the rep so :-)\nI have a Java class that returns instances of itself to allow chaining \n(e.g. ClassObject.doStuff().doStuff())\nFor instance:\npublic class Chainer\n{\n public Chainer doStuff()\n {\n /* Do stuff ... */...
See the question. I want to see the methods and classes offered by a DLLs library.
To see the methods and classes offered by a DLL (Dynamic Link Library) in Windows, you can use several tools and techniques. Here are some common methods: ### 1. **Using Dependency Walker** - **Dependency Walker** is a free utility that you can use to view the exported functions of a DLL. - **Steps**: 1. Do...
19,040
[ { "from": "human", "value": "See the question. I want to see the methods and classes offered by a DLLs library.\n" }, { "from": "gpt", "value": "To see the methods and classes offered by a DLL (Dynamic Link Library) in Windows, you can use several tools and techniques. Here are some common metho...
This is related to another question I asked. In summary, I have a special case of a URL where, when a form is POSTed to it, I can't rely on cookies for authentication or to maintain the user's session, but I somehow need to know who they are, and I need to know they're logged in! I think I came up with a solution to my...
Your situation is indeed challenging, especially since you need to authenticate users without relying on cookies or database storage. Using an encrypted hidden form field can work, but as you've identified, it introduces vulnerabilities, particularly replay attacks. Here are some strategies to enhance your approach, wh...
11,948
[ { "from": "human", "value": "This is related to another question I asked. In summary, I have a special case of a URL where, when a form is POSTed to it, I can't rely on cookies for authentication or to maintain the user's session, but I somehow need to know who they are, and I need to know they're logged in...
By default if you connect to a remote SQL Server via an account that has access to say 1 of the 10 databases. You will still see in the Object Explorer all other databases, obviously due to permissions you cannot actually query them, but you can see their names. I have heard that there is a method that disable this be...
To restrict users from seeing databases they do not have permission to access in SQL Server, you can employ the `DENY VIEW ANY DATABASE` permission for those users. By denying this permission, users will not see any databases except for those for which they have explicit permissions. Here’s how you can do this: 1. **...
23,981
[ { "from": "human", "value": "By default if you connect to a remote SQL Server via an account that has access to say 1 of the 10 databases. You will still see in the Object Explorer all other databases, obviously due to permissions you cannot actually query them, but you can see their names.\nI have heard t...
I inherited a database built with the idea that composite keys are much more ideal than using a unique object ID field and that when building a database, a single unique ID should never be used as a primary key. Because I was building a Rails front-end for this database, I ran into difficulties getting it to conform t...
The choice between using composite keys versus a single unique identifier (like a UUID or auto-incremented integer) as a primary key in a database design is a nuanced topic with pros and cons on both sides. The discussion often revolves around data integrity, performance, simplicity, and design philosophy. Here's a dee...
16,501
[ { "from": "human", "value": "I inherited a database built with the idea that composite keys are much more ideal than using a unique object ID field and that when building a database, a single unique ID should never be used as a primary key. Because I was building a Rails front-end for this database, I ran ...
I'd like to eliminate dependencies on hardcoded paths for configuration data in my Java apps, I understand that using ResourceBundle will help me use the classloader to find resources. Can someone tell me how I would replace a hardcoded path to a resource (say a .properties configuration data file required by a class) ...
Certainly! Using `ResourceBundle` in Java is a great way to manage your configuration data without relying on hardcoded paths. `ResourceBundle` helps you to load properties files that can be packaged with your application, making your application more flexible and portable. Here’s a simple example of how you can repla...
15,959
[ { "from": "human", "value": "I'd like to eliminate dependencies on hardcoded paths for configuration data in my Java apps, I understand that using ResourceBundle will help me use the classloader to find resources.\nCan someone tell me how I would replace a hardcoded path to a resource (say a .properties con...
I'm looking into some possible options for unit testing C++ classes. So, short and to the point, what are you using?
There are several popular options for unit testing C++ classes. Here are some of the most widely used frameworks: 1. **Google Test (gtest)**: A powerful and widely used testing framework developed by Google. It provides a rich set of assertions, test fixtures, and supports death tests and parameterized tests. 2. **Ca...
23,662
[ { "from": "human", "value": "I'm looking into some possible options for unit testing C++ classes. \nSo, short and to the point, what are you using?\n" }, { "from": "gpt", "value": "There are several popular options for unit testing C++ classes. Here are some of the most widely used frameworks:\n...
If two users edit the same wiki topic, what methods have been used in wikis (or in similar collaborative editing software) to merge the second user's edits with the first? I'd like a solution that: doesn't require locking doesn't lose any additions to the page. It may add extra "boilerplate" text to indicate where dif...
In collaborative editing environments like wikis, merging edits from multiple users without locking the page is a common challenge. Here are some methods that can be used to achieve this: 1. **Three-Way Merge Algorithm:** - This technique uses three versions of a document: the base version (the version that both us...
22,047
[ { "from": "human", "value": "If two users edit the same wiki topic, what methods have been used in wikis (or in similar collaborative editing software) to merge the second user's edits with the first?\nI'd like a solution that:\n\ndoesn't require locking\ndoesn't lose any additions to the page.\nIt may add ...
I have limited experience with .net. My app throws an error this.dateTimeFormat is undefined which I tracked down to a known ajax bug. The workaround posted said to: "Register the following as a startup script:" Sys.CultureInfo.prototype._getAbbrMonthIndex = function(value) { if (!this._upperAbbrMonths) { this._upper...
To register the provided script as a startup script in your ASP.NET application, you typically want to add it within the context of the page lifecycle, ensuring it runs after the required script libraries have been loaded. Here’s how you can do this: ### 1. Add the Script to the Page You can add the script directly ...
18,860
[ { "from": "human", "value": "I have limited experience with .net. My app throws an error this.dateTimeFormat is undefined which I tracked down to a known ajax bug. The workaround posted said to:\n\"Register the following as a startup script:\"\nSys.CultureInfo.prototype._getAbbrMonthIndex = function(value...
What is the best way to bind WPF properties to ApplicationSettings in C#? Is there an automatic way like in a Windows Forms Application? Similar to this question, how (and is it possible to) do you do the same thing in WPF?
In WPF, binding properties to application settings can be done, but it requires a bit more setup compared to Windows Forms, where it can be done more automatically. In WPF, you can use the `ApplicationSettingsBase` class, typically through the `Properties.Settings` of your application. Here’s a general step-by-step a...
21,985
[ { "from": "human", "value": "What is the best way to bind WPF properties to ApplicationSettings in C#? Is there an automatic way like in a Windows Forms Application? Similar to this question, how (and is it possible to) do you do the same thing in WPF?\n" }, { "from": "gpt", "value": "In WPF, b...
Using Apache's commons-httpclient for Java, what's the best way to add query parameters to a GetMethod instance? If I'm using PostMethod, it's very straightforward: PostMethod method = new PostMethod(); method.addParameter("key", "value"); GetMethod doesn't have an "addParameter" method, though. I've discovered that t...
When working with `GetMethod` in Apache's Commons HttpClient, you're correct that it does not have an `addParameter` method like `PostMethod`. The approach you have discovered using `setQueryString` is indeed the proper way to add query parameters to a `GetMethod` instance in a programmatic manner. ### Preferred Patte...
22,075
[ { "from": "human", "value": "Using Apache's commons-httpclient for Java, what's the best way to add query parameters to a GetMethod instance? If I'm using PostMethod, it's very straightforward:\nPostMethod method = new PostMethod();\nmethod.addParameter(\"key\", \"value\");\n\nGetMethod doesn't have an \"ad...
How can I set the flag FILE_FLAG_BACKUP_SEMANTICS for an fstream object? You can set most flags with fstream, but it seems like this one is not availble. You can read about the flag here.
The `FILE_FLAG_BACKUP_SEMANTICS` flag is specific to the Windows API and is used when opening files with the Windows functions that interact directly with the file system. The C++ standard library's `fstream` does not provide direct support for this flag, as it is a higher-level abstraction over file I/O. If you need ...
23,423
[ { "from": "human", "value": "How can I set the flag FILE_FLAG_BACKUP_SEMANTICS for an fstream object?\nYou can set most flags with fstream, but it seems like this one is not availble. You can read about the flag here.\n" }, { "from": "gpt", "value": "The `FILE_FLAG_BACKUP_SEMANTICS` flag is spe...
I met a problem when deveoping a photo viewer application. I use ListBox to Show Images, which is contained in a ObservableCollection. I bind the ListBox's ItemsSource to the ObservableCollection. <DataTemplate DataType="{x:Type modeldata:ImageInfo}"> <Image Margin="6" Source="{Bindin...
Your issue with the performance of the photo viewer application when resizing images in a `ListBox` is common, especially when dealing with a large number of items. Let's address your questions and concerns: ### 1. Why it becomes slow? There are a few reasons why resizing the images may cause performance issues: - **...
20,581
[ { "from": "human", "value": "I met a problem when deveoping a photo viewer application.\nI use ListBox to Show Images, which is contained in a ObservableCollection.\nI bind the ListBox's ItemsSource to the ObservableCollection.\n <DataTemplate DataType=\"{x:Type modeldata:ImageInfo}\">\n <Image \n ...
After I discontinued programming in C++ while entering into web authoring I was spoilt by PHP's high level constructs like hash tables or its dynamic, weak typing. I remembered the angst of C/C++ pointers and the maze of low-level Win32 API handles and message loops and that prevented me from utilizing environments lik...
If you're looking to move away from C++ and C# but still want to work in a high-level language with a dynamic and flexible syntax, there are several options you might consider. Here are a few programming languages and environments that might suit your needs: 1. **Python**: Known for its readability and simplicity, Pyt...
20,771
[ { "from": "human", "value": "After I discontinued programming in C++ while entering into web authoring I was spoilt by PHP's high level constructs like hash tables or its dynamic, weak typing. I remembered the angst of C/C++ pointers and the maze of low-level Win32 API handles and message loops and that pre...
More than decade passed since first publication of Date's and Darwen's "The Third Manifesto" in 1995. What is the place of relational school of thought in today's database world? Is there any evidence that Manifesto's ideas changed mainstream software development and data management practices? Have they catalyzed creat...
As of my last knowledge update in October 2023, the relational school of thought remains a foundational paradigm in the database world, although the landscape has evolved significantly since the publication of Chris Date and Hugh Darwen's "The Third Manifesto" in 1995. Their manifesto promoted a pure relational model, ...
20,322
[ { "from": "human", "value": "More than decade passed since first publication of Date's and Darwen's \"The Third Manifesto\" in 1995.\nWhat is the place of relational school of thought in today's database world?\nIs there any evidence that Manifesto's ideas changed mainstream software development and data ma...
I've recently started playing with Mono (1.9.1) on Ubuntu 8.04 with the Mono-Develop IDE (v1). I am attempting to use GTK-Sharp 2 to run the GUI for the play apps. For some reason when I try to create gtk dialogs (ColorSelectionDialog or MessageDialog) the compiler throws the error "'Gtk.ColorSelectionDialog.ColorSele...
The issue you're encountering with `Gtk.ColorSelectionDialog` in GTK# 2.0 relates to the constructor's accessibility. In GTK# 2, certain dialog constructors may be marked as inaccessible, which results in the error you're seeing. To resolve this issue, you can use a different approach to create color selection dialogs....
15,643
[ { "from": "human", "value": "I've recently started playing with Mono (1.9.1) on Ubuntu 8.04 with the Mono-Develop IDE (v1). I am attempting to use GTK-Sharp 2 to run the GUI for the play apps. \nFor some reason when I try to create gtk dialogs (ColorSelectionDialog or MessageDialog) the compiler throws the ...
I want to do an HTTP POST that looks like an HMTL form posted from a browser. Specifically, post some text fields and a file field. Posting text fields is straightforward, there's an example right there in the net/http rdocs, but I can't figure out how to post a file along with it. Net::HTTP doesn't look like the best ...
If you want to perform an HTTP POST that mimics an HTML form submission—including text fields and file uploads—you can use the `curb` gem in Ruby. Here's how you can achieve that. First, ensure you have the `curb` gem installed. If you haven't already, you can install it via: ```bash gem install curb ``` Here’s an e...
22,171
[ { "from": "human", "value": "I want to do an HTTP POST that looks like an HMTL form posted from a browser. Specifically, post some text fields and a file field.\nPosting text fields is straightforward, there's an example right there in the net/http rdocs, but I can't figure out how to post a file along with...
Can someone provide a simple explanation of methods vs. functions in OOP context?
In the context of Object-Oriented Programming (OOP), the terms "methods" and "functions" are often used, but they have distinct meanings: ### Functions: - A **function** is a standalone block of code designed to perform a specific task. It can take input (parameters) and return output (a result). - Functions are not ...
21,536
[ { "from": "human", "value": "Can someone provide a simple explanation of methods vs. functions in OOP context?\n" }, { "from": "gpt", "value": "In the context of Object-Oriented Programming (OOP), the terms \"methods\" and \"functions\" are often used, but they have distinct meanings:\n\n### Fun...
I've been working on a project where I need to iterate through a collection of data and remove entries where the "primary key" is duplicated. I have tried using a List<int> and Dictionary<int, bool> With the dictionary I found slightly better performance, even though I never need the Boolean tagged with each entry. ...
If you're aiming to filter out duplicates based on a "primary key" in a collection and you don't need to store the actual entries, a `HashSet<int>` is often a better choice than a `List<int>` or a `Dictionary<int, bool>`. A `HashSet` is specifically designed to hold unique elements, which makes it ideal for your scenar...
13,522
[ { "from": "human", "value": "I've been working on a project where I need to iterate through a collection of data and remove entries where the \"primary key\" is duplicated. I have tried using a\nList<int>\n\nand \nDictionary<int, bool>\n\nWith the dictionary I found slightly better performance, even though ...
What is the difference in meaning between 'semantics' and 'syntax'? What are they? Also, what's the difference between things like "semantic website vs. normal website", "semantic social networking vs. normal social networking" etc.
**Semantics vs. Syntax:** 1. **Syntax** refers to the set of rules, principles, and processes that govern the structure of sentences in a given language. It focuses on how words and phrases are arranged to create meaningful sentences. Syntax is concerned with the order of words, the arrangement of phrases, and the gra...
22,346
[ { "from": "human", "value": "What is the difference in meaning between 'semantics' and 'syntax'? What are they?\nAlso, what's the difference between things like \"semantic website vs. normal website\", \"semantic social networking vs. normal social networking\" etc.\n" }, { "from": "gpt", "valu...
I'm trying to debug an MSBuild task, and I know there is some way to write to the MSBuild log from within a custom task but I forget how.
In MSBuild, you can write messages to the MSBuild log from within a custom task by using the `Log` property of the `Task` class. This allows you to log messages at different severity levels, such as `Message`, `Warning`, and `Error`. Here's a basic example of how to create a custom MSBuild task that logs messages to t...
22,896
[ { "from": "human", "value": "I'm trying to debug an MSBuild task, and I know there is some way to write to the MSBuild log from within a custom task but I forget how.\n" }, { "from": "gpt", "value": "In MSBuild, you can write messages to the MSBuild log from within a custom task by using the `Lo...
I'd like to create a "universal" debug logging function that inspects the JS namespace for well-known logging libraries. For example, currently, it supports Firebug's console.log: var console = window['console']; if (console && console.log) { console.log(message); } Obviously, this only works in ...
Certainly! One well-known logging library you can check for is `jQuery`. If jQuery is present, you can utilize its built-in logging capabilities. Here's how you might implement a check for jQuery and use it for logging messages: ```javascript function logMessage(message) { // Check if jQuery is available if (type...
14,649
[ { "from": "human", "value": "I'd like to create a \"universal\" debug logging function that inspects the JS namespace for well-known logging libraries.\nFor example, currently, it supports Firebug's console.log:\n\n\n var console = window['console'];\n if (console && console.log) {\n console.log(...
I seldom use inheritance, but when I do, I never use protected attributes because I think it breaks the encapsulation of the inherited classes. Do you use protected attributes ? what do you use them for ?
The use of protected attributes in object-oriented programming (OOP) can be a topic of debate among developers, and opinions often vary. Here's a breakdown of the considerations around using protected attributes: ### What Are Protected Attributes? Protected attributes are class members that can be accessed within the...
8,471
[ { "from": "human", "value": "I seldom use inheritance, but when I do, I never use protected attributes because I think it breaks the encapsulation of the inherited classes.\nDo you use protected attributes ? what do you use them for ?\n" }, { "from": "gpt", "value": "The use of protected attribu...
I have an issue with trying to keep AR finders DRY in my application. I have created a blogging application which fetches all the related pages,posts,links,tags and categories for a blog when a user first views it. A sample show action for the Blog controller is shown below: def show #find blog by user name @us...
To make your Rails controller action more DRY, you can refactor the logic that populates your instance variables into a method that can be reused across actions within the controller. This approach avoids duplication of code and keeps your actions clean. Here’s one way to refactor your `show` action: 1. **Create a Pr...
22,874
[ { "from": "human", "value": "I have an issue with trying to keep AR finders DRY in my application. I have created a blogging application which fetches all the related pages,posts,links,tags and categories for a blog when a user first views it. A sample show action for the Blog controller is shown below:\nde...
There are many tools out there for writing and managing requirements, but are there any good ones for reviewing them? I'm not talking about managing reviews, but automation tools that look for common requirement blunders (such as using negative requirements, or ones that are worded in a way that makes testing difficu...
Yes, there are several tools and methodologies designed to assist in reviewing requirements and identifying common issues before they are distributed for wider review. Here are a few options that you might find useful: 1. **Requirements Management Tools with Validation Features**: - Some requirements management too...
21,213
[ { "from": "human", "value": "There are many tools out there for writing and managing requirements, but are there any good ones for reviewing them? \nI'm not talking about managing reviews, but automation tools that look for common requirement blunders (such as using negative requirements, or ones that are ...
I have a question regarding the two additional columns (timeCreated, timeLastUpdated) for each record that we see in many solutions. My question: Is there a better alternative? Scenario: You have a huge DB (in terms of tables, not records), and then the customer comes and asks you to add "timestamping" to 80% of your t...
Your proposed design of using a separate `TIMESTAMP` table to manage timestamps for multiple tables is an interesting approach that offers some advantages and trade-offs. Here are some considerations related to best practices, scalability, and potential challenges: ### Advantages of Separate Timestamp Table 1. **Norm...
17,770
[ { "from": "human", "value": "I have a question regarding the two additional columns (timeCreated, timeLastUpdated) for each record that we see in many solutions. My question: Is there a better alternative?\nScenario: You have a huge DB (in terms of tables, not records), and then the customer comes and asks ...
I have an application that imports large volumes of data daily, several 100 thousands records. Data comes from different sources. The data is read using C#, then bulk inserted into the database. This data is then processed: different tables are linked new tables are generated data is corrected using complicated algo...
When dealing with large volumes of data, particularly when it comes to importing, processing, and manipulating that data, there are several strategies and best practices you can implement. Here are some insights and experiences that you may find valuable: ### 1. **Batch Processing** When you're dealing with large data...
13,677
[ { "from": "human", "value": "I have an application that imports large volumes of data daily, several 100 thousands records.\nData comes from different sources. The data is read using C#, then bulk inserted into the database.\n\n\nThis data is then processed:\n\ndifferent tables are linked\nnew tables are ge...
Is there any facility of transposing rows to columns in SQL Server (it is possible in MS-Access)? I was befuddled because this facility is available in MS-Access but not in SQL Server. Is it by design that this feature has not been included in SQL Server?
In SQL Server, you can achieve the transposition of rows to columns (and vice versa) by using the `PIVOT` function or by using conditional aggregation. While SQL Server doesn't have a built-in feature that allows for direct transposition like MS Access, it provides powerful SQL capabilities to accomplish the same resul...
24,445
[ { "from": "human", "value": "Is there any facility of transposing rows to columns in SQL Server (it is possible in MS-Access)? \nI was befuddled because this facility is available in MS-Access but not in SQL Server. Is it by design that this feature has not been included in SQL Server?\n" }, { "from...
I'm on OS X 10.5.5 (though it does not matter much I guess) I have a set of text files with fancy characters like double backquotes, ellipsises ("...") in one character etc. I need to convert these files to good old plain 7-bit ASCII, preferably without losing character meaning (that is, convert those ellipses to thre...
You can use a combination of `iconv`, `sed`, and `tr` commands in the terminal to convert your files to plain 7-bit ASCII while replacing fancy characters with their closest ASCII equivalents. Here's a simple approach using `sed` to handle the character replacements. First, you'll need to create a script or a one-line...
20,735
[ { "from": "human", "value": "I'm on OS X 10.5.5 (though it does not matter much I guess)\nI have a set of text files with fancy characters like double backquotes, ellipsises (\"...\") in one character etc. \nI need to convert these files to good old plain 7-bit ASCII, preferably without losing character mea...
I'm playing around with the locale and I18N stuff in c++ and have been looking for real world examples. I've read through the Josuttis chapter on I18N in his book (2nd Edition for C++11 to be released April 2012), and found it useful but with no real world examples to draw from I've no idea if I'm following best practi...
You're correct in your observations regarding the handling of internationalization (I18N) and localization (L10N) in C++. The standard library indeed provides limited support for Unicode and internationalization features. Below are some resources, best practices, libraries, and recommendations for working with I18N in ...
19,535
[ { "from": "human", "value": "I'm playing around with the locale and I18N stuff in c++ and have been looking for real world examples. I've read through the Josuttis chapter on I18N in his book (2nd Edition for C++11 to be released April 2012), and found it useful but with no real world examples to draw from ...
I need to round a value up to the nearest multiple of 2.5. For example: 6 --> 7.5 7.6 --> 10 etc. This seems like the best way to do this? Function RoundToIncrement(ByVal originalNumber As Decimal, ByVal increment As Decimal) As Decimal Dim num = Math.Round(originalNumber / increment, MidpointRounding.Awa...
The function you've provided for rounding up to the nearest multiple of an increment (in this case, 2.5) has a solid structure, but there are a few adjustments that need to be made to ensure that it always rounds **up** correctly, even if the original number is already a multiple of the increment. To round **up** to ...
23,591
[ { "from": "human", "value": "I need to round a value up to the nearest multiple of 2.5.\nFor example:\n6 --> 7.5\n7.6 --> 10\netc. \nThis seems like the best way to do this?\n Function RoundToIncrement(ByVal originalNumber As Decimal, ByVal increment As Decimal) As Decimal\n\n Dim num = Math.Round...
Am looking for commercial/free recommended c# winform controls packs
There are several commercial and free control libraries for WinForms that you can use in your C# projects. Here are some recommendations: ### Free Control Libraries 1. **ComponentOne Studio for WinForms (Community Edition)** - A free version of ComponentOne Studio that offers various controls, including grids, cha...
18,090
[ { "from": "human", "value": "Am looking for commercial/free recommended c# winform controls packs\n" }, { "from": "gpt", "value": "There are several commercial and free control libraries for WinForms that you can use in your C# projects. Here are some recommendations:\n\n### Free Control Librari...
I'm trying to use the page-break-inside CSS directive, the class of which is to be attached to a div tag or a table tag (I think this may only work on block elements, in which case it would have to be the table). I've tried all the tutorials that supposedly describe exactly how to do this, but nothing works. Is this an...
The `page-break-inside` CSS property is indeed intended to help control how elements break when printing a document. You are correct that it can be applied to block-level elements, including `<div>` and `<table>`. However, there are some considerations regarding browser support and how effectively the property works. ...
21,112
[ { "from": "human", "value": "I'm trying to use the page-break-inside CSS directive, the class of which is to be attached to a div tag or a table tag (I think this may only work on block elements, in which case it would have to be the table).\nI've tried all the tutorials that supposedly describe exactly how...
I have an activex object I loaded into an html page. I then use that activex object to create another object, but I need to register an event with the new object created. The object is expecting an event listener of a certain type. I can load this same dll in c# and it will work fine. Code looks like this for c#. upl...
When working with ActiveX objects in JavaScript, registering event handlers can differ from how it's done in C#. The error you're encountering suggests that the event you're trying to attach to is not being recognized as a standard JavaScript event, which is common with ActiveX objects. In ActiveX, events are typicall...
21,141
[ { "from": "human", "value": "I have an activex object I loaded into an html page. I then use that activex object to create another object, but I need to register an event with the new object created. The object is expecting an event listener of a certain type.\nI can load this same dll in c# and it will w...
What is the best way to overwrite a specific line in a file? I basically want to search a file for the string '@parsethis' and overwrite the rest of that line with something else.
To overwrite a specific line in a file based on a search string (in your case, `@parsethis`), you can follow these steps in Python. This method involves reading the file, modifying the content as needed, and then writing it back to the file. Here's an example of how to do this: ```python # Define the filename and the ...
23,966
[ { "from": "human", "value": "What is the best way to overwrite a specific line in a file? I basically want to search a file for the string '@parsethis' and overwrite the rest of that line with something else.\n" }, { "from": "gpt", "value": "To overwrite a specific line in a file based on a sear...
I have recently come across a situation where code is dynamically loading some libraries, wiring them up, then calling what is termed the "application entry point" (one of the libraries must implement IApplication.Run()). Is this a valid "Appliation entry point"? I would always have considered the application entry po...
The concept of an "application entry point" can vary depending on the context, the programming language, and the architectural patterns being employed. In many conventional applications, the entry point is typically where the execution starts. In C# and other .NET languages, for instance, the entry point is defined a...
22,811
[ { "from": "human", "value": "I have recently come across a situation where code is dynamically loading some libraries, wiring them up, then calling what is termed the \"application entry point\" (one of the libraries must implement IApplication.Run()).\nIs this a valid \"Appliation entry point\"? \nI would ...
I need to implement an audit trail for Add/Edit/Delete on my objects,I'm using an ORM (XPO) for defining my objects etc. I implemented an audit trail object that is triggered on OnSaving OnDeleting Of the base object, and I store the changes in Audit-AuditTrail (Mast-Det) table, for field changes. etc. using some m...
Implementing an audit trail in an OOP environment using an ORM like XPO (eXpress Persistent Objects) can be quite effective for tracking changes made to your objects. Here are some insights and best practices for implementing an audit trail, as well as addressing your concern about disabling it during unit testing. ##...
16,116
[ { "from": "human", "value": "I need to implement an audit trail for Add/Edit/Delete on my objects,I'm using an ORM (XPO) for defining my objects etc. I implemented an audit trail object that is triggered on \n\nOnSaving \nOnDeleting\n\nOf the base object, and I store the changes in Audit-AuditTrail (Mast-De...
I'm generating an Eclipse update site and I'm trying to give it a label so that when it appears in a user's sites list, it would appear as a name (e.g., "Ganymede project") rather than as a URL. I haven't been able to find any parameter for it in the PDE or site.xml The only thing that I've seen is to let it generate a...
To set a label for your Eclipse update site that appears in the user's sites list, you can use the `site.xml` file for your update site. In this file, you can provide a `<name>` element that specifies the display name for your update site. Here’s how to properly set it up: 1. In the root directory of your update site...
22,054
[ { "from": "human", "value": "I'm generating an Eclipse update site and I'm trying to give it a label so that when it appears in a user's sites list, it would appear as a name (e.g., \"Ganymede project\") rather than as a URL.\nI haven't been able to find any parameter for it in the PDE or site.xml\nThe only...
I have faced this problem quite often during the last couple of months, during which I've been building this system. The scenario is this: I have this kind of object that essentially is a list of other objects, but has some other properties specific of its nature. For example: Class Tests: Contains many Test objects...
This is a common design question, and you're right to consider both inheritance and composition as they relate to object-oriented design principles. Both approaches have their merits, but generally, composition is preferred over inheritance in this scenario for several reasons. ### Composition vs. Inheritance 1. **Si...
22,534
[ { "from": "human", "value": "I have faced this problem quite often during the last couple of months, during which I've been building this system. The scenario is this: I have this kind of object that essentially is a list of other objects, but has some other properties specific of its nature. For example:\n...
I am using ASP.NET 2.0 with AJAX Extensions (1.0?) and am wondering if it is possible to call a method asynchronously and have the results populate on the page after it has been loaded. I have a gridview that is populated by a fairly long-running SQL query. I would prefer to have the page come up and the results trickl...
In ASP.NET 2.0 with AJAX Extensions, you can achieve asynchronous behavior using the `UpdatePanel` and `AsyncPostBackTrigger`. This allows you to update parts of your page without a full page refresh, providing a smoother user experience. Here’s how you can set it up to populate your `GridView` with results from a lon...
13,866
[ { "from": "human", "value": "I am using ASP.NET 2.0 with AJAX Extensions (1.0?) and am wondering if it is possible to call a method asynchronously and have the results populate on the page after it has been loaded.\nI have a gridview that is populated by a fairly long-running SQL query. I would prefer to ha...
I have a simple C++ DLL that implements a few custom actions for a WiX installer. Debugging the custom actions is usually simple: put up a temporary dialog box at the beginning of the action, and attach to the process when the dialog box appears. But today, whenever I attach to the process, I get the "Microsoft Visual ...
The "Microsoft Visual Studio is Busy" message typically occurs when Visual Studio is waiting for some operation to complete or is processing another task that is blocking it from responding to your current action. Here are some potential causes and suggestions to resolve this issue: 1. **Check for Long-running Operati...
22,246
[ { "from": "human", "value": "I have a simple C++ DLL that implements a few custom actions for a WiX installer.\nDebugging the custom actions is usually simple: put up a temporary dialog box at the beginning of the action, and attach to the process when the dialog box appears.\nBut today, whenever I attach t...
I am presently running several websites and a mail server from my home network. I have a business DSL account with 8 public IP addresses (1 by itself, and 7 in a block). To handle routing/firewall/gateway, I am presently using RRAS, DNS, & DHCP from Windows 2003 running on a ancient (circa 2001) PC -- which I suspect...
Transitioning from an aging Windows 2003 PC to a more modern solution for managing your home network, especially with multiple public IPs, is a smart move. Let's address your questions one by one: ### 1. Can this be done with a standard Linksys router? Most consumer-grade routers, including Linksys models, typically ...
18,298
[ { "from": "human", "value": "I am presently running several websites and a mail server from my home network. I have a business DSL account with 8 public IP addresses (1 by itself, and 7 in a block). To handle routing/firewall/gateway, I am presently using RRAS, DNS, & DHCP from Windows 2003 running on a a...