instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I am using partial classes to split some functionality between 2 files, but I am getting an error. What am I doing wrong? A1.cs: private partial class A { private string SomeProperty { get { return "SomeGeneratedString"; } } } A2.cs: private partial class A { void SomeFunction() { //trying ...
The issue you're encountering with your partial class implementation in C# stems from the access modifier you've applied to the `SomeProperty`. In your `A1.cs` file, the property `SomeProperty` is defined as `private`, which means that it is only accessible within the same file and within the same class. Therefore, it ...
29,131
[ { "from": "human", "value": "I am using partial classes to split some functionality between 2 files, but I am getting an error. What am I doing wrong?\nA1.cs:\nprivate partial class A\n{\n private string SomeProperty { get { return \"SomeGeneratedString\"; } } \n}\n\nA2.cs:\nprivate partial class ...
I was trying the following example, but with external URLs: Using WebViews The example shows how to load an HTML file from assets folder (file:// url) and display it in a WebView. But when I try it with external URLs (like http://google.com), I am always getting a "Website Not Available" error. Android's built-in brow...
When using a WebView in an Android application to load external URLs, there are a few common issues that can lead to the "Website Not Available" error. Here are some steps to ensure that your WebView is set up correctly and can load external content: 1. **Internet Permissions**: Ensure that you have the necessary perm...
18,990
[ { "from": "human", "value": "I was trying the following example, but with external URLs:\nUsing WebViews\nThe example shows how to load an HTML file from assets folder (file:// url) and display it in a WebView. \nBut when I try it with external URLs (like http://google.com), I am always getting a \"Website ...
I wonder if there is a way to create a Custom List in Sharepoint, but specify that each user may only create one item in the list. I am thinking of two approaches: Develop a ListReceiver that checks if the user already created an item. Problem: I did not see a way to enable a Feature on a specific list (the idea is th...
To achieve the requirement of allowing each user to create only one item in a SharePoint custom list, you can consider both options you mentioned. However, let's delve deeper into the feasibility of each option and explore possible solutions. ### Option 1: Use a List Receiver While it's true that you can create a Lis...
26,747
[ { "from": "human", "value": "I wonder if there is a way to create a Custom List in Sharepoint, but specify that each user may only create one item in the list.\nI am thinking of two approaches:\n\nDevelop a ListReceiver that checks if the user already created an item. Problem: I did not see a way to enable ...
I'm creating a custom Java Struts tag that is for building and formatting an html select box in a standardised way (part of our usability guidelines). Each select box has an additional/initial value which describes the requirement of the value returned by the select element, i.e.: Mandatory - with the label "Please Se...
Choosing a clear and descriptive variable name is essential for maintainability and usability. For your custom Java Struts tag that holds the initial value for the select box, you want to convey both the purpose of the variable and the specific options it represents. Here are some suggestions: 1. **`initialSelectLabel...
29,118
[ { "from": "human", "value": "I'm creating a custom Java Struts tag that is for building and formatting an html select box in a standardised way (part of our usability guidelines).\nEach select box has an additional/initial value which describes the requirement of the value returned by the select element, i....
I want to use XMLHttpRequest in JavaScript to POST a form that includes a file type input element so that I can avoid page refresh and get useful XML back. I can submit the form without page refresh, using JavaScript to set the target attribute on the form to an iframe for MSIE or an object for Mozilla, but this has tw...
To achieve file uploads using `XMLHttpRequest` in JavaScript without a page refresh, you can use the `FormData` object. `FormData` automatically handles the `multipart/form-data` encoding required for file uploads. Here's a step-by-step guide on how to do this: ### Step 1: Create Your HTML Form Make sure you have a fo...
21,122
[ { "from": "human", "value": "I want to use XMLHttpRequest in JavaScript to POST a form that includes a file type input element so that I can avoid page refresh and get useful XML back.\nI can submit the form without page refresh, using JavaScript to set the target attribute on the form to an iframe for MSIE...
I need to access RMI methods from a client front end. For different reasons, I have JBoss running on the server side. This makes me thinking of using JBoss to expose the RMI server methods. I'm kinda new to JBoss, so my question would be: What steps are required in order to make the RMI server methods visible to the cl...
To expose RMI methods via JBoss, you will typically need to implement a few steps to create a Java RMI (Remote Method Invocation) service and expose it through the JBoss application server. Below, I've outlined a step-by-step guide on how to do this: ### Step 1: Create Your RMI Interface Define a Java interface that ...
23,174
[ { "from": "human", "value": "I need to access RMI methods from a client front end.\nFor different reasons, I have JBoss running on the server side. This makes me thinking of using JBoss to expose the RMI server methods.\nI'm kinda new to JBoss, so my question would be: What steps are required in order to ma...
I'm working on a C# library which offloads certain work tasks to the GPU using NVIDIA's CUDA. An example of this is adding two arrays together using extension methods: float[] a = new float[]{ ... } float[] b = new float[]{ ... } float[] c = a.Add(b); The work in this code is done on the GPU. However, I would like it ...
Your implementation of `ExecutionResult<T>` is a good start for managing asynchronous GPU computations. However, your use of `Thread.Sleep` in the implicit conversion operator can lead to inefficiencies and is generally not recommended for waiting on asynchronous operations. Instead, you can use `Task` and `async/await...
27,149
[ { "from": "human", "value": "I'm working on a C# library which offloads certain work tasks to the GPU using NVIDIA's CUDA. An example of this is adding two arrays together using extension methods:\nfloat[] a = new float[]{ ... }\nfloat[] b = new float[]{ ... }\nfloat[] c = a.Add(b);\n\nThe work in this code...
Is this possible? I want to have the To:, Body, and an Attachment all pre-populated so all the user has to do is click send. Thanks!
Yes, it is possible to create an email with pre-populated fields like the To, Body, and Attachments, depending on the platform you are using. Here are a few methods to achieve this for different scenarios: ### 1. Using a Mailto Link You can create a simple mailto link for pre-filling the To and Body fields, but it won...
25,709
[ { "from": "human", "value": "Is this possible? I want to have the To:, Body, and an Attachment all pre-populated so all the user has to do is click send. Thanks!\n" }, { "from": "gpt", "value": "Yes, it is possible to create an email with pre-populated fields like the To, Body, and Attachments...
There are many skills a programmer could have (understanding the problem, asking good questions, good design skills, etc.). I think System Debugging skill is incredibly valuable. This general skill of debuggin any technical system (from the batteries being dead in your remote control to signal interference from your ne...
Your method for teaching system debugging skills is well-structured and comprehensive. It emphasizes critical thinking, systematic problem-solving, and the importance of testing and analysis. Here’s a breakdown of the strengths of your approach and a few suggestions for enhancements: ### Strengths: 1. **Problem Defin...
22,279
[ { "from": "human", "value": "There are many skills a programmer could have (understanding the problem, asking good questions, good design skills, etc.).\nI think System Debugging skill is incredibly valuable. This general skill of debuggin any technical system (from the batteries being dead in your remote c...
How would you go about dead code detection in C/C++ code? I have a pretty large code base to work with and at least 10-15% is dead code. Is there any Unix based tool to identify this areas? Some pieces of code still use a lot of preprocessor, can automated process handle that?
Detecting dead code in C/C++ can be challenging, especially in large codebases with significant preprocessor usage. However, there are several strategies and tools that can help you identify dead code in your projects. Here are some methods and tools to consider: ### 1. **Static Analysis Tools** Static analysis tools ...
22,824
[ { "from": "human", "value": "How would you go about dead code detection in C/C++ code? I have a pretty large code base to work with and at least 10-15% is dead code. Is there any Unix based tool to identify this areas? Some pieces of code still use a lot of preprocessor, can automated process handle that?\n...
I'm a kinda newbie developer with a few years under my belt. Recently I interviewed at a game company and was asked "have you done any multi-threading?" I told them about having a C# app with a few Threads... and then I said a bit about transactions and locking etc in Sql. The interviewer politely told me that this ...
Sure! Multi-threading in C++ can be a bit lower-level compared to higher-level languages like C#, especially if you're working with raw threads, synchronization primitives, and manual memory management. Here's a basic example to illustrate how you might set up multi-threading in C++ using the standard library. ### Exa...
20,948
[ { "from": "human", "value": "I'm a kinda newbie developer with a few years under my belt. Recently I interviewed at a game company and was asked \"have you done any multi-threading?\" I told them about having a C# app with a few Threads... and then I said a bit about transactions and locking etc in Sql. ...
I'm working on a custom CMS for my own use and was thinking about implementing a plugin system so I could extend the code a little easier. I'm having trouble conceptualizing the architecture and layout though. I know I could go through a few open source programs that implement similar features but this is really just ...
Designing a plugin system for your custom CMS is a great way to allow for extensibility and flexibility. Here’s an outline of how to conceptualize and build your plugin architecture, along with some ideas on how popular systems implement their plugins. ### Key Concepts 1. **Plugin Architecture**: At a high level, you...
22,498
[ { "from": "human", "value": "I'm working on a custom CMS for my own use and was thinking about implementing a plugin system so I could extend the code a little easier. I'm having trouble conceptualizing the architecture and layout though. \nI know I could go through a few open source programs that implement...
I have a mysql table with albums. Each album can be a top level album, or a child album of another album. Each album has a foldername which is the name of the folder its pictures are in. Each album also has a field called parent which is the id of the parent album. So, if I have a path to an image like this: root/album...
To construct the path from the `albums` table using only MySQL, you will need to recursively concatenate the folder names starting from the child album back to the top-level album. MySQL does not have built-in recursive common table expressions (CTEs) until version 8.0, but if you're using a version that supports them,...
25,910
[ { "from": "human", "value": "I have a mysql table with albums. Each album can be a top level album, or a child album of another album. Each album has a foldername which is the name of the folder its pictures are in. Each album also has a field called parent which is the id of the parent album. So, if I have...
I used to work with eclipse for nearly all the languages I need. I'm asked to work on a tool developed in C# and so, I would like to stay in the same familiar environment. I've found the improve's plugin but its last release is from 2004 and .NET 1.1 which is quite old. Is there a newer plugin to program in C# within e...
While Eclipse is a versatile IDE for many programming languages, it is not the most common choice for C# development. The primary IDE for C# and .NET development is Visual Studio, which provides a robust set of tools and features specifically tailored for the .NET ecosystem. That said, there are still a few options if...
26,710
[ { "from": "human", "value": "I used to work with eclipse for nearly all the languages I need. I'm asked to work on a tool developed in C# and so, I would like to stay in the same familiar environment.\nI've found the improve's plugin but its last release is from 2004 and .NET 1.1 which is quite old. Is ther...
This is a subjective question as I want to gauge if it's worth me moaning at my co-workers for doing something which I find utterly detestable. The issue is that a bunch of my co-workers will truncate method calls to fit a width. We all use widescreen laptops that can handle large resolutions (mine is 1920x1200) and wh...
It's a common scenario in software development where different team members have varying preferences for formatting code. In your case, you prefer single-line method calls for readability, while your coworkers are opting for a multiline format to accommodate longer method calls. ### Considerations for Addressing the I...
26,487
[ { "from": "human", "value": "This is a subjective question as I want to gauge if it's worth me moaning at my co-workers for doing something which I find utterly detestable.\nThe issue is that a bunch of my co-workers will truncate method calls to fit a width. We all use widescreen laptops that can handle la...
What's an easy to use SNMP client library for c++?
There are several SNMP (Simple Network Management Protocol) client libraries available for C++. Here are a few easy-to-use options: 1. **Net-SNMP**: This is one of the most widely used SNMP libraries. It provides extensive functionality and is well-documented. It supports SNMP v1, v2c, and v3. While it may have a stee...
26,239
[ { "from": "human", "value": "What's an easy to use SNMP client library for c++?\n" }, { "from": "gpt", "value": "There are several SNMP (Simple Network Management Protocol) client libraries available for C++. Here are a few easy-to-use options:\n\n1. **Net-SNMP**: This is one of the most widely ...
I was just watching a video on MSDN Channel 9 which can be found here, about some of the new features in Visual Basic 10. Now I like most of the new features, some of which have been long awaited(auto properties and Collection Initializers), one that caught my eye was the multiline lambdas like in C#. In the video h...
Multiline lambdas in Visual Basic (VB) certainly introduce a new level of flexibility that can enhance code readability and maintainability, particularly when dealing with more complex operations. Here are some thoughts on their usefulness and where they might be particularly advantageous: ### Advantages of Multiline ...
26,448
[ { "from": "human", "value": "I was just watching a video on MSDN Channel 9 which can be found here, about some of the new features in Visual Basic 10. Now I like most of the new features, some of which have been long awaited(auto properties and Collection Initializers), one that caught my eye was the multi...
I have some problems comparing an array with Norwegian characters with a utf8 character. All characters except the special Norwegian characters(æ, ø, å) works fine. function isNorwegianChar($Char) { $aNorwegianChars = array('a', 'A', 'b', 'B', 'c', 'C', 'd', 'D', 'e', 'E', 'f', 'F', 'g', 'G', 'h', 'H', 'i', 'I', 'j...
It looks like you're encountering an issue with recognizing the Norwegian special characters (æ, ø, å) in your `isNorwegianChar` function. The issue may stem from how the characters are being processed and compared. Here are some suggestions for resolving the problem and improving your code: 1. **Use `mb_strlen` inste...
20,613
[ { "from": "human", "value": "I have some problems comparing an array with Norwegian characters with a utf8 character.\nAll characters except the special Norwegian characters(æ, ø, å) works fine.\nfunction isNorwegianChar($Char)\n{\n $aNorwegianChars = array('a', 'A', 'b', 'B', 'c', 'C', 'd', 'D', 'e', 'E...
I have created a timeclock application in C# that connects to a web service on our server in order to clock employees in/out. The application resides in the system tray and clocks users out if they shut down/suspend their machines or if they are idle for more than three hours to which it clocks them out at the time of ...
To effectively handle the scenario where your C# timeclock application tries to clock an employee back in after a sleep/wake event but finds that the network connection isn't ready yet, you can implement a "re-check" mechanism. Instead of simply introducing a fixed delay, you'll want to continuously check for network a...
21,105
[ { "from": "human", "value": "I have created a timeclock application in C# that connects to a web service on our server in order to clock employees in/out. The application resides in the system tray and clocks users out if they shut down/suspend their machines or if they are idle for more than three hours to...
I'm looking at a new project and we are wanting to use Flex (to provide the easy integration with AIR and provide a desktop app for our project). How easy does CakePHP play with Flex or is there a better PHP framework to use with Flex, or should we use none?
Using Flex with CakePHP can work well together, as both technologies can communicate effectively through web services. However, there are a few considerations to keep in mind: ### 1. **Integration via APIs**: - **RESTful Services**: Flex can easily consume RESTful APIs, which CakePHP can be configured to provide. T...
26,722
[ { "from": "human", "value": "I'm looking at a new project and we are wanting to use Flex (to provide the easy integration with AIR and provide a desktop app for our project). How easy does CakePHP play with Flex or is there a better PHP framework to use with Flex, or should we use none?\n" }, { "fro...
We've got data with two different origins: some comes from a customer, some comes from different vendors. Currently, we physically "merge" this data into a massive table with almost a hundred columns, tens of thousands of rows and no formal separation of the two dimensions. Consequently, we can't actually use this t...
Designing an effective star schema involves considering not just the structure of the data but also how it will be used. In your case, you have data coming from different sources with overlapping yet distinct fact values. Let's analyze both options: ### Option 1: Single Fact Table (with Nulls) **Pros:** 1. **Simplici...
25,813
[ { "from": "human", "value": "We've got data with two different origins: some comes from a customer, some comes from different vendors. Currently, we physically \"merge\" this data into a massive table with almost a hundred columns, tens of thousands of rows and no formal separation of the two dimensions. ...
Does anyone know of a web site where I can find a list of 32-bit MIPS instructions/opcodes, with the following features: Clearly distinguishes between real opcodes and assembly-language macros (pseudo-instructions) Describes the instruction behavior including differences depending on privilege level. Indicates in whic...
For comprehensive documentation on 32-bit MIPS instructions, including their opcodes, behavior, and instruction set revisions, you can refer to the following resources: 1. **MIPS Architecture Manuals**: The official MIPS architecture documentation is the most authoritative source. MIPS Technologies provides manuals th...
27,640
[ { "from": "human", "value": "Does anyone know of a web site where I can find a list of 32-bit MIPS instructions/opcodes, with the following features:\n\nClearly distinguishes between real opcodes and assembly-language macros (pseudo-instructions)\nDescribes the instruction behavior including differences dep...
Is there some way I can define String[int] to avoid using String.CharAt(int)?
Yes, you can define a custom class in Java to achieve this. The idea is to create a class that behaves like a string but allows you to access its characters using array-like indexing. Here's an example of how you might implement such a class: ```java public class StringArray { private String str; public Strin...
26,563
[ { "from": "human", "value": "Is there some way I can define String[int] to avoid using String.CharAt(int)?\n" }, { "from": "gpt", "value": "Yes, you can define a custom class in Java to achieve this. The idea is to create a class that behaves like a string but allows you to access its characters...
I have a form that searches all rows in a single table (TServices) that occurred between the date range and then populates a dynamic table below the form. Now I'm adding a delete ImageButton next to each listing in the table. Here's my C# code-behind for adding the ImageButtons to the table cell: ImageButton b...
It sounds like you're on the right track, but there are a few details to ensure that the dynamic table is repopulated correctly after the deletion operation. Here’s a checklist and some advice on how to structure the code for your delete operation: ### 1. **Ensure ViewState and Event Handling:** - Make sure your dy...
26,221
[ { "from": "human", "value": "I have a form that searches all rows in a single table (TServices) that occurred between the date range and then populates a dynamic table below the form.\nNow I'm adding a delete ImageButton next to each listing in the table. Here's my C# code-behind for adding the ImageButton...
I am currently working on a website to track projects. In it, it is possible to create Service Level Agreements (SLAs). These are configurable with days of the week that a project can be worked on and also the timespan on each of those days. Eg. on Monday it might be between 08:00 and 16:00 and then on friday from 10:0...
To calculate the deadline based on configurable working hours and days, you'll need to follow a step-by-step approach. Here's a general outline of how to achieve this: 1. **Define the Inputs:** - Start time of the project (e.g., `2023-10-02 14:00` for Monday). - Priority that dictates the total work time needed ...
23,781
[ { "from": "human", "value": "I am currently working on a website to track projects. In it, it is possible to create Service Level Agreements (SLAs). These are configurable with days of the week that a project can be worked on and also the timespan on each of those days. Eg. on Monday it might be between 08:...
I am an Ajax developer and I want to build a Flash application. Given my previous experience with JavaScript, what do you thing will be the easiest way to learn ActionScript and what are the obstacles I might encounter?
Transitioning from Ajax and JavaScript to ActionScript can be relatively smooth given your background in web development, but there are some key differences and challenges you might encounter. Here are some suggestions and potential obstacles to consider as you learn ActionScript: ### Easiest Ways to Learn ActionScrip...
19,163
[ { "from": "human", "value": "I am an Ajax developer and I want to build a Flash application. Given my previous experience with JavaScript, what do you thing will be the easiest way to learn ActionScript and what are the obstacles I might encounter? \n" }, { "from": "gpt", "value": "Transitioning...
Our application executes a long, hairy stored procedure with multiple result sets. The users are experiencing long wait times for this query, so I set out to determine what is causing the delay. I put a Stopwatch on executing and reading the data, and it takes 6-7 seconds each time. I timed the execution of the store...
Based on your explanation, it seems you've made significant progress in diagnosing the performance issue associated with your stored procedure and how your application interacts with it. Your observations regarding the behavior of `NextResult()` are key to understanding why you are experiencing delays. ### Key Points:...
24,452
[ { "from": "human", "value": "Our application executes a long, hairy stored procedure with multiple result sets. The users are experiencing long wait times for this query, so I set out to determine what is causing the delay.\nI put a Stopwatch on executing and reading the data, and it takes 6-7 seconds each...
i'm want to have a repeater generate a bunch of checkboxes, e.g.: <tr><td><input type="checkbox" name="t" value="11cbf4deb87" /> <input type="checkbox" name="a" value="33cbf4deb87" />stackoverflow.com</td></tr> <tr><td><input type="checkbox" name="t" value="11cbf4deb88" /> <input type="checkbox" name="a" value="33cbf4d...
Let's address your questions regarding the use of a Repeater control in ASP.NET Web Forms to generate checkboxes dynamically and handle user interactions with them. ### Question 1: Referencing Each Checkbox and Setting Unique Values When using a Repeater, you can set unique values for the checkboxes in two ways: usin...
22,581
[ { "from": "human", "value": "i'm want to have a repeater generate a bunch of checkboxes, e.g.:\n<tr><td><input type=\"checkbox\" name=\"t\" value=\"11cbf4deb87\" /> <input type=\"checkbox\" name=\"a\" value=\"33cbf4deb87\" />stackoverflow.com</td></tr>\n<tr><td><input type=\"checkbox\" name=\"t\" value=\"11...
Can anyone tell the function to sort the columns of a gridview in c# asp.net. The databound to gridview is from datacontext created using linq. I wanted to click the header of the column to sort the data. Thanks!
In ASP.NET, you can enable sorting in a GridView that is bound to data from a LINQ-to-SQL DataContext. To achieve this, you need to make a few modifications to your GridView and your data binding code. Below are the steps to implement sorting when clicking on the header of the columns. ### Step 1: Enable Sorting in Gr...
21,023
[ { "from": "human", "value": "Can anyone tell the function to sort the columns of a gridview in c# asp.net.\nThe databound to gridview is from datacontext created using linq. I wanted to click the header of the column to sort the data.\nThanks!\n" }, { "from": "gpt", "value": "In ASP.NET, you ca...
I am creating a WordML document from an xml file whose elements sometimes contain html-formatted text. <w:p> <w:r> <w:t> html formatted content is in here taken from xml file! </w:t> </w:r> </w:p> This is how my templates are sort of set up. I have a recursive call-template function that does text replaceme...
Yes, it is possible to use XSLT to manipulate XML without directly embedding CDATA strings. Instead of inserting CDATA sections, you can use XSLT's ability to create new elements and close existing ones dynamically. To achieve this, you can utilize the `<xsl:choose>` statement along with templates to handle the format...
23,490
[ { "from": "human", "value": "I am creating a WordML document from an xml file whose elements sometimes contain html-formatted text. \n<w:p>\n <w:r>\n <w:t> html formatted content is in here taken from xml file! </w:t>\n </w:r>\n</w:p>\n\nThis is how my templates are sort of set up. I have a recursive...
how do I pass additional information to the service method returning the collection of items? I'll attempt to explain what I mean, I have 2 text boxes on a form, I need to fill out names, based of a specific account id in a database. so, I need to pass an integer to the getNamesForDropDown method. I couldn't figure ...
To properly pass additional information, such as an account ID, to a service method in ASP.NET, you should modify the way you call the service from the front end. Instead of using `CompletionSetCount` (which is not intended for passing custom parameters), you can achieve this by using an additional control, like a hidd...
17,351
[ { "from": "human", "value": "how do I pass additional information to the service method returning the collection of items? I'll attempt to explain what I mean, I have 2 text boxes on a form, I need to fill out names, based of a specific account id in a database. so, I need to pass an integer to the getNam...
I need to add a row to a spreadsheet using VBScript on a PC that does not have Microsoft Office installed. I tried [Set objExcel = CreateObject("Excel.Application")] Since Excel does not exist on the PC I cannot create this object. Is there a way to modify a spreadsheet without Excel?
If you need to manipulate a spreadsheet without Microsoft Excel installed on a PC, you can use alternative libraries or approaches. One common method is to work with CSV files or use an open-source library like `Spreadsheet::ParseExcel` if you're using VBScript. However, since VBScript itself does not have built-in c...
27,000
[ { "from": "human", "value": "I need to add a row to a spreadsheet using VBScript on a PC that does not have Microsoft Office installed.\nI tried [Set objExcel = CreateObject(\"Excel.Application\")]\nSince Excel does not exist on the PC I cannot create this object.\nIs there a way to modify a spreadsheet wit...
I have deployed ASP.NET web site and ASP.NET web service on the same web server. Both of them require access to shared file. How to implement/share lock that supports single writers and multiple readers? If somebody reads, nobody can write, but all still can read. If somebody writes, nobody can read/write.
To implement a shared lock that supports single writers and multiple readers in an ASP.NET environment, you can use a combination of `ReaderWriterLockSlim`, which is a synchronization primitive designed specifically for this purpose. This mechanism allows multiple threads to read simultaneously while ensuring that only...
22,382
[ { "from": "human", "value": "I have deployed ASP.NET web site and ASP.NET web service on the same web server. Both of them require access to shared file. \nHow to implement/share lock that supports single writers and multiple readers? If somebody reads, nobody can write, but all still can read. If somebody ...
I'm overriding WndProc, so I want to write code like if (m.Msg == WM_COMMAND) my special stuff else base.WndProc(ref m)
When overriding the `WndProc` method in a Windows Forms application, you can handle specific messages by checking the `Msg` property of the `Message` structure. To implement your requirement of handling the `WM_COMMAND` message and calling the base implementation for other messages, you can follow this pattern: Here’s...
27,054
[ { "from": "human", "value": "I'm overriding WndProc, so I want to write code like\nif (m.Msg == WM_COMMAND)\n my special stuff\nelse\n base.WndProc(ref m)\n\n" }, { "from": "gpt", "value": "When overriding the `WndProc` method in a Windows Forms application, you can handle specific message...
How do I in SQL Server 2005 use the DateAdd function to add a day to a date
In SQL Server 2005, you can use the `DATEADD` function to add a specified interval to a date. To add a day to a date, you would use the following syntax: ```sql DATEADD(interval, number, date) ``` For adding a day, the `interval` would be `'day'` or `'d'`, the `number` would be `1` (for one day), and the `date` would...
29,181
[ { "from": "human", "value": "How do I in SQL Server 2005 use the DateAdd function to add a day to a date\n" }, { "from": "gpt", "value": "In SQL Server 2005, you can use the `DATEADD` function to add a specified interval to a date. To add a day to a date, you would use the following syntax:\n\n`...
I've got a database here that runs entirely on GMT. The client machines, however, may run on many different time zones (including BST). When you pull data back using SqlConnection, it will translate the datetime value so, for instance 19 August 2008 becomes 18 August 2008 23:00:00. My question is, is there a way to s...
When you're working with SQL Server and retrieving `DATETIME` values through a connection, the conversion to the client machine's local timezone is indeed influenced by the application and the settings of the SQL connection. Unfortunately, there's no direct way to prevent the automatic timezone conversion in the `SqlCo...
28,487
[ { "from": "human", "value": "I've got a database here that runs entirely on GMT. The client machines, however, may run on many different time zones (including BST). When you pull data back using SqlConnection, it will translate the datetime value so, for instance\n19 August 2008\nbecomes\n18 August 2008 2...
I'm looking for success and failure stories of web applications rendering rich, 2D graphics via the HTML canvas element. I've seen some intriguing examples online but wanted to learn about some real-world, practical examples of development done using this approach.
There are numerous success and failure stories associated with web applications that leverage the HTML `<canvas>` element for rendering rich, 2D graphics. Below are a few notable examples that illustrate both successful implementations and challenges faced during development. ### Success Stories 1. **Google Chrome Ex...
21,165
[ { "from": "human", "value": "I'm looking for success and failure stories of web applications rendering rich, 2D graphics via the HTML canvas element. I've seen some intriguing examples online but wanted to learn about some real-world, practical examples of development done using this approach. \n" }, { ...
Because I run a blog aggregator website which checks a large list of RSS feeds for new posts every hour so I will be happy if its possible to use google feed api or Google AJAX Feed API instead of making the cron jobs to read the whole feed to know if its updated or not. like this link text
Google has deprecated the Feed API and the AJAX Feed API, so you can no longer use these services to fetch RSS feeds. Instead, you'll need to implement your own solution to periodically check RSS feeds for updates. Here are some alternatives to consider: 1. **Use a Third-Party RSS Library**: Instead of using Google’s...
25,560
[ { "from": "human", "value": "Because I run a blog aggregator website which checks a large list of RSS feeds for new posts every hour so I will be happy if its possible to use google feed api or Google AJAX Feed API instead of making the cron jobs to read the whole feed to know if its updated or not.\nlike t...
I'm way buried in many nested levels of css, and I can't tell which style layer/level is messing up my display. How can I find out everything that's being applied to a particular element?
When you're dealing with complex nested styles in CSS, it can sometimes be tricky to pinpoint which styles are affecting a particular element. Fortunately, there are several tools and techniques available to help you identify all the styles being applied to an element: 1. **Browser Developer Tools**: Most modern br...
24,819
[ { "from": "human", "value": "I'm way buried in many nested levels of css, and I can't tell which style layer/level is messing up my display. How can I find out everything that's being applied to a particular element?\n" }, { "from": "gpt", "value": "When you're dealing with complex nested styles...
I wanted to derive a class from Predicate<IMyInterface>, but it appears as if Predicate<> is sealed. In my case I wanted to simply return the inverted (!) result of the designated function. I have other ways to accomplish the goal. My question is what might the MS designers have been thinking when deciding to seal Pred...
The decision to seal the `Predicate<T>` delegate in .NET may stem from several considerations by the designers at Microsoft. Here are some possible thoughts behind this design choice: 1. **Intent and Use Case**: The `Predicate<T>` delegate is intended to provide a simple way to define a method that represents a boolea...
27,316
[ { "from": "human", "value": "I wanted to derive a class from Predicate<IMyInterface>, but it appears as if Predicate<> is sealed. In my case I wanted to simply return the inverted (!) result of the designated function. I have other ways to accomplish the goal. My question is what might the MS designers have...
I need to send email through an (external) SMTP server from Java however this server will only accept CRAM-MD5 authentication, which is not supported by JavaMail. What would be a good way to get these emails to send? (It must be in Java.)
If you need to send emails using an external SMTP server that only supports CRAM-MD5 authentication, and since the JavaMail API does not natively support CRAM-MD5 authentication, you will need to implement a custom solution. Here's how you can approach this: 1. **Use a Third-Party Library**: You can use a library that...
19,607
[ { "from": "human", "value": "I need to send email through an (external) SMTP server from Java however this server will only accept CRAM-MD5 authentication, which is not supported by JavaMail.\nWhat would be a good way to get these emails to send? (It must be in Java.)\n" }, { "from": "gpt", "val...
I am new to the world of ASP.NET and SQL server, so please pardon my ignorance ... If I have a data structure in C# (for e.g. let's just say, a vector that stores some strings), is it possible to store the contents of the vector as is in SQL table? I want to do this so that it fast to convert that data back into vector...
Yes, it is possible to store a collection of strings (or any binary data) in a SQL Server database using a `VARBINARY(MAX)` field. The idea is to serialize your data structure (in this case, a vector of strings) into a byte array before storing it in the database. When retrieving the data, you can deserialize the byte ...
22,169
[ { "from": "human", "value": "I am new to the world of ASP.NET and SQL server, so please pardon my ignorance ...\nIf I have a data structure in C# (for e.g. let's just say, a vector that stores some strings), is it possible to store the contents of the vector as is in SQL table? I want to do this so that it ...
I want to "remove" a UIView from a superview and add it again at the end... but at the "bottom" of the rest of the UIviews that belong to the superview. Is this possible? Any help is very appreciated!
Yes, it's possible to "remove" a `UIView` from its superview and then add it back to the end of the subviews in that superview. You can achieve this using the following steps: 1. Remove the view from its superview. 2. Add the view back to the superview. When you add the view back, it will automatically be placed at t...
25,597
[ { "from": "human", "value": "I want to \"remove\" a UIView from a superview and add it again at the end... but at the \"bottom\" of the rest of the UIviews that belong to the superview. \nIs this possible?\nAny help is very appreciated!\n" }, { "from": "gpt", "value": "Yes, it's possible to \"re...
I have been running Apache HTTPD in 64bit mode by stripping out the 32bit architecture from the binary (along with the ppc parts). I did this to make it more compatible for python and mysql. However I have another machine that needs it to be run in 32bit mode (it has all four original architectures still in it). Is it ...
To run Apache HTTPD in 32-bit mode on a machine that has a 64-bit binary, you have several options. Here’s a summary of your options: 1. **Use a 32-bit Version of Apache**: The most straightforward approach is to install a native 32-bit version of Apache HTTPD. This is generally the recommended way, as it ensures that...
28,022
[ { "from": "human", "value": "I have been running Apache HTTPD in 64bit mode by stripping out the 32bit architecture from the binary (along with the ppc parts). I did this to make it more compatible for python and mysql.\nHowever I have another machine that needs it to be run in 32bit mode (it has all four o...
What are some useful Oracle optimizations one can use for an Application that mostly writes (updates) to an Oracle database? The general usage pattern here is not web-serving or logging, as is most cases, but instead to persist complex state of a system, so the only times reading is needed is when the system starts up...
In a scenario where your application primarily focuses on writes and updates to an Oracle database, several optimization strategies can be employed to enhance performance. Given your unique usage pattern, here are several recommendations: 1. **Use Direct Path Inserts**: - For bulk inserts, consider using direct pat...
17,906
[ { "from": "human", "value": "What are some useful Oracle optimizations one can use for an Application that mostly writes (updates) to an Oracle database? \nThe general usage pattern here is not web-serving or logging, as is most cases, but instead to persist complex state of a system, so the only times read...
I have been reading carefully through the MediaWiki documentation but I have not been able to find out how to create new groups. When I look at Special:Userrights, I see only 3 groups : Bots, Sysops, Bureaucrats I would like to create my own custom groups, so I can use some extensions like the http://www.mediawiki.org/...
To create new user groups in MediaWiki, you need to modify the `LocalSettings.php` file of your MediaWiki installation. Here are the steps you can follow to create custom user groups: 1. **Access the LocalSettings.php File**: You will typically find this file in the root directory of your MediaWiki installation. Open ...
27,692
[ { "from": "human", "value": "I have been reading carefully through the MediaWiki documentation but I have not been able to find out how to create new groups.\nWhen I look at Special:Userrights, I see only 3 groups :\nBots, Sysops, Bureaucrats\nI would like to create my own custom groups, so I can use some e...
I've heard that it's possible with extension methods, but I can't quite figure it out myself. I'd like to see a specific example if possible. Thanks!
Certainly! Extension methods in C# allow you to "add" new methods to existing types without modifying their source code. This is particularly useful for enhancing functionality or creating utility methods for existing classes, such as built-in types. Here's a simple example to illustrate how to create and use extensio...
26,909
[ { "from": "human", "value": "I've heard that it's possible with extension methods, but I can't quite figure it out myself. I'd like to see a specific example if possible.\nThanks!\n" }, { "from": "gpt", "value": "Certainly! Extension methods in C# allow you to \"add\" new methods to existing typ...
We've got VisualSVN Server set up as our Subversion server on Windows, and we use Ankhsvn + TortoiseSVN as clients on our workstations. How can you configure the server to require commit messages to be non-empty?
To configure your VisualSVN Server to require non-empty commit messages in Subversion, you can use a pre-commit hook. This is a script that is executed on the server side before the commit is completed, and it can be used to enforce rules such as ensuring that commit messages are not empty. Here’s how you can set this...
25,085
[ { "from": "human", "value": "We've got VisualSVN Server set up as our Subversion server on Windows, and we use Ankhsvn + TortoiseSVN as clients on our workstations.\nHow can you configure the server to require commit messages to be non-empty?\n" }, { "from": "gpt", "value": "To configure your Vi...
Generate the Fibonacci sequence in the fewest amount of characters possible. Any language is OK, except for one that you define with one operator, f, which prints the Fibonacci numbers. Starting point: 25 14 characters in Haskell: f=0:1:zipWith(+)f(tail f) f=0:scanl(+)1f
Here's a concise way to generate the Fibonacci sequence in a few programming languages: ### Python ```python f=lambda n:n and f(n-1)+f(n-2)or n ``` ### Ruby ```ruby f=->n{n<2?n:f[n-1]+f[n-2]} ``` ### JavaScript ```javascript f=n=>n<2?n:f(n-1)+f(n-2) ``` ### Bash ```bash f(){ echo $1; ((n=$1+2)); ((x=0)); ((y=1)); f...
28,693
[ { "from": "human", "value": "Generate the Fibonacci sequence in the fewest amount of characters possible. Any language is OK, except for one that you define with one operator, f, which prints the Fibonacci numbers.\nStarting point: 25 14 characters in Haskell:\n f=0:1:zipWith(+)f(tail f) \nf=0:scanl(+)1f\n\...
I'm trying to use a generic List as a property on a ServicedComponent class... public class MyCOM : ServicedComponent { public enum MyEnumType { Value1, Value2, Value3 } public List<MyEnumType> MyList { private set; get; } public MyCOM() { MyList = new List<MyEnumType>(); } } Th...
When dealing with COM Interop in .NET, there are specific limitations and requirements that need to be taken into account, especially regarding the types and constructs that can be exposed to COM clients. ### Issue with Generics in COM The primary reason why generics (including `List<T>`) do not work well with COM i...
27,093
[ { "from": "human", "value": "I'm trying to use a generic List as a property on a ServicedComponent class...\npublic class MyCOM : ServicedComponent {\n public enum MyEnumType {\n Value1, Value2, Value3\n }\n public List<MyEnumType> MyList { private set; get; }\n public MyCOM()\n {\n ...
If I have added/removed/modified a large number of files in my local ClearCase view, how can I be certain that all the files have been added to source control?
To ensure that all files have been added to source control in your local ClearCase view after you've made a large number of modifications (additions, removals, or modifications), you can follow these steps: 1. **Use ClearCase Commands**: - Open a command prompt or terminal where ClearCase is available. - Naviga...
23,631
[ { "from": "human", "value": "If I have added/removed/modified a large number of files in my local ClearCase view, how can I be certain that all the files have been added to source control?\n" }, { "from": "gpt", "value": "To ensure that all files have been added to source control in your local C...
I have a GridView control in an Asp.net application, that has a <asp:buttonField> of type="image" and CommandName="Delete". Is there any way to execute a piece of javascript before reaching the OnRowDelete event? I want just a simple confirm before deleting the row. Thanks! EDIT: Please Note that <asp:ButtonField> tag ...
In an ASP.NET GridView control, if you are using an `<asp:ButtonField>` of type "image", you cannot directly set an `OnClientClick` attribute as you would with an `<asp:Button>` control. However, you can achieve the desired functionality of confirming the delete action using a combination of JavaScript and handling the...
25,796
[ { "from": "human", "value": "I have a GridView control in an Asp.net application, that has a <asp:buttonField> of type=\"image\" and CommandName=\"Delete\".\nIs there any way to execute a piece of javascript before reaching the OnRowDelete event?\nI want just a simple confirm before deleting the row.\nThank...
Building a client-side swing application what should be notified on a bus (application-wide message system, similar in concept to JMS but much simpler) and what should be notified using direct listeners? When using a bus, I always have an unescapable feeling of "I have no idea who uses that and where". Also, no set ord...
When designing a client-side Swing application, managing communications between different components is crucial for maintainability and clarity. You've identified the trade-offs between using a centralized message bus and direct listeners, and it's important to find the right balance. Here are some guidelines to help y...
24,025
[ { "from": "human", "value": "Building a client-side swing application what should be notified on a bus (application-wide message system, similar in concept to JMS but much simpler) and what should be notified using direct listeners?\nWhen using a bus, I always have an unescapable feeling of \"I have no idea...
We have seen the following exceptions very frequently on IBM AIX when attempting to make an SSL connection to our server: java.net.SocketException: Socket closed at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275(Compiled Code)) at com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA6275(Compiled Code)) at...
The exceptions you're encountering indicate issues related to network connections, specifically SSL connections, on an IBM AIX system. Here are some potential causes and troubleshooting steps to consider: 1. **Network Configuration Changes**: Even though you mentioned there haven't been any changes to the network layo...
27,382
[ { "from": "human", "value": "We have seen the following exceptions very frequently on IBM AIX when attempting to make an SSL connection to our server:\njava.net.SocketException: Socket closed\nat com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275(Compiled Code))\nat com.sun.net.ssl.internal.ssl.AppOutp...
I've been given a requirement for an internal web application to send documents to a printer transparently. The idea would be that the user can select their nearest printer, and the web application would send their print jobs to the printer they selected. The first printer we have to roll out against are Canons, so my...
To send print jobs to a Canon iR5570 printer from an internal web application, you'll generally follow these steps: ### 1. Determine Printer Access Ensure that the Canon iR5570 printer is accessible on the network from the machine running your web application. You’ll need the printer's IP address or hostname. ### 2. ...
25,232
[ { "from": "human", "value": "I've been given a requirement for an internal web application to send documents to a printer transparently. The idea would be that the user can select their nearest printer, and the web application would send their print jobs to the printer they selected.\nThe first printer we ...
Given an arbitrary sequence of points in space, how would you produce a smooth continuous interpolation between them? 2D and 3D solutions are welcome. Solutions that produce a list of points at arbitrary granularity and solutions that produce control points for bezier curves are also appreciated. Also, it would be coo...
Creating a smooth continuous interpolation between a sequence of points in space can be approached in various ways, depending on the specific requirements (smoothness, dimensionality, and the ability to handle arbitrary granularity). Below are several methods you can use for both 2D and 3D cases. ### 1. Polynomial Int...
8,001
[ { "from": "human", "value": "Given an arbitrary sequence of points in space, how would you produce a smooth continuous interpolation between them?\n2D and 3D solutions are welcome. Solutions that produce a list of points at arbitrary granularity and solutions that produce control points for bezier curves a...
I want to set up a Subversion server installation on Windows Server 2003 64-bit and I'm considering using VisualSVN Server. Does this work OK in a 64-bit environment? Are there any issues or gotchas I should be aware of before installing the software? Many thanks!
Yes, VisualSVN Server is compatible with Windows Server 2003 (both 32-bit and 64-bit versions). It is designed to run smoothly on various Windows operating systems, including older versions like Windows Server 2003. Here are some considerations and potential gotchas to keep in mind before installing: ### Compatibility...
26,370
[ { "from": "human", "value": "I want to set up a Subversion server installation on Windows Server 2003 64-bit and I'm considering using VisualSVN Server. Does this work OK in a 64-bit environment? Are there any issues or gotchas I should be aware of before installing the software?\nMany thanks!\n" }, { ...
Looking for a way to programatically, or otherwise, add a new instance of SQL 2005 Express Edition to a system that already has an instance installed. Traditionally, you run Micrsoft's installer like I am in the command line below and it does the trick. Executing the command in my installer is not the issue, it's mor...
To add a new instance of SQL Server 2005 Express without re-running the full installer, you'll need to utilize the SQL Server's command line tools, specifically `SQL Server Setup`, and leverage the existing installation. Unfortunately, SQL Server 2005 does not have a built-in command to create a new instance from an al...
24,957
[ { "from": "human", "value": "Looking for a way to programatically, or otherwise, add a new instance of SQL 2005 Express Edition to a system that already has an instance installed. Traditionally, you run Micrsoft's installer like I am in the command line below and it does the trick. Executing the command i...
I want to create visuals along the lines of CNN's "red-state, blue-state" shadings of the states in the U.S. for my project. I'm planning to do something fancier than just shading the state's shape in a color. Are there open source libraries of state shapes/polygons (or - if not open source - others) that I can import ...
Creating visually appealing maps with complex shading for U.S. states can be accomplished using various libraries and tools. Here are some options for obtaining state shapes/polygons and creating customized visualizations: ### Open Source Libraries and Datasets 1. **GeoJSON Data**: - You can find GeoJSON files con...
25,326
[ { "from": "human", "value": "I want to create visuals along the lines of CNN's \"red-state, blue-state\" shadings of the states in the U.S. for my project. I'm planning to do something fancier than just shading the state's shape in a color. Are there open source libraries of state shapes/polygons (or - if n...
Is there a way of using an 'OR' operator or equivalent in a PHP switch? For example, something like this: switch ($value) { case 1 || 2: echo 'the value is either 1 or 2'; break; }
In PHP, the `switch` statement does not natively support the use of an `OR` operator in the way you're attempting in your example. However, you can achieve the equivalent functionality by using multiple `case` statements for each condition. Here's how you can implement it: ```php switch ($value) { case 1: case...
30,021
[ { "from": "human", "value": "Is there a way of using an 'OR' operator or equivalent in a PHP switch?\nFor example, something like this:\nswitch ($value) {\n\n case 1 || 2:\n echo 'the value is either 1 or 2';\n break;\n}\n\n" }, { "from": "gpt", "value": "In PHP, the `switch` st...
I'm getting ready to start a new project and I've been researching the entity framework. My question is what is the best strategy for validating the entities? Other projects I've worked on have used attributes for most of the validation, but obviously this is not possible in the entity framework. Is the only way to do ...
When working with Entity Framework (EF), especially EF Core, there are multiple strategies you can employ for validating entities. While using attributes is common in ASP.NET for model validation, Entity Framework itself does not support validation through attributes directly on the entity classes as part of its core f...
20,951
[ { "from": "human", "value": "I'm getting ready to start a new project and I've been researching the entity framework. My question is what is the best strategy for validating the entities? Other projects I've worked on have used attributes for most of the validation, but obviously this is not possible in the...
Let's suppose I'm using the Northwind database and I would like to run a query via a stored procedure that contains, among other parameters, the following: @Offset to indicate where the pagination starts, @Limit to indicate the page size, @SortColumn to indicate the column used for sorting purposes, @SortDirection, to...
Your approach to paginating and sorting using the `ROW_NUMBER()` function in SQL Server is a common practice, especially when you want to implement pagination with dynamic sorting capabilities. However, the use of `CASE` statements for sorting can make the query a bit more complicated than necessary. One main concern...
23,842
[ { "from": "human", "value": "Let's suppose I'm using the Northwind database and I would like to run a query via a stored procedure that contains, among other parameters, the following:\n\n@Offset to indicate where the pagination starts,\n@Limit to indicate the page size,\n@SortColumn to indicate the column ...
I am looking at connecting to a openSuse 11.1 Beta 3 virtual machine from my Vista 64-bit development workstation. I found UltraVNC Viewer to be the only option for this purpose. Is there any other clients that I can use to connect from Vista to openSuse/other Linux installs? Note: Bandwidth is not a worry, the connec...
Yes, there are several options you can consider for connecting to an openSUSE 11.1 Beta 3 virtual machine from your Windows Vista 64-bit development workstation. While UltraVNC is a popular choice, here are some alternative clients and protocols you might want to explore: 1. **TightVNC**: Similar to UltraVNC, TightVNC...
26,459
[ { "from": "human", "value": "I am looking at connecting to a openSuse 11.1 Beta 3 virtual machine from my Vista 64-bit development workstation. I found UltraVNC Viewer to be the only option for this purpose. Is there any other clients that I can use to connect from Vista to openSuse/other Linux installs? \n...
Weird issue: Open a large notepad window create a toolwindow (style WS_EX_TOOLWINDOW) create 2 more windows (normal overlapped) (WS_OVERLAPPED) close those 2 overlapped windows (child of desktop or the toolwindow) the toolwindow jumps behind the notepad window Does anyone know why this is the case? Or what I could b...
The behavior you're encountering, where a tool window moves behind other windows when its child overlapped windows are closed, may be related to how Windows manages the Z-order of windows and the way you are defining your window styles. ### Explanation: 1. **Window Styles and Z-order**: - Tool windows (`WS_EX_TOOL...
24,976
[ { "from": "human", "value": "Weird issue:\n\nOpen a large notepad window\ncreate a toolwindow (style WS_EX_TOOLWINDOW)\ncreate 2 more windows (normal overlapped) (WS_OVERLAPPED)\nclose those 2 overlapped windows (child of desktop or the toolwindow)\nthe toolwindow jumps behind the notepad window\n\nDoes any...
I have a WPF TreeView with just 1 level of items. The TreeView is data bound to an ObservableCollection of strings. How can I ensure that the same icon appears to the left of each node in the TreeView?
To display the same icon next to each item in a WPF `TreeView` that is data-bound to an `ObservableCollection<string>`, you can define a `TreeViewItem` template using a `HierarchicalDataTemplate`. This allows you to customize the display of each item, including adding an icon. Here's a step-by-step guide to achieving ...
25,615
[ { "from": "human", "value": "I have a WPF TreeView with just 1 level of items. The TreeView is data bound to an ObservableCollection of strings. How can I ensure that the same icon appears to the left of each node in the TreeView?\n" }, { "from": "gpt", "value": "To display the same icon next ...
What rules do you use to name your variables? Where are single letter vars allowed? How much info do you put in the name? How about for example code? What are your preferred meaningless variable names? (after foo & bar) Why are they spelled "foo" and "bar" rather than FUBAR
Naming variables is a crucial part of writing clean, maintainable code. Here are some common rules and best practices for variable naming: ### Rules for Naming Variables: 1. **Descriptive Names**: Use meaningful names that describe the purpose of the variable (e.g., `totalPrice`, `userAge`). 2. **Camel Case or Snake C...
25,748
[ { "from": "human", "value": "\nWhat rules do you use to name your variables?\nWhere are single letter vars allowed?\nHow much info do you put in the name?\nHow about for example code?\nWhat are your preferred meaningless variable names? (after foo & bar)\nWhy are they spelled \"foo\" and \"bar\" rather than...
We use a lot of of python to do much of our deployment and would be handy to connect to our TFS server to get information on iteration paths, tickets etc. I can see the webservice but unable to find any documentation. Just wondering if anyone knew of anything?
Connecting to a Team Foundation Server (TFS) and interacting with its data using Python can be accomplished through the TFS API, specifically through the REST API provided by TFS/Azure DevOps. Here are the steps and resources to help you get started: ### 1. Use the Azure DevOps REST API TFS has evolved into Azure Dev...
23,007
[ { "from": "human", "value": "We use a lot of of python to do much of our deployment and would be handy to connect to our TFS server to get information on iteration paths, tickets etc. I can see the webservice but unable to find any documentation. Just wondering if anyone knew of anything?\n" }, { "f...
I have a range of random numbers. The range is actually determined by the user but it will be up to 1000 integers. They are placed in this: vector<int> n and the values are inserted like this: srand(1); for (i = 0; i < n; i++) v[i] = rand() % n; I'm creating a separate function to find all the non-prime values. ...
To identify non-prime values from a range of numbers in C++, it's important to clarify the logic you need for the Sieve of Eratosthenes method or a similar approach. Here's a cleaner and more efficient way to identify non-prime numbers from a vector of integers: 1. **Define Non-Prime Numbers**: Non-prime numbers inclu...
25,631
[ { "from": "human", "value": "I have a range of random numbers. The range is actually determined by the user but it will be up to 1000 integers. They are placed in this:\nvector<int> n\n\nand the values are inserted like this:\nsrand(1);\n\nfor (i = 0; i < n; i++)\n v[i] = rand() % n;\n\nI'm creating a se...
If you throw an exception from inside an MFC dialog, the app hangs, even if you have a catch block in your code. It refuses to respond to the mouse or keyboard, and the only way to shut it down is to use Task Manager. Why I'm posting this question To my shame, there is a popular shrink-wrapped application that hangs ...
The issue you're encountering with exceptions in an MFC (Microsoft Foundation Class) dialog typically arises from the fact that exceptions that are thrown inside a modal dialog (such as when a user interacts with the dialog) can interfere with MFC's message handling system. If not properly managed, this can cause the a...
24,588
[ { "from": "human", "value": "If you throw an exception from inside an MFC dialog, the app hangs, even if you have a catch block in your code. It refuses to respond to the mouse or keyboard, and the only way to shut it down is to use Task Manager.\nWhy I'm posting this question\nTo my shame, there is a pop...
For a complex web application that includes dynamic content and personalization, what is a good response time from the server (so excluding network latency and browser rendering time)? I'm thinking about sites like Facebook, Amazon, MyYahoo, etc. A related question is what is a good response time for a backend servic...
For a complex web application that includes dynamic content and personalization, a good server response time is generally considered to be under **200 milliseconds (ms)**. This benchmark is especially relevant for applications like Facebook, Amazon, and MyYahoo, where users expect fast interactions. 1. **User Experie...
28,294
[ { "from": "human", "value": "For a complex web application that includes dynamic content and personalization, what is a good response time from the server (so excluding network latency and browser rendering time)? I'm thinking about sites like Facebook, Amazon, MyYahoo, etc. A related question is what is ...
May I request you to help me in clarifying a query.. I am getting an error message "80004005- file could not be opened" The scenario is I am trying to load an XML file created using VB script at run time. ie the creation of the XML and loading it in to QTP are handled in the same script one after the other. I am able ...
The error message "80004005 - file could not be opened" typically indicates a problem related to file access or permissions when attempting to load the XML file in QTP (QuickTest Professional, now known as UFT - Unified Functional Testing). Here are a few steps you can take to troubleshoot and resolve this issue: 1. *...
25,101
[ { "from": "human", "value": "May I request you to help me in clarifying a query..\nI am getting an error message \"80004005- file could not be opened\"\nThe scenario is I am trying to load an XML file created using VB script at run time. ie the creation of the XML and loading it in to QTP are handled in the...
I am making an expand/collapse call rates table for the company I work for. I currently have a table with a button under it to expand it, the button says "Expand". It is functional except I need the button to change to "Collapse" when it is clicked and then of course back to "Expand" when it is clicked again. The writi...
To achieve the functionality of toggling the button's background image between "Expand" and "Collapse," you can use JavaScript along with CSS. Here’s a simple example of how you could implement this: ### HTML Structure ```html <div id="callRatesTable" style="display: none;"> <!-- Your table content goes here --> ...
27,741
[ { "from": "human", "value": "I am making an expand/collapse call rates table for the company I work for. I currently have a table with a button under it to expand it, the button says \"Expand\". It is functional except I need the button to change to \"Collapse\" when it is clicked and then of course back to...
I've been starting to use the new inbuilt Ribbon controls in Delphi 2009 and use the custom frame so the Application button and Mini-toolbar slide up onto the Window Frame, but I'm wondering if on Vista it should use the glass effect like Office 2007 does, and if so how I would enable this setting. Thanks for any help....
In Delphi 2009, when using the Ribbon controls, you can indeed utilize the Windows Vista glass effect (Aero) to enhance the visual appearance of your application, similar to how Office 2007 does. This effect is achieved through the use of the `DwmSetWindowAttribute` API and the appropriate Windows settings. Here are t...
20,002
[ { "from": "human", "value": "I've been starting to use the new inbuilt Ribbon controls in Delphi 2009 and use the custom frame so the Application button and Mini-toolbar slide up onto the Window Frame, but I'm wondering if on Vista it should use the glass effect like Office 2007 does, and if so how I would ...
I have an existing database with the table Transactions in it. I have added a new table called TransactionSequence where each transaction will ultimately have only one record. We are using the sequence table to count transactions for a given account. I have mapped this as a one-to-one mapping where TransactionSequence ...
To address the issue of NHibernate trying to update the `Transaction` table when inserting into the `TransactionSequence` table, it is important to configure your mappings and relationships properly. In your current configuration, the `one-to-one` mapping between `Transaction` and `TransactionSequence` is creating a s...
25,604
[ { "from": "human", "value": "I have an existing database with the table Transactions in it. I have added a new table called TransactionSequence where each transaction will ultimately have only one record. We are using the sequence table to count transactions for a given account. I have mapped this as a one-...
Why can't I create a class in VB.NET that inherits System.IO.Directory? According to Lutz Roeder, it is not declared as NotInheritable! I want to create a utility class that adds functionality to the Directory class. For instance, I want to add a Directory.Move function. Please advise and I will send you a six pack. ...
In VB.NET (as well as in C# and other .NET languages), the reason you cannot inherit from the `System.IO.Directory` class is that it is designed to be a static class. Even though it is not explicitly marked as `NotInheritable` (or `sealed` in C#), it contains only static (Shared in VB.NET) methods and properties, and i...
26,795
[ { "from": "human", "value": "Why can't I create a class in VB.NET that inherits System.IO.Directory? According to Lutz Roeder, it is not declared as NotInheritable!\nI want to create a utility class that adds functionality to the Directory class. For instance, I want to add a Directory.Move function.\nPle...
For example, if I have a unicode string, I can encode it as an ASCII string like so: >>> u'\u003cfoo/\u003e'.encode('ascii') '<foo/>' However, I have e.g. this ASCII string: '\u003foo\u003e' ... that I want to turn into the same ASCII string as in my first example above: '<foo/>'
To convert the ASCII string that contains Unicode escape sequences (like `'\u003cfoo\u003e'`) into the actual ASCII string (`'<foo/>'`), you can use the built-in `unicode_escape` codec in Python. Here is how you can do it: ```python # Your ASCII string containing Unicode escape sequences ascii_string_with_unicode_esca...
30,236
[ { "from": "human", "value": "For example, if I have a unicode string, I can encode it as an ASCII string like so:\n>>> u'\\u003cfoo/\\u003e'.encode('ascii')\n'<foo/>'\n\nHowever, I have e.g. this ASCII string:\n'\\u003foo\\u003e'\n\n... that I want to turn into the same ASCII string as in my first example a...
Is there an easy way to display a messagebox in VB.NET with custom button captions? I came across What is an easy way to create a MessageBox with custom button text in Managed C++?, in the Stack Overflow archives, but it's for Managed C++.
In VB.NET, the standard `MessageBox` class does not directly support custom button captions. However, you can create a custom form to simulate a message box with any buttons and captions you need. Here's how you can create a simple custom message box in VB.NET: ### Step 1: Create a Custom Form 1. Add a new Windows Fo...
24,045
[ { "from": "human", "value": "Is there an easy way to display a messagebox in VB.NET with custom button captions? I came across What is an easy way to create a MessageBox with custom button text in Managed C++?, in the Stack Overflow archives, but it's for Managed C++.\n" }, { "from": "gpt", "va...
Is there a way to get stored procedures from a SQL Server 2005 Express database using C#? I would like to export all of this data in the same manner that you can script it our using SQL Server Management Studio, without having to install the GUI. I've seen some references to do thing via the PowerShell but in the end a...
Yes, you can retrieve and script out stored procedures from a SQL Server 2005 Express database using C#. While you mentioned that you want to avoid using SQL Server Management Studio (SSMS), you can still achieve this programmatically by executing the necessary SQL queries to get the definition of the stored procedures...
16,602
[ { "from": "human", "value": "Is there a way to get stored procedures from a SQL Server 2005 Express database using C#? I would like to export all of this data in the same manner that you can script it our using SQL Server Management Studio, without having to install the GUI.\nI've seen some references to do...
I see in C++ there are multiple ways to allocate and free data and I understand that when you call malloc you should call free and when you use the new operator you should pair with delete and it is a mistake to mix the two (e.g. Calling free() on something that was created with the new operator), but I'm not clear on ...
Great question! Understanding the differences between `malloc`/`free` and `new`/`delete` in C++ is fundamental for effective memory management. Here are some key points and rules of thumb to help you choose between these memory allocation methods: ### 1. **Type Safety and Construction:** - **Use `new`/`delete` when...
25,150
[ { "from": "human", "value": "I see in C++ there are multiple ways to allocate and free data and I understand that when you call malloc you should call free and when you use the new operator you should pair with delete and it is a mistake to mix the two (e.g. Calling free() on something that was created with...
How do I check if an object has a specific property in JavaScript? Consider: x = {'key': 1}; if ( x.hasOwnProperty('key') ) { //Do this } Is that the best way to do it?
Using the `hasOwnProperty` method is a common and effective way to check if an object has a specific property in JavaScript. Your example is perfectly valid: ```javascript x = {'key': 1}; if (x.hasOwnProperty('key')) { // Do this } ``` However, there are a few other methods you could consider, each with its own u...
26,133
[ { "from": "human", "value": "How do I check if an object has a specific property in JavaScript?\nConsider:\nx = {'key': 1};\nif ( x.hasOwnProperty('key') ) {\n //Do this\n}\n\nIs that the best way to do it?\n" }, { "from": "gpt", "value": "Using the `hasOwnProperty` method is a common and eff...
I want to know how the glBlendFunc works. For example, i have 2 gl textures, where the alpha is on tex1, i want to have alpha in my final image. Where the color is on tex1, i want the color from tex2 to be.
In OpenGL, `glBlendFunc` is used to specify the blending factors for blending operations. Blending allows you to combine colors from different sources, often textures, based on their alpha values. In your case, you want to blend two textures such that the alpha from one texture (`tex1`) determines the final image's tra...
21,055
[ { "from": "human", "value": "I want to know how the glBlendFunc works. For example, i have 2 gl textures, where the alpha is on tex1, i want to have alpha in my final image. Where the color is on tex1, i want the color from tex2 to be.\n" }, { "from": "gpt", "value": "In OpenGL, `glBlendFunc` is...
Here's the information according to the official documentation: There are four different pairs of opening and closing tags which can be used in PHP. Two of those, <?php ?> and <script language="php"> </script>, are always available. The other two are short tags and ASP style tags, and can be turned on and ...
Short tags and ASP-style tags in PHP can provide convenience, especially for quick scripts or when you want to write less code. However, there are several reasons why they are not generally recommended: 1. **Portability**: Not all PHP installations have short tags enabled by default. If you write code using short tags...
28,296
[ { "from": "human", "value": "Here's the information according to the official documentation:\n\nThere are four different pairs of\n opening and closing tags which can be\n used in PHP. Two of those, <?php ?>\n and <script language=\"php\"> </script>,\n are always available. The other two\n are short ta...
I have a need to explore VOIP integration into a .Net application. It would be incredibly helpful if the toolset was usable via ASP.Net (version 2.0 or higher), and provided the developer the option to allow interaction on the client either embedded within the web browser or external to the client web browser. It shoul...
Integrating VoIP (Voice over Internet Protocol) into a .NET application can be approached in several ways, especially considering your requirements regarding ASP.NET compatibility and browser independence. Here are some toolsets and technologies you might explore for this purpose: ### 1. **WebRTC** WebRTC (Web Real-Ti...
20,167
[ { "from": "human", "value": "I have a need to explore VOIP integration into a .Net application. It would be incredibly helpful if the toolset was usable via ASP.Net (version 2.0 or higher), and provided the developer the option to allow interaction on the client either embedded within the web browser or ext...
The example given for a spring injected endpoint is as follows: <endpoint id="hl7listener" uri="mina:tcp://localhost:8888?sync=true&amp;codec=hl7codec"/> How do I setup a client mode endpoint such that is will connect to a specific port on another server? How do I configure the endpoint to listen for inbound connectio...
To set up a client-mode endpoint in a Spring application that connects to a specific port on another server, you can use the same Mina transport configuration, but specify it as a client endpoint. ### Setting Up Client Mode Endpoint 1. **Client Endpoint Configuration**: Here is an example of how to configure a clien...
26,485
[ { "from": "human", "value": "The example given for a spring injected endpoint is as follows:\n<endpoint id=\"hl7listener\" uri=\"mina:tcp://localhost:8888?sync=true&amp;codec=hl7codec\"/>\n\nHow do I setup a client mode endpoint such that is will connect to a specific port on another server?\nHow do I confi...
I have a structure like this: <ul> <li>text1</li> <li>text2</li> <li>text3</li> </ul> How do I use javascript or jQuery to get the text as an array? ['text1', 'text2', 'text3'] My plan after this is to assemble it into a string, probably using .join(', '), and get it in a format like this: '"text1", "text2", "t...
You can achieve this using either plain JavaScript or jQuery. Below are examples for both methods. ### Using JavaScript You can select the `<li>` elements, extract their text content, and then use `Array.from` to convert the NodeList to an array. Here's how you can do it: ```javascript // Select all <li> elements co...
28,425
[ { "from": "human", "value": "I have a structure like this:\n<ul>\n <li>text1</li>\n <li>text2</li>\n <li>text3</li>\n</ul>\n\nHow do I use javascript or jQuery to get the text as an array?\n['text1', 'text2', 'text3']\n\nMy plan after this is to assemble it into a string, probably using .join(', '), and ...
I recently baselined my machine and installed VS2008 and I am trying to import my settings file: http://naspinski.net/file.axd?file=naspinski.vssettings I click Tools->Import Settings, select Import selected environment settings and click on Next Next screen I select No, just import new settings, overwrite my current s...
It sounds like you're experiencing an issue while trying to import your settings file in Visual Studio 2008. Here are some steps and suggestions that might help you troubleshoot the issue: 1. **Verify the Settings File**: Make sure that the settings file (`naspinski.vssettings`) is not corrupted. Try opening it in a t...
28,565
[ { "from": "human", "value": "I recently baselined my machine and installed VS2008 and I am trying to import my settings file: http://naspinski.net/file.axd?file=naspinski.vssettings\nI click Tools->Import Settings, select Import selected environment settings and click on Next\nNext screen I select No, just ...
Can this be done? How? I want to write my own extension. Can Get the current page sorcecode in my own extension?
Yes, you can write your own browser extension and access the current page's source code. The method you use will depend on whether you are developing for Google Chrome, Mozilla Firefox, or another browser, but the general approach is similar. Below, I'll outline the steps to create a simple Chrome extension that can re...
21,306
[ { "from": "human", "value": "Can this be done? How?\n\nI want to write my own extension. Can Get the current page sorcecode in my own extension?\n" }, { "from": "gpt", "value": "Yes, you can write your own browser extension and access the current page's source code. The method you use will depen...
I'm trying to run a shell command using the backtick operators, but the fact that the child process inherits php's open file descriptors is problematic. Is there a way to keep this from happening? I'm running PHP 5.1.2
In PHP, when you use backticks (`` `command` ``) or the `shell_exec()` function to run shell commands, the command runs as a child process of the PHP process, and it inherits the file descriptors, including any open file descriptors that your PHP script might have. If you are experiencing issues due to these inherite...
25,307
[ { "from": "human", "value": "I'm trying to run a shell command using the backtick operators, but the fact that the child process inherits php's open file descriptors is problematic. Is there a way to keep this from happening?\nI'm running PHP 5.1.2\n" }, { "from": "gpt", "value": "In PHP, when ...
I need to get the Class of an object at runtime. For an non-abstract class I could do something like: public class MyNoneAbstract{ public static Class MYNONEABSTRACT_CLASS = new MyNoneAbstract().getClass(); But for an abstract class this does NOT work (always gives me Object) public abstract class MyAbstract{ ...
In Java, when you want to get the class of an object at runtime, using `getClass()` is the right approach. However, when you're working with abstract classes, you have to instantiate a subclass of the abstract class since abstract classes cannot be instantiated directly. The reason your code is returning `Object` is b...
26,413
[ { "from": "human", "value": "I need to get the Class of an object at runtime.\nFor an non-abstract class I could do something like:\npublic class MyNoneAbstract{\n public static Class MYNONEABSTRACT_CLASS = new MyNoneAbstract().getClass();\n\nBut for an abstract class this does NOT work (always gives me ...
I'm trying to pick a good CMS that isn't a portal. All of my research as lead me to believe SilverStipe is the best option. I'd like some opinions/impressions. Thanks for any thoughts you have. edit: I've decided to try it out. I'll post my own answer after I've had some time with it. It seems like based on the lac...
SilverStripe is a flexible and user-friendly CMS that has gained popularity for its simplicity and extensibility. Here are some impressions and thoughts based on common feedback from users: ### Pros: 1. **User-Friendly Interface**: SilverStripe offers a clean and intuitive admin interface, making it accessible for con...
26,457
[ { "from": "human", "value": "I'm trying to pick a good CMS that isn't a portal. All of my research as lead me to believe SilverStipe is the best option. I'd like some opinions/impressions.\nThanks for any thoughts you have.\nedit: I've decided to try it out. I'll post my own answer after I've had some ti...
I need to be able to lock down the valid characters in a textbox, I presently have a regex which I can check each character against such as [A-Za-z] would lock down to just Alpha characters. protected override void OnKeyPress(KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Back) { base.OnKeyPress(e); ...
To handle special key combinations like Ctrl-C, Ctrl-V, and others while still validating the input characters against your regex, you need to take a different approach. Instead of only checking individual character input in the `OnKeyPress` method, you can handle the `KeyDown` event for special keys and then still val...
26,418
[ { "from": "human", "value": "I need to be able to lock down the valid characters in a textbox, I presently have a regex which I can check each character against such as \n\n[A-Za-z]\n\nwould lock down to just Alpha characters. \nprotected override void OnKeyPress(KeyPressEventArgs e)\n{\n if (e.KeyChar == ...
I have an Ant script with a junit target where I want it to start up the VM with a different working directory than the basedir. How would I do this? Here's a pseudo version of my target. <target name="buildWithClassFiles"> <mkdir dir="${basedir}/UnitTest/junit-reports"/> <junit fork="true" printsummary="yes"> ...
To change the working directory of the JVM when running JUnit tests from an Ant script, you can use the `-D` option to set the working directory in conjunction with the `junit` task. However, the `junit` task doesn't have a direct attribute to set the working directory of the spawned JVM. Instead, you can use the `di...
25,394
[ { "from": "human", "value": "I have an Ant script with a junit target where I want it to start up the VM with a different working directory than the basedir. How would I do this?\nHere's a pseudo version of my target.\n<target name=\"buildWithClassFiles\">\n <mkdir dir=\"${basedir}/UnitTest/junit-reports...
I am trying to adapt an existing code to a 64 bit machine. The main problem is that in one function, the previous coder uses a void* argument that is converted into suitable type in the function itself. A short example: void function(MESSAGE_ID id, void* param) { if(id == FOO) { int real_param = (int)param;...
To adapt your code for a 64-bit machine while maintaining compatibility with 32-bit machines, you should avoid directly casting a `void*` to an `int`. Instead, you should use a `uintptr_t`, which is an unsigned integer type that is guaranteed to be able to store a pointer. This approach maintains portability across bot...
27,251
[ { "from": "human", "value": "I am trying to adapt an existing code to a 64 bit machine. The main problem is that in one function, the previous coder uses a void* argument that is converted into suitable type in the function itself. A short example:\nvoid function(MESSAGE_ID id, void* param)\n{\n if(id ==...
I have the following line: "14:48 say;0ed673079715c343281355c2a1fde843;2;laka;hello ;)" I parse this by using a simple regexp: if($line =~ /(\d+:\d+)\ssay;(.*);(.*);(.*);(.*)/) { my($ts, $hash, $pid, $handle, $quote) = ($1, $2, $3, $4, $5); } But the ; at the end messes things up and I don't know why. Shouldn't t...
The issue you're experiencing with the regex is due to how the greedy operator `.*` works in your regex. The `.*` matches as much as possible, which can lead to it consuming characters that you didn't intend for it to capture, particularly if there is a `;` character at the end of your input line. In your input line, ...
27,167
[ { "from": "human", "value": "I have the following line:\n\"14:48 say;0ed673079715c343281355c2a1fde843;2;laka;hello ;)\"\n\nI parse this by using a simple regexp:\nif($line =~ /(\\d+:\\d+)\\ssay;(.*);(.*);(.*);(.*)/) {\n my($ts, $hash, $pid, $handle, $quote) = ($1, $2, $3, $4, $5);\n}\n\nBut the ; at the ...
What are the possibilities of a programmer to handle data that are rarely used but cannot be simply deleted because at least reporting still requires it? Some examples I am thinking of: Discountinued funding types of older years of a university Unused currencies (e.g. Italian lira) Names of disappeared countries (e.g....
Your considerations about handling rarely used but necessary data are quite insightful. This scenario is common in various data management contexts, and there are several strategies and design patterns that can help address this challenge effectively. Here are some thoughts and potential solutions: ### 1. **Archiving ...
18,945
[ { "from": "human", "value": "What are the possibilities of a programmer to handle data that are rarely used but cannot be simply deleted because at least reporting still requires it?\nSome examples I am thinking of:\n\nDiscountinued funding types of older years of a university\nUnused currencies (e.g. Itali...
I'm creating an app that will have to put at max 32 GB of data into my database. I am using B-tree indexing because the reads will have range queries (like from 0 < time < 1hr). At the beginning (database size = 0GB), I will get 60 and 70 writes per millisecond. After say 5GB, the three databases I've tested (H2, ber...
When dealing with databases and high write volumes, a few key factors can contribute to the observed performance issues, especially as the database grows in size. Let's address your questions in detail. ### 1. Is this typical? Yes, experiencing a slowdown in write performance as the database size increases can be typ...
21,930
[ { "from": "human", "value": "I'm creating an app that will have to put at max 32 GB of data into my database. I am using B-tree indexing because the reads will have range queries (like from 0 < time < 1hr).\nAt the beginning (database size = 0GB), I will get 60 and 70 writes per millisecond. After say 5GB...
Is it possible to see the CODE for sp_executesql? I would like to see the actual code. I could not find it in sql server management studio.
In SQL Server, `sp_executesql` is a system stored procedure that is part of the SQL Server database engine. Its implementation is not exposed directly to users, meaning that you cannot view the actual source code of `sp_executesql` like you can with user-defined functions or procedures. The code for system stored proc...
29,132
[ { "from": "human", "value": "Is it possible to see the CODE for sp_executesql? \nI would like to see the actual code. \nI could not find it in sql server management studio. \n" }, { "from": "gpt", "value": "In SQL Server, `sp_executesql` is a system stored procedure that is part of the SQL Serve...
I'm trying to think of a naming convention that accurately conveys what's going on within a class I'm designing. On a secondary note, I'm trying to decide between two almost-equivalent user APIs. Here's the situation: I'm building a scientific application, where one of the central data structures has three phases: 1) a...
This is a thoughtful design problem, and your goal of balancing usability with performance is important in scientific applications, especially when dealing with large datasets. Here are some thoughts regarding the design choices and naming conventions for your `ContinuousScalarField` class: ### Design Approach: Lazy E...
25,068
[ { "from": "human", "value": "I'm trying to think of a naming convention that accurately conveys what's going on within a class I'm designing. On a secondary note, I'm trying to decide between two almost-equivalent user APIs.\nHere's the situation:\nI'm building a scientific application, where one of the cen...
we'd like to add movable panels to an application. presently we've used DevExpress docking library but have found them to be disappointingly quirky & difficult to work with. it also has some limitations that aren't so great. auto-hide, pinning, and moving of pages by drag-and-drop are all features we'd like to use. t...
It sounds like you're encountering some challenges with the DevExpress docking library, particularly in terms of usability and complexity. It's common for developers to experience frustrations when dealing with third-party libraries that are not as intuitive or well-documented as expected. Given your requirements for m...
25,867
[ { "from": "human", "value": "we'd like to add movable panels to an application. presently we've used DevExpress docking library but have found them to be disappointingly quirky & difficult to work with. it also has some limitations that aren't so great.\nauto-hide, pinning, and moving of pages by drag-and...
Let's say that for some reason you need to write a macro: MACRO(X,Y). (Let's assume there's a good reason you can't use an inline function.) You want this macro to emulate a call to a function with no return value. Example 1: This should work as expected. if (x > y) MACRO(x, y); do_something(); Example 2: This sh...
Yes, there's a way to write a macro that can handle your three examples correctly. The key is to use a do-while loop trick, which ensures the macro behaves as if it's a single statement while maintaining the correct semantics for both if-else constructs and standalone statements. Here's how you can do that: ```cpp #d...
22,249
[ { "from": "human", "value": "Let's say that for some reason you need to write a macro: MACRO(X,Y). (Let's assume there's a good reason you can't use an inline function.) You want this macro to emulate a call to a function with no return value.\n\nExample 1: This should work as expected.\nif (x > y)\n MAC...