instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I'm really sick of this problem. Google searches always seem to suggest "delete all bpls for the package", "delete all dcus". Sometimes this just-does-not-work. Hopefully I can get some other ideas here.
I have a package written in-house, which had been installed without issue a few months ago. Having made a few change... | Dealing with Delphi compilation and installation errors can be frustrating, especially when they involve internal errors and access violations. Here’s a compilation of common troubleshooting steps that you can try to resolve issues like the ones you've encountered:
### General Troubleshooting Steps
1. **Delete BPLs a... | 27,590 | [
{
"from": "human",
"value": "I'm really sick of this problem. Google searches always seem to suggest \"delete all bpls for the package\", \"delete all dcus\". Sometimes this just-does-not-work. Hopefully I can get some other ideas here.\nI have a package written in-house, which had been installed without is... |
Does anyone have a good guide to capabilities of Windows Services under XP? In particular, I am trying to find out what happens when a program being run as a service tries to open windows, but hasn't been given permission to interact with the desktop.
Basically, I have a program that is/was a GUI application, that shou... | Running a GUI application as a Windows Service under Windows XP can present several challenges, especially when it comes to interacting with the desktop. Windows Services run in a different session than the user session, and as such, they are isolated from user interaction by default.
### Key Points Regarding Windows ... | 19,511 | [
{
"from": "human",
"value": "Does anyone have a good guide to capabilities of Windows Services under XP? In particular, I am trying to find out what happens when a program being run as a service tries to open windows, but hasn't been given permission to interact with the desktop.\nBasically, I have a progra... |
I'm using Cocoon and want to store the jobs and triggers for the quartz scheduler in the database so they are persisted. I can see where I need to make the change in cocoon.xconf but I can't find much on how to configure the datasource etc.
How do I configure this to use our existing (postgres) database?
| To configure Apache Cocoon to use a Quartz Scheduler with a PostgreSQL database for storing jobs and triggers, you'll need to follow a few steps to set up the data source and ensure Quartz can persist the data appropriately.
### Step 1: Add Required Dependencies
Make sure you have the necessary libraries for Quartz a... | 24,358 | [
{
"from": "human",
"value": "I'm using Cocoon and want to store the jobs and triggers for the quartz scheduler in the database so they are persisted. I can see where I need to make the change in cocoon.xconf but I can't find much on how to configure the datasource etc.\nHow do I configure this to use our ex... |
Looking at this loop that copies one c-string to another:
void strcpyr(char *s, char *t)
{
while(*s++=*t++)// Why does this work?
;
}
Why do we not check for the '\0' character in the while loop, like this?
while((*s++=*r++)!='\0')..
How does the first loop terminate?
| The loop in the function `strcpyr` works due to the way the assignment and the evaluation of the condition are structured. Let's break down the loop:
```c
while (*s++ = *t++)
;
```
1. **Assignment**: The expression `*s++ = *t++` does two things:
- It dereferences `t` to get the current character it points to a... | 29,459 | [
{
"from": "human",
"value": "Looking at this loop that copies one c-string to another:\nvoid strcpyr(char *s, char *t)\n{\n while(*s++=*t++)// Why does this work?\n ;\n}\n\nWhy do we not check for the '\\0' character in the while loop, like this?\nwhile((*s++=*r++)!='\\0')..\n\nHow does the first ... |
The image above is from "Wikipedia's entry on AVL trees" which Wikipedia indicates is unbalanced.
How is this tree not balanced already?
Here's a quote from the article:
The balance factor of a node is the height of its right subtree minus the height of its left subtree and a node with balance factor 1, 0, or -1 is ... | It sounds like you are examining the balance of an AVL tree, but may be confused by how the balance factor is calculated and what it means for a tree to be balanced.
For a binary tree to be considered balanced under the AVL tree property, each node in the tree must have a balance factor of -1, 0, or +1. The balance fa... | 24,741 | [
{
"from": "human",
"value": "\nThe image above is from \"Wikipedia's entry on AVL trees\" which Wikipedia indicates is unbalanced.\nHow is this tree not balanced already? \nHere's a quote from the article:\n\nThe balance factor of a node is the height of its right subtree minus the height of its left subtre... |
I am building a fun little app to determine if I should bike to work.
I would like to test to see if it is either Raining or Thunderstorm(ing).
public enum WeatherType : byte
{ Sunny = 0, Cloudy = 1, Thunderstorm = 2, Raining = 4, Snowing = 8, MostlyCloudy = 16 }
I was thinking I could do something like:
WeatherType ... | To determine if the current weather includes either a Thunderstorm or Raining condition while keeping your `WeatherType` values separate, you can use bitwise operations. The bitwise OR operator (`|`) allows you to combine multiple flags, but since you want to check if the current weather matches any of the specified ba... | 30,433 | [
{
"from": "human",
"value": "I am building a fun little app to determine if I should bike to work.\nI would like to test to see if it is either Raining or Thunderstorm(ing).\npublic enum WeatherType : byte\n{ Sunny = 0, Cloudy = 1, Thunderstorm = 2, Raining = 4, Snowing = 8, MostlyCloudy = 16 }\n\nI was thi... |
I need to have my iPhone Objective-C code catch Javascript errors in a UIWebView. That includes uncaught exceptions, syntax errors when loading files, undefined variable references, etc.
This is for a development environment, so it doesn't need to be SDK-kosher. In fact, it only really needs to work on the simulator.... | Capturing JavaScript errors in a UIWebView can be a bit tricky, especially since UIWebView does not provide a built-in mechanism for handling JavaScript errors. However, you can leverage a combination of JavaScript error handling techniques and Objective-C to catch errors effectively.
Since you're open to using hidden... | 26,629 | [
{
"from": "human",
"value": "I need to have my iPhone Objective-C code catch Javascript errors in a UIWebView. That includes uncaught exceptions, syntax errors when loading files, undefined variable references, etc.\nThis is for a development environment, so it doesn't need to be SDK-kosher. In fact, it o... |
During execution, how can a java program tell how much memory it is using?
I don't care how efficient it is!
| In Java, you can use the `Runtime` class to obtain information about the memory usage of your application. The `Runtime` class provides methods to access the Java Runtime, which can be used to find out how much memory is being used by the Java Virtual Machine (JVM). Here’s a simple example of how you can use this class | 27,219 | [
{
"from": "human",
"value": "During execution, how can a java program tell how much memory it is using?\nI don't care how efficient it is!\n"
},
{
"from": "gpt",
"value": "In Java, you can use the `Runtime` class to obtain information about the memory usage of your application. The `Runtime` cla... |
First post, so here goes. I'm writing a script that does intelligent search and replace on a file tree. Essentially, the script gets each file's contents into a buffer string and performs a match with a pre-defined pattern, in this case the pattern is /^[^\r\n]*(vendor)[^\r\n]*$/im. The pattern should find any case-ins... | To achieve your goal of matching all occurrences of the word "vendor" (in any case) on each line, you need a different approach. The regex pattern you're currently using will only match the first occurrence of "vendor" on a line due to the way regex engine processes matches.
To find multiple occurrences within a singl... | 23,599 | [
{
"from": "human",
"value": "First post, so here goes. I'm writing a script that does intelligent search and replace on a file tree. Essentially, the script gets each file's contents into a buffer string and performs a match with a pre-defined pattern, in this case the pattern is /^[^\\r\\n]*(vendor)[^\\r\\... |
Dependency injection seems to be a good thing. In general, should dependencies be injected at the methods that require them, or should they be injected in the contructor of the class?
See the samples below to demonstrate the two ways to inject the same dependency.
//Inject the dependency into the methods that require ... | Dependency injection is a design pattern that can significantly improve the flexibility and testability of your code. Whether to inject dependencies via method parameters or through the constructor can depend on several factors, including the nature of the dependencies and the design goals of your application. Below, I... | 21,266 | [
{
"from": "human",
"value": "Dependency injection seems to be a good thing. In general, should dependencies be injected at the methods that require them, or should they be injected in the contructor of the class?\nSee the samples below to demonstrate the two ways to inject the same dependency.\n//Inject th... |
I would like to hear some opinions about using the isolated storage in Silverlight for storing sensitive data. For example, is it OK to store an authentication token (some GUID that identifies a server-side session) in this storage, or is it better to use cookies?
The isolated storage gives an advantage over cookies in... | When it comes to storing sensitive data like authentication tokens, it's important to consider the security implications of your choices. Here are some thoughts on using isolated storage in Silverlight compared to cookies:
### Isolated Storage:
**Pros:**
1. **Browser Independence:** As you mentioned, isolated storage... | 26,953 | [
{
"from": "human",
"value": "I would like to hear some opinions about using the isolated storage in Silverlight for storing sensitive data. For example, is it OK to store an authentication token (some GUID that identifies a server-side session) in this storage, or is it better to use cookies?\nThe isolated ... |
What is the best way to go about monitoring a folder to see when an image file has been added to it? Files are added approximately once a minute and the naming goes like this... image0001.jpg, image0002.jpg, image0003.jpg etc. I need to know when a file has been written to the folder so that my app can access and use i... | To monitor a folder for the addition of new image files, you can use a variety of programming languages and libraries. One of the most effective ways to accomplish this is by using file system watchers. Below are examples in Python, which is a popular language for such tasks due to its simplicity and the availability o... | 25,772 | [
{
"from": "human",
"value": "What is the best way to go about monitoring a folder to see when an image file has been added to it? Files are added approximately once a minute and the naming goes like this... image0001.jpg, image0002.jpg, image0003.jpg etc. I need to know when a file has been written to the f... |
I wrote a class/function to send xml over https via PHP4/cURL, just wondering if this is the correct approach, or if there's a better one.
Note that PHP5 is not an option at present.
/**
* Send XML via http(s) post
*
* curl --header "Content-Type: text/xml" --data "<?xml version="1.0"?>...." http://www.foo.com/
*
... | Your approach to sending XML over HTTPS using PHP4 and cURL looks generally sound. Here are some suggestions and improvements you might consider:
1. **Error Handling**: It's important to include error handling after executing `curl_exec()`. This will help you catch any errors that may occur during the request. You can... | 26,184 | [
{
"from": "human",
"value": "I wrote a class/function to send xml over https via PHP4/cURL, just wondering if this is the correct approach, or if there's a better one.\nNote that PHP5 is not an option at present.\n/**\n * Send XML via http(s) post\n *\n * curl --header \"Content-Type: text/xml\" --data \"<?... |
...I want to Show the 'delete' button when user is an admin, and show the 'add item' button when user is a contributor:
<!-- More code above -->
<asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
<asp:TemplateField ShowHeader="False">
<ItemTempla... | The issue you're encountering with the `Visible` attribute of the `asp:table` containing the "Add Item" hyperlink is likely due to the data-binding syntax. The data-binding expressions (`<%# ... %>`) are typically evaluated in the context of data binding (like inside a `Repeater`, `GridView`, etc.), and they won't work... | 25,512 | [
{
"from": "human",
"value": "...I want to Show the 'delete' button when user is an admin, and show the 'add item' button when user is a contributor:\n<!-- More code above -->\n<asp:BoundField DataField=\"Description\" HeaderText=\"Description\" SortExpression=\"Description\" />\n <asp:TemplateFie... |
When I download the zip file from the website it contains files with the following extensions:
.dbf
.prj
.sbn
.sbx
.shp
.shp.xml
.shx
Is this is a common data file format that I download or purchase a converter?
I think this is some kind of mapping data file but I all need are the addresses it contains to push into our... | The files you downloaded are part of the ESRI Shapefile format, which is indeed used for storing geospatial vector data. Each of these file types has a specific purpose within the Shapefile format:
- **.shp**: Contains the geometry data (the actual shapes).
- **.shx**: Contains the shape index data for quick access.
-... | 25,907 | [
{
"from": "human",
"value": "When I download the zip file from the website it contains files with the following extensions:\n.dbf\n.prj\n.sbn\n.sbx\n.shp\n.shp.xml\n.shx\nIs this is a common data file format that I download or purchase a converter?\nI think this is some kind of mapping data file but I all n... |
I have an Internet Explorer only web application.
I'm exploring what we can do to automate the testing.
Selenium looks like a good tool, but to be able to activate links etc. I need to tell it where they are. The application wasn't built with this kind of testing in mind, so there generally aren't id attributes on the... | Automating web applications in Internet Explorer (IE) can indeed be a challenge, especially when it comes to generating XPath selectors for elements. While the IE Developer Toolbar provides some useful information, it lacks a direct way to copy XPath like Firebug does in Firefox. However, here are a few alternative app... | 23,732 | [
{
"from": "human",
"value": "I have an Internet Explorer only web application.\nI'm exploring what we can do to automate the testing. \nSelenium looks like a good tool, but to be able to activate links etc. I need to tell it where they are. The application wasn't built with this kind of testing in mind, so ... |
Is it possible to create an attribute that can be initialized with a variable number of arguments?
For example:
[MyCustomAttribute(new int[3,4,5])] // this doesn't work
public MyClass ...
| In C#, attributes have some constraints that limit how they can be constructed. Specifically, attributes can only take certain types of arguments, and they cannot accept variables or complex types directly as arguments. Instead, they can only take constants, which means that array literals or anything other than simple... | 29,633 | [
{
"from": "human",
"value": "Is it possible to create an attribute that can be initialized with a variable number of arguments?\nFor example:\n[MyCustomAttribute(new int[3,4,5])] // this doesn't work\npublic MyClass ...\n\n"
},
{
"from": "gpt",
"value": "In C#, attributes have some constraints ... |
A client is switching from Community Server to DNN. We would like to just import all the users including their passwords. It seems like this should work since both products use the .NET SqlMembershipProvider. What tables need to be populated to get a user set up correctly in DNN?
| Migrating users from Community Server to DNN (DotNetNuke) can be quite a task, especially when it comes to maintaining user authentication with their existing passwords. Since both systems utilize the .NET SqlMembershipProvider, the migration process can be simplified by focusing on specific tables and ensuring compati... | 23,764 | [
{
"from": "human",
"value": "A client is switching from Community Server to DNN. We would like to just import all the users including their passwords. It seems like this should work since both products use the .NET SqlMembershipProvider. What tables need to be populated to get a user set up correctly in DNN... |
I want to enforce CHECK constraint on a date range such that all dates in column BIRTH_DATE are less than tomorrow and greater than or equal to 100 years ago. I tried this expression in a CHECK constraint:
BIRTH_DATE >= (sysdate - numtoyminterval(100, 'YEAR')) AND BIRTH_DATE < sysdate + 1
But I received the error "OR... | In Oracle, the `CHECK` constraint does not allow the use of functions or expressions that involve non-deterministic values, such as `SYSDATE`. This is why you encountered the "ORA-02436" error when you tried to use `SYSDATE` in your `CHECK` constraint.
However, you can enforce a date range constraint using a static da... | 30,262 | [
{
"from": "human",
"value": "I want to enforce CHECK constraint on a date range such that all dates in column BIRTH_DATE are less than tomorrow and greater than or equal to 100 years ago. I tried this expression in a CHECK constraint:\nBIRTH_DATE >= (sysdate - numtoyminterval(100, 'YEAR')) AND BIRTH_DATE <... |
I am trying to insert an image (jpg) in to a word document and the Selection.InlineShapes.AddPicture does not seem to be supported by win32old or I am doing something wrong. Has anyone had any luck inserting images.
| To insert an image into a Word document using VBA in the Win32 environment, the method `Selection.InlineShapes.AddPicture` should generally work as expected. However, if you are experiencing issues, here are a few steps to help you troubleshoot or resolve the problem.
### Basic Example
Here's a simple example of how t... | 27,191 | [
{
"from": "human",
"value": "I am trying to insert an image (jpg) in to a word document and the Selection.InlineShapes.AddPicture does not seem to be supported by win32old or I am doing something wrong. Has anyone had any luck inserting images. \n"
},
{
"from": "gpt",
"value": "To insert an im... |
I'm planning to write an operating system and I don't know very much about operating systems. Are there any good resources or books to read in order for me to learn? What are your recommendations?
| Writing an operating system is a challenging but rewarding endeavor! To help you get started, here are some excellent resources and books that can deepen your understanding of operating systems, their design, and implementation:
### Books:
1. **"Operating System Concepts" by Abraham Silberschatz, Peter B. Galvin, and ... | 29,220 | [
{
"from": "human",
"value": "I'm planning to write an operating system and I don't know very much about operating systems. Are there any good resources or books to read in order for me to learn? What are your recommendations?\n"
},
{
"from": "gpt",
"value": "Writing an operating system is a chal... |
I have the following code that won't compile and although there is a way to make it compile I want to understand why it isn't compiling. Can someone enlighten me as to specifically why I get the error message I will post at the end please?
public class Test {
public static void main(String args[]) {
Test t ... | The error message you're encountering is due to Java's type system and how generics work in this context. Let's break down the code and the error message step-by-step.
### Code Analysis
1. **Method Signature**:
```java
public <T extends Test> void testT(Class<T> type)
```
Here, `T` is a type parameter th... | 22,287 | [
{
"from": "human",
"value": "I have the following code that won't compile and although there is a way to make it compile I want to understand why it isn't compiling. Can someone enlighten me as to specifically why I get the error message I will post at the end please?\npublic class Test {\n public static... |
I just got a shiny, brand-new Debian server handed to me by our Systems group, and the /etc directory is kept under version control with Subversion. Unfortunately, I couldn't seem to save some configuration changes; Subversion kept asking me for the password of the gentlemen who set the box up and who is on vacation a... | When using `sudo` to run `svn commit`, the command executes in the context of the root user, which likely has its own Subversion configuration. If the root user does not have any credentials cached for the repository, it will prompt for the password associated with the username specified in the repository URL (which se... | 25,938 | [
{
"from": "human",
"value": "I just got a shiny, brand-new Debian server handed to me by our Systems group, and the /etc directory is kept under version control with Subversion. Unfortunately, I couldn't seem to save some configuration changes; Subversion kept asking me for the password of the gentlemen wh... |
As I am using for-loops on large multi-dim arrays, any saving on the for-loop mechanism itself is meaningful.
Accordingly, I am looking for any tips on how to reduce this overhead.
e.g. : counting down using uint instead of int and != 0 as stop instead of >0 allows the CPU to do less work (heard it once, not sure it is... | Optimizing for-loops, especially when working with large multi-dimensional arrays, can yield significant performance benefits. Here are several strategies you might consider to reduce overhead in your loops:
### 1. Use Local Variables
Accessing array elements can be costly, especially in nested loops. By using local v... | 25,852 | [
{
"from": "human",
"value": "As I am using for-loops on large multi-dim arrays, any saving on the for-loop mechanism itself is meaningful.\nAccordingly, I am looking for any tips on how to reduce this overhead.\ne.g. : counting down using uint instead of int and != 0 as stop instead of >0 allows the CPU to ... |
The story:
I been googling for some way of displaying computer graphics over the web using acceleration from video cards (no software renders). I know it is possible to write and activeX module for IE but that is not a complete solution as that would alinate a good amount of users (firefox + macOS fans).
Here is an exa... | Your inquiry about using JOGL (Java Binding for the Open Graphics Library) for hardware-accelerated graphics in web applications raises several interesting points. Let's address your questions one by one:
### A) Is JOGL the best solution for my story?
JOGL can be a viable solution for achieving hardware-accelerated g... | 26,610 | [
{
"from": "human",
"value": "The story:\nI been googling for some way of displaying computer graphics over the web using acceleration from video cards (no software renders). I know it is possible to write and activeX module for IE but that is not a complete solution as that would alinate a good amount of us... |
Summary: I'm developing a persistent Java web application, and I need to make sure that all resources I persist have globally unique identifiers to prevent duplicates.
The Fine Print:
I'm not using an RDBMS, so I don't have any fancy sequence generators (such as the one provided by Oracle)
I'd like it to be fast, pref... | To create a persistent Java web application that generates globally unique identifiers (GUIDs) for your resources without an RDBMS, you can utilize the following approaches, keeping in mind your requirements for speed, thread safety, and consistency across JVM instances:
### Option 1: Use `java.util.UUID`
Using `java... | 25,090 | [
{
"from": "human",
"value": "Summary: I'm developing a persistent Java web application, and I need to make sure that all resources I persist have globally unique identifiers to prevent duplicates.\nThe Fine Print:\n\nI'm not using an RDBMS, so I don't have any fancy sequence generators (such as the one prov... |
I have a simple event handler with a ItemAdding event that changes a column value that I need in the ItemUpdated method. After uploading a word 2007 document (*.docx, *.pptx or xlsx) the value of the column is changed, but when I protect the document the value of the column disappears in the ItemUpdated method. This o... | It seems like you're experiencing an issue with your event handler for the ItemAdding and ItemUpdated events in a SharePoint document library, specifically when handling Office 2007 file formats.
Here are a few considerations and potential solutions to address this issue:
1. **Check for ItemUpdating vs. ItemUpdated*... | 28,052 | [
{
"from": "human",
"value": "I have a simple event handler with a ItemAdding event that changes a column value that I need in the ItemUpdated method. After uploading a word 2007 document (*.docx, *.pptx or xlsx) the value of the column is changed, but when I protect the document the value of the column disa... |
I recently read that using flexible array members in C was poor software engineering practice. However, that statement was not backed by any argument. Is this an accepted fact?
(Flexible array members are a C feature introduced in C99 whereby one can declare the last element to be an array of unspecified size. For exam... | The use of flexible array members in C can be a contentious topic, and whether it's considered poor software engineering practice depends largely on context and how they're used. Let's break down some of the considerations:
### Advantages of Flexible Array Members
1. **Memory Efficiency**: They allow for the creation... | 28,174 | [
{
"from": "human",
"value": "I recently read that using flexible array members in C was poor software engineering practice. However, that statement was not backed by any argument. Is this an accepted fact?\n(Flexible array members are a C feature introduced in C99 whereby one can declare the last element to... |
I've noticed in many places in Java (C# included), that many "getter" methods are prefixed with "get" while many other aren't. I never noticed any kind of pattern Sun seems to be following. What are some guidelines or rules for using "get" in getter method names?
| In Java and C#, the convention for naming getter methods follows a general pattern based on the principles of encapsulation and readability. Here are some guidelines for using "get" in getter method names:
### Guidelines for Naming Getter Methods:
1. **Use "get" Prefix for Standard Properties**:
- For instance var... | 28,098 | [
{
"from": "human",
"value": "I've noticed in many places in Java (C# included), that many \"getter\" methods are prefixed with \"get\" while many other aren't. I never noticed any kind of pattern Sun seems to be following. What are some guidelines or rules for using \"get\" in getter method names?\n"
},
... |
I know this is not a "real" programming question. But, it relates to programming so I am going to set it anyway. I have a program that I need to test that reads the Byte Order Marker of the file to see if it is utf-8 or utf-16. My problem is I cannot find a program/text editor that will allow me to set the byte orde... | You can manually set a Byte Order Marker (BOM) in a text file using a hex editor or by writing a small program. Here’s how you can do it using different methods:
### Method 1: Using a Hex Editor
1. **Download a Hex Editor**: There are several free hex editors available, such as HxD or Hex Fiend.
2. **Create a New Fil... | 28,728 | [
{
"from": "human",
"value": "I know this is not a \"real\" programming question. But, it relates to programming so I am going to set it anyway. I have a program that I need to test that reads the Byte Order Marker of the file to see if it is utf-8 or utf-16. My problem is I cannot find a program/text edi... |
I've an image that is wrapped in an anchor tag that, through jQuery, triggers an action somewhere else on the page. When I click on the image, two tiny 1px by 1px boxes show up in the upper and lower left corners of the image.
My CSS styles explicitly state no borders for images: a,img { border: 0; }
It also seems to ... | The issue you're experiencing in Firefox 3, where tiny boxes appear in the corners of your image when it's clicked, may be due to the browser's handling of focus outlines on anchor (`<a>`) elements. When you click on an anchor tag, it may receive focus, which can lead to the display of a default focus outline or box ar... | 30,670 | [
{
"from": "human",
"value": "I've an image that is wrapped in an anchor tag that, through jQuery, triggers an action somewhere else on the page. When I click on the image, two tiny 1px by 1px boxes show up in the upper and lower left corners of the image.\nMy CSS styles explicitly state no borders for imag... |
In a web application I am developing, I wish to implement wiki-style edits (where each and every edit is saved, can be compared, and users can rollback edits easily).
What is a good way of implementing this without re-inventing the wheel too much?
Thank you in advance.
| Implementing wiki-style editing functionality is a great feature for a web application. This involves keeping track of changes to the content over time, allowing users to compare different versions and revert to previous ones if necessary. Here are some steps and considerations for implementing this feature without rei... | 27,161 | [
{
"from": "human",
"value": "In a web application I am developing, I wish to implement wiki-style edits (where each and every edit is saved, can be compared, and users can rollback edits easily).\nWhat is a good way of implementing this without re-inventing the wheel too much?\nThank you in advance.\n"
},... |
I tried using the Microsoft ReportingControls but found them overly cumbersome, with too little documentation. I'd like a simple control that would convert a GridView control into a PDF document. I've started looking into PDFSHarp and am running into dead ends with documentation. Same thing with iTextSharp. I'm wil... | Creating a PDF document from a `GridView` in ASP.NET can be achieved using libraries like PDFSharp or iTextSharp. Both libraries are capable and have been used by many developers, but they do have a learning curve.
Here's a brief overview of how you can achieve your goal with both libraries:
### Option 1: Using iText... | 25,149 | [
{
"from": "human",
"value": "I tried using the Microsoft ReportingControls but found them overly cumbersome, with too little documentation. I'd like a simple control that would convert a GridView control into a PDF document. I've started looking into PDFSHarp and am running into dead ends with documentati... |
We all know that having a good note taking tool is important as a developer.
However, OneNote and Evernote forces us to be locked in to a particular vendor.
Anyone know of good open-source tools, or even other method of taking notes w/o being "locked-in"?
EDIT: I should kick myself in the head for not specifying. Takin... | Certainly! There are several open-source tools and alternatives that support rich note-taking features, including ink notes, image additions, and sketching. Here are some options you can consider:
### Open-Source Note-Taking Tools:
1. **Joplin**:
- Joplin is an open-source note-taking and to-do application that su... | 26,442 | [
{
"from": "human",
"value": "We all know that having a good note taking tool is important as a developer.\nHowever, OneNote and Evernote forces us to be locked in to a particular vendor.\nAnyone know of good open-source tools, or even other method of taking notes w/o being \"locked-in\"?\nEDIT: I should kic... |
If I have a windows service on a server, what is 'best practise' for updating the service? (say there was a bug in it, or I need to ad more features to it).
Is there a way I could shutdown the service, patch it and get it up and running in a more automated way?
(any links with code would be great)
| Updating a Windows Service can be a critical task, especially in a production environment. The goal is to minimize downtime and ensure a smooth transition between the old and new versions of the service. Here are some best practices | 27,717 | [
{
"from": "human",
"value": "If I have a windows service on a server, what is 'best practise' for updating the service? (say there was a bug in it, or I need to ad more features to it).\nIs there a way I could shutdown the service, patch it and get it up and running in a more automated way?\n(any links with... |
I'd like to write a Silverlight app that has 2 or more browser windows that "interact".
An example would be a parent/details display where selecting an item in the "Parent" list (in one browser window) will display the details of the item in another window.
The main point is so that on a multiple-monitor setup the ... | Creating a Silverlight application that spans multiple browser windows can be challenging due to the restrictions imposed by web browsers and the Silverlight framework itself. Silverlight was designed for rich internet applications and runs in a sandboxed environment, which limits cross-domain communication and interac... | 29,587 | [
{
"from": "human",
"value": "I'd like to write a Silverlight app that has 2 or more browser windows that \"interact\". \nAn example would be a parent/details display where selecting an item in the \"Parent\" list (in one browser window) will display the details of the item in another window. \nThe main po... |
I've found the "open" command in Mac OS X very handy in the command line. From "man open":
The open command opens a file (or a directory or URL), just as if you had
double-clicked the file's icon. If no application name is specified, the
default application as determined via LaunchServices is used to open ... | In Linux, there isn't a direct equivalent of the `open` command from macOS that automatically determines the default application for a given file type. However, you can achieve similar functionality using various tools and methods depending on your Linux distribution and desktop environment.
### Method 1: Using `xdg-o... | 30,926 | [
{
"from": "human",
"value": "I've found the \"open\" command in Mac OS X very handy in the command line. From \"man open\":\n\nThe open command opens a file (or a directory or URL), just as if you had\n double-clicked the file's icon. If no application name is specified, the\n default application ... |
Just curious here: is it possible to invoke a Windows Blue Screen of Death using .net managed code under Windows XP/Vista? And if it is possible, what could the example code be?
Just for the record, this is not for any malicious purpose, I am just wondering what kind of code it would take to actually kill the operating... | Invoking a Blue Screen of Death (BSOD) deliberately through managed code, such as .NET, is not straightforward and generally not possible due to the abstraction layer that managed code operates under. Managed code runs in a controlled environment provided by the .NET Framework, which isolates it from low-level system o... | 29,806 | [
{
"from": "human",
"value": "Just curious here: is it possible to invoke a Windows Blue Screen of Death using .net managed code under Windows XP/Vista? And if it is possible, what could the example code be?\nJust for the record, this is not for any malicious purpose, I am just wondering what kind of code it... |
.NET has a lot of complex data structures. Unfortunately, some of them are quite similar and I'm not always sure when to use one and when to use another. Most of my C# and VB books talk about them to a certain extent, but they never really go into any real detail.
What's the difference between Array, ArrayList, List, H... | Understanding the differences between these data structures in .NET can indeed be challenging, but it's essential for selecting the right one for your needs. Let's break down these collections based on several key factors: purpose, key/value pairs, enumerability, performance (in terms of speed), and memory footprint.
... | 18,765 | [
{
"from": "human",
"value": ".NET has a lot of complex data structures. Unfortunately, some of them are quite similar and I'm not always sure when to use one and when to use another. Most of my C# and VB books talk about them to a certain extent, but they never really go into any real detail.\nWhat's the di... |
Hey all, This is my first question here!
I'm trying to setup custom error pages in my JBoss RESTful web service. I'm starting with the 400 error, so in my web.xml I've added
<error-page>
<error-code>400</error-code>
<location>/400.html</location>
</error-page>
and I've placed 400.html at the root of my war fi... | It sounds like you're on the right track with your error handling in your JBoss RESTful web service, but there are a few points to consider that may help resolve the issue.
1. **Placement of 400.html**: Make sure that `400.html` is placed directly under the root of your WAR file. It should not be in the `WEB-INF` fold... | 27,002 | [
{
"from": "human",
"value": "Hey all, This is my first question here!\nI'm trying to setup custom error pages in my JBoss RESTful web service. I'm starting with the 400 error, so in my web.xml I've added\n<error-page>\n <error-code>400</error-code>\n <location>/400.html</location>\n</error-page>\n\na... |
Just wondering what the difference between BeginInvoke() and Invoke() are?
Mainly what each one would be used for.
EDIT: What is the difference between creating a threading object and calling invoke on that and just calling BeginInvoke() on a delegate? or are they the same thing?
| `BeginInvoke()` and `Invoke()` are methods associated with delegates in .NET, particularly when dealing with multi-threading and UI updates. Both are used to execute a method on a different thread or context (usually the UI thread), but they serve different purposes and work in distinct ways.
### `Invoke()`
- **Synchr... | 23,211 | [
{
"from": "human",
"value": "Just wondering what the difference between BeginInvoke() and Invoke() are? \nMainly what each one would be used for.\nEDIT: What is the difference between creating a threading object and calling invoke on that and just calling BeginInvoke() on a delegate? or are they the same th... |
I was recently approached by a network-engineer, co-worker who would like to offload his minor network admin duties to a junior-level helpdesk tech. The specific location in need of management acts as an ISP for tenants on its single-site property, so there's a lot of small adjustments being made on a daily basis.
I ... | Using SNMP (Simple Network Management Protocol) to manage your Cisco devices can offer several advantages over emulating a Telnet session. Here's a breakdown of the benefits of using SNMP and why you might consider it:
### Benefits of SNMP:
1. **Standardization**: SNMP is a standard protocol that is supported by a wi... | 24,001 | [
{
"from": "human",
"value": "I was recently approached by a network-engineer, co-worker who would like to offload his minor network admin duties to a junior-level helpdesk tech. The specific location in need of management acts as an ISP for tenants on its single-site property, so there's a lot of small ad... |
What is the best technique for catching ALL exceptions thrown within JavaScript?
Obviously, the best technique is to use try...catch. But with ansynchronous callbacks and so forth, that can get tricky.
I know IE and Gecko browsers support window.onerror, but what about Opera and Safari?
Here are a bunch of test-cases ... | To create a comprehensive error handling system in JavaScript that catches all exceptions—including those from asynchronous calls—you can use a combination of techniques. Here’s a breakdown of how you can handle both synchronous and asynchronous errors effectively, along with a centralized error handler.
### Centraliz... | 26,756 | [
{
"from": "human",
"value": "What is the best technique for catching ALL exceptions thrown within JavaScript?\nObviously, the best technique is to use try...catch. But with ansynchronous callbacks and so forth, that can get tricky.\nI know IE and Gecko browsers support window.onerror, but what about Opera ... |
I suppose this question could just as easily be applied to PHP with regard to MSSQL. However, with some versions of MSSQL being so expensive, I always wondered, what is the real advantage of choosing it over MySQL for .NET development? Is it really difficult to use .NET tools in conjunction with a MySQL database? Why n... | When considering whether to use Microsoft SQL Server (MSSQL) or MySQL for .NET development, there are several factors to evaluate. Here’s a breakdown of the advantages and considerations for both databases:
### Advantages of MSSQL for .NET Development
1. **Integration with .NET Framework**:
- MSSQL has robust supp... | 26,513 | [
{
"from": "human",
"value": "I suppose this question could just as easily be applied to PHP with regard to MSSQL. However, with some versions of MSSQL being so expensive, I always wondered, what is the real advantage of choosing it over MySQL for .NET development? Is it really difficult to use .NET tools in... |
The glorified global variable - becomes a gloried global class. Some say breaking object-oriented design.
Give me scenarios, other than the good old logger where it makes sense to use the singleton.
| The singleton pattern can be a controversial design choice in object-oriented programming, often criticized for breaking the principles of encapsulation and making code harder to test. However, there are scenarios where using a singleton can be beneficial. Here are some examples beyond the traditional logging use case:... | 25,932 | [
{
"from": "human",
"value": "The glorified global variable - becomes a gloried global class. Some say breaking object-oriented design.\nGive me scenarios, other than the good old logger where it makes sense to use the singleton.\n"
},
{
"from": "gpt",
"value": "The singleton pattern can be a con... |
I am losing hair on this one ... it seems that when I fix width an HTML SELECT control it renders its width differently depending on the browser.
Any idea how to to standardize this without having to turn to multiple style sheets?
Here is what I am working with:
.combo
{
padding: 2px;
width: 200px;
}
.text
{... | Standardizing the width of HTML `<select>` elements across different browsers can be a bit tricky since they can render form controls differently. Here are some suggestions to help you achieve consistent styling:
### 1. Use a Reset CSS
Consider using a CSS reset or normalize CSS at the beginning of your stylesheet. T... | 21,560 | [
{
"from": "human",
"value": "I am losing hair on this one ... it seems that when I fix width an HTML SELECT control it renders its width differently depending on the browser. \nAny idea how to to standardize this without having to turn to multiple style sheets?\nHere is what I am working with:\n.combo\n{\n... |
Question: Is there any reason Autocomplete=off on a ASP:Textbox would not be working in IE 7?
In case this is the best term for it, the IE Autocomplete feature is that drop down list like thing that drops down from textboxes and shows you past things you have typed in.
I need the IE Autocomplete feature to not work at ... | The behavior you're encountering with the `autocomplete` attribute in Internet Explorer 7 can be quite tricky due | 28,062 | [
{
"from": "human",
"value": "Question: Is there any reason Autocomplete=off on a ASP:Textbox would not be working in IE 7?\nIn case this is the best term for it, the IE Autocomplete feature is that drop down list like thing that drops down from textboxes and shows you past things you have typed in.\nI need ... |
I have a Java applet that runs inside a forms-authenticated aspx page. In the .NET 1.1 version of my site, the applet has access to the session cookie and is able to retrieve a file from the server, but in the .NET 2.0 version it fails to authenticate.
I have seen a couple of forum posts elsewhere that state that 2.0 s... | The behavior you're experiencing may stem from a few key differences between ASP.NET 1.1 and 2.0, particularly regarding how cookies are managed. Here are several factors to consider and possible solutions:
### 1. HttpOnly Cookie Attribute
In ASP.NET 2.0, the `HttpOnly` attribute may be enabled by default for session ... | 27,259 | [
{
"from": "human",
"value": "I have a Java applet that runs inside a forms-authenticated aspx page. In the .NET 1.1 version of my site, the applet has access to the session cookie and is able to retrieve a file from the server, but in the .NET 2.0 version it fails to authenticate.\nI have seen a couple of f... |
Im curious what the exact meaning of "committed" memory is when the value is queried from the MemoryUsage class. That class explains it as "committed represents the amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine." Does this mean that the memory is in use by the jvm ... | In the context of the Java Virtual Machine (JVM), specifically when referring to the HotSpot implementation, the term "committed" memory has a specific meaning as part of the memory management system.
When you query the `MemoryUsage` class and examine the "committed" value, it refers to the amount of memory that the J... | 29,013 | [
{
"from": "human",
"value": "Im curious what the exact meaning of \"committed\" memory is when the value is queried from the MemoryUsage class. That class explains it as \"committed represents the amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\" Does th... |
Disclaimer: I've solved the problem using Expressions from System.Linq.Expressions, but I'm still looking for a better/easier way.
Consider the following situation :
var query =
from c in db.Customers
where (c.ContactFirstName.Contains("BlackListed") ||
c.ContactLastName.Contains("BlackListed") ||... | To generate a dynamic `where` clause in your LINQ query that checks multiple properties based on their names at runtime, you can use `System.Linq.Expressions` to construct an expression tree. This allows you to build up the query dynamically according to the properties specified at runtime.
Here's a step-by-step guide... | 23,643 | [
{
"from": "human",
"value": "Disclaimer: I've solved the problem using Expressions from System.Linq.Expressions, but I'm still looking for a better/easier way.\nConsider the following situation :\nvar query = \n from c in db.Customers\n where (c.ContactFirstName.Contains(\"BlackListed\") || \n ... |
I'm a Linux guy and I'm used to copying directory trees with cp -a. OS X doesn't have -a option on cp... but it does have the ditto command. I'm reading the man on ditto now, but is there anything I should specifically be looking out for?
| Yes, when transitioning from using `cp -a` on Linux to using `ditto` on macOS, there are a few important points and features to consider:
1. **Preserving Attributes**:
- `ditto` is designed to preserve file and directory attributes (including permissions, ownership, and extended attributes), similar to `cp -a`. Yo... | 22,630 | [
{
"from": "human",
"value": "I'm a Linux guy and I'm used to copying directory trees with cp -a. OS X doesn't have -a option on cp... but it does have the ditto command. I'm reading the man on ditto now, but is there anything I should specifically be looking out for?\n"
},
{
"from": "gpt",
"valu... |
We've got a fairly large amount of code that just made the jump to Java 5. We've been using generics in those components targeted at being released in the Java 5 version, but the remaining code is, of course, full of raw types. I've set the compiler to generate an error for raw types and started manually clearing them,... | Migrating a large codebase from raw types to generics can indeed be a daunting task, but there are several strategies and tools you can leverage to make the process more manageable:
### 1. **Use Refactoring Tools:**
- **Eclipse's Refactoring Tools:** While you mentioned using Eclipse's "Infer Generic Type" quick fi... | 28,308 | [
{
"from": "human",
"value": "We've got a fairly large amount of code that just made the jump to Java 5. We've been using generics in those components targeted at being released in the Java 5 version, but the remaining code is, of course, full of raw types. I've set the compiler to generate an error for raw ... |
I need to generate an XML file in C#.
I want to write the code that generates this in a file that is mostly XML with code inside of it as I can in an ASP.NET MVC page.
So I want a code file that looks like:
<lots of angle brackets...>
<% foreach(data in myData)
{ %>
< <%= data.somefield %>
<% } %>
M... | If you want to generate an XML file in C# using a templating style similar to ASP.NET, you can use the Razor templating engine, which allows you to embed C# code within your templates. Razor is primarily used in ASP.NET MVC applications, but it can also be used independently in console applications or other types of pr... | 27,139 | [
{
"from": "human",
"value": "I need to generate an XML file in C#.\nI want to write the code that generates this in a file that is mostly XML with code inside of it as I can in an ASP.NET MVC page. \nSo I want a code file that looks like:\n<lots of angle brackets...>\n\n <% foreach(data in myData)\n {... |
I need to output some JavaScript in a WebControl based on some processing and some properties that the consumer can set, doing it on the load of the page will be to early.
When is the latest I can call RegisterClientScriptBlock and still have it output on the page?
| In ASP.NET, you can use the `RegisterClientScriptBlock` method to register JavaScript code that will be rendered in the page when it is sent to the client. However, the timing of when you can call this method is crucial to ensure that the script is output correctly.
To ensure that your JavaScript is included in the re... | 27,211 | [
{
"from": "human",
"value": "I need to output some JavaScript in a WebControl based on some processing and some properties that the consumer can set, doing it on the load of the page will be to early.\nWhen is the latest I can call RegisterClientScriptBlock and still have it output on the page?\n"
},
{
... |
I have a site collection and I want to set the search center value to be the same as another site collection. The site collection is created in code, so I need to be able to set the property after the site collection has been created.
How can I do this programatically?
| To set the search center value for a SharePoint site collection programmatically after its creation, you can use the SharePoint Client Object Model or the Server Object Model, depending on your environment. Below, I will provide examples for both approaches.
### Using the Server Object Model
If you are working in a S... | 29,678 | [
{
"from": "human",
"value": "I have a site collection and I want to set the search center value to be the same as another site collection. The site collection is created in code, so I need to be able to set the property after the site collection has been created.\nHow can I do this programatically?\n"
},
... |
I'm using the javax.mail system, and having problems with "Invalid Address" exceptions. Here's the basics of the code:
// Get system properties
Properties props = System.getProperties();
// Setup mail server
props.put("mail.smtp.host", m_sending_host);
// Get session
Session session = Session... | It looks like you've done a great job diagnosing the issue with your email sending code using the `javax.mail` library. Your update highlights several key points about email authentication that are crucial for successful delivery, especially when dealing with different types of email addresses (local vs. relay).
Here’... | 27,311 | [
{
"from": "human",
"value": "I'm using the javax.mail system, and having problems with \"Invalid Address\" exceptions. Here's the basics of the code:\n // Get system properties\n Properties props = System.getProperties();\n\n // Setup mail server\n props.put(\"mail.smtp.host\", m_sending_host);... |
I'm making a dynamic image for a forum that doesn't allow dynamic images.
I tried using .htacess to redirect all *.png files to image.png... which works perfectly, but from here I can't seem to be able to get the filename of the .png that was requested to generate the content.
For example:
user puts in banana.png
hta... | You can achieve this by using the `RewriteRule` directive in your `.htaccess` file along with a query string. Here's how you can set it up to forward the requested `.png` file to your `image.php` script while passing the filename as a query parameter.
### .htaccess Configuration
You can add the following rules to you... | 28,092 | [
{
"from": "human",
"value": "I'm making a dynamic image for a forum that doesn't allow dynamic images.\nI tried using .htacess to redirect all *.png files to image.png... which works perfectly, but from here I can't seem to be able to get the filename of the .png that was requested to generate the content. ... |
I'm trying to make a simple C# web server that, at this stage, you can access via your browser and will just do a "Hello World".
The problem I'm having is that the server can receive data fine - I get the browser's header information - but the browser doesn't receive anything I send. Furthermore, I can only connect to... | It looks like you are trying to implement a simple HTTP server in C#. The issues you described can occur due to a few common mistakes in handling HTTP responses, network settings, and connection management. Let's break down the potential issues and provide some solutions.
### 1. Sending the Response
The first and most... | 24,550 | [
{
"from": "human",
"value": "I'm trying to make a simple C# web server that, at this stage, you can access via your browser and will just do a \"Hello World\". \nThe problem I'm having is that the server can receive data fine - I get the browser's header information - but the browser doesn't receive anythin... |
This one has me scratching my head.
I'm running Subversion 1.3.1 (r19032) on Ubuntu. All was well until recently when I tried to run svnadmin verify prior to a dump. This is the error message:
svnadmin: Invalid diff stream: insn 0
cannot be decoded
I have looked around for an explanation and fix but can't seem to f... | The error message you are encountering during the `svnadmin verify` operation indicates that there is corruption in your Subversion repository's data. The specific error message "Invalid diff stream: insn 0 cannot be decoded" suggests that the repository's revision data cannot be properly interpreted due to some form o... | 26,598 | [
{
"from": "human",
"value": "This one has me scratching my head.\nI'm running Subversion 1.3.1 (r19032) on Ubuntu. All was well until recently when I tried to run svnadmin verify prior to a dump. This is the error message:\n\nsvnadmin: Invalid diff stream: insn 0\n cannot be decoded\n\nI have looked around... |
How do you find the version of an installed Perl module?
This is in an answer down at the bottom, but I figure it important enough to live up here. With these suggestions, I create a function in my .bashrc
function perlmodver {
perl -M$1 -e 'print "Version " . $ARGV[0]->VERSION . " of " . $ARGV[0] . \
" is ins... | To find the version of an installed Perl module, you can use various methods. Your approach with a custom Bash function is a great way to streamline the process. Here's a refined version of the function you've provided, along with some alternative methods to check module versions in Perl.
### Bash Function
You can de... | 26,708 | [
{
"from": "human",
"value": "How do you find the version of an installed Perl module?\nThis is in an answer down at the bottom, but I figure it important enough to live up here. With these suggestions, I create a function in my .bashrc\nfunction perlmodver {\n perl -M$1 -e 'print \"Version \" . $ARGV[0]... |
In c#, I have a handle to a window ( an IntPtr ), I want to change the background color of that window. How can I do this?
I can get the GDI graphics object for that handle like so:
Graphics graphics = Graphics.FromHwnd(theHandle);
So I should somehow be able to change the background color from this?
I also want to en... | To change the background color of a window in C#, you will need to perform a few steps. The method you mentioned (`Graphics.FromHwnd()`) allows you to draw directly onto the window, but it won't change the background color permanently, as the window will be redrawn by the operating system in response to events like res... | 25,144 | [
{
"from": "human",
"value": "In c#, I have a handle to a window ( an IntPtr ), I want to change the background color of that window. How can I do this?\nI can get the GDI graphics object for that handle like so:\nGraphics graphics = Graphics.FromHwnd(theHandle);\nSo I should somehow be able to change the b... |
Delphi (and probably a lot of other languages) has class helpers. These provide a way to add extra methods to an existing class. Without making a subclass.
So, what are good uses for class helpers?
| Class helpers are a powerful feature that allows you to extend the functionality of existing classes without modifying the original class or creating subclasses. Here are some good uses for class helpers:
1. **Utility Methods**: Class helpers can provide utility methods that enhance the functionality of existing class... | 27,026 | [
{
"from": "human",
"value": "Delphi (and probably a lot of other languages) has class helpers. These provide a way to add extra methods to an existing class. Without making a subclass.\nSo, what are good uses for class helpers?\n"
},
{
"from": "gpt",
"value": "Class helpers are a powerful featur... |
I've been trying to follow the information from:
Long URL clipped to stop breaking the page
and
http://msdn.microsoft.com/en-us/library/ms415817.aspx
Which more or less have the same instructions. I've been copying the .dll file from the build over to the BIN directory of the Sharepoint site.
When I click the Web Part... | It sounds like you are facing some common issues that can occur when deploying a Web Part in SharePoint. Here’s a checklist and steps to ensure everything is correctly set up:
### 1. Verify Assembly Placement
- **DLL in the BIN Directory**: Make sure your `.dll` file is correctly placed in the `BIN` directory of your ... | 29,943 | [
{
"from": "human",
"value": "I've been trying to follow the information from:\nLong URL clipped to stop breaking the page\nand\nhttp://msdn.microsoft.com/en-us/library/ms415817.aspx\nWhich more or less have the same instructions. I've been copying the .dll file from the build over to the BIN directory of t... |
Is there a way to unlock Windows files without downloading a utility?
I have a few files on my Windows XP C: drive that are very old and very useless. When I try to delete these files I get the following message:
Cannot delete FILENAME.zip: It is being used by another person or program
Close any programs that might ... | If you're encountering an issue with a file being "in use" on Windows XP and you don't want to download a utility to unlock it, there are a few methods you can try directly within the operating system. Here are some approaches:
### 1. **Close Related Programs**
Make sure to close any programs that might be accessing t... | 23,353 | [
{
"from": "human",
"value": "Is there a way to unlock Windows files without downloading a utility?\nI have a few files on my Windows XP C: drive that are very old and very useless. When I try to delete these files I get the following message:\n\nCannot delete FILENAME.zip: It is being used by another perso... |
I'm developing an algorithm to parse a number out of a series of short-ish strings. These strings are somewhat regular, but there's a few different general forms and several exceptions. I'm trying to build a set of regexes that will handle the various forms and exceptions; I'll apply them one after another to see if I ... | Yes, you can construct a single regex to capture the number in the format you described, allowing for the optional part enclosed in parentheses.
Given the requirements, here’s a regex pattern you can use:
```regex
([0-9]+)(?: \((.*?)\))? Z
```
### Explanation of the regex:
- `([0-9]+)`: This part captures one or mo... | 28,393 | [
{
"from": "human",
"value": "I'm developing an algorithm to parse a number out of a series of short-ish strings. These strings are somewhat regular, but there's a few different general forms and several exceptions. I'm trying to build a set of regexes that will handle the various forms and exceptions; I'll ... |
I am having a small problem regarding pre-requisites and launch condition for setup.
For example, my setup is having one launch condition requiring "Software1" and one prerequisite installing "Software2".
So, if a system does not have both requirements "Software1" and "Software2" on installing the setup:
Is it shows t... | When creating a setup installer that has both launch conditions and prerequisites, it's important to manage the order of checks so that users are prompted in a logical sequence. Here's a breakdown of how to handle the scenario you're describing, as well as some tips to control the flow of the installation process:
###... | 25,990 | [
{
"from": "human",
"value": "I am having a small problem regarding pre-requisites and launch condition for setup.\nFor example, my setup is having one launch condition requiring \"Software1\" and one prerequisite installing \"Software2\".\nSo, if a system does not have both requirements \"Software1\" and \"... |
I have data from MySQL showing all organisations a customer got, with all details of employess in each organisation. I want to list each organisation name only once i.e. in a single cell ( row span) and all employees in that organisation against this name like:
Org1 Emp1 Name, Emp1 Phone, Emp1 Address
Emp2... | To display the data in the specified format using a single SQL query, we can use the concept of grouping and concatenation in SQL. However, handling the visual presentation of this data (like row spanning) will typically be done on the front-end (e.g., using HTML/CSS in a web application) rather than in the SQL query i... | 26,420 | [
{
"from": "human",
"value": "I have data from MySQL showing all organisations a customer got, with all details of employess in each organisation. I want to list each organisation name only once i.e. in a single cell ( row span) and all employees in that organisation against this name like:\nOrg1 Emp1 Na... |
Lets say I have several web sites on my web server, all as applications under one domain. How could I register other domains to point to the same web server, and redirect requests to, e.g. a web site linked to the requesting domain?
I know I'll have to have a root site, and I'm guessing I may have have to do some vood... | To achieve the functionality you're describing—where multiple domains point to a single web server and redirect requests to the appropriate application or sub-site while keeping the original domain in the address bar—you can follow these steps:
### Step 1: Domain Registration and DNS Configuration
1. **Register the A... | 19,653 | [
{
"from": "human",
"value": "Lets say I have several web sites on my web server, all as applications under one domain. How could I register other domains to point to the same web server, and redirect requests to, e.g. a web site linked to the requesting domain?\nI know I'll have to have a root site, and I'... |
ASP.NET ASMX service occasionally throws exceptions. However, global.asax Application_Error method do not seem to catch them. The question is, how to configure global error handler to catch and log these exceptions?
| In ASP.NET ASMX web services, exceptions can sometimes escape the standard error handling mechanisms, including the `Application_Error` method in the `Global.asax` file. To ensure that exceptions are caught and logged appropriately, you can follow these strategies:
### 1. Use the `HttpApplication` class
By deriving f... | 22,615 | [
{
"from": "human",
"value": "ASP.NET ASMX service occasionally throws exceptions. However, global.asax Application_Error method do not seem to catch them. The question is, how to configure global error handler to catch and log these exceptions?\n"
},
{
"from": "gpt",
"value": "In ASP.NET ASMX we... |
I would like to use a TypeCoverter to regionalise output for enums in an assembly that is a PIA loaded into Excel.
I can run this and it works on an assembly in a test project I created with an explicitly referenceed assembly, however when running a project that has been built as an Excel PIA. If I try:
_
public enum... | When dealing with Excel and Primary Interop Assemblies (PIAs), there are specific considerations that could lead to the behavior you're encountering with the `TypeConverter` and localization of enums.
Here are some possible reasons and solutions to your issue:
1. **TypeConverter Registration**:
Ensure that your `L... | 21,580 | [
{
"from": "human",
"value": "I would like to use a TypeCoverter to regionalise output for enums in an assembly that is a PIA loaded into Excel.\nI can run this and it works on an assembly in a test project I created with an explicitly referenceed assembly, however when running a project that has been built ... |
I want to compute for month difference of 2 dates which will return a float value.
example:
date1='4/23/2008'
date2='12/31/2008'
that will be 7.y months. I want to find the y value. can someone give me the formula to make this in sql codes? tnx..
| To compute the month difference between two dates in SQL, returning a float value representing the total difference in months, you can use a combination of date functions.
Assuming you are working with a SQL database that supports standard date functions, you can use the following formula to achieve this. Below is a ... | 29,264 | [
{
"from": "human",
"value": "I want to compute for month difference of 2 dates which will return a float value.\nexample:\ndate1='4/23/2008'\ndate2='12/31/2008'\nthat will be 7.y months. I want to find the y value. can someone give me the formula to make this in sql codes? tnx..\n"
},
{
"from": "gpt... |
Using data binding, how do you bind a new object that uses value types?
Simple example:
public class Person() {
private string _firstName;
private DateTime _birthdate;
private int _favoriteNumber;
//Properties
}
If I create a new Person() and bind it to a form with text boxes. Birth Date displays as... | In Silverlight (as well as in WPF and WinForms), the challenge of binding new objects with value types is that value types cannot be `null`, which can lead to unwanted default values being displayed in your UI. However, you can address this challenge with a few strategies.
### Solution Overview
1. **Use Nullable Valu... | 23,441 | [
{
"from": "human",
"value": "Using data binding, how do you bind a new object that uses value types? \nSimple example:\npublic class Person() {\n private string _firstName;\n private DateTime _birthdate;\n private int _favoriteNumber;\n //Properties\n}\n\nIf I create a new Person() and bind it ... |
I'm using a small site to experiment with the uploading of pictures and displaying them.
When someone clicks "add a picture", they get taken to a page with a form on it. They can select a file and click the submit button.
But what I want to do now is this: put a second submit button labeled "Cancel" next to the normal ... | To implement a "Cancel" functionality for file uploads without using JavaScript can be quite tricky, especially since PHP processes requests sequentially and cannot interrupt an ongoing file upload once it has started. However, we can explore a design that allows you to cancel an upload if the user decides to click the... | 24,538 | [
{
"from": "human",
"value": "I'm using a small site to experiment with the uploading of pictures and displaying them.\nWhen someone clicks \"add a picture\", they get taken to a page with a form on it. They can select a file and click the submit button.\nBut what I want to do now is this: put a second submi... |
FxCop has the CollectionPropertiesShouldBeReadOnly rule that complains if your class has some kind of collection property that clients can set. Instead, it suggests making the property read-only and supplying a Clear() method and Add() or AddRange() methods for changing the contents of the collection.
I agree that make... | It sounds like you're facing a common dilemma when using FxCop's best practices alongside the Spring framework's dependency injection mechanism. Indeed, the recommendation of using read-only collection properties for better encapsulation contrasts with how Spring typically manages dependency injection, especially for c... | 28,088 | [
{
"from": "human",
"value": "FxCop has the CollectionPropertiesShouldBeReadOnly rule that complains if your class has some kind of collection property that clients can set. Instead, it suggests making the property read-only and supplying a Clear() method and Add() or AddRange() methods for changing the cont... |
I have a VB 6 application and we are starting to port it over to C#. We have finished one of the screens and wanted to see if there was an incremental way of hosting the winform within VB to start to have the existing users get used to new screens. This is a migration strategy..
Any thoughts.
| Porting an application from VB6 to C# and using WinForms can be a complex task, but having an incremental migration strategy can definitely help ease the transition for existing users. Here are some strategies you might consider for hosting a WinForms application within a VB6 application:
### 1. Use COM Interop
You ca... | 22,856 | [
{
"from": "human",
"value": "I have a VB 6 application and we are starting to port it over to C#. We have finished one of the screens and wanted to see if there was an incremental way of hosting the winform within VB to start to have the existing users get used to new screens. This is a migration strategy... |
I have to generate two random sets of matrices
Each containing 3 digit numbers ranging from 2 - 10
like that
matrix 1: 994,878,129,121
matrix 2: 272,794,378,212
the numbers in both matrices have to be greater then 100 and less then 999
BUT
the mean for both matrices has to be in the ratio of 1:2 or 2:3... | Certainly! You can achieve this by first generating random matrices with the required constraints (3-digit numbers between 100 and 999) and then adjusting the numbers to meet the mean ratio condition. Here's a step-by-step guide on how to do this:
### Steps to Generate the Matrices
1. **Generate Random Numbers**: Cre... | 27,110 | [
{
"from": "human",
"value": "I have to generate two random sets of matrices\nEach containing 3 digit numbers ranging from 2 - 10 \nlike that\nmatrix 1: 994,878,129,121\nmatrix 2: 272,794,378,212\nthe numbers in both matrices have to be greater then 100 and less then 999\nBUT\nthe mean for both ... |
This is a follow-up to a previous question I had about interfaces. I received an answer that I like, but I'm not sure how to implement it in VB.NET.
Previous question:
Should this property be part of my object's interface?
public interface Foo{
bool MyMinimallyReadOnlyPropertyThatCanAlsoBeReadWrite {get;}
}
How can... | In VB.NET, you can define an interface with a read-only property and then implement it in a class while allowing the property to be both read-only (through the interface) and read-write (in the implementation).
Here's how you can achieve this:
1. **Define the Interface**: The interface will declare the property as r... | 27,102 | [
{
"from": "human",
"value": "This is a follow-up to a previous question I had about interfaces. I received an answer that I like, but I'm not sure how to implement it in VB.NET.\nPrevious question:\nShould this property be part of my object's interface?\npublic interface Foo{\n bool MyMinimallyReadOnlyPro... |
I need to convert from a SQLVARCHAR to a string data type
Variable definitions as follows:
string strFirstName;
SQLVARCHAR rtnFirstName[50];
Want to be able to accomplish the following:
if (strFirstName.empty()) strFirstName = rtnFirstName;
Gives an error that the binary '=': no operator found which takes a right-ha... | To convert the `SQLVARCHAR` to a `std::string` in C++, you need to first extract the string value from the `SQLVARCHAR` array. Since `SQLVARCHAR` is typically a type used in database interfaces and often comes as a fixed-size array (in this case, `SQLVARCHAR[50]`), you will need to manage this conversion properly.
Th... | 23,288 | [
{
"from": "human",
"value": "I need to convert from a SQLVARCHAR to a string data type\nVariable definitions as follows:\nstring strFirstName;\n\nSQLVARCHAR rtnFirstName[50];\n\nWant to be able to accomplish the following:\nif (strFirstName.empty()) strFirstName = rtnFirstName;\n\nGives an error that the bi... |
I've got a web application that is running against Windows Authentication using our Active Directory. I've got a new requirement to pull some personal information through from the Active Directory entry. What would be the easiest way to get access to this information?
| To access additional personal information from Active Directory (AD) for users authenticated through Windows Authentication, you can use the `System.DirectoryServices` or `System.DirectoryServices.AccountManagement` namespaces in .NET. Here are the steps you can follow to access the required user information:
### 1. R... | 21,575 | [
{
"from": "human",
"value": "I've got a web application that is running against Windows Authentication using our Active Directory. I've got a new requirement to pull some personal information through from the Active Directory entry. What would be the easiest way to get access to this information?\n"
},
... |
I'm searching a C# component or code snipped that does something like that:
I want to inform new users about the most important program functions if he opens a new window for example.
It should be a box showing text (formated if possible) that is of course not modal and has some mechanism to 'go out of the way' if the ... | You can achieve your goal of showing informative tooltips or messages to new users in a C# Windows Forms application by creating a custom user control that can display formatted text. You can position this control in a corner of your main window, and implement a mechanism to hide or minimize it when the user hovers ove... | 25,702 | [
{
"from": "human",
"value": "I'm searching a C# component or code snipped that does something like that:\nI want to inform new users about the most important program functions if he opens a new window for example.\nIt should be a box showing text (formated if possible) that is of course not modal and has so... |
I'm having a bit of trouble trying to get class variables to work in javascript.
I thought that I understood the prototype inheritance model, but obviously not. I assumed that since prototypes will be shared between objects then so will their variables.
This is why this bit of code confuses me.
What is the correct ... | Your confusion stems from how JavaScript handles properties on objects and how the prototype chain works. Let's clarify the behavior and the reasoning behind it.
### Understanding Prototype and Instance Properties
1. **Prototype Properties:** When you define a property on an object’s prototype (like `classA.prototype... | 28,014 | [
{
"from": "human",
"value": "I'm having a bit of trouble trying to get class variables to work in javascript. \nI thought that I understood the prototype inheritance model, but obviously not. I assumed that since prototypes will be shared between objects then so will their variables.\nThis is why this bi... |
With more and more code pushed to the Views in Asp.Net MVC (i.e. AJAX, JQuery, etc...), how do you maintain the 'testability'?
How do you test your Views?
How do you test your views with client-side jscript code?
How do you test your Views with Async behavior?
It seems that most examples on the testability of MVC dea... | Testing Views in ASP.NET MVC can indeed be challenging due to the mix of server-side code and client-side scripting (JavaScript, AJAX, jQuery). Here are strategies for maintaining testability, along with methods for testing Views, including those with client-side code and asynchronous behavior.
### Testing ASP.NET MVC... | 24,657 | [
{
"from": "human",
"value": "With more and more code pushed to the Views in Asp.Net MVC (i.e. AJAX, JQuery, etc...), how do you maintain the 'testability'?\n\nHow do you test your Views?\nHow do you test your views with client-side jscript code?\nHow do you test your Views with Async behavior?\n\nIt seems t... |
Following on from a previous question, I am creating a symbolic link on a Server 2008 from a Vista machine using UNC paths. I can create the link just fine. I can go to the Server 2008 box and double click on the link in explorer to open the target file. What I cannot do though is use FileCreateW to get a handle to the... | The error code 1463 (0x5B7) you encountered indicates that the symbolic link type is disabled. In Windows Server 2008 and later, the ability to create and use symbolic links is controlled by a security setting that may not be enabled by default.
### Steps to Enable Symbolic Links in Windows Server 2008
1. **Enable De... | 23,259 | [
{
"from": "human",
"value": "Following on from a previous question, I am creating a symbolic link on a Server 2008 from a Vista machine using UNC paths. I can create the link just fine. I can go to the Server 2008 box and double click on the link in explorer to open the target file. What I cannot do though ... |
I have a method that I would like to call. However, I'm looking for a clean, simple way to kill it or force it to return if it is taking too long to execute.
I'm using Java.
to illustrate:
logger.info("sequentially executing all batches...");
for (TestExecutor executor : builder.getExecutors()) {
logger.info("executin... | If you want to forcefully stop a method execution in Java that does not check for interruptions or does not run in a loop, you can use a separate thread to execute the method and control its execution time. Java does not provide a built-in way to forcibly stop a thread, and attempting to do so can lead to resource leak... | 27,580 | [
{
"from": "human",
"value": "I have a method that I would like to call. However, I'm looking for a clean, simple way to kill it or force it to return if it is taking too long to execute.\nI'm using Java.\nto illustrate:\nlogger.info(\"sequentially executing all batches...\");\nfor (TestExecutor executor : ... |
I have a standard .NET windows service written in C#.
Can it install itself without using InstallUtil?
Should I use the service installer class? How should I use it?
I want to be able to call the following:
MyService.exe -install
And it will have the same effect as calling:
InstallUtil MyService.exe
| Yes, you can create a Windows service in C# that can install itself without using `InstallUtil`, by using the `ServiceInstaller` and `ServiceProcessInstaller` classes. To allow your service to be installed from the command line using `MyService.exe -install`, you'll need to implement this functionality in your service'... | 26,568 | [
{
"from": "human",
"value": "I have a standard .NET windows service written in C#.\nCan it install itself without using InstallUtil?\nShould I use the service installer class? How should I use it?\nI want to be able to call the following:\nMyService.exe -install\n\nAnd it will have the same effect as callin... |
I once heard a prominent scientist say, of global warming, that he didn't realize how much he would have to learn about politics.
I just read an excellent article in DDJ about the Jacobsen verus Katzer case. When in university, I didn't know how much I would have to learn about the law.
It seems to me that a big hole i... | You're right that understanding legal issues, especially those related to copyright and intellectual property, is essential for developers and anyone involved in the tech industry. Here are some resources and strategies to help you become more informed about copyright law and related legal issues in IT:
### Online Cou... | 27,980 | [
{
"from": "human",
"value": "I once heard a prominent scientist say, of global warming, that he didn't realize how much he would have to learn about politics.\nI just read an excellent article in DDJ about the Jacobsen verus Katzer case. When in university, I didn't know how much I would have to learn about... |
I would like to generate a WSDL file from a c++ atl webservice without using a web server. I would like to generate it as part of the visual studio build or as a post build event. I found a program (CmdHelper) that does this for .NET assemblies but it doesn't seem to work for what I need. Any ideas?
| Generating a WSDL (Web Services Description Language) file for a C++ ATL (Active Template Library) web service without using a web server can be challenging, but you can approach it in a couple of ways. Here are some ideas to help you create a WSDL file during the Visual Studio build process or as part of a post-build ... | 22,539 | [
{
"from": "human",
"value": "I would like to generate a WSDL file from a c++ atl webservice without using a web server. I would like to generate it as part of the visual studio build or as a post build event. I found a program (CmdHelper) that does this for .NET assemblies but it doesn't seem to work for ... |
I'm currently working with Db2 Enterprise Server V 8.2 with FixPak 10
And I want to retrieve list of all the open active connections with an instance.
In Oracle there is a utility program called "Top Session" which does the similar task. Is there any equivalent in DB2?
| In Db2, you can | 28,203 | [
{
"from": "human",
"value": "I'm currently working with Db2 Enterprise Server V 8.2 with FixPak 10\nAnd I want to retrieve list of all the open active connections with an instance.\nIn Oracle there is a utility program called \"Top Session\" which does the similar task. Is there any equivalent in DB2?\n"
... |
The problem is very simple. An object needs to notify some events that might be of interest to observers.
When I sat to validate a design that I cooked up now in Ruby just to validate it.. I find myself stumped as to how to implement the object events. In .Net this would be a one-liner.. .Net also does handler method s... | In Ruby, there isn't a built-in event system like the one you find in .NET, but you can implement a simple event system using blocks or by using a module to manage observers. The Ruby way often favors the use of blocks for callbacks rather than strict type signatures, which aligns with the principle of "least surprise"... | 28,524 | [
{
"from": "human",
"value": "The problem is very simple. An object needs to notify some events that might be of interest to observers.\nWhen I sat to validate a design that I cooked up now in Ruby just to validate it.. I find myself stumped as to how to implement the object events. In .Net this would be a o... |
Often, programmers write code that generates other code.
(The technical term is metaprogramming, but it is more common than merely cross-compilers; think about every PHP web-page that generates HTML or every XSLT file.)
One area I find challenging is coming up with techniques to ensure that both the hand-written source... | When it comes to generating HTML from PHP while maintaining clear indentation and readability in the resulting code, there are several techniques you can employ. Here are some strategies that can help ensure both generated and hand-written code are well-structured and maintainable:
### 1. Use Output Buffers
PHP has ou... | 22,217 | [
{
"from": "human",
"value": "Often, programmers write code that generates other code.\n(The technical term is metaprogramming, but it is more common than merely cross-compilers; think about every PHP web-page that generates HTML or every XSLT file.)\nOne area I find challenging is coming up with techniques ... |
I have a requirement to read and display the owner of a file (for audit purposes), and potentially changing it as well (this is secondary requirement). Are there any nice C# wrappers?
After a quick google, I found only the WMI solution and a suggestion to PInvoke GetSecurityInfo
| In C#, you can use the `System.IO` namespace along with the `System.Security.AccessControl` namespace to read and potentially modify the owner of a file. You don't need to rely on WMI or P/Invoke for this, as the .NET Framework provides a nice wrapper for these operations.
Here’s how you can read the owner of a file a... | 27,257 | [
{
"from": "human",
"value": "I have a requirement to read and display the owner of a file (for audit purposes), and potentially changing it as well (this is secondary requirement). Are there any nice C# wrappers?\nAfter a quick google, I found only the WMI solution and a suggestion to PInvoke GetSecurityInf... |
The SQL implementation of relational databases has been around in their current form for something like 25 years (since System R and Ingres). Even the main (loosely adhered to) standard is ANSI-92 (although there were later updates) is a good 15 years old.
What innovations can you think of with SQL based databases in ... | Certainly! While the core SQL language and its fundamental principles have remained relatively static, there have been several noteworthy innovations and enhancements in SQL-based databases over the past decade that extend beyond the areas you mentioned. Here are some additional innovations:
1. **JSON Support**: Many ... | 23,686 | [
{
"from": "human",
"value": "The SQL implementation of relational databases has been around in their current form for something like 25 years (since System R and Ingres). Even the main (loosely adhered to) standard is ANSI-92 (although there were later updates) is a good 15 years old.\nWhat innovations can... |
Im a coding a library including textual feedback that I need to translate.
I put the following lines in a _config.py module that I import everywhere in my app :
import gettext, os, sys
pathname = os.path.dirname(sys.argv[0])
localdir = os.path.abspath(pathname) + "/locale"
gettext.install("messages", localdir)
I have ... | The situation you described poses a potential issue due to the global nature of the `gettext` translation mechanism. When a user sets up their own translation with `gettext.install`, it can overshadow your library's translations. This could lead to conflicts or undesired behavior if both your library and the user are t... | 28,583 | [
{
"from": "human",
"value": "Im a coding a library including textual feedback that I need to translate.\nI put the following lines in a _config.py module that I import everywhere in my app :\nimport gettext, os, sys\npathname = os.path.dirname(sys.argv[0])\nlocaldir = os.path.abspath(pathname) + \"/locale\"... |
The fundamental equation of weight loss/gain is:
weight_change = convert_to_weight_diff(calories_consumed - calories_burnt);
I'm going on a health kick, and like a good nerd I thought I'd start keeping track of these things and write some software to process my data. I'm not attentive and disciplined enough to count c... | To create a function that converts a difference in calories to a weight change in pounds or kilograms, we need to consider the conversion factors that relate calories to weight. The general rule is that a deficit or surplus of approximately 3,500 calories results in a change of about 1 pound of body weight. Similarly, ... | 28,873 | [
{
"from": "human",
"value": "The fundamental equation of weight loss/gain is:\nweight_change = convert_to_weight_diff(calories_consumed - calories_burnt);\n\nI'm going on a health kick, and like a good nerd I thought I'd start keeping track of these things and write some software to process my data. I'm not... |
I have to override Add method of "Controls" property of myControl that is extended from a Panel control of windows. For that i extended ControlCollection class into MyControlCollection where i overriden its Add method. Now i declared a Controls property of MyControlCollection type to hide panel's Controls property. Whe... | When you extend a Panel control and override the `Add` method in your custom `ControlCollection` (in this case, `MyControlCollection`), you need to ensure that the custom collection is used properly in the designer as well. However, simply overriding the `Controls` property and defining a new property of your custom co... | 30,097 | [
{
"from": "human",
"value": "I have to override Add method of \"Controls\" property of myControl that is extended from a Panel control of windows. For that i extended ControlCollection class into MyControlCollection where i overriden its Add method. Now i declared a Controls property of MyControlCollection ... |
I was browsing the Hidden Features of C# question and thought I would try out one of the features I was unfamiliar with. Unfortunately I use Visual Studio 2005 and the feature in question was introduced later. Is there a good list for new features in C# 3.0 (Visual Studio 2008) vs. C# 2.0 (Visual Studio 2005)?
| Certainly! C# 3.0 introduced several significant features compared to C# 2.0. Here’s a list of the notable new features you can find in C# 3.0 as compared to C# 2.0:
### 1. **Language Integrated Query (LINQ)**
- LINQ allows querying of data from different sources (like arrays, collections, databases) using a unifie... | 26,357 | [
{
"from": "human",
"value": "I was browsing the Hidden Features of C# question and thought I would try out one of the features I was unfamiliar with. Unfortunately I use Visual Studio 2005 and the feature in question was introduced later. Is there a good list for new features in C# 3.0 (Visual Studio 200... |
I'd like to align label/value pairs in the center using CSS without using absolute positioning or tables (see screen shot). In that screen shot I positioned the value (ie. $4,500/wk) absolute and then floated the label right up against it. But absolute doesn't work so well in IE and I've heard it's not a good techniq... | You can achieve center alignment of label/value pairs without using absolute positioning or tables by using a combination of CSS flexbox or CSS grid. Below, I'll demonstrate how to use both methods. You can choose the one that fits your needs better.
### Method 1: Flexbox
Here's how you can use flexbox to align your ... | 25,007 | [
{
"from": "human",
"value": "I'd like to align label/value pairs in the center using CSS without using absolute positioning or tables (see screen shot). In that screen shot I positioned the value (ie. $4,500/wk) absolute and then floated the label right up against it. But absolute doesn't work so well in ... |
When you unload a project in Visual Studio, any referencing projects get warning triangles on their reference to the unloaded project. I've written myself a macro to do clever stuff (detect add/remove of project and transform any references from-to file/project dependency), but I can't believe that I'm not missing some... | Unloading projects in Visual Studio is indeed a common practice to enhance performance when working with large solutions, especially when some projects are not actively being worked on. However, managing project references when unloading is a concern, as you’ve noticed with the warning triangles that indicate broken re... | 25,389 | [
{
"from": "human",
"value": "When you unload a project in Visual Studio, any referencing projects get warning triangles on their reference to the unloaded project. I've written myself a macro to do clever stuff (detect add/remove of project and transform any references from-to file/project dependency), but ... |
I am writing a Java Application for Data Entry using Eclipse and SWT. Naturally it has a great many Text objects.
What I would like to happen is that when user enters something into one field focus automatically changes to the next field.
Thanks in advance
| To achieve automatic focus change between text fields in a Java SWT application, you can listen for key events on each Text widget. Specifically, you can listen for the `KeyEvent` when the user presses the `Enter` key, and then set the focus to the next Text field.
Here’s a simple example to illustrate how you can do ... | 27,304 | [
{
"from": "human",
"value": "I am writing a Java Application for Data Entry using Eclipse and SWT. Naturally it has a great many Text objects. \nWhat I would like to happen is that when user enters something into one field focus automatically changes to the next field.\nThanks in advance\n"
},
{
"fr... |
Simple question. If you have a compiled and published ASP.NET web application running on a server and you need to update, say, a line in one of the codebehind files. Do you shut down the entire site, republish, then load the site back up? Or do you publish straight to your live site with users still using it?
| In general, the approach to updating a compiled ASP.NET web application while minimizing downtime and impact on users can vary based on the specifics of your deployment strategy and the nature of the changes. However, here are some common practices:
### 1. **No Downtime Deployment (Hot Deployment)**:
- **Publish Direc... | 27,467 | [
{
"from": "human",
"value": "Simple question. If you have a compiled and published ASP.NET web application running on a server and you need to update, say, a line in one of the codebehind files. Do you shut down the entire site, republish, then load the site back up? Or do you publish straight to your li... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.