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 |
|---|---|---|---|---|---|---|
208,411 | <p>I am adding a context menu using <code>QAction</code> for a widget.
Now, there is some white space beside the text of the action. I assume this is the space where the <code>QIcon</code> association with the <code>QAction</code> should have been there. Now how do I hide this space. I tried doing:</p>
<pre><code>acti... | [
{
"answer_id": 210372,
"author": "Caleb Huitt - cjhuitt",
"author_id": 9876,
"author_profile": "https://Stackoverflow.com/users/9876",
"pm_score": 1,
"selected": true,
"text": "<p>I don't know if there is a way specific to the action or the menu, but you could probably remove it using a ... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11212/"
] | I am adding a context menu using `QAction` for a widget.
Now, there is some white space beside the text of the action. I assume this is the space where the `QIcon` association with the `QAction` should have been there. Now how do I hide this space. I tried doing:
```
action->setIcon(QIcon());
```
but still does not ... | I don't know if there is a way specific to the action or the menu, but you could probably remove it using a style. |
208,421 | <p>How can I have a view render a partial (user control) from a different folder?
With preview 3 I used to call RenderUserControl with the complete path, but whith upgrading to preview 5 this is not possible anymore.
Instead we got the RenderPartial method, but it's not offering me the functionality I'm looking for.</p... | [
{
"answer_id": 208448,
"author": "Elijah Manor",
"author_id": 4481,
"author_profile": "https://Stackoverflow.com/users/4481",
"pm_score": 10,
"selected": true,
"text": "<p>Just include the path to the view, with the file extension.</p>\n\n<p>Razor:</p>\n\n<pre><code>@Html.Partial(\"~/Vie... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11333/"
] | How can I have a view render a partial (user control) from a different folder?
With preview 3 I used to call RenderUserControl with the complete path, but whith upgrading to preview 5 this is not possible anymore.
Instead we got the RenderPartial method, but it's not offering me the functionality I'm looking for. | Just include the path to the view, with the file extension.
Razor:
```
@Html.Partial("~/Views/AnotherFolder/Messages.cshtml", ViewData.Model.Successes)
```
ASP.NET engine:
```
<% Html.RenderPartial("~/Views/AnotherFolder/Messages.ascx", ViewData.Model.Successes); %>
```
If that isn't your issue, could you please... |
208,433 | <p>Very basic question: how do I write a <code>short</code> literal in C++?</p>
<p>I know the following:</p>
<ul>
<li><code>2</code> is an <code>int</code></li>
<li><code>2U</code> is an <code>unsigned int</code></li>
<li><code>2L</code> is a <code>long</code></li>
<li><code>2LL</code> is a <code>long long</code></li... | [
{
"answer_id": 208444,
"author": "unwind",
"author_id": 28169,
"author_profile": "https://Stackoverflow.com/users/28169",
"pm_score": 3,
"selected": false,
"text": "<p>As far as I know, you don't, there's no such suffix. Most compilers will warn if an integer literal is too large to fit ... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208433",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18511/"
] | Very basic question: how do I write a `short` literal in C++?
I know the following:
* `2` is an `int`
* `2U` is an `unsigned int`
* `2L` is a `long`
* `2LL` is a `long long`
* `2.0f` is a `float`
* `2.0` is a `double`
* `'\2'` is a `char`.
But how would I write a `short` literal? I tried `2S` but that gives a compil... | ```
((short)2)
```
Yeah, it's not strictly a short literal, more of a casted-int, but the behaviour is the same and I think there isn't a direct way of doing it.
>
> That's what I've been doing because I couldn't find anything about it. I would guess that the compiler would be smart enough to compile this as if it'... |
208,436 | <p>When I plug my HP Laserjet 3015, Windows detects the correct model and then tries to install the appropriate drivers.</p>
<p>How can I detect the model of connected printer(s)? I don't want to use the list of installed printers because a Zebra printer can be installed with a Generic/Text only driver.</p>
<p>I'm a ... | [
{
"answer_id": 208503,
"author": "Roman Ganz",
"author_id": 17981,
"author_profile": "https://Stackoverflow.com/users/17981",
"pm_score": 2,
"selected": false,
"text": "<p>Recently I made a little demo with this. Just put a <code>TComboBox</code> and a <code>TMemo</code> on a Form and re... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208436",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17766/"
] | When I plug my HP Laserjet 3015, Windows detects the correct model and then tries to install the appropriate drivers.
How can I detect the model of connected printer(s)? I don't want to use the list of installed printers because a Zebra printer can be installed with a Generic/Text only driver.
I'm a Delphi and C# pro... | You can send a
```
~HI
```
to the Zebra printer and it should return its model number and also fw version |
208,468 | <p>What issues or refactoring did you have to do when you upgraded from ASP.NET MVC Preview 5 to the newly released <a href="http://www.microsoft.com/downloads/details.aspx?familyid=a24d1e00-cd35-4f66-baa0-2362bdde0766&displaylang=en&tm" rel="nofollow noreferrer">Beta</a> version?</p>
| [
{
"answer_id": 208883,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 4,
"selected": true,
"text": "<p>I'm about to do this myself. Here's the list of changes from the readme:</p>\n\n<h2>Changes Made Between CodePlex Preview 5... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4481/"
] | What issues or refactoring did you have to do when you upgraded from ASP.NET MVC Preview 5 to the newly released [Beta](http://www.microsoft.com/downloads/details.aspx?familyid=a24d1e00-cd35-4f66-baa0-2362bdde0766&displaylang=en&tm) version? | I'm about to do this myself. Here's the list of changes from the readme:
Changes Made Between CodePlex Preview 5 and Beta
------------------------------------------------
* Changed the default validation messages to be more end-user friendly.
* Renamed CompositeViewEngine to AutoViewEngine.
* Added a Url property to ... |
208,469 | <p>I have multiple RequireFieldValidators on my aspx page.</p>
<p>On the backend (C#) I want to be able to tell which control specifically wasn't valid so I can apply a style to that control.
I use the Page.IsValid method to see if the overall page passed validation but I need to know specifically which one control fa... | [
{
"answer_id": 208520,
"author": "bob",
"author_id": 23805,
"author_profile": "https://Stackoverflow.com/users/23805",
"pm_score": 1,
"selected": false,
"text": "<p>All Validators are added to the ValidatorCollection of the Page (property Page.Validators).</p>\n\n<p>You can loop through ... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208469",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4144/"
] | I have multiple RequireFieldValidators on my aspx page.
On the backend (C#) I want to be able to tell which control specifically wasn't valid so I can apply a style to that control.
I use the Page.IsValid method to see if the overall page passed validation but I need to know specifically which one control failed. | As others have mentioned, you need to loop the validator collection of the page and check their states. [MSDN has examples here.](http://msdn.microsoft.com/en-us/library/dh9ad08f.aspx)
```
If (Me.IsPostBack) Then
Me.Validate()
If (Not Me.IsValid) Then
Dim msg As String
' Loop through all validation controls to... |
208,471 | <p>I'm using jQuery to hide and show elements when a radio button group is altered/clicked. It works fine in browsers like Firefox, but in IE 6 and 7, the action only occurs when the user then clicks somewhere else on the page.</p>
<p>To elaborate, when you load the page, everything looks fine. In Firefox, if you clic... | [
{
"answer_id": 208488,
"author": "Paolo Bergantino",
"author_id": 16417,
"author_profile": "https://Stackoverflow.com/users/16417",
"pm_score": 8,
"selected": true,
"text": "<p>Try using <a href=\"http://api.jquery.com/click\" rel=\"noreferrer\"><code>.click</code></a> instead of <a href... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208471",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21709/"
] | I'm using jQuery to hide and show elements when a radio button group is altered/clicked. It works fine in browsers like Firefox, but in IE 6 and 7, the action only occurs when the user then clicks somewhere else on the page.
To elaborate, when you load the page, everything looks fine. In Firefox, if you click a radio ... | Try using [`.click`](http://api.jquery.com/click) instead of [`.change`](http://api.jquery.com/change). |
208,475 | <p>What is a fairly standard way for storing application settings, mainly for windows but also easy to move over to other platforms.</p>
<p>There's basically 4 groups of settings I want to have:</p>
<ul>
<li>Global settings, affects all users, and may be moved between machines</li>
<li>Global system settings, affects... | [
{
"answer_id": 208517,
"author": "Richard T",
"author_id": 26976,
"author_profile": "https://Stackoverflow.com/users/26976",
"pm_score": 1,
"selected": false,
"text": "<p>There are (at least) three reasonable choices:</p>\n\n<p>Registry: This is my least favorite because of portability a... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208475",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6266/"
] | What is a fairly standard way for storing application settings, mainly for windows but also easy to move over to other platforms.
There's basically 4 groups of settings I want to have:
* Global settings, affects all users, and may be moved between machines
* Global system settings, affects all users, but specific to ... | If you are a boost user, you might take a look at the [program options](http://www.boost.org/doc/libs/1_36_0/doc/html/program_options.html) library, it supports using config files as well as environment variables and (of course) command line options.
It is designed to be portable, so that should ease your cross-platfo... |
208,493 | <p>Is it possible to search every field of every table for a particular value in Oracle?</p>
<p>There are hundreds of tables with thousands of rows in some tables so I know this could take a very long time to query. But the only thing I know is that a value for the field I would like to query against is <code>1/22/200... | [
{
"answer_id": 208519,
"author": "Dheer",
"author_id": 17266,
"author_profile": "https://Stackoverflow.com/users/17266",
"pm_score": 1,
"selected": false,
"text": "<p>I don't of a simple solution on the SQL promprt. Howeve there are quite a few tools like toad and PL/SQL Developer that h... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208493",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2849/"
] | Is it possible to search every field of every table for a particular value in Oracle?
There are hundreds of tables with thousands of rows in some tables so I know this could take a very long time to query. But the only thing I know is that a value for the field I would like to query against is `1/22/2008P09RR8`.
<
I'... | Quote:
>
> I've tried using this statement below
> to find an appropriate column based on
> what I think it should be named but it
> returned no results.\*
>
>
>
> ```
> SELECT * from dba_objects WHERE
> object_name like '%DTN%'
>
> ```
>
>
A column isn't an object. If you mean that you expect the column na... |
208,532 | <p>Currently, I'm using:</p>
<pre><code>DataTable dt = CreateDataTableInSomeWay();
List<DataRow> list = new List<DataRow>();
foreach (DataRow dr in dt.Rows)
{
list.Add(dr);
}
</code></pre>
<p>Is there a better/magic way?</p>
| [
{
"answer_id": 208544,
"author": "Kibbee",
"author_id": 1862,
"author_profile": "https://Stackoverflow.com/users/1862",
"pm_score": 5,
"selected": false,
"text": "<p>You could use </p>\n\n<pre><code>List<DataRow> list = new List<DataRow>(dt.Select());\n</code></pre>\n\n<p><co... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208532",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1122/"
] | Currently, I'm using:
```
DataTable dt = CreateDataTableInSomeWay();
List<DataRow> list = new List<DataRow>();
foreach (DataRow dr in dt.Rows)
{
list.Add(dr);
}
```
Is there a better/magic way? | If you're using .NET 3.5, you can use [`DataTableExtensions.AsEnumerable`](http://msdn.microsoft.com/en-us/library/system.data.datatableextensions.asenumerable.aspx) (an extension method) and then if you really need a `List<DataRow>` instead of just `IEnumerable<DataRow>` you can call [`Enumerable.ToList`](http://msdn.... |
208,533 | <p>I have an ASP.NET site that has been running perfectly for a long time, nothing's changed recently. From one hour to the next I started receiving an IndexOutOfRangeException in a line where I do a LINQ query like this:</p>
<pre><code>var form = SqlDB.GetTable<ORMB.Form, CDB>()
.Where(f => f.FormID == f... | [
{
"answer_id": 208899,
"author": "csgero",
"author_id": 21764,
"author_profile": "https://Stackoverflow.com/users/21764",
"pm_score": 3,
"selected": true,
"text": "<p>Are you sharing a common DataContext? That would explain the threading issues you are describing, as DataContext is not t... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208533",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12469/"
] | I have an ASP.NET site that has been running perfectly for a long time, nothing's changed recently. From one hour to the next I started receiving an IndexOutOfRangeException in a line where I do a LINQ query like this:
```
var form = SqlDB.GetTable<ORMB.Form, CDB>()
.Where(f => f.FormID == formID)
.Single();
... | Are you sharing a common DataContext? That would explain the threading issues you are describing, as DataContext is not thread safe. |
208,557 | <p>The back button just causes my page to refresh. Is there a way around this without disabling the cache?</p>
| [
{
"answer_id": 208598,
"author": "Kon",
"author_id": 22303,
"author_profile": "https://Stackoverflow.com/users/22303",
"pm_score": 2,
"selected": true,
"text": "<p>Try adding this to your HTML header:</p>\n\n<pre><code><META HTTP-EQUIV=\"CACHE-CONTROL\" CONTENT=\"NO-CACHE\">\n<M... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24481/"
] | The back button just causes my page to refresh. Is there a way around this without disabling the cache? | Try adding this to your HTML header:
```
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
``` |
208,570 | <p>I have a class which is marked with a custom attribute, like this:</p>
<pre><code>public class OrderLine : Entity
{
...
[Parent]
public Order Order { get; set; }
public Address ShippingAddress{ get; set; }
...
}
</code></pre>
<p>I want to write a generic method, where I need to get the Property... | [
{
"answer_id": 208595,
"author": "Konrad Rudolph",
"author_id": 1968,
"author_profile": "https://Stackoverflow.com/users/1968",
"pm_score": 2,
"selected": false,
"text": "<p>This works for me:</p>\n\n<pre><code>public static object GetParentValue<T>(T obj) {\n Type t = obj.GetTy... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8547/"
] | I have a class which is marked with a custom attribute, like this:
```
public class OrderLine : Entity
{
...
[Parent]
public Order Order { get; set; }
public Address ShippingAddress{ get; set; }
...
}
```
I want to write a generic method, where I need to get the Property on a Entity which is mark... | Use Type.GetProperties() and PropertyInfo.GetValue()
```
T GetPropertyValue<T>(object o)
{
T value = default(T);
foreach (System.Reflection.PropertyInfo prop in o.GetType().GetProperties())
{
object[] attrs = prop.GetCustomAttributes(typeof(ParentAttribute), false);
... |
208,580 | <p>I was wondering peoples opinions on the naming of ID columns in database tables.</p>
<p>If I have a table called Invoices with a primary key of an identity column I would call that column InvoiceID so that I would not conflict with other tables and it's obvious what it is.</p>
<p>Where I am workind current they ha... | [
{
"answer_id": 208591,
"author": "Jason Cohen",
"author_id": 4926,
"author_profile": "https://Stackoverflow.com/users/4926",
"pm_score": 5,
"selected": false,
"text": "<p>We use <code>InvoiceID</code>, not <code>ID</code>. It makes queries more readable -- when you see <code>ID</code> a... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208580",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26792/"
] | I was wondering peoples opinions on the naming of ID columns in database tables.
If I have a table called Invoices with a primary key of an identity column I would call that column InvoiceID so that I would not conflict with other tables and it's obvious what it is.
Where I am workind current they have called all ID ... | ID is a SQL Antipattern.
See <http://www.amazon.com/s/ref=nb_sb_ss_i_1_5?url=search-alias%3Dstripbooks&field-keywords=sql+antipatterns&sprefix=sql+a>
If you have many tables with ID as the id you are making reporting that much more difficult. It obscures meaning and makes complex queries harder to read as well as req... |
208,604 | <p>I have successfully been able to rename a table and drop all constraints on that table with foreign key relationships and build they all back up. However, now I am at a point where the PK_tblFoo exists in more than one place (when I transfer the table to another DB). Renaming the table does not rename the primary ke... | [
{
"answer_id": 208686,
"author": "RyanKeeter",
"author_id": 7952,
"author_profile": "https://Stackoverflow.com/users/7952",
"pm_score": 1,
"selected": false,
"text": "<p>I believe I will need to this manually, drop all FK constraints, run this guy:</p>\n\n<pre><code>IF EXISTS ( SELECT *... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7952/"
] | I have successfully been able to rename a table and drop all constraints on that table with foreign key relationships and build they all back up. However, now I am at a point where the PK\_tblFoo exists in more than one place (when I transfer the table to another DB). Renaming the table does not rename the primary key.... | I believe I will need to this manually, drop all FK constraints, run this guy:
```
IF EXISTS ( SELECT *
FROM sys.indexes
WHERE object_id = OBJECT_ID(N'[dbo].[tblFoo]')
AND name = N'PK_tblBusinessListings' )
ALTER TABLE [dbo].[tblFoo] DROP CONSTRAINT [PK_tblBusinessListings]
GO
AL... |
208,612 | <p>I am kinda repeating this question bit the 1st time it was asked incorrectly.</p>
<p>I have this:</p>
<pre><code><xsd:complexType name="A">
<xsd:sequence>
<xsd:element name="options" type="options"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType n... | [
{
"answer_id": 208858,
"author": "Jeff Yates",
"author_id": 23234,
"author_profile": "https://Stackoverflow.com/users/23234",
"pm_score": 0,
"selected": false,
"text": "<p>You could make the <code>options</code> sequence open-ended so you can have any number of options and then validate ... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208612",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22763/"
] | I am kinda repeating this question bit the 1st time it was asked incorrectly.
I have this:
```
<xsd:complexType name="A">
<xsd:sequence>
<xsd:element name="options" type="options"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="B">
<xsd:complexContent>
<xsd:e... | Just stick with elements of type B and then use then decorate your instance document elements as described below with the appropriate `xsi:type` attribute value.
```
<xsd:complexType name="B">
<xsd:complexContent>
<xsd:element name="options" type="ex_options"/>
</xsd:complexContent>
</xsd... |
208,647 | <p>I have a <a href="https://jqueryui.com/draggable/" rel="nofollow noreferrer"><code>draggable</code></a> with a custom <a href="http://api.jqueryui.com/draggable/#option-helper" rel="nofollow noreferrer"><code>helper</code></a>. Sometimes the helper is a clone and sometimes it is the original element. </p>
<p>The pr... | [
{
"answer_id": 212623,
"author": "Adam Hepton",
"author_id": 2268,
"author_profile": "https://Stackoverflow.com/users/2268",
"pm_score": 0,
"selected": false,
"text": "<p>I might be missing something here, but is it not simply a case of adding</p>\n\n<pre><code>revert: \"invalid\"\n</cod... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1896/"
] | I have a [`draggable`](https://jqueryui.com/draggable/) with a custom [`helper`](http://api.jqueryui.com/draggable/#option-helper). Sometimes the helper is a clone and sometimes it is the original element.
The problem is that when the helper is the original element and is **not** dropped on a valid droppable it gets ... | Ok, I found a solution! It's ugly and it breaks the 'rules of encapsulation,' but at least it does the job.
Remember **this is just for special cases**! jQuery can handle its own helper removal just fine. In my case I had a helper that was sometimes the original element and sometimes a clone, so it wasn't always appr... |
208,659 | <p>Does anyone know of a good .NET library rules library (ideally open-source)? I need something that can do nested logic expressions, e.g., (A AND B) AND (B OR C OR D). I need to do comparisons of object properties, e.g., A.P1 AND B.P1. (Ideally, I could compare any property -- A.P1 AND B.P2). </p>
<p>It should s... | [
{
"answer_id": 208717,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 3,
"selected": false,
"text": "<p>The official MS solution for this is <a href=\"http://msdn.microsoft.com/en-us/netframework/aa663328.aspx\" rel=\"noreferre... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208659",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28588/"
] | Does anyone know of a good .NET library rules library (ideally open-source)? I need something that can do nested logic expressions, e.g., (A AND B) AND (B OR C OR D). I need to do comparisons of object properties, e.g., A.P1 AND B.P1. (Ideally, I could compare any property -- A.P1 AND B.P2).
It should store the rules... | Agreeing with will I would say use something from the workflow engine family although not workflow.
Examine [System.Workflow.Activities.Rules](http://msdn.microsoft.com/en-us/library/system.workflow.activities.rules.aspx) Namespace a little bit - it's supported in .Net 3, and built into .Net3.5. You have everything in ... |
208,666 | <p>I was wondering, is there any possibility to create a table without a primary key, but with two foreign keys, where the foreign keys pairs are always different?
For example, a <code>STOCK</code> table with <code>item_id</code> and <code>warehouse_id</code> as foreign keys from <code>ITEMS</code> and <code>WAREHOUSES... | [
{
"answer_id": 208675,
"author": "Galwegian",
"author_id": 3201,
"author_profile": "https://Stackoverflow.com/users/3201",
"pm_score": 5,
"selected": false,
"text": "<p>You want a <a href=\"http://en.wikipedia.org/wiki/Combination_Primary_Key\" rel=\"noreferrer\">compound primary key</a>... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208666",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I was wondering, is there any possibility to create a table without a primary key, but with two foreign keys, where the foreign keys pairs are always different?
For example, a `STOCK` table with `item_id` and `warehouse_id` as foreign keys from `ITEMS` and `WAREHOUSES` tables. So same item can be in different warehouse... | You want a [compound primary key](http://en.wikipedia.org/wiki/Combination_Primary_Key). |
208,668 | <p>I had an odd problem today when I was trying to serialize an object. The object was generated via "Add service reference" from a web service (svcutil.exe). </p>
<p>The problem was that the below property (agencyId) was not being serialized with the rest of the object. Out of desperation I commented the property ... | [
{
"answer_id": 208684,
"author": "Joel Coehoorn",
"author_id": 3043,
"author_profile": "https://Stackoverflow.com/users/3043",
"pm_score": 0,
"selected": false,
"text": "<p>The purpose of XmlIgnoreAttribute is to tell the XmlSerializer that you don't want to serialize that property: it's... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208668",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10589/"
] | I had an odd problem today when I was trying to serialize an object. The object was generated via "Add service reference" from a web service (svcutil.exe).
The problem was that the below property (agencyId) was not being serialized with the rest of the object. Out of desperation I commented the property below it beca... | There is a pattern (for XmlSerializer), that a property Foo will also look for either "bool FooSpecified", or "bool ShouldSerializeFoo()" - and if found, only serialize Foo if this other member returns true. So I assume that agencyIdSpecified had never been set to true? Removing this member would make it always seriali... |
208,682 | <p>So - I have a checkbox</p>
<pre><code><asp:CheckBox ID="chkOrder" runat="server" Visible='<%#IsCheckBoxVisible() %>'
Checked="false"
OnCheckedChanged="chkOrder_CheckedChanged" AutoPostBack="true"
EnableViewState="false"></asp:CheckBox>
</code></pre>
<p>the one above. Now, the che... | [
{
"answer_id": 208701,
"author": "Huibert Gill",
"author_id": 1254442,
"author_profile": "https://Stackoverflow.com/users/1254442",
"pm_score": 0,
"selected": false,
"text": "<p>Have you tried to compare the genrated HTML from FF and IE? (with \"view html source\")</p>\n\n<p>Just to loca... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5246/"
] | So - I have a checkbox
```
<asp:CheckBox ID="chkOrder" runat="server" Visible='<%#IsCheckBoxVisible() %>'
Checked="false"
OnCheckedChanged="chkOrder_CheckedChanged" AutoPostBack="true"
EnableViewState="false"></asp:CheckBox>
```
the one above. Now, the checkbox is in a gridview and on databound - fo... | In some php coding I did recently, I noticed that FF3 was remembering what I checked, even after a F5 page refresh. Looking at the source showed the correct HTML that I wanted generated. To work around this was to go up to the Address Bar and force the request for the page again.
Why this work around was necessary I'm... |
208,703 | <p>I have seen the following code:</p>
<pre><code>[DefaultValue(100)]
[Description("Some descriptive field here")]
public int MyProperty{...}
</code></pre>
<p>The functionality from the above snippit seems clear enough, I have no idea as to how I can use it to do useful things. Im not even sure as to what name to gi... | [
{
"answer_id": 208705,
"author": "Greg Dean",
"author_id": 1200558,
"author_profile": "https://Stackoverflow.com/users/1200558",
"pm_score": 2,
"selected": false,
"text": "<p>These attributes customize the design time experience.</p>\n\n<p><a href=\"http://msdn.microsoft.com/en-us/librar... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208703",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1816/"
] | I have seen the following code:
```
[DefaultValue(100)]
[Description("Some descriptive field here")]
public int MyProperty{...}
```
The functionality from the above snippit seems clear enough, I have no idea as to how I can use it to do useful things. Im not even sure as to what name to give it!
Does anyone know w... | People have already covered the UI aspect - attributes have other uses, though... for example, they are used extensively in most serialization frameworks.
Some attributes are given special treatment by the compiler - for example, `[PrincipalPermission(...)]` adds declarative security to a method, allowing you to (autom... |
208,736 | <p>How can I strip out extra whitespace from jsp pages' output? Is there a switch I can flip on my web.xml? Is there a Tomcat specific setting?</p>
| [
{
"answer_id": 208752,
"author": "Rontologist",
"author_id": 13925,
"author_profile": "https://Stackoverflow.com/users/13925",
"pm_score": 9,
"selected": true,
"text": "<p>There is a trimWhiteSpaces directive that should accomplish this,</p>\n\n<p>In your JSP:</p>\n\n<pre><code><%@ pa... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5586/"
] | How can I strip out extra whitespace from jsp pages' output? Is there a switch I can flip on my web.xml? Is there a Tomcat specific setting? | There is a trimWhiteSpaces directive that should accomplish this,
In your JSP:
```
<%@ page trimDirectiveWhitespaces="true" %>
```
Or in the jsp-config section your web.xml (Note that this works starting from servlet specification 2.5.):
```
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
... |
208,739 | <p>Eric Meyer's advice to keep individual rules alphabetized in a CSS style definition makes sense - there's no "natural" way to order rules, and this makes it easy in a complex definition to make sure you don't define the same thing twice.</p>
<pre><code>div.Foo
{
background:Green;
border:1px solid K... | [
{
"answer_id": 208754,
"author": "Geoff",
"author_id": 1097,
"author_profile": "https://Stackoverflow.com/users/1097",
"pm_score": 4,
"selected": true,
"text": "<p>I don't know of anything in visual studio, but there online tools to clean up and format css. I've used <a href=\"http://ww... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/239663/"
] | Eric Meyer's advice to keep individual rules alphabetized in a CSS style definition makes sense - there's no "natural" way to order rules, and this makes it easy in a complex definition to make sure you don't define the same thing twice.
```
div.Foo
{
background:Green;
border:1px solid Khaki;
display:none;... | I don't know of anything in visual studio, but there online tools to clean up and format css. I've used [CleanCSS](http://www.cleancss.com/) with success
**Update:**
Try this one [Format CSS Online](http://www.lonniebest.com/FormatCSS/). It seems to output the lines more like you want |
208,777 | <p>I have a class which has the following constructor</p>
<pre><code>public DelayCompositeDesigner(DelayComposite CompositeObject)
{
InitializeComponent();
compositeObject = CompositeObject;
}
</code></pre>
<p>along with a default constructor with no parameters.</p>
<p>Next I'm trying to create an instanc... | [
{
"answer_id": 208812,
"author": "DocMax",
"author_id": 6234,
"author_profile": "https://Stackoverflow.com/users/6234",
"pm_score": 4,
"selected": false,
"text": "<p>I would think that your call would need to be:</p>\n\n<pre><code>var designer = Activator.CreateInstance(designerAttribute... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28149/"
] | I have a class which has the following constructor
```
public DelayCompositeDesigner(DelayComposite CompositeObject)
{
InitializeComponent();
compositeObject = CompositeObject;
}
```
along with a default constructor with no parameters.
Next I'm trying to create an instance, but it only works without para... | I think you are dealing with a Type mismatch.
Likely the assembly is referenced in different places, or they are compiled against different versions.
I suggest you iterate through the ConstructorInfo's and do a `paramtype == typeof(DelayComposite)` on the appropriate parameter. |
208,835 | <p>I am just now learning about function pointers and, as I was reading the K&R chapter on the subject, the first thing that hit me was, "Hey, this is kinda like a closure." I knew this assumption is fundamentally wrong somehow and after a search online I didn't find really any analysis of this comparison... | [
{
"answer_id": 208851,
"author": "Herms",
"author_id": 1409,
"author_profile": "https://Stackoverflow.com/users/1409",
"pm_score": 3,
"selected": false,
"text": "<p>In C you can't define the function inline, so you can't really create a closure. All you're doing is passing around a refe... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25012/"
] | I am just now learning about function pointers and, as I was reading the K&R chapter on the subject, the first thing that hit me was, "Hey, this is kinda like a closure." I knew this assumption is fundamentally wrong somehow and after a search online I didn't find really any analysis of this comparison.
So why are C-s... | A lambda (or [closure](http://en.wikipedia.org/wiki/Closure_(computer_science))) encapsulates both the function pointer and variables. This is why, in C#, you can do:
```
int lessThan = 100;
Func<int, bool> lessThanTest = delegate(int i) {
return i < lessThan;
};
```
I used an anonymous delegate there as a closur... |
208,839 | <p>We are working with some legacy code that accesses a shared drive by the letter (f:\ for example). Using the UNC notation is not an option. Our Java wrapper app will run as a service, and as the first step, I would like to map the drive explicitly in the code. Has anyone done this?</p>
| [
{
"answer_id": 208857,
"author": "Jonas K",
"author_id": 26609,
"author_profile": "https://Stackoverflow.com/users/26609",
"pm_score": 3,
"selected": false,
"text": "<p>I think the easiest way is to use the Runtime.getRuntime().exec() method and call the \"net use\" command.</p>\n\n<p>Fo... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9293/"
] | We are working with some legacy code that accesses a shared drive by the letter (f:\ for example). Using the UNC notation is not an option. Our Java wrapper app will run as a service, and as the first step, I would like to map the drive explicitly in the code. Has anyone done this? | Consider executing the DOS command that maps a network drive as in the following code:
```
String command = "c:\\windows\\system32\\net.exe use f: \\\\machine\\share /user:user password";
Process p = Runtime.getRuntime().exec(command);
...
```
See details on net use command:
```
The syntax of this command is:
NET... |
208,855 | <p>Let's have the following class definition:</p>
<pre><code>CThread::CThread ()
{
this->hThread = NULL;
this->hThreadId = 0;
this->hMainThread = ::GetCurrentThread ();
this->hMainThreadId = ::GetCurrentThreadId ();
this->Timeout = 2000; //milliseconds
}
CThrea... | [
{
"answer_id": 208888,
"author": "Rob Walker",
"author_id": 3631,
"author_profile": "https://Stackoverflow.com/users/3631",
"pm_score": 5,
"selected": true,
"text": "<p>The memory space for your application is accessible to all threads. By default any variable is visible to any thread r... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/446104/"
] | Let's have the following class definition:
```
CThread::CThread ()
{
this->hThread = NULL;
this->hThreadId = 0;
this->hMainThread = ::GetCurrentThread ();
this->hMainThreadId = ::GetCurrentThreadId ();
this->Timeout = 2000; //milliseconds
}
CThread::~CThread ()
{
//waitin... | The memory space for your application is accessible to all threads. By default any variable is visible to any thread regardless of context (the only exception would be variables declared \_\_delcspec(thread) )
You are getting a crash due to a race condition. The thread you just created hasn't started running yet at th... |
208,874 | <p>I have 3 tables (archive has many sections, section (may) belong to many archives):</p>
<ul>
<li><p><code>archive</code></p>
<ul>
<li><code>id PK</code></li>
<li><code>description</code></li>
</ul></li>
<li><p><code>archive_to_section</code></p>
<ul>
<li><code>archive_id PK FK</code></li>
<li><code>section_id PK ... | [
{
"answer_id": 208898,
"author": "tloach",
"author_id": 14092,
"author_profile": "https://Stackoverflow.com/users/14092",
"pm_score": 1,
"selected": false,
"text": "<p>We've already dropped it, but it depends on who you're marketing to. Only other companies will ever see our product, so... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208874",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4196/"
] | I have 3 tables (archive has many sections, section (may) belong to many archives):
* `archive`
+ `id PK`
+ `description`
* `archive_to_section`
+ `archive_id PK FK`
+ `section_id PK FK`
* `section`
+ `id PK`
+ `description`
What would the SQL look like to list all the sections that belong a certain archive ... | According to [some](http://www.w3schools.com/browsers/browsers_stats.asp) - [browser](http://www.adtech.info/news/pr-08-07_en.htm) - [statistics](http://www.thecounter.com/stats/2008/September/browser.php), IE6 market share is still bigger than Chrome, Safari and Opera together, nearly as much as IE7.
Unless you targe... |
208,894 | <p>How should I base64 encode a PDF file for transport over XML-RPC in Python?</p>
| [
{
"answer_id": 208950,
"author": "johnstok",
"author_id": 27929,
"author_profile": "https://Stackoverflow.com/users/27929",
"pm_score": 2,
"selected": false,
"text": "<p>You can do it with the <a href=\"https://docs.python.org/3/library/base64.html\" rel=\"nofollow noreferrer\">base64 li... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208894",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/825/"
] | How should I base64 encode a PDF file for transport over XML-RPC in Python? | If you don't want to use the xmlrpclib's Binary class, you can just use the .encode() method of strings:
```
a = open("pdf_reference.pdf", "rb").read().encode("base64")
``` |
208,919 | <p>I am searching for "o" then prints all lines with "o". Any suggestion/code I must apply?</p>
<p>data.txt:</p>
<pre><code>j,o,b:
a,b,d:
o,l,e:
f,a,r:
e,x,o:
</code></pre>
<p>desired output:</p>
<pre><code>j,o,b:
o,l,e:
e,x,o:
</code></pre>
| [
{
"answer_id": 208935,
"author": "Srikanth",
"author_id": 7205,
"author_profile": "https://Stackoverflow.com/users/7205",
"pm_score": 1,
"selected": false,
"text": "<pre><code>grep \"o\" data.txt\n</code></pre>\n\n<p>Does that help? I don't know Perl, but you can get the same output usin... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28607/"
] | I am searching for "o" then prints all lines with "o". Any suggestion/code I must apply?
data.txt:
```
j,o,b:
a,b,d:
o,l,e:
f,a,r:
e,x,o:
```
desired output:
```
j,o,b:
o,l,e:
e,x,o:
``` | ```
grep o data.txt
perl -ne 'print if (/o/);' <data.txt
``` |
208,925 | <p>I'm using MS SQL Server 2005. Is there a difference, to the SQL engine, between</p>
<pre><code>SELECT * FROM MyTable;
</code></pre>
<p>and</p>
<pre><code>SELECT ColA, ColB, ColC FROM MyTable;
</code></pre>
<p>When ColA, ColB, and ColC represent every column in the table?</p>
<p>If they are the same, is there a... | [
{
"answer_id": 208939,
"author": "Ikke",
"author_id": 20261,
"author_profile": "https://Stackoverflow.com/users/20261",
"pm_score": 2,
"selected": false,
"text": "<p>When you select each field individually, it is more clear which fields are actually being selected. </p>\n"
},
{
"... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17803/"
] | I'm using MS SQL Server 2005. Is there a difference, to the SQL engine, between
```
SELECT * FROM MyTable;
```
and
```
SELECT ColA, ColB, ColC FROM MyTable;
```
When ColA, ColB, and ColC represent every column in the table?
If they are the same, is there a reason why you should use the 2nd one anyway? I have a p... | Generally, it's better to be explicit, so `Select col1, col2 from Table` is better. The reason being that at some point, an extra column may be added to that table, and would cause unneeded data to be brought back from the query.
This isn't a hard and fast rule though. |
208,959 | <p>I'm in the process of creating a class that stores metadata about a particular data source. The metadata is structured in a tree, very similar to how XML is structured. The metadata values can be integer, decimal, or string values.</p>
<p>I'm curious if there is a good way in C++ to store variant data for a situa... | [
{
"answer_id": 208968,
"author": "Konrad Rudolph",
"author_id": 1968,
"author_profile": "https://Stackoverflow.com/users/1968",
"pm_score": 6,
"selected": true,
"text": "<p>As of C++17, there’s <a href=\"http://en.cppreference.com/w/cpp/utility/variant\" rel=\"noreferrer\"><code>std::var... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21254/"
] | I'm in the process of creating a class that stores metadata about a particular data source. The metadata is structured in a tree, very similar to how XML is structured. The metadata values can be integer, decimal, or string values.
I'm curious if there is a good way in C++ to store variant data for a situation like th... | As of C++17, there’s [`std::variant`](http://en.cppreference.com/w/cpp/utility/variant).
If you can’t use that yet, you might want [Boost.Variant](http://www.boost.org/doc/libs/1_36_0/doc/html/variant.html). A similar, but distinct, type for modelling polymorphism is provided by [`std::any`](http://en.cppreference.com... |
208,969 | <p>Is it possible to encode an assignment into an expression tree?</p>
| [
{
"answer_id": 209002,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 5,
"selected": true,
"text": "<p>No, I don't believe so.</p>\n\n<p>Certainly the C# compiler disallows it when converting a lambda expression:</p>\n\n<... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208969",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26054/"
] | Is it possible to encode an assignment into an expression tree? | No, I don't believe so.
Certainly the C# compiler disallows it when converting a lambda expression:
```
int x;
Expression<Func<int,int>> foo = (x=y); // Assign to x and return value
```
This yields the error:
```
CS0832: An expression tree may not contain an assignment operator
``` |
208,977 | <p>When I launch CruiseControl.NET with a particular configuration file I receive the following error:</p>
<blockquote>
<p>ThoughtWorks.CruiseControl.Core.Config.ConfigurationException: Duplicate node detected</p>
</blockquote>
<p>What does this mean, and what causes it?</p>
| [
{
"answer_id": 209002,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 5,
"selected": true,
"text": "<p>No, I don't believe so.</p>\n\n<p>Certainly the C# compiler disallows it when converting a lambda expression:</p>\n\n<... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13172/"
] | When I launch CruiseControl.NET with a particular configuration file I receive the following error:
>
> ThoughtWorks.CruiseControl.Core.Config.ConfigurationException: Duplicate node detected
>
>
>
What does this mean, and what causes it? | No, I don't believe so.
Certainly the C# compiler disallows it when converting a lambda expression:
```
int x;
Expression<Func<int,int>> foo = (x=y); // Assign to x and return value
```
This yields the error:
```
CS0832: An expression tree may not contain an assignment operator
``` |
208,978 | <p>I'm trying to write an audio analysis application, and I need to identify local maxima in a 2D array which represents a spectrogram. I've already got an open source library that can generate the spectrogram using Fast Fourier Transforms, but I was wondering if anybody knew of any good libraries to help me with actua... | [
{
"answer_id": 209002,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 5,
"selected": true,
"text": "<p>No, I don't believe so.</p>\n\n<p>Certainly the C# compiler disallows it when converting a lambda expression:</p>\n\n<... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208978",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4397/"
] | I'm trying to write an audio analysis application, and I need to identify local maxima in a 2D array which represents a spectrogram. I've already got an open source library that can generate the spectrogram using Fast Fourier Transforms, but I was wondering if anybody knew of any good libraries to help me with actually... | No, I don't believe so.
Certainly the C# compiler disallows it when converting a lambda expression:
```
int x;
Expression<Func<int,int>> foo = (x=y); // Assign to x and return value
```
This yields the error:
```
CS0832: An expression tree may not contain an assignment operator
``` |
208,993 | <p>I have an asp.net page which sends content of a file to the client, so the browser shows the save as dialog to download the file. This page is displayed in a popup and when the user clicks the save button, it closes automatically and the download starts.</p>
<p>On windows server 2003, it works fine. On vista with o... | [
{
"answer_id": 208999,
"author": "swilliams",
"author_id": 736,
"author_profile": "https://Stackoverflow.com/users/736",
"pm_score": 3,
"selected": false,
"text": "<p>Try removing the spaces in your <code>ContentType</code>. The standard is <code>application/octet-stream</code>.</p>\n"
... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208993",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31505/"
] | I have an asp.net page which sends content of a file to the client, so the browser shows the save as dialog to download the file. This page is displayed in a popup and when the user clicks the save button, it closes automatically and the download starts.
On windows server 2003, it works fine. On vista with other brows... | Try removing the spaces in your `ContentType`. The standard is `application/octet-stream`. |
208,998 | <pre><code>something.each do |x|
#lots of stuff
end if some_condition
</code></pre>
| [
{
"answer_id": 209012,
"author": "workmad3",
"author_id": 16035,
"author_profile": "https://Stackoverflow.com/users/16035",
"pm_score": 2,
"selected": false,
"text": "<p>I'd personally advocate against that for the pure and simple reason that it is too easy to miss. Even with that shorte... | 2008/10/16 | [
"https://Stackoverflow.com/questions/208998",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20714/"
] | ```
something.each do |x|
#lots of stuff
end if some_condition
``` | I think the popular way is to **use statement modifiers only if it is a one-liner**.
In all other cases, use the normal if style prevalent in C, Java etc.
```
bail_out if reqd_param.nil?
if its_gonna_be_long then
long_exec stmt1
long_exec stmt2
....
end
``` |
209,005 | <p>I am trying to create a MATLAB class with a member variable that's being updated as a result of a method invocation, but when I try to change the property within the class it (apperently, from what I understood from MATLAB's memory management) creates a copy of the object and then modifies it, leaving the original o... | [
{
"answer_id": 209159,
"author": "Azim J",
"author_id": 4612,
"author_profile": "https://Stackoverflow.com/users/4612",
"pm_score": 5,
"selected": false,
"text": "<h3>Using a Value (Vanilla) Class</h3>\n<p>When using a value class you need to tell Matlab to store a modified copy of the o... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209005",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I am trying to create a MATLAB class with a member variable that's being updated as a result of a method invocation, but when I try to change the property within the class it (apperently, from what I understood from MATLAB's memory management) creates a copy of the object and then modifies it, leaving the original obje... | ### Using a Value (Vanilla) Class
When using a value class you need to tell Matlab to store a modified copy of the object to save the changes in the property value. So,
```
>> a=testprop
>> a.Request(5); % will NOT change the value of a.numRequests.
5
>> a.Request(5)
5
>> a.numRequests
ans =
0
>> a=a.Requ... |
209,023 | <p>I have a Google App Engine that has a form. When the user clicks on the submit button, AJAX operation will be called, and the server will output something to append to the end of the very page where it comes from. How, I have a Django template, and I intend to use jquery. I have the following view:</p>
<pre><code>... | [
{
"answer_id": 266862,
"author": "Seamus",
"author_id": 30443,
"author_profile": "https://Stackoverflow.com/users/30443",
"pm_score": 2,
"selected": false,
"text": "<p>Without being able to test the code, what are your results? Have you checked the results returned by the AJAX call? I wo... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3834/"
] | I have a Google App Engine that has a form. When the user clicks on the submit button, AJAX operation will be called, and the server will output something to append to the end of the very page where it comes from. How, I have a Django template, and I intend to use jquery. I have the following view:
```
<html>
<head>
<... | Without being able to test the code, what are your results? Have you checked the results returned by the AJAX call? I would suggest you run Firefox with Firebug and log the AJAX results to the Firebug console to see what you get:
```
//...
success: function( result ) {
console.log( result );
$('... |
209,029 | <p>I have an <code>input type="image"</code>. This acts like the cell notes in Microsoft Excel. If someone enters a number into the text box that this <code>input-image</code> is paired with, I setup an event handler for the <code>input-image</code>. Then when the user clicks the <code>image</code>, they get a little p... | [
{
"answer_id": 209044,
"author": "John Boker",
"author_id": 2847,
"author_profile": "https://Stackoverflow.com/users/2847",
"pm_score": 5,
"selected": false,
"text": "<p>maybe the unbind method will work for you</p>\n\n<pre><code>$(\"#myimage\").unbind(\"click\");\n</code></pre>\n"
},
... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209029",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13800/"
] | I have an `input type="image"`. This acts like the cell notes in Microsoft Excel. If someone enters a number into the text box that this `input-image` is paired with, I setup an event handler for the `input-image`. Then when the user clicks the `image`, they get a little popup to add some notes to the data.
My problem... | jQuery ≥ 1.7
------------
With jQuery 1.7 onward the event API has been updated, `.bind()`/`.unbind()` are still available for backwards compatibility, but the preferred method is using the [on()](http://api.jquery.com/on/)/[off()](http://api.jquery.com/off/) functions. The below would now be,
```
$('#myimage').click... |
209,043 | <p>I am used to using Atlas. Recently i have started transitioning to jQuery and sometimes prototype. The project that i'm currently working on is using prototype.</p>
<p>In Prototype, is there an easy way to get the browser name and version? I've looked over the API documentation and can't seem to find it.</p>
| [
{
"answer_id": 209537,
"author": "Remy Sharp",
"author_id": 22617,
"author_profile": "https://Stackoverflow.com/users/22617",
"pm_score": 2,
"selected": false,
"text": "<p>You're right - prototype doesn't provide a utility for ascertaining the browser name or version.</p>\n\n<p>If you <e... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209043",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6350/"
] | I am used to using Atlas. Recently i have started transitioning to jQuery and sometimes prototype. The project that i'm currently working on is using prototype.
In Prototype, is there an easy way to get the browser name and version? I've looked over the API documentation and can't seem to find it. | As a completion to nertzy's answer you can add the ability for detecting IE versions using this:
```
Prototype.Browser.IE6 = Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)) == 6;
Prototype.Browser.IE7 = Prototype.Browser.IE && parseInt(navigator.userAgent.substrin... |
209,067 | <p>Since Access 2003 doesn't have the control anchoring functionality as exists in 2007, I was wondering if anyone has or is aware of some VBA script, or a freeware control, that can give this functionality?</p>
| [
{
"answer_id": 209827,
"author": "Godeke",
"author_id": 28006,
"author_profile": "https://Stackoverflow.com/users/28006",
"pm_score": 4,
"selected": true,
"text": "<p>I know of no exact duplication of the 2007 functionality in 2003. There are multiple components for resolution independen... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8678/"
] | Since Access 2003 doesn't have the control anchoring functionality as exists in 2007, I was wondering if anyone has or is aware of some VBA script, or a freeware control, that can give this functionality? | I know of no exact duplication of the 2007 functionality in 2003. There are multiple components for resolution independence (resizing the controls on a form based on the users monitor resolution) and for resizing with the form resize event (such as <http://www.fmsinc.com/products/components/ControlTour/resize.htm>). No... |
209,095 | <p>Requirement is to pass module name and function name from the command-line argument.
I need to get the command-line argument in the program and I need to call that function from that module</p>
<p>For example, calling a try.pl program with 2 arguments: MODULE1(Module name) Display(Function name)</p>
<pre><code> pe... | [
{
"answer_id": 209284,
"author": "Yanick",
"author_id": 10356,
"author_profile": "https://Stackoverflow.com/users/10356",
"pm_score": 3,
"selected": false,
"text": "<p>There's many ways to do this. One of them is:</p>\n\n<pre><code>#!/usr/bin/perl\nuse strict;\nuse warnings;\n\nmy ( $pa... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28622/"
] | Requirement is to pass module name and function name from the command-line argument.
I need to get the command-line argument in the program and I need to call that function from that module
For example, calling a try.pl program with 2 arguments: MODULE1(Module name) Display(Function name)
```
perl try.pl MODULE1 Dis... | There's many ways to do this. One of them is:
```
#!/usr/bin/perl
use strict;
use warnings;
my ( $package, $function ) = @ARGV;
eval "use $package; 1" or die $@;
$package->$function();
```
Note the the first argument of the function will be $package. |
209,110 | <p>In my application I have a number of panes from m_wndspliter classes. What I want to do is at run time show and hide one of these panes. Whilst with the following code I can show and hide the view associated with the pane, I can't temporarily remove the pane itself. </p>
<pre><code>CWnd * pCurView = m_wndSplitter2.... | [
{
"answer_id": 209338,
"author": "SmacL",
"author_id": 22564,
"author_profile": "https://Stackoverflow.com/users/22564",
"pm_score": 1,
"selected": false,
"text": "<p>You need to call CSplitterWnd::DeleteView to do this, which basically means that you have to save your CView elsewhere if... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18664/"
] | In my application I have a number of panes from m\_wndspliter classes. What I want to do is at run time show and hide one of these panes. Whilst with the following code I can show and hide the view associated with the pane, I can't temporarily remove the pane itself.
```
CWnd * pCurView = m_wndSplitter2.GetPane(2, 0)... | Does this help?
<http://www.codeguru.com/cpp/w-d/splitter/article.php/c1543>
I have used something very similar myself, |
209,127 | <p>I'm looking for a plugin for jQuery that can validate as a key is pressed and after it loses focus (text boxes). </p>
<p>I'm currently using <a href="http://www.overset.com/2008/07/31/jval-jquery-form-field-validation-plugin/" rel="nofollow noreferrer">jVal - jQuery Form Field Validation Plugin</a>. It works pretty... | [
{
"answer_id": 209168,
"author": "hasseg",
"author_id": 4111,
"author_profile": "https://Stackoverflow.com/users/4111",
"pm_score": 5,
"selected": true,
"text": "<p>This one looks like it would fit your description:</p>\n\n<ul>\n<li><a href=\"http://bassistance.de/jquery-plugins/jquery-p... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209127",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7617/"
] | I'm looking for a plugin for jQuery that can validate as a key is pressed and after it loses focus (text boxes).
I'm currently using [jVal - jQuery Form Field Validation Plugin](http://www.overset.com/2008/07/31/jval-jquery-form-field-validation-plugin/). It works pretty good. The only issue I have is that I can only... | This one looks like it would fit your description:
* [jQuery plugin:validation (Homepage)](http://bassistance.de/jquery-plugins/jquery-plugin-validation/)
* [demo](http://jquery.bassistance.de/validate/demo/)
* [API docs](http://docs.jquery.com/Plugins/Validation)
Here's a snippet of code copied from the source of th... |
209,132 | <p>How would I assign a variable within scriplet code in JSP <%> and then use struts logic tags to do stuff based on the value of the variable assigned in the scriplet code block?</p>
<p>I have tried using struts:logic equal and greaterthan to no avail....</p>
<p>Many Thanks,</p>
| [
{
"answer_id": 209882,
"author": "myplacedk",
"author_id": 28683,
"author_profile": "https://Stackoverflow.com/users/28683",
"pm_score": 1,
"selected": false,
"text": "<p>What you are trying to do (if I understand you correct) is basically this:</p>\n\n<pre><code><% String foo = \"Tes... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209132",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21004/"
] | How would I assign a variable within scriplet code in JSP <%> and then use struts logic tags to do stuff based on the value of the variable assigned in the scriplet code block?
I have tried using struts:logic equal and greaterthan to no avail....
Many Thanks, | What you are trying to do (if I understand you correct) is basically this:
```
<% String foo = "Test"; %>
<bean:write name="foo" />
```
Which, as you already know, doesn't work. That would give an error like this:
>
> Cannot find bean foo in any scope
>
>
>
What I usually do, is to put my data in the page scop... |
209,133 | <p>We are logging any exceptions that happen in our system by writing the Exception.Message to a file. However, they are written in the culture of the client. And Turkish errors don't mean a lot to me.</p>
<p>So how can we log any error messages in English without changing the users culture?</p>
| [
{
"answer_id": 209222,
"author": "morechilli",
"author_id": 5427,
"author_profile": "https://Stackoverflow.com/users/5427",
"pm_score": 1,
"selected": false,
"text": "<p>I would imagine one of these approaches:</p>\n\n<ol>\n<li><p>The exceptions are only ever read by you, i.e. they are n... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209133",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21679/"
] | We are logging any exceptions that happen in our system by writing the Exception.Message to a file. However, they are written in the culture of the client. And Turkish errors don't mean a lot to me.
So how can we log any error messages in English without changing the users culture? | This issue can be partially worked around. The Framework exception code loads the error messages from its resources, based on the current thread locale. In the case of some exceptions, this happens at the time the Message property is accessed.
For those exceptions, you can obtain the full US English version of the mes... |
209,138 | <p>I need to make a mouseover menu that opens diagonally (from top-left to bottom-right). </p>
| [
{
"answer_id": 209194,
"author": "Chris Marasti-Georg",
"author_id": 96,
"author_profile": "https://Stackoverflow.com/users/96",
"pm_score": 0,
"selected": false,
"text": "<p>Use a Tween to tween the height from 0 to whatever height you want, and width from 0 to whatever width you want.<... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209138",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I need to make a mouseover menu that opens diagonally (from top-left to bottom-right). | Assuming your menu has id "mymenu", try this code to show it:
```
$('#mymenu').animate({width: '80px', height: '200px'})
```
and this code to hide it:
```
$('#mymenu').animate({width: '0px', height: '0px', opacity: 'hide'})
``` |
209,145 | <p>When setting the export path in Unix, example:</p>
<pre><code>export PATH=$PATH: $EC2_HOME/bin
</code></pre>
<p>If I quit terminal and open it back up to continue working, I have to go through all the steps again, setting up the paths each time.
I'm wondering how I can set the path and have it "stick" so my system... | [
{
"answer_id": 209162,
"author": "J.J.",
"author_id": 21204,
"author_profile": "https://Stackoverflow.com/users/21204",
"pm_score": 0,
"selected": false,
"text": "<p>add it to your .bashrc or another .bash startup file.</p>\n"
},
{
"answer_id": 209163,
"author": "Paul Nathan"... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209145",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2293/"
] | When setting the export path in Unix, example:
```
export PATH=$PATH: $EC2_HOME/bin
```
If I quit terminal and open it back up to continue working, I have to go through all the steps again, setting up the paths each time.
I'm wondering how I can set the path and have it "stick" so my system knows where to find every... | Open `~/.bashrc.` This file is loaded every time you start up a new shell (if you're using Bash, which most people are). If you're using a different shell, the file may have a different name, like `~/.shrc`.
Add the line you need to the bottom of the file:
```
export PATH=$PATH:$EC2_HOME/bi
```
Other info rolled up... |
209,148 | <p>What on earth is a caret in the context of a CSplitterWnd class? I can't find any documentation relating explicitly to CSplitterWnds...</p>
<p>EDIT: Specifically, what do these functions <em>actually</em> do:</p>
<pre><code>CWnd * pCurView = m_wndSplitter2.GetPane(2, 0);
pCurView->ShowCaret()
pCurView->HideC... | [
{
"answer_id": 209157,
"author": "TheSmurf",
"author_id": 1975282,
"author_profile": "https://Stackoverflow.com/users/1975282",
"pm_score": 1,
"selected": false,
"text": "<p>It's a caret in the normal sense. Applies only when you're splitting two CEditViews in the same window.</p>\n"
}... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18664/"
] | What on earth is a caret in the context of a CSplitterWnd class? I can't find any documentation relating explicitly to CSplitterWnds...
EDIT: Specifically, what do these functions *actually* do:
```
CWnd * pCurView = m_wndSplitter2.GetPane(2, 0);
pCurView->ShowCaret()
pCurView->HideCaret()
```
EDIT2: Please note, I... | Any CWnd can have a caret, but only CWnd inheritors that CreateCaret first actually display one. @DannySmurf gives you one example - CEditView - of a CView that creates a caret that you can show and hide.
Depending on the specific kind of CView you've got on your pane, ShowCaret is probably irrelevant. It has nothing ... |
209,160 | <p>I want to do something like this :</p>
<pre><code>myYear = record.GetValueOrNull<int?>("myYear"),
</code></pre>
<p>Notice the nullable type as the generic parameter. </p>
<p>Since the <code>GetValueOrNull</code> function could return null my first attempt was this: </p>
<pre><code>public static T GetValueO... | [
{
"answer_id": 209219,
"author": "Greg Dean",
"author_id": 1200558,
"author_profile": "https://Stackoverflow.com/users/1200558",
"pm_score": 9,
"selected": true,
"text": "<p>Change the return type to <code>Nullable<T></code>, and call the method with the non nullable parameter</p>\... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25145/"
] | I want to do something like this :
```
myYear = record.GetValueOrNull<int?>("myYear"),
```
Notice the nullable type as the generic parameter.
Since the `GetValueOrNull` function could return null my first attempt was this:
```
public static T GetValueOrNull<T>(this DbDataRecord reader, string columnName)
where... | Change the return type to `Nullable<T>`, and call the method with the non nullable parameter
```
static void Main(string[] args)
{
int? i = GetValueOrNull<int>(null, string.Empty);
}
public static Nullable<T> GetValueOrNull<T>(DbDataRecord reader, string columnName) where T : struct
{
object columnValue = rea... |
209,192 | <p>I would like to match the time (10.00) from a string with the date and time ("21.01.08 10.00"). I'm using the following regular expression:</p>
<pre><code>new RegExp("\\b[0-9]{1,2}\\.[0-9]{1,2}\\b" "g");
</code></pre>
<p>But this matches 21.01 from 21.01.08 and 10.00.</p>
<p>I'm using PCRE as my regualar expressi... | [
{
"answer_id": 209231,
"author": "Pat",
"author_id": 238,
"author_profile": "https://Stackoverflow.com/users/238",
"pm_score": 0,
"selected": false,
"text": "<p>try using </p>\n\n<pre><code>new RegExp(\"\\\\b[0-9]{1,2}\\\\.[0-9]{1,2}$\" \"g\");\n</code></pre>\n\n<p>$ indicates end of str... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209192",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/948/"
] | I would like to match the time (10.00) from a string with the date and time ("21.01.08 10.00"). I'm using the following regular expression:
```
new RegExp("\\b[0-9]{1,2}\\.[0-9]{1,2}\\b" "g");
```
But this matches 21.01 from 21.01.08 and 10.00.
I'm using PCRE as my regualar expression engine.
Update:
I'm sorry, ... | Your original regex didn't work because `\b` (word boundary) matches at the "." in "21.01.08." You need to code the boundaries more robustly:
```
(?:[^\d:.]|^)(\d\d?[.:]\d\d)(?![.:\d])
```
This captures the time, in either of the notations you used, while excluding dates. Note that it does not validate the time. For... |
209,193 | <p>I am creating a left navigation system utilizing xml and xsl. Everything was been going great until I tried to use a special character in my xml document. I am using <code>&raquo;</code> and I get th error.</p>
<blockquote>
<p>reason: Reference to undefined entity 'raquo'.<br>
error code: -1072898046</p>
</... | [
{
"answer_id": 209214,
"author": "Zxaos",
"author_id": 4924,
"author_profile": "https://Stackoverflow.com/users/4924",
"pm_score": 0,
"selected": false,
"text": "<p>Are you using the » symbol directly or are you defining it as &raquo; ? If you're using the escaped symbol, did you for... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27516/"
] | I am creating a left navigation system utilizing xml and xsl. Everything was been going great until I tried to use a special character in my xml document. I am using `»` and I get th error.
>
> reason: Reference to undefined entity 'raquo'.
>
> error code: -1072898046
>
>
>
How do I make this work? | You are trying to use an [HTML entity](http://en.wikipedia.org/wiki/SGML_entity) in a non-HTML or non-XHTML document. These entities are declared in the document's [Document Type Definition (DTD)](http://en.wikipedia.org/wiki/Document_Type_Definition).
You should use the numerical Unicode version of the [entity refere... |
209,198 | <p>I am using Borland Turbo C++ with some inlined assembler code, so presumably Turbo Assembler (TASM) style assembly code. I wish to do the following:</p>
<pre><code>void foo::bar( void )
{
__asm
{
mov eax, SomeLabel
// ...
}
// ...
SomeLabel:
// ...
}
</code></pre>
<p>So the address ... | [
{
"answer_id": 209341,
"author": "Robert Deml",
"author_id": 9516,
"author_profile": "https://Stackoverflow.com/users/9516",
"pm_score": 1,
"selected": false,
"text": "<p>3 suggestions:</p>\n\n<p>1) put a '_' in front of the SomeLabel in the assembly so it becomes \"mov eax, _SomeLabel\n... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14260/"
] | I am using Borland Turbo C++ with some inlined assembler code, so presumably Turbo Assembler (TASM) style assembly code. I wish to do the following:
```
void foo::bar( void )
{
__asm
{
mov eax, SomeLabel
// ...
}
// ...
SomeLabel:
// ...
}
```
So the address of SomeLabel is placed int... | Last time I tried to make some assembly code Borland-compatible I came across the limitation that you can't forward-reference labels. Not sure if that's what you're running into here. |
209,199 | <p>The <a href="http://msdn.microsoft.com/en-us/library/bb384061.aspx" rel="noreferrer">var</a> keyword does away with the need for an explicit type declaration and I have read with interest the <a href="https://stackoverflow.com/questions/41479/use-of-var-keyword-in-c">SO discussion</a> of when it might be appropriate... | [
{
"answer_id": 209205,
"author": "DOK",
"author_id": 27637,
"author_profile": "https://Stackoverflow.com/users/27637",
"pm_score": 0,
"selected": false,
"text": "<p>I believe that var (and several other new keywords) were added specifically to support Linq.</p>\n\n<p>var is the keyword u... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4200/"
] | The [var](http://msdn.microsoft.com/en-us/library/bb384061.aspx) keyword does away with the need for an explicit type declaration and I have read with interest the [SO discussion](https://stackoverflow.com/questions/41479/use-of-var-keyword-in-c) of when it might be appropriate.
I have also read about (but not used) [... | **Update:** There are two related questions here, actually:
1. Why do I have to declare variables at all?
2. What use is "var" in a language that makes you declare variables?
The answers to (1) are numerous, and can be found elsewhere for this question. My answer to (2) is below:
As other commenters have said, LINQ u... |
209,206 | <p>I currently have a web app that has 3 front ends (depending on what URL you go to) that shares very little code between the 3 front ends. My directory structure looks like this:</p>
<pre><code>\app1
\includes
\html
\app2
\includes
\html
\app3
\includes
\html
\crons
\libs
\logs
\setup
\db... | [
{
"answer_id": 209846,
"author": "Chris MacDonald",
"author_id": 18146,
"author_profile": "https://Stackoverflow.com/users/18146",
"pm_score": 3,
"selected": true,
"text": "<p>What do you mean by 'loading Dojo'?<br>\nIf you mean opening a page with a clean cache, and the site takes a lon... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/204/"
] | I currently have a web app that has 3 front ends (depending on what URL you go to) that shares very little code between the 3 front ends. My directory structure looks like this:
```
\app1
\includes
\html
\app2
\includes
\html
\app3
\includes
\html
\crons
\libs
\logs
\setup
\db
\shared
\... | What do you mean by 'loading Dojo'?
If you mean opening a page with a clean cache, and the site takes a long time to load, then it may be because you're using a non-minified version of the library.
If you mean loading some Dijits, or [a full-featured page](http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/th... |
209,224 | <p>I have to consume 2 different web services. Both contain a definition for a 'user' object. </p>
<p>When I reference the services using "Add service reference" I give each service a unique namespace:</p>
<pre><code>com.xyz.appname.ui.usbo.UserManagement
com.xyz.appname.ui.usbo.AgencyManagement
</code></pre>
<... | [
{
"answer_id": 209263,
"author": "Mark Cidade",
"author_id": 1659,
"author_profile": "https://Stackoverflow.com/users/1659",
"pm_score": 0,
"selected": false,
"text": "<p>You can put the <em>user</em> type in a shared common assembly that both the services and the client project referenc... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209224",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10589/"
] | I have to consume 2 different web services. Both contain a definition for a 'user' object.
When I reference the services using "Add service reference" I give each service a unique namespace:
```
com.xyz.appname.ui.usbo.UserManagement
com.xyz.appname.ui.usbo.AgencyManagement
```
The problem I have is that each ... | What ended up working for me was to provide the svcutil.exe all WSDL addresses that I needed to generate code from. SVCUTIL will look at all the types from each service and determine automatically which ones are common and should be re-used.
The type that you want to be shared should also have a shared namespace, and ... |
209,237 | <p>I know I should be using htmlentities for all my form text input fields but this doesn't work:</p>
<pre><code><?php
echo "<tr>
<td align=\"right\">".Telephone." :</td>
<td><input type=\"text\" name=\"telephone\" size=\"27\"
value=\"htmlentities($row[tele... | [
{
"answer_id": 209246,
"author": "workmad3",
"author_id": 16035,
"author_profile": "https://Stackoverflow.com/users/16035",
"pm_score": 3,
"selected": false,
"text": "<p>try using </p>\n\n<pre><code>value=\\\"\" . htmlentities($row[telephone]) . \"\\\"\n</code></pre>\n\n<p>there. Current... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209237",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I know I should be using htmlentities for all my form text input fields but this doesn't work:
```
<?php
echo "<tr>
<td align=\"right\">".Telephone." :</td>
<td><input type=\"text\" name=\"telephone\" size=\"27\"
value=\"htmlentities($row[telephone])\"> Inc. dialing codes
</td> ... | try using
```
value=\"" . htmlentities($row[telephone]) . "\"
```
there. Currently, your string simply contains the htmlentities string and splices the variable in. You need to get out the string, call the function and put it's result in place, as above. |
209,255 | <p>I've got a unidirectional tree of objects, in which each objects points to its parent. Given an object, I need to obtain its entire subtree of descendants, as a collection of objects. The objects are not actually in any data structure, but I can easily get a collection of all the objects.</p>
<p>The naive approach ... | [
{
"answer_id": 209285,
"author": "Matthias Winkelmann",
"author_id": 4494,
"author_profile": "https://Stackoverflow.com/users/4494",
"pm_score": 0,
"selected": false,
"text": "<p>Your question is a little abstract, but <a href=\"http://mikehillyer.com/articles/managing-hierarchical-data-... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209255",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2819/"
] | I've got a unidirectional tree of objects, in which each objects points to its parent. Given an object, I need to obtain its entire subtree of descendants, as a collection of objects. The objects are not actually in any data structure, but I can easily get a collection of all the objects.
The naive approach is to exam... | As others have mentioned, build a hashtable/map of objects to a list of their (direct) children.
From there you can easily lookup a list of direct children of your "target object", and then for each object in the list, repeat the process.
Here's how I did it in Java and using generics, with a queue instead of any rec... |
209,257 | <p>I getting the following error when I try to connect to my server app using remoting:</p>
<blockquote>
<p><em>A problem seems to have occured whilst connecting to the remote server:<br>
Server encountered an internal error. For more information, turn off customErrors in the server's .config file.</em></p>
</bloc... | [
{
"answer_id": 209278,
"author": "Gulzar Nazim",
"author_id": 4337,
"author_profile": "https://Stackoverflow.com/users/4337",
"pm_score": 6,
"selected": true,
"text": "<p>For .Net 1.0/1.1 , you need a config file for remoting server</p>\n\n<p>If you don't have a <code><ServerEXE>.c... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11989/"
] | I getting the following error when I try to connect to my server app using remoting:
>
> *A problem seems to have occured whilst connecting to the remote server:
>
> Server encountered an internal error. For more information, turn off customErrors in the server's .config file.*
>
>
>
This is the code on my se... | For .Net 1.0/1.1 , you need a config file for remoting server
If you don't have a `<ServerEXE>.config` file, create one and have this in it:
```
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<customErrors mode="off" />
</system.runtime.remoting>
</configuration>
``... |
209,258 | <p>I am trying to use a third party DLL that wants an int** as one of the parameters to the method. It describes the parameter as the address of the pointer that will point to the memory allocation.</p>
<p>Sorry for any confusion. The parameter is two-way I think. The DLL is for talking to an FPGA board and the met... | [
{
"answer_id": 209267,
"author": "Mark Cidade",
"author_id": 1659,
"author_profile": "https://Stackoverflow.com/users/1659",
"pm_score": 4,
"selected": true,
"text": "<p>Use a by-ref <a href=\"http://msdn.microsoft.com/en-us/library/system.intptr.aspx\" rel=\"noreferrer\"><code>System.In... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209258",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1629/"
] | I am trying to use a third party DLL that wants an int\*\* as one of the parameters to the method. It describes the parameter as the address of the pointer that will point to the memory allocation.
Sorry for any confusion. The parameter is two-way I think. The DLL is for talking to an FPGA board and the method is sett... | Use a by-ref [`System.IntPtr`](http://msdn.microsoft.com/en-us/library/system.intptr.aspx).
```
[DllImport("thirdparty.dll")]
static extern long ThirdPartyFunction(ref IntPtr arg);
long f(int[] array)
{ long retval = 0;
int size = Marshal.SizeOf(typeof(int));
var ptr = IntPtr.Zero;
try
... |
209,281 | <p>I am aware that you can lock an object in c# using lock but can you give up the lock and wait for something else to notify you that it's changed like you can in java with wait and notify?</p>
<p>It seems to me that synchronised and lock in java and c# respectively are synonomous.</p>
| [
{
"answer_id": 209290,
"author": "EBGreen",
"author_id": 1358,
"author_profile": "https://Stackoverflow.com/users/1358",
"pm_score": 1,
"selected": false,
"text": "<p>I think Wait Handles may work for you. See if <a href=\"http://msdn.microsoft.com/en-us/library/ms173179.aspx\" rel=\"nof... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209281",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20400/"
] | I am aware that you can lock an object in c# using lock but can you give up the lock and wait for something else to notify you that it's changed like you can in java with wait and notify?
It seems to me that synchronised and lock in java and c# respectively are synonomous. | The equivalent functionality (including the normal locking) is in the [Monitor](http://msdn.microsoft.com/en-us/library/system.threading.monitor.aspx) class.
```
foo.notify() => Monitor.Pulse(foo)
foo.notifyAll() => Monitor.PulseAll(foo)
foo.wait() => Monitor.Wait(foo)
```
The `lock` statement in C# is equivalent ... |
209,301 | <p>How do I post a form from an HTML page to and ASPX page (2.0) and be able to read the values?</p>
<p>I currently have an ASP.NET site using the Membership provider and everything is working fine. Users can log in from the Login.aspx page.</p>
<p>We now want to be able to have users log in directly from another we... | [
{
"answer_id": 209396,
"author": "user8032",
"author_id": 8032,
"author_profile": "https://Stackoverflow.com/users/8032",
"pm_score": 2,
"selected": false,
"text": "<p>Are you sure your HTML form is correct, and does, in fact, do an HTTP POST? I would suggest running <a href=\"http://www... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209301",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | How do I post a form from an HTML page to and ASPX page (2.0) and be able to read the values?
I currently have an ASP.NET site using the Membership provider and everything is working fine. Users can log in from the Login.aspx page.
We now want to be able to have users log in directly from another web site--which is b... | This is *very* possible. I mocked up 3 pages which should give you a proof of concept:
.aspx page:
```
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:TextBox TextMode="password" ID="TextBox2" runat="server"></asp:TextBox>
<asp:Button ID... |
209,320 | <p>I have an activex object I loaded into an html page. I then use that activex object to create another object, but I need to register an event with the new object created. The object is expecting an event listener of a certain type.</p>
<p>I can load this same dll in c# and it will work fine. Code looks like this ... | [
{
"answer_id": 209433,
"author": "Ichorus",
"author_id": 27247,
"author_profile": "https://Stackoverflow.com/users/27247",
"pm_score": 1,
"selected": false,
"text": "<p>The only way I know how to do it reliably is to close the socket. </p>\n"
},
{
"answer_id": 212180,
"autho... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21664/"
] | I have an activex object I loaded into an html page. I then use that activex object to create another object, but I need to register an event with the new object created. The object is expecting an event listener of a certain type.
I can load this same dll in c# and it will work fine. Code looks like this for c#.
```... | Can't you just do a `recvfrom()` into a temporary buffer and discard the buffer? |
209,327 | <p>How should I format URLs with special/international characters?</p>
<p>Currently I try to make URLs "look good", so that: </p>
<pre><code>www.myhost.com/this is a test, do you know how?
</code></pre>
<p>is converted to: </p>
<pre><code>www.myhost.com/this_is_a_test_do_you_know_how
</code></pre>
<p>I know some i... | [
{
"answer_id": 209370,
"author": "JSBձոգչ",
"author_id": 8078,
"author_profile": "https://Stackoverflow.com/users/8078",
"pm_score": 1,
"selected": false,
"text": "<p>What language are you using? PHP includes a function filter_var() that seems to do most of what you want. See <a href=\"h... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209327",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | How should I format URLs with special/international characters?
Currently I try to make URLs "look good", so that:
```
www.myhost.com/this is a test, do you know how?
```
is converted to:
```
www.myhost.com/this_is_a_test_do_you_know_how
```
I know some international letters could be converted (ü = ue, æ = ae,... | What language are you using? PHP includes a function filter\_var() that seems to do most of what you want. See <http://us.php.net/manual/en/function.filter-var.php>.
In general, the cost of making human-readable ASCII strings from arbitrary string input is probably too great to be worth it. If the user gives you a Chi... |
209,335 | <p>I have a chart in a Worksheet in Excel and I have a macro set up so that when I change the value in a certain cell the range of data in the chart is set to <code>A2</code> down as far as the row number corresponding in this certain cell.</p>
<p>What I can't seem to be able to do is to modify the axis as the specifi... | [
{
"answer_id": 209486,
"author": "Dave DuPlantis",
"author_id": 8174,
"author_profile": "https://Stackoverflow.com/users/8174",
"pm_score": 4,
"selected": true,
"text": "<p>You should be able to set the XValues property in the same way you did in Lance's answer for your <a href=\"https:/... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209335",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4014/"
] | I have a chart in a Worksheet in Excel and I have a macro set up so that when I change the value in a certain cell the range of data in the chart is set to `A2` down as far as the row number corresponding in this certain cell.
What I can't seem to be able to do is to modify the axis as the specified axis no longer cov... | You should be able to set the XValues property in the same way you did in Lance's answer for your [other question](https://stackoverflow.com/questions/198045/excel-charts-setting-series-end-dynamically).
```
Charts("chartname").SeriesCollection(1).XValues = "=MYXAXIS"
```
or whatever you call the named range for th... |
209,354 | <p>I am currently developing an approval routing WCF service that will allow an user to create "rules" which determine how an request is routed. The route is determined by comparing the "ObjectToEvaluate" property of the Request class against the "ObjectToEvaluate" property of the "Rule" class. The "UnitOfMeasurement... | [
{
"answer_id": 209393,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 1,
"selected": false,
"text": "<p>Where are you getting the unit of measurement from? I can see the enum, but I don't see any reference to it elsewhere... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26327/"
] | I am currently developing an approval routing WCF service that will allow an user to create "rules" which determine how an request is routed. The route is determined by comparing the "ObjectToEvaluate" property of the Request class against the "ObjectToEvaluate" property of the "Rule" class. The "UnitOfMeasurement" enu... | Use an implicit type operator that checks the value of the enum. That way callers can transparently assign the objects to the types you want to represent them. Eg:
```
public class CastableObject {
private UnitOfMeasurement eUnit; // Assign this somehow
public static implicit operator int(CastableObject obj)... |
209,376 | <p>Is it possible to use SQL Server 2008 CROSS APPLY with LINQ-2-SQL? </p>
<p>Example SQL:</p>
<pre><code>select d.dateCol, tvf.descr, tvf.value
from dateTable d
cross apply tvFunction(d.dt, 'anotherParam') tvf
where d.category='someCat'
</code></pre>
<p>CROSS APPLY enables using values from a table (dateTable in th... | [
{
"answer_id": 212738,
"author": "DamienG",
"author_id": 5720,
"author_profile": "https://Stackoverflow.com/users/5720",
"pm_score": 4,
"selected": true,
"text": "<p>The only way to use it would be to wrap the above code in a stored procedure and wrap it with LINQ to SQL.</p>\n"
},
{... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/224/"
] | Is it possible to use SQL Server 2008 CROSS APPLY with LINQ-2-SQL?
Example SQL:
```
select d.dateCol, tvf.descr, tvf.value
from dateTable d
cross apply tvFunction(d.dt, 'anotherParam') tvf
where d.category='someCat'
```
CROSS APPLY enables using values from a table (dateTable in the example) as parameters to a tab... | The only way to use it would be to wrap the above code in a stored procedure and wrap it with LINQ to SQL. |
209,383 | <p>I have a stored procedure that returns 80 columns, and 300 rows. I want to write a select that gets 2 of those columns. Something like </p>
<pre><code>SELECT col1, col2 FROM EXEC MyStoredProc 'param1', 'param2'
</code></pre>
<p>When I used the above syntax I get the error: </p>
<blockquote>
<p>"Invalid Column... | [
{
"answer_id": 209390,
"author": "Gulzar Nazim",
"author_id": 4337,
"author_profile": "https://Stackoverflow.com/users/4337",
"pm_score": 8,
"selected": false,
"text": "<p>Can you split up the query? Insert the stored proc results into a table variable or a temp table. Then, select the 2... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28281/"
] | I have a stored procedure that returns 80 columns, and 300 rows. I want to write a select that gets 2 of those columns. Something like
```
SELECT col1, col2 FROM EXEC MyStoredProc 'param1', 'param2'
```
When I used the above syntax I get the error:
>
> "Invalid Column Name".
>
>
>
I know the easiest solution... | Can you split up the query? Insert the stored proc results into a table variable or a temp table. Then, select the 2 columns from the table variable.
```
Declare @tablevar table(col1 col1Type,..
insert into @tablevar(col1,..) exec MyStoredProc 'param1', 'param2'
SELECT col1, col2 FROM @tablevar
``` |
209,389 | <p>If I have a string (010) and i want to add 1 to it (011) what value type should i use to convert this string into a number for adding and at the same time preserve the whole number and not 10 + 1 = 11. </p>
| [
{
"answer_id": 209392,
"author": "Omer van Kloeten",
"author_id": 4979,
"author_profile": "https://Stackoverflow.com/users/4979",
"pm_score": 3,
"selected": false,
"text": "<pre><code>if (int.TryParse(str, out i))\n str = (i + 1).ToString(\"000\");\n</code></pre>\n\n<p>HTH.</p>\n\n<p>... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209389",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28647/"
] | If I have a string (010) and i want to add 1 to it (011) what value type should i use to convert this string into a number for adding and at the same time preserve the whole number and not 10 + 1 = 11. | You could use something like this:
```
string initialValue = "010";
int tempValue = Int.Parse(initialValue) + 1;
string newValue = tempValue.ToString("000");
```
You do your math as normal and then just return your string to its previous format using the number formatting feature of the `.ToString()` |
209,403 | <p>i know this doesnt work but i dont know why, also how can i make it work?</p>
<pre><code> <% int result = referer.indexOf("smlMoverDetail.do"); %>
<% if (result == -1){%>
<%out.print("checking");%>
<bean:define id="JOININGDATE" name="smlMoverDetailForm"
property="empFDJoiningDate" type="j... | [
{
"answer_id": 211651,
"author": "myplacedk",
"author_id": 28683,
"author_profile": "https://Stackoverflow.com/users/28683",
"pm_score": 0,
"selected": false,
"text": "<p>It would help a lot if you say what the code actually does. I can see what you are trying to do, but what is actually... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | i know this doesnt work but i dont know why, also how can i make it work?
```
<% int result = referer.indexOf("smlMoverDetail.do"); %>
<% if (result == -1){%>
<%out.print("checking");%>
<bean:define id="JOININGDATE" name="smlMoverDetailForm"
property="empFDJoiningDate" type="java.lang.String" toScope="session"/... | Guess this was just a typing error, but the Equal in
```
<logic:Equal name="result" value = "-1">
```
should actually be
```
<logic:equal name="result" value = "-1">
```
The case could be the reason why the error is occurring.
Of course, it would help if you could tell us what error you are getting. |
209,407 | <p>I am developing a specialty application where the end-user needs to operate multiple controls simultaneously. The application is used to "tune" the control parameters of an electronic device to calibrate the unit to its best performance.</p>
<p>Currently, there is a UI with multiple graphical sliders which the ope... | [
{
"answer_id": 209424,
"author": "theraccoonbear",
"author_id": 7210,
"author_profile": "https://Stackoverflow.com/users/7210",
"pm_score": 3,
"selected": true,
"text": "<p>Maybe capture key presses and define a row of pairs as your up/down controllers.</p>\n\n<p>Something like...</p>\n\... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22329/"
] | I am developing a specialty application where the end-user needs to operate multiple controls simultaneously. The application is used to "tune" the control parameters of an electronic device to calibrate the unit to its best performance.
Currently, there is a UI with multiple graphical sliders which the operator click... | Maybe capture key presses and define a row of pairs as your up/down controllers.
Something like...
```
A/Z are the up/down keys for slider 1
S/X are the up/down keys for slider 2
D/C are the up/down keys for slider 3
F/V are the up/down keys for slider 4
G/B are the up/down keys for slider 5
```
etc...
Or maybe ju... |
209,415 | <p>Some text before the code so that the question summary isn't mangled.</p>
<pre><code>class Tree
{
public event EventHandler MadeSound;
public void Fall() { MadeSound(this, new EventArgs()); }
static void Main(string[] args)
{
Tree oaky = new Tree();
oaky.Fall();
}
}
</code></pr... | [
{
"answer_id": 209437,
"author": "James Curran",
"author_id": 12725,
"author_profile": "https://Stackoverflow.com/users/12725",
"pm_score": 3,
"selected": false,
"text": "<p>Well, the canonical form is:</p>\n\n<pre><code>void OnMadeSound()\n{\n if (MadeSound != null)\n {\n M... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209415",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/82/"
] | Some text before the code so that the question summary isn't mangled.
```
class Tree
{
public event EventHandler MadeSound;
public void Fall() { MadeSound(this, new EventArgs()); }
static void Main(string[] args)
{
Tree oaky = new Tree();
oaky.Fall();
}
}
```
I haven't used even... | You need to understand what your event declaration is actually doing. It's declaring both an event and a variable, When you refer to it within the class, you're just referring to the variable, which will be null when there are no subscribers. |
209,428 | <p>HTML (or maybe just XHTML?) is relatively strict when it comes to non-standard attributes on tags. If they aren't part of the spec, then your code is considered non-compliant.</p>
<p>Non-standard attributes can be fairly useful for passing along meta-data to Javascript however. For instance, if a link is suppose to... | [
{
"answer_id": 209432,
"author": "eyelidlessness",
"author_id": 17964,
"author_profile": "https://Stackoverflow.com/users/17964",
"pm_score": 7,
"selected": true,
"text": "<p>I am a big fan of the proposed HTML 5 solution (<code>data-</code> prefixed attributes). Edit: I'd add that there... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209428",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10093/"
] | HTML (or maybe just XHTML?) is relatively strict when it comes to non-standard attributes on tags. If they aren't part of the spec, then your code is considered non-compliant.
Non-standard attributes can be fairly useful for passing along meta-data to Javascript however. For instance, if a link is suppose to show a po... | I am a big fan of the proposed HTML 5 solution (`data-` prefixed attributes). Edit: I'd add that there are probably better examples for the use of custom attributes. For instance, data that a custom application will use that have no analogue in standard attributes (eg. customization for event handlers based on somethin... |
209,429 | <p>I have installed CherryPy 3.1.0,. Here is what happens when I try to run tutorial 9:</p>
<pre><code>$ cd /Library/Python/2.5/site-packages/cherrypy/tutorial/
$ python tut09_files.py
Traceback (most recent call last):
File "tut09_files.py", line 48, in <module>
from cherrypy.lib import static
ImportError... | [
{
"answer_id": 209432,
"author": "eyelidlessness",
"author_id": 17964,
"author_profile": "https://Stackoverflow.com/users/17964",
"pm_score": 7,
"selected": true,
"text": "<p>I am a big fan of the proposed HTML 5 solution (<code>data-</code> prefixed attributes). Edit: I'd add that there... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/173/"
] | I have installed CherryPy 3.1.0,. Here is what happens when I try to run tutorial 9:
```
$ cd /Library/Python/2.5/site-packages/cherrypy/tutorial/
$ python tut09_files.py
Traceback (most recent call last):
File "tut09_files.py", line 48, in <module>
from cherrypy.lib import static
ImportError: cannot import name... | I am a big fan of the proposed HTML 5 solution (`data-` prefixed attributes). Edit: I'd add that there are probably better examples for the use of custom attributes. For instance, data that a custom application will use that have no analogue in standard attributes (eg. customization for event handlers based on somethin... |
209,478 | <p>Hopefully I haven't misunderstood the meaning of "duck typing", but from what I've read, it means that I should write code based on how an object responds to methods rather than what type/class it is.</p>
<p>Here's the code:</p>
<pre><code>def convert_hash(hash)
if hash.keys.all? { |k| k.is_a?(Integer) }
ret... | [
{
"answer_id": 209532,
"author": "Eli Courtwright",
"author_id": 1694,
"author_profile": "https://Stackoverflow.com/users/1694",
"pm_score": 5,
"selected": true,
"text": "<p>How you write this method should depend on whether you expect an exception to be thrown during the course of norma... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24848/"
] | Hopefully I haven't misunderstood the meaning of "duck typing", but from what I've read, it means that I should write code based on how an object responds to methods rather than what type/class it is.
Here's the code:
```
def convert_hash(hash)
if hash.keys.all? { |k| k.is_a?(Integer) }
return hash
elsif hash... | How you write this method should depend on whether you expect an exception to be thrown during the course of normal program execution. If you want a readable exception message because an end-user might see it, then throwing one manually makes sense. Otherwise, I'd just do something like this:
```
def convert(hash)
... |
209,491 | <p>I have a form using multiple <code><cfinput type="datefield" ...></code>. They are positioned in such a way that the pop-up CSS calendar should appear over the field for others. However, the text fields for the other dates end up in front of the calendar.</p>
<p>This is only an IE issue as Firefox and Safari ... | [
{
"answer_id": 209696,
"author": "Ben Doom",
"author_id": 12267,
"author_profile": "https://Stackoverflow.com/users/12267",
"pm_score": 0,
"selected": false,
"text": "<p>My first inclination is to attempt to add a style for the text fields with a negative z-index. Alternately, you could... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21960/"
] | I have a form using multiple `<cfinput type="datefield" ...>`. They are positioned in such a way that the pop-up CSS calendar should appear over the field for others. However, the text fields for the other dates end up in front of the calendar.
This is only an IE issue as Firefox and Safari work just fine.
Is there a... | Well, you have to encapsulate your datefield wirhin a div with both position:relative and Z-index value, as in :
```
<div style="position:relative; z-index:3">
<cfinput type="dateField" name="info_dateDebutPub" value="#dateformat(info_dateDebutPub,'dd/mm/yy')#" mask="dd/mm/yy">
</div>
```
Defining Z-index within the... |
209,495 | <p>I am looking for a concise way to check a value to see if it is nil or zero. Currently I am doing something like:</p>
<pre><code>if (!val || val == 0)
# Is nil or zero
end
</code></pre>
<p>But this seems very clumsy.</p>
| [
{
"answer_id": 209522,
"author": "unwind",
"author_id": 28169,
"author_profile": "https://Stackoverflow.com/users/28169",
"pm_score": 2,
"selected": false,
"text": "<p>I believe your code is incorrect; it will in fact test for three values: <code>nil</code>, <strong><code>false</code></s... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19839/"
] | I am looking for a concise way to check a value to see if it is nil or zero. Currently I am doing something like:
```
if (!val || val == 0)
# Is nil or zero
end
```
But this seems very clumsy. | Objects have a [*nil?* method](http://ruby-doc.org/core/Object.html#method-i-nil-3F).
```
if val.nil? || val == 0
[do something]
end
```
Or, for just one instruction:
```
[do something] if val.nil? || val == 0
``` |
209,513 | <p>How do I convert a hex string to an integer?</p>
<pre><code>"0xffff" ⟶ 65535
"ffff" ⟶ 65535
</code></pre>
| [
{
"answer_id": 209529,
"author": "unwind",
"author_id": 28169,
"author_profile": "https://Stackoverflow.com/users/28169",
"pm_score": 8,
"selected": false,
"text": "<p><code>int(hexstring, 16)</code> does the trick, and works with and without the 0x prefix:</p>\n<pre><code>>>> i... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209513",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17693/"
] | How do I convert a hex string to an integer?
```
"0xffff" ⟶ 65535
"ffff" ⟶ 65535
``` | **Without** the `0x` prefix, you need to specify the base explicitly, otherwise there's no way to tell:
```
x = int("deadbeef", 16)
```
**With** the `0x` prefix, Python can distinguish hex and decimal automatically:
```
>>> print(int("0xdeadbeef", 0))
3735928559
>>> print(int("10", 0))
10
```
(You *must* specify ... |
209,528 | <p>How would I drag and drop something into a static control? It looks like I need to create a sub class of COleDropTarget and include that as a member variable in a custom CStatic. That doesn't appear to be working though. When I try and drag something onto the Static control I get the drop denied cursor.</p>
| [
{
"answer_id": 209870,
"author": "ChrisN",
"author_id": 3853,
"author_profile": "https://Stackoverflow.com/users/3853",
"pm_score": 3,
"selected": true,
"text": "<p>The static control's <code>m_hWnd</code> must be valid when you call <code>COleDropTarget::Register</code>, which is why it... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209528",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6701/"
] | How would I drag and drop something into a static control? It looks like I need to create a sub class of COleDropTarget and include that as a member variable in a custom CStatic. That doesn't appear to be working though. When I try and drag something onto the Static control I get the drop denied cursor. | The static control's `m_hWnd` must be valid when you call `COleDropTarget::Register`, which is why it doesn't work from within your `CMyStatic` constructor. What you can do is override `CWnd::PreSubclassWindow` within your `CMyStatic` class:
```
class CMyStatic : public CStatic {
...
virtual void PreSubclassWi... |
209,554 | <p>I'm seeing this exception message coming from XslCompiledTransform.Transform(), but after handling the exception the XSL transform still appears to have been successful. The full exception message is:</p>
<blockquote>
<p>Token Text in state EndRootElement
would result in an invalid XML
document. Make sure tha... | [
{
"answer_id": 209697,
"author": "ddaa",
"author_id": 11549,
"author_profile": "https://Stackoverflow.com/users/11549",
"pm_score": 0,
"selected": false,
"text": "<p>Your output does constitute a well-formed XML fragment. In other words, it looks okay and so does your XSLT.</p>\n\n<p>It ... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5548/"
] | I'm seeing this exception message coming from XslCompiledTransform.Transform(), but after handling the exception the XSL transform still appears to have been successful. The full exception message is:
>
> Token Text in state EndRootElement
> would result in an invalid XML
> document. Make sure that the
> Conforman... | The exception is trying to tell you that you have attempted to output text after the close element of the root element. The reason your output looks ok is that the exception *prevented* the invalid XML from being generated.
The reason is simple: you don't have a transform for the root of the document. Therefore, the d... |
209,558 | <p>I'm attempting to put together some basic report screens. I've got some fairly complicated SQL queries that I'm feeding into ActiveRecord's find_by_sql method. The problem I am having here is that I am losing the order of the columns as given in the original query. I'm assuming that this is because the Hash class... | [
{
"answer_id": 209750,
"author": "Mike Deck",
"author_id": 1247,
"author_profile": "https://Stackoverflow.com/users/1247",
"pm_score": 0,
"selected": false,
"text": "<p>How are you creating these \"report screens\"? Are they erb templates? Are you just calling .each on columns to print... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23513/"
] | I'm attempting to put together some basic report screens. I've got some fairly complicated SQL queries that I'm feeding into ActiveRecord's find\_by\_sql method. The problem I am having here is that I am losing the order of the columns as given in the original query. I'm assuming that this is because the Hash class doe... | You're correct in that the Ruby Hash does not preserve order. That's part of the point, really - you access it using the key.
I assume your query is written to deliver the columns in the order that you want to output them and you were hoping to output the values via a loop? Seems like a decent enough idea, but I can't... |
209,595 | <p>I want to make a deep copy of a LINQ to XML XElement. The reason I want to do this is there are some nodes in the document that I want to create modified copies of (in the same document). I don't see a method to do this.</p>
<p>I could convert the element to an XML string and then reparse it, but I'm wondering if... | [
{
"answer_id": 209613,
"author": "JaredPar",
"author_id": 23283,
"author_profile": "https://Stackoverflow.com/users/23283",
"pm_score": -1,
"selected": false,
"text": "<p>I do not believe there is an existing mechanism that allows you to perform a deep copy of an XNode style tree. I thi... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1509/"
] | I want to make a deep copy of a LINQ to XML XElement. The reason I want to do this is there are some nodes in the document that I want to create modified copies of (in the same document). I don't see a method to do this.
I could convert the element to an XML string and then reparse it, but I'm wondering if there's a b... | There is no need to reparse. One of the constructors of XElement takes another XElement and makes a deep copy of it:
```
XElement original = new XElement("original");
XElement deepCopy = new XElement(original);
```
Here are a couple of unit tests to demonstrate:
```
[TestMethod]
public void XElementShallowCopyShoul... |
209,603 | <p>What are the easiest steps to make a small circuit with an LED flash from a C/C++ program?</p>
<p>I would prefer the least number of dependencies and packages needed. </p>
<ul>
<li>What port would I connect something into?</li>
<li>Which compiler would I use?</li>
<li>How do I send data to that port?</li>
<li>Do I... | [
{
"answer_id": 209649,
"author": "nobody",
"author_id": 19405,
"author_profile": "https://Stackoverflow.com/users/19405",
"pm_score": 0,
"selected": false,
"text": "<p>It also depends on the OS. On Linux, you could wire an LED directly to the parallel port (with an appropriate current-li... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209603",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3153/"
] | What are the easiest steps to make a small circuit with an LED flash from a C/C++ program?
I would prefer the least number of dependencies and packages needed.
* What port would I connect something into?
* Which compiler would I use?
* How do I send data to that port?
* Do I need to have a micro-processor? If not I ... | Here's a tutorial on doing it with a [parallel port](http://ashishrd.blogspot.com/2006/11/controlling-leds-with-parallel-port.html).
Though I would recommend an [Arduino](http://www.arduino.cc) which can be purchased very cheaply and would only involve the following code:
```
/* Blinking LED
* ------------
*
* tu... |
209,615 | <p>Using the following query:</p>
<pre><code> SELECT pe.prodtree_element_name_l, MAX(rs.resource_value) AS resource_value
FROM prodtree_element pe
LEFT JOIN resource_shortstrings rs
ON pe.prodtree_element_name_l_rk = rs.resource_key
WHERE rs.language_id = '5'
AND pe.prodtree_element_name... | [
{
"answer_id": 209623,
"author": "Dave Markle",
"author_id": 24995,
"author_profile": "https://Stackoverflow.com/users/24995",
"pm_score": 0,
"selected": false,
"text": "<pre><code> SELECT pe.prodtree_element_name_l, MAX(CAST(rs.resource_value AS NVARCHAR(MAX))) AS resource_value\n F... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16631/"
] | Using the following query:
```
SELECT pe.prodtree_element_name_l, MAX(rs.resource_value) AS resource_value
FROM prodtree_element pe
LEFT JOIN resource_shortstrings rs
ON pe.prodtree_element_name_l_rk = rs.resource_key
WHERE rs.language_id = '5'
AND pe.prodtree_element_name_l <> ''
G... | This will get the first random entry
```
SELECT DISTINCT
pe.prodtree_element_name_l,
(SELECT TOP 1 rs2.resource_value
FROM resource_shortstrings rs2
WHERE rs2.language_id = '5'
AND rs2.resource_key = pe.prodtree_element_name_l_rk) AS "resource_value"
FROM prodtree_element pe
LEFT JOIN resource... |
209,657 | <p>I have a footer that is a 1 x 70px, which is set as the background and tiles horizonally.</p>
<p>In cases when the web page does not contain a lot of content on it, it will display the footer above where the footer should be. I want it to fill in with a solid color, so if they scroll down, it won't show the footer,... | [
{
"answer_id": 209664,
"author": "Mitchel Sellers",
"author_id": 13279,
"author_profile": "https://Stackoverflow.com/users/13279",
"pm_score": 0,
"selected": false,
"text": "<p>You can use </p>\n\n<pre><code>position:absolute;\nbottom: 0;\n</code></pre>\n\n<p>to put the footer at the bot... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26130/"
] | I have a footer that is a 1 x 70px, which is set as the background and tiles horizonally.
In cases when the web page does not contain a lot of content on it, it will display the footer above where the footer should be. I want it to fill in with a solid color, so if they scroll down, it won't show the footer, then the ... | Please clarify - do you want solid green at the bottom? If so, just set a green background for body...
```
body {
background-color:#060;
}
```
That should give you the result in your second screenshot. Change the color to match the bottom of your gradient image.
If you want the foot pegged to the bottom, use th... |
209,686 | <p>I've often had to load multiple items to a particular record in the database. For example: a web page displays items to include for a single report, all of which are records in the database (Report is a record in the Report table, Items are records in Item table). A user is selecting items to include in a single rep... | [
{
"answer_id": 209703,
"author": "Kev",
"author_id": 419,
"author_profile": "https://Stackoverflow.com/users/419",
"pm_score": 3,
"selected": false,
"text": "<p>You either do what you've already got, pass in a delimited string and then parse out to a table value, or the other choice is p... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27908/"
] | I've often had to load multiple items to a particular record in the database. For example: a web page displays items to include for a single report, all of which are records in the database (Report is a record in the Report table, Items are records in Item table). A user is selecting items to include in a single report... | If going to SQL Server 2008 is an option for you, there's a new feature called "Table-valued parameters" to solve this exact problem.
Check out more details on TVP [here](http://blog.benhall.me.uk/2007/07/sql-server-2008-table-value-parameters.html) and [here](http://www.mssqltips.com/tip.asp?tip=1483) or just ask Goo... |
209,687 | <p>I'm trying to order items based on an attribute value:</p>
<pre><code><xsl:apply-templates select="Question">
<xsl:sort order="ascending" select="@Value"></xsl:sort>
</xsl:apply-templates>
</code></pre>
<p>This does order them, but I could have values like 1,2,3, ... 10, 11, ... 20 and ... | [
{
"answer_id": 209700,
"author": "Greg Hewgill",
"author_id": 893,
"author_profile": "https://Stackoverflow.com/users/893",
"pm_score": 2,
"selected": false,
"text": "<p>You can sort in numeric order using the <a href=\"http://www.w3.org/TR/xslt#sorting\" rel=\"nofollow noreferrer\"><cod... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209687",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9266/"
] | I'm trying to order items based on an attribute value:
```
<xsl:apply-templates select="Question">
<xsl:sort order="ascending" select="@Value"></xsl:sort>
</xsl:apply-templates>
```
This does order them, but I could have values like 1,2,3, ... 10, 11, ... 20 and it will order them 1,10,11, ... 2,20... 3. etc.
... | If you know that every question has a multi-part number, you could handle them with two `<xsl:sort>` instructions:
```
<xsl:apply-templates select="Question">
<xsl:sort select="substring-before(@Value, '.')" data-type="number" />
<xsl:sort select="substring-after(@Value, '.')" />
</xsl:apply-templates>
```
If so... |
209,721 | <p>I'm doing a personal organizer for learning purposes, and i've never worked with XML so i'm not sure if my solution is the best. Here's the basic structure for the XML file i came with:</p>
<pre><code><calendar>
<year value="2008">
<month value="october">
<day value="16"... | [
{
"answer_id": 209733,
"author": "Adam V",
"author_id": 517,
"author_profile": "https://Stackoverflow.com/users/517",
"pm_score": 3,
"selected": true,
"text": "<p>Your way is quite adequate to me. However, I prefer child tags to attributes, so my way would be more like:</p>\n\n<pre><code... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27090/"
] | I'm doing a personal organizer for learning purposes, and i've never worked with XML so i'm not sure if my solution is the best. Here's the basic structure for the XML file i came with:
```
<calendar>
<year value="2008">
<month value="october">
<day value="16">
<activity name="m... | Your way is quite adequate to me. However, I prefer child tags to attributes, so my way would be more like:
```
<activity>
<name>Mike's Birthday</name>
<time>2100</time>
<address>Mike's Place</address>
<urgency>10</urgency>
<description>activity description</description>
</activity>
```
But like I said, yo... |
209,731 | <p>First of all, using gnome is not an option (but it is possible to install its libraries).</p>
<p>I need to know what is necessary to display a Java Swing desktop application using the current installed KDE look and feel of KDE. Ideally, the solution should allow me to apply a look and feel that looks like the under... | [
{
"answer_id": 211004,
"author": "Marcus Tik",
"author_id": 23450,
"author_profile": "https://Stackoverflow.com/users/23450",
"pm_score": 0,
"selected": false,
"text": "<p>maybe this works:</p>\n\n<pre><code>try {\n// sure look and feel\nUIManager.setLookAndFeel(\"com.sun.java.swing.plaf... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24165/"
] | First of all, using gnome is not an option (but it is possible to install its libraries).
I need to know what is necessary to display a Java Swing desktop application using the current installed KDE look and feel of KDE. Ideally, the solution should allow me to apply a look and feel that looks like the underlying wind... | You can set the look and feel from the command line:
java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel MyApp
Also, [SwingSet2.jnlp](http://java.sun.com/products/jfc/jws/SwingSet2.jnlp) provides a sample demo of all the different things that can be changed. The source and other info can be found here:... |
209,732 | <p>I have code similar to this filtering entries in an Array of Objects:</p>
<pre><code>var filterRegex = new RegExp(".*blah.*","ig");
if (filterRegex.test(events[i].thing) && events[i].show) {
console.log("SUCCESS: filtering thing " + i + " " + events[i].thing);
events[i].show = false;
numevents--... | [
{
"answer_id": 209817,
"author": "Tomalak",
"author_id": 18771,
"author_profile": "https://Stackoverflow.com/users/18771",
"pm_score": 0,
"selected": false,
"text": "<p>I just can't imagine there is any situation where two JavaScript expressions evaluate to true individually, but not whe... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25066/"
] | I have code similar to this filtering entries in an Array of Objects:
```
var filterRegex = new RegExp(".*blah.*","ig");
if (filterRegex.test(events[i].thing) && events[i].show) {
console.log("SUCCESS: filtering thing " + i + " " + events[i].thing);
events[i].show = false;
numevents--;
}
```
I get incons... | Ok, i see it now. The key to your problem is the use of the `g` (global match) flag: when this is specified for a regex, it will be set up such that it can be executed multiple times, beginning each time at the place where it left off last time. It keeps a "bookmark" of sorts in its `lastIndex` property:
```
var testR... |
209,738 | <p>I need that my Apache require authentication only to external access but free in my local network. I have mod_user in my Apache.</p>
| [
{
"answer_id": 209783,
"author": "fmsf",
"author_id": 26004,
"author_profile": "https://Stackoverflow.com/users/26004",
"pm_score": 1,
"selected": false,
"text": "<p>Not much into apache authentication, i just use tomcat from time to time to test some jsp.</p>\n\n<p>Have you tried readin... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I need that my Apache require authentication only to external access but free in my local network. I have mod\_user in my Apache. | The ***easiest*** way to deal with this is to use two virtual host. Use one for the external users and one of the internal users... i.e. "www.myhost.com" for external and "www-int.myhome.com" for internal users. Restrict www-int to internal IP's only with no auth requirements.
Alternatively, you can use something like... |
209,753 | <p>I have an error handling method in my ApplicationController:</p>
<pre><code>rescue_from ActiveRecord::RecordNotFound, :with => :not_found
def not_found(exception)
@exception = exception
render :template => '/errors/not_found', :status => 404
end
</code></pre>
<p>In <code>RAILS_ROOT/app/views/errors/n... | [
{
"answer_id": 209792,
"author": "Avdi",
"author_id": 20487,
"author_profile": "https://Stackoverflow.com/users/20487",
"pm_score": 4,
"selected": true,
"text": "<p>That's odd, and I don't know why. As an alternative, have you tried passing the exception as an explicit local?</p>\n\n<pr... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1190/"
] | I have an error handling method in my ApplicationController:
```
rescue_from ActiveRecord::RecordNotFound, :with => :not_found
def not_found(exception)
@exception = exception
render :template => '/errors/not_found', :status => 404
end
```
In `RAILS_ROOT/app/views/errors/not_found.html.erb`, I have this:
```
<h... | That's odd, and I don't know why. As an alternative, have you tried passing the exception as an explicit local?
```
def not_found(exception)
render :template => '/errors/not_found',
:status => 404,
:locals => {:exception => exception}
end
```
and the view:
```
<h1>Error 404: Not Found</h1>... |
209,754 | <p>We have a sitemap for our site <a href="http://www.appsamuck.com/" rel="nofollow noreferrer">http://www.appsamuck.com/</a></p>
<p>The sitemap is here <a href="http://www.appsamuck.com/sitemap.xml" rel="nofollow noreferrer">http://www.appsamuck.com/sitemap.xml</a></p>
<p>But Google seems to hate it. My question is ... | [
{
"answer_id": 209767,
"author": "Diodeus - James MacFarlane",
"author_id": 12579,
"author_profile": "https://Stackoverflow.com/users/12579",
"pm_score": -1,
"selected": false,
"text": "<p>I've encountered similar problems. Just resubmit the same map. Often the warnings go away.</p>\n\n<... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209754",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23294/"
] | We have a sitemap for our site <http://www.appsamuck.com/>
The sitemap is here <http://www.appsamuck.com/sitemap.xml>
But Google seems to hate it. My question is why? I'm just staring at it now saying to myself it looks right. Am I missing something?
3 Paths don't match
We've detected that you submitted your Sitemap... | I just typed a huge response and FF crashed and I lost it I hate it when that happens!!
Basically its possible to have two sites with different content, one running under www. and one without the www a bit like a subdomain. Because of this when you submitted your sitemap google sees its on the www site (<http://www.ap... |
209,779 | <p>I am developing a wizard for a machine that is to be used as a backup of other machines. When it replaces an existing machine, it needs to set its IP address, DNS, WINS, and host name to match the machine being replaced.</p>
<p>Is there a library in .net (C#) which allows me to do this programatically?</p>
<p>The... | [
{
"answer_id": 209983,
"author": "balexandre",
"author_id": 28004,
"author_profile": "https://Stackoverflow.com/users/28004",
"pm_score": 7,
"selected": true,
"text": "<p>Just made this in a few minutes:</p>\n\n<pre><code>using System;\nusing System.Management;\n\nnamespace WindowsFormsA... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10119/"
] | I am developing a wizard for a machine that is to be used as a backup of other machines. When it replaces an existing machine, it needs to set its IP address, DNS, WINS, and host name to match the machine being replaced.
Is there a library in .net (C#) which allows me to do this programatically?
There are multiple NI... | Just made this in a few minutes:
```
using System;
using System.Management;
namespace WindowsFormsApplication_CS
{
class NetworkManagement
{
public void setIP(string ip_address, string subnet_mask)
{
ManagementClass objMC =
new ManagementClass("Win32_NetworkAdapterConfiguration");
Mana... |
209,786 | <p><strong>Summary</strong></p>
<p>We have a central LDAP server that our deployed Java web app should connect to. Our JUnit tests depend on specific data in the LDAP repository, so they need to connect to an embedded ApacheDS LDAP server, primed with a sample data set. How do we make sure that the ApacheDS server d... | [
{
"answer_id": 210148,
"author": "Spencer Kormos",
"author_id": 8528,
"author_profile": "https://Stackoverflow.com/users/8528",
"pm_score": 1,
"selected": false,
"text": "<p>If you're using Maven, why not use the Assembly plugin to manage your environment deployments. It seems like your... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209786",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8217/"
] | **Summary**
We have a central LDAP server that our deployed Java web app should connect to. Our JUnit tests depend on specific data in the LDAP repository, so they need to connect to an embedded ApacheDS LDAP server, primed with a sample data set. How do we make sure that the ApacheDS server doesn't start up when we d... | If you're using Maven, why not use the Assembly plugin to manage your environment deployments. It seems like your spring file is not that complex, so you can have a common spring file which doesn't have the ldap-context.xml reference, and then a test-specific version which does have the ldap reference. When assembly is... |
209,787 | <p>In the following one to many</p>
<pre><code>CREATE TABLE source(id int, name varchar(10), PRIMARY KEY(id));
CREATE TABLE params(id int, source int, value int);
</code></pre>
<p>where params.source is a foreign key to source.id</p>
<pre><code>INSERT INTO source values(1, 'yes');
INSERT INTO source values(2, 'no');... | [
{
"answer_id": 209819,
"author": "Lasse V. Karlsen",
"author_id": 267,
"author_profile": "https://Stackoverflow.com/users/267",
"pm_score": 4,
"selected": true,
"text": "<p><strong>Edit</strong> Modified to handle case where there can be multiple occurances of the value for a given sourc... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209787",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | In the following one to many
```
CREATE TABLE source(id int, name varchar(10), PRIMARY KEY(id));
CREATE TABLE params(id int, source int, value int);
```
where params.source is a foreign key to source.id
```
INSERT INTO source values(1, 'yes');
INSERT INTO source values(2, 'no');
INSERT INTO params VALUES(1,1,1);
I... | **Edit** Modified to handle case where there can be multiple occurances of the value for a given source.
Try this:
```
SELECT
*
FROM
source
WHERE
(
SELECT COUNT(DISTINCT value)
FROM params
WHERE params.source = source.id
AND params.value IN (1, 2, 3)
) = 3
```
You c... |
209,789 | <p>Is there a way to start an instance of eclipse, passing it some sort of parameter telling it to use a specific workspace?</p>
<p>The problem I'm trying to solve is that I have a workspace for work projects and one for personal projects. I'd like to be able to tie these to workspaces to separate shortcuts that I cou... | [
{
"answer_id": 209794,
"author": "Matt H",
"author_id": 18049,
"author_profile": "https://Stackoverflow.com/users/18049",
"pm_score": 9,
"selected": true,
"text": "<p>From <a href=\"http://help.eclipse.org/help21/topic/org.eclipse.platform.doc.user/tasks/running_eclipse.htm\" rel=\"noref... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209789",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5291/"
] | Is there a way to start an instance of eclipse, passing it some sort of parameter telling it to use a specific workspace?
The problem I'm trying to solve is that I have a workspace for work projects and one for personal projects. I'd like to be able to tie these to workspaces to separate shortcuts that I could launch ... | From <http://help.eclipse.org/help21/topic/org.eclipse.platform.doc.user/tasks/running_eclipse.htm>:
Use the following command-line argument:
```
-data your_workspace_location
```
For example,
```
-data c:\users\robert\myworkspace
```
you can also use UNIX-style relative path names such as
```
-data ../workspa... |
209,790 | <p>I would like to have the same editor available on all of the platforms I frequent.</p>
<p>Emacs and Vi are not desired solutions.</p>
| [
{
"answer_id": 209794,
"author": "Matt H",
"author_id": 18049,
"author_profile": "https://Stackoverflow.com/users/18049",
"pm_score": 9,
"selected": true,
"text": "<p>From <a href=\"http://help.eclipse.org/help21/topic/org.eclipse.platform.doc.user/tasks/running_eclipse.htm\" rel=\"noref... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7734/"
] | I would like to have the same editor available on all of the platforms I frequent.
Emacs and Vi are not desired solutions. | From <http://help.eclipse.org/help21/topic/org.eclipse.platform.doc.user/tasks/running_eclipse.htm>:
Use the following command-line argument:
```
-data your_workspace_location
```
For example,
```
-data c:\users\robert\myworkspace
```
you can also use UNIX-style relative path names such as
```
-data ../workspa... |