instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I believe the simplest way to request data from a server in XML format is to have a PHP/JSP/ASP.net page which actually generates XML based on HTTP GET params, and to somehow call/load this page from Flex. How exactly can this be achieved using the Flex library classes?
To request data from a server in XML format using Adobe Flex, you can use the `URLLoader` class, which is designed to load data from a URL. Below is a step-by-step guide on how to achieve this: 1. **Set Up Your Server-Side Script**: First, create a server-side script (PHP, JSP, ASP.NET) that generates XML data base...
27,660
[ { "from": "human", "value": "I believe the simplest way to request data from a server in XML format is to have a PHP/JSP/ASP.net page which actually generates XML based on HTTP GET params, and to somehow call/load this page from Flex.\nHow exactly can this be achieved using the Flex library classes?\n" },...
How do I put a gridview row in edit mode programmatically?
To put a GridView row in edit mode programmatically in ASP.NET, you typically follow these steps: 1. Find the specific row you want to edit. 2. Call the `EditIndex` property of the GridView to specify which row should be edited. 3. Rebind the data to the GridView to reflect the edit mode. Here’s an example that demon...
29,922
[ { "from": "human", "value": "How do I put a gridview row in edit mode programmatically?\n" }, { "from": "gpt", "value": "To put a GridView row in edit mode programmatically in ASP.NET, you typically follow these steps:\n\n1. Find the specific row you want to edit.\n2. Call the `EditIndex` proper...
I want to point several domain names to the same Rails application. The content is different for each domain, but the functionality and the structure of the application is the same. What is the best way to do this when it comes to server set up and routing? I will use nginx as a web server.
To set up multiple domain names pointing to the same Rails application, where the content is different for each domain but the application's functionality and structure remain the same, you can follow these steps: ### 1. Nginx Configuration You need to configure Nginx to handle requests for multiple domains. You can ...
25,540
[ { "from": "human", "value": "I want to point several domain names to the same Rails application. The content is different for each domain, but the functionality and the structure of the application is the same. \nWhat is the best way to do this when it comes to server set up and routing? I will use nginx as...
My organization's main project went live on Monday. That was my third day here. Now that I've been here almost a week, I'm tasked with creating a change management plan for the maintenance of the application and preparation for phase 2, which will commence "someday." We're a Microsoft shop but open-minded. I'm looking ...
Creating an effective change management (CM) plan, even for a smaller project, is critical for ensuring that the application remains reliable and meets user needs as it evolves. Here are some suggestions on CM techniques, processes, and tools that can fit your context: ### Change Management Techniques 1. **Baseline C...
26,091
[ { "from": "human", "value": "My organization's main project went live on Monday. That was my third day here. Now that I've been here almost a week, I'm tasked with creating a change management plan for the maintenance of the application and preparation for phase 2, which will commence \"someday.\" We're a M...
Under Windows Server 2003, Enterprise Edition, SP2 (/3GB switch not enabled) As I understand it, and I may be wrong, the maximum addressable memory for a process is 4GB. Is that 2GB of private bytes and 2GB of virtual bytes? Do you get "out of memory" errors when the private byte limit or virtual byte limit is reache...
In a 32-bit Windows environment like Windows Server 2003 (without the /3GB switch enabled), the memory addressing for processes operates under certain limits: 1. **Addressable Memory**: Each process can address up to 4GB of virtual memory. However, the way this memory is divided depends on whether the /3GB switch is e...
29,304
[ { "from": "human", "value": "Under Windows Server 2003, Enterprise Edition, SP2 (/3GB switch not enabled)\nAs I understand it, and I may be wrong, the maximum addressable memory for a process is 4GB. \nIs that 2GB of private bytes and 2GB of virtual bytes? \nDo you get \"out of memory\" errors when the priv...
What are your opinions (as users as well as developers) on begware that e.g. at the start screen or intermittently shows a modal dialog for x seconds? What about other methods of getting the user to pay (or send you a postcard or any other kind of appreciation) instead of using the trail version?
As both a user and a developer, the concept of "begware"—software that prompts users for payment or donations through intrusive or persistent messages—can be viewed from multiple angles. Here are some considerations for both perspectives: ### User Perspective 1. **User Experience**: Users generally dislike intrusive ...
28,331
[ { "from": "human", "value": "What are your opinions (as users as well as developers) on begware that e.g. at the start screen or intermittently shows a modal dialog for x seconds? What about other methods of getting the user to pay (or send you a postcard or any other kind of appreciation) instead of using ...
I have a mockup layout for something here. Essentially there are sections, columns and fields, which are all written as a combination of <ul> and <li> elements. This is done specifically for later parsing. A snippet of the HTML: <li class="layout"><span class="type">[Column] </span> <ul class="layout-children"> ...
To arrange the columns beside each other using CSS, you can leverage Flexbox or CSS Grid. Since you prefer not to change the HTML structure, we can use Flexbox to achieve this. Below are the CSS styles you can apply: ### Using Flexbox You can apply the following CSS styles to the `.layout` elements to make them displ...
26,525
[ { "from": "human", "value": "I have a mockup layout for something here. Essentially there are sections, columns and fields, which are all written as a combination of <ul> and <li> elements. This is done specifically for later parsing. \nA snippet of the HTML:\n<li class=\"layout\"><span class=\"type\">[Colu...
<?php function toconv(string) { $gogo = array("a" => "b","cd" => "e"); $string = str_replace( array_keys( $gogo ), array_values( $gogo ), $string ); return $string; } ?> How can I implement that in JavaScript?
You can implement the PHP function in JavaScript by defining a similar function that utilizes an object for the replacements. Here's how you can do it: ```javascript function toconv(string) { const gogo = { "a": "b", "cd": "e" }; // Replace the keys in the string with their corresponding v...
28,054
[ { "from": "human", "value": "<?php\nfunction toconv(string)\n{\n $gogo = array(\"a\" => \"b\",\"cd\" => \"e\");\n $string = str_replace(\n array_keys( $gogo ),\n array_values( $gogo ),\n $string\n );\n return $string;\n}\n?>\n\nHow can I implement that in JavaScript?\n" },...
At the moment I have a console application. I would like to be able to exit the application, update through svn, recompile and then relaunch. This is running under a Linux environment. At the moment I'm not sure how I would be able to relaunch the application. Is there a way to do this?
Yes, there are several ways you can achieve this on a Linux environment. Below are some methods to automate the process of exiting your console application, updating through SVN, recompiling, and then relaunching the application. ### Option 1: Shell Script You can write a shell script to automate the process. Here’s ...
26,193
[ { "from": "human", "value": "At the moment I have a console application. I would like to be able to exit the application, update through svn, recompile and then relaunch. This is running under a Linux environment. At the moment I'm not sure how I would be able to relaunch the application. Is there a way...
Possible Duplicate: When will C++0x be finished? What are the latest news about C++0X? (or should I say C++1X) Any release date decided yet?
C++11, which was previously referred to as C++0x (as it was expected to be released in the 200x years), was officially released in 2011. Since then, it has become the standard for C++, incorporating many new features and improvements over the previous versions. If you're looking for information about the newer standar...
32,698
[ { "from": "human", "value": "\nPossible Duplicate:\nWhen will C++0x be finished? \n\nWhat are the latest news about C++0X? (or should I say C++1X) Any release date decided yet?\n" }, { "from": "gpt", "value": "C++11, which was previously referred to as C++0x (as it was expected to be released in...
I've been looking for a simple regex for URLs, does anybody have one handy that works well? I didn't find one with the zend framework validation classes and have seen several implementations.
Regular expressions (regex) for matching URLs can vary in complexity depending on what you want to allow or disallow. Here's a relatively simple regex that captures most common URLs: ```regex \bhttps?:\/\/[^\s/$.?#].[^\s]*\b ``` ### Explanation: - `\b`: Asserts a word boundary, ensuring we're matching a full URL and ...
28,853
[ { "from": "human", "value": "I've been looking for a simple regex for URLs, does anybody have one handy that works well? I didn't find one with the zend framework validation classes and have seen several implementations.\n" }, { "from": "gpt", "value": "Regular expressions (regex) for matching ...
I'm after some good tips for fluent interfaces in C#. I'm just learning about it myself but keen to hear what others think outside of the articles I am reading. In particular I'm after: when is fluent too much? are there any fluent patterns? what is in C# that makes fluent interfaces more fluent (e.g. extension method...
### Tip 1: When is Fluent Too Much? Fluency can enhance readability, but it can also lead to complexity if taken too far. A fluent interface becomes "too much" when: - **Excessive Chaining**: If a method chain becomes too long or complex, it can become difficult to understand at a glance. Aim for 3-4 method calls in ...
32,201
[ { "from": "human", "value": "I'm after some good tips for fluent interfaces in C#. I'm just learning about it myself but keen to hear what others think outside of the articles I am reading. In particular I'm after:\n\nwhen is fluent too much?\nare there any fluent patterns?\nwhat is in C# that makes fluent ...
I develop and maintain small intranet web apps(JSP and Resin). Some users takes so much time to complete the forms that, when they submit, they lose all their input data because of session timeout. Currently I prolonged session timeout to 30 minutes and display count-down clock till session timeout on top of the page...
To improve user experience and prevent data loss due to session timeouts, you can implement several strategies that ensure the integrity of the user's input. Here are some best practices that you can consider for your intranet web apps: ### 1. **Auto-Save Feature** Implement an auto-save feature that periodically save...
25,962
[ { "from": "human", "value": "I develop and maintain small intranet web apps(JSP and Resin).\nSome users takes so much time to complete the forms that,\nwhen they submit, they lose all their input data because of session timeout.\nCurrently I prolonged session timeout to 30 minutes and\n display count-down c...
I'm using autotools to build a shared object. Using pkglib_LTLIBRARIES in my Makefile.am causes a libtest.la AND libtest.so to be built. I only want it to build/install libtest.so. Is this possible?
Yes, it is possible to configure your Autotools setup to only build and install the shared object (`libtest.so`) without creating the `libtest.la` file. However, it’s important to clarify that `.la` files are associated with the Libtool and are used as convenience libraries for linking. If your intention is to build o...
26,908
[ { "from": "human", "value": "I'm using autotools to build a shared object. \nUsing pkglib_LTLIBRARIES in my Makefile.am causes a libtest.la AND libtest.so to be built.\nI only want it to build/install libtest.so.\nIs this possible?\n" }, { "from": "gpt", "value": "Yes, it is possible to configu...
Reading up the new Vista/Win2008 features, I wonder what is the point of the Thread Ordering Service. In other words, in which scenario the "classic" scheduler's "fair to all" policy is not sufficient, and a definite order of threads is preferrable? To clarify. What would be a concrete application that would benefit fr...
The Thread Ordering Service (TOS) introduced in Windows Vista/Windows Server 2008 is designed to provide a way to order the execution of threads in a way that can be beneficial for certain types of applications, particularly those that have specific inter-thread dependencies or require coordination between threads. The...
26,532
[ { "from": "human", "value": "Reading up the new Vista/Win2008 features, I wonder what is the point of the Thread Ordering Service. In other words, in which scenario the \"classic\" scheduler's \"fair to all\" policy is not sufficient, and a definite order of threads is preferrable?\nTo clarify. What would b...
I would like to monitor the following system information in Java: Current CPU usage** (percent) Available memory* (free/total) Available disk space (free/total) *Note that I mean overall memory available to the whole system, not just the JVM. I'm looking for a cross-platform solution (Linux, Mac, and Windows) that do...
To monitor system information like CPU usage, available memory, and available disk space in a cross-platform manner using Java, your approach leveraging the Java Management Extensions (JMX) is a solid choice. Here’s a breakdown of how to implement this and a few recommendations based on your preferences: ### Using the...
14,415
[ { "from": "human", "value": "I would like to monitor the following system information in Java:\n\nCurrent CPU usage** (percent)\nAvailable memory* (free/total)\nAvailable disk space (free/total)\n*Note that I mean overall memory available to the whole system, not just the JVM.\n\nI'm looking for a cross-pla...
I have not had to mess with mailto links much. However I now need to add a link in the body of a mailto if it is possible. Is there a way to add a link or to change the email opened to an html email vs a text email? Something like: <a href="mailto:test@test.test?body=The message's first paragraph.%0A%0aSecond paragr...
Mailto links are designed to open the user's default email client with predefined fields such as the recipient's email, subject, and body of the email. However, when it comes to including HTML content (like links) in the body of a mailto link, there are limitations. 1. **Plain Text Only**: The body of a mailto link ca...
29,563
[ { "from": "human", "value": "I have not had to mess with mailto links much. However I now need to add a link in the body of a mailto if it is possible. \nIs there a way to add a link or to change the email opened to an html email vs a text email?\nSomething like:\n<a href=\"mailto:test@test.test?body=The ...
Problem: Ajax suggest-search on [n] ingredients in recipes. That is: match recipes against multiple ingredients. For instance: SELECT Recipes using "flower", "salt" would produce: "Pizza", "Bread", "Saltwater" and so forth. Tables: Ingredients [ IngredientsID INT [PK], IngredientsName VARCHAR ] Recipes [ R...
To optimize your SQL query for searching recipes that contain specific ingredients while minimizing the need to handle logic in your code, you can consider a few approaches. Here’s a breakdown of how to achieve this: ### Option 1: Use a Stored Procedure Creating a stored procedure allows you to encapsulate the logic ...
12,441
[ { "from": "human", "value": "Problem:\nAjax suggest-search on [n] ingredients in recipes. That is: match recipes against multiple ingredients.\nFor instance: SELECT Recipes using \"flower\", \"salt\" would produce: \"Pizza\", \"Bread\", \"Saltwater\" and so forth.\nTables:\nIngredients [\n IngredientsID ...
Currently, I'm using: DataTable dt = CreateDataTableInSomeWay(); List<DataRow> list = new List<DataRow>(); foreach (DataRow dr in dt.Rows) { list.Add(dr); } Is there a better/magic way?
Yes, you can simplify the process of converting a `DataTable`'s rows to a `List<DataRow>` using LINQ, which provides a more concise and expressive way to achieve the same result. Here's how you can do it: ```csharp using System.Linq; // Assume dt is already created and populated DataTable dt = CreateDataTableInSomeWa...
32,814
[ { "from": "human", "value": "Currently, I'm using:\nDataTable dt = CreateDataTableInSomeWay();\n\nList<DataRow> list = new List<DataRow>(); \nforeach (DataRow dr in dt.Rows)\n{\n list.Add(dr);\n}\n\nIs there a better/magic way?\n" }, { "from": "gpt", "value": "Yes, you can simplify the proces...
I'd like to receive error logs via email. For example, if a Warning-level error message should occur, I'd like to get an email about it. How can I get that working in CodeIgniter?
To receive error logs via email in CodeIgniter, you can implement a custom logging mechanism that sends an email whenever a specific log level, such as a Warning-level message, is triggered. Here’s a step-by-step guide to achieving this: ### Step 1: Set up Email Configuration First, you need to configure email settin...
27,583
[ { "from": "human", "value": "I'd like to receive error logs via email. For example, if a Warning-level error message should occur, I'd like to get an email about it.\nHow can I get that working in CodeIgniter?\n" }, { "from": "gpt", "value": "To receive error logs via email in CodeIgniter, you c...
Looking for links to resources that will help me write a user guide for a software application. I'm after something that will help me to structure my guide, give it an appropriate writing style, and ensure that it has an excellent look and feel throughout.
Creating a user guide for a software application can be a rewarding task, but it does require careful planning and attention to detail. Here are some resources that can help you structure your guide, develop an appropriate writing style, and enhance its visual appeal: ### Structuring Your User Guide 1. **Microsoft Wr...
24,669
[ { "from": "human", "value": "Looking for links to resources that will help me write a user guide for a software application. I'm after something that will help me to structure my guide, give it an appropriate writing style, and ensure that it has an excellent look and feel throughout. \n" }, { "from...
I'm looking to move some of my lighter weight metaprogramming from Nemerle to Boo and I'm trying to figure out how to define custom operators. For example, I can do the following in Nemerle: macro @<-(func, v) { <[ $func($v) ]> } Then these two are equivalent: foo <- 5; foo(5); I can't find a way of doing this i...
In Boo, you can't define custom operators in the same way as you would in Nemerle with macros. However, you can achieve similar functionality using method overloads or by defining extension methods. Boo supports a flexible syntax that allows you to create functions that can be called in a manner resembling operator u...
30,072
[ { "from": "human", "value": "I'm looking to move some of my lighter weight metaprogramming from Nemerle to Boo and I'm trying to figure out how to define custom operators. For example, I can do the following in Nemerle:\nmacro @<-(func, v) {\n <[ $func($v) ]>\n}\n\nThen these two are equivalent:\nfoo <-...
I usually never see test for new in C++ and I was wondering why. Foo *f = new Foo; // f is assumed as allocated, why usually, nobody test the return of new?
In C++, when you use the `new` operator to allocate memory for an object, it can throw an exception on failure (typically, `std::bad_alloc`) if it cannot allocate the requested memory. This behavior is different from languages like C, where memory allocation functions like `malloc` return `NULL` on failure. Here's a b...
28,075
[ { "from": "human", "value": "I usually never see test for new in C++ and I was wondering why.\nFoo *f = new Foo;\n// f is assumed as allocated, why usually, nobody test the return of new?\n" }, { "from": "gpt", "value": "In C++, when you use the `new` operator to allocate memory for an object, i...
We have a POST to a PL/SQL database procedure that (a) does some database operations based on the POST parameters and (b) redirects the user to a page showing the results. The problem is, when the user does a browser "refresh" of the results page, that still has the original request, so it calls the database procedure ...
Yes, you can handle this scenario effectively to prevent the "Refresh" issue in the browser by using the **Post/Redirect/Get (PRG)** pattern. This pattern separates the HTTP POST request from the following GET request that displays the result, ensuring that refreshing the results page won't trigger the same database op...
27,629
[ { "from": "human", "value": "We have a POST to a PL/SQL database procedure that (a) does some database operations based on the POST parameters and (b) redirects the user to a page showing the results.\nThe problem is, when the user does a browser \"refresh\" of the results page, that still has the original ...
I'm applying for a masters in fall of next year and was wondering if anyone had suggestions for interesting/challenging master's degrees in CS. I think that even though picking the right university is important, it is even more important to pick a master's degree where you'll find talented/creative people to interact a...
Based on your interests and background, there are several Master's programs in Computer Science (CS) that could be a good fit for you. It sounds like you want to focus on Human-Computer Interaction (HCI), mobile technology, and applications that bridge technology with creative fields like music, art, and design. Here a...
28,187
[ { "from": "human", "value": "I'm applying for a masters in fall of next year and was wondering if anyone had suggestions for interesting/challenging master's degrees in CS. I think that even though picking the right university is important, it is even more important to pick a master's degree where you'll fi...
I have a polling service that checks a directory for new files, if there is a new file I call SSIS. There are instances where I can't have SSIS run if another instance of SSIS is already processing another file. How can I make SSIS run sequentially during these situations? Note: parallel SSIS's running is fine in some ...
To manage the execution of SSIS packages so that some instances run in parallel while others must run sequentially based on specific conditions, you can implement a combination of a locking mechanism and a control system that allows for flexibility. Here's a general approach you could take: ### Step 1: Define a Locki...
24,640
[ { "from": "human", "value": "I have a polling service that checks a directory for new files, if there is a new file I call SSIS.\nThere are instances where I can't have SSIS run if another instance of SSIS is already processing another file.\nHow can I make SSIS run sequentially during these situations?\nNo...
I have two combos; provinces and cities. I would like to change cities value when the province combo value changes. Here is my code <div class="cities form"> <?php $v = $ajax->remoteFunction(array('url' => '/cities/','update' => 'divcity')); print $form-> input('Province.province_id', array('type' => 'select', ...
To achieve the functionality of updating the city dropdown based on the selected province, you'll need to ensure that the JavaScript (AJAX) request properly retrieves the cities related to the selected province and updates the city dropdown accordingly. Below is a revised version of your code, including the necessary A...
25,096
[ { "from": "human", "value": "I have two combos; provinces and cities.\nI would like to change cities value when the province combo value changes. Here is my code\n<div class=\"cities form\">\n<?php\n $v = $ajax->remoteFunction(array('url' => '/cities/','update' => 'divcity'));\n print $form-> input('P...
The explorer control in Windows Vista is very handy and I would like to be able to incorporate it in an application written in WPF. I've been unable to find a stock control that is part of the Framework. This application is being specifically developed for Windows Vista and therefore, having the same look and feel as t...
If you're looking to incorporate an Explorer-style control in a WPF application and want it to match the Windows Vista look and feel, you have a few options to consider, even though there isn't a built-in WPF control that directly mimics the Windows Explorer. ### Options: 1. **Windows API (COM Interop)**: You can...
27,379
[ { "from": "human", "value": "The explorer control in Windows Vista is very handy and I would like to be able to incorporate it in an application written in WPF. I've been unable to find a stock control that is part of the Framework. This application is being specifically developed for Windows Vista and ther...
I have a thread running in the background that is reading events from an input device in a blocking fashion, now when I exit the application I want to clean up the thread properly, but I can't just run a pthread_join() because the thread would never exit due to the blocking IO. How do I properly solve that situation? S...
To properly handle a blocking I/O in a thread without leaving the thread hanging when you want to exit your application, the best approach is to design a mechanism to signal the thread to stop gracefully. Instead of using `pthread_kill()` with signals like `SIGIO` or `SIGALRM`, which can lead to undefined behavior when...
26,739
[ { "from": "human", "value": "I have a thread running in the background that is reading events from an input device in a blocking fashion, now when I exit the application I want to clean up the thread properly, but I can't just run a pthread_join() because the thread would never exit due to the blocking IO.\...
I'm a newbie to swing development. I have a swing app that needs to access data from a remote sql database. The users of the app are all located in our office. Is it bad practice to access the database directly from the swing app? Should I put database facing code into an rmi server?
Accessing a remote SQL database directly from a Swing application can work, but it typically isn't considered best practice for several reasons. Here are some considerations and recommendations: ### Reasons Against Direct Database Access from Swing Apps 1. **Security**: - If the Swing application connects directly...
30,151
[ { "from": "human", "value": "I'm a newbie to swing development.\nI have a swing app that needs to access data from a remote sql database. The users of the app are all located in our office.\nIs it bad practice to access the database directly from the swing app? \nShould I put database facing code into an rm...
I am writing a program that will be emailing reports out many (~100) clients which I want to test before I spam everyone. I want to do a test run against my production data and actually send the messages to a SMTP server, but I don't want the SMTP server to actually deliver the messages. I want the server to act like ...
For testing your email delivery without actually sending emails to real recipients, you have several options. Here are a few SMTP servers specifically designed for testing purposes: ### 1. **MailHog** MailHog is a simple SMTP server for testing email sending. It catches emails sent to it and provides a web interface t...
28,370
[ { "from": "human", "value": "I am writing a program that will be emailing reports out many (~100) clients which I want to test before I spam everyone.\nI want to do a test run against my production data and actually send the messages to a SMTP server, but I don't want the SMTP server to actually deliver the...
I am working on a business problem in C#.NET. I have two classes, named C and W that will be instantiated independently at different times. An object of class C needs to contain references to 0 ... n objects of class W, i.e. a C object can contain up to n W objects. Each W object needs to contain a reference to exactl...
Your initial approach using a bidirectional relationship between classes `C` and `W` is a valid and common design pattern in object-oriented programming. However, as you've mentioned, managing the references and their validity could become complicated, especially when dealing with refreshes or updates. Here are a few ...
26,302
[ { "from": "human", "value": "I am working on a business problem in C#.NET. I have two classes, named C and W that will be instantiated independently at different times.\nAn object of class C needs to contain references to 0 ... n objects of class W, i.e. a C object can contain up to n W objects.\nEach W ob...
We are a group of students doing our Master degree in field of computer science. This semester we should do a Software engineering project according to the following bottom explanation. we should exactly act and report as a real Software engineering Team. I have been chosen as a project manager of this group, I am good...
Managing a software engineering project as a project manager, especially with a diverse group of students, can be both exciting and challenging. Here’s a structured approach to help you manage your project effectively. ### 1. **Initial Steps** #### **Define the Project Scope** - **Understand the Requirements**: Gathe...
25,800
[ { "from": "human", "value": "We are a group of students doing our Master degree in field of computer science.\nThis semester we should do a Software engineering project according to the following bottom explanation.\nwe should exactly act and report as a real Software engineering Team.\nI have been chosen a...
I'm relatively new to Nant, what i'd like to do is have a task that creates a new Website and AppPool in IIS6 is there a way to do this in Nant? Essentially the task would need to set all the appropriate properties including the correct version of the .net Framework Ideally i'd also like to check if the site is already...
Nant is a .NET build tool that can automate various tasks, but it doesn't directly provide built-in tasks for managing IIS. However, you can achieve what you want by using the `exec` task to call command-line utilities like `aspnet_regiis.exe` and `iisweb` or using PowerShell scripts. Here’s a way you can set up a Nan...
24,347
[ { "from": "human", "value": "I'm relatively new to Nant, what i'd like to do is have a task that creates a new Website and AppPool in IIS6\nis there a way to do this in Nant?\nEssentially the task would need to set all the appropriate properties including the correct version of the .net Framework\nIdeally i...
I'm doing some searching of tags, and some users like "cat" while others like "Cat" Go figure... Anyways, is there a way to force a particular find to be case sensitive? Such as: Tag.find(:some-special-option-here) Any ideas?
In Ruby on Rails, the `find` method itself does not have built-in options for case sensitivity directly. However, you can achieve case-sensitive searches by modifying your query slightly. If you're working with ActiveRecord, you can use the `where` method with a SQL condition to perform a case-sensitive search. Here's...
30,791
[ { "from": "human", "value": "I'm doing some searching of tags, and some users like \"cat\" while others like \"Cat\" Go figure...\nAnyways, is there a way to force a particular find to be case sensitive? Such as:\nTag.find(:some-special-option-here)\n\nAny ideas?\n" }, { "from": "gpt", "value"...
I've got a tomcat instance with several apps running on it... I want the root of my new domain to go to one of these apps (context path of blah).. so I have the following set up: <Location /> ProxyPass ajp://localhost:8025/blah ProxyPassReverse ajp://localhost:8025/blah </Location> it kinda works... going to m...
To make the application work correctly when you want to expose it at the root of your new domain without deploying it to the ROOT context or changing the Tomcat server configuration, you can use the `ProxyPass` and `ProxyPassReverse` directives in a way that ensures that the app's resources (like CSS, JS, images, etc.)...
24,448
[ { "from": "human", "value": "I've got a tomcat instance with several apps running on it... I want the root of my new domain to go to one of these apps (context path of blah).. so I have the following set up:\n<Location />\n ProxyPass ajp://localhost:8025/blah\n ProxyPassReverse ajp://localhost:8025/bl...
I need to add multiple empty divs to a container element using jQuery. At the moment I am generating a string containing the empty html using a loop divstr = '<div></div><div></div>...<div></div>'; and then injecting that into my container: $('#container').html(divstr); Is there a more elegant way to insert multiple,...
You can achieve adding multiple identical elements in a more elegant way using jQuery's `append` method in a loop, or even better, you can create a jQuery object for the div and clone it multiple times. This method is both more efficient and maintains chainability. ### Example using a loop: Here's how you can append m...
26,188
[ { "from": "human", "value": "I need to add multiple empty divs to a container element using jQuery.\nAt the moment I am generating a string containing the empty html using a loop\ndivstr = '<div></div><div></div>...<div></div>';\n\nand then injecting that into my container:\n$('#container').html(divstr);\n\...
I have the following problem in my Data Structures and Problem Solving using Java book: Write a routine that uses the Collections API to print out the items in any Collection in reverse order. Do not use a ListIterator. I'm not putting it up here because I want somebody to do my homework, I just can't seem to unders...
The problem you're facing asks you to write a method that can print the items of any type of `Collection` (like a `HashSet`, `TreeSet`, `LinkedList`, etc.) in reverse order, using Java's Collections API. ### Understanding the Requirements 1. **Routine**: In this context, a "routine" typically refers to a method that...
27,780
[ { "from": "human", "value": "I have the following problem in my Data Structures and Problem Solving using Java book:\n\nWrite a routine that uses the Collections API to print out the items in any Collection in reverse order. Do not use a ListIterator.\n\nI'm not putting it up here because I want somebody t...
Do you do automated testing on a complex workflow system like K2? We are building a system with extensive integration between Sharepoint 2007 and K2. I can't even imagine where to start with automated testing as the workflow involves multiple users interacting with Sharepoint, K2 workflows and custom web pages. Has any...
Automated testing of complex workflow systems like K2, especially when integrating with platforms like SharePoint, can indeed be challenging but is not impossible. Here are some considerations, strategies, and tools that might help you get started: ### 1. **Understand the Workflow Complexity** - **Map Out the Workf...
27,979
[ { "from": "human", "value": "Do you do automated testing on a complex workflow system like K2?\nWe are building a system with extensive integration between Sharepoint 2007 and K2. I can't even imagine where to start with automated testing as the workflow involves multiple users interacting with Sharepoint, ...
From my small amount of experience, I've only used Ant as a build tool. Are there any other projects which are better, and why?
Yes, while Apache Ant is a popular build tool, there are several other build tools and systems that may be more suitable depending on your project's needs. Here are some alternatives to consider, along with their advantages: 1. **Maven**: - **Dependency Management**: Maven provides a powerful dependency management ...
18,044
[ { "from": "human", "value": "From my small amount of experience, I've only used Ant as a build tool. Are there any other projects which are better, and why?\n" }, { "from": "gpt", "value": "Yes, while Apache Ant is a popular build tool, there are several other build tools and systems that may be...
I have been trying to explain the difference between switch statements and pattern matching(F#) to a couple of people but I haven't really been able to explain it well..most of the time they just look at me and say "so why don't you just use if..then..else". How would you explain it to them? EDIT! Thanks everyone for ...
Explaining the differences between switch statements, pattern matching (like in F#), and if-then-else constructs can be a bit tricky, but here’s a structured way to break it down: ### 1. **Basic Definitions**: - **Switch Statements**: A control structure that allows a variable to be tested for equality against a list ...
22,461
[ { "from": "human", "value": "I have been trying to explain the difference between switch statements and pattern matching(F#) to a couple of people but I haven't really been able to explain it well..most of the time they just look at me and say \"so why don't you just use if..then..else\".\nHow would you exp...
Can anyone point to some code that deals with the security of files access via a path specified (in part) by an environment variable, specifically for Unix and its variants, but Windows solutions are also of interest? This is a big long question - I'm not sure how well it fits the SO paradigm. Consider this scenario: B...
The problem you described is indeed a classic security vulnerability that arises from using environment variables to determine sensitive paths. This type of vulnerability can lead to serious issues, especially in applications that run with elevated privileges, such as setuid or setgid programs. Let's discuss potential ...
23,449
[ { "from": "human", "value": "Can anyone point to some code that deals with the security of files access via a path specified (in part) by an environment variable, specifically for Unix and its variants, but Windows solutions are also of interest?\nThis is a big long question - I'm not sure how well it fits ...
When I change the application log level to FINE, SQL Servers log also uses it, and, as consequence, I get a lot of unnecessary log messages. How can I turn off SQL Server log messages?
To control the logging behavior of SQL Server and reduce unnecessary log messages when you set your application log level to FINE, you can adjust the logging settings specifically for SQL Server. Here are a few approaches you can take: 1. **Modify the Logging Level in the Application**: If your application is loggi...
27,810
[ { "from": "human", "value": "When I change the application log level to FINE, SQL Servers log also uses it, and, as consequence, I get a lot of unnecessary log messages. How can I turn off SQL Server log messages?\n" }, { "from": "gpt", "value": "To control the logging behavior of SQL Server and...
In terms of general operating system concepts, what is the difference between a file and a record? How the OS will manage them? I know what a file is and what a record is but how it is distinguished in an OS?
In the context of operating systems and data management, both files and records are fundamental concepts, but they serve different roles in how data is organized and accessed. ### Definitions 1. **File**: - A file is a collection of data or information that is stored on a storage device (such as a hard drive, SSD,...
26,345
[ { "from": "human", "value": "In terms of general operating system concepts, what is the difference between a file and a record?\nHow the OS will manage them? I know what a file is and what a record is but how it is distinguished in an \nOS?\n" }, { "from": "gpt", "value": "In the context of oper...
I'm refactoring some PHP code and discovered that certain nested combinations of if () : and if () { generate syntax errors. Not that I would normally mix the two, but I like to do frequent syntax checks as I'm writing code and I kept getting a syntax error because of this. Example - generates syntax error: if ( $...
The syntax error you are encountering in the first block of code is due to the mixing of alternative syntax (using colons and `endif;`) with curly brace syntax in a nested structure. In PHP, when you use alternative syntax with colons (e.g., `if (condition) :`), you must use that alternative syntax consistently until ...
26,655
[ { "from": "human", "value": "I'm refactoring some PHP code and discovered that certain nested combinations of \nif () :\n\nand \nif () {\n\ngenerate syntax errors. Not that I would normally mix the two, but I like to do frequent syntax checks as I'm writing code and I kept getting a syntax error because of...
I apologize in advance for the long post... I used to be able to build our VC++ solutions (we're on VS 2008) when we listed the STLPort include and library directories under VS Menu > Tools > Options > VC++ Directories > Directories for Include and Library files. However, we wanted to transition to a build process tha...
The linker errors you're encountering (LNK2019 and LNK2001) typically indicate that the linker is unable to find the definitions for certain functions or symbols referenced in your code. This is especially common when dealing with custom libraries like STLPort, especially if you have recently transitioned your build pr...
28,094
[ { "from": "human", "value": "I apologize in advance for the long post...\nI used to be able to build our VC++ solutions (we're on VS 2008) when we listed the STLPort include and library directories under VS Menu > Tools > Options > VC++ Directories > Directories for Include and Library files. However, we w...
We have developed a webservice that sits and runs in the context of a sharepoint site. This works fine using normal windows authentication. We now have a client who wants to install this on a Kerberos enabled sharepoint site. What changes would we need to make to either the webserivce, the calling client (a windows se...
Enabling Kerberos authentication for your web service on a SharePoint site involves several steps, both in the configuration of your SharePoint environment and potentially some changes in your web service and client. Here’s a high-level overview of what you would need to do: ### 1. Configure SharePoint for Kerberos Au...
26,928
[ { "from": "human", "value": "We have developed a webservice that sits and runs in the context of a sharepoint site. This works fine using normal windows authentication.\nWe now have a client who wants to install this on a Kerberos enabled sharepoint site. What changes would we need to make to either the we...
I am currently working on two projects, and I am using Fogbugz to keep track of my cases. My question is: if I enter one month worth of estimated work for each project, will Fogbugz estimate that the ship dates for the two projects will be TWO months from now? Note: there's a discussion here but I don't know if it's st...
In FogBugz, the ship date estimation is primarily based on the total estimated work across all cases in your projects. If you enter one month of estimated work for each of your two projects, FogBugz will likely consider the total estimated work to be two months. This could lead to an estimated ship date being set to tw...
32,239
[ { "from": "human", "value": "I am currently working on two projects, and I am using Fogbugz to keep track of my cases. My question is: if I enter one month worth of estimated work for each project, will Fogbugz estimate that the ship dates for the two projects will be TWO months from now?\nNote: there's a d...
Does WPF support using a triggers that respond to routed events but only given a condition is met? For example, WPF supports triggering on routed events through Event Triggers. ie: <Button> <Button.Triggers> <EventTrigger RoutedEvent="Click"> ... </.. </.. </.. However I am looking for the trigger to...
In WPF, you can't directly combine `EventTrigger` with a condition in the way you're describing using XAML alone, because `EventTrigger` doesn't support conditions like `MultiDataTrigger` does. However, you can achieve your goal using a workaround by combining behaviors with a `Trigger` or `DataTrigger` pattern, which...
25,165
[ { "from": "human", "value": "Does WPF support using a triggers that respond to routed events but only given a condition is met?\nFor example, WPF supports triggering on routed events through Event Triggers.\nie:\n<Button>\n <Button.Triggers>\n <EventTrigger RoutedEvent=\"Click\">\n ...\n </..\n ...
Is it possible to configure Windows Servers that reside on the same domain such that when a web service call is made from a web app using an IP address, the request does not go via a proxy server? The web service is running on one of the servers on the domain. I want to configure IP based security on the server that h...
Yes, it is possible to configure Windows Servers on the same domain so that requests to a web service do not go through a proxy server, particularly when using an IP address. This setup can help you implement IP-based security for the web service. Here are several approaches you can consider to achieve this: ### 1. Co...
24,913
[ { "from": "human", "value": "Is it possible to configure Windows Servers that reside on the same domain such that when a web service call is made from a web app using an IP address, the request does not go via a proxy server?\nThe web service is running on one of the servers on the domain. \nI want to confi...
We've got products built both with GUI and CHUI. Going forward, we're looking at redesigning a lot of our software and mainly taking the route of going all GUI. My question to the group is, do we need to account for keeping a CHUI around? What are the advantages of CHUI over GUI? Many times in the past people have said...
Your considerations regarding the transition from CHUI (Character-based User Interface) to GUI (Graphical User Interface) are relevant and worthy of deeper examination. While there are several advantages to moving towards a GUI-centric approach, there are also compelling reasons to consider retaining CHUI elements or e...
27,738
[ { "from": "human", "value": "We've got products built both with GUI and CHUI. Going forward, we're looking at redesigning a lot of our software and mainly taking the route of going all GUI. My question to the group is, do we need to account for keeping a CHUI around? What are the advantages of CHUI over GUI...
I'm looking at a new project where both Native and Managed approaches sound like a good idea. This is a Windows desktop application which should support an MDI interface. The client area will make extensive use of Direct3D. The developers on the project are equally skilled on C#, C++/CLI and MFC. MFC Advantages: Doc/V...
Sure! Here are additional advantages for both the MFC and Managed Code approaches, focusing on your requirements for a Windows desktop application with an MDI interface and extensive use of Direct3D: ### MFC Advantages: - **Performance**: Native C++ code typically has better performance due to lower overhead, which ca...
27,839
[ { "from": "human", "value": "I'm looking at a new project where both Native and Managed approaches sound like a good idea. This is a Windows desktop application which should support an MDI interface. The client area will make extensive use of Direct3D. The developers on the project are equally skilled on C#...
In VIM in command line mode a "%" denotes the current file, "cword" denotes the current word under the cursor. I want to create a shortcut where I need the current line number. What is the symbol which denotes this?
In Vim, you can use the expression `line('.')` to refer to the current line number in the command line mode. If you're looking to create a shortcut or mapping to easily access the current line number, you could use the following command: ```vim :map <key> :echo line('.')<CR> ``` Replace `<key>` with your desired ke...
31,137
[ { "from": "human", "value": "In VIM in command line mode a \"%\" denotes the current file, \"cword\" denotes the current word under the cursor. I want to create a shortcut where I need the current line number. What is the symbol which denotes this?\n" }, { "from": "gpt", "value": "In Vim, you ca...
In this question, I was given a really cool answer to alternating an image and its description between left and right, respectively. Now I want to apply styling to both, e.g. padding-top, padding-bottom etc. How do I apply a style to both the RowStyle and AlternatingRowStyle in this scenario. <AlternatingRowStyle CssC...
To apply CSS styles such as padding, margin, or other properties to both the `RowStyle` and `AlternatingRowStyle` in your ASP.NET Web Forms application, you can define a common CSS class and then use that class in both styles. Here's how you can do it: 1. Define a common CSS class in your stylesheet. For example: ```...
30,458
[ { "from": "human", "value": "In this question, I was given a really cool answer to alternating an image and its description between left and right, respectively. Now I want to apply styling to both, e.g. padding-top, padding-bottom etc. How do I apply a style to both the RowStyle and AlternatingRowStyle in...
Now that Silverlight 2.0 has been officially released I was wondering if anyone was using it for any line of business apps, for example POS, Vertical Market apps etc. If so how were your experiences compared to an old WinForms app or Web app?
Silverlight 2.0, released in late 2008, provided a new framework for building rich internet applications with features such as improved graphics, better media support, and a more responsive user experience compared to traditional web applications or WinForms apps. In terms of line of business applications, including PO...
28,979
[ { "from": "human", "value": "Now that Silverlight 2.0 has been officially released I was wondering if anyone was using it for any line of business apps, for example POS, Vertical Market apps etc. If so how were your experiences compared to an old WinForms app or Web app?\n" }, { "from": "gpt", "...
I have a table of events with a recorded start and end time as a MySQL DATETIME object (in the format YYYY-MM-DD HH:MM:SS. I want to find all events that occur in a specific date range. However, events can span multiple days (and go outside of my date range, but I want to return them if they even overlap by 1 second or...
To find all events that occur in a specific date range, including those that overlap with that date range even if they span multiple days, you can use a SQL query that checks for overlapping conditions. Assuming your events table is named `events` and has columns `start_time` and `end_time`, you would typically defin...
29,797
[ { "from": "human", "value": "I have a table of events with a recorded start and end time as a MySQL DATETIME object (in the format YYYY-MM-DD HH:MM:SS. I want to find all events that occur in a specific date range. However, events can span multiple days (and go outside of my date range, but I want to return...
What is the coolest somewhat practical metaprogramming hack you've done or seen done in the D programming language? Somewhat practical means excluding, for example, the compile-time raytracer.
One interesting and somewhat practical metaprogramming hack in the D programming language is using templates to create a type-safe serialization/deserialization system. This allows for the automatic generation of code that can convert complex data structures to and from a serialized format (like JSON or binary), withou...
27,235
[ { "from": "human", "value": "What is the coolest somewhat practical metaprogramming hack you've done or seen done in the D programming language? Somewhat practical means excluding, for example, the compile-time raytracer.\n" }, { "from": "gpt", "value": "One interesting and somewhat practical m...
I have to use unsigned integers that could span to more than 4 bytes, what type should I use? PS Sorry for the "noobism" but that's it :D NB: I need integers because i have to do divisions and care only for the integer parts and this way int are useful
No problem at all! It’s great that you’re asking questions to clarify your understanding. If you need to work with unsigned integers that can span more than 4 bytes, you have a few options depending on the programming language you’re using. Here are common choices in popular languages: 1. **C/C++:** - You can use...
29,841
[ { "from": "human", "value": "I have to use unsigned integers that could span to more than 4 bytes, what type should I use?\nPS Sorry for the \"noobism\" but that's it :D\nNB: I need integers because i have to do divisions and care only for the integer parts and this way int are useful\n" }, { "from"...
I use a axis to auto-generate webservice artifacts which I then convert into objects used within our application. Is there a sensible pattern for doing this ? We have written transform methods to output our objects from the axis created objects, at other times we have written an intermediate set of transformer classes ...
When working with web service artifacts generated by frameworks like Apache Axis, it's common to encounter the challenge of mapping those generated objects to your application's domain objects. Here are some design patterns and practices you can consider to streamline this process and make it more manageable: ### 1. *...
27,852
[ { "from": "human", "value": "I use a axis to auto-generate webservice artifacts which I then convert into objects used within our application. Is there a sensible pattern for doing this ? We have written transform methods to output our objects from the axis created objects, at other times we have written an...
When I'm in the flash debugger, and I have some callbacks saved, I can see that the functions have a property named savedThis that is very usefull to know where that callback came from. I'm trying to access that property from code, but for some reason I can't. callback.savedThis throws an Error because it can't find th...
Accessing properties that are not explicitly defined in the public API of an object can be tricky, especially in a debugging context. Since you mentioned `savedThis` is only available in the Flash debugger and seems to be treated as a private property in the code, your approach to access it using `Function.prototype` m...
28,857
[ { "from": "human", "value": "When I'm in the flash debugger, and I have some callbacks saved, I can see that the functions have a property named savedThis that is very usefull to know where that callback came from.\nI'm trying to access that property from code, but for some reason I can't.\ncallback.savedTh...
I'm looking for a SharePoint (MOSS) shared hosting provider that supports deployment of custom solutions (.WSPs) - it'd be okay if it was medium trust. I'm building a public Internet site on SP and the client doesn't want to host it or pay for the license all up front. Any suggestions?
Finding a SharePoint (MOSS) shared hosting provider that allows deployment of custom solutions (.WSPs) can be challenging, especially for medium trust environments. However, there are some options you might consider: 1. **Microsoft Azure**: While not traditional shared hosting, Azure offers SharePoint as part of its s...
26,383
[ { "from": "human", "value": "I'm looking for a SharePoint (MOSS) shared hosting provider that supports deployment of custom solutions (.WSPs) - it'd be okay if it was medium trust. I'm building a public Internet site on SP and the client doesn't want to host it or pay for the license all up front. Any sugge...
My master page contains a list as shown here. What I'd like to do though, is add the "class=active" attribute to the list li thats currently active but I have no idea how to do this. I know that the code goes in the aspx page's page_load event, but no idea how to access the li I need to add the attribute. Please enligh...
To add the "class=active" attribute to the currently active `<li>` element in your ASP.NET Web Forms page, you can do this in the `Page_Load` event of your ASPX page's code-behind file. Here's a step-by-step guide on how to do this: 1. **Determine the Current Page**: You need a way to know which page is currently ac...
20,279
[ { "from": "human", "value": "My master page contains a list as shown here. What I'd like to do though, is add the \"class=active\" attribute to the list li thats currently active but I have no idea how to do this. I know that the code goes in the aspx page's page_load event, but no idea how to access the li...
Is the memory space consumed by one object with 100 attributes the same as that of 100 objects, with one attribute each? How much memory is allocated for an object? How much additional space is used when adding an attribute?
The memory space consumed by one object with 100 attributes is generally not the same as that of 100 objects, each with one attribute, due to various factors such as memory overhead, object alignment, and data structure representation. ### Memory Allocation for Objects 1. **Overhead**: Every object in a programming l...
30,577
[ { "from": "human", "value": "Is the memory space consumed by one object with 100 attributes the same as that of 100 objects, with one attribute each?\nHow much memory is allocated for an object?\nHow much additional space is used when adding an attribute?\n" }, { "from": "gpt", "value": "The mem...
I have two keyboards connected to my PC, is there any way to know what keyboard a key was pressed on in any language or framework?
Detecting which specific keyboard a key was pressed on can be quite challenging, as most operating systems do not provide a straightforward way to differentiate between multiple keyboards at a low level. However, depending on your requirements and the programming environment you are using, there are some potential appr...
22,861
[ { "from": "human", "value": "I have two keyboards connected to my PC, is there any way to know what keyboard a key was pressed on in any language or framework? \n" }, { "from": "gpt", "value": "Detecting which specific keyboard a key was pressed on can be quite challenging, as most operating sys...
Using PHP, what's the fastest way to convert a string like this: "123" to an integer? Why is that particular method the fastest? What happens if it gets unexpected input, such as "hello" or an array?
In PHP, the fastest way to convert a string like `"123"` to an integer is to use type casting. You can do this simply by prefixing the variable with `(int)` or `(integer)` like so: ```php $string = "123"; $int = (int)$string; // or (integer)$string ``` ### Why is Type Casting the Fastest? Type casting is considered ...
26,931
[ { "from": "human", "value": "Using PHP, what's the fastest way to convert a string like this: \"123\" to an integer?\nWhy is that particular method the fastest? What happens if it gets unexpected input, such as \"hello\" or an array?\n" }, { "from": "gpt", "value": "In PHP, the fastest way to co...
I was just wondering how many experienced programers out there actually map out their process or algorithms in a program like MS Visio or Gnome Dia? I am trying to code some complex PHP for my website and just seem to be missing something. Is a diagram program going to help or should I be looking in another area?
Using diagramming tools like MS Visio or Gnome Dia can indeed be helpful for visualizing complex processes or algorithms, especially when working on intricate code or architectures. Many experienced programmers utilize these tools, particularly in the early stages of a project, for several reasons: 1. **Clarity**: Dia...
29,871
[ { "from": "human", "value": "I was just wondering how many experienced programers out there actually map out their process or algorithms in a program like MS Visio or Gnome Dia? \nI am trying to code some complex PHP for my website and just seem to be missing something. Is a diagram program going to help ...
Most of Apples documentation seems to avoid using autoreleased objects especially when creating gui views, but I want to know what the cost of using autoreleased objects is? UIScrollView *timeline = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 20, 320, 34)]; [self addSubview:timeline]; [timeline release]; Ultimat...
Using autoreleased objects in Objective-C, especially in the context of GUI development with UIKit, can be a useful strategy, but it does come with some trade-offs. Here are some key considerations about the cost and usage of autoreleased objects: ### Costs of Using Autoreleased Objects 1. **Memory Management Overhea...
28,099
[ { "from": "human", "value": "Most of Apples documentation seems to avoid using autoreleased objects especially when creating gui views, but I want to know what the cost of using autoreleased objects is?\nUIScrollView *timeline = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 20, 320, 34)];\n[self addSubv...
Here's what I have on my list so far. I'd like to know of others in the same vein, perhaps more technical, perhaps less Blown to Bits: Your Life, Liberty, and Happiness After the Digital Explosion - Ableson, Leeden, and Lewis Glut: Mastering Information Through the Ages - Wright Information Rules - Varian and Shapir...
You have a great list already, covering a variety of topics in information theory, search technology, and data mining. Here are some additional book recommendations, blog suggestions, and notable papers that might align with your interests: ### Additional Book Recommendations 1. **Data Science for Business** by Foste...
24,301
[ { "from": "human", "value": "Here's what I have on my list so far. I'd like to know of others in the same vein, perhaps more technical, perhaps less \nBlown to Bits: Your Life, Liberty, and Happiness After the Digital Explosion - Ableson, Leeden, and Lewis\nGlut: Mastering Information Through the Ages - W...
I have given a location defined by latitude and longitude. Now i want to calculate a bounding box within e.g. 10 kilometers of that point. The bounding box should be defined as latmin, lngmin and latmax, lngmax. I need this stuff in order to use the panoramio API. Does someone know the formula of how to get thos points...
To calculate a bounding box around a given latitude and longitude point, defined by a distance (e.g., 10 kilometers), you can use the Haversine formula for determining distances on a sphere (which the Earth can be approximated as). However, for the bounding box, you can directly calculate the latitudinal and longitudin...
24,223
[ { "from": "human", "value": "I have given a location defined by latitude and longitude.\nNow i want to calculate a bounding box within e.g. 10 kilometers of that point.\nThe bounding box should be defined as latmin, lngmin and latmax, lngmax.\nI need this stuff in order to use the panoramio API.\nDoes someo...
Is there a good way to read RAW image files (especially Canon CR2 and Adobe DNG files) as GDI+ bitmaps that is reasonably fast? I found an example running under WPF that would read an image using any installed image codec and then display it in an image control. And I modified this example to create a GDI+ bitmap by wr...
Reading RAW image files, such as Canon CR2 or Adobe DNG, efficiently in a GDI+ Bitmap format can indeed be challenging. Since you mentioned that your current approach using WPF and a MemoryStream is slow, here are several alternatives to consider that can help speed up the process and avoid the need for WPF in an ASP.N...
24,109
[ { "from": "human", "value": "Is there a good way to read RAW image files (especially Canon CR2 and Adobe DNG files) as GDI+ bitmaps that is reasonably fast?\nI found an example running under WPF that would read an image using any installed image codec and then display it in an image control. And I modified ...
I've been slowly working on a personnel project to run a webmud like game using extjs as my frontend. One of the design choices I made was to allow user-generated evaluated code for game logic. So when the player enters a new "room" a number of state scripts would be called along the lines of "has player been here be...
Your project sounds intriguing, and you're right to be cautious about security when allowing user-generated code to run on your server. Here are some options and considerations you might explore beyond the two you mentioned: ### 1. **JavaScript in a Sandboxed Environment** You mentioned ECMAScript as an option, but i...
28,166
[ { "from": "human", "value": "I've been slowly working on a personnel project to run a webmud like game using extjs as my frontend. One of the design choices I made was to allow user-generated evaluated code for game logic. So when the player enters a new \"room\" a number of state scripts would be called ...
Is there any way to manually create fold points in code in Eclipse? I know how to enable folding and how to set the auto preferences, but i like being able to set my own fold points so I can ignore certain parts of my code. Think regions in VS. I know there is in VS and NetBeans, but I cannot find a way to set manual ...
In Eclipse, there isn't a built-in feature exactly like Visual Studio's regions for manually creating fold points in code. However, you can manage code folding with some workarounds. Here are a couple of methods you can use to create a more organized view of your code: ### 1. **Using Comments for Folding:** While you...
29,890
[ { "from": "human", "value": "Is there any way to manually create fold points in code in Eclipse? I know how to enable folding and how to set the auto preferences, but i like being able to set my own fold points so I can ignore certain parts of my code. Think regions in VS.\n I know there is in VS and NetBea...
Is there a way to set the StartPosition of a Windows Forms form using code? It seems whatever I try results in the StartPostion being the default. Here is what I am doing in the form to display: public DealsForm() { InitializeComponent(); this.StartPosition = FormStartPosition.CenterParent; ...
The issue you're encountering is due to the way the `Show()` method works in Windows Forms. When you use `Show()`, the `StartPosition` property of the form does not take effect until after the form is shown for the first time. The position is determined based on the `StartPosition` property only after the form is creat...
30,948
[ { "from": "human", "value": "Is there a way to set the StartPosition of a Windows Forms form using code? It seems whatever I try results in the StartPostion being the default.\nHere is what I am doing in the form to display:\n public DealsForm()\n {\n InitializeComponent();\n this.Start...
I'm working on a table of links within a site using iframes. I'm wondering if there's any way to code a link to go to two simultaneous destinations within two different target frames? I've been reading all afternoon and can't find anything close to what I want to do. Basically I want one link to present a photo in one ...
Unfortunately, HTML does not support a single link that targets two different frames simultaneously. However, you can achieve the desired effect using JavaScript. By handling the link click event, you can set the `src` attribute of each iframe independently. Here's an example of how to implement this: ```html <!DOCT...
29,878
[ { "from": "human", "value": "I'm working on a table of links within a site using iframes. I'm wondering if there's any way to code a link to go to two simultaneous destinations within two different target frames? I've been reading all afternoon and can't find anything close to what I want to do. Basically I...
I have an ASP.NET application. Basically the delivery process is this one : Nant builds the application and creates a zip file on the developer's computer with the application files without SVN folders and useless files. This file is delivered with a Nant script. The zip and nant files are copied to the client's compu...
To address your problem of file permissions in your ASP.NET application deployment process, here are some suggestions for both changing file permissions with Nant and avoiding the problem altogether: ### Changing File Permissions with Nant You can change file permissions using Nant with the help of the `chmod` task o...
29,482
[ { "from": "human", "value": "I have an ASP.NET application.\nBasically the delivery process is this one :\n\nNant builds the application and creates a zip file on the developer's computer with the application files without SVN folders and useless files. This file is delivered with a Nant script.\nThe zip an...
In our program, each customer gets their own database. We e-mail them a link that connects them to their database. The link contains a GUID that lets the program know which database to connect to. How do I dynamically and programatically connect ActiveRecord to the right db?
To dynamically connect ActiveRecord to the right database based on a GUID in a Rails application, you can follow these steps: ### Step 1: Store Database Connection Information You should have a way to map the GUID to the corresponding database configuration. This can be done in a couple of ways, such as storing the i...
25,736
[ { "from": "human", "value": "In our program, each customer gets their own database. We e-mail them a link that connects them to their database. The link contains a GUID that lets the program know which database to connect to.\nHow do I dynamically and programatically connect ActiveRecord to the right db?\...
Can I write and compile code for this on XP? We have utilities for our apps that use activesync and now will be adding Vista/WMDC - and I was hoping I don't have to have another development OS (Vista) to develop and compile on. I have not seen much documentation for the API for WMDC - can someone point me to some us...
Yes, you can write and compile code for applications that use ActiveSync on Windows XP. However, if you're planning to develop applications that specifically target Windows Mobile Device Center (WMDC), you may encounter limitations and potential compatibility issues, as WMDC was designed for Windows Vista and later ope...
27,915
[ { "from": "human", "value": "Can I write and compile code for this on XP? We have utilities for our apps that use activesync and now will be adding Vista/WMDC - and I was hoping I don't have to have another development OS (Vista) to develop and compile on. \nI have not seen much documentation for the API ...
I have an MSI file that I have created using a Visual Studio Setup Project. The installed generates an .InstallState file in the application directory. Is there a way to have this file generated in a different location rather than the default location?
In a Visual Studio Setup Project, the `.InstallState` file is typically created in the application's installation directory by default. However, changing its location isn't straightforward as it doesn't have a built-in option to specify a custom location during the setup process. To achieve the functionality of placin...
28,713
[ { "from": "human", "value": "I have an MSI file that I have created using a Visual Studio Setup Project. The installed generates an .InstallState file in the application directory. Is there a way to have this file generated in a different location rather than the default location?\n" }, { "from": ...
I have several user drawn controls on a form, unfortunately when the form is shown the user drawn controls are showing the previous forms background rather than the current forms background. The OnPaint event is very simple, and the OnBackgroundPaint event is empty... Like this: protected override void OnPaint(...
It sounds like you are encountering an issue with transparency and the rendering of your custom-drawn controls, specifically that they are not properly clearing the background before rendering the new frame. When custom-drawing controls that involve images, you often need to make sure to clear the background properly, ...
30,376
[ { "from": "human", "value": "I have several user drawn controls on a form, unfortunately when the form is shown the user drawn controls are showing the previous forms background rather than the current forms background. \nThe OnPaint event is very simple, and the OnBackgroundPaint event is empty... \nLike...
Is there a cross database platform way to get the primary key of the record you have just inserted? I noted that this answer says that you can get it by Calling SELECT LAST_INSERT_ID() and I think that you can call SELECT @@IDENTITY AS 'Identity'; is there a common way to do this accross databases in jdbc? If not how w...
Retrieving the primary key of a newly inserted record can indeed differ across various database systems like SQL Server, MySQL, and Oracle. While methods such as `SELECT LAST_INSERT_ID()` for MySQL or `SELECT @@IDENTITY` for SQL Server work, they are not common across databases. Oracle has a different approach involvin...
29,248
[ { "from": "human", "value": "Is there a cross database platform way to get the primary key of the record you have just inserted?\nI noted that this answer says that you can get it by Calling SELECT LAST_INSERT_ID() and I think that you can call SELECT @@IDENTITY AS 'Identity'; is there a common way to do th...
What does it mean: "First-chance exception at in : 0x000006BA: The RPC server is unavailable" ? this debug message appears in Debug output of visual studio debugger when I using socket connection, but I don't know what operation initiates this message...
The error message "First-chance exception at ... : 0x000006BA: The RPC server is unavailable" indicates that an exception has occurred in your application, specifically related to Remote Procedure Calls (RPC). This error often points to a situation where the application is trying to call an RPC service, but it is unabl...
29,970
[ { "from": "human", "value": "What does it mean:\n\"First-chance exception at in : 0x000006BA: The RPC server is unavailable\"\n?\nthis debug message appears in Debug output of visual studio debugger when I using socket connection, but I don't know what operation initiates this message...\n" }, { "f...
There appear to be several options available to programs that handle large numbers of socket connections (such as web services, p2p systems, etc). Spawn a separate thread to handle I/O for each socket. Use the select system call to multiplex the I/O into a single thread. Use the poll system call to multiplex the I/O (...
You've outlined some common approaches for handling large numbers of socket connections, and you're correct that on multicore systems, options that utilize multiple threads and efficient I/O multiplexing can yield better performance. Let’s summarize the approaches and provide insights based on recent trends and finding...
20,669
[ { "from": "human", "value": "There appear to be several options available to programs that handle large numbers of socket connections (such as web services, p2p systems, etc).\n\nSpawn a separate thread to handle I/O for each socket.\nUse the select system call to multiplex the I/O into a single thread.\nUs...
I'm looking at the output from spring being loaded up by tomcat and there's something very strange...Everything is duplicated. What would cause this? Whatever it is, it's causing my application to run in odd ways. Additional Info: The application is a web app. All the spring information is loaded using the context lo...
It sounds like you're experiencing a situation where the Spring context is being initialized multiple times, leading to the duplication of beans, security filters, or other components in your application. This issue can manifest in various ways and typically leads to unexpected behavior in your web application. Here ar...
25,446
[ { "from": "human", "value": "I'm looking at the output from spring being loaded up by tomcat and there's something very strange...Everything is duplicated. What would cause this? Whatever it is, it's causing my application to run in odd ways.\nAdditional Info:\nThe application is a web app. All the spring...
How can I get the BSSID / MAC (Media Access Control) address of the wireless access point my system is connected to using C#? Note that I'm interested in the BSSID of the WAP. This is different from the MAC address of the networking portion of the WAP.
To retrieve the BSSID (Basic Service Set Identifier) or MAC address of the wireless access point (WAP) that your system is connected to in C#, you can use the `System.Management` namespace to interact with Windows Management Instrumentation (WMI). This can be done by querying the appropriate WMI class. Here’s a simple...
26,515
[ { "from": "human", "value": "How can I get the BSSID / MAC (Media Access Control) address of the wireless access point my system is connected to using C#?\nNote that I'm interested in the BSSID of the WAP. This is different from the MAC address of the networking portion of the WAP.\n" }, { "from": "...
Just for my own purposes, I'm trying to build a tokenizer in Java where I can define a regular grammar and have it tokenize input based on that. The StringTokenizer class is deprecated, and I've found a couple functions in Scanner that hint towards what I want to do, but no luck yet. Anyone know a good way of going abo...
Building a custom tokenizer in Java using regular expressions can be achieved using the `Pattern` and `Matcher` classes from the `java.util.regex` package. Instead of using the deprecated `StringTokenizer` class, you can create a more flexible tokenizer that allows you to define a regular grammar for tokenization. Her...
24,950
[ { "from": "human", "value": "Just for my own purposes, I'm trying to build a tokenizer in Java where I can define a regular grammar and have it tokenize input based on that. The StringTokenizer class is deprecated, and I've found a couple functions in Scanner that hint towards what I want to do, but no luck...
I've been exploring different strategies for running integration tests within some Nant build scripts. Typically a number of different scripts are chained in one monolithic build that has separate targets: staging (build a staging version, like build), build (just build the stuff), integration (build the stuff and run ...
Your current strategy of separating build and integration testing targets in your Nant build scripts seems reasonable. It’s quite common to have different targets for different purposes in a build process, especially when integration tests can be more time-consuming. Here are a few points to consider and best practices...
28,172
[ { "from": "human", "value": "I've been exploring different strategies for running integration tests within some Nant build scripts. Typically a number of different scripts are chained in one monolithic build that has separate targets: staging (build a staging version, like build), build (just build the stuf...
I want to have a web based admin to upload, delete files and folders in Amazon S3 on ASP.NET website. I am pretty sure something like this already exist, has anyone seen it?
Yes, there are several solutions and libraries that can help you create a web-based admin interface to manage files and folders in Amazon S3 using ASP.NET. While there may not be a ready-made "one-size-fits-all" solution specifically designed for your needs, there are several libraries and tools that you can utilize to...
28,483
[ { "from": "human", "value": "I want to have a web based admin to upload, delete files and folders in Amazon S3 on ASP.NET website. \nI am pretty sure something like this already exist, has anyone seen it? \n" }, { "from": "gpt", "value": "Yes, there are several solutions and libraries that can h...
I've used both SVN and CVS a little bit, but will need to choose one for a new project I will be starting. Can anyone who has used both extensively please offer some pros and cons and which they think is better? Best learning resources would be appreciated too. This will be for a small project, just one or two develop...
When choosing between SVN (Subversion) and CVS (Concurrent Versions System) for your project, it's important to consider several factors such as ease of use, feature set, community support, and the specific needs of your project. Below are some pros and cons for each system, as well as suggestions for learning resource...
26,588
[ { "from": "human", "value": "I've used both SVN and CVS a little bit, but will need to choose one for a new project I will be starting.\nCan anyone who has used both extensively please offer some pros and cons and which they think is better? Best learning resources would be appreciated too.\nThis will be f...
When should you NOT use a singleton class although it might be very tempting to do so? It would be very nice if we had a list of most common instances of 'singletonitis' that we should take care to avoid.
Singletons can be a useful design pattern in certain scenarios, but they also come with potential downsides and pitfalls. Below are some common instances of "singletonitis"—situations where it's tempting to use a singleton, but doing so might be inappropriate or lead to issues: 1. **Global State Management**: Using si...
25,975
[ { "from": "human", "value": "When should you NOT use a singleton class although it might be very tempting to do so? It would be very nice if we had a list of most common instances of 'singletonitis' that we should take care to avoid.\n" }, { "from": "gpt", "value": "Singletons can be a useful de...
I'm not sure how password hashing works (will be implementing it later), but need to create database schema now. I'm thinking of limiting passwords to 4-20 characters, but as I understand after encrypting hash string will be of different length. So, how to store these passwords in the database?
When implementing password hashing for storing passwords in your database, there are some best practices you should follow. Here's how to structure your database schema and manage hashed passwords effectively: ### 1. Password Hashing Overview When you hash a password, the result is a fixed-length string, typically lo...
29,658
[ { "from": "human", "value": "I'm not sure how password hashing works (will be implementing it later), but need to create database schema now.\nI'm thinking of limiting passwords to 4-20 characters, but as I understand after encrypting hash string will be of different length.\nSo, how to store these password...
Does anyone know of an easy way to import a legacy project, whose "version control system" is a series of dated folders, into SVN, so that the history of the revisions is preserved? The project I inherited was not under version control, and there are hundreds of folders, each dated like: 2006-11-26, 2006-11-27, etc... ...
Importing a legacy project structured in dated folders into SVN while preserving history can be done with a custom script. Since this is a common challenge, there are indeed ways to automate the process, although you may need to write some code to handle it. Below is a general outline of how you could achieve this usin...
26,117
[ { "from": "human", "value": "Does anyone know of an easy way to import a legacy project, whose \"version control system\" is a series of dated folders, into SVN, so that the history of the revisions is preserved?\nThe project I inherited was not under version control, and there are hundreds of folders, each...
I need to extract all the emails that show up as autocomplete entries in Outlook 2007. I mostly need to create a list of all the email addresses which I have sent emails to in the past and dump them into excel. Should I be connecting to Outlook through COM somehow? Thanks.
Yes, you can extract the autocomplete entries (often referred to as the "nickname cache") from Outlook 2007 using the COM (Component Object Model) interface in Python or any other programming language that supports COM automation. Below are the general steps and a sample script to guide you through the process of extra...
26,769
[ { "from": "human", "value": "I need to extract all the emails that show up as autocomplete entries in Outlook 2007. I mostly need to create a list of all the email addresses which I have sent emails to in the past and dump them into excel.\nShould I be connecting to Outlook through COM somehow?\nThanks.\n" ...
is it somehow possible to call a rails function or to access a rails object from within jQuery? I'd like to do something like: jQuery(document).ready(function($) { $('#mydiv').html("<%= @object.name %>"); }); OR jQuery(document).ready(function($) { $('#mydiv').html("<%= render :partial => "contacts" %>"); }); At the ...
In Rails, you cannot directly call Ruby functions or access Ruby objects from within JavaScript or jQuery once the page has been rendered in the browser. This is because JavaScript runs on the client side, while Ruby (and Rails) runs on the server side. However, you can pass data from your Rails application to the Java...
27,649
[ { "from": "human", "value": "is it somehow possible to call a rails function or to access a rails object from within jQuery?\nI'd like to do something like:\njQuery(document).ready(function($) {\n$('#mydiv').html(\"<%= @object.name %>\");\n});\n\nOR\njQuery(document).ready(function($) {\n$('#mydiv').html(\"...
I want to display the current host and database names in a view. Where can I get these names? Are there some predefined environment or global variables?
In many database management systems (DBMS), you can access the current host and database names using predefined functions or system variables. Here’s how you can do this for some common DBMS: ### MySQL In MySQL, you can use the following commands to get the current host and database names: - **Current Database Name:...
29,732
[ { "from": "human", "value": "I want to display the current host and database names in a view.\nWhere can I get these names?\nAre there some predefined environment or global variables? \n" }, { "from": "gpt", "value": "In many database management systems (DBMS), you can access the current host an...
Whilst trying to get our app working in Firefox (I'm a big proponent of X-Browser support but our lead dev is resisting me saying IE is good enough). So I'm doing a little side project to see how much work it is to convert. I've hit a problem straight away. The main.aspx page binds to a webservice using the IE only met...
Hi Rob, It sounds like you're running into some compatibility issues between Internet Explorer's proprietary behavior system and the more standard JavaScript/CSS methodologies that Firefox uses. The `htc` files and their associated behaviors are indeed specific to IE, and while you may be able to utilize XML bindings ...
26,854
[ { "from": "human", "value": "Whilst trying to get our app working in Firefox (I'm a big proponent of X-Browser support but our lead dev is resisting me saying IE is good enough). So I'm doing a little side project to see how much work it is to convert.\nI've hit a problem straight away.\nThe main.aspx page ...
This is supposed to be a no brainer but I still can’t figure it out. In my sample app there’s a button and a textbox in a dockpanel. If the content of the textbox is smaller than the content of the textbox the window is as big as it needs to be to display the content of the button. That’s what I want. But if I put more...
It looks like you're trying to achieve a layout where the window's width is determined by the button's content, and the textbox wraps text or shows scrollbars as needed. You can achieve this by using a `TextBox` instead of a `TextBlock` for the textbox part of your layout, and setting the appropriate properties to enab...
28,582
[ { "from": "human", "value": "This is supposed to be a no brainer but I still can’t figure it out.\nIn my sample app there’s a button and a textbox in a dockpanel. If the content of the textbox is smaller than the content of the textbox the window is as big as it needs to be to display the content of the but...
I am running windows XP with ruby 1.8.6 patchlevel 111. I am using HTTP to connect to a remote server and it has been running fine. All of a sudden it started to through the exception listed below (I did not change any code since the last time I ran it successfully). Does anybody know what is going on? c:/ruby/lib/r...
The error message you're encountering indicates that a timeout has occurred while trying to read from a network connection in Ruby. This typically happens when your script is trying to connect to a remote server, but it is taking too long to receive a response. Here are several potential reasons for this issue and su...
25,957
[ { "from": "human", "value": "I am running windows XP with ruby 1.8.6 patchlevel 111. I am using HTTP to connect to a remote server and it has been running fine. All of a sudden it started to through the exception listed below (I did not change any code since the last time I ran it successfully). Does anyb...
I have a windows c# application and I want to display a pdf file, located on a webserver, in an acrobat com object added to my form. pdf.loadfile(@"http://somewhere.com/nowwhere.pdf") As my pdf is large, the application seems to hang till the entire file is loaded. I want to read the large file without the user bein...
To load a large PDF file from a web server without causing your C# application to hang, you can run the file download operation in a separate thread or use asynchronous programming. This way, the user interface remains responsive while the PDF file is being downloaded. Below is an example of how you can achieve this u...
26,622
[ { "from": "human", "value": "I have a windows c# application and I want to display a pdf file, located on a webserver, in an acrobat com object added to my form. \npdf.loadfile(@\"http://somewhere.com/nowwhere.pdf\")\n\nAs my pdf is large, the application seems to hang till the entire file is loaded. \nI wa...
Why does the C++ STL not provide any "tree" containers, and what's the best thing to use instead? I want to store a hierarchy of objects as a tree, rather than use a tree as a performance enhancement...
The C++ Standard Library (STL) does not include tree containers (like binary trees, AVL trees, or Red-Black trees) primarily for a few reasons: 1. **Complexity**: Implementing and maintaining a generalized tree structure can be complex due to the various balancing and structural considerations. Different types of tree...
28,285
[ { "from": "human", "value": "Why does the C++ STL not provide any \"tree\" containers, and what's the best thing to use instead?\nI want to store a hierarchy of objects as a tree, rather than use a tree as a performance enhancement...\n" }, { "from": "gpt", "value": "The C++ Standard Library (ST...
I have an ASP.NET MVC view which contains checkboxes for user-defined categories. <td><% foreach (Category c in (List<Category>)ViewData["cats"]) { if (selCats.ContainsKey(c.ID)) { %> <input name="CategoryIDs" type="checkbox" value="<%=c.ID %>" checked="checked" />&nbsp;<%= c.Name%><% } else { %>...
Certainly! You can simplify the association of categories with a post by leveraging the functionality of your data access layer in LINQ to SQL, along with the power of collections. Assuming you have a many-to-many relationship established between your `Post` and `Category` entities via an association table (let's call...
22,575
[ { "from": "human", "value": "I have an ASP.NET MVC view which contains checkboxes for user-defined categories.\n<td><% foreach (Category c in (List<Category>)ViewData[\"cats\"]) {\n if (selCats.ContainsKey(c.ID)) { %>\n <input name=\"CategoryIDs\" type=\"checkbox\" value=\"<%=c.ID %>\" checked=\...