instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Suppose I have a simple XHTML document that uses a custom namespace for attributes:
<html xmlns="..." xmlns:custom="http://www.example.com/ns">
...
<div class="foo" custom:attr="bla"/>
...
</html>
How do I match each element that has a certain custom attribute using jQuery? Using
$("div[custom:attr]")
doe... | In jQuery, the standard attribute selectors do not work directly with XML namespaces because jQuery does not natively support namespace-aware selectors. However, you can match elements that have a certain custom attribute by using the `is()` method with a more explicit selector.
To select elements with custom attribut... | 11,845 | [
{
"from": "human",
"value": "Suppose I have a simple XHTML document that uses a custom namespace for attributes:\n<html xmlns=\"...\" xmlns:custom=\"http://www.example.com/ns\">\n ...\n <div class=\"foo\" custom:attr=\"bla\"/>\n ...\n</html>\n\nHow do I match each element that has a certain custom ... |
I am trying to run a SQL Server Reporting Services where the data for the report is on a SQL Server database that's on a different server. Integrated Authentication is turned on for both the Report Server and the report. I have confirmed that Kerberos delegation is working fine by using Internet Explorer to run the r... | The issue you’re encountering is related to how Kerberos authentication works with SQL Server Reporting Services (SSRS) and the use of firewalls or other network boundaries. Let's break down the situation:
### Understanding the Issue
1. **Kerberos Authentication**: Kerberos authentication allows for secure and seamle... | 7,663 | [
{
"from": "human",
"value": "I am trying to run a SQL Server Reporting Services where the data for the report is on a SQL Server database that's on a different server. Integrated Authentication is turned on for both the Report Server and the report. I have confirmed that Kerberos delegation is working fin... |
Is there a project that maintains annotations for patterns?
For example, when I write a builder, I want to mark it with @Builder.
Annotating in this way immediately provides a clear idea of what the code implements. Also, the Javadoc of the @Builder annotation can reference explanations of the builder pattern. Furtherm... | It's great to hear that you've taken the initiative to create the **Pattern Notes** project! Using annotations to represent design patterns and idioms can significantly enhance code readability and maintainability, making it easier for developers to understand the intent behind certain implementations at a glance.
As ... | 10,404 | [
{
"from": "human",
"value": "Is there a project that maintains annotations for patterns?\nFor example, when I write a builder, I want to mark it with @Builder.\nAnnotating in this way immediately provides a clear idea of what the code implements. Also, the Javadoc of the @Builder annotation can reference ex... |
I have a xslt stylesheet with multiple xsl:imports and I want to merge them all into the one xslt file.
It is a limitation of the system we are using where it passes around the xsl stylesheet as a string object stored in memory. This is transmitted to remote machine where it performs the transformation. Since it is not... | Yes, there are several ways to merge XSLT stylesheets with `xsl:import` statements into a single file. While there may not be a specific tool solely dedicated to merging XSLT files, there are a few approaches you can take, including using existing XML/XSLT processors, writing a custom script, or using some text process... | 7,111 | [
{
"from": "human",
"value": "I have a xslt stylesheet with multiple xsl:imports and I want to merge them all into the one xslt file.\nIt is a limitation of the system we are using where it passes around the xsl stylesheet as a string object stored in memory. This is transmitted to remote machine where it pe... |
I'm embedding the Google Maps Flash API in Flex and it runs fine locally with the watermark on it, etc. When I upload it to the server (flex.mydomain.com) I get a sandbox security error listed below:
SecurityError: Error #2121: Security sandbox violation: Loader.content: http://mydomain.com/main.swf?Fri, 12 Sep 200... | The error message you're encountering indicates that the Flash Player is enforcing security restrictions related to loading content from different domains. The Google Maps Flash API is trying to load resources from `maps.googleapis.com`, but due to the same-origin policy, this action is being blocked because your SWF f... | 8,146 | [
{
"from": "human",
"value": "I'm embedding the Google Maps Flash API in Flex and it runs fine locally with the watermark on it, etc. When I upload it to the server (flex.mydomain.com) I get a sandbox security error listed below: \nSecurityError: Error #2121: Security sandbox violation: Loader.content: ht... |
Suppose I have a table called Companies that has a DepartmentID column. There's also a Departaments table that has as EmployeeID column. Of course I have an Employee table as well. The problem is that I want to delete a company, so first i have to delete all the employees for every departament and then all the departam... | Certainly! When dealing with deletions in a database that has foreign key relationships, it's important to ensure that you delete records in the correct order to avoid foreign key constraint violations. Since you mentioned that cascading deletes are not an option, you'll need to manually handle the deletions.
In your ... | 6,701 | [
{
"from": "human",
"value": "Suppose I have a table called Companies that has a DepartmentID column. There's also a Departaments table that has as EmployeeID column. Of course I have an Employee table as well. The problem is that I want to delete a company, so first i have to delete all the employees for ev... |
While there are 100 ways to solve the conversion problem, I am focusing on performance.
Give that the string only contains binary data, what is the fastest method, in terms of performance, of converting that data to a byte[] (not char[]) under C#?
Clarification: This is not ASCII data, rather binary data that happens ... | When converting binary data represented as a string in C#, the goal is to efficiently transform that string into a `byte[]`. Since you specified that the string contains binary data, it’s likely that the string consists of characters representing binary digits (e.g., "01010101"). Here's a method using `Span<byte>` whic... | 6,212 | [
{
"from": "human",
"value": "While there are 100 ways to solve the conversion problem, I am focusing on performance.\nGive that the string only contains binary data, what is the fastest method, in terms of performance, of converting that data to a byte[] (not char[]) under C#?\nClarification: This is not A... |
We have a CMS system whose web interface gets served over HTTPS. This works beautifully for Firefox, but when we load it in IE6 or IE7, it complains that "This page contains both secure and nonsecure items."
I've loaded the page in Firefox and checked with Firebug, and every connection seems to be going through HTTPS, ... | When Internet Explorer (IE) 6 and 7 display the warning "This page contains both secure and nonsecure items," it typically indicates that the browser has detected mixed content, meaning that some parts of the page are being served over HTTP while others are being served over HTTPS. This can happen even if you believe a... | 9,551 | [
{
"from": "human",
"value": "We have a CMS system whose web interface gets served over HTTPS. This works beautifully for Firefox, but when we load it in IE6 or IE7, it complains that \"This page contains both secure and nonsecure items.\"\nI've loaded the page in Firefox and checked with Firebug, and every ... |
Given a controller method like:
def show
@model = Model.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => model }
end
end
What's the best way to write an integration test that asserts that the return has the expected XML?
| To write an integration test for the `show` method in a Rails controller that asserts the XML response, you can use Rails' built-in testing framework, typically RSpec or Minitest. Below, I'll provide examples for both RSpec and Minitest.
### Using RSpec
First, ensure you have RSpec set up in your Rails project. Then,... | 8,778 | [
{
"from": "human",
"value": "Given a controller method like: \ndef show\n @model = Model.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => model }\n end\nend\n\nWhat's the best way to write an integration test that asserts that the return has ... |
I'm looking for an alternative to www.jsfmatrix.net to get a better idea of what JSF libraries are out there and to avoid having to write my own grid/table components. Or are these 27 the best the world has to offer (really only 3 are worth their salt.)
| If you're looking for alternatives to JSFMatrix.net for exploring JSF libraries and components, here are some resources and libraries that may help you:
### Alternative Resources
1. **GitHub**: Many JSF libraries are hosted on GitHub. Searching for "JSF libraries" or "JSF components" can lead you to popular repositori... | 8,190 | [
{
"from": "human",
"value": "I'm looking for an alternative to www.jsfmatrix.net to get a better idea of what JSF libraries are out there and to avoid having to write my own grid/table components. Or are these 27 the best the world has to offer (really only 3 are worth their salt.)\n"
},
{
"from": "... |
It seems like you could use a mashup of Relector and a Debugger to be able to debug any .NET app WITHOUT having the source code at all. Is this possible? Has anyone seen this before?
| Yes, it is indeed possible to debug .NET applications without having the source code, though it involves specific tools and techniques. Here are some methods and tools that allow you to achieve this:
1. **Reflector Tools**: Tools like **ILSpy**, **dotPeek**, and **dnSpy** allow you to inspect and decompile .NET assemb... | 7,356 | [
{
"from": "human",
"value": "It seems like you could use a mashup of Relector and a Debugger to be able to debug any .NET app WITHOUT having the source code at all. Is this possible? Has anyone seen this before?\n"
},
{
"from": "gpt",
"value": "Yes, it is indeed possible to debug .NET applicat... |
I just got surprised by something in TSQL. I thought that if xact_abort was on, calling something like
raiserror('Something bad happened', 16, 1);
would stop execution of the stored procedure (or any batch).
But my ADO.NET error message just proved the opposite. I got both the raiserror error message in the exceptio... | Yes, you are correct that `SET XACT_ABORT ON` will affect how your SQL statements behave in the context of transactions, but it does not terminate the execution of the current batch or stored procedure when a `RAISEERROR` is invoked.
The documentation you referenced indicates that when `XACT_ABORT` is set to `ON`, if ... | 8,921 | [
{
"from": "human",
"value": "I just got surprised by something in TSQL. I thought that if xact_abort was on, calling something like\nraiserror('Something bad happened', 16, 1);\n\nwould stop execution of the stored procedure (or any batch).\nBut my ADO.NET error message just proved the opposite. I got bot... |
I want to set a background image for a div, in a way that it is in the upper RIGHT of the div, but with a fixed 10px distance from top and right.
Here is how I would do that if wanted it in the upper LEFT of the div:
background: url(images/img06.gif) no-repeat 10px 10px;
Is there anyway to achieve the same result, but ... | Yes, you can achieve the desired effect of positioning the background image in the upper right corner of a div with a fixed 10px distance from the top and right edges by using the following CSS:
```css
div {
background: url(images/img06.gif) no-repeat;
background-position: right 10px top 10px;
}
```
In this c... | 11,043 | [
{
"from": "human",
"value": "I want to set a background image for a div, in a way that it is in the upper RIGHT of the div, but with a fixed 10px distance from top and right.\nHere is how I would do that if wanted it in the upper LEFT of the div:\nbackground: url(images/img06.gif) no-repeat 10px 10px;\nIs t... |
Has anyone successfully implemented a Java based solution that uses Microsoft SQL Server 2005 Reporting Services? Reporting Services comes with a set of Web Services that allow you to control the creation of a report, execution of a report, etc and I am just starting development on a POC of this integration. A couple... | Yes, integrating Java with Microsoft SQL Server Reporting Services (SSRS) using its web services API is a common approach for generating and managing reports programmatically. Several developers have successfully implemented this integration using various technologies, including Axis2, JAX-WS, and other SOAP-based web ... | 7,952 | [
{
"from": "human",
"value": "Has anyone successfully implemented a Java based solution that uses Microsoft SQL Server 2005 Reporting Services? Reporting Services comes with a set of Web Services that allow you to control the creation of a report, execution of a report, etc and I am just starting developmen... |
How do I get my C# program to sleep (pause execution) for 50 milliseconds?
| In C#, you can pause or "sleep" your program's execution for a specified duration using the `Thread.Sleep` method. To pause for 50 milliseconds, you can use the following code snippet:
```csharp
using System;
using System.Threading;
class Program
{
static void Main()
{
Console.WriteLine("Pausing for 5... | 10,150 | [
{
"from": "human",
"value": "How do I get my C# program to sleep (pause execution) for 50 milliseconds?\n"
},
{
"from": "gpt",
"value": "In C#, you can pause or \"sleep\" your program's execution for a specified duration using the `Thread.Sleep` method. To pause for 50 milliseconds, you can use ... |
I'm using NHibernate on a project and I need to do data auditing. I found this article on codeproject which discusses the IInterceptor interface.
What is your preferred way of auditing data? Do you use database triggers? Do you use something similar to what's dicussed in the article?
| When it comes to data auditing in a project using NHibernate, there are several approaches, and the best one often depends on the specific requirements and constraints of your application. Here are some common strategies, including the use of `IInterceptor` and database triggers, along with their pros and cons:
### 1.... | 5,536 | [
{
"from": "human",
"value": "I'm using NHibernate on a project and I need to do data auditing. I found this article on codeproject which discusses the IInterceptor interface.\nWhat is your preferred way of auditing data? Do you use database triggers? Do you use something similar to what's dicussed in the... |
After compiling a simple C++ project using Visual Studio 2008 on vista, everything runs fine on the original vista machine and other vista computers. However, moving it over to an XP box results in an error message: "The application failed to start because the application configuration is incorrect".
What do I have to ... | The error message "The application failed to start because the application configuration is incorrect" usually indicates that the application is dependent on a particular runtime or configuration that is not present on the target machine. Here are some steps you can take to resolve this issue and ensure that your compi... | 7,934 | [
{
"from": "human",
"value": "After compiling a simple C++ project using Visual Studio 2008 on vista, everything runs fine on the original vista machine and other vista computers. However, moving it over to an XP box results in an error message: \"The application failed to start because the application confi... |
I wondered if anyone can give an example of a professional use of RSS/Atom feeds in a company product. Does anyone use feeds for other things than updating news?
For example, did you create a product that gives results as RSS/Atom feeds? Like price listings or current inventory, or maybe dates of training lessons?
Or a... | RSS and Atom feeds, while often associated with news updates, have a wide range of professional applications beyond just content syndication. Here are several examples of how companies and products utilize RSS/Atom feeds:
1. **E-commerce Product Updates**: Online retailers often use RSS feeds to provide real-time upda... | 6,970 | [
{
"from": "human",
"value": "I wondered if anyone can give an example of a professional use of RSS/Atom feeds in a company product. Does anyone use feeds for other things than updating news?\nFor example, did you create a product that gives results as RSS/Atom feeds? Like price listings or current inventory... |
I would like to programmatically create a gloss effect on an Image, kinda like on the Apple-inspired design that the Web has adopted when it was updated to 2.0 Beta.
Essentially this:
example icons http://nhc.hcmuns.googlepages.com/web2_icons.jpg
Now, I see two approaches here: I create one image which has an Alpha cha... | Creating a gloss effect on images is a common task in graphic design, especially for icons in the Web 2.0 style. The effect generally involves creating a highlight and a subtle gradient that mimics a shiny surface. While there isn't a specific named "gloss algorithm," you can achieve this effect through a combination o... | 7,887 | [
{
"from": "human",
"value": "I would like to programmatically create a gloss effect on an Image, kinda like on the Apple-inspired design that the Web has adopted when it was updated to 2.0 Beta.\nEssentially this:\nexample icons http://nhc.hcmuns.googlepages.com/web2_icons.jpg\nNow, I see two approaches her... |
Question
Alright, I'm confused by all the buzzwords and press release bingo going on.
What is the relationship between flash and flex:
Replace flash (not really compatible)
Enhance flash
The next version of flash but still basically compatible
Separate technology altogether
???
If I'm starting out in Flash now, sho... | Hi Adam,
You've got a solid understanding of the relationship between Flash, ActionScript, and Flex, but let’s clarify each of these elements in a bit more detail.
### Flash
1. **Flash IDE (Flash Professional or Flash CS3)**: This is the graphical editor where you create "Flash Movies". It's designed for creating ani... | 7,050 | [
{
"from": "human",
"value": "Question\nAlright, I'm confused by all the buzzwords and press release bingo going on.\n\nWhat is the relationship between flash and flex:\n\n\nReplace flash (not really compatible)\nEnhance flash\nThe next version of flash but still basically compatible\nSeparate technology alt... |
Update: Check out this follow-up question: Gem Update on Windows - is it broken?
On Windows, when I do this:
gem install sqlite3-ruby
I get the following error:
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
c:/ruby/... | The issue you're experiencing when trying to install the `sqlite3-ruby` gem on Windows typically stems from the need for native extensions, which means that some additional tools are required to compile the C extensions for the gem. Here's how you can troubleshoot and potentially resolve this problem:
### 1. Install t... | 7,359 | [
{
"from": "human",
"value": "Update: Check out this follow-up question: Gem Update on Windows - is it broken?\n\nOn Windows, when I do this:\ngem install sqlite3-ruby\n\nI get the following error:\nBuilding native extensions. This could take a while...\nERROR: Error installing sqlite3-ruby:\n ERROR... |
I'm currently working on upgrading a product for the Chinese market. The target is a ARMTDMI7 with a QVGA display. Most resources I've located on the net are targeted at desktop or web programming rather than embedded devices.
Can anyone suggest some tools and
resources that might be useful?
What are the best techniqu... | Upgrading a product for the Chinese market, especially with a focus on embedded devices like the ARMTDMI7, presents unique challenges and opportunities. Here are some tools, resources, and techniques that can help in your development and localization process:
### Tools and Resources
1. **Development Environments**:
... | 5,570 | [
{
"from": "human",
"value": "I'm currently working on upgrading a product for the Chinese market. The target is a ARMTDMI7 with a QVGA display. Most resources I've located on the net are targeted at desktop or web programming rather than embedded devices.\n\nCan anyone suggest some tools and\nresources that... |
Edit:
From another question I provided an answer that has links to a lot of questions/answers about singletons: More info about singletons here:
So I have read the thread Singletons: good design or a crutch?
And the argument still rages.
I see Singletons as a Design Pattern (good and bad).
The problem with Singleton... | Certainly! Here’s a refined version of your text that maintains the original ideas while improving clarity and structure:
---
### Understanding Singletons: When and How to Use Them
I've come across a lot of discussions on Singletons, including a particularly insightful thread titled "Singletons: Good Design or a Cru... | 4,726 | [
{
"from": "human",
"value": "Edit:\n From another question I provided an answer that has links to a lot of questions/answers about singletons: More info about singletons here:\nSo I have read the thread Singletons: good design or a crutch?\nAnd the argument still rages.\nI see Singletons as a Design Patte... |
I'm writing a J2SE desktop application that requires one of its components to be pluggable. I've already defined the Java interface for this plugin. The user should be able to select at runtime (via the GUI) which implementation of this interface they want to use (e.g. in an initialisation dialog). I envisage each plug... | Creating a pluggable architecture in a J2SE desktop application can be efficiently achieved through the use of Java's Service Provider Interface (SPI) mechanism, as well as class loading techniques for dynamically loading JAR files at runtime. Below are the recommended approaches to implement this:
### 1. Define the P... | 6,820 | [
{
"from": "human",
"value": "I'm writing a J2SE desktop application that requires one of its components to be pluggable. I've already defined the Java interface for this plugin. The user should be able to select at runtime (via the GUI) which implementation of this interface they want to use (e.g. in an ini... |
I am working on an application that installs a system wide keyboard
hook. I do not want to install this hook when I am running a debug
build from inside the visual studio (or else it would hang the studio
and eventually the system), and I can avoid this by checking if the
DEBUG symbol is defined.
However, when I debug ... | Detecting if your application is being run from within Visual Studio, particularly in a non-debug context (like a Release build), can indeed be a bit tricky. Your current method of checking the module name for the `.vshost` suffix is a common approach, but it may not cover all scenarios, especially if the user has modi... | 7,852 | [
{
"from": "human",
"value": "I am working on an application that installs a system wide keyboard\nhook. I do not want to install this hook when I am running a debug\nbuild from inside the visual studio (or else it would hang the studio\nand eventually the system), and I can avoid this by checking if the\nDE... |
While porting an application from SQL 2005 to SQL Server Compact Edition, I found that I need to port this command:
SELECT TOP 1 Id FROM tblJob WHERE Holder_Id IS NULL
But SQL Server Compact Edition doesn't support the TOP keyword. How can I port this command?
| In SQL Server Compact Edition, since the `TOP` keyword is not supported, you can achieve the same result by using the `ROW_NUMBER()` function combined with a Common Table Expression (CTE) or a subquery. However, SQL Server Compact Edition does not support CTEs, so the most straightforward approach is to use a subquery.... | 11,840 | [
{
"from": "human",
"value": "While porting an application from SQL 2005 to SQL Server Compact Edition, I found that I need to port this command:\nSELECT TOP 1 Id FROM tblJob WHERE Holder_Id IS NULL\n\nBut SQL Server Compact Edition doesn't support the TOP keyword. How can I port this command?\n"
},
{
... |
How can I find and delete unused references in my projects?
I know you can easily remove the using statements in vs 2008, but this doesn't remove the actual reference in your projects. The referenced dll will still be copied in your bin/setup package.
| To find and delete unused references in your projects, particularly in Visual Studio 2008, you'll need to follow a few manual steps, since the IDE does not automatically remove references that are not being used. Here’s a general approach to identify and remove those unused references:
### Step 1: Identify Unused Refe... | 7,174 | [
{
"from": "human",
"value": "How can I find and delete unused references in my projects? \nI know you can easily remove the using statements in vs 2008, but this doesn't remove the actual reference in your projects. The referenced dll will still be copied in your bin/setup package.\n"
},
{
"from": ... |
What would you say are the essential steps in verifying a file upload?
I'd tend to check the MIME type, give it a new (random) name, make sure its got an allowed file extension, and then I'd check the contents of the file. How do you go about it?
| Verifying a file upload is crucial for maintaining security and integrity in your application. Here are the essential steps you can take:
1. **Limit File Size**: Set maximum file size limits to prevent denial-of-service attacks and excessive resource usage.
2. **Restrict Allowed File Types**: Maintain a whitelist of ... | 8,189 | [
{
"from": "human",
"value": "What would you say are the essential steps in verifying a file upload?\nI'd tend to check the MIME type, give it a new (random) name, make sure its got an allowed file extension, and then I'd check the contents of the file. How do you go about it?\n"
},
{
"from": "gpt",
... |
I am looking to set the result action from a failed IAuthorizationFilter. However I am unsure how to create an ActionResult from inside the Filter. The controller doesn't seem to be accible from inside the filter so my usual View("SomeView") isn't working. Is there a way to get the controler or else another way of c... | In an `IAuthorizationFilter`, you don't have direct access to the controller, and hence you cannot call `View("SomeView")` as you would in a controller action. Instead, you need to set `context.Result` to an instance of an `ActionResult` that you can create manually.
For redirecting users to a login view or any other ... | 8,523 | [
{
"from": "human",
"value": "I am looking to set the result action from a failed IAuthorizationFilter. However I am unsure how to create an ActionResult from inside the Filter. The controller doesn't seem to be accible from inside the filter so my usual View(\"SomeView\") isn't working. Is there a way to... |
I have an Oracle database backup file (.dmp) that was created with expdp.
The .dmp file was an export of an entire database.
I need to restore 1 of the schemas from within this dump file.
I don't know the names of the schemas inside this dump file.
To use impdp to import the data I need the name of the schema to load.... | To inspect the contents of your `.dmp` file and list the schemas included in the Oracle Data Pump export (created with `expdp`), you can use the `impdp` command with the `CONTENT=METADATA_ONLY` option to extract metadata from the dump file. This way, you can view the schemas and their objects without actually importing... | 9,072 | [
{
"from": "human",
"value": "\nI have an Oracle database backup file (.dmp) that was created with expdp.\nThe .dmp file was an export of an entire database.\nI need to restore 1 of the schemas from within this dump file.\nI don't know the names of the schemas inside this dump file.\nTo use impdp to import t... |
Right now, I'm particularly interested in reading the data from MP3 files (ID3 tags?), but the more it can do (eg EXIF from images?) the better without compromising the ID3 tag reading abilities.
I'm interested in making a script that goes through my media (right now, my music files) and makes sure the file name and di... | Creating a script to read and validate media file metadata (like ID3 tags for MP3 files and EXIF data for images) against filenames and directory paths is a great project. Given your interest in using Python or Ruby, I'll provide a solution using Python, which has excellent libraries for handling media file metadata.
... | 1,180 | [
{
"from": "human",
"value": "Right now, I'm particularly interested in reading the data from MP3 files (ID3 tags?), but the more it can do (eg EXIF from images?) the better without compromising the ID3 tag reading abilities.\nI'm interested in making a script that goes through my media (right now, my music ... |
I'm looking for a desktop/embedded database. The two candidates I'm looking at are
Microsoft SQL Server CE and Oracle Lite. If anyone's used both of these products, it'd be great if you could compare them. I haven't been able to find any comparisons online.
The backend DB is Oracle10g.
Update: Clarification, the busine... | When comparing Microsoft SQL Server Compact Edition (SQL Server CE) and Oracle Lite for a client-server application with offline functionality, there are several factors to consider. Here’s a breakdown of the two databases based on various criteria:
### 1. **Integration with Backend Database**
- **Microsoft SQL Server... | 6,579 | [
{
"from": "human",
"value": "I'm looking for a desktop/embedded database. The two candidates I'm looking at are\nMicrosoft SQL Server CE and Oracle Lite. If anyone's used both of these products, it'd be great if you could compare them. I haven't been able to find any comparisons online.\nThe backend DB is O... |
I have this method on a webpart:
private IFilterData _filterData = null;
[ConnectionConsumer("Filter Data Consumer")]
public void GetConnectionInterface(IFilterData filterData)
{
_filterData = filterData;
}
Now, before I can call upon _filterData, I need to know when i can expect it to not be null. When is this?... | The `GetConnectionInterface` method you have implemented is part of the connection mechanism in SharePoint web parts. This method is called when the connection to the `IFilterData` interface is established. However, the timing of this call depends on when the web part connection is configured.
### When is `_filterData... | 8,854 | [
{
"from": "human",
"value": "I have this method on a webpart:\nprivate IFilterData _filterData = null;\n\n[ConnectionConsumer(\"Filter Data Consumer\")]\npublic void GetConnectionInterface(IFilterData filterData)\n{\n _filterData = filterData;\n}\n\nNow, before I can call upon _filterData, I need to know... |
My company just imported our CVS repository into Perforce. I'm new to P4V and I can't work out how to create a branch from an existing label. Can anyone tell me how to do this?
| Creating a branch from an existing label in Perforce (P4V) is a straightforward process, but it requires a few steps to ensure you're doing it correctly. Here's a guide to help you create a branch from an existing label:
1. **Open P4V**: Launch the P4V (Perforce Visual Client) application and connect to your Perforce ... | 9,005 | [
{
"from": "human",
"value": "My company just imported our CVS repository into Perforce. I'm new to P4V and I can't work out how to create a branch from an existing label. Can anyone tell me how to do this?\n"
},
{
"from": "gpt",
"value": "Creating a branch from an existing label in Perforce (P4V... |
Ometa is "a new object-oriented language for pattern matching." I've encountered pattern matching in languages like Oz tools to parse grammars like Lexx/Yacc or Pyparsing before. Despite looking at example code, reading discussions, and talking to a friend, I still am not able to get a real understanding of what makes... | Ometa is indeed an interesting language that focuses on pattern matching, and it provides some features that distinguish it from other parsing tools and languages. Here are a few aspects that contribute to its uniqueness and why some people find it compelling:
1. **Object-Oriented Syntax**: Ometa uses an object-orient... | 6,735 | [
{
"from": "human",
"value": "Ometa is \"a new object-oriented language for pattern matching.\" I've encountered pattern matching in languages like Oz tools to parse grammars like Lexx/Yacc or Pyparsing before. Despite looking at example code, reading discussions, and talking to a friend, I still am not abl... |
I think the best part of flash is the possibility to create not squared user interfaces, so I like the idea to create desktop apps using flash. I know AIR is for that but it doesn't allow real access to OperatingSystem apis and dlls and the commercial options are kind of difficult to customize.
| Your interest in creating non-square user interfaces with Flash and AIR is well-founded, as Flash offered a lot of flexibility in designing custom UIs. However, as you noted, Adobe AIR has its limitations when it comes to accessing certain operating system APIs and integrating deeply with native libraries (DLLs on Wind... | 7,667 | [
{
"from": "human",
"value": "I think the best part of flash is the possibility to create not squared user interfaces, so I like the idea to create desktop apps using flash. I know AIR is for that but it doesn't allow real access to OperatingSystem apis and dlls and the commercial options are kind of difficu... |
Do any asynchronous connectors exist for Mysql that can be used within a C or C++ application? I'm looking for something that can be plugged into a reactor pattern written in Boost.Asio.
[Edit:] Running a synchronous connector in threads is not an option.
| Yes, there are some asynchronous MySQL connectors that can be integrated with a C or C++ application, particularly those that can work within a reactor pattern like Boost.Asio. Here are a few options to consider:
1. **MySQL Connector/C++ with Asynchronous API (MySQL 8.0 and later)**:
MySQL Connector/C++ has support... | 5,985 | [
{
"from": "human",
"value": "Do any asynchronous connectors exist for Mysql that can be used within a C or C++ application? I'm looking for something that can be plugged into a reactor pattern written in Boost.Asio.\n[Edit:] Running a synchronous connector in threads is not an option.\n"
},
{
"from"... |
Is there a framework that can be used to enable a C# Windows Service to automatically check for a newer version and upgrade itself? I can certainly write code to accomplish this, but I am looking for a framework that has already been implemented and (most importantly) tested.
[edit]
Here is a link to a similar questio... | Yes, there are several frameworks and libraries available that can help you implement auto-updating functionality in a C# Windows Service. Here are some popular options that have been tested and used in various projects:
1. **Squirrel.Windows**: This is a popular framework for adding auto-update functionality to Windo... | 7,064 | [
{
"from": "human",
"value": "Is there a framework that can be used to enable a C# Windows Service to automatically check for a newer version and upgrade itself? I can certainly write code to accomplish this, but I am looking for a framework that has already been implemented and (most importantly) tested.\n... |
I know that there is no official API for Google Analytics but is there a way to access Google Analytics Reports with C#?
| Yes, you can access Google Analytics reports using the Google Analytics Reporting API, which allows you to programmatically retrieve your Google Analytics data. Although there is no standalone "API for Google Analytics" in a singular form, the Google Analytics Reporting API is what you would use.
To access Google Anal... | 4,702 | [
{
"from": "human",
"value": "I know that there is no official API for Google Analytics but is there a way to access Google Analytics Reports with C#?\n"
},
{
"from": "gpt",
"value": "Yes, you can access Google Analytics reports using the Google Analytics Reporting API, which allows you to progra... |
I am using VMWare tools for Ubuntu Hardy, but for some reason vmware-install.pl finds fault with my LINUX headers. The error message says that the "address space size" doesn't match.
To try and remediate, I have resorted to vmware-any-any-update117, and am now getting the following error instead:
In file included from ... | The error you're encountering seems to be related to compatibility issues between the version of VMware Tools you're using and the Linux kernel headers on your Ubuntu Hardy system. Here's a step-by-step approach to troubleshoot and possibly resolve the issues:
### Steps to Resolve the Issue
1. **Update Your System**:... | 4,164 | [
{
"from": "human",
"value": "I am using VMWare tools for Ubuntu Hardy, but for some reason vmware-install.pl finds fault with my LINUX headers. The error message says that the \"address space size\" doesn't match.\nTo try and remediate, I have resorted to vmware-any-any-update117, and am now getting the fol... |
Has anyone out there got a good set of instructions for building/compiling Ruby from source of windows XP ?
| Building Ruby from source on Windows XP can be a bit challenging due to the age of the operating system and potential compatibility issues. However, if you're willing to give it a try, here are general steps to guide you through the process:
### Prerequisites
1. **Install Ruby Development Kit (DevKit)**:
- Downloa... | 7,399 | [
{
"from": "human",
"value": "Has anyone out there got a good set of instructions for building/compiling Ruby from source of windows XP ?\n"
},
{
"from": "gpt",
"value": "Building Ruby from source on Windows XP can be a bit challenging due to the age of the operating system and potential compatib... |
Do you still use session or entity EJBs in your project? Why?
| Enterprise JavaBeans (EJB) technology has evolved over the years, and the use of session and entity beans depends on the specific needs of a project. Here are some considerations regarding their usage:
### When to Use Session EJBs:
1. **Business Logic Encapsulation**: Session beans are ideal for encapsulating busines... | 10,039 | [
{
"from": "human",
"value": "Do you still use session or entity EJBs in your project? Why?\n"
},
{
"from": "gpt",
"value": "Enterprise JavaBeans (EJB) technology has evolved over the years, and the use of session and entity beans depends on the specific needs of a project. Here are some consider... |
What things should be kept most in mind when writing cross-platform applications in C? Targeted platforms: 32-bit Intel based PC, Mac, and Linux. I'm especially looking for the type of versatility that Jungle Disk has in their USB desktop edition ( http://www.jungledisk.com/desktop/download.aspx )
What are tips and "go... | When writing cross-platform applications in C for 32-bit Intel-based PCs, Macs, and Linux, there are several key considerations to keep in mind. Here are some tips, best practices, and common pitfalls to avoid:
### 1. **Use Standard C Libraries**
- Stick to the C standard library (`<stdio.h>`, `<stdlib.h>`, `<strin... | 6,778 | [
{
"from": "human",
"value": "What things should be kept most in mind when writing cross-platform applications in C? Targeted platforms: 32-bit Intel based PC, Mac, and Linux. I'm especially looking for the type of versatility that Jungle Disk has in their USB desktop edition ( http://www.jungledisk.com/desk... |
I'm a beginner at rails programming, attempting to show many images on a page. Some images are to lay on top of others. To make it simple, say I want a blue square, with a red square in the upper right corner of the blue square (but not tight in the corner). I am trying to avoid compositing (with ImageMagick and sim... | To achieve the desired layout with overlapping images in a Rails application, you can utilize HTML and CSS to position the images without the need for compositing with libraries like ImageMagick. Here’s how you can do it step-by-step.
### Step 1: Set Up Your Rails Application
Ensure you have a Rails application set u... | 6,371 | [
{
"from": "human",
"value": "I'm a beginner at rails programming, attempting to show many images on a page. Some images are to lay on top of others. To make it simple, say I want a blue square, with a red square in the upper right corner of the blue square (but not tight in the corner). I am trying to av... |
I just found /n softwares free Powershell NetCmdlets, and after playing with them I love the functionality they bring to the command line. So it raises the question what are your favorite Cmdlets, and how do you use them?
| PowerShell Cmdlets provide powerful functionalities for managing Windows systems, and there are many that users find especially useful. Here are some favorite Cmdlets along with how they can be used:
### 1. `Get-Process`
**Usage**: Retrieves the processes that are running on your machine.
```powershell
Get-Process
``... | 2,412 | [
{
"from": "human",
"value": "I just found /n softwares free Powershell NetCmdlets, and after playing with them I love the functionality they bring to the command line. So it raises the question what are your favorite Cmdlets, and how do you use them?\n"
},
{
"from": "gpt",
"value": "PowerShell ... |
We have several wizard style form applications on our website where we capture information from the user on each page and then submit to a backend process using a web service.
Unfortunately we can't submit the information in chunks during each form submission so we have to store it the users session until the end of th... | When using sessions in an ASP.NET Web Forms application, there are several important considerations beyond just server memory and SQL Server disk space that you need to account for when determining how much data you can store in user sessions:
1. **Session State Storage**: ASP.NET can store session state in various wa... | 8,180 | [
{
"from": "human",
"value": "We have several wizard style form applications on our website where we capture information from the user on each page and then submit to a backend process using a web service.\nUnfortunately we can't submit the information in chunks during each form submission so we have to stor... |
We're experimenting with various ways to throttle user actions in a given time period:
Limit question/answer posts
Limit edits
Limit feed retrievals
For the time being, we're using the Cache to simply insert a record of user activity - if that record exists if/when the user does the same activity, we throttle.
Using ... | Throttling user actions effectively requires a balance between performance, user experience, and system stability. Below are several strategies that you can consider for throttling user actions beyond using a simple cache-based approach:
### 1. **Rate Limiting with Sliding Windows**
Implement a sliding window rate lim... | 3,121 | [
{
"from": "human",
"value": "We're experimenting with various ways to throttle user actions in a given time period:\n\nLimit question/answer posts\nLimit edits\nLimit feed retrievals\n\nFor the time being, we're using the Cache to simply insert a record of user activity - if that record exists if/when the u... |
Should simple JavaBeans that have only simple getters and setters be unit tested??
What about Beans with some logic in getters and setters?
| The decision to unit test simple JavaBeans depends on several factors, including the context of the application, the importance of the data encapsulated within the beans, and the complexity of the logic involved in the getters and setters.
### 1. Simple JavaBeans (Only Getters and Setters):
- **Generally Not Required:... | 11,160 | [
{
"from": "human",
"value": "Should simple JavaBeans that have only simple getters and setters be unit tested?? \nWhat about Beans with some logic in getters and setters?\n"
},
{
"from": "gpt",
"value": "The decision to unit test simple JavaBeans depends on several factors, including the context... |
If you're familiar with the phrase "build one to throw away", well, we seem to have done that; we’re reaching the limits of version 1 of our online app. It's time to clean things up by:
Re-organizing code and UI
Unifying UI processes
Adding more functionality
Building for the future
Modifying our database structure to... | Transitioning from an early version of an online application to a more refined and robust version can indeed be a complex undertaking. Here are some strategies to consider based on your objectives and concerns:
### 1. **Incremental Refactoring and Modular Updates**
Instead of a complete overhaul, consider refactoring... | 7,044 | [
{
"from": "human",
"value": "If you're familiar with the phrase \"build one to throw away\", well, we seem to have done that; we’re reaching the limits of version 1 of our online app. It's time to clean things up by:\n\nRe-organizing code and UI\nUnifying UI processes\nAdding more functionality\nBuilding fo... |
The original query looks like this (MySQL):
SELECT *
FROM books
WHERE title LIKE "%text%" OR description LIKE "%text%"
ORDER BY date
Would it be possible to rewrite it (without unions or procedures), so that result will look like this:
list of books where title matches query ordered by date, followed by:
list of b... | Yes, you can achieve the desired result by using a conditional sorting in the `ORDER BY` clause. Specifically, you can introduce a case statement that prioritizes rows where the title matches the query over those where the description matches. Here’s how you can rewrite your query:
```sql
SELECT *
FROM books
WHERE t... | 12,085 | [
{
"from": "human",
"value": "The original query looks like this (MySQL):\nSELECT * \nFROM books \nWHERE title LIKE \"%text%\" OR description LIKE \"%text%\" \nORDER BY date\n\nWould it be possible to rewrite it (without unions or procedures), so that result will look like this:\n\nlist of books where title ... |
Let's say I have an array, and I know I'm going to be doing a lot of "Does the array contain X?" checks. The efficient way to do this is to turn that array into a hash, where the keys are the array's elements, and then you can just say if($hash{X}) { ... }
Is there an easy way to do this array-to-hash conversion? Ideal... | Yes, you can easily convert an array into a hash in Perl using a simple method. The idea is to take the elements of the array and set them as keys in the hash. If you want to handle an anonymous array and return an anonymous hash, you can do this with a straightforward subroutine.
Here's an example of how you can achi... | 9,110 | [
{
"from": "human",
"value": "Let's say I have an array, and I know I'm going to be doing a lot of \"Does the array contain X?\" checks. The efficient way to do this is to turn that array into a hash, where the keys are the array's elements, and then you can just say if($hash{X}) { ... }\nIs there an easy wa... |
I need to calculate Math.exp() from java very frequently, is it possible to get a native version to run faster than java's Math.exp()??
I tried just jni + C, but it's slower than just plain java.
| If you're looking to optimize the calculation of `Math.exp()` in Java and have found that JNI (Java Native Interface) with C is slower, there are a few approaches you might consider to improve performance:
### 1. **Use Approximation Algorithms**
Instead of calculating the exponential function directly, you can use app... | 6,265 | [
{
"from": "human",
"value": "I need to calculate Math.exp() from java very frequently, is it possible to get a native version to run faster than java's Math.exp()??\nI tried just jni + C, but it's slower than just plain java.\n"
},
{
"from": "gpt",
"value": "If you're looking to optimize the cal... |
I've come across this term POD-type a few times.
What does it mean?
| The term "POD-type" can refer to different concepts depending on the context in which it's used. Here are a few common interpretations:
1. **Print on Demand (POD)**: In the context of publishing and printing, "POD" refers to Print on Demand. This is a printing technology that allows for the production of books, mercha... | 11,902 | [
{
"from": "human",
"value": "I've come across this term POD-type a few times.\nWhat does it mean? \n"
},
{
"from": "gpt",
"value": "The term \"POD-type\" can refer to different concepts depending on the context in which it's used. Here are a few common interpretations:\n\n1. **Print on Demand (P... |
This one has me kind of stumped. I want to make the first word of all the paragraphs in my #content div at 14pt instead of the default for the paragraphs (12pt). Is there a way to do this in straight CSS or am I left wrapping the first word in a span to accomplish this?
| You can achieve this effect using CSS by utilizing the `::first-letter` pseudo-element, but unfortunately, CSS does not have a built-in way to specifically target the first word of a paragraph directly. The `::first-letter` pseudo-element only allows you to style the first letter, not the entire first word.
However, y... | 10,341 | [
{
"from": "human",
"value": "This one has me kind of stumped. I want to make the first word of all the paragraphs in my #content div at 14pt instead of the default for the paragraphs (12pt). Is there a way to do this in straight CSS or am I left wrapping the first word in a span to accomplish this?\n"
},
... |
I want to prevent XSS attacks in my web application. I found that HTML Encoding the output can really prevent XSS attacks. Now the problem is that how do I HTML encode every single output in my application? I there a way to automate this?
I appreciate answers for JSP, ASP.net and PHP.
| Preventing XSS (Cross-Site Scripting) attacks is crucial for web applications, and HTML encoding is indeed one of the most effective strategies. Automating the process of HTML encoding your outputs can help ensure consistency and minimize errors. Here are some strategies for automating HTML encoding for JSP, ASP.NET, a... | 6,437 | [
{
"from": "human",
"value": "I want to prevent XSS attacks in my web application. I found that HTML Encoding the output can really prevent XSS attacks. Now the problem is that how do I HTML encode every single output in my application? I there a way to automate this?\nI appreciate answers for JSP, ASP.net a... |
I have a FullTrust assembly, Assembly A, which calls a 3rd party component, Assembly B. Is there any way I can, via A.dll.config or in A's code, prevent any CAS demands from propagating up the stack to Assembly B, which does not have FullTrust?
I do not want to alter the machine's security policy, if possible.
| In .NET, Code Access Security (CAS) can be quite intricate, especially when dealing with Full Trust assemblies and partially trusted ones. If you have a Full Trust assembly (Assembly A) that calls a third-party component (Assembly B) which is not Full Trust, you are indeed faced with the challenge of how CAS demands pr... | 7,705 | [
{
"from": "human",
"value": "I have a FullTrust assembly, Assembly A, which calls a 3rd party component, Assembly B. Is there any way I can, via A.dll.config or in A's code, prevent any CAS demands from propagating up the stack to Assembly B, which does not have FullTrust?\nI do not want to alter the machi... |
I liked the discussion at Differences in Generics, and was wondering whether there were any languages that used this feature particularly well.
I really dislike Java's List<? extends Foo> for a List of things that are Liskov-substitutable for Foo. Why can't List<Foo> cover that?
And honestly, Comparable<? super Bar>?
... | Generics are a powerful feature in many programming languages, but their implementation can vary significantly, leading to different experiences for developers. Here are some languages known for their effective use of generics, along with a discussion of the points you raised:
### 1. **Rust**
Rust uses generics in a v... | 6,527 | [
{
"from": "human",
"value": "I liked the discussion at Differences in Generics, and was wondering whether there were any languages that used this feature particularly well.\nI really dislike Java's List<? extends Foo> for a List of things that are Liskov-substitutable for Foo. Why can't List<Foo> cover tha... |
With the new caching options in Rails 2.1 i get nice entires in my log along the lines of
Cached fragment hit: views/homepage (0.16549)
However they are logged at the :debug level, which is the same level as the SQL output. I want to be able to disable the SQL output, and still see the cache info. How can I do this
| In Rails 2.1, you can customize the logging behavior by modifying the log level for specific components. If you want to disable the SQL output (which is logged at the `:debug` level) while still allowing `:debug` level logs for cache hits, you can achieve this by filtering out the SQL log messages.
Here’s one way to a... | 10,737 | [
{
"from": "human",
"value": "With the new caching options in Rails 2.1 i get nice entires in my log along the lines of\nCached fragment hit: views/homepage (0.16549)\nHowever they are logged at the :debug level, which is the same level as the SQL output. I want to be able to disable the SQL output, and stil... |
var e1 = new E1();
e1.e2s.Add(new e2()); //e2s is null until e1 is saved, i want to save them all at the same time
context.e1s.imsertonsubmit(e1);
context.submitchanges();
| In your current implementation, it seems you want to create a new instance of `E1`, add an instance of `E2` to its `e2s` collection, and save everything to the database at the same time. However, if the `e2s` collection is null until `e1` is saved, you may run into problems.
To ensure that you can save both `E1` and `... | 4,607 | [
{
"from": "human",
"value": "var e1 = new E1();\ne1.e2s.Add(new e2()); //e2s is null until e1 is saved, i want to save them all at the same time\ncontext.e1s.imsertonsubmit(e1);\ncontext.submitchanges();\n\n"
},
{
"from": "gpt",
"value": "In your current implementation, it seems you want to crea... |
Basically, I'm trying to tap into the Soap pipeline in .NET 2.0 - I want to do what a SoapExtension can do if you provide a custom SoapExtensionAttribute... but to do it for every SOAP call without having to add the extension attribute to dozens of WebMethods.
What I'm looking for is any extension point that lets me ... | To achieve the functionality you're looking for in .NET 2.0, you can make use of the `SoapExtension` class, but you'll need to find a way to apply it globally without needing to decorate each individual web method with the `SoapExtensionAttribute`.
Since you're looking for a way to intercept all SOAP messages for a w... | 7,976 | [
{
"from": "human",
"value": "Basically, I'm trying to tap into the Soap pipeline in .NET 2.0 - I want to do what a SoapExtension can do if you provide a custom SoapExtensionAttribute... but to do it for every SOAP call without having to add the extension attribute to dozens of WebMethods. \nWhat I'm lookin... |
Suppose you have the following string:
white sand, tall waves, warm sun
It's easy to write a regular expression that will match the delimiters, which the Java String.split() method can use to give you an array containing the tokens "white sand", "tall waves" and "warm sun":
\s*,\s*
Now say you have this string:
white... | To split the string `"white sand, tall waves and warm sun"` into the tokens `"white sand"`, `"tall waves"`, and `"warm sun"` using a single regular expression, you can use the following regex pattern:
```regex
\s*,\s*|\s+and\s+
```
This regex combines two delimiters:
1. `\s*,\s*` - Matches a comma with optional white... | 9,666 | [
{
"from": "human",
"value": "Suppose you have the following string:\nwhite sand, tall waves, warm sun\n\nIt's easy to write a regular expression that will match the delimiters, which the Java String.split() method can use to give you an array containing the tokens \"white sand\", \"tall waves\" and \"warm s... |
I have an ASP.net application that works fine in the development environment but in the production environment throws the following exception when clicking a link that performs a postback. Any ideas?
Invalid postback or callback argument.
Event validation is enabled using
in configuration or <%@ Page
EnableE... | The error you are encountering—"Invalid postback or callback argument"—is due to ASP.NET's event validation feature. This feature is designed to prevent potentially malicious postback data from being processed, ensuring that any data sent back to the server during a postback matches the data that was originally rendere... | 8,239 | [
{
"from": "human",
"value": "I have an ASP.net application that works fine in the development environment but in the production environment throws the following exception when clicking a link that performs a postback. Any ideas?\n\nInvalid postback or callback argument.\n Event validation is enabled using... |
It's my understanding that nulls are not indexable in DB2, so assuming we have a huge table (Sales) with a date column (sold_on) which is normally a date, but is occasionally (10% of the time) null.
Furthermore, let's assume that it's a legacy application that we can't change, so those nulls are staying there and mean ... | In DB2, standard B-tree indexes do not include NULL values in the index structure, which means that queries specifically looking for NULLs, as you've identified, won't benefit from a traditional index on the `sold_on` column.
However, there are several strategies you could consider to improve the performance of querie... | 9,278 | [
{
"from": "human",
"value": "It's my understanding that nulls are not indexable in DB2, so assuming we have a huge table (Sales) with a date column (sold_on) which is normally a date, but is occasionally (10% of the time) null.\nFurthermore, let's assume that it's a legacy application that we can't change, ... |
I'm looking for a tool to generate a JavaScript stub from a WSDL.
Although I usually prefer to use REST services with JSON or XML, there are some tools I am currently integrating that works only using SOAP.
I already created a first version of the client in JavaScript but I'm parsing the SOAP envelope by hand and I dou... | Generating a JavaScript client from a WSDL file for SOAP services can indeed streamline the process and increase the reliability of your code. Here are some tools and libraries that can help you generate JavaScript stubs from a WSDL file, particularly for RPC encoded services:
1. **SOAP Client Libraries**:
- **soap... | 6,828 | [
{
"from": "human",
"value": "I'm looking for a tool to generate a JavaScript stub from a WSDL.\nAlthough I usually prefer to use REST services with JSON or XML, there are some tools I am currently integrating that works only using SOAP.\nI already created a first version of the client in JavaScript but I'm ... |
Without getting a degree in information retrieval, I'd like to know if there exists any algorithms for counting the frequency that words occur in a given body of text. The goal is to get a "general feel" of what people are saying over a set of textual comments. Along the lines of Wordle.
What I'd like:
ignore articl... | Absolutely, there are several algorithms and approaches you can employ to analyze word frequency in a body of text while considering your requirements. Here’s a general outline of how you can achieve this using common techniques and tools in natural language processing (NLP):
### Basic Steps for Counting Word Frequenc... | 6,575 | [
{
"from": "human",
"value": "Without getting a degree in information retrieval, I'd like to know if there exists any algorithms for counting the frequency that words occur in a given body of text. The goal is to get a \"general feel\" of what people are saying over a set of textual comments. Along the lin... |
As much as we would all like to say it is a benefit to programmers to be language agnostic, is it really feasible to support multiple enterprise Web applications of the same type all written in different languages? Think about how complicated a CMS or e-commerce system can be -- now imagine supporting three different C... | Supporting multiple enterprise web applications written in different programming languages can indeed be a complex and challenging endeavor. Here are some considerations based on industry experiences that may help clarify the situation:
### 1. **Learning Curve and Expertise**:
- **Initial Learning**: When a team en... | 8,151 | [
{
"from": "human",
"value": "As much as we would all like to say it is a benefit to programmers to be language agnostic, is it really feasible to support multiple enterprise Web applications of the same type all written in different languages? Think about how complicated a CMS or e-commerce system can be --... |
I'm trying to hijack an asterisk with the form's KeyUp event. I can get the SHIFT key and the D8 key on the KeyUp event, but I can't get the * out of it. I can find it easily in the KeyPress event (e.KeyChar = "*"c), but company standards say that we have to use the KeyUp event for all such occasions. Thanks!
| In the context of handling key events in a Windows Forms application, the KeyUp event is not designed to provide character values directly like the KeyPress event does. Instead, it provides key codes which represent the keys pressed on the keyboard.
To detect the `*` (asterisk) character using the KeyUp event, you ne... | 9,328 | [
{
"from": "human",
"value": "I'm trying to hijack an asterisk with the form's KeyUp event. I can get the SHIFT key and the D8 key on the KeyUp event, but I can't get the * out of it. I can find it easily in the KeyPress event (e.KeyChar = \"*\"c), but company standards say that we have to use the KeyUp ev... |
Is there an XSLT library that is pure Python?
Installing libxml2+libxslt or any similar C libraries is a problem on some of the platforms I need to support.
I really only need basic XSLT support, and speed is not a major issue.
| Yes, there are pure Python libraries for XSLT processing that do not require C libraries like libxml2 or libxslt. Here are a few options you might consider:
1. **lxml (with pure Python support)**:
While `lxml` is typically backed by C libraries, you can use `xml.etree.ElementTree` or `xml.dom` with Python's built-i... | 11,997 | [
{
"from": "human",
"value": "Is there an XSLT library that is pure Python?\nInstalling libxml2+libxslt or any similar C libraries is a problem on some of the platforms I need to support.\nI really only need basic XSLT support, and speed is not a major issue.\n"
},
{
"from": "gpt",
"value": "Yes,... |
I have an action like this:
public class News : System.Web.Mvc.Controller
{
public ActionResult Archive(int year)
{
/ *** /
}
}
With a route like this:
routes.MapRoute(
"News-Archive",
"News.mvc/Archive/{year}", ... | The behavior you are experiencing is due to how the `Url.RouteUrl` method works. When you call `Url.RouteUrl("News-Archive")`, it generates a URL based on the current route values, which includes the year you are currently on (`2008`). This is why you see the action URL being rendered as `/News.mvc/Archive/2008`.
To a... | 8,675 | [
{
"from": "human",
"value": "I have an action like this:\npublic class News : System.Web.Mvc.Controller\n{\n public ActionResult Archive(int year)\n {\n / *** /\n }\n}\n\nWith a route like this:\nroutes.MapRoute(\n \"News-Archive\", \n ... |
I have the following script, where the first and third document.writeline are static and the second is generated:
<script language="javascript" type="text/javascript">
document.write("<script language='javascript' type='text/javascript' src='before.js'><\/sc" + "ript>");
document.write("<script language='javascript' ty... | The behavior you're experiencing is due to how browsers execute JavaScript and handle `document.write`. When you use `document.write`, it modifies the document's content directly, and different browsers may handle this modification differently, especially when combined with external scripts.
In your specific case, usi... | 10,202 | [
{
"from": "human",
"value": "I have the following script, where the first and third document.writeline are static and the second is generated:\n<script language=\"javascript\" type=\"text/javascript\">\ndocument.write(\"<script language='javascript' type='text/javascript' src='before.js'><\\/sc\" + \"ript>\... |
I cannot use the Resource File API from within a file system plugin due to a PlatSec issue:
*PlatSec* ERROR - Capability check failed - Can't load filesystemplugin.PXT because it links to bafl.dll which has the following capabilities missing: TCB
My understanding of the issue is that:
File system plugins are dlls whi... | You're correct in your understanding of the capabilities and the constraints that apply to file system plugins in the context of the platform security model (PlatSec) in Symbian OS. The TCB (Trusted Computing Base) privilege is indeed a requirement for any DLL used within a file system process. Since `bafl.dll` does no... | 10,618 | [
{
"from": "human",
"value": "I cannot use the Resource File API from within a file system plugin due to a PlatSec issue:\n*PlatSec* ERROR - Capability check failed - Can't load filesystemplugin.PXT because it links to bafl.dll which has the following capabilities missing: TCB \n\nMy understanding of the iss... |
I'm creating a form using the Content Construction Kit (CCK) in Drupal5.
I've added several singe on/off checkboxes but their associated labels are not being displayed. Help text is displayed underneath the checkboxes but this is not the desired behavior. To me the expected behavior is that the label would appear b... | In Drupal 5, when using the Content Construction Kit (CCK) to create forms with checkboxes, it's important to ensure that labels are correctly set up for each checkbox field. If the labels are not being displayed beside the checkboxes, here are a few steps you can take to troubleshoot and fix the issue:
1. **Check Fie... | 8,848 | [
{
"from": "human",
"value": "I'm creating a form using the Content Construction Kit (CCK) in Drupal5. \nI've added several singe on/off checkboxes but their associated labels are not being displayed. Help text is displayed underneath the checkboxes but this is not the desired behavior. To me the expected... |
There is a rich scripting model for Microsoft Office, but not so with Apple iWork, and specifically the word processor Pages. While there are some AppleScript hooks, it looks like the best approach is to manipulate the underlying XML data.
This turns out to be pretty ugly because (for example) page breaks are stored in... | Manipulating Pages documents via XML can indeed be quite challenging, especially when it comes to managing elements like page breaks, which don't correspond directly to the logical flow of the text. Here are a few thoughts and potential approaches you could consider:
1. **Use AppleScript for Simple Automation**: While... | 7,479 | [
{
"from": "human",
"value": "There is a rich scripting model for Microsoft Office, but not so with Apple iWork, and specifically the word processor Pages. While there are some AppleScript hooks, it looks like the best approach is to manipulate the underlying XML data.\nThis turns out to be pretty ugly becau... |
When writing j2me applications for cellphones, using System.out.println() prints on the console if using an emulator. However, when the code is deployed on a cellphone, where does the console output go?
If it is impossible to see this in the untethered cellphone, is there a way to see it if the cellphone is still conne... | In J2ME applications, `System.out.println()` is typically used for debugging purposes during development, especially when running the application on an emulator. In the emulator environment, console output is displayed in the IDE's console or terminal.
However, when you deploy the J2ME application on an actual cellpho... | 9,937 | [
{
"from": "human",
"value": "When writing j2me applications for cellphones, using System.out.println() prints on the console if using an emulator. However, when the code is deployed on a cellphone, where does the console output go?\nIf it is impossible to see this in the untethered cellphone, is there a way... |
Why does C++ Builder 6 always compile all files?
I make some changes on one file but BCB 6 compiles all files when I start the app. Any idea? I use Windows XP SP2.
| C++ Builder 6 (BCB 6) is an older IDE, and there are several reasons it might compile all files instead of just the modified ones. Here are some common causes and potential solutions:
1. **Project File (.bpr) Corruption**: The project file may have become corrupted. Try removing and re-adding files or creating a new p... | 7,743 | [
{
"from": "human",
"value": "Why does C++ Builder 6 always compile all files? \nI make some changes on one file but BCB 6 compiles all files when I start the app. Any idea? I use Windows XP SP2.\n"
},
{
"from": "gpt",
"value": "C++ Builder 6 (BCB 6) is an older IDE, and there are several reasons... |
For a while, I thought I'd host stuff at home because I can do whatever I want. However, hurricane Ike knocked out my power for a week, and I've finally realized this situation won't work.
I have extremely low traffice websites (20 visitors/day), so I don't need tons of CPU or bandwidth. What cheap options are there ... | If you're looking for affordable VPS hosting options that provide you with the flexibility to configure your server, here are some reliable providers that you might consider:
1. **DigitalOcean**:
- Plans start as low as $5/month.
- Offers a simple and user-friendly interface.
- You can create droplets with va... | 8,891 | [
{
"from": "human",
"value": "For a while, I thought I'd host stuff at home because I can do whatever I want. However, hurricane Ike knocked out my power for a week, and I've finally realized this situation won't work.\nI have extremely low traffice websites (20 visitors/day), so I don't need tons of CPU or... |
I need to determine which version of GTK+ is installed on Ubuntu
Man does not seem to help
| To determine which version of GTK+ is installed on your Ubuntu system, you can use several methods. Here are a few ways to check the installed version:
### Method 1: Using the `dpkg` command
You can use the `dpkg` command to query the installed GTK+ packages:
1. Open a terminal.
2. Run the following command:
```b... | 10,855 | [
{
"from": "human",
"value": "I need to determine which version of GTK+ is installed on Ubuntu\nMan does not seem to help\n"
},
{
"from": "gpt",
"value": "To determine which version of GTK+ is installed on your Ubuntu system, you can use several methods. Here are a few ways to check the installed... |
We are getting an error in a VB6 application that sends data back and forth over TCP sockets. We get a runtime error "out of string space". Has anyone seen this or have any thoughts on why this would happen? It seems like we are hitting some VB6 threshhold so any other thoughts would be helpful as well.
| The "Out of string space" error in VB6 typically occurs when your application attempts to use more string memory than is available. This can happen for a variety of reasons in a TCP socket application. Here are some common causes and possible solutions:
### Possible Causes
1. **Large Strings**: If your application is... | 9,544 | [
{
"from": "human",
"value": "We are getting an error in a VB6 application that sends data back and forth over TCP sockets. We get a runtime error \"out of string space\". Has anyone seen this or have any thoughts on why this would happen? It seems like we are hitting some VB6 threshhold so any other thou... |
http://en.wikipedia.org/wiki/Diamond_problem
I know what it means, but what steps can I take to avoid it?
| The diamond problem, also known as the "deadly diamond of death," arises in multiple inheritance situations in object-oriented programming, particularly when a class inherits from two classes that both inherit from a common base class. This can lead to ambiguity and confusion about which path to take when accessing mem... | 10,169 | [
{
"from": "human",
"value": "http://en.wikipedia.org/wiki/Diamond_problem\nI know what it means, but what steps can I take to avoid it?\n"
},
{
"from": "gpt",
"value": "The diamond problem, also known as the \"deadly diamond of death,\" arises in multiple inheritance situations in object-oriente... |
NHibernate is not really a good fit for our environment due to all the dependencies. (Castle, log4net etc.)
Is there a good lightweight alternative?
Support for simple file based databases such as Access/SQLite/VistaDB is essential.
Ideally, something contained in a single assembly that only references .NET assemblies.... | If you're looking for a lightweight alternative to NHibernate that has minimal dependencies and supports simple file-based databases like Access, SQLite, or VistaDB, here are a few options you might consider:
1. **Dapper**:
- **Overview**: Dapper is a micro-ORM developed by the team at Stack Overflow. It is designe... | 6,559 | [
{
"from": "human",
"value": "NHibernate is not really a good fit for our environment due to all the dependencies. (Castle, log4net etc.)\nIs there a good lightweight alternative?\nSupport for simple file based databases such as Access/SQLite/VistaDB is essential.\nIdeally, something contained in a single as... |
A friend of mine and I were having a discussion regarding currying and partial function application in Javascript, and we came to very different conclusions as to whether either were achievable. I came up with this implementation of Function.prototype.curry, which was the basis of our discussion:
Function.prototype.cur... | Your implementation of currying in JavaScript and your interpretation of the concept of partial application are both valid within the context of functional programming principles, even though JavaScript does not have built-in support for partial application like some other languages do.
### Your Position
Your argumen... | 9,684 | [
{
"from": "human",
"value": "A friend of mine and I were having a discussion regarding currying and partial function application in Javascript, and we came to very different conclusions as to whether either were achievable. I came up with this implementation of Function.prototype.curry, which was the basis ... |
I'm using ASP.NET Web Forms for blog style comments.
Edit 1: This looks way more complicated then I first thought. How do you filter the src?
I would prefer to still use real html tags but if things get too complicated that way, I might go a custom route. I haven't done any XML yet, so do I need to learn more about... | When building a blog comment system in ASP.NET Web Forms, handling user inputs carefully is crucial to avoid issues like cross-site scripting (XSS) attacks, especially if you're allowing HTML tags in comments. Here are some strategies you can consider to filter the HTML source and ensure your comments are safe.
### 1.... | 8,242 | [
{
"from": "human",
"value": "I'm using ASP.NET Web Forms for blog style comments. \nEdit 1: This looks way more complicated then I first thought. How do you filter the src?\nI would prefer to still use real html tags but if things get too complicated that way, I might go a custom route. I haven't done an... |
Which reporting technology would fit for the best situation/type of product? I am now thinking of 3 technologies:
Embedded Reports (Crystal Reports;MS Reporting services)
Server reports (MS Reporting Services)
OLAP Databases (MS Analysis Services)
Which report technology would you use for an off the shelf product? ... | When considering reporting technologies for an off-the-shelf product, the decision largely depends on the specific requirements of the application, user needs, and the type of data being processed. Let's evaluate the options based on your questions.
### Embedded Reports (Crystal Reports; MS Reporting Services)
**Best... | 8,734 | [
{
"from": "human",
"value": "Which reporting technology would fit for the best situation/type of product? I am now thinking of 3 technologies:\n\nEmbedded Reports (Crystal Reports;MS Reporting services) \nServer reports (MS Reporting Services) \nOLAP Databases (MS Analysis Services)\n\nWhich report technolo... |
I'm trying to draw a graph on an ASP webpage. I'm hoping an API can be helpful, but so far I have not been able to find one.
The graph contains labeled nodes and unlabeled directional edges.
The ideal output would be something like this.
Anybody know of anything pre-built than can help?
| There are several libraries and APIs that can help you create graphs with labeled nodes and directional edges for your ASP webpage. Here are a few popular options that you can consider:
### 1. **D3.js**
D3.js is a powerful JavaScript library for producing dynamic, interactive data visualizations in web browsers. You c... | 6,636 | [
{
"from": "human",
"value": "I'm trying to draw a graph on an ASP webpage. I'm hoping an API can be helpful, but so far I have not been able to find one. \nThe graph contains labeled nodes and unlabeled directional edges.\nThe ideal output would be something like this. \nAnybody know of anything pre-built t... |
For various reasons calling System.exit is frowned upon when writing Java Applications, so how can I notify the calling process that not everything is going according to plan?
Edit: The 1 is a standin for any non-zero exit code.
| In Java applications, particularly those that are part of larger systems or microservices, using `System.exit()` is generally discouraged because it terminates the entire Java Virtual Machine (JVM), which can lead to resource leaks and an uncontrolled shutdown of the application. Instead, it's better to communicate err... | 5,250 | [
{
"from": "human",
"value": "For various reasons calling System.exit is frowned upon when writing Java Applications, so how can I notify the calling process that not everything is going according to plan?\nEdit: The 1 is a standin for any non-zero exit code.\n"
},
{
"from": "gpt",
"value": "In J... |
How is the salt generated in HashProvider in Microsoft Enterprise Library when we set SaltEnabled?
Is it random to new machines? Is it some magic number?
(I know what is a salt, the question is what's the actual value of a/the salt in Enterprise Library HashProvider)
| In the Microsoft Enterprise Library, the `HashProvider` class is designed to hash data securely, and the use of salts is a key part of its functionality to prevent rainbow table attacks on hashed data.
When you enable salting in the `HashProvider`, the actual salt value is generated randomly each time a hash is create... | 10,861 | [
{
"from": "human",
"value": "How is the salt generated in HashProvider in Microsoft Enterprise Library when we set SaltEnabled?\nIs it random to new machines? Is it some magic number?\n(I know what is a salt, the question is what's the actual value of a/the salt in Enterprise Library HashProvider)\n"
},
... |
I'm accessing an Ubuntu machine using PuTTY, and using gcc.
The default LANG environment variable on this machine is set to en_NZ.UTF-8, which causes GCC to think PuTTY is capable of displaying UTF-8 text, which it doesn't seem to be.
Maybe it's my font, I don't know - it does this:
foo.c:1: error: expected â=â, â,â, ... | If you want to set your locale to avoid UTF-8 issues while still being able to use `man` and other commands without errors, you can set your environment to use a `C` or `POSIX` locale instead of `en_NZ.UTF-8`. The `C` locale is the traditional ASCII locale, which should work fine for GCC and won't give you the UTF-8 is... | 8,768 | [
{
"from": "human",
"value": "I'm accessing an Ubuntu machine using PuTTY, and using gcc.\nThe default LANG environment variable on this machine is set to en_NZ.UTF-8, which causes GCC to think PuTTY is capable of displaying UTF-8 text, which it doesn't seem to be. \nMaybe it's my font, I don't know - it doe... |
Is it "acceptable" to have an ASP.Net 2.0 application without the BLL (Business Logic Layer) as the following?
SQL Server Data Storage & Stored Procedures
Data Link Layer (Strongly Typed Table Adapters) connecting to Stored Procs
Presentation Layer ASPX Pages with Code behind and ObjectDataSource for connection straig... | In an ASP.NET 2.0 application, the decision to implement a Business Logic Layer (BLL) or not is influenced by several factors, including the complexity of the application, maintainability, scalability, and separation of concerns. Here's an analysis of your scenario:
### Acceptability of Not Using a BLL
Your proposed ... | 5,649 | [
{
"from": "human",
"value": "Is it \"acceptable\" to have an ASP.Net 2.0 application without the BLL (Business Logic Layer) as the following?\n\nSQL Server Data Storage & Stored Procedures\nData Link Layer (Strongly Typed Table Adapters) connecting to Stored Procs\nPresentation Layer ASPX Pages with Code be... |
I found this guide for using the flash parameters, thought it might be useful to post here, since Flash CS3 lacks a usage example for reading these parameters.
See answers for the link
| It sounds like you're sharing some useful information about using flash parameters in Flash CS3! If you're looking to provide an example or a specific code snippet for others who might be interested, feel free to include it here. This way, anyone reading your post will benefit from the practical application of the info... | 10,475 | [
{
"from": "human",
"value": "I found this guide for using the flash parameters, thought it might be useful to post here, since Flash CS3 lacks a usage example for reading these parameters.\nSee answers for the link\n"
},
{
"from": "gpt",
"value": "It sounds like you're sharing some useful inform... |
I'm wanting to get the full value of a char[] variable in the VC6 watch window, but it only shows a truncated version. I can copy the value from a debug memory window, but that contains mixed lines of hex and string values. Surely there is a better way??
| In Visual C++ 6.0, the watch window can indeed truncate long character arrays (strings) when displaying their values. However, there are a few methods you can use to view the full content of a `char[]` variable without the truncation issue:
### Method 1: Use the Debugger's Memory Window
While you mentioned this method... | 8,852 | [
{
"from": "human",
"value": "I'm wanting to get the full value of a char[] variable in the VC6 watch window, but it only shows a truncated version. I can copy the value from a debug memory window, but that contains mixed lines of hex and string values. Surely there is a better way??\n"
},
{
"from":... |
In C++ Windows app, I launch several long running child processes (currently I use CreateProcess(...) to do this.
I want the child processes to be automatically closed if my main processes crashes or is closed.
Because of the requirement that this needs to work for a crash of the "parent", I believe this would need to... | To ensure that child processes are automatically closed if the main process crashes or is terminated, you can use the Job Objects feature provided by Windows. Job Objects allow you to manage a group of processes as a single entity, and they provide options for automatic cleanup when the parent process exits or crashes.... | 6,164 | [
{
"from": "human",
"value": "In C++ Windows app, I launch several long running child processes (currently I use CreateProcess(...) to do this. \nI want the child processes to be automatically closed if my main processes crashes or is closed.\nBecause of the requirement that this needs to work for a crash of... |
I have inherited a poorly written web application that seems to have errors when it tries to read in an xml document stored in the database that has an "&" in it. For example there will be a tag with the contents: "Prepaid & Charge". Is there some secret simple thing to do to have it not get an error parsing that cha... | The issue you're encountering with the XML document is due to the fact that certain characters in XML are reserved and must be properly escaped to be well-formed. The ampersand (`&`) is one such character. In XML, an ampersand must be replaced with its corresponding entity reference, which is `&`.
### Handling Sp... | 10,624 | [
{
"from": "human",
"value": "I have inherited a poorly written web application that seems to have errors when it tries to read in an xml document stored in the database that has an \"&\" in it. For example there will be a tag with the contents: \"Prepaid & Charge\". Is there some secret simple thing to do... |
I need to compress portions of our application's network traffic for performance. I presume this means I need to stay away from some of the newer algorithms like bzip2, which I think I have heard is slower.
| When considering compression for network traffic, you’re correct that some algorithms prioritize compression ratios over speed, which can impact performance negatively, especially for real-time applications. Here are some points to consider when choosing a compression algorithm:
1. **Speed vs. Compression Ratio**: Alg... | 9,938 | [
{
"from": "human",
"value": "I need to compress portions of our application's network traffic for performance. I presume this means I need to stay away from some of the newer algorithms like bzip2, which I think I have heard is slower.\n"
},
{
"from": "gpt",
"value": "When considering compressi... |
The name of a temporary table such as #t1 can be determined using
select @TableName = [Name]
from tempdb.sys.tables
where [Object_ID] = object_id('tempDB.dbo.#t1')
How can I find the name of a table valued variable, i.e. one declared by
declare @t2 as table (a int)
the purpose is to be able to get meta-information ... | In SQL Server, table-valued variables are treated differently than temporary tables. While you can query metadata about temporary tables in `tempdb`, table-valued variables do not have a corresponding entry in the system catalog views like `sys.tables` or `sys.columns`. As a result, there isn't a direct way to query me... | 9,122 | [
{
"from": "human",
"value": "The name of a temporary table such as #t1 can be determined using \nselect @TableName = [Name]\nfrom tempdb.sys.tables \nwhere [Object_ID] = object_id('tempDB.dbo.#t1')\n\nHow can I find the name of a table valued variable, i.e. one declared by\ndeclare @t2 as table (a int)\n\nt... |
In crontab, I can use an asterisk to mean every value, or "*/2" to mean every even value.
Is there a way to specify every odd value? (Would something like "1+*/2" work?)
| In `crontab`, there is no direct way to specify "every odd value" like you can with "*/2" for even values. However, you can achieve this by explicitly listing the odd values for the field you are interested in.
For example, if you're setting up a cron job and want to run it every odd minute, you could specify:
```
1... | 11,196 | [
{
"from": "human",
"value": "In crontab, I can use an asterisk to mean every value, or \"*/2\" to mean every even value.\nIs there a way to specify every odd value? (Would something like \"1+*/2\" work?)\n"
},
{
"from": "gpt",
"value": "In `crontab`, there is no direct way to specify \"every odd... |
I have a Windows 2008 Server (x64) running Microsoft SQL 2008 (x64) and I'm creating a Linked Server connection to an Oracle server. I'm able to make the connection, but I cannot see any information regarding which schema a table belongs to.
In SQL 2005, my linked servers show the schema information as I would expect.... | The issue you're experiencing with missing schema information when using a linked server to Oracle from SQL Server 2008 can often be attributed to how the Oracle provider is handling schema visibility. Here are some suggestions and troubleshooting steps you can take to resolve this issue:
### 1. Check Oracle User Perm... | 5,855 | [
{
"from": "human",
"value": "I have a Windows 2008 Server (x64) running Microsoft SQL 2008 (x64) and I'm creating a Linked Server connection to an Oracle server. I'm able to make the connection, but I cannot see any information regarding which schema a table belongs to.\nIn SQL 2005, my linked servers show... |
Moved from preview 2 to preview 5 and now my Html.ActionLink calls are all failing. It appears that the generic version has been replaced with a non-type safe version.
// used to work
<li>
<%= Html.ActionLink<HomeController>(c => c.Index(), "Home")%>
</li>
// what appears I can only do now
<li>
<%= Html.ActionLink... | The changes you are observing in the `Html.ActionLink` method are due to updates in ASP.NET MVC as it has evolved over time. Specifically, starting from later previews and moving into the final versions, some generic methods were deprecated or altered to simplify the API and improve usability.
In earlier versions, the... | 10,251 | [
{
"from": "human",
"value": "Moved from preview 2 to preview 5 and now my Html.ActionLink calls are all failing. It appears that the generic version has been replaced with a non-type safe version.\n// used to work\n<li>\n <%= Html.ActionLink<HomeController>(c => c.Index(), \"Home\")%>\n</li>\n// what appe... |
I am trying to figure out how to click a button on a web page programmatically.
Specifically, I have a WinForm with a WebBrowser control. Once it navigates to the target ASP.NET login page I'm trying to work with, in the DocumentCompleted event handler I have the following coded:
HtmlDocument doc = webBrowser1.Documen... | When working with a `WebBrowser` control in WinForms, clicking a button programmatically can sometimes be tricky due to the way the HTML DOM and JavaScript handle events.
In your case, since you are dealing with an ASP.NET page, the button's functionality is typically tied to JavaScript. The `RaiseEvent` method, while... | 9,298 | [
{
"from": "human",
"value": "I am trying to figure out how to click a button on a web page programmatically.\nSpecifically, I have a WinForm with a WebBrowser control. Once it navigates to the target ASP.NET login page I'm trying to work with, in the DocumentCompleted event handler I have the following cod... |
Is is possible to get login credentials such as name/id if user does login by OpenId?
| When a user logs in via OpenID, the process involves an authentication mechanism that typically returns a limited set of user information based on the scope of permissions granted by the user and the specific OpenID provider being used. Here's how it generally works:
1. **Authentication**: The user authenticates with ... | 8,351 | [
{
"from": "human",
"value": "Is is possible to get login credentials such as name/id if user does login by OpenId?\n"
},
{
"from": "gpt",
"value": "When a user logs in via OpenID, the process involves an authentication mechanism that typically returns a limited set of user information based on t... |
I saw some code like the following in a JSP
<c:if test="<%=request.isUserInRole(RoleEnum.USER.getCode())%>">
<li>user</li>
</c:if>
My confusion is over the "=" that appears in the value of the test attribute. My understanding was that anything included within <%= %> is printed to the output, but surely the value a... | You're correct in your understanding of JSP, but there's a bit of nuance regarding the way the `<c:if>` tag from JSTL (JavaServer Pages Standard Tag Library) processes its `test` attribute.
### Explanation of the `<c:if>` Tag Usage
The `test` attribute in the `<c:if>` tag is indeed expecting a Boolean expression. Whe... | 10,490 | [
{
"from": "human",
"value": "I saw some code like the following in a JSP\n<c:if test=\"<%=request.isUserInRole(RoleEnum.USER.getCode())%>\">\n <li>user</li>\n</c:if>\n\nMy confusion is over the \"=\" that appears in the value of the test attribute. My understanding was that anything included within <%= %... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.