instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
My website is entirely flash based, it moves around a 3D model which was given to me as chunks of video that I've converted to FLV files. I'm using the FLVPlayback component to control the video inside of my program. While running memory checks using System.totalMemory I've noticed that whenever a video is loaded, it w... | The issue you're experiencing with memory management in Flash, especially when dealing with video playback, is a common concern due to the way Flash handles resources. Here are a few strategies that can help you manage memory more effectively while working with FLVPlayback components:
1. **Single Instance Reuse**: As ... | 3,297 | [
{
"from": "human",
"value": "My website is entirely flash based, it moves around a 3D model which was given to me as chunks of video that I've converted to FLV files. I'm using the FLVPlayback component to control the video inside of my program. While running memory checks using System.totalMemory I've noti... |
Google custom search code is provided as a form tag. However, Asp.net only allows a single form tag on a page. What is the best way to implement their code so you can include it on an aspx page (say as part of a Masterpage or navigation element).
| In ASP.NET Web Forms, it's true that you can only have a single `<form>` tag per page, which can be a limitation when integrating third-party services like Google Custom Search that provide their code as a form tag. However, you can work around this limitation by using a couple of different strategies. Here are two com... | 5,949 | [
{
"from": "human",
"value": "Google custom search code is provided as a form tag. However, Asp.net only allows a single form tag on a page. What is the best way to implement their code so you can include it on an aspx page (say as part of a Masterpage or navigation element). \n"
},
{
"from": "gpt",
... |
I've looked for some other articles on this problem and even tried some of the ideas in this thread; however, nothing has solved the issue yet. So, on to the issue.
Something happens when working in Visual Studio (usually C#) that causes the IDE to become a bit wonky when saving a file. I will be working along just f... | It sounds like you're encountering a common issue in Visual Studio that can stem from various causes, such as extensions, background processes, or settings. Here are some suggestions to help troubleshoot and resolve the issue:
### 1. **Disable Extensions**
Some Visual Studio extensions can interfere with performance, ... | 8,246 | [
{
"from": "human",
"value": "I've looked for some other articles on this problem and even tried some of the ideas in this thread; however, nothing has solved the issue yet. So, on to the issue.\nSomething happens when working in Visual Studio (usually C#) that causes the IDE to become a bit wonky when savi... |
I'm trying to compile a Delphi 7 project that I've inherited, and I'm getting this error:
[Error] WARNING. Duplicate resource(s):
[Error] Type 2 (BITMAP), ID EDIT:
[Error] File C:[path shortened]\common\CRGrid.res resource kept; file c:\common\raptree.RES resource discarded.
It says warning, but it's actua... | This error occurs when two or more resources in different .res files have the same type and ID. In your case, both the `CRGrid` and `RapTree` components are trying to define a bitmap resource with the same ID (`EDIT`). This is causing a conflict that results in a compilation error.
Here are a few potential solutions t... | 10,608 | [
{
"from": "human",
"value": "I'm trying to compile a Delphi 7 project that I've inherited, and I'm getting this error:\n\n[Error] WARNING. Duplicate resource(s):\n [Error] Type 2 (BITMAP), ID EDIT:\n [Error] File C:[path shortened]\\common\\CRGrid.res resource kept; file c:\\common\\raptree.RES res... |
I've been tasked with "fixing" an old VSS database. At this point in time, we are considering migrating to TFS, but for the time being, if we could get VSS back to a stable condition, it would provide some peace of mind.
We're starting to get worried that VSS is going to die on us, because when we try to view the histo... | It sounds like you're dealing with a few potential issues related to the old Visual SourceSafe (VSS) database. While migrating to TFS (Team Foundation Server) or another modern version control system is certainly a good long-term solution, here are some steps to help stabilize your current VSS setup in the meantime:
#... | 10,414 | [
{
"from": "human",
"value": "I've been tasked with \"fixing\" an old VSS database. At this point in time, we are considering migrating to TFS, but for the time being, if we could get VSS back to a stable condition, it would provide some peace of mind.\nWe're starting to get worried that VSS is going to die ... |
I decided to make a system for a client using Castle ActiveRecord, everything went well until I found that the transactions do not work, for instance;
TransactionScope t = new TransactionScope();
try
{
member.Save();
//This is just to ... | It sounds like you're encountering issues with transaction management in Castle ActiveRecord and NHibernate. Let's go through a few points to clarify how transactions are typically handled and address your concerns.
### Transaction Management with Castle ActiveRecord and NHibernate
1. **Using `TransactionScope`:**
... | 6,728 | [
{
"from": "human",
"value": "I decided to make a system for a client using Castle ActiveRecord, everything went well until I found that the transactions do not work, for instance;\n TransactionScope t = new TransactionScope();\n\n try\n {\n member.... |
Can someone explain me how it works, starting from when you select to run a test
| Certainly! To explain how a software testing process works from the moment you select to run a test, let's break it down into several key steps:
### 1. Test Selection
- **Initiation**: You begin by selecting a test from your test management tool or directly from the testing framework.
- **Test Suite**: You might choos... | 9,767 | [
{
"from": "human",
"value": "Can someone explain me how it works, starting from when you select to run a test\n"
},
{
"from": "gpt",
"value": "Certainly! To explain how a software testing process works from the moment you select to run a test, let's break it down into several key steps:\n\n### 1... |
I'm working on a .NET 3.5 website, with three projects under one solution. I'm using jQuery in this project. I'd like to use the Visual Studio JavaScript debugger to step through my JavaScript code. If I set a breakpoint in any of the .js files I get a warning that says:
The breakpoint will not currently be hit. No sy... | The warning "The breakpoint will not currently be hit. No symbols have been loaded for this document." suggests that the JavaScript debugger is having trouble associating the JavaScript file with the loaded symbols, which typically means the browser or the debugger is not able to find the source map or isn't loading th... | 8,916 | [
{
"from": "human",
"value": "I'm working on a .NET 3.5 website, with three projects under one solution. I'm using jQuery in this project. I'd like to use the Visual Studio JavaScript debugger to step through my JavaScript code. If I set a breakpoint in any of the .js files I get a warning that says:\n\nThe ... |
I am looking for a drop-down JavaScript menu.
It should be the simplest and most elegant accessible menu that works in IE6 and Firefox 2 also.
It would be fine if it worked on an unnumbered list (ul) so the user can use the page without JavaScript support.
Which one do you recommend and where can I find the code to suc... | Creating a simple and accessible drop-down menu that works in older browsers like IE6 and Firefox 2 can be a bit challenging given their limitations, but it is possible. Below is a simple example of an accessible drop-down menu using an unnumbered list (ul) that will work without JavaScript as well. I'll provide both t... | 6,856 | [
{
"from": "human",
"value": "I am looking for a drop-down JavaScript menu.\nIt should be the simplest and most elegant accessible menu that works in IE6 and Firefox 2 also.\nIt would be fine if it worked on an unnumbered list (ul) so the user can use the page without JavaScript support.\nWhich one do you re... |
Is there anything out there (for Java specifically) that allow you to automatically test the behavior of an interface? As an example, let's say I have a bunch of tests for the Comparable interface, that should apply to anything that implements Comparable. What I'd like is to be able to include "ComparableTests" automat... | In the Java ecosystem, there are several approaches and libraries that can help you automate the testing of interfaces like `Comparable` across various implementations. Here are a few options you might consider:
1. **JUnit with Parameterized Tests**: JUnit provides support for parameterized tests, which can be used to... | 10,477 | [
{
"from": "human",
"value": "Is there anything out there (for Java specifically) that allow you to automatically test the behavior of an interface? As an example, let's say I have a bunch of tests for the Comparable interface, that should apply to anything that implements Comparable. What I'd like is to be ... |
What "Hidden Features" of JavaScript do you think every programmer should know?
After having seen the excellent quality of the answers to the following questions I thought it was time to ask it for JavaScript.
Hidden Features of HTML
Hidden Features of CSS
Hidden Features of PHP
Hidden Features of ASP.NET
Hidden Featu... | JavaScript is a powerful and versatile language with many features that are often overlooked or underutilized. Here are some "hidden features" of JavaScript that every programmer should know:
### 1. Destructuring Assignment
JavaScript allows you to unpack values from arrays or properties from objects into distinct var... | 2,854 | [
{
"from": "human",
"value": "What \"Hidden Features\" of JavaScript do you think every programmer should know?\nAfter having seen the excellent quality of the answers to the following questions I thought it was time to ask it for JavaScript.\n\nHidden Features of HTML\nHidden Features of CSS\nHidden Feature... |
I was writing a database handler class in PHP using the mysqli class and prepared statements. I was attempting to print out the result. It didn't work right off the bat so I decided to do some debugging. I tried to use the num_rows() method from the mysqli_statement class, but it kept returning 0. I decided to writ... | The issue you're experiencing with `num_rows()` returning `0` is due to the order of the operations in your code. In the `mysqli_stmt` class, `store_result()` must be called **before** you call `fetch()`.
When you execute a prepared statement, you need to store the result set first so that it can properly count the n... | 11,548 | [
{
"from": "human",
"value": "I was writing a database handler class in PHP using the mysqli class and prepared statements. I was attempting to print out the result. It didn't work right off the bat so I decided to do some debugging. I tried to use the num_rows() method from the mysqli_statement class, bu... |
Ran into this problem today, posting in case someone else has the same issue.
var execBtn = document.createElement('input');
execBtn.setAttribute("type", "button");
execBtn.setAttribute("id", "execBtn");
execBtn.setAttribute("value", "Execute");
execBtn.setAttribute("onclick", "runCommand();");
Turns out to get IE to ... | You're correct, and it's great that you're sharing this insight for others who might face similar issues with dynamically created elements in Internet Explorer (IE). Here's a concise summary of the best practices and what to avoid when working with `onclick` for dynamically generated buttons or elements.
### Correct W... | 9,097 | [
{
"from": "human",
"value": "Ran into this problem today, posting in case someone else has the same issue.\nvar execBtn = document.createElement('input');\nexecBtn.setAttribute(\"type\", \"button\");\nexecBtn.setAttribute(\"id\", \"execBtn\");\nexecBtn.setAttribute(\"value\", \"Execute\");\nexecBtn.setAttri... |
I want to simulate a 'Web 2.0' Lightbox style UI technique in a Windows Forms application. That is, to draw attention to some foreground control by 'dimming' all other content in the client area of a window.
The obvious solution is to create a control that is simply a partially transparent rectangle that can be docked... | Creating a "Lightbox" effect in a Windows Forms application can be challenging since it isn't directly supported as it is in web design. However, you can simulate this effect by creating a semi-transparent overlay that dims the background while allowing interactions with the foreground control.
Here's a step-by-step ... | 8,160 | [
{
"from": "human",
"value": "I want to simulate a 'Web 2.0' Lightbox style UI technique in a Windows Forms application. That is, to draw attention to some foreground control by 'dimming' all other content in the client area of a window. \nThe obvious solution is to create a control that is simply a partiall... |
The easiest way to think of my question is to think of a single, simple unix command (albeit, this is for windows) and I need progmatic access to run it.
I have a single command-line based executable that performs some unit of work. I want to call that executable with the .net process library, as I can do with any oth... | Yes, you can run an external executable from a .NET application using the `System.Diagnostics.Process` class. This class allows you to start external applications, wait for them to complete, and capture their output, among other functionalities. Here's how you can achieve this in a Windows environment:
### Example of ... | 9,228 | [
{
"from": "human",
"value": "The easiest way to think of my question is to think of a single, simple unix command (albeit, this is for windows) and I need progmatic access to run it. \nI have a single command-line based executable that performs some unit of work. I want to call that executable with the .net... |
How can I use the nifty JavaScript date and time widgets that the default admin uses with my custom view?
I have looked through the Django forms documentation, and it briefly mentions django.contrib.admin.widgets, but I don't know how to use it?
Here is my template that I want it applied on.
<form action="." method="PO... | To use the JavaScript date and time widgets from the Django admin in your custom form, you will need to import the relevant widgets from `django.contrib.admin.widgets` and apply them to your form fields. Here's a step-by-step guide to help you achieve this.
### Step 1: Update Your Form
Assuming you have a form that i... | 6,148 | [
{
"from": "human",
"value": "How can I use the nifty JavaScript date and time widgets that the default admin uses with my custom view?\nI have looked through the Django forms documentation, and it briefly mentions django.contrib.admin.widgets, but I don't know how to use it?\nHere is my template that I want... |
I've been digging through some parts of the Linux kernel, and found calls like this:
if (unlikely(fd < 0))
{
/* Do something */
}
or
if (likely(!err))
{
/* Do something */
}
I've found the definition of them:
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)... | The `likely()` and `unlikely()` macros are used in the Linux kernel (and some other performance-sensitive code) to provide hints to the compiler about the expected outcomes of conditionals. This optimization technique can help improve performance by influencing how the compiler generates branching code.
### How Do The... | 7,865 | [
{
"from": "human",
"value": "I've been digging through some parts of the Linux kernel, and found calls like this:\nif (unlikely(fd < 0))\n{\n /* Do something */\n}\n\nor\nif (likely(!err))\n{\n /* Do something */\n}\n\nI've found the definition of them:\n#define likely(x) __builtin_expect(!!(x),... |
As a beginner to TDD I am trying to write a test that assumes a property has had its value changed on a PropertyGrid (C#, WinForms, .NET 3.5).
Changing a property on an object in a property grid does not fire the event (fair enough, as it's a UI raised event, so I can see why changing the owned object may be invisible ... | You're correct in your observation that UI events, such as those from a PropertyGrid or a TreeView in WinForms, do not automatically trigger when you change the underlying data directly in code. This is a common issue in UI testing, especially when using Test-Driven Development (TDD).
In WinForms, a common approach to... | 11,632 | [
{
"from": "human",
"value": "As a beginner to TDD I am trying to write a test that assumes a property has had its value changed on a PropertyGrid (C#, WinForms, .NET 3.5).\nChanging a property on an object in a property grid does not fire the event (fair enough, as it's a UI raised event, so I can see why c... |
Let's say I have a class:
class Foo
{
public string Bar
{
get { ... }
}
public string this[int index]
{
get { ... }
}
}
I can bind to these two properties using "{Binding Path=Bar}" and "{Binding Path=[x]}". Fine.
Now let's say I want to implement INotifyPropertyChanged:
class Foo : INotifyPropert... | When working with WPF data binding and implementing `INotifyPropertyChanged`, you're correct that raising property change notifications for indexed properties (like your indexer) can be a bit tricky. The main issue is that WPF does not recognize indexed properties in the same way as regular properties when it comes to ... | 9,725 | [
{
"from": "human",
"value": "Let's say I have a class:\nclass Foo\n{\n public string Bar\n {\n get { ... }\n }\n\n public string this[int index]\n {\n get { ... }\n }\n}\n\nI can bind to these two properties using \"{Binding Path=Bar}\" and \"{Binding Path=[x]}\". Fine.\nNow let's say I want to ... |
I have successfully connected to an Oracle database (10g) from C# (Visual Studio 2008) by downloading and installing the client administration tools and Visual Studio 2008 on my laptop.
The installation footprint for Oracle Client tools was over 200Mb, and quite long winded.
Does anyone know what the minimum workable f... | To connect to an Oracle database from C# using the `Oracle.DataAccess` namespace, you typically need the Oracle Data Access Components (ODAC), which usually involves installing the Oracle Client. The full client installation can indeed be quite large, but there are lighter alternatives depending on your requirements.
... | 10,040 | [
{
"from": "human",
"value": "I have successfully connected to an Oracle database (10g) from C# (Visual Studio 2008) by downloading and installing the client administration tools and Visual Studio 2008 on my laptop.\nThe installation footprint for Oracle Client tools was over 200Mb, and quite long winded.\nD... |
I would like to serialize and deserialize objects without having to worry about the entire class graph.
Flexibility is key. I would like to be able to serialize any object passed to me without complete attributes needed throughout the entire object graph.
That means that Binary Serialization
is not an option as it ... | To achieve flexible serialization and deserialization of .NET objects while avoiding the limitations you mentioned, I recommend using JSON serialization with the help of libraries like **Json.NET (Newtonsoft.Json)** or **System.Text.Json**, which are both widely used and provide robust functionality for handling variou... | 6,881 | [
{
"from": "human",
"value": "I would like to serialize and deserialize objects without having to worry about the entire class graph.\nFlexibility is key. I would like to be able to serialize any object passed to me without complete attributes needed throughout the entire object graph.\n\nThat means that Bi... |
I just ran a "PROCEDURE ANALYSE ( )" on one of my tables. And I have this column that is of type INT and it only ever contains values from 0 to 12 (category IDs).
And MySQL said that I would be better of with a ENUM('0','1','2',...,'12'). This category's are basically static and won't change in the future, but if they ... | Using an `ENUM` type in MySQL instead of an `INT` for a column that contains a limited range of static values (like category IDs from 0 to 12) can have several potential benefits in terms of performance and storage efficiency, even though both approaches can work. Here’s why `ENUM` might be considered better for your c... | 7,558 | [
{
"from": "human",
"value": "I just ran a \"PROCEDURE ANALYSE ( )\" on one of my tables. And I have this column that is of type INT and it only ever contains values from 0 to 12 (category IDs).\nAnd MySQL said that I would be better of with a ENUM('0','1','2',...,'12'). This category's are basically static ... |
OK-- thanks to Mike, I was able to get Wincrypt to generate a Diffie-Hellman keypair. I figured out out to export the public key, and how to import the other party's public key. According to the docs, upon import of the other party's public key, the shared secret has been computed. Great.
I now need to get ahold of ... | It seems you are dealing with the Windows Crypto API (Wincrypt) and the Diffie-Hellman (DH) key exchange process for generating a shared secret. As you've noted, the API has specific methods for handling key pairs and shared secrets, and it can be somewhat opaque when you're trying to extract the shared secret directly... | 6,111 | [
{
"from": "human",
"value": "OK-- thanks to Mike, I was able to get Wincrypt to generate a Diffie-Hellman keypair. I figured out out to export the public key, and how to import the other party's public key. According to the docs, upon import of the other party's public key, the shared secret has been comp... |
I have a table which is full of arbitrarily formatted phone numbers, like this
027 123 5644
021 393-5593
(07) 123 456
042123456
I need to search for a phone number in a similarly arbitrary format ( e.g. 07123456 should find the entry (07) 123 456
The way I'd do this in a normal programming language is to strip all the... | Using the `REPLACE` function multiple times in your query to strip out unwanted characters can work, but it can lead to performance issues, especially as the dataset grows. Here’s a more refined solution and an explanation of potential performance implications.
### Using `REPLACE` to Strip Unwanted Characters
You can... | 4,853 | [
{
"from": "human",
"value": "I have a table which is full of arbitrarily formatted phone numbers, like this\n027 123 5644\n021 393-5593\n(07) 123 456\n042123456\n\nI need to search for a phone number in a similarly arbitrary format ( e.g. 07123456 should find the entry (07) 123 456\nThe way I'd do this in a... |
I feel that my shop has a hole because we don't have a solid process in place for versioning our database schema changes. We do a lot of backups so we're more or less covered, but it's bad practice to rely on your last line of defense in this way.
Surprisingly, this seems to be a common thread. Many shops I have spoke... | You're absolutely right that having a solid process for managing database schema changes is crucial for maintaining data integrity, especially as your application grows and evolves. Here are some best practices and strategies that can help you implement effective versioning of your database schema:
### 1. **Use a Vers... | 8,805 | [
{
"from": "human",
"value": "I feel that my shop has a hole because we don't have a solid process in place for versioning our database schema changes. We do a lot of backups so we're more or less covered, but it's bad practice to rely on your last line of defense in this way. \nSurprisingly, this seems to b... |
Using Windows Installer (targeting XP and Vista), is there a best practice for installing demo projects and files with your application?
| When creating a Windows Installer package for applications targeting Windows XP and Vista, there are several best practices you should follow, especially if your application includes demo projects and files. Here are some recommendations:
### 1. **Use the Appropriate Installer Technology**
- For older systems like ... | 6,899 | [
{
"from": "human",
"value": "Using Windows Installer (targeting XP and Vista), is there a best practice for installing demo projects and files with your application?\n"
},
{
"from": "gpt",
"value": "When creating a Windows Installer package for applications targeting Windows XP and Vista, there ... |
After installing VS2005 VB6 lost F1 function to MSDN Oct/2001 lib.
Suggestions to re-install MSDN did not work.
The only thing F1 works on now are ADO statements in VB6. Example ado1.recordset.recordcount If I highlight recordcount and press F1 I do get the ADO help information. If I highlight "recordset", I get "He... | The issue you're experiencing with Visual Basic 6 (VB6) help functionality after installing Visual Studio 2005 is not uncommon. It appears that the MSDN help integration with VB6 has been disrupted, leading to the "Help not found" errors you’re encountering. Here are several steps you can take to troubleshoot and poten... | 9,526 | [
{
"from": "human",
"value": "After installing VS2005 VB6 lost F1 function to MSDN Oct/2001 lib. \nSuggestions to re-install MSDN did not work. \nThe only thing F1 works on now are ADO statements in VB6. Example ado1.recordset.recordcount If I highlight recordcount and press F1 I do get the ADO help informa... |
I am seeting up Apache server with TortoiseSVN for local source code repository. Currently on trial purpose I am setting only two users.
Is it possible for administrator to set up some thing so that file get compulsory locked once its checkout (copy to working directory) by some one.
Abhijit Dhopate
| Yes, it is possible to enforce a locking mechanism in Apache Subversion (SVN) to ensure that files are locked when checked out. This is particularly useful for binary files or other files where you want to prevent concurrent edits. Here’s how you can set up a compulsory lock on files when they are checked out.
### Set... | 8,232 | [
{
"from": "human",
"value": "I am seeting up Apache server with TortoiseSVN for local source code repository. Currently on trial purpose I am setting only two users.\nIs it possible for administrator to set up some thing so that file get compulsory locked once its checkout (copy to working directory) by som... |
I'm trying to create a map application similar to this. Click the SWF Preview tab on the left of the image. Specifically, noticed how you can pan around, and the clickable buttons on the map move with it. Basically, how do they do that?
My application has a map that you can click and pan around using a startDrag() func... | To achieve the effect of having clickable buttons that follow a panning map in ActionScript 3.0 (AS3), you can approach this in a few ways. Since you want the buttons to stay in place relative to the map as it pans, you'll need to adjust their positions dynamically based on the movement of the map. Here's a general out... | 9,476 | [
{
"from": "human",
"value": "I'm trying to create a map application similar to this. Click the SWF Preview tab on the left of the image. Specifically, noticed how you can pan around, and the clickable buttons on the map move with it. Basically, how do they do that?\nMy application has a map that you can cli... |
How do you use network sockets in Pascal?
| Using network sockets in Pascal typically involves utilizing the `Sockets` unit, which provides various functions and types for handling network communications. Below, I will outline the basic steps to create a simple client and server application using sockets in Free Pascal.
### Server Example
This example demonstr... | 3,278 | [
{
"from": "human",
"value": "How do you use network sockets in Pascal?\n\n"
},
{
"from": "gpt",
"value": "Using network sockets in Pascal typically involves utilizing the `Sockets` unit, which provides various functions and types for handling net... |
Of course most languages have library functions for this, but suppose I want to do it myself.
Suppose that the float is given like in a C or Java program (except for the 'f' or 'd' suffix), for example "4.2e1", ".42e2" or simply "42". In general, we have the "integer part" before the decimal point, the "fractional part... | Your approach to parsing and converting a float in scientific notation (like "4.2e1") into a float or double value without losing precision is quite reasonable. Let's break it down step by step to see if we can ensure maximum precision throughout the process.
### Step-by-Step Process
1. **Parsing the String**:
Fir... | 4,734 | [
{
"from": "human",
"value": "Of course most languages have library functions for this, but suppose I want to do it myself.\nSuppose that the float is given like in a C or Java program (except for the 'f' or 'd' suffix), for example \"4.2e1\", \".42e2\" or simply \"42\". In general, we have the \"integer par... |
I have a 3 column grid in a window with a GridSplitter on the first column. I want to set the MaxWidth of the first column to a third of the parent Window or Page Width (or ActualWidth) and I would prefer to do this in XAML if possible.
This is some sample XAML to play with in XamlPad (or similar) which shows what I'm ... | To limit the maximum width of the first column to one-third of the parent window's width while using a `GridSplitter`, and to do so purely in XAML, you can use a combination of a `Grid`, `SharedSizeGroup`, and a `Viewbox` to achieve this.
Here's how you can do it:
```xml
<Page xmlns="http://schemas.microsoft.com/winf... | 10,164 | [
{
"from": "human",
"value": "I have a 3 column grid in a window with a GridSplitter on the first column. I want to set the MaxWidth of the first column to a third of the parent Window or Page Width (or ActualWidth) and I would prefer to do this in XAML if possible.\nThis is some sample XAML to play with in ... |
Where I work, the design and development departments are totally separated, however we (the design department) are responsible for managing the CSS for our sites. Typically, new CSS needs to be released to the production server far more often than new website code. Because of this, we are deploying the CSS separately, ... | Managing a large and constantly evolving CSS codebase, especially in a separated design and development environment, can be challenging. Here are some strategies that can help you streamline the process and bring the CSS under better control, while addressing your specific issues:
### 1. Version Control for CSS
**Ado... | 5,205 | [
{
"from": "human",
"value": "Where I work, the design and development departments are totally separated, however we (the design department) are responsible for managing the CSS for our sites. Typically, new CSS needs to be released to the production server far more often than new website code. Because of th... |
Problem. I need a way to find Starteam server time through Starteam Java SDK 8.0. Version of server is 8.0.172 so method Server.getCurrentTime() is not available since it was added only in server version 9.0.
Motivation. My application needs to use views at specific dates. So if there's some difference in system time b... | To find the current time on a StarTeam server using the StarTeam Java SDK 8.0, you can employ a workaround since the `Server.getCurrentTime()` method is not available in version 8.0. Instead, you can retrieve a timestamp from a specific object that is controlled by the server to help you determine the server's time. He... | 10,845 | [
{
"from": "human",
"value": "Problem. I need a way to find Starteam server time through Starteam Java SDK 8.0. Version of server is 8.0.172 so method Server.getCurrentTime() is not available since it was added only in server version 9.0.\nMotivation. My application needs to use views at specific dates. So i... |
Should I catch exceptions for logging purposes?
public foo(..)
{
try
{
...
} catch (Exception ex) {
Logger.Error(ex);
throw;
}
}
If I have this in place in each of my layers (DataAccess, Business and WebService) it means the exception is logged several times.
Does it make sense to do so if ... | Logging exceptions for debugging and monitoring purposes is a common practice in software development. However, if you're logging the same exception multiple times across different layers of your application, you might end up with redundant log entries, making it harder to track issues. Here are some considerations and... | 9,068 | [
{
"from": "human",
"value": "Should I catch exceptions for logging purposes?\n\npublic foo(..)\n{\n try\n {\n ...\n } catch (Exception ex) {\n Logger.Error(ex);\n throw;\n }\n}\n\nIf I have this in place in each of my layers (DataAccess, Business and WebService) it means the exception is... |
What are some of the strategies that are used when implementing FxCop / static analysis on existing code bases with existing violations? How can one most effectively reduce the static analysis violations?
| Implementing FxCop or any static analysis tool on existing codebases can be challenging, especially when there are numerous existing violations. However, with a structured approach, it's possible to effectively reduce these violations over time. Here are some strategies you can use:
### 1. **Baseline Analysis**
- *... | 8,278 | [
{
"from": "human",
"value": "What are some of the strategies that are used when implementing FxCop / static analysis on existing code bases with existing violations? How can one most effectively reduce the static analysis violations?\n"
},
{
"from": "gpt",
"value": "Implementing FxCop or any sta... |
I've recently started using Eclipse Ganymede CDT for C development and I couldn't like it more. I'm aware the learning curve could be sort of pronounced, therefore and with your help, my goal is to flatten it as much as possible. I'm looking for the best hacks, hints, tips, tricks, and best practices to really unleash ... | Eclipse Ganymede CDT (C/C++ Development Tooling) is a powerful IDE for C and C++ development, but it can be overwhelming at first. Here are some tips, tricks, and best practices to help you get the most out of it:
### 1. **Customize the Workspace**
- **Set Up Perspectives:** Customize your workspace by arranging vi... | 6,651 | [
{
"from": "human",
"value": "I've recently started using Eclipse Ganymede CDT for C development and I couldn't like it more. I'm aware the learning curve could be sort of pronounced, therefore and with your help, my goal is to flatten it as much as possible. I'm looking for the best hacks, hints, tips, tric... |
Specifically I have a PHP command-line script that at a certain point requires input from the user. I would like to be able to execute an external editor (such as vi), and wait for the editor to finish execution before resuming the script.
My basic idea was to use a temporary file to do the editing in, and to retrieve ... | Yes, you can achieve this in a PHP command-line script by using the `exec` function to call an external editor. Your approach using a temporary file is a good one, and PHP can handle this seamlessly in a command-line context. Below is a sample implementation of your idea using PHP:
```php
<?php
function get_user_inpu... | 10,768 | [
{
"from": "human",
"value": "Specifically I have a PHP command-line script that at a certain point requires input from the user. I would like to be able to execute an external editor (such as vi), and wait for the editor to finish execution before resuming the script.\nMy basic idea was to use a temporary f... |
I am creating an appcation on Vista,which include a service and a Console application .Both running in same user account
In service i am creating an event and waits for that event.In console application i am opening the same event (problem starts here) and calling SetEvent function. I can not open the event (getting ... | The issue you're encountering with error code 5 (Access Denied) when trying to open the event in your console application from a service is indeed likely related to security and integrity levels in Windows Vista and later versions. Here are the steps you can take to resolve the problem and successfully set up inter-pro... | 8,568 | [
{
"from": "human",
"value": "I am creating an appcation on Vista,which include a service and a Console application .Both running in same user account\nIn service i am creating an event and waits for that event.In console application i am opening the same event (problem starts here) and calling SetEvent fu... |
I need to be able to change the users' password through a web page (in a controlled environment).
So, for that, I'm using this code:
<?php
$output = shell_exec("sudo -u dummy passwd testUser testUserPassword");
$output2 = shell_exec("dummyPassword");
echo $output;
echo $output2;
echo "done";
?>
My problem is that this... | Your approach to changing a user's password using PHP and shell commands has several issues. Let's address them:
1. **Using `sudo` and `passwd`:** The command you are trying to run requires `sudo` privileges, and the way you're invoking the `passwd` command is not correct. The `passwd` command usually requires interac... | 10,460 | [
{
"from": "human",
"value": "I need to be able to change the users' password through a web page (in a controlled environment).\nSo, for that, I'm using this code:\n<?php\n$output = shell_exec(\"sudo -u dummy passwd testUser testUserPassword\");\n$output2 = shell_exec(\"dummyPassword\");\necho $output;\necho... |
I'm looking for advice on the built-in unit testing feature provided in VS08. Can any body please tell me if they know of any reasons NOT to use this feature over any of the other packages available (I'm vaguely familiar with NUnit)?
I'm planning on applying unit testing to an older project just to learn the ropes of u... | Hi Eric,
It's great to hear that you're exploring unit testing! Visual Studio 2008 (VS08) provides a built-in unit testing framework that integrates well with the IDE, making it convenient for developers, especially those who are already familiar with Microsoft's ecosystem. Here are some pros and cons to consider when... | 9,791 | [
{
"from": "human",
"value": "I'm looking for advice on the built-in unit testing feature provided in VS08. Can any body please tell me if they know of any reasons NOT to use this feature over any of the other packages available (I'm vaguely familiar with NUnit)?\nI'm planning on applying unit testing to an ... |
What tools/websites do you use to read JavaDocs?
I currently use Firefox with 20+ tabs open when working on a J2EE project to have all the documentation available which is not very usable, is eating too much memory and is not searchable.
What I would expect from such a tool/website:
Aggregate JavaDocs from different ... | It sounds like you're looking for a more efficient way to navigate and utilize JavaDocs while working on your J2EE projects. Here are a few additional tools and websites that could meet your requirements and possibly enhance your current workflow:
### 1. **Javadocs.io**
- **Features**: A modern, user-friendly inter... | 8,372 | [
{
"from": "human",
"value": "What tools/websites do you use to read JavaDocs? \nI currently use Firefox with 20+ tabs open when working on a J2EE project to have all the documentation available which is not very usable, is eating too much memory and is not searchable.\nWhat I would expect from such a tool/w... |
There are similar question, but not regarding C# libraries I can use in my source code.
Thank you all for your help.
I've already saw lucene, but I need something more easy to search for similar strings and without the overhead of the indexing part.
The answer I marked has got two very easy algorithms, and one uses LIN... | If you're looking for C# libraries or algorithms to find similar strings without the overhead of indexing, you might want to consider a few options that are simpler than Lucene. Here are some suggestions:
### 1. **FuzzyStrings**
This library provides functions to perform fuzzy string comparisons. It includes implement... | 3,775 | [
{
"from": "human",
"value": "There are similar question, but not regarding C# libraries I can use in my source code.\nThank you all for your help.\nI've already saw lucene, but I need something more easy to search for similar strings and without the overhead of the indexing part.\nThe answer I marked has go... |
For deployment reasons, I am trying to use IJW to wrap a C# assembly in C++ instead of using a COM Callable Wrapper.
I've done it on other projects, but on this one, I am getting an EEFileLoadException. Any help would be appreciated!
Managed C++ wrapper code (this is in a DLL):
extern "C" __declspec(dllexport) IMyOb... | The `EEFileLoadException` and the accompanying execution engine error you’re encountering are typically indicative of issues in loading the .NET assembly, and can arise from several potential misconfigurations or environmental issues. Here are a few steps you can take to troubleshoot and potentially resolve this issue:... | 9,023 | [
{
"from": "human",
"value": "For deployment reasons, I am trying to use IJW to wrap a C# assembly in C++ instead of using a COM Callable Wrapper. \nI've done it on other projects, but on this one, I am getting an EEFileLoadException. Any help would be appreciated!\nManaged C++ wrapper code (this is in a D... |
So, I am seeing a curious problem. If I have a function
// counter wraps around to beginning eventually, omitted for clarity.
var counter;
cycleCharts(chartId) {
// chartId should be undefined when called from setInterval
console.log('chartId: ' + chartId);
if(typeof chartId == 'undefined' || chartId < 0) ... | The behavior you're observing is indeed intriguing and can be explained by how JavaScript handles function contexts and the `this` keyword, especially in the context of `setInterval`.
When you pass a function to `setInterval`, it doesn't automatically bind to the context of the function (like a method of an object) an... | 4,050 | [
{
"from": "human",
"value": "So, I am seeing a curious problem. If I have a function\n// counter wraps around to beginning eventually, omitted for clarity.\nvar counter; \ncycleCharts(chartId) {\n // chartId should be undefined when called from setInterval\n console.log('chartId: ' + chartId);\n if... |
I'm having a problem debugging an Eclipse Application from Eclipse. When I launch the Debug Configuration, the Eclipse Application starts up and then stops repeatedly. It shows the splash screen and then disappears. This is the farthest it gets before restarting:
MyDebugConfiguration [Eclipse Application]
org.... | The issue you're encountering with your Eclipse Application likely stems from an error during the startup process, which leads to the application crashing and restarting repeatedly. Here are a few steps you can take to debug this problem:
### 1. Check the Error Log:
- Go to `Window -> Show View -> Error Log`. This vie... | 10,059 | [
{
"from": "human",
"value": "I'm having a problem debugging an Eclipse Application from Eclipse. When I launch the Debug Configuration, the Eclipse Application starts up and then stops repeatedly. It shows the splash screen and then disappears. This is the farthest it gets before restarting:\nMyDebugConf... |
I'm asking for a template trick to detect if a class has a specific member function of a given signature.
The problem is similar to the one cited here
http://www.gotw.ca/gotw/071.htm
but not the same: in the item of Sutter's book he answered to the question that a class C MUST PROVIDE a member function with a particul... | You can achieve the desired behavior using SFINAE (Substitution Failure Is Not An Error) along with some template metaprogramming techniques to check for the presence of a specific member function in a class. This can be done without polluting the global namespace or requiring that the user define functions in a specif... | 7,928 | [
{
"from": "human",
"value": "I'm asking for a template trick to detect if a class has a specific member function of a given signature.\nThe problem is similar to the one cited here\nhttp://www.gotw.ca/gotw/071.htm\nbut not the same: in the item of Sutter's book he answered to the question that a class C MUS... |
I am writing a little application to download files over http (as, for example, described here).
I also want to include a little download progress indicator showing the percentage of the download progress.
Here is what I came up with:
sys.stdout.write(rem_file + "...")
urllib.urlretrieve(rem_file, loc_file... | Your improved approach using the `\r` character to return the cursor to the beginning of the line is a great enhancement, as it allows you to overwrite the progress display without moving the cursor unnecessarily. This is definitely a more user-friendly output.
Here are some additional tips and suggestions to further ... | 9,563 | [
{
"from": "human",
"value": "I am writing a little application to download files over http (as, for example, described here).\nI also want to include a little download progress indicator showing the percentage of the download progress.\nHere is what I came up with:\n\n sys.stdout.write(rem_file + \"...\"... |
My quick search reveals the reference implementation (http://stax.codehaus.org), the Woodstox implementation (http://woodstox.codehaus.org), and Sun's SJSXP implementation (https://sjsxp.dev.java.net/).
Please comment on the relative merits of these, and fill me in on any other implementations I should consider.
| When considering different implementations of the StAX (Streaming API for XML) parsing framework, it's important to examine the features, performance, and support for standards of each implementation. Here are some comments on the three you mentioned:
1. **Reference Implementation (StAX)**:
- The reference implemen... | 9,753 | [
{
"from": "human",
"value": "My quick search reveals the reference implementation (http://stax.codehaus.org), the Woodstox implementation (http://woodstox.codehaus.org), and Sun's SJSXP implementation (https://sjsxp.dev.java.net/).\nPlease comment on the relative merits of these, and fill me in on any other... |
I work at a college and have been developing an ASP.NET site with many, many reports about students, attendance stats... The basis for the data is an MSSQL server DB which is the back end to our student management system. This has a regular maintenance period on Thursday mornings for an unknown length of time (dependen... | To handle site maintenance in an ASP.NET application, you can implement a global mechanism that redirects users to a maintenance page when the database is unavailable. The approach below allows you to have a centralized way to manage maintenance notifications without needing to modify every individual page.
Here’s a g... | 7,757 | [
{
"from": "human",
"value": "I work at a college and have been developing an ASP.NET site with many, many reports about students, attendance stats... The basis for the data is an MSSQL server DB which is the back end to our student management system. This has a regular maintenance period on Thursday morning... |
I've got a webapp whose original code base was developed with a hand crafted hibernate mapping file. Since then, I've become fairly proficient at 'coding' my hbm.xml file. But all the cool kids are using annotations these days.
So, the question is: Is it worth the effort to refactor my code to use hibernate annotatio... | Refactoring your Hibernate mapping from XML files to annotations can indeed have benefits, but whether it's worth the effort depends on a variety of factors. Let's break down the key considerations:
### Advantages of Using Annotations
1. **Conciseness**: Annotations tend to make the codebase more concise and reduce b... | 9,574 | [
{
"from": "human",
"value": "I've got a webapp whose original code base was developed with a hand crafted hibernate mapping file. Since then, I've become fairly proficient at 'coding' my hbm.xml file. But all the cool kids are using annotations these days.\nSo, the question is: Is it worth the effort to r... |
I am just starting to learn javascript, so I don't have the skills to figure out what I assume is a trivial problem.
I'm working with a Wordpress blog that serves as a FAQ for our community and I am trying to pull together some tools to make managing the comments easier. Internet Duct Tape's Greasemonkey tools, like C... | It's great to see that you're diving into JavaScript and creating useful tools for your Wordpress blog! Your combined solution is a good approach for extracting IP addresses from selected text and displaying them in a new window. I’ll provide a little explanation of your code and offer a slightly enhanced version for c... | 7,994 | [
{
"from": "human",
"value": "I am just starting to learn javascript, so I don't have the skills to figure out what I assume is a trivial problem.\nI'm working with a Wordpress blog that serves as a FAQ for our community and I am trying to pull together some tools to make managing the comments easier. Inter... |
I am having difficulty reliably creating / removing event sources during the installation of my .Net Windows Service.
Here is the code from my ProjectInstaller class:
// Create Process Installer
ServiceProcessInstaller spi = new ServiceProcessInstaller();
spi.Account = ServiceAccount.LocalSystem;
// Create Service
Ser... | Creating and managing event sources for a Windows Service can sometimes be tricky due to the way Windows handles event logging and registry entries. The issue you're facing might be occurring due to timing or state inconsistency between the installation and the event log system.
### Best Practices for Managing Event S... | 8,948 | [
{
"from": "human",
"value": "I am having difficulty reliably creating / removing event sources during the installation of my .Net Windows Service.\nHere is the code from my ProjectInstaller class:\n// Create Process Installer\nServiceProcessInstaller spi = new ServiceProcessInstaller();\nspi.Account = Servi... |
I need an associative container that makes me index a certain object through a string, but that also keeps the order of insertion, so I can look for a specific object by its name or just iterate on it and retrieve objects in the same order I inserted them.
I think this hybrid of linked list and hash map should do the j... | The `std::unordered_map` in C++ is a hash table-based associative container that allows you to store key-value pairs, where you can quickly access the value based on the key. Here are some key features and behaviors of `std::unordered_map`:
1. **Fast Access**: The primary feature of `std::unordered_map` is that it pro... | 9,177 | [
{
"from": "human",
"value": "I need an associative container that makes me index a certain object through a string, but that also keeps the order of insertion, so I can look for a specific object by its name or just iterate on it and retrieve objects in the same order I inserted them.\nI think this hybrid o... |
Do you write consumer desktop applications with .NET languages? If so what type?
My impression is that most consumer desktop applications are still native compiled applications in C, C++ and the like.
Whilst .NET languages are growing in up take and popularity, do these new breed of applications ever break out of the e... | Yes, .NET languages, particularly C# and F#, can be used to write consumer desktop applications. While it's true that many high-performance applications, particularly in areas like gaming, CAD/CAE, and other resource-intensive domains, are often developed in C or C++, .NET languages have been successfully used to build... | 8,510 | [
{
"from": "human",
"value": "Do you write consumer desktop applications with .NET languages? If so what type?\nMy impression is that most consumer desktop applications are still native compiled applications in C, C++ and the like.\nWhilst .NET languages are growing in up take and popularity, do these new br... |
If a class defined an annotation, is it somehow possible to force its subclass to define the same annotation?
For instance, we have a simple class/subclass pair that share the @Author @interface.
What I'd like to do is force each further subclass to define the same @Author annotation, preventing a RuntimeException some... | In Java, there's no built-in way to enforce that all subclasses of a class must have a specific annotation at compile time. Annotations in Java are primarily a runtime feature, and the Java compiler does not have a mechanism to enforce that subclasses of a given class must also have specific annotations.
However, you ... | 9,041 | [
{
"from": "human",
"value": "If a class defined an annotation, is it somehow possible to force its subclass to define the same annotation?\nFor instance, we have a simple class/subclass pair that share the @Author @interface.\nWhat I'd like to do is force each further subclass to define the same @Author ann... |
I have the following enum:
public enum Status implements StringEnum{
ONLINE("on"),OFFLINE("off");
private String status = null;
private Status(String status) {
this.status = status;
}
public String toString() {
return this.status;
}
public static Status find(String valu... | Yes, you can create a `StringEnum` interface in Java that ensures all implementing enums have a `find()`, `toString()`, and a constructor. However, it's important to note that interfaces in Java cannot enforce constructor definitions directly, as constructors are specific to classes, and interfaces cannot define them.
... | 10,135 | [
{
"from": "human",
"value": "I have the following enum:\npublic enum Status implements StringEnum{ \n\n ONLINE(\"on\"),OFFLINE(\"off\");\n\n private String status = null;\n\n private Status(String status) {\n this.status = status;\n }\n\n public String toString() {\n return this... |
In several modern programming languages (including C++, Java, and C#), the language allows integer overflow to occur at runtime without raising any kind of error condition.
For example, consider this (contrived) C# method, which does not account for the possibility of overflow/underflow. (For brevity, the method also ... | You are correct that one of the primary reasons programming languages like C++, Java, and C# allow integer overflow to occur without raising exceptions is indeed performance. However, there are several other considerations that contribute to this design decision:
1. **Performance Overhead**: Raising exceptions or chec... | 8,483 | [
{
"from": "human",
"value": "In several modern programming languages (including C++, Java, and C#), the language allows integer overflow to occur at runtime without raising any kind of error condition.\nFor example, consider this (contrived) C# method, which does not account for the possibility of overflow/... |
We have multiple MFC apps, which use CMutex( false, "blah" ), where "blah" allows the mutex to work across process boundaries.
One of these apps was re-written without MFC (using Qt instead). How can I simulate the CMutex using Win32 calls? (Qt's QMutex is not inter-process.) I prefer not to modify the MFC apps.
| To simulate the behavior of `CMutex` using Win32 API calls, you can use the `CreateMutex` and `WaitForSingleObject` functions. This allows you to create a named mutex that can be shared across processes. Below are the steps you can follow to create a similar mechanism using Win32 API:
### Step 1: Create a Mutex
You c... | 9,709 | [
{
"from": "human",
"value": "We have multiple MFC apps, which use CMutex( false, \"blah\" ), where \"blah\" allows the mutex to work across process boundaries.\nOne of these apps was re-written without MFC (using Qt instead). How can I simulate the CMutex using Win32 calls? (Qt's QMutex is not inter-proces... |
We've seen an issue where one of our installers (msi) returns the error code 2908, which is used to indicate that an assembly failed to register. Later in the installation, we get the following (sanitized) error:
MyAssemblyName, version="1.0.1.1",
culture="neutral",
publicKeyToken="119EFC79848A50".
Please refer... | The error code 2908 along with HRESULT: 0x8002802F generally indicates an issue with the registration of a COM assembly, which can occur for several reasons. Here are some steps you can take to troubleshoot and potentially resolve the issue:
1. **Permissions Issue**: Ensure that the user running the installer has suff... | 11,992 | [
{
"from": "human",
"value": "We've seen an issue where one of our installers (msi) returns the error code 2908, which is used to indicate that an assembly failed to register. Later in the installation, we get the following (sanitized) error:\n\nMyAssemblyName, version=\"1.0.1.1\",\n culture=\"neutral\",\n... |
I'll have an ASP.net page that creates some Excel Sheets and sends them to the user. The problem is, sometimes I get Http timeouts, presumably because the Request runs longer than executionTimeout (110 seconds per default).
I just wonder what my options are to prevent this, without wanting to generally increase the exe... | Handling long-running operations in an ASP.NET application requires some strategic approaches, especially if you want to avoid increasing the global `executionTimeout`. Here are several options you can consider:
### 1. **Asynchronous Processing**
Instead of executing the long-running task synchronously, you can use as... | 8,194 | [
{
"from": "human",
"value": "I'll have an ASP.net page that creates some Excel Sheets and sends them to the user. The problem is, sometimes I get Http timeouts, presumably because the Request runs longer than executionTimeout (110 seconds per default).\nI just wonder what my options are to prevent this, wit... |
What's the easiest way to add a header and footer to a .Net PrintDocument object, either pragmatically or at design-time?
Specifically I'm trying to print a 3rd party grid control (Infragistics GridEx v4.3), which takes a PrintDocument object and draws itself into it.
The resulting page just contains the grid and it's ... | Adding a header and footer to a `PrintDocument` object in VB.NET can be accomplished by handling the `PrintPage` event. You can draw text and graphics directly onto the `PrintDocument` using the `Graphics` object that is passed to the event handler. Below, I'll provide a basic outline of how to implement this, along wi... | 7,372 | [
{
"from": "human",
"value": "What's the easiest way to add a header and footer to a .Net PrintDocument object, either pragmatically or at design-time?\nSpecifically I'm trying to print a 3rd party grid control (Infragistics GridEx v4.3), which takes a PrintDocument object and draws itself into it.\nThe resu... |
I have a classic client/server (fat client and database) program written in Delphi 2006. When certain conditions are met in the client, I need to notify all the other clients very quickly. Up until now this has been done using UDP broadcasts, but this is no longer viable as clients now connect from outside the LAN and ... | You're correct in thinking that moving away from UDP broadcasts is necessary since clients are connecting from outside the LAN. A server-client architecture using TCP sockets would be a more appropriate solution for your scenario. The Indy libraries are a solid choice for implementing this in Delphi.
### Basic Archit... | 6,077 | [
{
"from": "human",
"value": "I have a classic client/server (fat client and database) program written in Delphi 2006. When certain conditions are met in the client, I need to notify all the other clients very quickly. Up until now this has been done using UDP broadcasts, but this is no longer viable as clie... |
I have a function inside a loop inside a function. The inner function acquires and stores a large vector of data in memory (as a global variable... I'm using "R" which is like "S-Plus"). The loop loops through a long list of data to be acquired. The outer function starts the process and passes in the list of datasets t... | Using global variables for data storage in your R code, especially when dealing with large datasets, is generally considered poor practice. This approach can lead to issues with code readability, maintainability, and potential bugs, particularly in larger projects where variable scope can become ambiguous.
### Compari... | 8,886 | [
{
"from": "human",
"value": "I have a function inside a loop inside a function. The inner function acquires and stores a large vector of data in memory (as a global variable... I'm using \"R\" which is like \"S-Plus\"). The loop loops through a long list of data to be acquired. The outer function starts the... |
Question
I'm wondering how different ExtendScript is from JavaScript? Could I theoretically hire a web developer who has JavaScript savvy to develop it without demanding an excessive amount of learning on their part?
Overview
I'm working on a media database (or a so-called "multimedia library") project and it is based ... | ExtendScript is Adobe's extended version of JavaScript, designed specifically for automation and scripting within Adobe applications such as Bridge, Photoshop, InDesign, and Illustrator. While it shares a similar syntax and core principles with JavaScript, there are some key differences and additional features that you... | 9,677 | [
{
"from": "human",
"value": "Question\nI'm wondering how different ExtendScript is from JavaScript? Could I theoretically hire a web developer who has JavaScript savvy to develop it without demanding an excessive amount of learning on their part?\nOverview\nI'm working on a media database (or a so-called \"... |
I would like to do both of the following things:
use audit triggers on my database tables to identify which user updated what;
use connection pooling to improve performance
For #1, I use 'system_user' in the database trigger to identify the user making the change, but this prevent me from doing #2 which requires a ge... | To achieve both goals—tracking user changes with audit triggers while using connection pooling in an ASP.NET application—you can take the following approach:
### 1. Use Application-Level User Context
Instead of relying solely on `SYSTEM_USER` in your database triggers (which is limited by the connection pooling conte... | 9,419 | [
{
"from": "human",
"value": "I would like to do both of the following things:\n\nuse audit triggers on my database tables to identify which user updated what;\nuse connection pooling to improve performance\n\nFor #1, I use 'system_user' in the database trigger to identify the user making the change, but thi... |
I need to sum points on each level earned by a tree of users. Level 1 is the sum of users' points of the users 1 level below the user. Level 2 is the Level 1 points of the users 2 levels below the user, etc...
The calculation happens once a month on a non production server, no worries about performance.
What would the ... | To calculate the points for each user at different levels based on the hierarchical structure of the users, we can use Common Table Expressions (CTEs) in SQL Server to traverse the tree structure and aggregate the points accordingly. The goal is to create a recursive CTE that will sum the points at each level for each ... | 11,111 | [
{
"from": "human",
"value": "I need to sum points on each level earned by a tree of users. Level 1 is the sum of users' points of the users 1 level below the user. Level 2 is the Level 1 points of the users 2 levels below the user, etc...\nThe calculation happens once a month on a non production server, no ... |
Given the key for some registry value (e.g. HKEY_LOCAL_MACHINE\blah\blah\blah\foo) how can I:
Safely determine that such a key exists.
Programmatically (i.e. with code) get its value.
I have absolutely no intention of writing anything back to the registry (for the duration of my career if I can help it). So we can sk... | To safely determine if a registry key exists and to retrieve its value using the Windows API in C++, you can follow these steps:
1. Use `RegOpenKeyEx` to open the registry key.
2. Check if the operation succeeded to determine if the key exists.
3. If the key exists, use `RegQueryValueEx` to read the value.
Below is a... | 3,660 | [
{
"from": "human",
"value": "Given the key for some registry value (e.g. HKEY_LOCAL_MACHINE\\blah\\blah\\blah\\foo) how can I:\n\nSafely determine that such a key exists.\nProgrammatically (i.e. with code) get its value.\n\nI have absolutely no intention of writing anything back to the registry (for the dur... |
I'm looking at Rails development as a backend to a Flex application and am trying to figure out the communication layer between the Rails app and the Flash Player. All of the things I am finding suggest using SOAP web services to communicate.
However, Flash supports AMF which is nice and fast (and native). Is there a... | Yes, you can certainly use AMF (Action Message Format) to communicate between a Ruby on Rails application and a Flex application. While SOAP is a common choice for web services, AMF can provide a faster and more efficient communication layer, especially given its native support in Flash/Flex applications.
To implement... | 8,521 | [
{
"from": "human",
"value": "I'm looking at Rails development as a backend to a Flex application and am trying to figure out the communication layer between the Rails app and the Flash Player. All of the things I am finding suggest using SOAP web services to communicate.\nHowever, Flash supports AMF which ... |
I came back today to an old script I had for logging into Gmail via SSL. The script worked fine last time I ran it (several months ago) but now it dies immediately with:
<urlopen error The read operation timed out>
If I set the timeout (no matter how long), it dies even more immediately with:
<urlopen error The connec... | It looks like you're encountering connection issues with your script when trying to access Gmail over SSL. Here are some potential reasons and steps to troubleshoot and resolve the issue:
### Possible Causes:
1. **Network Issues**:
- The network you are on may have restrictions or issues that prevent connecting to... | 9,049 | [
{
"from": "human",
"value": "I came back today to an old script I had for logging into Gmail via SSL. The script worked fine last time I ran it (several months ago) but now it dies immediately with:\n<urlopen error The read operation timed out>\n\nIf I set the timeout (no matter how long), it dies even more... |
I'd like to to associate a file extension to the current executable in C#.
This way when the user clicks on the file afterwards in explorer, it'll run my executable with the given file as the first argument.
Ideally it'd also set the icon for the given file extensions to the icon for my executable.
Thanks all.
| To associate a file extension with your executable in C#, you will need to modify the Windows Registry. This allows your application to be executed with a specified file as an argument when the user double-clicks a file with that extension in Windows Explorer. Additionally, you can also set the icon for the file extens... | 8,016 | [
{
"from": "human",
"value": "I'd like to to associate a file extension to the current executable in C#.\nThis way when the user clicks on the file afterwards in explorer, it'll run my executable with the given file as the first argument.\nIdeally it'd also set the icon for the given file extensions to the i... |
I am developing console application in .Net and I want to change a behavior a little based on information that application was started from cmd.exe or from explorer.exe. Is it possible?
| Yes, it is possible to determine whether your .NET console application was launched from `cmd.exe` or `explorer.exe`. While there is no direct way to get this information in .NET, you can use some Windows API calls to achieve this. Specifically, you can examine the parent process of your application to see if it was st... | 6,837 | [
{
"from": "human",
"value": "I am developing console application in .Net and I want to change a behavior a little based on information that application was started from cmd.exe or from explorer.exe. Is it possible?\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to determine whether your .N... |
Here's something I haven't been able to fix, and I've looked everywhere. Perhaps someone here will know!
I have a table called dandb_raw, with three columns in particular: dunsId (PK), name, and searchName. I also have a trigger that acts on this table:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [d... | The issue you are encountering with the error message regarding the "Insert Error: Column name or number of supplied values does not match table definition." appears to be due to the way the temporary table `#newMatches` is being used in your trigger. Specifically, you are attempting to `INSERT` into `#newMatches`, but... | 9,014 | [
{
"from": "human",
"value": "Here's something I haven't been able to fix, and I've looked everywhere. Perhaps someone here will know!\nI have a table called dandb_raw, with three columns in particular: dunsId (PK), name, and searchName. I also have a trigger that acts on this table:\nSET ANSI_NULLS ON\nGO\n... |
I've been doing code review (mostly using tools like FindBugs) of one of our pet projects and FindBugs marked following code as erroneous (pseudocode):
Connection conn = dataSource.getConnection();
try{
PreparedStatement stmt = conn.prepareStatement();
//initialize the statement
stmt.execute();
ResultS... | Yes, the pattern you've observed is a common issue in Java applications using JDBC. Not properly closing `ResultSet` and `Statement` objects can lead to resource leaks, which in turn can exhaust database connections or lead to other resource-related problems.
### Closing Resources
In JDBC, when you create a `Connecti... | 8,733 | [
{
"from": "human",
"value": "I've been doing code review (mostly using tools like FindBugs) of one of our pet projects and FindBugs marked following code as erroneous (pseudocode):\nConnection conn = dataSource.getConnection();\n\ntry{\n PreparedStatement stmt = conn.prepareStatement();\n //initialize... |
I have an Exchange mailbox linked as a table in an MS Access app. This is primarily used for reading, but I would also like to be able to "move" messages to another folder.
Unfortunately this is not as simple as writing in a second linked mailbox, because apparently I can not edit some fields. Some critical fields l... | Working with Exchange mailboxes in MS Access can indeed be tricky, especially when dealing with read/write operations on certain fields. Since you cannot directly edit fields like "To" in the linked table and using `CreateObject("Outlook.Application")` prompts a security dialog, you'll have to explore alternative metho... | 11,081 | [
{
"from": "human",
"value": "I have an Exchange mailbox linked as a table in an MS Access app. This is primarily used for reading, but I would also like to be able to \"move\" messages to another folder. \nUnfortunately this is not as simple as writing in a second linked mailbox, because apparently I can ... |
I've created an implementation of the QAbstractListModel class in Qt Jambi 4.4 and am finding that using the model with a QListView results in nothing being displayed, however using the model with a QTableView displays the data correctly.
Below is my implementation of QAbstractListModel:
public class FooListModel exten... | The issue you're facing with your `QAbstractListModel` implementation likely stems from the lack of handling for the role used to retrieve the data in your model. When using `QListView`, it typically expects the `Qt.UserRole` or even specific roles like `Qt.DisplayRole` to properly display the data.
Here are a few thi... | 11,255 | [
{
"from": "human",
"value": "I've created an implementation of the QAbstractListModel class in Qt Jambi 4.4 and am finding that using the model with a QListView results in nothing being displayed, however using the model with a QTableView displays the data correctly.\nBelow is my implementation of QAbstract... |
I'd sort of like to use SQLite from within C#.Net, but I can't seem to find an appropriate library. Is there one? An official one? Are there other ways to use SQLite than with a wrapper?
| Yes, you can definitely use SQLite from within C#.NET, and there is a very popular and well-supported library that you can use: **System.Data.SQLite**. This library is an official ADO.NET provider for SQLite and is maintained by the SQLite team, providing a robust and reliable way to interact with SQLite databases in a... | 10,805 | [
{
"from": "human",
"value": "I'd sort of like to use SQLite from within C#.Net, but I can't seem to find an appropriate library. Is there one? An official one? Are there other ways to use SQLite than with a wrapper?\n"
},
{
"from": "gpt",
"value": "Yes, you can definitely use SQLite from within ... |
I'm using Webkit-sharp to embed Webkit into an application and I need to hook certain links to perform actions in my app rather than their normal action.
I've considered using Javascript to iterate over the anchor tags and replace the ones that match with the proper link, but I'm wondering if this is the best way. Is ... | When embedding WebKit with Webkit-sharp, intercepting link clicks to perform custom actions in your application can be effectively handled in a few different ways. Here are some preferred approaches:
### 1. **Using JavaScript to Intercept Clicks**
You can use JavaScript to attach event listeners to anchor tags (`<a>`)... | 11,020 | [
{
"from": "human",
"value": "I'm using Webkit-sharp to embed Webkit into an application and I need to hook certain links to perform actions in my app rather than their normal action.\nI've considered using Javascript to iterate over the anchor tags and replace the ones that match with the proper link, but I... |
Say I have a blogging app in Django. How can i re-order the posts using a draggable table in the default admin?
It would be best if i didn't have to add any extra fields to the model, but if i really have to i can.
| To implement draggable ordering of posts in the Django admin without adding extra fields to your model, you can utilize JavaScript along with Django's admin interface customization. However, to ensure that the order persists, you may need to use a field to store the order. Since you prefer not to add extra fields to th... | 8,108 | [
{
"from": "human",
"value": "Say I have a blogging app in Django. How can i re-order the posts using a draggable table in the default admin?\nIt would be best if i didn't have to add any extra fields to the model, but if i really have to i can.\n"
},
{
"from": "gpt",
"value": "To implement dragg... |
I have a self referencing Categories table. Each Category has a CategoryID, ParentCategoryID, CategoryName, etc. And each category can have any number of sub categories, and each of those sub categories can have any number of sub categories, and so and and so forth. So basically the tree can be X levels deep.
Then Prod... | When dealing with a self-referencing hierarchy in a database, it's common to encounter challenges related to recursion, especially when trying to retrieve all leaf nodes for a given category, and their associated products.
### Using LINQ to SQL
LINQ to SQL does not natively support recursive queries like some SQL data... | 8,753 | [
{
"from": "human",
"value": "I have a self referencing Categories table. Each Category has a CategoryID, ParentCategoryID, CategoryName, etc. And each category can have any number of sub categories, and each of those sub categories can have any number of sub categories, and so and and so forth. So basically... |
I am reading about COFF file formats, which is commonly used to create an executable file format (it has some variants also).
While reading, I came across the relocation section of the format. How is this relocation section used to create an executable file.
It would be very useful if you point me to some links which ... | COFF (Common Object File Format) is an object file format used for executables, object code, and shared libraries. One of the important components of COFF files is the relocation section, which plays a key role in creating executable files from object files.
### Purpose of the Relocation Section
When an object file i... | 10,173 | [
{
"from": "human",
"value": "I am reading about COFF file formats, which is commonly used to create an executable file format (it has some variants also). \nWhile reading, I came across the relocation section of the format. How is this relocation section used to create an executable file.\nIt would be very ... |
I need to store user entered changes to a particular table, but not show those changes until they have been viewed and approved by an administrative user. While those changes are still in a pending state, I would still display the old version of the data. What would be the best way of storing these changes waiting f... | Your requirement to manage pending changes with an approval process without needing to retain historical data can be effectively addressed using a PendingChanges table. Here’s a more structured approach to your proposed method:
### Structure of the PendingChanges Table
1. **ID**: Primary key to uniquely identify the c... | 8,608 | [
{
"from": "human",
"value": "I need to store user entered changes to a particular table, but not show those changes until they have been viewed and approved by an administrative user. While those changes are still in a pending state, I would still display the old version of the data. What would be the be... |
When a getter returns a property, such as returning a List of other related objects, should that list and it's objects be immutable to prevent code outside of the class, changing the state of those objects, without the main parent object knowing?
For example if a Contact object, has a getDetails getter, which returns a... | When designing classes in object-oriented programming, especially when dealing with collections and related objects, you need to consider encapsulation, data integrity, and the intended use of your objects. In the scenario you presented with a `Contact` object having a getter for a `List` of `ContactDetails`, you indee... | 9,847 | [
{
"from": "human",
"value": "When a getter returns a property, such as returning a List of other related objects, should that list and it's objects be immutable to prevent code outside of the class, changing the state of those objects, without the main parent object knowing?\nFor example if a Contact object... |
I have a bunch of reports that are printed out and mailed to clients. At the top of the report is the return address, left aligned. I was asked to add an optional logo to the report. This logo should be left of the return address. (The logo and all other info is stored in the database). So if the logo exists, you SHOUL... | In RDL (Report Definition Language) reports, if you're using a subreport to display a logo and want it to dynamically adjust its space based on whether the logo exists or not, you have a couple of options to achieve the desired result.
### Option 1: Conditional Visibility on the Subreport
1. **Set Up the Subreport**:... | 11,092 | [
{
"from": "human",
"value": "I have a bunch of reports that are printed out and mailed to clients. At the top of the report is the return address, left aligned. I was asked to add an optional logo to the report. This logo should be left of the return address. (The logo and all other info is stored in the da... |
My machine is seriously underpowered, and I think I need to start conserving every spare cycle. I know that my Gnome environment seems to underperform compared to my coworkers' KDE setups. But if I'm going to make that big of a switch, I might as well consider running something even lighter.
Is it possible to survive... | Yes, it's definitely possible to run a lightweight window manager and still use modern applications like Firefox, Eclipse, and OpenOffice. Many users on underpowered machines successfully use lightweight setups while maintaining productivity with modern software.
### Lightweight Window Managers
Here are a few good ca... | 9,294 | [
{
"from": "human",
"value": "My machine is seriously underpowered, and I think I need to start conserving every spare cycle. I know that my Gnome environment seems to underperform compared to my coworkers' KDE setups. But if I'm going to make that big of a switch, I might as well consider running somethin... |
I'm developping a small UML Class editor in Java, mainly a personal project, it might end up on SourceForge if I find the time to create a project on it.
The project is quite advanced : I can create classes, move them around, create interfaces, create links, etc.
What I'm working on is the dialog box for setting class/... | Hello Guillaume,
Your project sounds interesting, and it's clear that you're putting a lot of thought into the design! You're right to consider the implications of your design choices, especially in an object-oriented context. The issue you're facing is quite common when working with polymorphism and ensuring that you... | 10,302 | [
{
"from": "human",
"value": "I'm developping a small UML Class editor in Java, mainly a personal project, it might end up on SourceForge if I find the time to create a project on it.\nThe project is quite advanced : I can create classes, move them around, create interfaces, create links, etc.\nWhat I'm work... |
No C++ love when it comes to the "hidden features of" line of questions? Figured I would throw it out there. What are some of the hidden features of C++?
| C++ is a powerful and complex programming language with many features that are sometimes not well-known or appreciated. Here are some of the "hidden" or less commonly highlighted features of C++ that can significantly enhance your programming experience:
1. **RAII (Resource Acquisition Is Initialization)**:
- This ... | 7,161 | [
{
"from": "human",
"value": "No C++ love when it comes to the \"hidden features of\" line of questions? Figured I would throw it out there. What are some of the hidden features of C++?\n"
},
{
"from": "gpt",
"value": "C++ is a powerful and complex programming language with many features that a... |
A former coworker insisted that a database with more tables with fewer columns each is better than one with fewer tables with more columns each. For example rather than a customer table with name, address, city, state, zip, etc. columns, you would have a name table, an address table, a city table, etc.
He argued this ... | The design choice between using more tables with fewer columns versus fewer tables with more columns (also known as normalization versus denormalization) depends on various factors, including the specific use case, the nature of the data, and the expected queries. Let's explore the advantages and disadvantages of each ... | 8,331 | [
{
"from": "human",
"value": "A former coworker insisted that a database with more tables with fewer columns each is better than one with fewer tables with more columns each. For example rather than a customer table with name, address, city, state, zip, etc. columns, you would have a name table, an address ... |
Does anyone have a technique for generating SQL table create (and data insert) commands pragmatically from a CSV (or sheet in a .xls) file?
I've got a third party database system which I'd like to populate with data from a csv file (or sheet in a xls file) but the importer supplied can't create the table structure au... | To generate SQL table creation and data insertion commands from a CSV file (or a sheet in an XLS file), you can use a programming language like Python, which has libraries for handling both CSV and Excel files. Below are the steps to achieve this along with a sample code implementation.
### Steps to Generate SQL Comma... | 1,764 | [
{
"from": "human",
"value": "Does anyone have a technique for generating SQL table create (and data insert) commands pragmatically from a CSV (or sheet in a .xls) file? \nI've got a third party database system which I'd like to populate with data from a csv file (or sheet in a xls file) but the importer su... |
i wonder if there is a simple solution to change language of a wpf application during runtime. i used locbaml to globalize all the resources. Setting the Current Thread's UICulture in the App-constructor works fine, but when i try to chang it a little bit later, i doesn't reflect the changes anymore.
This was actually ... | Changing the language of a WPF application at runtime is indeed more complex than it was in WinForms. However, it can be done with some additional steps. Since you've already used LocBaml for globalization and set the `CurrentThread.UICulture` in the App constructor, you're on the right path.
Here's a general approach... | 10,652 | [
{
"from": "human",
"value": "i wonder if there is a simple solution to change language of a wpf application during runtime. i used locbaml to globalize all the resources. Setting the Current Thread's UICulture in the App-constructor works fine, but when i try to chang it a little bit later, i doesn't reflec... |
Can a firefox XPCOM component read and write page content across multiple pages?
Scenario:
A bunch of local HTML and javascript files. A "Main.html" file opens a window "pluginWindow", and creates a plugin using:
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var obj = Components.classes[ci... | In the context of Firefox and XPCOM (Cross Platform Component Object Model), the behavior you're encountering is primarily due to security restrictions that are in place to prevent unauthorized access to components across different contexts (like windows or tabs).
### Understanding the Error
When you receive the erro... | 10,752 | [
{
"from": "human",
"value": "Can a firefox XPCOM component read and write page content across multiple pages? \nScenario:\nA bunch of local HTML and javascript files. A \"Main.html\" file opens a window \"pluginWindow\", and creates a plugin using:\n\nnetscape.security.PrivilegeManager.enablePrivilege('Univ... |
I am trying to have a logout page where is displays a messages and then redirects to the login page. This is in ASP.net 2.0.
I have this in my Page_Load:
ClientScript.RegisterStartupScript(typeof(Page), "pageredirect", JavascriptRedirect() );
This is my redirect function:
private string JavascriptRedirect()
{
Stri... | In ASP.NET, the `Page_Load` event is indeed one of the early events in the page lifecycle, but there are a few considerations that might prevent your JavaScript from being registered correctly. Here's a checklist to help you troubleshoot and correct the issue:
1. **Ensure you're not doing a response end**: Make sure t... | 8,705 | [
{
"from": "human",
"value": "I am trying to have a logout page where is displays a messages and then redirects to the login page. This is in ASP.net 2.0.\nI have this in my Page_Load:\nClientScript.RegisterStartupScript(typeof(Page), \"pageredirect\", JavascriptRedirect() );\n\nThis is my redirect function:... |
C# question (.net 3.5). I have a class, ImageData, that has a field ushort[,] pixels. I am dealing with proprietary image formats. The ImageData class takes a file location in the constructor, then switches on file extension to determine how to decode. In several of the image files, there is a "bit depth" field in ... | In C#, you can handle different bit depths for pixel data by using either a polymorphic approach (with inheritance) or by using a more dynamic approach with a common interface or abstract class.
In your case, since you want to handle varying bit depths at runtime based on the data read from the file, a good option wou... | 9,961 | [
{
"from": "human",
"value": "C# question (.net 3.5). I have a class, ImageData, that has a field ushort[,] pixels. I am dealing with proprietary image formats. The ImageData class takes a file location in the constructor, then switches on file extension to determine how to decode. In several of the imag... |
Suppose I have fileA.h which declares a class classA with template function SomeFunc<T>(). This function is implemented directly in the header file (as is usual for template functions). Now I add a specialized implementation of SomeFunc() (like for SomeFunc<int>()) in fileA.C (ie. not in the header file).
If I now call... | The situation you're encountering with template specialization in C++ can indeed lead to confusion, particularly regarding the linkage and visibility of specialized templates when they're defined in separate translation units (like your `.C` file).
### Understanding Template Specialization
1. **Generic Template Funct... | 7,803 | [
{
"from": "human",
"value": "Suppose I have fileA.h which declares a class classA with template function SomeFunc<T>(). This function is implemented directly in the header file (as is usual for template functions). Now I add a specialized implementation of SomeFunc() (like for SomeFunc<int>()) in fileA.C (i... |
I am in a position where I could become a team leader of a team distributed over two countries. This team would be the tech. team for a start up company that we plan to bootstrap on limited funds. So I am trying to find out ways to minimize upfront expenses. Right now we are planning to use Java and will have a lot ... | Absolutely! There are several Continuous Integration (CI) services available in a Software as a Service (SaaS) model that can help you manage your CI/CD pipeline without the need for substantial upfront investment. Here are some popular options that integrate well with GitHub:
1. **GitHub Actions**: This is a powerful... | 11,990 | [
{
"from": "human",
"value": "I am in a position where I could become a team leader of a team distributed over two countries. This team would be the tech. team for a start up company that we plan to bootstrap on limited funds. So I am trying to find out ways to minimize upfront expenses. Right now we are ... |
After making some comments, I've been inspired to get some feedback on the PHP MVC framework PRADO. I've been using it for over a year now and I've very much enjoyed working with it, however I notice that throughout Stack Overflow, it doesn't seem to rate a mention when symfony or CakePHP are being talked about as pote... | PRADO is a lesser-known PHP MVC framework compared to more popular frameworks like Symfony or CakePHP, which could explain its limited presence in discussions on platforms like Stack Overflow. Here are some insights into its strengths, weaknesses, and how it compares to Symfony and CakePHP:
### Strengths of PRADO
1. ... | 9,091 | [
{
"from": "human",
"value": "After making some comments, I've been inspired to get some feedback on the PHP MVC framework PRADO. I've been using it for over a year now and I've very much enjoyed working with it, however I notice that throughout Stack Overflow, it doesn't seem to rate a mention when symfony ... |
I've seen several question on here about exceptions, and some of them hint at interrupts as exceptions, but none make the connection clear.
What is an interrupt?
What is an exception? (please explain what exceptions are for each language you know, as there are some differences)
When is an exception an interrupt and vi... | To understand the concepts of interrupts and exceptions, it’s helpful to start with their definitions and roles in computer systems, as well as how they are treated in various programming languages. Let’s break these concepts down:
### What is an Interrupt?
An **interrupt** is a signal to the processor emitted by har... | 10,232 | [
{
"from": "human",
"value": "I've seen several question on here about exceptions, and some of them hint at interrupts as exceptions, but none make the connection clear.\n\nWhat is an interrupt?\nWhat is an exception? (please explain what exceptions are for each language you know, as there are some differenc... |
I have the following scenario:
public class CarManager
{
..
public long AddCar(Car car)
{
try
{
string username = _authorizationManager.GetUsername();
...
long id = _carAccessor.AddCar(username, car.Id, car.Name, ....);
if(id == 0)
{
throw ne... | When designing unit tests, it's important to follow best practices for both coverage and maintainability. Let's discuss your approach and the structure of your tests for the `CarManager` class, specifically focusing on `AddCar()` and `AddCars()` methods.
### Testing `AddCar()`
You are correct in thinking that `AddCar... | 11,414 | [
{
"from": "human",
"value": "I have the following scenario:\n\npublic class CarManager\n{\n ..\n\n public long AddCar(Car car)\n {\n try\n {\n string username = _authorizationManager.GetUsername();\n ...\n long id = _carAccessor.AddCar(username, car.Id, car.Name, ....);\... |
Linux/Gcc/LD - Toolchain.
I would like to remove STL/Boost debug symbols from libraries and executable, for two reasons:
Linking gets very slow for big programs
Debugging jumps into stl/boost code, which is annoying
For 1. incremental linking would be a big improvement, but AFAIK ld does not support incremental linki... | To remove STL and Boost debug symbols from libraries and executables while keeping other debug symbols intact, you can follow a more targeted approach using the `strip` command combined with custom linker options. Here’s how to achieve your goals:
### Step 1: Use Custom Compiler Flags
When compiling your code, you ca... | 9,481 | [
{
"from": "human",
"value": "Linux/Gcc/LD - Toolchain.\nI would like to remove STL/Boost debug symbols from libraries and executable, for two reasons:\n\nLinking gets very slow for big programs\nDebugging jumps into stl/boost code, which is annoying\n\nFor 1. incremental linking would be a big improvement, ... |
I'm trying to use the tree command in a windows commandline to generate a text file listing the contents of a directory but when I pipe the output the unicode characters get stuffed up.
Here is the command I am using:
tree /f /a > output.txt
The results in the console window are fine:
\---Erika szobája
cover.... | The issue you're encountering is due to the way Windows handles Unicode characters in the command prompt and the output redirection to a text file. The `tree` command outputs text in the console using a specific character encoding, but when you redirect that output to a file, it uses a different encoding, leading to ga... | 12,075 | [
{
"from": "human",
"value": "I'm trying to use the tree command in a windows commandline to generate a text file listing the contents of a directory but when I pipe the output the unicode characters get stuffed up.\nHere is the command I am using:\ntree /f /a > output.txt\n\nThe results in the console windo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.