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 |
|---|---|---|---|---|---|---|
247,331 | <p>I'm using jQuery validate on a form I am building and it is working great. What I want to do is when something is invalid to have the text field change colors and the error message to be white. I figured the following CSS would work:</p>
<pre><code>label .error {color: white; font-weight: bold;}
input .error {backg... | [
{
"answer_id": 247341,
"author": "Dave",
"author_id": 32300,
"author_profile": "https://Stackoverflow.com/users/32300",
"pm_score": 2,
"selected": false,
"text": "<p>Try label.error and input.error without spaces.</p>\n"
},
{
"answer_id": 247343,
"author": "Tomalak",
"aut... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247331",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/204/"
] | I'm using jQuery validate on a form I am building and it is working great. What I want to do is when something is invalid to have the text field change colors and the error message to be white. I figured the following CSS would work:
```
label .error {color: white; font-weight: bold;}
input .error {background-color: p... | One space can be one too much. Try:
```
label.error {color: white; font-weight: bold;}
input.error {background-color: pink; border: 1px dashed red; color: white}
```
Background info:
```
label .error /* selects all elements of class "error" *within* any label */
label.error /* selects labels of class "error" ... |
247,369 | <p>I am attempting to allow my web designers to use the metadata we have about database fields in the asp.net pages they are creating. The most obvious one is as follows:</p>
<pre><code><asp:TextBox runat="server" id="txTextBox" MaxLength="<Value From Metadata here>" ... />
</code></pre>
<p>All the requir... | [
{
"answer_id": 247390,
"author": "Marcus King",
"author_id": 19840,
"author_profile": "https://Stackoverflow.com/users/19840",
"pm_score": 0,
"selected": false,
"text": "<p>I think you should be able to do it with something like this</p>\n\n<pre><code><asp:TextBox runat=\"server\" id=... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31128/"
] | I am attempting to allow my web designers to use the metadata we have about database fields in the asp.net pages they are creating. The most obvious one is as follows:
```
<asp:TextBox runat="server" id="txTextBox" MaxLength="<Value From Metadata here>" ... />
```
All the required metadata is stored in our class obj... | You can use a data binding expression:
```
<asp:TextBox MaxLength="<%# Constant.Value %>" />
```
*but*, that requires it to be in a databound control. If it's not in a repeater or somesuch, you'll need to call Container.DataBind() at some point in the page lifecycle.
Alternatively, you could create an [ExpressionBu... |
247,373 | <p>I'm importing data from another system to MySQL, its a CSV file. The "Date" field however contains cryptic of 3-digit time entries, here's a random sample set:</p>
<pre><code>> 540
> 780
> 620
> 965
</code></pre>
<p>What's this? obviously its not 5:40 and 6:20. But it's not UNIX either (I tried 1225295... | [
{
"answer_id": 247381,
"author": "Vinko Vrsalovic",
"author_id": 5190,
"author_profile": "https://Stackoverflow.com/users/5190",
"pm_score": 2,
"selected": false,
"text": "<p>I've seen some systems where the date is stored in a special table and elsewhere as an id to it. This might be on... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/547/"
] | I'm importing data from another system to MySQL, its a CSV file. The "Date" field however contains cryptic of 3-digit time entries, here's a random sample set:
```
> 540
> 780
> 620
> 965
```
What's this? obviously its not 5:40 and 6:20. But it's not UNIX either (I tried 1225295**XXX** before I realized the time ran... | It's the number of minutes since midnight in five minute intervals. Your range of values should be 0 to 1440 |
247,413 | <p>Here's my binding source object: </p>
<pre><code>Public Class MyListObject
Private _mylist As New ObservableCollection(Of String)
Private _selectedName As String
Public Sub New(ByVal nameList As List(Of String), ByVal defaultName As String)
For Each name In nameList
_mylist.Add(na... | [
{
"answer_id": 247482,
"author": "Aaron Fischer",
"author_id": 5618,
"author_profile": "https://Stackoverflow.com/users/5618",
"pm_score": 6,
"selected": true,
"text": "<p>We had a similar issue last week. It has to do with how <code>SelectedValue</code> updates its internals. What we f... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247413",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/132931/"
] | Here's my binding source object:
```
Public Class MyListObject
Private _mylist As New ObservableCollection(Of String)
Private _selectedName As String
Public Sub New(ByVal nameList As List(Of String), ByVal defaultName As String)
For Each name In nameList
_mylist.Add(name)
Ne... | We had a similar issue last week. It has to do with how `SelectedValue` updates its internals. What we found was if you set `SelectedValue` it would not see the change we had to instead set `SelectedItem` which would properly update every thing. My conclusion is that `SelectedValue` is **designed for get** operations a... |
247,416 | <p>I'm using several variants of the Validator controls (RequiredFieldValidator, CompareValidator, etc) and am using the CssClass property of the validator. I can see (via Firebug) that the class is being applied, but the validator control itself is adding a style element to it, namely color: red. But I don't want th... | [
{
"answer_id": 247435,
"author": "Ken Ray",
"author_id": 12253,
"author_profile": "https://Stackoverflow.com/users/12253",
"pm_score": 1,
"selected": false,
"text": "<p>Have you looked at themes?</p>\n"
},
{
"answer_id": 247453,
"author": "Keltex",
"author_id": 28260,
... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247416",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/232/"
] | I'm using several variants of the Validator controls (RequiredFieldValidator, CompareValidator, etc) and am using the CssClass property of the validator. I can see (via Firebug) that the class is being applied, but the validator control itself is adding a style element to it, namely color: red. But I don't want that. I... | You can do this in your css file:
```
.validator
{
color: blue !important;
}
```
This will override the inline red style. |
247,422 | <p>I've got a Excel VSTO 2005 application I need to debug, I've tried attaching to the process EXCEL.EXE in Visual Studio 2005 to no avail.</p>
<p>Does anyone know what to do in order to debug managed code running in a VSTO Excel Application?</p>
| [
{
"answer_id": 247436,
"author": "Josh",
"author_id": 5233,
"author_profile": "https://Stackoverflow.com/users/5233",
"pm_score": 4,
"selected": true,
"text": "<p>I haven't worked with Excel, but with VSTO in Word, attaching the debugger to the WINWORD process works, but makes it impossi... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247422",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18818/"
] | I've got a Excel VSTO 2005 application I need to debug, I've tried attaching to the process EXCEL.EXE in Visual Studio 2005 to no avail.
Does anyone know what to do in order to debug managed code running in a VSTO Excel Application? | I haven't worked with Excel, but with VSTO in Word, attaching the debugger to the WINWORD process works, but makes it impossible to debug startup code, as it has already ran before you can attach. In this case you can insert
```
Debugger.Launch();
```
which will stop your code and ask to attach a debugger. It's abou... |
247,430 | <p>Is there a better way to implement copy construcor for matlab for a handle derived class other than adding a constructor with one input and explicitly copying its properties?</p>
<pre><code>obj.property1 = from.property1;
obj.property2 = from.property2;
</code></pre>
<p>etc.</p>
<p>Thanks,
Dani</p>
| [
{
"answer_id": 248091,
"author": "Mr Fooz",
"author_id": 25050,
"author_profile": "https://Stackoverflow.com/users/25050",
"pm_score": 4,
"selected": true,
"text": "<p>If you want a quick-and-dirty solution that assumes all properties can be copied, take a look at the PROPERTIES function... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28772/"
] | Is there a better way to implement copy construcor for matlab for a handle derived class other than adding a constructor with one input and explicitly copying its properties?
```
obj.property1 = from.property1;
obj.property2 = from.property2;
```
etc.
Thanks,
Dani | If you want a quick-and-dirty solution that assumes all properties can be copied, take a look at the PROPERTIES function. Here's an example of a class that automatically copies all properties:
```
classdef Foo < handle
properties
a = 1;
end
methods
function F=Foo(rhs)
if nargin==0
% default... |
247,442 | <p>I have a JAX-RPC (Java) web service that needs to return a complex polymorphic value. To be more specific, the class structure is something like this:</p>
<pre><code>abstract class Child {
}
class Question extends Child {
private String name;
// other fields, getters, and setters
}
class Section extends ... | [
{
"answer_id": 247458,
"author": "Aaron Fischer",
"author_id": 5618,
"author_profile": "https://Stackoverflow.com/users/5618",
"pm_score": 0,
"selected": false,
"text": "<p>I had to deal with the same issue. But I ended up using a combobox with paging support and auto complete. Current... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247442",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25498/"
] | I have a JAX-RPC (Java) web service that needs to return a complex polymorphic value. To be more specific, the class structure is something like this:
```
abstract class Child {
}
class Question extends Child {
private String name;
// other fields, getters, and setters
}
class Section extends Child {
pri... | I think your idea for the autocomplete extender is the best solution. I've had this problem as well (sounds similar--a project you are taking over from somebody else). The push-back often comes from the user side. They are used to being able to select from a list of items. Unfortunately as the database grows, this beco... |
247,471 | <p>I'm trying to build a shared library (DLL) on Windows, using MSVC 6 (retro!) and I have a peculiar link issue I need to resolve. My shared library must access some global state, controlled by the loading application.</p>
<p>Broadly, what I have is this:</p>
<p>application.c:</p>
<pre><code>static int g_private_v... | [
{
"answer_id": 247588,
"author": "Peter Olsson",
"author_id": 2703,
"author_profile": "https://Stackoverflow.com/users/2703",
"pm_score": 1,
"selected": false,
"text": "<p>I'll start with half of the answer.</p>\n\n<p>In shared_library.c:</p>\n\n<pre><code>__declspec(dllexport) int __std... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247471",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23309/"
] | I'm trying to build a shared library (DLL) on Windows, using MSVC 6 (retro!) and I have a peculiar link issue I need to resolve. My shared library must access some global state, controlled by the loading application.
Broadly, what I have is this:
application.c:
```
static int g_private_value;
int use_private_value(... | This is actually going to be pretty difficult to get working. On Unix/Linux you can have shared objects and applications import symbols from each other, but on Windows you can't have a DLL import symbols from the application that loads it: the Windows PE executable format just doesn't support that idiom.
I know that t... |
247,474 | <p>A path in Perforce contains files a.txt and b.txt. I'll refer to the main path as mainline.</p>
<p>I've create a branch (called initialbranch) from there which contains just a.txt. I make lots of changes to a.txt, and am very happy with it. However, it's not yet ready for submitting back to mainline. I can easily i... | [
{
"answer_id": 247566,
"author": "erickson",
"author_id": 3474,
"author_profile": "https://Stackoverflow.com/users/3474",
"pm_score": 3,
"selected": true,
"text": "<p>I'm not convinced I understand your question, but I'll try to help. </p>\n\n<p>If you're saying that you don't really wan... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20972/"
] | A path in Perforce contains files a.txt and b.txt. I'll refer to the main path as mainline.
I've create a branch (called initialbranch) from there which contains just a.txt. I make lots of changes to a.txt, and am very happy with it. However, it's not yet ready for submitting back to mainline. I can easily integrate a... | I'm not convinced I understand your question, but I'll try to help.
If you're saying that you don't really want b.txt in initialbranch, you can define a branch specification like this:
```
initialbranch/a.txt secondbranch/a.txt
mainline/b.txt secondbranch/b.txt
```
That way, when you integrate using the "secondbra... |
247,479 | <p>Does anyone know of a script that can select all text references to URLs and automatically replace them with anchor tags pointing to those locations?</p>
<pre><code>For example:
http://www.google.com
would automatically turn into
<a href="http://www.google.com">http://www.google.com</a>
</code></pre... | [
{
"answer_id": 247542,
"author": "Pseudo Masochist",
"author_id": 8529,
"author_profile": "https://Stackoverflow.com/users/8529",
"pm_score": 5,
"selected": true,
"text": "<p>JQuery isn't going to help you a whole lot here as you're not really concerned with DOM traversal/manipulation (o... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247479",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4481/"
] | Does anyone know of a script that can select all text references to URLs and automatically replace them with anchor tags pointing to those locations?
```
For example:
http://www.google.com
would automatically turn into
<a href="http://www.google.com">http://www.google.com</a>
```
Note: I am wanting this because ... | JQuery isn't going to help you a whole lot here as you're not really concerned with DOM traversal/manipulation (other than creating the anchor tag). If all your URLs were in <p class="url"> tags then perhaps.
A vanilla JavaScript solution is probably what you want, and as fate would have it, [this guy should have you ... |
247,483 | <p>I need to do an <a href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods" rel="noreferrer">HTTP GET</a> request in JavaScript. What's the best way to do that?</p>
<p>I need to do this in a Mac OS X dashcode widget.</p>
| [
{
"answer_id": 247489,
"author": "Greg",
"author_id": 24181,
"author_profile": "https://Stackoverflow.com/users/24181",
"pm_score": 2,
"selected": false,
"text": "<p><a href=\"http://en.wikipedia.org/wiki/Ajax_%28programming%29\" rel=\"nofollow noreferrer\">Ajax</a></p>\n\n<p>You'd be be... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247483",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26948/"
] | I need to do an [HTTP GET](http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods) request in JavaScript. What's the best way to do that?
I need to do this in a Mac OS X dashcode widget. | Browsers (and Dashcode) provide an XMLHttpRequest object which can be used to make HTTP requests from JavaScript:
```
function httpGet(theUrl)
{
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false ); // false for synchronous request
xmlHttp.send( null );
return xmlHttp.responseText;
... |
247,486 | <p>I'm loading data into a DataSet from an XML file using the ReadXml method. This results in two tables with the same name. One of the tables has a namespace and the other doesn't. I'm trying to reference the table with the namespace. Can anyone tell me how to do this?</p>
<pre><code> Dim reader As XmlTextReade... | [
{
"answer_id": 247489,
"author": "Greg",
"author_id": 24181,
"author_profile": "https://Stackoverflow.com/users/24181",
"pm_score": 2,
"selected": false,
"text": "<p><a href=\"http://en.wikipedia.org/wiki/Ajax_%28programming%29\" rel=\"nofollow noreferrer\">Ajax</a></p>\n\n<p>You'd be be... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28327/"
] | I'm loading data into a DataSet from an XML file using the ReadXml method. This results in two tables with the same name. One of the tables has a namespace and the other doesn't. I'm trying to reference the table with the namespace. Can anyone tell me how to do this?
```
Dim reader As XmlTextReader = New XmlTextRe... | Browsers (and Dashcode) provide an XMLHttpRequest object which can be used to make HTTP requests from JavaScript:
```
function httpGet(theUrl)
{
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false ); // false for synchronous request
xmlHttp.send( null );
return xmlHttp.responseText;
... |
247,530 | <p>I've an image that is wrapped in an anchor tag that, through jQuery, triggers an action somewhere else on the page. When I click on the image, two tiny 1px by 1px boxes show up in the upper and lower left corners of the image.</p>
<p>My CSS styles explicitly state no borders for images: <code>a,img { border: 0; }<... | [
{
"answer_id": 247489,
"author": "Greg",
"author_id": 24181,
"author_profile": "https://Stackoverflow.com/users/24181",
"pm_score": 2,
"selected": false,
"text": "<p><a href=\"http://en.wikipedia.org/wiki/Ajax_%28programming%29\" rel=\"nofollow noreferrer\">Ajax</a></p>\n\n<p>You'd be be... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247530",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32154/"
] | I've an image that is wrapped in an anchor tag that, through jQuery, triggers an action somewhere else on the page. When I click on the image, two tiny 1px by 1px boxes show up in the upper and lower left corners of the image.
My CSS styles explicitly state no borders for images: `a,img { border: 0; }`
It also seems ... | Browsers (and Dashcode) provide an XMLHttpRequest object which can be used to make HTTP requests from JavaScript:
```
function httpGet(theUrl)
{
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false ); // false for synchronous request
xmlHttp.send( null );
return xmlHttp.responseText;
... |
247,538 | <p>I was looking through the plans for C++0x and came upon <code>std::initializer_list</code> for implementing initializer lists in user classes. This class could not be implemented in C++
without using itself, or else using some "compiler magic". If it could, it wouldn't be needed since whatever technique you used t... | [
{
"answer_id": 247540,
"author": "Eclipse",
"author_id": 8701,
"author_profile": "https://Stackoverflow.com/users/8701",
"pm_score": 3,
"selected": false,
"text": "<p>The only other one I could think of was the <a href=\"http://msdn.microsoft.com/en-us/library/70ky2y6k.aspx\" rel=\"nofol... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247538",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8701/"
] | I was looking through the plans for C++0x and came upon `std::initializer_list` for implementing initializer lists in user classes. This class could not be implemented in C++
without using itself, or else using some "compiler magic". If it could, it wouldn't be needed since whatever technique you used to implement `ini... | `std::type_info` is a simple class, although populating it requires `typeinfo`: a compiler construct.
Likewise, exceptions are normal objects, but throwing exceptions requires compiler magic (where are the exceptions allocated?).
The question, to me, is "how close can we get to `std::initializer_list`s without compil... |
247,541 | <p>I've editing this original question as I think I've narrowed down the problem...</p>
<p>I have one view in my site that will not let me put $document.ready within a masterpage contentplaceholder. I've stripped this page to the bare bones and the only thing that is special about it is it has a custom route in global... | [
{
"answer_id": 247554,
"author": "Ben Scheirman",
"author_id": 3381,
"author_profile": "https://Stackoverflow.com/users/3381",
"pm_score": 2,
"selected": false,
"text": "<p>Your master page (or view page if you're not using master pages) needs to reference jquery. This is included in th... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247541",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5463/"
] | I've editing this original question as I think I've narrowed down the problem...
I have one view in my site that will not let me put $document.ready within a masterpage contentplaceholder. I've stripped this page to the bare bones and the only thing that is special about it is it has a custom route in global.asax
```... | I had the same problem and it turned out that when I used a certain route it changed the perceived file hierarchy of the site such as the ../../Content link for the .js file didn't work any more. I fixed it by changing my jquery script reference to look like this:
```
<script src="<%= Url.Content("~/Content/jquery-1.2... |
247,546 | <p>I'm sending an email using the dotnet framework. Here is the template that I'm using to create the message:</p>
<pre><code>Date of Hire: %HireDate%
Annual Salary: %AnnualIncome%
Reason for Request: %ReasonForRequest%
Name of Voluntary Employee: %FirstName% %LastName%
Total Coverage Applied For: %EECoverageAmount%... | [
{
"answer_id": 247664,
"author": "seanyboy",
"author_id": 1726,
"author_profile": "https://Stackoverflow.com/users/1726",
"pm_score": -1,
"selected": false,
"text": "<p>Change your line termination from crlf to either cr or lf. </p>\n\n<p>I suspect that the top of the email uses only cr ... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247546",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21155/"
] | I'm sending an email using the dotnet framework. Here is the template that I'm using to create the message:
```
Date of Hire: %HireDate%
Annual Salary: %AnnualIncome%
Reason for Request: %ReasonForRequest%
Name of Voluntary Employee: %FirstName% %LastName%
Total Coverage Applied For: %EECoverageAmount%
Guaranteed Co... | Start every line with 2 spaces and outlook will be "tricked" into keeping your formatting.
So change
```
Date of Hire: %HireDate%
Annual Salary: %AnnualIncome%
Reason for Request: %ReasonForRequest%
Name of Voluntary Employee: %FirstName% %LastName%
Total Coverage Applied For: %EECoverageAmount%
Guaranteed Coverage... |
247,550 | <p>I have a blank test app created in VS 2005 as ASP.NET application. <a href="http://msdn.microsoft.com/en-us/library/ms998351.aspx" rel="nofollow noreferrer">MSDN says</a> that </p>
<blockquote>
<p>By default, ASP.NET does not use impersonation, and your code runs using the ASP.NET application's process identity.<... | [
{
"answer_id": 247582,
"author": "Rob Stevenson-Leggett",
"author_id": 4950,
"author_profile": "https://Stackoverflow.com/users/4950",
"pm_score": 1,
"selected": false,
"text": "<p>Seems odd, A few things to try:</p>\n\n<ul>\n<li>While in on a breakpoint in Debug type $user in a watch wi... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/578/"
] | I have a blank test app created in VS 2005 as ASP.NET application. [MSDN says](http://msdn.microsoft.com/en-us/library/ms998351.aspx) that
>
> By default, ASP.NET does not use impersonation, and your code runs using the ASP.NET application's process identity.
>
>
>
And I have the following web.config
```
<confi... | I think I understand your problem here.
Things to know before moving further,
1. There are different security context while an application is running. Like `System.Security.Principal.WindowsIdentity.GetCurrent().Name`, and the one you mentioned above, i.e. `System.Threading.Thread.CurrentPrincipal.Identity.Name`
2. I... |
247,571 | <p>I'm trying filter the child collection of an aggregate root when loading it with Nhibernate. Load a Customer with all their Orders that have been shipped. Is this possible?</p>
| [
{
"answer_id": 248184,
"author": "Tim Scott",
"author_id": 29493,
"author_profile": "https://Stackoverflow.com/users/29493",
"pm_score": 2,
"selected": false,
"text": "<p>Well, you can expose properties that are filtered in the map, like so:</p>\n\n<pre><code><bag name=\"shippedOrders... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247571",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I'm trying filter the child collection of an aggregate root when loading it with Nhibernate. Load a Customer with all their Orders that have been shipped. Is this possible? | Well, you can expose properties that are filtered in the map, like so:
```
<bag name="shippedOrders" ... where="Status == 'Shipped'" >
<key column="CustomerId" />
<one-to-many class="Order" />
</bag>
```
The 'where' attribute is arbitrary SQL.
Theoretically you could have two properties of Customer, Orders an... |
247,596 | <p>svg is an xml based graphics and you can add JavaScripts to it. I have tried to access to the script functions defined in a svg. The script in my svg is something like this:</p>
<pre><code><svg ... onload="RunScript(evt);"...>
<script type="text/javascript">
...
function RunScript(loadEvent) {
// Get ... | [
{
"answer_id": 247811,
"author": "pdc",
"author_id": 8925,
"author_profile": "https://Stackoverflow.com/users/8925",
"pm_score": 3,
"selected": true,
"text": "<p>I think the clue might be in 'on another site'. There are strict rules about when JavaScript programs from different sites are... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62776/"
] | svg is an xml based graphics and you can add JavaScripts to it. I have tried to access to the script functions defined in a svg. The script in my svg is something like this:
```
<svg ... onload="RunScript(evt);"...>
<script type="text/javascript">
...
function RunScript(loadEvent) {
// Get object in my html by id
... | I think the clue might be in 'on another site'. There are strict rules about when JavaScript programs from different sites are allowed to communicate with teach other. The embedded SVG is being treated the same way a document inside an `iframe` would. |
247,626 | <p>How can I set cron to run certain commands every one and a half hours?</p>
| [
{
"answer_id": 247640,
"author": "vfilby",
"author_id": 24279,
"author_profile": "https://Stackoverflow.com/users/24279",
"pm_score": 4,
"selected": false,
"text": "<p>Is there a good reason why you can't use 1 hour or 2 hours? It would be simpler for sure.</p>\n\n<p>I haven't tried this... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247626",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25368/"
] | How can I set cron to run certain commands every one and a half hours? | That's not possible with a single expression in normal `cron`.
The best you could do without modifying the code is:
```
0 0,3,6,9,12,15,18,21 * * * [cmd]
30 1,4,7,10,13,16,19,22 * * * [cmd]
```
These *might* be compressible, depending on the version of cron you have to:
```
0 */3 * * * [cmd]
30 1-23/3 * * * [cmd]... |
247,639 | <p>I have seen a codebase recently that I fear is violating alignment constraints. I've scrubbed it to produce a minimal example, given below. Briefly, the players are:</p>
<ul>
<li><p><em>Pool</em>. This is a class which allocates memory efficiently, for some definition of 'efficient'. <em>Pool</em> is guaranteed to ... | [
{
"answer_id": 247690,
"author": "Andrew Grant",
"author_id": 1043,
"author_profile": "https://Stackoverflow.com/users/1043",
"pm_score": 1,
"selected": false,
"text": "<p>The alignment will be picked by the compiler according to its defaults, this will probably end up as four-bytes unde... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3778/"
] | I have seen a codebase recently that I fear is violating alignment constraints. I've scrubbed it to produce a minimal example, given below. Briefly, the players are:
* *Pool*. This is a class which allocates memory efficiently, for some definition of 'efficient'. *Pool* is guaranteed to return a chunk of memory that i... | Ok - had a chance to read it properly. You have an alignment problem, and invoke undefined behaviour when you access the char array as an Obj\_list. Most likely your platform will do one of three things: let you get away with it, let you get away with it at a runtime penalty or occasionally crash with a bus error.
You... |
247,647 | <p>I have a plugin for OpenFire that creates and delivers a message to a user using</p>
<pre><code>XMPPServer.getInstance().getMessageRouter().route(message)
</code></pre>
<p>What I would like to know is what happens to that message if the user is not online. </p>
<p>My goal is to only have the message delivered if... | [
{
"answer_id": 248003,
"author": "Chase Seibert",
"author_id": 7679,
"author_profile": "https://Stackoverflow.com/users/7679",
"pm_score": 3,
"selected": true,
"text": "<p>It's all down to Openfire config. In the Openfire admin console, go to Server -> Server Settings -> Offline Messages... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21925/"
] | I have a plugin for OpenFire that creates and delivers a message to a user using
```
XMPPServer.getInstance().getMessageRouter().route(message)
```
What I would like to know is what happens to that message if the user is not online.
My goal is to only have the message delivered if the user is online, and fail or b... | It's all down to Openfire config. In the Openfire admin console, go to Server -> Server Settings -> Offline Messages. There are options for store, bounce and drop.
* Store: deliver the message when the
user comes back online.
* Drop: Just discard the message.
* Bounce: Discard and notify the sender with a return mess... |
247,666 | <p>I need to use C# programatically to append several preexisting <code>docx</code> files into a single, long <code>docx</code> file - including special markups like bullets and images. Header and footer information will be stripped out, so those won't be around to cause any problems.</p>
<p>I can find plenty of info... | [
{
"answer_id": 248249,
"author": "Terence Lewis",
"author_id": 32539,
"author_profile": "https://Stackoverflow.com/users/32539",
"pm_score": 2,
"selected": false,
"text": "<p>I wrote a little test app a while ago to do this. My test app worked with Word 2003 documents (.doc) not .docx, b... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247666",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32471/"
] | I need to use C# programatically to append several preexisting `docx` files into a single, long `docx` file - including special markups like bullets and images. Header and footer information will be stripped out, so those won't be around to cause any problems.
I can find plenty of information about manipulating an ind... | In spite of all good suggestions and solutions submitted, I developed an alternative. In my opinion you should avoid using Word in server applications entirely. So I worked with OpenXML, but it did not work with AltChunk. I added text to original body, I receive a List of byte[] instead a List of file names but you can... |
247,668 | <p>I'm trying to access the command line and execute a command, and then return the output to my aspx page. A good example would be running dir on page load of an aspx page and returning the output via Response.Write(). I have tried using the code below. When I try debugging this it runs but never finishes loading and ... | [
{
"answer_id": 247679,
"author": "Sunny Milenov",
"author_id": 8220,
"author_profile": "https://Stackoverflow.com/users/8220",
"pm_score": 2,
"selected": false,
"text": "<p>Most likely your problem is with the permissions. The user under which ASP.NET process runs is with very limited ri... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247668",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32474/"
] | I'm trying to access the command line and execute a command, and then return the output to my aspx page. A good example would be running dir on page load of an aspx page and returning the output via Response.Write(). I have tried using the code below. When I try debugging this it runs but never finishes loading and no ... | You have a problem with the syntax of commandline arguments to cmd.exe. This is why cmd never exits.
In order to have cmd.exe run a program and then quit, you need to send it the syntax "/c [command]". Try running the same code with the line
```
si.StartInfo.Arguments = "dir";
```
replaced with
```
... |
247,678 | <p>I have a Perl application that parses MediaWiki SQL tables and displays data from multiple wiki pages. I need to be able to re-create the absolute image path to display the images, eg: <code>.../f/fc/Herbs.jpg/300px-Herbs.jpg</code> </p>
<p>From MediaWiki Manual:</p>
<blockquote>
<p>Image_Authorisation: "the [im... | [
{
"answer_id": 248086,
"author": "JDrago",
"author_id": 29060,
"author_profile": "https://Stackoverflow.com/users/29060",
"pm_score": 3,
"selected": true,
"text": "<p>One possible way would be to calculate the MD5 signature of the file (or the file ID in a database), and then build/find ... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247678",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32477/"
] | I have a Perl application that parses MediaWiki SQL tables and displays data from multiple wiki pages. I need to be able to re-create the absolute image path to display the images, eg: `.../f/fc/Herbs.jpg/300px-Herbs.jpg`
From MediaWiki Manual:
>
> Image\_Authorisation: "the [image] path can be calculated easily fr... | One possible way would be to calculate the MD5 signature of the file (or the file ID in a database), and then build/find the path based on that.
For example, say we get an MD5 signature like "1ff8a7b5dc7a7d1f0ed65aaa29c04b1e"
The path might look like "/1f/f" or "/1f/ff/8a"
The reason is that you don't want to have a... |
247,703 | <p>Is there a (standardized) way to get the name of the current method using c++? </p>
<p>Using GNU GCC you can do this by using the macro <code>__FUNCTION__</code> and <code>__PRETTY_FUNCTION__</code> (surrounded by 2 underscores), however, this is of course non portable. Is there a way to do this in standard c++ or ... | [
{
"answer_id": 247707,
"author": "Marko",
"author_id": 31141,
"author_profile": "https://Stackoverflow.com/users/31141",
"pm_score": 0,
"selected": false,
"text": "<p>No, it is not supported by c++ standard.</p>\n"
},
{
"answer_id": 247721,
"author": "Michael Burr",
"auth... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247703",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23163/"
] | Is there a (standardized) way to get the name of the current method using c++?
Using GNU GCC you can do this by using the macro `__FUNCTION__` and `__PRETTY_FUNCTION__` (surrounded by 2 underscores), however, this is of course non portable. Is there a way to do this in standard c++ or a way to make it portable? | The `__func__` identifier is part of the C99 standard and is in the C++0x draft.
The identifier `__func__` is implicitly declared by the compiler as if the following were at the very start of each function body:
```
static const char __func__[] = "function-name";
```
where `function-name` is an implementation-defin... |
247,706 | <p>In Bash I'm executing a command and putting the result in a variable like this:</p>
<pre>export var=`svn ls`</pre>
<p>But if SVN fails for some reason--say it returns a non-zero error code--export still returns status code 0. How do I detect if the executed command fails?</p>
| [
{
"answer_id": 247722,
"author": "Marko",
"author_id": 31141,
"author_profile": "https://Stackoverflow.com/users/31141",
"pm_score": 1,
"selected": false,
"text": "<p>I had similar problem, it can be done like this:</p>\n\n<pre>\nrm -f error_marker_file\nexport var=`svn ls || touch error... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/79/"
] | In Bash I'm executing a command and putting the result in a variable like this:
```
export var=`svn ls`
```
But if SVN fails for some reason--say it returns a non-zero error code--export still returns status code 0. How do I detect if the executed command fails? | ```
var=`svn ls`
if [[ $? == 0 ]]
then
export var
else
unset var
fi
```
`$?` is the exit code of the last command executed, which is `svn ls` here.
jmohr's solution is short and sweet. Adapted mildly,
```
var=`svn ls` && export var || unset var
```
would be approximately equivalent to the above (`... |
247,708 | <p>While the built-in analytics of MOSS2007 are nice to have - they are inadequate at the same time. Any ideas where I can look for a more comprehensive package? Am I missing something?</p>
<p>Thanks,
Carl</p>
| [
{
"answer_id": 247722,
"author": "Marko",
"author_id": 31141,
"author_profile": "https://Stackoverflow.com/users/31141",
"pm_score": 1,
"selected": false,
"text": "<p>I had similar problem, it can be done like this:</p>\n\n<pre>\nrm -f error_marker_file\nexport var=`svn ls || touch error... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32480/"
] | While the built-in analytics of MOSS2007 are nice to have - they are inadequate at the same time. Any ideas where I can look for a more comprehensive package? Am I missing something?
Thanks,
Carl | ```
var=`svn ls`
if [[ $? == 0 ]]
then
export var
else
unset var
fi
```
`$?` is the exit code of the last command executed, which is `svn ls` here.
jmohr's solution is short and sweet. Adapted mildly,
```
var=`svn ls` && export var || unset var
```
would be approximately equivalent to the above (`... |
247,718 | <p>I am calling a SQL proc that has 3 OUTPUT params. After the call to the proc one of the params does not return a value when the other two do. Profiler shows that all 3 values are being returned.</p>
<p>The params are declared as follows in the proc...</p>
<pre><code>@UsrVariableID INT OUTPUT,
@OrganisationName NVA... | [
{
"answer_id": 247755,
"author": "Ady",
"author_id": 31395,
"author_profile": "https://Stackoverflow.com/users/31395",
"pm_score": 2,
"selected": false,
"text": "<p>You could try declaring the parameters first (then set the values), and see if this make a difference.</p>\n\n<pre><code>cm... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1127460/"
] | I am calling a SQL proc that has 3 OUTPUT params. After the call to the proc one of the params does not return a value when the other two do. Profiler shows that all 3 values are being returned.
The params are declared as follows in the proc...
```
@UsrVariableID INT OUTPUT,
@OrganisationName NVARCHAR(256) OUTPUT,
@V... | With output parameters that have variable length data types (nvarchar, varchar, etc), I've found that being more explicit leads to better results. In the case you've posted, a type is not specified on the C# side. I would probably change things to look something like the following:
```
SqlParameter theOrganizationName... |
247,724 | <p>I am creating a Python script where it does a bunch of tasks and one of those tasks is to launch and open an instance of Excel. What is the ideal way of accomplishing that in my script?</p>
| [
{
"answer_id": 247730,
"author": "Marko",
"author_id": 31141,
"author_profile": "https://Stackoverflow.com/users/31141",
"pm_score": 0,
"selected": false,
"text": "<p>os.system(\"open file.xls\")</p>\n"
},
{
"answer_id": 247740,
"author": "warren",
"author_id": 4418,
... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247724",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4872/"
] | I am creating a Python script where it does a bunch of tasks and one of those tasks is to launch and open an instance of Excel. What is the ideal way of accomplishing that in my script? | While the `Popen` answers are reasonable for the general case, I would recommend `win32api` for this specific case, if you want to do something useful with it:
It goes something like this:
```
from win32com.client import Dispatch
xl = Dispatch('Excel.Application')
wb = xl.Workbooks.Open('C:\\Documents and Settings\\G... |
247,738 | <p>If you have an STL vector which has been resized, is it safe to take the address of element 0 and assume the rest of the vector will follow in memory?</p>
<p>e.g.</p>
<pre><code>vector<char> vc(100);
// do some stuff with vc
vc.resize(200);
char* p = &vc[0];
// do stuff with *p
</code></pre>
| [
{
"answer_id": 247744,
"author": "Keith Nicholas",
"author_id": 10431,
"author_profile": "https://Stackoverflow.com/users/10431",
"pm_score": 2,
"selected": false,
"text": "<p>yes. </p>\n\n<p>it should alway be contiguous</p>\n"
},
{
"answer_id": 247746,
"author": "Jasper B... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4086/"
] | If you have an STL vector which has been resized, is it safe to take the address of element 0 and assume the rest of the vector will follow in memory?
e.g.
```
vector<char> vc(100);
// do some stuff with vc
vc.resize(200);
char* p = &vc[0];
// do stuff with *p
``` | **Yes, that is a valid assumption (\*).**
From the C++03 standard (23.2.4.1):
>
> The elements of a vector are stored
> contiguously, meaning that if v is a
> vector where T is some
> type other than bool, then it obeys
> the identity &v[n] == &v[0] + n for
> all 0 <= n < v.size().
>
>
>
(\*) ... but watch ... |
247,743 | <p>I already know: "Don't use css expressions!" My question is not about whether I should be using an expression or if there is an alternative; my question is simply: <strong>Can I get a css expression to only be evaluated in versions of IE prior to version 7 without using conditional comments?</strong></p>
<p>I occa... | [
{
"answer_id": 247763,
"author": "Diodeus - James MacFarlane",
"author_id": 12579,
"author_profile": "https://Stackoverflow.com/users/12579",
"pm_score": 1,
"selected": false,
"text": "<p>You can try <a href=\"http://rafael.adm.br/css_browser_selector/\" rel=\"nofollow noreferrer\">Rafae... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5628/"
] | I already know: "Don't use css expressions!" My question is not about whether I should be using an expression or if there is an alternative; my question is simply: **Can I get a css expression to only be evaluated in versions of IE prior to version 7 without using conditional comments?**
I occasionally use an undersco... | I always use the star "hack" to target IE6 specifically, but it does require your browser to be in **standards compliant** mode (see below).
```
/* IE6 only */
* html .myClass {
width: 500px;
}
```
I like it because it doesn't rely on parsing inconsistencies in browsers and it validates according to [W3C](htt... |
247,768 | <p>I am using JSF frontend for a page where an image is uploaded or deleted. Clicking on the upload or delete button causes a postback and the page to reload with the updated status. This however, resets the scroll position of the page. How should I go about retaining the scrollback of this page on the postback actions... | [
{
"answer_id": 247802,
"author": "shadit",
"author_id": 9925,
"author_profile": "https://Stackoverflow.com/users/9925",
"pm_score": 0,
"selected": false,
"text": "<p>If you are using Apache MyFaces Tomahawk, you can set the parameter AUTOSCROLL then make sure AutoScrollPhaseListener is e... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I am using JSF frontend for a page where an image is uploaded or deleted. Clicking on the upload or delete button causes a postback and the page to reload with the updated status. This however, resets the scroll position of the page. How should I go about retaining the scrollback of this page on the postback actions. | You can do that with an actionListener. For example, in your page (page.jsf for example):
```
<f:view>
<h:form>
<h:commandLink actionListener="#{bean.method}">
<h:outputText value="Submit" />
<f:param name="anchor" value="image" />
</h:commandLink>
</h:form>
<div... |
247,770 | <p>I want to detect whether module has changed. Now, using inotify is simple, you just need to know the directory you want to get notifications from.</p>
<p>How do I retrieve a module's path in python?</p>
| [
{
"answer_id": 248066,
"author": "Cheery",
"author_id": 21711,
"author_profile": "https://Stackoverflow.com/users/21711",
"pm_score": 5,
"selected": false,
"text": "<p>This was trivial.</p>\n\n<p>Each module has a <code>__file__</code> variable that shows its relative path from where you... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21711/"
] | I want to detect whether module has changed. Now, using inotify is simple, you just need to know the directory you want to get notifications from.
How do I retrieve a module's path in python? | ```
import a_module
print(a_module.__file__)
```
Will actually give you the path to the .pyc file that was loaded, at least on Mac OS X. So I guess you can do:
```
import os
path = os.path.abspath(a_module.__file__)
```
You can also try:
```
path = os.path.dirname(a_module.__file__)
```
To get the module's dire... |
247,772 | <pre><code>a:3:{i:0;i:4;i:1;i:3;i:2;i:2;}
</code></pre>
<p>Am I right to say that this is an array of size 3 where the key value pairs are <code>0->4</code>, <code>1->3</code>, and <code>2->2</code>?</p>
<p>If so, I find this representation awfully confusing. At first, I thought it was a listing of values (o... | [
{
"answer_id": 247784,
"author": "JamShady",
"author_id": 11905,
"author_profile": "https://Stackoverflow.com/users/11905",
"pm_score": 0,
"selected": false,
"text": "<p>Why don't you use the <a href=\"http://uk.php.net/unserialize\" rel=\"nofollow noreferrer\">unserialize()</a> function... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/572/"
] | ```
a:3:{i:0;i:4;i:1;i:3;i:2;i:2;}
```
Am I right to say that this is an array of size 3 where the key value pairs are `0->4`, `1->3`, and `2->2`?
If so, I find this representation awfully confusing. At first, I thought it was a listing of values (or the array contained `{0, 4, 1, 3, 2, 2}`), but I figured that the ... | ```
$string="a:3:{i:0;i:4;i:1;i:3;i:2;i:2;}";
$array=unserialize($string);
print_r($array);
```
outpts:
```
Array
(
[0] => 4
[1] => 3
[2] => 2
)
```
If think the point is that PHP does not differentiate between integer indexed arrays and string indexed hashtables. The serialization format can be used f... |
247,779 | <p>I have essentially a survey that is shown, and people answer questions a lot like a test,
and there are different paths, it is pretty easy so far, but i wanted to make it more dynamic, so that i can have a generic rule that is for the test with all the paths, to make the evaluator easier to work with currently i ju... | [
{
"answer_id": 247836,
"author": "Tim Robinson",
"author_id": 32133,
"author_profile": "https://Stackoverflow.com/users/32133",
"pm_score": 3,
"selected": true,
"text": "<p>This doesn't have to be complicated: you're most of the way already, since your and elements effectively implemen... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5111/"
] | I have essentially a survey that is shown, and people answer questions a lot like a test,
and there are different paths, it is pretty easy so far, but i wanted to make it more dynamic, so that i can have a generic rule that is for the test with all the paths, to make the evaluator easier to work with currently i just a... | This doesn't have to be complicated: you're most of the way already, since your and elements effectively implement an AND-type rule. I would introduce an element that can hold and elements.
In your could, you could have:
* A RuleBase class, with a "public abstract bool Evaluate()" method
* TrueRule, FalseRule and OrR... |
247,800 | <p>I don't think this is possible, but if is then I need it :)</p>
<p>I have a auto-generated proxy file from the wsdl.exe command line tool by Visual Studio 2008.</p>
<p>The proxy output is partial classes. I want to override the default constructor that is generated. I would rather not modify the code since it is a... | [
{
"answer_id": 247808,
"author": "James Curran",
"author_id": 12725,
"author_profile": "https://Stackoverflow.com/users/12725",
"pm_score": -1,
"selected": false,
"text": "<p>Nothing that I can think of. The \"best\" way I can come up with is to add a ctor with a dummy parameter and use... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4481/"
] | I don't think this is possible, but if is then I need it :)
I have a auto-generated proxy file from the wsdl.exe command line tool by Visual Studio 2008.
The proxy output is partial classes. I want to override the default constructor that is generated. I would rather not modify the code since it is auto-generated.
I... | This is not possible.
Partial classes are essentially parts of the same class; no method can be defined twice or overridden, and that includes the constructor.
You could call a method in the constructor, and only implement it in the other part file. |
247,818 | <p>Multimap essentially has groups of data sorted by the key. I want a method by which I could access these individual groups and get their aggregate values.
For example, in a <code>std::multimap< string, int ></code> I store </p>
<pre><code>{"Group1", 1},
{"Group1", 2},
{"Group1", 3},
{"Group2", 10},
{"Gro... | [
{
"answer_id": 247852,
"author": "Mark Ransom",
"author_id": 5987,
"author_profile": "https://Stackoverflow.com/users/5987",
"pm_score": 4,
"selected": false,
"text": "<p>If you already know the keys, you can use <code>multimap::equal_range</code> to get the iterators to the beginning an... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247818",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32492/"
] | Multimap essentially has groups of data sorted by the key. I want a method by which I could access these individual groups and get their aggregate values.
For example, in a `std::multimap< string, int >` I store
```
{"Group1", 1},
{"Group1", 2},
{"Group1", 3},
{"Group2", 10},
{"Group2", 11},
{"Group2", 12}
```... | ```
pair<Iter, Iter> range = my_multimap.equal_range("Group1");
int total = accumulate(range.first, range.second, 0);
```
Is one way.
**Edit:**
If you don't know the group you are looking for, and are just going through each group, getting the next group's range can be done like so:
```
template <typename Pair>
st... |
247,819 | <p>I have an application built in Flex Builder 3. It has a fair amount of mxml and as3 code which uses some other custom compenents. I have looked at the documentation on building components which shows how to make a simple mxml or action script component that extends something like a combobox, but I'm lost as to how... | [
{
"answer_id": 247890,
"author": "Matt Dillard",
"author_id": 863,
"author_profile": "https://Stackoverflow.com/users/863",
"pm_score": 0,
"selected": false,
"text": "<p>If you simply want some \"parent\" Flex application to embed several instances of this autonomous child application, t... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247819",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have an application built in Flex Builder 3. It has a fair amount of mxml and as3 code which uses some other custom compenents. I have looked at the documentation on building components which shows how to make a simple mxml or action script component that extends something like a combobox, but I'm lost as to how to t... | The easy thing to do is to swap the Application mxml tag with a VBox tag...thus making it act like a component.
e.g. If this were your application:
```
//Foo.mxml
<mx:Appliction xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Label text = "foo" />
</mx:Appliction>
```
change it to:
```
//Foo.mxml
<mx:VBox>
... |
247,833 | <p>I have a Visual Basic .NET program which needs to open and close an Excel spreadsheet. Opening and reading the spreadsheet work fine, but trying to close the Excel 2007 application causes it to hang. It seems to close, but if you look in the task manager the application is still running. The code that I'm using t... | [
{
"answer_id": 247841,
"author": "Eric Ness",
"author_id": 18891,
"author_profile": "https://Stackoverflow.com/users/18891",
"pm_score": 0,
"selected": false,
"text": "<p>I found a <a href=\"http://blogs.msdn.com/excel/archive/2006/06/19/636534.aspx\" rel=\"nofollow noreferrer\">solution... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18891/"
] | I have a Visual Basic .NET program which needs to open and close an Excel spreadsheet. Opening and reading the spreadsheet work fine, but trying to close the Excel 2007 application causes it to hang. It seems to close, but if you look in the task manager the application is still running. The code that I'm using to clos... | The answer to your question has been covered here i think:
[How to properly clean up excel interop objects in c](https://stackoverflow.com/questions/158706/how-to-properly-clean-up-excel-interop-objects-in-c)
i cant see from your code sample, but basically, always assign your excel objects to local variables, never go... |
247,834 | <p>The scriptaculous wiki has a demo (<a href="http://github.com/madrobby/scriptaculous/wikis/effect-slidedown" rel="nofollow noreferrer">http://github.com/madrobby/scriptaculous/wikis/effect-slidedown</a>) that shows the SlideDown effect in use. However I need to have the same link to slide down if a certain DIV is hi... | [
{
"answer_id": 247845,
"author": "Diodeus - James MacFarlane",
"author_id": 12579,
"author_profile": "https://Stackoverflow.com/users/12579",
"pm_score": 1,
"selected": false,
"text": "<p>Wrap it in a function, call the function instead.</p>\n\n<pre><code>function slideMe(myDiv) {\n\n ... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247834",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32495/"
] | The scriptaculous wiki has a demo (<http://github.com/madrobby/scriptaculous/wikis/effect-slidedown>) that shows the SlideDown effect in use. However I need to have the same link to slide down if a certain DIV is hidden and SlideUp if that DIV is showing.
How do I achieve this?
Thanks. | Use [Effect.toggle](http://github.com/madrobby/scriptaculous/wikis/effect-toggle).
```
Effect.toggle('element_id', 'slide');
``` |
247,837 | <p>I found a while ago (and I want to confirm again) that if you declare a class level variable, you should not call its constructor until the class constructor or load has been called. The reason was performance - but are there other reasons to do or not do this? Are there exceptions to this rule?</p>
<p><strong>ie... | [
{
"answer_id": 247838,
"author": "jonnii",
"author_id": 4590,
"author_profile": "https://Stackoverflow.com/users/4590",
"pm_score": 0,
"selected": false,
"text": "<p>I prefer the latter, but only becuase I find it neater. </p>\n\n<p>It's personal preference really, they both do the same... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247837",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26685/"
] | I found a while ago (and I want to confirm again) that if you declare a class level variable, you should not call its constructor until the class constructor or load has been called. The reason was performance - but are there other reasons to do or not do this? Are there exceptions to this rule?
**ie: this is what I d... | If you set your variable outside of the constructor then there is no error handling (handeling) available. While in your example it makes no difference, but there are many cases that you may want to have some sort of error handling. In that case using your first option would be correct.
Nescio talked about what implic... |
247,856 | <pre><code>List<String> nameList = new List<String>();
DropDownList ddl = new DropDownList();
</code></pre>
<p>List is populated here, then sorted:</p>
<pre><code>nameList.Sort();
</code></pre>
<p>Now I need to drop it into the dropdownlist, which is where I'm having issues (using foreach):</p>
<pre><co... | [
{
"answer_id": 247865,
"author": "Marcus King",
"author_id": 19840,
"author_profile": "https://Stackoverflow.com/users/19840",
"pm_score": 5,
"selected": false,
"text": "<p>Why not just bind the DDL directly to the List like</p>\n\n<pre><code>DropDownList ddl = new DropDownList();\nddl.D... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24565/"
] | ```
List<String> nameList = new List<String>();
DropDownList ddl = new DropDownList();
```
List is populated here, then sorted:
```
nameList.Sort();
```
Now I need to drop it into the dropdownlist, which is where I'm having issues (using foreach):
```
foreach (string name in nameList){
ddl.Items.Add(new ListI... | Replace this:
```
ddl.Items.Add(new ListItem(nameList[name].ToString()));
```
with this:
```
ddl.Items.Add(new ListItem(name));
```
Done like dinner. |
247,857 | <p>I'm trying to think of a naming convention that accurately conveys what's going on within a class I'm designing. On a secondary note, I'm trying to decide between two almost-equivalent user APIs.</p>
<p>Here's the situation:</p>
<p>I'm building a scientific application, where one of the central data structures has... | [
{
"answer_id": 247891,
"author": "jonnii",
"author_id": 4590,
"author_profile": "https://Stackoverflow.com/users/4590",
"pm_score": 2,
"selected": false,
"text": "<p>Your objects should have one role and responsibility. In your case should the ContinuousScalarField be responsible for in... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22979/"
] | I'm trying to think of a naming convention that accurately conveys what's going on within a class I'm designing. On a secondary note, I'm trying to decide between two almost-equivalent user APIs.
Here's the situation:
I'm building a scientific application, where one of the central data structures has three phases: 1)... | I generally prefer to have an explicit change, rather than lazily recomputing the result. This approach makes the performance of the utility more predictable, and it reduces the amount of work I have to do to provide a good user experience. For example, if this occurs in a UI, where do I have to worry about popping up ... |
247,858 | <p>In T-SQL, you can do this:</p>
<pre><code>SELECT ProductId, COALESCE(Price, 0)
FROM Products
</code></pre>
<p>How do you do the same thing in Access SQL? I see examples for doing it with Nz in VBA, but I'm looking for the SQL equivalent.</p>
<p>Thanks.</p>
| [
{
"answer_id": 247869,
"author": "pipTheGeek",
"author_id": 28552,
"author_profile": "https://Stackoverflow.com/users/28552",
"pm_score": 6,
"selected": true,
"text": "<p>Access supports the <code>Nz</code> function and allows you to use it in a query. Note though that <code>Nz</code> i... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1753/"
] | In T-SQL, you can do this:
```
SELECT ProductId, COALESCE(Price, 0)
FROM Products
```
How do you do the same thing in Access SQL? I see examples for doing it with Nz in VBA, but I'm looking for the SQL equivalent.
Thanks. | Access supports the `Nz` function and allows you to use it in a query. Note though that `Nz` is the same as the T-SQL `ISNULL` function. It can not take an arbitrary number of parameters like `COALESCE` can. |
247,875 | <p>When is memory allocated in the .NET compact framework? If there is a difference between value and reference types, please detail. Documentation or steps to confirm are appreciated.</p>
<p>In particular, consider this scenario...</p>
<pre><code>private MyClass item; // here?
public void MyMethod()
{
item = n... | [
{
"answer_id": 247898,
"author": "Nicholas Mancuso",
"author_id": 8945,
"author_profile": "https://Stackoverflow.com/users/8945",
"pm_score": 4,
"selected": true,
"text": "<p>There are 3 different ways memory is allocated.</p>\n\n<p><strong>Static:</strong></p>\n\n<p>These are bound and ... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247875",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3619/"
] | When is memory allocated in the .NET compact framework? If there is a difference between value and reference types, please detail. Documentation or steps to confirm are appreciated.
In particular, consider this scenario...
```
private MyClass item; // here?
public void MyMethod()
{
item = new MyClass(); // or ... | There are 3 different ways memory is allocated.
**Static:**
These are bound and allocated at compile time. Global static variables for example.
**Stack Dynamic:**
These are bound during runtime and pushed onto the stack. Such as a local variable in a function call.
**Heap Dynamic:**
Now heap dynamic also has a fe... |
247,909 | <p>I have a lot of constants that are somehow related, at some point I need to pair them, something like this:</p>
<pre><code>const
key1 = '1';
key2 = '2';
key3 = '3';
value1 = 'a';
value2 = 'b';
value3 = 'c';
</code></pre>
<p>I want to avoid doing:</p>
<pre><code>if MyValue = key1 then Result := value1... | [
{
"answer_id": 247935,
"author": "Jozz",
"author_id": 12351,
"author_profile": "https://Stackoverflow.com/users/12351",
"pm_score": 4,
"selected": true,
"text": "<p>Yes, assignment can be done this way instead, avoiding manual string concatenation:</p>\n\n<pre><code>MyStringList.Values[K... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247909",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/727/"
] | I have a lot of constants that are somehow related, at some point I need to pair them, something like this:
```
const
key1 = '1';
key2 = '2';
key3 = '3';
value1 = 'a';
value2 = 'b';
value3 = 'c';
```
I want to avoid doing:
```
if MyValue = key1 then Result := value1;
```
I know how to do it with stri... | Yes, assignment can be done this way instead, avoiding manual string concatenation:
```
MyStringList.Values[Key1] := Value1;
``` |
247,918 | <p>I have two combos; provinces and cities.
I would like to change cities value when the province combo value changes. Here is my code</p>
<pre><code><div class="cities form">
<?php
$v = $ajax->remoteFunction(array('url' => '/cities/','update' => 'divcity'));
print $form-> input('Province.... | [
{
"answer_id": 248206,
"author": "neilcrookes",
"author_id": 9968,
"author_profile": "https://Stackoverflow.com/users/9968",
"pm_score": 2,
"selected": false,
"text": "<p>The 'url' => '/cities/' is calling the default index action of the cities controller.</p>\n\n<p>This automatically re... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have two combos; provinces and cities.
I would like to change cities value when the province combo value changes. Here is my code
```
<div class="cities form">
<?php
$v = $ajax->remoteFunction(array('url' => '/cities/','update' => 'divcity'));
print $form-> input('Province.province_id', array('type' => 'sele... | The 'url' => '/cities/' is calling the default index action of the cities controller.
This automatically renders the cities/index.ctp view.
Have you included the RequestHandler component in the cities controller?
This can be used to detect Ajax requests and then render a different view. |
247,922 | <p>I have the following code in my Django application:</p>
<pre><code>if 'book' in authorForm.changed_data:
#Do something here...
</code></pre>
<p>I realize Django can tell me which values have changed in my form by utilizing the "changed_data" list object, but I'd like to know the new values of the fields that ha... | [
{
"answer_id": 248200,
"author": "Alex Koshelev",
"author_id": 19772,
"author_profile": "https://Stackoverflow.com/users/19772",
"pm_score": 2,
"selected": false,
"text": "<p>Hmm... Try this:</p>\n\n<pre><code>if authorForm.is_valid() and 'book' in authorForm.changed_data:\n new_value... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10040/"
] | I have the following code in my Django application:
```
if 'book' in authorForm.changed_data:
#Do something here...
```
I realize Django can tell me which values have changed in my form by utilizing the "changed\_data" list object, but I'd like to know the new values of the fields that have changed.
Any thoughts... | The short answer to my original question is "No". |
247,929 | <p>I have to connect my rails app in a legacy Postgre database. It uses schemas so in a SQL its is common to use something like </p>
<pre><code>SELECT * FROM "Financial".budget
</code></pre>
<p>I want to write a Budget model but I don't know how to set the table name in this case. I've tried the following:</p>
<ul>
... | [
{
"answer_id": 248729,
"author": "Ian Terrell",
"author_id": 9269,
"author_profile": "https://Stackoverflow.com/users/9269",
"pm_score": 0,
"selected": false,
"text": "<p>Look at your logs -- what SQL is Rails generating with your various options?</p>\n"
},
{
"answer_id": 248788,... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247929",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19224/"
] | I have to connect my rails app in a legacy Postgre database. It uses schemas so in a SQL its is common to use something like
```
SELECT * FROM "Financial".budget
```
I want to write a Budget model but I don't know how to set the table name in this case. I've tried the following:
* set\_table\_name 'budget'
* set\_... | Now, this bug seems to be solved in 2-3-stable. Take a look at [this post](http://weblog.rubyonrails.org/2009/4/24/this-week-in-edge-rails) |
247,936 | <p>Lately I've been in the habit of assigning integer values to constants and simply using the constant name as a means of identifying its purpose. However, in some cases this has resulted in the need to write a function like typeToString($const) when a string representation is needed. Obviously this is inefficient and... | [
{
"answer_id": 247945,
"author": "Jasper Bekkers",
"author_id": 31486,
"author_profile": "https://Stackoverflow.com/users/31486",
"pm_score": 0,
"selected": false,
"text": "<p>Instead of using const integers I generally just go with strings if I need to print them. So I'd do something li... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247936",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5291/"
] | Lately I've been in the habit of assigning integer values to constants and simply using the constant name as a means of identifying its purpose. However, in some cases this has resulted in the need to write a function like typeToString($const) when a string representation is needed. Obviously this is inefficient and un... | The performance difference will be negligible unless you're storing a lot of them.
I'd write the `toString()` method more concisely:
```
$strings = array
(
self::USER_TYPE_ADMIN => 'admin',
self::USER_TYPE_USER => 'user',
);
if (!isset($strings[$type]))
return 'unknown';
return $strings[$type];
```
Als... |
247,946 | <p>I have a .NET UserControl (FFX 3.5). This control contains several child Controls - a Panel, a couple Labels, a couple TextBoxes, and yet another custom Control. I want to handle a right click anywhere on the base Control - so a right click on any child control (or child of a child in the case of the Panel). I'd ... | [
{
"answer_id": 248017,
"author": "Mark Cidade",
"author_id": 1659,
"author_profile": "https://Stackoverflow.com/users/1659",
"pm_score": 6,
"selected": true,
"text": "<p>If the labels are in a subcontrol then you'd have to do this recursively:</p>\n\n<pre><code>void initControlsRecursive... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13154/"
] | I have a .NET UserControl (FFX 3.5). This control contains several child Controls - a Panel, a couple Labels, a couple TextBoxes, and yet another custom Control. I want to handle a right click anywhere on the base Control - so a right click on any child control (or child of a child in the case of the Panel). I'd like t... | If the labels are in a subcontrol then you'd have to do this recursively:
```
void initControlsRecursive(ControlCollection coll)
{
foreach (Control c in coll)
{
c.MouseClick += (sender, e) => {/* handle the click here */});
initControlsRecursive(c.Controls);
}
}
/* ... */
initCon... |
247,948 | <p>Is there a better way than the following to check to see if a string is nil OR has a length of 0 in Ruby?</p>
<pre class="lang-ruby prettyprint-override"><code>if !my_string || my_string.length == 0
return true
else
return false
end
</code></pre>
<p>In C# there's the handy</p>
<pre class="lang-csharp prettypr... | [
{
"answer_id": 247971,
"author": "Paige Ruten",
"author_id": 813,
"author_profile": "https://Stackoverflow.com/users/813",
"pm_score": 2,
"selected": false,
"text": "<p>Every class has a <code>nil?</code> method:</p>\n\n<pre><code>if a_variable.nil?\n # the variable has a nil value\ne... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247948",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/650/"
] | Is there a better way than the following to check to see if a string is nil OR has a length of 0 in Ruby?
```ruby
if !my_string || my_string.length == 0
return true
else
return false
end
```
In C# there's the handy
```csharp
string.IsNullOrEmpty(myString)
```
Anything similar to that in Ruby? | When I'm not worried about performance, I'll often use this:
```
if my_string.to_s == ''
# It's nil or empty
end
```
There are various variations, of course...
```
if my_string.to_s.strip.length == 0
# It's nil, empty, or just whitespace
end
``` |
247,961 | <p>Exception: Failed to compare two elements in the array.</p>
<pre><code>private void assignNames(DropDownList ddl, Hashtable names)
{
List<ListItem> nameList = new List<ListItem>();
if (ddl != null)
{
ddl.ClearSelection();
ddl.Items.Add(new ListItem("Select Author"));
... | [
{
"answer_id": 247983,
"author": "Marcus King",
"author_id": 19840,
"author_profile": "https://Stackoverflow.com/users/19840",
"pm_score": 1,
"selected": false,
"text": "<p>what type of object is \"names\"?</p>\n\n<p>EDIT:\nFrom what I can tell you will have to specify an IComparer for t... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247961",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24565/"
] | Exception: Failed to compare two elements in the array.
```
private void assignNames(DropDownList ddl, Hashtable names)
{
List<ListItem> nameList = new List<ListItem>();
if (ddl != null)
{
ddl.ClearSelection();
ddl.Items.Add(new ListItem("Select Author"));
foreach (string key in nam... | Provide a [`Comparison<T>`](http://msdn.microsoft.com/en-us/library/tfakywbh.aspx) to instruct the [`List`](http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx) on how to sort the items.
```
nameList.Sort(delegate(ListItem thisItem, ListItem otherItem) {
return thisItem.Text.CompareTo(otherItem.Text);
});
```
... |
247,977 | <p>I have this in some WSDL:</p>
<pre><code><element name="startDate" type="xsd:dateTime"/>
<element name="endDate" type="xsd:dateTime"/>
</code></pre>
<p>Which results in the following text in the SOAP envelope:</p>
<pre><code><startDate>2008-10-29T12:01:05<... | [
{
"answer_id": 248099,
"author": "Dan Finucane",
"author_id": 30026,
"author_profile": "https://Stackoverflow.com/users/30026",
"pm_score": 1,
"selected": false,
"text": "<p>What are you using to generate the date? If you are building this XML in your code rather than using some seriali... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3275/"
] | I have this in some WSDL:
```
<element name="startDate" type="xsd:dateTime"/>
<element name="endDate" type="xsd:dateTime"/>
```
Which results in the following text in the SOAP envelope:
```
<startDate>2008-10-29T12:01:05</startDate>
<endDate>2008-10-29T12:38:59.65625-04:00</endDate>
```
Only some times have the m... | I suspect your endDate value has the Kind property set to DateTimeKind.Local.
You can change this to DateTimeKind.Unspecified as follows:
```
endDate = DateTime.SpecifyKind(endDate, DateTimeKind.Unspecified)
```
after which I believe it will be serialized without the timezone offset.
Note that you will get a DateT... |
247,991 | <p>I would like to display a Drupal view without the page template that normally surrounds it - I want just the plain HTML content of the view's nodes.</p>
<p>This view would be included in another, non-Drupal site.</p>
<p>I expect to have to do this with a number of views, so a solution that lets me set these up rap... | [
{
"answer_id": 248044,
"author": "Owen",
"author_id": 4853,
"author_profile": "https://Stackoverflow.com/users/4853",
"pm_score": 1,
"selected": false,
"text": "<p>there are probably a number of ways around this, however, the \"easiest\" may be just setting your own custom theme, and hav... | 2008/10/29 | [
"https://Stackoverflow.com/questions/247991",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1902010/"
] | I would like to display a Drupal view without the page template that normally surrounds it - I want just the plain HTML content of the view's nodes.
This view would be included in another, non-Drupal site.
I expect to have to do this with a number of views, so a solution that lets me set these up rapidly and easily w... | I was looking for a way to pull node data via ajax and came up with the following solution for Drupal 6. After implementing the changes below, if you add ajax=1 in the URL (e.g. mysite.com/node/1?ajax=1), you'll get just the content and no page layout.
in the template.php file for your theme:
```
function phptemplate... |
248,011 | <p><code>pre</code> tags are super-useful for code blocks in HTML and for debugging output while writing scripts, but how do I make the text word-wrap instead of printing out one long line?</p>
| [
{
"answer_id": 248013,
"author": "adambox",
"author_id": 2462,
"author_profile": "https://Stackoverflow.com/users/2462",
"pm_score": 11,
"selected": true,
"text": "<p>The answer, from <a href=\"https://longren.io/wrapping-text-inside-pre-tags/\" rel=\"noreferrer\">this page</a> in CSS:</... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2462/"
] | `pre` tags are super-useful for code blocks in HTML and for debugging output while writing scripts, but how do I make the text word-wrap instead of printing out one long line? | The answer, from [this page](https://longren.io/wrapping-text-inside-pre-tags/) in CSS:
```
pre {
white-space: pre-wrap; /* Since CSS 2.1 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap... |
248,031 | <p>Hi I'm trying to get some practice with Linked Lists.</p>
<p>I Defined an Object class called <code>Student</code>:</p>
<pre><code>public class Student
{
protected string Student_Name;
protected int Student_ID;
protected int Student_Mark;
protected char Student_Grade;
public Stud... | [
{
"answer_id": 248049,
"author": "Ihar Bury",
"author_id": 18001,
"author_profile": "https://Stackoverflow.com/users/18001",
"pm_score": 1,
"selected": false,
"text": "<p>Actually I don't see a reason to write your own linked list in C# (other then learning how it works) since the .NET a... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248031",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31512/"
] | Hi I'm trying to get some practice with Linked Lists.
I Defined an Object class called `Student`:
```
public class Student
{
protected string Student_Name;
protected int Student_ID;
protected int Student_Mark;
protected char Student_Grade;
public Student() // default Constructor
... | ```
the head of the list.
( item1
Element: student1
Next ------------> ( item2
) Element: student2
Next ------------> ( item3
) Element: student3
Next: null
... |
248,046 | <p>Oracle is giving me an error (ORA-00907: missing right parenthesis) when I run this query:</p>
<pre><code>select *
from reason_for_appointment
where reason_for_appointment_id in
(
select reason_for_appointment_id
from appointment_reason
where appointment_id = 11
order by appointment_reason_id
... | [
{
"answer_id": 248051,
"author": "StingyJack",
"author_id": 16391,
"author_profile": "https://Stackoverflow.com/users/16391",
"pm_score": 4,
"selected": false,
"text": "<p>The inner query results will never be displayed, so theres no point in doing the order by in the nested select. Appl... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248046",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/549/"
] | Oracle is giving me an error (ORA-00907: missing right parenthesis) when I run this query:
```
select *
from reason_for_appointment
where reason_for_appointment_id in
(
select reason_for_appointment_id
from appointment_reason
where appointment_id = 11
order by appointment_reason_id
)
```
Howeve... | The problem is that ORDER BY is not permiited inside a subquery like this one. Why did you want to have one? |
248,052 | <p>I'm checking for existing of a row in in_fmd, and the ISBN I look up can be the ISBN parameter, or another ISBN in a cross-number table that may or may not have a row.</p>
<pre><code>select count(*)
from in_fmd i
where (description='GN')
and ( i.isbn in
(
select bwi_isbn from bw_isbn where orig_isbn... | [
{
"answer_id": 248071,
"author": "Cade Roux",
"author_id": 18255,
"author_profile": "https://Stackoverflow.com/users/18255",
"pm_score": 3,
"selected": true,
"text": "<p>Why bother with the <code>UNION ALL</code></p>\n\n<pre><code>select count(*)\nfrom in_fmd i\nwhere (description='GN')\... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8454/"
] | I'm checking for existing of a row in in\_fmd, and the ISBN I look up can be the ISBN parameter, or another ISBN in a cross-number table that may or may not have a row.
```
select count(*)
from in_fmd i
where (description='GN')
and ( i.isbn in
(
select bwi_isbn from bw_isbn where orig_isbn = ?
... | Why bother with the `UNION ALL`
```
select count(*)
from in_fmd i
where (description='GN')
and (
i.isbn in (
select bwi_isbn from bw_isbn where orig_isbn = ?
)
or i.isbn = cast(? as varchar)
)
```
I would probably use a `LEFT JOIN`-style query instead of the `IN`, but that... |
248,067 | <p>The only method provided by the DNN framework to get a module by ID also required a tab ID. What can I do if I don't <em>have</em> a tab ID?</p>
| [
{
"answer_id": 248068,
"author": "bdukes",
"author_id": 2688,
"author_profile": "https://Stackoverflow.com/users/2688",
"pm_score": 4,
"selected": true,
"text": "<p>The GetModule method off of the DotNetNuke.Entities.Modules.ModuleController class will accept a \"null\" value for tab ID ... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2688/"
] | The only method provided by the DNN framework to get a module by ID also required a tab ID. What can I do if I don't *have* a tab ID? | The GetModule method off of the DotNetNuke.Entities.Modules.ModuleController class will accept a "null" value for tab ID if you don't have a tab ID. That is, try the following:
```
new ModuleController().GetModule(moduleId, DotNetNuke.Common.Utilities.Null.NullInteger)
```
See also [my blog post on the subject](http... |
248,072 | <p>Evil or not evil?</p>
<pre><code>public static void Raise(this EventHandler handler, object sender, EventArgs args)
{
if (handler != null)
{
handler(sender, args);
}
}
// Usage:
MyButtonClicked.Raise(this, EventArgs.Empty);
// This works too! Evil?
EventHandler handler = null;
handler.Raise(this, E... | [
{
"answer_id": 248089,
"author": "Dan Goldstein",
"author_id": 23427,
"author_profile": "https://Stackoverflow.com/users/23427",
"pm_score": 6,
"selected": true,
"text": "<p>Not evil. I wish events worked this way by default. Can someone explain why an event with no subscribers is null?<... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/536/"
] | Evil or not evil?
```
public static void Raise(this EventHandler handler, object sender, EventArgs args)
{
if (handler != null)
{
handler(sender, args);
}
}
// Usage:
MyButtonClicked.Raise(this, EventArgs.Empty);
// This works too! Evil?
EventHandler handler = null;
handler.Raise(this, EVentArgs.Empty... | Not evil. I wish events worked this way by default. Can someone explain why an event with no subscribers is null? |
248,102 | <p>By default, I think my vimrc setttings enable the auto-wrapping. However, sometimes, I would like to see text lines are not wrapped. Is there any command I toggle the text line wrapping enabled and disabled? This would avoid me to exit and to change settings.</p>
| [
{
"answer_id": 248116,
"author": "Greg Hewgill",
"author_id": 893,
"author_profile": "https://Stackoverflow.com/users/893",
"pm_score": 4,
"selected": true,
"text": "<pre><code>:set nowrap\n</code></pre>\n\n<p>There is also the <code>linebreak</code> option that controls whether wrapped ... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62776/"
] | By default, I think my vimrc setttings enable the auto-wrapping. However, sometimes, I would like to see text lines are not wrapped. Is there any command I toggle the text line wrapping enabled and disabled? This would avoid me to exit and to change settings. | ```
:set nowrap
```
There is also the `linebreak` option that controls whether wrapped text is broken at word boundaries or not. |
248,118 | <p>What does this mean exactly? I'm doing something like this:</p>
<pre><code>File.Copy(@"\\foo\bar\baz.txt", @"c:\test\baz.txt");
</code></pre>
<p>MSDN doesn't describe this exception except in general terms, and googling around just yields tables of error codes.</p>
<p>I've confirmed the source file exists, and I... | [
{
"answer_id": 248851,
"author": "Andrew Theken",
"author_id": 32238,
"author_profile": "https://Stackoverflow.com/users/32238",
"pm_score": 0,
"selected": false,
"text": "<p>You will get this error if the destination file already exists. I would also confirm that the account you're runn... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16320/"
] | What does this mean exactly? I'm doing something like this:
```
File.Copy(@"\\foo\bar\baz.txt", @"c:\test\baz.txt");
```
MSDN doesn't describe this exception except in general terms, and googling around just yields tables of error codes.
I've confirmed the source file exists, and I'm 99% sure that I have the permis... | Check this article for some information about using symlinks in .Net: "[Manipulating NTFS Junction Points in .NET](http://www.codeproject.com/KB/files/JunctionPointsNet.aspx)".
According to this article:
>
> "In particular the .NET libraries does
> not include any functionality for
> creating or querying propertie... |
248,149 | <p><code>Connection.close()</code> may throw <code>SqlException</code>, but I have always assumed that it is safe to ignore any such exceptions (and I have never seen code that does not ignore them). </p>
<p>Normally I would write:</p>
<pre><code> try{
connection.close();
}catch(Exception e) {}
</code></pre>
<p... | [
{
"answer_id": 248167,
"author": "Bill K",
"author_id": 12943,
"author_profile": "https://Stackoverflow.com/users/12943",
"pm_score": 4,
"selected": false,
"text": "<p>In general, I've had days wasted by people throwing away exceptions like that.</p>\n\n<p>I recommend following a few bas... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7918/"
] | `Connection.close()` may throw `SqlException`, but I have always assumed that it is safe to ignore any such exceptions (and I have never seen code that does not ignore them).
Normally I would write:
```
try{
connection.close();
}catch(Exception e) {}
```
Or
```
try{
connection.close();
}catch(Excepti... | Actually, what you're doing is (almost) best practice :-) here's what I saw in Spring's JdbcUtils.java. So, you might want to add
another Catch block.
```
/**
* Close the given ResultSet and ignore any thrown exception.
* This is useful for typical finally blocks in manual code.
* @param resultSet the ResultSet ... |
248,161 | <p>I got curious by <a href="http://dotnet.kapenilattex.com/?p=93" rel="nofollow noreferrer">Jon Limjap's interview mishap</a> and started to look for efficient ways to do palindrome detection. I checked the <a href="https://stackoverflow.com/questions/228518/palindrome-golf">palindrome golf</a> answers and it seems to... | [
{
"answer_id": 248187,
"author": "nlucaroni",
"author_id": 157,
"author_profile": "https://Stackoverflow.com/users/157",
"pm_score": 2,
"selected": false,
"text": "<p>There isn't, unless you do a fuzzy match. Which is what they probably do in DNA (I've done EST <em>searching</em> in DNA ... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5190/"
] | I got curious by [Jon Limjap's interview mishap](http://dotnet.kapenilattex.com/?p=93) and started to look for efficient ways to do palindrome detection. I checked the [palindrome golf](https://stackoverflow.com/questions/228518/palindrome-golf) answers and it seems to me that in the answers are two algorithms only, re... | Given only one palindrome, you will have to do it in O(N), yes. You can get more efficiency with multi-processors by splitting the string as you said.
Now say you want to do exact DNA matching. These strings are thousands of characters long, and they are very repetitive. This gives us the opportunity to optimize.
Say... |
248,219 | <p>i know how to import an sql file via the cli:</p>
<pre><code>mysql -u USER -p DBNAME < dump.sql
</code></pre>
<p>but that's if the dump.sql file is local. how could i use a file on a remote server?</p>
| [
{
"answer_id": 248228,
"author": "Greg",
"author_id": 24181,
"author_profile": "https://Stackoverflow.com/users/24181",
"pm_score": 0,
"selected": false,
"text": "<p>I'd use <a href=\"http://www.gnu.org/software/wget/\" rel=\"nofollow noreferrer\">wget</a> to either download it to a file... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248219",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18285/"
] | i know how to import an sql file via the cli:
```
mysql -u USER -p DBNAME < dump.sql
```
but that's if the dump.sql file is local. how could i use a file on a remote server? | You didn't say what network access you have to the remote server.
Assuming you have SSH access to the remote server, you could pipe the results of a remote mysqldump to the mysql command. I just tested this, and it works fine:
```
ssh remote.com "mysqldump remotedb" | mysql localdb
```
I put stuff like user, passwo... |
248,222 | <p>What's better practice when defining several methods that return the same shape of data with different filters? Explicit method names or overloaded methods?</p>
<p>For example. If I have some Products and I'm pulling from a database</p>
<p>explicit way:</p>
<pre><code>public List<Product> GetProduct(int pro... | [
{
"answer_id": 248233,
"author": "Elie",
"author_id": 23249,
"author_profile": "https://Stackoverflow.com/users/23249",
"pm_score": 4,
"selected": false,
"text": "<p>As far as I can tell, you won't have fewer methods, just fewer names. I generally prefer the overloaded method system of n... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248222",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26931/"
] | What's better practice when defining several methods that return the same shape of data with different filters? Explicit method names or overloaded methods?
For example. If I have some Products and I'm pulling from a database
explicit way:
```
public List<Product> GetProduct(int productId) { // return a List }... | Yes, overloading can easily be overused.
I've found that the key to working out whether an overload is warranted or not is to consider the audience - not the compiler, but the maintenance programmer who will be coming along in weeks/months/years and has to understand what the code is trying to achieve.
A simple metho... |
248,224 | <p>I downloaded the free CodeRush Xpress version to try it. Is there a way to change the colors it uses for it's highlighting and line drawing? ie the matching braces. I have a dark color scheme and my monitor I have VS on must suck because I can't see the lines. Yet on the LCD I can. Is there a way to change the ... | [
{
"answer_id": 862842,
"author": "Christian",
"author_id": 54193,
"author_profile": "https://Stackoverflow.com/users/54193",
"pm_score": 4,
"selected": true,
"text": "<p>I use <em>CodeRush Xpress 9.2</em>. It is possible to configure some colors used for highlighting in the Options menu ... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248224",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7024/"
] | I downloaded the free CodeRush Xpress version to try it. Is there a way to change the colors it uses for it's highlighting and line drawing? ie the matching braces. I have a dark color scheme and my monitor I have VS on must suck because I can't see the lines. Yet on the LCD I can. Is there a way to change the colors? | I use *CodeRush Xpress 9.2*. It is possible to configure some colors used for highlighting in the Options menu of *CodeRush Xpress*. You can find the menu in *Visual Studio* under *DevExpress* -> *Options*. Go to the *Painting* sub-item of the *Editor* item to control some of the colors used (among them *Navigation Fie... |
248,227 | <p>I have an XML file, and I want to find nodes that have duplicate CDATA. Are there any tools that exist that can help me do this?</p>
<p>I'd be fine with a tool that does this generally for text documents.</p>
| [
{
"answer_id": 248457,
"author": "lImbus",
"author_id": 32490,
"author_profile": "https://Stackoverflow.com/users/32490",
"pm_score": 0,
"selected": false,
"text": "<p>never heard about anything like that, but it might be an intresting task to write such a program based on a <a href=\"ht... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/245644/"
] | I have an XML file, and I want to find nodes that have duplicate CDATA. Are there any tools that exist that can help me do this?
I'd be fine with a tool that does this generally for text documents. | Here is a first attempt, written in Python and using only standard libraries. You can improve it in many ways (trim leading and ending whitespaces, computing a hash of the text to decrease memory requirments, better displaying of the elements, with their line number, etc):
```python
import xml.etree.ElementTree as Ele... |
248,243 | <p>A library using off_t as a parameter for one function (seek). Library and application are compiled differently, one with large file support switched off, the other with large file support. This situation results in strange runtime errors, because both interpret off_t differently. How can the library check at runtime... | [
{
"answer_id": 248309,
"author": "Andrew Johnson",
"author_id": 5109,
"author_profile": "https://Stackoverflow.com/users/5109",
"pm_score": 2,
"selected": false,
"text": "<p>You could add an API to the library to return the sizeof(off_t) and then check it from the client. Alternatively ... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248243",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21005/"
] | A library using off\_t as a parameter for one function (seek). Library and application are compiled differently, one with large file support switched off, the other with large file support. This situation results in strange runtime errors, because both interpret off\_t differently. How can the library check at runtime ... | You could add an API to the library to return the sizeof(off\_t) and then check it from the client. Alternatively the library could require every app to provide the API in order to successfully link:
library.c:
```
size_t lib_get_off_t_size (void)
{
return (sizeof(off_t));
}
```
client.c (init\_function):
```
... |
248,246 | <p>Do any queries exist that require RIGHT JOIN, or can they always be re-written with LEFT JOIN?</p>
<p>And more specifically, how do you re-write this one without the right join (and I guess implicitly without any subqueries or other fanciness):</p>
<p><pre><code>
SELECT *
FROM t1
LEFT JOIN t2 ON t1.k2 = t2.k2
RIGH... | [
{
"answer_id": 248252,
"author": "Bill the Lizard",
"author_id": 1288,
"author_profile": "https://Stackoverflow.com/users/1288",
"pm_score": 1,
"selected": false,
"text": "<p>You can always swap the table order to turn a RIGHT JOIN into a LEFT JOIN. Sometimes it's just more efficient to... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12861/"
] | Do any queries exist that require RIGHT JOIN, or can they always be re-written with LEFT JOIN?
And more specifically, how do you re-write this one without the right join (and I guess implicitly without any subqueries or other fanciness):
```
SELECT *
FROM t1
LEFT JOIN t2 ON t1.k2 = t2.k2
RIGHT JOIN t3 ON t3.k3 = t2.... | You can always use only left Joins...
```
SELECT * FROM t1
LEFT JOIN t2 ON t1.k2 = t2.k2
RIGHT JOIN t3 ON t3.k3 = t2.k3
```
is equivilent to:
```
Select * From t3
Left Join (t1 Left Join t2
On t2.k2 = t1.k2)
On T2.k3 = T3.K3
```
In general I always try to use only Left Joins, ... |
248,254 | <p>I want to be able to see how many lines were added to a file since the last quering without reading the whole file again.</p>
<p>Something like :</p>
<pre><code>ptail my_file | fgrep "[ERROR]" | wc -l
</code></pre>
<p>A solution in simple Perl would be prefered, since I don't have an easy access to a compiler.</... | [
{
"answer_id": 248252,
"author": "Bill the Lizard",
"author_id": 1288,
"author_profile": "https://Stackoverflow.com/users/1288",
"pm_score": 1,
"selected": false,
"text": "<p>You can always swap the table order to turn a RIGHT JOIN into a LEFT JOIN. Sometimes it's just more efficient to... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248254",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24760/"
] | I want to be able to see how many lines were added to a file since the last quering without reading the whole file again.
Something like :
```
ptail my_file | fgrep "[ERROR]" | wc -l
```
A solution in simple Perl would be prefered, since I don't have an easy access to a compiler. | You can always use only left Joins...
```
SELECT * FROM t1
LEFT JOIN t2 ON t1.k2 = t2.k2
RIGHT JOIN t3 ON t3.k3 = t2.k3
```
is equivilent to:
```
Select * From t3
Left Join (t1 Left Join t2
On t2.k2 = t1.k2)
On T2.k3 = T3.K3
```
In general I always try to use only Left Joins, ... |
248,273 | <p>Given a date range, I need to know how many Mondays (or Tuesdays, Wednesdays, etc) are in that range.</p>
<p>I am currently working in C#.</p>
| [
{
"answer_id": 248288,
"author": "Jonathan Leffler",
"author_id": 15168,
"author_profile": "https://Stackoverflow.com/users/15168",
"pm_score": 2,
"selected": false,
"text": "<p>Any particular language and therefore date format?</p>\n\n<p>If dates are represented as a count of days, then... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248273",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32552/"
] | Given a date range, I need to know how many Mondays (or Tuesdays, Wednesdays, etc) are in that range.
I am currently working in C#. | Try this:
```
static int CountDays(DayOfWeek day, DateTime start, DateTime end)
{
TimeSpan ts = end - start; // Total duration
int count = (int)Math.Floor(ts.TotalDays / 7); // Number of whole weeks
int remainder = (int)(ts.TotalDays % 7); // Number of remaining days
int... |
248,312 | <p>Two table:</p>
<pre><code>StoreInfo:
UserId uniqueidentifier
StoreNo nvarchar
UserName nvarchar
Password nvarchar
UserInfo:
UserId uniqueidentifier
UserName nvarchar
Password nvarchar
</code></pre>
<p>the UserId on StoreInfo is currently null. How do i update StoreInfo's UserId with UserInfo's UserId based on Sto... | [
{
"answer_id": 248323,
"author": "Philip Kelley",
"author_id": 7491,
"author_profile": "https://Stackoverflow.com/users/7491",
"pm_score": 0,
"selected": false,
"text": "<pre><code>UPDATE StoreInfo\n set UserId = ui.UserId\n from StoreInfo si\n inner join UserInfo ui\n on ui.UserName ... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28647/"
] | Two table:
```
StoreInfo:
UserId uniqueidentifier
StoreNo nvarchar
UserName nvarchar
Password nvarchar
UserInfo:
UserId uniqueidentifier
UserName nvarchar
Password nvarchar
```
the UserId on StoreInfo is currently null. How do i update StoreInfo's UserId with UserInfo's UserId based on StoreInfo's UserName and Pass... | The update would look like this
```
update storeinfo
set userid = u.userid
from userinfo u
inner join storeinfo s on (s.username = u.username and s.password = u.password)
where userid is null
``` |
248,315 | <p>I have a simple Flex application that is a panel with a repeater inside of it; albeit a little simplified, it is like such:</p>
<pre>
<code>
<mx:Panel id="pnl">
<mx:Repeater id="rp">
<mx:Label text = "foo" />
</mx:Repeater>
</mx:Panel>
</code>
</pre>
<p>I am then embedding this Flex ap... | [
{
"answer_id": 258517,
"author": "netsuo",
"author_id": 27911,
"author_profile": "https://Stackoverflow.com/users/27911",
"pm_score": 0,
"selected": false,
"text": "<p>Why not simply using percent width and height on your HTML page for your Flash object ? This way you event don't have to... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248315",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1638/"
] | I have a simple Flex application that is a panel with a repeater inside of it; albeit a little simplified, it is like such:
```
<mx:Panel id="pnl">
<mx:Repeater id="rp">
<mx:Label text = "foo" />
</mx:Repeater>
</mx:Panel>
```
I am then embedding this Flex application into an HTML wrapper. I am then... | I'm currently working in the same thing (a swf that dynamically changes it's height depending on the content it's currently holding). I also had a similar problem to yours trying to make a multi-line button.
I'm new to flex but I managed to solve the problem manually invoking the updateDisplayList() of the container..... |
248,320 | <p>I have some HTML that looks like this:</p>
<pre><code><ul class="faq">
<li class="open">
<a class="question" href="">This is my question?</a>
<p>Of course you can, it will be awesome. </p>
</li>
</ul>
</code></pre>
<p>Using CSS I'm setting the... | [
{
"answer_id": 248331,
"author": "Ben Scheirman",
"author_id": 3381,
"author_profile": "https://Stackoverflow.com/users/3381",
"pm_score": 4,
"selected": false,
"text": "<pre><code>$(this).next(\"p\").css(\"...\")\n</code></pre>\n\n<p>the \"p\" above is optional, if you just want the nex... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4106/"
] | I have some HTML that looks like this:
```
<ul class="faq">
<li class="open">
<a class="question" href="">This is my question?</a>
<p>Of course you can, it will be awesome. </p>
</li>
</ul>
```
Using CSS I'm setting the `p` tag to `display:none;`. I want to use jQuery to display or hide the `... | Try using:
```
$(this).siblings('p').css()
``` |
248,332 | <p>I have this large C++ project that I need to build on a platform that does not have a parallel make (like make -j on Linux). The server has 6 CPU's and I want to do a parallel build manually. </p>
<p>I can generate a task list like this for about 300 object files. I use the Makefile for the dependency checks and in... | [
{
"answer_id": 248365,
"author": "warren",
"author_id": 4418,
"author_profile": "https://Stackoverflow.com/users/4418",
"pm_score": -1,
"selected": false,
"text": "<p>If the OS is properly handling inter-processor communication and scheduling, you should just be able to throw all the mak... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7743/"
] | I have this large C++ project that I need to build on a platform that does not have a parallel make (like make -j on Linux). The server has 6 CPU's and I want to do a parallel build manually.
I can generate a task list like this for about 300 object files. I use the Makefile for the dependency checks and incremental ... | In Perl the you should look at [Parallel::ForkManager](http://search.cpan.org/perldoc?Parallel::ForkManager). You could do something like this:
```
my @make_obj = qw(
obj1.o
obj2.o
obj3.o
...
);
my $fm = $pm = new Parallel::ForkManager(6);
foreach my $obj (@make_obj) {
$fm->start and next;
system("make -f... |
248,350 | <p>The windows installed on my machine has the locale <code>en_AU</code> and that's what JasperReports uses. I already tried changing the locale of all users, including the Administrator but it still uses <code>en_AU</code>.</p>
<p>How can I change that locale? Is it possible to change the <code>REPORT_LOCALE</code> p... | [
{
"answer_id": 772406,
"author": "waxwing",
"author_id": 90566,
"author_profile": "https://Stackoverflow.com/users/90566",
"pm_score": 6,
"selected": false,
"text": "<p>The locale is set during execution, not in the JRXML.</p>\n\n<p>Using Java, set the <code>REPORT_LOCALE</code> paramete... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16020/"
] | The windows installed on my machine has the locale `en_AU` and that's what JasperReports uses. I already tried changing the locale of all users, including the Administrator but it still uses `en_AU`.
How can I change that locale? Is it possible to change the `REPORT_LOCALE` parameter on my report? | The locale is set during execution, not in the JRXML.
Using Java, set the `REPORT_LOCALE` parameter for the report's parameter map. For example:
```
InputStream reportTemplate = getReportTemplate();
JRDataSource dataSource = getDataSource();
java.util.Map parameters = getParameters();
java.util.Locale locale = new L... |
248,351 | <p>I want to create a javascript badge that displays a list of links. We host the javascript on our domain. Other sites can put an empty div tag on their page and at the bottom a reference to our javascript that would render the content in the div tag. How do you implement something like this?</p>
| [
{
"answer_id": 248379,
"author": "Owen",
"author_id": 4853,
"author_profile": "https://Stackoverflow.com/users/4853",
"pm_score": 1,
"selected": false,
"text": "<p>just as you say, have them put a div at the bottom of their page:</p>\n\n<pre><code><div id=\"mywidget\"></div>\... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3784/"
] | I want to create a javascript badge that displays a list of links. We host the javascript on our domain. Other sites can put an empty div tag on their page and at the bottom a reference to our javascript that would render the content in the div tag. How do you implement something like this? | I would give the SCRIPT tag an ID and replace the script tag itself with the DIV + contents, making it so they only have to include one line of code. Something along the lines of the following:
```
<script id="my-script" src="http://example.com/my-script.js"></script>
```
In your script, you can swap out the SCRIPT ... |
248,353 | <p>I'm busy with an asignment where i have to make a graphical interface for a simple program. But i'm strugling with the layout.</p>
<p>This is the idea:<br>
<img src="https://i.stack.imgur.com/a3Xk7.png" alt="Layout Example" title="Layout Example"></p>
<p>What is the easiest way to accomplish such a layout?</p>
<p... | [
{
"answer_id": 248380,
"author": "Michael Myers",
"author_id": 13531,
"author_profile": "https://Stackoverflow.com/users/13531",
"pm_score": 2,
"selected": false,
"text": "<blockquote>\n <p>And what method do you use to make layouts in java. Just code it, or use an IDE like netbeans?</p... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248353",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20261/"
] | I'm busy with an asignment where i have to make a graphical interface for a simple program. But i'm strugling with the layout.
This is the idea:

What is the easiest way to accomplish such a layout?
And what method do you use to make layouts i... | Well considering how simple the layout is I would suggest you use a BorderLayout with NORTH set to the top section in a container and the JTable in the CENTER of the BorderLayout. For the Top it appears to be a simple BorderLayout again with NORTH as the Instruction: south as the black box (possibly in a container with... |
248,362 | <p>I am trying to build a dropdown list for a winform interop, and I am creating the dropdown in code. However, I have a problem getting the data to bind based on the DataTemplate I specify.</p>
<p>What am I missing?</p>
<pre><code>drpCreditCardNumberWpf = new ComboBox();
DataTemplate cardLayout = new DataTemplate ... | [
{
"answer_id": 248638,
"author": "Donnelle",
"author_id": 28074,
"author_profile": "https://Stackoverflow.com/users/28074",
"pm_score": 8,
"selected": true,
"text": "<p>Assuming that you've already set up the <code>ItemsSource</code> etc for <code>drpCreditCardNumberWpf</code>...</p>\n\n... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248362",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I am trying to build a dropdown list for a winform interop, and I am creating the dropdown in code. However, I have a problem getting the data to bind based on the DataTemplate I specify.
What am I missing?
```
drpCreditCardNumberWpf = new ComboBox();
DataTemplate cardLayout = new DataTemplate {DataType = typeof (C... | Assuming that you've already set up the `ItemsSource` etc for `drpCreditCardNumberWpf`...
```
//create the data template
DataTemplate cardLayout = new DataTemplate();
cardLayout.DataType = typeof(CreditCardPayment);
//set up the stack panel
FrameworkElementFactory spFactory = new FrameworkElementFactory(typeof(StackP... |
248,396 | <p>I am writing a batch file script using Windows command and want to change each occurrence of some blank space with "," What is the simplest way to do that? </p>
| [
{
"answer_id": 248401,
"author": "EBGreen",
"author_id": 1358,
"author_profile": "https://Stackoverflow.com/users/1358",
"pm_score": 0,
"selected": false,
"text": "<p>Well it will depend a lot on how you are getting the data, but you may be able to finagle something with a For-Do constru... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32565/"
] | I am writing a batch file script using Windows command and want to change each occurrence of some blank space with "," What is the simplest way to do that? | If your users are a list of words on one line in a text file, separated by spaces, eg:
```
one two three four
```
Create a batch file SpaceToComma.bat as follows:
```
@echo off
setlocal
for /F "tokens=* delims= " %%a in (%1) do @set data=%%a
echo %data: =,%
endlocal
```
Then run it, you'll get the words separated... |
248,400 | <p>I have a range of random numbers. The range is actually determined by the user but it will be up to 1000 integers. They are placed in this:</p>
<pre><code>vector<int> n
</code></pre>
<p>and the values are inserted like this:</p>
<pre><code>srand(1);
for (i = 0; i < n; i++)
v[i] = rand() % n;
</code>... | [
{
"answer_id": 248436,
"author": "Motti",
"author_id": 3848,
"author_profile": "https://Stackoverflow.com/users/3848",
"pm_score": 1,
"selected": false,
"text": "<p>You should try using a <a href=\"http://en.wikipedia.org/wiki/Prime_sieve\" rel=\"nofollow noreferrer\">prime sieve</a>. Yo... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248400",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28392/"
] | I have a range of random numbers. The range is actually determined by the user but it will be up to 1000 integers. They are placed in this:
```
vector<int> n
```
and the values are inserted like this:
```
srand(1);
for (i = 0; i < n; i++)
v[i] = rand() % n;
```
I'm creating a separate function to find all the ... | In this code:
```
if(i % v[j] == 0)
cout << v[j] << endl;
```
You are testing your index to see if it is divisible by v[j]. I think you meant to do it the other way around, i.e.:
```
if(v[j] % i == 0)
```
Right now, you are printing random divisors of i. You are not printing out random numbers which are known n... |
248,405 | <p>I have some thread-related questions, assuming the following code. Please ignore the possible inefficiency of the code, I'm only interested in the thread part.</p>
<pre><code>//code without thread use
public static int getNextPrime(int from) {
int nextPrime = from+1;
boolean superPrime = false;
while(!... | [
{
"answer_id": 248431,
"author": "JesperE",
"author_id": 13051,
"author_profile": "https://Stackoverflow.com/users/13051",
"pm_score": 1,
"selected": false,
"text": "<p>Read your code carefully. The two cases aren't doing the same thing, and it has nothing to do with threads.</p>\n\n<p>W... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248405",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31610/"
] | I have some thread-related questions, assuming the following code. Please ignore the possible inefficiency of the code, I'm only interested in the thread part.
```
//code without thread use
public static int getNextPrime(int from) {
int nextPrime = from+1;
boolean superPrime = false;
while(!superPrime) {
... | By putting the join() in the loop, you're starting a thread, then waiting for that thread to stop before running the next one. I think you probably want something more like this:
```
public static void main(String[] args) {
int primeStart = 5;
// Make thread-safe list for adding results to
List list = Collec... |
248,437 | <p>Is it possible in ASP.NET to take a string containing some HTML and make ASP.NET to parse it and create a Control for me? For example:</p>
<pre><code>string rawHTML = "<table><td><td>Cell</td></tr></table>";
HTMLTable table = MagicClass.ParseTable(rawHTML);
</code></pre>
<p>I kn... | [
{
"answer_id": 248462,
"author": "Stephen Wrighton",
"author_id": 7516,
"author_profile": "https://Stackoverflow.com/users/7516",
"pm_score": 0,
"selected": false,
"text": "<p>You could traverse the HTML string a token at a time (token defined here as HTML Element or HTML InnerText), and... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8954/"
] | Is it possible in ASP.NET to take a string containing some HTML and make ASP.NET to parse it and create a Control for me? For example:
```
string rawHTML = "<table><td><td>Cell</td></tr></table>";
HTMLTable table = MagicClass.ParseTable(rawHTML);
```
I know that this is a bad thing to do but I am in the unfortunate ... | The closest I think you'll get is [Page.ParseControl](http://msdn.microsoft.com/en-us/library/kz3ffe28.aspx), which is the ASP.NET parser. The downside is that the text you have *is* a LiteralControl, since it doesn't have runat="server" on it - so you 'll do a very tiny bit of string manipulation beforehand.
In other... |
248,459 | <p>We are deploying our ASP.NET 3.5 app to a production server for beta testing.</p>
<p>Each page is secured using SSL.</p>
<p>On our homepage (default.aspx) we have web services which populate flash objects.</p>
<p>I am getting an error:</p>
<p>The HTTP request is unauthorized with client authentication scheme 'An... | [
{
"answer_id": 248500,
"author": "Bryant",
"author_id": 10893,
"author_profile": "https://Stackoverflow.com/users/10893",
"pm_score": 0,
"selected": false,
"text": "<p>Sounds like IIS isn't configured for <a href=\"http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/II... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248459",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23576/"
] | We are deploying our ASP.NET 3.5 app to a production server for beta testing.
Each page is secured using SSL.
On our homepage (default.aspx) we have web services which populate flash objects.
I am getting an error:
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication he... | I would think that the request from Flash to the secure web services doesn't have credentials or that the secure certificate in the response can't be validated.
Probably both.
So in flash there will probably need to be some code like:
```
request.Username = "xyz"
request.Password = "***"
```
or something similar
... |
248,470 | <p>I'm writing a script to remove some build artifacts older than 1 week. </p>
<p>The files have names in the form <em>artifact-1.1-200810391018.exe</em>.</p>
<p>How do I go about removing only the files that are greater than 1 week old, excluding the time in hours and minutes at the end of the date-time-stamp?</p>
... | [
{
"answer_id": 248485,
"author": "VonC",
"author_id": 6309,
"author_profile": "https://Stackoverflow.com/users/6309",
"pm_score": 4,
"selected": true,
"text": "<p>You mean, something along the line of:</p>\n\n<pre><code>find /path/to/files -name \"artifact*\" -type f -mtime +7 -exec rm {... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248470",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18340/"
] | I'm writing a script to remove some build artifacts older than 1 week.
The files have names in the form *artifact-1.1-200810391018.exe*.
How do I go about removing only the files that are greater than 1 week old, excluding the time in hours and minutes at the end of the date-time-stamp?
Currently it is removing all... | You mean, something along the line of:
```
find /path/to/files -name "artifact*" -type f -mtime +7 -exec rm {} \;
```
? |
248,478 | <p>I am writing a custom session handler in PHP and trying to make the methods defined in session_set_save_handler private.</p>
<pre><code>session_set_save_handler(
array('Session','open'),
array('Session','close'),
array('Session','read'),
array('Session','write'),
array('Session','destroy'),
... | [
{
"answer_id": 248648,
"author": "Peter Bailey",
"author_id": 8815,
"author_profile": "https://Stackoverflow.com/users/8815",
"pm_score": 3,
"selected": true,
"text": "<p>They have to be public. Your class is instantiated and called in exactly the manner you would in your own code.</p>\... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28714/"
] | I am writing a custom session handler in PHP and trying to make the methods defined in session\_set\_save\_handler private.
```
session_set_save_handler(
array('Session','open'),
array('Session','close'),
array('Session','read'),
array('Session','write'),
array('Session','destroy'),
array('Sess... | They have to be public. Your class is instantiated and called in exactly the manner you would in your own code.
So, unless you can figure out how to publically call a private method on ANY class, then no =P |
248,483 | <p>I have defined a fieldset in HTML, and applied the following (simple) CSS rules to it:</p>
<pre><code>fieldset
{
margin: 2em 0;
position:relative;
padding: 1em;
border:1px solid #ccc;
}
</code></pre>
<p>Everything is great, no big deal, except in all versions (well, up to 7 as far as I know) of IE... | [
{
"answer_id": 248515,
"author": "Rudi",
"author_id": 22830,
"author_profile": "https://Stackoverflow.com/users/22830",
"pm_score": 1,
"selected": false,
"text": "<p>Could you post more of your code, like the HTML of what's surrounding the fieldset and the corresponding CSS rules for tha... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248483",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2323/"
] | I have defined a fieldset in HTML, and applied the following (simple) CSS rules to it:
```
fieldset
{
margin: 2em 0;
position:relative;
padding: 1em;
border:1px solid #ccc;
}
```
Everything is great, no big deal, except in all versions (well, up to 7 as far as I know) of IE the top border -- but not... | I've struggled with this one for some time; tonight I finally found the answer.
<http://www.sitepoint.com/forums/showthread.php?t=526881>
To quote NatalieMac:
>
> Seems that if you have an element inside the fieldset that's overflowing
> to the right of the fieldset, it extends the top border. I had a
> container... |
248,501 | <p>I am using MS SQL Server 2005, I have dates stored in epoch time (starting 1970) I need to create a statement that will affect any record that has not been updated in the last 24 hours.</p>
| [
{
"answer_id": 248524,
"author": "George Mastros",
"author_id": 1408129,
"author_profile": "https://Stackoverflow.com/users/1408129",
"pm_score": 1,
"selected": false,
"text": "<p>You can convert from SQL Server DateTime to Epoch time by calculating the number of seconds that have elapse... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32579/"
] | I am using MS SQL Server 2005, I have dates stored in epoch time (starting 1970) I need to create a statement that will affect any record that has not been updated in the last 24 hours. | To get the current datetime into epoch format, use ([via](http://wiki.lessthandot.com/index.php/Epoch_Date)):
```
SELECT DATEDIFF(s,'19700101 05:00:00:000',GETUTCDATE())
```
To get the epoch time for now - 24 hours use:
```
SELECT DATEDIFF(s,'19700101 05:00:00:000', DATEADD(DAY, -1, GETUTCDATE()))
```
So, you cou... |
248,502 | <p>I want to run a background task that reads input from a TextReader and processes it a line at a time. I want the background task to block until the user types some text into a field and clicks the submit button. Is there some flavour of TextReader that will block until text is available and lets you somehow add more... | [
{
"answer_id": 248561,
"author": "Harper Shelby",
"author_id": 21196,
"author_profile": "https://Stackoverflow.com/users/21196",
"pm_score": 3,
"selected": false,
"text": "<p>I think you'd be much better off creating an event in your main application that is raised when the user hits Sub... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248502",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4794/"
] | I want to run a background task that reads input from a TextReader and processes it a line at a time. I want the background task to block until the user types some text into a field and clicks the submit button. Is there some flavour of TextReader that will block until text is available and lets you somehow add more te... | It seems that there is no implementation of this - which is strange, since I agree that it would be a useful construct. But it should be simple to write. Something like this should work:
```
public class BlockingStream: Stream
{
private readonly Stream _stream;
public BlockingStream(Stream stream)
{
... |
248,534 | <p><strong>Question</strong></p>
<p>I have an application written in Java. It is designed to run on a Linux box standalone. I am trying to spawn a new <em>firefox</em> window. However, <em>firefox</em> never opens. It always has a shell exit code of 1. I can run this same code with <em>gnome-terminal</em> and it ... | [
{
"answer_id": 248552,
"author": "James Van Huis",
"author_id": 31828,
"author_profile": "https://Stackoverflow.com/users/31828",
"pm_score": 3,
"selected": false,
"text": "<p>If you can narrow it down to Java 6, you can use the desktop API:</p>\n\n<p><a href=\"http://java.sun.com/develo... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248534",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29773/"
] | **Question**
I have an application written in Java. It is designed to run on a Linux box standalone. I am trying to spawn a new *firefox* window. However, *firefox* never opens. It always has a shell exit code of 1. I can run this same code with *gnome-terminal* and it opens fine.
**Background**
So, here is its init... | after having read the various answers and various comments(from questioner), here's what I would do
1) try this java approach
<http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ProcessBuilder.html>
```
ProcessBuilder pb = new ProcessBuilder("myCommand", "myArg1", "myArg2");
Map<String, String> env = pb.environment();... |
248,535 | <p>How can you find out the number of active users when you're using a StateServer? Also is it possible to query the StateServer and retrieve the contents in the Session State? </p>
<p>I know that this is all possible if you use SqlServer for a backing store, but I want them to be in memory.</p>
| [
{
"answer_id": 248674,
"author": "Doug Wilson",
"author_id": 32588,
"author_profile": "https://Stackoverflow.com/users/32588",
"pm_score": 1,
"selected": true,
"text": "<p>Tracking the number of users would need to be done at the application level, not the session level.</p>\n\n<p>You sh... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16628/"
] | How can you find out the number of active users when you're using a StateServer? Also is it possible to query the StateServer and retrieve the contents in the Session State?
I know that this is all possible if you use SqlServer for a backing store, but I want them to be in memory. | Tracking the number of users would need to be done at the application level, not the session level.
You should be able to see what is currently in the session with the following:
```
StringBuilder builder = new StringBuilder();
foreach ( String key in Session.Contents ) {
builder.AppendFormat("{0}: {1}<br />", ke... |
248,545 | <p>I have a listbox, and I have the following ItemTemplate for it:</p>
<pre><code><DataTemplate x:Key="ScenarioItemTemplate">
<Border Margin="5,0,5,0"
Background="#FF3C3B3B"
BorderBrush="#FF797878"
BorderThickness="2"
CornerRadius="5">
<DockPan... | [
{
"answer_id": 248581,
"author": "Matt Hamilton",
"author_id": 615,
"author_profile": "https://Stackoverflow.com/users/615",
"pm_score": 8,
"selected": true,
"text": "<p>You can style your ContentControl such that a trigger fires when its container (the ListBoxItem) becomes selected:</p>... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248545",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28149/"
] | I have a listbox, and I have the following ItemTemplate for it:
```
<DataTemplate x:Key="ScenarioItemTemplate">
<Border Margin="5,0,5,0"
Background="#FF3C3B3B"
BorderBrush="#FF797878"
BorderThickness="2"
CornerRadius="5">
<DockPanel>
<DockPanel Do... | You can style your ContentControl such that a trigger fires when its container (the ListBoxItem) becomes selected:
```
<ContentControl
x:Name="designerContent"
MinHeight="100"
Margin="2,0,2,2"
Content="{Binding Path=DesignerInstance}"
Background="#FF999898">
<ContentControl.Style>
<Sty... |
248,557 | <pre><code>// goal: update Address record identified by "id", with new data in "colVal"
string cstr = ConnectionApi.GetSqlConnectionString("SwDb"); // get connection str
using (DataContext db = new DataContext(cstr)) {
Address addr = (from a in db.GetTable<Address>()
where a.Id == id
... | [
{
"answer_id": 248586,
"author": "Bryant",
"author_id": 10893,
"author_profile": "https://Stackoverflow.com/users/10893",
"pm_score": 3,
"selected": false,
"text": "<p>You can get a quick view of the changes to be submitted using the <a href=\"http://msdn.microsoft.com/en-us/library/bb88... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32584/"
] | ```
// goal: update Address record identified by "id", with new data in "colVal"
string cstr = ConnectionApi.GetSqlConnectionString("SwDb"); // get connection str
using (DataContext db = new DataContext(cstr)) {
Address addr = (from a in db.GetTable<Address>()
where a.Id == id
... | You can get a quick view of the changes to be submitted using the [GetChangeSet](http://msdn.microsoft.com/en-us/library/bb882650.aspx) method.
Also make sure that your table has a primary key defined and that the mapping knows about this primary key. Otherwise you won't be able to perform updates. |
248,562 | <p>I have a Spring MVC web app which uses Spring Security. I want to know the username of the currently logged in user. I'm using the code snippet given below . Is this the accepted way? </p>
<p>I don't like having a call to a static method inside this controller - that defeats the whole purpose of Spring, IMHO. ... | [
{
"answer_id": 252096,
"author": "RichH",
"author_id": 16779,
"author_profile": "https://Stackoverflow.com/users/16779",
"pm_score": 2,
"selected": false,
"text": "<p>For the last Spring MVC app I wrote, I didn't inject the SecurityContext holder, but I did have a base controller that I ... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2495576/"
] | I have a Spring MVC web app which uses Spring Security. I want to know the username of the currently logged in user. I'm using the code snippet given below . Is this the accepted way?
I don't like having a call to a static method inside this controller - that defeats the whole purpose of Spring, IMHO. Is there a way ... | If you are using [Spring 3](http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-ann-requestmapping-arguments), the easiest way is:
```
@RequestMapping(method = RequestMethod.GET)
public ModelAndView showResults(final HttpServletRequest request, Principal principal) {
... |
248,569 | <p>Is this possible? I want to have the To:, Body, and an Attachment all pre-populated so all the user has to do is click send. Thanks!</p>
| [
{
"answer_id": 248598,
"author": "VonC",
"author_id": 6309,
"author_profile": "https://Stackoverflow.com/users/6309",
"pm_score": 7,
"selected": true,
"text": "<p>Open a new mail message (<code>ipm.note</code> is the <a href=\"https://msdn.microsoft.com/en-gb/en-en/library/office/ff86157... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14101/"
] | Is this possible? I want to have the To:, Body, and an Attachment all pre-populated so all the user has to do is click send. Thanks! | Open a new mail message (`ipm.note` is the [message class](https://msdn.microsoft.com/en-gb/en-en/library/office/ff861573.aspx) for emails)
```
outlook.exe /c ipm.note
```
Open a new mail message and populate sender:
```
outlook.exe /c ipm.note /m someone@microsoft.com
```
Open a new mail message with attachment... |
248,580 | <p>I'm having a problem, creating a fixed-size overall panel for a touchscreen GUI application that has to take up the entire screen. In a nutshell, the touchscreen is 800 x 600 pixels, and therefore I want the main GUI panel to be that size.</p>
<p>When I start a new GUI project in NetBeans, I set the properties of ... | [
{
"answer_id": 249459,
"author": "Peter",
"author_id": 26483,
"author_profile": "https://Stackoverflow.com/users/26483",
"pm_score": 0,
"selected": false,
"text": "<p>I use this method to complete the task, not sure if its the best and you need to wait calling it until the frame is actua... | 2008/10/29 | [
"https://Stackoverflow.com/questions/248580",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I'm having a problem, creating a fixed-size overall panel for a touchscreen GUI application that has to take up the entire screen. In a nutshell, the touchscreen is 800 x 600 pixels, and therefore I want the main GUI panel to be that size.
When I start a new GUI project in NetBeans, I set the properties of the main pa... | Have you tried [java full screen mode](http://java.sun.com/docs/books/tutorial/extra/fullscreen/index.html)? |