qid int64 4 8.14M | question stringlengths 20 48.3k | answers list | date stringlengths 10 10 | metadata list | input stringlengths 12 45k | output stringlengths 2 31.8k |
|---|---|---|---|---|---|---|
174,885 | <p>I've got this code:</p>
<pre><code>rs1 = getResults(sSQL1)
rs2 = getResults(sSQL2)
</code></pre>
<p>rs1 and rs2 and 2D arrays. The first index represents the number of columns (static) and the second index represents the number of rows (dynamic).</p>
<p>I need to join the two arrays and store them in rs3. I don... | [
{
"answer_id": 174897,
"author": "Joel Coehoorn",
"author_id": 3043,
"author_profile": "https://Stackoverflow.com/users/3043",
"pm_score": 1,
"selected": false,
"text": "<p>Are you sure that the columns will match up? Because if that's not the case I don't know how you'd do it in a gene... | 2008/10/06 | [
"https://Stackoverflow.com/questions/174885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9825/"
] | I've got this code:
```
rs1 = getResults(sSQL1)
rs2 = getResults(sSQL2)
```
rs1 and rs2 and 2D arrays. The first index represents the number of columns (static) and the second index represents the number of rows (dynamic).
I need to join the two arrays and store them in rs3. I don't know what type rs1 and rs2 are t... | I've figured it out. Turns out I was doing it the right way all along, I was just off by one. You don't need a third array either.
```
aRS_RU = rowsQuery(sSQL & ", 'RU'")
aRS_KR = rowsQuery(sSQL & ", 'KR'")
uboundRU1 = UBound(aRS_RU, 1)
uboundRU2 = UBound(aRS_RU, 2)
uboundKR2 =... |
174,888 | <p>i want to find the mime-type for a given file extension on an IIS ASP.NET web-server from the code-behind file.</p>
<p>i want to search the same list that the server itself uses when serving up a file. This means that any mime types a web-server administrator has added to the <em>Mime Map</em> will be included.</p... | [
{
"answer_id": 174963,
"author": "liggett78",
"author_id": 19762,
"author_profile": "https://Stackoverflow.com/users/19762",
"pm_score": 1,
"selected": false,
"text": "<p>IIS stores the MIME information in its own database. Searching for \"MimeMap IIS\" on the internet will reveal how to... | 2008/10/06 | [
"https://Stackoverflow.com/questions/174888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12597/"
] | i want to find the mime-type for a given file extension on an IIS ASP.NET web-server from the code-behind file.
i want to search the same list that the server itself uses when serving up a file. This means that any mime types a web-server administrator has added to the *Mime Map* will be included.
i could blindly use... | Here's one I made earlier:
```
public static string GetMimeTypeFromExtension(string extension)
{
using (DirectoryEntry mimeMap =
new DirectoryEntry("IIS://Localhost/MimeMap"))
{
PropertyValueCollection propValues = mimeMap.Properties["MimeMap"];
foreach (object value in propValues)... |
174,890 | <p>I've discovered that cElementTree is about 30 times faster than <code>xml.dom.minidom</code> and I'm rewriting my XML encoding/decoding code. However, I need to output XML that contains CDATA sections and there doesn't seem to be a way to do that with ElementTree.</p>
<p>Can it be done?</p>
| [
{
"answer_id": 175016,
"author": "Dan Lenski",
"author_id": 20789,
"author_profile": "https://Stackoverflow.com/users/20789",
"pm_score": 3,
"selected": false,
"text": "<p>It's not possible AFAIK... which is a pity. Basically, ElementTree modules assume that the reader is 100% XML compl... | 2008/10/06 | [
"https://Stackoverflow.com/questions/174890",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15109/"
] | I've discovered that cElementTree is about 30 times faster than `xml.dom.minidom` and I'm rewriting my XML encoding/decoding code. However, I need to output XML that contains CDATA sections and there doesn't seem to be a way to do that with ElementTree.
Can it be done? | After a bit of work, I found the answer myself. Looking at the ElementTree.py source code, I found there was special handling of XML comments and preprocessing instructions. What they do is create a factory function for the special element type that uses a special (non-string) tag value to differentiate it from regular... |
174,891 | <p>Last week we released Omniture's analytics code onto a large volume of web sites after tinkering and testing for the last week or so.</p>
<p>On almost all of our site templates, it works just fine. In a few scattered, unpredictable situations, there is a <em>crippling, browser-crashing experience</em> that <em>may<... | [
{
"answer_id": 175068,
"author": "Sergey Ilinsky",
"author_id": 23815,
"author_profile": "https://Stackoverflow.com/users/23815",
"pm_score": 1,
"selected": false,
"text": "<p>DOM doesn't provide any means to introspecting through the events listeners' collections associated with a node.... | 2008/10/06 | [
"https://Stackoverflow.com/questions/174891",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22491/"
] | Last week we released Omniture's analytics code onto a large volume of web sites after tinkering and testing for the last week or so.
On almost all of our site templates, it works just fine. In a few scattered, unpredictable situations, there is a *crippling, browser-crashing experience* that *may* turn away some user... | I did an "inspect element" on a link in that page with firebug, and in the DOM tab it says there is an onclick function (anonymous), and also some other function called "s\_onclick\_0".
I coaxed firebug placing a watch like
```
alert(document.links[0].onclick)
```
to alert me the onclick function that omniture (i ... |
174,912 | <p>I am a bit confused about the uses of these words. I have a table with he following columns: SITE, LAT, LONG, NAME, ......</p>
<p>I want results with unique (or is it distinct) LAT, LONG.
How do I achieve this?</p>
| [
{
"answer_id": 174941,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "<p>AFAIR both mean the same. To get unique vel distinct LAT & LONG from your table just do:</p>\n\n<p>SELECT DISTINCT LAT,... | 2008/10/06 | [
"https://Stackoverflow.com/questions/174912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I am a bit confused about the uses of these words. I have a table with he following columns: SITE, LAT, LONG, NAME, ......
I want results with unique (or is it distinct) LAT, LONG.
How do I achieve this? | ```
select unique colA, colB from atable
select distinct colA, colB from atable
```
In this context, unique and distinct mean the same thing.
Distinct however is ANSI standard, whereas unique is not.
Please note that unique has many other meanings when used in other area's ie index creation etc. |
174,914 | <p>Is there a recommended way to upgrade Quartz in JBoss 4.2.x?</p>
<p>JBoss bundles quartz 1.5.2, but I have encountered issues (<a href="http://jira.opensymphony.com/browse/QUARTZ-399" rel="nofollow noreferrer">QUARTZ-399</a>, <a href="http://jira.opensymphony.com/browse/QUARTZ-520" rel="nofollow noreferrer">QUARTZ-... | [
{
"answer_id": 174941,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "<p>AFAIR both mean the same. To get unique vel distinct LAT & LONG from your table just do:</p>\n\n<p>SELECT DISTINCT LAT,... | 2008/10/06 | [
"https://Stackoverflow.com/questions/174914",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12039/"
] | Is there a recommended way to upgrade Quartz in JBoss 4.2.x?
JBoss bundles quartz 1.5.2, but I have encountered issues ([QUARTZ-399](http://jira.opensymphony.com/browse/QUARTZ-399), [QUARTZ-520](http://jira.opensymphony.com/browse/QUARTZ-520)) that I want to avoid.
I would not want to patch quartz.jar in JBoss just t... | ```
select unique colA, colB from atable
select distinct colA, colB from atable
```
In this context, unique and distinct mean the same thing.
Distinct however is ANSI standard, whereas unique is not.
Please note that unique has many other meanings when used in other area's ie index creation etc. |
174,916 | <p>I'm specifying my doctype as xhtml strict, but it's being sent over the wire as a content type of text/html. I'd like to specify that the content type is application/xhtml+xm, but I can't figure out where, or if, I can configure this from within my application</p>
| [
{
"answer_id": 174926,
"author": "Mitchel Sellers",
"author_id": 13279,
"author_profile": "https://Stackoverflow.com/users/13279",
"pm_score": 5,
"selected": true,
"text": "<p>You can specify it in the @ page attributes section, like this:</p>\n\n<pre><code><%@ Page ContentType=\"appl... | 2008/10/06 | [
"https://Stackoverflow.com/questions/174916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I'm specifying my doctype as xhtml strict, but it's being sent over the wire as a content type of text/html. I'd like to specify that the content type is application/xhtml+xm, but I can't figure out where, or if, I can configure this from within my application | You can specify it in the @ page attributes section, like this:
```
<%@ Page ContentType="application/xhtml+xm" %>
```
...more on [MSDN](http://msdn.microsoft.com/en-us/library/ydy4x04a(v=vs.100).aspx). |
174,923 | <p>I have a btnSave_Click() function in my code-behind. If a user clicks the save button (image) I created, it calls this function:</p>
<pre><code>protected void btnSave_Click(object sender, EventArgs e)
{
this.saveForm();
txtMessages.Text = "Save Complete";
}
</code></pre>
<p>The saveForm() function obviously saves ... | [
{
"answer_id": 174936,
"author": "Inisheer",
"author_id": 2982,
"author_profile": "https://Stackoverflow.com/users/2982",
"pm_score": 0,
"selected": false,
"text": "<p>It will only show \"Save Complete\" once the previous operation is complete.</p>\n\n<p>I typically put these types of me... | 2008/10/06 | [
"https://Stackoverflow.com/questions/174923",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25538/"
] | I have a btnSave\_Click() function in my code-behind. If a user clicks the save button (image) I created, it calls this function:
```
protected void btnSave_Click(object sender, EventArgs e)
{
this.saveForm();
txtMessages.Text = "Save Complete";
}
```
The saveForm() function obviously saves the form (through stored ... | This is a synchronous method. It's going to wait until the saveForm() method has returned (exited) it's completion before it can move on. |
174,933 | <p>How can I get a single keyboard character from the terminal with Ruby without pressing enter?
I tried <code>Curses::getch</code>, but that didn't really work for me.</p>
| [
{
"answer_id": 174967,
"author": "Jay",
"author_id": 20840,
"author_profile": "https://Stackoverflow.com/users/20840",
"pm_score": 6,
"selected": true,
"text": "<p><a href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/2999\" rel=\"noreferrer\">http://blade.nagaokaut.ac.jp... | 2008/10/06 | [
"https://Stackoverflow.com/questions/174933",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25017/"
] | How can I get a single keyboard character from the terminal with Ruby without pressing enter?
I tried `Curses::getch`, but that didn't really work for me. | <http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/2999>
```
#!/usr/bin/ruby
begin
system("stty raw -echo")
str = STDIN.getc
ensure
system("stty -raw echo")
end
p str.chr
```
(Tested on my OS X system, may not be portable to all Ruby platforms). See <http://www.rubyquiz.com/quiz5.html> for some addi... |
174,986 | <p>I create a TextArea in actionscript:</p>
<pre><code>var textArea:TextArea = new TextArea();
</code></pre>
<p>I want it to have a black background. I've tried</p>
<pre><code>textArea.setStyle("backgroundColor", 0x000000);
</code></pre>
<p>and I've tried</p>
<pre><code>textArea.opaqueBackground = 0x000000;
</cod... | [
{
"answer_id": 175914,
"author": "nerdabilly",
"author_id": 8349,
"author_profile": "https://Stackoverflow.com/users/8349",
"pm_score": 4,
"selected": true,
"text": "<p>TextArea is a UI component built from TextField and other Flash built-in classes and UIComponents. As with most of the ... | 2008/10/06 | [
"https://Stackoverflow.com/questions/174986",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15371/"
] | I create a TextArea in actionscript:
```
var textArea:TextArea = new TextArea();
```
I want it to have a black background. I've tried
```
textArea.setStyle("backgroundColor", 0x000000);
```
and I've tried
```
textArea.opaqueBackground = 0x000000;
```
but the TextArea stays white. What should I do? | TextArea is a UI component built from TextField and other Flash built-in classes and UIComponents. As with most of the Adobe UI components, nothing is as it seems when setting properties. To set the color of the area behind the text in the TextArea, you need to actually set the opaque background of its internal TextFie... |
175,042 | <p>I have this solution for a single button:</p>
<pre><code>myButton.Attributes.Add("onclick", "this.disabled=true;" + GetPostBackEventReference(myButton).ToString());
</code></pre>
<p>Which works pretty well for one button, any ideas on how to expand this to 2 buttons?</p>
| [
{
"answer_id": 175060,
"author": "FlySwat",
"author_id": 1965,
"author_profile": "https://Stackoverflow.com/users/1965",
"pm_score": 3,
"selected": true,
"text": "<p>You could add an clientside onSubmit handler, or you could do this:</p>\n\n<pre><code>myButton.Attributes.Add(\"onclick\",... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175042",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3208/"
] | I have this solution for a single button:
```
myButton.Attributes.Add("onclick", "this.disabled=true;" + GetPostBackEventReference(myButton).ToString());
```
Which works pretty well for one button, any ideas on how to expand this to 2 buttons? | You could add an clientside onSubmit handler, or you could do this:
```
myButton.Attributes.Add("onclick", "this.disabled=true; document.getElementById('"
+ button2.ClientID + "').disabled = true;"
+ GetPostBackEventReference(myButton).ToString());
``` |
175,055 | <p>I am running a series of JUnits using Apache ANT using JDK 1.5.</p>
<p>All JUnits that use an Oracle JDBC driver give the UnsatisfiedLinkError shown below.</p>
<p>What native library is it looking for and how do I solve this? What should the PATH variable contain?</p>
<pre><code>java.lang.UnsatisfiedLinkError: or... | [
{
"answer_id": 175092,
"author": "Shachar",
"author_id": 13897,
"author_profile": "https://Stackoverflow.com/users/13897",
"pm_score": 0,
"selected": false,
"text": "<p>Had this one, you should add classes12.jar or classes13.jar to your classpath (not sure about the name, it's been over ... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175055",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I am running a series of JUnits using Apache ANT using JDK 1.5.
All JUnits that use an Oracle JDBC driver give the UnsatisfiedLinkError shown below.
What native library is it looking for and how do I solve this? What should the PATH variable contain?
```
java.lang.UnsatisfiedLinkError: oracle/jdbc/driver/T2CConnecti... | Resolved!
It was actually an out-of-date ojdbc14.jar file causing this issue. All I did was update it and the problem is fixed now. The classes file
Thanks |
175,056 | <p>In a project I am working on, we have an ongoing discussion amongst the dev team - should the production environment be deployed as a checkout from the SVN repository or as an export?</p>
<p>The development environment is obviously a checkout, since it is constantly updated.
For the production, I'm personally for c... | [
{
"answer_id": 175073,
"author": "Shachar",
"author_id": 13897,
"author_profile": "https://Stackoverflow.com/users/13897",
"pm_score": 3,
"selected": false,
"text": "<p>IMHO you should create a branch/tag where you have the (desired) subset of the dev env which you use for production. So... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175056",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10585/"
] | In a project I am working on, we have an ongoing discussion amongst the dev team - should the production environment be deployed as a checkout from the SVN repository or as an export?
The development environment is obviously a checkout, since it is constantly updated.
For the production, I'm personally for checking ou... | [The Subversion FAQ](http://subversion.tigris.org/faq.html#website-auto-update) seems to advocate deployment as a checkout, autoupdated with post-commit hook scripts. They prevent Apache from exporting .svn folders (probably a good idea) by adding the following in httpd.conf:
```
# Disallow browsing of Subversion work... |
175,066 | <p>My database contains three tables called <code>Object_Table</code>, <code>Data_Table</code> and <code>Link_Table</code>. The link table just contains two columns, the identity of an object record and an identity of a data record.</p>
<p>I want to copy the data from <code>DATA_TABLE</code> where it is linked to one ... | [
{
"answer_id": 175104,
"author": "Craig",
"author_id": 2894,
"author_profile": "https://Stackoverflow.com/users/2894",
"pm_score": 2,
"selected": false,
"text": "<p>If you want the actions to be more or less atomic, I would make sure to wrap them in a transaction. That way you can be su... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18107/"
] | My database contains three tables called `Object_Table`, `Data_Table` and `Link_Table`. The link table just contains two columns, the identity of an object record and an identity of a data record.
I want to copy the data from `DATA_TABLE` where it is linked to one given object identity and insert corresponding records... | The following sets up the situation I had, using table variables.
```
DECLARE @Object_Table TABLE
(
Id INT NOT NULL PRIMARY KEY
)
DECLARE @Link_Table TABLE
(
ObjectId INT NOT NULL,
DataId INT NOT NULL
)
DECLARE @Data_Table TABLE
(
Id INT NOT NULL Identity(1,1),
Data VARCHAR(50) NOT NULL
)
-- cre... |
175,091 | <p>I'm trying to host a PHP web site that was given to me. I see this warning:</p>
<blockquote>
<p><strong>Warning:</strong> Unknown: Your script possibly
relies on a session side-effect which
existed until PHP 4.2.3. Please be
advised that the session extension
does not consider global variables as
a sou... | [
{
"answer_id": 175145,
"author": "Owen",
"author_id": 4853,
"author_profile": "https://Stackoverflow.com/users/4853",
"pm_score": 8,
"selected": true,
"text": "<p>basically you have a variable with the same name as your session. ex:</p>\n\n<pre><code>$_SESSION['var1'] = null;\n$var1 = 's... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/83/"
] | I'm trying to host a PHP web site that was given to me. I see this warning:
>
> **Warning:** Unknown: Your script possibly
> relies on a session side-effect which
> existed until PHP 4.2.3. Please be
> advised that the session extension
> does not consider global variables as
> a source of data, unless
> regist... | basically you have a variable with the same name as your session. ex:
```
$_SESSION['var1'] = null;
$var1 = 'something';
```
which will reproduce this error. you can stop PHP from trying to find existing variables and warning you about them by adding these lines to your script:
```
ini_set('session.bug_compat_warn'... |
175,099 | <p>Does anyone have a good algorithm for re-sorting an array of values (already pre-sorted) so that they can be displayed in multiple (N) columns and be read vertically? This would be implemented in .Net but I'd prefer something portable and not some magic function.</p>
<p>A good example of it working is the ASP.Net C... | [
{
"answer_id": 175516,
"author": "Eric",
"author_id": 6367,
"author_profile": "https://Stackoverflow.com/users/6367",
"pm_score": 1,
"selected": false,
"text": "<p>This looks like homework assignments\nanyway</p>\n\n<pre><code>array<String^>^ sArray = {\"A\", \"B\", \"C\", \"D\", ... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175099",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25549/"
] | Does anyone have a good algorithm for re-sorting an array of values (already pre-sorted) so that they can be displayed in multiple (N) columns and be read vertically? This would be implemented in .Net but I'd prefer something portable and not some magic function.
A good example of it working is the ASP.Net CheckBoxLis... | Okay, I'm sorry for my initial statement, but when you want it to work as you described in the comment to my first answer, you need in fact re-sort the data... well somewhat. It could maybe be done without the helper matrix, however the resulting code is probably very complex and as long as the matrix will only use a c... |
175,103 | <p>I have a <a href="http://en.wikipedia.org/wiki/Uniform_resource_locator" rel="noreferrer">URL</a>, and I'm trying to match it to a regular expression to pull out some groups. The problem I'm having is that the URL can either end <em>or</em> continue with a "/" and more URL text. I'd like to match URLs like this:</p>... | [
{
"answer_id": 175141,
"author": "Adam Tegen",
"author_id": 4066,
"author_profile": "https://Stackoverflow.com/users/4066",
"pm_score": 7,
"selected": true,
"text": "<pre class=\"lang-none prettyprint-override\"><code>/(.+)/(\\d{4}-\\d{2}-\\d{2})-(\\d+)(/.*)?$\n</code></pre>\n<p><strong>... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175103",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/404/"
] | I have a [URL](http://en.wikipedia.org/wiki/Uniform_resource_locator), and I'm trying to match it to a regular expression to pull out some groups. The problem I'm having is that the URL can either end *or* continue with a "/" and more URL text. I'd like to match URLs like this:
* <http://server/xyz/2008-10-08-4>
* <ht... | ```none
/(.+)/(\d{4}-\d{2}-\d{2})-(\d+)(/.*)?$
```
**1st Capturing Group `(.+)`**
`.+` matches any character (except for line terminators)
* `+` **Quantifier** — Matches between **one** and **unlimited** times, as many times as possible, giving back as needed *(greedy)*
**2nd Capturing Group `(\d{4}-\d{2}-\d{2})`*... |
175,109 | <p>I'm doing some research into using log4net, and I found the <em>IObjectRenderer</em> interface interesting. It would allow us to control how types are logged and provide a different, possibly more user-friendly <code>ToString()</code> implementation. I just started looking at log4net though, and can't seem to find... | [
{
"answer_id": 175111,
"author": "OwenP",
"author_id": 2547,
"author_profile": "https://Stackoverflow.com/users/2547",
"pm_score": 4,
"selected": true,
"text": "<p>I poked around with it some while writing the question and came up with this:</p>\n\n<pre><code>using System.IO;\nusing log4... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2547/"
] | I'm doing some research into using log4net, and I found the *IObjectRenderer* interface interesting. It would allow us to control how types are logged and provide a different, possibly more user-friendly `ToString()` implementation. I just started looking at log4net though, and can't seem to find a logical way to progr... | I poked around with it some while writing the question and came up with this:
```
using System.IO;
using log4net;
using log4net.Config;
using log4net.ObjectRenderer;
using log4net.Util;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
BasicConfigura... |
175,115 | <p>[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:</p>
<pre><code>document.onmousemove = (function() {
var onmousestop = function() {
Tip('Click to search here');
document.getE... | [
{
"answer_id": 175139,
"author": "theraccoonbear",
"author_id": 7210,
"author_profile": "https://Stackoverflow.com/users/7210",
"pm_score": 2,
"selected": false,
"text": "<p>Here's a nifty jQuery plugin for a nice float over tool tip.</p>\n\n<p><a href=\"http://jqueryfordesigners.com/dem... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5234/"
] | [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('MyDi... | A bit late to be answering this, but this will be helpful for those in need.
I needed this function to be able to detect when the mouse stopped moving for a certain time to hide an HTML/JS player controller when hovering over a video. This is the revised code for the tooltip:
```
document.getElementById('MyDiv').onmo... |
175,170 | <p>What function can I use in Excel VBA to slice an array?</p>
| [
{
"answer_id": 175178,
"author": "Lance Roberts",
"author_id": 13295,
"author_profile": "https://Stackoverflow.com/users/13295",
"pm_score": 7,
"selected": true,
"text": "<blockquote>\n <p><strong>Application.WorksheetFunction.Index(array, row, column)</strong></p>\n</blockquote>\n\n<p>... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175170",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13295/"
] | What function can I use in Excel VBA to slice an array? | >
> **Application.WorksheetFunction.Index(array, row, column)**
>
>
>
If you specify a zero value for row or column, then you'll get the entire column or row that is specified.
Example:
>
> Application.WorksheetFunction.Index(array, 0, 3)
>
>
>
This will give you the entire 3rd column.
If you specify both ... |
175,186 | <p>Let's say I have this type in my application:</p>
<pre><code>public class A {
public int id;
public B b;
public boolean equals(Object another) { return this.id == ((A)another).id; }
public int hashCode() { return 31 * id; //nice prime number }
}
</code></pre>
<p>and a <code>Set<code><A</code>></code> s... | [
{
"answer_id": 175211,
"author": "Paul Tomblin",
"author_id": 3333,
"author_profile": "https://Stackoverflow.com/users/3333",
"pm_score": 5,
"selected": false,
"text": "<p>Since a Set can only contain one instance of an object (as defined by its <code>equals</code> and <code>hashCode</co... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175186",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2819/"
] | Let's say I have this type in my application:
```
public class A {
public int id;
public B b;
public boolean equals(Object another) { return this.id == ((A)another).id; }
public int hashCode() { return 31 * id; //nice prime number }
}
```
and a `Set`<A`>` structure. Now, I have an object of type `A` and wan... | Since a Set can only contain one instance of an object (as defined by its `equals` and `hashCode` methods), just remove it and then add it. If there was one already, that other one will be removed from the Set and replaced by the one you want.
I have code that does something similar - I am caching objects so that ever... |
175,205 | <p>Consider the following code:</p>
<pre><code>$("a").attr("disabled", "disabled");
</code></pre>
<p>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... | [
{
"answer_id": 175221,
"author": "Neall",
"author_id": 619,
"author_profile": "https://Stackoverflow.com/users/619",
"pm_score": 4,
"selected": true,
"text": "<p>I assume that you have an onclick event handler bound to these anchor elements. Just have your event handler check the \"disab... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175205",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19704/"
] | 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 attr... | I assume that you have an onclick event handler bound to these anchor elements. Just have your event handler check the "disabled" attribute and cancel the event if it is set. Your event handler would look something like this:
```
$("a").click(function(event){
if (this.disabled) {
event.preventDefault();
} else... |
175,228 | <p>Is it ever appropriate to abandon the "getMyValue()" and "setMyValue()" pattern of getters and setters if alternative function names make the API more obvious?</p>
<p>For example, imagine I have this class in C++:</p>
<pre><code>
public class SomeClass {
private:
bool mIsVisible;
public:
void draw();
... | [
{
"answer_id": 175233,
"author": "Adam Bellaire",
"author_id": 21632,
"author_profile": "https://Stackoverflow.com/users/21632",
"pm_score": 3,
"selected": false,
"text": "<p>In the example you gave, <code>show()</code> and <code>hide()</code> make a lot of sense, at least to me. </p>\n... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2289/"
] | Is it ever appropriate to abandon the "getMyValue()" and "setMyValue()" pattern of getters and setters if alternative function names make the API more obvious?
For example, imagine I have this class in C++:
```
public class SomeClass {
private:
bool mIsVisible;
public:
void draw();
void erase();
}
```
... | Have a read of the article "[Tell, Don't Ask](http://www.pragprog.com/articles/tell-dont-ask)" over at the Pragmatic Programmers web site and I think you'll see that the second example is the way to go.
Basically, you shouldn't be spreading the logic out through your code which is implied with your first example, name... |
175,236 | <p>Actually, I'm using this way. Do you have a better way?</p>
<pre><code>private bool AcceptJson(HttpRequest request)
{
const string JsonType = "application/json";
if (request.ContentType.ToLower(CultureInfo.InvariantCulture).StartsWith(JsonType))
{
return true;
}
if (request.AcceptTypes... | [
{
"answer_id": 175321,
"author": "Quentin",
"author_id": 19068,
"author_profile": "https://Stackoverflow.com/users/19068",
"pm_score": 3,
"selected": true,
"text": "<p>That approach can lead to false positives (it doesn't account for q values or content types of which application/json is... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175236",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20683/"
] | Actually, I'm using this way. Do you have a better way?
```
private bool AcceptJson(HttpRequest request)
{
const string JsonType = "application/json";
if (request.ContentType.ToLower(CultureInfo.InvariantCulture).StartsWith(JsonType))
{
return true;
}
if (request.AcceptTypes.Select(t => t... | That approach can lead to false positives (it doesn't account for q values or content types of which application/json is a substring).
You can find a decent Accept header parser in [this article about XHTML](http://www.dev-archive.net/articles/xhtml.html#content-negotiation). You'll have to port the algorithm to your ... |
175,240 | <p>I use a 3rd party tool that outputs a file in Unicode format. However, I prefer it to be in ASCII. The tool does not have settings to change the file format.</p>
<p>What is the best way to convert the entire file format using Python?</p>
| [
{
"answer_id": 175258,
"author": "Pete Karl II",
"author_id": 22491,
"author_profile": "https://Stackoverflow.com/users/22491",
"pm_score": 4,
"selected": false,
"text": "<p><em>I think this is a deeper issue than you realize</em>. Simply changing the file from Unicode into ASCII is easy... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4872/"
] | I use a 3rd party tool that outputs a file in Unicode format. However, I prefer it to be in ASCII. The tool does not have settings to change the file format.
What is the best way to convert the entire file format using Python? | You can convert the file easily enough just using the `unicode` function, but you'll run into problems with Unicode characters without a straight ASCII equivalent.
[This blog](http://www.peterbe.com/plog/unicode-to-ascii) recommends the `[unicodedata](http://www.python.org/doc/2.5.2/lib/module-unicodedata.html)` modu... |
175,296 | <p>I use TortoiseSVN 1.5.3 and VisualSVN 1.5.3 (Subversion 1.5.2)</p>
<p>Suppose that I create a new branch (/branches/branch1) of the trunk(/trunk) then someone (also using TortoiseSVN 1.5.3) merges their branch back into the trunk. </p>
<p>I try to merge from the trunk into the branch (to aquire all changes which m... | [
{
"answer_id": 175524,
"author": "Nick DeVore",
"author_id": 1380,
"author_profile": "https://Stackoverflow.com/users/1380",
"pm_score": 0,
"selected": false,
"text": "<p>I think you need to use the Branch as your from URL. The reason is that your Trunk revision is now higher than your ... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175296",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11356/"
] | I use TortoiseSVN 1.5.3 and VisualSVN 1.5.3 (Subversion 1.5.2)
Suppose that I create a new branch (/branches/branch1) of the trunk(/trunk) then someone (also using TortoiseSVN 1.5.3) merges their branch back into the trunk.
I try to merge from the trunk into the branch (to aquire all changes which might have beemn m... | SOLVED: The answer appears to be down to a workaround we implemented here for some previous bugs in Subversion.
The workaround involved the use of SomeUserName@ being placed in the url. thus
```
http://SomeUsername@Myserver:8080/myrepo/trunk
```
...was being used instead of...
```
http://Myserver:8080/myrepo/trunk... |
175,323 | <p>As I am coding my unit tests, I tend to find that I insert the following lines:</p>
<pre><code>Console.WriteLine("Starting InteropApplication, with runInBackground set to true...");
try
{
InteropApplication application = new InteropApplication(true);
application.Start();
Console.WriteLine("Application s... | [
{
"answer_id": 175331,
"author": "David Arno",
"author_id": 7122,
"author_profile": "https://Stackoverflow.com/users/7122",
"pm_score": 2,
"selected": false,
"text": "<p>I personally would recommend that you output only errors and a summary of the number of tests run and how many passed.... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175323",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8505/"
] | As I am coding my unit tests, I tend to find that I insert the following lines:
```
Console.WriteLine("Starting InteropApplication, with runInBackground set to true...");
try
{
InteropApplication application = new InteropApplication(true);
application.Start();
Console.WriteLine("Application started correct... | I personally would recommend that you output only errors and a summary of the number of tests run and how many passed. This is a completely subjective view though. Display what suits your needs. |
175,381 | <p>I'm trying to grab a div's ID in the code behind (C#) and set some css on it. Can I grab it from the DOM or do I have to use some kind of control?</p>
<pre><code><div id="formSpinner">
<img src="images/spinner.gif" />
<p>Saving...</p>
</div>
</code></pre>
| [
{
"answer_id": 175402,
"author": "Jeremy Frey",
"author_id": 13412,
"author_profile": "https://Stackoverflow.com/users/13412",
"pm_score": 2,
"selected": false,
"text": "<p>Add the runat=\"server\" attribute to the tag, then you can reference it from the codebehind.</p>\n"
},
{
"... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25538/"
] | I'm trying to grab a div's ID in the code behind (C#) and set some css on it. Can I grab it from the DOM or do I have to use some kind of control?
```
<div id="formSpinner">
<img src="images/spinner.gif" />
<p>Saving...</p>
</div>
``` | Add the `runat="server"` attribute to it so you have:
```
<div id="formSpinner" runat="server">
<img src="images/spinner.gif">
<p>Saving...</p>
</div>
```
That way you can access the class attribute by using:
```
formSpinner.Attributes["class"] = "classOfYourChoice";
```
It's also worth mentioning that th... |
175,385 | <p>When setting up a rollover effect in HTML, are there any benefits (or pitfalls) to doing it in CSS vs. JavaScript? Are there any performance or code maintainability issues I should be aware of with either approach?</p>
| [
{
"answer_id": 175394,
"author": "warren",
"author_id": 4418,
"author_profile": "https://Stackoverflow.com/users/4418",
"pm_score": 0,
"selected": false,
"text": "<p>I'd stay on the CSS side of the house, but I've done very little Javascript.</p>\n\n<p>CSS seems to be easier to standardi... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2470/"
] | When setting up a rollover effect in HTML, are there any benefits (or pitfalls) to doing it in CSS vs. JavaScript? Are there any performance or code maintainability issues I should be aware of with either approach? | CSS is fine for rollovers. They're implemented basically using the `:hover` pseudo-selector. Here's a really simple implementation:
```
a{
background-image: url(non-hovered-state.png);
}
a:hover{
background-image: url(hovered-state.png);
}
```
There are a few things you need to be aware of though:
* IE6 onl... |
175,415 | <p>What is the best way to get the names of all of the tables in a specific database on SQL Server?</p>
| [
{
"answer_id": 175417,
"author": "Ray",
"author_id": 4872,
"author_profile": "https://Stackoverflow.com/users/4872",
"pm_score": 3,
"selected": false,
"text": "<pre><code>exec sp_msforeachtable 'print ''?'''\n</code></pre>\n"
},
{
"answer_id": 175423,
"author": "spoulson",
... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175415",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4872/"
] | What is the best way to get the names of all of the tables in a specific database on SQL Server? | SQL Server 2000, 2005, 2008, 2012, 2014, 2016, 2017 or 2019:
```
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'
```
To show only tables from a particular database
```
SELECT TABLE_NAME
FROM [<DATABASE_NAME>].INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
```
Or,
```
SELECT TAB... |
175,454 | <p>I am working on a web application and I have run into the following situation.</p>
<pre><code>Dim a as Object
Dim i as Integer = 0
Try
For i=1 to 5
a = new Object()
'Do stuff '
a = Nothing
Next
Catch
Finally
a = Nothing
End Try
</code></pre>
<p>Do i need to do the a=Not... | [
{
"answer_id": 175460,
"author": "Epaga",
"author_id": 6583,
"author_profile": "https://Stackoverflow.com/users/6583",
"pm_score": 2,
"selected": false,
"text": "<p>No you don't need it. .NET has garbage collection. And since it looks like this code is in a method scope the garbage colle... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175454",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1001650/"
] | I am working on a web application and I have run into the following situation.
```
Dim a as Object
Dim i as Integer = 0
Try
For i=1 to 5
a = new Object()
'Do stuff '
a = Nothing
Next
Catch
Finally
a = Nothing
End Try
```
Do i need to do the a=Nothing in the loop or will t... | In .NET, you generally do not **need** to set a variable reference = `Nothing` (`null` in C#). The garbage collector will clean up, eventually. The reference itself will be destroyed when it goes out of scope (either when your method exits or when the object of this class is finalized.) Note that this doesn't mean the ... |
175,544 | <p>I'm trying to write a tennis reservation system and I got stucked with this problem.
Let's say you have players with their prefs regarding court number, day and hour.
Also every player is ranked so if there is day/hour slot and there are several players
with preferences for this slot the one with top priority should... | [
{
"answer_id": 175585,
"author": "Claudiu",
"author_id": 15055,
"author_profile": "https://Stackoverflow.com/users/15055",
"pm_score": 2,
"selected": false,
"text": "<p>This is an NP-complete problem, I think, so it'll be impossible to have a very fast algorithm for any large data sets. ... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175544",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25587/"
] | I'm trying to write a tennis reservation system and I got stucked with this problem.
Let's say you have players with their prefs regarding court number, day and hour.
Also every player is ranked so if there is day/hour slot and there are several players
with preferences for this slot the one with top priority should be... | This is an NP-complete problem, I think, so it'll be impossible to have a very fast algorithm for any large data sets.
There's also the problem where you might have a schedule that is impossible to make. Given that that's not the case, something like this pseudocode is probably your best bet:
```
sort players by pri... |
175,547 | <p>How you fix the following Hibernate error:</p>
<p>What does "Use of the same entity name twice".</p>
| [
{
"answer_id": 175599,
"author": "toolkit",
"author_id": 3295,
"author_profile": "https://Stackoverflow.com/users/3295",
"pm_score": 0,
"selected": false,
"text": "<p>I think it means you have declared the same entity in more than one configuration file.</p>\n\n<p>Without more informatio... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175547",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | How you fix the following Hibernate error:
What does "Use of the same entity name twice". | This exception occures when you have more then one @Entity with the same class's name or explicit name.
To fix the issue you have to set different explicit names for each entity.
Example of error case:
```
package A;
@Entity
class Cell{
...
}
package B;
@Entity
class Cell{
...
}
```
Solution example:
pa... |
175,554 | <p>I need to convert an arbitrary amount of milliseconds into Days, Hours, Minutes Second.</p>
<p>For example: 10 Days, 5 hours, 13 minutes, 1 second.</p>
| [
{
"answer_id": 175565,
"author": "theraccoonbear",
"author_id": 7210,
"author_profile": "https://Stackoverflow.com/users/7210",
"pm_score": 2,
"selected": false,
"text": "<p>I would suggest using whatever date/time functions/libraries your language/framework of choice provides. Also che... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1965/"
] | I need to convert an arbitrary amount of milliseconds into Days, Hours, Minutes Second.
For example: 10 Days, 5 hours, 13 minutes, 1 second. | Well, since nobody else has stepped up, I'll write the easy code to do this:
```
x = ms / 1000
seconds = x % 60
x /= 60
minutes = x % 60
x /= 60
hours = x % 24
x /= 24
days = x
```
I'm just glad you stopped at days and didn't ask for months. :)
Note that in the above, it is assumed that `/` represents truncating in... |
175,621 | <p>I want completely automated integration testing for a Maven project. The integration tests require that an external (platform-dependent) program is started before running. Ideally, the external program would be killed after the unit tests are finished, but is not necessary. </p>
<p>Is there a Maven plugin to acc... | [
{
"answer_id": 175664,
"author": "sblundy",
"author_id": 4893,
"author_profile": "https://Stackoverflow.com/users/4893",
"pm_score": 3,
"selected": true,
"text": "<p>You could use the <a href=\"http://maven.apache.org/plugins/maven-antrun-plugin/\" rel=\"nofollow noreferrer\">antrun</a> ... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12880/"
] | I want completely automated integration testing for a Maven project. The integration tests require that an external (platform-dependent) program is started before running. Ideally, the external program would be killed after the unit tests are finished, but is not necessary.
Is there a Maven plugin to accomplish this?... | You could use the [antrun](http://maven.apache.org/plugins/maven-antrun-plugin/) plugin. Inside you would use ant's [exec](http://ant.apache.org/manual/Tasks/exec.html) [apply](http://ant.apache.org/manual/Tasks/apply.html) task.
Something like this.
```
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<a... |
175,649 | <p>I'm working on a project where I have 2 web services that need the same entity. The 2 web services are on the same server so on the back-end, they share the same classes. </p>
<p>On the front-end side, my code consumes <em>both</em> web services and sees the entities from both services as separate (in different nam... | [
{
"answer_id": 175744,
"author": "matt b",
"author_id": 4249,
"author_profile": "https://Stackoverflow.com/users/4249",
"pm_score": 1,
"selected": false,
"text": "<p>I'm not sure about the implementation details with .NET 2.0, but I believe what you want to do is put the common classes i... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/392/"
] | I'm working on a project where I have 2 web services that need the same entity. The 2 web services are on the same server so on the back-end, they share the same classes.
On the front-end side, my code consumes *both* web services and sees the entities from both services as separate (in different namespaces) so I can... | I think that you can not do that from inside VS but you can manually use the `wsdl.exe` utility like this:
```
wsdl.exe /sharetypes http://localhost/MyService1.asmx?wsdl http://localhost/MyService2.asmx?wsdl
```
Notice the `/sharetypes` option which turns on the type sharing feature. This feature creates one code fi... |
175,655 | <p>We recently had a problem where, after a series of commits had occurred, a backend process failed to run. Now, we were good little boys and girls and ran <code>rake test</code> after every check-in but, due to some oddities in Rails' library loading, it only occurred when we ran it directly from Mongrel in productio... | [
{
"answer_id": 175946,
"author": "Ken",
"author_id": 20621,
"author_profile": "https://Stackoverflow.com/users/20621",
"pm_score": 3,
"selected": false,
"text": "<p>This may help but you would have to code it yourself. Pasted from the blog:</p>\n\n<blockquote>\n <p>Ruby provides a meth... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2590/"
] | We recently had a problem where, after a series of commits had occurred, a backend process failed to run. Now, we were good little boys and girls and ran `rake test` after every check-in but, due to some oddities in Rails' library loading, it only occurred when we ran it directly from Mongrel in production mode.
I tra... | This is really late, but here's how you can find where a method is defined:
<http://gist.github.com/76951>
```
# How to find out where a method comes from.
# Learned this from Dave Thomas while teaching Advanced Ruby Studio
# Makes the case for separating method definitions into
# modules, especially when enhancing b... |
175,689 | <p>I know you can use C++ keyword 'explicit' for constructors of classes to prevent an automatic conversion of type. Can you use this same command to prevent the conversion of parameters for a class method?</p>
<p>I have two class members, one which takes a bool as a param, the other an unsigned int. When I called t... | [
{
"answer_id": 175716,
"author": "Superpolock",
"author_id": 16496,
"author_profile": "https://Stackoverflow.com/users/16496",
"pm_score": 0,
"selected": false,
"text": "<p>Compiler gave \"ambiguous call\" warning, which will be sufficient. </p>\n\n<p>I was doing TDD development and did... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16496/"
] | I know you can use C++ keyword 'explicit' for constructors of classes to prevent an automatic conversion of type. Can you use this same command to prevent the conversion of parameters for a class method?
I have two class members, one which takes a bool as a param, the other an unsigned int. When I called the function ... | No, you can't use explicit, but you can use a templated function to catch the incorrect parameter types.
With **C++11**, you can declare the templated function as `delete`d. Here is a simple example:
```
#include <iostream>
struct Thing {
void Foo(int value) {
std::cout << "Foo: value" << std::endl;
... |
175,690 | <p>I know I could just ask, but that would involve bureaucratic entanglements.</p>
| [
{
"answer_id": 175701,
"author": "jj33",
"author_id": 430,
"author_profile": "https://Stackoverflow.com/users/430",
"pm_score": 0,
"selected": false,
"text": "<p>I believe that on an AD network that is DNS enabled the root zone points at all the AD servers. So, for instance, if your off... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9328/"
] | I know I could just ask, but that would involve bureaucratic entanglements. | Try ping or nslookup \_ldap.\_tcp. with your AD Domain (e.g. \_ldap.\_tcp.test.com) in a console (cmd.exe) - this should give you the AD Server IP.
```
_ldap._tcp.*
```
Is a general SRV entry made by your active directory server for locating LDAP (AD) servers in your domain. Your domain itself should match your Wind... |
175,695 | <p>How can I represent the following in XSD.</p>
<pre><code><price-update>
<![CDATA[
arbitrary data goes here
]]>
</price-update>
</code></pre>
| [
{
"answer_id": 175706,
"author": "Oliver Hallam",
"author_id": 19995,
"author_profile": "https://Stackoverflow.com/users/19995",
"pm_score": 5,
"selected": false,
"text": "<p>A CDATA tag is merely a means of escaping data as a text node. Therefore you cannot stipulate that you require a... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175695",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21297/"
] | How can I represent the following in XSD.
```
<price-update>
<![CDATA[
arbitrary data goes here
]]>
</price-update>
``` | ```
<element name="price-update" type="string"></element>
```
is about as close as you can get.
(I thought it best to move the answer out of the comments and into an actual answer). |
175,717 | <p>This is something that I have never fully grasped in .NET as to the correct application of the .dispose() method.</p>
<p>Say I have something like</p>
<pre><code>Public Class someClass()
sub someMethod
' do some stuff tying up resources
end sub
End Class
public class mainApp
dim _class as new SomeClass... | [
{
"answer_id": 175722,
"author": "Mark Cidade",
"author_id": 1659,
"author_profile": "https://Stackoverflow.com/users/1659",
"pm_score": 0,
"selected": false,
"text": "<p>The <code>Dispose()</code> method is used for cleaning up any resources early. Although the garbage collector reclaim... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175717",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11802/"
] | This is something that I have never fully grasped in .NET as to the correct application of the .dispose() method.
Say I have something like
```
Public Class someClass()
sub someMethod
' do some stuff tying up resources
end sub
End Class
public class mainApp
dim _class as new SomeClass
_class.someMethod(... | I highly recommend reading [Cleaning Up Unmanaged Resources](http://msdn.microsoft.com/en-us/library/498928w2(VS.80).aspx) on MSDN, it has articles touching on when to use Dispose and how to implement IDisposable correctly. Your gut instinct is mostly correct as you rarely have to implement IDisposable, unless your cla... |
175,723 | <p>I have a form where controls are dynamically added to a Panel. However, when they do so, they are many times added below the fold (bottom of the container). It's nice that the .NET Framework provides this ScrollControlIntoView method, however, for added usability, it would also be nice if there was an easy way to ... | [
{
"answer_id": 175722,
"author": "Mark Cidade",
"author_id": 1659,
"author_profile": "https://Stackoverflow.com/users/1659",
"pm_score": 0,
"selected": false,
"text": "<p>The <code>Dispose()</code> method is used for cleaning up any resources early. Although the garbage collector reclaim... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175723",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21807/"
] | I have a form where controls are dynamically added to a Panel. However, when they do so, they are many times added below the fold (bottom of the container). It's nice that the .NET Framework provides this ScrollControlIntoView method, however, for added usability, it would also be nice if there was an easy way to anima... | I highly recommend reading [Cleaning Up Unmanaged Resources](http://msdn.microsoft.com/en-us/library/498928w2(VS.80).aspx) on MSDN, it has articles touching on when to use Dispose and how to implement IDisposable correctly. Your gut instinct is mostly correct as you rarely have to implement IDisposable, unless your cla... |
175,726 | <p>c# windows forms: How do you create new settings at run time so that they are permanently saved as Settings.Default.-- values?</p>
| [
{
"answer_id": 175734,
"author": "OregonGhost",
"author_id": 20363,
"author_profile": "https://Stackoverflow.com/users/20363",
"pm_score": 3,
"selected": false,
"text": "<p>Since the Settings class is generated at build time (or, actually, whenever you update the settings file from withi... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | c# windows forms: How do you create new settings at run time so that they are permanently saved as Settings.Default.-- values? | Just in case that still matters to anyone:
You can dynamically add settings through `Settings.Default.Properties.Add(...)` and have these also persisted in the local storage after saving (I had those entries reflected in the roaming file).
Nevertheless it seems that the dynamically added settings keep missing in the ... |
175,733 | <p>I have two tables in my database, called <em>ratings</em> and <em>movies</em>.</p>
<p><strong>Ratings:</strong></p>
<blockquote>
<p><code>| id | movie_id | rating |</code></p>
</blockquote>
<p><strong>Movies:</strong></p>
<blockquote>
<p><code>| id | title |</code></p>
</blockquote>
<p>A typical movie record might b... | [
{
"answer_id": 175740,
"author": "theraccoonbear",
"author_id": 7210,
"author_profile": "https://Stackoverflow.com/users/7210",
"pm_score": 2,
"selected": false,
"text": "<p>You'll probably want to use MySQL's HAVING clause</p>\n\n<p><a href=\"http://www.severnsolutions.co.uk/twblog/arch... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175733",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/326176/"
] | I have two tables in my database, called *ratings* and *movies*.
**Ratings:**
>
> `| id | movie_id | rating |`
>
>
>
**Movies:**
>
> `| id | title |`
>
>
>
A typical movie record might be like this:
>
> `| 4 | Cloverfield (2008) |`
>
>
>
and there may be several rating records for Cloverfield, like t... | Use the HAVING clause. Something along these lines:
```
SELECT movies.id, movies.title, COUNT(ratings.id) AS num_ratings
FROM movies
LEFT JOIN ratings ON ratings.movie_id=movies.id
GROUP BY movies.id
HAVING num_ratings > 5;
``` |
175,738 | <p>Weird issue:</p>
<ol>
<li>Open a large notepad window</li>
<li>create a toolwindow (style WS_EX_TOOLWINDOW)</li>
<li>create 2 more windows (normal overlapped) (WS_OVERLAPPED)</li>
<li>close those 2 overlapped windows (child of desktop or the toolwindow)</li>
<li>the toolwindow jumps behind the notepad window</li>
<... | [
{
"answer_id": 180689,
"author": "jussij",
"author_id": 14738,
"author_profile": "https://Stackoverflow.com/users/14738",
"pm_score": 0,
"selected": false,
"text": "<p>Are the three windows dialogs to another main window or are they applications in their own right?</p>\n\n<p>If they are ... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25602/"
] | Weird issue:
1. Open a large notepad window
2. create a toolwindow (style WS\_EX\_TOOLWINDOW)
3. create 2 more windows (normal overlapped) (WS\_OVERLAPPED)
4. close those 2 overlapped windows (child of desktop or the toolwindow)
5. the toolwindow jumps behind the notepad window
Does anyone know why this is the case? ... | This isn't surprising. In fact, it's exactly the behavior I'd expect.
You're tool window isn't jumping down; rather Notepad is jumping up.
You closed the window that had activation. The system is going to activate the next-highest top-level window in the z-order. Your tool window doesn't a count as a top-level window... |
175,739 | <p>I'm hoping there's something in the same conceptual space as the old VB6 <code>IsNumeric()</code> function?</p>
| [
{
"answer_id": 175746,
"author": "theraccoonbear",
"author_id": 7210,
"author_profile": "https://Stackoverflow.com/users/7210",
"pm_score": 5,
"selected": false,
"text": "<p>Try the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN\" rel=\"n... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19074/"
] | I'm hoping there's something in the same conceptual space as the old VB6 `IsNumeric()` function? | **2nd October 2020:** note that many bare-bones approaches are fraught with subtle bugs (eg. whitespace, implicit partial parsing, radix, coercion of arrays etc.) that many of the answers here fail to take into account. The following implementation might work for you, but note that it does not cater for number separato... |
175,742 | <p>I want to allocate a 2 D Array in Java Script. </p>
<p>I want do some thing similar to this in JavaScript</p>
<pre><code>typedef struct
{
int itemA,
int itemB,
string testC
} myStruc;
myStruct MyArray [100];
</code></pre>
<p>How to do this ? </p>
| [
{
"answer_id": 175764,
"author": "matt b",
"author_id": 4249,
"author_profile": "https://Stackoverflow.com/users/4249",
"pm_score": 0,
"selected": false,
"text": "<p>There are a few ways of creating arrays in Javascript, the method closest to what you want to do should be:</p>\n\n<pre><... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175742",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I want to allocate a 2 D Array in Java Script.
I want do some thing similar to this in JavaScript
```
typedef struct
{
int itemA,
int itemB,
string testC
} myStruc;
myStruct MyArray [100];
```
How to do this ? | ```
var arr = []
arr[0] = { "itemA": "A", "itemB": "B", "itemC": "C" }
arr[1] = { "itemA": "A", "itemB": "B", "itemC": "C" }
```
I think you are trying to apply static language constructs to the dynamic and different world of Javascript. Javascript doesn't really have the notion of arrays in the sense that many langu... |
175,835 | <p>I'm trying add a tab to my web page that looks like this: <img src="https://i.stack.imgur.com/DT3e7.png" alt="alt text"></p>
<p>Using <a href="http://mattberseth.com/blog/2007/09/using_css_image_sprites_with_t.html" rel="nofollow noreferrer">this example</a> as a basis, I've gotten it partially working. My case di... | [
{
"answer_id": 175844,
"author": "VirtuosiMedia",
"author_id": 13281,
"author_profile": "https://Stackoverflow.com/users/13281",
"pm_score": 2,
"selected": false,
"text": "<p>I think the <a href=\"http://alistapart.com/articles/slidingdoors/\" rel=\"nofollow noreferrer\">Sliding Doors Te... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12601/"
] | I'm trying add a tab to my web page that looks like this: 
Using [this example](http://mattberseth.com/blog/2007/09/using_css_image_sprites_with_t.html) as a basis, I've gotten it partially working. My case differs because I want the text section to be a fixed with, but ... | This is a simplified version that works:
```
<div style="background: url('BlueTabSprite.png') no-repeat; width: 290px; min-width: 120px; max-width: 290px; height: 23px;">
<div style="float: right; background: url('BlueTabSprite.png') top right no-repeat; width: 10px; height: 23px;"></div>
Test
</div>
``` |
175,836 | <p>When using the .NET WebBrowser control how do you open a link in a new window using the the same session (ie.. do not start a new ASP.NET session on the server), or how do you capture the new window event to open the URL in the same WebBrowser control?</p>
| [
{
"answer_id": 175851,
"author": "Greg Bray",
"author_id": 17373,
"author_profile": "https://Stackoverflow.com/users/17373",
"pm_score": 5,
"selected": true,
"text": "<p>I just spent an hour looking for the answer, so I though I would post the results here. You can use the SHDocVwCtl.Web... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17373/"
] | When using the .NET WebBrowser control how do you open a link in a new window using the the same session (ie.. do not start a new ASP.NET session on the server), or how do you capture the new window event to open the URL in the same WebBrowser control? | I just spent an hour looking for the answer, so I though I would post the results here. You can use the SHDocVwCtl.WebBrowser\_V1 object to capture the NewWindow event.
NOTE: Code from <http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_21484555.html#discussion>
```
//-------------------------------... |
175,845 | <p>I have a repeater control where in the footer I have a DropDownList. In my code-behind I have:</p>
<pre><code>protected void ddMyRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item
|| e.Item.ItemType == ListItemType.AlternatingItem)
{
... | [
{
"answer_id": 175888,
"author": "John Rudy",
"author_id": 14048,
"author_profile": "https://Stackoverflow.com/users/14048",
"pm_score": 2,
"selected": false,
"text": "<p>I think it's because you're probably not databinding on postbacks. I haven't tested this, but try hooking that code u... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3111/"
] | I have a repeater control where in the footer I have a DropDownList. In my code-behind I have:
```
protected void ddMyRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item
|| e.Item.ItemType == ListItemType.AlternatingItem)
{
// Item bindin... | If you just want to fire the OnSelectedIndexChanged, this is how it should look:
**Page.aspx - Source**
```
<FooterTemplate>
<asp:DropDownList ID="ddlOptions"
runat="server"
AutoPostBack="true"
onselectedindexchanged="ddlOptions_SelectedIndexChanged">
<asp:ListIt... |
175,847 | <p>I am writing a fairly basic script using jQuery. However, the script behaves differently depending on whether I am running it on my local Web server (localhost) or on a production server.</p>
<p>On development, the following code returns the HTML I'm expecting: </p>
<pre><code>$('#objID').siblings('.mAddress').h... | [
{
"answer_id": 175865,
"author": "eyelidlessness",
"author_id": 17964,
"author_profile": "https://Stackoverflow.com/users/17964",
"pm_score": -1,
"selected": false,
"text": "<p><del>I don't regularly use jQuery but my first suspicion is that your libraries are out of sync.</del></p>\n"
... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175847",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13449/"
] | I am writing a fairly basic script using jQuery. However, the script behaves differently depending on whether I am running it on my local Web server (localhost) or on a production server.
On development, the following code returns the HTML I'm expecting:
```
$('#objID').siblings('.mAddress').html();
```
On product... | Given that you have different behaviour, it's reasonable to assume that *something* is different between the two pages, so my suggestion is to reduce both pages to the minimum that keeps the current behaviour and then see what is different. |
175,858 | <p>Has anyone found a way to save a FlowDocument as BAML or other compressed format? I can import XML with images to create a new FlowDocument:</p>
<pre><code><TextRange class instance>.Load(fs, DataFormats.Rtf)
</code></pre>
<p>However, I haven't found a good way to save it in a 'native' compressed format. U... | [
{
"answer_id": 177362,
"author": "rudigrobler",
"author_id": 5147,
"author_profile": "https://Stackoverflow.com/users/5147",
"pm_score": 2,
"selected": true,
"text": "<p>I do not think it is possible... The BamlWriter is marked as internal, this will hopefully open up soon!</p>\n\n<p>I u... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/177/"
] | Has anyone found a way to save a FlowDocument as BAML or other compressed format? I can import XML with images to create a new FlowDocument:
```
<TextRange class instance>.Load(fs, DataFormats.Rtf)
```
However, I haven't found a good way to save it in a 'native' compressed format. Uncompressed XAML is easy to genera... | I do not think it is possible... The BamlWriter is marked as internal, this will hopefully open up soon!
I unfortunatly do not know of any XAML compilers |
175,891 | <p>Lets assume we have this xml: </p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<tns:RegistryResponse status="urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Failure"
xmlns:tns="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"
xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0">
<t... | [
{
"answer_id": 175920,
"author": "Mark Cidade",
"author_id": 1659,
"author_profile": "https://Stackoverflow.com/users/1659",
"pm_score": 4,
"selected": true,
"text": "<pre><code>var q = from x in doc.Root.Elements()\n where x.Name.LocalName==\"RegistryErrorList\"\n select x... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175891",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4795/"
] | Lets assume we have this xml:
```
<?xml version="1.0" encoding="UTF-8"?>
<tns:RegistryResponse status="urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Failure"
xmlns:tns="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"
xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0">
<tns:RegistryErrorList highestS... | ```
var q = from x in doc.Root.Elements()
where x.Name.LocalName=="RegistryErrorList"
select x;
var errorList = q.SingleOrDefault();
``` |
175,892 | <p>I'm trying to resize an embedded object. The issue is that when the mouse hovers over the object, it takes "control" of the mouse, swallowing up movement events. The result being that you can expand the div containing the object, but when you try to shrink it, if the mouse enters the area of the object the resize ... | [
{
"answer_id": 175904,
"author": "eyelidlessness",
"author_id": 17964,
"author_profile": "https://Stackoverflow.com/users/17964",
"pm_score": 0,
"selected": false,
"text": "<p>Overlay.</p>\n\n<p>One word answers prohibited, this sentence no verb.</p>\n"
},
{
"answer_id": 177198,
... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I'm trying to resize an embedded object. The issue is that when the mouse hovers over the object, it takes "control" of the mouse, swallowing up movement events. The result being that you can expand the div containing the object, but when you try to shrink it, if the mouse enters the area of the object the resize halts... | Well I was utterly unable to find a XPS Document Viewer example or whatnot, but I was able to come up with [`this working sample`](http://www.rootspot.com/stackoverflow/box.php). It doesn't use the overlay idea, but it's a pdf that you can resize...
**edit** the thing that made this work without the overlay was the `w... |
175,951 | <p>Among other text and visual aids on a form submission, post-validation, I'm coloring my input boxes red to signify the interactive area needing attention.</p>
<p>On Chrome (and for Google Toolbar users) the auto-fill feature re-colors my input forms yellow. Here's the complex issue: I want auto-complete allowed on ... | [
{
"answer_id": 175963,
"author": "Quentin",
"author_id": 19068,
"author_profile": "https://Stackoverflow.com/users/19068",
"pm_score": -1,
"selected": false,
"text": "<p>If I remember correctly, an !important rule in the stylesheet for the background color of the inputs will override the... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2486915/"
] | Among other text and visual aids on a form submission, post-validation, I'm coloring my input boxes red to signify the interactive area needing attention.
On Chrome (and for Google Toolbar users) the auto-fill feature re-colors my input forms yellow. Here's the complex issue: I want auto-complete allowed on my forms, ... | I know in Firefox you can use the attribute autocomplete="off" to disable the autocomplete functionality. If this works in Chrome (haven't tested), you could set this attribute when an error is encountered.
This can be used for both a single element
```
<input type="text" name="name" autocomplete="off">
```
...as w... |
175,961 | <blockquote>
<pre><code>List<tinyClass> ids = new List<tinyClass();
ids.Add(new tinyClass(1, 2));
bool b = ids.IndexOf(new tinyClass(1, 2)) >= 0; //true or false?
</code></pre>
</blockquote>
<p>If it compares by value, it should return true; if by reference, it will return false.<br>
If it compares by ref... | [
{
"answer_id": 175988,
"author": "OregonGhost",
"author_id": 20363,
"author_profile": "https://Stackoverflow.com/users/20363",
"pm_score": 5,
"selected": true,
"text": "<p>From MSDN:</p>\n<blockquote>\n<p>This method determines equality using the default equality comparer EqualityCompare... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175961",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8435/"
] | >
>
> ```
> List<tinyClass> ids = new List<tinyClass();
> ids.Add(new tinyClass(1, 2));
>
> bool b = ids.IndexOf(new tinyClass(1, 2)) >= 0; //true or false?
>
> ```
>
>
If it compares by value, it should return true; if by reference, it will return false.
If it compares by reference, and I make tinyClass a st... | From MSDN:
>
> This method determines equality using the default equality comparer EqualityComparer<T>.Default for T, the type of values in the list.
>
>
> The Default property checks whether type T implements the System.IEquatable<T> generic interface and if so returns an EqualityComparer<T> that uses that impleme... |
175,962 | <p>How can I have a dynamic variable setting the amount of rows to return in SQL Server? Below is not valid syntax in SQL Server 2005+:</p>
<pre><code>DECLARE @count int
SET @count = 20
SELECT TOP @count * FROM SomeTable
</code></pre>
| [
{
"answer_id": 175965,
"author": "Brian Kim",
"author_id": 5704,
"author_profile": "https://Stackoverflow.com/users/5704",
"pm_score": 10,
"selected": true,
"text": "<pre><code>SELECT TOP (@count) * FROM SomeTable\n</code></pre>\n\n<p>This will only work with SQL 2005+</p>\n"
},
{
... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175962",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5769/"
] | How can I have a dynamic variable setting the amount of rows to return in SQL Server? Below is not valid syntax in SQL Server 2005+:
```
DECLARE @count int
SET @count = 20
SELECT TOP @count * FROM SomeTable
``` | ```
SELECT TOP (@count) * FROM SomeTable
```
This will only work with SQL 2005+ |
175,982 | <p>I have a copy of emacs that I use on a couple of different (windows) computers from a thumb drive, and I am wondering if it is possible to create something that is sort of the equivalent of a bash alias or symlink within emacs? Something that I could use within find-file is the main thing that i'm looking for, so fo... | [
{
"answer_id": 176194,
"author": "cjm",
"author_id": 8355,
"author_profile": "https://Stackoverflow.com/users/8355",
"pm_score": 5,
"selected": true,
"text": "<p>I'm not really clear on what you're asking for. I store my commonly-used files in registers in my .emacs:</p>\n\n<pre><code>(... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25616/"
] | I have a copy of emacs that I use on a couple of different (windows) computers from a thumb drive, and I am wondering if it is possible to create something that is sort of the equivalent of a bash alias or symlink within emacs? Something that I could use within find-file is the main thing that i'm looking for, so for e... | I'm not really clear on what you're asking for. I store my commonly-used files in registers in my .emacs:
```
(set-register ?c '(file . "c:/data/common.txt"))
(set-register ?f '(file . "c:/data/frequent.txt"))
```
Then I can jump to a file with `jump-to-register` (`C-x r j`):
For example, "`C-x r j c`" takes me to ... |
175,994 | <p>I have written an HTML Application (hta file) and am wondering if there is a way to embed an icon file into the hta file itself.</p>
<p>I have seen html emails that include embedded graphic files, is there any way to do this with html applications and icons?</p>
<p>HTA files have an HTA:APPLICATION tag that allows... | [
{
"answer_id": 176049,
"author": "Buzz",
"author_id": 13113,
"author_profile": "https://Stackoverflow.com/users/13113",
"pm_score": 2,
"selected": false,
"text": "<p>Quite possibly ... there is a way to embed images directly into an html file that may work for this <a href=\"http://www.s... | 2008/10/06 | [
"https://Stackoverflow.com/questions/175994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20848/"
] | I have written an HTML Application (hta file) and am wondering if there is a way to embed an icon file into the hta file itself.
I have seen html emails that include embedded graphic files, is there any way to do this with html applications and icons?
HTA files have an HTA:APPLICATION tag that allows you to specify a... | I've found an hack to set the icon.
Prepare an icon file *icon.ico* and an hta file *source.hta* with the following contents:
```
<HTML>
<HEAD>
<SCRIPT>
path = document.URL;
document.write(
'<HTA:APPLICATION ID="oHTA" APPLICATIONNAME="myApp" ICON="'+path+'">');
</SCRIPT>
</HEAD>
<BODY SCROLL=... |
176,051 | <p>I want to save and store simple mail objects via serializing, but I get always an error and I can't find where it is.</p>
<pre><code>package sotring;
import java.io.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import com.sun.org.apache.bcel.internal.generic.INEG;
public c... | [
{
"answer_id": 176063,
"author": "Michael Myers",
"author_id": 13531,
"author_profile": "https://Stackoverflow.com/users/13531",
"pm_score": 3,
"selected": true,
"text": "<p>If an exception occurs, you never get to the return statement in getStoredMails. You need to either throw the exce... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25128/"
] | I want to save and store simple mail objects via serializing, but I get always an error and I can't find where it is.
```
package sotring;
import java.io.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import com.sun.org.apache.bcel.internal.generic.INEG;
public class storeing ... | If an exception occurs, you never get to the return statement in getStoredMails. You need to either throw the exception you catch (possibly wrapping it in another more descriptive exception) or just return null at the end of the method. It really depends on what you want to do if there's an error.
Oh, and your in.clos... |
176,062 | <p>I have the following unmanaged C++ code:</p>
<pre><code>MessageBox( NULL, strMessage, "Cool Product", MB_RETRYCANCEL | MB_ICONEXCLAMATION);
</code></pre>
<p>I want to disable the RETRY button for 10 seconds (for example), then enable it.</p>
<p>How can I do this?</p>
| [
{
"answer_id": 176082,
"author": "Jeff Yates",
"author_id": 23234,
"author_profile": "https://Stackoverflow.com/users/23234",
"pm_score": 0,
"selected": false,
"text": "<p>With the standard MessageBox call, you can't. You'd need to implement your own MessageBox in order to do this.</p>\n... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176062",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16794/"
] | I have the following unmanaged C++ code:
```
MessageBox( NULL, strMessage, "Cool Product", MB_RETRYCANCEL | MB_ICONEXCLAMATION);
```
I want to disable the RETRY button for 10 seconds (for example), then enable it.
How can I do this? | Like [@ffpf](https://stackoverflow.com/questions/176062/how-do-i-disable-and-then-enable-the-retry-button-in-a-messagebox-c#176082) says, you need to make your own dialog to do this, using MFC, ATL, raw Win32, etc.
Then create a timer that would enable and disable the button. |
176,084 | <p>When writing the string "¿" out using</p>
<pre><code>System.out.println(new String("¿".getBytes("UTF-8")));
</code></pre>
<p>¿ is written instead of just ¿.</p>
<p>WHY? And how do we fix it?</p>
| [
{
"answer_id": 176089,
"author": "Greg",
"author_id": 24181,
"author_profile": "https://Stackoverflow.com/users/24181",
"pm_score": 0,
"selected": false,
"text": "<p>Sounds like the system console isn't in UTF-8</p>\n"
},
{
"answer_id": 176105,
"author": "Michael Myers",
... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9518/"
] | When writing the string "¿" out using
```
System.out.println(new String("¿".getBytes("UTF-8")));
```
¿ is written instead of just ¿.
WHY? And how do we fix it? | You don't have to use UTF-16 to solve this:
```
new String("¿".getBytes("UTF-8"), "UTF-8");
```
works just fine. As long as the encoding given to the `getBytes()` method is the same as the encoding you pass to the String constructor, you should be fine! |
176,088 | <p>Is it possible to open an HTML page using navigateToURL and specifying a named frame in your HTML document? For instance, if you have an iframe on the page called "Steven", can you call</p>
<pre><code>navigateToURL("someURL","Steven");
</code></pre>
<p>instead of something like</p>
<pre><code>navigateToURL("someU... | [
{
"answer_id": 176108,
"author": "Diodeus - James MacFarlane",
"author_id": 12579,
"author_profile": "https://Stackoverflow.com/users/12579",
"pm_score": 0,
"selected": false,
"text": "<p>I'm not sure, but you can use JavaScript:</p>\n\n<pre><code>navigateToURL(\"javascript:loadFrame(som... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25280/"
] | Is it possible to open an HTML page using navigateToURL and specifying a named frame in your HTML document? For instance, if you have an iframe on the page called "Steven", can you call
```
navigateToURL("someURL","Steven");
```
instead of something like
```
navigateToURL("someURL","_self");
```
I have tried this... | Did you test this on local files saved to your hard drive? If so, then there are some security restrictions that you may be running in to. See the security note [here](http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/package.html#navigateToURL()).
But if you're testing this with files on a web serve... |
176,093 | <p>Is there a way to use a Graphics object's 'setClip()' method to clip using a Line-ish shape? Right now I'm trying to use a Polygon shape but I'm having problems simulating the "width" of the line. I basically draw the line, and when I reach the end, I redraw it but this time subtract the line width from y-coordina... | [
{
"answer_id": 176169,
"author": "Michael Myers",
"author_id": 13531,
"author_profile": "https://Stackoverflow.com/users/13531",
"pm_score": 1,
"selected": false,
"text": "<p>If there is a better way, I've never run across it. The best I can think of is to use some trigonometry to make t... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1471/"
] | Is there a way to use a Graphics object's 'setClip()' method to clip using a Line-ish shape? Right now I'm trying to use a Polygon shape but I'm having problems simulating the "width" of the line. I basically draw the line, and when I reach the end, I redraw it but this time subtract the line width from y-coordinate:
... | If there is a better way, I've never run across it. The best I can think of is to use some trigonometry to make the line width more consistent. |
176,106 | <p>I need to be able to validate a string against a list of the possible United States Postal Service state abbreviations, and Google is not offering me any direction. </p>
<p>I know of the obvious solution: and that is to code a horridly huge if (or switch) statement to check and compare against all 50 states, but I ... | [
{
"answer_id": 176127,
"author": "Ben Hoffstein",
"author_id": 4482,
"author_profile": "https://Stackoverflow.com/users/4482",
"pm_score": 3,
"selected": false,
"text": "<p>Here's a regex. Enjoy!</p>\n\n<pre><code>^(?-i:A[LKSZRAEP]|C[AOT]|D[EC]|F[LM]|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEHINOP... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176106",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/506/"
] | I need to be able to validate a string against a list of the possible United States Postal Service state abbreviations, and Google is not offering me any direction.
I know of the obvious solution: and that is to code a horridly huge if (or switch) statement to check and compare against all 50 states, but I am asking ... | I like something like this:
```
private static String states = "|AL|AK|AS|AZ|AR|CA|CO|CT|DE|DC|FM|FL|GA|GU|HI|ID|IL|IN|IA|KS|KY|LA|ME|MH|MD|MA|MI|MN|MS|MO|MT|NE|NV|NH|NJ|NM|NY|NC|ND|MP|OH|OK|OR|PW|PA|PR|RI|SC|SD|TN|TX|UT|VT|VI|VA|WA|WV|WI|WY|";
public static bool isStateAbbreviation (String state)
{
return state.Le... |
176,137 | <p>Does anyone know of a way, in Java, to convert an earth surface position from lat, lon to UTM (say in WGS84)? I'm currently looking at Geotools but unfortunately the solution is not obvious.</p>
| [
{
"answer_id": 176925,
"author": "Steve Kuo",
"author_id": 24396,
"author_profile": "https://Stackoverflow.com/users/24396",
"pm_score": 5,
"selected": true,
"text": "<p>I was able to use Geotools 2.4 to get something that works, based on some <a href=\"http://svn.geotools.org/trunk/demo... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176137",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24396/"
] | Does anyone know of a way, in Java, to convert an earth surface position from lat, lon to UTM (say in WGS84)? I'm currently looking at Geotools but unfortunately the solution is not obvious. | I was able to use Geotools 2.4 to get something that works, based on some [example code](http://svn.geotools.org/trunk/demo/referencing/src/main/java/org/geotools/demo/referencing/CTSTutorial.java).
```
double utmZoneCenterLongitude = ... // Center lon of zone, example: zone 10 = -123
int zoneNumber = ... ... |
176,150 | <p>I'm working with a combobox in a Swing-based application, and I'm having a hard time figuring out what to do to differentiate between an ItemEvent that is generated from a user event vs one caused by the application. </p>
<p>For instance, Lets say I have a combobox, '<code>combo</code>' and I'm listening for itemSt... | [
{
"answer_id": 176214,
"author": "tim_yates",
"author_id": 6509,
"author_profile": "https://Stackoverflow.com/users/6509",
"pm_score": 1,
"selected": false,
"text": "<p>You can set a flag in your code before you set the selection, and then check for this flag in the listener (and unset t... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176150",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13812/"
] | I'm working with a combobox in a Swing-based application, and I'm having a hard time figuring out what to do to differentiate between an ItemEvent that is generated from a user event vs one caused by the application.
For instance, Lets say I have a combobox, '`combo`' and I'm listening for itemStateChanged events wit... | The Action and Reaction law is quite clear :). If you try to react on change there is no need to distinguish between user and application. I can imagine only one use case where you need to "distinguish". The case where application is displaying some data. In this case you have, probably, data model for your application... |
176,158 | <p>Is it possible to create an STL-like container, or even just an STL-style iterator, for an existing array of POD-type elements?</p>
<p>For example, suppose I have an array of ints. It would be convenient to be able to call some of the STL functions, such as find_if, count_if, or sort directly on this array... | [
{
"answer_id": 176167,
"author": "Ferruccio",
"author_id": 4086,
"author_profile": "https://Stackoverflow.com/users/4086",
"pm_score": 2,
"selected": false,
"text": "<p>You can use <a href=\"http://www.boost.org/doc/libs/1_36_0/doc/html/array.html\" rel=\"nofollow noreferrer\">Boost.Arra... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176158",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3561/"
] | Is it possible to create an STL-like container, or even just an STL-style iterator, for an existing array of POD-type elements?
For example, suppose I have an array of ints. It would be convenient to be able to call some of the STL functions, such as find\_if, count\_if, or sort directly on this array.
Non-solution: ... | You can call many of the STL algorithms directly on a regular C style array - they were designed for this to work. e.g.,:
```
int ary[100];
// init ...
std::sort(ary, ary+100); // sorts the array
std::find(ary, ary+100, pred); find some element
```
I think you'll find that most stuff works just as you would expect. |
176,171 | <p>I have run in to a bit of a problem and I have done a bit of digging, but struggling to come up with a conclusive answer/fix.</p>
<p>Basically, I have some javascript (created by a 3rd party) that does some whizzbang stuff to page elements to make them look pretty. The code works great on single pages (i.e. no maste... | [
{
"answer_id": 176208,
"author": "roenving",
"author_id": 23142,
"author_profile": "https://Stackoverflow.com/users/23142",
"pm_score": 2,
"selected": false,
"text": "<p>Isn't it possible to do with clean javascript ?-)</p>\n\n<p>-- just add something similar to this inside the body-tag:... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176171",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/832/"
] | I have run in to a bit of a problem and I have done a bit of digging, but struggling to come up with a conclusive answer/fix.
Basically, I have some javascript (created by a 3rd party) that does some whizzbang stuff to page elements to make them look pretty. The code works great on single pages (i.e. no master), howev... | Put a ContentPlaceHolder in the head section of the master page, then add a asp:Content control on the content page referring to the placeholder and put your script in that control. You can customize it for each page this way.
Also, the reference by ID may not be working because when you use Master Pages, the control ... |
176,196 | <p>Why is the following displayed different in Linux vs Windows?</p>
<pre><code>System.out.println(new String("¿".getBytes("UTF-8"), "UTF-8"));
</code></pre>
<p>in Windows:</p>
<p>¿</p>
<p>in Linux:</p>
<p>¿</p>
| [
{
"answer_id": 176211,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 1,
"selected": false,
"text": "<p>It's hard to know exactly which bytes your source code contains, or the string which getBytes() is being called on, d... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176196",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9518/"
] | Why is the following displayed different in Linux vs Windows?
```
System.out.println(new String("¿".getBytes("UTF-8"), "UTF-8"));
```
in Windows:
¿
in Linux:
¿ | System.out.println() outputs the text in the system default encoding, but the console interprets that output according to its own encoding (or "codepage") setting. On your Windows machine the two encodings seem to match, but on the Linux box the output is apparently in UTF-8 while the console is decoding it as a single... |
176,284 | <p>Im looking for a method (or function) to strip out the domain.ext part of any URL thats fed into the function. The domain extension can be anything (.com, .co.uk, .nl, .whatever), and the URL thats fed into it can be anything from <a href="http://www.domain.com" rel="noreferrer">http://www.domain.com</a> to www.doma... | [
{
"answer_id": 176300,
"author": "davidmytton",
"author_id": 2183,
"author_profile": "https://Stackoverflow.com/users/2183",
"pm_score": 4,
"selected": false,
"text": "<p>You can use <a href=\"http://www.php.net/manual/en/function.parse-url.php\" rel=\"nofollow noreferrer\">parse_url()</... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176284",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Im looking for a method (or function) to strip out the domain.ext part of any URL thats fed into the function. The domain extension can be anything (.com, .co.uk, .nl, .whatever), and the URL thats fed into it can be anything from <http://www.domain.com> to www.domain.com/path/script.php?=whatever
Whats the best way t... | [parse\_url](http://www.php.net/manual/en/function.parse-url.php) turns a URL into an associative array:
```
php > $foo = "http://www.example.com/foo/bar?hat=bowler&accessory=cane";
php > $blah = parse_url($foo);
php > print_r($blah);
Array
(
[scheme] => http
[host] => www.example.com
[path] => /foo/bar
... |
176,295 | <p>I've tried these, and they did not work (Access opens, but it does not wait:</p>
<pre><code>start "C:\program files\Microsoft Office\Office\MSACCESS.EXE" filename.mdb
start /WAIT "C:\program files\Microsoft Office\Office\MSACCESS.EXE" filename.mdb
start /W "C:\program files\Microsoft Office\Office\MSACCESS.EXE" f... | [
{
"answer_id": 176297,
"author": "pc1oad1etter",
"author_id": 525,
"author_profile": "https://Stackoverflow.com/users/525",
"pm_score": 3,
"selected": true,
"text": "<pre><code>start /WAIT msaccess.exe filename.mdb\n</code></pre>\n\n<p>does the trick.</p>\n\n<p>I don't know why adding th... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/525/"
] | I've tried these, and they did not work (Access opens, but it does not wait:
```
start "C:\program files\Microsoft Office\Office\MSACCESS.EXE" filename.mdb
start /WAIT "C:\program files\Microsoft Office\Office\MSACCESS.EXE" filename.mdb
start /W "C:\program files\Microsoft Office\Office\MSACCESS.EXE" filename.mdb
s... | ```
start /WAIT msaccess.exe filename.mdb
```
does the trick.
I don't know why adding the full path makes it fail. |
176,319 | <p>It seems MySQL does not support the flag "NO_ WRITE_ TO_ BINLOG" for TRUNCATE. So I have to wait until delay is 0, then stop the replication, make the TRUNCATE of the table/s, reset the master, and then start replication again. Really painful. Any other suggestion?</p>
| [
{
"answer_id": 178091,
"author": "Neall",
"author_id": 619,
"author_profile": "https://Stackoverflow.com/users/619",
"pm_score": 0,
"selected": false,
"text": "<p>TRUNCATE is pretty heavy-handed. Can you get by with just a DELETE query?</p>\n"
},
{
"answer_id": 178642,
"autho... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | It seems MySQL does not support the flag "NO\_ WRITE\_ TO\_ BINLOG" for TRUNCATE. So I have to wait until delay is 0, then stop the replication, make the TRUNCATE of the table/s, reset the master, and then start replication again. Really painful. Any other suggestion? | You can use the command to disable binary logging for a session to do what you want.
```
SET SQL_LOG_BIN = 0;
TRUNCATE TABLE ;
SET SQL_LOG_BIN = 1;
```
This does require that you have the SUPER privilege since you are effectively breaking replication by not sending the TRUNCATE to the slave. |
176,331 | <p>I've developed a windows application that uses shared memory---that is---memory mapped files for interprocess communication. I have a windows service that does some processing and periodically writes data to the memory mapped file. I have a separate windows application that reads from the memory mapped file and di... | [
{
"answer_id": 176424,
"author": "jmatthias",
"author_id": 2768,
"author_profile": "https://Stackoverflow.com/users/2768",
"pm_score": 0,
"selected": false,
"text": "<p>Have you tried moving the file to a different location. Try putting it in the 'Shared Documents' folder, this seems to ... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176331",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25636/"
] | I've developed a windows application that uses shared memory---that is---memory mapped files for interprocess communication. I have a windows service that does some processing and periodically writes data to the memory mapped file. I have a separate windows application that reads from the memory mapped file and display... | So I found the solution to my problem:
On Windows XP, all named kernel objects such as mutex, semaphore and memory mapped objects are stored in the same namespace. So when different processes in different user sessions reference a particular object using it's name, they obtain a handle to that object. However, as a se... |
176,338 | <p>I have an ASP.NET 2.0 [no ajax...yet] web site that will be deployed in compiled form on multiple customer sites. Typically the site will be intranet only. Some customers trust all of their people and don't care about limiting access to the site and/or page functions, others trust no one and want only certain people... | [
{
"answer_id": 176384,
"author": "Jeremy",
"author_id": 9266,
"author_profile": "https://Stackoverflow.com/users/9266",
"pm_score": 2,
"selected": true,
"text": "<p>I prefer to grant access rights to AD groups rather than specific users. I find it's much more flexible.</p>\n\n<p>I don't ... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176338",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9345/"
] | I have an ASP.NET 2.0 [no ajax...yet] web site that will be deployed in compiled form on multiple customer sites. Typically the site will be intranet only. Some customers trust all of their people and don't care about limiting access to the site and/or page functions, others trust no one and want only certain people an... | I prefer to grant access rights to AD groups rather than specific users. I find it's much more flexible.
I don't know much about your application, but you might want to look at the authorization tag in the web.config file:
```
<authorization>
<!--
<deny users="?" />
<allow users="[comma sepa... |
176,343 | <p>Perl 6 seems to have an explosion of equality operators. What is <code>=:=</code>? What's the difference between <code>leg</code> and <code>cmp</code>? Or <code>eqv</code> and <code>===</code>?</p>
<p>Does anyone have a good summary?</p>
| [
{
"answer_id": 176381,
"author": "moritz",
"author_id": 14132,
"author_profile": "https://Stackoverflow.com/users/14132",
"pm_score": 7,
"selected": true,
"text": "<p><a href=\"http://doc.perl6.org/routine/%3D%3A%3D\" rel=\"noreferrer\">=:=</a> tests if two containers (variables or items... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7598/"
] | Perl 6 seems to have an explosion of equality operators. What is `=:=`? What's the difference between `leg` and `cmp`? Or `eqv` and `===`?
Does anyone have a good summary? | [=:=](http://doc.perl6.org/routine/%3D%3A%3D) tests if two containers (variables or items of arrays or hashes) are aliased, ie if one changes, does the other change as well?
```
my $x;
my @a = 1, 2, 3;
# $x =:= @a[0] is false
$x := @a[0];
# now $x == 1, and $x =:= @a[0] is true
$x = 4;
# now @a is 4, 2, 3
```
As fo... |
176,347 | <p>I read some of the answers on here re: testing views and controllers, and mocking, but I still can't figure out how to test an ASP.NET MVC controller that reads and sets Session values (or any other context based variables.)
How do I provide a (Session) context for my test methods? Is mocking the answer? Anybody hav... | [
{
"answer_id": 176390,
"author": "chadmyers",
"author_id": 10862,
"author_profile": "https://Stackoverflow.com/users/10862",
"pm_score": 4,
"selected": false,
"text": "<p>The ASP.NET MVC framework is not very mock-friendly (or rather, requires too much setup to mock properly, and causes ... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17729/"
] | I read some of the answers on here re: testing views and controllers, and mocking, but I still can't figure out how to test an ASP.NET MVC controller that reads and sets Session values (or any other context based variables.)
How do I provide a (Session) context for my test methods? Is mocking the answer? Anybody have e... | Check out Stephen Walther's post on Faking the Controller Context:
[ASP.NET MVC Tip #12 – Faking the Controller Context](http://stephenwalther.com/blog/archive/2008/07/01/asp-net-mvc-tip-12-faking-the-controller-context.aspx)
```
[TestMethod]
public void TestSessionState()
{
// Create controller
var controlle... |
176,373 | <p>We are trying to make a project template, but the documentation on this is spotty or non-existent.</p>
<p>Doing some reverse-engineering on some template files, we have come up with the following. However, it doen't actually work!</p>
<p>First of all, we have figured out that project templates should be installed... | [
{
"answer_id": 176420,
"author": "bbum",
"author_id": 25646,
"author_profile": "https://Stackoverflow.com/users/25646",
"pm_score": 2,
"selected": false,
"text": "<p>You likely want to use a \"FilesToRename\" section. The following is from the PyObjC Cocoa Document Based Application te... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25560/"
] | We are trying to make a project template, but the documentation on this is spotty or non-existent.
Doing some reverse-engineering on some template files, we have come up with the following. However, it doen't actually work!
First of all, we have figured out that project templates should be installed inside:
~/Librar... | You likely want to use a "FilesToRename" section. The following is from the PyObjC Cocoa Document Based Application template. It works fine.
```
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>... |
176,403 | <p>In C++/CLI , you can use native types in a managed class by it is not allowed to hold a member of a native class in a managed class : you need to use pointers in that case.</p>
<p>Here is an example :</p>
<pre><code>class NativeClass
{
....
};
public ref class ManagedClass
{
private:
NativeClass mNativeClass; ... | [
{
"answer_id": 176450,
"author": "1800 INFORMATION",
"author_id": 3146,
"author_profile": "https://Stackoverflow.com/users/3146",
"pm_score": 0,
"selected": false,
"text": "<p><a href=\"http://msdn.microsoft.com/en-us/library/ms379600.aspx\" rel=\"nofollow noreferrer\">STL.Net is documen... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19816/"
] | In C++/CLI , you can use native types in a managed class by it is not allowed to hold a member of a native class in a managed class : you need to use pointers in that case.
Here is an example :
```
class NativeClass
{
....
};
public ref class ManagedClass
{
private:
NativeClass mNativeClass; // Not allowed !
Na... | I found the answer on [codeproject](http://www.codeproject.com) :
Nishant Sivakumar posted an article about this at <http://www.codeproject.com/KB/mcpp/CAutoNativePtr.aspx>
On this page, also look for the comment by Denis N. Shevchenko : he provides a stl-like implementation that works quite well. |
176,411 | <p>A question about different methods of outputting html from PHP; what are the performance differences between these:</p>
<p>Method 1 - variable concatenation</p>
<pre><code>$html = '';
$html .= '<ul>';
for ($k = 1; $k < = 1000; $k++){
$html .= '<li> This is list item #'.$k.'</li>';
}
$html ... | [
{
"answer_id": 176434,
"author": "Darryl Hein",
"author_id": 5441,
"author_profile": "https://Stackoverflow.com/users/5441",
"pm_score": 2,
"selected": false,
"text": "<p>I typically use method #1 so I can put that HTML any where in a template file that contains static HTML. I try to kee... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2027/"
] | A question about different methods of outputting html from PHP; what are the performance differences between these:
Method 1 - variable concatenation
```
$html = '';
$html .= '<ul>';
for ($k = 1; $k < = 1000; $k++){
$html .= '<li> This is list item #'.$k.'</li>';
}
$html .= '</ul>';
echo $html;
```
Method 2 - o... | It's a bit old, but [this post](http://blog.libssh2.org/index.php?/archives/28-How-long-is-a-piece-of-string.html) by Sara Golemon will probably help. AFAIK the output buffering functions are quite fast and efficient and so is `echo`, so that's what I would use. |
176,440 | <p>I have a filter in a combobox with a number of entries. Instead of filtering the datagrid with an exact match, I would like to take the selected value and only display records where the selected value is contained in the datafield.
For example: the user selects a value of "New" and the datagrid displays records wher... | [
{
"answer_id": 176606,
"author": "JustLogic",
"author_id": 21664,
"author_profile": "https://Stackoverflow.com/users/21664",
"pm_score": 2,
"selected": false,
"text": "<p>Something like this should work:</p>\n\n<pre><code> public function filter(item:Object):Boolean{\n var result:... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25463/"
] | I have a filter in a combobox with a number of entries. Instead of filtering the datagrid with an exact match, I would like to take the selected value and only display records where the selected value is contained in the datafield.
For example: the user selects a value of "New" and the datagrid displays records where t... | Something like this should work:
```
public function filter(item:Object):Boolean{
var result:Boolean=false;
if (item.name.toUpperCase().indexOf(cbo.selectedLabel.toUpperCase()) >= 0)
result=true;
return result;
}
```
This filter function will search the name attribute(or whatev... |
176,446 | <p>Why do I get compiler errors with this Java code?</p>
<pre><code>1 public List<? extends Foo> getFoos()
2 {
3 List<? extends Foo> foos = new ArrayList<? extends Foo>();
4 foos.add(new SubFoo());
5 return foos;
6 }</code></pre>
<p>Where 'SubFoo' is a concrete class that implements Foo,... | [
{
"answer_id": 176478,
"author": "erickson",
"author_id": 3474,
"author_profile": "https://Stackoverflow.com/users/3474",
"pm_score": 6,
"selected": true,
"text": "<p>Use this instead:</p>\n\n<pre><code>1 public List<? extends Foo> getFoos()\n2 {\n3 List<Foo> foos = new ... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176446",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2197/"
] | Why do I get compiler errors with this Java code?
```
1 public List<? extends Foo> getFoos()
2 {
3 List<? extends Foo> foos = new ArrayList<? extends Foo>();
4 foos.add(new SubFoo());
5 return foos;
6 }
```
Where 'SubFoo' is a concrete class that implements Foo, and Foo is an interface.
Errors I get with... | Use this instead:
```
1 public List<? extends Foo> getFoos()
2 {
3 List<Foo> foos = new ArrayList<Foo>(); /* Or List<SubFoo> */
4 foos.add(new SubFoo());
5 return foos;
6 }
```
Once you declare foos as `List<? extends Foo>`, the compiler doesn't know that it's safe to add a SubFoo. What if an `ArrayList<... |
176,459 | <p>Here are the declarations of the variables:</p>
<pre><code>string strFirstName;
string strLastName;
string strAddress;
string strCity;
string strState;
double dblSalary;
string strGender;
int intAge;
</code></pre>
<p>...Do some "cin" statements to get data...</p>
<pre><code>retcode = SQLPrepare(StatementHandle, (... | [
{
"answer_id": 176466,
"author": "EvilTeach",
"author_id": 7734,
"author_profile": "https://Stackoverflow.com/users/7734",
"pm_score": 0,
"selected": false,
"text": "<p>It looks like the api, wants an <strong>unsigned char *</strong>\ntry passing in a c string, using the <strong>c_str()<... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176459",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25642/"
] | Here are the declarations of the variables:
```
string strFirstName;
string strLastName;
string strAddress;
string strCity;
string strState;
double dblSalary;
string strGender;
int intAge;
```
...Do some "cin" statements to get data...
```
retcode = SQLPrepare(StatementHandle, (SQLCHAR *)"INSERT INTO EMPLOYEE ([Fir... | [MSDN documentation for SQLBindParameter](http://msdn.microsoft.com/en-us/library/ms710963.aspx) says you are meant to pass a buffer containing the data for `ParameterValuePtr` and the length of the buffer in bytes for `BufferLength`:
```
retcode = SQLBindParameter(StatementHandle, 1, SQL_PARAM_INPUT, SQL_C_CHAR,
S... |
176,479 | <p>I have a image upload form that should take image types (PNG, JPEG, GIF), resize it and then save it to a path. </p>
<p>For some reason I can't get the PNG file types to work, it works fine with JPEG/GIF and the file is copied so it looks like it's something to do with how I'm creating the PNG. </p>
<p>Does PNG cr... | [
{
"answer_id": 176513,
"author": "DreamWerx",
"author_id": 15487,
"author_profile": "https://Stackoverflow.com/users/15487",
"pm_score": 2,
"selected": false,
"text": "<p>You need to look how your PHP is built.. Eg:</p>\n\n<pre><code>GD Support enabled\nGD Version bundled (2.0.28 com... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176479",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have a image upload form that should take image types (PNG, JPEG, GIF), resize it and then save it to a path.
For some reason I can't get the PNG file types to work, it works fine with JPEG/GIF and the file is copied so it looks like it's something to do with how I'm creating the PNG.
Does PNG creation in PHP req... | You need to look how your PHP is built.. Eg:
```
GD Support enabled
GD Version bundled (2.0.28 compatible)
PNG Support enabled
```
If you don't have PNG support compiled in, you'll need to have that updated. |
176,512 | <p>In short, how do you unit test an error condition such as EINTR on a system call.</p>
<p>One particular example I'm working on, which could be a case all by itself, is whether it's necessary to call fclose again when it returns EOF with (errno==EINTR). The behavior depends on the implementation of fclose:</p>
<pre... | [
{
"answer_id": 176761,
"author": "Benoit",
"author_id": 10703,
"author_profile": "https://Stackoverflow.com/users/10703",
"pm_score": 2,
"selected": false,
"text": "<p>I don't think there is an easy way to actually test this at will.</p>\n\n<p>EINTR will be generated if the fclose operat... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24310/"
] | In short, how do you unit test an error condition such as EINTR on a system call.
One particular example I'm working on, which could be a case all by itself, is whether it's necessary to call fclose again when it returns EOF with (errno==EINTR). The behavior depends on the implementation of fclose:
```
// Given an op... | I don't think there is an easy way to actually test this at will.
EINTR will be generated if the fclose operation is interrupted by a signal.
This implies that fclose was in a background thread which received a signal as it was processing the close request.
Good luck trying to reproduce that set of circumstances. |
176,527 | <p>I need to enumerate all classes in a package and add them to a List. The non-dynamic version for a single class goes like this:</p>
<pre><code>List allClasses = new ArrayList();
allClasses.add(String.class);
</code></pre>
<p>How can I do this dynamically to add all classes in a package and all its subpackages?</p>... | [
{
"answer_id": 176694,
"author": "G B",
"author_id": 25662,
"author_profile": "https://Stackoverflow.com/users/25662",
"pm_score": 2,
"selected": false,
"text": "<p>I'm afraid you'll have to manually scan the classpath and the other places where java searches for classes (e.g., the ext d... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176527",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13041/"
] | I need to enumerate all classes in a package and add them to a List. The non-dynamic version for a single class goes like this:
```
List allClasses = new ArrayList();
allClasses.add(String.class);
```
How can I do this dynamically to add all classes in a package and all its subpackages?
---
***Update:*** Having re... | \*\*\*\*UPDATE 1 (2012)\*\*\*\*
OK, I've finally gotten around to cleaning up the code snippet below. I stuck it into it's own github project and even added tests.
<https://github.com/ddopson/java-class-enumerator>
\*\*\*\*UPDATE 2 (2016)\*\*\*\*
For an even more robust and feature-rich classpath scanner, see <http... |
176,545 | <p>I am going to be starting a javascript reporting engine for my website, and have started some prototyping using MooTools. I really like being able to do things like this:</p>
<pre><code>function showLeagues(leagues) {
var leagueList = $("leagues");
leagueList.empty();
for(var i = 0; i<leagues.length... | [
{
"answer_id": 176567,
"author": "nickf",
"author_id": 9021,
"author_profile": "https://Stackoverflow.com/users/9021",
"pm_score": 2,
"selected": false,
"text": "<p>Here's that same thing in jQuery. Basically to create a new element, you just put in the HTML you want.</p>\n\n<pre><code>f... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176545",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/96/"
] | I am going to be starting a javascript reporting engine for my website, and have started some prototyping using MooTools. I really like being able to do things like this:
```
function showLeagues(leagues) {
var leagueList = $("leagues");
leagueList.empty();
for(var i = 0; i<leagues.length; ++i) {
v... | syntactically, it may be nicer to use jQuery to do it, but its probably more efficient to use
```
document.createElement('li')
```
And eliminate the need for at the bare minimum a string comparison test and a minor token parse.
[flydom](http://flydom.socianet.com/) may also tickle your interest if you insist on ... |
176,569 | <p>I have a C# console app "App1" that reads a row of data from a table in a SQL Server 2005 DB. I want App1 to pass all the data in this row to App2, another C# console app. What is the best way to do this?</p>
<p>My first (naive) attempt was to do this:</p>
<pre><code>object[] o = myrow.ItemArray;
// make a strin... | [
{
"answer_id": 176595,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 1,
"selected": false,
"text": "<p>The space-separated approach is fine if you are using Process.Start - you just need to wrap items containing space... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22471/"
] | I have a C# console app "App1" that reads a row of data from a table in a SQL Server 2005 DB. I want App1 to pass all the data in this row to App2, another C# console app. What is the best way to do this?
My first (naive) attempt was to do this:
```
object[] o = myrow.ItemArray;
// make a string that separates each i... | One approach would be to serialize the row to XML and use that, except that DataRow (lacking a default constructor) can't be serialized. Instead you'd have to create a new DataTable and add that row to it.
Then you could simply serialize the entire DataTable to XML and pass it to the other application, either as a com... |
176,625 | <p>I have the following query in iSeries SQL which I output to a file.</p>
<pre><code>SELECT SSLOTMAK, SSLOTMDL, SSLOTYER, sum(SSCOUNT)
FROM prqhdrss
GROUP BY SSLOTMAK, SSLOTMDL, SSLotyer
HAVING sum(SSCOUNT) > 4
ORDER BY SSLOTMAK, SSLOTMDL, SSLOTYER ... | [
{
"answer_id": 177098,
"author": "Mike Wills",
"author_id": 2535,
"author_profile": "https://Stackoverflow.com/users/2535",
"pm_score": 0,
"selected": false,
"text": "<p>How are you trying to bring it to your PC? Most iSeries methods I know will automatically convert that to a PC-readabl... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176625",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11270/"
] | I have the following query in iSeries SQL which I output to a file.
```
SELECT SSLOTMAK, SSLOTMDL, SSLOTYER, sum(SSCOUNT)
FROM prqhdrss
GROUP BY SSLOTMAK, SSLOTMDL, SSLotyer
HAVING sum(SSCOUNT) > 4
ORDER BY SSLOTMAK, SSLOTMDL, SSLOTYER ... | Try this
```
SELECT SSLOTMAK, SSLOTMDL, SSLOTYER, cast(sum(SSCOUNT) as integer)
FROM prqhdrss
GROUP BY SSLOTMAK, SSLOTMDL, SSLotyer
HAVING sum(SSCOUNT) > 4
ORDER BY SSLOTMAK, SSLOTMDL, SSLOTYER
```
I've casted to integer because of the name of the column "count". If the column has floating-point values you can use `... |
176,626 | <p>I'm writing an article about editing pages in order to hand pick what you really want to print. There are many tools (like "Print What you like") but I also found this script. Anyone knows anything about it? I haven't found any kind of documentation or references.</p>
<pre><code>javascript:document.body.contentEdit... | [
{
"answer_id": 176644,
"author": "Grank",
"author_id": 12975,
"author_profile": "https://Stackoverflow.com/users/12975",
"pm_score": 1,
"selected": false,
"text": "<p>document.designMode is supported in IE 4+ (which started it apparently) and FireFox 1.3+.\nYou turn it on and you can edi... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176626",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1657/"
] | I'm writing an article about editing pages in order to hand pick what you really want to print. There are many tools (like "Print What you like") but I also found this script. Anyone knows anything about it? I haven't found any kind of documentation or references.
```
javascript:document.body.contentEditable='true'; d... | The contentEditable property is what you want -- It's supported by IE, Safari (and by chrome as a byproduct), and I *think* firefox 3 (alas not FFX2). And hey, it's also part of HTML5 :D
Firefox 2 supports designMode, but that is restricted to individual frames, whereas the contentEditable property applies applies to ... |
176,673 | <p>If I have a datetime field, how do I get just records created later than a certain time, ignoring the date altogether?</p>
<p>It's a logging table, it tells when people are connecting and doing something in our application. I want to find out how often people are on later than 5pm. </p>
<p>(Sorry - it is SQL Ser... | [
{
"answer_id": 176682,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 1,
"selected": false,
"text": "<p>The best thing I can think would be: don't use a DateTime field; well, you could use a lot of DATEADD/DATEPART etc... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176673",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22523/"
] | If I have a datetime field, how do I get just records created later than a certain time, ignoring the date altogether?
It's a logging table, it tells when people are connecting and doing something in our application. I want to find out how often people are on later than 5pm.
(Sorry - it is SQL Server. But this could... | For SQL Server:
```
select * from myTable where datepart(hh, myDateField) > 17
```
See <http://msdn.microsoft.com/en-us/library/aa258265(SQL.80).aspx>. |
176,695 | <p>The attached screenshot is from OS X/Firefox 3. Note that the center tab (an image) has a dotted line around it, apparently because it was the most-recently selected tab. Is there a way I can eliminate this dotted line in CSS or JavaScript? (Hmmm...the free image hosting service has reduced the size of the image. Bu... | [
{
"answer_id": 176701,
"author": "BoltBait",
"author_id": 20848,
"author_profile": "https://Stackoverflow.com/users/20848",
"pm_score": 2,
"selected": false,
"text": "<p>In your onclick event, this.blur()</p>\n\n<p>or, specifically set focus somewhere else.</p>\n"
},
{
"answer_id... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176695",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17307/"
] | The attached screenshot is from OS X/Firefox 3. Note that the center tab (an image) has a dotted line around it, apparently because it was the most-recently selected tab. Is there a way I can eliminate this dotted line in CSS or JavaScript? (Hmmm...the free image hosting service has reduced the size of the image. But i... | You'll want to add the following line to your css:
```
a:active, a:focus { outline-style: none; -moz-outline-style:none; }
```
(Assuming your tabs are done using the a element, of course.)
*[edit] On request from everyone else, for future viewers of this it should be noted that the outline is essential for keyboard... |
176,709 | <p>I have a set of configuration items I need to persist to a "human readable" file. These items are in a hierarchy:</p>
<pre>
Device 1
Name
Channel 1
Name
Size
...
Channel N
Name
...
Device M
Name
Channel 1
</pre>
<p>Each of these item could be stored in a Dictionary with a string ... | [
{
"answer_id": 176713,
"author": "Mark Cidade",
"author_id": 1659,
"author_profile": "https://Stackoverflow.com/users/1659",
"pm_score": 2,
"selected": false,
"text": "<p><a href=\"http://www.codeplex.com/yaml\" rel=\"nofollow noreferrer\">YAML for .NET</a></p>\n"
},
{
"answer_id... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176709",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10703/"
] | I have a set of configuration items I need to persist to a "human readable" file. These items are in a hierarchy:
```
Device 1
Name
Channel 1
Name
Size
...
Channel N
Name
...
Device M
Name
Channel 1
```
Each of these item could be stored in a Dictionary with a string Key and a val... | See the [FileHelpers](http://filehelpers.sourceforge.net/) library. It's got tons of stuff for reading from and writing to a lot of different formats - and all you have to do is mark up your objects with attributes and call Save(). Sort of like ORM for flat files. |
176,712 | <p>I'd like to find the base url of my application, so I can automatically reference other files in my application tree...</p>
<p>So given a file config.php in the base of my application, if a file in a subdirectory includes it, knows what to prefix a url with. </p>
<pre><code>application/config.php
application/admin... | [
{
"answer_id": 176729,
"author": "theraccoonbear",
"author_id": 7210,
"author_profile": "https://Stackoverflow.com/users/7210",
"pm_score": 1,
"selected": false,
"text": "<p>Unless you track this yourself, I don't believe this would have a definition. Or rather, you're asking PHP to tra... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14253/"
] | I'd like to find the base url of my application, so I can automatically reference other files in my application tree...
So given a file config.php in the base of my application, if a file in a subdirectory includes it, knows what to prefix a url with.
```
application/config.php
application/admin/something.php
applic... | I use the following in a homebrew framework... Put this in a file in the root folder of your application and simply include it.
```
define('ABSPATH', str_replace('\\', '/', dirname(__FILE__)) . '/');
$tempPath1 = explode('/', str_replace('\\', '/', dirname($_SERVER['SCRIPT_FILENAME'])));
$tempPath2 = explode('/', sub... |
176,720 | <p>What is the easiest way to do this? Is it possible with managed code?</p>
| [
{
"answer_id": 176734,
"author": "Geoff",
"author_id": 10427,
"author_profile": "https://Stackoverflow.com/users/10427",
"pm_score": 6,
"selected": true,
"text": "<pre><code>this.BackgroundImage = //Image\nthis.FormBorderStyle = FormBorderStyle.None;\nthis.Width = this.BackgroundImage.Wi... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4386/"
] | What is the easiest way to do this? Is it possible with managed code? | ```
this.BackgroundImage = //Image
this.FormBorderStyle = FormBorderStyle.None;
this.Width = this.BackgroundImage.Width;
this.Height = this.BackgroundImage.Height;
this.TransparencyKey = Color.FromArgb(0, 255, 0); //Contrast Color
```
This allows you to create a form based on an image, and use transparency index to m... |
176,743 | <p>I'm writing a .NET forms control to edit HTML using MSHTML. I am creating some custom elements and want to make them effectively read-only. I thought I could go about this by focusing on the entire element any time focus entered anywhere in that element but the HtmlElement.Focus() doesn't select the entire element... | [
{
"answer_id": 177798,
"author": "Sergey Ilinsky",
"author_id": 23815,
"author_profile": "https://Stackoverflow.com/users/23815",
"pm_score": 0,
"selected": false,
"text": "<p>In case you are trying to apply readonly behavior to an User Input control, you can try using @readonly attribut... | 2008/10/06 | [
"https://Stackoverflow.com/questions/176743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1807/"
] | I'm writing a .NET forms control to edit HTML using MSHTML. I am creating some custom elements and want to make them effectively read-only. I thought I could go about this by focusing on the entire element any time focus entered anywhere in that element but the HtmlElement.Focus() doesn't select the entire element and ... | I found that setting the attribute:
```
contentEditable=false
```
Resulted in the desired behavior. |
176,749 | <p>I have a web service that uses Python's SimpleJSON to serialize JSON, and a javascript/ client that uses Google's Visualization <a href="http://code.google.com/apis/visualization/documentation/reference.html" rel="nofollow noreferrer">API</a>. When I try to read in the JSON response using Google Data Table's Query m... | [
{
"answer_id": 176780,
"author": "John Millikin",
"author_id": 3560,
"author_profile": "https://Stackoverflow.com/users/3560",
"pm_score": 3,
"selected": true,
"text": "<p>Are you certain the Google API is expecting JSON? In my experience Google's APIs tend not to be massively broken in ... | 2008/10/07 | [
"https://Stackoverflow.com/questions/176749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1227001/"
] | I have a web service that uses Python's SimpleJSON to serialize JSON, and a javascript/ client that uses Google's Visualization [API](http://code.google.com/apis/visualization/documentation/reference.html). When I try to read in the JSON response using Google Data Table's Query method, I am getting a "invalid label" er... | Are you certain the Google API is expecting JSON? In my experience Google's APIs tend not to be massively broken in a manner you're describing -- it could be that they're actually expecting a different format that merely resembles JSON.
---
Further poking around reveals instructions for retrieving data in the format ... |
176,777 | <p>I'm trying to build a proxy module for .NET, but I'm having trouble copying the Headers from the current request to the new request. I am setting the headers of the new request, because I want the proxy to support SOAP requests. Here is a portion of my code. I can post everything if need, but this is the only par... | [
{
"answer_id": 176788,
"author": "Darrel Miller",
"author_id": 6819,
"author_profile": "https://Stackoverflow.com/users/6819",
"pm_score": 3,
"selected": true,
"text": "<p>Some of the headers are actually exposed as properties directly on the HttpWebRequest object. These headers you are... | 2008/10/07 | [
"https://Stackoverflow.com/questions/176777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23869/"
] | I'm trying to build a proxy module for .NET, but I'm having trouble copying the Headers from the current request to the new request. I am setting the headers of the new request, because I want the proxy to support SOAP requests. Here is a portion of my code. I can post everything if need, but this is the only part that... | Some of the headers are actually exposed as properties directly on the HttpWebRequest object. These headers you are not allowed to set directly. e.g HttpWebRequest,ContentType and HttpWebRequest.UserAgent
You will need to update these properties directly and avoid setting them via the Headers property. |
176,827 | <p>I have an ASP.NET linkbutton control on my form. I would like to use it for javascript on the client side and prevent it from posting back to the server. (I'd like to use the linkbutton control so I can skin it and disable it in some cases, so a straight up tag is not preferred).</p>
<p>How do I prevent it from po... | [
{
"answer_id": 176829,
"author": "BoltBait",
"author_id": 20848,
"author_profile": "https://Stackoverflow.com/users/20848",
"pm_score": 2,
"selected": false,
"text": "<p>In C#, you'd do something like this:</p>\n\n<pre><code>MyButton.Attributes.Add(\"onclick\", \"put your javascript here... | 2008/10/07 | [
"https://Stackoverflow.com/questions/176827",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/417/"
] | I have an ASP.NET linkbutton control on my form. I would like to use it for javascript on the client side and prevent it from posting back to the server. (I'd like to use the linkbutton control so I can skin it and disable it in some cases, so a straight up tag is not preferred).
How do I prevent it from posting back ... | ASPX code:
```
<asp:LinkButton ID="someID" runat="server" Text="clicky"></asp:LinkButton>
```
Code behind:
```
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
someID.Attributes.Add("onClick", "return false;");
}
}
```
What renders as... |
176,831 | <p>I have a modal popup that initially shows some content but expands a div if a checkbox is selected. The modal expands correctly but doesn't recenter unless you scroll up or down. Is there a javascript event I can tack on to my javascript function to recenter the entire modal?</p>
| [
{
"answer_id": 176837,
"author": "Adam Bellaire",
"author_id": 21632,
"author_profile": "https://Stackoverflow.com/users/21632",
"pm_score": 0,
"selected": false,
"text": "<p>Whatever event you have bound to the scrolling to get it to re-center, bind that event to the checkbox/div expand... | 2008/10/07 | [
"https://Stackoverflow.com/questions/176831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14275/"
] | I have a modal popup that initially shows some content but expands a div if a checkbox is selected. The modal expands correctly but doesn't recenter unless you scroll up or down. Is there a javascript event I can tack on to my javascript function to recenter the entire modal? | Here is what it is:
```
$find('ModalPopupExtenderClientID')._layout();
```
For example:
```
$find('detailsPopUpExtenderId')._layout();
```
and in aspx:
```
<ccl:ModalPopupExtender runat="server" ID="MyPopUpExtender" TargetControlID="pop" PopupControlID="PopUp" BehaviorID="detailsPopUpExtenderId" BackgroundCssCla... |