instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
As far as I can tell, the best way to do this is do it in the DataTable.RowChanging event. But what if I want to cancel the action? There is no EventArgs.Cancel option...
| In the `DataTable.RowChanging` event, if you want to cancel the addition or deletion of a row, you can do so by handling the event in a specific way. Although there is no `EventArgs.Cancel` option in this event, you can throw an exception to prevent the action from being completed.
Here's an example of how you might i... | 26,920 | [
{
"from": "human",
"value": "As far as I can tell, the best way to do this is do it in the DataTable.RowChanging event. But what if I want to cancel the action? There is no EventArgs.Cancel option...\n"
},
{
"from": "gpt",
"value": "In the `DataTable.RowChanging` event, if you want to cancel the... |
I have many instances of an application installed on an IIS 6.0, Windows Server 2003 box under the same application pool. They share many of the same assemblies and can not be joined in to a single application.
I recently added a new instance of the application and obtained a System.OutOfMemoryException when I tried t... | Using the Global Assembly Cache (GAC) to store common assemblies can help manage assembly versions and reduce the overall memory footprint of your applications, but it may not directly resolve a `System.OutOfMemoryException` that you're encountering.
Here's a breakdown of the options:
### GAC and Shared Assemblies
- ... | 28,243 | [
{
"from": "human",
"value": "I have many instances of an application installed on an IIS 6.0, Windows Server 2003 box under the same application pool. They share many of the same assemblies and can not be joined in to a single application. \nI recently added a new instance of the application and obtained a ... |
I've been a professional software engineer for about a year now, having graduated with a CS degree. I've known about assertions for a while in C++ and C, but had no idea they existed in C# and .NET at all until recently.
Our production code contains no asserts whatsoever and my question is this...
Should I begin using ... | It's great that you're exploring the use of assertions in your code! Assertions can be a valuable tool in software development, but whether to use them in production code—and how to use them—depends on their purpose and the context of your application. Let's break down the concepts.
### What Are Assertions?
In C#, as... | 21,271 | [
{
"from": "human",
"value": "I've been a professional software engineer for about a year now, having graduated with a CS degree. I've known about assertions for a while in C++ and C, but had no idea they existed in C# and .NET at all until recently.\nOur production code contains no asserts whatsoever and my... |
I began an iPhone project the other day with a silly development code name, and now I want to change the name of the project since it's nearly finished. How can I do this?
| Changing the name of an iPhone project in Xcode involves several steps. Here’s how you can do it:
1. **Change the Project Name**:
- Open your project in Xcode.
- In the Project Navigator, click on your project at the top of the navigator.
- In the main panel, you'll see the project settings. Under the "Identi... | 26,839 | [
{
"from": "human",
"value": "I began an iPhone project the other day with a silly development code name, and now I want to change the name of the project since it's nearly finished. How can I do this?\n"
},
{
"from": "gpt",
"value": "Changing the name of an iPhone project in Xcode involves sever... |
I have a rails app that has picked up a bit of traction, but I have a serious headache to deal with. It's a basic sort of asset manager application - users upload their photos, .pdfs, videos, etc., and the system allows them to manage how that asset is presented.
I started with a fairly standard rails view - just what... | To achieve the desired functionality where clicking on a thumbnail loads an edit form into a specific `<div>` using AJAX, you can follow these steps:
1. **Modify the Thumbnail Partial**: Make sure your thumbnail partial has a link that triggers an AJAX request when clicked. You can use `link_to` with the `remote: true... | 23,570 | [
{
"from": "human",
"value": "I have a rails app that has picked up a bit of traction, but I have a serious headache to deal with. It's a basic sort of asset manager application - users upload their photos, .pdfs, videos, etc., and the system allows them to manage how that asset is presented.\nI started wit... |
I have a problem in a query in Acess 2003 (SP3).
I have a query that includes some tables and a sub query. The sub query and tables are all joined to a main table. The query uses some aggregate functions and there is a HAVING clause that filters the result on the primary key (PK).
Under these conditions, a memo field o... | The behavior you're experiencing in Access 2003, particularly with memo fields displaying incorrectly when combined with aggregate functions and HAVING clauses, may indeed point to a known issue or bug in that version of Access. Here are some steps you can take to troubleshoot the issue and potential workarounds:
### ... | 26,159 | [
{
"from": "human",
"value": "I have a problem in a query in Acess 2003 (SP3).\nI have a query that includes some tables and a sub query. The sub query and tables are all joined to a main table. The query uses some aggregate functions and there is a HAVING clause that filters the result on the primary key (P... |
I'm looking for a way to transform a genuine string into it's hexadecimal value in SQL. I'm looking something that is Informix-friendly but I would obviously prefer something database-neutral
Here is the select I am using now:
SELECT SomeStringColumn from SomeTable
Here is the select I would like to use:
SELECT ... | In Informix, converting a string to its hexadecimal representation can be a bit tricky because there isn't a built-in `hex()` function for strings like you might find in other databases. However, you can achieve this using the `ASCII` function and string manipulation functions to convert each character of the string to... | 29,017 | [
{
"from": "human",
"value": "I'm looking for a way to transform a genuine string into it's hexadecimal value in SQL. I'm looking something that is Informix-friendly but I would obviously prefer something database-neutral \nHere is the select I am using now:\nSELECT SomeStringColumn from SomeTable\n\nHere is... |
I've got a lot of small DLLs which I would like to make into one big(er) DLL (as suggested here). I can do so by merging my projects but I would like a less intrusive way.
Can several DLLs be merged into one unit?
A quick search found this thread that claims this is not possible. Does anyone know otherwise?
Note that... | Merging multiple native C++ DLLs into a single DLL is not straightforward because of how DLLs and their dependencies work. However, there are a few approaches you might consider, depending on your specific needs and constraints:
### 1. **Using a Linker Tool:**
You could potentially use a tool like **"DLL Redirectio... | 26,743 | [
{
"from": "human",
"value": "I've got a lot of small DLLs which I would like to make into one big(er) DLL (as suggested here). I can do so by merging my projects but I would like a less intrusive way. \nCan several DLLs be merged into one unit? \nA quick search found this thread that claims this is not poss... |
I run windows in a VMWare partition. At times, TSVNCache.exe process starts doing some weird things (Seems like its doing an endless loop of I/O operations). Suddenly my whole VMWare session starts slowing down. My mac heats up badly. In the sense its freaking hot.
My question is what is this TSVNCache process anyway ?... | TSVNCache.exe is part of TortoiseSVN, which is a popular Subversion (SVN) client for Windows. The process is primarily responsible for caching the status of files and folders in your SVN working copies to provide quick access to their status without needing to check the repository every time. This can help speed up ope... | 27,346 | [
{
"from": "human",
"value": "I run windows in a VMWare partition. At times, TSVNCache.exe process starts doing some weird things (Seems like its doing an endless loop of I/O operations). Suddenly my whole VMWare session starts slowing down. My mac heats up badly. In the sense its freaking hot.\nMy question ... |
I've been able to find Xaml Object Mapping Specification, WPF Xaml Vocabulary Specification, and Silverlight Xaml Vocabulary Specification documents online but no WF Xaml Vocabulary Specification document for Windows Workflows. I want to be able to specify workflows without using a Visual Studio IDE.
Does anybody know... | The Windows Workflow Foundation (WF) does not have a dedicated XAML Vocabulary Specification document readily available like the ones for WPF or Silverlight. However, the workflow definitions in WF do indeed use XAML, and you can find some useful resources and documentation that can help you understand how to define wo... | 28,591 | [
{
"from": "human",
"value": "I've been able to find Xaml Object Mapping Specification, WPF Xaml Vocabulary Specification, and Silverlight Xaml Vocabulary Specification documents online but no WF Xaml Vocabulary Specification document for Windows Workflows. I want to be able to specify workflows without usi... |
I've got a lot of similar oracle jobs I need to create, and I'd like to do it programatically.
Where does the Oracle store the job library (schema/table)?
(yes, I know I might be running with scissors)
| In Oracle Database, job information is typically stored in the `DBA_SCHEDULER_JOBS` view for jobs created using the Oracle Scheduler (which is the recommended approach for managing jobs in Oracle).
The Scheduler manages jobs in a centralized way, and you can access several views to get information about jobs:
- `DBA_... | 28,247 | [
{
"from": "human",
"value": "I've got a lot of similar oracle jobs I need to create, and I'd like to do it programatically. \nWhere does the Oracle store the job library (schema/table)?\n(yes, I know I might be running with scissors)\n"
},
{
"from": "gpt",
"value": "In Oracle Database, job infor... |
I've been programming in C++ for a few years, and I've used STL quite a bit and have created my own template classes a few times to see how it's done.
Now I'm trying to integrate templates deeper into my OO design, and a nagging thought keeps coming back to me: They're just a macros, really... You could implement (rath... | You're right to consider both templates and macros, but they serve fundamentally different purposes and are implemented very differently in C++. Let’s break down some of the key distinctions between templates and macros, as well as the implications each has for your code.
### Key Distinctions
1. **Type Safety**:
-... | 25,527 | [
{
"from": "human",
"value": "I've been programming in C++ for a few years, and I've used STL quite a bit and have created my own template classes a few times to see how it's done.\nNow I'm trying to integrate templates deeper into my OO design, and a nagging thought keeps coming back to me: They're just a m... |
I am writing a compiler in F# and I want to be able to access the unmanaged metadata COM interfaces in the .net runtime. Before anybody mentions it, Reflection.Emit is not suitable for my purposes, nor do I want to use any other method than the metadata COM interfaces.
I've imported mscoree.tlb but it doesn't seem to i... | It's great to hear that you've found a solution by writing explicit COM references using the interface GUIDs. For others who may find themselves in a similar situation and want to access unmanaged metadata COM interfaces, such as `IMetaDataEmit`, here's a sample approach to get started using F# or C#.
### Step 1: Defi... | 19,399 | [
{
"from": "human",
"value": "I am writing a compiler in F# and I want to be able to access the unmanaged metadata COM interfaces in the .net runtime. Before anybody mentions it, Reflection.Emit is not suitable for my purposes, nor do I want to use any other method than the metadata COM interfaces.\nI've imp... |
Does anyone know of a tool to take a T-SQL query and convert it into a LINQtoSQL query?
| There isn't a direct tool that universally converts T-SQL queries to LINQ to SQL queries due to the fundamental differences between SQL and LINQ in terms of syntax and structure. However, there are several approaches you can take to facilitate the conversion process:
1. **LINQPad**: This is a great tool that allows yo... | 28,756 | [
{
"from": "human",
"value": "Does anyone know of a tool to take a T-SQL query and convert it into a LINQtoSQL query?\n"
},
{
"from": "gpt",
"value": "There isn't a direct tool that universally converts T-SQL queries to LINQ to SQL queries due to the fundamental differences between SQL and LINQ i... |
I'm really stumped on this one. I want to output a list and have the tag file take care of commas, singular versus plural, etc. but when I display the list it completely ignores whitespace so everythingrunstogetherlikethis. I tried using the HTML entities "thinsp", "ensp" and "emsp" (I can't use "nbsp", these have to b... | It sounds like you're facing an issue with whitespace handling in your JSP tag file. When generating lists or strings programmatically, whitespace can sometimes be ignored in the output. Here are a few approaches you can try to resolve this issue:
### 1. Use `<c:out>` with Whitespace Handling
Make sure to wrap your o... | 25,645 | [
{
"from": "human",
"value": "I'm really stumped on this one. I want to output a list and have the tag file take care of commas, singular versus plural, etc. but when I display the list it completely ignores whitespace so everythingrunstogetherlikethis. I tried using the HTML entities \"thinsp\", \"ensp\" an... |
I'm not much of a Visual Basic person, but I am tasked with maintaining an old VB6 app. Whenever I check out a file, the editor will replace a bunch of the uppercase variable names with lowercase automatically. How can I make this stop!? I don't want to have to change them all back, and it's a pain to have these cha... | It sounds like you're encountering the case sensitivity issues inherent to Visual Basic 6 (VB6). In VB6, variable names are not case-sensitive; however, the IDE often displays them in a certain case based on how they're defined and how they are first used.
### Possible Solutions:
1. **Check IDE Settings**:
- Unfo... | 25,950 | [
{
"from": "human",
"value": "I'm not much of a Visual Basic person, but I am tasked with maintaining an old VB6 app. Whenever I check out a file, the editor will replace a bunch of the uppercase variable names with lowercase automatically. How can I make this stop!? I don't want to have to change them al... |
OK, say that my application is emitting (x86) instructions into memory, making the page executable, etc. Is there a way of altering the method stub of an un-JITted method to point to my emitted instruction stream?
E.g.:
Suppose I have created an x86 instruction stream in memory, which does something arbitrary. Now, fur... | Altering method stubs in .NET at runtime is a complex task, and while it might theoretically be possible through certain means, doing so can lead to significant security risks and is not recommended.
### Background:
In .NET, methods are often Just-In-Time (JIT) compiled, and the method stubs you mention are placehold... | 23,990 | [
{
"from": "human",
"value": "OK, say that my application is emitting (x86) instructions into memory, making the page executable, etc. Is there a way of altering the method stub of an un-JITted method to point to my emitted instruction stream?\nE.g.:\nSuppose I have created an x86 instruction stream in memor... |
Something that has always bugged me is how unpredictable the setTimeout() method in Javascript is.
In my experience, the timer is horribly inaccurate in a lot of situations. By inaccurate, I mean the actual delay time seems to vary by 250-500ms more or less. Although this isn't a huge amount of time, when using it to h... | You're correct that the `setTimeout()` method in JavaScript can sometimes be unpredictable, especially due to the way JavaScript handles its event loop and the timers. The actual delay can often be longer than the specified time, especially if there are other tasks in the event queue that are blocking execution. Here a... | 22,257 | [
{
"from": "human",
"value": "Something that has always bugged me is how unpredictable the setTimeout() method in Javascript is.\nIn my experience, the timer is horribly inaccurate in a lot of situations. By inaccurate, I mean the actual delay time seems to vary by 250-500ms more or less. Although this isn't... |
In my just-completed project, I was working getting distributed transactions working.
We implemented this using JBoss's Arjuna Transaction Manager, and Spring's declarative transaction boundaries.
Our request sequence looked like:
browser -> secured servlet -> 'wafer-thin' SLSB -> spring TX-aware proxy -> request-handl... | Your setup involves a common architecture pattern, but you're right to seek a cleaner separation of concerns and to reduce the complexity that comes from mixing different technologies. Here are several strategies to consider for separating the presentation and business tiers when using Spring, which can help you mainta... | 24,387 | [
{
"from": "human",
"value": "In my just-completed project, I was working getting distributed transactions working.\nWe implemented this using JBoss's Arjuna Transaction Manager, and Spring's declarative transaction boundaries.\nOur request sequence looked like:\nbrowser -> secured servlet -> 'wafer-thin' SL... |
I'm running PHP on Windows/IIS.
My session variables don't seem to be preserved from page-to-page.
This code…
//echos out the session variables in a nice format for inspection
echo "<p><pre>";
print_r($_SESSION);
echo "</pre></p>";
…outputs blank values, like this…
Array
(
[s_firstvar] =>
... | It sounds like you're experiencing issues with PHP session variables not persisting across requests, which is often related to session handling configuration. Here’s a checklist of things you should verify to ensure that sessions work correctly on your Windows/IIS setup:
1. **Verify `session_start()`**: Ensure that yo... | 26,844 | [
{
"from": "human",
"value": "I'm running PHP on Windows/IIS.\nMy session variables don't seem to be preserved from page-to-page.\nThis code…\n//echos out the session variables in a nice format for inspection\necho \"<p><pre>\";\nprint_r($_SESSION);\necho \"</pre></p>\";\n\n…outputs blank values, like this…\... |
How do I Configuring DoxyGen to document ActionScript files?
I've included the *.as and *.asi files in doxygen's search pattern, but the classes, functions and variables don't show there.
| Configuring Doxygen to document ActionScript files requires some specific settings because Doxygen primarily targets languages like C++, C#, and Java. However, you can configure it to recognize ActionScript files by following these steps:
### Step-by-step Configuration
1. **File Extensions**:
Ensure that Doxygen r... | 22,693 | [
{
"from": "human",
"value": "How do I Configuring DoxyGen to document ActionScript files?\nI've included the *.as and *.asi files in doxygen's search pattern, but the classes, functions and variables don't show there.\n"
},
{
"from": "gpt",
"value": "Configuring Doxygen to document ActionScript ... |
I am trying to get PHP working on my vista home machine but I am getting weird problems. First I had file permission problems for which I disabled Vista's UAC. Now I can't get the PHP interpreter working.
I have made all the necessary changes following some tutorial but I still can't get it working.
Tutorial was locate... | It can be challenging to set up PHP on Windows Vista, especially considering the UAC (User Account Control) and permission issues. Here are some steps to help troubleshoot your PHP installation and get it working correctly:
### Step 1: Check Installation
1. **PHP Installation**: Make sure you have downloaded the corr... | 22,607 | [
{
"from": "human",
"value": "I am trying to get PHP working on my vista home machine but I am getting weird problems. First I had file permission problems for which I disabled Vista's UAC. Now I can't get the PHP interpreter working.\nI have made all the necessary changes following some tutorial but I still... |
Are there any tools that can help find race conditions when testing multi-threaded .net code? I'm looking for something with similar capabilities to IBM's ConTest tool for Java.
| Yes, there are several tools and techniques that can help you find race conditions and other concurrency issues in .NET applications. While there may not be an exact equivalent to IBM's ConTest for .NET, there are several options you can consider:
1. **Concurrency Visualizer**: This is a tool that comes with Visual St... | 26,771 | [
{
"from": "human",
"value": "Are there any tools that can help find race conditions when testing multi-threaded .net code? I'm looking for something with similar capabilities to IBM's ConTest tool for Java.\n"
},
{
"from": "gpt",
"value": "Yes, there are several tools and techniques that can hel... |
I have been tasked to optimize some sql queries at work. Everything I have found points to using Explain Plan to identify problem areas. The problem I can not find out exactly what explain plan is telling me. You get Cost, Cardinality, and bytes.
What do this indicate, and how should I be using this as a guide. Are lo... | Understanding the `EXPLAIN PLAN` output is crucial for optimizing SQL queries. Here's a breakdown of the key components you mentioned: **Cost**, **Cardinality**, and **Bytes**.
### 1. Cost
- **What it is:** Cost is an estimate of the resources required to execute the query, usually expressed as a numeric value. It re... | 23,906 | [
{
"from": "human",
"value": "I have been tasked to optimize some sql queries at work. Everything I have found points to using Explain Plan to identify problem areas. The problem I can not find out exactly what explain plan is telling me. You get Cost, Cardinality, and bytes. \nWhat do this indicate, and how... |
How to programmatically associate a name like COM51 to a physical serial port in Microsoft Windows?
To manually perform the operation I can follow the steps described in
link text
Open Device Manager with devmgmt.msc
Double-click Ports (COM & LPT).
Right-click the port I want, and then click Properties.
On the Port Set... | To programmatically associate a name like COM51 to a physical serial port in Microsoft Windows, you can use the Windows Management Instrumentation (WMI) or the SetupAPI to modify device properties. Here are a couple of methods:
### Method 1: Using WMI
You can use the `Win32_SerialPort` WMI class to query and set prop... | 25,520 | [
{
"from": "human",
"value": "How to programmatically associate a name like COM51 to a physical serial port in Microsoft Windows?\nTo manually perform the operation I can follow the steps described in\nlink text\nOpen Device Manager with devmgmt.msc\nDouble-click Ports (COM & LPT).\nRight-click the port I wa... |
Possible Duplicate:
How can I use a carriage return in a HTML tooltip?
I'd like to know if it's possible to force a newline to show in the tooltip when using title property of a TD.
something like
<td title="lineone \n linetwo \n etc...">
Can this be done?
| The `title` attribute in HTML does not support HTML formatting or line breaks, such as `\n`, for its tooltips. The content of the `title` attribute is displayed as a plain text tooltip, and it does not interpret special characters or HTML tags.
If you want to create a tooltip with line breaks, you can use a JavaScript... | 29,041 | [
{
"from": "human",
"value": "\nPossible Duplicate:\nHow can I use a carriage return in a HTML tooltip? \n\nI'd like to know if it's possible to force a newline to show in the tooltip when using title property of a TD.\nsomething like \n<td title=\"lineone \\n linetwo \\n etc...\">\n\nCan this be done?\n"
... |
I have a form that is sending in sizes of things, and I need to see what the strings are equal to so that I can set the price accordingly. When i try to do this, it says that they are not equal, and i get no prices. This is the code i'm using:
if ($_POST['sizes'] == "Small ($30)"){$total = "30";}
if ($_POST['sizes'] ==... | The issue you're encountering stems from the way you're checking the conditions in your code. Specifically, the last condition (`else`) will always execute if the first `if` statement fails, which means that the subsequent `if` statements will not be evaluated correctly. This will result in your `$total` variable being... | 26,526 | [
{
"from": "human",
"value": "I have a form that is sending in sizes of things, and I need to see what the strings are equal to so that I can set the price accordingly. When i try to do this, it says that they are not equal, and i get no prices. This is the code i'm using:\nif ($_POST['sizes'] == \"Small ($3... |
The situation
When you study social sciences, you are frequently confronted with the need for online surveys (scientific data collection online). That's one of the main reasons why I started with PHP in the first place.
Recently these survey applications have grown and grown. A lot of complexity has been added: reporti... | Your situation highlights common challenges in developing and maintaining complex web applications, especially those centered around data gathering and reporting. Let's address your questions step by step:
### 1. Is PHP/MySQL still a way to go?
PHP and MySQL are still widely used technologies, and they are capable of... | 24,827 | [
{
"from": "human",
"value": "The situation\nWhen you study social sciences, you are frequently confronted with the need for online surveys (scientific data collection online). That's one of the main reasons why I started with PHP in the first place.\nRecently these survey applications have grown and grown. ... |
I created a wcf service based on ServiceHostFactory, and i'm hosting it in IIS6.
If i use a HTTP endpoint everything works just fine, but when i try to switch to TCP it goes bad.
Is it even possible to do this in II6?
I have a more specific question posted here, that asks for a solution, but i would be happy with (for ... | When hosting a WCF service in IIS 6, it is important to understand that IIS 6 has limitations compared to later versions of IIS (such as IIS 7 and above), particularly regarding support for different transport protocols like TCP.
### Reasons Why TCP Connection Might Not Work:
1. **IIS 6 Limitations**:
- IIS 6 doe... | 24,234 | [
{
"from": "human",
"value": "I created a wcf service based on ServiceHostFactory, and i'm hosting it in IIS6.\nIf i use a HTTP endpoint everything works just fine, but when i try to switch to TCP it goes bad.\nIs it even possible to do this in II6?\nI have a more specific question posted here, that asks for... |
I have the following autorun.inf
[Autorun]
action="Blah, Inc."
open=marketing.exe
icon=blah.ico
label="Blah, Inc."
On Vista, the autorun dialog shows "Publisher not specified". How do I specify a publisher?
| To specify a publisher in the `autorun.inf` file for Windows Vista, you cannot directly set a publisher in the `autorun.inf` itself. Instead, the "Publisher not specified" message usually appears when the executable does not have a digital signature.
To resolve this, you need to sign your executable file (`marketing.... | 29,154 | [
{
"from": "human",
"value": "I have the following autorun.inf\n[Autorun]\naction=\"Blah, Inc.\"\nopen=marketing.exe\nicon=blah.ico\nlabel=\"Blah, Inc.\"\n\nOn Vista, the autorun dialog shows \"Publisher not specified\". How do I specify a publisher?\n"
},
{
"from": "gpt",
"value": "To specify a... |
I'm trying to set up a virtual host on a new VPS using apache 2.x on a Ubuntu server.
When starting apache I get the error " xxx.241.214.xxx:80 has no VirtualHosts", and the url for the site still points to the default location which means my virtual host file isn't taking effect:
<VirtualHost xxx.241.214.xxx:80>
Serve... | Setting up a virtual host in Apache can be tricky if you're new to server configuration, but I can guide you through the process. The error message "xxx.241.214.xxx:80 has no VirtualHosts" suggests that Apache is not recognizing your virtual host configuration. Here are steps to ensure your virtual host is set up corre... | 22,200 | [
{
"from": "human",
"value": "I'm trying to set up a virtual host on a new VPS using apache 2.x on a Ubuntu server.\nWhen starting apache I get the error \" xxx.241.214.xxx:80 has no VirtualHosts\", and the url for the site still points to the default location which means my virtual host file isn't taking ef... |
Notice in the bottom right hand corner of this page it has the SVN revision id? I'm assuming that's dynamic.
I'd love to add that to some of my sites, just as a comment in the source to make sure code pushes are going through.
NOTE: You can also assume that the working directory of the site in question is an svn checko... | To display the global SVN revision number in your web pages, you can retrieve this information directly from the SVN working directory using a simple script. Since you want to add this as a comment in the source code, you can use a server-side language (like PHP, Python, etc.) to extract the revision number dynamically... | 26,573 | [
{
"from": "human",
"value": "Notice in the bottom right hand corner of this page it has the SVN revision id? I'm assuming that's dynamic.\nI'd love to add that to some of my sites, just as a comment in the source to make sure code pushes are going through.\nNOTE: You can also assume that the working directo... |
I'm using an HTML sanitizing whitelist code found here:
http://refactormycode.com/codes/333-sanitize-html
I needed to add the "font" tag as an additional tag to match, so I tried adding this condition after the <img tag check
if (tagname.StartsWith("<font"))
{
// detailed <font> tag checking
// Non-escaped ex... | It looks like you've already identified the primary issue with your regular expression: the `#` character needs to be escaped in C#. In many programming languages, including C#, the `#` character is treated as a special character in regex and needs to be escaped with a backslash (`\`) to be matched literally.
Here's a... | 27,172 | [
{
"from": "human",
"value": "I'm using an HTML sanitizing whitelist code found here:\nhttp://refactormycode.com/codes/333-sanitize-html\nI needed to add the \"font\" tag as an additional tag to match, so I tried adding this condition after the <img tag check \nif (tagname.StartsWith(\"<font\"))\n{\n // ... |
For example, using the answer for this question:
How to select all users who made more than 10 submissions
"How to select all users who made more than 10 submissions."
select userId
from submission
group by userId
having count(submissionGuid) > 10
Let's say now I want to know many rows this sql statement outputted... | To count the number of rows returned by the SQL statement that selects users with more than 10 submissions, you can wrap your existing query in another query that performs a count on its results. This approach is scalable and maintains readability.
Here’s how you can do it:
```sql
SELECT COUNT(*)
FROM (
SELECT us... | 27,727 | [
{
"from": "human",
"value": "For example, using the answer for this question: \nHow to select all users who made more than 10 submissions\n\"How to select all users who made more than 10 submissions.\"\nselect userId\nfrom submission \ngroup by userId\nhaving count(submissionGuid) > 10\n\nLet's say now I ... |
Returning to WinForms in VS2008 after a long time.. Tinkering with a OOD problem in VS2008 Express Edition.
I need some controls to be "display only" widgets. The user should not be able to change the value of these controls... the widgets are updated by a periodic update tick event. I vaguely remember there being a Re... | In WinForms, if you want to make controls display-only without allowing user interaction while maintaining their visual appearance, you typically won't find a direct `ReadOnly` property for most control types. However, you can achieve the desired behavior through different approaches depending on the control type you'r... | 27,325 | [
{
"from": "human",
"value": "Returning to WinForms in VS2008 after a long time.. Tinkering with a OOD problem in VS2008 Express Edition.\nI need some controls to be \"display only\" widgets. The user should not be able to change the value of these controls... the widgets are updated by a periodic update tic... |
So like most new .NET developers you start of passing DataSets everywhere and although things do the job it doesn't seem right.
The next progression is usually to create entity objects that extend a DAL base class so you have i.e.
public class User : UserDAL
{
//User specific methods
}
public class UserDAL
{
//... | Your question touches on several important concepts in software design, particularly in the context of data access and object-oriented programming. It's great that you're thinking critically about the architecture of your application. Let's break down your concerns, clarify some terminology, and examine the implication... | 23,338 | [
{
"from": "human",
"value": "So like most new .NET developers you start of passing DataSets everywhere and although things do the job it doesn't seem right. \nThe next progression is usually to create entity objects that extend a DAL base class so you have i.e. \npublic class User : UserDAL\n{\n //User s... |
Is it possible in ASP.NET to take a string containing some HTML and make ASP.NET to parse it and create a Control for me? For example:
string rawHTML = "<table><td><td>Cell</td></tr></table>";
HTMLTable table = MagicClass.ParseTable(rawHTML);
I know that this is a bad thing to do but I am in the unfortunate situation ... | In ASP.NET, parsing a string that contains HTML and converting it into server-side controls can be quite challenging, especially when you want to retain the original structure and hierarchy of the HTML. However, you can achieve this using the `HtmlAgilityPack`, a popular .NET library for parsing and manipulating HTML d... | 25,678 | [
{
"from": "human",
"value": "Is it possible in ASP.NET to take a string containing some HTML and make ASP.NET to parse it and create a Control for me? For example:\nstring rawHTML = \"<table><td><td>Cell</td></tr></table>\";\nHTMLTable table = MagicClass.ParseTable(rawHTML);\n\nI know that this is a bad thi... |
My application is generating different floating point values when I compile it in release mode and in debug mode. The only reason that I found out is I save a binary trace log and the one from the release build is ever so slightly off from the debug build, it looks like the bottom two bits of the 32 bit float values ar... | The behavior you are observing, where floating point values differ between debug and release builds, is not uncommon and can often be attributed to a number of factors related to how floating-point arithmetic is handled in different compilation modes. Here are some key points to consider:
### Reasons for Differences
... | 20,996 | [
{
"from": "human",
"value": "My application is generating different floating point values when I compile it in release mode and in debug mode. The only reason that I found out is I save a binary trace log and the one from the release build is ever so slightly off from the debug build, it looks like the bott... |
If this is possible, please provide a sample query or two so I can see how it would work. Both tables will be in the same database.
Thanks!
| Certainly! To provide you with relevant sample queries, I need some context regarding the tables you are working with, such as their structure (the table names, columns, data types, and relationships) and the type of queries you're interested in (e.g., SELECT, INSERT, UPDATE, DELETE). However, I can provide you with a ... | 26,828 | [
{
"from": "human",
"value": "If this is possible, please provide a sample query or two so I can see how it would work. Both tables will be in the same database.\nThanks!\n"
},
{
"from": "gpt",
"value": "Certainly! To provide you with relevant sample queries, I need some context regarding the ta... |
Lasty, I tried to implements an hybrid structure in Java, something that looks like:
public class MapOfSet<K, V extends HasKey<K>> implements Set<V>, Map<K, Set<V>>
Where HasKey is the following interface:
public interface HasKey<K> {
public K getKey();
}
Unfortunately, there are some conflicts between methos sig... | To achieve your goal of having a structure that behaves like both a `Set` and a `Map` where each key can correspond to a subset of values, you can create a custom class that internally maintains both a `Set` and a `Map`. This way, you can provide the functionalities of both interfaces without running into method signat... | 11,137 | [
{
"from": "human",
"value": "Lasty, I tried to implements an hybrid structure in Java, something that looks like:\npublic class MapOfSet<K, V extends HasKey<K>> implements Set<V>, Map<K, Set<V>>\n\nWhere HasKey is the following interface:\npublic interface HasKey<K> {\n public K getKey();\n}\n\nUnfortuna... |
I am a complete JSP beginner. I am trying to use a java.util.List in a JSP page. What do I need to do to use classes other than ones in java.lang?
| To use classes from other packages like `java.util.List` in a JSP page, you need to do a couple of things. Here's a simple guide to help you get started.
### Step 1: Ensure the Environment is Set Up
Make sure your JSP environment is correctly set up, which usually means having a servlet container like Apache Tomcat i... | 26,939 | [
{
"from": "human",
"value": "I am a complete JSP beginner. I am trying to use a java.util.List in a JSP page. What do I need to do to use classes other than ones in java.lang?\n"
},
{
"from": "gpt",
"value": "To use classes from other packages like `java.util.List` in a JSP page, you need to d... |
Here's what I need to do, any ideas would be helpful.
I need to be able to change the Local IP address of a computer programmatically as a limited user in XP. Without giving Admin information to the users. I've played with runas, sanur, and autoit, but all either require giving up the Administrator password or is not... | Changing the local IP address programmatically on Windows XP without administrative privileges can be quite challenging due to the inherent security measures in place. Here are a few approaches you might consider, although they come with certain limitations and security implications.
### 1. **Scheduled Task with Eleva... | 22,996 | [
{
"from": "human",
"value": "Here's what I need to do, any ideas would be helpful.\nI need to be able to change the Local IP address of a computer programmatically as a limited user in XP. Without giving Admin information to the users. I've played with runas, sanur, and autoit, but all either require givi... |
Let's say I have a class in my web app called class "Foo". It has an initialise() method that is called when the bean is created using Spring. The initialise() method then tries to load an external service and assign it to a field. If the service could not be contacted, the field will be set to null.
private Servi... | Yes, it is possible that you could run into synchronization issues if multiple threads are calling the `get()` method concurrently. This is because the `service` field may be accessed and modified simultaneously by different threads, leading to a race condition.
Here’s how the problem can occur:
1. Thread A checks if... | 25,480 | [
{
"from": "human",
"value": "Let's say I have a class in my web app called class \"Foo\". It has an initialise() method that is called when the bean is created using Spring. The initialise() method then tries to load an external service and assign it to a field. If the service could not be contacted, the... |
What's a simple/easy way to access the system clock using Java, so that I can calculate the elapsed time of an event?
| In Java, you can use the `System.currentTimeMillis()` or `System.nanoTime()` methods to access the system clock for measuring elapsed time. Here's a simple way to do it:
### Using `System.currentTimeMillis()`
This method returns the current time in milliseconds since the epoch (January 1, 1970, 00:00:00 GMT). It is g... | 26,806 | [
{
"from": "human",
"value": "What's a simple/easy way to access the system clock using Java, so that I can calculate the elapsed time of an event?\n"
},
{
"from": "gpt",
"value": "In Java, you can use the `System.currentTimeMillis()` or `System.nanoTime()` methods to access the system clock for ... |
I used the command line "arp -s IP MAC" command to set a static ARP entry on Windows Server 2003. When I ran "arp -a" it was there as a "static" entry. When I restart, it is gone. Is there some file somewhere like lmhosts where I can make this absolutely permanent?
Thanks!
| On Windows systems, including Windows Server 2003, static ARP entries set with the `arp -s` command are not persistent across reboots. Unfortunately, there is no built-in way in Windows to create permanent ARP entries like you can with `lmhosts` for hostnames.
However, you can create a simple workaround to re-add the ... | 27,031 | [
{
"from": "human",
"value": "I used the command line \"arp -s IP MAC\" command to set a static ARP entry on Windows Server 2003. When I ran \"arp -a\" it was there as a \"static\" entry. When I restart, it is gone. Is there some file somewhere like lmhosts where I can make this absolutely permanent?\nThanks... |
What are the alternative "design methods" to the Model View Controller? MVC seems to be popular (SO was built with it, I know that much) but is it the only method used?
| Model View Controller (MVC) is indeed a popular design pattern for organizing code in applications, especially web applications. However, there are several other design patterns and architectural methods that can be used as alternatives or in conjunction with MVC. Here are some of the most notable ones:
1. **Model Vie... | 22,442 | [
{
"from": "human",
"value": "What are the alternative \"design methods\" to the Model View Controller? MVC seems to be popular (SO was built with it, I know that much) but is it the only method used?\n"
},
{
"from": "gpt",
"value": "Model View Controller (MVC) is indeed a popular design pattern ... |
I have roughly the following code. Could this be made nicer or more efficient? Perhaps using std::remove_if? Can you remove items from the map while traversing it? Can we avoid using the temporary map?
typedef std::map<Action, What> Actions;
static Actions _actions;
bool expired(const Actions::value_type &action)
{
... | Certainly! Let's address your questions regarding improving the code. Here's a summary of improvements we can consider:
1. **Using `std::remove_if`:** While `std::remove_if` is a good way to remove items from containers, it doesn't work directly with `std::map` because it doesn't have a contiguous memory layout (like ... | 27,668 | [
{
"from": "human",
"value": "I have roughly the following code. Could this be made nicer or more efficient? Perhaps using std::remove_if? Can you remove items from the map while traversing it? Can we avoid using the temporary map?\ntypedef std::map<Action, What> Actions;\nstatic Actions _actions;\n\nbool ex... |
I would like to be able to fetch a web page's html and save it to a String, so I can do some processing on it. Also, how could I handle various types of compression.
How would I go about doing that using Java?
| You can fetch a web page's HTML and handle various types of compression using Java's `HttpURLConnection` or an HTTP client library like Apache HttpClient. Below, I'll outline how you can accomplish this using both methods, focusing on handling common compression types like Gzip and Deflate.
### Using HttpURLConnection... | 24,302 | [
{
"from": "human",
"value": "I would like to be able to fetch a web page's html and save it to a String, so I can do some processing on it. Also, how could I handle various types of compression.\nHow would I go about doing that using Java?\n"
},
{
"from": "gpt",
"value": "You can fetch a web pa... |
It turns out install shield doesn't support file download resuming.
Is there a .net component that provides this functionality?
| Yes, there are several .NET libraries and components that can help you implement file download resuming functionality. Here are some options you might consider:
1. **HttpClient**:
The `HttpClient` class in .NET can be used to implement resumable downloads manually. You can specify the `Range` header to request only... | 27,822 | [
{
"from": "human",
"value": "It turns out install shield doesn't support file download resuming.\nIs there a .net component that provides this functionality?\n"
},
{
"from": "gpt",
"value": "Yes, there are several .NET libraries and components that can help you implement file download resuming f... |
The code-complete feature in Visual Studio is very useful, and it still works for C# and C++ code - but no longer works for XAML (XML) editing.
Is there a setting somewhere that can re-enable this? My co-workers still have it working.
| If you're experiencing issues with IntelliSense or the code-complete feature not working for XAML in Visual Studio, there are a few steps you can take to troubleshoot and possibly re-enable it. Here are some suggestions:
1. **Check Visual Studio Extensions**: Sometimes, extensions can interfere with IntelliSense funct... | 27,405 | [
{
"from": "human",
"value": "The code-complete feature in Visual Studio is very useful, and it still works for C# and C++ code - but no longer works for XAML (XML) editing.\nIs there a setting somewhere that can re-enable this? My co-workers still have it working.\n"
},
{
"from": "gpt",
"value"... |
I know about the HIG (which is quite handy!), but what programming practices do you use when writing Objective-C, and more specifically when using Cocoa (or CocoaTouch).
| When programming in Objective-C, especially when using Cocoa (for macOS) or Cocoa Touch (for iOS), there are several best practices that can help you write clean, efficient, and maintainable code. Here are some important programming practices to consider:
### 1. **Use Objective-C Naming Conventions:**
- Class names... | 22,398 | [
{
"from": "human",
"value": "I know about the HIG (which is quite handy!), but what programming practices do you use when writing Objective-C, and more specifically when using Cocoa (or CocoaTouch).\n"
},
{
"from": "gpt",
"value": "When programming in Objective-C, especially when using Cocoa (fo... |
I have a table with columns
Index, Date
where an Index may have multiple Dates, and my goal is the following: select a list that looks like
Index, MinDate, MaxDate
where each Index is listed only once, and MinDate (MaxDate) represents the earliest (latest) date present in the entire table for that index. That's ea... | Certainly! Your query can be optimized by reducing the number of subqueries and using joins instead, which can improve performance. In SQL Server, using a join can help the query optimizer create a more efficient execution plan. Here's an alternative approach using a join:
```sql
SELECT
t.Index,
MIN(t.Date) A... | 29,735 | [
{
"from": "human",
"value": "I have a table with columns\n\nIndex, Date\n\nwhere an Index may have multiple Dates, and my goal is the following: select a list that looks like\n\nIndex, MinDate, MaxDate\n\nwhere each Index is listed only once, and MinDate (MaxDate) represents the earliest (latest) date prese... |
When I try to install the Reporting Services on a second node of a failover cluster, I get the following error message:
Existing clustered or cluster-prepared instance failed. The instance selected for installation is already installed and clustered on node 2.
But, we never installed it before. Does anyone have any... | The error message you're encountering suggests that the installation process is detecting an existing clustered instance of SQL Server Reporting Services on the second node of the failover cluster, even though you believe it has not been installed there previously. Here are some steps to troubleshoot and resolve this i... | 27,255 | [
{
"from": "human",
"value": "When I try to install the Reporting Services on a second node of a failover cluster, I get the following error message:\nExisting clustered or cluster-prepared instance failed. The instance selected for installation is already installed and clustered on node 2. \nBut, we never... |
I'm getting lost in pointer land, I believe. I've got this (code syntax might be a little off, I am not looking at the machine with this code on it...but all the pertinent details are correct):
NSMutableArray *tmp = [[NSMutableArray alloc] init];
I them pass that to a routine in another class
- (BOOL)myRoutine: (NSMu... | It sounds like you are experiencing a common issue when dealing with pointers and object mutability in Objective-C. When you pass an `NSMutableArray` to a method and modify it inside that method, the changes should reflect outside the method as long as you are modifying the same instance. However, if you reassign the p... | 24,596 | [
{
"from": "human",
"value": "I'm getting lost in pointer land, I believe. I've got this (code syntax might be a little off, I am not looking at the machine with this code on it...but all the pertinent details are correct):\nNSMutableArray *tmp = [[NSMutableArray alloc] init];\n\nI them pass that to a routi... |
I know you can just use CSS to hide the DIV or Silverlight Plugin, but is there a way to instantiate a Silverlight Component/App using JavaScript that doesn't show any UI element at all?
There is alot of great functionality in Silverlight, like MultiThreading and compiled code, that could be utilized by traditional Aja... | Yes, it is possible to instantiate a Silverlight application without displaying its UI components. While Silverlight is designed primarily for rich interactive applications, you can run the logic in the background and keep the UI hidden from the user. Here’s how you can achieve this:
### 1. Create a Silverlight Applic... | 23,205 | [
{
"from": "human",
"value": "I know you can just use CSS to hide the DIV or Silverlight Plugin, but is there a way to instantiate a Silverlight Component/App using JavaScript that doesn't show any UI element at all?\nThere is alot of great functionality in Silverlight, like MultiThreading and compiled code,... |
I know that IntelliJ has an option to select all the code in a JSP file, right click, and select "format". This nicely formats all HTML, CSS, scriptlets and JSTL tags in a JSP file.
Can Eclipse do this?
If not, what is the best free Eclipse plugin that does the same?
| Yes, Eclipse has the capability to format JSP files natively, but it might not be as comprehensive as IntelliJ's formatting options for all JSP components (like HTML, CSS, scriptlets, and JSTL tags).
### Native Formatting in Eclipse
1. **Format JSP File**: You can select all the code in a JSP file and use the `Source... | 26,662 | [
{
"from": "human",
"value": "I know that IntelliJ has an option to select all the code in a JSP file, right click, and select \"format\". This nicely formats all HTML, CSS, scriptlets and JSTL tags in a JSP file. \nCan Eclipse do this? \nIf not, what is the best free Eclipse plugin that does the same? \n"
... |
We're moving to cheap office space that provides a lot of stuff: receptionist, copiers, printers, microwave and internet access - all of it shared with strangers.
What should I ask to find out if the network is safe to use, and if it's not inherently safe, what can I do to make it safe?
| When considering the safety of a shared office network, it's important to ask specific questions and take certain steps to ensure your data remains secure. Here are some key questions to ask, followed by steps to enhance security if the network is not inherently safe.
### Questions to Ask:
1. **What type of internet ... | 24,994 | [
{
"from": "human",
"value": "We're moving to cheap office space that provides a lot of stuff: receptionist, copiers, printers, microwave and internet access - all of it shared with strangers.\nWhat should I ask to find out if the network is safe to use, and if it's not inherently safe, what can I do to make... |
I'm working with jQuery for the first time and need some help. I have html that looks like the following:
<div id='comment-8' class='comment'>
<p>Blah blah</p>
<div class='tools'></div>
</div>
<div id='comment-9' class='comment'>
<p>Blah blah something else</p>
<div class='tools'></div>
</div>
I'm try... | Hi Brian,
You're on the right track with using jQuery to create spans and bind click events to them. To pass the `commentId` to the `doSomething` function, you can leverage the `data` attributes or use the `closest` method to find the parent comment's ID when the span is clicked. Here's how you can accomplish that:
#... | 22,385 | [
{
"from": "human",
"value": "I'm working with jQuery for the first time and need some help. I have html that looks like the following:\n<div id='comment-8' class='comment'>\n <p>Blah blah</p>\n <div class='tools'></div>\n</div>\n\n<div id='comment-9' class='comment'>\n <p>Blah blah something else</... |
What's the easiest way to increase or decrease indentation for a large block of code in vi?
| In `vi` or `vim`, you can easily adjust the indentation for a large block of code using visual mode. Here are the steps to increase or decrease indentation:
### To Increase Indentation
1. **Open the File**: Start by opening the file in `vi` or `vim`.
```bash
vi filename
```
2. **Select the Block of Code**:
... | 26,078 | [
{
"from": "human",
"value": "What's the easiest way to increase or decrease indentation for a large block of code in vi?\n"
},
{
"from": "gpt",
"value": "In `vi` or `vim`, you can easily adjust the indentation for a large block of code using visual mode. Here are the steps to increase or decreas... |
Difficult question. The answer is probably no, if all I found in the Intertubes is right, but it is worth a try. I need to override the Ctrl + Shift + Esc and the Ctrl + Esc combinations. It would be good to be able to override the Win key combinations, but I have a low level hook that does such, I only wish I didn't n... | Overriding keyboard shortcuts like Ctrl + Shift + Esc (which opens Task Manager) and Ctrl + Esc (which opens the Start Menu) at the operating system level is generally not straightforward and can involve several approaches, depending on your specific requirements and environment. Here are some methods you can consider,... | 23,445 | [
{
"from": "human",
"value": "Difficult question. The answer is probably no, if all I found in the Intertubes is right, but it is worth a try. I need to override the Ctrl + Shift + Esc and the Ctrl + Esc combinations. It would be good to be able to override the Win key combinations, but I have a low level ho... |
I'm looking at maybe moving from an older AMD64 to a new Intel dual-core which is 32 bit. Installation isn't a problem but can I transfer all the installed apps? I haven't been
able to find anything so far on Google except where the migration is to a similar platform and file-system. I won't change the filesystem but t... | Transferring installed applications from an AMD64 architecture to a new Intel dual-core 32-bit architecture can be challenging due to the differences in architecture and the way software is compiled. Here's a breakdown of what you need to consider:
1. **Different Architectures**: The AMD64 architecture is 64-bit, whil... | 25,948 | [
{
"from": "human",
"value": "I'm looking at maybe moving from an older AMD64 to a new Intel dual-core which is 32 bit. Installation isn't a problem but can I transfer all the installed apps? I haven't been\nable to find anything so far on Google except where the migration is to a similar platform and file-s... |
I'm currently creating a website for a client that will basically involve selling various files. This is obviously a really common thing to do, which is making me feel kind of foolish for not thinking of a method for doing it.
Once the purchase has been made the customer should be taken to a page containing the downloa... | It's great that you're thinking about security and protecting your files while building a website for your client. There are several methods you can use to obscure the location of the files and prevent unauthorized access. Here’s a breakdown of the steps you can take:
### 1. **Use Secure Download Links**
Instead of p... | 23,067 | [
{
"from": "human",
"value": "I'm currently creating a website for a client that will basically involve selling various files. This is obviously a really common thing to do, which is making me feel kind of foolish for not thinking of a method for doing it.\nOnce the purchase has been made the customer should... |
I have implemented a YUV to RGB conversion via a fragment shader written in Nvidia's shader language. (Y, U and V are stored in separate textures that are combined via multi texturing in my fragment shader). It works great under OpenGL, but under Direct3D I just can't get the output image to look right. I'm starting to... | When transitioning from OpenGL to Direct3D, there are several factors that could affect how your textures are read and processed. Here are some considerations and possible solutions that could help you ensure that the YUV to RGB conversion works correctly in Direct3D:
1. **Texture Format and Storage**: Ensure that the... | 22,301 | [
{
"from": "human",
"value": "I have implemented a YUV to RGB conversion via a fragment shader written in Nvidia's shader language. (Y, U and V are stored in separate textures that are combined via multi texturing in my fragment shader). It works great under OpenGL, but under Direct3D I just can't get the ou... |
I want to know how does the SQL Server know what @p# is in say this LINQtoSQL query
SELECT
[t0].[MemberID], [t0].[Aspnetusername], [t0].[Aspnetpassword],
[t0].[EmailAddr], [t0].[DateCreated], [t0].[Location],
[t0].[DaimokuGoal], [t0].[PreviewImageID],
[t0].[LastDaimoku] AS [LastDaimoku], [t0].[LastN... | In SQL Server, the `@p#` notation (like `@p0`, `@p1`, etc.) refers to parameterized queries, which are a way to safely pass values into SQL commands without directly embedding those values in the query string. This mechanism is a part of the way ADO.NET and LINQ to SQL interact with the SQL Server database.
When you r... | 28,287 | [
{
"from": "human",
"value": "I want to know how does the SQL Server know what @p# is in say this LINQtoSQL query\nSELECT \n [t0].[MemberID], [t0].[Aspnetusername], [t0].[Aspnetpassword], \n [t0].[EmailAddr], [t0].[DateCreated], [t0].[Location], \n [t0].[DaimokuGoal], [t0].[PreviewImageID], \n [t... |
Assuming Visual C/C++ 6, I have a complex data structure of 22399 elements that looks like this:
{
{ "(SAME", "AS", "U+4E18)", "HILLOCK", "OR", "MOUND"},
{ "TO", "LICK;", {1, 1, 0}, "TASTE,", "A", "MAT,", "BAMBOO", "BARK"},
{ "(J)", "NON-STANDARD", "FORM", "OF", "U+559C", ",", {1, 1, 0}, "LIKE,", "LOVE,", "ENJOY;", {1,... | In order to properly declare and manage a complex data structure like the one you've described in Visual C/C++ 6, you should consider using a struct to encapsulate the various types of data you have (i.e., strings and triplet arrays). Since the number of elements in each entry varies, a dynamic data structure, such as ... | 20,968 | [
{
"from": "human",
"value": "Assuming Visual C/C++ 6, I have a complex data structure of 22399 elements that looks like this:\n{\n{ \"(SAME\", \"AS\", \"U+4E18)\", \"HILLOCK\", \"OR\", \"MOUND\"},\n{ \"TO\", \"LICK;\", {1, 1, 0}, \"TASTE,\", \"A\", \"MAT,\", \"BAMBOO\", \"BARK\"},\n{ \"(J)\", \"NON-STANDARD... |
As far as I've gathered (read: measured), building the configuration and the sessionfactory by far takes the most time in executing a query using nhibernate. Is there anything against making the sessionfactory static, so it will only be configured once per appDomain?
I know there are locking and racing issues when usin... | Making the `SessionFactory` static in NHibernate is a common and recommended practice for several reasons. The `SessionFactory` is designed to be a heavy and expensive object to create, and its primary purpose is to provide sessions for accessing the database. By making it static, you ensure that it's initialized once ... | 22,335 | [
{
"from": "human",
"value": "As far as I've gathered (read: measured), building the configuration and the sessionfactory by far takes the most time in executing a query using nhibernate. Is there anything against making the sessionfactory static, so it will only be configured once per appDomain?\nI know the... |
I have a system in place which applies calculations to a set of numbers (the specifics aren't really relevant). There are a number of sets of calculations which can be applied by the system users and new sets are added frequently. Currently when a new set of calculations need to be added to the system they are added in... | To facilitate the dynamic addition of new calculation sets in your VB.NET and SQL Server application without needing to release new versions of the software, you can adopt a strategy that leverages external configuration and scripting, while ensuring safety and maintainability. Here's a step-by-step approach:
### 1. S... | 22,186 | [
{
"from": "human",
"value": "I have a system in place which applies calculations to a set of numbers (the specifics aren't really relevant). There are a number of sets of calculations which can be applied by the system users and new sets are added frequently. Currently when a new set of calculations need to... |
I'm in the process of developing a social network site.
And been thinking of scalability from day one of the project, I've fine tuned the site and queries to the best of my ability.
However; Certain pages are very data heavy and I'm not quite sure if they are loading as fast as they could so I was thinking of implement... | When developing a social network site, scalability and performance are indeed critical considerations, especially as user engagement and data complexity grow. Let's break down your questions regarding caching and page load times.
### Should You Implement Caching?
1. **What to Cache**:
- **Static Content**: Cache s... | 26,192 | [
{
"from": "human",
"value": "I'm in the process of developing a social network site.\nAnd been thinking of scalability from day one of the project, I've fine tuned the site and queries to the best of my ability.\nHowever; Certain pages are very data heavy and I'm not quite sure if they are loading as fast a... |
I am planning a PHP application that needs to store date/times in an MSSQL database. (For the curious, it is a calendar application.) What is the preferred format to store this information?
MSSQL has its own datetime data type, which works well in the database itself and is very readable. However, there aren't any MSSQ... | When deciding how to store date and time information in your MSSQL database for a PHP application, there are a few options to consider, each with its own pros and cons. Here's a detailed look at the approaches you've mentioned:
### Option 1: Use MSSQL `datetime` Data Type
**Pros:**
- Readable: The `datetime` data typ... | 23,629 | [
{
"from": "human",
"value": "I am planning a PHP application that needs to store date/times in an MSSQL database. (For the curious, it is a calendar application.) What is the preferred format to store this information?\nMSSQL has its own datetime data type, which works well in the database itself and is ver... |
Imagine you got an entity in the Google App Engine datastore, storing links for anonymous users.
You would like to perform the following SQL query, which is not supported:
SELECT DISTINCT user_hash FROM links
Instead you could use:
user = db.GqlQuery("SELECT user_hash FROM links")
How to use Python most efficiently ... | To achieve the functionality of retrieving distinct `user_hash` values from the `links` datastore in Google App Engine, you can retrieve all the `user_hash` values and then use Python's built-in capabilities to filter out duplicates and count the distinct results. Here’s how you can do this efficiently.
1. **Retrieve ... | 27,787 | [
{
"from": "human",
"value": "Imagine you got an entity in the Google App Engine datastore, storing links for anonymous users. \nYou would like to perform the following SQL query, which is not supported:\nSELECT DISTINCT user_hash FROM links\n\nInstead you could use:\nuser = db.GqlQuery(\"SELECT user_hash FR... |
Alright, I'm trying to read a comma delimited file and then put that into a ListView (or any grid, really). I have the delimiting part of the job taken care of, with the fields of the file being put into a multidimensional string array. The problem is trying to get it into the ListView.
It appears that there isn't a ... | In C#, you don't need to give your `ListViewItem` instances specific names. Instead, you can create each item dynamically and add it directly to the `ListView` or a similar control. Below is an example of how to populate a `ListView` from a two-dimensional string array that you've created by reading a CSV file.
Assumi... | 23,627 | [
{
"from": "human",
"value": "Alright, I'm trying to read a comma delimited file and then put that into a ListView (or any grid, really). I have the delimiting part of the job taken care of, with the fields of the file being put into a multidimensional string array. The problem is trying to get it into the... |
Is it possible to update IIS on Windows XP from 5.1 to 6?
If so how?
Thanks.
| IIS (Internet Information Services) 6.0 is not directly installable on Windows XP. IIS 6.0 is designed to run on Windows Server 2003. Therefore, you cannot upgrade IIS on Windows XP from version 5.1 to 6.0.
However, if you want to use IIS 6.0 features, you would need to upgrade your operating system to at least Window... | 26,516 | [
{
"from": "human",
"value": "Is it possible to update IIS on Windows XP from 5.1 to 6?\nIf so how?\nThanks.\n"
},
{
"from": "gpt",
"value": "IIS (Internet Information Services) 6.0 is not directly installable on Windows XP. IIS 6.0 is designed to run on Windows Server 2003. Therefore, you cannot... |
Can't figure out why I'm getting 'SQL Statement ignored' and 'ORA-01775: looping chain of synonyms' on line 52 of this stored procedure. Got any ideas?
CREATE OR REPLACE PACKAGE PURGE_LOG_BY_EVENT_DAYS AS
TYPE dual_cursorType IS REF CURSOR RETURN dual%ROWTYPE;
PROCEDURE log_master_by_event_days (event_id NUMBER,... | The `ORA-01775: looping chain of synonyms` error typically occurs when a SQL statement involves a chain of synonyms that lead back to one another, creating an infinite loop. This issue is generally not directly related to the SQL you provided but could stem from the way your database objects are defined and referenced.... | 28,546 | [
{
"from": "human",
"value": "Can't figure out why I'm getting 'SQL Statement ignored' and 'ORA-01775: looping chain of synonyms' on line 52 of this stored procedure. Got any ideas?\nCREATE OR REPLACE PACKAGE PURGE_LOG_BY_EVENT_DAYS AS\n\n TYPE dual_cursorType IS REF CURSOR RETURN dual%ROWTYPE;\n\n PROCED... |
I'm reading input in a C++ program. First some integers, then a string. When I try reading the string with getline(cin,stringname);, it doesn't read the line that the user types: instead, I get an empty line, from when the user pressed Enter after typing the integers.
cin>>track.day; //Int
cin>>track.seriesday; //Int
g... | When you're reading multiple types of input from `std::cin`, especially after reading integers using the `>>` operator, it often leaves a newline character in the input buffer. This is because the `>>` operator reads formatted input but does not consume the newline character that comes after the input when you press En... | 27,389 | [
{
"from": "human",
"value": "I'm reading input in a C++ program. First some integers, then a string. When I try reading the string with getline(cin,stringname);, it doesn't read the line that the user types: instead, I get an empty line, from when the user pressed Enter after typing the integers.\ncin>>trac... |
How can I find out if SP1 has been installed on a server which has .NET 3.5?
| To determine if Service Pack 1 (SP1) has been installed for .NET Framework 3.5 on a Windows server, you can use several methods. Here are a few effective approaches:
### Method 1: Check Windows Features
1. **Open Control Panel**: Go to the Control Panel.
2. **Programs and Features**: Click on "Programs" and then "Pro... | 25,076 | [
{
"from": "human",
"value": "How can I find out if SP1 has been installed on a server which has .NET 3.5?\n"
},
{
"from": "gpt",
"value": "To determine if Service Pack 1 (SP1) has been installed for .NET Framework 3.5 on a Windows server, you can use several methods. Here are a few effective app... |
I need to implement an OpenID Provider in .Net and wondered....Is there's any OpenSource code already written and available?
| Yes, there are several open-source implementations of OpenID Providers in .NET that you can leverage for your project. Here are a few options you might find helpful:
1. **DotNetOpenAuth**:
- GitHub: [DotNetOpenAuth](https://github.com/DotNetOpenAuth/DotNetOpenAuth)
- Description: While DotNetOpenAuth was more po... | 27,535 | [
{
"from": "human",
"value": "I need to implement an OpenID Provider in .Net and wondered....Is there's any OpenSource code already written and available?\n"
},
{
"from": "gpt",
"value": "Yes, there are several open-source implementations of OpenID Providers in .NET that you can leverage for your... |
I have to connect to a legacy DB which has a schema called "Financeiro".
I setup my database.yml to:
...
schema_search_path: Financeiro
...
when activerecord tries to find something I get the following error:
ActiveRecord::StatementInvalid: RuntimeError: ERROR C3F000 Mschema "financeiro" does not exist F.\src... | The issue you are encountering is related to how PostgreSQL handles schema names. PostgreSQL treats unquoted identifiers (like schema names) as case-insensitive and will automatically convert them to lowercase. So, when you specify `Financeiro` in your `database.yml`, it is being interpreted as `financeiro`.
To preser... | 30,168 | [
{
"from": "human",
"value": "I have to connect to a legacy DB which has a schema called \"Financeiro\".\nI setup my database.yml to:\n... \nschema_search_path: Financeiro \n... \n\nwhen activerecord tries to find something I get the following error:\n\nActiveRecord::StatementInvalid: RuntimeError: ERROR ... |
I want a function like GetCurrentThread which returns a TThread object of the current executing thread. I know there is a Win32 API call GetCurrentThread, but it returns the thread Id. If there is a possibility to get TThread object from that ID that's also fine.
| In Delphi, to retrieve the `TThread` object of the currently executing thread, you cannot directly use the `GetCurrentThread` function since it only returns the thread ID and not the `TThread` object. However, you can maintain a mapping of thread IDs to `TThread` instances within your application.
Here's an example of... | 21,510 | [
{
"from": "human",
"value": "I want a function like GetCurrentThread which returns a TThread object of the current executing thread. I know there is a Win32 API call GetCurrentThread, but it returns the thread Id. If there is a possibility to get TThread object from that ID that's also fine.\n"
},
{
... |
I have a class Animal and an interface it inherits from IAnimal.
@MappedSuperclass
public class Animal implements Serializable, IAnimal{...}.
@Entity
public class Jaguar extends Animal{...}
My first question is, do I need to annotate the interface?
I asked this because I am getting this error when I run my tests:
Er... | In JPA (Java Persistence API), when you're dealing with class hierarchies and interfaces, the way you model your entities and how they are recognized in JPQL (Java Persistence Query Language) queries can impact your code's functionality.
### Addressing Your Questions
1. **Do I need to annotate the interface?**
- N... | 27,444 | [
{
"from": "human",
"value": "I have a class Animal and an interface it inherits from IAnimal.\n@MappedSuperclass\npublic class Animal implements Serializable, IAnimal{...}.\n\n@Entity\npublic class Jaguar extends Animal{...}\n\nMy first question is, do I need to annotate the interface?\nI asked this because... |
How do you debug your SharePoint 2007 code? Since SharePoint runs on a remote server, and I'm developing on a windows xp machine (with the necessary .dll files copied into my GAC), I haven't had much luck with finding easy ways to debug. Breakpoints don't work, etc.
The best way I've come up with is to enable page tr... | Debugging SharePoint 2007 can be challenging, especially when developing on a remote server. Here are some more methods that you can use to improve your debugging process beyond page tracing:
1. **Attach to Process**: If you have Visual Studio installed on your development machine, you can set up remote debugging by a... | 25,489 | [
{
"from": "human",
"value": "How do you debug your SharePoint 2007 code? Since SharePoint runs on a remote server, and I'm developing on a windows xp machine (with the necessary .dll files copied into my GAC), I haven't had much luck with finding easy ways to debug. Breakpoints don't work, etc.\nThe best ... |
I have an application where 2 threads are running... Is there any certanty that when I change a global variable from one thread, the other will notice this change?
I don't have any syncronization or Mutual exclusion system in place... but should this code work all the time (imagine a global bool named dataUpdated):
Th... | In your application, you have two threads that are interacting with a shared global variable (`dataUpdated`). Without proper synchronization mechanisms (like mutexes, atomic operations, or memory barriers), there are several important issues to consider:
1. **Visibility of Changes Between Threads**: When one thread mo... | 25,218 | [
{
"from": "human",
"value": "I have an application where 2 threads are running... Is there any certanty that when I change a global variable from one thread, the other will notice this change? \nI don't have any syncronization or Mutual exclusion system in place... but should this code work all the time (im... |
I have a class on which I want to allow several (~20+) configuration options.
Each option turns on or off a piece of functionality, or otherwise alters operations.
To facilitate this, I coded a separate options class with default values. However, I had to litter my code with guard conditions to determine how methods sh... | It sounds like you're facing a common problem in software design: managing a large number of configuration options that lead to complex and hard-to-read code due to multiple guard clauses. This is often referred to as "configuration hell."
Here are some design patterns and techniques that can help simplify your code ... | 24,236 | [
{
"from": "human",
"value": "I have a class on which I want to allow several (~20+) configuration options.\nEach option turns on or off a piece of functionality, or otherwise alters operations.\nTo facilitate this, I coded a separate options class with default values. However, I had to litter my code with g... |
How does one setup DUnit Testing in a Midas/DataSnap project in Delphi 2006
Edit
How does one set up a Dunit Test into a TRemoteDataModule
The project wizard in Delphi 2006 does not work with TRemoteDataModule
| Setting up DUnit testing for a DataSnap project using `TRemoteDataModule` in Delphi 2006 requires a few steps, as there are some unique considerations when dealing with remote data modules. Below are the steps to set up DUnit testing in such a project.
### Step 1: Create a DataSnap Application
1. **Create a new DataS... | 25,254 | [
{
"from": "human",
"value": "How does one setup DUnit Testing in a Midas/DataSnap project in Delphi 2006 \nEdit \nHow does one set up a Dunit Test into a TRemoteDataModule \nThe project wizard in Delphi 2006 does not work with TRemoteDataModule \n"
},
{
"from": "gpt",
"value": "Setting up DUni... |
I'm trying to do the classic Insert/Update scenario where I need to update existing rows in a database or insert them if they are not there.
I've found a previous question on the subject, but it deals with stored procedures, which I'm not using. I'd like to just use plain SQL SELECT, INSERT and UPDATE statements, unle... | In your scenario where you want to perform an Insert/Update operation in SQL Server 2005 without using stored procedures or the MERGE statement, you have a couple of options.
### Option 1: Use Separate SELECT, UPDATE, and INSERT Statements
You can first perform a `SELECT` statement to check if the row exists, and bas... | 28,175 | [
{
"from": "human",
"value": "I'm trying to do the classic Insert/Update scenario where I need to update existing rows in a database or insert them if they are not there.\nI've found a previous question on the subject, but it deals with stored procedures, which I'm not using. I'd like to just use plain SQL ... |
It looks like I had a fundamental misunderstanding about C++ :<
I like the polymorphic container solution. Thank you SO, for bringing that to my attention :)
So, we have a need to create a relatively generic container type object. It also happens to encapsulate some business related logic. However, we need to store es... | Your scenario is a classic trade-off in C++ between the flexibility of polymorphism and the type safety and efficiency of templates. Let's break down your options and how to approach the design of your container.
### Option 1: Using Polymorphism with `void*`
While using `void*` might provide you with a flexible way t... | 20,612 | [
{
"from": "human",
"value": "It looks like I had a fundamental misunderstanding about C++ :<\nI like the polymorphic container solution. Thank you SO, for bringing that to my attention :)\n\nSo, we have a need to create a relatively generic container type object. It also happens to encapsulate some business... |
Here's my setup: a Mac, running OS X Tiger. Windows XP running in a virtual machine (Parallels). Windows XP has my Mac home directory mapped as a network drive.
I have two files in a directory of my Mac home directory:
foo.py
pass
test.py
import foo
If I run test.py from within my virtual machine by typing 'python ... | It sounds like you are experiencing a namespace issue due to the presence of the `pass` file in the same directory as `test.py` and `foo.py`. In Python, if there is a file named the same as a keyword (like `pass`), it may cause unexpected behavior, particularly with how modules and imports are resolved.
Here's a break... | 25,986 | [
{
"from": "human",
"value": "Here's my setup: a Mac, running OS X Tiger. Windows XP running in a virtual machine (Parallels). Windows XP has my Mac home directory mapped as a network drive.\nI have two files in a directory of my Mac home directory:\nfoo.py\npass\n\ntest.py\nimport foo\n\nIf I run test.py ... |
I work on a variety of projects using different languages and platforms. Parts of them I abstract out into their own separate projects, and I want to open some of these up to the public.
What gets me stuck is the christening.
So, does it matter? Should I just choose something and stick with it?
And if it does matter, w... | Choosing a name for your open-source project is indeed an important step, and it can impact the project's visibility and how it is perceived by potential users and contributors. Here are some considerations to help you make your decision:
### 1. Memorability vs. Descriptiveness
- **Memorable Names**: A cool-sounding n... | 28,182 | [
{
"from": "human",
"value": "I work on a variety of projects using different languages and platforms. Parts of them I abstract out into their own separate projects, and I want to open some of these up to the public.\nWhat gets me stuck is the christening.\nSo, does it matter? Should I just choose something ... |
I have a HQL query that can generate either an IList of results, or an IEnumerable of results.
However, I want it to return an array of the Entity that I'm selecting, what would be the best way of accomplishing that? I can either enumerate through it and build the array, or use CopyTo() a defined array.
Is there any b... | In HQL (Hibernate Query Language), when you're executing a query and you want to convert the results to an array of the selected entity type, your approach using `CopyTo` is indeed a valid way to accomplish this. However, if you're looking for other options that might be more concise or elegant, here are a couple of al... | 28,245 | [
{
"from": "human",
"value": "I have a HQL query that can generate either an IList of results, or an IEnumerable of results. \nHowever, I want it to return an array of the Entity that I'm selecting, what would be the best way of accomplishing that? I can either enumerate through it and build the array, or us... |
So I know that autocommit commits every sql statement, but do updates to the database go directly to the disk or do they remain on cache until flushed?
I realize it's dependent on the database implementation.
Does auto-commit mean
a) every statement is a complete transaction AND it goes straight to disk or
b) every... | You're correct that the behavior of the autocommit feature can vary depending on the database implementation, but let's clarify the general principles.
### Autocommit
When autocommit is enabled (which is often the default setting in many relational database management systems), each individual SQL statement is treate... | 27,457 | [
{
"from": "human",
"value": "So I know that autocommit commits every sql statement, but do updates to the database go directly to the disk or do they remain on cache until flushed? \nI realize it's dependent on the database implementation.\nDoes auto-commit mean \na) every statement is a complete transacti... |
In a Silverlight application I'm trying to find out when a property on a usercontrol has changed. I'm interested in one particular DependencyProperty, but unfortunately the control itself doesn't implement INotifyPropertyChanged.
Is there any other way of determining if the value has changed?
| In Silverlight, if you're dealing with a `DependencyProperty` on a user control, you can utilize the `PropertyChangedCallback` feature that is inherent to `DependencyProperties`. This allows you to respond to changes of a specific property without needing the control to implement `INotifyPropertyChanged`.
Here’s how y... | 27,265 | [
{
"from": "human",
"value": "In a Silverlight application I'm trying to find out when a property on a usercontrol has changed. I'm interested in one particular DependencyProperty, but unfortunately the control itself doesn't implement INotifyPropertyChanged.\nIs there any other way of determining if the val... |
I'm occasionaly getting the following popup from an AJAX.NET application
Sys.WebForms.PageRequestManagerServerErrorException: An Unknown error occurred while processing the request on the server. The status code returned from the server was: 12031
From the Microsoft kb that status code indicates a ERROR_INTERNET_CONNEC... | To troubleshoot and log the underlying error that caused the `Sys.WebForms.PageRequestManagerServerErrorException` and the associated status code `12031` (ERROR_INTERNET_CONNECTION_RESET), you can follow several steps. Here’s a structured approach to help you diagnose the issue:
### 1. **Enable ASP.NET Tracing**
Enabl... | 26,528 | [
{
"from": "human",
"value": "I'm occasionaly getting the following popup from an AJAX.NET application\nSys.WebForms.PageRequestManagerServerErrorException: An Unknown error occurred while processing the request on the server. The status code returned from the server was: 12031\nFrom the Microsoft kb that st... |
For example for the following XML
<Order>
<Phone>1254</Phone>
<City>City1</City>
<State>State</State>
</Order>
I might want to find out whether the XElement contains "City" Node or not.
| To check whether an `XElement` contains a specific node, such as the "City" node in your XML example, you can use LINQ to XML in C#. Below is a code example that demonstrates how to achieve this.
```csharp
using System;
using System.Xml.Linq;
class Program
{
static void Main()
{
string xmlString = @"
... | 27,047 | [
{
"from": "human",
"value": "For example for the following XML\n <Order>\n <Phone>1254</Phone>\n <City>City1</City>\n <State>State</State>\n </Order>\n\nI might want to find out whether the XElement contains \"City\" Node or not. \n"
},
{
"from": "gpt",
"value": "To check whether an `XElement... |
Is there any way instead of a JS hack where I can post from an iframe to another page outside the iframe?
the iframe is posting data to a 3rd party and then just responding back with a URL which is the redirection URl thus we cannot set the form target. We are PCI compliant and thus we cannot use window.parent.location... | If you need to post data from an iframe to another page outside of that iframe without using JavaScript hacks, and you're constrained by PCI compliance, your options are somewhat limited due to security restrictions in modern web browsers designed to prevent cross-origin attacks.
However, here are some potential solut... | 26,334 | [
{
"from": "human",
"value": "Is there any way instead of a JS hack where I can post from an iframe to another page outside the iframe?\nthe iframe is posting data to a 3rd party and then just responding back with a URL which is the redirection URl thus we cannot set the form target. We are PCI compliant and... |
I am working in Java on a fairly large project. My question is about how to best structure the set of Properties for my application.
Approach 1: Have some static Properties object that's accessible by every class. (Disadvantages: then, some classes lose their generality should they be taken out of the context of the... | You've identified two common approaches to managing configuration properties in a Java application, and both have their pros and cons. Here are some considerations and suggestions that can help you determine the best structure for your specific use case:
### Approach 1: Static Properties Object
#### Pros:
- Easy acce... | 25,354 | [
{
"from": "human",
"value": "I am working in Java on a fairly large project. My question is about how to best structure the set of Properties for my application.\nApproach 1: Have some static Properties object that's accessible by every class. (Disadvantages: then, some classes lose their generality shou... |
In reading about Perl 6, I see a feature being trumpeted about, where you no longer have to do:
return "0 but true";
...but can instead do:
return 0 but True;
If that's the case, how does truth work in Perl 6? In Perl 5, it was pretty simple: 0, "", and undef are false, everything else is true.
What are the rules in ... | Perl 6, now known as Raku, has a more nuanced approach to truthiness and falsiness compared to Perl 5. In Raku, the concept of truthiness is defined through a combination of `Bool` and the value of objects.
Here's how truth works in Raku:
1. **True and False**: Raku defines `True` and `False` as distinct values of th... | 25,070 | [
{
"from": "human",
"value": "In reading about Perl 6, I see a feature being trumpeted about, where you no longer have to do:\nreturn \"0 but true\";\n\n...but can instead do:\nreturn 0 but True;\n\nIf that's the case, how does truth work in Perl 6? In Perl 5, it was pretty simple: 0, \"\", and undef are fal... |
I have a simple HTML upload form, and I want to specify a default extension ("*.drp" for example). I've read that the way to do this is through the ACCEPT attribute of the input tag, but I don't know how exactly.
<form enctype="multipart/form-data" action="uploader.php" method="POST">
Upload DRP File:
<input name="Uplo... | To specify a default extension for file uploads and restrict the file types that users can select in the file dialog, you can use the `accept` attribute in the `<input>` tag. However, the correct syntax for specifying file extensions in the `accept` attribute does not include the asterisk (`*`). Instead, you should sim... | 29,328 | [
{
"from": "human",
"value": "I have a simple HTML upload form, and I want to specify a default extension (\"*.drp\" for example). I've read that the way to do this is through the ACCEPT attribute of the input tag, but I don't know how exactly.\n<form enctype=\"multipart/form-data\" action=\"uploader.php\" m... |
It seems the ObservableCollection only support add, remove, clear operation from the UI thread, It throw Not Support Exception if it is operated by a NO UI thread. I tried to override methods of ObservableCollection, unfortunatly, I met lots of problems.
Any one can provide me a ObservableCollection sample which can be... | To enable an `ObservableCollection` to be modified safely from multiple threads, you need to implement your own thread-safe version of the collection. This can be achieved by wrapping the `ObservableCollection` with a locking mechanism to prevent concurrent access issues. Below is a sample implementation of a `ThreadSa... | 21,095 | [
{
"from": "human",
"value": "It seems the ObservableCollection only support add, remove, clear operation from the UI thread, It throw Not Support Exception if it is operated by a NO UI thread. I tried to override methods of ObservableCollection, unfortunatly, I met lots of problems.\nAny one can provide me ... |
I'm a jQuery novice, so the answer to this may be quite simple:
I have an image, and I would like to do several things with it.
When a user clicks on a 'Zoom' icon, I'm running the 'imagetool' plugin (http://code.google.com/p/jquery-imagetool/) to load a larger version of the image. The plugin creates a new div around ... | You're on the right track in understanding the issue; it does indeed relate to how jQuery handles DOM elements after they have been replaced. When you replace the `#productImage` with a new image, the imagetool plugin doesn't know about the new image that has been added to the DOM.
### Suggested Solution:
You need to... | 24,829 | [
{
"from": "human",
"value": "I'm a jQuery novice, so the answer to this may be quite simple:\nI have an image, and I would like to do several things with it.\nWhen a user clicks on a 'Zoom' icon, I'm running the 'imagetool' plugin (http://code.google.com/p/jquery-imagetool/) to load a larger version of the ... |
From a HTML application (.hta file), you can drag any image and drop it into the desktop for example.
Does anybody know how to disable this capability?
I want the .hta files to have the same behavior as the .html files.
| To disable drag-and-drop functionality in an HTA (HTML Application) file, you can prevent the default drag-and-drop events from occurring. This involves capturing the relevant events and calling `preventDefault()` on them.
Here's an example of how you can achieve this:
```html
<!DOCTYPE html>
<html>
<head>
<title... | 26,266 | [
{
"from": "human",
"value": "From a HTML application (.hta file), you can drag any image and drop it into the desktop for example.\nDoes anybody know how to disable this capability?\nI want the .hta files to have the same behavior as the .html files.\n"
},
{
"from": "gpt",
"value": "To disable d... |
Most developers and engineers that have experience writing software and deploying with the packaged Visual Studio Setup Project know about its many shortcomings. Usually in regards to installation customization, upgrade paths, etc. What are some good alternatives for software deployment? In particular I'm interested in... | There are several alternatives to the Visual Studio Setup Project for software deployment, each with its own set of features, capabilities, and pricing structures. Here are some of the most notable options:
### 1. **WiX Toolset**
- **Features**: WiX (Windows Installer XML) allows you to create Windows installation pac... | 21,865 | [
{
"from": "human",
"value": "Most developers and engineers that have experience writing software and deploying with the packaged Visual Studio Setup Project know about its many shortcomings. Usually in regards to installation customization, upgrade paths, etc. What are some good alternatives for software de... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.