instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I'm running into a common pattern in the code that I'm writing, where I need to wait for all threads in a group to complete, with a timeout. The timeout is supposed to be the time required for all threads to complete, so simply doing Thread.Join(timeout) for each thread won't work, since the possible timeout is then ti...
Your current approach using `EventWaitHandle` and `Mutex.WaitAll` works, but you're right that it can be simplified. A better pattern for waiting for multiple threads with a timeout is to use the `Task` class along with `Task.WhenAll`. This not only simplifies the code but also integrates better with asynchronous progr...
28,456
[ { "from": "human", "value": "I'm running into a common pattern in the code that I'm writing, where I need to wait for all threads in a group to complete, with a timeout. The timeout is supposed to be the time required for all threads to complete, so simply doing Thread.Join(timeout) for each thread won't wo...
I believe that Agile is nothing but another implementation of Spiral Model. I am a big supporter of Spiral (The spiral model is a software development process combining elements of both design and prototyping-in-stages, in an effort to combine advantages of top-down and bottom-up concepts) since its beginnings and have...
You're correct in observing that both Agile and the Spiral Model share some fundamental principles, particularly in how they approach software development. However, they have distinct characteristics that cater to different project needs and contexts. Here’s a breakdown of the similarities and differences between Agile...
28,023
[ { "from": "human", "value": "I believe that Agile is nothing but another implementation of Spiral Model. I am a big supporter of Spiral (The spiral model is a software development process combining elements of both design and prototyping-in-stages, in an effort to combine advantages of top-down and bottom-u...
I'm taking my first crack at Ajax with jQuery. I'm getting my data onto my page, but I'm having some trouble with the JSON data that is returned for Date data types. Basically, I'm getting a string back that looks like this: /Date(1224043200000)/ From someone totally new to JSON - How do I format this to a short date ...
It looks like you're on the right track with your AJAX call and date formatting. However, there are a couple of adjustments needed to handle the date string format you mentioned (`/Date(1224043200000)/`). First, the value inside that string represents a Unix timestamp in milliseconds. To convert it to a JavaScript `D...
30,339
[ { "from": "human", "value": "I'm taking my first crack at Ajax with jQuery. I'm getting my data onto my page, but I'm having some trouble with the JSON data that is returned for Date data types. Basically, I'm getting a string back that looks like this:\n/Date(1224043200000)/\n\nFrom someone totally new to ...
I have a form with multiple fields that I'm validating (some with methods added for custom validation) with Jörn Zaeffere's excellent jQuery Validation plugin. How do you circumvent validation with specified submit controls (in other words, fire validation with some submit inputs, but do not fire validation with others...
To implement a setup where you can bypass validation for certain submit buttons using the jQuery Validation plugin, you can achieve this by modifying the `submitHandler` or by using a custom click event for your specific buttons. Below is a suggested approach that allows you to either run the validation or skip it base...
27,402
[ { "from": "human", "value": "I have a form with multiple fields that I'm validating (some with methods added for custom validation) with Jörn Zaeffere's excellent jQuery Validation plugin. How do you circumvent validation with specified submit controls (in other words, fire validation with some submit input...
I'm about to start (with fellow programmers) a programming & algorithms club in my high school. The language of choice is C++ - sorry about that, I can't change this. We can assume students have little to no experience in the aforementioned topics. What do you think are the most basic concepts I should focus on? I know...
Starting a programming and algorithms club is a fantastic initiative, especially in a high school setting! Here's a structured approach to help your club members get comfortable with C++ and algorithms while fostering a programmer's mindset. ### First Meeting: Setting the Tone 1. **Introduction to Programming**: -...
27,469
[ { "from": "human", "value": "I'm about to start (with fellow programmers) a programming & algorithms club in my high school. The language of choice is C++ - sorry about that, I can't change this. We can assume students have little to no experience in the aforementioned topics.\nWhat do you think are the mos...
When I attempt to update the code on a IIS webserver by replacing the old code with my new code, I receive 503 Service Unavailable replys when attempting to access any of the replaced pages on the server. What is the cause of this failure and what steps can I take to correct such errors? Thanks!
The "503 Service Unavailable" error in IIS typically indicates that the server is temporarily unable to handle the request. This can occur for various reasons, especially after updating the code on the server. Here are some common causes and steps you can take to troubleshoot and resolve the issue: ### Common Causes ...
17,532
[ { "from": "human", "value": "When I attempt to update the code on a IIS webserver by replacing the old code with my new code, I receive 503 Service Unavailable replys when attempting to access any of the replaced pages on the server. \nWhat is the cause of this failure and what steps can I take to correct ...
In A.ascx I have one DropDownList and one DIV. The DropDownList is populated dynamically. How do I load B.ascx into the DIV, when the user changes the selected index in the DropDownList. This should be done on the client side without postback, by using jQuery and Ajax.
To load `B.ascx` into a `DIV` when the user changes the selected index in a `DropDownList` without causing a postback, you can utilize jQuery and an ASP.NET web method. Below are the steps to accomplish this: 1. **Set Up the ASP.NET User Control (A.ascx)**: - Ensure you have a `DropDownList` and a `DIV` in your `A...
23,113
[ { "from": "human", "value": "In A.ascx I have one DropDownList and one DIV. The DropDownList is populated dynamically.\nHow do I load B.ascx into the DIV, when the user changes the selected index in the DropDownList. This should be done on the client side without postback, by using jQuery and Ajax.\n" }, ...
If you have a project, that releases a library and an application, how you handle version-numbers between the two. Example: Your project delivers a library, that convert different file-formats into each other. The library is released for inclusion into other applications. But you also release a command-line-application...
Handling version numbers for a project that includes both a library and an application can be done in a few different ways, and the approach you choose will depend on the relationship between the two components, how they are used, and the conventions you want to follow. Here are some common strategies: ### 1. **Indepe...
27,978
[ { "from": "human", "value": "If you have a project, that releases a library and an application, how you handle version-numbers between the two.\nExample: Your project delivers a library, that convert different file-formats into each other. The library is released for inclusion into other applications. But y...
Apparently ;-) the standard containers provide some form of guarantees. What type of guarantees and what exactly are the differences between the different types of container? Working from the SGI page (about STL) I have come up with this: Container Types: ================ Container: Forward Container Revers...
The C++ Standard Library provides a variety of container types, each designed with specific properties and guarantees. Understanding these guarantees and differences between the types of containers can help you choose the appropriate one for your needs. Here’s a breakdown based on your provided classification. ### Con...
20,088
[ { "from": "human", "value": "Apparently ;-) the standard containers provide some form of guarantees.\nWhat type of guarantees and what exactly are the differences between the different types of container?\nWorking from the SGI page (about STL) I have come up with this:\nContainer Types:\n================\nC...
I have a pretty generic Article model, with m2m relation to Tag model. I want to keep count of each tag usage, i think the best way would be to denormalise count field on Tag model and update it each time Article being saved. How can i accomplish this, or maybe there's a better way?
You're correct that denormalizing the count field on your `Tag` model can be a practical way to track the usage of tags, especially if you're frequently querying this information. Here’s a way to implement this in Django with a Many-to-Many (M2M) relationship between `Article` and `Tag`. ### Step 1: Define the Models...
27,965
[ { "from": "human", "value": "I have a pretty generic Article model, with m2m relation to Tag model. I want to keep count of each tag usage, i think the best way would be to denormalise count field on Tag model and update it each time Article being saved. How can i accomplish this, or maybe there's a better ...
I have a little dilemma on how to set up my visual studio builds for multi-targeting. Background: c# .NET v2.0 with p/invoking into 3rd party 32 bit DLL's, SQL compact v3.5 SP1, with a Setup project. Right now, the platform target is set to x86 so it can be run on Windows x64. The 3rd party company has just released 6...
You can absolutely achieve your goal of multi-targeting (32-bit and 64-bit) within the same codebase using Visual Studio. Here are some suggestions to help you set this up effectively: ### 1. Create Separate Build Configurations You can create additional build configurations in your Visual Studio project for the 64-b...
29,533
[ { "from": "human", "value": "I have a little dilemma on how to set up my visual studio builds for multi-targeting.\nBackground: c# .NET v2.0 with p/invoking into 3rd party 32 bit DLL's, SQL compact v3.5 SP1, with a Setup project. \nRight now, the platform target is set to x86 so it can be run on Windows x64...
This might be a naive question. I have to manually edit a .WXS file to make it support select features from command line. For example, there are 3 features in .WXS file. <Feature Id="AllFeature" Level='1'> <Feature Id="Feature1" Level='1'> </Feature> <Feature Id="Feature2" Level='1'> </Feature> <Feature ...
To accomplish selective feature installation based on command-line parameters in WiX, you can use a combination of conditions and `Level` attributes for the features. Here's how you can set this up: 1. **Define Features with Appropriate Levels**: You need to modify the feature definitions in your `.wxs` file to contro...
28,913
[ { "from": "human", "value": "This might be a naive question. I have to manually edit a .WXS file to make it support select features from command line.\nFor example, there are 3 features in .WXS file.\n<Feature Id=\"AllFeature\" Level='1'>\n\n <Feature Id=\"Feature1\" Level='1'> </Feature>\n\n <Feature...
I have been working on a webpage. It is the first I have actually tried to design using an image and then use proper CSS layout rather than tables. http://www.roccocammisola.com/proj/brunel/bgimage.html I have been having issues with the shadows on either side of the main content area. Of course these are only an issue...
It sounds like you're encountering an issue with how Internet Explorer (IE) is rendering your webpage, especially with respect to the shadows you've applied to the main content area. Here are some steps and tips to help you troubleshoot and potentially fix this issue: ### 1. **Check CSS Properties:** - Ensure that ...
26,868
[ { "from": "human", "value": "I have been working on a webpage. It is the first I have actually tried to design using an image and then use proper CSS layout rather than tables.\nhttp://www.roccocammisola.com/proj/brunel/bgimage.html\nI have been having issues with the shadows on either side of the main cont...
Here is my sample code. It is meant to be an iterative procedure for gauss seidel (matrix solver). Essentially when the error is small enough it breaks out of the while loop. i=1 while (i>0): x_past = x_present j=0 while(j<3): value=0 k=0 while(k<3): if(k!=j): ...
It looks like you're encountering a common issue in Python related to how lists (or mutable objects) are handled. When you assign `x_past = x_present`, both variables reference the same list object in memory. So, if you modify `x_present`, `x_past` will also reflect that change since they are pointing to the same objec...
31,659
[ { "from": "human", "value": "Here is my sample code. It is meant to be an iterative procedure for gauss seidel (matrix solver). Essentially when the error is small enough it breaks out of the while loop.\ni=1\nwhile (i>0):\n x_past = x_present\n\n j=0\n while(j<3):\n value=0\n k=0\n ...
I'm trying to use NAnt/NAntContrib build script to build a web application on Windows 2008 (IIS 7.0). In the build file, there is mkiisdir task, which fails with: [mkiisdir] The webservice at 'localhost' does not exist or is not reachable. All the documents/posts I found so far (non for w2k8, only Vista) say to install...
It seems like you're encountering permission-related issues when using NAnt to manage IIS on Windows Server 2008. The fact that the task succeeds when logged in as a local administrator but fails for domain admins suggests that there might be some required permissions or configuration that’s not correctly set for domai...
27,498
[ { "from": "human", "value": "I'm trying to use NAnt/NAntContrib build script to build a web application on Windows 2008 (IIS 7.0).\nIn the build file, there is mkiisdir task, which fails with:\n[mkiisdir] The webservice at 'localhost' does not exist or is not reachable.\nAll the documents/posts I found so f...
I'm writing a client-server app using BSD sockets. It needs to run in the background, continuously transferring data, but cannot hog the bandwidth of the network interface from normal use. Depending on the speed of the interface, I need to throttle this connection to a certain max transfer rate. What is the best way ...
To achieve bandwidth throttling in your client-server application using BSD sockets, you can implement a rate-limiting mechanism. This can be done in several ways, but one common approach is to control the flow of data you send over the socket using timing and data chunk sizes. Here are some strategies to consider: ##...
24,040
[ { "from": "human", "value": "I'm writing a client-server app using BSD sockets. It needs to run in the background, continuously transferring data, but cannot hog the bandwidth of the network interface from normal use. Depending on the speed of the interface, I need to throttle this connection to a certain...
I'm looking for a way to do grouping with displaytag but with the group title separated from the detail. It's probably not all that clear, so here is an example : If I just add groups to a displaytag table, I end up with something like : | group1 | item1 | | | item2 | | | item3 | | group2 | item4 | | ...
To achieve the desired layout for grouping in DisplayTag, you can use a combination of custom header and row decorators. Here is how you can accomplish that: 1. **Custom Row Decorator**: Create a custom row decorator that will handle the display of the group headers separately from the detail rows. 2. **Modify Your J...
29,818
[ { "from": "human", "value": "I'm looking for a way to do grouping with displaytag but with the group title separated from the detail. It's probably not all that clear, so here is an example :\nIf I just add groups to a displaytag table, I end up with something like :\n| group1 | item1 |\n| | item2 |\...
When building static libraries with VS2005 I keep getting linker warnings that VC80.pdb cant be found with my library.lib. Apparently, as a result, the edit and continue feature of the IDE fails to work any project that incorporates library.lib What magic is needed to tell VS2005 to produce a static lib with edit and c...
To enable the Edit and Continue feature with your static libraries in Visual Studio 2005, and to avoid the linker warnings regarding the `VC80.pdb`, you need to ensure a couple of things regarding the settings for generating your static libraries. Here's a step-by-step guide to address the issues you're facing: 1. **...
27,761
[ { "from": "human", "value": "When building static libraries with VS2005 I keep getting linker warnings that VC80.pdb cant be found with my library.lib. Apparently, as a result, the edit and continue feature of the IDE fails to work any project that incorporates library.lib\nWhat magic is needed to tell VS20...
I've got a C# program that's supposed to play audio files. I've figured out how to play any sound file for which Windows has a codec by using DirectShow, but now I want to properly fill in the file type filter box on the Open dialog. I'd like to automatically list any file format for which Windows has a codec. If so...
To dynamically list the supported audio file formats for your Open File dialog in a C# application, you can utilize Windows' registry to retrieve the installed codecs and their associated file extensions and descriptions. The audio codecs are generally registered under the `HKEY_CLASSES_ROOT` registry hive, where each ...
29,473
[ { "from": "human", "value": "I've got a C# program that's supposed to play audio files. I've figured out how to play any sound file for which Windows has a codec by using DirectShow, but now I want to properly fill in the file type filter box on the Open dialog. I'd like to automatically list any file for...
Many examples of macros seem to be about hiding lambdas, e.g. with-open-file in CL. I'm looking for some more exotic uses of macros, particularly in PLT Scheme. I'd like to get a feel for when to consider using a macro vs. using functions.
In PLT Scheme (now known as Racket), macros are a powerful feature that allow you to extend the language syntax in ways that functions cannot. While hiding lambdas is a common use case, there are several other interesting scenarios where macros can be particularly beneficial: ### 1. **Creating Domain-Specific Language...
27,556
[ { "from": "human", "value": "Many examples of macros seem to be about hiding lambdas, e.g. with-open-file in CL. I'm looking for some more exotic uses of macros, particularly in PLT Scheme. I'd like to get a feel for when to consider using a macro vs. using functions.\n" }, { "from": "gpt", "val...
I've got a PHP application which needs to grab the contents from another web page, and the web page I'm reading needs a cookie. I've found info on how to make this call once i have the cookie ( http://groups.google.com/group/comp.lang.php/msg/4f618114ab15ae2a ), however I've no idea how to generate the cookie, or how /...
To achieve the functionality you described—saving cookies from a login request and then using them for subsequent requests in PHP—you can use the `cURL` library. This allows for greater flexibility, including cookie management, compared to the basic file_get_contents method. Here's how you can perform the steps you've...
28,364
[ { "from": "human", "value": "I've got a PHP application which needs to grab the contents from another web page, and the web page I'm reading needs a cookie.\nI've found info on how to make this call once i have the cookie ( http://groups.google.com/group/comp.lang.php/msg/4f618114ab15ae2a ), however I've no...
I am trying to monitor a tcp flow using flow monitor. attach-fmon wants link object which is not available in wireless connections. How can I solve this problem ? Are there any other solutions ? My code is here http://pastebin.com/f59241692 I got this error message eid@eid-laptop:~/code/ns2/noisy$ ns mixed.tcl num_node...
It looks like you're trying to monitor a TCP flow using flow monitors in a simulation with NS2 (Network Simulator 2), but encountering an issue related to wireless connections where the `attach-fmon` function requires a link object that is not available for wireless links. Here are a few potential solutions to conside...
28,958
[ { "from": "human", "value": "I am trying to monitor a tcp flow using flow monitor. attach-fmon wants link object which is not available in wireless connections. How can I solve this problem ? Are there any other solutions ?\nMy code is here\nhttp://pastebin.com/f59241692\nI got this error message\neid@eid-l...
I am wondering how to get a process run at the command line to use less processing power. The problem I'm having is the the process is basically taking over the CPU and taking MySQL and the rest of the server with it. Everything is becoming very slow. I have used nice before but haven't had much luck with it. If it is ...
To address the issue of a CPU-intensive process consuming too much CPU on your server, here are several options you can consider, including the `nice` command and other strategies: ### 1. Using `nice` The `nice` command adjusts the priority of a process, allowing you to reduce its impact on other processes. If you're...
28,128
[ { "from": "human", "value": "I am wondering how to get a process run at the command line to use less processing power. The problem I'm having is the the process is basically taking over the CPU and taking MySQL and the rest of the server with it. Everything is becoming very slow.\nI have used nice before bu...
I need to know if a folder is accessible to other computers on the network, so the first part of this is checking if the folder is shared accross the network. As the folder I'm checking may be a sub-folder, I can't just iterate across shared folders on the computer to check if one of them points to my folder unless WM...
To determine if a specific folder (including subdirectories) is accessible over the network, you can utilize a combination of Windows Management Instrumentation (WMI) and file system access checks. Here’s how you can approach this: ### Method 1: Check Shared Folders Using WMI 1. **Enumerate Shared Folders**: Use WMI ...
22,533
[ { "from": "human", "value": "I need to know if a folder is accessible to other computers on the network, so the first part of this is checking if the folder is shared accross the network. As the folder I'm checking may be a sub-folder, I can't just iterate across shared folders on the computer to check if ...
I'm looking to revamp an old open source project I've started a couple of months ago. I'm a tidiness fanatic, I really try hard to "code like a girl" whenever I can. That's why I've been policing my code with StyleCop, which makes me really happy. Now for some reason I've got the feeling that I've uploaded a pile of ju...
Revamping your open source project is a great initiative, especially since you want to ensure that only the necessary files are included. Here’s a step-by-step guide to help you clean up your repository and make a tidy commit: ### 1. Assess the Current State of the Repository First, you need to review what you current...
28,389
[ { "from": "human", "value": "I'm looking to revamp an old open source project I've started a couple of months ago. I'm a tidiness fanatic, I really try hard to \"code like a girl\" whenever I can. That's why I've been policing my code with StyleCop, which makes me really happy. Now for some reason I've got ...
I was writing a program in C++ to find all solutions of ab = c, where a, b and c together use all the digits 0-9 exactly once. The program looped over values of a and b, and it ran a digit-counting routine each time on a, b and ab to check if the digits condition was satisfied. However, spurious solutions can be genera...
In C++, handling integer overflow requires careful attention, especially since signed integer overflow leads to undefined behavior. However, with unsigned integers, we can handle overflow more safely. The technique you've implemented to check for overflow using the product `c_test = c * b;` is valid, but there's a cle...
28,031
[ { "from": "human", "value": "I was writing a program in C++ to find all solutions of ab = c, where a, b and c together use all the digits 0-9 exactly once. The program looped over values of a and b, and it ran a digit-counting routine each time on a, b and ab to check if the digits condition was satisfied.\...
I am a .NET developer now and have come from Foxpro/VB6/COM background. Over the time, I think we have changed to worry too much about languages/tools to do the work. If you look at what a developer in the .NET space would use, the list is ever growing. More so, the tools itself are so complex that - days are gone wher...
Your observations about the evolution of software development, particularly in the .NET space, resonate with many developers who have witnessed similar trends over the years. Here are some thoughts on raising the abstraction in software development and navigating the growing complexity of tools and languages: ### The ...
27,919
[ { "from": "human", "value": "I am a .NET developer now and have come from Foxpro/VB6/COM background.\nOver the time, I think we have changed to worry too much about languages/tools to do the work. If you look at what a developer in the .NET space would use, the list is ever growing.\nMore so, the tools itse...
Which language for quick GUI app + sqlite database CRUD (2-4 tables). Java, Python? (Please no jokes like VBasic), some reference, source code to look on? added: First idea: 1 database SQLite (Win) + client GUI app (Win) clients table + orders table + others import, export database add, del, edit, etc. entries Second i...
Both Java and Python are excellent choices for building a GUI application with an SQLite database or a web application with a hosted database. However, Python is generally seen as a more straightforward and faster option for rapid development, particularly for those new to programming or GUI development. ### Option 1...
25,609
[ { "from": "human", "value": "Which language for quick GUI app + sqlite database CRUD (2-4 tables). Java, Python? (Please no jokes like VBasic), some reference, source code to look on?\nadded:\nFirst idea:\n1 database SQLite (Win) + client GUI app (Win)\nclients table + orders table + others\nimport, export ...
I have a lot of spare intel linux servers laying around (hundreds) and want to use them for a distributed file system in a web hosting and file sharing environment. This isn't for a HPC application, so high performance isn't critical. The main requirement is high availability, if one server goes offline, the data sto...
You have several options for setting up a distributed file system that meets your requirements for high availability and POSIX compliance. Here are some alternatives to Lustre and Gfarm that you might want to consider: ### 1. **Ceph** - **Overview**: Ceph is a highly scalable distributed file system that provides obje...
28,947
[ { "from": "human", "value": "I have a lot of spare intel linux servers laying around (hundreds) and want to use them for a distributed file system in a web hosting and file sharing environment. This isn't for a HPC application, so high performance isn't critical. The main requirement is high availability,...
I have inherited a very large and complex project (actually, a 'solution' consisting of 119 'projects', most of which are DLLs) that was built and tested under VC8 (VS2005), and I have the task of porting it to VC9 (VS2008). The porting process I used was: Copy the VC8 .sln file and rename it to a VC9 .sln file. Co...
Porting a large and complex project from VC8 (VS2005) to VC9 (VS2008) can indeed be challenging, especially when it involves nuanced behavior like the startup sequence of the C runtime and how global objects are initialized. ### Addressing the Startup Sequence Issue In VC9, the order of initialization for global obje...
28,888
[ { "from": "human", "value": "I have inherited a very large and complex project (actually, a 'solution' consisting of 119 'projects', most of which are DLLs) that was built and tested under VC8 (VS2005), and I have the task of porting it to VC9 (VS2008).\nThe porting process I used was:\n\nCopy the VC8 .sln ...
I have a file with data listed as follows: 0, 2, 10 10, 8, 10 10, 10, 10 10, 16, 10 15, 10, 16 17, 10, 16 I want to be able to input the file and split it into three arrays, in the process trimming all excess spaces and converting each element to integers. For some rea...
Certainly! In C++, you can achieve similar functionality with much less boilerplate code by utilizing the Standard Template Library (STL). Below is a concise example to demonstrate how to read from a file, split the lines by a specified delimiter, trim spaces, and store the values as integers in separate arrays (or vec...
30,235
[ { "from": "human", "value": "I have a file with data listed as follows:\n0, 2, 10\n10, 8, 10\n10, 10, 10\n10, 16, 10\n15, 10, 16\n17, 10, 16\n\nI want to be able to input the file and split it into three arrays, in the process trimming all excess spaces and ...
Is it generally better to run functions on the webserver, or in the database? Example: INSERT INTO example (hash) VALUE (MD5('hello')) or INSERT INTO example (hash) VALUE ('5d41402abc4b2a76b9719d911017c592') Ok so that's a really trivial example, but for scalability when a site grows to multiple websites or database ...
The decision of whether to perform computations in the application (web server) or in the database can significantly affect the performance, scalability, and maintainability of your application. Here are some factors to consider for each approach: ### Pros and Cons of Performing Functions in the Database #### Pros: 1...
27,352
[ { "from": "human", "value": "Is it generally better to run functions on the webserver, or in the database?\nExample:\nINSERT INTO example (hash) VALUE (MD5('hello'))\n\nor\nINSERT INTO example (hash) VALUE ('5d41402abc4b2a76b9719d911017c592')\n\nOk so that's a really trivial example, but for scalability whe...
My automated deployment system updates a latest version of my site trough subversion. Instead of having my live site point to the trunk (which is always almost a work in progress version), I have my live site point to a tag. E.g. I work on trunk and when my v1.0 is finished I create a tag called 1.0 and do a checkout o...
Yes, you can switch between tags in Subversion while minimizing the amount of data you need to download. Instead of performing a full checkout each time, you can use the `svn switch` command. This command updates your working copy to point to a different URL, such as a different tag, while preserving the local files th...
27,506
[ { "from": "human", "value": "My automated deployment system updates a latest version of my site trough subversion. Instead of having my live site point to the trunk (which is always almost a work in progress version), I have my live site point to a tag.\nE.g. I work on trunk and when my v1.0 is finished I c...
I'm trying to use the windows native (Theme-aware) header control to display just some column headers. The main purpose is to avoid manually drawing the column headers and rely on the natively supported functionality. So the 2 options I was thinking of are: Use a HeaderControl, and add columns to it (I can't seem to f...
To display column headers in a Windows Forms application without manually drawing them, you can use the `ListView` control since it supports headers natively. The goal is to set it up so that it shows the headers without displaying any rows. Here’s how you can achieve this using a `ListView` control: ### Step-by-Step...
29,061
[ { "from": "human", "value": "I'm trying to use the windows native (Theme-aware) header control to display just some column headers. The main purpose is to avoid manually drawing the column headers and rely on the natively supported functionality.\nSo the 2 options I was thinking of are:\n\nUse a HeaderContr...
I have a web page that uses a scrolling div to display table information. When the window is resized (and also on page load), the display is centered and the div's scrollbar positioned to the right of the page by setting its width. For some reason, the behaviour is different under firefox than IE. IE positions/sizes th...
It sounds like you're running into some cross-browser differences, particularly with how padding, margins, and widths are calculated in Firefox compared to Internet Explorer. Below are some suggestions to help resolve the issue: ### 1. Box Model Differences One of the most common issues arises from the box model diff...
29,093
[ { "from": "human", "value": "I have a web page that uses a scrolling div to display table information. When the window is resized (and also on page load), the display is centered and the div's scrollbar positioned to the right of the page by setting its width. For some reason, the behaviour is different und...
I have a program that I'm porting from one language to another. I'm doing this with a translation program that I'm developing myself. The relevant result of this is that I expect that there are a number of bugs in my system that I am going to need to find and fix. Each bug is likely to manifest in many places and fixin...
To analyze the problem, we can draw some parallels with the "coupon collector's problem," which is a well-known problem in probability theory. In the coupon collector's problem, one is trying to collect all distinct coupons (or in your case, distinct bugs) from a fixed number \( M \). When you randomly draw coupons, yo...
27,563
[ { "from": "human", "value": "I have a program that I'm porting from one language to another. I'm doing this with a translation program that I'm developing myself. The relevant result of this is that I expect that there are a number of bugs in my system that I am going to need to find and fix. Each bug is li...
I have www.example.com and also store.example.com. (Yes they are subdomains of the same parent domain) store.example.com is on ASP.NET 1.1 www.example.com is on ASP.NET 3.5 I want to know what options are available for sharing 'session' data between the two sites. I need some kind of shared login and also the abiltity ...
Sharing session data between different subdomains, particularly when they are running on different frameworks and versions of ASP.NET, can be a bit tricky, but there are several strategies you can employ. Here are your options: ### 1. **Shared Cookies Across Subdomains** You can use cookies to share session informati...
28,233
[ { "from": "human", "value": "I have www.example.com and also store.example.com.\n(Yes they are subdomains of the same parent domain)\nstore.example.com is on ASP.NET 1.1\nwww.example.com is on ASP.NET 3.5\nI want to know what options are available for sharing 'session' data between the two sites. I need som...
So, simple procedure, calculate a factorial number. Code is as follows. int calcFactorial(int num) { int total = 1; if (num == 0) { return 0; } for (num; num > 0; num--) { total *= num; } return total; } Now, this works fine and dandy (There are certainly quicker and ...
Yes, the issue you're encountering is indeed due to the limits of 32-bit signed integers. The factorial of a number grows extremely quickly, and for numbers as small as 13, the result exceeds the maximum value for a 32-bit signed integer (which is 2,147,483,647). In your specific case, calculating `250!` is way beyon...
28,282
[ { "from": "human", "value": "So, simple procedure, calculate a factorial number. Code is as follows.\nint calcFactorial(int num)\n{\n int total = 1;\n\n if (num == 0)\n {\n return 0;\n }\n\n for (num; num > 0; num--)\n {\n total *= num;\n }\n\n return total;\n}\n\nNow, ...
What is the best way to actively monitor if a .NET Windows service is still running (e.g not hung)? The service needs to periodically respond to events raised by a timer. Thanks Jon
To actively monitor a .NET Windows service to ensure that it is still running and not hung, you can implement a combination of techniques: ### 1. Implement Heartbeat Mechanism A heartbeat mechanism involves periodically sending a signal (heartbeat) from your service to indicate that it is still functioning correctly. ...
24,871
[ { "from": "human", "value": "What is the best way to actively monitor if a .NET Windows service is still running (e.g not hung)? The service needs to periodically respond to events raised by a timer.\nThanks\nJon\n" }, { "from": "gpt", "value": "To actively monitor a .NET Windows service to ens...
I need a way to allow each letter of a word to rotate through 3 different colors. I know of some not so clean ways I can do this with asp.NET, but I'm wondering if there might be a cleaner CSS/JavaScript solution that is more search engine friendly. The designer is including a file like this for each page. I'd rather n...
You can achieve a rotating color effect for each letter of a word using CSS and JavaScript in a clean and search engine-friendly way. Below is a simple solution that utilizes CSS animations and JavaScript to rotate the colors of the letters in a word without the need for images. ### HTML Structure You can create a sim...
21,513
[ { "from": "human", "value": "I need a way to allow each letter of a word to rotate through 3 different colors. I know of some not so clean ways I can do this with asp.NET, but I'm wondering if there might be a cleaner CSS/JavaScript solution that is more search engine friendly.\nThe designer is including a ...
Is there anything built into Windows and the .Net framework for programmatically installing and executing applications remotely? Ie: an API for remote software deployment. I'd like to build a tool that can install services on a pool of new computers from one central admin workstation. Update: The computers are part of ...
Yes, Windows and the .NET framework offer various methods and APIs for programmatically installing and executing applications remotely on computers in an internal network. Below are some tools and techniques you can use to achieve this: ### 1. **Windows Management Instrumentation (WMI)** WMI is a powerful feature in ...
28,303
[ { "from": "human", "value": "Is there anything built into Windows and the .Net framework for programmatically installing and executing applications remotely? Ie: an API for remote software deployment. I'd like to build a tool that can install services on a pool of new computers from one central admin workst...
Is there a simple way to duplicate all child components under parent component, including their published properties? For example: TPanel TLabel TEdit TListView TSpecialClassX Of course the most important factor, it should duplicate any new component which I drop on the TPanel without modifying the code under norm...
To duplicate all child components under a parent component in Delphi, including their published properties, you can use the Run-Time Type Information (RTTI) and the component's `Create` method to achieve this. You can create a method that will clone each child component, copy its properties, and add the cloned componen...
26,846
[ { "from": "human", "value": "Is there a simple way to duplicate all child components under parent component, including their published properties?\nFor example:\n\nTPanel\n\n\nTLabel\nTEdit\nTListView\nTSpecialClassX\n\n\nOf course the most important factor, it should duplicate any new component which I dro...
I'm using this code, and I get the stack trace that is listed below. I've got this working with just https and with basic authentication, but not ntlm. HttpClient client = null; HttpMethod get = null; try { Protocol myhttps = new Protocol("https", ((ProtocolSocketFactory) new EasySSLProtocolSocketFactory()), 443); ...
The error you're encountering is a `javax.net.ssl.SSLHandshakeException`, which occurs when the SSL/TLS handshake fails. Specifically, the stack trace indicates that the underlying issue is a `PKIX path validation failed`, which suggests that the server's SSL certificate could not be validated against the trusted certi...
26,905
[ { "from": "human", "value": "I'm using this code, and I get the stack trace that is listed below.\nI've got this working with just https and with basic authentication, but not ntlm.\nHttpClient client = null;\nHttpMethod get = null;\ntry\n{\n Protocol myhttps = new Protocol(\"https\", ((ProtocolSocketFacto...
I'm using FileStream to write to a file, and watching the underlying system calls using Process Monitor. I'm having trouble with some file locking issues in a production deployment, so I'm looking at the details closely. This sample code: using (FileStream fs = new FileStream("c:\\temp\\test.txt", FileMode.Cre...
The behavior you're observing with `FileStream` and the associated system calls can be influenced by several factors, including the operating system's file caching and handling mechanisms, and how the file handles are managed by the underlying file system. ### Key Observations 1. **FileShare Options**: The `FileStrea...
28,277
[ { "from": "human", "value": "I'm using FileStream to write to a file, and watching the underlying system calls using Process Monitor. I'm having trouble with some file locking issues in a production deployment, so I'm looking at the details closely.\nThis sample code:\n using (FileStream fs = new Fi...
I understand that they force you to implement methods and such but what I cant understand is why you would want to use them. Can anybody give me a good example or explanation on why I would want to implement this.
It seems like you're asking about the use of interfaces and abstract classes in programming. These concepts are often used in object-oriented programming (OOP) to define contracts for classes and to promote a more structured and maintainable codebase. Here are some reasons why you would want to implement them, along wi...
27,264
[ { "from": "human", "value": "I understand that they force you to implement methods and such but what I cant understand is why you would want to use them. Can anybody give me a good example or explanation on why I would want to implement this.\n" }, { "from": "gpt", "value": "It seems like you're...
I have a TreeView bound to an XmlDataProvider. The name of a node is reflected in the tree and the data of the node is in a TextBox. When you click on a tree item, it loads the data in the TextBox. What is the best way to determine when a user has changed the source data referenced by the XmlDataProvider. I would lik...
To track changes made to the data in a `TextBox` that are initiated by a user as opposed to updates made through two-way data binding, you can consider a few different approaches. Here are some ideas you might explore, including your mention of `PreviewTextInput`: ### 1. **Using a Boolean Flag** You could introduce a ...
27,479
[ { "from": "human", "value": "I have a TreeView bound to an XmlDataProvider. The name of a node is reflected in the tree and the data of the node is in a TextBox. When you click on a tree item, it loads the data in the TextBox.\nWhat is the best way to determine when a user has changed the source data refe...
Currently I have a stored procedure that makes some updates to a table, and after it makes them, I need to call a web service. The procedure uses a transaction, and I need to call the web service at the end of the transaction. If the web service call should fail, the transaction would get rolled back. I need to know ho...
Calling a SOAP web service directly from a SQL Server stored procedure can be quite challenging, especially when you have constraints such as not using CLR, distributed transactions, or Enterprise Services. However, you can achieve this with some workarounds, although the implementation won't be as straightforward as o...
26,652
[ { "from": "human", "value": "Currently I have a stored procedure that makes some updates to a table, and after it makes them, I need to call a web service.\nThe procedure uses a transaction, and I need to call the web service at the end of the transaction. If the web service call should fail, the transactio...
I'm working on a program that is form based but I have been asked to add some command line support, this works fine apart from the form flashes up and closes down when running from the command line. Is there anyway to hide the form whilst the command line is running? Some code does refer to controls so the gui would ne...
Yes, it is possible to run a form-based application in a way that allows you to execute command line operations while keeping the form hidden. Here's a general approach to implement this in a Windows Forms application using C# as an example: ### Step 1: Hide the Form You can hide the form when the command line operat...
27,116
[ { "from": "human", "value": "I'm working on a program that is form based but I have been asked to add some command line support, this works fine apart from the form flashes up and closes down when running from the command line. Is there anyway to hide the form whilst the command line is running? Some code d...
Anyone know the formula used to control the movement of a simple tank-like vehicle? To 'steer' it, you need to alter the force applied the left and right "wheels". Eg. 1 unit of force on both wheels makes it go forward. -1 units of force on both wheels makes it go backwards. Apply more force to one wheel than the o...
You're on the right track with the concept of skid steering for a tank-like vehicle. In this type of vehicle, the ability to steer is achieved by varying the speed (or force) applied to the left and right wheels. To turn, you would typically apply more force to one side than the other. ### Basic Concepts: 1. **Forwar...
23,540
[ { "from": "human", "value": "Anyone know the formula used to control the movement of a simple tank-like vehicle?\nTo 'steer' it, you need to alter the force applied the left and right \"wheels\". Eg. 1 unit of force on both wheels makes it go forward. -1 units of force on both wheels makes it go backward...
We're currently replacing all special characters and spaces in our URLs with hypens (-). From an SEO and readability point-of-view this works fine. However, in some cases, we are feeding parts of the URL into a search after stripping the hyphens out. The problem occurs when the search term should have hyphens as it ret...
Hi Zac, Your concerns about URL structure and SEO are quite valid. Let's address your questions one by one: ### 1. Are there alternative characters we can use to represent hyphens? Using alternative characters in URLs can lead to various complications. Most characters are either not allowed or not recommended due to...
30,438
[ { "from": "human", "value": "We're currently replacing all special characters and spaces in our URLs with hypens (-). From an SEO and readability point-of-view this works fine. However, in some cases, we are feeding parts of the URL into a search after stripping the hyphens out. The problem occurs when the ...
We have a couple of web servers using load balancer. Machines are running IIS6 on port 81. Externally, site is accessable using port 80. External name and name of the machine are different. We're getting System.ServiceModel.EndpointNotFoundException: The message with To '<url>' cannot be processed at the receiver, due...
The `EndpointNotFoundException` you are encountering is typically due to a mismatch in the address that the service is listening on and the address that the client is trying to access. Given your setup with the load balancer, IIS6, and the configuration details you've provided, there are a few things to check: 1. **En...
28,181
[ { "from": "human", "value": "We have a couple of web servers using load balancer. Machines are running IIS6 on port 81. Externally, site is accessable using port 80. External name and name of the machine are different.\nWe're getting \nSystem.ServiceModel.EndpointNotFoundException: The message with To '<url...
I'm looking for resources that can help me determine which approach to use in creating a 2d data structure with C#.
Creating a 2D data structure in C# can vary significantly based on your specific requirements and the operations you'll need to perform on that structure. Here are several resources and approaches you can consider when determining the best method for creating a 2D data structure: ### Approaches to Consider 1. **Multi...
14,992
[ { "from": "human", "value": "I'm looking for resources that can help me determine which approach to use in creating a 2d data structure with C#.\n" }, { "from": "gpt", "value": "Creating a 2D data structure in C# can vary significantly based on your specific requirements and the operations you'l...
I want to generate unique filenames per image so I'm using MD5 to make filenames.Since two of the same image could come from different locations, I'd like to actually base the hash on the image contents. What caveats does this present? (doing this with PHP5 for what it's worth)
Generating unique filenames based on the contents of an image using MD5 can be a good approach to avoid duplicates, but there are some caveats and considerations to keep in mind when implementing this in PHP5: 1. **Image Formats**: Different formats of the same image (e.g., JPEG, PNG, GIF) will have different binary r...
28,739
[ { "from": "human", "value": "I want to generate unique filenames per image so I'm using MD5 to make filenames.Since two of the same image could come from different locations, I'd like to actually base the hash on the image contents. What caveats does this present? \n(doing this with PHP5 for what it's worth...
Say I have a class called PermissionManager which should only exist once for my system and basically fulfills the function of managing various permissions for various actions in my application. Now I have some class in my application which needs to be able to check a certain permission in one of its methods. This class...
Your consideration of moving away from the singleton pattern for the `PermissionManager` is a great step towards enhancing the testability and decoupling of your application components. Here are some recommendations on how to handle the design without sacrificing the principles of good software design: ### 1. Dependen...
28,126
[ { "from": "human", "value": "Say I have a class called PermissionManager which should only exist once for my system and basically fulfills the function of managing various permissions for various actions in my application. Now I have some class in my application which needs to be able to check a certain per...
Please advise how to scrape AJAX pages.
Scraping AJAX pages can be a bit more complex than scraping static HTML pages because the content is dynamically loaded by JavaScript after the initial page load. Here’s a step-by-step guide on how to scrape AJAX pages effectively: ### Step 1: Understand AJAX Loading 1. **Inspect the Page**: Use your browser's Develo...
27,564
[ { "from": "human", "value": "Please advise how to scrape AJAX pages.\n" }, { "from": "gpt", "value": "Scraping AJAX pages can be a bit more complex than scraping static HTML pages because the content is dynamically loaded by JavaScript after the initial page load. Here’s a step-by-step guide on ...
I am using a 3rd party API which is defined in 2 DLLs. I have included those DLLs in my project and set references to them. So far so good. However, these DLLs have at least one dependent DLL which cannot be found at runtime. I copied the missing DLL into the project and set the 'Copy to output' flag but without succe...
When dealing with a scenario where your project relies on third-party DLLs, and those DLLs have dependencies that are not being found at runtime, there are several approaches you can take to resolve this issue. Here are some common solutions: 1. **Check the Dependency Chain**: Use a tool like Dependency Walker (for Wi...
26,979
[ { "from": "human", "value": "I am using a 3rd party API which is defined in 2 DLLs. I have included those DLLs in my project and set references to them. So far so good. \nHowever, these DLLs have at least one dependent DLL which cannot be found at runtime. I copied the missing DLL into the project and set t...
I'm starting a hobby project in which I would like to have a graphical, touchscreen interface for interacting with a kiosk-like device running on top of Windows XP Embedded. For development of a rich UI experience, I was considering using WPF. However, a number of demonstration videos that I have come across have use...
For a kiosk-like device running on Windows XP Embedded, the choice between WPF and Silverlight can be a bit nuanced, especially given the platform's limitations and the specific goals of your project. ### 1. Recommended Graphical Subsystem **WPF (Windows Presentation Foundation)** is indeed targeted towards desktop a...
31,594
[ { "from": "human", "value": "I'm starting a hobby project in which I would like to have a graphical, touchscreen interface for interacting with a kiosk-like device running on top of Windows XP Embedded. For development of a rich UI experience, I was considering using WPF. However, a number of demonstratio...
I display data into an html table, w/ a drop down box with a list of venues. Each volunteer will be assigned a venue. I envision being able to go down thru the html table and assigning each volunteer a venue. The drop down box contains all the possible venues that they can be assigned to. <select> <option value="1">Set...
To achieve the functionality where you can assign each volunteer a venue from a dropdown menu in an HTML table and submit all the assignments at once, you can use a combination of HTML, JavaScript, and form elements. Below, I'll provide a simple example of how to set this up. ### Step 1: Create the HTML structure Her...
24,874
[ { "from": "human", "value": "I display data into an html table, w/ a drop down box with a list of venues. Each volunteer will be assigned a venue. I envision being able to go down thru the html table and assigning each volunteer a venue. The drop down box contains all the possible venues that they can be as...
I have a this aspx-code: (sample) <asp:DropDownList runat="server" ID="ddList1"></asp:DropDownList> With this codebehind: List<System.Web.UI.WebControls.ListItem> colors = new List<System.Web.UI.WebControls.ListItem>(); colors.Add(new ListItem("Select Value", "0")); colors.Add(new ListItem("Red", "1")); colors.Add(...
The behavior you're observing is due to the way the `DropDownList` control binds data from the data source. When you use a `List<System.Web.UI.WebControls.ListItem>` as the data source, the `DropDownList` attempts to extract the display text and value from each `ListItem` in the list. However, when you bind a `ListIte...
24,144
[ { "from": "human", "value": "I have a this aspx-code: (sample)\n<asp:DropDownList runat=\"server\" ID=\"ddList1\"></asp:DropDownList> \n\nWith this codebehind:\nList<System.Web.UI.WebControls.ListItem> colors = new List<System.Web.UI.WebControls.ListItem>();\ncolors.Add(new ListItem(\"Select Value\", \"0\...
I am looking for a general UI design / work-flow for changing the same property across multiple objects. Suppose I have an object class called Person. The Person class has a property called City. I want to select 5 Person objects and change the City property on all 5 to "New York" in one action in the UI. This is ...
Creating an intuitive UI workflow for batch editing properties of multiple objects like the `Person` class can enhance user experience significantly. Here are a few ideas to address your requirements while incorporating best practices in UI design. ### General UI Workflow Ideas 1. **Batch Edit Mode:** - **Activati...
27,796
[ { "from": "human", "value": "I am looking for a general UI design / work-flow for changing the same property across multiple objects. \nSuppose I have an object class called Person. The Person class has a property called City. I want to select 5 Person objects and change the City property on all 5 to \"N...
JsUnit provides an ant-script with the target 'standalone_test'. This target uses the property url to identify the HTML-site, that executes the tests. These site is checked in, so that everyone should be able after a checkout to execute this tests. This works, but the url-proprty must be set to an absolute path, like f...
To facilitate the automation of your JsUnit tests in a continuous integration system by using a relative path instead of an absolute URL, you can consider a couple of approaches: ### 1. Modify the Ant Script You can modify the Ant build script to construct the absolute path dynamically based on the project's root dir...
27,539
[ { "from": "human", "value": "JsUnit provides an ant-script with the target 'standalone_test'. This target uses the property url to identify the HTML-site, that executes the tests. These site is checked in, so that everyone should be able after a checkout to execute this tests. This works, but the url-proprt...
So am I crazy for considering doing a beta/production release on Glassfish V3 Prelude? Since all of my content is dynamic, I'm not even thinking of bothering to set up apache in front either. Doing so complicates the setup by requiring something like AJP or mod_jk and will not offer us much in terms of capability. So ...
Your approach to deploying your applications on GlassFish V3 Prelude is not inherently flawed, but there are several considerations you should take into account when deciding whether to run GlassFish directly or to set up Apache in front of it. ### Pros of Running GlassFish Directly: 1. **Simplicity**: Bypassing Apach...
30,742
[ { "from": "human", "value": "So am I crazy for considering doing a beta/production release on Glassfish V3 Prelude?\nSince all of my content is dynamic, I'm not even thinking of bothering to set up apache in front either. Doing so complicates the setup by requiring something like AJP or mod_jk and will not...
I want to do something like this: <MyTemplate> <span><%# Container.Title %></span> <MySubTemplate> <span><%# Container.Username %></span> </MySubTemplate> </MyTemplate> Assuming I have a list of Titles that each have a list of Usernames.. If this is a correct approach how can I do this or what is a ...
Your approach to nesting templates is valid in many templating scenarios, but the specific implementation will depend on the technology or framework you are using (e.g., ASP.NET Web Forms, React, Angular, etc.). Assuming you're working within a context that supports nested templating (like ASP.NET), I’ll provide an exa...
29,197
[ { "from": "human", "value": "I want to do something like this:\n<MyTemplate>\n <span><%# Container.Title %></span>\n <MySubTemplate>\n <span><%# Container.Username %></span>\n </MySubTemplate>\n</MyTemplate>\n\nAssuming I have a list of Titles that each have a list of Usernames.. If this is a...
I'm trying to make a picture button in the compact framework. I made a usercontrol and added a picturebox. I saw you could over ride the text and font for normal windows forms. but don't seem able to do it for compact. It crashes VS2008. Has anyone done this?
Creating a picture button in the .NET Compact Framework (CF) can be a bit different from the full .NET Framework, as certain features and properties are not available or function differently. Since you're working with a UserControl that contains a PictureBox, you can handle the drawing and events manually. Here's a ge...
25,606
[ { "from": "human", "value": "I'm trying to make a picture button in the compact framework. I made a usercontrol and added a picturebox. I saw you could over ride the text and font for normal windows forms. but don't seem able to do it for compact. It crashes VS2008. Has anyone done this? \n" }, { ...
I have a requirement on my current project (a Flex app which will be run in Flash player) to display an arbitrary subset of the components on a form while hiding all the other components based on certain aspects of the application state. There are about a dozen different text boxes and drop downs, but some become irre...
In Flex, when dealing with dynamic visibility of components based on application state, you have a couple of solid approaches you can take. Here's a breakdown of your options, along with a suggested approach: ### 1. Using `visible` Property Setting the `visible` property of components to `false` is a straightforward a...
22,446
[ { "from": "human", "value": "I have a requirement on my current project (a Flex app which will be run in Flash player) to display an arbitrary subset of the components on a form while hiding all the other components based on certain aspects of the application state. There are about a dozen different text b...
I'm developing software that writes to a tiny LCD screen (less than 1" x 1"). I've got all the usual suspects - lines, filled polygons, fonts, etc. I remember, however, learning how to do fun vector manipulation in linear algebra many moons ago, and creating rotating wireframe objects. I'd like to do that again, but fi...
Hi Adam, That sounds like a fun project! Creating rotating wireframe objects can definitely add a lot of visual interest to your application. Here are some pointers and resources that can help you quickly get started with vector manipulation and 3D graphics in C: ### Libraries for Vector Manipulation 1. **GLM (OpenG...
17,593
[ { "from": "human", "value": "I'm developing software that writes to a tiny LCD screen (less than 1\" x 1\").\nI've got all the usual suspects - lines, filled polygons, fonts, etc.\nI remember, however, learning how to do fun vector manipulation in linear algebra many moons ago, and creating rotating wirefra...
What are some strategies to achieve code separation in AJAX applications? I am building a PHP application that I would like to have a nice AJAX front end on. I have long since learned to use some kind of templating in my PHP code to make sure I maintain good separation between my logic and display code, but I'm having...
Achieving code separation in AJAX applications, especially when dealing with PHP on the backend and JavaScript (jQuery) on the front end, is crucial for maintainability and scalability. Here are some strategies you can use to enhance code separation in your AJAX-driven application: ### 1. **Use MVC or MVVM Architectur...
28,400
[ { "from": "human", "value": "What are some strategies to achieve code separation in AJAX applications?\nI am building a PHP application that I would like to have a nice AJAX front end on. I have long since learned to use some kind of templating in my PHP code to make sure I maintain good separation between...
We are just starting on a pretty big project with lots of sub projects. we don't currently use any kind of named process but I am hoping to get some kind of agile/scrumlike process in by the back door. The area I will be focusing on most is having a good backlog for the whole project and, at least in my head, the idea ...
Creating and maintaining a good backlog, especially for a larger project with multiple sub-projects, is crucial for effective agile or Scrum-like processes. Here’s a general approach that you can take to break down your project, create and manage a backlog, and some resources you can refer to for inspiration. ### Tech...
23,393
[ { "from": "human", "value": "We are just starting on a pretty big project with lots of sub projects. we don't currently use any kind of named process but I am hoping to get some kind of agile/scrumlike process in by the back door.\nThe area I will be focusing on most is having a good backlog for the whole p...
In a Delphi Form, I would like to replace one visual component with another. Example: I want to replace a Panel component with an ElPanel from a 3rd party package. I would like all identical properties and events of the first component to be transferred to the new one, and all the components that belong to the first c...
Replacing a visual component in a Delphi form while preserving its properties, events, and child components can be a tedious process if done manually. Fortunately, there are some strategies that can help streamline this process: ### Method 1: Use the Delphi IDE to Replace the Component 1. **Select the Component**: Cl...
26,785
[ { "from": "human", "value": "In a Delphi Form, I would like to replace one visual component with another. Example: I want to replace a Panel component with an ElPanel from a 3rd party package. \nI would like all identical properties and events of the first component to be transferred to the new one, and all...
I think the title pretty much says it all... I'm looking to implement an interface similar to the standard OS X sidebar used in all the above mentioned programs, and I'm wondering if anybody has any thoughts as to the easiest way to do it, namely about what view to use for the left hand selection pane. Really I don't t...
Implementing a sidebar interface similar to the macOS applications can be done efficiently using a few different approaches depending on your requirements and design preferences. Here are some suggestions for creating a simple, flat list of choices for your left-hand selection pane: ### 1. **NSSplitView with NSOutline...
29,882
[ { "from": "human", "value": "I think the title pretty much says it all... I'm looking to implement an interface similar to the standard OS X sidebar used in all the above mentioned programs, and I'm wondering if anybody has any thoughts as to the easiest way to do it, namely about what view to use for the l...
I'm starting a new application and looking at using an ORM -- in particular, SQLAlchemy. Say I've got a column 'foo' in my database and I want to increment it. In straight sqlite, this is easy: db = sqlite3.connect('mydata.sqlitedb') cur = db.cursor() cur.execute('update table stuff set foo = foo + 1') I figured out ...
You're correct in your observation that the ORM approach you've used requires fetching all instances into memory, modifying them, and then committing the changes, which can be significantly slower for large datasets. SQLAlchemy's ORM does allow for performing bulk updates more efficiently. If you want to perform an up...
31,310
[ { "from": "human", "value": "I'm starting a new application and looking at using an ORM -- in particular, SQLAlchemy.\nSay I've got a column 'foo' in my database and I want to increment it. In straight sqlite, this is easy:\ndb = sqlite3.connect('mydata.sqlitedb')\ncur = db.cursor()\ncur.execute('update ta...
I'm looking for a strategy in as far as stopping the repetitive problem of branching out tables. For example as a fictitious use case, say I have a table with users that contains their name, login, password and other meta data. In this particular scenario, say the user is restricted to login per a specific subset of IP...
In database design, the decision to normalize or denormalize data often depends on the specific requirements of your application, including the frequency of read vs. write operations, the complexity of queries, and the overall performance needs. Here are some strategies to consider for your use case of storing user IPs...
28,910
[ { "from": "human", "value": "I'm looking for a strategy in as far as stopping the repetitive problem of branching out tables. For example as a fictitious use case, say I have a table with users that contains their name, login, password and other meta data. In this particular scenario, say the user is restri...
This is just to satisfy my own curiosity. Is there an implementation of this: float InvSqrt (float x) { float xhalf = 0.5f*x; int i = *(int*)&x; i = 0x5f3759df - (i>>1); x = *(float*)&i; x = x*(1.5f - xhalf*x*x); return x; } in C#? If it exists, post the code. I guess I should have mentioned I was...
Certainly! The `InvSqrt` function you posted is an implementation of the fast inverse square root algorithm, which is famous for its speed and was originally used in graphics programming. In C#, the equivalent code can be implemented in a "safe" manner using `BitConverter` or with an `unsafe` block. Here's how you cou...
28,463
[ { "from": "human", "value": "This is just to satisfy my own curiosity.\nIs there an implementation of this:\nfloat InvSqrt (float x)\n{\n float xhalf = 0.5f*x;\n int i = *(int*)&x;\n i = 0x5f3759df - (i>>1);\n x = *(float*)&i;\n x = x*(1.5f - xhalf*x*x);\n return x;\n}\n\nin C#? If it exists, p...
Ant has a nice way to select groups of files, most handily using ** to indicate a directory tree. E.g. **/CVS/* # All files immediately under a CVS directory. mydir/mysubdir/** # All files recursively under mysubdir More examples can be seen here: http://ant.apache.org/manual/dirtasks.html How would you i...
To implement a function in Python that simulates the Ant-like file selection pattern using `**`, you can leverage the `fnmatch` and `os` modules. The `fnmatch` module allows you to match file paths against patterns, while the `os` module can be used to walk through directories. Here's a simple implementation of the `g...
27,676
[ { "from": "human", "value": "Ant has a nice way to select groups of files, most handily using ** to indicate a directory tree. E.g.\n**/CVS/* # All files immediately under a CVS directory.\nmydir/mysubdir/** # All files recursively under mysubdir\n\nMore examples can be seen here:\nhttp://ant.a...
Does anyone have any strategies/tips/traps for moving to Team System? Should it be done in baby steps, or all at once? Should we migrate our SourceSafe library over, or draw a line in the sand and move forward? Is it worth brining SharePoint into the mix? Any thoughts are appreciated.
Migrating from a legacy system like SourceSafe to a more robust solution such as Team Foundation Server (TFS) or Azure DevOps (formerly known as VSTS) can be a significant undertaking. Here are some strategies, tips, and considerations to help ensure a smooth transition: ### Strategies for Migration 1. **Assess Your ...
29,106
[ { "from": "human", "value": "Does anyone have any strategies/tips/traps for moving to Team System? Should it be done in baby steps, or all at once? Should we migrate our SourceSafe library over, or draw a line in the sand and move forward? Is it worth brining SharePoint into the mix? Any thoughts are apprec...
I'm looking for ideas for a heap-manager to handle a very specific situation: Lots and lots of very small allocations, ranging from 12 to 64 bytes each. Anything bigger, I will pass on to the regular heap-manager, so only tiny blocks need be catered for. Only 4-byte alignment is needed. My main concerns are Overhead. ...
Designing a specialized heap manager for small allocations in the range of 12 to 64 bytes can greatly improve performance and reduce overhead. Below are several ideas and improvements that you could consider to optimize your current approach: ### 1. Block Pooling - **Segregated Free Lists:** Divide your memory pool i...
25,848
[ { "from": "human", "value": "I'm looking for ideas for a heap-manager to handle a very specific situation: Lots and lots of very small allocations, ranging from 12 to 64 bytes each. Anything bigger, I will pass on to the regular heap-manager, so only tiny blocks need be catered for. Only 4-byte alignment is...
I used to have a class in 1.1 for the Datagrid that inherited from the DataGridColumn class. This allowed me to create a check box column with a client-side un/check-all box in the header. Then as I designed my grid I would just add my custom column. I am currently on a project where I need similar functionality for th...
In ASP.NET Web Forms, the GridView control doesn't provide an extensibility mechanism similar to what you have with the DataGridColumn in the DataGrid. However, you can still create a custom solution that allows you to achieve similar functionality by extending the existing GridView control or creating a user control. ...
26,518
[ { "from": "human", "value": "I used to have a class in 1.1 for the Datagrid that inherited from the DataGridColumn class. This allowed me to create a check box column with a client-side un/check-all box in the header. Then as I designed my grid I would just add my custom column.\nI am currently on a project...
What is the best way to access an ASP.NET HiddenField control that is embedded in an ASP.NET PlaceHolder control through JavaScript? The Visible attribute is set to false in the initial page load and can changed via an AJAX callback. Here is my current source code: <script language="javascript" type="text/javascript">...
To access an ASP.NET `HiddenField` control embedded within a `PlaceHolder` and retrieve its value using JavaScript, you typically want to ensure that the control is rendered on the client-side first. Since the `Visible` property of the `PlaceHolder` is initially set to `false`, the `HiddenField` will not be rendered un...
25,893
[ { "from": "human", "value": "What is the best way to access an ASP.NET HiddenField control that is embedded in an ASP.NET PlaceHolder control through JavaScript? The Visible attribute is set to false in the initial page load and can changed via an AJAX callback.\nHere is my current source code:\n<script la...
std::auto_ptr is broken in VC++ 8 (which is what we use at work). My main gripe with it is that it allows auto_ptr<T> x = new T();, which of course leads to horrible crashes, while being simple to do by mistake. From an answer to another question here on stackoverflow: Note that the implementation of std::auto_ptr in ...
It sounds like you’ve done a thorough investigation into the issues with `std::auto_ptr` in Visual Studio 2005 and have explored alternative solutions. Given the context you've provided, let's summarize your findings and outline best practices when working with smart pointers in C++—especially in a legacy environment l...
29,888
[ { "from": "human", "value": "std::auto_ptr is broken in VC++ 8 (which is what we use at work). My main gripe with it is that it allows auto_ptr<T> x = new T();, which of course leads to horrible crashes, while being simple to do by mistake.\nFrom an answer to another question here on stackoverflow:\n\nNote ...
I have two models indexed for searching (User and Item). I'm trying to do a geo-search across models: ThinkingSphinx::Search.search('keywords', :geo => [ degrees_to_radians(params[:lat].to_f), degrees_to_radians(params[:lon].to_f) ], ) But I only get an error: Sphinx Error: index item_core,item_delta,user_core,u...
The issue you're experiencing with the geo-search across the `User` and `Item` models in Thinking Sphinx appears to be related to the missing latitude and longitude attributes in the query when you're combining the two models for a geo-search. Here are some steps to troubleshoot and resolve this issue: 1. **Check At...
30,395
[ { "from": "human", "value": "I have two models indexed for searching (User and Item). I'm trying to do a geo-search across models:\nThinkingSphinx::Search.search('keywords', :geo => [\n degrees_to_radians(params[:lat].to_f),\n degrees_to_radians(params[:lon].to_f)\n],\n)\nBut I only get an error: \nSphi...
I'm building a .NET 3.5 web app and I am thinking about all the fundamental issues as I work through the project, like monitoring, exception handling, the lot. The app will obviously be small in size when it is rolled out because it won't have a high load until the site is heavily promoted (lines of code/cyclomatic com...
Using Nagios, Monit, and Munin for monitoring a .NET application running on Windows is definitely possible, but it may require some additional steps to set up and configure properly. Here are some tips and suggestions based on common practices: ### Nagios on Windows 1. **Nagios Core**: Nagios is primarily a monitorin...
30,735
[ { "from": "human", "value": "I'm building a .NET 3.5 web app and I am thinking about all the fundamental issues as I work through the project, like monitoring, exception handling, the lot.\nThe app will obviously be small in size when it is rolled out because it won't have a high load until the site is heav...
I'm working on a REST service that has a few requirements: It has to be secure. Users should not be able to forge requests. My current proposed solution is to have a custom Authorization header that look like this (this is the same way that the amazon web services work): Authorization: MYAPI username:signature My qu...
To create a secure and forgery-proof REST service, your proposed approach of using an Authorization header is a solid foundation. However, it's essential to implement a few additional measures to ensure security and to prevent request forgery. ### 1. Signature Generation You will want to create a signature that inclu...
27,559
[ { "from": "human", "value": "I'm working on a REST service that has a few requirements:\n\nIt has to be secure.\nUsers should not be able to forge requests.\n\nMy current proposed solution is to have a custom Authorization header that look like this (this is the same way that the amazon web services work):\...
What are the main/best Maven repositories to use that will include the majority of your open source Java package dependencies. Also in what order should these be included? Does it matter?
When working with Maven for Java projects, there are several key repositories that are commonly used to manage open-source Java package dependencies. Here are the main repositories you might want to consider: ### Main Maven Repositories 1. **Maven Central Repository (Central)** - This is the primary repository for...
28,101
[ { "from": "human", "value": "What are the main/best Maven repositories to use that will include the majority of your open source Java package dependencies.\nAlso in what order should these be included? Does it matter?\n" }, { "from": "gpt", "value": "When working with Maven for Java projects, th...
Does Linux/Unix/Posix provide an API to user-space applications to access a monotonically increasing clock, with centisecond to millisecond accuracy? On Linux, /proc/uptime provides a string-based representation of a floating point number of the number of seconds the system has been up. gettimeofday(2) does not provide...
Yes, Linux provides APIs to access a monotonically increasing clock with sufficient accuracy, and there are several options you can consider. 1. **clock_gettime()**: This is the recommended way to access various clock types in Linux. You can use it with the `CLOCK_MONOTONIC` clock, which provides a monotonically incre...
29,741
[ { "from": "human", "value": "Does Linux/Unix/Posix provide an API to user-space applications to access a monotonically increasing clock, with centisecond to millisecond accuracy?\nOn Linux, /proc/uptime provides a string-based representation of a floating point number of the number of seconds the system has...
Nowadays, we have tons of Javascript libraries per page in addition to the Javascript files we write ourselves. How do you manage them all? How do you minify them in an organized way?
Managing multiple JavaScript libraries and files in a web project can quickly become overwhelming, especially as the complexity of your application grows. Here are some best practices and tools you can use to efficiently manage, organize, and minify your JavaScript files: ### 1. **Module Bundlers** Use module bundlers...
29,148
[ { "from": "human", "value": "Nowadays, we have tons of Javascript libraries per page in addition to the Javascript files we write ourselves. How do you manage them all? How do you minify them in an organized way? \n" }, { "from": "gpt", "value": "Managing multiple JavaScript libraries and fi...
Is it possible to add an image overlay to a google map that scales as the user zooms? My current code works like this: var map = new GMap2(document.getElementById("gMap")); var customIcon = new GIcon(); customIcon.iconSize = new GSize(100, 100); customIcon.image = "/images/image.png"; map.addOverlay(new GMarker(new G...
In the Google Maps JavaScript API, if you want to add an image overlay that scales with the map zoom level, you can use the `OverlayView` class to create a custom overlay. This way, you can control how the overlay behaves in relation to the map's zoom level. Here's an example of how you can create a scaling image ove...
26,349
[ { "from": "human", "value": "Is it possible to add an image overlay to a google map that scales as the user zooms?\nMy current code works like this:\nvar map = new GMap2(document.getElementById(\"gMap\"));\n\nvar customIcon = new GIcon();\ncustomIcon.iconSize = new GSize(100, 100);\ncustomIcon.image = \"/im...
Consider I'm interfacing with an external system that will send a message (DB table, message queue, web service) in some format. In the "message header" there is the "MessageType" that is a number from 1 to 20. The MessageType defines what to do with the rest of the message. There are things like new, modified, dele...
You raise an important question regarding the balance between maintainability and simplicity when designing a system to handle a series of message types defined by a number. Let's explore the considerations surrounding the use of switch/case versus a table-driven approach, and how to decide when to transition between t...
28,898
[ { "from": "human", "value": "Consider I'm interfacing with an external system that will send a message (DB table, message queue, web service) in some format. In the \"message header\" there is the \"MessageType\" that is a number from 1 to 20. The MessageType defines what to do with the rest of the messag...
My group has a source analysis tool that enforces certain styles that we have to comply with. I can't change it, and some of the rules are just a pain. One example is that all properties have to come before methods, and all constructors must come before properties. It seems silly to me that I have to take time to do...
It sounds like you're dealing with some strict coding style guidelines that can be cumbersome, especially if they don't align with your personal preferences. Fortunately, there are tools and extensions for Visual Studio that can help automate code formatting and organization according to your specified rules. ### Reco...
29,283
[ { "from": "human", "value": "My group has a source analysis tool that enforces certain styles that we have to comply with. I can't change it, and some of the rules are just a pain. One example is that all properties have to come before methods, and all constructors must come before properties. It seems s...
I'm setting up a solution to deploy, driven by a batch file so it's reproducible - I've got a binding file that works but I've now added on my MSMQ adapters - works on my local machine, but I've found I have to add a userid and password to get it to work on the actual server - it's in the domain, my virtual dev mac...
When dealing with MSMQ adapters and needing to authenticate in a domain environment, it is indeed a concern to include user IDs and passwords in a clear text format due to security risks. Here are a few options to handle the situation without hardcoding sensitive information in your scripts: ### 1. **Use Windows Authe...
29,409
[ { "from": "human", "value": "I'm setting up a solution to deploy, driven by a batch file so it's reproducible \n- I've got a binding file that works but I've now added on my MSMQ adapters\n- works on my local machine, but I've found I have to add a userid and password to get it to work on the actual server\...
I am trying to to walk though the tree of PdfItem objects in an existing PDF document using PDFSharp in c#. I want to create a hierarchy of all the objects as I go along -- similar to what the "PDF Explorer" example does -- but I want it to be a tree instead of a flat list of all the objects. The root node is document...
To walk through the tree of `PdfItem` objects in a PDF document using PDFSharp in C#, you'll want to perform a depth-first search (DFS) while keeping track of the visited objects to handle circular references. Below is an example code snippet that shows how to achieve this: 1. Create a `TreeNode` class to represent ea...
25,960
[ { "from": "human", "value": "I am trying to to walk though the tree of PdfItem objects in an existing PDF document using PDFSharp in c#. \nI want to create a hierarchy of all the objects as I go along -- similar to what the \"PDF Explorer\" example does -- but I want it to be a tree instead of a flat list o...
Looking to hear from people who are using WCF in an enterprise environment. What were the major hurdles with the roll out? Performance issues? Any and all tips appreciated! Please provide some general statistics and server configs if you can!
When implementing Windows Communication Foundation (WCF) in an enterprise environment, many organizations encounter a variety of challenges and hurdles. Here are some common issues, performance considerations, and best practices based on experiences from enterprises that have used WCF. ### Major Hurdles During Rollout...
24,137
[ { "from": "human", "value": "Looking to hear from people who are using WCF in an enterprise environment.\nWhat were the major hurdles with the roll out?\nPerformance issues?\nAny and all tips appreciated!\nPlease provide some general statistics and server configs if you can!\n" }, { "from": "gpt", ...
Is there a specific reason why I should be using the Html.CheckBox, Html.TextBox, etc methods instead of just manually writing the HTML? <%= Html.TextBox("uri") %> renders the following HTML <input type="text" value="" name="uri" id="uri"/> It guess it saves you a few key strokes but other than that. Is there a spec...
Using HTML helpers like `Html.TextBox`, `Html.CheckBox`, etc., instead of writing raw HTML can provide several benefits, particularly in the context of ASP.NET MVC. Here are some reasons to consider using HTML helpers: ### 1. **Automatic Model Binding** HTML helpers automatically manage the name attributes of form ele...
30,222
[ { "from": "human", "value": "Is there a specific reason why I should be using the Html.CheckBox, Html.TextBox, etc methods instead of just manually writing the HTML?\n<%= Html.TextBox(\"uri\") %>\n\nrenders the following HTML\n<input type=\"text\" value=\"\" name=\"uri\" id=\"uri\"/>\n\nIt guess it saves yo...
Is there a good .NET file syncing library? It can be pretty basic and only needs to work on local and mapped drives (no server client model like rsync is needed). And yes, I know there is the MS Sync Services, but that is a lot more than what I need.
If you're looking for a simple .NET file syncing library that works on local and mapped drives without the complexity of MS Sync Services, there are several options you might consider: 1. **LibSassNet**: This is a library that enables synchronization of files and directories. While not specifically a "sync library," y...
27,749
[ { "from": "human", "value": "Is there a good .NET file syncing library? It can be pretty basic and only needs to work on local and mapped drives (no server client model like rsync is needed).\nAnd yes, I know there is the MS Sync Services, but that is a lot more than what I need. \n" }, { "from": "...
Is there an ASP.NET AJAX framework other than just using UpdatePanel & Friends or the ASP.NET AjaxControlToolkit? Currently I am using plain ICallbackEventHandler calls but it gets quite complicated a while as a lot of serialization needs to be done. Any suggestions?
Yes, there are several alternatives to using UpdatePanel and the ASP.NET AjaxControlToolkit for implementing AJAX functionality in ASP.NET applications. Here are some options you can consider: 1. **ASP.NET Web API**: If you are working with ASP.NET, you might want to consider using ASP.NET Web API to create RESTful se...
27,720
[ { "from": "human", "value": "Is there an ASP.NET AJAX framework other than just using UpdatePanel & Friends or the ASP.NET AjaxControlToolkit?\nCurrently I am using plain ICallbackEventHandler calls but it gets quite complicated a while as a lot of serialization needs to be done.\nAny suggestions?\n" }, ...
I've a fairly huge .gdbinit (hence not copied here) in my home directory. Now if I want to debug code inside Xcode I get this error: Failed to load debugging library at: /Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/PBGDBIntrospectionSupport.A.dylib Custom data formatt...
The error message you're encountering suggests that Xcode's debugger (which is based on GDB or LLDB) is having trouble loading a specific dynamic library related to data formatters. Since this issue arises only when your `.gdbinit` file is present, it indicates that some configuration or setting in that file is conflic...
29,293
[ { "from": "human", "value": "I've a fairly huge .gdbinit (hence not copied here) in my home directory.\nNow if I want to debug code inside Xcode I get this error: \nFailed to load debugging library at:\n\n/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/PBGDBIntr...
Given a large API (an in particular, the Java or J2EE standard libraries), is there a tool or search engine or other resource that can tells me which methods, classes, or even packages people in general tend to use the most? I am annotating (see below) APIs and would like to focus my attention on popular areas. The onl...
There are several approaches and tools you can use to identify popular methods, classes, or packages within large APIs like the Java or J2EE standard libraries. Here are a few suggestions: 1. **Usage Analytics and Code Search Engines**: - **GitHub**: You can leverage the GitHub search functionality to find reposito...
30,917
[ { "from": "human", "value": "Given a large API (an in particular, the Java or J2EE standard libraries), is there a tool or search engine or other resource that can tells me which methods, classes, or even packages people in general tend to use the most?\nI am annotating (see below) APIs and would like to fo...
I have a class derived from CTreeCtrl. In OnCreate() I replace the default CToolTipCtrl object with a custom one: int CMyTreeCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CTreeCtrl::OnCreate(lpCreateStruct) == -1) return -1; // Replace tool tip with our own which will // ask us for the text t...
The issue you're facing with the `TTN_NEEDTEXT` message not being received by your `CMyTreeCtrl` likely has to do with how tool tips are being managed in conjunction with the parent window (which is a `CDockablePane` in your case) and how the tool tip control is being set up. Here are some suggestions to help you trou...
28,832
[ { "from": "human", "value": "I have a class derived from CTreeCtrl. In OnCreate() I replace the default CToolTipCtrl object with a custom one:\nint CMyTreeCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)\n{\n if (CTreeCtrl::OnCreate(lpCreateStruct) == -1)\n return -1;\n\n // Replace tool tip with ...
Jeff wrote about getting a file version/datestamp a while back. Visual studio doesn't increment builds unless you close/reopen the solution, so grabbing the timestamp seems to be the best way to verify what build you are using. I ported the solution to C# // from http://www.codinghorror.com/blog/archives/000264.htm...
Using the method you provided to get the linker timestamp is a common approach to determine when a .NET assembly was built. However, there are some alternative approaches and additional methods you can consider to track the deployment date of a web application. ### Alternative Approaches 1. **File System Timestamps**...
30,234
[ { "from": "human", "value": "Jeff wrote about getting a file version/datestamp a while back. Visual studio doesn't increment builds unless you close/reopen the solution, so grabbing the timestamp seems to be the best way to verify what build you are using.\nI ported the solution to C#\n // from http://ww...
I'm have written an msi file that offers a choice of "per-user" or "for all" installation in the UI phase, and now find that the installer fails on Vista: if I just reuse the installer that works for XP, Vista will trigger a UAC prompt even for the "per-user" installation, making that installation pointless if I turn ...
To address your issue with the UAC (User Account Control) behavior when running an MSI installer on Windows Vista, you need to understand how the installation context is managed between per-user and per-machine installations. When designing an MSI file, especially for Windows Vista and later operating systems, you ne...
26,660
[ { "from": "human", "value": "I'm have written an msi file that offers a choice of \"per-user\" or \"for all\" installation in the UI phase, and now find that the installer fails on Vista:\n\nif I just reuse the installer that works for XP, Vista will trigger a UAC prompt even for the \"per-user\" installati...
I made previously a question: error handling when taking user input and I made the suggested changes: char displayMainMenu() { char mainMenuChoice; cout << "\nQuadratic equation: a*X^2 + b*X + c = 0 main menu: "; cout << "\n <r> Give new coefficients"; cout << "\n <c> Calculate equations solutions"; cout << "\n <t...
The issue you are encountering is due to how `cin` handles input when the user enters a string longer than a single character. When you enter "ter", `cin` reads the first character ('t') and leaves the rest ("er") in the input buffer, which causes subsequent reads to fail and enter the default case. To properly handle...
29,646
[ { "from": "human", "value": "I made previously a question:\nerror handling when taking user input\nand I made the suggested changes:\nchar displayMainMenu()\n{\nchar mainMenuChoice;\ncout << \"\\nQuadratic equation: a*X^2 + b*X + c = 0 main menu: \"; \ncout << \"\\n <r> Give new coefficients\"; \ncout << \...