instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I am working on an ASP.NET application. I need to use some third party component (do not have the source code) that is unverifiable (I think it is written in managed c++). I am wondering if this can cause problems for the customers. The ASP.NET application can be installed on the customers servers or potentially on som...
Using an unverifiable third-party component in your ASP.NET application can indeed lead to several potential issues, especially considering that the component is written in Managed C++ (which can involve both managed and unmanaged code). Here are some concerns and risks associated with using such components in your app...
13,454
[ { "from": "human", "value": "I am working on an ASP.NET application. I need to use some third party component (do not have the source code) that is unverifiable (I think it is written in managed c++).\nI am wondering if this can cause problems for the customers.\nThe ASP.NET application can be installed on ...
I have a model and two views set up like this: Model ---> OSortFilterProxyModel ---> OListView Model ------------------------------> OTableView When the user selects something in one of the views, I want the other view to mirror that selection. So I thought I'd use a QSelectionModel to link them together. But this doe...
You're correct in your assessment that the issue stems from the fact that the two views (`OListView` and `OTableView`) are working with different proxy models (the `OSortFilterProxyModel` for the `OListView` and the original `Model` for the `OTableView`). This results in them having different selection models, which is...
16,638
[ { "from": "human", "value": "I have a model and two views set up like this:\nModel ---> OSortFilterProxyModel ---> OListView\nModel ------------------------------> OTableView\n\nWhen the user selects something in one of the views, I want the other view to mirror that selection. So I thought I'd use a QSelec...
I'm considering using Castle Windsor's Interceptors to cache data for helping scale an asp.net site. Does anyone have any thoughts/experience with doing this? Minor clarification: My intention was to use Windsor to intercept 'expensive' calls and delegate to MemCacheD or Velocity (or another distributed cache) for the ...
Using Castle Windsor's interceptors to implement caching can be a very effective way to scale your ASP.NET application, especially if you have specific methods that make expensive calls, such as fetching data from a database or making external API requests. Here are some thoughts and considerations for implementing th...
11,459
[ { "from": "human", "value": "I'm considering using Castle Windsor's Interceptors to cache data for helping scale an asp.net site.\nDoes anyone have any thoughts/experience with doing this?\nMinor clarification:\nMy intention was to use Windsor to intercept 'expensive' calls and delegate to MemCacheD or Velo...
I am trying to display a list of all files found in the selected directory (and optionally any subdirectories). The problem I am having is that when the GetFiles() method comes across a folder that it cannot access, it throws an exception and the process stops. How do I ignore this exception (and ignore the protected f...
When you use `Directory.GetFiles()` with `SearchOption.AllDirectories`, it will throw exceptions for directories that you don't have permission to access. To handle this gracefully and continue processing other files, you can use a recursive method that tries to access each directory and catches any exceptions that occ...
15,844
[ { "from": "human", "value": "I am trying to display a list of all files found in the selected directory (and optionally any subdirectories). The problem I am having is that when the GetFiles() method comes across a folder that it cannot access, it throws an exception and the process stops.\nHow do I ignore ...
Which Computer-aided Software Engineering tools do you use and why? In what ways do they increase your productivity or help you design your programs? Or, in case you do not use CASE tools, what are your reasons for this?
As an AI language model, I don't use tools or software myself, but I can provide information on various Computer-Aided Software Engineering (CASE) tools, their benefits, and how they can enhance productivity and program design. ### Common CASE Tools 1. **UML Tools (e.g., Lucidchart, Visual Paradigm)**: - **Purpose...
13,246
[ { "from": "human", "value": "Which Computer-aided Software Engineering tools do you use and why? In what ways do they increase your productivity or help you design your programs? Or, in case you do not use CASE tools, what are your reasons for this?\n" }, { "from": "gpt", "value": "As an AI lang...
How can I show a grey transparent overlay in C#? It should overlay other process which are not owned by the application doing the overlay.
Creating a grey transparent overlay that can overlay other processes in C# involves using the Windows API to create a topmost window that has a transparent background. Here's a basic guide on how you can achieve this using WinForms. ### Step 1: Create a Windows Forms Application 1. Open Visual Studio and create a new...
15,247
[ { "from": "human", "value": "How can I show a grey transparent overlay in C#?\nIt should overlay other process which are not owned by the application doing the overlay.\n" }, { "from": "gpt", "value": "Creating a grey transparent overlay that can overlay other processes in C# involves using the ...
I are working in a small development team of 4 people. We are trying develop "Agile style" - story points, small tasks, etc... Unfortunately, we are currently managing our tasks in a (shared) excel table. We looked at some available tools (Mingle, TFS, Scrum for Team System), but all of these looked like they would be ...
It's great to hear that you're adopting Agile practices in your small development team! When it comes to tracking tasks and retrospectives over a longer period, especially for analyzing estimation accuracy and overall progress, there are several lightweight tools that could meet your needs without overwhelming you with...
12,255
[ { "from": "human", "value": "I are working in a small development team of 4 people.\nWe are trying develop \"Agile style\" - story points, small tasks, etc...\nUnfortunately, we are currently managing our tasks in a (shared) excel table.\nWe looked at some available tools (Mingle, TFS, Scrum for Team System...
The situation: we have a large database with a number of denormalized tables. We frequently have to resummarize the data to keep the summary tables in synch. We've talked on and off about using computed columns to keep the data fresh. We've also talked about triggers, but that's a separate discussion. In our summary ta...
Using computed columns in SQL can be an effective way to maintain data integrity while avoiding data redundancy, especially in situations where your summary tables are frequently updated. However, there are several factors to consider regarding performance and functionality. ### Performance Implications of Using Compu...
13,685
[ { "from": "human", "value": "The situation: we have a large database with a number of denormalized tables. We frequently have to resummarize the data to keep the summary tables in synch. We've talked on and off about using computed columns to keep the data fresh. We've also talked about triggers, but that's...
I'm writing a program that uses SetWindowRgn to make transparent holes in a window that belongs to another process. (This is done only when the user explicitly requests it.) The program has to assume that the target window may already have holes which need to be preserved, so before it calls SetWindowRgn, it calls GetW...
Interacting with windows belonging to another process can be tricky, especially in newer versions of Windows like Vista and later, due to stricter security models. Here are some suggestions that may help you troubleshoot or work around the issues you're facing: ### 1. **Check Permissions and Ownership:** Ensure you...
12,641
[ { "from": "human", "value": "I'm writing a program that uses SetWindowRgn to make transparent holes in a window that belongs to another process. (This is done only when the user explicitly requests it.)\nThe program has to assume that the target window may already have holes which need to be preserved, so b...
From time to time, there will be student attached to our projects, i would certainly like to assign him/her many things to do so can learn more. But alot of times we are resigned to assigning stuff like documentaiton, updating of ui mockup screens etc. As problem is that is it bit hard to trust the quality of work prov...
Utilizing students in a way that both reduces your workload and provides them with valuable learning experiences requires a structured approach. Here are some strategies to help you achieve this: ### 1. **Define Clear Goals and Expectations** - **Set Objectives:** Clearly define what you want the student to learn a...
12,835
[ { "from": "human", "value": "From time to time, there will be student attached to our projects, i would certainly like to assign him/her many things to do so can learn more. But alot of times we are resigned to assigning stuff like documentaiton, updating of ui mockup screens etc. As problem is that is it b...
I am using Installshield 2008 Premier to edit some XML files which are already on the targetsystem. This process does work fine with the "XML file changes" function. My problem is, that Installshield does not remove these changes on uninstall. I have set the "Remove element on uninstall" checkbox within the added eleme...
The issue you're encountering with InstallShield 2008 Premier where the "Remove element on uninstall" checkbox does not work as expected can be quite frustrating. Here are several approaches to troubleshoot and potentially resolve the problem: 1. **Check XML File Permissions**: Ensure that the XML files you are trying...
15,196
[ { "from": "human", "value": "I am using Installshield 2008 Premier to edit some XML files which are already on the targetsystem. This process does work fine with the \"XML file changes\" function.\nMy problem is, that Installshield does not remove these changes on uninstall. I have set the \"Remove element ...
Is it possible to call managed code, specifically IronRuby or IronPython from unamanaged code such as C++ or Delphi? For example, we have an application written in Delphi that is being moved to C#.NET We'd like to provide Ruby or Python scripting in our new application to replace VBSCRIPT. However, we would need to p...
Yes, it is possible to call managed code from unmanaged code such as Delphi or C++, but it requires a bit of interop work because of the differences between managed and unmanaged environments. ### Overview of the Approach 1. **Use a COM Wrapper**: One common approach is to create a COM wrapper around your IronRuby or...
13,606
[ { "from": "human", "value": "Is it possible to call managed code, specifically IronRuby or IronPython from unamanaged code such as C++ or Delphi?\nFor example, we have an application written in Delphi that is being moved to C#.NET We'd like to provide Ruby or Python scripting in our new application to repl...
When it comes to organizing python modules, my Mac OS X system is a mess. I've packages lying around everywhere on my hdd and no particular system to organize them. How do you keep everything manageable?
Organizing Python modules and packages on your Mac OS X system can greatly enhance your workflow and make it easier to manage your projects. Here are some best practices to keep everything manageable: ### 1. Use Virtual Environments **Virtual environments** are one of the best ways to manage Python packages. They allo...
15,192
[ { "from": "human", "value": "When it comes to organizing python modules, my Mac OS X system is a mess. I've packages lying around everywhere on my hdd and no particular system to organize them.\nHow do you keep everything manageable?\n" }, { "from": "gpt", "value": "Organizing Python modules and...
Writing some test scripts in IronPython, I want to verify whether a window is displayed or not. I have the pid of the main app's process, and want to get a list of window titles that are related to the pid. I was trying to avoid using win32api calls, such as FindWindowEx, since (to my knowledge) you cannot access wi...
In IronPython, while you cannot directly use Win32 API calls such as `FindWindowEx`, you can still achieve the goal of listing window titles associated with a specific process ID (PID) using the System.Diagnostics namespace in combination with some P/Invoke calls to get window handles. Since your update indicates tha...
11,015
[ { "from": "human", "value": "Writing some test scripts in IronPython, I want to verify whether a window is displayed or not. I have the pid of the main app's process, and want to get a list of window titles that are related to the pid. \nI was trying to avoid using win32api calls, such as FindWindowEx, si...
For various reasons, we are writing a new business objects/data storage library. One of the requirements of this layer is to separate the logic of the business rules, and the actual data storage layer. It is possible to have multiple data storage layers that implement access to the same object - for example, a main "d...
When considering the design approaches for separating business rules from the data storage layer in your application, there are a few key factors to evaluate: maintainability, flexibility, ease of use, and adherence to design principles like the Single Responsibility Principle (SRP) and the Open/Closed Principle (OCP)....
12,983
[ { "from": "human", "value": "For various reasons, we are writing a new business objects/data storage library. One of the requirements of this layer is to separate the logic of the business rules, and the actual data storage layer. \nIt is possible to have multiple data storage layers that implement access t...
Windows file system is case insensitive. How, given a file/folder name (e.g. "somefile"), I get the actual name of that file/folder (e.g. it should return "SomeFile" if Explorer displays it so)? Some ways I know, all of which seem quite backwards: Given the full path, search for each folder on the path (via FindFirstF...
If you're looking to obtain the actual case of a file or folder in a case-insensitive filesystem like NTFS on Windows, you can indeed encounter some challenges since many of the common WinAPI calls do not return the correct casing. Here's a method that utilizes `FindFirstFile` and `FindNextFile` properly to obtain the...
13,632
[ { "from": "human", "value": "Windows file system is case insensitive. How, given a file/folder name (e.g. \"somefile\"), I get the actual name of that file/folder (e.g. it should return \"SomeFile\" if Explorer displays it so)?\nSome ways I know, all of which seem quite backwards:\n\nGiven the full path, se...
I recently added -pedantic and -pedantic-errors to my make GCC compile options to help clean up my cross-platform code. All was fine until it found errors in external-included header files. Is there a way to turn off this error checking in external header files, i.e.: Keep checking for files included like this: #includ...
The `-pedantic` and `-pedantic-errors` options in GCC are intended to enforce strict adherence to the C++ standard, and this includes checking external headers that you include in your project. Unfortunately, there is no direct way to selectively apply these options only to your own headers and not to system or externa...
15,728
[ { "from": "human", "value": "I recently added -pedantic and -pedantic-errors to my make GCC compile options to help clean up my cross-platform code. All was fine until it found errors in external-included header files. Is there a way to turn off this error checking in external header files, i.e.:\nKeep chec...
Part of our app parses RTF documents and we've come across a special character that is not translating well. When viewed in Word the character is an elipsis (...), and it's encoded in the RTF as ('85). In our vb code we converted the hex (85) to int(133) and then did Chr(133) to return (...) Here's the code in C# - pr...
The issue you're experiencing stems from the fact that the `Convert.ToChar` method in C# is limited to Unicode characters in the range of 0 to 65535. When you try to convert a value like `133` (which is represented as `0x85` in hexadecimal) using `Convert.ToChar`, it works for values in the basic ASCII range (0-127) bu...
14,855
[ { "from": "human", "value": "Part of our app parses RTF documents and we've come across a special character that is not translating well. When viewed in Word the character is an elipsis (...), and it's encoded in the RTF as ('85).\nIn our vb code we converted the hex (85) to int(133) and then did Chr(133) ...
We are building a website which will display news headlines and news. It will be a public site initially, but will evolve include portal content like personalized web pages. The site also needs to build web 2.0 features around the news stories being displayed, and needs to be extensible and highly customizable, allowi...
The Web Client Software Factory (WCSF) is a good choice for developing a web application that requires a modular and customizable architecture, especially if you are working within the Microsoft ecosystem. Here are some points to consider when deciding if WCSF is suitable for your project: ### Pros of Using WCSF: 1. ...
14,437
[ { "from": "human", "value": "We are building a website which will display news headlines and news. It will be a public site initially, but will evolve include portal content like personalized web pages. \nThe site also needs to build web 2.0 features around the news stories being displayed, and needs to be ...
I've got a text file full of records where each field in each record is a fixed width. My first approach would be to parse each record simply using string.Substring(). Is there a better way? For example, the format could be described as: <Field1(8)><Field2(16)><Field3(12)> And an example file with two records could...
Using regular expressions to parse fixed-width records is indeed a more elegant and maintainable approach compared to manually using `Substring()`. Your update showing the use of a regex for extracting the fields from fixed-width records is an excellent choice for the following reasons: 1. **Readability**: The regex p...
15,070
[ { "from": "human", "value": "I've got a text file full of records where each field in each record is a fixed width. My first approach would be to parse each record simply using string.Substring(). Is there a better way? \nFor example, the format could be described as:\n<Field1(8)><Field2(16)><Field3(12)>\...
I am new to asp and have a deadline in the next few days. i receive the following xml from within a webservice response. print("<?xml version="1.0" encoding="UTF-8"?> <user_data> <execution_status>0</execution_status> <row_count>1</row_count> <txn_id>stuetd678</txn_id> <person_info> <attribute name="firstname">john...
You can definitely parse XML in Classic ASP using the Microsoft XML parser, which is usually available in ASP environments. Here's how you can parse the XML you've received and extract attributes from it. Firstly, make sure you have the Microsoft XML DOM object available by creating an instance of it. You can use the ...
13,555
[ { "from": "human", "value": "I am new to asp and have a deadline in the next few days.\ni receive the following xml from within a webservice response.\nprint(\"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<user_data>\n<execution_status>0</execution_status>\n<row_count>1</row_count>\n<txn_id>stuetd678</txn_id...
For years, one of my most important tools has been incremental copy utility that compares the contents of two directories and shows me which files are newer / older / added / deleted. Every day I find myself copying folders of source code between my two desktop machines and the server, and such a utility is critical t...
There are several popular tools and utilities available for comparing and incrementally copying files between directories. Here are some of the most commonly used ones: 1. **rsync**: This is a powerful command-line tool available on Unix/Linux systems (and also on Windows via WSL or Cygwin) that efficiently syncs file...
13,837
[ { "from": "human", "value": "For years, one of my most important tools has been incremental copy utility that compares the contents of two directories and shows me which files are newer / older / added / deleted. Every day I find myself copying folders of source code between my two desktop machines and the...
I'm writing a program (for Mac OS X, using Objective-C) and I need to create a bunch of .webloc files programmatically. The .webloc file is simply file which is created after you drag-n-drop an URL from Safari's location bar to some folder. Generally speaking, I need an approach to create items in a filesystem which po...
Yes, you can create `.webloc` files programmatically in Objective-C on macOS. A `.webloc` file is essentially an XML plist file that contains a URL. Below is an example of how to create a `.webloc` file with a specified URL and title. Here’s a simple method to create a `.webloc` file: 1. **Create a Dictionary** with ...
12,137
[ { "from": "human", "value": "I'm writing a program (for Mac OS X, using Objective-C) and I need to create a bunch of .webloc files programmatically.\nThe .webloc file is simply file which is created after you drag-n-drop an URL from Safari's location bar to some folder.\nGenerally speaking, I need an approa...
Is there any framework for querying XML SQL Syntax, I seriously tire of iterating through node lists. Or is this just wishful thinking (if not idiotic) and certainly not possible since XML isn't a relational database?
It's understandable to find working with XML node lists cumbersome, especially when you're looking for a more SQL-like querying capability. However, there are frameworks and technologies designed to query XML data more efficiently than manual iteration. ### Options for Querying XML with SQL-like Syntax 1. **XQuery**:...
15,004
[ { "from": "human", "value": "Is there any framework for querying XML SQL Syntax, I seriously tire of iterating through node lists.\n\nOr is this just wishful thinking (if not idiotic) and certainly not possible since XML isn't a relational database?\n" }, { "from": "gpt", "value": "It's underst...
I've gone through just about every property I can think of, but haven't found a simple way to hide the header on a winform UltraCombo control from Infragistics. Headers make sense when I have multiple visible columns and whatnot, but sometimes it would be nice to hide it. To give a simple example, let's say I have a co...
It looks like you've already found the solution to your issue with the UltraCombo control from Infragistics by setting `ColHeadersVisible` to `False` for the specific band. For anyone else looking for a similar solution, here's a bit of clarification on how to achieve this: If you want to hide the column headers in an...
16,530
[ { "from": "human", "value": "I've gone through just about every property I can think of, but haven't found a simple way to hide the header on a winform UltraCombo control from Infragistics.\nHeaders make sense when I have multiple visible columns and whatnot, but sometimes it would be nice to hide it.\nTo g...
There are situations, where it is practical to have a type-cast return a null value instead of throwing a ClassCastException. C# has the as operator to do this. Is there something equivalent available in Java so you don't have to explicitly check for the ClassCastException?
In Java, there isn't a direct equivalent to C#'s `as` operator that allows for type casting to return `null` instead of throwing a `ClassCastException`. However, you can achieve similar behavior using a utility method. The common practice is to create a method that safely attempts to cast an object and returns `null` i...
17,244
[ { "from": "human", "value": "There are situations, where it is practical to have a type-cast return a null value instead of throwing a ClassCastException. C# has the as operator to do this. Is there something equivalent available in Java so you don't have to explicitly check for the ClassCastException?\n" ...
Is it at the state where it is actually useful and can do more than rename classes?
It seems like you might be asking about the capabilities of AI tools or language models, particularly in software development or code refactoring. As of my last update in October 2023, AI-powered tools have significantly evolved and can do much more than just renaming classes. Here are some capabilities that have been ...
15,432
[ { "from": "human", "value": "Is it at the state where it is actually useful and can do more than rename classes?\n" }, { "from": "gpt", "value": "It seems like you might be asking about the capabilities of AI tools or language models, particularly in software development or code refactoring. As ...
I was writing a (seemingly) straight-forward SQL snippet that drops a column after it makes sure the column exists. The problem: if the column does NOT exist, the code inside the IF clause complains that it can't find the column! Well, doh, that's why it's inside the IF clause! So my question is, why does a piece of co...
The issue you're experiencing is due to how SQL Server compiles and executes your SQL statements. When the SQL Server engine parses the entire batch of commands, it checks for errors regardless of whether certain conditions (like those in your IF statement) are met. This means that it tries to validate all the commands...
17,311
[ { "from": "human", "value": "I was writing a (seemingly) straight-forward SQL snippet that drops a column after it makes sure the column exists.\nThe problem: if the column does NOT exist, the code inside the IF clause complains that it can't find the column! Well, doh, that's why it's inside the IF clause!...
I have some ASP.NET Master Pages located in one assembly. I need to use these Master Pages with my WebForm pages located in other assemblies that have a reference to the first assembly. I cannot seem to figure out a way to do this. Is there a nice way that I can do this? If no pretty solution exists I would also like t...
Using ASP.NET Master Pages from different assemblies can be a bit tricky, as ASP.NET does not natively support using master pages defined in one assembly from web forms defined in another. However, there are a few approaches you can consider, both standard practices and workarounds (hacks) if necessary. ### Standard A...
15,041
[ { "from": "human", "value": "I have some ASP.NET Master Pages located in one assembly. I need to use these Master Pages with my WebForm pages located in other assemblies that have a reference to the first assembly. I cannot seem to figure out a way to do this.\nIs there a nice way that I can do this?\nIf no...
Our development team work with Borland C++ Builder 6 and CodeGear C++ Builder 2007 (as well as Visual Studio). I hear a lot of comments that the Builder 2007 IDE crashes a lot more than BCB6 does. Does anyone out there have any experience of the C++ Builder 2009 IDE yet, particularly with a decent size application, and...
While I can't provide real-time experiences, I can share insights based on community feedback and general trends surrounding these IDEs. 1. **BCB6 vs. BCB2007**: Many developers have noted that BCB6 is relatively stable and mature compared to BCB2007. The transition to CodeGear and the addition of new features in BCB2...
16,433
[ { "from": "human", "value": "Our development team work with Borland C++ Builder 6 and CodeGear C++ Builder 2007 (as well as Visual Studio). I hear a lot of comments that the Builder 2007 IDE crashes a lot more than BCB6 does. Does anyone out there have any experience of the C++ Builder 2009 IDE yet, particu...
In the vxWorks shell, there are a number of routines you can use to display information about the system. These routines are usually referred to as show routines because they tend to have the form of "xxxShow". Is there a list of these routines available?
Yes, in VxWorks, there is a set of "show" routines designed to provide information about various aspects of the system. While there is no official exhaustive list provided in the VxWorks documentation for all the show routines, several commonly used ones include: 1. **taskShow** - Displays information about tasks. 2. ...
17,128
[ { "from": "human", "value": "In the vxWorks shell, there are a number of routines you can use to display information about the system. \nThese routines are usually referred to as show routines because they tend to have the form of \"xxxShow\".\nIs there a list of these routines available?\n" }, { "...
I start with an entity A with primary key A1, it has child collections B and C, but they are empty, because I haven't prefetched them. I now get a new occurrence of A (A prime) with primary key A1 with the child collections B and C filled. What is a good way to get the A and A prime to be the same object and to get A ...
To merge the entity A with its new occurrence A' (with the same primary key A1) and ensure that the child collections B and C in A are populated with the data from A', you can follow these steps. The approach can vary depending on the programming language and framework you are using, but the general principles remain t...
14,459
[ { "from": "human", "value": "I start with an entity A with primary key A1, it has child collections B and C, but they are empty, because I haven't prefetched them. I now get a new occurrence of A (A prime) with primary key A1 with the child collections B and C filled.\nWhat is a good way to get the A and A...
What is the difference between UNION and UNION ALL?
`UNION` and `UNION ALL` are both SQL operations used to combine the results of two or more SELECT queries. However, they have some important differences: 1. **Duplicate Rows**: - **UNION**: Removes duplicate rows from the result set. If the same row appears in multiple SELECT queries, it will only be included once ...
16,897
[ { "from": "human", "value": "What is the difference between UNION and UNION ALL?\n" }, { "from": "gpt", "value": "`UNION` and `UNION ALL` are both SQL operations used to combine the results of two or more SELECT queries. However, they have some important differences:\n\n1. **Duplicate Rows**:\n ...
In a user defined wizard page, is there a way to capture change or focus events of the controls? I want to provide an immediate feedback on user input in some dropdowns (e.g. a message box)
In most frameworks that support user-defined wizard pages (like Windows Forms, WPF, or web frameworks), you can capture change or focus events for controls. Here's how you can do it in a couple of popular environments: ### Windows Forms (WinForms) In a WinForms application, you can subscribe to events like `SelectedI...
12,379
[ { "from": "human", "value": "In a user defined wizard page, is there a way to capture change or focus events of the controls? I want to provide an immediate feedback on user input in some dropdowns (e.g. a message box)\n" }, { "from": "gpt", "value": "In most frameworks that support user-defined...
When compressing a string "stream" the '/r' gets stripped out from '/r/n'. I am using the ICSharp.zip library for compression. Has any one else faced this problem, and if you have is there is a workaround?
The issue you are experiencing with the ICSharpZip library may be due to how the library handles newlines during compression or decompression. The sequence `'/r/n'` represents a carriage return and a newline character, which is commonly used in text file formats to denote the end of a line on Windows systems. If you'r...
12,252
[ { "from": "human", "value": "When compressing a string \"stream\" the '/r' gets stripped out from '/r/n'. I am using the ICSharp.zip library for compression. Has any one else faced this problem, and if you have is there is a workaround?\n" }, { "from": "gpt", "value": "The issue you are experien...
I want to save the objects I generated in a program. After restart the App should load automaticly all Objects in an Array. I want to write them in a file and parse them after restart. Are the other smarter possibilities than do it by hand? Thank you
Yes, there are several smarter and more efficient ways to save and load objects in a program compared to handling file operations manually. Here are some commonly used approaches: ### 1. **Serialization** - **JSON Serialization**: Convert your objects to JSON format using libraries available in your programming lan...
14,231
[ { "from": "human", "value": "I want to save the objects I generated in a program. After restart the App should load automaticly all Objects in an Array. I want to write them in a file and parse them after restart. Are the other smarter possibilities than do it by hand?\nThank you\n" }, { "from": "gp...
for example this code var html = "<p>This text is <a href=#> good</a></p>"; var newNode = Builder.node('div',{className: 'test'},[html]); $('placeholder').update(newNode); casues the p and a tags to be shown, how do I prevent them from being escaped?
In the code you've provided, it appears that you are trying to create a new HTML element with inner HTML that contains HTML tags. However, when you create an element using a method that expects an array of child nodes or text content, the HTML tags are treated as plain text rather than being rendered as HTML. To ensur...
16,363
[ { "from": "human", "value": "for example this code\nvar html = \"<p>This text is <a href=#> good</a></p>\";\nvar newNode = Builder.node('div',{className: 'test'},[html]);\n$('placeholder').update(newNode);\n\ncasues the p and a tags to be shown, how do I prevent them from being escaped?\n" }, { "fr...
Is there a way to separate a C# class into a header that contains the class definition and then an actual .cs file that contains the implementation? I suppose one can do this by creating an interface, but that doesn't seem right. I just want a file where I can just see the class design, and not all the detail. It's ...
In C#, you don't have the same header and implementation file separation as in C++. However, you can achieve a similar effect by using partial classes. Partial classes allow you to define a class across multiple files, which can help you organize your code better. Here's how you can do it: 1. **Create a Partial Class...
16,109
[ { "from": "human", "value": "Is there a way to separate a C# class into a header that contains the class definition and then an actual .cs file that contains the implementation? I suppose one can do this by creating an interface, but that doesn't seem right. I just want a file where I can just see the cla...
Anyone have any suggestions on where to start for a newbie wanting to try out some sort of source-control along with a new journey into ASP.NET? SVN, VSS, CVS...I dont even know where to start!
Welcome to the world of source control and ASP.NET! As a beginner, it's great that you want to incorporate version control into your development process. Here are some suggestions on where to start: ### 1. Choose a Version Control System (VCS) While you mentioned SVN, VSS, and CVS, I recommend starting with **Git**. ...
13,315
[ { "from": "human", "value": "Anyone have any suggestions on where to start for a newbie wanting to try out some sort of source-control along with a new journey into ASP.NET? SVN, VSS, CVS...I dont even know where to start!\n" }, { "from": "gpt", "value": "Welcome to the world of source control a...
is there a way to add an existing classic ASP webapp into a solution in VS? The application is around 4000 files large and currently maintained outisde Visual Studio.
Yes, you can add an existing classic ASP web application into a solution in Visual Studio. While Visual Studio does not have direct support for classic ASP like it does for ASP.NET projects, you can still manage your files and edit them within the IDE. Here are the steps to add your classic ASP application to a Visual ...
7,787
[ { "from": "human", "value": "is there a way to add an existing classic ASP webapp into a solution in VS? The application is around 4000 files large and currently maintained outisde Visual Studio.\n" }, { "from": "gpt", "value": "Yes, you can add an existing classic ASP web application into a sol...
I have a stored procedure with the following header: FUNCTION SaveShipment (p_user_id IN INTEGER, p_transaction_id IN INTEGER, p_vehicle_code IN VARCHAR2 DEFAULT NULL, p_seals IN VARCHAR2 DEFAULT NULL) RETURN INTEGER; And I am having trouble running it from TOAD's Editor. I cannot run it as part of a select from dual...
The error message you're encountering, `ORA-01008: not all variables bound`, indicates that the PL/SQL block you're trying to execute is expecting variables to be bound, but the binding is not correctly set up. When you want to execute a stored function in PL/SQL that returns a value, you typically do so within an ano...
15,580
[ { "from": "human", "value": "I have a stored procedure with the following header:\nFUNCTION SaveShipment (p_user_id IN INTEGER, p_transaction_id IN INTEGER, p_vehicle_code IN VARCHAR2 DEFAULT NULL, p_seals IN VARCHAR2 DEFAULT NULL) RETURN INTEGER;\n\nAnd I am having trouble running it from TOAD's Editor. I...
I am changing a GET to a POST. Currently I have .jsp?id=a,b,c,d. When changing this to a post I am still sitting the id parameter a,b,c,d . This is not working for me. Can I submit a comma separated list to a post parameter?
Yes, you can submit a comma-separated list as a POST parameter. The way you do it depends on how you are sending the data and how you want to retrieve it on the server-side. Here are a few approaches you can take: ### 1. Form Submission If you are using a traditional HTML form to submit the POST request, you can incl...
16,864
[ { "from": "human", "value": "I am changing a GET to a POST. Currently I have .jsp?id=a,b,c,d. When changing this to a post I am still sitting the id parameter a,b,c,d . This is not working for me. Can I submit a comma separated list to a post parameter?\n" }, { "from": "gpt", "value": "Yes, you ...
We are using SQL Server 2005, but this question can be for any RDBMS. Which of the following is more efficient, when selecting all columns from a view? Select * from view or Select col1, col2, ..., colN from view
When considering efficiency in SQL queries, particularly when selecting all columns from a view, there are several factors to take into account. 1. **Select * from view**: - This approach retrieves all columns from the view, regardless of whether you need all of them. - If the view contains many columns or if s...
17,387
[ { "from": "human", "value": "We are using SQL Server 2005, but this question can be for any RDBMS.\nWhich of the following is more efficient, when selecting all columns from a view?\nSelect * from view \n\nor \nSelect col1, col2, ..., colN from view\n\n" }, { "from": "gpt", "value": "When consid...
Does anyone know of any existing projects that aim to port Android's Java VM over to the iPhone? From what I understand, this wouldn't be too out of reach and would certainly make for some exciting developments. Edit: I should point out that I am aware this will not happen using the official iPhone SDK. However, a jail...
There have been various attempts and discussions in the past about porting Android's Java VM or even entire Android environments to iOS devices, particularly for jailbroken devices. However, creating a fully functional Android experience on iOS is a complex endeavor due to several factors, including differences in hard...
14,475
[ { "from": "human", "value": "Does anyone know of any existing projects that aim to port Android's Java VM over to the iPhone? From what I understand, this wouldn't be too out of reach and would certainly make for some exciting developments.\nEdit: I should point out that I am aware this will not happen usin...
I have the option of storing data in memory either as an XML document or multi-table ADO dataset. The web page utilizing this object will be selectively retrieving data items based on keys. Does either of these objects have a clear performance advantage over the other?
When deciding between using an XML document and a multi-table ADO dataset for storing data in memory, particularly in the context of selectively retrieving data items based on keys, you should consider several factors, including performance, ease of access, and the structure of your data. ### Performance: 1. **XML Do...
16,062
[ { "from": "human", "value": "I have the option of storing data in memory either as an XML document or multi-table ADO dataset. The web page utilizing this object will be selectively retrieving data items based on keys.\nDoes either of these objects have a clear performance advantage over the other?\n" }, ...
According to the documentation the return value from a slot doesn't mean anything. Yet in the generated moc code I see that if a slot returns a value this value is used for something. Any idea what does it do? Here's an example of what I'm talking about. this is taken from code generated by moc. 'message' is a slot th...
In Qt's signal and slot mechanism, the return value of a slot does not typically play a significant role in the standard signal-slot connection, especially when signals are emitted. When you connect a signal to a slot, the signal does not expect a return value from the slot. However, the generated MOC (Meta-Object Com...
12,721
[ { "from": "human", "value": "According to the documentation the return value from a slot doesn't mean anything.\nYet in the generated moc code I see that if a slot returns a value this value is used for something. Any idea what does it do?\n\nHere's an example of what I'm talking about. this is taken from c...
We're developing a windows mobile 6.1 application and would like to make the user interface look better than the standard battleship grey. Has anyone had any experience with 3rd party controls that can make a windows mobile app look like a WPF/Silverlight/Iphone - like interface?
Developing a visually appealing user interface for Windows Mobile 6.1 can be challenging, especially considering the limitations of the platform. However, there are several third-party libraries and controls that can help enhance the UI aesthetics beyond the standard look. Here are some options you might consider: 1. ...
15,707
[ { "from": "human", "value": "We're developing a windows mobile 6.1 application and would like to make the user interface look better than the standard battleship grey. Has anyone had any experience with 3rd party controls that can make a windows mobile app look like a WPF/Silverlight/Iphone - like interfac...
Do you think that writing about software (i.e. having a blog) and speaking on software (and concepts) make you a better programmer?
Yes, writing about software and speaking on related concepts can significantly enhance your skills as a programmer for several reasons: 1. **Deepening Understanding**: Writing requires you to articulate your thoughts clearly, which can lead to a deeper understanding of the subject matter. When you explain concepts, yo...
15,001
[ { "from": "human", "value": "Do you think that writing about software (i.e. having a blog) and speaking on software (and concepts) make you a better programmer?\n" }, { "from": "gpt", "value": "Yes, writing about software and speaking on related concepts can significantly enhance your skills as ...
I have a hidden DIV which contains a toolbar-like menu. I have a number of DIVs which are enabled to show the menu DIV when the mouse hovers over them. Is there a built-in function which will move the menu DIV to the top right of the active (mouse hover) DIV? I'm looking for something like $(menu).position("topright", ...
While jQuery does not have a built-in method like `$(menu).position("topright", targetEl);` to move a DIV to the top right of another element, you can achieve this by calculating the position of the target element (the DIV you are hovering over) and then positioning the menu DIV accordingly. Here's a step-by-step way ...
13,652
[ { "from": "human", "value": "I have a hidden DIV which contains a toolbar-like menu.\nI have a number of DIVs which are enabled to show the menu DIV when the mouse hovers over them.\nIs there a built-in function which will move the menu DIV to the top right of the active (mouse hover) DIV? I'm looking for s...
I have the following code in one of my aspx pages: <% foreach (Dependency dep in this.Common.GetDependencies(this.Request.QueryString["Name"])) { %> <ctl:DependencyEditor DependencyKey='<%= dep.Key %>' runat="server" /> <% } %> When I run it, I get the following error: Parser Error Message: Cannot create an...
The error you're encountering is due to how ASP.NET handles data-binding expressions within declarative controls in an .aspx page. Specifically, ASP.NET doesn't recognize `<%= dep.Key %>` as a valid expression for property assignment when used in an ASP.NET server control like `<ctl:DependencyEditor>`. To solve this, ...
15,753
[ { "from": "human", "value": "I have the following code in one of my aspx pages:\n<% foreach (Dependency dep in this.Common.GetDependencies(this.Request.QueryString[\"Name\"]))\n { %>\n <ctl:DependencyEditor DependencyKey='<%= dep.Key %>' runat=\"server\" />\n<% } %>\n\nWhen I run it, I get the foll...
What are the pros/cons of using black-box reuse over white-box reuse?
When considering software reuse strategies, black-box and white-box approaches each have their pros and cons. Here's a breakdown of both: ### Black-Box Reuse **Pros:** 1. **Encapsulation:** Black-box components hide their internal workings, allowing developers to use them without needing to understand their implemen...
13,565
[ { "from": "human", "value": "What are the pros/cons of using black-box reuse over white-box reuse?\n" }, { "from": "gpt", "value": "When considering software reuse strategies, black-box and white-box approaches each have their pros and cons. Here's a breakdown of both:\n\n### Black-Box Reuse\n\n...
Before moving on to use SVN, I used to manage my project by simply keeping a /develop/ directory and editing and testing files there, then moving them to the /main/ directory. When I decided to move to SVN, I needed to be sure that the directories were indeed in sync. So, what is a good way to write a shell script [ ba...
To create a shell script that recursively compares files with the same name in two different directories, you can use the `diff` command combined with `find`. Here's a sample Bash script that achieves this: ```bash #!/bin/bash # Check if two directory arguments are provided if [ "$#" -ne 2 ]; then echo "Usage: $0...
12,487
[ { "from": "human", "value": "Before moving on to use SVN, I used to manage my project by simply keeping a /develop/ directory and editing and testing files there, then moving them to the /main/ directory. When I decided to move to SVN, I needed to be sure that the directories were indeed in sync.\nSo, what ...
A while ago I came across a Python library that formats regular text to HTML similar to Markdown, reStructuredText and Textile, just that it had no syntax at all. It detected indentatations, quotes, links and newlines/paragraphs only. Unfortunately I lost the name of the library and was unable to Google it. Anyone an...
It sounds like you're describing a library called **Textile**. However, since you mentioned that you're looking for something with no syntax at all, it might actually be **Textile's Python implementation**, or perhaps even a different library like **pypandoc** or **htmlify**. Another possibility could be **plain-text-...
18,738
[ { "from": "human", "value": "A while ago I came across a Python library that formats regular text to HTML similar to Markdown, reStructuredText and Textile, just that it had no syntax at all. It detected indentatations, quotes, links and newlines/paragraphs only.\nUnfortunately I lost the name of the libra...
I've seen that it's possible to get the latitude and longitude (geocoding, like in Google Maps API) from a street address, but is it possible to do the reverse and get the street address when you know what the lat/long already is? The application would be an iPhone app (and why the app already knows lat/long), so anyth...
Yes, it is indeed possible to get a street address from latitude and longitude coordinates through a process known as reverse geocoding. There are several options available for implementing reverse geocoding in your iPhone app: ### 1. **Core Location Framework (iOS)** Apple’s Core Location framework provides reverse g...
13,989
[ { "from": "human", "value": "I've seen that it's possible to get the latitude and longitude (geocoding, like in Google Maps API) from a street address, but is it possible to do the reverse and get the street address when you know what the lat/long already is?\nThe application would be an iPhone app (and why...
Will content requested over https still be cached by web browsers or do they consider this insecure behaviour? If this is the case is there anyway to tell them it's ok to cache?
Yes, content requested over HTTPS can still be cached by web browsers, and this behavior is considered secure. Browsers generally cache both HTTP and HTTPS content, but there are some important factors that determine how caching is handled for HTTPS requests: 1. **Cache-Control Headers**: The server can control cachin...
15,521
[ { "from": "human", "value": "Will content requested over https still be cached by web browsers or do they consider this insecure behaviour? If this is the case is there anyway to tell them it's ok to cache?\n" }, { "from": "gpt", "value": "Yes, content requested over HTTPS can still be cached b...
I'm just learning about SVG, and it seems great but I'm not sure about browser support - have people successfully got around this, or is it still too early?
SVG (Scalable Vector Graphics) has been widely supported across all modern web browsers for many years now, including Chrome, Firefox, Safari, Edge, and even mobile browsers like Chrome for Android and Safari on iOS. Most browsers have robust support for SVG features, allowing developers to use it confidently for graph...
17,189
[ { "from": "human", "value": "I'm just learning about SVG, and it seems great but I'm not sure about browser support - have people successfully got around this, or is it still too early?\n" }, { "from": "gpt", "value": "SVG (Scalable Vector Graphics) has been widely supported across all modern we...
I guess this topic is often overseen, but is rather useful when debugging your code. Just today I have stumbled across this simple yet effective visualizer that visualizes images (it's on a german blog, but I guess the code content is self-explanatory): link text I would like to know which debug visualizers you use in ...
When it comes to debugging in Visual Studio 2005/2008, there are several tools and techniques that can greatly enhance your workflow. Here are some commonly used debug visualizers that you might find helpful: 1. **Text Visualizer**: This is the default visualizer for string variables. It allows you to view the content...
9,004
[ { "from": "human", "value": "I guess this topic is often overseen, but is rather useful when debugging your code. Just today I have stumbled across this simple yet effective visualizer that visualizes images (it's on a german blog, but I guess the code content is self-explanatory):\nlink text\nI would like ...
Is it possible to access a constant value (i.e. a public static final variable defined in a Java class) from a Velocity template? I would like to be able to write something like this: #if ($a lt Long.MAX_VALUE) but this is apparently not the right syntax.
Yes, you can access a public static final variable from a Java class in a Velocity template, but you have to be sure that the class is included in the Velocity context properly. Here's how you can do it: ### 1. Expose the Constant in the Context First, you need to add the constant to the Velocity context in your Java...
16,735
[ { "from": "human", "value": "Is it possible to access a constant value (i.e. a public static final variable defined in a Java class) from a Velocity template?\nI would like to be able to write something like this:\n#if ($a lt Long.MAX_VALUE)\n\nbut this is apparently not the right syntax.\n" }, { "f...
I'm using the GL class from JOGL, which basically contains all OpenGL functions. Now I just installed the Javadoc for JOGL, because it's nice to have the parameter names if you can't remember the order. However, with this Javadoc installed, it takes about half a minute to show the autocompletion list whenever I type GL...
If you're experiencing slow autocompletion in your IDE due to the JOGL Javadoc, there are a few strategies you can employ to improve the situation without uninstalling or disabling the Javadoc completely. Here are some potential solutions: 1. **Adjust Javadoc Settings**: Some IDEs allow you to adjust how Javadoc is us...
16,071
[ { "from": "human", "value": "I'm using the GL class from JOGL, which basically contains all OpenGL functions. Now I just installed the Javadoc for JOGL, because it's nice to have the parameter names if you can't remember the order.\nHowever, with this Javadoc installed, it takes about half a minute to show ...
Assuming String a and b: a += b a = a.concat(b) Under the hood, are they the same thing? Here is concat decompiled as reference. I'd like to be able to decompile the + operator as well to see what that does. public String concat(String s) { int i = s.length(); if (i == 0) { return this; } else...
Under the hood, the `+=` operator and the `concat()` method in Java for `String` objects do perform similar operations but with some differences in behavior and performance implications. 1. **String concatenation using `+=`:** The `+=` operator is syntactic sugar in Java for concatenating strings. When you use `a +...
14,593
[ { "from": "human", "value": "Assuming String a and b:\na += b\na = a.concat(b)\n\nUnder the hood, are they the same thing?\nHere is concat decompiled as reference. I'd like to be able to decompile the + operator as well to see what that does.\npublic String concat(String s) {\n\n int i = s.length();\n ...
So I was reading these Asp.Net interview questions at Scott Hanselman's blog and I came across this question. Can anyone shed some light of what he's talking about.
Sure! While I don't have direct access to Scott Hanselman's blog or specific interview questions from it, I can help explain some common ASP.NET interview topics or questions that might be discussed in such a context. Generally, ASP.NET interview questions can cover various areas, including: 1. **ASP.NET Framework v...
16,368
[ { "from": "human", "value": "So I was reading these Asp.Net interview questions at Scott Hanselman's blog and I came across this question. Can anyone shed some light of what he's talking about.\n" }, { "from": "gpt", "value": "Sure! While I don't have direct access to Scott Hanselman's blog or s...
I'm looking for a XPath library to query over XML documents in FF, IE, Opera and Safari... and couldn't find one. Have you seen any?
If you're looking for an XPath library that works across multiple browsers such as Firefox, Internet Explorer, Opera, and Safari, you have a few options to consider: 1. **XPath** built into browsers: Most modern browsers support XPath natively through the `document.evaluate` method. This means you can directly use XPa...
16,449
[ { "from": "human", "value": "I'm looking for a XPath library to query over XML documents in FF, IE, Opera and Safari... and couldn't find one. Have you seen any?\n" }, { "from": "gpt", "value": "If you're looking for an XPath library that works across multiple browsers such as Firefox, Internet ...
After reading the Test-and-Set Wikipedia entry, I am still left with the question "What would a Test-and-Set be used for?" I realize that you can use it to implement Mutex (as described in wikipedia), but what other uses does it have?
The Test-and-Set operation is a fundamental synchronization primitive in concurrent programming. Beyond its use in implementing mutexes, it has several applications, including: 1. **Spinlocks**: Test-and-Set can be used to implement spinlocks, which are simple locking mechanisms that repeatedly check (or "spin") until...
16,903
[ { "from": "human", "value": "After reading the Test-and-Set Wikipedia entry, I am still left with the question \"What would a Test-and-Set be used for?\"\nI realize that you can use it to implement Mutex (as described in wikipedia), but what other uses does it have?\n" }, { "from": "gpt", "value...
Most applications only have "Restore, Move, Size, Minimize, Maximize and Close", however MS SQL offers extra options "Help, Customize view". Along those lines, is it possible to add to the right click menu of an application in the task bar? Note: I'm not referring to an icon in the notification area next to the clock...
In Windows, the right-click context menu that appears when you click on an application's icon in the taskbar is generally predefined by the operating system and the application itself. By default, it includes options like "Restore," "Move," "Size," "Minimize," "Maximize," and "Close." However, developers can extend o...
16,931
[ { "from": "human", "value": "Most applications only have \"Restore, Move, Size, Minimize, Maximize and Close\", however MS SQL offers extra options \"Help, Customize view\". Along those lines, is it possible to add to the right click menu of an application in the task bar? \nNote: I'm not referring to an i...
I am a total Groovy newbie. I saw the following code here. def beforeInterceptor = [action:this.&auth,except:'login'] How would I expand this to also include a second exception, say, if the action was 'login2'?
In Groovy, you can specify multiple exceptions in the `except` property of an interceptor by providing a list of actions you want to exclude. To include an additional exception (like 'login2') in your `beforeInterceptor`, you can modify the `except` attribute to be a list. Here’s how you can expand the original code t...
19,137
[ { "from": "human", "value": "I am a total Groovy newbie. I saw the following code here.\ndef beforeInterceptor = [action:this.&auth,except:'login']\n\nHow would I expand this to also include a second exception, say, if the action was 'login2'?\n" }, { "from": "gpt", "value": "In Groovy, you can ...
Assuming I have an ArrayList ArrayList<MyClass> myList; And I want to call toArray, is there a performance reason to use MyClass[] arr = myList.toArray(new MyClass[myList.size()]); over MyClass[] arr = myList.toArray(new MyClass[0]); ? I prefer the second style, since it's less verbose, and I assumed that the compil...
When using `toArray()` in Java, there are indeed two common styles as you've pointed out: 1. `MyClass[] arr = myList.toArray(new MyClass[myList.size()]);` 2. `MyClass[] arr = myList.toArray(new MyClass[0]);` ### Performance Considerations In most cases, the performance difference between these two methods is negligi...
15,349
[ { "from": "human", "value": "Assuming I have an ArrayList\nArrayList<MyClass> myList;\n\nAnd I want to call toArray, is there a performance reason to use\nMyClass[] arr = myList.toArray(new MyClass[myList.size()]);\n\nover\nMyClass[] arr = myList.toArray(new MyClass[0]);\n\n?\nI prefer the second style, sin...
For example, this regex (.*)<FooBar> will match: abcde<FooBar> But how do I get it to match across multiple lines? abcde fghij<FooBar>
To match text across multiple lines using regex, you typically want to enable the "dot matches newline" mode, which allows the dot (`.`) to match newline characters as well as other characters. In many programming languages and regex engines, you can achieve this by using a specific flag or modifier. Here's how you ca...
16,585
[ { "from": "human", "value": "For example, this regex\n(.*)<FooBar>\n\nwill match:\nabcde<FooBar>\n\nBut how do I get it to match across multiple lines?\nabcde\nfghij<FooBar>\n\n" }, { "from": "gpt", "value": "To match text across multiple lines using regex, you typically want to enable the \"dot...
I'm trying: import commands print commands.getoutput("ps -u 0") But it doesn't work on os x. os instead of commands gives the same output: USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND nothing more
It looks like you're trying to retrieve the output of the `ps -u 0` command in Python to list processes run by the user with UID 0 (which is typically the root user). In macOS, the `commands` module is deprecated, and you're better off using the `subprocess` module to run shell commands. Here's an example of how you c...
16,907
[ { "from": "human", "value": "I'm trying:\nimport commands\nprint commands.getoutput(\"ps -u 0\")\n\nBut it doesn't work on os x.\nos instead of commands gives the same output:\nUSER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND\nnothing more\n" }, { "from": "gpt", "value":...
I may have this completely wrong, but my understanding is that the --standalone compiler option tells the compiler to include the F# core and other dependencies in the exe, so that you can run it on another machine without installing any 'runtime'. However, I can't get this to work in the CTP - it doesn't even seem to ...
It sounds like you're working with the F# compiler and exploring the `--standalone` option. You're correct that this option is intended to package the F# core libraries and other dependencies directly into the executable, allowing it to run on machines that do not have the F# runtime installed. This is particularly use...
14,759
[ { "from": "human", "value": "I may have this completely wrong, but my understanding is that the --standalone compiler option tells the compiler to include the F# core and other dependencies in the exe, so that you can run it on another machine without installing any 'runtime'.\nHowever, I can't get this to ...
There are many SCM systems out there. Some open, some closed, some free, some quite expensive. Which one (please choose only one) would you use for a 3000+ developer organization with several sites (some behind a very slow link)? Explain why you chose the one you chose. (Give some reasons, not just "because".)
For a large organization with over 3000 developers and multiple sites, I would recommend **GitLab** as the source control management (SCM) system. Here are several reasons why GitLab would be a suitable choice: 1. **All-in-One Platform**: GitLab provides a comprehensive suite of features that integrate not only versio...
15,404
[ { "from": "human", "value": "There are many SCM systems out there. Some open, some closed, some free, some quite expensive. Which one (please choose only one) would you use for a 3000+ developer organization with several sites (some behind a very slow link)? Explain why you chose the one you chose. (Give so...
I am writing software to parse ID3v2 tags in Java. I need to find some files with good examples of the tag with lots of different frames. Ideally the tags will contain an embedded picture because that is what is kicking my butt right now. Does anyone know where I can find some good free (legal) ID3v2 tagged files (ID...
Finding free (and legal) audio files with well-defined ID3v2 tags can be quite useful for testing your software. Here are several resources you can consider to obtain such files: 1. **Public Domain or Creative Commons Music**: Websites like Free Music Archive (FMA), Jamendo, and ccMixter offer music that is often tagg...
16,685
[ { "from": "human", "value": "I am writing software to parse ID3v2 tags in Java. I need to find some files with good examples of the tag with lots of different frames. Ideally the tags will contain an embedded picture because that is what is kicking my butt right now.\nDoes anyone know where I can find som...
We recently switched our Windows software packages from RPM (cygwin) to MSI (wix). Having a native packaging is a much welcome change and we intend to stick with it. However, MSI feels overly complicated for what it does and doesn't seem to provide some basic abilities. But I'm probably mistaken. Is there a way to l...
Yes, you can list all installed MSI packages from the command line in Windows. You can use the Windows Management Instrumentation Command-line (WMIC) or PowerShell to achieve this. ### Using WMIC 1. Open a Command Prompt with administrative privileges. 2. Run the following command: ```cmd wmic product get name...
18,777
[ { "from": "human", "value": "\nWe recently switched our Windows software packages from RPM (cygwin) to MSI (wix). Having a native packaging is a much welcome change and we intend to stick with it. However, MSI feels overly complicated for what it does and doesn't seem to provide some basic abilities. But I'...
Dynamically creating a radio button using eg var radioInput = document.createElement('input'); radioInput.setAttribute('type', 'radio'); radioInput.setAttribute('name', name); works in Firefox but not in IE. Why not?
The issue you're experiencing with dynamically creating radio buttons in Internet Explorer (IE) might be due to the way the browser handles DOM elements and their properties. In particular, older versions of IE may not support certain DOM methods or may require additional steps to ensure proper functionality. Here are...
12,263
[ { "from": "human", "value": "Dynamically creating a radio button using eg \nvar radioInput = document.createElement('input');\nradioInput.setAttribute('type', 'radio');\nradioInput.setAttribute('name', name);\n\nworks in Firefox but not in IE. Why not?\n" }, { "from": "gpt", "value": "The issue ...
I am trying to find a way to determine at run-time how much memory a given class is using in .NET. Using Marshal.SizeOf() is out, as it only works on value types. Is there a way to check exactly how much memory a class uses?
In .NET, there is no built-in method to directly determine the exact memory usage of a reference type (class) at runtime, because the memory allocated for a class instance may involve several factors, including object headers, the size of its fields (which can also include references to other objects), and the memory u...
12,175
[ { "from": "human", "value": "I am trying to find a way to determine at run-time how much memory a given class is using in .NET. Using Marshal.SizeOf() is out, as it only works on value types. Is there a way to check exactly how much memory a class uses?\n" }, { "from": "gpt", "value": "In .NET,...
Is there a way to enable STRICT_ALL_TABLES for a single MySQL database?
In MySQL, the `STRICT_ALL_TABLES` mode is part of the SQL modes that can be configured globally or for a session. However, there is no direct way to enable `STRICT_ALL_TABLES` for a single database only. SQL modes in MySQL can be set at the global or session level, which affects all databases or a single session, respe...
16,381
[ { "from": "human", "value": "Is there a way to enable STRICT_ALL_TABLES for a single MySQL database?\n" }, { "from": "gpt", "value": "In MySQL, the `STRICT_ALL_TABLES` mode is part of the SQL modes that can be configured globally or for a session. However, there is no direct way to enable `STRIC...
Can someone please remind me how to create a .Net class from an XML file? I would prefer the batch commands, or a way to integrate it into the shell. Thanks!
To generate a .NET class from an XML schema (XSD file), you can use the `xsd.exe` tool, which is part of the .NET SDK. The `xsd.exe` command-line tool can create classes from an XML schema file (.xsd) or even from an XML file directly. Here are the steps to create a .NET class from an XML file using the command line: ...
14,078
[ { "from": "human", "value": "Can someone please remind me how to create a .Net class from an XML file?\nI would prefer the batch commands, or a way to integrate it into the shell.\nThanks!\n" }, { "from": "gpt", "value": "To generate a .NET class from an XML schema (XSD file), you can use the `x...
"Dirty reads", meaning reading an object's value even though it is write-locked by another thread, are described on Terracotta's website, yet I've heard that they shouldn't be used, even if you don't care about the possibility that you might get old data when you dirty-read the locked object. Does anyone have any exper...
Dirty reads in a distributed caching context like Terracotta can be a complex topic. To clarify, a dirty read occurs when a thread reads data that has been modified but not yet committed by another transaction. This can lead to scenarios where your application reads stale or inconsistent data, which can be problematic ...
16,259
[ { "from": "human", "value": "\"Dirty reads\", meaning reading an object's value even though it is write-locked by another thread, are described on Terracotta's website, yet I've heard that they shouldn't be used, even if you don't care about the possibility that you might get old data when you dirty-read th...
http://thedailywtf.com/Articles/The-Hot-Room.aspx You see how at the bottom there're links to the next and previous articles ("Unprepared For Divide_By_Zero" and "A Completely Different Game")? How do I do that, but selecting the next and previous non-private articles? This works for selecting the next article: SELECT ...
To select both the next and previous non-private articles in one query, you can use a combination of `UNION` and subqueries. You'll want to select the next article where the `id` is greater than the current article's id and the previous article where the `id` is less than the current article's id. Here's how you could...
16,331
[ { "from": "human", "value": "http://thedailywtf.com/Articles/The-Hot-Room.aspx\nYou see how at the bottom there're links to the next and previous articles (\"Unprepared For Divide_By_Zero\" and \"A Completely Different Game\")? How do I do that, but selecting the next and previous non-private articles? This...
I've created a few autorun script files on various USB devices that run bash scripts when they mount. These scripts run "in the background", how do I get them to run in a terminal window? (Like the "Application in Terminal" gnome Launcher type.)
To run your bash scripts in a terminal window instead of in the background when your USB device is mounted, you can use a terminal emulator like `gnome-terminal`, `xterm`, or `konsole`, depending on what is available on your system and your desktop environment. Here's a general approach you can follow for `gnome-termi...
8,503
[ { "from": "human", "value": "I've created a few autorun script files on various USB devices that run bash scripts when they mount. These scripts run \"in the background\", how do I get them to run in a terminal window? (Like the \"Application in Terminal\" gnome Launcher type.)\n" }, { "from": "gpt...
Passing an undimensioned array to the VB6's Ubound function will cause an error, so I want to check if it has been dimensioned yet before attempting to check its upper bound. How do I do this?
In VB6, there is no built-in function to directly check if an array has been dimensioned before attempting to use the `UBound` function. However, you can implement a workaround to achieve this by using error handling or by checking for an array with a specific size. One common approach is to use error handling to catc...
16,443
[ { "from": "human", "value": "Passing an undimensioned array to the VB6's Ubound function will cause an error, so I want to check if it has been dimensioned yet before attempting to check its upper bound. How do I do this?\n" }, { "from": "gpt", "value": "In VB6, there is no built-in function to...
I would like to track metrics that can be used to improve my team’s software development process, improve time estimates, and detect special case variations that need to be addressed during the project execution. Please limit each answer to a single metric, describe how to use it, and vote up the good answers.
### Metric: Cycle Time **Description**: Cycle time measures the total time from when work starts on a task until it is completed and delivered. This metric helps identify the efficiency of the development process and can reveal bottlenecks in workflows. **How to Use It**: 1. **Track Tasks**: Record the start and end...
17,880
[ { "from": "human", "value": "I would like to track metrics that can be used to improve my team’s software development process, improve time estimates, and detect special case variations that need to be addressed during the project execution.\nPlease limit each answer to a single metric, describe how to use ...
Is there a simple way to convert a string to Title Case? E.g. john smith becomes John Smith. I'm not looking for something complicated like John Resig's solution, just (hopefully) some kind of one- or two-liner.
Yes, you can easily convert a string to Title Case in Python using the `title()` method. Here's a simple one-liner: ```python title_case_string = "john smith".title() print(title_case_string) # Output: John Smith ``` This will convert the first letter of each word to uppercase and the rest to lowercase. If you need...
19,072
[ { "from": "human", "value": "Is there a simple way to convert a string to Title Case? E.g. john smith becomes John Smith. I'm not looking for something complicated like John Resig's solution, just (hopefully) some kind of one- or two-liner.\n" }, { "from": "gpt", "value": "Yes, you can easily co...
I've got a XmlNodeList which I need to have it in a format that I can then re-use within a XSLT stylesheet by calling it from a C# extension method. Can anyone help? I have read that it might have something to do with using a XPathNavigator but I'm still a bit stuck.
To reuse an `XmlNodeList` in an XSLT stylesheet by calling it from a C# extension method, you indeed can utilize the `XPathNavigator` class. Here's a general step-by-step approach to achieve this: 1. **Convert XmlNodeList to XPathNavigator**: You need to create an `XPathNavigator` from your `XmlNodeList`. The `XPathNa...
13,415
[ { "from": "human", "value": "I've got a XmlNodeList which I need to have it in a format that I can then re-use within a XSLT stylesheet by calling it from a C# extension method.\nCan anyone help? I have read that it might have something to do with using a XPathNavigator but I'm still a bit stuck.\n" }, ...
Say I've got a string which contains a number. I want to check if this number is an integer. Examples IsInteger("sss") => false IsInteger("123") => true IsInterger("123.45") =>false
You can check if a string contains an integer using Python. Here’s a function that achieves this: ```python def is_integer(s): # Check if the string represents an integer if s.isdigit() or (s.startswith('-') and s[1:].isdigit()): return True return False # Test cases print(is_integer("sss")) ...
18,020
[ { "from": "human", "value": "Say I've got a string which contains a number. I want to check if this number is an integer.\nExamples\nIsInteger(\"sss\") => false \n\nIsInteger(\"123\") => true\n\nIsInterger(\"123.45\") =>false\n\n" }, { "from": "gpt", "value": "You can check if a string contains ...
I am having trouble finding good guides for WPF. I have experience in C# and .NET but I don't know anything about WPF except for the regular marketing-ish description of the technology as a whole. Can anyone point me to a good beginner's tutorial/guide on WPF.
Absolutely! WPF (Windows Presentation Foundation) is a powerful framework for building desktop applications on Windows. Since you already have experience in C# and .NET, you'll find it easier to pick up WPF. Here are some great resources to help you get started: ### Official Documentation 1. **Microsoft Docs - WPF Ove...
8,502
[ { "from": "human", "value": "I am having trouble finding good guides for WPF.\nI have experience in C# and .NET but I don't know anything about WPF except for the regular marketing-ish description of the technology as a whole.\nCan anyone point me to a good beginner's tutorial/guide on WPF.\n" }, { ...
I am currently working on an asp.net application in Visual Studio 2005. I would like to upgrade to 2008 to take advantage of some of the new features, but my remote team won't be able to upgrade to it for a while. Is it possible for only a few people on my team to upgrade to Visual Studio 2008, while the rest of the te...
Yes, it is possible for some team members to upgrade to Visual Studio 2008 while others continue to use Visual Studio 2005. However, there are a few considerations you should keep in mind: 1. **Project Compatibility**: Visual Studio 2008 can open and work with projects created in Visual Studio 2005. When you upgrade a...
14,737
[ { "from": "human", "value": "I am currently working on an asp.net application in Visual Studio 2005. I would like to upgrade to 2008 to take advantage of some of the new features, but my remote team won't be able to upgrade to it for a while.\nIs it possible for only a few people on my team to upgrade to Vi...
Are C++ enums signed or unsigned? And by extension is it safe to validate an input by checking that it is <= your max value, and leave out >= your min value (assuming you started at 0 and incremented by 1)?
In C++, the underlying type of an `enum` is implementation-defined, but by default, it is typically an integer type capable of representing all the enumerator values. In most cases, this means that it can be `int` (which is signed) or `unsigned int`, but the C++ standard allows compilers the flexibility to choose an ap...
16,219
[ { "from": "human", "value": "Are C++ enums signed or unsigned? And by extension is it safe to validate an input by checking that it is <= your max value, and leave out >= your min value (assuming you started at 0 and incremented by 1)?\n" }, { "from": "gpt", "value": "In C++, the underlying type...
I've written a small service (plain Win32) and I'd like to know if it's possible to run multiple instances of it when multiple users are logged on. Basically, let's say we've got UserA and UserB for UserA the service would log on as "domain\UserA" and for UserB the service would log on as "domain\UserB" - this is from ...
In Windows, services are designed to run in the context of the Local System account or a specific user account. They are not intended to be user-specific applications that can run multiple instances for different users. Windows services operate at a system level and do not have a direct association with user sessions. ...
15,998
[ { "from": "human", "value": "I've written a small service (plain Win32) and I'd like to know if it's possible to run multiple instances of it when multiple users are logged on.\nBasically, let's say we've got UserA and UserB for UserA the service would log on as \"domain\\UserA\" and for UserB the service w...
I have heard this concept used frequently, but I don't have a really good grasp of what it is.
It seems like you're asking about a specific concept, but you haven't mentioned what that concept is. Could you please specify what you're referring to? This way, I can provide you with a clear and thorough explanation.
20,354
[ { "from": "human", "value": "I have heard this concept used frequently, but I don't have a really good grasp of what it is.\n" }, { "from": "gpt", "value": "It seems like you're asking about a specific concept, but you haven't mentioned what that concept is. Could you please specify what you're ...
In my ASP.net MVC app I have a view that looks like this: ... <label>Due Date</label> <%=Html.TextBox("due")%> ... I am using a ModelBinder to bind the post to my model (the due property is of DateTime type). The problem is when I put "01/01/2009" into the textbox, and the post does not validate (due to other data bei...
In ASP.NET MVC, when binding a `DateTime` property in your model, the model binder will generally use the default format for `DateTime`, which usually includes both the date and time. To format the date correctly in your view while still allowing for proper model binding, you can customize how the date is displayed in ...
14,608
[ { "from": "human", "value": "In my ASP.net MVC app I have a view that looks like this:\n...\n<label>Due Date</label>\n<%=Html.TextBox(\"due\")%>\n...\n\nI am using a ModelBinder to bind the post to my model (the due property is of DateTime type). The problem is when I put \"01/01/2009\" into the textbox, an...
For some reason, when I try to install SQL Server 2008 Express, I get an error saying that I need to have .Net Framework 3.5 installed first, but the thing is: I already have! So could anybody tell me if I can bypass this verification by updating a registry key or something? I have np with visual studio or any other th...
If you're encountering an error stating that you need .NET Framework 3.5 installed when trying to install SQL Server 2008 Express, despite having it installed, there are several steps you can take to troubleshoot and potentially resolve the issue. ### Verify .NET Framework Installation 1. **Check Installed Versions**:...
13,367
[ { "from": "human", "value": "For some reason, when I try to install SQL Server 2008 Express, I get an error saying that I need to have .Net Framework 3.5 installed first, but the thing is: I already have! So could anybody tell me if I can bypass this verification by updating a registry key or something? I h...
Is it possible, in Java, to make a JPanel skip drawing its background thus being transparent except for the components on it?
Yes, in Java Swing, you can create a `JPanel` that appears transparent by skipping the drawing of its background. To achieve this effect, you can override the `paintComponent` method of the `JPanel` and not call the superclass method or set the panel's background to `null` or `new Color(0, 0, 0, 0)`. Here’s how you c...
13,359
[ { "from": "human", "value": "Is it possible, in Java, to make a JPanel skip drawing its background thus being transparent except for the components on it?\n" }, { "from": "gpt", "value": "Yes, in Java Swing, you can create a `JPanel` that appears transparent by skipping the drawing of its backgr...
How do they compare to the DevXpress ones or the original MSOffice ones. Are they worth investing time in them (for practical usage now, not academic curiosity which I'll do anyway)?
When comparing third-party libraries like DevExpress to the original Microsoft Office libraries (Office Interop), several factors come into play, particularly in the context of practical usage. Here are some points to consider: ### Performance and Efficiency - **DevExpress**: Generally, DevExpress components are optim...
14,293
[ { "from": "human", "value": "How do they compare to the DevXpress ones or the original MSOffice ones.\nAre they worth investing time in them (for practical usage now, not academic curiosity which I'll do anyway)?\n" }, { "from": "gpt", "value": "When comparing third-party libraries like DevExpre...
In Oracle, I have set the log_archive_dest1='D:\app\administrator\orcl\archive' parameter and shutdown the database. When I tried to start up the db, I got the following error: SQL> startup mount; ORA-16032: parameter LOG_ARCHIVE_DEST_1 destination string cannot be translated ORA-09291: sksachk: invalid device specif...
The error messages you are encountering indicate that Oracle cannot access the directory specified in the `log_archive_dest1` parameter for archive logs. The specific error `O/S-Error: (OS 3) The system cannot find the path specified` suggests that the directory `D:\app\administrator\orcl\archive` does not exist or is ...
16,086
[ { "from": "human", "value": "In Oracle, I have set the log_archive_dest1='D:\\app\\administrator\\orcl\\archive' parameter and shutdown the database. When I tried to start up the db, I got the following error:\nSQL> startup mount;\n\nORA-16032: parameter LOG_ARCHIVE_DEST_1 destination string cannot be trans...
I'm having troubles finding good Ruby libraries that implement WS-Security. I've seen wss4r but have yet to use it (and the documentation is a bit light on it). What libraries do you use for this task, or is there a better alternative?
When it comes to implementing WS-Security in Ruby, there are a few options you can consider. You're right that **wss4r** is one of the more prominent libraries, but its documentation can be sparse, making it challenging to use for those not already familiar with WS-Security. Here are some libraries and tools you might...
15,887
[ { "from": "human", "value": "I'm having troubles finding good Ruby libraries that implement WS-Security. I've seen wss4r but have yet to use it (and the documentation is a bit light on it). What libraries do you use for this task, or is there a better alternative?\n" }, { "from": "gpt", "value":...
I have a local mercurial repository with some site-specific changes in it. What I would like to do is set a couple files to be un-commitable so that they aren't automatically committed when I do an hg commit with no arguments. Right now, I'm doing complicated things with mq and guards to achieve this, pushing and popp...
Yes, there is a simpler way to handle this situation in Mercurial without having to deal with patches and mq. You can use the `.hgignore` file to prevent certain files from being tracked altogether, or you can use the `hg commit` command with the `--exclude` option to exclude certain files from a commit. Here's how to ...
15,615
[ { "from": "human", "value": "I have a local mercurial repository with some site-specific changes in it. What I would like to do is set a couple files to be un-commitable so that they aren't automatically committed when I do an hg commit with no arguments.\nRight now, I'm doing complicated things with mq an...
How do I write a regular expression to find all lines containing 665 and not having .pdf I can't seem to find how to do not in regex. This is for Notepad++ syntax if it matters. Thanks
In Notepad++, you can use regular expressions to find lines containing specific text and not containing other text. To find lines containing "665" and not containing ".pdf", you can use a negative lookahead in your regular expression. Here's the regex you need: ``` ^(?=.*665)(?!.*\.pdf).* ``` ### Explanation of the ...
17,838
[ { "from": "human", "value": "How do I write a regular expression to find all lines containing 665 and not having .pdf\nI can't seem to find how to do not in regex. This is for Notepad++ syntax if it matters.\nThanks\n" }, { "from": "gpt", "value": "In Notepad++, you can use regular expressions ...
I want to create templates for base new reports on to have common designs. How do you do it?
Creating templates for base reports is a great way to ensure consistency, save time, and enhance the professional appearance of your documents. Here’s a step-by-step guide to help you create effective report templates: ### 1. Define the Purpose and Audience - **Identify the report type**: Determine what kind of report...
11,495
[ { "from": "human", "value": "I want to create templates for base new reports on to have common designs. How do you do it?\n" }, { "from": "gpt", "value": "Creating templates for base reports is a great way to ensure consistency, save time, and enhance the professional appearance of your documen...
With Merb 1.0 rapidly approaching, I would like to know what Merb/Rails users recommend? Is it time to try Merb? What was downside for you when you switched to Merb from Rails?
As of the time leading up to Merb 1.0, many developers were exploring the framework and weighing the pros and cons of switching from Rails to Merb. Here are some insights and recommendations based on common experiences from users who made the transition: ### Reasons to Try Merb: 1. **Performance**: Merb was designed t...
14,343
[ { "from": "human", "value": "With Merb 1.0 rapidly approaching, I would like to know what Merb/Rails users recommend?\nIs it time to try Merb? What was downside for you when you switched to Merb from Rails?\n" }, { "from": "gpt", "value": "As of the time leading up to Merb 1.0, many developers w...
This is a question you can read everywhere on the web with various answers: $ext = end(explode('.', $filename)); $ext = substr(strrchr($filename, '.'), 1); $ext = substr($filename, strrpos($filename, '.') + 1); $ext = preg_replace('/^.*\.([^.]+)$/D', '$1', $filename); $exts = split("[/\\.]", $filename); $n = count(...
When it comes to extracting the file extension from a filename in PHP, there are indeed several methods available, as you've pointed out. However, the "best way" depends on several factors, such as readability, performance, and your specific use case. One of the most straightforward and readable methods is using `pat...
15,257
[ { "from": "human", "value": "This is a question you can read everywhere on the web with various answers:\n$ext = end(explode('.', $filename));\n$ext = substr(strrchr($filename, '.'), 1);\n$ext = substr($filename, strrpos($filename, '.') + 1);\n$ext = preg_replace('/^.*\\.([^.]+)$/D', '$1', $filename);\n\n$e...