instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I'm trying to do some custom UI behavior on a Windows Forms PropertyGrid control. I'd like to be able to respond to clicks and double-clicks on the GridItems to change the state. For example, to flip a binary or ternary variable through its states.
I can get at the underlying view by looking up a child of typename "Pro... | Working with the `PropertyGrid` control in Windows Forms to achieve custom behavior can be quite tricky, especially since it doesn't provide straightforward access to the underlying grid items for handling custom interactions like clicks or double-clicks. However, there are ways to implement the behavior you want witho... | 14,721 | [
{
"from": "human",
"value": "I'm trying to do some custom UI behavior on a Windows Forms PropertyGrid control. I'd like to be able to respond to clicks and double-clicks on the GridItems to change the state. For example, to flip a binary or ternary variable through its states.\nI can get at the underlying v... |
Is there any good book or material which covers C# unit testing using mocks in depth?
| Yes, there are several excellent resources available that cover C# unit testing with mocks in depth. Here are some recommended books and materials:
### Books:
1. **"The Art of Unit Testing" by Roy Osherove**
- This book provides a solid foundation for unit testing in .NET, including the use of mocking frameworks. I... | 21,614 | [
{
"from": "human",
"value": "Is there any good book or material which covers C# unit testing using mocks in depth?\n"
},
{
"from": "gpt",
"value": "Yes, there are several excellent resources available that cover C# unit testing with mocks in depth. Here are some recommended books and materials:\... |
Our web application renders fast in some IE browsers, slow in others... It seems to be an HTML rendering problem... The first 10% of the page displays immediately, the last 90% takes up to 10 seconds, and this is static content. I've run with firefox/yslow, renders very quickly. Seems to be isolated to some users/c... | It sounds like you're dealing with a frustrating issue with Internet Explorer (IE) rendering speed. Given that your application performs well in other browsers but has specific slowdowns in some versions of IE, there are several things you can investigate. Here are some suggestions and tools you can use to diagnose the... | 20,244 | [
{
"from": "human",
"value": "Our web application renders fast in some IE browsers, slow in others... It seems to be an HTML rendering problem... The first 10% of the page displays immediately, the last 90% takes up to 10 seconds, and this is static content. I've run with firefox/yslow, renders very quick... |
I'm in a 10 person team working on a large legacy code base with a less than ideal product owner. Our backlog is in pretty bad shape and large epics have frequently been breaking our sprints. The team also struggles with its definition of done - some members write unit test religiously, others don't, sometimes dependin... | It sounds like you're delving into the analysis of burndown charts, which can provide valuable insights into team performance and project health. Let's break down each pattern you presented, focusing on both positive and negative explanations, especially considering the context of your team's struggles.
### Pattern 1:... | 21,061 | [
{
"from": "human",
"value": "I'm in a 10 person team working on a large legacy code base with a less than ideal product owner. Our backlog is in pretty bad shape and large epics have frequently been breaking our sprints. The team also struggles with its definition of done - some members write unit test reli... |
I'm using the following code to loop through a directory to print out the names of the files. However, not all of the files are displayed. I have tried using clearstatcache with no effect.
$str = '';
$ignore = array('.', '..');
$dh = @opendir( $path );
if ($dh === FALSE)
{
// error
}
... | The issue you’re experiencing could be due to how the loop reads files from the directory. In your current implementation, the loop breaks when it encounters a file that matches the entries in the `$ignore` array. However, you should actually continue looping through the directory instead of breaking the loop.
Here's... | 22,089 | [
{
"from": "human",
"value": "I'm using the following code to loop through a directory to print out the names of the files. However, not all of the files are displayed. I have tried using clearstatcache with no effect.\n $str = '';\n $ignore = array('.', '..');\n\n $dh = @opendir( $path );\n if (... |
I have a C++ tool that walks the call stack at one point. In the code, it first gets a copy of the live CPU registers (via RtlCaptureContext()), then uses a few "#ifdef ..." blocks to save the CPU-specific register names into stackframe.AddrPC.Offset, ...AddrStack..., and ...AddrFrame...; also, for each of the 3 Addr.... | When dealing with the differences between x86 and x64 architectures, especially in the context of stack walking using `StackWalk64`, there are several considerations to take into account that could explain the issues you're facing. Here are some possible reasons for the problems you're encountering along with suggestio... | 16,808 | [
{
"from": "human",
"value": "I have a C++ tool that walks the call stack at one point. In the code, it first gets a copy of the live CPU registers (via RtlCaptureContext()), then uses a few \"#ifdef ...\" blocks to save the CPU-specific register names into stackframe.AddrPC.Offset, ...AddrStack..., and ...... |
Let's face it: writing proper, standards compliant HTML is quite difficult to do. Writing semantic HTML is even more so, but I don't think it's possible for a computer to figure that out.
So my question to you is what would the "ideal" feedback for a user who entered HTML be? Would it be a W3C validator style list of e... | Designing an ideal feedback system for users entering HTML is a nuanced challenge that balances technical accuracy with user experience. Here’s a breakdown of the optimal approach:
### 1. **Immediate Error Feedback**
- **Inline Validation:** As users type, provide real-time feedback. Highlight problematic lines or ... | 19,484 | [
{
"from": "human",
"value": "Let's face it: writing proper, standards compliant HTML is quite difficult to do. Writing semantic HTML is even more so, but I don't think it's possible for a computer to figure that out.\nSo my question to you is what would the \"ideal\" feedback for a user who entered HTML be?... |
Can someone provide an explanation of variable scope in JS as it applies to objects, functions and closures?
| Sure! Variable scope in JavaScript is a fundamental concept that determines the accessibility or visibility of variables in different parts of your code. It is crucial for understanding how objects, functions, and closures operate. Here’s a breakdown:
### 1. Global Scope
Variables defined in the global context (outsid... | 16,373 | [
{
"from": "human",
"value": "Can someone provide an explanation of variable scope in JS as it applies to objects, functions and closures? \n"
},
{
"from": "gpt",
"value": "Sure! Variable scope in JavaScript is a fundamental concept that determines the accessibility or visibility of variables in ... |
How do you concatenate bits in VHDL? I'm trying to use the following code:
Case b0 & b1 & b2 & b3 is
...
and it throws an error
Thanks
| In VHDL, you can concatenate bits using the `&` operator, but there are a few points to keep in mind, especially when you're using it within a `case` statement.
Here's how to concatenate bits correctly in VHDL, especially within a `case` statement:
1. Ensure that the concatenation results in a single type (for exampl... | 21,371 | [
{
"from": "human",
"value": "How do you concatenate bits in VHDL? I'm trying to use the following code:\nCase b0 & b1 & b2 & b3 is \n ...\nand it throws an error\nThanks\n"
},
{
"from": "gpt",
"value": "In VHDL, you can concatenate bits using the `&` operator, but there are a few points to keep ... |
When I use a ASP:Calendar control, and give it an ID:
<asp:Calendar runat="server" ID="MyCal" />
It looks like this in the rendered html:
<table id="NameMangled_MyCal"... />
And I can access the element by ID in javascript like this:
var cal= document.getElementById("<%= MyCal.ClientID%>")
However, When I make a custom... | The issue you're encountering is related to the structure of your user control and how the ASP.NET rendering engine handles IDs for controls inside of a user control.
When you create a user control (like `WeeklyEventsCalendar`), the user control itself is treated as a separate control. However, you need to ensure that... | 22,201 | [
{
"from": "human",
"value": "When I use a ASP:Calendar control, and give it an ID:\n<asp:Calendar runat=\"server\" ID=\"MyCal\" />\nIt looks like this in the rendered html:\n<table id=\"NameMangled_MyCal\"... />\nAnd I can access the element by ID in javascript like this:\nvar cal= document.getElementById(\... |
We want to show a hint for a JList that the user can select multiple items with the platform dependent key for multiselect.
However I have not found any way to show the OS X COMMAND symbol in a JLabel, which means the symbol that's printed on the apple keyboard on the command key, also called apple key.
Here's a pictu... | To display the Command symbol (⌘) in a `JLabel` in a platform-independent way, you can utilize Unicode characters directly. The Unicode for the Command symbol is `U+2318`, which corresponds to the string `"\u2318"` in Java.
Here is how you can implement this in your application:
1. Determine the key for multi-select ... | 22,789 | [
{
"from": "human",
"value": "We want to show a hint for a JList that the user can select multiple items with the platform dependent key for multiselect. \nHowever I have not found any way to show the OS X COMMAND symbol in a JLabel, which means the symbol that's printed on the apple keyboard on the command ... |
Before I begin, I want to clarify that this is not a command-line tool, but an application that accepts commands through it's own command-line interface.
Edit: I must apologize about my explanation from before, apparently I didn't do a very good job at explaining it. One more time...
I am building a command-line interf... | Your situation involves needing to handle user input from the command-line interface in a non-blocking way, while still being able to respond to signals to gracefully shut down your application. Here are some strategies you could consider to achieve this:
### 1. Use Non-Blocking Input
You can set up the terminal in a... | 19,196 | [
{
"from": "human",
"value": "Before I begin, I want to clarify that this is not a command-line tool, but an application that accepts commands through it's own command-line interface.\nEdit: I must apologize about my explanation from before, apparently I didn't do a very good job at explaining it. One more t... |
I'm considering integrating some D3D code I have with WPF via the new D3DImage as described
here:
My question is this: Do pixel shader's work on offscreen surfaces?
| Yes, pixel shaders can work on offscreen surfaces in Direct3D. When you're using Direct3D with WPF and integrating with `D3DImage`, you can create offscreen render targets (textures) and apply pixel shaders to them.
Here’s a high-level overview of how you can achieve this:
1. **Create an Offscreen Surface**: You can ... | 21,922 | [
{
"from": "human",
"value": "I'm considering integrating some D3D code I have with WPF via the new D3DImage as described \nhere:\nMy question is this: Do pixel shader's work on offscreen surfaces?\n"
},
{
"from": "gpt",
"value": "Yes, pixel shaders can work on offscreen surfaces in Direct3D. Whe... |
I'm wondering if it's possible to sandbox JavaScript running in the browser to prevent access to features that are normally available to JavaScript code running in an HTML page.
For example, let's say I want to provide a JavaScript API for end users to let them define event handlers to be run when "interesting events" ... | Sandboxing JavaScript in the browser to limit access to certain APIs or features while allowing user-defined event handlers is a challenging task. There are a few approaches you can consider, each with its own pros and cons.
### 1. **Using an Iframe with the `sandbox` Attribute**
One of the most straightforward ways t... | 18,849 | [
{
"from": "human",
"value": "I'm wondering if it's possible to sandbox JavaScript running in the browser to prevent access to features that are normally available to JavaScript code running in an HTML page.\nFor example, let's say I want to provide a JavaScript API for end users to let them define event han... |
In C++, on Linux, how can I write a function to return a temporary filename that I can then open for writing?
The filename should be as unique as possible, so that another process using the same function won't get the same name.
| In C++, on Linux, you can generate a unique temporary filename by using the `mkstemp` function, which safely creates a temporary file and returns a file descriptor. The function modifies a template string that includes a unique suffix. Here is an example of how to implement such a function:
```cpp
#include <iostream>
... | 20,739 | [
{
"from": "human",
"value": "In C++, on Linux, how can I write a function to return a temporary filename that I can then open for writing?\nThe filename should be as unique as possible, so that another process using the same function won't get the same name.\n"
},
{
"from": "gpt",
"value": "In C... |
What MySQL query will do a text search and replace in one particular field in a table?
I.e. search for foo and replace with bar so a record with a field with the value hello foo becomes hello bar.
| To perform a search and replace operation in a specific field in a MySQL table, you can use the `UPDATE` statement in conjunction with the `REPLACE` function. Here's how you can do it for your requirement to replace occurrences of "foo" with "bar" in a specific column.
Assuming you have a table named `your_table` and ... | 24,748 | [
{
"from": "human",
"value": "What MySQL query will do a text search and replace in one particular field in a table?\nI.e. search for foo and replace with bar so a record with a field with the value hello foo becomes hello bar.\n"
},
{
"from": "gpt",
"value": "To perform a search and replace oper... |
I've been hearing a lot about about how the new version of VMWare Fusion can run virtual operating systems in "headless mode".
A Google search makes it clear that other virtualisation products also have similar features, however, I have not been able to find a good description of what this actually means? What is happ... | Running virtual operating systems in "headless mode" refers to a mode of operation where the virtual machine (VM) runs without a graphical user interface (GUI). This means that you can operate the VM without having a visible window or desktop environment displayed on your host machine. Here’s a more detailed explanatio... | 15,301 | [
{
"from": "human",
"value": "I've been hearing a lot about about how the new version of VMWare Fusion can run virtual operating systems in \"headless mode\". \nA Google search makes it clear that other virtualisation products also have similar features, however, I have not been able to find a good descripti... |
When I open a file in eclipse it shows with the improper line spacing showing an extra line break between every line. When I open the file with notepad or wordpad it doesn't show these extra line breaks that only eclipse shows. How do I get eclipse to read these files like notepad and wordpad without those line breaks?... | The issue you're experiencing in Eclipse with extra line breaks may stem from differences in line ending formats or encoding between the files you edited and Eclipse's default settings. Here are steps to troubleshoot and resolve the issue:
### 1. Check Line Endings
Eclipse may be interpreting the line endings differen... | 19,848 | [
{
"from": "human",
"value": "When I open a file in eclipse it shows with the improper line spacing showing an extra line break between every line. When I open the file with notepad or wordpad it doesn't show these extra line breaks that only eclipse shows. How do I get eclipse to read these files like notep... |
I know the Html.Button has been moved to the Microsoft.Web.Mvc namespace, but I really miss the generic versions that used to exist in the early Previews.
All I want the Html.Button to do is to hit an action in my controller, but I'd rather not write the JavaScript in the onClickMethod argument.
In my previous project... | In the early previews of ASP.NET MVC, there were indeed some convenience methods for creating buttons that could be used to trigger actions in your controller. However, as the framework evolved, many of these methods were restructured or moved around, leading to the situation you're currently facing.
Since you want t... | 21,477 | [
{
"from": "human",
"value": "I know the Html.Button has been moved to the Microsoft.Web.Mvc namespace, but I really miss the generic versions that used to exist in the early Previews. \nAll I want the Html.Button to do is to hit an action in my controller, but I'd rather not write the JavaScript in the onCl... |
This confusion arises as most people are trained to evaluate arithmetic expressions as per PEDMAS or BODMAS rule whereas arithmetic expressions in programming languages like C# do not work in the same way.
What are your takes on it?
| The confusion between arithmetic operations in mathematics and their evaluation in programming languages like C# often stems from the different contexts in which they are used. Let's break down some of the key points regarding this topic:
### 1. **Order of Operations (PEDMAS/BODMAS) in Mathematics:**
- **PEDMAS/BODMAS... | 11,333 | [
{
"from": "human",
"value": "This confusion arises as most people are trained to evaluate arithmetic expressions as per PEDMAS or BODMAS rule whereas arithmetic expressions in programming languages like C# do not work in the same way.\nWhat are your takes on it?\n"
},
{
"from": "gpt",
"value": "... |
I have read the GOLD Homepage ( http://www.devincook.com/goldparser/ ) docs, FAQ and Wikipedia to find out what practical application there could possibly be for GOLD. I was thinking along the lines of having a programming language (easily) available to my systems such as ABAP on SAP or X++ on Axapta - but it doesn't l... | GOLD Parser is a tool designed for creating parsers that can interpret structured text input based on a defined grammar. It's primarily used in scenarios where you need to analyze and manipulate textual data according to specific syntax rules. Below are some practical applications, along with a detailed example to illu... | 20,220 | [
{
"from": "human",
"value": "I have read the GOLD Homepage ( http://www.devincook.com/goldparser/ ) docs, FAQ and Wikipedia to find out what practical application there could possibly be for GOLD. I was thinking along the lines of having a programming language (easily) available to my systems such as ABAP o... |
I downloaded Reflector.Net and it's an .Exe outside VS. I remember (last year) when I downloaded it, it was an Addin to VS. How can I make it back to an Addin?
| Reflector is a tool for .NET developers that was originally available as both a standalone application and a Visual Studio add-in. However, the original Reflector Add-in for Visual Studio was discontinued, and the current version is primarily a standalone application.
If you want to integrate Reflector more closely wi... | 23,430 | [
{
"from": "human",
"value": "I downloaded Reflector.Net and it's an .Exe outside VS. I remember (last year) when I downloaded it, it was an Addin to VS. How can I make it back to an Addin?\n"
},
{
"from": "gpt",
"value": "Reflector is a tool for .NET developers that was originally available as b... |
In a Linux embedded application I'm developing, there is the need to record some events that happen from time to time. These records are saved on a MTD flash device and once written there is no need to change them or do efficient searches, but read access is required to show the data back to the user.
A big problem is ... | For your requirements, it sounds like you are facing challenges with the robustness and reliability of the database system in a power-failure-prone environment. Given the constraints and your needs, here are a few suggestions to consider for implementing a more reliable solution:
### 1. **Use a More Robust Filesystem:... | 15,655 | [
{
"from": "human",
"value": "In a Linux embedded application I'm developing, there is the need to record some events that happen from time to time. These records are saved on a MTD flash device and once written there is no need to change them or do efficient searches, but read access is required to show the... |
I'm trying to override Ant compiler attributes via the command line so that all 'javac' tasks use my specified compiler.
The problem I've run into is that any target that sets its own value for compiler overrides the one that I set at the commmand line. So, even though I'm entering the following command.
ant -Dbuild.c... | In Apache Ant, when you specify a property on the command line (like `-Dbuild.compiler=mycompiler`), it sets the property, but any explicit attributes defined in the build file (like `compiler="modern"`) take precedence over the property unless they reference it.
If you want to ensure that the `javac` tasks use the c... | 24,572 | [
{
"from": "human",
"value": "I'm trying to override Ant compiler attributes via the command line so that all 'javac' tasks use my specified compiler.\nThe problem I've run into is that any target that sets its own value for compiler overrides the one that I set at the commmand line. So, even though I'm ent... |
Is there a Python module for converting wiki markup to other languages (e.g. HTML)?
A similar question was asked here, What's the easiest way to convert wiki markup to html, but no Python modules are mentioned.
Just curious. :) Cheers.
| Yes, there are several Python modules that can help convert wiki markup (such as MediaWiki markup) to other formats like HTML. Here are a few options:
1. **mwparserfromhell**:
- This is a powerful library that can parse MediaWiki markup. It allows you to manipulate the parse tree and convert it to various formats.
... | 22,099 | [
{
"from": "human",
"value": "Is there a Python module for converting wiki markup to other languages (e.g. HTML)?\nA similar question was asked here, What's the easiest way to convert wiki markup to html, but no Python modules are mentioned.\nJust curious. :) Cheers.\n"
},
{
"from": "gpt",
"value... |
This question is for C# 2.0 Winform.
For the moment I use checkboxes to select like this : Monday[x], Thuesday[x]¸... etc.
It works fine but is it a better way to get the day of the week? (Can have more than one day picked)
| Using checkboxes to select days of the week is a simple and straightforward approach in WinForms, but if you're looking for alternatives that might offer a more user-friendly experience, here are a few suggestions:
### 1. **ListBox with Multi-Select:**
You can use a `ListBox` that allows multiple selections. This prov... | 20,588 | [
{
"from": "human",
"value": "This question is for C# 2.0 Winform. \nFor the moment I use checkboxes to select like this : Monday[x], Thuesday[x]¸... etc. \nIt works fine but is it a better way to get the day of the week? (Can have more than one day picked)\n"
},
{
"from": "gpt",
"value": "Using... |
Maybe world peace would be easier, but I have a problem with the widths of auto generated columns when a DataGrid has no rows. The column headings all squeeze up with no spacing between them. I've tried adding the following CSS to no avail:
td.gridHeader
{
padding-left:20px;
padding-right: 20px;
}
| When dealing with issues related to spacing in the headers of an auto-generated DataGrid, particularly when there are no rows, you can try a few different approaches to ensure that the column headers maintain proper spacing and do not squeeze together. Here's a more comprehensive approach you could take:
### 1. CSS St... | 22,282 | [
{
"from": "human",
"value": "Maybe world peace would be easier, but I have a problem with the widths of auto generated columns when a DataGrid has no rows. The column headings all squeeze up with no spacing between them. I've tried adding the following CSS to no avail:\ntd.gridHeader\n{\n padding-left:20... |
We have a few operations where we are doing a large number of large string concatenations, and have recently encountered an out of memory exception. Unfortunately, debugging the code is not an option, as this is occurring at a customer site.
So, before looking into a overhaul of our code, I would like to ask: what i... | When considering the memory consumption characteristics of `StringBuilder` compared to standard strings in .NET (or similar languages), especially for large strings, here are some key points to keep in mind:
### Memory Allocation
1. **Immutable vs Mutable**:
- **Strings**: In languages like C# and Java, strings ar... | 19,125 | [
{
"from": "human",
"value": "We have a few operations where we are doing a large number of large string concatenations, and have recently encountered an out of memory exception. Unfortunately, debugging the code is not an option, as this is occurring at a customer site. \nSo, before looking into a overhau... |
I first encountered the concept of lazy registration the Ajax Patterns site, where they define it as accumulating "bits of information about the user as they interact, with formal registration occurring later on." I'm looking at doing something similar for my website, but I'd like to know a little bit more about best p... | Lazy registration is a compelling approach for web applications, especially in environments where reducing friction for users is crucial. Here are some best practices, considerations, and examples that can guide you in implementing lazy registration effectively:
### Best Practices for Implementing Lazy Registration
1... | 19,614 | [
{
"from": "human",
"value": "I first encountered the concept of lazy registration the Ajax Patterns site, where they define it as accumulating \"bits of information about the user as they interact, with formal registration occurring later on.\" I'm looking at doing something similar for my website, but I'd ... |
I know that Open Office Database uses a java database backend. Does anyone have any insight on how this compares to the Jet Database Engine?
Also is the query designer/reporting nearly as robust as MS Access?
| OpenOffice Base and Microsoft Access serve similar purposes as database management systems, but they differ significantly in terms of their underlying technology, capabilities, and features.
### Backend Database Engines
- **OpenOffice Base**: OpenOffice Base can work with various backends, including the built-in HSQLD... | 22,600 | [
{
"from": "human",
"value": "I know that Open Office Database uses a java database backend. Does anyone have any insight on how this compares to the Jet Database Engine? \nAlso is the query designer/reporting nearly as robust as MS Access?\n"
},
{
"from": "gpt",
"value": "OpenOffice Base and Mic... |
I can reset FPU's CTRL registers with this:
http://support.microsoft.com/kb/326219
But how can I save current registers, and restore them later?
It's from .net code..
What I'm doing, is from Delphi calling an .net dll as an COM module. Checking the Ctrl registers in delphi yield one value, checking with controlfp in th... | To save and restore the FPU control word in a .NET application, you can use the `ControlFP` function from the C runtime library, which allows you to manipulate the floating-point control word directly. You will want to do this in conjunction with P/Invoke to call these C functions from your .NET code.
Here's how you c... | 21,647 | [
{
"from": "human",
"value": "I can reset FPU's CTRL registers with this:\nhttp://support.microsoft.com/kb/326219\nBut how can I save current registers, and restore them later?\nIt's from .net code..\nWhat I'm doing, is from Delphi calling an .net dll as an COM module. Checking the Ctrl registers in delphi y... |
I'm looking at sessions in Django, and by default they are stored in the database. What are the benefits of filesystem and cache sessions and when should I use them?
| In Django, sessions can be stored in various backends, including the database (the default), filesystem, cache, and more. Each method has its own benefits and is suitable for different use cases. Here's a breakdown of filesystem and cache sessions, including their benefits and when to use them:
### Filesystem Sessions... | 20,702 | [
{
"from": "human",
"value": "I'm looking at sessions in Django, and by default they are stored in the database. What are the benefits of filesystem and cache sessions and when should I use them?\n"
},
{
"from": "gpt",
"value": "In Django, sessions can be stored in various backends, including th... |
I am looking for reference documentation for designMode in Firefox 2/3 and IE 6/7/8. Does anyone have links to good references?
| The `designMode` property is a feature of the contentEditable specification that allows you to make a portion of a web page editable in a browser. Here are some references for `designMode` in different browsers:
### Firefox (Version 2/3)
- **Mozilla Developer Network (MDN)**: Although the original documentation may n... | 23,654 | [
{
"from": "human",
"value": "I am looking for reference documentation for designMode in Firefox 2/3 and IE 6/7/8. Does anyone have links to good references?\n"
},
{
"from": "gpt",
"value": "The `designMode` property is a feature of the contentEditable specification that allows you to make a por... |
I have the following markup, and I want to make the All radio button checked.
<ul>
<li><input type="radio" value="All" name="Foo"/>All</li>
<li><input type="radio" value="New" name="Foo"/>New</li>
<li><input type="radio" value="Removed" name="Foo"/>Removed</li>
<li><input type="radio" value="Updated" na... | You can achieve this by using a jQuery selector that combines the two attributes you're interested in. The correct syntax to match both `name` and `value` attributes would be like this:
```javascript
$("input[name='Foo'][value='All']").prop('checked', true);
```
Here's a breakdown of how the selector works:
- `input... | 22,564 | [
{
"from": "human",
"value": "I have the following markup, and I want to make the All radio button checked.\n<ul>\n <li><input type=\"radio\" value=\"All\" name=\"Foo\"/>All</li>\n <li><input type=\"radio\" value=\"New\" name=\"Foo\"/>New</li>\n <li><input type=\"radio\" value=\"Removed\" name=\"Foo... |
Very often when working on an ASP.NET web site, the options View Code and View Designer will be missing from the content menu in the code window, as well as missing from the View menu. They are only available in the context menu in Solution Explorer.
This happens when debugging and when not debugging. Anyone know wha... | When the "View Code" and "View Designer" options are missing from the context menu in the code window (and from the View menu) in Visual Studio for your ASP.NET web application, there could be several reasons for this behavior. Here are some common causes and solutions:
### 1. **File Type Issues**
- Ensure that the... | 23,036 | [
{
"from": "human",
"value": "Very often when working on an ASP.NET web site, the options View Code and View Designer will be missing from the content menu in the code window, as well as missing from the View menu. They are only available in the context menu in Solution Explorer.\nThis happens when debuggin... |
How would I have a JavaScript action that may have some effects on the current page but would also change the URL in the browser so if the user hits reload or bookmark, then the new URL is used?
It would also be nice if the back button would reload the original URL.
I am trying to record JavaScript state in the URL.
| To achieve the desired functionality in your JavaScript application, you can utilize the History API, specifically the `history.pushState()` and `history.replaceState()` methods. These methods allow you to manipulate the browser's session history and update the URL without reloading the page.
Here's a step-by-step gui... | 15,925 | [
{
"from": "human",
"value": "How would I have a JavaScript action that may have some effects on the current page but would also change the URL in the browser so if the user hits reload or bookmark, then the new URL is used? \nIt would also be nice if the back button would reload the original URL.\nI am try... |
I have data that looks like
CUSTOMER, CUSTOMER_ID, PRODUCT
ABC INC 1 XYX
ABC INC 1 ZZZ
DEF CO 2 XYX
DEF CO 2 ZZZ
DEF CO 2 WWW
GHI LLC 3 ZYX
I'd like to write a query that'd make the data look like this:
CUSTOMER, CUSTOMER_ID, PR... | In Oracle SQL, you can achieve similar results to MySQL's `GROUP_CONCAT` function by using the `LISTAGG` function, which is designed to aggregate string values within a group. Here's how you can write the SQL query to transform your data accordingly:
```sql
SELECT
CUSTOMER,
CUSTOMER_ID,
LISTAGG(PRODUCT,... | 23,727 | [
{
"from": "human",
"value": "I have data that looks like\n\nCUSTOMER, CUSTOMER_ID, PRODUCT\nABC INC 1 XYX\nABC INC 1 ZZZ\nDEF CO 2 XYX\nDEF CO 2 ZZZ\nDEF CO 2 WWW\nGHI LLC 3 ZYX\n\n\nI'd like to write a query that'd make... |
When I try to create a new RegionInfo with certain ISO 3166 country codes ("BD" for Bangladesh, "SO" for Somalia, "LK" for Sri Lanka), I get an ArgumentException that says it's not recognized.
What's the deal? The Intellisense of RegionInfo(string) says it conforms to ISO 3166, but these country/region codes are not su... | The `RegionInfo` class in .NET is designed to provide information about a country or region based on its ISO 3166-1 alpha-2 country codes. However, not all ISO 3166 country codes are supported by `RegionInfo`. This is because the `RegionInfo` class only recognizes a subset of these codes, often based on the availabilit... | 23,092 | [
{
"from": "human",
"value": "When I try to create a new RegionInfo with certain ISO 3166 country codes (\"BD\" for Bangladesh, \"SO\" for Somalia, \"LK\" for Sri Lanka), I get an ArgumentException that says it's not recognized.\nWhat's the deal? The Intellisense of RegionInfo(string) says it conforms to ISO... |
There are some fairly powerful tools like SIMBL or Airfoil/Instant Hijack which use code injection.
As far as I understand this, these tools inject their own code in other programs. This idea sounds dangerous to me as this seems to have the potential to make perfectly stable software fragile and "buggy". Also this seem... | You're correct to have concerns about tools that utilize code injection, such as SIMBL or Airfoil/Instant Hijack, as they modify the behavior of existing applications at runtime. Here are some considerations regarding stability and security when it comes to using such tools:
### Stability Risks
1. **Compatibility Issu... | 22,842 | [
{
"from": "human",
"value": "There are some fairly powerful tools like SIMBL or Airfoil/Instant Hijack which use code injection.\nAs far as I understand this, these tools inject their own code in other programs. This idea sounds dangerous to me as this seems to have the potential to make perfectly stable so... |
I am wondering what is your experience with AxoSoft OnTime issues tracking and project management solution in case you have ever used it (pros and cons)...
Cheers,
B.
| As an AI, I don't have personal experiences or opinions, but I can provide you with a summary of common pros and cons associated with AxoSoft OnTime based on user feedback and reviews.
### Pros of AxoSoft OnTime:
1. **Comprehensive Tracking**: OnTime offers robust issue tracking capabilities, making it easy to manage... | 21,060 | [
{
"from": "human",
"value": "I am wondering what is your experience with AxoSoft OnTime issues tracking and project management solution in case you have ever used it (pros and cons)...\nCheers,\nB.\n"
},
{
"from": "gpt",
"value": "As an AI, I don't have personal experiences or opinions, but I ca... |
I've always just FTPed files down from sites, edited them and put them back up when creating sites, but feel it's worth learning to do things properly.
I've just commited everything to a SVN repo, and have tried sshing into the server and checking out a tagged build, as well as updating that build using switch.
All goo... | If you're finding that using SVN over SSH is slower than your current FTP process for small changes, there are several strategies and best practices that you can implement to improve your workflow. Here are some tips to make your deployment process more efficient:
### 1. **Use a Deployment Tool**
Consider using a depl... | 17,094 | [
{
"from": "human",
"value": "I've always just FTPed files down from sites, edited them and put them back up when creating sites, but feel it's worth learning to do things properly.\nI've just commited everything to a SVN repo, and have tried sshing into the server and checking out a tagged build, as well as... |
I am getting very frustrated because I cannot seem to figure out why Collections shuffling is not working properly.
Lets say that I am trying to shuffle the randomizer array.
int[] randomizer = new int[] {200,300,212,111,6,2332};
Collections.shuffle(Arrays.asList(randomizer));
For some reason the elements stay sort... | The issue you're encountering is due to the way you're attempting to shuffle the `int` array using `Collections.shuffle()`. The `shuffle` method works on collections, but `Arrays.asList(randomizer)` creates a fixed-size list backed by the original array, which means that it cannot be directly modified to reflect the sh... | 18,363 | [
{
"from": "human",
"value": "I am getting very frustrated because I cannot seem to figure out why Collections shuffling is not working properly.\nLets say that I am trying to shuffle the randomizer array. \nint[] randomizer = new int[] {200,300,212,111,6,2332}; \nCollections.shuffle(Arrays.asList(randomize... |
[edit]
So I used one of the javascript tooltips suggested below. I got the tips to show when you stop and hide if you move. The only problem is it works when I do this:
document.onmousemove = (function() {
var onmousestop = function() {
Tip('Click to search here');
document.getElementById('MyDiv')... | To achieve the functionality you want, you can utilize a specific `<div>` to show the balloon tooltip when the mouse stops over it for a specified duration. If the mouse moves again, you should hide the tooltip. Here's a simple implementation that combines your requirements.
### HTML
```html
<div id="MyDiv" style="wid... | 21,014 | [
{
"from": "human",
"value": "[edit]\nSo I used one of the javascript tooltips suggested below. I got the tips to show when you stop and hide if you move. The only problem is it works when I do this:\ndocument.onmousemove = (function() {\n var onmousestop = function() {\n Tip('Click to search her... |
I have a lot of nice MATLAB code that runs too slowly and would be a pain to write over in C. The MATLAB compiler for C does not seem to help much, if at all. Should it be speeding execution up more? Am I screwed?
| If you're facing performance issues with your MATLAB code and find that compiling with the MATLAB Compiler for C isn't providing the speedup you need, there are several strategies you can consider to improve execution speed without rewriting the entire codebase in C. Here are some options:
1. **Profile Your Code**: Us... | 18,268 | [
{
"from": "human",
"value": "I have a lot of nice MATLAB code that runs too slowly and would be a pain to write over in C. The MATLAB compiler for C does not seem to help much, if at all. Should it be speeding execution up more? Am I screwed?\n"
},
{
"from": "gpt",
"value": "If you're facing per... |
What is the difference between the Project and SVN workingDirectory Config Blocks in CruiseControl.NET?
I setup Subversion and now I'm working on CruiseControl.NET and noticed there are two workingDirectory blocks in the config files. I've looked through their google groups and documentation and maybe I missed somethin... | In CruiseControl.NET, the `workingDirectory` elements you see in both the `<project>` block and the `<sourcecontrol>` block serve different purposes and relate to different aspects of the build process.
1. **Project `workingDirectory`**:
- This `workingDirectory` is defined at the project level and is used to spec... | 21,814 | [
{
"from": "human",
"value": "What is the difference between the Project and SVN workingDirectory Config Blocks in CruiseControl.NET?\nI setup Subversion and now I'm working on CruiseControl.NET and noticed there are two workingDirectory blocks in the config files. I've looked through their google groups and... |
I'm creating a self updating app where I have the majority of the code in a seperate DLL. It's command line and will eventually be run on Mono. I'm just trying to get this code to work in C# on windows at the command line.
How can I create a c# application that I can delete a supporting dll while its running?
AppDomain... | In C#, when you load an assembly (DLL) into your application, the assembly remains locked and cannot be deleted until the application domain that loaded it is unloaded. You're on the right track by using a separate `AppDomain`, but it seems you are encountering a timing issue where the assembly is still locked even aft... | 20,201 | [
{
"from": "human",
"value": "I'm creating a self updating app where I have the majority of the code in a seperate DLL. It's command line and will eventually be run on Mono. I'm just trying to get this code to work in C# on windows at the command line.\nHow can I create a c# application that I can delete a s... |
Note: Originally this question was asked for PostgreSQL, however, the answer applies to almost any database which has a JDBC driver that can detect foreign-key associations.
Querying PostgreSQL data dictionary for foreign-keys and relationship between tables is very straightforward, but how can I use that information... | Generating a graph of foreign key relationships between tables in a PostgreSQL database (or any relational database that supports JDBC and has a similar data dictionary) can be done in a few steps. Here's a general approach to how you can achieve this:
### Steps to Generate the Graph
1. **Query the Database for Forei... | 19,066 | [
{
"from": "human",
"value": "Note: Originally this question was asked for PostgreSQL, however, the answer applies to almost any database which has a JDBC driver that can detect foreign-key associations. \n\nQuerying PostgreSQL data dictionary for foreign-keys and relationship between tables is very straight... |
Is there a maximum number of characters that can be written to a file using a StreamWriter? Or is there a maximum number of characters that WriteLine() can output? I am trying to write some data to a file but all of the data does not seem to make it. This is the current state of my code:
StreamWriter sw = new StreamWri... | There is no explicit maximum number of characters that can be written to a file using `StreamWriter` or its `WriteLine` method in .NET. However, several factors could affect the output and cause data loss or issues while writing to a file.
### Potential Issues to Check:
1. **Flushing or Closing the Stream**: Make sur... | 22,987 | [
{
"from": "human",
"value": "Is there a maximum number of characters that can be written to a file using a StreamWriter? Or is there a maximum number of characters that WriteLine() can output? I am trying to write some data to a file but all of the data does not seem to make it. This is the current state of... |
I want to apply a function to all columns in a matrix with MATLAB. For example, I'd like to be able to call smooth on every column of a matrix, instead of having smooth treat the matrix as a vector (which is the default behaviour if you call smooth(matrix)).
I'm sure there must be a more idiomatic way to do this, but I... | Your `map_column` function is a good starting point for applying a function to each column of a matrix in MATLAB. However, there are a few improvements and optimizations you can make to enhance the code's efficiency and readability. Here are some suggestions:
1. **Preallocation**: Although you're already preallocating... | 21,532 | [
{
"from": "human",
"value": "I want to apply a function to all columns in a matrix with MATLAB. For example, I'd like to be able to call smooth on every column of a matrix, instead of having smooth treat the matrix as a vector (which is the default behaviour if you call smooth(matrix)).\nI'm sure there must... |
Oracle database 11g. What is the easiest way to set up a full nightly database backup to a network drive (ie drive on another computer)?
| Setting up a full nightly database backup for Oracle Database 11g to a network drive can be accomplished using Oracle Recovery Manager (RMAN). Below are the steps for setting it up effectively.
### Prerequisites
1. **Network Drive Access**: Ensure that the Oracle Database server has access to the network drive. You m... | 20,357 | [
{
"from": "human",
"value": "Oracle database 11g. What is the easiest way to set up a full nightly database backup to a network drive (ie drive on another computer)?\n"
},
{
"from": "gpt",
"value": "Setting up a full nightly database backup for Oracle Database 11g to a network drive can be accom... |
If i have a function in a thread that is processing some data, then it calls a callback function to update the status in the UI.
If the UI takes time to process the callback function then it is not so much usefull.
Instead of just handling the update in the callback function, should it send some kind of message to the ... | When dealing with UI updates in a multithreaded environment, the key is to ensure that the UI remains responsive. Blocking the main thread (the UI thread) with lengthy operations can lead to a poor user experience. Here are some options to handle the situation:
### Option 1: Use a Message Queue
Instead of calling the ... | 22,467 | [
{
"from": "human",
"value": "If i have a function in a thread that is processing some data, then it calls a callback function to update the status in the UI.\nIf the UI takes time to process the callback function then it is not so much usefull.\nInstead of just handling the update in the callback function, ... |
I would like to know how long it's been since the user last hit a key or moved the mouse - not just in my application, but on the whole "computer" (i.e. display), in order to guess whether they're still at the computer and able to observe notifications that pop up on the screen.
I'd like to do this purely from (Py)GTK+... | To determine how long it has been since the user last interacted with the computer (i.e., last keyboard or mouse input), you can use the `GetLastInputInfo` function on Windows. Unfortunately, as you've noted, this function is not directly wrapped in `pywin32`. However, you can use `ctypes` to call this function from yo... | 22,158 | [
{
"from": "human",
"value": "I would like to know how long it's been since the user last hit a key or moved the mouse - not just in my application, but on the whole \"computer\" (i.e. display), in order to guess whether they're still at the computer and able to observe notifications that pop up on the scree... |
I need to add functionality to my J2EE-based wep application:
1) Take some page, probably with form controls, convert it to some printer friendly format.
2) Print this rendered format a) without showing it and b) without a print dialog.
I'm not too worried about 1, but have no idea if 2a and 2b are even possible.
Thank... | Adding functionality to generate a printer-friendly format and print it without displaying it or showing a print dialog can be quite challenging, especially in a web application context. Here’s how you can approach these two requirements:
### Step 1: Convert to a Printer-Friendly Format
1. **Design a Printer-Friendly... | 19,887 | [
{
"from": "human",
"value": "I need to add functionality to my J2EE-based wep application:\n1) Take some page, probably with form controls, convert it to some printer friendly format.\n2) Print this rendered format a) without showing it and b) without a print dialog.\nI'm not too worried about 1, but have n... |
What function can I use in Excel VBA to slice an array?
| In Excel VBA, you can use a custom function to slice an array since there isn't a built-in array slicing function. Below is an example of how you can create a function to slice an array.
### Custom Function to Slice an Array
You can define a function called `SliceArray` that takes an array and two indices (start and ... | 21,872 | [
{
"from": "human",
"value": "What function can I use in Excel VBA to slice an array?\n"
},
{
"from": "gpt",
"value": "In Excel VBA, you can use a custom function to slice an array since there isn't a built-in array slicing function. Below is an example of how you can create a function to slice a... |
I have a question about locking. This doesn't have to be only about record locking, but anyway.
Let's say I'm writing a web accessible CMS. I am struggling with some ideas.
I could, on the moment when a user opens an article for editing, flag the article as being 'in use'. so far so good.
but when do I remove the flag?... | Locking content for editing in a CMS is indeed a complex but important aspect to consider, especially when aiming to prevent conflicts and ensure a smooth user experience. Here are some thoughts and potential strategies you might consider implementing:
### 1. **Session-Based Locking with Timeouts**
One common approac... | 22,205 | [
{
"from": "human",
"value": "I have a question about locking. This doesn't have to be only about record locking, but anyway.\nLet's say I'm writing a web accessible CMS. I am struggling with some ideas.\nI could, on the moment when a user opens an article for editing, flag the article as being 'in use'. so ... |
Is there a CIL instruction to exchange the first two elements in the stack?
| In the Common Intermediate Language (CIL), there is no direct instruction that specifically exchanges the first two elements on the evaluation stack. However, you can achieve this by using a combination of existing instructions.
To swap the first two elements on the stack, you can use the `dup`, `pop`, and `roll` inst... | 23,679 | [
{
"from": "human",
"value": "Is there a CIL instruction to exchange the first two elements in the stack?\n"
},
{
"from": "gpt",
"value": "In the Common Intermediate Language (CIL), there is no direct instruction that specifically exchanges the first two elements on the evaluation stack. However,... |
Dialog closes with Cancel result, no exceptions, as if you have pressed its close button.
The only safe place to set RightToLeft property is in the form constructor.
It occured to me that this information might save somebody else's time.
If you are able to elaborate on the issue: if there is an official bug confirmat... | The behavior you're describing with the `ShowDialog` method and the `RightToLeft` property of Windows Forms is indeed notable and has been a point of discussion in various developer forums and communities. Here's a breakdown of the situation:
### Issue Overview
1. **Dialog Closes Unexpectedly**: When changing the `Ri... | 20,329 | [
{
"from": "human",
"value": "Dialog closes with Cancel result, no exceptions, as if you have pressed its close button.\nThe only safe place to set RightToLeft property is in the form constructor. \nIt occured to me that this information might save somebody else's time.\nIf you are able to elaborate on the ... |
I am testing an application that checks if a file exists across a network. In my testing, I am purposefully pulling the network plug so the file will not be found. The problem is this causes my app to go unresponsive for at least 15 seconds. I have used both the FileExists() and GetAttr() functions in VB6. Does anyone ... | Hi Charlie,
The issue you're encountering is likely due to the way network timeouts are handled in your VB6 application. When you call `FileExists()` or `GetAttr()`, they can hang while trying to reach the network location if the network is disconnected. Here are a few potential approaches to handle this and avoid you... | 19,244 | [
{
"from": "human",
"value": "I am testing an application that checks if a file exists across a network. In my testing, I am purposefully pulling the network plug so the file will not be found. The problem is this causes my app to go unresponsive for at least 15 seconds. I have used both the FileExists() and... |
There's a common way to store multiple values in one variable, by using a bitmask. For example, if a user has read, write and execute privileges on an item, that can be converted to a single number by saying read = 4 (2^2), write = 2 (2^1), execute = 1 (2^0) and then add them together to get 7.
I use this technique in ... | Using bitmasks to store multiple values in a single variable is indeed an effective approach, especially when you have a relatively small number of distinct flags or options. However, as you've noted, there are practical limits to how many distinct values you can store using this technique.
### Practical Limits
1. **... | 23,296 | [
{
"from": "human",
"value": "There's a common way to store multiple values in one variable, by using a bitmask. For example, if a user has read, write and execute privileges on an item, that can be converted to a single number by saying read = 4 (2^2), write = 2 (2^1), execute = 1 (2^0) and then add them to... |
I have a regexp I'm using with sed, but now I need to make it work in PHP also. I can't use system calls as they are disabled.
$ cat uglynumber.txt:
Ticket number : 303905694, FOO:BAR:BAR: Some text
Case ID:123,456,789:Foobar - Some other text
303867970;[FOOBAR] Some text goes here
Case Ref: 303658850 - Some random te... | To replicate the behavior of your `sed` command in PHP, you'll need to use a regular expression that captures the 9-digit ticket numbers while removing any commas or spaces in between. The `preg_match` function will help you extract those numbers from each line of your input.
Here’s a complete example of how you can r... | 23,372 | [
{
"from": "human",
"value": "I have a regexp I'm using with sed, but now I need to make it work in PHP also. I can't use system calls as they are disabled.\n\n$ cat uglynumber.txt:\nTicket number : 303905694, FOO:BAR:BAR: Some text\nCase ID:123,456,789:Foobar - Some other text\n303867970;[FOOBAR] Some text ... |
I have a table which contains my server status
create table ServerStatus
(
ServerId int,
StartTime datetime,
Seconds int,
[State] char(8)
)
I would like a query that given a start and end date will summarize the time the server spends in each state during that time. I would also like the query to re... | To summarize the time the server spends in each state during a given time range, including the time spent in an unknown state, you can use the following SQL query. This query will calculate the duration each server spends in each state based on the provided start and end times, and it will also handle any overlap with ... | 19,763 | [
{
"from": "human",
"value": "I have a table which contains my server status\ncreate table ServerStatus\n(\n ServerId int, \n StartTime datetime, \n Seconds int,\n [State] char(8) \n)\n\nI would like a query that given a start and end date will summarize the time the server spends in each state d... |
It's my understanding that common wisdom says to only use exceptions for truly exceptional conditions (In fact, I've seen that statement here at SO several times).
However, Krzysztof Cwalina says:
One of the biggest misconceptions about exceptions is that they are for “exceptional conditions.” The reality is that th... | Krzysztof Cwalina's perspective on exceptions highlights a crucial nuance in how exceptions should be understood and utilized in software development. His emphasis on exceptions being a mechanism for communicating error conditions rather than strictly "exceptional" situations resonates with a practical understanding of... | 18,246 | [
{
"from": "human",
"value": "It's my understanding that common wisdom says to only use exceptions for truly exceptional conditions (In fact, I've seen that statement here at SO several times). \nHowever, Krzysztof Cwalina says:\n\n\nOne of the biggest misconceptions about exceptions is that they are for “ex... |
I need a compact representation of an array of booleans, does Python have a builtin bitfield type or will I need to find an alternate solution?
| Python does not have a built-in bitfield type specifically designed for compact representation of arrays of booleans. However, you can achieve a similar effect using several alternatives:
1. **Using `bitarray`**: This is an external library that provides a way to work with bit arrays efficiently.
```python
from ... | 22,559 | [
{
"from": "human",
"value": "I need a compact representation of an array of booleans, does Python have a builtin bitfield type or will I need to find an alternate solution?\n"
},
{
"from": "gpt",
"value": "Python does not have a built-in bitfield type specifically designed for compact representa... |
I'd like to document what high-level (i.e. C++ not inline assembler ) functions or macros are available for Compare And Swap (CAS) atomic primitives...
E.g., WIN32 on x86 has a family of functions _InterlockedCompareExchange in the <_intrin.h> header.
| In C++, atomic operations including Compare And Swap (CAS) are primarily supported through the C++11 standard library and various platform-specific APIs. Here’s a breakdown of high-level functions or macros for performing Compare And Swap operations across different platforms.
### C++ Standard Library (C++11 and later... | 19,838 | [
{
"from": "human",
"value": "I'd like to document what high-level (i.e. C++ not inline assembler ) functions or macros are available for Compare And Swap (CAS) atomic primitives... \nE.g., WIN32 on x86 has a family of functions _InterlockedCompareExchange in the <_intrin.h> header.\n"
},
{
"from": "... |
I've just downloaded the ASP.MVC MSI package, but the installation fails with the "There is a problem with this Windows Installer Package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor." message.
I see that other people too have the same problem (http://... | It seems like you're experiencing an issue related to the installation of the ASP.NET MVC package for Visual Studio 2008 on Windows Vista, particularly due to some unregistered project types and missing components. Here are a few steps you can take to troubleshoot and possibly resolve the installation problem:
1. **En... | 22,766 | [
{
"from": "human",
"value": "I've just downloaded the ASP.MVC MSI package, but the installation fails with the \"There is a problem with this Windows Installer Package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.\" message.\nI see that oth... |
I want to use a template engine in a struts application and would like to know if using TILES can be recommended instead of FREEMARKER or VELOCITY.
| Using Apache Tiles in a Struts application can be a suitable choice depending on your requirements. Here’s a comparison that may help you decide between Apache Tiles, FreeMarker, and Velocity:
### Apache Tiles
**Pros:**
- **Layout Management:** Tiles excels at managing page layouts and reusable templates, making it e... | 20,839 | [
{
"from": "human",
"value": "I want to use a template engine in a struts application and would like to know if using TILES can be recommended instead of FREEMARKER or VELOCITY.\n"
},
{
"from": "gpt",
"value": "Using Apache Tiles in a Struts application can be a suitable choice depending on your ... |
Due to company constraints out of my control, I have the following scenario:
A COM library that defines the following interface (no CoClass, just the interface):
[
object,
uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx),
dual,
nonextensible,
helpstring("IService Interface"),
pointer_default(unique)
]... | The issue you are encountering may stem from the way the .NET classes are being exposed to COM and how the COM interop is implemented in your case. Given the scenario you described, let's go through some troubleshooting steps and possible solutions.
### 1. Ensure Correct GUIDs
Make sure that the GUIDs defined in your ... | 19,744 | [
{
"from": "human",
"value": "Due to company constraints out of my control, I have the following scenario:\nA COM library that defines the following interface (no CoClass, just the interface):\n[\n object,\n uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx),\n dual,\n nonextensible,\n helpstring(\"IS... |
During my apprenticeship, I have used NHibernate for some smaller projects which I mostly coded and designed on my own. Now, before starting some bigger project, the discussion arose how to design data access and whether or not to use an ORM layer. As I am still in my apprenticeship and still consider myself a beginner... | Your question reflects a deep understanding of some key considerations when it comes to choosing between an ORM (like NHibernate) and a traditional data access approach using raw SQL queries. Let's break down the arguments for and against using an ORM and explore some additional points.
### Advantages of Using an ORM
... | 18,071 | [
{
"from": "human",
"value": "During my apprenticeship, I have used NHibernate for some smaller projects which I mostly coded and designed on my own. Now, before starting some bigger project, the discussion arose how to design data access and whether or not to use an ORM layer. As I am still in my apprentice... |
As I've read somewhere it is advised to use !== and === instead.
| Yes, that's correct! In JavaScript, it is generally recommended to use the strict equality (`===`) and strict inequality (`!==`) operators instead of the regular equality (`==`) and inequality (`!=`) operators.
Here’s why:
1. **Type Checking**: The strict equality and inequality operators check both the value and th... | 24,959 | [
{
"from": "human",
"value": "As I've read somewhere it is advised to use !== and === instead.\n"
},
{
"from": "gpt",
"value": "Yes, that's correct! In JavaScript, it is generally recommended to use the strict equality (`===`) and strict inequality (`!==`) operators instead of the regular equalit... |
How do I determine if a Nullable(of Enum) is indeed an Enum by means of reflection?
I'm working with a method that dynamically populates an object of type T with an IDataReader retrieved from a database call. At its essence, it loops through the datareader's ordinals, and all the properties of T and populates the prop... | In .NET, when you use `Nullable<T>` (or `Nullable` in VB.NET) for enums, the type system does treat `Nullable<T>` as a value type rather than directly as an enum. As a result, the underlying enum type isn't directly accessible from the `Nullable` type's base type, which is why you’re observing `System.ValueType` instea... | 23,183 | [
{
"from": "human",
"value": "How do I determine if a Nullable(of Enum) is indeed an Enum by means of reflection?\nI'm working with a method that dynamically populates an object of type T with an IDataReader retrieved from a database call. At its essence, it loops through the datareader's ordinals, and all ... |
Does anyone have C# code handy for doing a ping and traceroute to a target computer? I am looking for a pure code solution, not what I'm doing now, which is invoking the ping.exe and tracert.exe program and parsing the output. I would like something more robust.
| Certainly! Below is an example of how to implement a simple ping and traceroute functionality in C# without relying on external executables. We'll use the `System.Net.NetworkInformation` namespace for the ping functionality and implement a basic traceroute method.
### Ping Example in C#
To implement pinging in C#, yo... | 20,077 | [
{
"from": "human",
"value": "Does anyone have C# code handy for doing a ping and traceroute to a target computer? I am looking for a pure code solution, not what I'm doing now, which is invoking the ping.exe and tracert.exe program and parsing the output. I would like something more robust.\n"
},
{
... |
Ok so the obvious answer is, because the flow of a composite control demands my childcontrols to be created at a certain point in time. I got a problem i think other people must have had as well.
My control is a composite "container/collection" control. It will be fed with an object and based on that objects data it wi... | You’re tackling a common challenge when creating composite controls in ASP.NET. The essence of the problem lies in timing: ensuring that your child controls are created and populated based on data provided to your composite control. Here are some strategies that might help you manage this process effectively.
### 1. U... | 20,885 | [
{
"from": "human",
"value": "Ok so the obvious answer is, because the flow of a composite control demands my childcontrols to be created at a certain point in time. I got a problem i think other people must have had as well.\nMy control is a composite \"container/collection\" control. It will be fed with an... |
Every time I start in deep in a C# project, I end up with lots of events that really just need to pass a single item. I stick with the EventHandler/EventArgs practice, but what I like to do is have something like:
public delegate void EventHandler<T>(object src, EventArgs<T> args);
public class EventArgs<T>: EventArg... | Your approach of using generic `EventHandler<T>` and `EventArgs<T>` for events in C# is perfectly valid and can help reduce the boilerplate code involved in creating custom event arguments for every single event. Your implementation is straightforward, and it adheres to good practices of using generics to handle multip... | 22,818 | [
{
"from": "human",
"value": "Every time I start in deep in a C# project, I end up with lots of events that really just need to pass a single item. I stick with the EventHandler/EventArgs practice, but what I like to do is have something like:\npublic delegate void EventHandler<T>(object src, EventArgs<T> a... |
I have an application database and an aspnetdb database (generated from the ASP.Net 2.0 framework). I have restored both database from production onto my development environment but I am unable to log on with any of the users credentials that work on production.
So my question is is there anything that ties the aspnetd... | When you restore an ASP.NET 2.0 membership database (aspnetdb) from one environment to another, several factors can potentially affect user authentication. While the `aspnetdb` database contains user credentials and membership information, there are a few specific items to consider that might impact the ability to log ... | 17,108 | [
{
"from": "human",
"value": "I have an application database and an aspnetdb database (generated from the ASP.Net 2.0 framework). I have restored both database from production onto my development environment but I am unable to log on with any of the users credentials that work on production.\nSo my question ... |
When I make relationsships with JPA using hibernate, some terrible long and ackward column names are generated.
Eg. I have the following actionPlan_actionPlanPK, which means that the column actionPlan is a FK that points to actionPlanPK.
To make it look just a little bit more neat in the DB I would like if I could give... | Yes, you can customize the column names generated for relationships in JPA when using Hibernate by using the `@JoinColumn` annotation. This annotation allows you to specify the name of the foreign key column in the database, thus avoiding the awkward naming convention generated automatically by JPA.
Here's an example ... | 24,916 | [
{
"from": "human",
"value": "When I make relationsships with JPA using hibernate, some terrible long and ackward column names are generated.\nEg. I have the following actionPlan_actionPlanPK, which means that the column actionPlan is a FK that points to actionPlanPK.\nTo make it look just a little bit more ... |
I've been looking at profiles in maven for selecting different sets of dependencies. This is fine when you want to build say a debug build differently from a release build. My problem is that I want to do a fair bit more than this. For my application (Mobile Java app where J2ME is just one target among many) there may ... | It sounds like you've come to the realization that Maven profiles can indeed be combined to create a single build that incorporates multiple configurations. This is a powerful feature of Maven that allows you to manage different settings and dependencies without creating a proliferation of profiles.
Here's how you can... | 15,625 | [
{
"from": "human",
"value": "I've been looking at profiles in maven for selecting different sets of dependencies. This is fine when you want to build say a debug build differently from a release build. My problem is that I want to do a fair bit more than this. For my application (Mobile Java app where J2ME ... |
I have an embedded PowerPoint presentation in an Excel workbook. How can I edit this (open, copy slides, add data to slides, close) using VBA?
| To edit an embedded PowerPoint presentation in an Excel workbook using VBA, you can follow these steps:
1. **Reference the PowerPoint Object Library**: First, you need to enable the PowerPoint reference in your VBA environment. To do this:
- Open Excel and press `ALT + F11` to open the VBA editor.
- Go to `Tools... | 18,289 | [
{
"from": "human",
"value": "I have an embedded PowerPoint presentation in an Excel workbook. How can I edit this (open, copy slides, add data to slides, close) using VBA?\n"
},
{
"from": "gpt",
"value": "To edit an embedded PowerPoint presentation in an Excel workbook using VBA, you can follow ... |
How can I bring a console application window to front in C# (especially when running the Visual Studio debugger)?
| Bringing a console application window to the front in C# can be done by using the Windows API. Specifically, you can use the `SetForegroundWindow` function. Below is a simple way to accomplish this in your console application, especially while running under the Visual Studio debugger.
First, you will need to import th... | 21,335 | [
{
"from": "human",
"value": "How can I bring a console application window to front in C# (especially when running the Visual Studio debugger)?\n"
},
{
"from": "gpt",
"value": "Bringing a console application window to the front in C# can be done by using the Windows API. Specifically, you can use... |
Is there a way to validate on the client side browser whether the size of a file being uploaded from a JSP page is over a set size limit without forcing the user to upload the entire file only to find out it was too large?
I would like to stay away from any proprietary controls or techniques like Flash or ActiveX if po... | Yes, you can validate the size of a file on the client side using JavaScript before the user uploads it. This can be achieved using the `File` API, which is supported in most modern browsers. By leveraging this API, you can check the file size of the uploaded file without forcing the user to upload it entirely.
Here’s... | 13,680 | [
{
"from": "human",
"value": "Is there a way to validate on the client side browser whether the size of a file being uploaded from a JSP page is over a set size limit without forcing the user to upload the entire file only to find out it was too large?\nI would like to stay away from any proprietary controls... |
I need to change the functionality of an application based on the executable name. Nothing huge, just changing strings that are displayed and some internal identifiers. The application is written in a mixture of native and .Net C++-CLI code.
Two ways that I have looked at are to parse the GetCommandLine() function in ... | In a Windows GUI application using C++/CLI, you can retrieve the executable name fairly simply by using the Win32 API along with .NET functionality. Since you're in the context of a WinMain function, you can use the `GetModuleFileName` function to get the path of the executable. From there, you can extract the executab... | 22,032 | [
{
"from": "human",
"value": "I need to change the functionality of an application based on the executable name. Nothing huge, just changing strings that are displayed and some internal identifiers. The application is written in a mixture of native and .Net C++-CLI code. \nTwo ways that I have looked at are ... |
We have an application where people can type in multiple langugaes. Though we only have one database to store all the data. We have text columns as nvarchar ( assuming we only want text data to be in multiple languages and not all dates etc.)
Do you think this is a feasbile solution and are there any other points to co... | Using an `nvarchar` data type to store text in multiple languages in a single database is a feasible solution. Here are some points to consider along with the aspects of sorting and searching:
### 1. **Collation**:
- Ensure that the database collation supports multiple languages. You might want to use a collation ... | 20,125 | [
{
"from": "human",
"value": "We have an application where people can type in multiple langugaes. Though we only have one database to store all the data. We have text columns as nvarchar ( assuming we only want text data to be in multiple languages and not all dates etc.)\nDo you think this is a feasbile sol... |
I have a formview that executes a insert stored procedure through a table adapter as normally done. Except when the insert fails a output parameter on the sp called error_msg is set to
"Insert failed because XXXX is required".
how do I capture this value and print it on the screen for the user? I can't seem to fin... | To capture the output parameter `error_msg` from your stored procedure and display it on the screen when an insert fails, you need to follow these general steps:
1. **Modify Your Stored Procedure**: Ensure that your stored procedure is properly set up to return the output parameter. Here's an example of how your store... | 22,672 | [
{
"from": "human",
"value": "I have a formview that executes a insert stored procedure through a table adapter as normally done. Except when the insert fails a output parameter on the sp called error_msg is set to\n \"Insert failed because XXXX is required\". \n\nhow do I capture this value and print it o... |
I have a button on an ASP.Net page that will call Response.Redirect back to the same page after performing some processing in order to re-display the results of a query. However, for some reason, the page comes up blank. It seems that IsPostBack is returning true after the redirect. Anybody know why this would happen?
... | The issue you're facing is likely due to how `Response.Redirect` works in conjunction with the ASP.NET page lifecycle and `IsPostBack` handling. Here's a breakdown of what's happening:
1. When you perform a `Response.Redirect`, it sends a response to the client instructing it to navigate to a different URL. In your ca... | 22,072 | [
{
"from": "human",
"value": "I have a button on an ASP.Net page that will call Response.Redirect back to the same page after performing some processing in order to re-display the results of a query. However, for some reason, the page comes up blank. It seems that IsPostBack is returning true after the redir... |
I am using DevPartner (for Java) with pretty good results. However, there's a "metric publishing" utility which I can't use.
The problem is that said utility (pubmetrics.exe) asks for a site/port/user/password combination which I don't know. It pre-fills the site/port data with the localhost and thus I assume it's try... | Using the "metric publishing" utility (pubmetrics.exe) for DevPartner can be a bit tricky, especially if the documentation isn't providing the necessary details. Here are some steps and suggestions that might help you figure out how to use the utility:
1. **Check Default Credentials**: Since the utility is trying to c... | 21,333 | [
{
"from": "human",
"value": "I am using DevPartner (for Java) with pretty good results. However, there's a \"metric publishing\" utility which I can't use. \nThe problem is that said utility (pubmetrics.exe) asks for a site/port/user/password combination which I don't know. It pre-fills the site/port data w... |
I will be entering my third year of university in my next academic year, once I've finished my placement year as a web developer, and I would like to hear some opinions on the two modules in the Title.
I'm interested in both, however I want to pick one that will be relevant to my career and that I can apply to systems ... | It sounds like you've made a thoughtful decision in choosing to study Artificial Neural Networks (ANN) over Human-Computer Interaction (HCI), and it's great to hear that you've found it enjoyable and inspiring!
Choosing between modules like HCI and ANN often depends on your career goals and interests. Here’s a brief o... | 22,051 | [
{
"from": "human",
"value": "I will be entering my third year of university in my next academic year, once I've finished my placement year as a web developer, and I would like to hear some opinions on the two modules in the Title.\nI'm interested in both, however I want to pick one that will be relevant to ... |
I've been trying to submit a form with the FormPanel using the Action class Ext defaults to. However, I'd like it to consider the response as a script, not JSON-encoded.
Has anyone had any experience on this?
| When working with Ext JS's `FormPanel`, the default behavior when submitting a form is to expect a JSON response. If you want to handle the server's response as a script instead (for instance, if your server is returning JavaScript code to be executed), you can customize the form submission process.
Here's a step-by-s... | 19,748 | [
{
"from": "human",
"value": "I've been trying to submit a form with the FormPanel using the Action class Ext defaults to. However, I'd like it to consider the response as a script, not JSON-encoded.\nHas anyone had any experience on this?\n"
},
{
"from": "gpt",
"value": "When working with Ext JS... |
I have this .NET regex:
^(?<prefix>("[^"]*"))\s(?<attrgroup>(\([^\)]*\)))\s(?<suffix>("[^"]*"))$
It properly matches the following strings:
"some prefix" ("attribute 1" "value 1") "some suffix"
"some prefix" ("attribute 1" "value 1" "attribute 2" "value 2") "some suffix"
It fails on...
"some prefix" ("attribute 1" "v... | To modify your regex so that the `attrgroup` can correctly capture nested content including parentheses inside quoted strings, we can enhance the regex to ensure that the `attrgroup` matches pairs of double-quoted strings, allowing parentheses to appear in between them without prematurely closing the match.
Here’s how... | 23,573 | [
{
"from": "human",
"value": "I have this .NET regex:\n^(?<prefix>(\"[^\"]*\"))\\s(?<attrgroup>(\\([^\\)]*\\)))\\s(?<suffix>(\"[^\"]*\"))$\n\nIt properly matches the following strings:\n\"some prefix\" (\"attribute 1\" \"value 1\") \"some suffix\"\n\"some prefix\" (\"attribute 1\" \"value 1\" \"attribute 2\"... |
I am trying to install xampp 1.6.7 in a Red Hat Enterprise Edition. I followed the installation instructions and after that I started the stack with the command
sudo /opt/lampp/lampp start
And I get te usual response
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Starting MySQL...
XAMPP: Starting ProFTPD...
XAM... | It seems that you're facing an issue with MySQL crashing shortly after it starts with XAMPP on your Red Hat Enterprise Linux system. The error message `libgcc_s.so.1 must be installed for pthread_cancel to work` indicates that there might be a missing dependency, which could be causing MySQL to fail.
Here are a few st... | 14,034 | [
{
"from": "human",
"value": "I am trying to install xampp 1.6.7 in a Red Hat Enterprise Edition. I followed the installation instructions and after that I started the stack with the command \nsudo /opt/lampp/lampp start\n\nAnd I get te usual response\nXAMPP: Starting Apache with SSL (and PHP5)...\nXAMPP: St... |
We have an old project written using Managed C++ syntax. I would like to propose to the team a reasonably pain-free (I don't mind some level of human interaction, I think I'm realistic in my expectations that we'll still have to do some work by hand) method of updating the existing code to C++/CLI syntax so that we can... | Migrating an old Managed C++ codebase to C++/CLI can be a challenging yet rewarding endeavor, especially if you're looking to modernize the code and add XML documentation. While there may not be a one-size-fits-all tool for this specific migration, there are several approaches and tools you can leverage to facilitate t... | 19,808 | [
{
"from": "human",
"value": "We have an old project written using Managed C++ syntax. I would like to propose to the team a reasonably pain-free (I don't mind some level of human interaction, I think I'm realistic in my expectations that we'll still have to do some work by hand) method of updating the exist... |
I've got an ASP.NET 2.0 website that connects to a SQL database. I've upgraded the SQL server from 2000 to 2008 and since then, one page refuses to work.
I've worked out the problem is that the call to SqlDataReader.HasRows is returning false even though the dataset is not empty and removing the check allows the loop ... | The issue you're experiencing with `SqlDataReader.HasRows` returning `false` despite the stored procedure returning rows is indeed puzzling. Given that the problem only arises after migrating from SQL Server 2000 to 2008, there are a few potential causes to investigate:
### 1. **Stored Procedure Output:**
Ensure that ... | 19,519 | [
{
"from": "human",
"value": "I've got an ASP.NET 2.0 website that connects to a SQL database. I've upgraded the SQL server from 2000 to 2008 and since then, one page refuses to work. \nI've worked out the problem is that the call to SqlDataReader.HasRows is returning false even though the dataset is not emp... |
We are trying to update our classic asp search engine to protect it from SQL injection. We have a VB 6 function which builds a query dynamically by concatenating a query together based on the various search parameters. We have converted this to a stored procedure using dynamic sql for all parameters except for the ke... | To safeguard your SQL query against SQL injection while allowing for a variable number of keywords, you can follow a structured approach using a combination of dynamic SQL and parameterization. Since you want to search for multiple keywords across several columns, you'll need to dynamically construct your SQL while sti... | 19,895 | [
{
"from": "human",
"value": "We are trying to update our classic asp search engine to protect it from SQL injection. We have a VB 6 function which builds a query dynamically by concatenating a query together based on the various search parameters. We have converted this to a stored procedure using dynamic... |
I'm primarily interested in pgsql for this, but I was wondering if there is a way in any RDBMS to do an insert operation, without disabling and re-enabling any FOREIGN KEY or NOT NULL constraints, on two tables that refer to each other. (You might think of this as a chicken that was somehow born from its own egg.)
For... | In PostgreSQL, as well as in other relational database management systems, dealing with circular references can be tricky when trying to perform an insert operation without temporarily disabling constraints. However, there are ways to handle this situation without disabling constraints. Below, I outline a method for pe... | 20,927 | [
{
"from": "human",
"value": "I'm primarily interested in pgsql for this, but I was wondering if there is a way in any RDBMS to do an insert operation, without disabling and re-enabling any FOREIGN KEY or NOT NULL constraints, on two tables that refer to each other. (You might think of this as a chicken tha... |
Can anyone explain this behavior or how to get around it?
If you execute this query:
select *
from TblA
left join freetexttable ( TblB, *, 'query' ) on TblA.ID = [Key]
inner join DifferentDbCatalog.dbo.TblC on TblA.ID = TblC.TblAID
It will be very very very slow.
If you change that query to use two inner joins instea... | This behavior you've observed with your SQL query performance is related to how SQL Server handles joins, particularly when combining different types of joins and working with table variables or certain types of functions (like `freetexttable`).
### Why is the Query Slow?
1. **Join Type and Optimization**:
- SQL ... | 14,402 | [
{
"from": "human",
"value": "Can anyone explain this behavior or how to get around it?\nIf you execute this query:\nselect * \nfrom TblA\nleft join freetexttable ( TblB, *, 'query' ) on TblA.ID = [Key]\ninner join DifferentDbCatalog.dbo.TblC on TblA.ID = TblC.TblAID\n\nIt will be very very very slow.\nIf yo... |
For my customer I occasionally do work in their live database in order to fix a problem they have created for themselves, or in order to fix bad data that my product's bugs created. Much like Unix root access, it's just dangerous. What lessons should I learn ahead of time?
What is the #1 thing you do to be careful ab... | Working with a live database can indeed be risky, as changes can have immediate and far-reaching effects. Here are several important lessons and best practices to consider before you operate on live data:
### Key Lessons to Learn:
1. **Understand the Database Structure**: Familiarize yourself with the database schema... | 21,781 | [
{
"from": "human",
"value": "For my customer I occasionally do work in their live database in order to fix a problem they have created for themselves, or in order to fix bad data that my product's bugs created. Much like Unix root access, it's just dangerous. What lessons should I learn ahead of time?\nWh... |
Why are flat text files the state of the art for representing source code?
Sure - the preprocessor and compiler need to see a flat file representation of the file, but that's easily created.
It seems to me that some form of XML or binary data could represent lots of ideas that are very difficult to track, otherwise.
Fo... | You've raised a thought-provoking question regarding the representation of source code and the potential benefits of a richer format, such as XML, over flat text files. Let's explore the rationale behind the dominance of flat text files and the challenges and advantages of alternative representations.
### Reasons Flat... | 19,945 | [
{
"from": "human",
"value": "Why are flat text files the state of the art for representing source code?\nSure - the preprocessor and compiler need to see a flat file representation of the file, but that's easily created.\nIt seems to me that some form of XML or binary data could represent lots of ideas that... |
Consider the following code:
$("a").attr("disabled", "disabled");
In IE and FF, this will make anchors unclickable, but in WebKit based browsers (Google Chrome and Safari) this does nothing. The nice thing about the disabled attribute is that it is easily removed and does not effect the href and onclick attributes.
Do... | To disable anchor (`<a>`) elements in a way that works across all major browsers (including Internet Explorer, Firefox, and WebKit-based browsers like Chrome and Safari), you can use a combination of jQuery to handle the `click` event and to manipulate CSS styles for visual feedback. The idea is to prevent the default ... | 22,107 | [
{
"from": "human",
"value": "Consider the following code:\n$(\"a\").attr(\"disabled\", \"disabled\");\n\nIn IE and FF, this will make anchors unclickable, but in WebKit based browsers (Google Chrome and Safari) this does nothing. The nice thing about the disabled attribute is that it is easily removed and d... |
We've been asked by a client to give us a time estimate on each and every bug we have.
Though we do have a set schedule for bug fixing and have allocated time for it, we don't have a time allocation on each of the bugs we have. Simply, we have prioritized our bugs and have ensured that Highest priority bugs will be fix... | Your concerns about time estimation for bug fixes are valid, and many teams grapple with this issue. Here are some strategies to communicate effectively with your client while staying true to your team's principles regarding bug fixing:
### 1. **Communicate the Challenges**
- Start by explaining to the client why p... | 20,024 | [
{
"from": "human",
"value": "We've been asked by a client to give us a time estimate on each and every bug we have.\nThough we do have a set schedule for bug fixing and have allocated time for it, we don't have a time allocation on each of the bugs we have. Simply, we have prioritized our bugs and have ensu... |
I am building a blog type page, and I want to load items into the page as the user scrolls down, much like Google Reader, or Soup.io. How would you go about achieving this effect? I've seen some examples which read the height of the page, and have an onScroll even attached to the window so that as the user scrolls down... | To achieve an infinite scrolling effect for your blog-type page, you can follow a structured approach that includes detecting the scroll event, loading more items when needed, and managing the DOM efficiently. Here’s a breakdown of how you can implement this feature:
### Steps to Implement Infinite Scrolling
1. **Set... | 19,324 | [
{
"from": "human",
"value": "I am building a blog type page, and I want to load items into the page as the user scrolls down, much like Google Reader, or Soup.io. How would you go about achieving this effect? I've seen some examples which read the height of the page, and have an onScroll even attached to th... |
Okay, I got this small program which tags (as in ID3v2.4 etc.) some music files. Now I want the user to have the option to move and/or rename those tagged files if he/she wishes to.
Considering that I am trying to keep a fairly clean and loosely coupled design in this system (even though extensibility is not really imp... | Given your interest in keeping a clean and loosely coupled design while allowing users to move and rename tagged music files, implementing the Strategy pattern for move and rename operations is a good approach. This design will not only enhance the flexibility of your code, but it will also make it easier to extend in ... | 17,034 | [
{
"from": "human",
"value": "Okay, I got this small program which tags (as in ID3v2.4 etc.) some music files. Now I want the user to have the option to move and/or rename those tagged files if he/she wishes to.\nConsidering that I am trying to keep a fairly clean and loosely coupled design in this system (e... |
Is anyone aware of a (preferablly free) webservice that would accept a SOAP or REST request.
This request would contain an IP address, and the service would return an approximation of that IP's location.
EDIT: I need resolution down to the city of possible.
| Yes, there are several web services that can provide geolocation data based on an IP address, with some offering free tiers. Here are a few options you can consider:
1. **ip-api.com**
- **Type**: REST API
- **Free Tier**: Yes, limited usage
- **Endpoint**: `http://ip-api.com/json/{ip}`
- **Details**: This ... | 22,438 | [
{
"from": "human",
"value": "Is anyone aware of a (preferablly free) webservice that would accept a SOAP or REST request.\nThis request would contain an IP address, and the service would return an approximation of that IP's location.\nEDIT: I need resolution down to the city of possible.\n"
},
{
"fr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.