instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I know this question has been asked before, but I ran into a problem.
Oddly enough, when I execute this function, it includes the html of the page that the link you select to execute the function.
function exportCSV($table) {
$result = mysql_query("SHOW COLUMNS FROM ".$table."");
$i = 0;
if (mysql_num_rows(... | The issue you're encountering, where the generated CSV file includes HTML content, is likely due to the way the headers are being set and the subsequent output to the browser.
Here are a few points to consider:
1. **Header setting order**: Make sure that the headers are set before any output is sent to the browser. I... | 30,202 | [
{
"from": "human",
"value": "I know this question has been asked before, but I ran into a problem.\nOddly enough, when I execute this function, it includes the html of the page that the link you select to execute the function.\nfunction exportCSV($table) {\n $result = mysql_query(\"SHOW COLUMNS FROM \".$... |
How to make a shadow to main window widget on windows using Qt?
| In Qt, creating a shadow effect for a main window widget can be accomplished by using the `QGraphicsDropShadowEffect` class. This class allows you to add a shadow effect to any QWidget. Below are the steps to create a shadow effect for your main window:
### Example Code
Here’s a simple example that demonstrates how t... | 31,251 | [
{
"from": "human",
"value": "How to make a shadow to main window widget on windows using Qt?\n"
},
{
"from": "gpt",
"value": "In Qt, creating a shadow effect for a main window widget can be accomplished by using the `QGraphicsDropShadowEffect` class. This class allows you to add a shadow effect ... |
Suppose we have some named enums:
enum MyEnum {
FOO,
BAR = 0x50
};
What I googled for is a script (any language) that scans all the headers in my project and generates a header with one function per enum.
char* enum_to_string(MyEnum t);
And a implementation with something like this:
char* enum_to_string(M... | To achieve your goal of automatically generating string conversion functions for your enums, we can create a Python script that will scan through your C header files for defined enums. The script will identify both named and unnamed enums as well as typedefed enums and generate corresponding string functions for each. ... | 26,651 | [
{
"from": "human",
"value": "Suppose we have some named enums:\nenum MyEnum {\n FOO,\n BAR = 0x50\n};\n\nWhat I googled for is a script (any language) that scans all the headers in my project and generates a header with one function per enum.\nchar* enum_to_string(MyEnum t);\n\nAnd a implementatio... |
I would like a "system" that monitors a process and would kill said process if:
the process exceeds some memory requirements
the process does not respond to a message from the "system" in some period of time
I assume this "system" could be something as simple as a monitoring process? A code example of how this could ... | You can create a simple monitoring system using Python that checks the memory usage of a specific process and sends periodic heartbeat messages to check if the process is responsive. If the process exceeds a defined memory threshold or does not respond to the heartbeat message within a specified timeout, the system wil... | 27,308 | [
{
"from": "human",
"value": "I would like a \"system\" that monitors a process and would kill said process if:\n\nthe process exceeds some memory requirements\nthe process does not respond to a message from the \"system\" in some period of time\n\nI assume this \"system\" could be something as simple as a m... |
I've been using Eclipse with each project in a separate window by right clicking on a project and selecting Open in New Window. This worked fine, but suddenly... even when I close Eclipse and reopen it, the Navigator only shows one of the projects I was working on. How can I navigate back???
Thanks!
| It sounds like you may have inadvertently changed your workspace configuration or the way your projects are being loaded in Eclipse. Here are some steps you can follow to try to resolve the issue and navigate back to your projects:
1. **Check the Current Workspace**:
- Go to `File` > `Switch Workspace` > `Other...`... | 31,093 | [
{
"from": "human",
"value": "I've been using Eclipse with each project in a separate window by right clicking on a project and selecting Open in New Window. This worked fine, but suddenly... even when I close Eclipse and reopen it, the Navigator only shows one of the projects I was working on. How can I nav... |
I'm having a hard time understanding some git/DCVS concepts. Here's what happened:
I created a git project, and imported it from an SVN repo
I made some commits
I wanted to experiment something, so I created a branch called constants-update
I switched to constants-updatebranch, moved some files, deleted others and add... | You're encountering a couple of common issues with Git that relate to how it tracks changes in your working directory and how it interacts with different operating systems (like Windows). Let's break down your problems and provide solutions.
### Issue 1: Error When Switching Branches
The error you're seeing:
```
erro... | 28,963 | [
{
"from": "human",
"value": "I'm having a hard time understanding some git/DCVS concepts. Here's what happened:\n\nI created a git project, and imported it from an SVN repo\nI made some commits\nI wanted to experiment something, so I created a branch called constants-update\nI switched to constants-updatebr... |
With a TreeMap it's trivial to provide a custom Comparator, thus overriding the semantics provided by Comparable objects added to the map. HashMaps however cannot be controlled in this manner; the functions providing hash values and equality checks cannot be 'side-loaded'.
I suspect it would be both easy and useful to ... | Your idea of introducing a `Hasharator` interface to control the hashing and equality behavior of a `HashMap` or a similar data structure is an interesting one. It addresses a common issue where the default behavior of `hashCode` and `equals` methods for objects can lead to unexpected results, particularly when case-in... | 29,877 | [
{
"from": "human",
"value": "With a TreeMap it's trivial to provide a custom Comparator, thus overriding the semantics provided by Comparable objects added to the map. HashMaps however cannot be controlled in this manner; the functions providing hash values and equality checks cannot be 'side-loaded'.\nI su... |
I need to execute a select and then update some of the rows in the ResultSet in an atomic way.
The code I am using looks like (simplified):
stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
rs = stmt.executeQuery("SELECT ...");
while (rs.next()) {
if (conditions_to_update) {
... | Your current approach using a `ResultSet` that is both scrollable and updatable allows you to read and modify rows in a database table, but there are a few important considerations regarding atomicity and concurrency.
### Atomicity of Updates
1. **Atomicity of Updates**: In your code, the updates to the database rows ... | 31,323 | [
{
"from": "human",
"value": "I need to execute a select and then update some of the rows in the ResultSet in an atomic way.\nThe code I am using looks like (simplified):\nstmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);\nrs = stmt.executeQuery(\"SELECT ...\");\n\nwhil... |
Can anyone reccomend a .net control (winforms) that can be used to as a designer to edit xml files / DSL files ??
| There are several options you can consider for .NET WinForms controls that can help you design and edit XML files or Domain-Specific Language (DSL) files. Here are some recommendations:
1. **XML Editor Controls:**
- **ICSharpCode.TextEditor:** This is part of the ICSharpCode (SharpDevelop) library and offers syntax... | 33,509 | [
{
"from": "human",
"value": "Can anyone reccomend a .net control (winforms) that can be used to as a designer to edit xml files / DSL files ??\n"
},
{
"from": "gpt",
"value": "There are several options you can consider for .NET WinForms controls that can help you design and edit XML files or Dom... |
I've got a Page class in my .edmx ADO.NET Entity Data Model file with with Parent and Children properties. It's for a hierarchy of Pages.
removed dead ImageShack link - ADO.NET Entity Framework Hierarchical Page Class
This is handled in my SQL database with a ParentId foreign key in the Page table bound to the Id prim... | To display a hierarchical structure of `Page` objects in a WPF `TreeView`, you can follow these steps:
1. **Modify Your `Page` Class**: Ensure your `Page` class has a recursive structure with properties for its children and a reference to the parent. It seems you already have these properties (`Parent` and `Children`)... | 29,297 | [
{
"from": "human",
"value": "I've got a Page class in my .edmx ADO.NET Entity Data Model file with with Parent and Children properties. It's for a hierarchy of Pages.\nremoved dead ImageShack link - ADO.NET Entity Framework Hierarchical Page Class\nThis is handled in my SQL database with a ParentId foreign... |
How do i take advantage of MySQL's ability to cache prepared statements?
One reason to use prepared statements is that there is no need to send the prepared statement itself multiple times if the same prepared statement is to be used again.
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getCon... | To effectively take advantage of MySQL's ability to cache prepared statements using JDBC, you need to ensure that your prepared statements are reused properly without redefining them in each loop iteration. The parameter `cachePrepStmts=true` is used to enable caching on the MySQL server side, but it doesn't automatica... | 31,613 | [
{
"from": "human",
"value": "How do i take advantage of MySQL's ability to cache prepared statements?\nOne reason to use prepared statements is that there is no need to send the prepared statement itself multiple times if the same prepared statement is to be used again. \nClass.forName(\"com.mysql.jdbc.Driv... |
I was recently working with a DateTime object, and wrote something like this:
DateTime dt = DateTime.Now;
dt.AddDays(1);
return dt; // still today's date! WTF?
The intellisense documentation for AddDays() says it adds a day to the date, which it doesn't - it actually returns a date with a day added to it, so you have ... | You're absolutely right! In C#, `DateTime` is an immutable struct, which means that methods like `AddDays()` do not modify the original `DateTime` object, but instead return a new `DateTime` object with the specified modifications. This can indeed lead to some confusion if you're not aware of this behavior.
Here’s a c... | 27,446 | [
{
"from": "human",
"value": "I was recently working with a DateTime object, and wrote something like this:\nDateTime dt = DateTime.Now;\ndt.AddDays(1);\nreturn dt; // still today's date! WTF?\n\nThe intellisense documentation for AddDays() says it adds a day to the date, which it doesn't - it actually retur... |
I have used this in my HTML:
<q> Hai How r u </q>
Which shows the text in quotes, like "Hai How r u", for example.
This is working fine in FF but not in IE 6.0.
Please let me know why this happens, and any solutions you might know of.
I don't want to use the quote (") character in my HTML or a separate css file for t... | The `<q>` tag in HTML is used to mark up a short quotation, and it is supposed to automatically add quotation marks around the enclosed text in browsers that support it. However, older browsers like Internet Explorer 6 (IE 6) do not fully support the `<q>` element's semantic meaning and may not render the quotation mar... | 30,998 | [
{
"from": "human",
"value": "I have used this in my HTML:\n<q> Hai How r u </q>\n\nWhich shows the text in quotes, like \"Hai How r u\", for example.\nThis is working fine in FF but not in IE 6.0.\nPlease let me know why this happens, and any solutions you might know of. \nI don't want to use the quote (\")... |
I'm building an automated promotion utility for TFS. One of the features I'd like to support is rolling back the latest change. I'm quite aware of the Rollback Power Tool, but my understanding is that even if you pass a changeset in through the command line, it still brings up the GUI interface for other operations.
My... | Your approach to rolling back changes in TFS by creating a new workspace and merging to resolve conflicts is valid, but it can be a bit cumbersome. Here are some suggestions to enhance your approach and consider alternatives:
### 1. **TFS Command Line (tf.exe) Usage**
Instead of using the GUI for rollback, you can ... | 32,217 | [
{
"from": "human",
"value": "I'm building an automated promotion utility for TFS. One of the features I'd like to support is rolling back the latest change. I'm quite aware of the Rollback Power Tool, but my understanding is that even if you pass a changeset in through the command line, it still brings up t... |
I'd like to install Java on a Psion 5MX with GNU/Linux 16MB RAM machine, will it be possible?
Unfortunatly, "KVM must be installed by the manufacturer".
What I want is to be able to is to write basic Java code, test and sketch simple algorithms.
Important notes: I don't need the graphic part since I'll only use the co... | Installing Java on a Psion 5MX with GNU/Linux (specifically with only 16MB of RAM) presents several significant challenges. The Psion 5MX is an older device with limited hardware capabilities, which significantly limits the software you can run on it. Here are some points to consider:
### Feasibility of Java on Psion ... | 24,546 | [
{
"from": "human",
"value": "I'd like to install Java on a Psion 5MX with GNU/Linux 16MB RAM machine, will it be possible?\nUnfortunatly, \"KVM must be installed by the manufacturer\".\nWhat I want is to be able to is to write basic Java code, test and sketch simple algorithms. \nImportant notes: I don't ne... |
I want to just store the year in one of my models. At the moment I just have a database field called year of type date, but it seems to want to take a whole date (yyyy-mm-dd) rather than just a year.
What's the best way to store this? In a date field but using some way of just getting it to store the date bit (in which... | Storing just a year can be handled in several ways, depending on your specific use case and preferences. Here are some options along with their pros and cons:
### 1. **Integer Field**
- **Pros**:
- Simple and straightforward; storing the year as an integer (e.g., `2023`) is clear and efficient.
- Avoids a... | 31,807 | [
{
"from": "human",
"value": "I want to just store the year in one of my models. At the moment I just have a database field called year of type date, but it seems to want to take a whole date (yyyy-mm-dd) rather than just a year.\nWhat's the best way to store this? In a date field but using some way of just ... |
I'm following the ASP.Net MVC "TaskList" example video and on clicking Run in Visual Studio (~14:00 min into the video) I'm getting the following error message in the browser:
Server Error in '/' Application.
Bad IL format.
Description: An unhandled exception occurred during the execution of the
current webrequest. P... | The error message you are encountering, "Bad IL format," typically suggests that there is an issue with the compiled code for your application. This can happen due to a variety of reasons, especially when dealing with different versions of the .NET Framework or using the wrong build configuration. Here are some trouble... | 31,645 | [
{
"from": "human",
"value": "I'm following the ASP.Net MVC \"TaskList\" example video and on clicking Run in Visual Studio (~14:00 min into the video) I'm getting the following error message in the browser:\nServer Error in '/' Application.\n\nBad IL format.\nDescription: An unhandled exception occurred dur... |
The vast majority of applications does not handle "disk full" scenarios properly.
Example: an installer doesn't see that the disk is full, ignores all errors, and finally happily announces "installation complete!", or an email program is unaware that the message it has just downloaded could not be saved, and tells th... | Handling "disk full" scenarios gracefully is an essential aspect of software development that can significantly improve user experience and prevent data loss. Here are several techniques that can be employed to handle these situations effectively:
### 1. **Preemptive Disk Space Checks**
- **Before Performing Action... | 31,546 | [
{
"from": "human",
"value": "The vast majority of applications does not handle \"disk full\" scenarios properly. \nExample: an installer doesn't see that the disk is full, ignores all errors, and finally happily announces \"installation complete!\", or an email program is unaware that the message it has ju... |
I've been tasked with deploying an application built by a third party on an Oracle Application Server, version 10.1.3.0. I've deployed it on Oracle Application Server version 10.1.2.0 without much difficulty. I'm getting the following error:
javax.naming.NamingException: Lookup error: javax.naming.AuthenticationExcep... | The error you are experiencing, `javax.naming.AuthenticationException: No such domain/application: "etrace"`, indicates that the Oracle Application Server's JNDI (Java Naming and Directory Interface) service is unable to locate the specified domain or application named "etrace". This issue can arise from a number of po... | 31,050 | [
{
"from": "human",
"value": "I've been tasked with deploying an application built by a third party on an Oracle Application Server, version 10.1.3.0. I've deployed it on Oracle Application Server version 10.1.2.0 without much difficulty. I'm getting the following error:\njavax.naming.NamingException: Look... |
I have a simple extender component that draws 3D borders around any Control. In my designer supprot for the component, I'd like to use the same editor that VS uses to select the Anchor property.
I know I can use the [Editor()] attribute, but I don't know the class name of the editor that's used.
| In Visual Studio, the editor used for the `Anchor` property is a `UITypeEditor` that is part of the `System.Windows.Forms.Design` namespace. Specifically, the class you are looking for is `AnchorEditor`, which is found in the `System.Windows.Forms.Design` assembly.
To use the `AnchorEditor` in your extender component,... | 34,950 | [
{
"from": "human",
"value": "I have a simple extender component that draws 3D borders around any Control. In my designer supprot for the component, I'd like to use the same editor that VS uses to select the Anchor property.\nI know I can use the [Editor()] attribute, but I don't know the class name of the ... |
My SQL table looks like this:
CREATE TABLE Page (
Id int primary key,
ParentId int, -- refers to Page.Id
Title varchar(255),
Content ntext
)
and maps to the following class in my ActiveRecord model:
[ActiveRecord]
public class Page {
[PrimaryKey]
public int Id { get; set; }
[BelongsTo("Pa... | To load the entire `Page` table in a single query and then construct the parent-child relationships in memory, you can modify your code to fetch all pages at once and then manually build the object graph.
Here is a step-by-step approach:
1. Fetch all pages from the database.
2. Use a dictionary to create a mapping of... | 33,689 | [
{
"from": "human",
"value": "My SQL table looks like this:\nCREATE TABLE Page (\n Id int primary key,\n ParentId int, -- refers to Page.Id\n Title varchar(255),\n Content ntext\n)\n\nand maps to the following class in my ActiveRecord model:\n[ActiveRecord]\npublic class Page {\n\n [PrimaryKey... |
I know most of the ins and outs of Python's approach to private variables/members/functions/...
However, I can't make my mind up on how to distinguish between methods for external use or subclassing use.
Consider the following example:
class EventMixin(object):
def subscribe(self, **kwargs):
'''kwargs shoul... | In Python, convention plays a significant role in determining how to structure your code, especially when it comes to defining the intended visibility of methods and attributes. Your concern about clearly distinguishing between methods intended for external use and those meant for subclass use is valid, and there are s... | 28,939 | [
{
"from": "human",
"value": "I know most of the ins and outs of Python's approach to private variables/members/functions/...\nHowever, I can't make my mind up on how to distinguish between methods for external use or subclassing use.\nConsider the following example:\nclass EventMixin(object):\n def subsc... |
I've converted the 'easy' parts (fragment, @header and @member
declerations etc.), but since I'm new to Antlr I have a really hard
time converting the Tree statements etc.
I use the following migration guide.
The grammar file can be found here....
Below you can find some examples where I run into problems:
For instan... | Migrating an ANTLR grammar from an older version that uses tree parsing (like ANTLR 2) to a newer version (like ANTLR 4) can be challenging, especially if you're accustomed to the tree structure and manipulation that older versions required. ANTLR 4 does away with explicit tree manipulation in the grammar definition it... | 25,762 | [
{
"from": "human",
"value": "I've converted the 'easy' parts (fragment, @header and @member\ndeclerations etc.), but since I'm new to Antlr I have a really hard\ntime converting the Tree statements etc.\nI use the following migration guide.\nThe grammar file can be found here....\nBelow you can find some ... |
What is a good way to create and read an OpenOffice spreadsheet in Perl?
| To create and read OpenOffice spreadsheets (specifically ODS files, which are the format used by OpenDocument Spreadsheet) in Perl, you can use the `Spreadsheet::OpenOffice::Writer` and `Spreadsheet::OpenOffice::Reader` modules. These modules provide a convenient interface for working with ODS files.
### Installation
... | 29,908 | [
{
"from": "human",
"value": "What is a good way to create and read an OpenOffice spreadsheet in Perl?\n"
},
{
"from": "gpt",
"value": "To create and read OpenOffice spreadsheets (specifically ODS files, which are the format used by OpenDocument Spreadsheet) in Perl, you can use the `Spreadsheet:... |
I'm using the following view function to iterate over all items in the database (in order to find a tag), but I think the performance is very poor if the dataset is large.
Any other approach?
def by_tag(tag):
return '''
function(doc) {
if (doc.tags.length > 0) {
for (var tag in doc.... | The approach you're using involves a map function that iterates through all documents in your database to find those that contain a specific tag. This can indeed lead to poor performance as the dataset grows, especially if you're iterating through all documents each time you want to query for a tag.
Here are a few str... | 30,464 | [
{
"from": "human",
"value": "I'm using the following view function to iterate over all items in the database (in order to find a tag), but I think the performance is very poor if the dataset is large.\nAny other approach?\ndef by_tag(tag):\nreturn '''\n function(doc) {\n if (doc.tags.leng... |
I'm trying to learn about catamorphisms and I've read the Wikipedia article and the first couple posts in the series of the topic for F# on the Inside F# blog.
I understand that it's a generalization of folds (i.e., mapping a structure of many values to one value, including a list of values to another list). And I gat... | Yes, catamorphisms can indeed be implemented in C# using LINQ, particularly with the `Aggregate` method. A catamorphism is a way of folding (or reducing) data structures, such as lists or trees, to a single value.
Here's how you can implement a simple fold operation (catamorphism) for a list and a binary tree in C#.
... | 24,323 | [
{
"from": "human",
"value": "I'm trying to learn about catamorphisms and I've read the Wikipedia article and the first couple posts in the series of the topic for F# on the Inside F# blog. \nI understand that it's a generalization of folds (i.e., mapping a structure of many values to one value, including a ... |
My initial installation for the MySQL had no password for root. I assigned a password for root and everything worked fine. Due to some reason (don't ask why) I had to revert back to the original settings where root didn't have any password.
I changed the root password to '' (empty string). The problem now is that MySQL... | To revert the MySQL root user to have no password, you typically need to modify the user authentication settings in the MySQL database. If you've already set the root password to an empty string but still need to provide it, it may be due to how MySQL interprets the authentication method for the root user. Here’s how t... | 26,245 | [
{
"from": "human",
"value": "My initial installation for the MySQL had no password for root. I assigned a password for root and everything worked fine. Due to some reason (don't ask why) I had to revert back to the original settings where root didn't have any password.\nI changed the root password to '' (em... |
Can we somehow extend the RuleSetDialog class and host in our windows application?
| Yes, you can extend the `RuleSetDialog` class in a .NET application, assuming you are working with the .NET framework where the `RuleSetDialog` class is part of the `Microsoft.CSharp.RuntimeBinder` namespace or another relevant library for rule sets.
Here's a general approach to extending a class like `RuleSetDialog` ... | 33,084 | [
{
"from": "human",
"value": "Can we somehow extend the RuleSetDialog class and host in our windows application?\n"
},
{
"from": "gpt",
"value": "Yes, you can extend the `RuleSetDialog` class in a .NET application, assuming you are working with the .NET framework where the `RuleSetDialog` class i... |
I need to match something in the form
<a href="pic/5" id="piclink"><img src="thumb/5" /></a>
to find the number, in this case 5, using JavaScript. I have no idea how to use regexes, so I was wondering if anyone here could help out.
| You can use a regular expression (regex) in JavaScript to extract the number from the HTML string you provided. Here's how you can do it:
1. Create a regex pattern to match the structure of your string and capture the number.
2. Use the `match()` method on the string to apply the regex.
Here's a sample code snippet t... | 28,198 | [
{
"from": "human",
"value": "I need to match something in the form \n<a href=\"pic/5\" id=\"piclink\"><img src=\"thumb/5\" /></a>\n\nto find the number, in this case 5, using JavaScript. I have no idea how to use regexes, so I was wondering if anyone here could help out.\n"
},
{
"from": "gpt",
"... |
I have a database that many different client applications (a smattering of web services, some java apps and a few dot net applications) connect to. Not all of these are running on windows (Sadly, otherwise it would make this an easy answer question with just enabling windows authentication for database connections). At... | To secure database connection passwords while keeping them configurable, you can implement several best practices that balance security and usability. Here are some strategies:
1. **Encryption**:
- **Encrypt Passwords**: Store encrypted passwords in your configuration files instead of plain text. Use a robust encry... | 31,068 | [
{
"from": "human",
"value": "I have a database that many different client applications (a smattering of web services, some java apps and a few dot net applications) connect to. Not all of these are running on windows (Sadly, otherwise it would make this an easy answer question with just enabling windows aut... |
I'm working on a project that returns paged results with volumes potentially in the hundreds of pages. I've been playing around with more usable ways to perform paging than the standard fisrt/last/next/previous links and jump-to text box. One alternative I had was to have a scrolling list of pages. I'd display 5 to 7 l... | Your idea of a scrolling list of page links is a good start, as it gives users flexibility without being overwhelming. Here are a few more suggestions for improving your pagination and implementing the scrolling functionality:
### 1. Infinite Scroll
Instead of traditional pagination, consider implementing infinite scr... | 29,410 | [
{
"from": "human",
"value": "I'm working on a project that returns paged results with volumes potentially in the hundreds of pages. I've been playing around with more usable ways to perform paging than the standard fisrt/last/next/previous links and jump-to text box. One alternative I had was to have a scro... |
I am looking for a free WYSIWYG editor control to be used in a Winform application. The applications primary language is VB but using C# is also an option. To clarify I need a rich text editor control that has a formatting bar. I have looked all over the web and the only options I can find are expensive control package... | Finding a free WYSIWYG rich text editor control specifically for WinForms can indeed be a challenge since many of the well-known libraries come as part of larger commercial packages. However, there are a few options you can consider that might meet your needs:
1. **RichTextBox Control**: WinForms comes with a built-in... | 31,622 | [
{
"from": "human",
"value": "I am looking for a free WYSIWYG editor control to be used in a Winform application. The applications primary language is VB but using C# is also an option. To clarify I need a rich text editor control that has a formatting bar. I have looked all over the web and the only options... |
I would like to know if there is an easy way to detect if the text on the clipboard is in ISO 8859 or UTF-8 ?
Here is my current code:
COleDataObject obj;
if (obj.AttachClipboard())
{
if (obj.IsDataAvailable(CF_TEXT))
{
HGLOBAL hmem = obj.GetGlobalData(CF_TEXT);
CMe... | To determine whether the text retrieved from the clipboard is in ISO 8859 or UTF-8, you'll need to analyze the byte sequence of the text. Here are some key characteristics of both encodings:
1. **ISO 8859-1** (Latin-1):
- Uses a single byte for each character.
- Valid byte values range from 0x00 to 0xFF.
2. **U... | 20,729 | [
{
"from": "human",
"value": "I would like to know if there is an easy way to detect if the text on the clipboard is in ISO 8859 or UTF-8 ?\nHere is my current code:\n COleDataObject obj;\n\n if (obj.AttachClipboard())\n {\n if (obj.IsDataAvailable(CF_TEXT))\n {\n HGLOBAL h... |
I currently capture MiniDumps of unhandled exceptions using SetUnhandledExceptionFilter however at times I am getting "R6025: pure virtual function".
I understand how a pure virtual function call happens I am just wondering if it is possible to capture them so I can create a MiniDump at that point.
| Capturing a minidump when a "pure virtual function call" occurs can be a bit tricky, but it is possible. The "R6025: pure virtual function call" error indicates that your program is trying to call a pure virtual function, typically because an object of a class that hasn’t been fully constructed or has already been dest... | 24,884 | [
{
"from": "human",
"value": "I currently capture MiniDumps of unhandled exceptions using SetUnhandledExceptionFilter however at times I am getting \"R6025: pure virtual function\".\nI understand how a pure virtual function call happens I am just wondering if it is possible to capture them so I can create a ... |
I am a ASP.NET Developer trying to learn Rails and RESTful approach. To understand, I am planning to write a Email client, which would make RESTful GET call to the server to fetch the emails and POST to send an email.
What are the best practices (both generic and/or specific to Rails) to be followed so that, the above ... | When developing an email client or any web application with a RESTful approach, it’s crucial to consider security best practices, especially to prevent Cross-Site Request Forgery (CSRF or XSRF) vulnerabilities. Here are some best practices that are both generic and specific to Rails:
### Generic Best Practices
1. **U... | 27,301 | [
{
"from": "human",
"value": "I am a ASP.NET Developer trying to learn Rails and RESTful approach. To understand, I am planning to write a Email client, which would make RESTful GET call to the server to fetch the emails and POST to send an email.\nWhat are the best practices (both generic and/or specific to... |
I want to create a stand-alone (i.e. not hosted in IIS) web service in ASP.NET. Is this possible, and if so what's the best way to do it?
| Yes, it is indeed possible to create a stand-alone web service in ASP.NET without hosting it in IIS. Starting from ASP.NET Core, the framework allows you to build self-hosted applications that can run on Kestrel, a cross-platform web server. Here's how you can create a stand-alone web service using ASP.NET Core:
### S... | 26,410 | [
{
"from": "human",
"value": "I want to create a stand-alone (i.e. not hosted in IIS) web service in ASP.NET. Is this possible, and if so what's the best way to do it?\n"
},
{
"from": "gpt",
"value": "Yes, it is indeed possible to create a stand-alone web service in ASP.NET without hosting it in... |
The following code will not compile:
string foo = "bar";
Object o = foo == null ? DBNull.Value : foo;
I get: Error 1 Type of conditional expression cannot be determined because there is no implicit conversion between 'System.DBNull' and 'string'
To fix this, I must do something like this:
string foo = "bar";
Object o ... | The issue you're encountering stems from the way the C# type system handles the conditional (ternary) operator, especially when it comes to the types involved in the expression.
### Explanation of the Conditional Operator Behavior
In C#, the ternary operator (`?:`) has specific rules that dictate how the types of its... | 31,751 | [
{
"from": "human",
"value": "The following code will not compile:\nstring foo = \"bar\";\nObject o = foo == null ? DBNull.Value : foo;\n\nI get: Error 1 Type of conditional expression cannot be determined because there is no implicit conversion between 'System.DBNull' and 'string'\nTo fix this, I must do so... |
I'm trying to change user input in wildcard form ("*word*") to a regular expression format. To that end, I'm using the code below to strip off the '*' at the beginning and end of the input so that I can add the regular expression characters on either end:
string::iterator iter_begin = expressionBuilder.begin();
str... | The issue you're encountering stems from how you are handling the iterator `iter_end` after decrementing it. In C++, when you call `iter_end--`, you're modifying the iterator to point to the last character of the string (which is actually the character before the last one). However, when you call `erase()` with this it... | 32,405 | [
{
"from": "human",
"value": "I'm trying to change user input in wildcard form (\"*word*\") to a regular expression format. To that end, I'm using the code below to strip off the '*' at the beginning and end of the input so that I can add the regular expression characters on either end:\nstring::iterator ... |
We've been getting request (from worms?) of the form
http://www.example.com/MSOffice/cltreq.asp?...
http://www.example.com/_vti_bin/owssvr.dll?...
What is the best practice for dealing with these?
I've considered either returning a 404 or trying to terminate the connection while leaving it open on the other end.
Thou... | The requests you're observing are often associated with probing attempts from malicious actors or automated scripts, which could be the result of worms or vulnerability scanners looking for known exploits in web applications, particularly those related to Microsoft Office or SharePoint.
Here are some best practices fo... | 33,219 | [
{
"from": "human",
"value": "We've been getting request (from worms?) of the form\n\nhttp://www.example.com/MSOffice/cltreq.asp?...\nhttp://www.example.com/_vti_bin/owssvr.dll?...\n\nWhat is the best practice for dealing with these?\nI've considered either returning a 404 or trying to terminate the connecti... |
What algorithms could i use to determine common characters in a set of strings?
To make the example simple, I only care about 2+ characters in a row and if it shows up in 2 or more of the sample. For instance:
0000abcde0000
0000abcd00000
000abc0000000
00abc000de000
I'd like to know:
00 was used in 1,2,3,4
000 was... | To determine common substrings of 2 or more characters that appear in at least two of a set of strings, you can use a combination of algorithms and data structures. Below are several approaches you might consider:
### 1. Brute Force Approach
This approach involves generating all possible substrings of length 2 or more... | 30,277 | [
{
"from": "human",
"value": "What algorithms could i use to determine common characters in a set of strings?\nTo make the example simple, I only care about 2+ characters in a row and if it shows up in 2 or more of the sample. For instance:\n\n0000abcde0000 \n0000abcd00000 \n000abc0000000\n00abc000de000\n\... |
I'm writing SQL (for Oracle) like:
INSERT INTO Schema1.tableA SELECT * FROM Schema2.tableA;
where Schema1.tableA and Schema2.tableA have the same columns. However, it seems like this is unsafe, since the order of the columns coming back in the SELECT is undefined. What I should be doing is:
INSERT INTO Schema1.table... | You're correct in your concern about relying on the order of columns when performing `INSERT` statements in SQL. Instead of using a function `foo` to extract column names dynamically within your SQL, you can achieve your objective through a combination of PL/SQL and dynamic SQL.
However, if you want to automate the pr... | 28,286 | [
{
"from": "human",
"value": "I'm writing SQL (for Oracle) like:\n\nINSERT INTO Schema1.tableA SELECT * FROM Schema2.tableA;\n\nwhere Schema1.tableA and Schema2.tableA have the same columns. However, it seems like this is unsafe, since the order of the columns coming back in the SELECT is undefined. What I s... |
I remember from C days that we were encouraged to use
i > -1
instead of
i >= 0
because of performance.
Does this still apply in the C# .NET world? What are the performance implications of using one over the other with today's compilers? i.e. Is the compiler clever enough to optimize these for you?
(As an aside try an... | In C and C++, there has historically been a subtle performance consideration regarding the use of `i > -1` versus `i >= 0`. This was due to the possibility that the compiler might generate different machine code for the two comparisons, and in certain contexts (like performance-critical inner loops), one might be sligh... | 32,658 | [
{
"from": "human",
"value": "I remember from C days that we were encouraged to use\ni > -1\n\ninstead of\ni >= 0\n\nbecause of performance.\nDoes this still apply in the C# .NET world? What are the performance implications of using one over the other with today's compilers? i.e. Is the compiler clever enoug... |
So im working on a game in XNA and i need it to get a server list off our site.
so i just need to do a http request to http://play.feedthezombie.com/?want=servers&enc=xml
and get the contest as either a string or xml object.
any clues?
| To make an HTTP request in XNA (or in a typical .NET environment), you can use the `HttpClient` class, which is available in the `System.Net.Http` namespace. This class allows you to send HTTP requests and receive responses. Below is a step-by-step guide on how you can fetch the server list from your specified URL and ... | 31,286 | [
{
"from": "human",
"value": "So im working on a game in XNA and i need it to get a server list off our site. \nso i just need to do a http request to http://play.feedthezombie.com/?want=servers&enc=xml\nand get the contest as either a string or xml object.\nany clues?\n"
},
{
"from": "gpt",
"va... |
Is there a way that you can have SERVEROUTPUT set to ON in sqlplus but somehow repress the message "PL/SQL procedure successfully completed" that is automatically generated upon completed execution of a plsql procedure?
| Yes, in SQL*Plus, when you set `SERVEROUTPUT ON`, messages from PL/SQL procedures, including "PL/SQL procedure successfully completed", are displayed. However, you can suppress the "PL/SQL procedure successfully completed" message by using the following approaches:
### Option 1: Use a Wrapper Procedure
You can create ... | 34,432 | [
{
"from": "human",
"value": "Is there a way that you can have SERVEROUTPUT set to ON in sqlplus but somehow repress the message \"PL/SQL procedure successfully completed\" that is automatically generated upon completed execution of a plsql procedure?\n"
},
{
"from": "gpt",
"value": "Yes, in SQL*... |
Are there ways except CAPTCHAs for web apps like pastie.org or p.ramaze.net? CAPTCHAs take too long for a small paste for my taste.
| Yes, there are several alternative methods to CAPTCHAs that can help prevent spam and automated submissions on web applications like pastie.org or similar pastebin services. Here are some alternatives:
1. **Honeypot Technique**: This method involves adding an invisible field to your form that is hidden from users but ... | 30,365 | [
{
"from": "human",
"value": "Are there ways except CAPTCHAs for web apps like pastie.org or p.ramaze.net? CAPTCHAs take too long for a small paste for my taste.\n"
},
{
"from": "gpt",
"value": "Yes, there are several alternative methods to CAPTCHAs that can help prevent spam and automated submis... |
We have a large application in Ruby on Rails with many filters. Some of these filters can be complex. I am looking for a way to individually test these filters with a unit test. Right now I test them by testing them through an action that uses them with a functional test. This just doesn't feel like the right way.
... | Testing complex filters in a Ruby on Rails application can indeed be challenging, especially when you're currently doing it through higher-level functional tests. Unit testing your filters can help you isolate and thoroughly validate their behavior. Here are some steps and tips to effectively unit test your filters:
#... | 31,763 | [
{
"from": "human",
"value": "We have a large application in Ruby on Rails with many filters. Some of these filters can be complex. I am looking for a way to individually test these filters with a unit test. Right now I test them by testing them through an action that uses them with a functional test. Th... |
I have a map in Java. I would like to compare a source string against all items in the map and return the best match based on a levenshtein ratio algorithm. I am wondering what the optimal way to perform this check on every element in the list would be.
Thanks, Matt
| To compare a source string against all items in a map using the Levenshtein distance algorithm in Java, you can follow these steps:
1. **Implement the Levenshtein Distance**: First, you need a method to compute the Levenshtein distance. This distance measures how many single-character edits (insertions, deletions, or ... | 26,324 | [
{
"from": "human",
"value": "I have a map in Java. I would like to compare a source string against all items in the map and return the best match based on a levenshtein ratio algorithm. I am wondering what the optimal way to perform this check on every element in the list would be. \nThanks, Matt\n"
},... |
I have written a vector-based 3D editor (UI customized somewhat like technical drawings). I now want save the vectors/drawing data in portable formats. Which formats are available; which (one?) of them are the most widely accepted, and where can I get hold of the format specifications?
| When considering portable formats for saving vector-based 3D drawing data, there are several options to choose from. Here are some of the most widely accepted formats:
### 1. **SVG (Scalable Vector Graphics)**
- **Description**: SVG is an XML-based format widely used for 2D vector graphics. While primarily for 2D, ... | 28,509 | [
{
"from": "human",
"value": "I have written a vector-based 3D editor (UI customized somewhat like technical drawings). I now want save the vectors/drawing data in portable formats. Which formats are available; which (one?) of them are the most widely accepted, and where can I get hold of the format specific... |
I need to choose a database management system (DBMS) that uses the least amount of main memory since we are severely constrained. Since a DBMS will use more and more memory to hold the index in main memory, how exactly do I tell which DBMS has the smallest memory footprint?
Right now I just have a memory monitor pro... | Your approach of using a memory monitor program to assess the memory usage of different database management systems (DBMS) while executing a series of queries is a valid method for evaluating their memory footprints. However, there are several considerations and alternative strategies you can use to obtain more accurat... | 30,939 | [
{
"from": "human",
"value": "I need to choose a database management system (DBMS) that uses the least amount of main memory since we are severely constrained. Since a DBMS will use more and more memory to hold the index in main memory, how exactly do I tell which DBMS has the smallest memory footprint? \n... |
SQL Server 2000: Is there a way to find out server memory / CPU parameters in Query Analyzer?
| Yes, in SQL Server 2000, you can find out the server memory and CPU parameters using system stored procedures and system views. Here are some ways to retrieve this information in Query Analyzer:
### 1. Checking Memory Information
You can use the following query to check memory settings:
```sql
EXEC sp_configure 'sho... | 34,757 | [
{
"from": "human",
"value": "SQL Server 2000: Is there a way to find out server memory / CPU parameters in Query Analyzer?\n"
},
{
"from": "gpt",
"value": "Yes, in SQL Server 2000, you can find out the server memory and CPU parameters using system stored procedures and system views. Here are som... |
In .NET, the GetHashCode method is used in a lot of places throughout the .NET base class libraries. Implementing it properly is especially important to find items quickly in a collection or when determining equality.
Is there a standard algorithm or best practice on how to implement GetHashCode for my custom classes s... | Yes, implementing `GetHashCode` properly is crucial for maintaining performance and correctness when using collections like hash tables or dictionaries in .NET. Here are some best practices and guidelines you can follow when implementing `GetHashCode` for your custom classes:
### 1. Combine Hash Codes
Use a combinati... | 30,609 | [
{
"from": "human",
"value": "In .NET, the GetHashCode method is used in a lot of places throughout the .NET base class libraries. Implementing it properly is especially important to find items quickly in a collection or when determining equality.\nIs there a standard algorithm or best practice on how to imp... |
I am tasked with writing an authentication component for an open source JAVA app. We have an in-house authentication widget that uses https. I have some example php code that accesses the widget which uses cURL to handle the transfer.
My question is whether or not there is a port of cURL to JAVA, or better yet, wha... | You're on the right track by considering `HttpsURLConnection` for your Java implementation. While there's no direct port of cURL for Java, the built-in Java libraries provide sufficient capabilities to handle HTTPS requests and parse the responses. Here's how you can replicate the provided PHP cURL code using `HttpsURL... | 11,246 | [
{
"from": "human",
"value": "I am tasked with writing an authentication component for an open source JAVA app. We have an in-house authentication widget that uses https. I have some example php code that accesses the widget which uses cURL to handle the transfer. \nMy question is whether or not there is ... |
I've written some software for a customer, and I'd like to release it to them under a license that permits them to make modifications for their own in-house use, but still prohibits them from selling or otherwise redistributing the software after I've given it to them. Can someone point me to a license that either has ... | For your needs, it sounds like you want a license that allows the customer to use and modify the software for their own internal purposes, but does not allow them to redistribute it or sell it. Here are a couple of options you might consider:
1. **Custom License Agreement**: Since your requirements are specific, creat... | 33,356 | [
{
"from": "human",
"value": "I've written some software for a customer, and I'd like to release it to them under a license that permits them to make modifications for their own in-house use, but still prohibits them from selling or otherwise redistributing the software after I've given it to them. Can someo... |
I'm listening to podcast #19 and Joel and Jeff are arguing about running SQL Server on the same machine as your IIS installation. I have to say that it sounds like Jeff folded to Joel, but then again I am only guessing which one is which. ;)
What are the pros and cons of each? Which is better?
I typically run them sepa... | Running SQL Server on the same machine as your IIS installation has its pros and cons, and the choice largely depends on the specific requirements of your application, the scale of deployment, and the resources available. Here’s a breakdown of the advantages and disadvantages of both approaches:
### Running SQL Server... | 32,942 | [
{
"from": "human",
"value": "I'm listening to podcast #19 and Joel and Jeff are arguing about running SQL Server on the same machine as your IIS installation. I have to say that it sounds like Jeff folded to Joel, but then again I am only guessing which one is which. ;)\nWhat are the pros and cons of each? ... |
I'm curious to know how NULLs are stored into a database ?
It surely depends on the database server but I would like to have an general idea about it.
First try:
Suppose that the server put a undefined value (could be anything) into the field for a NULL value.
Could you be very lucky and retrieve the NULL value with
.... | Your curiosity about how NULLs are stored in a database is a common one, and you are correct that the specifics can vary between different database systems. However, there are some general principles that apply to many relational database management systems (RDBMS).
### Storage of NULLs in Databases
1. **Representat... | 29,221 | [
{
"from": "human",
"value": "I'm curious to know how NULLs are stored into a database ?\nIt surely depends on the database server but I would like to have an general idea about it.\n\nFirst try:\nSuppose that the server put a undefined value (could be anything) into the field for a NULL value.\nCould you be... |
How do I access specific sections of man pages?
| In Unix-like operating systems, the manual pages (man pages) provide documentation for commands, system calls, libraries, and other aspects of the system. Man pages are organized into sections, and you can access specific sections using the `man` command followed by the section number.
### Man Page Sections
Here are ... | 30,614 | [
{
"from": "human",
"value": "How do I access specific sections of man pages?\n"
},
{
"from": "gpt",
"value": "In Unix-like operating systems, the manual pages (man pages) provide documentation for commands, system calls, libraries, and other aspects of the system. Man pages are organized into se... |
I am setting up my Java EE version of Eclipse to compile Servlets. I have the problem where Eclipse says "HttpServlet" cannot be resolved because it can't find the Java EE jar files.
I am using Windows XP. I already have Tomcat 6.0 up and running. I think the easiest solution would be to link to the servlet-api.jar fil... | To resolve the issue with Eclipse not recognizing `HttpServlet`, you need to ensure that the `servlet-api.jar` is included in your Eclipse project's build path rather than relying solely on the Windows CLASSPATH environment variable. Here are the steps to properly configure your project to use the Servlet API from Tomc... | 32,676 | [
{
"from": "human",
"value": "I am setting up my Java EE version of Eclipse to compile Servlets. I have the problem where Eclipse says \"HttpServlet\" cannot be resolved because it can't find the Java EE jar files.\nI am using Windows XP. I already have Tomcat 6.0 up and running. I think the easiest solution... |
I am trying to render a user control into a string. The application is set up to enable user to use tokens and user controls are rendered where the tokens are found.
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter writer = new HtmlTextWriter(sw);
Control uc = LoadControl... | When rendering a user control into a string, you are essentially bypassing the standard ASP.NET page lifecycle, which means that events such as `Page_Load` won't be triggered as they would in a normal page request.
To ensure that your user control behaves as expected (i.e., that the `Page_Load` and any event handlers... | 31,526 | [
{
"from": "human",
"value": "I am trying to render a user control into a string. The application is set up to enable user to use tokens and user controls are rendered where the tokens are found.\nStringBuilder sb = new StringBuilder();\nStringWriter sw = new StringWriter(sb);\nHtmlTextWriter writer = new H... |
I want to assign default values to a column in my select sql query so that if the value of that column is null I get that default value in my recordset. Is there anyway to do this?
Example:
select col1 (some default value) from tblname;
| Yes, you can achieve this in SQL by using the `COALESCE()` function or the `IFNULL()` function (depending on the SQL dialect you are using) to substitute a default value for a `NULL` value in a column. Here's how you can do it in various SQL databases:
### Using `COALESCE()`
The `COALESCE()` function takes multiple ar... | 34,585 | [
{
"from": "human",
"value": "I want to assign default values to a column in my select sql query so that if the value of that column is null I get that default value in my recordset. Is there anyway to do this?\nExample:\nselect col1 (some default value) from tblname;\n\n"
},
{
"from": "gpt",
"v... |
I've been trying for a while now to write a unit test for a UserViewControl in ASP.NET MVC. I'd like to get to code that looks something like this:
[TestMethod]
public void HaveControlToDisplayThings()
{
var listControl = new ControlUnderTest();
var viewData = new ViewDataDictionary<IList<string>>(this.repo.Get... | Testing ASP.NET MVC views and controls can be challenging, especially when dealing with the `HttpContext` and rendering. In your case, it looks like you're running into issues with the static nature of `HttpContext.Current`. A common approach to unit test these kinds of controls is to use dependency injection to pass a... | 22,901 | [
{
"from": "human",
"value": "I've been trying for a while now to write a unit test for a UserViewControl in ASP.NET MVC. I'd like to get to code that looks something like this:\n[TestMethod]\npublic void HaveControlToDisplayThings()\n{\n var listControl = new ControlUnderTest();\n var viewData = new V... |
I have some System.Diagnotics.Processes to run. I'd like to call the close method on them automatically. Apparently the "using" keyword does this for me.
Is this the way to use the using keyword?
foreach(string command in S) // command is something like "c:\a.exe"
{
try
{
using(p = Process.Start(comma... | You're on the right track with the `using` keyword, as it helps ensure that resources are disposed of properly. However, you have a couple of important points to consider regarding the use of `Process.Start` and how the `using` statement works with it.
The `Process.Start` method returns a `Process` object that you can... | 31,991 | [
{
"from": "human",
"value": "I have some System.Diagnotics.Processes to run. I'd like to call the close method on them automatically. Apparently the \"using\" keyword does this for me.\nIs this the way to use the using keyword?\nforeach(string command in S) // command is something like \"c:\\a.exe\"\n{\n ... |
I'm trying to emulate the file upload code from the grails website, and I'm running into some problems. I'm using the same code as found here. Here is my code:
<g:form action="upload" method="post" enctype="multipart/form-data">
<input type="file" name="myFile" />
<input type="submit" value="Uploa... | It looks like you're encountering a problem with handling file uploads in a Grails application. The error message indicates that the `request.getFile()` method isn't recognized, which suggests that the request isn't being processed as a `MultipartHttpServletRequest`. This often happens when the application isn't correc... | 30,309 | [
{
"from": "human",
"value": "I'm trying to emulate the file upload code from the grails website, and I'm running into some problems. I'm using the same code as found here. Here is my code:\n <g:form action=\"upload\" method=\"post\" enctype=\"multipart/form-data\">\n <input type=\"file\" name=\"... |
So I have some html like so:
<div id="avatar_choices">
<label for="id_choice_0">
<input id="id_choice_0" type="radio" name="choice" value="7" />
<img src="someimage.jpg" />
</label>
<label for="id_choice_1">
<input id="id_choice_1" type="radio" name="choice" value="8" />
<img... | It looks like you encountered a common issue with managing the state of styles in different browsers. The initial code you provided was having trouble in Internet Explorer when trying to reset the border on the previously selected image. Your updated solution with the use of a CSS class (`.selected`) is indeed a more r... | 31,253 | [
{
"from": "human",
"value": "So I have some html like so:\n<div id=\"avatar_choices\">\n <label for=\"id_choice_0\">\n <input id=\"id_choice_0\" type=\"radio\" name=\"choice\" value=\"7\" />\n <img src=\"someimage.jpg\" />\n </label>\n <label for=\"id_choice_1\">\n <input id=\"... |
Googling has been difficult because I can't get results specific enough - wondering if my fellow SO-ers have any insight. Are there any handy CSS/HTML templates out there to make inserting content into a google maps bubble easy? I'm throwning together a quick-n-dirty mashup and wanted to avoid spending time styling man... | If you're looking for a quick and easy way to create a styled info window (bubble) for Google Maps, there are several options and resources you can leverage. Here are a few suggestions:
### 1. Use a CSS Template
You can create a basic HTML/CSS template for the Google Maps info window. Here's a simple example:
```html... | 32,437 | [
{
"from": "human",
"value": "Googling has been difficult because I can't get results specific enough - wondering if my fellow SO-ers have any insight. Are there any handy CSS/HTML templates out there to make inserting content into a google maps bubble easy? I'm throwning together a quick-n-dirty mashup and ... |
What do you usually use to connect to a Web Service when you are developing a Java project?
There are different API-s that can do the job.
From different books and tutorials I have read about: JAX-WS, JAXB, JAXM, JAXR, JAX-RPC, Axis ans so on.
I'm interested in what exactly are you using and how much? Take this as a su... | When developing a Java project that connects to a web service, the choice of API or framework depends largely on the type of web service being consumed (SOAP or REST) and the specific requirements of the project. Here’s a breakdown of some common options:
### For SOAP Web Services:
1. **JAX-WS (Java API for XML Web Se... | 28,564 | [
{
"from": "human",
"value": "What do you usually use to connect to a Web Service when you are developing a Java project?\nThere are different API-s that can do the job.\nFrom different books and tutorials I have read about: JAX-WS, JAXB, JAXM, JAXR, JAX-RPC, Axis ans so on.\nI'm interested in what exactly a... |
Is there a way to get the directory of a project in Eclipse? We are writing a plugin that will allow the user to select files, and then run some processes on those files. I would ideally like to be able to get all the files with a certain extension, but that is not necessary.
| Yes, you can get the directory of a project in Eclipse when writing a plugin. The Eclipse Platform provides a variety of APIs to interact with the workspace and projects. Here’s how you can access the project directory and retrieve files with a certain extension:
### Accessing the Project Directory
1. **Get the Proje... | 32,090 | [
{
"from": "human",
"value": "Is there a way to get the directory of a project in Eclipse? We are writing a plugin that will allow the user to select files, and then run some processes on those files. I would ideally like to be able to get all the files with a certain extension, but that is not necessary.\... |
I want my php script to create an output file in a folder based on the date. The way I'm doing this is that its supposed to get the foldername/filename from a text file outputted by another program which I am unable to edit.
So the file its grabbing the data from looks like this:
data/newfolder/10302008/log_for_Today.... | You can achieve this in PHP by reading the text file line by line, extracting the folder path and filename, and then creating the necessary directories and the empty file. Below is a sample script that illustrates how to do this:
```php
<?php
// Path to the input text file
$inputFile = 'path/to/your/input_file.txt';
... | 33,208 | [
{
"from": "human",
"value": "I want my php script to create an output file in a folder based on the date. The way I'm doing this is that its supposed to get the foldername/filename from a text file outputted by another program which I am unable to edit.\nSo the file its grabbing the data from looks like th... |
As a Micro ISV I am coming to the stage in the development of a new desktop software application where beta testing it with an external group of users would be great.
I would prefer private invite only beta testing as opposed to public free for all beta testing.
Are there websites/organisations, both free or paid, wher... | Beta testing can be a crucial step in the development of your software, and finding the right audience for private beta testing is important. Here are some suggestions for websites and platforms where you can reach out to potential beta testers in a selective manner:
### Platforms for Beta Testing
1. **BetaTesting**:... | 32,104 | [
{
"from": "human",
"value": "As a Micro ISV I am coming to the stage in the development of a new desktop software application where beta testing it with an external group of users would be great.\nI would prefer private invite only beta testing as opposed to public free for all beta testing.\nAre there webs... |
This is sort of a follow-up to this question.
If there are multiple blobs with the same contents, they are only stored once in the git repository because their SHA-1's will be identical. How would one go about finding all duplicate files for a given tree?
Would you have to walk the tree and look for duplicate hashes... | Git does not provide a built-in way to directly find duplicate files across a tree. However, you can achieve this by walking through the tree and keeping track of the SHA-1 hashes of the blobs you encounter. Git stores blobs (which represent file contents) and trees (which represent directories) in a way that does not ... | 31,826 | [
{
"from": "human",
"value": "This is sort of a follow-up to this question.\nIf there are multiple blobs with the same contents, they are only stored once in the git repository because their SHA-1's will be identical. How would one go about finding all duplicate files for a given tree? \nWould you have to ... |
How do I write the SQL code to INSERT (or UPDATE) an array of values (with probably an attendant array of fieldnames, or with a matrix with them both) without simple iteration?
| In SQL, inserting or updating multiple rows of data without simple iteration typically involves using a single `INSERT` or `UPDATE` statement with a `VALUES` clause that contains multiple tuples or by leveraging a common table expression (CTE) or temporary tables in case of updates. Below are some methods to achieve th... | 29,974 | [
{
"from": "human",
"value": "How do I write the SQL code to INSERT (or UPDATE) an array of values (with probably an attendant array of fieldnames, or with a matrix with them both) without simple iteration?\n"
},
{
"from": "gpt",
"value": "In SQL, inserting or updating multiple rows of data witho... |
The install instructions are:
$ python setup.py build
$ sudo python setup.py install # or su first
This gives me an .egg file. How do I tell the install to dump the files as a normal, uncompressed library?
Thanks!
| When you use `python setup.py install`, the default behavior for many Python packages is to create an `.egg` file (or sometimes a `.whl` file if you're using a newer package format). If you want to install the package without creating an `.egg` file (i.e., you want the files to be installed directly into the `site-pack... | 32,840 | [
{
"from": "human",
"value": "The install instructions are:\n$ python setup.py build\n$ sudo python setup.py install # or su first\n\nThis gives me an .egg file. How do I tell the install to dump the files as a normal, uncompressed library?\nThanks!\n"
},
{
"from": "gpt",
"value": "When you use `... |
Here's my new project: an open canvas, right in front of me. In a few days, I will start to code a big web application. It will start small, with few modules, only myself as developer and engineer, but hopefully it will grow and grow.
Even though I am an active Java Developer, It's been a while since I last created a W... | That sounds like an exciting project! The web development landscape has indeed evolved significantly since the days of Struts and J2EE. Below, I’ll provide a selection of technologies and practices that are popular today, with an emphasis on Java but also incorporating some general web development trends that might be ... | 28,991 | [
{
"from": "human",
"value": "Here's my new project: an open canvas, right in front of me. In a few days, I will start to code a big web application. It will start small, with few modules, only myself as developer and engineer, but hopefully it will grow and grow.\nEven though I am an active Java Developer, ... |
I have just been getting into low level programming (reading/writing to memory that sort of thing) and have run into an issue i cannot find an answer to.
The piece of information i want to read from has an address that is relative to a DLL loaded in memory e,g, it is at mydll.dll + 0x01234567. the problem im having is ... | To find the base address of a loaded DLL in memory in C#, you can use the Windows API. Specifically, you can use the `Process` class from the `System.Diagnostics` namespace to retrieve information about the currently running processes, and then use the `VirtualQueryEx` API to find the base address of the DLL you are in... | 29,127 | [
{
"from": "human",
"value": "I have just been getting into low level programming (reading/writing to memory that sort of thing) and have run into an issue i cannot find an answer to.\nThe piece of information i want to read from has an address that is relative to a DLL loaded in memory e,g, it is at mydll.d... |
I have to pass parameters between two rails apps. In one side (sender) I have an array of hashes. I have a code like the following to send the data:
http = Net::HTTP.new('localhost', '3030')
result = http.post('/processar_lotes', my_array_of_hashes)
Some questions
Is there any (kind of) serialize or something l... | When passing data between two Rails applications (or any two web services), serialization and deserialization are important concepts. Here's how you can handle the situation you've described:
### 1. Serialization
In Ruby, you can serialize your data into a format that can be easily transmitted over HTTP. The most com... | 29,464 | [
{
"from": "human",
"value": "I have to pass parameters between two rails apps. In one side (sender) I have an array of hashes. I have a code like the following to send the data:\n http = Net::HTTP.new('localhost', '3030')\n result = http.post('/processar_lotes', my_array_of_hashes)\n\nSome questions\n\n... |
How can I use vimdiff to view the differences described in a diff file?
| To use `vimdiff` to view the differences described in a diff file, you can follow these steps:
1. **Open a terminal**: Launch your terminal or command prompt.
2. **Use vimdiff command**: You will invoke `vimdiff` with the `-d` option and specify the original and modified files along with the diff file. The basic synt... | 33,990 | [
{
"from": "human",
"value": "How can I use vimdiff to view the differences described in a diff file?\n"
},
{
"from": "gpt",
"value": "To use `vimdiff` to view the differences described in a diff file, you can follow these steps:\n\n1. **Open a terminal**: Launch your terminal or command prompt.\... |
I am developing an application which will be connected to Access database at the beginning and the plan is to switch to MS SQL or SQL Express in the near future. The datatables structures are same for both types of databases and I am trying to avoid duplicating the code and trying to find the way to minimize the code.
... | To minimize code duplication when working with different database types, you can use an abstraction layer to define a common interface for database operations. This way, you can have different implementations for Access and SQL Server that share the same logic.
Here’s a step-by-step approach to achieve this:
### Step... | 27,340 | [
{
"from": "human",
"value": "I am developing an application which will be connected to Access database at the beginning and the plan is to switch to MS SQL or SQL Express in the near future. The datatables structures are same for both types of databases and I am trying to avoid duplicating the code and tryi... |
I'm trying to get this piece of code working a little better. I suspect it's the loop reading one byte at a time. I couldn't find another way of doing this with gzip decompression. Implementing a StreamReader is fine, but it returns a string which I can't pass to the decompression stream.
Is there a better way?
byte[] ... | To improve the performance of your code while reading from a stream, you can read larger chunks of data instead of one byte at a time. This will significantly reduce the number of I/O operations, making your code faster and more efficient.
You can achieve this by using a `byte[]` buffer of a specified size (e.g., 4096... | 30,447 | [
{
"from": "human",
"value": "I'm trying to get this piece of code working a little better. I suspect it's the loop reading one byte at a time. I couldn't find another way of doing this with gzip decompression. Implementing a StreamReader is fine, but it returns a string which I can't pass to the decompressi... |
How do I read the value of a checkbox in a word (*.doc) file in VB.net using a range object?
This is what I have so far:
Dim app As New Word.Application
Dim doc As Document
doc = app.Documents.Open("C:\myDoc.doc")
dim chkBox as Bookmark
chkBox = doc.Bookmarks("MyCheckbox")
Dim rng as Range
rng = chkBox.Range
where "My... | To read the value of a checkbox in a Word document using VB.NET and the Word interop, you can access the checkbox using the `Range` object associated with the bookmark. However, checkboxes in Word are represented as `FormField` objects when using legacy form fields. Here's how you can do it:
1. Ensure that the checkbo... | 32,450 | [
{
"from": "human",
"value": "How do I read the value of a checkbox in a word (*.doc) file in VB.net using a range object?\nThis is what I have so far:\nDim app As New Word.Application\nDim doc As Document\ndoc = app.Documents.Open(\"C:\\myDoc.doc\")\ndim chkBox as Bookmark\nchkBox = doc.Bookmarks(\"MyCheckb... |
While opening any MS Access database, a security warning appears saying that the file can be harmful to the computer. However, is there a way to remove this message. Or should it remain a necessary evil
| The security warning you see when opening an MS Access database is a precautionary measure designed to protect users from potentially harmful files, such as those containing malicious code or viruses. However, if you trust the source of the database and want to remove or suppress these warnings, there are several metho... | 33,482 | [
{
"from": "human",
"value": "While opening any MS Access database, a security warning appears saying that the file can be harmful to the computer. However, is there a way to remove this message. Or should it remain a necessary evil\n"
},
{
"from": "gpt",
"value": "The security warning you see wh... |
getopt() is not behaving as I expect for short options.
eg: Invoking the below program with a missing parameter:
Valid Case: testopt -d dir -a action -b build
Error Case: testopt -d -a action -b build
This did not throw any error as I was expecting an error message operand missing for -d
Is this a known bug?
If so, i... | The behavior you're experiencing with `getopt()` in your program is expected due to how the function processes command-line arguments. Let's go through the relevant parts of your code and the specifics of the `getopt` function.
### Explanation
When using `getopt()` with short options, each option that requires an arg... | 32,134 | [
{
"from": "human",
"value": "getopt() is not behaving as I expect for short options.\neg: Invoking the below program with a missing parameter:\nValid Case: testopt -d dir -a action -b build\nError Case: testopt -d -a action -b build\nThis did not throw any error as I was expecting an error message operand m... |
Does anyone know how to use CruiseControl.Net to publish to an FTP server?
| Using CruiseControl.Net to publish to an FTP server can be accomplished by configuring your project's `ccnet.config` file to include an FTP task. Here’s a step-by-step guide on how to set this up:
### Step 1: Install FTP Plugin
Before you start, make sure that your CruiseControl.Net installation includes the FTP task... | 31,988 | [
{
"from": "human",
"value": "Does anyone know how to use CruiseControl.Net to publish to an FTP server?\n"
},
{
"from": "gpt",
"value": "Using CruiseControl.Net to publish to an FTP server can be accomplished by configuring your project's `ccnet.config` file to include an FTP task. Here’s a step... |
I have a gradient image as a background for a table header(9x18pix). This image is called through a selector class. When the header content grows to 2 lines(vertical height increases), the bg image is tiling vertically and looks ugly. How can I stretch the bg image vertically without tiling?
| To stretch the background image vertically without tiling, you can use CSS properties that control how the background image is displayed. Specifically, you can use the `background-size` property to stretch the image to fit the element. Here's how you can do it:
```css
.header {
background-image: url('path/to/your/... | 32,719 | [
{
"from": "human",
"value": "I have a gradient image as a background for a table header(9x18pix). This image is called through a selector class. When the header content grows to 2 lines(vertical height increases), the bg image is tiling vertically and looks ugly. How can I stretch the bg image vertically wi... |
In almost any Windows application, I notice that holding the mouse button down in a non-client area causes the painting to stop. Why is this required?
For example, I have a Managed Direct 3D application which displays a spinning cube. If I place the pointer over the title bar and hold the mouse button down, the cube ce... | The behavior you're observing, where holding the mouse button down in a non-client area (like a title bar) causes painting to stop, is a result of the way Windows manages message processing and the main message loop for the application. Here's a breakdown of why this happens, its benefits, and possible workarounds.
##... | 26,938 | [
{
"from": "human",
"value": "In almost any Windows application, I notice that holding the mouse button down in a non-client area causes the painting to stop. Why is this required?\nFor example, I have a Managed Direct 3D application which displays a spinning cube. If I place the pointer over the title bar a... |
How to cancel a keypress event in a textbox after pressing the return key.
| To cancel a keypress event in a textbox after pressing the Return (Enter) key, you can use JavaScript to listen for the `keydown` event. When the Return key is detected, you can call the `preventDefault` method to cancel the event. Here's a basic example to illustrate how to implement this:
### Example Code
```html
<... | 31,183 | [
{
"from": "human",
"value": "How to cancel a keypress event in a textbox after pressing the return key.\n"
},
{
"from": "gpt",
"value": "To cancel a keypress event in a textbox after pressing the Return (Enter) key, you can use JavaScript to listen for the `keydown` event. When the Return key is... |
I want to make my Python library working with MySQLdb be able to detect deadlocks and try again. I believe I've coded a good solution, and now I want to test it.
Any ideas for the simplest queries I could run using MySQLdb to create a deadlock condition would be?
system info:
MySQL 5.0.19
Client 5.1.11
Windows XP
P... | To create a deadlock condition in MySQL, you can use two transactions that lock resources in such a way that each transaction is waiting for a resource held by the other. Below is an example of a simple setup to create a deadlock using Python and MySQLdb.
1. **Create a Sample Table**: First, you need to have a table t... | 29,387 | [
{
"from": "human",
"value": "I want to make my Python library working with MySQLdb be able to detect deadlocks and try again. I believe I've coded a good solution, and now I want to test it.\nAny ideas for the simplest queries I could run using MySQLdb to create a deadlock condition would be?\nsystem info:... |
What is the default XSLT processor for IE6. Does it support EXSLT? Is there anyway to make it support it?
| The default XSLT processor used by Internet Explorer 6 (IE6) is based on Microsoft’s own implementation of XSLT 1.0. This processor has some limitations compared to more modern XSLT processors, particularly in terms of standards compliance and additional features.
**Support for EXSLT:**
EXSLT is a community initiative... | 34,483 | [
{
"from": "human",
"value": "What is the default XSLT processor for IE6. Does it support EXSLT? Is there anyway to make it support it?\n"
},
{
"from": "gpt",
"value": "The default XSLT processor used by Internet Explorer 6 (IE6) is based on Microsoft’s own implementation of XSLT 1.0. This proces... |
DDL for Database Tables:
Users:
id - int - identity
name - varchar - unique
PCs:
id - int - idnetity
name - varchar - unique
userid - FK to Users
Apps:
id - int - identity
name - varchar
pcid - FK to PCs
I created a DataContext using the Linq To SQL designer in Visual Stud... | The feedback you received about your query potentially resulting in a cross join is a common point of confusion when dealing with LINQ queries. However, the way you structured your LINQ query does not produce a cross join due to the relationships defined in your data model.
In LINQ to SQL, when you use the `from ... i... | 34,566 | [
{
"from": "human",
"value": "DDL for Database Tables:\n Users:\n id - int - identity\n name - varchar - unique\n\n PCs:\n id - int - idnetity\n name - varchar - unique\n userid - FK to Users\n\n Apps:\n id - int - identity\n name - varchar\n pcid - FK to PCs\n\nI created a D... |
svg is an xml based graphics and you can add JavaScripts to it. I have tried to access to the script functions defined in a svg. The script in my svg is something like this:
<svg ... onload="RunScript(evt);"...>
<script type="text/javascript">
...
function RunScript(loadEvent) {
// Get object in my html by id
var o... | The issue you're experiencing is due to the Same-Origin Policy (SOP) enforced by web browsers. This policy restricts how documents or scripts loaded from one origin can interact with resources from another origin, which includes accessing the DOM of a different document or script located on a different domain, protocol... | 30,897 | [
{
"from": "human",
"value": "svg is an xml based graphics and you can add JavaScripts to it. I have tried to access to the script functions defined in a svg. The script in my svg is something like this:\n<svg ... onload=\"RunScript(evt);\"...>\n<script type=\"text/javascript\">\n...\nfunction RunScript(load... |
I'm trying to code opposite action to this:
std::ostream outs; // properly initialized of course
std::set<int> my_set; // ditto
outs << my_set.size();
std::copy( my_set.begin(), my_set.end(), std::ostream_iterator<int>( outs ) );
it should be something like this:
std::istream ins;
std::set<int>::size_type size;
ins ... | You can accomplish your goal using a simple approach with `std::istream_iterator` to read the integers from the input stream and insert them into the set without needing to determine the end of the input stream in advance.
Since you're interested in reading the number of elements first, you can simply read the size, ... | 33,709 | [
{
"from": "human",
"value": "I'm trying to code opposite action to this:\nstd::ostream outs; // properly initialized of course\nstd::set<int> my_set; // ditto\n\nouts << my_set.size();\nstd::copy( my_set.begin(), my_set.end(), std::ostream_iterator<int>( outs ) );\n\nit should be something like this:\nstd::... |
What is a StackOverflowError, what causes it, and how should I deal with them?
| A `StackOverflowError` is an error in programming that occurs when a program exhausts the call stack, which is a special area of memory that stores information about active subroutines or functions in a program. This typically happens in languages like Java, C, and C++ that use a call stack to manage function calls.
#... | 32,313 | [
{
"from": "human",
"value": "What is a StackOverflowError, what causes it, and how should I deal with them?\n"
},
{
"from": "gpt",
"value": "A `StackOverflowError` is an error in programming that occurs when a program exhausts the call stack, which is a special area of memory that stores informa... |
I'm consuming an axis 1.4 web service that returns soap responses that I want to unmarshal into my domain objects using jaxb annotations. My initial tests worked very well until some of the returned messages had multiRef elements. Objects that were marshalled using multiRef were showing up as null in my client side an... | JAXB, the Java Architecture for XML Binding, does support unmarshalling XML documents, including those with multiRef elements. However, handling `multiRef` can be a bit tricky since it requires managing the references correctly to ensure that the unmarshalled objects are linked as intended.
Here's how you can handle `... | 32,086 | [
{
"from": "human",
"value": "I'm consuming an axis 1.4 web service that returns soap responses that I want to unmarshal into my domain objects using jaxb annotations. My initial tests worked very well until some of the returned messages had multiRef elements. Objects that were marshalled using multiRef wer... |
Lets say I have an EJB application which defines some entities and relations among them. I figured the DB schema can easily be created from the entities. So now the app works but after a while a need to change some relations, e.g. a one-to-one needs to become a one-to-many, can I upgrade my DB to do so WITHOUT losing t... | Yes, you can upgrade your database schema to accommodate changes in entity relationships, such as changing a one-to-one relationship to a one-to-many relationship, without losing old data. Here are the general steps you would take to achieve this:
### 1. **Analyze Current Schema and Data**
Before making changes, you ... | 32,306 | [
{
"from": "human",
"value": "Lets say I have an EJB application which defines some entities and relations among them. I figured the DB schema can easily be created from the entities. So now the app works but after a while a need to change some relations, e.g. a one-to-one needs to become a one-to-many, can ... |
I'm working with a .NET dev team who are trying to interface with a web service that uses WS-Security, and although the service requires signed requests it only returns unsigned responses.
The team knows of a way to call the service using WSE, but they're required to use WCF, so can anyone suggest how to configure WCF ... | In order to configure WCF to interface with a web service that requires WS-Security with signed requests and returns unsigned responses, you can utilize the built-in WS-Security features provided by WCF. Here are the steps you can follow to achieve this configuration.
### Step 1: Create a WCF Client
First, ensure you... | 29,603 | [
{
"from": "human",
"value": "I'm working with a .NET dev team who are trying to interface with a web service that uses WS-Security, and although the service requires signed requests it only returns unsigned responses.\nThe team knows of a way to call the service using WSE, but they're required to use WCF, s... |
When I create a web site on IIS6 it defaults the ASP.NET version to 1.1. Is there a way to make the version default to 2.0?
| Yes, you can change the default ASP.NET version for new web applications in IIS 6.0 to 2.0. Here's how you can do this:
### Steps to Change the Default ASP.NET Version in IIS 6.0:
1. **Open IIS Manager**:
- Go to **Start** -> **Run**, and type `inetmgr` to open Internet Information Services (IIS) Manager.
2. **Co... | 30,864 | [
{
"from": "human",
"value": "When I create a web site on IIS6 it defaults the ASP.NET version to 1.1. Is there a way to make the version default to 2.0?\n"
},
{
"from": "gpt",
"value": "Yes, you can change the default ASP.NET version for new web applications in IIS 6.0 to 2.0. Here's how you can... |
I'm trying to link a Qt application with its libraries and the linker (MinGW) spews hundreds of lines like the following, and I am unsure how to proceed.
cpp: undefined reference to `_Unwind_SjLj_Register'
c:/qt/lib/libQtCore.a(qcoreapplication_win.o)(.text+0x29d):qcoreapplication_win.
cpp: undefined reference to `... | The errors you're encountering regarding the undefined references to `_Unwind_SjLj_Register`, `_Unwind_SjLj_Unregister`, and `_Unwind_SjLj_Resume` are commonly related to the use of exceptions in C++ and, more specifically, how the MinGW toolchain handles exceptions and unwind information.
These errors can arise when:... | 26,906 | [
{
"from": "human",
"value": "I'm trying to link a Qt application with its libraries and the linker (MinGW) spews hundreds of lines like the following, and I am unsure how to proceed.\n\n cpp: undefined reference to `_Unwind_SjLj_Register'\n c:/qt/lib/libQtCore.a(qcoreapplication_win.o)(.text+0x29d):qcoreapp... |
I believe the following VB.Net code is the equivalent of the proceeding C# code; however the VB.Net test fails - the event handling Lambda is never called.
What is going on?
VB.Net version - fails:
<TestFixture()> _
Public Class TestClass
<Test()> _
Public Sub EventTest()
Dim eventClass As New EventClas... | The issue you're encountering with the VB.Net code arises from how you are using the `AddHandler` statement in combination with a lambda expression. Specifically, the syntax and handling of the lambda expression in VB.Net are not the same as in C#.
In C#, when you use `eventClass.AnEvent += () => { eventRaised = true... | 33,192 | [
{
"from": "human",
"value": "I believe the following VB.Net code is the equivalent of the proceeding C# code; however the VB.Net test fails - the event handling Lambda is never called.\nWhat is going on?\nVB.Net version - fails:\n<TestFixture()> _\nPublic Class TestClass\n <Test()> _\n Public Sub Even... |
I remember working on a project with a group of developers and they always wanted static
html text to be inside of an out tag (<c:out value="words" />). I don't remember why
this was the case.
Is this really a best practice when building jsp pages? What are the
advantages/disadvantages of such an approach?
| Using `<c:out value="words" />` in JSP (JavaServer Pages) is a common practice among developers to enhance the security and maintainability of web applications. Here's a breakdown of the reasons, advantages, and potential disadvantages of this approach:
### Advantages
1. **Prevent XSS Attacks**: One of the primary re... | 30,761 | [
{
"from": "human",
"value": "I remember working on a project with a group of developers and they always wanted static\n html text to be inside of an out tag (<c:out value=\"words\" />). I don't remember why\n this was the case.\nIs this really a best practice when building jsp pages? What are the \nadvanta... |
I have many emails coming in from different sources.
they all have attachments, many of them have attachment names in chinese, so these
names are converted to base64 by their email clients.
When I receive these emails, I wish to decode the name. but there are other names which are
not base64. How can I differentiate wh... | To differentiate whether a string is a base64 encoded string or not in Jython, you can use the following criteria:
1. **Character set**: Base64 strings typically only consist of the characters A-Z, a-z, 0-9, `+`, `/`, and `=` as padding.
2. **Length**: The length of a valid base64 string should be a multiple of 4.
3. ... | 33,407 | [
{
"from": "human",
"value": "I have many emails coming in from different sources.\nthey all have attachments, many of them have attachment names in chinese, so these\nnames are converted to base64 by their email clients.\nWhen I receive these emails, I wish to decode the name. but there are other names whic... |
As a team we are using Visual Studio 2005 with framework 3.0. I am thinking if it will be nice for us to switch to Visual Studio 2008 with framework 3.5 ? Is it worth it ?
Thanks.
| Switching from Visual Studio 2005 with .NET Framework 3.0 to Visual Studio 2008 with .NET Framework 3.5 can offer several advantages. Here are some key points to consider:
### Benefits of Upgrading:
1. **Enhanced Features**: Visual Studio 2008 introduced several new features that can improve productivity, such as:
... | 32,848 | [
{
"from": "human",
"value": "As a team we are using Visual Studio 2005 with framework 3.0. I am thinking if it will be nice for us to switch to Visual Studio 2008 with framework 3.5 ? Is it worth it ?\nThanks.\n"
},
{
"from": "gpt",
"value": "Switching from Visual Studio 2005 with .NET Framework... |
I'm writing a web application that dynamically creates URL's based off of some input, to be consumed by a client at another time. For discussion sake these URL's can contain certain characters, like a forward slash (i.e. '/'), which should not be interpreted as part of the actual URL, but just as an argument. For examp... | In your situation, where you want to pass arguments that may include special characters in a URL without them being interpreted as part of the URL structure itself, there are several strategies you can consider. Here’s a breakdown of different methods you can use to encode these arguments while ensuring they can be eas... | 30,497 | [
{
"from": "human",
"value": "I'm writing a web application that dynamically creates URL's based off of some input, to be consumed by a client at another time. For discussion sake these URL's can contain certain characters, like a forward slash (i.e. '/'), which should not be interpreted as part of the actua... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.