instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I'd like to create a script that will configure the Visual Studio IDE the way I like it. Nothing vastly complicated, just a few Tools/Options settings, adding some External Tools, that kind of thing.
I know that this can be done inside VS with Import/Export Settings, but I'd like to be able to automate it from outside... | Automating the configuration of Visual Studio IDE settings from outside of the IDE is indeed possible, although it requires some manual setup since Visual Studio does not have a built-in command-line utility for this specific purpose. Below are a couple of approaches you could take:
### 1. Modify CurrentSettings.vsset... | 4,725 | [
{
"from": "human",
"value": "I'd like to create a script that will configure the Visual Studio IDE the way I like it. Nothing vastly complicated, just a few Tools/Options settings, adding some External Tools, that kind of thing. \nI know that this can be done inside VS with Import/Export Settings, but I'd l... |
After reading this answer, I wonder if there's a way to get a "testing" credit card number. One that you can experiment with but that doesn't actually charge anything.
| Yes, there are several ways to obtain "testing" credit card numbers that you can use for experimentation and development purposes. Many payment gateways and APIs provide specific test card numbers that will not result in actual charges. Here are a few options:
1. **Payment Gateway Documentation**: Most payment process... | 7,524 | [
{
"from": "human",
"value": "After reading this answer, I wonder if there's a way to get a \"testing\" credit card number. One that you can experiment with but that doesn't actually charge anything.\n"
},
{
"from": "gpt",
"value": "Yes, there are several ways to obtain \"testing\" credit card n... |
I'd like to ask a question then follow it up with my own answer, but also see what answers other people have.
We have two large files which we'd like to read from two separate threads concurrently. One thread will sequentially read fileA while the other thread will sequentially read fileB. There is no locking or comm... | It sounds like you're encountering a classic example of disk contention due to multiple threads trying to read from separate files on the same physical storage medium. The operating system's disk scheduler seems to struggle with the multiple seeks required for your dual-threaded approach, leading to significantly reduc... | 5,718 | [
{
"from": "human",
"value": "I'd like to ask a question then follow it up with my own answer, but also see what answers other people have.\nWe have two large files which we'd like to read from two separate threads concurrently. One thread will sequentially read fileA while the other thread will sequentiall... |
With a distributed application, where you have lots of clients and one main server, should you:
Make the clients dumb and the server smart: clients are fast and non-invasive. Business rules are needed in only 1 place
Make the clients smart and the server dumb: take as much load as possible off of the server
Additiona... | In the scenario you've described, it is generally more effective to **make the clients dumb and the server smart**. Here's the reasoning behind this approach:
### Advantages of a Dumb Client / Smart Server Architecture:
1. **Centralized Business Logic**: Having the business rules and logic centralized in the server a... | 6,994 | [
{
"from": "human",
"value": "With a distributed application, where you have lots of clients and one main server, should you:\n\nMake the clients dumb and the server smart: clients are fast and non-invasive. Business rules are needed in only 1 place\nMake the clients smart and the server dumb: take as much l... |
I'm using the following html to load dojo from Google's hosting.
<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript">google.load("dojo", "1.1.1");</script>
<script type="text/javascript">
dojo.require("dojox.gfx");
...
This errors out on the requre line with an error like dojox.gfx is un... | The issue you're encountering arises because the version of Dojo you're trying to load (1.1.1) does not have the `dojox` namespace defined. The `dojox` extensions were added in later versions of the Dojo Toolkit. To resolve this, you need to load a more recent version of Dojo that includes the `dojox` namespace.
Here ... | 6,050 | [
{
"from": "human",
"value": "I'm using the following html to load dojo from Google's hosting.\n<script src=\"http://www.google.com/jsapi\"></script>\n<script type=\"text/javascript\">google.load(\"dojo\", \"1.1.1\");</script>\n<script type=\"text/javascript\">\ndojo.require(\"dojox.gfx\");\n...\n\nThis erro... |
I want to download this open source application, and they are using Git. What do I need to download the code base?
Update
How do I change the working directory when I am using Git Bash? (I want to download the repo at a certain directory, using pwd tells me I will be downloading the repo where I don't want it.
| To download an open source application using Git, you need to follow these steps:
### Downloading the Code Base
1. **Install Git**: If you haven't already installed Git, download it from [git-scm.com](https://git-scm.com/) and follow the installation instructions for your operating system.
2. **Open Git Bash**: Once... | 8,311 | [
{
"from": "human",
"value": "I want to download this open source application, and they are using Git. What do I need to download the code base?\nUpdate\nHow do I change the working directory when I am using Git Bash? (I want to download the repo at a certain directory, using pwd tells me I will be downloa... |
I'd like to have a TabNavigator component that has a close button for some of the tabs. How do I do that?
It seems that the TabNavigator component does not allow (or I could not find) extensibility of this form.
Help. Thanks
| To create a `TabNavigator` component that includes close buttons for some of the tabs, you'll likely want to extend the functionality of a typical tab navigator. Most popular libraries like React Navigation do not directly support close buttons on tabs out of the box, but you can achieve this by customizing the tab bar... | 5,629 | [
{
"from": "human",
"value": "I'd like to have a TabNavigator component that has a close button for some of the tabs. How do I do that? \nIt seems that the TabNavigator component does not allow (or I could not find) extensibility of this form.\nHelp. Thanks\n"
},
{
"from": "gpt",
"value": "To c... |
Is there a way to detect if a flash movie contains any sound or is playing any music?
It would be nice if this could be done inside a webbrowser (actionscript from another flash object, javascript,..) and could be done before the flash movie starts playing.
However, I have my doubts this will be possible altogether, so... | Detecting if a Flash movie (SWF file) contains sound or music before it starts playing can be quite challenging due to the limitations of the technologies involved. However, there are a few approaches you can consider:
### 1. **Using External Tools or Libraries:**
If you have access to the SWF file before it is embedd... | 2,419 | [
{
"from": "human",
"value": "Is there a way to detect if a flash movie contains any sound or is playing any music?\nIt would be nice if this could be done inside a webbrowser (actionscript from another flash object, javascript,..) and could be done before the flash movie starts playing.\nHowever, I have my ... |
I want to debug an application in Visual Studio but I ONLY have the source code for 1 class. I only need to step through a single function in that file, but I don't understand what I need to do it. I think the steps are normally something like this:
Open a file in VS
Load in the "symbols" (.PDB file)
Attach to the r... | Yes, you can generate the .PDB (Program Database) file for your class by building the project that contains it. The .PDB file contains debugging information, including the symbols necessary for stepping through the code in a debugger like Visual Studio. Here’s how you can generate the .PDB file and use it to debug the ... | 7,400 | [
{
"from": "human",
"value": "I want to debug an application in Visual Studio but I ONLY have the source code for 1 class. I only need to step through a single function in that file, but I don't understand what I need to do it. I think the steps are normally something like this:\n\nOpen a file in VS\nLoad ... |
While working on a tool that allows to exchange images of several third-party applications and thus creating individual "skins" for those applications, I have stumbled across a jpg-format about which I cannot seem to find any decent informations.
When looking at it in a hex-editor, it starts with the tag "CF10". Search... | The "CF10" tag you are encountering at the beginning of your JPEG file suggests that it is not a standard JPEG format. Instead, it is likely that this file is using a proprietary or specific format that incorporates JPEG compression or data, but with additional metadata or a different structure.
The "CF10" header is i... | 7,631 | [
{
"from": "human",
"value": "While working on a tool that allows to exchange images of several third-party applications and thus creating individual \"skins\" for those applications, I have stumbled across a jpg-format about which I cannot seem to find any decent informations.\nWhen looking at it in a hex-e... |
A common task in programs I've been working on lately is modifying a text file in some way. (Hey, I'm on Linux. Everything's a file. And I do large-scale system admin.)
But the file the code modifies may not exist on my desktop box. And I probably don't want to modify it if it IS on my desktop.
I've read about unit tes... | Your approach to testing file modifications in a controlled environment is quite reasonable. It is common to use temporary files for unit testing, especially when dealing with file I/O. However, there are ways to make this process cleaner and more efficient, while also avoiding potential issues with file access and sta... | 7,065 | [
{
"from": "human",
"value": "A common task in programs I've been working on lately is modifying a text file in some way. (Hey, I'm on Linux. Everything's a file. And I do large-scale system admin.)\nBut the file the code modifies may not exist on my desktop box. And I probably don't want to modify it if it ... |
I have a couple old services that I want to completely uninstall. How can I do this?
| To completely uninstall old services from your system, the process can vary slightly depending on your operating system. Below are instructions for uninstalling services on both Windows and Linux systems.
### Windows
1. **Stop the Service**:
- Open the Command Prompt as Administrator. You can search for `cmd`, rig... | 8,265 | [
{
"from": "human",
"value": "I have a couple old services that I want to completely uninstall. How can I do this?\n"
},
{
"from": "gpt",
"value": "To completely uninstall old services from your system, the process can vary slightly depending on your operating system. Below are instructions for u... |
I work a lot with network and serial communications software, so it is often necessary for me to have code to display or log hex dumps of data packets.
Every time I do this, I write yet another hex-dump routine from scratch. I'm about to do so again, but figured I'd ask here: Is there any good free hex dump code for ... | Certainly! Below is a simple hex dump utility in C++ that meets your requirements. You can easily drop it into your project. It provides the functionality for configurable bytes per line, optional ASCII/UTF8 output, customizable indentation, and per-line prefixes/suffixes. It is designed to minimize dependencies and ca... | 4,663 | [
{
"from": "human",
"value": "I work a lot with network and serial communications software, so it is often necessary for me to have code to display or log hex dumps of data packets.\nEvery time I do this, I write yet another hex-dump routine from scratch. I'm about to do so again, but figured I'd ask here: ... |
Update: giving a much more thorough example.
The first two solutions offered were right along the lines of what I was trying to say not to do. I can't know location, it needs to be able to look at the whole document tree. So a solution along these lines, with /Books/ specified as the context will not work:
SELECT x.q... | To achieve the desired output by filtering the XML document based on the presence or value of a particular attribute while maintaining the original structure, we can utilize the XQuery capabilities of SQL Server. However, since SQL Server 2005 does not support advanced XQuery functions directly, we will approach this b... | 6,022 | [
{
"from": "human",
"value": "Update: giving a much more thorough example.\nThe first two solutions offered were right along the lines of what I was trying to say not to do. I can't know location, it needs to be able to look at the whole document tree. So a solution along these lines, with /Books/ specifie... |
I have a custom component where I have implemented
INotifyPropertyChanged and IBindableComponent.
However, when I try to databind a property, the designer adds this
line:
this.component11.TestString =
global::WindowsFormsApplication2.Properties.Settings.Default.Setting;
instead of creating a binding as it does with a ... | The behavior you're observing with the designer not generating the binding code for your custom component is indeed rooted in a few specific design considerations in how Windows Forms and the designer treat controls and components.
### Key Considerations:
1. **Component vs. Control**:
- Your custom component deri... | 7,241 | [
{
"from": "human",
"value": "I have a custom component where I have implemented\nINotifyPropertyChanged and IBindableComponent.\nHowever, when I try to databind a property, the designer adds this\nline:\nthis.component11.TestString =\nglobal::WindowsFormsApplication2.Properties.Settings.Default.Setting;\n\n... |
If I have a separate system with its own concept of users and presence, what is the most appropriate architecture for creating a bridge to an XMPP server network? As far as I can tell there are three primary ways:
Act as a server. This creates one touchpoint, but I fear it has implications for compatibility, and pot... | Creating a bridge between your separate system and an XMPP server network involves trade-offs depending on the desired scalability, complexity, and maintenance overhead. Let's discuss the three approaches you mentioned along with their pros and cons:
### 1. **Act as an XMPP Server**
In this architecture, your system ... | 6,567 | [
{
"from": "human",
"value": "If I have a separate system with its own concept of users and presence, what is the most appropriate architecture for creating a bridge to an XMPP server network? As far as I can tell there are three primary ways:\n\nAct as a server. This creates one touchpoint, but I fear it ... |
How can i add a line break to the text area in a html page?
i use VB.net for server side coding.
| To add a line break in a text area on an HTML page, you generally use the `<textarea>` element in HTML. For displaying multiline text, users can manually enter line breaks by pressing the Enter key. However, if you want to add line breaks programmatically (e.g., from your VB.NET server-side code), you need to ensure th... | 7,307 | [
{
"from": "human",
"value": "How can i add a line break to the text area in a html page?\ni use VB.net for server side coding.\n"
},
{
"from": "gpt",
"value": "To add a line break in a text area on an HTML page, you generally use the `<textarea>` element in HTML. For displaying multiline text, u... |
I am working on a project with peek performance requirements, so we need to bulk (batch?) several operations (for example persisting the data to a database) for efficiency.
However, I want our code to maintain an easy to understand flow, like:
input = Read();
parsed = Parse(input);
if (parsed.Count > 10)
{
status = ... | To achieve your requirement of having a bulk/persistent operation that behaves as if it's synchronous while running asynchronously under the hood, you can use a combination of `Task` and a `SemaphoreSlim` to control access and manage the concurrency. Here's a simplified approach that aligns with your original code stru... | 6,848 | [
{
"from": "human",
"value": "I am working on a project with peek performance requirements, so we need to bulk (batch?) several operations (for example persisting the data to a database) for efficiency.\nHowever, I want our code to maintain an easy to understand flow, like:\ninput = Read();\nparsed = Parse(i... |
This is from an example accompanying the agsXMPP .Net assembly. I've read up on delegates, but am not sure how that fits in with this line of code (which waits for the logon to occur, and then sends a message. I guess what I'm looking for is an understanding of why delegate(0) accomplishes this, in the kind of simple... | Certainly! Let's break down the line of code you provided and explain how delegates work in this context.
### Understanding Delegates
In C#, a **delegate** is essentially a reference to a method. It allows you to define a callback mechanism where a method can be called in response to an event happening. In simpler te... | 8,262 | [
{
"from": "human",
"value": "This is from an example accompanying the agsXMPP .Net assembly. I've read up on delegates, but am not sure how that fits in with this line of code (which waits for the logon to occur, and then sends a message. I guess what I'm looking for is an understanding of why delegate(0)... |
I want the following layout to appear on the screen:
FieldName 1 [Field input 1]
FieldName 2 is longer [Field input 2]
. .
. .
FieldName N [Field input N]
Requirements:
Field names and field inputs must align on the left edges
Both colu... | You can achieve the desired layout using CSS flexbox, which allows you to create a responsive and aligned layout without using tables. Below is an example of how you can implement this using HTML and CSS:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="widt... | 7,808 | [
{
"from": "human",
"value": "I want the following layout to appear on the screen:\nFieldName 1 [Field input 1]\nFieldName 2 is longer [Field input 2]\n . .\n . .\nFieldName N [Field input N]\n\nRequirements:\n\nField names and f... |
I noticed that Google maps is providing directions in my local language (hungarian) when I am using google chrome, but English language directions when I am using it from IE.
I would like to know how chrome figures this out and how can I write code that is always returning directions on the user's language.
| Google Maps and many other web applications often use the browser's language settings to determine the preferred language for content, including directions. Browsers typically provide a way for users to specify their preferred languages, and web applications can access these settings to adjust their output accordingly.... | 3,924 | [
{
"from": "human",
"value": "I noticed that Google maps is providing directions in my local language (hungarian) when I am using google chrome, but English language directions when I am using it from IE. \nI would like to know how chrome figures this out and how can I write code that is always returning dir... |
I've been using make and makefiles for many many years, and although the concept
is sound, the implementation has something to be desired.
Has anyone found any good alternatives to make that don't overcomplicate
the problem?
| Yes, there are several alternatives to `make` that can simplify building and managing projects without the complexity that some users find in `makefiles`. Here are a few notable ones:
1. **CMake**: While it can be complex for larger projects, CMake is widely used and offers a more user-friendly syntax than traditional... | 7,342 | [
{
"from": "human",
"value": "I've been using make and makefiles for many many years, and although the concept\nis sound, the implementation has something to be desired.\nHas anyone found any good alternatives to make that don't overcomplicate\nthe problem?\n"
},
{
"from": "gpt",
"value": "Yes, t... |
In a Visual Studio SQL Server Database project, how can you resolve the errors associated with linked server references within the project?
| When working with a Visual Studio SQL Server Database project, you might encounter errors associated with linked server references if those linked servers are not properly defined in the project. Here are steps to resolve those errors:
1. **Define Linked Servers in Project Settings:**
- Go to the project in Visual ... | 8,687 | [
{
"from": "human",
"value": "In a Visual Studio SQL Server Database project, how can you resolve the errors associated with linked server references within the project?\n"
},
{
"from": "gpt",
"value": "When working with a Visual Studio SQL Server Database project, you might encounter errors asso... |
I have a .tag file that requires a JavaScript library (as in a .js file).
Currently I am just remembering to import the .js file in every JSP that uses the tag but this is a bit cumbersome and prone to error.
Is there a way to do the importing of the .js inside the JSP tag?
(for caching reasons I would want the .js to ... | Yes, you can manage JavaScript imports within your custom JSP tag by including the necessary script tags in the tag file itself. However, JSP tags don’t directly allow you to embed HTML or JavaScript like you would in a regular JSP page, but you can utilize a few tricks to ensure that the JavaScript file is included co... | 7,948 | [
{
"from": "human",
"value": "I have a .tag file that requires a JavaScript library (as in a .js file).\nCurrently I am just remembering to import the .js file in every JSP that uses the tag but this is a bit cumbersome and prone to error.\nIs there a way to do the importing of the .js inside the JSP tag?\n(... |
What is the purpose of the code behind view file in ASP.NET MVC besides setting of the generic parameter of ViewPage ?
| In ASP.NET MVC, the code-behind file for a view (typically a `.cshtml` file) serves several important purposes beyond just setting the generic parameter of `ViewPage`. Here are some key purposes:
1. **Strongly Typed Models**: The code-behind allows you to define a strongly typed model for the view. By setting the mode... | 8,878 | [
{
"from": "human",
"value": "What is the purpose of the code behind view file in ASP.NET MVC besides setting of the generic parameter of ViewPage ?\n"
},
{
"from": "gpt",
"value": "In ASP.NET MVC, the code-behind file for a view (typically a `.cshtml` file) serves several important purposes beyo... |
I'd like to convert a Parallels Virtual Machine image on my mac into an image usable by Virtual PC 2007. Does anyone know how to do that, or if it is possible?
| Converting a Parallels Virtual Machine (VM) image to a format usable by Virtual PC 2007 can be a bit of a process, but it is possible. Below are steps you can follow to achieve this:
### Step 1: Export the Parallels VM
1. Open Parallels Desktop on your Mac.
2. Select the VM you want to convert and go to the **File** m... | 7,025 | [
{
"from": "human",
"value": "I'd like to convert a Parallels Virtual Machine image on my mac into an image usable by Virtual PC 2007. Does anyone know how to do that, or if it is possible?\n"
},
{
"from": "gpt",
"value": "Converting a Parallels Virtual Machine (VM) image to a format usable by V... |
I have a History Table in SQL Server that basically tracks an item through a process. The item has some fixed fields that don't change throughout the process, but has a few other fields including status and Id which increment as the steps of the process increase.
Basically I want to retrieve the last step for each item... | To achieve your goal of retrieving the last step for each item given a specific `BatchRef`, you can use a common table expression (CTE) or a subquery along with the `ROW_NUMBER()` function. This allows you to rank each step for an item and then select only the last step.
Here's how you can do it with a CTE:
```sql
WI... | 9,134 | [
{
"from": "human",
"value": "I have a History Table in SQL Server that basically tracks an item through a process. The item has some fixed fields that don't change throughout the process, but has a few other fields including status and Id which increment as the steps of the process increase.\nBasically I wa... |
My last couple of projects have involved websites that sell a product/service and require a 'checkout' process in which users put in their credit card information and such. Obviously we got SSL certificates for the security of it plus giving peace of mind to the customers. I am, however, a little clueless as to the sub... | Using HTTPS for your website is an important aspect of modern web security, and it's wise to consider how to implement it properly. Here are some insights on the subtleties of using SSL certificates and the implications of using HTTPS throughout your site:
### 1. **Full Website vs. Specific Pages:**
- **Full Websit... | 7,607 | [
{
"from": "human",
"value": "My last couple of projects have involved websites that sell a product/service and require a 'checkout' process in which users put in their credit card information and such. Obviously we got SSL certificates for the security of it plus giving peace of mind to the customers. I am,... |
I want to implement search functionality for a website (assume it is similar to SO). I don't want to use Google search of stuff like that.
My question is:
How do I implement this?
There are two methods I am aware of:
Search all the databases in the application when the user gives his query.
Index all the data I have a... | Implementing a search functionality for a website similar to Stack Overflow requires careful consideration of your requirements, the volume of data, and the expected search performance. You’ve outlined two common approaches, and I’ll provide insights into each along with their pros and cons. Additionally, I’ll discuss ... | 4,422 | [
{
"from": "human",
"value": "I want to implement search functionality for a website (assume it is similar to SO). I don't want to use Google search of stuff like that.\nMy question is:\nHow do I implement this?\nThere are two methods I am aware of:\n\nSearch all the databases in the application when the use... |
What are the other types of database systems out there. I've recently came across couchDB that handles data in a non relational way. It got me thinking about what other models are other people is using.
So, I want to know what other types of data model is out there. (I'm not looking for any specifics, just want to look... | There are several types of database systems and data models that cater to different use cases and requirements. Here's a list of some of the prominent types beyond what you've mentioned:
1. **Column-Family Stores**: These databases store data in columns rather than rows, optimizing for read and write operations on lar... | 7,106 | [
{
"from": "human",
"value": "What are the other types of database systems out there. I've recently came across couchDB that handles data in a non relational way. It got me thinking about what other models are other people is using.\nSo, I want to know what other types of data model is out there. (I'm not lo... |
I'm building an HTML UI with some text elements, such as tab names, which look bad when selected. Unfortunately, it's very easy for a user to double-click a tab name, which selects it by default in many browsers.
I might be able to solve this with a JavaScript trick (I'd like to see those answers, too) -- but I'm reall... | To prevent text selection in your HTML UI for tab names (or any other text elements), you can use CSS to disable text selection. This approach works consistently across most modern browsers. Here's how you can do it:
### CSS Solution
You can use the following CSS rule to prevent text selection:
```css
.no-select {
... | 6,957 | [
{
"from": "human",
"value": "I'm building an HTML UI with some text elements, such as tab names, which look bad when selected. Unfortunately, it's very easy for a user to double-click a tab name, which selects it by default in many browsers.\nI might be able to solve this with a JavaScript trick (I'd like t... |
Currently, if I want to output a SQL script for a table in my database, in Management Studio, I can right click and output a create script.
Is there an equivalent to output an SQL script for a database's maintenance plan?#
Edit
The company I work for has 4 servers, 3 servers and no sign of integration, each one runn... | In SQL Server Management Studio (SSMS), while you can easily generate scripts for tables, there isn't a direct option to generate a script for an entire maintenance plan in the same way. However, there are ways to script out the maintenance plans through the use of SQL Server Management Objects (SMO) or by using T-SQL ... | 4,750 | [
{
"from": "human",
"value": "Currently, if I want to output a SQL script for a table in my database, in Management Studio, I can right click and output a create script. \nIs there an equivalent to output an SQL script for a database's maintenance plan?#\nEdit\nThe company I work for has 4 servers, 3 serve... |
I have heard using PDB files can help diagnose where a crash occurred.
My basic understanding is that you give Visual studio the source file, the pdb file and the crash information (from Dr Watson?)
Can someone please explain how it all works / what is involved?
(Thank you!)
| Certainly! Using Program Database (PDB) files in conjunction with crash information can be invaluable for diagnosing crashes in applications. Here's a breakdown of how this works:
### 1. What is a PDB File?
A PDB file is generated by compilers when you build your application in a debug configuration. It contains debu... | 6,075 | [
{
"from": "human",
"value": "I have heard using PDB files can help diagnose where a crash occurred.\nMy basic understanding is that you give Visual studio the source file, the pdb file and the crash information (from Dr Watson?)\nCan someone please explain how it all works / what is involved?\n(Thank you!)\... |
I've been doing some HTML scraping in PHP using regular expressions. This works, but the result is finicky and fragile. Has anyone used any packages that provide a more robust solution? A config driven solution would be ideal, but I'm not picky.
| Using regular expressions for HTML scraping can be challenging because HTML is not a regular language, and therefore regex can struggle with nested tags or varying structures. For a more robust solution, consider using a dedicated HTML parsing library in PHP. Here are a few popular options:
1. **DOMDocument**:
This... | 3,776 | [
{
"from": "human",
"value": "I've been doing some HTML scraping in PHP using regular expressions. This works, but the result is finicky and fragile. Has anyone used any packages that provide a more robust solution? A config driven solution would be ideal, but I'm not picky.\n"
},
{
"from": "gpt",... |
In most C or C++ environments, there is a "debug" mode and a "release" mode compilation.
Looking at the difference between the two, you find that the debug mode adds the debug symbols (often the -g option on lots of compilers) but it also disables most optimizations.
In "release" mode, you usually have all sorts of opt... | The difference between "debug" mode and "release" mode in C and C++ compilation is primarily driven by the intended use of the resulting binary, which affects both debugging capability and performance.
### Debug Mode
1. **Debug Symbols**: In debug mode, the compiler includes debug symbols in the binary. These symbols... | 6,553 | [
{
"from": "human",
"value": "In most C or C++ environments, there is a \"debug\" mode and a \"release\" mode compilation.\nLooking at the difference between the two, you find that the debug mode adds the debug symbols (often the -g option on lots of compilers) but it also disables most optimizations.\nIn \"... |
I have been sick and tired Googling the solution for doing case-insensitive search on Sybase ASE (Sybase data/column names are case sensitive). The Sybase documentation proudly says that there is only one way to do such search which is using the Upper and Lower functions, but the adage goes, it has performance problems... | When you're dealing with case sensitivity in Sybase ASE and need to perform case-insensitive searches without resorting to the `UPPER` or `LOWER` functions (which indeed can lead to performance issues), there are a few strategies you could consider:
1. **Use Collation**: If you're on a version of Sybase that supports ... | 6,116 | [
{
"from": "human",
"value": "I have been sick and tired Googling the solution for doing case-insensitive search on Sybase ASE (Sybase data/column names are case sensitive). The Sybase documentation proudly says that there is only one way to do such search which is using the Upper and Lower functions, but th... |
I have a DTS package with a data transformation task (data pump). I’d like to source the data with the results of a stored procedure that takes parameters, but DTS won’t preview the result set and can’t define the columns in the data transformation task.
Has anyone gotten this to work?
Caveat: The stored procedure us... | Using a stored procedure as a source for a Data Transformation Services (DTS) package can be tricky, especially when the stored procedure involves temporary tables. DTS does have limitations when it comes to previewing result sets from stored procedures, particularly if the result set is generated dynamically or if the... | 6,072 | [
{
"from": "human",
"value": "I have a DTS package with a data transformation task (data pump). I’d like to source the data with the results of a stored procedure that takes parameters, but DTS won’t preview the result set and can’t define the columns in the data transformation task.\nHas anyone gotten this... |
Has anybody got any kind of experience with dynamic programming using WCF. By dynamic programming I mean runtime consumption of WSDL's.
I have found one blog entry/tool:
http://blogs.msdn.com/vipulmodi/archive/2006/11/16/dynamic-programming-with-wcf.aspx
Has anybody here found good tools for this?
| Dynamic programming with WCF (Windows Communication Foundation) can be a bit challenging, especially when it comes to consuming WSDL (Web Services Description Language) at runtime. This is because WCF typically relies on generating client proxies at compile time. However, there are some tools and libraries that can hel... | 6,586 | [
{
"from": "human",
"value": "Has anybody got any kind of experience with dynamic programming using WCF. By dynamic programming I mean runtime consumption of WSDL's.\nI have found one blog entry/tool:\nhttp://blogs.msdn.com/vipulmodi/archive/2006/11/16/dynamic-programming-with-wcf.aspx\nHas anybody here foun... |
I'm compiling a simple .c in visual c++ with Compile as C Code (/TC)
and i get this compiler error
error C2143: syntax error : missing ';' before 'type'
on a line that calls for a simple struct
struct foo test;
same goes for using the typedef of the struct.
error C2275: 'FOO' : illegal use of this type as an exp... | The errors you are encountering suggest that there may be a problem with how you are defining your struct or using it in your C code. Here are a few common reasons why these errors might occur, along with suggestions on how to resolve them.
### Common Issues and Solutions
1. **Typedef Declaration**:
Make sure you ... | 4,085 | [
{
"from": "human",
"value": "I'm compiling a simple .c in visual c++ with Compile as C Code (/TC)\nand i get this compiler error \n\nerror C2143: syntax error : missing ';' before 'type'\n\non a line that calls for a simple struct \n struct foo test;\n\nsame goes for using the typedef of the struct.\n\nerro... |
I'm writing a Spring web application that requires users to login. My company has an Active Directory server that I'd like to make use of for this purpose. However, I'm having trouble using Spring Security to connect to the server.
I'm using Spring 2.5.5 and Spring Security 2.0.3, along with Java 1.6.
If I change the... | It looks like you're trying to set up LDAP authentication using Spring Security with an Active Directory server. Let's go through your configuration step by step and identify possible issues.
### Configuration Review
1. **LDAP URL**: Ensure that the LDAP URL is correct and reachable. You mentioned that changing the L... | 4,335 | [
{
"from": "human",
"value": "I'm writing a Spring web application that requires users to login. My company has an Active Directory server that I'd like to make use of for this purpose. However, I'm having trouble using Spring Security to connect to the server.\nI'm using Spring 2.5.5 and Spring Security 2... |
I'm working on an app that requires no user input, but I don't want the iPhone to enter the power saving mode.
Is it possible to disable power saving from an app?
| No, it is not possible for an app to disable power saving mode on an iPhone. Apple has strict guidelines and restrictions when it comes to managing system-level features, including power management settings.
However, you can prevent the screen from dimming or the device from sleeping while your app is in use by using... | 10,456 | [
{
"from": "human",
"value": "I'm working on an app that requires no user input, but I don't want the iPhone to enter the power saving mode.\nIs it possible to disable power saving from an app?\n"
},
{
"from": "gpt",
"value": "No, it is not possible for an app to disable power saving mode on an i... |
I am trying to implement NTLM authentication on one of our internal sites and everything is working. The one piece of the puzzle I do not have is how to take the information from NTLM and authenticate with Active Directory.
There is a good description of NTLM and the encryption used for the passwords, which I used to i... | It sounds like you've made significant progress in implementing NTLM authentication for your internal site using the JCIFS library. As you've noted, JCIFS is primarily focused on NTLMv1, and while it may work for your current needs, many environments are moving towards NTLMv2 or Kerberos for enhanced security.
Below, ... | 4,713 | [
{
"from": "human",
"value": "I am trying to implement NTLM authentication on one of our internal sites and everything is working. The one piece of the puzzle I do not have is how to take the information from NTLM and authenticate with Active Directory.\nThere is a good description of NTLM and the encryption... |
What would be the easiest way to be able to send and receive raw network packets. Do I have to write my own JNI wrapping of some c API, and in that case what API am I looking for?
EDIT: I want to be able to do what wireshark does, i.e. record all incomming packets on an interface, and in addition be able to send back m... | To send and receive raw network packets on macOS, you have a couple of options. Writing your own JNI wrapper for a C API is one approach, but it might not be the easiest or most efficient route. Instead, you could leverage existing libraries that allow packet manipulation, which would save you from dealing with JNI and... | 1,601 | [
{
"from": "human",
"value": "What would be the easiest way to be able to send and receive raw network packets. Do I have to write my own JNI wrapping of some c API, and in that case what API am I looking for?\nEDIT: I want to be able to do what wireshark does, i.e. record all incomming packets on an interfa... |
I've been using VMWare for a while and am very happy with it, but I would like to compare it with VirtualBox. Apparently the disk images are compatible, and I have successfully booted my Fedora based VM created by VMWare in VirtualBox... but the network is completely unavailable. How do you port a virtual machine fro... | Porting a virtual machine from VMware to VirtualBox involves several steps to ensure that all capabilities, including networking, function properly. Here’s a comprehensive guide to help you through the process:
### 1. Prepare the Virtual Machine in VMware
- **Shutdown the VM**: Ensure the VM is powered off.
- **Remov... | 4,857 | [
{
"from": "human",
"value": "I've been using VMWare for a while and am very happy with it, but I would like to compare it with VirtualBox. Apparently the disk images are compatible, and I have successfully booted my Fedora based VM created by VMWare in VirtualBox... but the network is completely unavailabl... |
Trying to avoid the .net WebBrowser control (I don't need to navigate to a url, print rendered html or any of the other inbuilt goodies). Wrapping the IE dll seems a bit heavyweight.
I simply require something that can display basic html marked up text - an html equivalent of RichTextBox in effect. Anyone have any ex... | If you're looking for a lightweight solution to display basic HTML without the overhead of the .NET WebBrowser control or the complexities of wrapping Internet Explorer, there are a few options you can consider:
### 1. **Using a `RichTextBox` Control with HTML Support**
- You can use a `RichTextBox` control in combina... | 7,676 | [
{
"from": "human",
"value": "Trying to avoid the .net WebBrowser control (I don't need to navigate to a url, print rendered html or any of the other inbuilt goodies). Wrapping the IE dll seems a bit heavyweight.\nI simply require something that can display basic html marked up text - an html equivalent of ... |
Drawing a parallelgram is nicely supported with Graphics.DrawImage:
Bitmap destImage = new Bitmap(srcImage.Width, srcImage.Height);
using (Graphics gr = new Graphics.FromImage(destImage))
{
Point[] destPts = new Point[] { new PointF(x1, y1),
new PointF(x2, y2), new PointF(x4, y4)};
gr.DrawImage(srcImag... | To draw an image transformed to fit a quadrilateral defined by four points using the `Graphics.DrawImage` method, you can use a `Graphics` object along with the `DrawImage` method that supports transforming an image to a destination rectangle defined by four points. However, in .NET, `Graphics.DrawImage` only supports ... | 5,881 | [
{
"from": "human",
"value": "Drawing a parallelgram is nicely supported with Graphics.DrawImage:\nBitmap destImage = new Bitmap(srcImage.Width, srcImage.Height);\nusing (Graphics gr = new Graphics.FromImage(destImage))\n{\n Point[] destPts = new Point[] { new PointF(x1, y1), \n new PointF(x2, y2),... |
Or vice versa.
Update:
Hmm, let's assume I have a shopping cart app, the user clicks on the Checkout button.
The next thing I want to do is send the user to a Invoice.aspx page (or similar). When the user hits checkout, I could Button.PostBackURL = "Invoice.aspx"
or I could do
Server.Transfer("Invoice.aspx")
(I also... | In your shopping cart app scenario, you're considering two methods to navigate from the current page to the `Invoice.aspx` page after the user clicks the Checkout button: setting `Button.PostBackURL` or using `Server.Transfer`.
### 1. Using `Button.PostBackURL`
Setting `Button.PostBackURL` allows you to redirect the u... | 5,479 | [
{
"from": "human",
"value": "Or vice versa.\nUpdate:\nHmm, let's assume I have a shopping cart app, the user clicks on the Checkout button.\nThe next thing I want to do is send the user to a Invoice.aspx page (or similar). When the user hits checkout, I could Button.PostBackURL = \"Invoice.aspx\"\nor I coul... |
I like the status email sent by TFS's alerts mechanism when a build breaks.
However I would like to send such an email to the entire team and not rely on the team to subscribe to the alert...
Having a hard time producing a nice and detailed enough message by myself when overriding the "OnBuildBreak" and using the MSBui... | In TFS (Team Foundation Server), the built-in alerts mechanism can be very useful for notifying team members about various events, such as build breaks. However, if you want to send these alerts to a specific list of emails without relying on individual subscriptions, you can approach the problem in a couple of differe... | 5,164 | [
{
"from": "human",
"value": "I like the status email sent by TFS's alerts mechanism when a build breaks.\nHowever I would like to send such an email to the entire team and not rely on the team to subscribe to the alert...\nHaving a hard time producing a nice and detailed enough message by myself when overri... |
I am confronted with a new kind of problem which I haven't encountered yet in my very young programming "career" and would like to know your opinion about how to tackle it best.
The situation
A research application (php/mysql) gathers stress related health data from users. User gets a an analyses after filling in the q... | It's great that you're exploring new approaches in your programming journey! The task of recalculating benchmark values based on new user data is definitely something you can handle with a couple of different strategies, and both stored procedures and cron jobs have their respective merits.
### Option 1: Stored Proced... | 3,196 | [
{
"from": "human",
"value": "I am confronted with a new kind of problem which I haven't encountered yet in my very young programming \"career\" and would like to know your opinion about how to tackle it best.\nThe situation\nA research application (php/mysql) gathers stress related health data from users. U... |
As an example take the following code:
public enum ExampleEnum { FooBar, BarFoo }
public class ExampleClass : INotifyPropertyChanged
{
private ExampleEnum example;
public ExampleEnum ExampleProperty
{ get { return example; } { /* set and notify */; } }
}
I want a to databind the property ExampleProperty... | You're on the right track for binding your `ComboBox` to an `enum` and implementing `INotifyPropertyChanged` to handle changes. Below, I'll guide you through the complete implementation, including how to set up the `ComboBox` to work with your `ExampleEnum`.
### Step 1: Implement `INotifyPropertyChanged`
Make sure yo... | 6,492 | [
{
"from": "human",
"value": "As an example take the following code:\npublic enum ExampleEnum { FooBar, BarFoo }\n\npublic class ExampleClass : INotifyPropertyChanged\n{\n private ExampleEnum example;\n\n public ExampleEnum ExampleProperty \n { get { return example; } { /* set and notify */; } }\n}\... |
Recently a friend and I were talking about securing stored procedure code in a SQL server database.
From distant memory, I'm pretty certain that "with encryption" is incredibly easily broken in all versions of SQL Server, however he said it has been greatly improved in SQL 2005. As a result I have not seriously cons... | The `WITH ENCRYPTION` option in SQL Server is a feature that allows you to encrypt the definition of stored procedures, views, and functions, making it harder for unauthorized users to read the source code. However, it’s important to understand the limitations and vulnerabilities associated with this feature, especiall... | 7,937 | [
{
"from": "human",
"value": "Recently a friend and I were talking about securing stored procedure code in a SQL server database. \nFrom distant memory, I'm pretty certain that \"with encryption\" is incredibly easily broken in all versions of SQL Server, however he said it has been greatly improved in SQL ... |
I'm building a function to extend the Enum.Parse concept that
Allows a default value to be parsed in case that an Enum value is not found
Is case insensitive
So I wrote the following:
public static T GetEnumFromString<T>(string value, T defaultValue) where T : Enum
{
if (string.IsNullOrEmpty(value)) return defaul... | It looks like you've made great progress in creating a utility function to parse enums with case insensitivity and a default value. Since C# 7.3, you can use the `where T : Enum` constraint directly, which allows you to enforce that `T` must be an enum type. Here's a refined version of your function utilizing the moder... | 5,427 | [
{
"from": "human",
"value": "I'm building a function to extend the Enum.Parse concept that\n\nAllows a default value to be parsed in case that an Enum value is not found\nIs case insensitive\n\nSo I wrote the following:\npublic static T GetEnumFromString<T>(string value, T defaultValue) where T : Enum\n{\n ... |
I'm working on a simple ASP.Net page (handler, actually) where I check the value of the LOGON_USER server variable. This works using Visual Studio's built-in web server and it works in other sites deployed to the live intranet site. But it doesn't work on the IIS instance on my local XP machine. How can I fix it, or... | If you're experiencing issues with the `LOGON_USER` server variable not being available in your ASP.NET handler on your local IIS instance, there are several factors to consider. The `LOGON_USER` variable contains the username of the user that is logged into the Windows account and is accessing the web application. Her... | 6,815 | [
{
"from": "human",
"value": "I'm working on a simple ASP.Net page (handler, actually) where I check the value of the LOGON_USER server variable. This works using Visual Studio's built-in web server and it works in other sites deployed to the live intranet site. But it doesn't work on the IIS instance on m... |
Is the real benefit in TDD the actual testing of the application, or the benefits that writing a testable application brings to the table? I ask because I feel too often the conversation revolves so much around testing, and not the total benefits package.
| You're touching on an important aspect of Test-Driven Development (TDD). The benefits of TDD can indeed be viewed from two perspectives: the immediate advantages of having tests and the longer-term benefits that arise from the practices and principles encouraged by TDD. Here's a breakdown of both:
### Immediate Benefi... | 6,133 | [
{
"from": "human",
"value": "Is the real benefit in TDD the actual testing of the application, or the benefits that writing a testable application brings to the table? I ask because I feel too often the conversation revolves so much around testing, and not the total benefits package.\n"
},
{
"from":... |
How do you convert decimal values to their hexadecimal equivalent in JavaScript?
| In JavaScript, you can convert decimal values to their hexadecimal equivalent using the `toString()` method of the `Number` object. The `toString()` method can take a radix (base) as an argument, and for hexadecimal conversion, you would use a radix of 16.
Here’s how you can do it:
```javascript
// Example decimal nu... | 8,960 | [
{
"from": "human",
"value": "How do you convert decimal values to their hexadecimal equivalent in JavaScript?\n"
},
{
"from": "gpt",
"value": "In JavaScript, you can convert decimal values to their hexadecimal equivalent using the `toString()` method of the `Number` object. The `toString()` meth... |
Have any of you tried Hadoop? Can it be used without the distributed filesystem that goes with it, in a Share-nothing architecture? Would that make sense?
I'm also interested into any performance results you have...
| Yes, Hadoop can technically be used without its associated distributed filesystem, HDFS (Hadoop Distributed File System). You can use Hadoop with other storage solutions, such as local filesystems or cloud storage like Amazon S3. In a Share-nothing architecture, where each node is independent and does not share storage... | 6,901 | [
{
"from": "human",
"value": "Have any of you tried Hadoop? Can it be used without the distributed filesystem that goes with it, in a Share-nothing architecture? Would that make sense?\nI'm also interested into any performance results you have...\n"
},
{
"from": "gpt",
"value": "Yes, Hadoop can t... |
I have a simple table comments (id INT, revision INT, comment VARCHAR(140)) with some content like this:
1|1|hallo1|
1|2|hallo2|
1|3|hallo3|
2|1|hallo1|
2|2|hallo2|
I'm searching for an SQL statement which will return each comment with the highest revision:
1|3|hallo3|
2|2|hallo2|
I've come up with this solution:
se... | Your current query is a common method to find the highest revision for each ID, but as you've experienced, it can be slow on large datasets because of the correlated subquery.
A more efficient approach is to use a common table expression (CTE) or a `GROUP BY` clause with the `JOIN` statement. Here are two alternative ... | 9,128 | [
{
"from": "human",
"value": "I have a simple table comments (id INT, revision INT, comment VARCHAR(140)) with some content like this:\n1|1|hallo1|\n1|2|hallo2|\n1|3|hallo3|\n2|1|hallo1|\n2|2|hallo2|\n\nI'm searching for an SQL statement which will return each comment with the highest revision:\n1|3|hallo3|... |
I'm thinking about making a simple map control in WPF, and am thinking about the design of the basic map interface and am wondering if anyone has some good advice for this.
What I'm thinking of is using a ScrollViewer (sans scroll bars) as my "view port" and then stacking everything up on top of a canvas. From Z-Ind... | Your approach to building a simple map control in WPF sounds quite promising! Here are some suggestions and comments that might help you refine your design:
### Basic Structure
1. **ScrollViewer for Panning and Zooming**:
- Using a `ScrollViewer` is a good idea for handling panning. Ensure you set `ScrollViewer.Ho... | 4,718 | [
{
"from": "human",
"value": "I'm thinking about making a simple map control in WPF, and am thinking about the design of the basic map interface and am wondering if anyone has some good advice for this. \nWhat I'm thinking of is using a ScrollViewer (sans scroll bars) as my \"view port\" and then stacking e... |
How would you write a regular expression to convert mark down into HTML? For example, you would type in the following:
This would be *italicized* text and this would be **bold** text
This would then need to be converted to:
This would be <em>italicized</em> text and this would be <strong>bold</strong> text
Very simi... | To convert Markdown into HTML for the specified formatting in C#, you can use regular expressions to match the Markdown patterns and replace them with the corresponding HTML tags.
Here's a simple example of how to accomplish this using C#:
```csharp
using System;
using System.Text.RegularExpressions;
class Program
{... | 8,055 | [
{
"from": "human",
"value": "How would you write a regular expression to convert mark down into HTML? For example, you would type in the following:\nThis would be *italicized* text and this would be **bold** text\n\nThis would then need to be converted to:\nThis would be <em>italicized</em> text and this w... |
I can easily set breakpoints in embedded JS functions, but I don't see any way of accessing external JS scripts via Firebug unless I happen to enter them during a debug session. Is there a way to do this without having to 'explore' my way into the script?
@Jason: This is a good point, but in my case I do not have easy ... | To debug external JavaScript files using Firebug, you can follow these steps to easily set breakpoints and access the code:
1. **Load the Page**: Open your web application in the browser where Firebug is installed, and make sure the external JavaScript files are loaded.
2. **Open Firebug**: Activate Firebug by clicki... | 4,550 | [
{
"from": "human",
"value": "I can easily set breakpoints in embedded JS functions, but I don't see any way of accessing external JS scripts via Firebug unless I happen to enter them during a debug session. Is there a way to do this without having to 'explore' my way into the script?\n@Jason: This is a good... |
What is the best way to disable Alt + F4 in a c# win form to prevent the user from closing the form?
I am using a form as a popup dialog to display a progress bar and I do not want the user to be able to close it.
| In a C# WinForms application, you can prevent the user from closing a form using the Alt + F4 key combination (and other methods) by overriding the `ProcessCmdKey` method or handling the `FormClosing` event. Here are two approaches you can take:
### Approach 1: Override `ProcessCmdKey`
You can override the `ProcessCm... | 7,574 | [
{
"from": "human",
"value": "What is the best way to disable Alt + F4 in a c# win form to prevent the user from closing the form?\nI am using a form as a popup dialog to display a progress bar and I do not want the user to be able to close it.\n"
},
{
"from": "gpt",
"value": "In a C# WinForms ap... |
Whilst refactoring some old code I realised that a particular header file was full of function declarations for functions long since removed from the .cpp file. Does anyone know of a tool that could find (and strip) these automatically?
| Yes, there are several tools and methods you can use to detect and remove unused function declarations in header files. Here are some options:
1. **Cppcheck**: This is a static analysis tool for C/C++ code. It can identify unused functions and variables, which might help you pinpoint the declarations that are no longe... | 7,837 | [
{
"from": "human",
"value": "Whilst refactoring some old code I realised that a particular header file was full of function declarations for functions long since removed from the .cpp file. Does anyone know of a tool that could find (and strip) these automatically?\n"
},
{
"from": "gpt",
"value... |
I've got a virtual machine running on a server that I can't stop or reboot - I can't log onto it anymore and I can't stop it using the VMware server console. There are other VM's running so rebooting the host is out of the question. Is there any other way of forcing one machine to stop?
| If you're unable to log onto the virtual machine (VM) and cannot stop it through the VMware server console, there are a few approaches you can take to forcefully stop the VM without rebooting the host. Here are some methods:
1. **Use Command Line Tools**:
- If you have access to the host machine via SSH or remote d... | 7,552 | [
{
"from": "human",
"value": "I've got a virtual machine running on a server that I can't stop or reboot - I can't log onto it anymore and I can't stop it using the VMware server console. There are other VM's running so rebooting the host is out of the question. Is there any other way of forcing one machine... |
This question is directed to the non-english speaking people here.
It is somewhat biased because SO is an "english-speaking" web forum, so... In the other hand, most developers would know english anyway...
In your locale culture, are technical words translated into locale words ? For example, how "Design Pattern", or "... | This is an interesting question that touches on the intersection of language and technology. In many non-English speaking countries, technical terms, especially in the field of IT, are often borrowed directly from English. However, there are also instances where translations exist and are used, sometimes alongside the ... | 8,980 | [
{
"from": "human",
"value": "This question is directed to the non-english speaking people here.\nIt is somewhat biased because SO is an \"english-speaking\" web forum, so... In the other hand, most developers would know english anyway...\nIn your locale culture, are technical words translated into locale wo... |
In Emacs, C-x o takes me to the next window.
What keyboard macro takes me to the previous window in Emacs?
| In Emacs, to navigate to the previous window, you can use the keyboard shortcut `C-x o` to switch to the next window, but for the previous window, you can use the `C-x p` command. However, `C-x p` is not a default command for previous window navigation.
Instead, you can create a keyboard macro to go to the previous wi... | 9,954 | [
{
"from": "human",
"value": "In Emacs, C-x o takes me to the next window.\nWhat keyboard macro takes me to the previous window in Emacs?\n"
},
{
"from": "gpt",
"value": "In Emacs, to navigate to the previous window, you can use the keyboard shortcut `C-x o` to switch to the next window, but for ... |
I use cruisecontrol.rb for CI and FogBugz for bug tracking, but the more general the answers, the better.
First is the technical problem: is there an API for FogBugz? Are there good tutorials, or better yet, pre-written code?
Second is the procedural problem: what, exactly, should the CI put in the bug tracker when th... | ### Technical Problem: FogBugz API
Yes, FogBugz has an API that you can use to interact with its features programmatically. The FogBugz API allows you to create and manage cases, projects, users, and more. You can access the API documentation [here](https://api.fogbugz.com).
For tutorials and pre-written code, you c... | 6,442 | [
{
"from": "human",
"value": "I use cruisecontrol.rb for CI and FogBugz for bug tracking, but the more general the answers, the better.\nFirst is the technical problem: is there an API for FogBugz? Are there good tutorials, or better yet, pre-written code?\nSecond is the procedural problem: what, exactly, s... |
What is the behind-the-scenes difference between int? and int data types?
Is int? somehow a reference type?
| The difference between `int` and `int?` in C# (and similar languages) lies in how they handle nullability and their underlying type.
1. **`int` (or `System.Int32`):**
- This is a non-nullable value type. It can hold any valid 32-bit integer value from -2,147,483,648 to 2,147,483,647.
- It cannot be assigned a `n... | 8,317 | [
{
"from": "human",
"value": "What is the behind-the-scenes difference between int? and int data types?\nIs int? somehow a reference type?\n"
},
{
"from": "gpt",
"value": "The difference between `int` and `int?` in C# (and similar languages) lies in how they handle nullability and their underlyin... |
Here's the situation: I have a label's text set, immediately followed by a response.redirect() call as follows (this is just an example, but I believe it describes my situation accurately):
aspx:
<asp:Label runat="server" Text="default text" />
Code-behind (code called on an onclick event):
Label.Text = "foo";
Respons... | The behavior you're encountering is due to the page lifecycle in ASP.NET Web Forms. When you set the `Label.Text` property in the code-behind and then call `Response.Redirect()`, the page is effectively terminated immediately after the redirect, meaning the changes you made to the label will not be rendered on the subs... | 8,607 | [
{
"from": "human",
"value": "Here's the situation: I have a label's text set, immediately followed by a response.redirect() call as follows (this is just an example, but I believe it describes my situation accurately):\naspx:\n<asp:Label runat=\"server\" Text=\"default text\" />\n\nCode-behind (code called ... |
After discussion with colleagues regarding the use of the 'var' keyword in C# 3 I wondered what people's opinions were on the appropriate uses of type inference via var?
For example I rather lazily used var in questionable circumstances, e.g.:-
foreach(var item in someList) { // ... } // Type of 'item' not clear.
var s... | Using the `var` keyword for type inference in C# can lead to both improved readability and potential confusion, depending on the context in which it is used. Below are some considerations for its appropriate use:
### Appropriate Uses of `var`
1. **Obvious Initializations**: Using `var` when the type is clear from the ... | 6,890 | [
{
"from": "human",
"value": "After discussion with colleagues regarding the use of the 'var' keyword in C# 3 I wondered what people's opinions were on the appropriate uses of type inference via var?\nFor example I rather lazily used var in questionable circumstances, e.g.:-\nforeach(var item in someList) { ... |
How to create new PCL file similar to existing MS doc. I have MS doc template and replacing it with actual data. I need to achieve same for PCL format (Create PCL file as template and replacing it with actual value from database and send it to fax).
| Creating a PCL (Printer Command Language) file from a Microsoft Word (MS Word) document template and replacing placeholders with actual data from a database requires a few steps. PCL is a page description language used primarily for controlling laser printers, and it can be less straightforward to work with compared to... | 6,341 | [
{
"from": "human",
"value": "How to create new PCL file similar to existing MS doc. I have MS doc template and replacing it with actual data. I need to achieve same for PCL format (Create PCL file as template and replacing it with actual value from database and send it to fax).\n"
},
{
"from": "gpt"... |
I have uncovered another problem in the effort that we are making to port several hundreds of ksh scripts from AIX, Solaris and HPUX to Linux. See here for the previous problem.
This code:
#!/bin/ksh
if [ -a k* ]; then
echo "Oh yeah!"
else
echo "No way!"
fi
exit 0
(when run in a directory with several files wh... | The issue you are encountering stems from the difference in how various shell implementations treat the `-a` flag in the test condition. In your script, the expression `[ -a k* ]` is used to check for the existence of files matching the pattern `k*`. This usage is valid in some versions of ksh (like ksh88 and ksh93) bu... | 9,291 | [
{
"from": "human",
"value": "I have uncovered another problem in the effort that we are making to port several hundreds of ksh scripts from AIX, Solaris and HPUX to Linux. See here for the previous problem.\nThis code:\n#!/bin/ksh\nif [ -a k* ]; then\n echo \"Oh yeah!\"\nelse\n echo \"No way!\"\nfi\ne... |
Business Objects Web Services returns error codes and I have yet to find a good resource where these are listed and what they mean. I am currently getting an "The resultset was empty. (Error: WBP 42019)". Any ideas on where these might be listed? I've called Business Objects support and the tech couldn't even tell m... | Error codes in Business Objects Web Services, such as "WBP 42019", can be challenging to find detailed documentation for. Here are a few steps you can take to troubleshoot and potentially resolve your issue:
1. **Business Objects Documentation**: While specific error codes may not be documented comprehensively, the Bu... | 8,942 | [
{
"from": "human",
"value": "Business Objects Web Services returns error codes and I have yet to find a good resource where these are listed and what they mean. I am currently getting an \"The resultset was empty. (Error: WBP 42019)\". Any ideas on where these might be listed? I've called Business Object... |
Is there a Perl module that allows me to view diffs between actual and reference output of programs (or functions)? The test fails if there are differences.
Also, in case there are differences but the output is OK (because the functionality has changed) I want to be able to commit the actual output as future reference ... | Yes, you can use the `Test::Differences` Perl module to view diffs between actual and reference outputs of programs or functions in your tests. This module provides a simple way to compare expected and actual output, and it will display a diff if there are any differences.
Here's a basic usage example of `Test::Differ... | 6,214 | [
{
"from": "human",
"value": "Is there a Perl module that allows me to view diffs between actual and reference output of programs (or functions)? The test fails if there are differences.\nAlso, in case there are differences but the output is OK (because the functionality has changed) I want to be able to com... |
In one of the answers to Broadcast like UDP with the Reliability of TCP, a user mentions the Spread messaging API. I've also run across one called ØMQ. I also have some familiarity with MPI.
So, my main question is: why would I choose one over the other? More specifically, why would I choose to use Spread or ØMQ w... | When deciding between Spread, ØMQ (ZeroMQ), and MPI (Message Passing Interface), the choice largely depends on your specific requirements and the context in which you're developing your application. Here are some factors to consider for each option:
### Spread Messaging API:
1. **Use Case**: Spread is designed for gro... | 5,199 | [
{
"from": "human",
"value": "In one of the answers to Broadcast like UDP with the Reliability of TCP, a user mentions the Spread messaging API. I've also run across one called ØMQ. I also have some familiarity with MPI. \nSo, my main question is: why would I choose one over the other? More specifically,... |
Here is the updated question:
the current query is doing something like:
$sql1 = "TRUNCATE TABLE fubar";
$sql2 = "CREATE TEMPORARY TABLE IF NOT EXISTS fubar SELECT id, name FROM barfu";
The first time the method containing this is run, it generates an error message on the truncate since the table doesn't exist yet.
Is... | In MySQL, you can't directly combine the `CREATE TABLE IF NOT EXISTS` and `TRUNCATE TABLE` statements into a single atomic operation. Unfortunately, MySQL does not support conditional execution of multiple statements within a single SQL query in the way you are describing.
The approach of performing three separate que... | 4,053 | [
{
"from": "human",
"value": "Here is the updated question:\nthe current query is doing something like:\n$sql1 = \"TRUNCATE TABLE fubar\";\n$sql2 = \"CREATE TEMPORARY TABLE IF NOT EXISTS fubar SELECT id, name FROM barfu\";\n\nThe first time the method containing this is run, it generates an error message on ... |
How do you install svn 1.5 on debian etch? The svn 1.5 packages available for etch are 1.4 and I really need the cool new merge tracking feature in svn1.5 (according to CollabNet its as good as ClearCase...an interesting statement in oh so many ways). So, what's the least painful way to go?
My options are:
build it... | Installing Subversion 1.5 on Debian Etch can be a bit challenging, especially since Etch is quite old and the available packages are not up to date. Here’s an overview of your options and some recommendations:
### Options Overview
1. **Build from Source**: This is a viable option, and it allows you to have the most c... | 7,194 | [
{
"from": "human",
"value": "How do you install svn 1.5 on debian etch? The svn 1.5 packages available for etch are 1.4 and I really need the cool new merge tracking feature in svn1.5 (according to CollabNet its as good as ClearCase...an interesting statement in oh so many ways). So, what's the least pai... |
I have a web application that needs to read (and possibly write) files from a network share. I was wondering what the best way to do this would be?
I can't give the network service or aspnet accounts access to the network share. I could possibly use impersonation.
The network share and the web application are both host... | Accessing a network share from a web application can be a bit tricky, especially if you can't use the default service accounts for permissions. Here are some options you can consider:
### 1. **Impersonation with a Fixed User Account**
You can use impersonation to execute actions under a specific user account that has ... | 5,295 | [
{
"from": "human",
"value": "I have a web application that needs to read (and possibly write) files from a network share. I was wondering what the best way to do this would be?\nI can't give the network service or aspnet accounts access to the network share. I could possibly use impersonation.\nThe network ... |
When I start Tomcat (6.0.18) from Eclipse (3.4), I receive this message (first in the log):
WARNING:
[SetPropertiesRule]{Server/Service/Engine/Host/Context}
Setting property 'source' to
'org.eclipse.jst.jee.server: (project name)'
did not find a matching property.
Seems this message does not have any severe i... | The warning message you're encountering when starting Tomcat from Eclipse is related to the way Eclipse manages web applications and their contexts. This warning typically occurs when Eclipse tries to set a property on the context of a web application, but it doesn't find the expected property setter in the `Context` c... | 7,723 | [
{
"from": "human",
"value": "When I start Tomcat (6.0.18) from Eclipse (3.4), I receive this message (first in the log):\n\nWARNING:\n [SetPropertiesRule]{Server/Service/Engine/Host/Context}\n Setting property 'source' to\n 'org.eclipse.jst.jee.server: (project name)'\n did not find a matching property.... |
I want to encrypt few files using python what is the best way
I can use gpg/pgp using any standard/famous python libraries?
| Encrypting files in Python can be effectively accomplished using the `gnupg` library, which is a wrapper for GnuPG (GPG/PGP). GnuPG is a widely used standard for encrypting and signing files. Below, I’ll guide you through the process of using `gnupg` to encrypt files.
### Step 1: Install GnuPG and the gnupg library
F... | 6,368 | [
{
"from": "human",
"value": "I want to encrypt few files using python what is the best way\nI can use gpg/pgp using any standard/famous python libraries?\n"
},
{
"from": "gpt",
"value": "Encrypting files in Python can be effectively accomplished using the `gnupg` library, which is a wrapper for ... |
I'm regularly running into similar situations :
I have a bunch of COM .DLLs (no IDL files) which I need to use and invoke to be able to access some foreign (non-open, non-documented) data format.
Microsoft's Visual Studio platform has very nice capabilities to import such COM DLLs and use them in my project (Visual C++... | Using COM DLLs on non-Microsoft platforms can indeed be challenging due to the inherent complexities of COM, which is tightly integrated with Windows architecture. However, there are ways to utilize COM DLLs with MinGW, Cygwin, or even Wine. Below are some strategies you can use:
### 1. MinGW and Cygwin with COM
Both ... | 4,016 | [
{
"from": "human",
"value": "I'm regularly running into similar situations :\nI have a bunch of COM .DLLs (no IDL files) which I need to use and invoke to be able to access some foreign (non-open, non-documented) data format.\nMicrosoft's Visual Studio platform has very nice capabilities to import such COM ... |
I'm wondering about instances when it makes sent to use #define and #if statements. I've known about it for a while, but never incorporated it into my way of coding. How exactly does this affect the compilation?
Is #define the only thing that determines if the code is included when compiled? If I have #define DEBUGme ... | Using `#define` and `#if` directives in C/C++ programming is a common way to control code inclusion based on conditions defined at compile time. These preprocessor directives allow you to enable or disable sections of your code depending on certain conditions, which can be quite useful for debugging, platform-specific ... | 4,819 | [
{
"from": "human",
"value": "I'm wondering about instances when it makes sent to use #define and #if statements. I've known about it for a while, but never incorporated it into my way of coding. How exactly does this affect the compilation?\n\nIs #define the only thing that determines if the code is include... |
So, I need some help. I am working on a project in C++. However, I think I have somehow managed to corrupt my heap. This is based on the fact that I added an std::string to a class and assigning it a value from another std::string:
std::string hello = "Hello, world.\n";
/* exampleString = "Hello, world.\n" would work f... | Diagnosing memory corruption issues, especially in C++, can be challenging, but there are several tools and techniques that can help you track down and resolve these problems. Here are some strategies and resources that you might find useful:
### Tools for Diagnosing Memory Issues
1. **Valgrind**:
Valgrind is a p... | 4,070 | [
{
"from": "human",
"value": "So, I need some help. I am working on a project in C++. However, I think I have somehow managed to corrupt my heap. This is based on the fact that I added an std::string to a class and assigning it a value from another std::string:\nstd::string hello = \"Hello, world.\\n\";\n/* ... |
What are the steps and techniques to debug an apparent hang due to a deadlock in a Win32 production process. I heard that WinDbg can be used for this purpose but could you please provide clear hints on how this can be accomplished?
| Debugging a deadlock in a Win32 production process can be challenging, but WinDbg is a powerful tool that can help you analyze the situation. Here are the steps and techniques you can follow to debug an apparent hang due to a deadlock:
### Prerequisites
- Ensure you have the **WinDbg** installed and configured to deb... | 5,325 | [
{
"from": "human",
"value": "What are the steps and techniques to debug an apparent hang due to a deadlock in a Win32 production process. I heard that WinDbg can be used for this purpose but could you please provide clear hints on how this can be accomplished?\n"
},
{
"from": "gpt",
"value": "De... |
I'm not sure what VS setting I've changed or if it's a web.config setting or what, but I keep getting this error in the error list and yet all solutions build fine. Here are some examples:
Error 5 'CompilerGlobalScopeAttribute' is ambiguous in the namespace 'System.Runtime.CompilerServices'. C:\projects\MyProject\... | The errors you're experiencing with ambiguous types in the `System` namespaces suggest that there are conflicting definitions or versions of assemblies in your project. This can happen if you have multiple versions of assemblies referenced, particularly when using different versions of the .NET framework, as it seems t... | 6,471 | [
{
"from": "human",
"value": "I'm not sure what VS setting I've changed or if it's a web.config setting or what, but I keep getting this error in the error list and yet all solutions build fine. Here are some examples:\n\nError 5 'CompilerGlobalScopeAttribute' is ambiguous in the namespace 'System.Runtim... |
I need to pass a UUID instance via http request parameter. Spring needs a custom type converter (from String) to be registered. How do I register one?
| In a Spring application, you can register a custom type converter to convert a `String` to a `UUID` by implementing the `Converter` interface provided by Spring. Here are the steps to create and register a custom `Converter` for `UUID`.
### Step 1: Create a UUID Converter
You can create a class that implements the `C... | 7,073 | [
{
"from": "human",
"value": "I need to pass a UUID instance via http request parameter. Spring needs a custom type converter (from String) to be registered. How do I register one?\n"
},
{
"from": "gpt",
"value": "In a Spring application, you can register a custom type converter to convert a `Str... |
Any recommendations on grep tools for Windows? Ideally ones that could leverage 64-bit OS.
I'm aware of Cygwin, of course, and have also found PowerGREP, but I'm wondering if there are any hidden gems out there?
| Certainly! There are several grep-like tools available for Windows that can leverage a 64-bit OS. Here are some options beyond Cygwin and PowerGREP that you might find useful:
1. **Git Bash**: If you have Git installed on your Windows machine, it comes with Git Bash, which includes a version of grep as part of its Uni... | 7,902 | [
{
"from": "human",
"value": "Any recommendations on grep tools for Windows? Ideally ones that could leverage 64-bit OS.\nI'm aware of Cygwin, of course, and have also found PowerGREP, but I'm wondering if there are any hidden gems out there?\n"
},
{
"from": "gpt",
"value": "Certainly! There are ... |
Which compiles to faster code: "ans = n * 3" or "ans = n+(n*2)"?
Assuming that n is either an int or a long, and it is is running on a modern Win32 Intel box.
Would this be different if there was some dereferencing involved, that is, which of these would be faster?
long a;
long *pn;
long ans;
...
*pn = som... | In terms of raw performance for the specific operations `ans = n * 3` vs `ans = n + (n * 2)`, the first version (`ans = n * 3`) is likely to compile to faster code for a couple of reasons:
1. **Simplicity of Operation**: The multiplication operation is straightforward and can be optimized very efficiently by the compi... | 7,456 | [
{
"from": "human",
"value": "Which compiles to faster code: \"ans = n * 3\" or \"ans = n+(n*2)\"?\nAssuming that n is either an int or a long, and it is is running on a modern Win32 Intel box.\nWould this be different if there was some dereferencing involved, that is, which of these would be faster?\n\n\nlo... |
I have to write an applet that brings up a password dialog. The problem is that dialog is set to be always on top but when user clicks on IE window dialog gets hidden behind IE window nevertheless. And since dialog is modal and holds all IE threads IE pane does not refresh and dialog window is still painted on top of I... | It sounds like you're encountering issues with displaying a modal dialog in a Java applet due to how the dialog is being rendered on top of other windows, particularly with Internet Explorer. The solution you've mentioned about changing the parent to a window instead of a null or applet context is a good step forward.
... | 8,164 | [
{
"from": "human",
"value": "I have to write an applet that brings up a password dialog. The problem is that dialog is set to be always on top but when user clicks on IE window dialog gets hidden behind IE window nevertheless. And since dialog is modal and holds all IE threads IE pane does not refresh and d... |
I've been handed a table with about 18000 rows. Each record describes the location of one customer. The issue is, that when the person created the table, they did not add a field for "Company Name", only "Location Name," and one company can have many locations.
For example, here are some records that describe the same ... | Creating a structured representation of the location names to associate them with a single company can be a daunting task, especially when dealing with a large number of records and variations in naming conventions. Here’s an approach to tackle the problem step-by-step, focusing on automating as much as possible while ... | 4,813 | [
{
"from": "human",
"value": "I've been handed a table with about 18000 rows. Each record describes the location of one customer. The issue is, that when the person created the table, they did not add a field for \"Company Name\", only \"Location Name,\" and one company can have many locations.\nFor example,... |
I need to add role based permissions to my Rails application, and am wondering what the best plugins out there are to look into. I am currently using the RESTful authentication plugin to handle user authentication. Why is the plug in you suggest better than the other ones out there?
| When it comes to adding role-based permissions to a Rails application, there are a few popular gems that you might consider. Here are a few of the best options:
1. **Pundit**:
- **Description**: Pundit is a simple and unobtrusive authorization library for Ruby on Rails. It uses plain Ruby classes (policies) to defi... | 8,032 | [
{
"from": "human",
"value": "I need to add role based permissions to my Rails application, and am wondering what the best plugins out there are to look into. I am currently using the RESTful authentication plugin to handle user authentication. Why is the plug in you suggest better than the other ones out ... |
What are the down sides of using a composite/compound primary key?
| Using a composite or compound primary key—defined as a primary key made up of two or more columns—has its advantages, such as ensuring uniqueness across multiple attributes. However, there are several downsides and challenges associated with using them:
1. **Complexity**: Composite keys can increase the complexity of ... | 7,539 | [
{
"from": "human",
"value": "What are the down sides of using a composite/compound primary key?\n"
},
{
"from": "gpt",
"value": "Using a composite or compound primary key—defined as a primary key made up of two or more columns—has its advantages, such as ensuring uniqueness across multiple attri... |
The below HTML/CSS/Javascript (jQuery) code displays the #makes select box. Selecting an option displays the #models select box with relevant options. The #makes select box sits off-center and the #models select box fills the empty space when it is displayed.
How do you style the form so that the #makes select box is ... | To achieve the desired styling, we need to modify the CSS so that the `#makes` select box is centered when it is the only visible element. Additionally, we want both select boxes to be centered together when they are displayed.
We can use CSS flexbox to easily achieve this centering behavior. Here’s how you can modif... | 2,694 | [
{
"from": "human",
"value": "The below HTML/CSS/Javascript (jQuery) code displays the #makes select box. Selecting an option displays the #models select box with relevant options. The #makes select box sits off-center and the #models select box fills the empty space when it is displayed. \nHow do you style ... |
Why isn't Collection.remove(Object o) generic?
Seems like Collection<E> could have boolean remove(E o);
Then, when you accidentally try to remove (for example) Set<String> instead of each individual String from a Collection<String>, it would be a compile time error instead of a debugging problem later.
| The reason `Collection.remove(Object o)` is not generic in the way you described has to do with how Java's generics and the type system work, specifically the design decisions made in Java regarding type safety and backward compatibility.
1. **Type Erasure**: In Java, generics are implemented using a mechanism called ... | 7,501 | [
{
"from": "human",
"value": "Why isn't Collection.remove(Object o) generic? \nSeems like Collection<E> could have boolean remove(E o); \nThen, when you accidentally try to remove (for example) Set<String> instead of each individual String from a Collection<String>, it would be a compile time error instead ... |
I am trying to include a link to my application in the Startup folder with a parameter passed to the program.
I think it would work if I created the shortcut locally and then added it to my source. After that I could copy it to the Startup folder on first run.
File.userDirectory.resolvePath("Start Menu\\Programs\\Star... | To include a link to your application in the Startup folder with a parameter during the installation process, you typically can't directly configure this in the app.xml file of your installer. However, there are alternative approaches you can take, depending on the installer technology you are using.
Here are a couple... | 8,308 | [
{
"from": "human",
"value": "I am trying to include a link to my application in the Startup folder with a parameter passed to the program. \nI think it would work if I created the shortcut locally and then added it to my source. After that I could copy it to the Startup folder on first run.\nFile.userDirect... |
Can anyone advise on how to crop an image, let's say jpeg, without using any .NET framework constructs, just raw bytes? Since this is the only* way in Silverlight...
Or point to a library?
I'm not concerned with rendering i'm wanting to manipulate a jpg before uploading.
*There are no GDI+(System.Drawing) or WPF(Syste... | If you're working in an environment like Silverlight where you don't have access to the .NET Framework's graphics libraries, you can manipulate JPEG images using raw byte manipulation. However, it's important to note that JPEG is a complex format with a specific structure, so cropping directly requires an understanding... | 4,826 | [
{
"from": "human",
"value": "Can anyone advise on how to crop an image, let's say jpeg, without using any .NET framework constructs, just raw bytes? Since this is the only* way in Silverlight...\nOr point to a library?\nI'm not concerned with rendering i'm wanting to manipulate a jpg before uploading.\n*Th... |
I'm thinking of learning the ASP.NET MVC framework for an upcoming project. Can I use the advanced routing to create long URLs based on the sitemap hierarchy?
Example navigation path:
Home > Shop > Products > Household > Kitchen > Cookware > Cooksets > Nonstick
Typical (I think) MVC URL:
http://example.com/products/ca... | Yes, you can definitely achieve this with ASP.NET MVC using advanced routing techniques. The URL structure you want to create is often referred to as a "friendly URL" or "SEO-friendly URL," and it can improve both user experience and search engine optimization.
### Steps to Implement Advanced Routing
1. **Define Your... | 7,363 | [
{
"from": "human",
"value": "I'm thinking of learning the ASP.NET MVC framework for an upcoming project. Can I use the advanced routing to create long URLs based on the sitemap hierarchy?\nExample navigation path:\nHome > Shop > Products > Household > Kitchen > Cookware > Cooksets > Nonstick\nTypical (I th... |
Does anyone know how I can check to see if a directory is writeable in PHP?
The function is_writable doesn't work for folders.
Edit: It does work. See the accepted answer.
| In PHP, the `is_writable()` function can indeed be used to check if a directory is writable. It returns `true` if the specified file or directory is writable, and `false` otherwise.
Here’s how you can use it:
```php
$directory = '/path/to/directory';
if (is_writable($directory)) {
echo "The directory is writable... | 10,647 | [
{
"from": "human",
"value": "Does anyone know how I can check to see if a directory is writeable in PHP? \nThe function is_writable doesn't work for folders.\n\nEdit: It does work. See the accepted answer.\n\n"
},
{
"from": "gpt",
"value": "In PHP, the `is_writable()` function can indeed be use... |
Is there a command in classic ASP I can use to tell the browser not to pull the page from it's cache, or, to not cache, or clear the cache of my page?
| Yes, in classic ASP, you can control the caching behavior of your web pages by setting specific HTTP headers. To prevent the browser from caching your page, you can add the following code at the top of your ASP file:
```asp
<%
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.AddHeade... | 9,240 | [
{
"from": "human",
"value": "Is there a command in classic ASP I can use to tell the browser not to pull the page from it's cache, or, to not cache, or clear the cache of my page?\n"
},
{
"from": "gpt",
"value": "Yes, in classic ASP, you can control the caching behavior of your web pages by sett... |
How can you enumerate an enum in C#?
E.g. the following code does not compile:
public enum Suit
{
Spades,
Hearts,
Clubs,
Diamonds
}
public void EnumerateAllSuitsDemoMethod()
{
foreach (Suit suit in Suit)
{
DoSomething(suit);
}
}
And it gives the following compile-time error:
'Suit... | In C#, to enumerate the values of an enum, you can use the `Enum.GetValues` method. The issue in your code is that you cannot use the enum type name directly in a `foreach` loop as if it were a variable. Instead, you should call `Enum.GetValues`, which returns an array of the values of the enum type.
Here’s how you c... | 10,537 | [
{
"from": "human",
"value": "How can you enumerate an enum in C#?\nE.g. the following code does not compile:\npublic enum Suit\n{\n Spades,\n Hearts,\n Clubs,\n Diamonds\n}\n\npublic void EnumerateAllSuitsDemoMethod()\n{\n foreach (Suit suit in Suit)\n {\n DoSomething(suit);\n }\... |
When I build a site, I'd like to have at least one browser I can show it off in without any hacks or workarounds, and yet still retain maximum functionality. Knowing that none of the browsers have perfect standards adherence, which one comes closest?
Also, are there any standards areas in which a single browser seems t... | When it comes to web browsers and their adherence to web standards, **Google Chrome** is widely regarded as one of the best options for achieving maximum functionality with minimal need for hacks or workarounds. Chrome is consistently updated and has strong support for the latest web technologies, including HTML5, CSS3... | 9,738 | [
{
"from": "human",
"value": "When I build a site, I'd like to have at least one browser I can show it off in without any hacks or workarounds, and yet still retain maximum functionality. Knowing that none of the browsers have perfect standards adherence, which one comes closest?\nAlso, are there any standar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.