instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
In TFS when you merge branch A to branch B and checkin, you get a single changeset on B (typically with a comment like "merged A->B"). This means B doesn't have any of the checkin history from A. So if someone created a new file on branch A, you can't tell who created it from branch B. And if someone updated a file...
In Team Foundation Server (TFS), tracking detailed history across branches after a merge can indeed be challenging due to the way merges are represented in changesets. Unfortunately, the built-in tools, including TFS Power Tools and the `tfpt history` command, often do not expand merges to show detailed commit history ...
4,511
[ { "from": "human", "value": "In TFS when you merge branch A to branch B and checkin, you get a single changeset on B (typically with a comment like \"merged A->B\"). \nThis means B doesn't have any of the checkin history from A. So if someone created a new file on branch A, you can't tell who created it f...
I have findbugs plugin for eclipse which when run on my project will show results in Bugs explorer clubbed by the type of bug. I need to be able to do two things: Export all these to excel sheet Find out the bugs reported in a set of files (and be able to do it recursively w/o running for whole project and exporting a...
To achieve your goals of exporting FindBugs results to an Excel sheet and identifying bugs in a specific set of files without running it on the whole project, here are some suggestions: ### Exporting FindBugs Results to Excel 1. **Exporting the Results**: - FindBugs allows you to generate reports in various format...
3,993
[ { "from": "human", "value": "I have findbugs plugin for eclipse which when run on my project will show results in Bugs explorer clubbed by the type of bug.\nI need to be able to do two things:\n\nExport all these to excel sheet\nFind out the bugs reported in a set of files (and be able to do it recursively ...
I have a message broker with some topics, and some set of applications running on it. Now I want to run a new set of the same applications (say for QA environment) on the same topics (on the same broker, if I could). What is the best way to do this. Creating a new broker and or creating a new set of topics is cumbersom...
Running a new set of applications in a Quality Assurance (QA) environment while using the same message broker and topics as your existing applications can be tricky, but it's feasible with a careful approach. Here are some strategies to consider: ### 1. **Use Different Consumer Groups** If your message broker supports...
4,487
[ { "from": "human", "value": "I have a message broker with some topics, and some set of applications running on it. Now I want to run a new set of the same applications (say for QA environment) on the same topics (on the same broker, if I could). What is the best way to do this. Creating a new broker and or ...
I'm using an Ubuntu 8.04 (x86_64) machine to connect to my employer's Cisco VPN. (The client didn't compile out of the box, but I found patches to update the client to compile on kernels released in the last two years.) This all works great, until my DHCP client decides to renew its lease and updates /etc/resolv.conf, ...
Yes, there are several ways to prevent your DHCP client from overwriting `/etc/resolv.conf` while connected to your VPN. Here are a few methods you can consider: ### Method 1: Use a Static `/etc/resolv.conf` One of the simplest methods is to manually configure the DNS settings in `/etc/resolv.conf` and then make it i...
4,755
[ { "from": "human", "value": "I'm using an Ubuntu 8.04 (x86_64) machine to connect to my employer's Cisco VPN. (The client didn't compile out of the box, but I found patches to update the client to compile on kernels released in the last two years.) This all works great, until my DHCP client decides to renew...
Not entirely sure what's going on here; any help would be appreciated. I'm trying to create a new .NET MVC web app. I was pretty sure I had it set up correctly, but I'm getting the following error: The type 'System.Web.Mvc.ViewPage' is ambiguous: it could come from assembly 'C:\MyProject\bin\System.Web.Mvc.DLL' or fro...
The error message you are encountering indicates that there is a name collision for the `System.Web.Mvc.ViewPage` type. This situation typically arises when the same type is defined in multiple assemblies, and the compiler cannot determine which one to use. Here's how you can resolve the issue: ### 1. Check for Dupli...
6,831
[ { "from": "human", "value": "Not entirely sure what's going on here; any help would be appreciated.\nI'm trying to create a new .NET MVC web app. I was pretty sure I had it set up correctly, but I'm getting the following error:\nThe type 'System.Web.Mvc.ViewPage' is ambiguous: it could come from assembly \n...
In Firefox you can enter the following into the awesome bar and hit enter: javascript:self.resizeTo(1024,768); How do you do the same thing in IE?
In Internet Explorer, you can achieve a similar effect by using the Developer Tools (F12) to run JavaScript, but you can't directly resize the browser window through the address bar like you can in Firefox. Here's how you can do it: 1. **Open Internet Explorer.** 2. **Press `F12`** to open the Developer Tools. 3. Navi...
8,115
[ { "from": "human", "value": "In Firefox you can enter the following into the awesome bar and hit enter:\njavascript:self.resizeTo(1024,768);\n\nHow do you do the same thing in IE?\n" }, { "from": "gpt", "value": "In Internet Explorer, you can achieve a similar effect by using the Developer Tools...
I have a Perl script that I'm attempting to set up using Perl Threads (use threads). When I run simple tests everything works, but when I do my actual script (which has the threads running multiple SQLPlus sessions), each SQLPlus session runs in order (i.e., thread 1's sqlplus runs steps 1-5, then thread 2's sqlplus r...
It sounds like you're encountering an issue with concurrency in your Perl script using threads. In Perl, when using threads, you should be able to achieve concurrent execution. However, there are a few things you should consider that could cause the behavior you're seeing where the threads are executing in a serialized...
4,020
[ { "from": "human", "value": "I have a Perl script that I'm attempting to set up using Perl Threads (use threads). When I run simple tests everything works, but when I do my actual script (which has the threads running multiple SQLPlus sessions), each SQLPlus session runs in order (i.e., thread 1's sqlplus ...
Visually both of the following snippets produce the same UI. So why are there 2 controls.. Snippet1 <TextBlock>Name:</TextBlock> <TextBox Name="nameTextBox" /> Snippet2 <Label>Name:</Label> <TextBox Name="nameTextBox" /> (Well I am gonna answer this myself... thought this is a useful tidbit I learnt today from Progr...
You're right! While both snippets visually produce the same UI, they serve different purposes and have different functionalities in WPF (Windows Presentation Foundation). 1. **TextBlock**: In Snippet 1, the `<TextBlock>` control is used solely for displaying text. It does not provide any additional functionality beyon...
7,070
[ { "from": "human", "value": "Visually both of the following snippets produce the same UI. So why are there 2 controls..\nSnippet1 \n<TextBlock>Name:</TextBlock>\n<TextBox Name=\"nameTextBox\" />\n\nSnippet2\n<Label>Name:</Label>\n<TextBox Name=\"nameTextBox\" />\n\n(Well I am gonna answer this myself... tho...
What are the best practices in setting up a new instance of TFS 2008 Workgroup edition? Specifically, the constraints are as follows: Must install on an existing Windows Server 2008 64 bit TFS application layer is 32 bit only Should I install SQL Server 2008, Sharepoint and the app layer in a virtual instance of Wi...
Setting up a new instance of Team Foundation Server (TFS) 2008 Workgroup Edition requires careful consideration to ensure optimal performance and maintainability, especially given your constraints. Here are some best practices for your setup: ### 1. Use Virtual Machines Wisely - **Dedicated VM for TFS**: Set up a ded...
4,361
[ { "from": "human", "value": "What are the best practices in setting up a new instance of TFS 2008 Workgroup edition? \nSpecifically, the constraints are as follows:\n\nMust install on an existing Windows Server 2008 64 bit\nTFS application layer is 32 bit only\n\nShould I install SQL Server 2008, Sharepoin...
Has anyone come up with a good way of performing full text searches (FREETEXT() CONTAINS()) for any number of arbitrary keywords using standard LinqToSql query syntax? I'd obviously like to avoid having to use a Stored Proc or have to generate a Dynamic SQL calls. Obviously I could just pump the search string in on a p...
Using full-text search capabilities like `FREETEXT()` and `CONTAINS()` in SQL Server with LINQ to SQL can be tricky since LINQ to SQL doesn't natively support these functions. However, you can achieve your goal by combining LINQ with some raw SQL functions, particularly by using `SqlMethods` or through LINQ's `AsQuerya...
6,250
[ { "from": "human", "value": "Has anyone come up with a good way of performing full text searches (FREETEXT() CONTAINS()) for any number of arbitrary keywords using standard LinqToSql query syntax?\nI'd obviously like to avoid having to use a Stored Proc or have to generate a Dynamic SQL calls.\nObviously I ...
I have a problem with some zombie-like processes on a certain server that need to be killed every now and then. How can I best identify the ones that have run for longer than an hour or so?
To identify zombie-like processes (defunct processes) that are running longer than an hour on your server, you can use the following methods: ### 1. Understanding Zombie Processes First, it's important to clarify that "zombie" processes are technically processes that have completed execution but still have an entry in...
4,840
[ { "from": "human", "value": "I have a problem with some zombie-like processes on a certain server that need to be killed every now and then. How can I best identify the ones that have run for longer than an hour or so?\n" }, { "from": "gpt", "value": "To identify zombie-like processes (defunct p...
I've been working on an embedded C/C++ project recently using the shell in Tornado 2 as a way of debugging what's going on in our kit. The only problem with this approach is that it's a complicated system and as a result, has a fair bit of output. Tornado 'helpfully' scrolls the window every time some new information a...
Redirecting the output from the Tornado shell in a way that you can log it for filtering can be quite challenging, especially given the constraints you mentioned (using Tornado 2.1.0 and the limitations on upgrading). However, here are a few approaches you might consider: ### 1. Use a Virtual Serial Port If the embedd...
6,808
[ { "from": "human", "value": "I've been working on an embedded C/C++ project recently using the shell in Tornado 2 as a way of debugging what's going on in our kit. The only problem with this approach is that it's a complicated system and as a result, has a fair bit of output. Tornado 'helpfully' scrolls the...
I have heard of some methods, but none of them have stuck. Personally I try to avoid complex types in C and try to break them into component typedef. I'm now faced with maintaining some legacy code from a so called 'three star programmer', and I'm having a hard time reading some of the ***code[][]. How do you read comp...
Understanding complex declarations in C can indeed be challenging, especially when dealing with pointers, arrays, and functions. To effectively read and understand complex C declarations, consider the following steps and tips: ### 1. **Break It Down** Start by breaking the declaration down into its components. Each pa...
5,287
[ { "from": "human", "value": "I have heard of some methods, but none of them have stuck. Personally I try to avoid complex types in C and try to break them into component typedef.\nI'm now faced with maintaining some legacy code from a so called 'three star programmer', and I'm having a hard time reading som...
I have a little dilemma that maybe you can help me sort out. I've been working today in modifying ASP.NET's Membership to add a level of indirection. Basically, ASP.NET's Membership supports Users and Roles, leaving all authorization rules to be based on whether a user belongs to a Role or not. What I need to do is a...
Your dilemma revolves around designing an abstract class with overloads in a way that encourages correct implementation while minimizing the risk of misuse. This is a common challenge in class design, particularly when it comes to handling method overloads. ### General Approaches to Your Scenario 1. **Abstract Method...
2,184
[ { "from": "human", "value": "I have a little dilemma that maybe you can help me sort out. \nI've been working today in modifying ASP.NET's Membership to add a level of indirection. Basically, ASP.NET's Membership supports Users and Roles, leaving all authorization rules to be based on whether a user belongs...
In VxWorks, I am creating a mutex with the SEM_INVERSION_SAFE option, to protect against the priority inversion problem. The manual says that I must also use the SEM_PRIORITY_Q option. Why is that?
In VxWorks, when you create a semaphore with the `SEM_INVERSION_SAFE` option, it is specifically designed to help mitigate the effects of priority inversion. Priority inversion occurs when a higher-priority task is waiting for a lower-priority task to release a resource (like a mutex or semaphore), which can lead to un...
6,859
[ { "from": "human", "value": "In VxWorks, I am creating a mutex with the SEM_INVERSION_SAFE option, to protect against the priority inversion problem.\nThe manual says that I must also use the SEM_PRIORITY_Q option. Why is that?\n" }, { "from": "gpt", "value": "In VxWorks, when you create a sema...
Say I'm building an ASP.Net class that inherits from IHttpHandler, should I wire this up to a URL ending in .ashx, or should I use the .axd extension? Does it matter as long as there's no naming conflict?
When you're building an ASP.NET class that implements the `IHttpHandler` interface, the choice between using the `.ashx` and `.axd` file extensions generally depends on the intended use case and conventions within your application. Here's a breakdown of the two options: 1. **.ashx extension**: - This extension is s...
6,704
[ { "from": "human", "value": "Say I'm building an ASP.Net class that inherits from IHttpHandler, should I wire this up to a URL ending in .ashx, or should I use the .axd extension? \nDoes it matter as long as there's no naming conflict?\n" }, { "from": "gpt", "value": "When you're building an ASP...
We are using SourceForge Enterprise Edition 4.4 in one of our project. My question is, in CollabNet SFEE (SourceForge Enterprise Edition 4.4), how will we get attachments associated with an Artifacts Using SFEE SOAP API? We have made our own .net 2.0 client. We are not using .net SDK provided by Collabnet,
To retrieve attachments associated with an artifact using the SourceForge Enterprise Edition (SFEE) SOAP API, you will typically need to follow these general steps. Since you are using a .NET 2.0 client and not the SDK provided by Collabnet, you will need to make raw SOAP calls. 1. **Understand the SOAP API**: First, ...
5,163
[ { "from": "human", "value": "We are using SourceForge Enterprise Edition 4.4 in one of our project.\nMy question is, in CollabNet SFEE (SourceForge Enterprise Edition 4.4), how will we get attachments associated with an Artifacts Using SFEE SOAP API?\nWe have made our own .net 2.0 client. We are not using ....
What's the current status of Mono's Platform Invoke implementation on Linux and on Solaris?
As of my last update in October 2023, Mono's Platform Invoke (P/Invoke) implementation allows .NET applications to call functions in native libraries written in languages such as C or C++. Mono has made significant strides in supporting P/Invoke across various platforms, including Linux and Solaris. On **Linux**, Mono...
8,259
[ { "from": "human", "value": "What's the current status of Mono's Platform Invoke implementation on Linux and on Solaris?\n" }, { "from": "gpt", "value": "As of my last update in October 2023, Mono's Platform Invoke (P/Invoke) implementation allows .NET applications to call functions in native li...
I am trying to populate a string with a double value using a sprintf like this: sprintf(S, "%f", val); But the precision is being cut off to six decimal places. I need about 10 decimal places for the precision. How can that be achieved?
To achieve a precision of 10 decimal places in your output using `sprintf`, you can specify the precision in the format string. The format for a floating-point number with a specified precision in `sprintf` is `%.nf`, where `n` is the number of decimal places you want. In your case, if you want to print a double value...
7,973
[ { "from": "human", "value": "I am trying to populate a string with a double value using a sprintf like this:\nsprintf(S, \"%f\", val);\n\nBut the precision is being cut off to six decimal places. I need about 10 decimal places for the precision.\nHow can that be achieved?\n" }, { "from": "gpt", ...
My application dynamically loads assemblies at runtime from specific subfolders. These assemblies are compiled with dependencies to other assemblies. The runtime trys to load these from the application directory. But I want to put them into the modules directory. Is there a way to tell the runtime that the dlls are in ...
Yes, you can specify additional directories for the .NET runtime to search for assemblies by handling the `AppDomain.AssemblyResolve` event. This event is triggered whenever the runtime cannot find an assembly to load. In this event handler, you can provide the logic to load the assembly from a specific subfolder. Her...
4,002
[ { "from": "human", "value": "My application dynamically loads assemblies at runtime from specific subfolders. These assemblies are compiled with dependencies to other assemblies. The runtime trys to load these from the application directory. But I want to put them into the modules directory.\nIs there a way...
After reading this description of late static binding (LSB) I see pretty clearly what is going on. Now, under which sorts of circumstances might that be most useful or needed?
Late static binding (LSB) is a concept often associated with object-oriented programming languages, particularly in the context of inheritance and polymorphism. It allows for method resolution to occur at runtime based on the actual object type rather than the type defined at compile time. This provides several advanta...
7,421
[ { "from": "human", "value": "After reading this description of late static binding (LSB) I see pretty clearly what is going on. Now, under which sorts of circumstances might that be most useful or needed?\n" }, { "from": "gpt", "value": "Late static binding (LSB) is a concept often associated wi...
I just started using the WPF WebBrowser that is included in Net 3.5 SP1. I built my setup project (which I have been using prior to moving to 3.5 SP1) and installed it on a test machine but the WebBrowser was not available. What must I do to be sure that the setup.exe/msi combination checks for and installs SP1?
To ensure that your setup project checks for and installs .NET Framework 3.5 SP1 on the target machine, you can follow these steps: 1. **Use the Prerequisites Feature**: In your setup project, you can specify prerequisites. This feature allows you to select the necessary components that should be installed prior to yo...
6,906
[ { "from": "human", "value": "I just started using the WPF WebBrowser that is included in Net 3.5 SP1. I built my setup project (which I have been using prior to moving to 3.5 SP1) and installed it on a test machine but the WebBrowser was not available.\nWhat must I do to be sure that the setup.exe/msi comb...
I need to remotely install windows service on number of computers, so I use CreateService() and other service functions from winapi. I know admin password and user name for machines that I need access to. In order to gain access to remote machine I impersonate calling process with help of LogonUser like this: //all...
When dealing with machines that are out of a domain, the approach using `LogonUser()` and impersonation becomes a bit more complicated. For such machines, you will need to account for the fact that they rely on local accounts, and you cannot use domain credentials. Instead, you will use the local account credentials th...
3,564
[ { "from": "human", "value": "I need to remotely install windows service on number of computers, so I use CreateService() and other service functions from winapi. I know admin password and user name for machines that I need access to. In order to gain access to remote machine I impersonate calling process wi...
I need to find out the external IP of the computer a C# application is running on. In the application I have a connection (via .NET remoting) to a server. Is there a good way to get the address of the client on the server side? (I have edited the question, to be a little more clear. I'm apologize to all kind people wh...
It looks like you've successfully implemented a way to retrieve the external IP address of a client in a C# application using .NET Remoting. By creating a custom `IServerChannelSinkProvider` and `IServerChannelSink`, you've intercepted the message processing to access the `CommonTransportKeys.IPAddress`. This method al...
6,249
[ { "from": "human", "value": "I need to find out the external IP of the computer a C# application is running on. \nIn the application I have a connection (via .NET remoting) to a server. Is there a good way to get the address of the client on the server side?\n(I have edited the question, to be a little more...
We are rewriting our legacy accounting system in VB.NET and SQL Server. We brought in a new team of .NET/ SQL Programmers to do the rewrite. Most of the system is already completed with the dollar amounts using floats. The legacy system language, I programmed in, did not have a float, so I probably would have used a de...
When designing a system for handling currency and dollar amounts, the choice between using `float` (or `double`) versus `decimal` is critical and can have significant implications. Here’s a detailed breakdown of the two data types with their pros and cons, specifically in the context of financial applications. ### Dec...
3,308
[ { "from": "human", "value": "We are rewriting our legacy accounting system in VB.NET and SQL Server. We brought in a new team of .NET/ SQL Programmers to do the rewrite. Most of the system is already completed with the dollar amounts using floats. The legacy system language, I programmed in, did not have a ...
How can I split long commands over multiple lines in a batch file?
In a Windows batch file, you can split long commands over multiple lines by using the caret (`^`) character at the end of the line you want to continue. This character tells the command interpreter to treat the following line as a continuation of the current line. Here's an example of how to do this: ```batch @echo o...
5,968
[ { "from": "human", "value": "How can I split long commands over multiple lines in a batch file?\n" }, { "from": "gpt", "value": "In a Windows batch file, you can split long commands over multiple lines by using the caret (`^`) character at the end of the line you want to continue. This character...
In a C# console app I have the need to extract the text from an RTF string, add some more text to it, and then convert it back into RTF. I have been able to do this using the System.Windows.Forms.RichTextBox class, but I find it a bit odd to use a Forms control in a non-Forms app. Any better way to do this?
Yes, while using `System.Windows.Forms.RichTextBox` is a common way to handle RTF text in .NET applications, it can feel out of place in a console application. Fortunately, there are alternatives that allow you to manipulate RTF without relying on Windows Forms controls. One option is to use a library such as **RTF to...
5,303
[ { "from": "human", "value": "In a C# console app I have the need to extract the text from an RTF string, add some more text to it, and then convert it back into RTF. I have been able to do this using the System.Windows.Forms.RichTextBox class, but I find it a bit odd to use a Forms control in a non-Forms a...
I've been running Tomcat 5.5 with Java 1.4 for a while now with a huge webapp. Most of the time it runs fine, but sometimes it will just hang, with no exception generated, and no apparant way of getting it to run again other than re-starting Tomcat. The tomcat instance is allowed a gigabyte of memory on the heap, but...
The issue you’re experiencing with Tomcat 5.5 and Java 1.4 hanging could be caused by a variety of factors, especially since both the Tomcat version and Java version you're using are quite old. Here are some possible causes and solutions to consider: 1. **Thread Blocking**: One of the common reasons for a web server h...
5,944
[ { "from": "human", "value": "I've been running Tomcat 5.5 with Java 1.4 for a while now with a huge webapp. Most of the time it runs fine, but sometimes it will just hang, with no exception generated, and no apparant way of getting it to run again other than re-starting Tomcat. The tomcat instance is allo...
What mechanisms do you know that prevent your site from being abused by anonymous spammers. For example, let's say that I have a site where people can vote something. But I don't want someone to spam something all the way to the top. So I found (a) creating an account and only allowed to vote once and (b) CAPTCHA to de...
To prevent abuse from anonymous spammers on a site that allows user-generated content, such as voting, there are several effective mechanisms that can be implemented alongside account creation and CAPTCHA. Here are some additional methods and their effectiveness: 1. **Rate Limiting**: - **Description**: Limit the ...
1,167
[ { "from": "human", "value": "What mechanisms do you know that prevent your site from being abused by anonymous spammers.\nFor example, let's say that I have a site where people can vote something. But I don't want someone to spam something all the way to the top. So I found (a) creating an account and only ...
Another easy one hopefully. Let's say I have a collection like this: List<DateTime> allDates; I want to turn that into List<List<DateTime>> dividedDates; where each List in 'dividedDates' contains all of the dates in 'allDates' that belong to a distinct year. Is there a bit of LINQ trickery that my tired mind can't ...
You can achieve this using LINQ's `GroupBy` method in a concise way. The idea is to group the dates by their year and then convert the groups into lists. Here's how you can do it: ```csharp using System; using System.Collections.Generic; using System.Linq; public class Program { public static void Main() { ...
7,975
[ { "from": "human", "value": "Another easy one hopefully.\nLet's say I have a collection like this:\nList<DateTime> allDates;\n\nI want to turn that into \nList<List<DateTime>> dividedDates;\n\nwhere each List in 'dividedDates' contains all of the dates in 'allDates' that belong to a distinct year.\nIs there...
What are the most common things to test in a new site? For instance to prevent exploits by bots, malicious users, massive load, etc.? And just as importantly, what tools and approaches should you use? (some stress test tools are really expensive/had to use, do you write your own? etc) Common exploits that should be che...
Testing a new site for vulnerabilities, performance, and functionality is crucial to ensure its security, reliability, and user experience. Below is a comprehensive checklist, including common exploits to look out for and recommended tools and approaches for testing. ### Checklist for Testing a New Site #### 1. **Sec...
1,964
[ { "from": "human", "value": "What are the most common things to test in a new site?\nFor instance to prevent exploits by bots, malicious users, massive load, etc.?\nAnd just as importantly, what tools and approaches should you use?\n(some stress test tools are really expensive/had to use, do you write your ...
I lost my MySQL username and password. How do I retrieve it?
If you have lost your MySQL username and password, there are several steps you can take to recover or reset them. Here's how you can go about it: ### Step 1: Check Common Usernames If you're unsure about the username, try common ones: - `root` - `admin` - `mysql` ### Step 2: Check Configuration Files If you have appl...
5,744
[ { "from": "human", "value": "I lost my MySQL username and password. How do I retrieve it?\n" }, { "from": "gpt", "value": "If you have lost your MySQL username and password, there are several steps you can take to recover or reset them. Here's how you can go about it:\n\n### Step 1: Check Common...
What is the best way of doing case-insensitive string comparison in C++ without transforming a string to all uppercase or all lowercase? Please indicate whether the methods are Unicode-friendly and how portable they are.
In C++, performing case-insensitive string comparisons without transforming the entire string to upper or lower case can be accomplished using locale-aware comparisons and standard library features. Here are some methods to achieve this: ### 1. Using `std::equal` with a Custom Comparator You can use `std::equal` with ...
2,655
[ { "from": "human", "value": "What is the best way of doing case-insensitive string comparison in C++ without transforming a string to all uppercase or all lowercase?\nPlease indicate whether the methods are Unicode-friendly and how portable they are.\n" }, { "from": "gpt", "value": "In C++, perf...
Can I write a plug in for Microsoft SQL Enterprise Manager which changes the query window background if the query window points to a production database?
Creating a plugin or extension for Microsoft SQL Server Management Studio (SSMS), which includes Enterprise Manager, to change the query window background color based on the database context is not straightforward, as SSMS does not natively support plugins like some other software does. However, there are some approach...
5,782
[ { "from": "human", "value": "Can I write a plug in for Microsoft SQL Enterprise Manager which changes the query window background if the query window points to a production database?\n" }, { "from": "gpt", "value": "Creating a plugin or extension for Microsoft SQL Server Management Studio (SSMS)...
I'm researching and experimenting more with Groovy and I'm trying to wrap my mind around the pros and cons of implementing things in Groovy that I can't/don't do in Java. Dynamic programming is still just a concept to me since I've been deeply steeped static and strongly typed languages. Groovy gives me the ability ...
Duck typing and dynamic programming can initially be difficult concepts to wrap your head around, especially if you have been primarily working with statically typed languages like Java. Let's break down the advantages and disadvantages of dynamic programming, particularly in Groovy, and highlight how you can experimen...
4,196
[ { "from": "human", "value": "I'm researching and experimenting more with Groovy and I'm trying to wrap my mind around the pros and cons of implementing things in Groovy that I can't/don't do in Java. Dynamic programming is still just a concept to me since I've been deeply steeped static and strongly typed ...
I have a Prolite LED sign that I like to set up to show scrolling search queries from a apache logs and other fun statistics. The problem is, my G5 does not have a serial port, so I have to use a usb to serial dongle. It shows up as /dev/cu.usbserial and /dev/tty.usbserial . When i do this everything seems to be hunky...
It seems like you're experiencing issues with the USB-to-serial communication on your G5, particularly when trying to use your Python script without an active connection established by your serial port tool. Let's address your concerns step by step. ### 1. Understanding `/dev/cu.usbserial` vs `/dev/tty.usbserial` - *...
4,216
[ { "from": "human", "value": "I have a Prolite LED sign that I like to set up to show scrolling search queries from a apache logs and other fun statistics. The problem is, my G5 does not have a serial port, so I have to use a usb to serial dongle. It shows up as /dev/cu.usbserial and /dev/tty.usbserial . \nW...
I have a console program written in C# that I am using to send faxes. When I step through the program in Visual Studio it works fine. When I double click on the program in Windows Explorer it works fine. When I setup a Windows scheduled task to run the program it fails with this in the event log. EventType clr20r3, ...
The behavior you're experiencing is likely due to differences in the execution environment when running the program through Windows Explorer versus through a scheduled task or batch file. Here are several potential causes and solutions to investigate: ### 1. **Working Directory** When you run your program by double-cl...
5,385
[ { "from": "human", "value": "I have a console program written in C# that I am using to send faxes. When I step through the program in Visual Studio it works fine. When I double click on the program in Windows Explorer it works fine. When I setup a Windows scheduled task to run the program it fails with t...
I get the following error in Visual Studio 2005 when doing a build: Error 9 Cannot register assembly "E:\CSharp\project\Some.Assembly.dll" - access denied. Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) project It happens only intermittantly and does go away if I restart the IDE, howe...
The "access denied" error you're encountering when trying to register an assembly in Visual Studio 2005 can be frustrating, especially if it occurs intermittently. Here are several strategies to help you resolve or mitigate this issue: 1. **Ensure Proper Permissions**: - Make sure you have the necessary permissions...
5,505
[ { "from": "human", "value": "I get the following error in Visual Studio 2005 when doing a build:\n\nError 9 Cannot register assembly\n \"E:\\CSharp\\project\\Some.Assembly.dll\"\n - access denied. Access is denied. (Exception from HRESULT: 0x80070005\n (E_ACCESSDENIED)) project\n\nIt happens only inter...
The product we are working on allows the user to easily set it up to run automatically whenever the computer is started. This is helpful because the product is part of the basic work environment of most of our users. This feature was implemented not so long ago and for a while all was well, but when we started testing ...
The behavior you're observing with your product and the dependent application X on Windows Vista relates to the way Windows manages system resources during startup, particularly regarding how and when services and background processes are loaded and initialized. Here are several potential reasons for the issues you're...
4,986
[ { "from": "human", "value": "The product we are working on allows the user to easily set it up to run automatically whenever the computer is started. This is helpful because the product is part of the basic work environment of most of our users.\nThis feature was implemented not so long ago and for a while ...
I'm using an identical call to "CryptUnprotectData" (exposed from Crypt32.dll) between XP and Vista. Works fine in XP. I get the following exception when I run in Vista: "Decryption failed. Key not valid for use in specified state." As expected, the versions of crypt32.dll are different between XP and Vista (w/XP actu...
The error message "Decryption failed. Key not valid for use in specified state" indicates that there may be an issue with the way data is being encrypted and decrypted across different versions of Windows, specifically between XP and Vista. Here are several potential reasons and suggestions for addressing this issue: ...
6,356
[ { "from": "human", "value": "I'm using an identical call to \"CryptUnprotectData\" (exposed from Crypt32.dll) between XP and Vista. Works fine in XP. I get the following exception when I run in Vista:\n\"Decryption failed. Key not valid for use in specified state.\"\n\nAs expected, the versions of crypt32.d...
I do not mean the compile errors because I made a syntax mistake or whatever. In C++ we can create compile time errors based on conditions as in the following example: template<int> struct CompileTimeError; template<> struct CompileTimeError<true> {}; #define STATIC_CHECK(expr, msg) { CompileTimeError<((expr) != 0)> E...
In Java, compile-time checks are more limited compared to C++. Java does not have template metaprogramming, and it also does not allow the same kind of manual static assertion using types. However, there are a few techniques to perform compile-time checks in Java, which can provide similar functionality to your C++ exa...
5,241
[ { "from": "human", "value": "I do not mean the compile errors because I made a syntax mistake or whatever. In C++ we can create compile time errors based on conditions as in the following example:\ntemplate<int> struct CompileTimeError;\ntemplate<> struct CompileTimeError<true> {};\n\n#define STATIC_CHECK(e...
I have my own class inside the file "Particles.h" and the class's implementation is inside "Particles.cpp" I want the file "Load.h" to recognize my classes inside there, so I've added the line #include "Particles.h" and the file doesn't recognize it and in the past everything was OK (I haven't made any changes inside ...
If your `Load.h` file is not recognizing the classes from `Particles.h`, there could be several reasons for this issue. Here are some steps you can take to troubleshoot and resolve the problem: ### 1. Check Include Guards Make sure that your `Particles.h` file has proper include guards. This prevents multiple inclusio...
5,764
[ { "from": "human", "value": "I have my own class inside the file \"Particles.h\" and the class's implementation is inside \"Particles.cpp\"\nI want the file \"Load.h\" to recognize my classes inside there, so I've added the line\n#include \"Particles.h\"\n\nand the file doesn't recognize it and in the past ...
When defining or calling functions with enough arguments to span multiple lines, I want vim to line them up. For example, def myfunction(arg1, arg2, arg, ... argsN-1, argN) The idea is for argsN-1 to have its 'a' lined up with args1. Does anyone have a way to have this happen automatically in vim? I've ...
To achieve automatic alignment of function arguments in Vim, you can utilize the `vim-closetag` and/or `vim-abolish` plugins. However, for a simpler solution without additional plugins, you can use a custom function and a mapping that will allow you to align your function parameters as you desire. Here's how you can s...
5,170
[ { "from": "human", "value": "When defining or calling functions with enough arguments to span multiple lines, I want vim to line them up. For example,\ndef myfunction(arg1, arg2, arg, ...\n argsN-1, argN)\n\nThe idea is for argsN-1 to have its 'a' lined up with args1.\nDoes anyone have a way t...
I suppose it allows for moving changes from one branch to the next but that's what cherry picking is for and if you're not making a commit of your changes, perhaps you shouldn't be moving them around? I have on occasion applied the wrong stash at the wrong branch, which left me wondering about this question.
Your observation about cherry-picking and stashing in version control systems like Git touches on some important concepts. Let's clarify the distinctions and the use cases for each: ### Cherry-Picking - **Purpose**: Cherry-picking is used to apply specific commits from one branch to another. It allows you to select an...
5,581
[ { "from": "human", "value": "I suppose it allows for moving changes from one branch to the next but that's what cherry picking is for and if you're not making a commit of your changes, perhaps you shouldn't be moving them around?\nI have on occasion applied the wrong stash at the wrong branch, which left me...
Is there an algorithm or some heuristic to decide whether digital audio data is clipping?
Yes, there are several algorithms and heuristics that can help determine whether digital audio data is clipping. Clipping occurs when the audio signal exceeds the maximum representable amplitude, resulting in distortion. Here are some methods to detect clipping: ### 1. **Peak Level Monitoring** - **Threshold Checki...
5,519
[ { "from": "human", "value": "Is there an algorithm or some heuristic to decide whether digital audio data is clipping?\n" }, { "from": "gpt", "value": "Yes, there are several algorithms and heuristics that can help determine whether digital audio data is clipping. Clipping occurs when the audio ...
Trying to make a make generic select "control" that I can dynamically add elements to, but I am having trouble getting functions to work right. This is what I started with. $select = $("<select></select>"); $select.addOption = function(value,text){ $(this).append($("<option></option>").val(value).text(text)); }; Thi...
It looks like you're trying to create a custom jQuery object with a method to add options to a `<select>` element, but running into issues when cloning the object. Your implementation can be improved using prototype inheritance in JavaScript. Here's a better approach: 1. Create a constructor function for your select e...
4,996
[ { "from": "human", "value": "Trying to make a make generic select \"control\" that I can dynamically add elements to, but I am having trouble getting functions to work right.\nThis is what I started with.\n$select = $(\"<select></select>\");\n$select.addOption = function(value,text){\n $(this).append($(\"<...
does anyone have a clue why the TortoiseSVN windows client (in Win32 XP and Vista) is so incredible slow when used with Putty and PAM? It seems it connects for each request since datatransfers (checkout) are not slow at all? Any ideas how to change it? Update: I had no problems with SSH before. But I have to use key ba...
The performance issue you are experiencing with TortoiseSVN when using Putty with PAM (Pluggable Authentication Module) in Windows XP and Vista might stem from a few common factors related to SSH authentication and the way TortoiseSVN interacts with Putty. Here are several potential solutions and optimizations you mig...
5,320
[ { "from": "human", "value": "does anyone have a clue why the TortoiseSVN windows client (in Win32 XP and Vista)\nis so incredible slow when used with Putty and PAM? It seems it connects for each request\nsince datatransfers (checkout) are not slow at all?\nAny ideas how to change it?\nUpdate: I had no probl...
I am getting the following error in an MS Access ADP when trying to add a record on a form linked to a MS SQL Server 2000 table: Run-time error '31004': The value of an (AutoNumber) field cannot be retrived prior to being saved. Please save the record that contains the (AutoNumber) field prior to performing th...
The error you are encountering in your MS Access ADP (Access Data Project) is related to the handling of AutoNumber fields when inserting new records. Specifically, this error indicates that you are trying to access or manipulate the value of an AutoNumber field before the record has been successfully saved to the data...
5,653
[ { "from": "human", "value": "I am getting the following error in an MS Access ADP when trying to add a record on a form linked to a MS SQL Server 2000 table:\n\nRun-time error '31004':\nThe value of an (AutoNumber) field\n cannot be retrived prior to being\n saved.\nPlease save the record that contains\n ...
Instead of returning a common string, is there a way to return classic objects? If not: what are the best practices? Do you transpose your object to xml and rebuild the object on the other side? What are the other possibilities?
Yes, it is absolutely possible to return complex objects (like classes or structures) instead of simple strings in various programming contexts. The approach you choose can depend on factors such as the technologies you're using, the requirements of your application, and the formats you prefer for data serialization an...
2,991
[ { "from": "human", "value": "Instead of returning a common string, is there a way to return classic objects?\nIf not: what are the best practices? Do you transpose your object to xml and rebuild the object on the other side? What are the other possibilities? \n" }, { "from": "gpt", "value": "Yes...
I remember back in the day with the old borland DOS compiler you could do something like this: asm { mov ax,ex etc etc... } Is there a semi-platform independent way to do this now? I have a need to make a BIOS call, so if there was a way to do this without asm code, that would be equally useful to me.
If you're looking for a way to perform low-level operations, such as making BIOS calls, in a more modern and platform-independent manner, there are some alternatives you can consider. However, please keep in mind that direct BIOS calls are typically associated with real-mode programming, which is less relevant in moder...
2,989
[ { "from": "human", "value": "I remember back in the day with the old borland DOS compiler you could do something like this:\nasm {\n mov ax,ex\n etc etc...\n}\n\nIs there a semi-platform independent way to do this now? I have a need to make a BIOS call, so if there was a way to do this without asm code, tha...
Looking for a way to display a PDF in Flex. I'm sure there are several ways. Looking for the easiest to maintain / integrate / most user friendly. I'm guessing it's possible to display a browser window in the app and render it, but if it goes off of IE / FireFox it's not acceptable for this project. Thanks...
Displaying a PDF directly in a Flex application can be a bit challenging since Flex does not have built-in support for rendering PDF files. However, there are a few approaches you can take to display PDF content while ensuring that it works seamlessly within your application. ### 1. Use an HTML Loader You can use an `...
3,172
[ { "from": "human", "value": "Looking for a way to display a PDF in Flex. I'm sure there are several ways. Looking for the easiest to maintain / integrate / most user friendly. I'm guessing it's possible to display a browser window in the app and render it, but if it goes off of IE / FireFox it's not accepta...
I'd like to do the following and can't find an elegant way: Read an XML template into a System.Xml.XmlDocument Populate it with data from my UI Transform it with an XSLT I've written Apply a CSS Stylesheet Render it to a WebBrowser control I'm currently reading it from a file on disk, populating it, then savi...
To achieve your goal of rendering an XML document with XSLT and CSS directly in a WebBrowser control without writing to disk, you can follow these steps: 1. **Load the XML template as an embedded resource**. 2. **Populate the XML Document** using your UI data. 3. **Transform the XML** using the XSLT. 4. **Apply the CS...
4,426
[ { "from": "human", "value": "I'd like to do the following and can't find an elegant way:\n\nRead an XML template into a System.Xml.XmlDocument \nPopulate it with data from my UI \nTransform it with an XSLT I've written \nApply a CSS Stylesheet \nRender it to a WebBrowser control \n\nI'm currently reading...
Generally, how bad of a performance hit is storing a file in a database (specifically mssql) as opposed to the file system? I can't come up with a reason outside of application portability that I would want to store my files as varbinaries in SQL Server.
Storing files as `VARBINARY` in SQL Server (or any relational database) instead of keeping them in the file system can have several implications for performance, management, and other factors. Here’s a breakdown of the performance considerations and potential trade-offs: ### Performance Considerations 1. **I/O Perfor...
5,595
[ { "from": "human", "value": "Generally, how bad of a performance hit is storing a file in a database (specifically mssql) as opposed to the file system? I can't come up with a reason outside of application portability that I would want to store my files as varbinaries in SQL Server.\n" }, { "from":...
I have got a simple contacts database but I'm having problems with users entering in duplicate data. I have implemented a simple data comparison but unfortunately the duplicated data that is being entered is not exactly the same. For example, names are incorrectly spelled or one person will put in 'Bill Smith' and anot...
Yes, there are several algorithms and techniques that can help you measure the similarity between strings, which is useful for identifying potential duplicate entries in your contacts database. Here are a few popular methods: 1. **Levenshtein Distance**: This algorithm calculates the minimum number of single-character...
4,653
[ { "from": "human", "value": "I have got a simple contacts database but I'm having problems with users entering in duplicate data. I have implemented a simple data comparison but unfortunately the duplicated data that is being entered is not exactly the same. For example, names are incorrectly spelled or one...
I manage a high-school computer lab with ~40 machines, have old PCs with varying hardware. I need to roll out Windows XP + a standard set of apps and settings for new machines, and to re-format older machines. What tool is available to help with this? It doesn't have to be perfect, but if it minimizes the time I set i...
For managing a high-school computer lab with varying hardware, especially when you're dealing with an older operating system like Windows XP, you have several options to streamline the deployment of your OS, applications, and settings. 1. **Windows Deployment Services (WDS)**: If you have access to a Windows Server, W...
7,141
[ { "from": "human", "value": "I manage a high-school computer lab with ~40 machines, have old PCs with varying hardware. I need to roll out Windows XP + a standard set of apps and settings for new machines, and to re-format older machines. \nWhat tool is available to help with this? It doesn't have to be per...
I'm trying to use a select statement to get all of the columns from a certain MySQL table except one. Is there a simple way to do this? EDIT: There are 53 columns in this table (NOT MY DESIGN)
In MySQL, there is no direct way to select all columns from a table except one or more specific columns using the `SELECT` statement. You will have to explicitly list the columns you want to select. However, if you have a table with many columns (like your example with 53 columns), it can be cumbersome to write out all...
5,707
[ { "from": "human", "value": "I'm trying to use a select statement to get all of the columns from a certain MySQL table except one. Is there a simple way to do this?\nEDIT: There are 53 columns in this table (NOT MY DESIGN)\n" }, { "from": "gpt", "value": "In MySQL, there is no direct way to sele...
Often, when I have a breakpoint on some line in Visual Studio, The program will run and stop there. great. I will then click the red circle (or press F9) to remove it. Obviously I don't want my program to keep stopping there. The problem is that the next time I refresh the page the breakpoint is back! The only way to ...
Hi Adin, The behavior you're experiencing with breakpoints in Visual Studio, especially with the ones that have a little plus sign (+) next to them, is likely related to conditional breakpoints or breakpoints set on specific lines or events tied to certain conditions. ### Here's what's happening: 1. **Breakpoint Gro...
6,717
[ { "from": "human", "value": "Often, when I have a breakpoint on some line in Visual Studio, The program will run and stop there. great. I will then click the red circle (or press F9) to remove it. Obviously I don't want my program to keep stopping there. The problem is that the next time I refresh the page ...
Has anybody come up with a better technique for managing tags and branches in subversion than what is generally recommended (the parallel directories called 'tags' and 'branches')?
In Subversion (SVN), the traditional structure for managing tags and branches involves creating parallel directories within the repository, typically structured as `/trunk`, `/branches`, and `/tags`. This approach is widely accepted and has served many teams well. However, some teams and users have developed alternativ...
6,963
[ { "from": "human", "value": "Has anybody come up with a better technique for managing tags and branches in subversion than what is generally recommended (the parallel directories called 'tags' and 'branches')?\n" }, { "from": "gpt", "value": "In Subversion (SVN), the traditional structure for ma...
Using VBA, how can I: test whether a file exists, and if so, delete it?
You can use VBA (Visual Basic for Applications) to test whether a file exists and delete it if it does. Here's a simple example that demonstrates how to do this. 1. Open the Visual Basic for Applications editor in Excel (or another Office application) by pressing `ALT + F11`. 2. Insert a new module by right-clicking ...
6,394
[ { "from": "human", "value": "Using VBA, how can I:\n\ntest whether a file exists, and if so,\ndelete it?\n\n" }, { "from": "gpt", "value": "You can use VBA (Visual Basic for Applications) to test whether a file exists and delete it if it does. Here's a simple example that demonstrates how to do ...
Strange question, but: Sharepoint 2007 greets you with the Administrator Tasks on the Central Administration after installation. I just wonder if this list is "safe" to be used for my own Administration Tasks? The reason why i'm asking is because I found that Sharepoint uses a lot of "black magic" and unlogical behavio...
It's understandable to be cautious about modifying the default tasks in SharePoint 2007, especially given the complexities and quirks that can arise when managing SharePoint environments. The Administrator Tasks list in Central Administration is essentially a task management tool that is designed to help you keep trac...
6,940
[ { "from": "human", "value": "Strange question, but: Sharepoint 2007 greets you with the Administrator Tasks on the Central Administration after installation.\nI just wonder if this list is \"safe\" to be used for my own Administration Tasks? The reason why i'm asking is because I found that Sharepoint uses ...
This link describes an exploit into my app using fckEditor: http://knitinr.blogspot.com/2008/07/script-exploit-via-fckeditor.html How do I make my app secure while still using fckEditor? Is it an fckEditor configuration? Is it some processing I'm supposed to do server-side after I grab the text from fckEditor? It's...
To secure your application while using FCKeditor (now known as CKEditor), you need to take a multi-faceted approach that combines proper configuration, input sanitization, and server-side processing. Here are the steps you can follow to mitigate the risk of script exploits and other security vulnerabilities: ### 1. Co...
4,886
[ { "from": "human", "value": "This link describes an exploit into my app using fckEditor:\nhttp://knitinr.blogspot.com/2008/07/script-exploit-via-fckeditor.html\nHow do I make my app secure while still using fckEditor? Is it an fckEditor configuration? Is it some processing I'm supposed to do server-side...
Continuous Integration toolchains for .NET, Java, and other languages are relatively well defined, but the C++ market seems to have a lot of diversity. By CI "toolchain" I specifically mean tools for the build scripts, automated testing, coding standards checking, etc. What are C++ teams using for CI toolchains?
C++ teams often face a diverse set of options for continuous integration (CI) toolchains due to the language's varied ecosystem and the specific requirements of different projects. Here are some commonly used tools and technologies in CI toolchains for C++ development: ### Build Systems 1. **CMake**: The most popular ...
1,610
[ { "from": "human", "value": "Continuous Integration toolchains for .NET, Java, and other languages are relatively well defined, but the C++ market seems to have a lot of diversity. \nBy CI \"toolchain\" I specifically mean tools for the build scripts, automated testing, coding standards checking, etc.\nWha...
I see that Adobe AIR uses WebKit as its render and I see that WebKit (at least the most current build) has some SVG support. Does this mean (and has anyone specifically tried) that an Adobe AIR application could render SVG on an HTML page?
Yes, Adobe AIR applications can render SVG content on an HTML page. Since Adobe AIR uses a version of the WebKit rendering engine, it supports many web standards, including SVG (Scalable Vector Graphics). You can embed SVG directly in HTML documents used within an Adobe AIR application, and the SVG should render corr...
7,503
[ { "from": "human", "value": "I see that Adobe AIR uses WebKit as its render and I see that WebKit (at least the most current build) has some SVG support. Does this mean (and has anyone specifically tried) that an Adobe AIR application could render SVG on an HTML page?\n" }, { "from": "gpt", "val...
OpenID is a great idea in principle, but the UI and the explanation as to why it is good are currently not tailored for general use -- what do you think it would take to make OpenID work for the general public? Can this be solved with technology, or is the problem so intrinsically hard that we are stuck with difficult...
Making OpenID (or similar decentralized identity systems) work for the general public involves addressing several key aspects, including user experience (UX), education, security, and ecosystem support. Here are some thoughts on what could help: ### 1. **Simplified User Interface (UI)** - **Intuitive Design**: The in...
4,502
[ { "from": "human", "value": "OpenID is a great idea in principle, but the UI and the explanation as to why it is good are currently not tailored for general use -- what do you think it would take to make OpenID work for the general public? Can this be solved with technology, or is the problem so intrinsica...
How does the compiler know the prototype of sleep function or even printf function, when I did not include any header file in the first place? Moreover, if I specify sleep(1,1,"xyz") or any arbitrary number of arguments, the compiler still compiles it. But the strange thing is that gcc is able to find the definition of...
In C, the way functions are handled in terms of declarations and definitions is quite flexible, which can lead to the behavior you've observed. Let's break down the key points related to your questions. ### 1. Compiler Understanding of Function Prototypes When you don't include a header file that contains a prototype...
5,257
[ { "from": "human", "value": "How does the compiler know the prototype of sleep function or even printf function, when I did not include any header file in the first place?\nMoreover, if I specify sleep(1,1,\"xyz\") or any arbitrary number of arguments, the compiler still compiles it.\nBut the strange thing ...
Say I've got this table (SQL Server 2005): Id => integer MyField => XML Id MyField 1 < Object>< Type>AAA< /Type>< Value>10< /Value>< /Object>< Object>< Type>BBB< /Type><Value>20< /Value>< /Object> 2 < Object>< Type>AAA< /Type>< Value>15< /Value>< /Object> 3 < Object>< Type>AAA< /Type>< Value>20< /Value><...
To achieve the desired output from your XML data in SQL Server 2005, you'll need to parse the XML content and pivot it to create the required columns for each `Type`. Given that the number of types is unknown, you can use dynamic SQL to create the necessary SQL statement. Here's a step-by-step approach along with an e...
4,904
[ { "from": "human", "value": "Say I've got this table (SQL Server 2005):\nId => integer \nMyField => XML\n\nId MyField \n1 < Object>< Type>AAA< /Type>< Value>10< /Value>< /Object>< Object>< Type>BBB< /Type><Value>20< /Value>< /Object> \n2 < Object>< Type>AAA< /Type>< Value>15< /Value>< /Object> \n3 ...
What would be the most efficient way to compare two double or two float values? Simply doing this is not correct: bool CompareDoubles1 (double A, double B) { return A == B; } But something like: bool CompareDoubles2 (double A, double B) { diff = A - B; return (diff < EPSILON) && (-diff < EPSILON); } Seems ...
When comparing floating-point values (like `float` or `double`), it is indeed necessary to account for the precision issues that arise due to how these numbers are represented in binary. The direct comparison `A == B` will not work reliably because of potential small discrepancies due to rounding errors. The approach ...
4,842
[ { "from": "human", "value": "\nWhat would be the most efficient way to compare two double or two float values?\nSimply doing this is not correct:\nbool CompareDoubles1 (double A, double B)\n{\n return A == B;\n}\n\nBut something like:\nbool CompareDoubles2 (double A, double B) \n{\n diff = A - B;\n re...
What I would like to do is create a clean virtual machine image as the output of a build of an application. So a new virtual machine would be created (from a template is fine, with the OS installed, and some base software installed) --- a new web site would be created in IIS, and the web app build output copied to a lo...
Creating a clean virtual machine image as part of a build process, particularly using Hyper-V, involves several steps that can be automated using PowerShell scripts and Hyper-V cmdlets. Below, I'll outline a general approach to accomplish this task. ### Prerequisites 1. **Hyper-V installed**: Ensure that Hyper-V is i...
2,752
[ { "from": "human", "value": "What I would like to do is create a clean virtual machine image as the output of a build of an application.\nSo a new virtual machine would be created (from a template is fine, with the OS installed, and some base software installed) --- a new web site would be created in IIS, a...
One of the fun parts of multi-cultural programming is number formats. Americans use 10,000.50 Germans use 10.000,50 French use 10 000,50 My first approach would be to take the string, parse it backwards until I encounter a separator and use this as my decimal separator. There is an obvious flaw with that: 10.000 woul...
The .NET Framework does not contain a mythical black magic parser that auto-detects number formats from strings without additional context. However, you can leverage the built-in culture-specific parsing capabilities in .NET to handle different number formats properly. Here's a breakdown of how you can approach the pro...
1,440
[ { "from": "human", "value": "One of the fun parts of multi-cultural programming is number formats.\n\nAmericans use 10,000.50\nGermans use 10.000,50\nFrench use 10 000,50\n\nMy first approach would be to take the string, parse it backwards until I encounter a separator and use this as my decimal separator. ...
With SVN, I had a single big repository I kept on a server, and checked-out on a few machines. This was a pretty good backup system, and allowed me easily work on any of the machines. I could checkout a specific project, commit and it updated the 'master' project, or I could checkout the entire thing. Now, I have a bun...
Managing multiple projects with Git, especially when you want a centralized backup and easy access across multiple machines, can be a bit tricky. Here are some strategies you can consider to help organize your personal code and projects effectively: ### 1. **Single Monorepo Approach** If your various projects are inte...
4,079
[ { "from": "human", "value": "With SVN, I had a single big repository I kept on a server, and checked-out on a few machines. This was a pretty good backup system, and allowed me easily work on any of the machines. I could checkout a specific project, commit and it updated the 'master' project, or I could che...
Can you please tell me how much is (-2) % 5? According to my Python interpreter is 3, but do you have a wise explanation for this? I've read that in some languages the result can be machine-dependent, but I'm not sure though.
In Python, the modulo operation follows the rule that the result has the same sign as the divisor (in this case, 5). Thus, when you calculate \((-2) \% 5\), Python computes it as follows: 1. Determine how many times 5 can be subtracted from -2 without going below zero. In this case, you can think about it in terms of ...
7,222
[ { "from": "human", "value": "Can you please tell me how much is (-2) % 5?\nAccording to my Python interpreter is 3, but do you have a wise explanation for this?\nI've read that in some languages the result can be machine-dependent, but I'm not sure though.\n" }, { "from": "gpt", "value": "In Pyt...
What is the best way to implement the singleton pattern in Python? It seems impossible to declare the constructor private or protected as is normally done with the Singleton pattern...
Implementing the Singleton pattern in Python can be achieved in several ways, despite the language's flexibility that does not strictly enforce access modifiers like private or protected. Here are a few popular methods to implement the Singleton pattern in Python: ### 1. Using a Class Variable One of the simplest way...
4,403
[ { "from": "human", "value": "What is the best way to implement the singleton pattern in Python? It seems impossible to declare the constructor private or protected as is normally done with the Singleton pattern...\n" }, { "from": "gpt", "value": "Implementing the Singleton pattern in Python can...
Why is Array.Length an int, and not a uint. This bothers me (just a bit) because a length value can never be negative. This also forced me to use an int for a length-property on my own class, because when you specify an int-value, this needs to be cast explicitly... So the ultimate question is: is there any use for a...
The decision to use `int` for the length of an array (and similar collections) in languages like C# has historical and practical reasons: 1. **Historical Context**: Many programming languages, especially those derived from C, use signed integers for sizes and lengths. This practice has been carried forward into langua...
4,878
[ { "from": "human", "value": "Why is Array.Length an int, and not a uint. This bothers me (just a bit) because a length value can never be negative. \nThis also forced me to use an int for a length-property on my own class, because when you \nspecify an int-value, this needs to be cast explicitly...\nSo the ...
We all know how to use <ctrl>-R to reverse search through history, but did you know you can use <ctrl>-S to forward search if you set stty stop ""? Also, have you ever tried running bind -p to see all of your keyboard shortcuts listed? There are over 455 on Mac OS X by default. What is your single most favorite obs...
One of my favorite obscure tricks in Bash is the ability to use **`!!`** to rerun the last command executed in the terminal. This can be particularly useful for quickly executing the last command with superuser privileges by prefixing it with **`sudo`**. For example, if the last command was a simple typo or it needed e...
8,579
[ { "from": "human", "value": "We all know how to use <ctrl>-R to reverse search through history, but did you know you can use <ctrl>-S to forward search if you set stty stop \"\"? Also, have you ever tried running bind -p to see all of your keyboard shortcuts listed? There are over 455 on Mac OS X by defau...
I got this output when running sudo cpan Scalar::Util::Numeric jmm@freekbox:~/bfwsandbox/sa/angel/astroportal/dtu8e/resources$ sudo cpan Scalar::Util::Numeric [sudo] password for jmm: CPAN: Storable loaded ok Going to read /home/jmm/.cpan/Metadata Database was generated on Tue, 09 Sep 2008 16:02:51 GMT CPAN: LWP::Us...
The errors you're encountering while trying to install `Scalar::Util::Numeric` indicate that your system is missing essential development libraries, particularly C header files needed to compile the XS (C extension) portion of the Perl module. The specific errors like "No such file or directory" for various standard li...
6,684
[ { "from": "human", "value": "I got this output when running sudo cpan Scalar::Util::Numeric\n\njmm@freekbox:~/bfwsandbox/sa/angel/astroportal/dtu8e/resources$ sudo cpan Scalar::Util::Numeric\n[sudo] password for jmm:\nCPAN: Storable loaded ok\nGoing to read /home/jmm/.cpan/Metadata\n Database was generated...
I'm using Helicon's ISAPI Rewrite 3, which basically enables .htaccess in IIS. I need to redirect a non-www URL to the www version, i.e. example.com should redirect to www.example.com. I used the following rule from the examples but it affects subdomains: RewriteCond %{HTTPS} (on)? RewriteCond %{HTTP:Host} ^(?!www\.)...
To ensure that only the root domain (`example.com`) redirects to the www version (`www.example.com`) without affecting subdomains (`sub.example.com`), you can modify the conditions in your rewrite rule to specifically check if the host is exactly `example.com` or `www.example.com`. Here’s how you can do that: ```apach...
6,040
[ { "from": "human", "value": "I'm using Helicon's ISAPI Rewrite 3, which basically enables .htaccess in IIS. I need to redirect a non-www URL to the www version, i.e. example.com should redirect to www.example.com. I used the following rule from the examples but it affects subdomains:\nRewriteCond %{HTTPS}...
Every time I need to work with date and/or timstamps in Java I always feel like I'm doing something wrong and spend endless hours trying to find a better way of working with the APIs without having to code my own Date and Time utility classes. Here's a couple of annoying things I just ran into: 0-based months. I rea...
Your frustrations with Java's date and time handling are quite common among developers. The introduction of the Java Date and Time API (JSR-310) in Java 8 significantly improved the situation, addressing many of the issues you mentioned. However, there are also third-party libraries like Joda-Time that have been popula...
6,107
[ { "from": "human", "value": "Every time I need to work with date and/or timstamps in Java I always feel like I'm doing something wrong and spend endless hours trying to find a better way of working with the APIs without having to code my own Date and Time utility classes. Here's a couple of annoying things...
I was browsing this thread, which has good recommendation but a bit too general for me. So, if anyone has a collection of nice game programming feeds,please share them. :) (both general and specific topics are welcome)
Sure! Here’s a collection of game programming feeds and resources that can help you stay updated on both general and specific topics in game development: ### General Game Programming Resources 1. **Gamasutra (Game Developer)**: - Website: [gamasutra.com](https://www.gamasutra.com/) - A great source for article...
4,378
[ { "from": "human", "value": "I was browsing this thread, which has good recommendation but a bit too general for me.\nSo, if anyone has a collection of nice game programming feeds,please share them. :)\n(both general and specific topics are welcome)\n" }, { "from": "gpt", "value": "Sure! Here’s ...
I'm writing an application that on some stage performs low-level disk operations in Linux environment. The app actually consists of 2 parts, one runs on Windows and interacts with a user and another is a linux part that runs from a LiveCD. User makes a choice of Windows drive letters and then a linux part performs acti...
Your current approach does have its limitations and potential points of failure, particularly in a diverse hardware environment where USB, FireWire, and other storage interfaces may be present. Here are some suggestions to enhance your solution and make it more robust: ### 1. Use `blkid` or `lsblk` Instead of manually...
2,076
[ { "from": "human", "value": "I'm writing an application that on some stage performs low-level disk operations in Linux environment. The app actually consists of 2 parts, one runs on Windows and interacts with a user and another is a linux part that runs from a LiveCD. User makes a choice of Windows drive le...
Every method I write to encode a string in Java using 3DES can't be decrypted back to the original string. Does anyone have a simple code snippet that can just encode and then decode the string back to the original string? I know I'm making a very silly mistake somewhere in this code. Here's what I've been working wit...
The code you provided has a few issues that need to be corrected in order to achieve successful encryption and decryption of a string using 3DES in Java. Let's address those issues and present a corrected version of your code: 1. **Returning the Base64 Encoded String**: Your `encrypt` method should return the Base64-e...
2,201
[ { "from": "human", "value": "Every method I write to encode a string in Java using 3DES can't be decrypted back to the original string. Does anyone have a simple code snippet that can just encode and then decode the string back to the original string?\nI know I'm making a very silly mistake somewhere in th...
For the past few weeks, I've been trying to learn about just how email works. I understand the process of a client receiving mail from a server using POP pretty well. I also understand how a client computer can use SMTP to ask an SMTP server to send a message. However, I'm still missing something... The way I unders...
Hi Jason, You're on the right track, and it's great to see you delving into the details of how email works! Let's clarify the process a bit further, especially the handoff of the message from the Gmail server to the Hotmail server. 1. **Sending Mail from Client to Server**: As you've noted, when you send an email fro...
5,049
[ { "from": "human", "value": "For the past few weeks, I've been trying to learn about just how email works. I understand the process of a client receiving mail from a server using POP pretty well. I also understand how a client computer can use SMTP to ask an SMTP server to send a message. However, I'm st...
I need a function called SizeOfPipe() which should return the size of a pipe - I only want to know how much data is in the pipe and not actually read data off the pipe itself. I thought the following code would work: fseek (pPipe, 0 , SEEK_END); *pBytes = ftell (pPipe); rewind (pPipe); but fseek() doesn't work on fil...
In C, a pipe is typically represented using file descriptors, and the standard file I/O functions like `fseek`, `ftell`, and `rewind` do not work with file descriptors directly. To get the size of data currently available in a pipe, you can use the `ioctl` function on the file descriptor associated with the pipe. Here...
5,103
[ { "from": "human", "value": "I need a function called SizeOfPipe() which should return the size of a pipe - I only want to know how much data is in the pipe and not actually read data off the pipe itself. \nI thought the following code would work:\nfseek (pPipe, 0 , SEEK_END);\n*pBytes = ftell (pPipe);\nrew...
I am wondering what directory structure are commonly used in development projects. I mean with the idea of facilitating builds, deploys release, and etc. I recently used a Maven structure for a java project, but I am not sure it's the best structure for a non-maven driven project. So, I have two questions: When you gu...
When starting a new development project, having a well-organized directory structure can greatly facilitate building, deploying, and maintaining the application. The structure can vary based on the type of project, the programming languages involved, and the frameworks used. Here are some common practices and structure...
2,723
[ { "from": "human", "value": "I am wondering what directory structure are commonly used in development projects. I mean with the idea of facilitating builds, deploys release, and etc.\nI recently used a Maven structure for a java project, but I am not sure it's the best structure for a non-maven driven proj...
Most recent edits in bold I am using the .net HttpListener class, but I won't be running this application on IIS and am not using ASP.net. This web site describes what code to actually use to implement SSL with asp.net and this site describes how to set up the certificates (although I'm not sure if it works only for I...
Setting up SSL with the .NET `HttpListener` class can be a bit tricky, especially since it requires proper certificate management. Let’s address your questions step by step. ### Problem Diagnosis 1. **Error in the System Event Log**: The error message you received (`0x80090016`) indicates that there is a problem w...
4,284
[ { "from": "human", "value": "Most recent edits in bold\nI am using the .net HttpListener class, but I won't be running this application on IIS and am not using ASP.net. This web site describes what code to actually use to implement SSL with asp.net and this site describes how to set up the certificates (al...
If I have .Net Form with a component/object such as a textbox that I need to access from a parent or other form I obviously need to "upgrade" the modifier to this component to an Internal or Public level variable. Now, if I were providing a public variable of an int or string type etc. in my form class I wouldn't think...
Yes, wrapping Visual Studio designer components (like a TextBox) with getters and setters is a good practice, especially if you intend to expose these components to other parts of your application. Here's why and how you might do it: ### Reasons for Using Getters and Setters 1. **Encapsulation**: By using getters and...
4,797
[ { "from": "human", "value": "If I have .Net Form with a component/object such as a textbox that I need to access from a parent or other form I obviously need to \"upgrade\" the modifier to this component to an Internal or Public level variable.\nNow, if I were providing a public variable of an int or string...
What memory leak detectors have people had a good experience with? Here is a summary of the answers so far: Valgrind - Instrumentation framework for building dynamic analysis tools. Electric Fence - A tool that works with GDB Splint - Annotation-Assisted Lightweight Static Checking Glow Code - This is a complete real-t...
Here are some additional memory leak detectors that developers have found helpful: 1. **AddressSanitizer (ASan)**: A fast memory error detector built into the LLVM and GCC compilers. It can detect a variety of memory-related errors, including memory leaks, buffer overflows, and use-after-free errors. 2. **LeakSanitiz...
6,627
[ { "from": "human", "value": "What memory leak detectors have people had a good experience with?\nHere is a summary of the answers so far:\nValgrind - Instrumentation framework for building dynamic analysis tools.\nElectric Fence - A tool that works with GDB\nSplint - Annotation-Assisted Lightweight Static C...
I've got a page with an control - the link is to a gif file. Right clicking on the link (in IE7) and selecting "open target in new window" correctly displays the image. However I can't then close the new IE window. MORE INFO: Works OK in Firefox 3 What might I be doing wrong ? TIA Tom
It sounds like you're experiencing a specific issue with Internet Explorer 7 when opening a GIF file in a new window. Here are a few potential reasons for the behavior you're encountering, as well as some solutions: 1. **Popup Blocker**: Ensure that the popup blocker in IE7 is either disabled or configured to allow ne...
5,279
[ { "from": "human", "value": "I've got a page with an control - the link is to a gif file. Right clicking on the link (in IE7) and selecting \"open target in new window\" correctly displays the image. However I can't then close the new IE window.\nMORE INFO: Works OK in Firefox 3\nWhat might I be doing wr...
Having been a PHP developer on LAMP servers for quite a while, is there anything that I will need to take into consideration while preparing an application for IIS on windows.
Transitioning a PHP application from a LAMP (Linux, Apache, MySQL, PHP) environment to IIS (Internet Information Services) on Windows involves several considerations. Here are the key points to keep in mind: 1. **Web Server Differences**: - **URL Rewriting**: Apache uses `.htaccess` files for URL rewriting. In IIS,...
111
[ { "from": "human", "value": "Having been a PHP developer on LAMP servers for quite a while, is there anything that I will need to take into consideration while preparing an application for IIS on windows.\n" }, { "from": "gpt", "value": "Transitioning a PHP application from a LAMP (Linux, Apache...
I have a table in MySQL that has 3 fields and I want to enforce uniqueness among two of the fields. Here is the table DDL: CREATE TABLE `CLIENT_NAMES` ( `ID` int(11) NOT NULL auto_increment, `CLIENT_NAME` varchar(500) NOT NULL, `OWNER_ID` int(11) NOT NULL, PRIMARY KEY (`ID`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8; Th...
The error you are encountering is due to the `CLIENT_NAME` field being defined as `varchar(500)`, which may exceed the maximum key length when combined with other fields in the unique index. In MySQL (specifically for InnoDB storage engine), the maximum index length for a non-full-text index is 767 bytes for versions p...
6,064
[ { "from": "human", "value": "I have a table in MySQL that has 3 fields and I want to enforce uniqueness among two of the fields. Here is the table DDL:\nCREATE TABLE `CLIENT_NAMES` (\n`ID` int(11) NOT NULL auto_increment,\n`CLIENT_NAME` varchar(500) NOT NULL,\n`OWNER_ID` int(11) NOT NULL,\nPRIMARY KEY (`I...
100 (or some even number 2N :-) ) prisoners are in a room A. They are numbered from 1 to 100. One by one (from prisoner #1 to prisoner #100, in order), they will be let into a room B in which 100 boxes (numbered from 1 to 100) await them. Inside the (closed) boxes are numbers from 1 to 100 (the numbers inside the boxes...
Yes, there is a well-known strategy that significantly increases the probability that all prisoners survive, and it hinges on a concept known as "loop-following." **The Strategy:** 1. Each prisoner is assigned a unique number from 1 to 100. 2. The prisoners agree to follow the "loop" strategy before entering room B. 3...
4,480
[ { "from": "human", "value": "100 (or some even number 2N :-) ) prisoners are in a room A. They are numbered from 1 to 100.\nOne by one (from prisoner #1 to prisoner #100, in order), they will be let into a room B in which 100 boxes (numbered from 1 to 100) await them. Inside the (closed) boxes are numbers f...
I'm receiving feedback from a developer that "The only way visual basic (6) can deal with a UNC path is to map it to a drive." Is this accurate? And, if so, what's the underlying issue and are there any alternatives other than a mapped drive?
The statement that "The only way Visual Basic (VB6) can deal with a UNC path is to map it to a drive" is somewhat misleading. Visual Basic 6 can indeed work with UNC (Universal Naming Convention) paths directly without the need to map them to a drive letter. UNC paths are used to specify the location of resources such ...
4,223
[ { "from": "human", "value": "I'm receiving feedback from a developer that \"The only way visual basic (6) can deal with a UNC path is to map it to a drive.\" Is this accurate? And, if so, what's the underlying issue and are there any alternatives other than a mapped drive?\n" }, { "from": "gpt", ...
By default when using a webapp server in Eclipse Web Tools, the server startup will fail after a timeout of 45 seconds. I can increase this timeout in the server instance properties, but I don't see a way to disable the timeout entirely (useful when debugging application startup). Is there a way to do this?
In Eclipse Web Tools, the server timeout is a useful feature to prevent long-running server start operations from hanging indefinitely. However, if you want to effectively disable or manage this timeout during debugging sessions, there are a few approaches you can take, as Eclipse does not provide a direct option to co...
6,947
[ { "from": "human", "value": "By default when using a webapp server in Eclipse Web Tools, the server startup will fail after a timeout of 45 seconds. I can increase this timeout in the server instance properties, but I don't see a way to disable the timeout entirely (useful when debugging application startu...
Is it possible to access the iSight camera on a macbook programmatically? By this I mean I would like to be able to just grab still frames from the iSight camera on command and then do something with them. If so, is it only accessible using objective c, or could other languages be used as well?
Yes, it is indeed possible to access the iSight camera (or any camera connected to your Mac) programmatically to grab still frames. You can use various programming languages to achieve this, including Objective-C, Swift, and even higher-level languages like Python, provided you have the right libraries. ### Using Obje...
5,617
[ { "from": "human", "value": "Is it possible to access the iSight camera on a macbook programmatically? By this I mean I would like to be able to just grab still frames from the iSight camera on command and then do something with them. If so, is it only accessible using objective c, or could other languages ...
I want to be able to get an estimate of how much code & static data is used by my C++ program? Is there a way to find this out by looking at the executable or object files? Or perhaps something I can do at runtime? Will otool help?
Yes, you can analyze your C++ program's executable or object files to estimate how much code and static data are used. Here are several methods you can use, including tools like `otool` on macOS, as well as other alternatives: ### 1. **Using `otool` on macOS:** `otool` is a command-line utility that can display inform...
5,200
[ { "from": "human", "value": "I want to be able to get an estimate of how much code & static data is used by my C++ program?\nIs there a way to find this out by looking at the executable or object files? Or perhaps something I can do at runtime?\nWill otool help?\n" }, { "from": "gpt", "value": ...
I'm using Steema's TeeChart ActiveX 5 component for an application in .NET C#. I do some drawings using the methods Line(), Rectangle() and Circle() through the "Canvas" property of the component. My code for drawing is called on every on every OnBeforeDrawSeries() and OnAfterDraw() events of the component. When there ...
The issue you're experiencing with the TeeChart ActiveX component may be related to how often you are trying to perform drawing operations in relation to the component's rendering pipeline. There are a few considerations and best practices that can help you avoid the "Canvas does not allow drawing" error. ### Best Pra...
3,804
[ { "from": "human", "value": "I'm using Steema's TeeChart ActiveX 5 component for an application in .NET C#.\nI do some drawings using the methods Line(), Rectangle() and Circle() through the \"Canvas\" property of the component.\nMy code for drawing is called on every on every OnBeforeDrawSeries() and OnAft...
Is an opensource/commercial tool/framework, available for automated web app testing in Google Chrome browser on Windows XP / Vista? ( An alpha/beta Tool is also OK) Thanks
Yes, there are several open-source and commercial tools available for automated web application testing in Google Chrome on Windows XP and Vista. Here are some options you can consider: ### Open Source Tools: 1. **Selenium WebDriver**: - Selenium is one of the most popular tools for automating web browsers. It supp...
6,626
[ { "from": "human", "value": "Is an opensource/commercial tool/framework, available for automated web app testing in Google Chrome browser on Windows XP / Vista? ( An alpha/beta Tool is also OK)\nThanks\n" }, { "from": "gpt", "value": "Yes, there are several open-source and commercial tools avail...
What is a good challenge to improve your skills in object oriented programming? The idea behind this poll is to provide an idea of which exercises are useful for learning OOP. The challenge should be as language agnostic as possible, requiring either little or no use of specific libraries, or only the most common of li...
Challenge - Create a simple bank account management system Skill level - Intermediate Rationale - This exercise helps in understanding the principles of encapsulation, inheritance, and polymorphism in OOP. You will define classes like `Account`, `SavingsAccount`, and `CheckingAccount`, each with attributes like `bala...
8,823
[ { "from": "human", "value": "What is a good challenge to improve your skills in object oriented programming?\nThe idea behind this poll is to provide an idea of which exercises are useful for learning OOP.\nThe challenge should be as language agnostic as possible, requiring either little or no use of specif...
So right now my project has a few custom dialogs that do things like prompt the user for his birthday, or whatever. Right now they're just doing things like setting a this.Birthday property once they get an answer (which is of type DateTime?, with the null indicating a "Cancel"). Then the caller inspects the Birthday p...
Yes, there are several design patterns and practices you can use in Windows Forms to encapsulate the data collected from a dialog, beyond just setting properties like `this.Birthday`. While setting `DialogResult` is common for indicating whether the dialog was accepted or canceled, you can implement more structured app...
4,585
[ { "from": "human", "value": "So right now my project has a few custom dialogs that do things like prompt the user for his birthday, or whatever. Right now they're just doing things like setting a this.Birthday property once they get an answer (which is of type DateTime?, with the null indicating a \"Cancel\...
I'm not too sure what is going on here, but sometimes a particular file in my repository will change the case of its name. e.g.,: before: File.h after: file.h I don't really care why this is happening, but this causes git to think it is a new file, and then I have to go and change the file name back. Can you just make ...
Git, by default, is case-sensitive, which means it tracks changes in file names that differ only by case. Unfortunately, you cannot configure Git to completely ignore case changes for file names, but you can mitigate the issue in a couple of ways. ### Workaround 1: Enable Case Sensitivity for Git You can enable `core...
5,267
[ { "from": "human", "value": "I'm not too sure what is going on here, but sometimes a particular file in my repository will change the case of its name. e.g.,:\nbefore: File.h\nafter: file.h\nI don't really care why this is happening, but this causes git to think it is a new file, and then I have to go and c...
What is the best way to create a fixed width file in C#. I have a bunch of fields with lengths to write out. Say 20,80.10,2 etc all left aligned. Is there an easy way to do this?
Creating a fixed-width file in C# is straightforward. You can use `String.PadRight` method to create each field in the desired fixed-width format. Here's a simple example that demonstrates how to construct a fixed-width string based on your specified field lengths (e.g., 20, 80, 10, 2) and then write it to a file. Her...
4,203
[ { "from": "human", "value": "What is the best way to create a fixed width file in C#. I have a bunch of fields with lengths to write out. Say 20,80.10,2 etc all left aligned. Is there an easy way to do this? \n" }, { "from": "gpt", "value": "Creating a fixed-width file in C# is straightforward. ...