instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Our application is an Xbap running in full trust. I have a function similar to this:
private void ShowPage(Page page)
{
NavigationWindow mainWindow = Application.Current.MainWindow as NavigationWindow;
mainWindow.Navigate(page);
}
This works great for browsing inside an existing window. I would like to open ... | In WPF (Windows Presentation Foundation), an XBAP application typically runs in a browser and is constrained in certain ways, including how it handles navigation. If you want to open a new page in a separate window, you can't directly use the `NavigationWindow` and `Navigate` method since it is designed for navigating ... | 46,821 | [
{
"from": "human",
"value": "Our application is an Xbap running in full trust. I have a function similar to this:\nprivate void ShowPage(Page page)\n{\n NavigationWindow mainWindow = Application.Current.MainWindow as NavigationWindow; \n mainWindow.Navigate(page);\n}\n\nThis works great for browsing ... |
Has anybody tried to use JavaFX Script in server side applications?
The language itself looks quite nice and modern, and is fully Java compatible. If Sun is serious about it, it could be quite ubiquitus on the server side too, where Java is strong.
What do you think?
| JavaFX Script was designed primarily as a declarative scripting language for building rich internet applications (RIAs) with a focus on client-side user interfaces. It was specifically created to provide a more intuitive way to develop Java applications for the desktop and web, and it integrates tightly with JavaFX's r... | 48,584 | [
{
"from": "human",
"value": "Has anybody tried to use JavaFX Script in server side applications?\nThe language itself looks quite nice and modern, and is fully Java compatible. If Sun is serious about it, it could be quite ubiquitus on the server side too, where Java is strong.\nWhat do you think?\n"
},
... |
I'm trying to find a markdown interpreter class/module that I can use in a rakefile.
So far I've found maruku, but I'm a bit wary of beta releases.
Has anyone had any issues with maruku? Or, do you know of a better alternative?
| If you're looking for a Markdown interpreter to use in a Rakefile, there are several options you can consider aside from Maruku. Here are a few popular alternatives that are stable and well-maintained:
1. **Redcarpet**: This is a widely used and highly configurable Markdown parser that is written in C, which makes it ... | 46,396 | [
{
"from": "human",
"value": "I'm trying to find a markdown interpreter class/module that I can use in a rakefile.\nSo far I've found maruku, but I'm a bit wary of beta releases.\nHas anyone had any issues with maruku? Or, do you know of a better alternative?\n"
},
{
"from": "gpt",
"value": "If y... |
I there a PHP based source control 'server' that is compatible with SVN clients?
I'd like to host my SVN on my hosting servers, however the current host will not allow me to start any process or install any software
| If you're looking for a PHP-based solution to host an SVN repository on a server that doesn't allow for starting processes or installing additional software, your options are somewhat limited, but there are a few potential solutions you can consider:
1. **SVN Hosting Services**: Rather than setting up your own server,... | 45,890 | [
{
"from": "human",
"value": "I there a PHP based source control 'server' that is compatible with SVN clients?\nI'd like to host my SVN on my hosting servers, however the current host will not allow me to start any process or install any software\n"
},
{
"from": "gpt",
"value": "If you're looking... |
I'm doing some really simple math and saving the result to a MS SQL2008 DB.
I'm averaging out the some numbers, which are byte values between 1<->5. I wish to record probably 2 decimal places only. I don't care about rounding for the 2nd decimal place (eg. a 1.155 == 1.5 or 1.6 .. i'm not too phased).
So .. should i st... | When it comes to storing averaged values with two decimal places, you should consider the following:
### Data Types
1. **Float**: This is a floating-point number, which is suitable for scientific calculations but is not ideal for financial calculations or situations where precision matters (like your case with decima... | 46,551 | [
{
"from": "human",
"value": "I'm doing some really simple math and saving the result to a MS SQL2008 DB.\nI'm averaging out the some numbers, which are byte values between 1<->5. I wish to record probably 2 decimal places only. I don't care about rounding for the 2nd decimal place (eg. a 1.155 == 1.5 or 1.6... |
I seem to recall that there is an HTML tag that escapes absolutely everything inside it except the matching closing tag. Kind of like <plaintext> but not fundamentally broken.
| Yes, you're likely thinking of the `<textarea>` tag, which is used in HTML to create a multi-line text input field. Everything you place inside a `<textarea>` element is treated as plain text and displayed as it is, without any HTML parsing or rendering.
However, if you're specifically looking for an HTML element that... | 46,702 | [
{
"from": "human",
"value": "I seem to recall that there is an HTML tag that escapes absolutely everything inside it except the matching closing tag. Kind of like <plaintext> but not fundamentally broken.\n"
},
{
"from": "gpt",
"value": "Yes, you're likely thinking of the `<textarea>` tag, which... |
What are the coolest new features that you guys are looking for, or that you've heard are releasing in c# 4.0.
| C# 4.0, released in 2010, introduced several new features that significantly enhanced the language. Here are some of the coolest new features that developers appreciated:
1. **Dynamic Typing**: One of the most notable features introduced in C# 4.0 is the `dynamic` keyword, which allows developers to bypass compile-tim... | 44,279 | [
{
"from": "human",
"value": "What are the coolest new features that you guys are looking for, or that you've heard are releasing in c# 4.0.\n"
},
{
"from": "gpt",
"value": "C# 4.0, released in 2010, introduced several new features that significantly enhanced the language. Here are some of the co... |
I heard that Visual Studio came with an Image Library, but I can't find it anywhere. Does anyone know where it is?
| In older versions of Visual Studio, there was an Image Library that included a variety of icons and images you could use in your applications. However, starting from Visual Studio 2013 and onward, Microsoft removed the built-in Image Library from the installation.
If you're looking for icons or images to use in your a... | 46,110 | [
{
"from": "human",
"value": "I heard that Visual Studio came with an Image Library, but I can't find it anywhere. Does anyone know where it is?\n"
},
{
"from": "gpt",
"value": "In older versions of Visual Studio, there was an Image Library that included a variety of icons and images you could us... |
Is there a way to do this without iterating through the List and adding the items to the ObservableCollection?
| Yes, there are ways to add items from a `List` to an `ObservableCollection` without manually iterating through the list in a loop, especially if you're looking for more concise or efficient methods. Here are a few approaches you could consider:
### 1. Use a Constructor Overload
You can initialize an `ObservableCollect... | 43,576 | [
{
"from": "human",
"value": "Is there a way to do this without iterating through the List and adding the items to the ObservableCollection?\n"
},
{
"from": "gpt",
"value": "Yes, there are ways to add items from a `List` to an `ObservableCollection` without manually iterating through the list in ... |
I have a MultipleChoiceField on a form holding car makes. I want to filter my database of cars to the makes that were checked but this causes a problem. How do I get all the Q(make=...) statements in dynamically?
How I start: ['value1', 'value2', ...]
How I want to end: Q(col='value1') | Q(col='value2') | ...
I've coup... | To dynamically construct a Q object for multiple values in Django, you can use the `reduce` function combined with the `Q` object from `django.db.models`. This approach will allow you to efficiently create a compound Q object that can be used in a query to filter your database records based on the selected car makes.
... | 47,004 | [
{
"from": "human",
"value": "I have a MultipleChoiceField on a form holding car makes. I want to filter my database of cars to the makes that were checked but this causes a problem. How do I get all the Q(make=...) statements in dynamically?\nHow I start: ['value1', 'value2', ...]\nHow I want to end: Q(col=... |
I created a windows service that's basically a file watcher that wont run unless a user is logged into the machine its on. The service is running on a Windows Server 2003 machine. It is designed to move the files that are put into one directory into a different directory based on keywords in the file names, but none ... | The behavior you're experiencing with your Windows Service is likely due to the service needing an interactive session to function correctly, which is not typical for services. Windows Services are designed to run in the background without user interaction, and they are generally not intended to require a user to be lo... | 44,059 | [
{
"from": "human",
"value": "I created a windows service that's basically a file watcher that wont run unless a user is logged into the machine its on. The service is running on a Windows Server 2003 machine. It is designed to move the files that are put into one directory into a different directory based... |
Same as title!
EDIT: Almost exactly the same as, and would be contextually equal to What is unit testing?
| **What is unit testing?**
Unit testing is a software testing technique where individual components or pieces of code (known as "units") are tested in isolation to ensure they function correctly. The primary goal of unit testing is to validate that each unit of the software performs as expected. This typically involves... | 46,923 | [
{
"from": "human",
"value": "Same as title! \nEDIT: Almost exactly the same as, and would be contextually equal to What is unit testing?\n"
},
{
"from": "gpt",
"value": "**What is unit testing?**\n\nUnit testing is a software testing technique where individual components or pieces of code (known... |
I've got a table, called faq_questions with the following structure:
id int not_null auto_increment,
question varchar(255),
sort_order int
I'm attempting to build a query that given a sort order, selects the row with the next highest sort order.
Example:
id question sort_order
1 'This is question 1... | To select the row with the next highest `sort_order` given a known `sort_order`, you can use a SQL query that filters for rows where `sort_order` is greater than the given value and then orders the results by `sort_order` in ascending order, limiting the results to only the first row.
Here is a query that achieves th... | 47,962 | [
{
"from": "human",
"value": "I've got a table, called faq_questions with the following structure:\nid int not_null auto_increment,\nquestion varchar(255),\nsort_order int\n\nI'm attempting to build a query that given a sort order, selects the row with the next highest sort order. \nExample:\nid question ... |
I need to get a count of the number of files in a directory. I could get the names of all the files in the directory using System.IO.Directory.GetFiles() and take the length of that array but that takes too long on large directories. Is there a way to get just the count without having to get the names?
| Yes, there is a more efficient way to get the count of files in a directory without retrieving the names of all the files, especially in large directories. You can use the `System.IO.Directory.EnumerateFiles` method, which returns an `IEnumerable<string>` that you can use with LINQ to efficiently count files without cr... | 45,837 | [
{
"from": "human",
"value": "I need to get a count of the number of files in a directory. I could get the names of all the files in the directory using System.IO.Directory.GetFiles() and take the length of that array but that takes too long on large directories. Is there a way to get just the count withou... |
Is it better to use NOT or to use <> when comparing values in VBScript?
is this:
If NOT value1 = value2 Then
or this:
If value1 <> value2 Then
better?
EDIT:
Here is my counterargument.
When looking to logically negate a Boolean value you would use the NOT operator, so this is correct:
If NOT boolValue1 Then
and... | In VBScript, both `NOT` and `<>` can be used to express "not equal," but they serve slightly different purposes and can impact readability and intent.
### Using `<>`
The expression `If value1 <> value2 Then` is the more straightforward and conventional way to check for inequality in VBScript. It directly expresses th... | 47,106 | [
{
"from": "human",
"value": "Is it better to use NOT or to use <> when comparing values in VBScript?\nis this:\n\nIf NOT value1 = value2 Then\n\nor this:\n\nIf value1 <> value2 Then\n\nbetter?\nEDIT:\nHere is my counterargument. \nWhen looking to logically negate a Boolean value you would use the NOT operat... |
I'm finding a couple for Java in general but no plugins for netbeans that I can see.
Thanks
| If you're looking for a couple of good Java libraries or frameworks to use in your projects, here are some popular ones:
### Java Libraries/Frameworks:
1. **Spring Framework**: A powerful framework for building Java applications. It provides a comprehensive programming and configuration model. Spring Boot, a part of ... | 43,799 | [
{
"from": "human",
"value": "I'm finding a couple for Java in general but no plugins for netbeans that I can see.\nThanks\n"
},
{
"from": "gpt",
"value": "If you're looking for a couple of good Java libraries or frameworks to use in your projects, here are some popular ones:\n\n### Java Librarie... |
Given
@interface Canvas:NSView {
NSNumber * currentToolType;
...
}
declared in my .h file
and in the .m file
- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
if (self) {
currentToolType=[[NSNumber alloc]initWithInt:1];
}
return self;
}
and further down
... | It seems like you're encountering an issue with your `currentToolType` variable not retaining its value between method calls in your `Canvas` class. Let's analyze the code step by step and address potential issues:
1. **Memory Management**: You are using manual memory management (retain/release). In your `selectToolOn... | 42,530 | [
{
"from": "human",
"value": "Given \n@interface Canvas:NSView { \n NSNumber * currentToolType; \n ...\n}\n\ndeclared in my .h file\nand in the .m file\n- (id)initWithFrame:(NSRect)frame {\n self = [super initWithFrame:frame];\n if (self) {\n currentToolType=[[NSNumber alloc]initWit... |
I have a client/server application that must use .NET Remoting (not WCF because the project is using Framework 2).
The following code (copied heavily from MSDN) works:
_clientChannel = new IpcClientChannel();
ChannelServices.RegisterChannel(_clientChannel, false);
IMyOb... | In .NET Remoting, the lines you've mentioned are crucial for setting up and tearing down the communication channel. Here’s a breakdown of what each line does:
1. **`_clientChannel = new IpcClientChannel();`**: This line creates an instance of `IpcClientChannel`, which is a specific type of remoting channel that uses I... | 44,088 | [
{
"from": "human",
"value": "I have a client/server application that must use .NET Remoting (not WCF because the project is using Framework 2).\nThe following code (copied heavily from MSDN) works:\n _clientChannel = new IpcClientChannel();\n\n ChannelServices.RegisterChannel(_... |
We're writing a web application that is trying to replace all ReportManager functionality using calls to Reporting Services SOAP API.
We started working with SSRS 2008 and had our Java code working correctly. We've since had to downgrade to SSRS 2005 and now we're having problems connecting to the Server to get the li... | When dealing with SSRS (SQL Server Reporting Services) SOAP API from a Java application, especially when downgrading from SSRS 2008 to SSRS 2005, a few common issues might arise, particularly concerning authentication and endpoint configurations. Here are some troubleshooting steps and recommendations to help resolve t... | 43,401 | [
{
"from": "human",
"value": "We're writing a web application that is trying to replace all ReportManager functionality using calls to Reporting Services SOAP API.\nWe started working with SSRS 2008 and had our Java code working correctly. We've since had to downgrade to SSRS 2005 and now we're having probl... |
This is a design question and good practice question. How do you structure your Java web development such that a lot of logic is not in the JSP file. Should you use any of the JSP tags for if structures or loops. I see a lot of code where the logic is hard to follow because of poorly designed JSP files. And then wh... | Certainly! When working with JSP (JavaServer Pages) in a Java web application, it's important to adhere to best practices that promote separation of concerns, maintainability, and scalability. Here are some tips and practices to keep in mind:
### 1. MVC Pattern
Utilize the Model-View-Controller (MVC) pattern effectiv... | 44,014 | [
{
"from": "human",
"value": "This is a design question and good practice question. How do you structure your Java web development such that a lot of logic is not in the JSP file. Should you use any of the JSP tags for if structures or loops. I see a lot of code where the logic is hard to follow because o... |
After using nunit for a long time, i've decided to test out Microsoft's built in testing framework.
At the beginning of my tests, I generally clean the database to get it into a state i can rely on for testing.
In my test setup, i delete all the data and insert fresh data for my tests.
Since starting to use the MS test... | When using Microsoft's built-in testing framework (MSTest), the framework does indeed run tests in parallel by default in certain scenarios, which can lead to issues like the ones you're experiencing with shared state, such as database access. Here are a few strategies you can employ to manage test execution and ensure... | 43,984 | [
{
"from": "human",
"value": "After using nunit for a long time, i've decided to test out Microsoft's built in testing framework.\nAt the beginning of my tests, I generally clean the database to get it into a state i can rely on for testing.\nIn my test setup, i delete all the data and insert fresh data for ... |
I'm updating an old project & my version of xdoclet complains about my Java 1.5 annontations (ArrayList data = ....) when parsing for Hibernate (hibernate3) tags.
So my question is this...
Is there a fix for Xdoclet 1.2.3, or should I look to move to Xdoclet2?
I've already started moving some of the code over, but xdoc... | Hi Jeff,
When dealing with legacy tools like XDoclet, compatibility can often be a challenge, especially with newer Java language features and annotations introduced in later versions.
### XDoclet 1.2.3 Compatibility
XDoclet 1.2.3 is quite old and may not fully support Java 1.5 features like annotations. If you're e... | 41,616 | [
{
"from": "human",
"value": "I'm updating an old project & my version of xdoclet complains about my Java 1.5 annontations (ArrayList data = ....) when parsing for Hibernate (hibernate3) tags.\nSo my question is this...\nIs there a fix for Xdoclet 1.2.3, or should I look to move to Xdoclet2?\nI've already st... |
When would I implement IDispose on a class as opposed to a destructor? I read this article, but I'm still missing the point.
My assumption is that if I implement IDispose on an object, I can explicitly 'destruct' it as opposed to waiting for the garbage collector to do it. Is this correct?
Does that mean I should a... | Your understanding is on the right track, but let's clarify some important points about implementing `IDisposable` and destructors in C# (or .NET in general).
### When to Implement `IDisposable`
1. **Resource Management**: Implement `IDisposable` when your class directly uses unmanaged resources (like file handles, d... | 40,303 | [
{
"from": "human",
"value": "When would I implement IDispose on a class as opposed to a destructor? I read this article, but I'm still missing the point. \nMy assumption is that if I implement IDispose on an object, I can explicitly 'destruct' it as opposed to waiting for the garbage collector to do it. ... |
How do you update this? I've never seen any current team that actually "checks out" a file. I don't compile, either. These seem to be from before the days of branching.
You shall check in early and check
in often. You anger your coworkers
when you check out a file and insist
on keeping it checked out until some
future... | The practices you mentioned come from an earlier era of version control systems, particularly those that relied heavily on locking files and manual check-in/check-out processes, like CVS or certain configurations of Subversion (SVN). Modern version control systems, particularly Git, operate quite differently and make m... | 43,771 | [
{
"from": "human",
"value": "How do you update this? I've never seen any current team that actually \"checks out\" a file. I don't compile, either. These seem to be from before the days of branching.\n\nYou shall check in early and check\nin often. You anger your coworkers\nwhen you check out a file and ins... |
I have an function which decodes the encoded base64 data in binary data but I dont know how to find the length of decoded data. I use the BIO functions in openssl.
unsigned char *unbase64(unsigned char *input, int length)
{
BIO *b64, *bmem;
unsigned char *buffer = (unsigned char *)malloc(length);
memset(bu... | To determine the length of the decoded data from the Base64 encoded input, you cannot simply assume that the length of the encoded input corresponds to the length of the decoded output. The Base64 encoding expands the data, which means you will need to calculate the length of the decoded data based on the length of the... | 41,482 | [
{
"from": "human",
"value": "I have an function which decodes the encoded base64 data in binary data but I dont know how to find the length of decoded data. I use the BIO functions in openssl.\nunsigned char *unbase64(unsigned char *input, int length)\n{\n BIO *b64, *bmem;\n\n unsigned char *buffer = ... |
In making a restful ASP.NET MVC app I'm wondering about the best way to structure the projects in my solution. By convention, the controllers reside in the same project as the views. However, if I have a few different presentation tiers accessing my restful controllers, would it be better to put my controllers in a lay... | When structuring your ASP.NET MVC application, especially with RESTful services in mind, it's essential to consider the separation of concerns, maintainability, and scalability. Here are a few common approaches to structuring your projects in the solution, along with some pros and cons:
### Structure Options
1. **Sin... | 43,035 | [
{
"from": "human",
"value": "In making a restful ASP.NET MVC app I'm wondering about the best way to structure the projects in my solution. By convention, the controllers reside in the same project as the views. However, if I have a few different presentation tiers accessing my restful controllers, would it... |
I'm working on a business application which is being developed using DDD philosophy. Database is accessed through NHibernate and data layer is implemented using DAO pattern.
The UML class diagram is shown below.
UML Class Diagram http://img266.imageshack.us/my.php?image=classdiagramhk0.png
http://img266.imageshack.us/... | Your current design and approach have some good aspects, but they also raise some concerns, particularly in relation to dependency management and the Single Responsibility Principle. Here are some points to consider, along with suggestions for improvement.
### Concerns with Current Design:
1. **Tight Coupling**: The ... | 42,478 | [
{
"from": "human",
"value": "I'm working on a business application which is being developed using DDD philosophy. Database is accessed through NHibernate and data layer is implemented using DAO pattern. \nThe UML class diagram is shown below.\nUML Class Diagram http://img266.imageshack.us/my.php?image=class... |
Our processing rule includes two Tranform actions, and a Validate, and Results actions. We want to add another action between the two transform actions to do the following:
The new action will use an XSLT to evaluate an expression. If there is a match, skip the rest of the processing rule actions to go to the last Resu... | To implement the processing rule you've described, using a "Route Action" is indeed a suitable choice. A Route Action allows you to conditionally control the flow of processing based on specific criteria evaluated through an XSLT transformation.
### Action Type:
- **Route Action**: This action will evaluate an XSLT ex... | 44,513 | [
{
"from": "human",
"value": "Our processing rule includes two Tranform actions, and a Validate, and Results actions. We want to add another action between the two transform actions to do the following:\nThe new action will use an XSLT to evaluate an expression. If there is a match, skip the rest of the proc... |
I am working on an app for doing screen scraping of small portions of external web pages (not an entire page, just a small subset of it).
So I have the code working perfectly for scraping the html, but my problem is that I want to scrape not just the raw html, but also the CSS styles used to format the section of the p... | Scraping both HTML and CSS styles for a specific portion of a webpage can be challenging, as CSS is often spread across multiple files and selectors. Here’s a structured approach to help you achieve your goal of scraping the HTML content along with the relevant CSS styles.
### 1. **Identify the HTML Element:**
Firs... | 41,746 | [
{
"from": "human",
"value": "I am working on an app for doing screen scraping of small portions of external web pages (not an entire page, just a small subset of it).\nSo I have the code working perfectly for scraping the html, but my problem is that I want to scrape not just the raw html, but also the CSS ... |
I have a long-running GUI application that outputs various statuses to the user. The user wants to view every status but doesn't want to worry about the screensaver kicking in after the inactivity settings.
Preferably in C#, how do I read the screensaver/power scheme settings (so I can reapply them when my app exits) ... | To manage the screensaver and power settings in a C# GUI application, you can use the `SetThreadExecutionState` function from the Windows API. This allows you to inform the operating system that your application is active and prevent the screensaver and sleep mode from activating. Additionally, you can read the current... | 44,209 | [
{
"from": "human",
"value": "I have a long-running GUI application that outputs various statuses to the user. The user wants to view every status but doesn't want to worry about the screensaver kicking in after the inactivity settings.\nPreferably in C#, how do I read the screensaver/power scheme settings ... |
I am using an IP location lookup to display localised prices to customers depending on whether they are visiting from the UK, US or general EU and defaulting to the US price if the location can't be determined.
I could easily force the system to believe I'm from a specific country for testing but still there is no way... | Using a proxy is indeed a common method for testing localization features of a website, including how different prices are displayed based on geographic location. Here are several approaches you can take to test your site from various countries:
### 1. **Proxy Services**
You can use proxy services that allow you to r... | 44,731 | [
{
"from": "human",
"value": "I am using an IP location lookup to display localised prices to customers depending on whether they are visiting from the UK, US or general EU and defaulting to the US price if the location can't be determined. \nI could easily force the system to believe I'm from a specific cou... |
In a one-to-many relationship what's the best way to handle data so it's flexible enough for the user to save the slave data before he saves the master table data.
reserving the row ID of the master so the I can save de slave data with the reserved master id
save slave data in a temporary table so that when we save th... | In the context of a one-to-many relationship where you want to allow users to upload files (slave data) before they save the associated ticket information (master data), there are a couple of strategies you can employ. Each approach has its pros and cons:
### Option 1: Reserved Row ID Approach
1. **Generate a temporar... | 42,886 | [
{
"from": "human",
"value": "In a one-to-many relationship what's the best way to handle data so it's flexible enough for the user to save the slave data before he saves the master table data.\n\nreserving the row ID of the master so the I can save de slave data with the reserved master id\nsave slave data ... |
I was working on some code recently and came across a method that had 3 for-loops that worked on 2 different arrays.
Basically, what was happening was a foreach loop would walk through a vector and convert a DateTime from an object, and then another foreach loop would convert a long value from an object. Each of these... | Your question touches on several important concepts in software engineering: code efficiency, memory management, and the trade-offs between readability and performance. Let's break down the issues you're dealing with and explore some best practices.
### 1. **Complexity Consideration:**
- Your original code structur... | 40,002 | [
{
"from": "human",
"value": "I was working on some code recently and came across a method that had 3 for-loops that worked on 2 different arrays. \nBasically, what was happening was a foreach loop would walk through a vector and convert a DateTime from an object, and then another foreach loop would convert ... |
Is there an easy way to move around controls on a form exactly the same way as the tab key? This includes moving around cells on a datagridview etc.
| To implement a way to move around controls on a Windows Forms application similar to the Tab key, including navigating through a DataGridView, you can use the KeyDown or KeyPress events to handle the movement. Below are some steps and a code example to demonstrate how to achieve this.
### Step 1: Handling Key Presses
... | 42,586 | [
{
"from": "human",
"value": "Is there an easy way to move around controls on a form exactly the same way as the tab key? This includes moving around cells on a datagridview etc.\n"
},
{
"from": "gpt",
"value": "To implement a way to move around controls on a Windows Forms application similar to... |
I need to replace our Ajax Modal Popup controls with a JavaScript equivalent. We use this as a simple context sensitive help type popup. I did a quick browse but didn't see quite what I was looking for. I just need some text and a simple Close button/link, but I would like the page darkened below the popup, as it does ... | Certainly! If you're looking for a simple JavaScript solution for a modal popup that dims the background, you can easily create one using plain HTML, CSS, and JavaScript without needing any external libraries. Below, I'll provide you with a simple implementation that includes a modal with a close button and a dimmed ba... | 36,799 | [
{
"from": "human",
"value": "I need to replace our Ajax Modal Popup controls with a JavaScript equivalent. We use this as a simple context sensitive help type popup. I did a quick browse but didn't see quite what I was looking for. I just need some text and a simple Close button/link, but I would like the p... |
Hey printing junkies need some pointers to send me in the right direction for this development.
I am developing an epos system for a local shop which we are later going to tie into an ecommerce site.
The front end of the epos system is going to be WinForms so we can handle USB devices easily and we are going to use a ... | When developing a web application that requires printing capabilities, particularly in an ePOS system where you want to print barcodes from a web-based admin console, you'll need to consider several approaches. Here are some pointers to get you started on the right track:
### 1. Understanding the Environment
Before di... | 42,047 | [
{
"from": "human",
"value": "Hey printing junkies need some pointers to send me in the right direction for this development.\nI am developing an epos system for a local shop which we are later going to tie into an ecommerce site. \nThe front end of the epos system is going to be WinForms so we can handle US... |
I'm currently in the process of testing our solution that has the whole "gamut" of layers: UI, Middle, and the omnipresent Database.
Before my arrival on my current team, query testing was done by the testers manually crafting queries that would theoretically return a result set that the stored procedure should return ... | Your situation touches on several important principles of software testing, particularly when it comes to testing complex systems involving databases, APIs, and UIs. Here are some practices and suggestions that can help you improve your testing approach and achieve better end-to-end coverage:
### 1. **Use of a Known D... | 43,829 | [
{
"from": "human",
"value": "I'm currently in the process of testing our solution that has the whole \"gamut\" of layers: UI, Middle, and the omnipresent Database.\nBefore my arrival on my current team, query testing was done by the testers manually crafting queries that would theoretically return a result ... |
I'm trying to implement a Load / Save function for a Windows Forms application.
I've got following components:
A tree view
A couple of list views
A couple of text boxes
A couple of objects (which holds a big dictionarylist)
I want to implement a way to save all of this into a file, and resume/load it later on.
What's... | Using XML serialization is indeed a good approach for saving and loading data in a Windows Forms application, especially when you have structured data like tree views, list views, and custom objects. XML is human-readable, and it can easily represent complex data structures. Below, I’ll outline the steps needed to impl... | 41,249 | [
{
"from": "human",
"value": "I'm trying to implement a Load / Save function for a Windows Forms application.\nI've got following components:\n\nA tree view\nA couple of list views\nA couple of text boxes\nA couple of objects (which holds a big dictionarylist)\n\nI want to implement a way to save all of this... |
I have a game with puzzles. Puzzles are created from script files using a puzzle engine ID. Puzzle engines register themselves using a static variable in a static hash. I'm having reports of crashes and we've tracked down the problem to the hash not having certain keys, which should have been added by the static functi... | The issue you're encountering can be perplexing, particularly since it's intermittent and difficult to reproduce. Here are several possibilities that could help you diagnose and fix the problem:
1. **Static Initialization Order Fiasco**: If `s_hPuzzleFactories` is defined in a different translation unit (i.e., differe... | 44,018 | [
{
"from": "human",
"value": "I have a game with puzzles. Puzzles are created from script files using a puzzle engine ID. Puzzle engines register themselves using a static variable in a static hash. I'm having reports of crashes and we've tracked down the problem to the hash not having certain keys, which sh... |
I'm using a table adapter in Visual Studio to make a query to a stored procedure in my SQL Server 2005 database. When I make the call via my website application it returns nothing. When I make the same call via SQL Server Manager it returns the expected data.
I put a breakpoint on the call to the adapter's getData me... | It sounds like you're encountering a common issue when dealing with `null` values in parameters for your stored procedure. Here are a few things you can check and try to troubleshoot the issue:
1. **Parameter Types**: Ensure that the parameter types in your Table Adapter configuration match the expected types in the s... | 41,852 | [
{
"from": "human",
"value": "I'm using a table adapter in Visual Studio to make a query to a stored procedure in my SQL Server 2005 database. When I make the call via my website application it returns nothing. When I make the same call via SQL Server Manager it returns the expected data.\nI put a breakpoi... |
I would like to deploy a very simple DLL with my C# application, but any DLL that I build in Visual Studio 2008 seems to have a dependency on "Microsoft.VC90.CRT". Is it possible to build a DLL using VS2008 without this dependency? How can I tell what is causing the dependency?
| To build a DLL in Visual Studio 2008 without the "Microsoft.VC90.CRT" dependency, you have a few options to consider. The "Microsoft.VC90.CRT" dependency typically comes from the Microsoft Visual C++ runtime libraries, which are linked when you compile your project with C++ code or using certain features of the C# proj... | 42,673 | [
{
"from": "human",
"value": "I would like to deploy a very simple DLL with my C# application, but any DLL that I build in Visual Studio 2008 seems to have a dependency on \"Microsoft.VC90.CRT\". Is it possible to build a DLL using VS2008 without this dependency? How can I tell what is causing the dependency... |
I have a small web application which uses themes. The themes work on host, so on preinit, if the host = a, load x theme, if the host = b, load y theme.
In my code this looks like:
If request.url.host.contains("a") Then
Page.Theme = x
Else
request.url.host.contains("b") Then
Page.Theme = y
I have a url which is a... | The issue you are experiencing with your web application not rendering styles correctly on a live environment (a.abc.com) while it works perfectly on localhost could be due to a number of factors. Here are some steps to help you troubleshoot and potentially fix the problem:
### 1. **Check CSS File Paths**
Make sure t... | 41,011 | [
{
"from": "human",
"value": "I have a small web application which uses themes. The themes work on host, so on preinit, if the host = a, load x theme, if the host = b, load y theme. \nIn my code this looks like: \nIf request.url.host.contains(\"a\") Then \nPage.Theme = x \nElse \nrequest.url.host.contains(\"... |
Hey I am coding using Visual Studio 2003. My program worked fine until I introduced a dll I made using CreateObject.
Code:
Set docs2 = server.CreateObject("DocGetter.Form1")
docs2.GetDocument oXMLDom,numID
It appears to be getting stuck at this code. I've already used regasm to register the dll.
What else could be wro... | There could be several reasons why your code is getting stuck at the `CreateObject` call or when invoking the method on the created object. Below are some common issues and their corresponding solutions that you can check:
### 1. **Check DLL Registration:**
Make sure that the DLL is correctly registered. You mentio... | 43,971 | [
{
"from": "human",
"value": "Hey I am coding using Visual Studio 2003. My program worked fine until I introduced a dll I made using CreateObject.\nCode:\nSet docs2 = server.CreateObject(\"DocGetter.Form1\")\ndocs2.GetDocument oXMLDom,numID\n\nIt appears to be getting stuck at this code. I've already used re... |
By convention our DB only alows the use of stored procedures for INSERT, UPDATE and DELETE. For some tables / types there is no DELETE stored procedure, because it is not allowed to delete rows. (You can only update the status of such a type to "deleted"). e.g. a customer may be marked as deleted but is never really re... | To prevent the use of the `Delete()` method for certain types in your Data Access Layer (DAL) while adhering to your stored procedure conventions, you can take a few approaches depending on your specific setup. Here's a general strategy you can follow:
### 1. Custom Repository Pattern
Implement a repository pattern wh... | 44,110 | [
{
"from": "human",
"value": "By convention our DB only alows the use of stored procedures for INSERT, UPDATE and DELETE. For some tables / types there is no DELETE stored procedure, because it is not allowed to delete rows. (You can only update the status of such a type to \"deleted\"). e.g. a customer may ... |
I am wondering how you would approach this problem
I have two Taxrates that can apply to my products. I specifically want to avoid persisting the Taxrates into the database while still being able to change them in a central place (like Taxrate from 20% to 19% etc).
so I decided it would be great to have them just compi... | Hi Daniel,
It seems like you're grappling with the need for a flexible, centralized way to manage your tax rates without having to persist them in a database, while also considering localization. Here’s a structured approach to your problem:
### 1. Define the Tax Rate as an Immutable Structure
You can create an immu... | 43,472 | [
{
"from": "human",
"value": "I am wondering how you would approach this problem\nI have two Taxrates that can apply to my products. I specifically want to avoid persisting the Taxrates into the database while still being able to change them in a central place (like Taxrate from 20% to 19% etc).\nso I decide... |
I have a method which prints out the order of a set of images. I need to submit this to a new php page.
I have a form which currently prints out the order to the same page.
<form action="mainpage.php" method="post">
<div style="clear:both;padding-bottom:10px">
<input type="Button" style="width:100px" value="Show o... | To submit the order of the images to your PHP page, you'll want to modify your form and JavaScript function to include a hidden input that stores the `orderString`. Here's how to do it:
1. Add a hidden input field to your form where you can store the `orderString`.
2. Update the `saveImageOrder()` function to set the ... | 44,028 | [
{
"from": "human",
"value": "I have a method which prints out the order of a set of images. I need to submit this to a new php page.\nI have a form which currently prints out the order to the same page.\n<form action=\"mainpage.php\" method=\"post\">\n<div style=\"clear:both;padding-bottom:10px\">\n\n <i... |
Greetings!
I have an XML value that I'd like to use as a boolean value to toggle the visibility of a Panel. I have something like this:
<asp:FormView id="MyFormView" runat="server" DataSourceID="MyXmlDataSource">
<ItemTemplate>
<!-- some stuff -->
<asp:Panel id="MyPanel" runat="server" Visible='<%#... | In ASP.NET Web Forms, when using data binding expressions like `<%# ... %>`, the expression needs to evaluate to a type that the property can accept. The `Visible` property of a Panel expects a boolean value, but your current approach is trying to directly cast the XPath result to a boolean, which can lead to exception... | 45,502 | [
{
"from": "human",
"value": "Greetings!\nI have an XML value that I'd like to use as a boolean value to toggle the visibility of a Panel. I have something like this:\n<asp:FormView id=\"MyFormView\" runat=\"server\" DataSourceID=\"MyXmlDataSource\">\n <ItemTemplate>\n <!-- some stuff -->\n ... |
I'm writing a simple templating layer in PHP but I've got myself a little stuck. Here's how it works at the moment:
Firstly I use fetch_template to load the template contents from the database - this works (and I collect all the templates at startup if you're interested).
I use PHP variables in my template code and in ... | To achieve the functionality you're looking for without using global variables or resorting to external templating engines, you can pass your variables to the `output_template` function as an associative array. This method maintains clean code, avoids potential issues with global state, and provides flexibility.
Here... | 44,885 | [
{
"from": "human",
"value": "I'm writing a simple templating layer in PHP but I've got myself a little stuck. Here's how it works at the moment:\nFirstly I use fetch_template to load the template contents from the database - this works (and I collect all the templates at startup if you're interested).\nI us... |
My question is whether or not Flex's fcsh can be called from within a PHP script. Here is the background:
I have been created a simple process that creates a simple quiz/tutorial by converting a text file into a .mxml file and compiling to a .swf file using the mxmlc compiler. This works well from the command line, b... | Using Flex's `fcsh` (Flex Compiler Shell) in a PHP script can be a bit tricky, but it is possible. The main challenge you may face is the way `exec()` and similar functions handle command-line execution, as well as the potential differences in permissions when running scripts via a web server versus the command line.
... | 44,915 | [
{
"from": "human",
"value": "My question is whether or not Flex's fcsh can be called from within a PHP script. Here is the background:\nI have been created a simple process that creates a simple quiz/tutorial by converting a text file into a .mxml file and compiling to a .swf file using the mxmlc compiler.... |
I'm concerned that this might be working on an NP-Complete problem. I'm hoping someone can give me an answer as to whether it is or not. And I'm looking for more of an answer than just yes or no. I'd like to know why. If you can say,"This is basically this problem 'x' which is/is not NP-Complete. (wikipedia link)"
(No ... | What you're describing is essentially the problem of determining whether two vertices in a graph are connected after the removal of certain vertices or edges, which relates closely to the concepts of **bridges** or **cut vertices** in graph theory.
### Is This Problem NP-Complete?
The specific problem of determining ... | 43,190 | [
{
"from": "human",
"value": "I'm concerned that this might be working on an NP-Complete problem. I'm hoping someone can give me an answer as to whether it is or not. And I'm looking for more of an answer than just yes or no. I'd like to know why. If you can say,\"This is basically this problem 'x' which is/... |
how to get GIF Transparency color in vc++ 6.0 and vc++ 2005 ?
| Handling GIF transparency in VC++ 6.0 and VC++ 2005 requires working with the Windows GDI and possibly some additional libraries for handling GIF files. Here’s a general approach to extracting the transparency color from a GIF image.
### Steps to Get GIF Transparency Color
1. **Load the GIF**: You need to load the GI... | 40,996 | [
{
"from": "human",
"value": "how to get GIF Transparency color in vc++ 6.0 and vc++ 2005 ?\n"
},
{
"from": "gpt",
"value": "Handling GIF transparency in VC++ 6.0 and VC++ 2005 requires working with the Windows GDI and possibly some additional libraries for handling GIF files. Here’s a general ap... |
I am working on an If statement and I want to satisfy two conditions to ignore the loop. This seemed easy at first, but now... I don't know. this is my dilemma...
if((radButton1.checked == false)&&(radButton2.checked == false))
{
txtTitle.Text = "go to work";
}
The dilemma is "go to work" is not executed if radB... | The `if` statement you've written will execute the block of code inside it only if both `radButton1` and `radButton2` are **false**. If `radButton2` is **true**, the condition in the `if` statement evaluates to false because the second part of the condition `(radButton2.checked == false)` is not satisfied. Therefore, t... | 45,428 | [
{
"from": "human",
"value": "I am working on an If statement and I want to satisfy two conditions to ignore the loop. This seemed easy at first, but now... I don't know. this is my dilemma...\nif((radButton1.checked == false)&&(radButton2.checked == false))\n{\n txtTitle.Text = \"go to work\";\n}\n\nTh... |
I have a JavaScript variable which holds an HTML page and due to the setup I need to extract everything between <div id="LiveArea"> and </div> from that variable using JavaScript.
Any help is greatly appreciated.
| You can achieve this by using a combination of JavaScript string methods or regular expressions to extract the content between the specified `<div>` tags. Below are a couple of ways to do this.
### Method 1: Using Regular Expressions
You can use a regular expression to match the content between the `<div id="LiveArea... | 45,327 | [
{
"from": "human",
"value": "I have a JavaScript variable which holds an HTML page and due to the setup I need to extract everything between <div id=\"LiveArea\"> and </div> from that variable using JavaScript.\nAny help is greatly appreciated.\n"
},
{
"from": "gpt",
"value": "You can achieve th... |
is there a free set of controls to be used for representing the OLAP cubes in aspx pages? something like the ones from Dundas, but free and (if possible) cross-browser.
Thanks,
Lucian
| There are several options available for representing OLAP cubes in ASP.NET applications that are free or open-source. While these may not offer the same level of sophistication or features as commercial products like Dundas, they can still provide useful functionality for visualizing OLAP data. Here are a few options t... | 41,802 | [
{
"from": "human",
"value": "is there a free set of controls to be used for representing the OLAP cubes in aspx pages? something like the ones from Dundas, but free and (if possible) cross-browser.\nThanks,\nLucian\n"
},
{
"from": "gpt",
"value": "There are several options available for represen... |
I believe it's the File class but I heard that is very expensive in memory.
Is there a better way to work with file paths?
| Yes, when working with file paths in Python, using the `os.path` module or, preferably, the `pathlib` module is recommended over using the `File` class, especially in terms of managing memory and providing a more convenient interface for file path manipulations.
### 1. Using `os.path`
The `os.path` module provides fu... | 45,270 | [
{
"from": "human",
"value": "I believe it's the File class but I heard that is very expensive in memory.\nIs there a better way to work with file paths?\n"
},
{
"from": "gpt",
"value": "Yes, when working with file paths in Python, using the `os.path` module or, preferably, the `pathlib` module i... |
There is a 2D java graphics library called Slick 2D (http://slick.cokeandcode.com/) that seems to be used by a bunch of indie games (mostly applets), but the documentation is a little lacking. Does anyone know of any good tutorials for this lib?
| Slick2D is indeed a popular library for 2D game development in Java, but you're right that the official documentation can be a bit sparse. Fortunately, there are several community resources and tutorials that can help you get started:
1. **Slick2D Wiki**: While it may not be exhaustive, the official [Slick2D Wiki](htt... | 46,155 | [
{
"from": "human",
"value": "There is a 2D java graphics library called Slick 2D (http://slick.cokeandcode.com/) that seems to be used by a bunch of indie games (mostly applets), but the documentation is a little lacking. Does anyone know of any good tutorials for this lib?\n"
},
{
"from": "gpt",
... |
How can I create a program to convert binary to decimal using a stack in C#?
| You can create a program to convert binary to decimal using a stack in C#. Below is a simple implementation of how you might achieve this.
### Steps to Implement the Binary to Decimal Conversion using a Stack:
1. **Create a Stack**: Use a stack to hold the binary digits.
2. **Push the Binary Digits onto the Stack**: ... | 43,992 | [
{
"from": "human",
"value": "How can I create a program to convert binary to decimal using a stack in C#?\n"
},
{
"from": "gpt",
"value": "You can create a program to convert binary to decimal using a stack in C#. Below is a simple implementation of how you might achieve this.\n\n### Steps to Im... |
I am creating a WPF Application using VS 2005. I download the add on to create the WPF application. Now for deploying the application I need the installer to automatically download the WPF components. Please note that I cannot installed 3.5 framework on the client's machine. There are some rules and things that prevent... | Deploying a WPF application without the ability to install the .NET Framework 3.5 on the client machines can be challenging, given that WPF is tightly coupled with this framework. However, you can consider several options to mitigate this issue:
### 1. **Bootstrapper Approach:**
Since you mentioned that you cannot ins... | 44,358 | [
{
"from": "human",
"value": "I am creating a WPF Application using VS 2005. I download the add on to create the WPF application. Now for deploying the application I need the installer to automatically download the WPF components. Please note that I cannot installed 3.5 framework on the client's machine. The... |
I'm trying to learn about Expression trees, and I've created a method that takes an
Expression<Func<bool>>
and executes it if it satisfies some conditions - see the code below.
private static void TryCommand(Expression<Func<bool>> expression)
{
var methodCallExpression = expression.Body as... | The issue you're encountering is due to how the expression is compiled and executed. When you compile the expression using `expression.Compile()`, it does not retain the instance of `MyClass` that the method is supposed to operate on. Instead, `func.Target` is `null` because the compiled delegate does not have a target... | 46,734 | [
{
"from": "human",
"value": "I'm trying to learn about Expression trees, and I've created a method that takes an\nExpression<Func<bool>> \n\nand executes it if it satisfies some conditions - see the code below.\n private static void TryCommand(Expression<Func<bool>> expression)\n {\n ... |
I'm using Spring's dependency injection but I'm running into difficulty loading a resource in my Spring config file.
The resource is an XML file and is in a JAR file on my classpath. I try to access it as follows:
<import resource="classpath:com/config/resources.xml" />
however I keep getting encountering the followi... | When using Spring to load resources from a classpath, it's important to ensure that the resource path you provide is correct and that the resource is indeed accessible from the classpath. Let's go through a few steps to troubleshoot your issue:
### 1. Verify the Resource Path
Double-check that the path you are using ... | 43,170 | [
{
"from": "human",
"value": "I'm using Spring's dependency injection but I'm running into difficulty loading a resource in my Spring config file. \nThe resource is an XML file and is in a JAR file on my classpath. I try to access it as follows:\n<import resource=\"classpath:com/config/resources.xml\" />\n\n... |
My compact framework application creates a smooth-scrolling list by rendering all the items to a large bitmap surface, then copying that bitmap to an offset position on the screen so that only the appropriate items show. Older versions only rendered the items that should appear on screen at the time, but this approach... | An `OutOfMemoryException` in your application can be particularly challenging, especially when you're dealing with large bitmap objects. Here are some strategies you can employ to potentially prevent the exception and better manage memory usage:
### 1. Optimize Bitmap Size
- **Reduce Bitmap Dimensions**: Check if you ... | 43,309 | [
{
"from": "human",
"value": "My compact framework application creates a smooth-scrolling list by rendering all the items to a large bitmap surface, then copying that bitmap to an offset position on the screen so that only the appropriate items show. Older versions only rendered the items that should appear... |
Recently an application I wrote started not working on Internet Explorer. There has been no change to the underlying (ruby on rails) code.
In IE 6 or IE 7, I can make one request (HTTP Post) to the app, but when I try to make a 2nd request, I get an "Operation Aborted" message. Everything works fine in firefox. The HT... | This issue seems to be related to the peculiarities of Internet Explorer 6 and 7, which have been known to exhibit a number of quirks and bugs, especially in handling certain types of HTTP responses. The fact that you can make one successful request and then face the "Operation Aborted" error on the second request sugg... | 42,538 | [
{
"from": "human",
"value": "Recently an application I wrote started not working on Internet Explorer. There has been no change to the underlying (ruby on rails) code.\nIn IE 6 or IE 7, I can make one request (HTTP Post) to the app, but when I try to make a 2nd request, I get an \"Operation Aborted\" messa... |
I get the above error whenever I try and use ActionLink ? I've only just started playing around with MVC and don't really understand what it's problem is with the code (below):
<%= Html.ActionLink("Lists", "Index", "Lists"); %>
This just seems to be a parsing issue but it only happens when I run the page. The applicat... | The error message you're encountering is related to the syntax in your ASP.NET MVC view. Specifically, the issue arises from using `<%= %>` syntax along with the `Html.ActionLink` method.
The `Html.ActionLink` method generates a hyperlink, and it doesn't return a simple string that can be used directly in a `<%= %>` ... | 45,511 | [
{
"from": "human",
"value": "I get the above error whenever I try and use ActionLink ? I've only just started playing around with MVC and don't really understand what it's problem is with the code (below):\n<%= Html.ActionLink(\"Lists\", \"Index\", \"Lists\"); %>\n\nThis just seems to be a parsing issue but... |
I'd like to write a script that (under certain conditions) will execute gdb and automatically run some program X with some set of arguments Y. Once the program has finished executing the user should remain at gdb's prompt until s/he explicitly exits it.
One way to do this would be to have the script output the run com... | Yes, you can accomplish this without the need for a temporary file by using a here-document (or "heredoc") in your shell script. A heredoc allows you to provide input to a command directly within the script. Here’s how you can do this with `gdb` to run a program with specified arguments.
Here's an example of how you c... | 44,974 | [
{
"from": "human",
"value": "I'd like to write a script that (under certain conditions) will execute gdb and automatically run some program X with some set of arguments Y. Once the program has finished executing the user should remain at gdb's prompt until s/he explicitly exits it.\nOne way to do this woul... |
OK,
Here is my problem, I have a master page with a HEAD section that contains my JS includes. I have one JS include
<script src="Includes/js/browser.js" language="javascript" type="text/javascript"></script>
In my page i consume it like this:
<body>
<form id="form1" runat="server">
<div>
....
<script type="text/jav... | It looks like you're encountering a JavaScript error where the function `registerBookmarkButton()` is not being recognized when it's called. Here are a few things to check and consider in order to resolve this issue:
1. **Check if `browser.js` is loaded correctly**: Ensure that the `browser.js` file is correctly inclu... | 41,671 | [
{
"from": "human",
"value": "OK,\nHere is my problem, I have a master page with a HEAD section that contains my JS includes. I have one JS include \n<script src=\"Includes/js/browser.js\" language=\"javascript\" type=\"text/javascript\"></script>\n\nIn my page i consume it like this:\n<body>\n<form id=\"fo... |
I've got a list of links which have a click event attached to them, I need to get the ID from the child A link. So in the example below if I clicked the first list element I'd need google retuned.
I've tried '$this a' but can't quite work out the syntax.
$("ul li").click(function(event){
$("input").val($(this).html(... | To achieve the functionality you described, you can modify your click event handler to target the `<a>` child element of the `<li>`. You can use `$(this).find("a")` to get the anchor tag inside the clicked list item, and then use `.attr("id")` to retrieve the `id` attribute from that anchor tag.
Here's how you can do ... | 44,090 | [
{
"from": "human",
"value": "I've got a list of links which have a click event attached to them, I need to get the ID from the child A link. So in the example below if I clicked the first list element I'd need google retuned. \nI've tried '$this a' but can't quite work out the syntax.\n$(\"ul li\").click(fu... |
Simple question: Can I mix in my desktop application Java and JavaFX Script code? If it is possible could you provide me with some link with examples?
Or could I pack my custom made javafx CustomNode-s in a jar and use them in my project side by side with standard SWING components?
| JavaFX Script was a scripting language designed for building JavaFX applications, but it was deprecated and is no longer in use. Current JavaFX development is done using Java, and you can use JavaFX alongside standard Swing components through a process called "JFXPanel".
To address your questions:
1. **Mixing Java an... | 44,292 | [
{
"from": "human",
"value": "Simple question: Can I mix in my desktop application Java and JavaFX Script code? If it is possible could you provide me with some link with examples?\nOr could I pack my custom made javafx CustomNode-s in a jar and use them in my project side by side with standard SWING compone... |
Delphi sometimes adds {$R *.res} in front of the unit path in the .dpr file uses clauses, then I get a duplicated resources warning when trying to compile.
Anyone knows why the hell Delphi does that? I'm using Delphi 2009 but this happens since Delphi 2007 (maybe 2006 too)
| The `{$R *.res}` directive in Delphi is used to include a resource file associated with a unit or project. When you see the `{$R *.res}` directive in your `.dpr` (Delphi project) file, it's often automatically added by the IDE when you create new forms or resources, but it can sometimes lead to issues, such as duplicat... | 45,086 | [
{
"from": "human",
"value": "Delphi sometimes adds {$R *.res} in front of the unit path in the .dpr file uses clauses, then I get a duplicated resources warning when trying to compile.\nAnyone knows why the hell Delphi does that? I'm using Delphi 2009 but this happens since Delphi 2007 (maybe 2006 too)\n"
... |
I'm working on a Perl script. How can I pass command line parameters to it?
Example:
script.pl "string1" "string2"
| To pass command line parameters to a Perl script, you can access the special array `@ARGV`, which contains all the command line arguments provided to the script. Each element in `@ARGV` corresponds to an argument, with `$ARGV[0]` being the first argument, `$ARGV[1]` the second, and so on.
Here's an example of how you ... | 47,354 | [
{
"from": "human",
"value": "I'm working on a Perl script. How can I pass command line parameters to it?\nExample:\nscript.pl \"string1\" \"string2\"\n\n"
},
{
"from": "gpt",
"value": "To pass command line parameters to a Perl script, you can access the special array `@ARGV`, which contains all ... |
In my working folder of a VSS project, is it alright if I make all the files/folders writable? i.e. not readonly?
| In a Visual SourceSafe (VSS) project, it is generally not advisable to make all files and folders writable (i.e., remove the read-only attribute) in your working folder. Here's why:
1. **Version Control**: VSS uses the read-only attribute to indicate that files are under source control. When files are read-only, it pr... | 47,667 | [
{
"from": "human",
"value": "In my working folder of a VSS project, is it alright if I make all the files/folders writable? i.e. not readonly?\n"
},
{
"from": "gpt",
"value": "In a Visual SourceSafe (VSS) project, it is generally not advisable to make all files and folders writable (i.e., remove... |
I have an animation and I want it to play it just only once. From where can I set so when I export to SWF the default will be AUTO LOOPING disabled.
Thanks
| To ensure that your animation plays only once and does not loop when exported as an SWF file, you can follow these steps, depending on the software you are using. Here are the instructions for Adobe Animate, which is commonly used for creating SWF files:
### Adobe Animate
1. **Open Your Animation Project**: Launch Ad... | 47,237 | [
{
"from": "human",
"value": "I have an animation and I want it to play it just only once. From where can I set so when I export to SWF the default will be AUTO LOOPING disabled.\nThanks\n"
},
{
"from": "gpt",
"value": "To ensure that your animation plays only once and does not loop when exported... |
OK,
This question has probably been answered before, but I'm not sure of how to word the Title.
I have a class that has methods which return many composite LINQ queries. Most of these queries form Anonymous Types in order to get the data I need. I found out that I'm not able to return an Anonymous Type from a method,... | You're correct that you cannot return anonymous types from methods in C#. Instead, you can return a specific type or a more general approach. Here are some approaches you could consider:
### 1. **Use a Named Type (DTO)**
Instead of using anonymous types, you can define a Data Transfer Object (DTO) class that represent... | 46,254 | [
{
"from": "human",
"value": "OK,\nThis question has probably been answered before, but I'm not sure of how to word the Title.\nI have a class that has methods which return many composite LINQ queries. Most of these queries form Anonymous Types in order to get the data I need. I found out that I'm not able... |
I've recently used our company's spare laptop (that has a general user set up) while mine was being repaired. I've checked the "Remember password" option in SQL Server Management Studio when logging in to the database.
I need to clear the login and password information that I have used to prevent the next person that ... | To clear the saved login and password information in SQL Server Management Studio (SSMS), you can follow these steps:
1. **Open SQL Server Management Studio**: Launch the application.
2. **Clear the Password Cache**:
- In the login dialog (the window that appears when you connect to a database), there’s typically ... | 47,757 | [
{
"from": "human",
"value": "I've recently used our company's spare laptop (that has a general user set up) while mine was being repaired. I've checked the \"Remember password\" option in SQL Server Management Studio when logging in to the database. \nI need to clear the login and password information that ... |
I need to create simple reusable javascript object publishing several methods and parameterized constructor. After reading through several "OOP in JavaScript" guides I'm sitting here with an empty head. How on the Earth can I do this?
Here my last non-working code:
SomeClass = function(id) {
this._id = id;
}
(funct... | It looks like you're on the right track with your JavaScript object, but there are a few issues in your code. Let's clarify a few key concepts in JavaScript OOP and fix your code accordingly.
1. **Constructor Function**: The `SomeClass` constructor should define properties for each instance. You've done that correctly... | 45,211 | [
{
"from": "human",
"value": "I need to create simple reusable javascript object publishing several methods and parameterized constructor. After reading through several \"OOP in JavaScript\" guides I'm sitting here with an empty head. How on the Earth can I do this?\nHere my last non-working code:\nSomeClass... |
I am using a route like this one:
routes.MapRoute("Invoice-New-NewCustomer",
"Invoice/New/Customer/New/{*name}",
new { controller = "Customer", action = "NewInvoice" },
new { name = @"[^\.]*" });
There is an action which handles this route:
public ActionResult NewInvoice(string name)
{
AddClientSideVal... | The issue you are encountering with the name parameter being truncated when using special characters (like spaces) in the URL is due to how URLs are encoded. When you redirect with `RedirectToAction`, the special characters (such as spaces) should be properly encoded to avoid truncation.
In your case, the space in th... | 46,864 | [
{
"from": "human",
"value": "I am using a route like this one:\nroutes.MapRoute(\"Invoice-New-NewCustomer\",\n \"Invoice/New/Customer/New/{*name}\",\n new { controller = \"Customer\", action = \"NewInvoice\" },\n new { name = @\"[^\\.]*\" });\n\nThere is an action which handles this route:\npublic ... |
How can you diff two pipelines without using temporary files in Bash? Say you have two command pipelines:
foo | bar
baz | quux
And you want to find the diff in their outputs. One solution would obviously be to:
foo | bar > /tmp/a
baz | quux > /tmp/b
diff /tmp/a /tmp/b
Is it possible to do so without the use of temp... | Yes, it is possible to diff two command pipelines in Bash without using temporary files by utilizing process substitution and named pipes (FIFOs). Here's how you can do it with process substitution, which allows you to create a temporary file descriptor that can be used as a file input for `diff`.
You can achieve this... | 48,618 | [
{
"from": "human",
"value": "How can you diff two pipelines without using temporary files in Bash? Say you have two command pipelines:\nfoo | bar\nbaz | quux\n\nAnd you want to find the diff in their outputs. One solution would obviously be to:\nfoo | bar > /tmp/a\nbaz | quux > /tmp/b\ndiff /tmp/a /tmp/b\... |
I have a ComponentResourceKey defined in my resource dictionary like this:
<Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:Resources}, ResourceId=BaseControlStyle}" TargetType="{x:Type FrameworkElement}">
<Setter Property="Margin" Value="4,4,0,0" />
</Style>
I have a static class that I use ... | To apply a style defined in a ResourceDictionary using a `ComponentResourceKey` in code, you cannot directly assign the `ComponentResourceKey` to the `Style` property. Instead, you need to retrieve the actual `Style` object from the resources using the `FindResource` or `TryFindResource` methods.
Here's how you can do... | 47,722 | [
{
"from": "human",
"value": "I have a ComponentResourceKey defined in my resource dictionary like this:\n<Style x:Key=\"{ComponentResourceKey TypeInTargetAssembly={x:Type local:Resources}, ResourceId=BaseControlStyle}\" TargetType=\"{x:Type FrameworkElement}\">\n <Setter Property=\"Margin\" Value=\"4,4,0... |
Given the schema
PERSON { name, spouse }
where PERSON.spouse is a foreign key to PERSON.name, NULLs will be necessary when a person is unmarried or we don't have any info.
Going with the argument against nulls, how do you avoid them in this case?
I have an alternate schema
PERSON { name }
SPOUSE { name1, name2 }
wh... | To avoid nulls in your schema while still accommodating relationships like marriage, you can take a slightly different approach by using a combination of the `PERSON` and `SPOUSE` tables, along with enforcing constraints to ensure that each person can have only one spouse.
Here's an improved approach that maintains th... | 45,414 | [
{
"from": "human",
"value": "Given the schema\n\nPERSON { name, spouse }\n\nwhere PERSON.spouse is a foreign key to PERSON.name, NULLs will be necessary when a person is unmarried or we don't have any info.\nGoing with the argument against nulls, how do you avoid them in this case?\nI have an alternate sche... |
My XML (a.xhtml) starts like this
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
...
My code starts like this
use XML::XPath;
use XML::XPath::XMLParser;
my $xp = XML::XPath->new(filename => "a.xhtml");
my $nodeset = $xp->find('/html/body//... | In Perl, if you're using the `XML::XPath` module and facing delays due to DTD fetching, you can try to set up an HTTP proxy directly in your Perl environment or use the LWP library to configure the proxy settings.
Here's how you can do it:
1. **Set up environment variables for the proxy**: You can set the `http_proxy... | 45,675 | [
{
"from": "human",
"value": "My XML (a.xhtml) starts like this\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n...\n\nMy code starts like this\nuse XML::XPath;\n\nuse XML::XPath::XMLParser;\n\nmy $xp = XML::XPath->new(filenam... |
Has anybody had any success with developing for Android platform using Netbeans (5.5+ ) IDE? I know of atleast netbeans one plugin that is supposed to support it but wanted to hear if anyone is using netbeans for Android development and how easy it is to set it up.
| Yes, there have been developers who have successfully used NetBeans for Android development, particularly with the help of plugins. The most notable plugin for this purpose was the **NBAndroid** plugin, which allows for Android development directly within the NetBeans IDE.
Here are some general steps and tips for set... | 44,861 | [
{
"from": "human",
"value": "Has anybody had any success with developing for Android platform using Netbeans (5.5+ ) IDE? I know of atleast netbeans one plugin that is supposed to support it but wanted to hear if anyone is using netbeans for Android development and how easy it is to set it up.\n"
},
{
... |
I have been trying to learn more about lambda expressions lately, and thought of a interesting exercise...
is there a way to simplify a c++ integration function like this:
// Integral Function
double integrate(double a, double b, double (*f)(double))
{
double sum = 0.0;
// Evaluate integral{a,b} f(x) dx
fo... | Yes, you can simplify the integration function in C# using lambda expressions. In C#, you can define a function using a lambda expression and then pass it as a parameter to your integration function. Here's how you can do it:
### C++ Version
Let's quickly summarize your C++ version of the integration function:
```cp... | 44,678 | [
{
"from": "human",
"value": "I have been trying to learn more about lambda expressions lately, and thought of a interesting exercise...\nis there a way to simplify a c++ integration function like this:\n// Integral Function\ndouble integrate(double a, double b, double (*f)(double))\n{\n double sum = 0.0;... |
I need to make OK and Cancel buttons in my HTML, and I'd like them to be a fixed width so the two buttons are the same size. For example, like this:
<style>
button.ok_cancel {
width: 50px;
background-color: #4274af;
font-size: 9px;
line-height: 12px;
color: #fff;
cursor: pointer;
text-trans... | You can achieve the desired effect by using a combination of CSS and some HTML structure. To ensure that your button has a fixed width when the text fits but can expand when the text is wider, you can use a wrapper element around the button text. Here’s an example of how you can do this:
```html
<style>
.button-wrappe... | 45,671 | [
{
"from": "human",
"value": "I need to make OK and Cancel buttons in my HTML, and I'd like them to be a fixed width so the two buttons are the same size. For example, like this:\n<style>\nbutton.ok_cancel {\n width: 50px;\n background-color: #4274af;\n font-size: 9px;\n line-height: 12px;\n ... |
I'm having some trouble uploading and getting my web app on the net with my chosen host. I built a war file in Net Beans and asked my host to deploy it for me. This worked fine but to access it I had to point my browser to:
www.myDomain.co.uk/explodedWar
What of course I wanted was to be able to access it just by po... | It sounds like your web application has been deployed successfully, but it is currently accessible under a specific context path (`/explodedWar`). To have your web application accessible directly from the root of your domain (`www.myDomain.co.uk`), you typically have a few options depending on your hosting provider and... | 47,126 | [
{
"from": "human",
"value": "I'm having some trouble uploading and getting my web app on the net with my chosen host. I built a war file in Net Beans and asked my host to deploy it for me. This worked fine but to access it I had to point my browser to:\nwww.myDomain.co.uk/explodedWar\n\nWhat of course I w... |
Path.Combine is handy, but is there a similar function in the .NET framework for URLs?
I'm looking for syntax like this:
Url.Combine("http://MyUrl.com/", "/Images/Image.jpg")
which would return:
"http://MyUrl.com/Images/Image.jpg"
| In .NET, there isn't a built-in method like `Url.Combine` specifically for URLs, but you can easily create a utility method to achieve this functionality. A common approach is to use `Uri` class functionality to correctly handle combining URLs, ensuring you have the right behavior regarding slashes.
Here’s an example ... | 46,220 | [
{
"from": "human",
"value": "Path.Combine is handy, but is there a similar function in the .NET framework for URLs?\nI'm looking for syntax like this:\nUrl.Combine(\"http://MyUrl.com/\", \"/Images/Image.jpg\")\n\nwhich would return:\n\"http://MyUrl.com/Images/Image.jpg\"\n"
},
{
"from": "gpt",
"... |
I'm trying to display the difference in a measure from one day to the next in Excel (2007) by setting the value field setting to 'Difference From' with Base field = day and Base item = previous. If my underlying data is a SSAS cube, the value that displays for each cell is #N/A. If my underlying data is a set of record... | The issue you're experiencing with the SSAS cube data likely stems from how the cube processes "Difference From" calculations compared to how Excel processes a standard data source. Here are a few steps and considerations that might help you resolve this issue:
1. **Check Dimension Settings**: Ensure that the time dim... | 43,152 | [
{
"from": "human",
"value": "I'm trying to display the difference in a measure from one day to the next in Excel (2007) by setting the value field setting to 'Difference From' with Base field = day and Base item = previous. If my underlying data is a SSAS cube, the value that displays for each cell is #N/A.... |
Whilst trawling through some old code I came across something similar to the following:
class Base
{
public:
virtual int Func();
...
};
class Derived : public Base
{
public:
int Func(); // Missing 'virtual' qualifier
...
};
The code compiles fine (MS VS2008) with no warnings (level 4) and it works as ... | The code you've encountered is indeed valid C++ and will compile without issues because of how inheritance and function overriding work in C++. In your example, the `Func` method in the `Derived` class overrides the `Func` method in the `Base` class, even though the `virtual` keyword is not explicitly stated in the `De... | 46,684 | [
{
"from": "human",
"value": "Whilst trawling through some old code I came across something similar to the following:\nclass Base\n{\npublic:\n virtual int Func();\n ...\n};\n\nclass Derived : public Base\n{\npublic:\n int Func(); // Missing 'virtual' qualifier\n ...\n};\n\nThe code compiles fine... |
I'm using Dojo's gfx routines to draw some shapes onto a div, and other than surface.clear(), is there a way to clear or erase just part of the surface?
| In Dojo's gfx framework, there isn't a built-in method to clear just a specific part of a surface. The `surface.clear()` method will indeed clear the entire surface.
However, there are a few alternative approaches you can consider for erasing or clearing a part of a surface:
1. **Overdrawing with Background Color**: ... | 40,822 | [
{
"from": "human",
"value": "I'm using Dojo's gfx routines to draw some shapes onto a div, and other than surface.clear(), is there a way to clear or erase just part of the surface?\n"
},
{
"from": "gpt",
"value": "In Dojo's gfx framework, there isn't a built-in method to clear just a specific p... |
I currently trying to find a solution, how to ensure that a test fails if an exception occurs in a thread which is spawn by the test method.
I DON'T want to start a discussion about more than one thread in a unit test. => "unit test".Replace("unit","integration");
I already read a lot of threads in several forums, I kn... | To ensure that a test fails if an exception occurs in a thread spawned by the test method while integrating with NUnit, you can use a combination of mechanisms provided by `Task` and `async/await` pattern. Below is an approach that minimizes changes to your existing test structure while allowing you to capture exceptio... | 45,955 | [
{
"from": "human",
"value": "I currently trying to find a solution, how to ensure that a test fails if an exception occurs in a thread which is spawn by the test method.\nI DON'T want to start a discussion about more than one thread in a unit test. => \"unit test\".Replace(\"unit\",\"integration\");\nI alre... |
I have a Viewbox with Stretch=Uniform in order to not distort the content.
However, when the frame window is wider or taller than the content, the Viewbox content is always centered.
I cannot seem to find any content alignment options on the Viewbox.
Is there a way to do this?
| In WPF (Windows Presentation Foundation), the `Viewbox` control indeed centers its content by default when there is extra space available, especially when the `Stretch` property is set to `Uniform`. However, if you want to control the alignment of the content when the `Viewbox` is larger than the content, you can achie... | 45,554 | [
{
"from": "human",
"value": "I have a Viewbox with Stretch=Uniform in order to not distort the content.\nHowever, when the frame window is wider or taller than the content, the Viewbox content is always centered.\nI cannot seem to find any content alignment options on the Viewbox.\nIs there a way to do this... |
I need to have my application translated into many different languages, I have the translators and know that I can use Qt Linguist. However as far as I can tell I have to package up Linguist myself and ship it out to the translators.
Is there a web-based solution or do other package Qt Linguist with the ts files?
| If you're looking for a more streamlined solution for managing translations without having to package Qt Linguist yourself, there are a few options you can consider:
1. **Web-Based Translation Management Systems (TMS):**
There are several web-based platforms that provide translation management tools. These platform... | 46,727 | [
{
"from": "human",
"value": "I need to have my application translated into many different languages, I have the translators and know that I can use Qt Linguist. However as far as I can tell I have to package up Linguist myself and ship it out to the translators.\nIs there a web-based solution or do other p... |
I'd like to run some small private/home applications on a local machine, but I dislike the idea to set up a full Win2003 Server with IIS for this.
Is there a easy and cheap way to get an ASP.Net application running at home?
| Yes, you can easily run an ASP.NET application on your local machine without setting up a full Windows Server with IIS. Here are a few options that are relatively easy and inexpensive:
### 1. **Use Visual Studio with Built-in IIS Express**
- **Visual Studio**: If you have Visual Studio installed, it comes with IIS Exp... | 44,383 | [
{
"from": "human",
"value": "I'd like to run some small private/home applications on a local machine, but I dislike the idea to set up a full Win2003 Server with IIS for this. \nIs there a easy and cheap way to get an ASP.Net application running at home?\n"
},
{
"from": "gpt",
"value": "Yes, you... |
I need a Javascript application that, when run, prompts a password to be entered, and if the password is correct, the script causes the webpage to close. If the password is incorrect, the script prompts for the password to be entered again.
I'm planning on loading this script onto my cell phone, which doesn't have a pa... | Certainly! Below is a simple JavaScript application that prompts the user for a password. If the password is correct, it will attempt to close the current webpage; if the password is incorrect, it will ask for the password again.
Please note that modern browsers may prevent a webpage from closing using JavaScript if i... | 44,432 | [
{
"from": "human",
"value": "I need a Javascript application that, when run, prompts a password to be entered, and if the password is correct, the script causes the webpage to close. If the password is incorrect, the script prompts for the password to be entered again.\nI'm planning on loading this script o... |
How do I send a cross-domain POST request via JavaScript?
Notes - it shouldn't refresh the page, and I need to grab and parse the response afterwards.
| To send a cross-domain POST request via JavaScript without refreshing the page, you can use the `fetch` API or the older `XMLHttpRequest`. The `fetch` API is preferred due to its simplicity and more modern features. However, you need to ensure that the server you are sending the request to supports Cross-Origin Resourc... | 41,792 | [
{
"from": "human",
"value": "How do I send a cross-domain POST request via JavaScript?\nNotes - it shouldn't refresh the page, and I need to grab and parse the response afterwards.\n"
},
{
"from": "gpt",
"value": "To send a cross-domain POST request via JavaScript without refreshing the page, yo... |
I have a dataprovider and a filterfunction for my array that's assigned to my dataprovider.
How can I get a list of the properties that are in each row of the dataprovider (item.data) as it gets passed to the filterfunction?
For instance, if my object contained:
Object
name
email
address
Then I would want, in my f... | If you want to dynamically access the properties of each object in your data provider within your filter function, you can use the `Object.keys()` method or `Object.entries()` method in JavaScript. These methods allow you to retrieve the keys (property names) of an object, which you can then use to check against your f... | 45,862 | [
{
"from": "human",
"value": "I have a dataprovider and a filterfunction for my array that's assigned to my dataprovider.\nHow can I get a list of the properties that are in each row of the dataprovider (item.data) as it gets passed to the filterfunction?\nFor instance, if my object contained:\n\nObject\n\n\... |
I'm familiar with .NET and with SQL. Now I'm looking at the new LINQ and it looks to me just like a cursor. I understand the ease of use, etc., but if I do a LINQ-to-SQL query with a foreach loop, am I just using a DB cursor? Or is there some sort of magic behind the scenes where LINQ collects all the data at once a... | Great question! LINQ (Language Integrated Query) is indeed a powerful feature in .NET that enables you to work with data in a more intuitive way. When it comes to LINQ to SQL, it's helpful to understand how it interacts with the database and handles data retrieval.
### LINQ to SQL and Data Retrieval
When you use LINQ... | 44,987 | [
{
"from": "human",
"value": "I'm familiar with .NET and with SQL. Now I'm looking at the new LINQ and it looks to me just like a cursor. I understand the ease of use, etc., but if I do a LINQ-to-SQL query with a foreach loop, am I just using a DB cursor? Or is there some sort of magic behind the scenes w... |
Disclaimer: I'm fairly new to python!
If I want all the lines of a file until (edit: and including) the line containing some string stopterm, is there a way of using the list syntax for it? I was hoping there would be something like:
usefullines = [line for line in file until stopterm in line]
For now, I've got
useful... | Welcome to Python! Your current approach is a common one when it comes to reading lines from a file until a certain condition is met. However, list comprehensions in Python don't support stopping early (like a `break` statement), so we can't directly achieve what you're looking for with a single list comprehension.
Ho... | 41,758 | [
{
"from": "human",
"value": "Disclaimer: I'm fairly new to python!\nIf I want all the lines of a file until (edit: and including) the line containing some string stopterm, is there a way of using the list syntax for it? I was hoping there would be something like:\nusefullines = [line for line in file until ... |
Is there a way to easily sort in SQL Server 2005 while ignoring hyphens in a string field? Currently I have to do a REPLACE(fieldname,'-','') or a function to remove the hyphen in the sort clause. I was hoping there was a flag I could set at the top of the stored procedure or something.
Access and the GridView defaul... | In SQL Server 2005, there is no built-in flag or setting that allows you to ignore specific characters (like hyphens) when sorting. However, your approach using `REPLACE` in the `ORDER BY` clause is a common and effective way to achieve the desired sorting behavior.
Here is an example of how to use `REPLACE` in your q... | 47,903 | [
{
"from": "human",
"value": "Is there a way to easily sort in SQL Server 2005 while ignoring hyphens in a string field? Currently I have to do a REPLACE(fieldname,'-','') or a function to remove the hyphen in the sort clause. I was hoping there was a flag I could set at the top of the stored procedure or ... |
According to the VS 2008 properties for a GridView:
DataBound fires after the control has been databound.
RowDataBound fires after a row has been databound.
If I want to manipulate the text in a header column, does it matter if I use the DataBound or RowDataBound because I can always just check the e.Row.RowType. Is... | Yes, there is a significant difference between the `DataBound` and `RowDataBound` events in a GridView, and choosing the right one to manipulate the text in a header column is important for a few reasons.
### DataBound Event:
- The `DataBound` event is raised once for the entire GridView after the control is fully dat... | 45,206 | [
{
"from": "human",
"value": "According to the VS 2008 properties for a GridView:\n\nDataBound fires after the control has been databound.\nRowDataBound fires after a row has been databound.\n\nIf I want to manipulate the text in a header column, does it matter if I use the DataBound or RowDataBound because ... |
I would like to automatically align lines of python variable assignments in vim.
For example I would like to change this:
a = 1
banana = 2
into this
a = 1
banana = 2
automatically in vim.
Is there a way to do this?
| Yes, you can align variable assignments in Vim using the built-in `:Tabularize` command from the `vim-tabular` plugin or by using Vim's regular expressions and commands.
### Option 1: Using the `vim-tabular` Plugin
1. **Install the Plugin**: First, you'll need to install the `vim-tabular` plugin. If you're using a pl... | 45,602 | [
{
"from": "human",
"value": "I would like to automatically align lines of python variable assignments in vim.\nFor example I would like to change this:\na = 1\nbanana = 2\n\ninto this\na = 1\nbanana = 2\n\nautomatically in vim.\nIs there a way to do this?\n"
},
{
"from": "gpt",
"value": "Ye... |
Closed as duplicate of What are some ways to protect emails on websites from spambots?
I am finally puting up my personal web site. I want to publish a webmaster/feedback email on every page, but I am concerned about SPAM crawlers extracting the email address and bombarding me. This is especially true because I can'... | To protect your email address from spambots while still making it accessible to legitimate users, here are several effective methods you can consider:
1. **Obfuscation**:
- Use a combination of text and symbols to write your email address. For example, instead of writing `example@example.com`, you can write `exampl... | 44,215 | [
{
"from": "human",
"value": "Closed as duplicate of What are some ways to protect emails on websites from spambots?\nI am finally puting up my personal web site. I want to publish a webmaster/feedback email on every page, but I am concerned about SPAM crawlers extracting the email address and bombarding m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.