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 |
|---|---|---|---|---|---|---|
435,023 | <p>Spring: In my context.xml, I have:</p>
<pre><code><util:set id="someIDs"
set-class="java.util.HashSet"
value-type="java.lang.String">
<value>"W000000001"</value>
<value>"W000000003"</value>
<value>"W000000009"</value>
</uti... | [
{
"answer_id": 435029,
"author": "Andrzej Doyle",
"author_id": 45664,
"author_profile": "https://Stackoverflow.com/users/45664",
"pm_score": 3,
"selected": true,
"text": "<p>Off the top of my head - I'm pretty sure that Spring doesn't require double quotes for String data. So it's proba... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Spring: In my context.xml, I have:
```
<util:set id="someIDs"
set-class="java.util.HashSet"
value-type="java.lang.String">
<value>"W000000001"</value>
<value>"W000000003"</value>
<value>"W000000009"</value>
</util:set>
```
In my Java bean, the implementation is:
```
... | Off the top of my head - I'm pretty sure that Spring doesn't require double quotes for String data. So it's probably inserting those strings into the map with actual double-quote characters at the start and the end.
Try checking
```
boolean found = someSet.contains("\"W000000009\"");
```
to see if this is the case. |
435,025 | <p>I have to buil a rather complex WPF UI (a hughe Grid) in code (no xaml invloved). Is there a way to stop the main UI thread from blocking while beeing in the process of building the Grid? Are there some portions of building the UI that can be outsourced to a workerthread? What parts of UI creation actually have to b... | [
{
"answer_id": 435070,
"author": "Kent Boogaart",
"author_id": 5380,
"author_profile": "https://Stackoverflow.com/users/5380",
"pm_score": 3,
"selected": true,
"text": "<p>If you can break the construction of your UI up into steps, you can do each of these steps as a separate message. Th... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435025",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4227/"
] | I have to buil a rather complex WPF UI (a hughe Grid) in code (no xaml invloved). Is there a way to stop the main UI thread from blocking while beeing in the process of building the Grid? Are there some portions of building the UI that can be outsourced to a workerthread? What parts of UI creation actually have to be o... | If you can break the construction of your UI up into steps, you can do each of these steps as a separate message. This will allow other messages to be processed in between. Something like:
```
private delegate void BuildHandler();
private void BuildGridPart1()
{
//build first part of grid
Dispatcher.BeginInv... |
435,028 | <p>I need to use the current library name explicitly in a CL program.</p>
<pre><code>CHGVAR &LIB *CURLIB
</code></pre>
<p>doesn't work (after this line &lib = '*curlib'). This should be simple - any ideas?</p>
| [
{
"answer_id": 435047,
"author": "nearly_lunchtime",
"author_id": 23447,
"author_profile": "https://Stackoverflow.com/users/23447",
"pm_score": 4,
"selected": true,
"text": "<p>Found it:</p>\n\n<p>RTVJOBA CURLIB(&LIB)</p>\n"
},
{
"answer_id": 522792,
"author": "David",
... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435028",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23447/"
] | I need to use the current library name explicitly in a CL program.
```
CHGVAR &LIB *CURLIB
```
doesn't work (after this line &lib = '\*curlib'). This should be simple - any ideas? | Found it:
RTVJOBA CURLIB(&LIB) |
435,035 | <pre><code> PS C:\Projects>
get-childitem -recurse
| where { $_.Extension -eq ".csproj" }
| foreach { Get-Content $_.FullName
| foreach { $_.Length } }
</code></pre>
<p>This prints the line size of every line in a csproj (pretty pointless true). How can I also output a outer variable (so to ... | [
{
"answer_id": 435256,
"author": "Shay Levy",
"author_id": 9833,
"author_profile": "https://Stackoverflow.com/users/9833",
"pm_score": 0,
"selected": false,
"text": "<pre><code>get-childitem -recurse -filter *.csproj | select @{n=\"FileName\";e={$_.FullName}},@{n=\"Lines\";e={ $(cat $_.F... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435035",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | ```
PS C:\Projects>
get-childitem -recurse
| where { $_.Extension -eq ".csproj" }
| foreach { Get-Content $_.FullName
| foreach { $_.Length } }
```
This prints the line size of every line in a csproj (pretty pointless true). How can I also output a outer variable (so to speak) when I've dived... | This the straightforward way:
```
`gci . -r "*.csproj" | % { $name = $_.name; gc $_.fullname |
% { $name + ": " + $_.length } }`
```
If you don't yet know the abbreviations, that is equivalent to:
```
`Get-ChildItem . -recurse "*.csproj" |
foreach { $name = $_.name; Get-Content $_.fullname |
... |
435,044 | <p>I have a regular form with a url as action to which the form submits when the submit button is clicked (or enter is pushed).<br>
Now I need a second button that goes to another page. I know I should be using a link for this, but as to client's requirements, it should look like a button.<br>
Because the CSS sheets ar... | [
{
"answer_id": 435051,
"author": "aivarsak",
"author_id": 53698,
"author_profile": "https://Stackoverflow.com/users/53698",
"pm_score": 0,
"selected": false,
"text": "<pre><code><input type=\"button\" onclick=\"document.location='my_other_link'\" value=\"Click here\"/>\n</code></pr... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435044",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11333/"
] | I have a regular form with a url as action to which the form submits when the submit button is clicked (or enter is pushed).
Now I need a second button that goes to another page. I know I should be using a link for this, but as to client's requirements, it should look like a button.
Because the CSS sheets are not... | The only way to do this without using JavaScript is to have the second button inside a second form, whose action is the desired destination. You may be able to use CSS to position this second button 'inside' the first form. |
435,049 | <p>I would like to have a function that modifies some variable list of parameters but they are all value types (int, string). There is a way to make the params keyword work with ref keyword or something close to that?</p>
<pre><code>public void funcParams(params object[] list)
{
/* Make something here to change 'a'... | [
{
"answer_id": 435053,
"author": "mmx",
"author_id": 33708,
"author_profile": "https://Stackoverflow.com/users/33708",
"pm_score": 2,
"selected": false,
"text": "<p>No, it's not possible with a neat syntax. The reason is, internally, the runtime treats the method as a simple method takin... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435049",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18623/"
] | I would like to have a function that modifies some variable list of parameters but they are all value types (int, string). There is a way to make the params keyword work with ref keyword or something close to that?
```
public void funcParams(params object[] list)
{
/* Make something here to change 'a', 'b' and 'c' ... | Yes. It is possible.
However, the resulting code is "unsafe" which makes it unverifiable.
That may or may not be an issue depending on your requirements.
In any case, here is the code:
```
using System;
namespace unsafeTest
{
class MainClass
{
public static void Main(string[] args)
{
... |
435,050 | <p>What would the preferred way of programmatically determining which the currently installed version of Microsoft Internet Information Services (IIS) is?</p>
<p>I know that it can be found by looking at the MajorVersion key in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters. </p>
<p>Would this ... | [
{
"answer_id": 435059,
"author": "Spencer Ruport",
"author_id": 52551,
"author_profile": "https://Stackoverflow.com/users/52551",
"pm_score": 2,
"selected": true,
"text": "<p>You could build a WebRequest and send it to port 80 on a loopback IP address and get the Server HTTP header.</p>\... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435050",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19220/"
] | What would the preferred way of programmatically determining which the currently installed version of Microsoft Internet Information Services (IIS) is?
I know that it can be found by looking at the MajorVersion key in HKEY\_LOCAL\_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters.
Would this be the *recomme... | You could build a WebRequest and send it to port 80 on a loopback IP address and get the Server HTTP header.
```
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create("http://127.0.0.1/");
HttpWebResponse myHttpWebResponse = null;
try
{
myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetRespons... |
435,069 | <p>I want to use java.util.ConcurrentLinkedQueue as a non-durable queue for a Servlet.
Here's the blurb from the javadoc for the class.</p>
<blockquote>
<p>An unbounded thread-safe queue based on linked nodes. A ConcurrentLinkedQueue is an appropriate choice when many threads will share access to a common collection... | [
{
"answer_id": 435080,
"author": "Yuval Adam",
"author_id": 24545,
"author_profile": "https://Stackoverflow.com/users/24545",
"pm_score": 1,
"selected": false,
"text": "<ol>\n<li><p>Since the queue is thread-safe, you do not need to perform any synchronizations to ensure thread-safety. H... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435069",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24457/"
] | I want to use java.util.ConcurrentLinkedQueue as a non-durable queue for a Servlet.
Here's the blurb from the javadoc for the class.
>
> An unbounded thread-safe queue based on linked nodes. A ConcurrentLinkedQueue is an appropriate choice when many threads will share access to a common collection. This queue does no... | You're essentially asking three different questions (two of them explicitly and one implicitly.) Here they are, with my answers:
**1. Do I need to do my own synchronization if I use `java.util.ConcurrentLinkedQueue`?**
Atomic operations on the concurrent collections are synchronized for you. In other words, each indi... |
435,084 | <p>In my old job I used XMLSpy to do my XML authoring and editing, but now I require a free plugin for Eclipse to do this. My basic requirements are:</p>
<pre><code>- General XML document editing
- Creating XSD files
- Creating WSDL files
</code></pre>
<p>Can you recommend a free Eclipse plugin for this?</p>
| [
{
"answer_id": 435184,
"author": "Markus Lausberg",
"author_id": 39062,
"author_profile": "https://Stackoverflow.com/users/39062",
"pm_score": 0,
"selected": false,
"text": "<p>To write XML/XSL files you can use <a href=\"http://www.oxygenxml.com/eclipse_plugin.html\" rel=\"nofollow nore... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42435/"
] | In my old job I used XMLSpy to do my XML authoring and editing, but now I require a free plugin for Eclipse to do this. My basic requirements are:
```
- General XML document editing
- Creating XSD files
- Creating WSDL files
```
Can you recommend a free Eclipse plugin for this? | In the free department, [**WTP** (Web Tools Platform)](http://www.eclipse.org/webtools/index.php) (in its latest version) does include a lot of features,
including [schema creation/modification](http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.wst.xsdeditor.doc.user/topics/cxmlsced.html). |
435,098 | <p>my company processes paper forms so that written data is being put to databases. every form has a set of fields. i'm writing a simple internal app to define the form's fields and that includes field's validations. i'm thinking of classes structure now and i can think of two approaches: </p>
<ol>
<li><p>i could wr... | [
{
"answer_id": 435128,
"author": "S.Lott",
"author_id": 10661,
"author_profile": "https://Stackoverflow.com/users/10661",
"pm_score": 1,
"selected": false,
"text": "<p>Writing a class hierarchy is good. Validation has numerous subclasses of validation.</p>\n\n<p>When a new validation sh... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435098",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | my company processes paper forms so that written data is being put to databases. every form has a set of fields. i'm writing a simple internal app to define the form's fields and that includes field's validations. i'm thinking of classes structure now and i can think of two approaches:
1. i could write a set of class... | Writing a class hierarchy is good. Validation has numerous subclasses of validation.
When a new validation shows up, nothing old needs to get rewritten. The old stuff is still in place and still works. EmailAddressValidation doesn't change when someone asks for a new SomeNewIDNumberValidation.
If you find a bug, of c... |
435,114 | <p>When trying to load a large text file into the oracle db using SQLLoader, we get the following errors:</p>
<pre><code>SQL*Loader-926: OCI-Error; uldlfca:OCIDirPathColArrayLoadStream for table <myTabele>
SQL*Loader-2026: the load was aborted because SQL Loader cannot continue.
SQL*Loader-925: Error in uldlgs: ... | [
{
"answer_id": 436138,
"author": "DCookie",
"author_id": 8670,
"author_profile": "https://Stackoverflow.com/users/8670",
"pm_score": 1,
"selected": false,
"text": "<p>First, it would be a big help if people could start specifying version information about the products they're having issu... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435114",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25320/"
] | When trying to load a large text file into the oracle db using SQLLoader, we get the following errors:
```
SQL*Loader-926: OCI-Error; uldlfca:OCIDirPathColArrayLoadStream for table <myTabele>
SQL*Loader-2026: the load was aborted because SQL Loader cannot continue.
SQL*Loader-925: Error in uldlgs: OCIStmtExecute (ptc_... | First, it would be a big help if people could start specifying version information about the products they're having issues with.
That said, I found one issue in metalink:
Bug 3073503 - Direct path load session fails with OER:klapse\_30 if first loaded row gets an ORA error
Description
```
Direct load via sqlldr ma... |
435,129 | <p>I have a simple search mechanism on ms sql server that uses full-text "contains".
I pass search value as a parameter to contains predicate - directly from user's input (via asp.net web site). The problem is that i get sql exception in variety of cases:
- when user inputs two words, like 'simple case'
- when user ad... | [
{
"answer_id": 435143,
"author": "Sergio",
"author_id": 32037,
"author_profile": "https://Stackoverflow.com/users/32037",
"pm_score": 0,
"selected": false,
"text": "<p>By the errors you are getting i would say you are not using parameters for your queries. This is very dangerous and allo... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435129",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35643/"
] | I have a simple search mechanism on ms sql server that uses full-text "contains".
I pass search value as a parameter to contains predicate - directly from user's input (via asp.net web site). The problem is that i get sql exception in variety of cases:
- when user inputs two words, like 'simple case'
- when user adds ... | In our app we use our own simple query language for the user input: just operands (words or phrases with optional wildcards), operators (AND, OR, NOT) and parentheses.
We parse the user input, break it down into it's constituent parts and check the syntax etc.
If we're happy that the input is valid, we rebuild it int... |
435,135 | <p>How can i change ex. 2009-01-14 06:38:18 to 2009-01-14 06:38?
the column type is <code>DATETIME</code>. i dont wanna use <code>SELECT DATE_FORMAT</code></p>
<p>How could I do it with PHP?
<code>date("M-d-Y H:i", $userow['regdate'])</code> gives:</p>
<pre><code>Strict Standards: date() [function.date]: It is not sa... | [
{
"answer_id": 435142,
"author": "Karsten",
"author_id": 28144,
"author_profile": "https://Stackoverflow.com/users/28144",
"pm_score": 2,
"selected": false,
"text": "<p>Use <a href=\"http://de3.php.net/manual/en/function.date-default-timezone-set.php\" rel=\"nofollow noreferrer\">date_de... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435135",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | How can i change ex. 2009-01-14 06:38:18 to 2009-01-14 06:38?
the column type is `DATETIME`. i dont wanna use `SELECT DATE_FORMAT`
How could I do it with PHP?
`date("M-d-Y H:i", $userow['regdate'])` gives:
```
Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please u... | Use [date\_default\_timezone\_set()](http://de3.php.net/manual/en/function.date-default-timezone-set.php) before, as your error says. |
435,138 | <p>I'm designing an application that supports plugin development. Its more of a learning exercise.</p>
<p>All of the assemblies (plugins) being loaded into my app contain a showPrefs() method. As I load each assembly, I want to assign a button to each one so that when I click on the button, it triggers the showPrefs()... | [
{
"answer_id": 435155,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 3,
"selected": false,
"text": "<p>I think you need to clarify what you're talking about, as what you're asking is much less complicated than loading the asse... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435138",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17211/"
] | I'm designing an application that supports plugin development. Its more of a learning exercise.
All of the assemblies (plugins) being loaded into my app contain a showPrefs() method. As I load each assembly, I want to assign a button to each one so that when I click on the button, it triggers the showPrefs() method of... | If you look at Will's pseudocode, he assigns a lambda expression to the Click handler, like such:
```
b.Click += (o,e) => { i.showPrefs(); };
```
That's an anynomous method right there, accepting an object and EventArgs. It then calls your showPrefs function on the interface. It's roughly equal to the following:
`... |
435,141 | <p>I will implement a virtual machine in x86 and I wonder what kind of design would yield best results. What should I concentrate on to squish out the juice? I will to implement the whole virtual machine in x86 assembly.</p>
<p>I haven't much instructions and I can choose their form. The instructions project directly ... | [
{
"answer_id": 435149,
"author": "Carl Seleborg",
"author_id": 2095,
"author_profile": "https://Stackoverflow.com/users/2095",
"pm_score": 1,
"selected": false,
"text": "<p>The point of an interpreter <strong>is</strong> portability, most of the time. The fastest approach I can think of ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435141",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21711/"
] | I will implement a virtual machine in x86 and I wonder what kind of design would yield best results. What should I concentrate on to squish out the juice? I will to implement the whole virtual machine in x86 assembly.
I haven't much instructions and I can choose their form. The instructions project directly into small... | I see there is some confusion about portability here, so I feel obliged to clarify matters some. These are my humble opinions so you are, of course, free to object against them.
I assume you came accross <http://www.complang.tuwien.ac.at/forth/threading/> if you consider writing a VM seriously, so I won't dwell upon ... |
435,144 | <p>Hopefully somebody will be able to help. In my Delphi 7 application small percentage of users report errors when printing and I'm trying to resolve this with last of them. I'm slightly limited when it comes to testing (as user is physically distant and we are working it out via e-mail), but I get some additional inf... | [
{
"answer_id": 435199,
"author": "Toon Krijthe",
"author_id": 18061,
"author_profile": "https://Stackoverflow.com/users/18061",
"pm_score": 2,
"selected": false,
"text": "<p>You say that a small percentage of users report the problems. Do you have any idea what is the difference between ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435144",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12891/"
] | Hopefully somebody will be able to help. In my Delphi 7 application small percentage of users report errors when printing and I'm trying to resolve this with last of them. I'm slightly limited when it comes to testing (as user is physically distant and we are working it out via e-mail), but I get some additional inform... | You say that a small percentage of users report the problems. Do you have any idea what is the difference between these and the other users?
In think about:
* used printers
* printer drivers (version)
* OS used, including patches and updates (don't forget the IE updates)
* version of your software
* other installed s... |
435,161 | <p>I had a function like this, that wasn't within a class:</p>
<pre><code>// Gets the maximum number of tracks displayable
const utils::uint32 GetConstMaxSystemRange()
{
return constMaxSystemNumber - constMinSystemNumber + 1;
}
</code></pre>
<p>It compiled fine in VS2005, but then I got linker errors for each fil... | [
{
"answer_id": 435178,
"author": "Johannes Schaub - litb",
"author_id": 34509,
"author_profile": "https://Stackoverflow.com/users/34509",
"pm_score": 5,
"selected": true,
"text": "<p>Include guards only protect that function from being included into the same translation unit twice. But i... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14250/"
] | I had a function like this, that wasn't within a class:
```
// Gets the maximum number of tracks displayable
const utils::uint32 GetConstMaxSystemRange()
{
return constMaxSystemNumber - constMinSystemNumber + 1;
}
```
It compiled fine in VS2005, but then I got linker errors for each file after the first one to i... | Include guards only protect that function from being included into the same translation unit twice. But it won't protect that function from being included into the whole program twice.
As the function is non-inline, it violates the One Definition Rule if it appears more than once in the whole program. Make it inline ... |
435,180 | <p>Per the example array at the very bottom, i want to be able to append the depth of each embedded array inside of the array. for example:</p>
<pre>
array (
53 =>
array (
'title' => 'Home',
'path' => '',
'type' => '118',
'pid' => 52,
'hasChildren' => 0,
)... | [
{
"answer_id": 435194,
"author": "Paul Dixon",
"author_id": 6521,
"author_profile": "https://Stackoverflow.com/users/6521",
"pm_score": 3,
"selected": false,
"text": "<p>A recursive function like this should do it?</p>\n\n<pre><code>function setDepth(&$a, $depth)\n{\n $a['depth']=... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45592/"
] | Per the example array at the very bottom, i want to be able to append the depth of each embedded array inside of the array. for example:
```
array (
53 =>
array (
'title' => 'Home',
'path' => '',
'type' => '118',
'pid' => 52,
'hasChildren' => 0,
),
```
... | I assume there is another array( at the top not included in your example code.
Something like this?
```
function array_set_depth($array, $depth = -1)
{
$subdepth = $depth + 1;
if ($depth < 0) {
foreach ($array as $key => $subarray) {
$temp[$key] = array_set_depth(($subarray), $subdepth);
}
}
if (... |
435,188 | <p>I want to count the number of set bits in a uint in Specman:</p>
<pre><code>var x: uint;
gen x;
var x_set_bits: uint;
x_set_bits = ?;
</code></pre>
<p>What's the best way to do this?</p>
| [
{
"answer_id": 435193,
"author": "Nathan Fellman",
"author_id": 1084,
"author_profile": "https://Stackoverflow.com/users/1084",
"pm_score": 2,
"selected": false,
"text": "<p>One way I've seen is:</p>\n\n<pre><code>x_set_bits = pack(NULL, x).count(it == 1);\n</code></pre>\n\n<p><code>pack... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1084/"
] | I want to count the number of set bits in a uint in Specman:
```
var x: uint;
gen x;
var x_set_bits: uint;
x_set_bits = ?;
```
What's the best way to do this? | I don't know Specman, but another way I've seen this done looks a bit cheesy, but tends to be efficient: Keep a 256-element array; each element of the array consists of the number of bits corresponding to that value. For example (pseudocode):
```
bit_count = [0, 1, 1, 2, 1, ...]
```
Thus, bit\_count[2](https://stack... |
435,210 | <p>I have a small command line utility project that I'm using Maven to manage. The utility is a very simple app to populate a Velocity template and dump the results to a new file. My problem is where to put my Velocity templates. When I put them in <code>src/test/resources/foo/bar/baz</code>, <code>mvn test</code> fail... | [
{
"answer_id": 435222,
"author": "krosenvold",
"author_id": 23691,
"author_profile": "https://Stackoverflow.com/users/23691",
"pm_score": 1,
"selected": false,
"text": "<p>You should put them in src/main/resources/foo/bar/baz because they need to be included in the main jar file.</p>\n"
... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4203/"
] | I have a small command line utility project that I'm using Maven to manage. The utility is a very simple app to populate a Velocity template and dump the results to a new file. My problem is where to put my Velocity templates. When I put them in `src/test/resources/foo/bar/baz`, `mvn test` fails because it can't find t... | So it turns out that instead of using something like
```
generator.mergeTemplate("foo.yaml", writer);
```
I should use something like
```
InputStream fooStream = getClass().getResourceAsStream("foo.yaml");
generator.mergeTemplate(fooStream, writer);
``` |
435,231 | <p>I have implemented a UserControl and put a TreeView control on that. The XAML file looks as follows. I am using a HierarchicalDataTemplate for data binding with the Treeview, </p>
<pre><code><UserControl x:Class="Trinity.Windows.Viewer.Alarm.AlarmPage.TrinityDeviceTree"
xmlns="http://schemas.microsoft.com/wi... | [
{
"answer_id": 435266,
"author": "UnkwnTech",
"author_id": 115,
"author_profile": "https://Stackoverflow.com/users/115",
"pm_score": 3,
"selected": false,
"text": "<p>From my own experience it has adding Google-Analytics has not changed the load times.<Br /><br />\nAccording to FireBug i... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have implemented a UserControl and put a TreeView control on that. The XAML file looks as follows. I am using a HierarchicalDataTemplate for data binding with the Treeview,
```
<UserControl x:Class="Trinity.Windows.Viewer.Alarm.AlarmPage.TrinityDeviceTree"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/pre... | **2018 update**: Where and how you mount Analytics has changed over and over and over again. The current gtag.js code does a few things:
1. Load the gtag script but async (non-blocking). This means it doesn't slow your page down in any other way than bandwidth and processing.
2. Create an array on the page called `win... |
435,244 | <p>I need a CSVParser class file
A Class File which parses csv and returns a dataSet as a result ASP.Net</p>
| [
{
"answer_id": 435260,
"author": "Steven Robbins",
"author_id": 26507,
"author_profile": "https://Stackoverflow.com/users/26507",
"pm_score": 1,
"selected": false,
"text": "<p>Simple google gives plenty of <a href=\"http://windowsclient.net/blogs/faqs/archive/2006/05/30/how-do-i-load-a-c... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I need a CSVParser class file
A Class File which parses csv and returns a dataSet as a result ASP.Net | I'm pretty sure that [CSVReader](http://www.codeproject.com/KB/database/CsvReader.aspx) (CodeProject) can read to `DataTable`.
```
DataTable table = new DataTable();
// set up schema... (Columns.Add)
using(TextReader text = File.OpenText(path))
using(CsvReader csv = new CsvReader(text, ... |
435,259 | <p>I have a file in a project that is in a bitkeeper repository. I checked in a file but I haven't committed the change to create a changeset. How can I undo the checkin?</p>
<p>If I had a changeset I could undo the commit with:</p>
<pre><code>bk undo -r<rev>
</code></pre>
<p>But in this case I can't commit ... | [
{
"answer_id": 435280,
"author": "UnkwnTech",
"author_id": 115,
"author_profile": "https://Stackoverflow.com/users/115",
"pm_score": -1,
"selected": false,
"text": "<p>Reading the number of pixels in the image can tell you the \"<a href=\"http://en.wikipedia.org/wiki/Pixel#Megapixel\" re... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435259",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1084/"
] | I have a file in a project that is in a bitkeeper repository. I checked in a file but I haven't committed the change to create a changeset. How can I undo the checkin?
If I had a changeset I could undo the commit with:
```
bk undo -r<rev>
```
But in this case I can't commit and undo the changeset because I have oth... | I'm not entirely clear what you mean by "quality", if you mean the quality setting in the JPG compression algorithm then you may be able to extract it from the EXIF tags of the image (relies on the capture device putting them in and no-one else overwriting them) for your library see here:
<http://www.aurigma.com/Suppo... |
435,311 | <p>I get a <strong>404 HTTP status error</strong> (not found) on <strong>a specific WebResource.axd</strong> call inside an ASP.NET 3.5 (AJAX) web application. I guess the error is thrown because a specific referenced assembly is missing in the bin folder/GAC. But I don't know which, since the page which requests the r... | [
{
"answer_id": 435324,
"author": "Diadistis",
"author_id": 47401,
"author_profile": "https://Stackoverflow.com/users/47401",
"pm_score": 6,
"selected": true,
"text": "<p>One of the reasons for this issue is that the registered embedded resource path is incorrect or the resource is not th... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6461/"
] | I get a **404 HTTP status error** (not found) on **a specific WebResource.axd** call inside an ASP.NET 3.5 (AJAX) web application. I guess the error is thrown because a specific referenced assembly is missing in the bin folder/GAC. But I don't know which, since the page which requests the resource is very complex (I'm ... | One of the reasons for this issue is that the registered embedded resource path is incorrect or the resource is not there. Make sure the resource file is added as a [Embedded Resource](http://support.microsoft.com/kb/319292).
Asp.net uses the [WebResourceAttribute](http://msdn.microsoft.com/en-us/library/system.web.ui... |
435,322 | <p>I have a few classes which do nothing except in their constructors/destructors. Here's an example</p>
<pre><code>class BusyCursor
{
private:
Cursor oldCursor_;
public:
BusyCursor()
{
oldCursor_ = CurrentCursor();
SetCursor(BUSY_CURSOR);
}
~BusyCursor()
{
SetCursor(ol... | [
{
"answer_id": 435334,
"author": "Brian R. Bondy",
"author_id": 3153,
"author_profile": "https://Stackoverflow.com/users/3153",
"pm_score": 6,
"selected": true,
"text": "<p>This technique is very common and is known as the design pattern: <a href=\"http://en.wikipedia.org/wiki/Resource_a... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1737/"
] | I have a few classes which do nothing except in their constructors/destructors. Here's an example
```
class BusyCursor
{
private:
Cursor oldCursor_;
public:
BusyCursor()
{
oldCursor_ = CurrentCursor();
SetCursor(BUSY_CURSOR);
}
~BusyCursor()
{
SetCursor(oldCursor_);
... | This technique is very common and is known as the design pattern: [Resource Acquisition Is Initialization (RAII)](http://en.wikipedia.org/wiki/Resource_acquisition_is_initialization).
I would not hesitate to use this design pattern at all.
It's much better that you are coding using this design pattern because you wi... |
435,328 | <p>How is it possible to open FireFox browser by Ruby(for automation script)?
I use</p>
<pre><code> @browser = RSpecSeleniumHelper.connect_browser('/admin/', '*firefox')
</code></pre>
<p>but it doesn't work.</p>
| [
{
"answer_id": 435357,
"author": "spas",
"author_id": 46999,
"author_profile": "https://Stackoverflow.com/users/46999",
"pm_score": 2,
"selected": false,
"text": "<p>You can start any program in ruby with:</p>\n\n<pre><code>`firefox http://www.google.com`\nor\nsystem(\"firefox http://www... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435328",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | How is it possible to open FireFox browser by Ruby(for automation script)?
I use
```
@browser = RSpecSeleniumHelper.connect_browser('/admin/', '*firefox')
```
but it doesn't work. | You can start any program in ruby with:
```
`firefox http://www.google.com`
or
system("firefox http://www.google.com")
``` |
435,332 | <p>I have a stored procedure that selects from multiple tables</p>
<p>The calling method in the class the inherits from DataContext is as follows</p>
<p>[Function(Name = "dbo.BASE_Product_Retrieve")]</p>
<pre><code> [ResultType(typeof(BASE_Product))]
[ResultType(typeof(BASE_Product_Version))]
[ResultTyp... | [
{
"answer_id": 435340,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 1,
"selected": false,
"text": "<p>How <em>exactly</em> are you using it? IIRC, you need to access the grids in the right order (it is just an <code>... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have a stored procedure that selects from multiple tables
The calling method in the class the inherits from DataContext is as follows
[Function(Name = "dbo.BASE\_Product\_Retrieve")]
```
[ResultType(typeof(BASE_Product))]
[ResultType(typeof(BASE_Product_Version))]
[ResultType(typeof(BASE_ItemPrice))]... | How *exactly* are you using it? IIRC, you need to access the grids in the right order (it is just an `IDataReader`, ultimately).
Or to quote: "Retrieves the next result as a sequence of a specified type."
See also the note on [MSDN](http://msdn.microsoft.com/en-us/library/bb534218.aspx):
>
> You must use the GetRes... |
435,349 | <p>I am using the afconvert command line utility to convert an audio file from <code>.caf</code> to <code>.mp3</code> format. I have used <code>afconvert</code>:</p>
<pre><code>afconvert -f 'MPG3 ' -d '.mp3' -v input.caf output.mp3
</code></pre>
<p>But this gives me the following error:</p>
<pre><code>Input file: i... | [
{
"answer_id": 499655,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": -1,
"selected": false,
"text": "<p>try this: </p>\n\n<pre><code>afconvert -f mp4f -d aac -v input.caf output.mp3\n</code></pre>\n\n<p>I know it's not exactly... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435349",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I am using the afconvert command line utility to convert an audio file from `.caf` to `.mp3` format. I have used `afconvert`:
```
afconvert -f 'MPG3 ' -d '.mp3' -v input.caf output.mp3
```
But this gives me the following error:
```
Input file: input.caf, 19008 frames
Error: ExtAudioFileSetProperty ('cfmt') failed ... | you should check this,
```
afconvert -f mp4f -d aac -b 128000 input.caf output2.mp4
```
This way you will convert your CAF file to the MPEG-4 format.
Read: Apple does not ship any form of MP3 encoder with Mac OS X aside from the one built into iTunes.
source: <http://lists.apple.com/archives/coreaudio-api/2005/... |
435,352 | <p>Some platforms mandate that you provide a list of a shared library's external symbols to the linker. However, on most unixish systems that's not necessary: all non-static symbols will be available by default.</p>
<p>My understanding is that the GNU toolchain can optionally restrict visibility just to symbols explic... | [
{
"answer_id": 437525,
"author": "jpalecek",
"author_id": 51831,
"author_profile": "https://Stackoverflow.com/users/51831",
"pm_score": 6,
"selected": false,
"text": "<p>I think the easiest way of doing that is adding the <code>-fvisibility=hidden</code> to gcc options and explicitly mak... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435352",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54157/"
] | Some platforms mandate that you provide a list of a shared library's external symbols to the linker. However, on most unixish systems that's not necessary: all non-static symbols will be available by default.
My understanding is that the GNU toolchain can optionally restrict visibility just to symbols explicitly decla... | GNU `ld` can do that on ELF platforms.
Here is how to do it with a linker version script:
```
/* foo.c */
int foo() { return 42; }
int bar() { return foo() + 1; }
int baz() { return bar() - 1; }
gcc -fPIC -shared -o libfoo.so foo.c && nm -D libfoo.so | grep ' T '
```
By default, all symbols are exported:
```
0000... |
435,353 | <p>How does one compare the text field of one record to all the other records in SQL server to return, for example, the top 5 most related records? </p>
<p>An example of the functionality I'm after are the various Related Posts plugins for Wordpress that produce a list of links to posts related to the post currently ... | [
{
"answer_id": 830316,
"author": "Brent Ozar",
"author_id": 26837,
"author_profile": "https://Stackoverflow.com/users/26837",
"pm_score": 0,
"selected": false,
"text": "<p>Here you go, from the excellent Robert Cain:</p>\n\n<p><a href=\"http://arcanecode.com/2007/06/28/getting-started-wi... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435353",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | How does one compare the text field of one record to all the other records in SQL server to return, for example, the top 5 most related records?
An example of the functionality I'm after are the various Related Posts plugins for Wordpress that produce a list of links to posts related to the post currently being viewe... | Thanks for these responses. I'm familiar with the referenced functions, but I'm not sure they do what I need. For example:
```
SELECT P.id, 'Product' AS Type, FT.rank, C.url + '/' + P.url AS url, longTitle, shortTitle, P.description
FROM Products P
INNER JOIN CONTAINSTABLE (Products, (longTitle, shortTitle), '"my... |
435,368 | <p>One of my colleagues has totally messed up the contents of a directory in our main CVS repository. I need to just revert the whole module to the state it was in at the end of last year. What's the CVS command to do this please?</p>
<p>He has added and removed hundreds of files, so a simple "copy over files from o... | [
{
"answer_id": 435375,
"author": "JB.",
"author_id": 12274,
"author_profile": "https://Stackoverflow.com/users/12274",
"pm_score": 0,
"selected": false,
"text": "<p>Have you tried using the <code>-d</code> option? (build subdirectories)</p>\n\n<p>As far as I can remember, it's implied fo... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435368",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37386/"
] | One of my colleagues has totally messed up the contents of a directory in our main CVS repository. I need to just revert the whole module to the state it was in at the end of last year. What's the CVS command to do this please?
He has added and removed hundreds of files, so a simple "copy over files from old checkout ... | Actually your initial approach was very close to the solution. The problem is, that joining date-based does not handle removed files and directories correctly. You need to set a tag to the code base you want to join first:
```
mkdir code_base1 && cd code_base1
cvs co -D "2008-12-30" modulename
cvs tag code_base_2008_1... |
435,379 | <p>I try to clear my listview but the clear method doesn't work:</p>
<pre><code>myListView.Items.Clear();
</code></pre>
<p>This doen't work. When i put a breakpoint at this line, the line is executed, but my listview isn't empty. How come??</p>
<p>I fill my listview by setting it's datasource to a datatable.</p>
<p... | [
{
"answer_id": 435414,
"author": "JaredPar",
"author_id": 23283,
"author_profile": "https://Stackoverflow.com/users/23283",
"pm_score": 5,
"selected": false,
"text": "<p>Try this ...</p>\n\n<pre><code>myListView.DataSource = null;\nmyListView.Items.Clear();\n</code></pre>\n"
},
{
... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435379",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40676/"
] | I try to clear my listview but the clear method doesn't work:
```
myListView.Items.Clear();
```
This doen't work. When i put a breakpoint at this line, the line is executed, but my listview isn't empty. How come??
I fill my listview by setting it's datasource to a datatable.
My solution now is to set the datasourc... | How about
```
DataSource = null;
DataBind();
``` |
435,380 | <p>Just thinking about this, is it possible to create a connection string outside the ASP.NET's web.config?</p>
| [
{
"answer_id": 435399,
"author": "cgreeno",
"author_id": 6088,
"author_profile": "https://Stackoverflow.com/users/6088",
"pm_score": 2,
"selected": false,
"text": "<p>Yes you can store it anywhere it is just text.... The web.config is just a XML document that stores configuration setting... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48581/"
] | Just thinking about this, is it possible to create a connection string outside the ASP.NET's web.config? | Yes you can store it anywhere it is just text.... The web.config is just a XML document that stores configuration settings about your application. You could just as easily create another XML file or a text file and read it in from there. You just wouldnt be able to use:
```
ConfigurationManager.ConnectionStrings[].Con... |
435,385 | <p>The problem is like this.</p>
<p>The report page numbers that are displayed on the page should not be dependent on the current but on the group page.</p>
<p>Let me explain: </p>
<p>I have a report with 2 groups that has 4 pages, each group on two pages, and what I need to do is the following:</p>
<pre><code>grou... | [
{
"answer_id": 1204656,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 1,
"selected": false,
"text": "<p>You could try setting setting the isResetPageNumber attribute of the group to true.</p>\n\n<p>e.g. <code><group name=\... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38973/"
] | The problem is like this.
The report page numbers that are displayed on the page should not be dependent on the current but on the group page.
Let me explain:
I have a report with 2 groups that has 4 pages, each group on two pages, and what I need to do is the following:
```
group 1 page 1: should be: 1/2 -> curre... | You could try setting setting the isResetPageNumber attribute of the group to true.
e.g. `<group name="someGroupName" isResetPageNumber="true" >` |
435,387 | <p>In an ASP.NET MVC application, I'm making logic for Admin to accept or reject new members. I'm showing a list of members and two buttons Accept and Reject, like this:</p>
<pre><code><% foreach (var mm in (ViewData["pendingmembers"] as List<MyMember>)) %>
<% { %>
<tr><td>Username:<... | [
{
"answer_id": 1204656,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 1,
"selected": false,
"text": "<p>You could try setting setting the isResetPageNumber attribute of the group to true.</p>\n\n<p>e.g. <code><group name=\... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435387",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54155/"
] | In an ASP.NET MVC application, I'm making logic for Admin to accept or reject new members. I'm showing a list of members and two buttons Accept and Reject, like this:
```
<% foreach (var mm in (ViewData["pendingmembers"] as List<MyMember>)) %>
<% { %>
<tr><td>Username:<%=mm.UserName %></td><td>
<tr><td>Firstname... | You could try setting setting the isResetPageNumber attribute of the group to true.
e.g. `<group name="someGroupName" isResetPageNumber="true" >` |
435,391 | <p>I have a <code><div></code> that holds a google ad. My website is mostly AJAX and there is no need for a browser refresh. That means my ads will not refresh either, which isn't ideal, a user staring at one ad all day. </p>
<p>So I wanted a way to refresh a particular <code><div></code> on a page. I foun... | [
{
"answer_id": 435432,
"author": "Sergey Ilinsky",
"author_id": 23815,
"author_profile": "https://Stackoverflow.com/users/23815",
"pm_score": -1,
"selected": false,
"text": "<p>It is not allowed (according to AdSense terms) to try and reload ads during the page life-cycle. Also, it is ha... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435391",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/51649/"
] | I have a `<div>` that holds a google ad. My website is mostly AJAX and there is no need for a browser refresh. That means my ads will not refresh either, which isn't ideal, a user staring at one ad all day.
So I wanted a way to refresh a particular `<div>` on a page. I found many solutions but they didn't work. For e... | As both of the other answers state, refreshing your AdSense advertisements automatically isn't allowed. I understand that you only intend to refresh the ad in response to user action, but it *still* isn't allowed, even though it should be!
Remember, the reason why you want to update the advertisements is so that you c... |
435,401 | <p>I am getting the following error when I execute a .Net Function in SQL 2005, any ideas?</p>
<blockquote>
<p>Msg 6522, Level 16, State 2, Line 1 A
.NET Framework error occurred during
execution of user defined routine or
aggregate 'Function1':
System.Security.SecurityException:
Request for the permissio... | [
{
"answer_id": 435411,
"author": "Fredou",
"author_id": 40868,
"author_profile": "https://Stackoverflow.com/users/40868",
"pm_score": 0,
"selected": false,
"text": "<p>it seem you don't have enough security access?</p>\n\n<p>but would be easier if you could post the code related to that ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435401",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I am getting the following error when I execute a .Net Function in SQL 2005, any ideas?
>
> Msg 6522, Level 16, State 2, Line 1 A
> .NET Framework error occurred during
> execution of user defined routine or
> aggregate 'Function1':
> System.Security.SecurityException:
> Request for the permission of type
> 'S... | You are not creating the assembly with the appropriate permission set. Your `CREATE ASSEMBLY` statement should look something like this:
```
CREATE ASSEMBLY ... WITH PERMISSION_SET = EXTERNAL_ACCESS
```
This *should* allow you to make the web service call. If that doesn't work, then you will have to set `PERMISSION_... |
435,404 | <p>I need a basic example of how to use the <code>IComparable</code> interface so that I can sort in ascending or descending order and by different fields of the object type I'm sorting.</p>
| [
{
"answer_id": 435406,
"author": "Spencer Ruport",
"author_id": 52551,
"author_profile": "https://Stackoverflow.com/users/52551",
"pm_score": 4,
"selected": false,
"text": "<p>Here's a simple example:</p>\n\n<pre><code>public class SortableItem : IComparable<SortableItem>\n{\n p... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435404",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/52551/"
] | I need a basic example of how to use the `IComparable` interface so that I can sort in ascending or descending order and by different fields of the object type I'm sorting. | Well, since you are using `List<T>` it would be a lot simpler to just use a `Comparison<T>`, for example:
```
List<Foo> data = ...
// sort by name descending
data.Sort((x,y) => -x.Name.CompareTo(y.Name));
```
Of course, with LINQ you could just use:
```
var ordered = data.OrderByDescending(x=>x.Name);
```
But you... |
435,408 | <p>I want to protect my <code>database.yml</code> file by keeping it out of version control. Thus, I have two tasks in my Capistrano deploy recipe:</p>
<pre><code>task :copy_db_config do
# copy local config file if it exists and is more
# recent than the remote one
end
task :symlink_db_config do
run "ln -nfs #... | [
{
"answer_id": 435406,
"author": "Spencer Ruport",
"author_id": 52551,
"author_profile": "https://Stackoverflow.com/users/52551",
"pm_score": 4,
"selected": false,
"text": "<p>Here's a simple example:</p>\n\n<pre><code>public class SortableItem : IComparable<SortableItem>\n{\n p... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1190/"
] | I want to protect my `database.yml` file by keeping it out of version control. Thus, I have two tasks in my Capistrano deploy recipe:
```
task :copy_db_config do
# copy local config file if it exists and is more
# recent than the remote one
end
task :symlink_db_config do
run "ln -nfs #{shared_path}/config/datab... | Well, since you are using `List<T>` it would be a lot simpler to just use a `Comparison<T>`, for example:
```
List<Foo> data = ...
// sort by name descending
data.Sort((x,y) => -x.Name.CompareTo(y.Name));
```
Of course, with LINQ you could just use:
```
var ordered = data.OrderByDescending(x=>x.Name);
```
But you... |
435,418 | <p>I'm using SQL Server 2005.</p>
<p>The query would look like this</p>
<pre><code>Select col1, col2, col3 from <subquery> where (col1,col2) in <subquery>
</code></pre>
<p>SQL Server doesn't seem to like that. Any way of implementing that that anyone knows of that doesn't involve converting to varchars o... | [
{
"answer_id": 435428,
"author": "Eduardo Molteni",
"author_id": 2385,
"author_profile": "https://Stackoverflow.com/users/2385",
"pm_score": -1,
"selected": true,
"text": "<p>You have to separate in two clauses</p>\n\n<pre><code> where col1 in (...) AND col2 in (...)\n</code></pre>\n\n<p... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435418",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I'm using SQL Server 2005.
The query would look like this
```
Select col1, col2, col3 from <subquery> where (col1,col2) in <subquery>
```
SQL Server doesn't seem to like that. Any way of implementing that that anyone knows of that doesn't involve converting to varchars or anything else messy?
This is the actual qu... | You have to separate in two clauses
```
where col1 in (...) AND col2 in (...)
```
or you could refactor it a little bit
```
select * FROM (
SELECT NEWID() AS guid, UserID, RoleId, ClubId, 0 AS GroupRole FROM dbo.Portal_UserRoles
UNION
SELECT NEWID() AS guid, dbo.Portal_UserGroups.UserId, dbo.Porta... |
435,423 | <p>I've got an assembly containing several WCF services, each with its own contract. It all works nicely. The service config in the app.config for the service looks like this:</p>
<pre><code><services>
<service behaviorConfiguration="WcfService.AlyzaServiceBehavior"
name="Sam.Alyza.WcfService.ServiceWeb... | [
{
"answer_id": 436584,
"author": "EnocNRoll - AnandaGopal Pardue",
"author_id": 54289,
"author_profile": "https://Stackoverflow.com/users/54289",
"pm_score": 2,
"selected": false,
"text": "<p>Services can share BaseAddress values (including port #'s, if the Net.Tcp Port Sharing Service i... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435423",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7021/"
] | I've got an assembly containing several WCF services, each with its own contract. It all works nicely. The service config in the app.config for the service looks like this:
```
<services>
<service behaviorConfiguration="WcfService.AlyzaServiceBehavior"
name="Sam.Alyza.WcfService.ServiceWebsites">
<endpoint a... | You can combine all contracts in one class, so you have one service with a baseaddress and one (or more) endpoint(s) per contract.
To avoid having one large class-file you can use the partial-keyword (asuming you use c#) to split the class across multiple files. Each file can implement one contract, that makes maintai... |
435,424 | <p>In Postgresql, how can I do a condition to create a table only if it does not already exist? </p>
<p>Code example appreciated. </p>
| [
{
"answer_id": 435471,
"author": "Jared",
"author_id": 14744,
"author_profile": "https://Stackoverflow.com/users/14744",
"pm_score": 4,
"selected": false,
"text": "<p>Just create the table and don't worry about whether it exists. If it doesn't exist it will be created; if it does exist t... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435424",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27126/"
] | In Postgresql, how can I do a condition to create a table only if it does not already exist?
Code example appreciated. | I'm not sure when it was added, but for the sake of completeness I'd like to point out that in version 9.1 (maybe before) `IF NOT EXISTS` can be used. `IF NOT EXISTS` will only create the table if it doesn't exist already.
Example:
```
CREATE TABLE IF NOT EXISTS users.vip
(
id integer
)
```
This will create a tab... |
435,429 | <p>When programming in C++ against the browser's <a href="http://www.google.co.il/url?sa=t&source=web&ct=res&cd=1&url=http%3A%2F%2Fwww.w3.org%2FDOM%2F&ei=eUhrSaTCDpyY9QSMr5imBw&usg=AFQjCNH0daWhsLwlt2sAqQJ71Vx8WtrHug&sig2=9eYS8DOTG8VOj3tJSKjyvg" rel="nofollow noreferrer">DOM</a> each engine h... | [
{
"answer_id": 441984,
"author": "Hach-Que",
"author_id": 130795,
"author_profile": "https://Stackoverflow.com/users/130795",
"pm_score": 1,
"selected": false,
"text": "<p>I've never seen one. For my software, I simple wrote the extension in Firefox's javascript, and then created an Int... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3848/"
] | When programming in C++ against the browser's [DOM](http://www.google.co.il/url?sa=t&source=web&ct=res&cd=1&url=http%3A%2F%2Fwww.w3.org%2FDOM%2F&ei=eUhrSaTCDpyY9QSMr5imBw&usg=AFQjCNH0daWhsLwlt2sAqQJ71Vx8WtrHug&sig2=9eYS8DOTG8VOj3tJSKjyvg) each engine has a different set of interfaces, IE has the COM based [MSHTML](<htt... | Your best bet seems to be to define your own interface and write different adapters. In the likeliness that your C++ code won't be employing all DOM traversing capabilities, your interface will only have to define a compact set of traversal functions.
As a bonus of defining your own interface, you can easily write a m... |
435,433 | <p>What is the preferred/easiest way to find the control that is currently receiving user (keyboard) input in WinForms?</p>
<p>So far I have come up with the following:</p>
<pre><code>public static Control FindFocusedControl(Control control)
{
var container = control as ContainerControl;
return (null != conta... | [
{
"answer_id": 435510,
"author": "Xn0vv3r",
"author_id": 42475,
"author_profile": "https://Stackoverflow.com/users/42475",
"pm_score": 5,
"selected": false,
"text": "<p>After searching the Internet, I found the following on <a href=\"http://www.syncfusion.com/faq/windowsforms/faq_c41c.as... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435433",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23843/"
] | What is the preferred/easiest way to find the control that is currently receiving user (keyboard) input in WinForms?
So far I have come up with the following:
```
public static Control FindFocusedControl(Control control)
{
var container = control as ContainerControl;
return (null != container
? FindFo... | If you have other calls to the Windows API already, there's no harm in using Peters solution. But I understand your worries about it and would tend to a similar solution as yours, using only the Framework functionalities. After all, the performance difference (if there is one) shouldn't be significant.
I would take a ... |
435,437 | <p>Our java applet needs to open a new htm page to web browser but popup blocker seem to block this code:</p>
<pre><code> try
{
AppletContext a = getAppletContext();
URL url = new URL(link);
a.showDocument(url,"_blank");
}
</code></pre>
<p>can you use somehow live javascript to open a wind... | [
{
"answer_id": 435451,
"author": "Andrzej Doyle",
"author_id": 45664,
"author_profile": "https://Stackoverflow.com/users/45664",
"pm_score": 0,
"selected": false,
"text": "<p>I am fairly sure that any popup blocker worth its salt will block popups. No matter what you put on your page, t... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20979/"
] | Our java applet needs to open a new htm page to web browser but popup blocker seem to block this code:
```
try
{
AppletContext a = getAppletContext();
URL url = new URL(link);
a.showDocument(url,"_blank");
}
```
can you use somehow live javascript to open a window instead? | `AppletContext` show document is implemented by doing the JavaScript call. However, the context the popup blocker is using will probably be absent. If the click happens outside of an applet you can use only JavaScript to open the popup, but using a URL supplied by the applet (so the applet never has to call out to Java... |
435,442 | <p>I am writing a JSON response from a perl/cgi program. The header's content type needs to be "application/json". But it doesn't seems to be recognized as response is thrown as a text file. </p>
<p>I would be capturing response using JSON library of jQuery. Where am I missing in sending the JSON response. </p>
| [
{
"answer_id": 435521,
"author": "cheng81",
"author_id": 46754,
"author_profile": "https://Stackoverflow.com/users/46754",
"pm_score": 1,
"selected": false,
"text": "<p>Even if you specify the type \"application/json\" you still need to parse the text. jQuery do this for you, using the $... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435442",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50851/"
] | I am writing a JSON response from a perl/cgi program. The header's content type needs to be "application/json". But it doesn't seems to be recognized as response is thrown as a text file.
I would be capturing response using JSON library of jQuery. Where am I missing in sending the JSON response. | I am doing this in a perl/cgi program.
I use these in the top of my code:
```
use CGI qw(:standard);
use JSON;
```
Then I print the json header:
```
print header('application/json');
```
which is a content type of:
```
Content-Type: application/json
```
And then I print out the JSON like this:
```
my $json->... |
435,444 | <p>I'm changing our application from "one set of code & one database" to "one set of code to multiple databases (one database per customer)".</p>
<p>The original code is VS2005 ASP.NET(VB) & lots of XSD's in a separate DLL. The web.config's ConnectionString would override the one stored in the DLL at runtime.<... | [
{
"answer_id": 436126,
"author": "DomBat",
"author_id": 54170,
"author_profile": "https://Stackoverflow.com/users/54170",
"pm_score": 4,
"selected": true,
"text": "<p>After a bit of research, it seems that an XSD has a property called ConnectionModifier. </p>\n\n<p>To find it, on your XS... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435444",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54170/"
] | I'm changing our application from "one set of code & one database" to "one set of code to multiple databases (one database per customer)".
The original code is VS2005 ASP.NET(VB) & lots of XSD's in a separate DLL. The web.config's ConnectionString would override the one stored in the DLL at runtime.
Now I need to cha... | After a bit of research, it seems that an XSD has a property called ConnectionModifier.
To find it, on your XSD diagram, click the TableAdapter part of the diagram (where the queries are defined).
In the properties window, change ConnectionModifier to Public and click Save. (This seems to change the property for all... |
435,446 | <p>Is it possible to have a <code>draggable</code> element with more than one handle? </p>
<p>I am initializing it twice, each time with a different handle param, but it doesn't work - only the first one works.</p>
| [
{
"answer_id": 435499,
"author": "James",
"author_id": 21677,
"author_profile": "https://Stackoverflow.com/users/21677",
"pm_score": 5,
"selected": true,
"text": "<p>You should only pass the 'handle' param once, and it can either be a selector or an elements(/s).</p>\n\n<p>So, to make it... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435446",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/52016/"
] | Is it possible to have a `draggable` element with more than one handle?
I am initializing it twice, each time with a different handle param, but it doesn't work - only the first one works. | You should only pass the 'handle' param once, and it can either be a selector or an elements(/s).
So, to make it work with more than one handle:
```
$(elem).draggable({
handle: '#handle1, #handle2',
});
```
More info / source: <http://docs.jquery.com/UI/Draggables/draggable> |
435,466 | <p>We have some auto-generated resource files in our project in Visual Studio 2008, with some localized versions, and in one of these localized versions, there is a string which in this case is empty.</p>
<p>More explicit. We have a core resource file, with lots of string resources. We then have 4 other localized vers... | [
{
"answer_id": 483795,
"author": "Ishmaeel",
"author_id": 227,
"author_profile": "https://Stackoverflow.com/users/227",
"pm_score": 0,
"selected": false,
"text": "<p>How much do you need a resource whose value is an empty string? I can imagine some multilingual scenarios where some resou... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267/"
] | We have some auto-generated resource files in our project in Visual Studio 2008, with some localized versions, and in one of these localized versions, there is a string which in this case is empty.
More explicit. We have a core resource file, with lots of string resources. We then have 4 other localized versions of th... | You might try creating a string resource empty\_string, defined as "" for every locale. If you make it the first resource, the form designer will (hopefully) always pick that one as the value to sprinkle through your forms. This way at least you'll be using a string designated for that purpose. |
435,474 | <p>Link is: <a href="http://people.apache.org/~ruchithf/hw-axis2/" rel="nofollow noreferrer">http://people.apache.org/~ruchithf/hw-axis2/</a>.</p>
<p>Command line is: <code>javac -extdirs d:\lib\ D:\stub\src\org\apache\ws\axis2\*.java -d d:\clientcode\</code></p>
<p>The Error is:</p>
<pre><code>C:\Program
Files\Java... | [
{
"answer_id": 483795,
"author": "Ishmaeel",
"author_id": 227,
"author_profile": "https://Stackoverflow.com/users/227",
"pm_score": 0,
"selected": false,
"text": "<p>How much do you need a resource whose value is an empty string? I can imagine some multilingual scenarios where some resou... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Link is: <http://people.apache.org/~ruchithf/hw-axis2/>.
Command line is: `javac -extdirs d:\lib\ D:\stub\src\org\apache\ws\axis2\*.java -d d:\clientcode\`
The Error is:
```
C:\Program
Files\Java\jdk1.6.0\bin>javac -extdirs
d:\lib\ D:\stub\src\org\apache
\ws\axis2\*.java -d d:\clientcode\
D:\stub\src\org\apache\ws\a... | You might try creating a string resource empty\_string, defined as "" for every locale. If you make it the first resource, the form designer will (hopefully) always pick that one as the value to sprinkle through your forms. This way at least you'll be using a string designated for that purpose. |
435,476 | <p>I have a C# project in VS2008 which I wish to build for two targets - x86 and the compact framework for dot net (CF.Net) depending on a chosen configuration (say Debug/SmartDeviceDebug etc). How do I go about this? I have an inkling this can be done somehow using the command line and msbuild but I am interested in a... | [
{
"answer_id": 435508,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 3,
"selected": true,
"text": "<p>I believe the csproj has to be radically different to build for different frameworks. However, there are tricks; fo... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435476",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39648/"
] | I have a C# project in VS2008 which I wish to build for two targets - x86 and the compact framework for dot net (CF.Net) depending on a chosen configuration (say Debug/SmartDeviceDebug etc). How do I go about this? I have an inkling this can be done somehow using the command line and msbuild but I am interested in a so... | I believe the csproj has to be radically different to build for different frameworks. However, there are tricks; for example, you can use wildcards in the csproj. I use this in [protobuf-net](http://code.google.com/p/protobuf-net/), which builds on .NET 2.0/3.0/CF 2.0/CF 3.5/Silverlight/Mono - so I know what you mean!
... |
435,491 | <p>I'm currently working on a Mips Code Generator for my Pascal Parser (Written in C using Lex / Yacc) . Does anybode know of a Tool out there I can use as a reference in order assure correct Code Generation?</p>
| [
{
"answer_id": 435508,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 3,
"selected": true,
"text": "<p>I believe the csproj has to be radically different to build for different frameworks. However, there are tricks; fo... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43960/"
] | I'm currently working on a Mips Code Generator for my Pascal Parser (Written in C using Lex / Yacc) . Does anybode know of a Tool out there I can use as a reference in order assure correct Code Generation? | I believe the csproj has to be radically different to build for different frameworks. However, there are tricks; for example, you can use wildcards in the csproj. I use this in [protobuf-net](http://code.google.com/p/protobuf-net/), which builds on .NET 2.0/3.0/CF 2.0/CF 3.5/Silverlight/Mono - so I know what you mean!
... |
435,538 | <p>My previous experience with ASP.NET web application (regarding the timeout) is that it logouts the user every 30 minutes, regardless of what module is running, Is there a way that we can increase the application timeout to an hour or two?</p>
<p>Any help is highly appreciated, thanks in advance.</p>
| [
{
"answer_id": 435550,
"author": "Peter Lindholm",
"author_id": 45467,
"author_profile": "https://Stackoverflow.com/users/45467",
"pm_score": 2,
"selected": false,
"text": "<p>You can set the Sesion timeout in your web.config file.</p>\n\n<pre><code><sessionState timeout=\"60\" />\... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435538",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48581/"
] | My previous experience with ASP.NET web application (regarding the timeout) is that it logouts the user every 30 minutes, regardless of what module is running, Is there a way that we can increase the application timeout to an hour or two?
Any help is highly appreciated, thanks in advance. | You can set the Sesion timeout in your web.config file.
```
<sessionState timeout="60" />
```
The value is defined in minutes.
I think you can set it programmatically as well from the HttpContext.Current.Session object. |
435,540 | <p>I have a database which is in Access (you can get it <a href="http://cid-84dd6ce2da273835.skydrive.live.com/self.aspx/.Public/Unisa.accdb" rel="nofollow noreferrer">link text</a>). If I run</p>
<pre><code>SELECT DISTINCT Spl.Spl_No, Spl.Spl_Name
FROM Spl INNER JOIN Del
ON Spl.Spl_No = Del.Spl_No
WHERE Del.Item_... | [
{
"answer_id": 435565,
"author": "Joel Coehoorn",
"author_id": 3043,
"author_profile": "https://Stackoverflow.com/users/3043",
"pm_score": 0,
"selected": false,
"text": "<p>Suppliers that have never delivered a compass:</p>\n\n<pre><code>SELECT Spl.Spl_No, Spl.Spl_Name\nFROM Spl\nLEFT JO... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/53236/"
] | I have a database which is in Access (you can get it [link text](http://cid-84dd6ce2da273835.skydrive.live.com/self.aspx/.Public/Unisa.accdb)). If I run
```
SELECT DISTINCT Spl.Spl_No, Spl.Spl_Name
FROM Spl INNER JOIN Del
ON Spl.Spl_No = Del.Spl_No
WHERE Del.Item_Name <> 'Compass'
```
It provides the names of th... | Do you mean something like this?
```
SELECT SPL.SPL_Name
FROM SPL
WHERE NOT SPL.SPL_no IN
(SELECT SPL_no FROM DEL WHERE DEL.Item_Name = "Compass")
``` |
435,553 | <p>Does creating an object using reflection rather than calling the class constructor result in any significant performance differences?</p>
| [
{
"answer_id": 435563,
"author": "Elie",
"author_id": 23249,
"author_profile": "https://Stackoverflow.com/users/23249",
"pm_score": 3,
"selected": false,
"text": "<p>Yes, it is significantly slower. We were running some code that did that, and while I don't have the metrics available at ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4316/"
] | Does creating an object using reflection rather than calling the class constructor result in any significant performance differences? | **Yes - absolutely.** Looking up a class via reflection is, *by magnitude*, more expensive.
Quoting [Java's documentation on reflection](http://java.sun.com/docs/books/tutorial/reflect/index.html):
>
> Because reflection involves types that are dynamically resolved, certain Java virtual machine optimizations can not... |
435,577 | <p>Thanks in advance for any help, guys and gals!</p>
<p>I just upgraded to Wordpress 2.7, and have to admin accounts, but regardless of which one I log into, it still says "Howdy, Jesse..." in the top corner.</p>
<p>Anyone have any insight to this?</p>
| [
{
"answer_id": 435563,
"author": "Elie",
"author_id": 23249,
"author_profile": "https://Stackoverflow.com/users/23249",
"pm_score": 3,
"selected": false,
"text": "<p>Yes, it is significantly slower. We were running some code that did that, and while I don't have the metrics available at ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435577",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54184/"
] | Thanks in advance for any help, guys and gals!
I just upgraded to Wordpress 2.7, and have to admin accounts, but regardless of which one I log into, it still says "Howdy, Jesse..." in the top corner.
Anyone have any insight to this? | **Yes - absolutely.** Looking up a class via reflection is, *by magnitude*, more expensive.
Quoting [Java's documentation on reflection](http://java.sun.com/docs/books/tutorial/reflect/index.html):
>
> Because reflection involves types that are dynamically resolved, certain Java virtual machine optimizations can not... |
435,582 | <p>My asp.net applications works fine everyday.
Until last month, my web start to get 2-3 time of problem with Sqlsession state server as
follow:</p>
<blockquote>
<p>Blockquote
System.Web.HttpException Exception of type 'System.Web.HttpException' was thrown. at System.Web.HttpAsyncResult.End() at System.... | [
{
"answer_id": 435642,
"author": "Ta01",
"author_id": 7280,
"author_profile": "https://Stackoverflow.com/users/7280",
"pm_score": 2,
"selected": false,
"text": "<p>I have seen this exact error happen when a developer was using a high number of SqldataReaders to get data to build some sor... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35682/"
] | My asp.net applications works fine everyday.
Until last month, my web start to get 2-3 time of problem with Sqlsession state server as
follow:
>
> Blockquote
> System.Web.HttpException Exception of type 'System.Web.HttpException' was thrown. at System.Web.HttpAsyncResult.End() at System.Web.SessionState.SessionStat... | It's quite some time since this post was first raised, but I've recently experienced this exact issue in a Production environment and thought it may be useful for others in the future.
We have an ASP.NET MVC web application running on .NET 4.5.2 load-balanced across two nodes. The application was configured to store ... |
435,588 | <p>I'm trying to display a table full of twitter statuses (yes, this is the <a href="http://cs193p.stanford.edu/downloads/AssignmentPresence2.pdf" rel="nofollow noreferrer">Stanford Presence 2</a> assignment), which are variably sized. I can relatively easily determine the appropriate height for my rows with code that... | [
{
"answer_id": 435611,
"author": "Stephen Darlington",
"author_id": 2998,
"author_profile": "https://Stackoverflow.com/users/2998",
"pm_score": 3,
"selected": true,
"text": "<p>You might want to look at the <code>userInteractionEnabled</code> property of the <code>UITextView</code>. That... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435588",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12254/"
] | I'm trying to display a table full of twitter statuses (yes, this is the [Stanford Presence 2](http://cs193p.stanford.edu/downloads/AssignmentPresence2.pdf) assignment), which are variably sized. I can relatively easily determine the appropriate height for my rows with code that approximates (from [accompanying lecture... | You might want to look at the `userInteractionEnabled` property of the `UITextView`. That should allow input to be passed through to the `UITableView` so you get scrolling. |
435,589 | <p>I want to refresh with ajax just a part of a site.I searched protorypjs and i found ajax.updater but i am having trobule making it work.
this is part of my page</p>
<pre><code><li id="Home"><a href="index.html">Home</a></li>
</code></pre>
<p>Can anyone tell me how i can implement this : Aja... | [
{
"answer_id": 435610,
"author": "Karsten",
"author_id": 28144,
"author_profile": "https://Stackoverflow.com/users/28144",
"pm_score": 1,
"selected": false,
"text": "<p>One solution to update content is by using</p>\n\n<pre><code>$('#refreshMe').innerHtml(_new_ajax_content_);\n</code></p... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435589",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I want to refresh with ajax just a part of a site.I searched protorypjs and i found ajax.updater but i am having trobule making it work.
this is part of my page
```
<li id="Home"><a href="index.html">Home</a></li>
```
Can anyone tell me how i can implement this : Ajax.Updater(container, url[, options]) ?
and make it... | One solution to update content is by using
```
$('#refreshMe').innerHtml(_new_ajax_content_);
```
where element is i.e. a
```
<div id="refreshMe">
```
If you want more specific help, you should post more information/code from your project. |
435,606 | <p>What is the easiest way using common linux tools to check if a bunch of ip addresses belongs to given network? I just need a number of how many of given addresses belongs to given subnet. Lets say network is 192.16.55.40/27 and addresses is 192.16.55.45, 192.16.55.115, 88.87.45.8, 192.16.55.37, 192.16.55.60 and 192.... | [
{
"answer_id": 435636,
"author": "Keltia",
"author_id": 16143,
"author_profile": "https://Stackoverflow.com/users/16143",
"pm_score": 4,
"selected": true,
"text": "<p>I'm not sure whether you consider Ruby as a \"common linux tool\" but it has a nice module called <code>IPAddr</code> tha... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/53319/"
] | What is the easiest way using common linux tools to check if a bunch of ip addresses belongs to given network? I just need a number of how many of given addresses belongs to given subnet. Lets say network is 192.16.55.40/27 and addresses is 192.16.55.45, 192.16.55.115, 88.87.45.8, 192.16.55.37, 192.16.55.60 and 192.16.... | I'm not sure whether you consider Ruby as a "common linux tool" but it has a nice module called `IPAddr` that has a method called `include?` for that.
```
require 'ipaddr'
net1 = IPAddr.new("192.168.2.0/24")
net2 = IPAddr.new("192.168.2.100")
net3 = IPAddr.new("192.168.3.0")
p net1.include?(net2) #=> true
p net1.... |
435,607 | <p>When I add www.stackoverflow.com into my RichTextBox and run the program it is shown in blue and as a hyperlink yet when I click it nothing happens. How can I fix this?</p>
| [
{
"answer_id": 435613,
"author": "Andrew Hare",
"author_id": 34211,
"author_profile": "https://Stackoverflow.com/users/34211",
"pm_score": 1,
"selected": false,
"text": "<p>Is <code>yourTextBox.DetectUrls</code> set to true? We may need some more info to provide a better answer.</p>\n"
... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | When I add www.stackoverflow.com into my RichTextBox and run the program it is shown in blue and as a hyperlink yet when I click it nothing happens. How can I fix this? | 1. Make sure the text property includes a valid url. E.g. <http://www.stackoverflow.com/>
2. set the **DetectUrls** property to **true**
3. Write an event handler for the **LinkClicked** event.
Personally, I wouldn't pass **"IExplore.exe"** in as a parameter to the **Process.Start** call as Microsoft advise as this pr... |
435,627 | <p>< backgound></p>
<p>I'm at a point where I really need to optimize C++ code. I'm writing a library for molecular simulations and I need to add a new feature. I already tried to add this feature in the past, but I then used virtual functions called in nested loops. I had bad feelings about that and the first i... | [
{
"answer_id": 435641,
"author": "Jasper Bekkers",
"author_id": 31486,
"author_profile": "https://Stackoverflow.com/users/31486",
"pm_score": 1,
"selected": false,
"text": "<p>Unless you have a <em>really</em> aggressive compiler (can happen), I'd suggest calculating a checksum (simply a... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49886/"
] | < backgound>
I'm at a point where I really need to optimize C++ code. I'm writing a library for molecular simulations and I need to add a new feature. I already tried to add this feature in the past, but I then used virtual functions called in nested loops. I had bad feelings about that and the first implementation pr... | If you want to force *any* compiler to not discard a result, have it write the result to a volatile object. That operation cannot be optimized out, by definition.
```
template<typename T> void sink(T const& t) {
volatile T sinkhole = t;
}
```
No iostream overhead, just a copy that has to remain in the generated c... |
435,629 | <p>I register my two interfaces on application start as so:-</p>
<pre><code>container.Register(Component.For(typeof(IEntityIndexController)).ImplementedBy(typeof(SnippetController)).LifeStyle.Transient);
container.Register(Component.For(typeof(ISnippetController)).ImplementedBy(typeof(SnippetController)).LifeStyle.Tra... | [
{
"answer_id": 442170,
"author": "Krzysztof Kozmic",
"author_id": 13163,
"author_profile": "https://Stackoverflow.com/users/13163",
"pm_score": 3,
"selected": true,
"text": "<p>Have you tried registering with different syntax (<code>AddComponent<></code>)?</p>\n\n<p>Try updating to... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435629",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54182/"
] | I register my two interfaces on application start as so:-
```
container.Register(Component.For(typeof(IEntityIndexController)).ImplementedBy(typeof(SnippetController)).LifeStyle.Transient);
container.Register(Component.For(typeof(ISnippetController)).ImplementedBy(typeof(SnippetController)).LifeStyle.Transient);
```
... | Have you tried registering with different syntax (`AddComponent<>`)?
Try updating to latest trunk version and see if it helps. Looks like a bug to me.
If it does not happen, create a test that exhibits the bug, and submit it [here](http://support.castleproject.org/projects/IOC) |
435,634 | <p>I can't seem to get this to work. I want to pull a CSV file from a different webserver to read in my application. This is how I'd like to call it:</p>
<pre><code>url = 'http://www.testing.com/test.csv'
records = FasterCSV.read(url, :headers => true, :header_converters => :symbol)
</code></pre>
<p>But that ... | [
{
"answer_id": 435643,
"author": "Keltia",
"author_id": 16143,
"author_profile": "https://Stackoverflow.com/users/16143",
"pm_score": 1,
"selected": false,
"text": "<p>I would retrieve the file with <code>Net::HTTP</code> for example and feed that to <code>FasterCSV</code></p>\n\n<p>Extr... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435634",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32154/"
] | I can't seem to get this to work. I want to pull a CSV file from a different webserver to read in my application. This is how I'd like to call it:
```
url = 'http://www.testing.com/test.csv'
records = FasterCSV.read(url, :headers => true, :header_converters => :symbol)
```
But that doesn't work. I tried Googling, an... | ```
require 'open-uri'
url = 'http://www.testing.com/test.csv'
open(url) do |f|
f.each_line do |line|
FasterCSV.parse(line) do |row|
# Your code here
end
end
end
```
<http://www.ruby-doc.org/core/classes/OpenURI.html>
<http://fastercsv.rubyforge.org/> |
435,638 | <p>I have a project that has a revision number of 3960. But unfortunately it is not under source control. Now I would like to put it under SVN and use Tortoise SVN. But when I put it there it will have revision from 1,2,3,4 and so on. </p>
<p>Is there a way to change the revision number to 3960?</p>
| [
{
"answer_id": 435652,
"author": "VonC",
"author_id": 6309,
"author_profile": "https://Stackoverflow.com/users/6309",
"pm_score": 3,
"selected": false,
"text": "<p>It is <a href=\"http://www.philmug.ph/forum/showthread.php?t=31613\" rel=\"nofollow noreferrer\">possible in theory</a>, but... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435638",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38940/"
] | I have a project that has a revision number of 3960. But unfortunately it is not under source control. Now I would like to put it under SVN and use Tortoise SVN. But when I put it there it will have revision from 1,2,3,4 and so on.
Is there a way to change the revision number to 3960? | The safest way I can think of would be to make a dump file with an appropriate number of empty revisions, than load it. The format would be something like:
```
SVN-fs-dump-format-version: 2
Revision-number: 0
Prop-content-length: 56
Content-length: 56
K 8
svn:date
V 27
2009-01-12T14:58:15.449041Z
PROPS-END
Revision... |
435,640 | <p>I've set up a queue by configuring it in activemq.xml (ActiveMQ version 5.2.0) as described in the <a href="http://activemq.apache.org/configure-startup-destinations.html" rel="noreferrer">documentation</a>.</p>
<pre><code><destinations>
<queue physicalName="FOO.BAR" />
<queue physicalName="D... | [
{
"answer_id": 436833,
"author": "James Strachan",
"author_id": 2068211,
"author_profile": "https://Stackoverflow.com/users/2068211",
"pm_score": 4,
"selected": true,
"text": "<p>Firstly you don't have to <a href=\"http://activemq.apache.org/how-do-i-create-new-destinations.html\" rel=\"... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33429/"
] | I've set up a queue by configuring it in activemq.xml (ActiveMQ version 5.2.0) as described in the [documentation](http://activemq.apache.org/configure-startup-destinations.html).
```
<destinations>
<queue physicalName="FOO.BAR" />
<queue physicalName="DUMMY" />
</destinations>
```
I'm trying to access it fr... | Firstly you don't have to [explicitly create any queues in the broker](http://activemq.apache.org/how-do-i-create-new-destinations.html) though it does no harm.
Also the destinations available in the broker are not auto-magically mapped into a JNDI context for you using some kind of JNDI name.
You can do this [explic... |
435,646 | <p>Suppose you have a history containing the three commits <i>A, B</i> and <i>C</i>:</p>
<pre><code>A-B-C
</code></pre>
<p>I would like to combine the two commits <i>A</i> and <i>B</i> to one commit <i>AB</i>:</p>
<pre><code>AB-C
</code></pre>
<p>I tried</p>
<pre><code>git rebase -i A
</code></pre>
<p>which opens... | [
{
"answer_id": 435686,
"author": "Loki",
"author_id": 39057,
"author_profile": "https://Stackoverflow.com/users/39057",
"pm_score": 3,
"selected": false,
"text": "<p>In the case of interactive rebase, you have to do it before A so that the list will be:</p>\n\n<pre><code>pick A\npick B\n... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435646",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54193/"
] | Suppose you have a history containing the three commits *A, B* and *C*:
```
A-B-C
```
I would like to combine the two commits *A* and *B* to one commit *AB*:
```
AB-C
```
I tried
```
git rebase -i A
```
which opens up my editor with the following contents:
```
pick e97a17b B
pick asd314f C
```
I change this... | Use `git rebase -i --root`
as of Git [version 1.7.12](https://github.com/git/git/blob/master/Documentation/RelNotes/1.7.12.txt).
In the interactive rebase file, change the second line of commit *B* to *squash* and leave the other lines at *pick*:
```
pick f4202da A
squash bea708e B
pick a8c6abc C
```
This will comb... |
435,647 | <p>I am not able to restrict this code to scroll only the front_mc and back_mc, in the front_mc are nested buttons that work and showing content on click - but the mouse-movement gets captured all the time so also content of the menu gets scrolled, when mouse is moved. please help me guys, I am not fit enough to deal w... | [
{
"answer_id": 435686,
"author": "Loki",
"author_id": 39057,
"author_profile": "https://Stackoverflow.com/users/39057",
"pm_score": 3,
"selected": false,
"text": "<p>In the case of interactive rebase, you have to do it before A so that the list will be:</p>\n\n<pre><code>pick A\npick B\n... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I am not able to restrict this code to scroll only the front\_mc and back\_mc, in the front\_mc are nested buttons that work and showing content on click - but the mouse-movement gets captured all the time so also content of the menu gets scrolled, when mouse is moved. please help me guys, I am not fit enough to deal w... | Use `git rebase -i --root`
as of Git [version 1.7.12](https://github.com/git/git/blob/master/Documentation/RelNotes/1.7.12.txt).
In the interactive rebase file, change the second line of commit *B* to *squash* and leave the other lines at *pick*:
```
pick f4202da A
squash bea708e B
pick a8c6abc C
```
This will comb... |
435,651 | <p>I am running an Execute SQL Task statement in my SSIS package. The Execute SQL Task is running sql and checking that the tables have more than 1000 rows. If they have less than 1000 rows, I want to fail the package. </p>
<p>How do I force a fail inside of a SQL statement?</p>
| [
{
"answer_id": 435707,
"author": "Harper Shelby",
"author_id": 21196,
"author_profile": "https://Stackoverflow.com/users/21196",
"pm_score": 5,
"selected": true,
"text": "<p>AFAIK, tasks in SSIS fail on error. So if your Execute SQL Task has a statment like so in it:</p>\n\n<pre><code>de... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38613/"
] | I am running an Execute SQL Task statement in my SSIS package. The Execute SQL Task is running sql and checking that the tables have more than 1000 rows. If they have less than 1000 rows, I want to fail the package.
How do I force a fail inside of a SQL statement? | AFAIK, tasks in SSIS fail on error. So if your Execute SQL Task has a statment like so in it:
```
declare @count int
select @count = select count(*) from my_table
if @count < 1000
begin
raiserror('Too few rows in my_table',16,1)
end
else
begin
-- Process your table here
end
```
You should get the results you... |
435,668 | <p>Looking for some sample code (C#) for a simple thread pool implementation.</p>
<p>I found one on codeproject, but the codebase was just huge and I don't need all that functionality.</p>
<p>This is more for educational purposes anyways.</p>
| [
{
"answer_id": 435691,
"author": "GEOCHET",
"author_id": 5640,
"author_profile": "https://Stackoverflow.com/users/5640",
"pm_score": 6,
"selected": true,
"text": "<p>There is no need to implement your own, since it is not very hard to use the existing .NET implementation.</p>\n\n<p>From ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435668",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] | Looking for some sample code (C#) for a simple thread pool implementation.
I found one on codeproject, but the codebase was just huge and I don't need all that functionality.
This is more for educational purposes anyways. | There is no need to implement your own, since it is not very hard to use the existing .NET implementation.
From [ThreadPool Documentation](https://learn.microsoft.com/en-us/dotnet/api/system.threading.threadpool.queueuserworkitem?view=netframework-4.8#System_Threading_ThreadPool_QueueUserWorkItem_System_Threading_Wait... |
435,676 | <p>I am trying to add data to a newly created column... </p>
<pre><code>DataSet ds = new DataSet;
ds.Tables[0].Columns.Add("Count");
Data.DataSource = ds;
Data.DataBind();
</code></pre>
<p>Where do I add, a hardcoded count? (I want count column to have '4')</p>
| [
{
"answer_id": 435691,
"author": "GEOCHET",
"author_id": 5640,
"author_profile": "https://Stackoverflow.com/users/5640",
"pm_score": 6,
"selected": true,
"text": "<p>There is no need to implement your own, since it is not very hard to use the existing .NET implementation.</p>\n\n<p>From ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435676",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54197/"
] | I am trying to add data to a newly created column...
```
DataSet ds = new DataSet;
ds.Tables[0].Columns.Add("Count");
Data.DataSource = ds;
Data.DataBind();
```
Where do I add, a hardcoded count? (I want count column to have '4') | There is no need to implement your own, since it is not very hard to use the existing .NET implementation.
From [ThreadPool Documentation](https://learn.microsoft.com/en-us/dotnet/api/system.threading.threadpool.queueuserworkitem?view=netframework-4.8#System_Threading_ThreadPool_QueueUserWorkItem_System_Threading_Wait... |
435,678 | <p>I am using <a href="http://api.rubyonrails.org/classes/ActiveRecord/Inheritance.html" rel="nofollow noreferrer">single table inheritance</a> in my rails application, and want to explicitly set the type of an instance.</p>
<p>I have the following;</p>
<pre><code>class Event < ActiveRecord::Base
class SpecialEven... | [
{
"answer_id": 435743,
"author": "Codebeef",
"author_id": 12037,
"author_profile": "https://Stackoverflow.com/users/12037",
"pm_score": 6,
"selected": true,
"text": "<p>If you're trying to dynamically instantiate a subtype, and you have the type as a string, you can do this:</p>\n\n<pre>... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435678",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43965/"
] | I am using [single table inheritance](http://api.rubyonrails.org/classes/ActiveRecord/Inheritance.html) in my rails application, and want to explicitly set the type of an instance.
I have the following;
```
class Event < ActiveRecord::Base
class SpecialEvent < Event
```
which is implemented through single table inh... | If you're trying to dynamically instantiate a subtype, and you have the type as a string, you can do this:
```
'SpecialEvent'.constantize.new()
``` |
435,703 | <p>I am storing the response to various rpc calls in a mysql table with the following fields:</p>
<pre><code>Table: rpc_responses
timestamp (date)
method (varchar)
id (varchar)
response (mediumtext)
PRIMARY KEY(timestamp,method,id)
</code></pre>
<p>What is the best method of selecting the most re... | [
{
"answer_id": 435709,
"author": "Ken",
"author_id": 20074,
"author_profile": "https://Stackoverflow.com/users/20074",
"pm_score": 5,
"selected": true,
"text": "<p>Self answered, but I'm not sure that it will be an efficient enough solution as the table grows:</p>\n<pre><code>SELECT time... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435703",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20074/"
] | I am storing the response to various rpc calls in a mysql table with the following fields:
```
Table: rpc_responses
timestamp (date)
method (varchar)
id (varchar)
response (mediumtext)
PRIMARY KEY(timestamp,method,id)
```
What is the best method of selecting the most recent responses for all exi... | Self answered, but I'm not sure that it will be an efficient enough solution as the table grows:
```
SELECT timestamp,method,id,response FROM rpc_responses
INNER JOIN
(SELECT max(timestamp) as timestamp,method,id FROM rpc_responses GROUP BY method,id) latest
USING (timestamp,method,id);
``` |
435,705 | <p>I was using <a href="http://www.apachefriends.org/en/xampp.html" rel="noreferrer">xampp</a> to develop locally and then I installed the PHP from the direct installer. Now in some of my PHP code, only PHP code that starts with <code>"<?php</code>" is correctly parsed. Anything that starts with "<code><?</code>"... | [
{
"answer_id": 435710,
"author": "Karsten",
"author_id": 28144,
"author_profile": "https://Stackoverflow.com/users/28144",
"pm_score": 6,
"selected": true,
"text": "<p>This is a php.ini setting named</p>\n\n<pre><code>short_open_tag = 1 # (enabled)\n</code></pre>\n"
},
{
"answer_... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39371/"
] | I was using [xampp](http://www.apachefriends.org/en/xampp.html) to develop locally and then I installed the PHP from the direct installer. Now in some of my PHP code, only PHP code that starts with `"<?php`" is correctly parsed. Anything that starts with "`<?`" or "`<?=`" is completely ignored and just left as is.
How... | This is a php.ini setting named
```
short_open_tag = 1 # (enabled)
``` |
435,708 | <p>I am using some features that are provided in GCC v4+ and would like CMake to find GCC v4 compiler and if it does not find it, return an error stating GCC v4 is required.</p>
<p>Anyone have any modules / ideas on how to do something like this?</p>
<p>Thanks.</p>
| [
{
"answer_id": 435788,
"author": "JesperE",
"author_id": 13051,
"author_profile": "https://Stackoverflow.com/users/13051",
"pm_score": 4,
"selected": true,
"text": "<p>Use the try_compile() command and try to compile the following program</p>\n\n<pre><code>#if __GNUC__ != 4\n#error\n#end... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/52704/"
] | I am using some features that are provided in GCC v4+ and would like CMake to find GCC v4 compiler and if it does not find it, return an error stating GCC v4 is required.
Anyone have any modules / ideas on how to do something like this?
Thanks. | Use the try\_compile() command and try to compile the following program
```
#if __GNUC__ != 4
#error
#endif
int main() { return 0; }
``` |
435,719 | <p>I am having a really bad issue where no matter what I try, the user is being logged off after 10 minutes.</p>
<p>I am using ASP.Net 2.0 running on IIS 6.0 on Server 2003 R2 Standard Edition running as a Virtual Server with all applicable updates and .Net 3.5 SP1.</p>
<p>The client is Internet Explorer 7.0</p>
<p>... | [
{
"answer_id": 435739,
"author": "inferis",
"author_id": 51998,
"author_profile": "https://Stackoverflow.com/users/51998",
"pm_score": 0,
"selected": false,
"text": "<p>I vaguely recall something about the IIS session timeout settings being able to override whatever you have set in the w... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13502/"
] | I am having a really bad issue where no matter what I try, the user is being logged off after 10 minutes.
I am using ASP.Net 2.0 running on IIS 6.0 on Server 2003 R2 Standard Edition running as a Virtual Server with all applicable updates and .Net 3.5 SP1.
The client is Internet Explorer 7.0
Below are the web.config... | It could also (have been) that the machinekey was not set and thus being randomly generated every time the app was initialized (which would mean that the encrypted authentication ticket would be salted with a new key).
I use a site to generate a new machinekey for my apps and stick it in the web.config:
<http://www.... |
435,721 | <p>I'm looking to build a "quick link" directory access widget.
e.g. (option 1)</p>
<pre><code>0-9 | A-F | G-K | L-P | Q-U | V-Z
</code></pre>
<p>Where each would be a link into sub-chunks of a directory starting with that character. The widget itself would be used in multiple places for looking up contacts, compani... | [
{
"answer_id": 435727,
"author": "James B",
"author_id": 2951,
"author_profile": "https://Stackoverflow.com/users/2951",
"pm_score": 1,
"selected": false,
"text": "<p>Well, one of the primary usability considerations is evenly-distributed groups, so either your current idea (0-9, A-F, et... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6144/"
] | I'm looking to build a "quick link" directory access widget.
e.g. (option 1)
```
0-9 | A-F | G-K | L-P | Q-U | V-Z
```
Where each would be a link into sub-chunks of a directory starting with that character. The widget itself would be used in multiple places for looking up contacts, companies, projects, etc.
Now, fo... | As a user I would most definitely prefer one link per letter.
But better (for me as a user) would be a search box. |
435,729 | <p>I would like to call <code>FindLast</code> on a collection which implements <code>IEnumerable</code>, but <code>FindLast</code> is only available for <code>List</code>. What is the best solution?</p>
| [
{
"answer_id": 435749,
"author": "davcar",
"author_id": 5033,
"author_profile": "https://Stackoverflow.com/users/5033",
"pm_score": 0,
"selected": false,
"text": "<p>Use the extension method Last()\nwhich is located in the namespace System.Linq.</p>\n"
},
{
"answer_id": 435754,
... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16012/"
] | I would like to call `FindLast` on a collection which implements `IEnumerable`, but `FindLast` is only available for `List`. What is the best solution? | The equivalent to:
```
var last = list.FindLast(predicate);
```
is
```
var last = sequence.Where(predicate).LastOrDefault();
```
(The latter will have to check *all* items in the sequence, however...)
Effectively the "Where()" is the Find part, and the "Last()" is the Last part of "FindLast" respectively. Simila... |
435,732 | <p>I would like to delay a hover event in jquery. I am reading from a file when user hovers over a link or label. I don't want this event to occur immediately in case the user is just moving the mouse across the screen. Is there a way to delay the event from firing?</p>
<p>Thank you.</p>
<p>Example code:</p>
<pre... | [
{
"answer_id": 435760,
"author": "roborourke",
"author_id": 42147,
"author_profile": "https://Stackoverflow.com/users/42147",
"pm_score": 8,
"selected": true,
"text": "<p>Use the hoverIntent plugin for jquery: <a href=\"http://cherne.net/brian/resources/jquery.hoverIntent.html\" rel=\"no... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5836/"
] | I would like to delay a hover event in jquery. I am reading from a file when user hovers over a link or label. I don't want this event to occur immediately in case the user is just moving the mouse across the screen. Is there a way to delay the event from firing?
Thank you.
Example code:
```
$(function() {
$('#c... | Use the hoverIntent plugin for jquery: <http://cherne.net/brian/resources/jquery.hoverIntent.html>
It's absolutely perfect for what you describe and I've used it on nearly every project that required mouseover activation of menus etc...
There is one gotcha to this approach, some interfaces are devoid of a 'hover' sta... |
435,769 | <p>My javascript paths work on this page:
<a href="http://localhost:53049/" rel="noreferrer">http://localhost:53049/</a></p>
<p>But not on this page:
<a href="http://localhost:53049/Home/Messages" rel="noreferrer">http://localhost:53049/Home/Messages</a></p>
<p>The reason is that the relative paths are different, the... | [
{
"answer_id": 435786,
"author": "jacobangel",
"author_id": 31318,
"author_profile": "https://Stackoverflow.com/users/31318",
"pm_score": 2,
"selected": false,
"text": "<p>Try setting the javascript to use a forward slash at the beginning, like \"/js/jquery.jqGrid.js\" This will set them... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435769",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4639/"
] | My javascript paths work on this page:
<http://localhost:53049/>
But not on this page:
<http://localhost:53049/Home/Messages>
The reason is that the relative paths are different, the former requires ("js/...") and the latter requires ("../../js/...").
I'm including my javascript in my Site.Master file:
```
<script ... | You can also use the Url.Content method call to make sure that the paths are correctly set.
Examples can be found [here](https://stackoverflow.com/questions/371591/jquery-in-an-asp-net-mvc-application-using-master-pages#371603). |
435,772 | <p>I recently <a href="http://social.msdn.microsoft.com/Forums/en-US/clr/thread/b18b0a27-e2fd-445a-bcb3-22a315cd6f0d/" rel="nofollow noreferrer">read this thread on MSDN</a>. So I was thinking of using a lambda expression as a way of calling EndInvoke just as a way to make sure everything is nice and tidy. Which woul... | [
{
"answer_id": 435782,
"author": "Boris Callens",
"author_id": 11333,
"author_profile": "https://Stackoverflow.com/users/11333",
"pm_score": 3,
"selected": false,
"text": "<p>You might want to read <a href=\"http://haacked.com/archive/2009/01/09/asynchronous-fire-and-forget-with-lambdas.... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/52051/"
] | I recently [read this thread on MSDN](http://social.msdn.microsoft.com/Forums/en-US/clr/thread/b18b0a27-e2fd-445a-bcb3-22a315cd6f0d/). So I was thinking of using a lambda expression as a way of calling EndInvoke just as a way to make sure everything is nice and tidy. Which would be more correct?
example 1:
```
Action... | Your 2nd example is slightly more efficient because the "method" delegate instance doesn't have to be captured in the closure. I doubt you'd ever notice. |
435,785 | <p>I have the following file:</p>
<pre><code><html>
<head>
<title></title>
<link rel="css" type="text/css" href="/empty.css" title="css" />
<script type="text/javascript" src="/Prototype"></script>
<script type="text/javascript">
function load_content()
{
var d = new D... | [
{
"answer_id": 435798,
"author": "Moran Helman",
"author_id": 1409636,
"author_profile": "https://Stackoverflow.com/users/1409636",
"pm_score": 1,
"selected": false,
"text": "<p>maybe this will help you ... \n<a href=\"http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml\" rel... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194/"
] | I have the following file:
```
<html>
<head>
<title></title>
<link rel="css" type="text/css" href="/empty.css" title="css" />
<script type="text/javascript" src="/Prototype"></script>
<script type="text/javascript">
function load_content()
{
var d = new Date();
new Ajax.PeriodicalUpdater('content', '/DOC?'+d.getTi... | Rather than changing the sheet in a single link, try using alternate style sheets. See this link on using alternate style sheets:
<http://www.alistapart.com/articles/alternate/> |
435,853 | <p>I have a simple form with some plain html input like bellow using ASP.NET Web Forms (not MVC)</p>
<pre><code><table id="tbl_SchoolDetails">
<tbody id="tbody_SchoolDetails">
<tr>
<td>
School Name
</td>
<td>
<input ... | [
{
"answer_id": 435863,
"author": "Bullines",
"author_id": 27870,
"author_profile": "https://Stackoverflow.com/users/27870",
"pm_score": 2,
"selected": false,
"text": "<p>HTML elements are not part of the ASP.NET lifecycle. An easy way to start would be to add the runat=\"server\" attrib... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1213936/"
] | I have a simple form with some plain html input like bellow using ASP.NET Web Forms (not MVC)
```
<table id="tbl_SchoolDetails">
<tbody id="tbody_SchoolDetails">
<tr>
<td>
School Name
</td>
<td>
<input id="SchoolDetails_SchoolName" type="text" value="<%= ... | Give the input both an id and a name and see if that doesn't solve your problem.
```
<input id="SchoolDetails_SchoolName"
name="SchoolDetails_SchoolName"
type="text"
value="<%= ViewModel.School.Name %>" />
```
The id property only identifies the tag within the DOM. The [name property](http://www... |
435,876 | <p>Is there a test suite for PDFs, preferably in Perl? What I want is some function to test positioning and existence of some text (and if possible a name of a grapic) in a PDF file. Is this theoritically possible with PDF markup?</p>
<p>Thank you for your help.</p>
| [
{
"answer_id": 435863,
"author": "Bullines",
"author_id": 27870,
"author_profile": "https://Stackoverflow.com/users/27870",
"pm_score": 2,
"selected": false,
"text": "<p>HTML elements are not part of the ASP.NET lifecycle. An easy way to start would be to add the runat=\"server\" attrib... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41093/"
] | Is there a test suite for PDFs, preferably in Perl? What I want is some function to test positioning and existence of some text (and if possible a name of a grapic) in a PDF file. Is this theoritically possible with PDF markup?
Thank you for your help. | Give the input both an id and a name and see if that doesn't solve your problem.
```
<input id="SchoolDetails_SchoolName"
name="SchoolDetails_SchoolName"
type="text"
value="<%= ViewModel.School.Name %>" />
```
The id property only identifies the tag within the DOM. The [name property](http://www... |
435,880 | <p>I have a GridView bound to an <code>ICollection<UserAnswer></code> that needs to show two columns:</p>
<pre><code><asp:GridView ID="UserAnswersGridView" runat="server">
<Columns>
<asp:BoundField DataField="Question.Name" HeaderText="Question Name" SortExpression="QuestionID" />
... | [
{
"answer_id": 435898,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 3,
"selected": true,
"text": "<p>I believe that <code>GridView</code> only supports properties of the immediate type. Is repeater or anything simila... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33137/"
] | I have a GridView bound to an `ICollection<UserAnswer>` that needs to show two columns:
```
<asp:GridView ID="UserAnswersGridView" runat="server">
<Columns>
<asp:BoundField DataField="Question.Name" HeaderText="Question Name" SortExpression="QuestionID" />
<asp:BoundField DataField="Score" Header... | I believe that `GridView` only supports properties of the immediate type. Is repeater or anything similar an option? That gives you more flexibility.
Alternatively, you can add shim properties to the type via a partial class:
```
namespace YourLinqNamespace {
partial class UserAnswer {
public string Quest... |
435,886 | <p>I have the following code:</p>
<pre><code>$sql = "INSERT INTO table VALUES ('', ...)";
$result = mysql_query($sql, $link) or die(mysql_error());
$id = mysql_insert_id($result) or die('oops'); //mysql_error() instead of oops produces the same result
echo $id . "\nDone";
</code></pre>
<p>The table that this insert o... | [
{
"answer_id": 435896,
"author": "Irmantas",
"author_id": 43182,
"author_profile": "https://Stackoverflow.com/users/43182",
"pm_score": 4,
"selected": true,
"text": "<p>You do not need to pass $result to mysql_insert_id you should pass $link variable.</p>\n"
},
{
"answer_id": 435... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435886",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115/"
] | I have the following code:
```
$sql = "INSERT INTO table VALUES ('', ...)";
$result = mysql_query($sql, $link) or die(mysql_error());
$id = mysql_insert_id($result) or die('oops'); //mysql_error() instead of oops produces the same result
echo $id . "\nDone";
```
The table that this insert occurs on has an auto-incro... | You do not need to pass $result to mysql\_insert\_id you should pass $link variable. |
435,916 | <p>I want to track and analyze web page load times on my user's systems.</p>
<p>I ran across this article <a href="http://www.panalysis.com/tracking-webpage-load-times.php" rel="nofollow noreferrer">http://www.panalysis.com/tracking-webpage-load-times.php</a> that uses Google analytics to track pages, but it's too coa... | [
{
"answer_id": 435956,
"author": "Ryan Doherty",
"author_id": 956,
"author_profile": "https://Stackoverflow.com/users/956",
"pm_score": 1,
"selected": false,
"text": "<p><a href=\"http://www.gomez.com/\" rel=\"nofollow noreferrer\">Gomez</a> has a service that tracks how long your websit... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7399/"
] | I want to track and analyze web page load times on my user's systems.
I ran across this article <http://www.panalysis.com/tracking-webpage-load-times.php> that uses Google analytics to track pages, but it's too coarse for my needs.
Are there any sites out there that specifically let you track page load times using a ... | [Gomez](http://www.gomez.com/) has a service that tracks how long your website takes to load. It doesn't use any JavaScript as far as I know.
Another good resource is <http://webpagetest.org/>. It allows you to test the load time manually, but offers a lot of analysis of your page. Latency, time to first byte, assets,... |
435,925 | <p>Each item in a WPF ListBox control seems to have a bit of left padding. How can I restyle to remove all padding?</p>
<p><img src="https://liijba.blu.livefilestore.com/y1pCGMhr_GaDEKJd4JWaVbyA-zXDL_IaGHOYsXQBPYFlihFt_eVmW9DX1EucSipT3nMygvki6UIDga_YLowF7vNmQ/ListBoxPadding.png" alt="Default Comparison"></p>
| [
{
"answer_id": 435969,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 3,
"selected": false,
"text": "<p>I'm not quite sure WHY this is happening (it appears to be an issue NOT with the ListBox but the ListBoxItem. If you set t... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38309/"
] | Each item in a WPF ListBox control seems to have a bit of left padding. How can I restyle to remove all padding?
 | You can also style the `ListBoxItem`s for a specific `ListBox` as follows:
```
<ListBox>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Padding" Value="0"/>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
``` |
435,951 | <p>Afternoon people!</p>
<p>I'm trying to implement a list of counties on my Compact Framework (Mobile) application.</p>
<p>I can do this easily in the full .Net framework with CultureInfo.GetCultures(..etc). However, the CF seems to be missing this feature?</p>
<p>Is there any way I can return a list of countries (... | [
{
"answer_id": 436119,
"author": "Stefano Driussi",
"author_id": 49209,
"author_profile": "https://Stackoverflow.com/users/49209",
"pm_score": 2,
"selected": false,
"text": "<p>Unfortunatly CultureInfo.GetCultures method is not supported by .NET Compact Framework but you can iterate thro... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44269/"
] | Afternoon people!
I'm trying to implement a list of counties on my Compact Framework (Mobile) application.
I can do this easily in the full .Net framework with CultureInfo.GetCultures(..etc). However, the CF seems to be missing this feature?
Is there any way I can return a list of countries (and regions if possible)... | How about this?
```
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Runtime.InteropServices;
namespace OpenNETCF.Globalization
{
public class CultureInfoHelper
{
private delegate int EnumLocalesHandler(string lpLocaleString);
private static EnumLocales... |
435,957 | <p>I'd like to develop and run my iPhone applications from the command line and my personal editor instead of having to use Xcode.</p>
<p>So far I've been able to edit all the files in Emacs and run <pre>xcodebuild</pre> in the project to compile/link/etc.</p>
<p>The next step would be to create a Makefile task to la... | [
{
"answer_id": 437129,
"author": "Noah Witherspoon",
"author_id": 30618,
"author_profile": "https://Stackoverflow.com/users/30618",
"pm_score": 4,
"selected": true,
"text": "<p>All you need to do is copy the built .app from wherever XCode puts it to <code>~/Library/Application Support/iP... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435957",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/161/"
] | I'd like to develop and run my iPhone applications from the command line and my personal editor instead of having to use Xcode.
So far I've been able to edit all the files in Emacs and run
```
xcodebuild
```
in the project to compile/link/etc.
The next step would be to create a Makefile task to launch the iPhone Si... | All you need to do is copy the built .app from wherever XCode puts it to `~/Library/Application Support/iPhone Simulator/[some version]/Applications/[somefolder]/`.
Then, launch `/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iOS Simulator.app`. Not sure how to get... |
435,959 | <p>Our site is running on apache and is secured using client certificates. So far there was only one certificate that would provide access to the whole site. Now, we have a requirement to expose jira to a new group of users who should not be able to access anything else but jira. I created a separate certificate for... | [
{
"answer_id": 436824,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 1,
"selected": false,
"text": "<p>It was a matter of getting the regex right. The LocationMatch directive with the following regex worked fine.</p>\n\n<pre>... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Our site is running on apache and is secured using client certificates. So far there was only one certificate that would provide access to the whole site. Now, we have a requirement to expose jira to a new group of users who should not be able to access anything else but jira. I created a separate certificate for that ... | Negative regexes are not supported in apache 2.2
See <https://issues.apache.org/bugzilla/show_bug.cgi?id=10932>
I don't know if it has been fixed in the last apache version.
As a workaround, use :
```
<LocationMatch "/[^s][^t][^a][^t][^i][^c]">
</LocationMatch>
```
or
```
<LocationMatch "^/(?!static)">
</Locatio... |
435,964 | <p>The following query will display all Dewey Decimal numbers that have been duplicated in the "book" table:</p>
<pre><code>SELECT dewey_number,
COUNT(dewey_number) AS NumOccurrences
FROM book
GROUP BY dewey_number
HAVING ( COUNT(dewey_number) > 1 )
</code></pre>
<p>However, what I'd like to do is have my query ... | [
{
"answer_id": 435972,
"author": "Kibbee",
"author_id": 1862,
"author_profile": "https://Stackoverflow.com/users/1862",
"pm_score": 4,
"selected": false,
"text": "<p>You probably want this</p>\n\n<pre><code>SELECT dewey_number, author_last_name,\n COUNT(dewey_number) AS NumOccurrences\nF... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10040/"
] | The following query will display all Dewey Decimal numbers that have been duplicated in the "book" table:
```
SELECT dewey_number,
COUNT(dewey_number) AS NumOccurrences
FROM book
GROUP BY dewey_number
HAVING ( COUNT(dewey_number) > 1 )
```
However, what I'd like to do is have my query display the name of the autho... | A nested query can do the job.
```
SELECT author_last_name, dewey_number, NumOccurrences
FROM author INNER JOIN
( SELECT author_id, dewey_number, COUNT(dewey_number) AS NumOccurrences
FROM book
GROUP BY author_id, dewey_number
HAVING ( COUNT(dewey_number) > 1 ) ) AS duplicates
ON author.i... |
435,971 | <p>I am working on a Java project using Netbeans for the first time. I would like to use Netbeans 6.5 to create a jar including about 50 text files. Is there a simple way to do this?</p>
| [
{
"answer_id": 435987,
"author": "frankodwyer",
"author_id": 42404,
"author_profile": "https://Stackoverflow.com/users/42404",
"pm_score": 1,
"selected": false,
"text": "<p>If you're familiar with ant, ant can do this, and Netbeans can run an ant script.</p>\n"
},
{
"answer_id": ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54223/"
] | I am working on a Java project using Netbeans for the first time. I would like to use Netbeans 6.5 to create a jar including about 50 text files. Is there a simple way to do this? | You need to locate the project directory on your drive. And then put all your 50 text files into **src** folder. Go back to Netbeans. You should see your text files under your source package by now. Then **Build** the project. Your newly created JAR should be in your project directory's **dist** folder.
**EDIT:** Here... |
435,989 | <p>I failed to find a way to disable the browser detection feature added by asp.net 2.0.<br>
I want <strong>all</strong> the request to my page to be treated as if IE is requesting them.<br>
My fix was to add an App_Browsers folder to my project and in it have the following .browser file: </p>
<pre><code><browsers... | [
{
"answer_id": 436056,
"author": "annakata",
"author_id": 13018,
"author_profile": "https://Stackoverflow.com/users/13018",
"pm_score": 3,
"selected": true,
"text": "<p>One of the more offensive parts of ASP.Net, imho. No way to just turn it off AFAIK, other than config like this. </p>\n... | 2009/01/12 | [
"https://Stackoverflow.com/questions/435989",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48317/"
] | I failed to find a way to disable the browser detection feature added by asp.net 2.0.
I want **all** the request to my page to be treated as if IE is requesting them.
My fix was to add an App\_Browsers folder to my project and in it have the following .browser file:
```
<browsers>
<browser refID="Default">
... | One of the more offensive parts of ASP.Net, imho. No way to just turn it off AFAIK, other than config like this.
You may be interested in [Rob Eberhardt's](http://slingfive.com/pages/code/browserCaps/) pool of resources on the topic. |
436,004 | <p>The following code gives a segmentation fault on the last line</p>
<pre><code>require 'rubygems'
gem 'mysql'
gem 'dbi'
require 'dbi'
require 'mysql'
dsn = "DBI:Mysql:DATABASE:www.HOST.net" # redacted
dbh = DBI.connect(dsn, "USERNAME", "PASSWORD") # redacted
sth = dbh.execute("select * from TABLE where numeric_va... | [
{
"answer_id": 436091,
"author": "Jonathan Adelson",
"author_id": 8092,
"author_profile": "https://Stackoverflow.com/users/8092",
"pm_score": 0,
"selected": false,
"text": "<p>I don't know why you're getting a segfault in this code.</p>\n\n<p>It is possible that, for instance, if you ove... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11522/"
] | The following code gives a segmentation fault on the last line
```
require 'rubygems'
gem 'mysql'
gem 'dbi'
require 'dbi'
require 'mysql'
dsn = "DBI:Mysql:DATABASE:www.HOST.net" # redacted
dbh = DBI.connect(dsn, "USERNAME", "PASSWORD") # redacted
sth = dbh.execute("select * from TABLE where numeric_value is not nul... | This could be any number of things, from the version of DBI, Mysql gem, mysql version, and ruby version.
Unfortunately ruby isn't a first class citizen on windows, nor are all configurations tested extensively on it.
First enable debugging on your VM to reproduce this issue with more information about where and why t... |
436,013 | <p>For two threads manipulating a container map for example, what the correct way to test whether an iterator still valid (for performance reason) ?<br/>
Or would be of only indirect way that this can be done.
The sample code for this :<br></p>
<pre><code>#define _SECURE_SCL 1
//http://msdn2.microsoft.com/en-us/librar... | [
{
"answer_id": 436029,
"author": "Eclipse",
"author_id": 8701,
"author_profile": "https://Stackoverflow.com/users/8701",
"pm_score": 4,
"selected": true,
"text": "<p><code>std::map</code>s are not at all thread-safe. You'll end up with much worse problems than invalidated iterators, if ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436013",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/47733/"
] | For two threads manipulating a container map for example, what the correct way to test whether an iterator still valid (for performance reason) ?
Or would be of only indirect way that this can be done.
The sample code for this :
```
#define _SECURE_SCL 1
//http://msdn2.microsoft.com/en-us/library/aa985973.aspx
#d... | `std::map`s are not at all thread-safe. You'll end up with much worse problems than invalidated iterators, if you have more than one thread at a time modifying the same map. I don't even think you have a guarantee that you can read anything out of a map while it's being modified by another thread.
Some pages on the ST... |
436,014 | <p>Why should I use templating system in PHP?</p>
<p>The reasoning behind my question is: PHP itself is feature rich templating system, why should I install another template engine?</p>
<p>The only two pros I found so far are:</p>
<ol>
<li>A bit cleaner syntax (sometimes)</li>
<li>Template engine is not usually powe... | [
{
"answer_id": 436048,
"author": "Luca Matteis",
"author_id": 50394,
"author_profile": "https://Stackoverflow.com/users/50394",
"pm_score": 2,
"selected": false,
"text": "<p>Mostly I think to avoid any \"unsafe\" backend logic to be applied in templates.\nSince most of the times template... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436014",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/53864/"
] | Why should I use templating system in PHP?
The reasoning behind my question is: PHP itself is feature rich templating system, why should I install another template engine?
The only two pros I found so far are:
1. A bit cleaner syntax (sometimes)
2. Template engine is not usually powerful enough to implement business... | Yes, as you said, if you don't force yourself to use a templating engine inside PHP ( the templating engine ) it becomes easy to slip and stop separating concerns.
**However**, the same people who have problems separating concerns end up generating HTML and feeding it to smarty, or executing PHP code in Smarty, so Sm... |
436,021 | <p>I am attempting to convert a Dephi 2006 project to Delphi 2009 (Delphi 2006 is on Drive C Delphi 2009 is on Drive D).</p>
<p>On the main form there is a <code>DataSource1: TDataSource;</code> and a <code>Table1: TTable;</code></p>
<p>In <code>OnFormShow</code> the table filename is set to:</p>
<pre><code>TableFil... | [
{
"answer_id": 436088,
"author": "Rob Kennedy",
"author_id": 33732,
"author_profile": "https://Stackoverflow.com/users/33732",
"pm_score": 3,
"selected": false,
"text": "<p>Add a <code>TSession</code> component to your project. Set its <code>NetFileDir</code> property to a location that ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I am attempting to convert a Dephi 2006 project to Delphi 2009 (Delphi 2006 is on Drive C Delphi 2009 is on Drive D).
On the main form there is a `DataSource1: TDataSource;` and a `Table1: TTable;`
In `OnFormShow` the table filename is set to:
```
TableFilename := IncludeTrailingPathDelimiter( MyProfileFolder ) + 'D... | Add a `TSession` component to your project. Set its `NetFileDir` property to a location that is writable by normal users, such as the common appdir folder. The *pdoxusers.net* file will be stored there instead. For more, see [a newsgroup post on comp.lang.pascal.delphi.misc](http://groups.google.com/group/comp.lang.pas... |
436,023 | <p>I have input data containing some "rogue" fields that are longer than the corresponding database field. This causes my import script, which uses SQL INSERT statements to fall over with a warning:</p>
<pre><code>Msg 8152, Level 16, State 13, Line 2
String or binary data would be truncated.
</code></pre>
<p>How can ... | [
{
"answer_id": 436069,
"author": "Ian Jacobs",
"author_id": 22818,
"author_profile": "https://Stackoverflow.com/users/22818",
"pm_score": 4,
"selected": false,
"text": "<p>When you insert do something along the lines of :</p>\n\n<pre><code>INSERT INTO Table1('Column1') VALUES(LEFT(RTRIM(... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38522/"
] | I have input data containing some "rogue" fields that are longer than the corresponding database field. This causes my import script, which uses SQL INSERT statements to fall over with a warning:
```
Msg 8152, Level 16, State 13, Line 2
String or binary data would be truncated.
```
How can I force truncation of thes... | When you insert do something along the lines of :
```
INSERT INTO Table1('Column1') VALUES(LEFT(RTRIM(InputField), MaxLength))
```
You'll only store the Left N characters to the DB. |
436,026 | <p>Lately I find myself writing data access layer select methods where the code all takes this general form:</p>
<pre><code>public static DataTable GetSomeData( ... arguments)
{
string sql = " ... sql string here: often it's just a stored procedure name ... ";
DataTable result = new DataTable();
// GetO... | [
{
"answer_id": 436082,
"author": "dfasdljkhfaskldjhfasklhf",
"author_id": 2763,
"author_profile": "https://Stackoverflow.com/users/2763",
"pm_score": 1,
"selected": false,
"text": "<p>The only thing I do differently is I switched from my own internal database helper methods to the actual... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3043/"
] | Lately I find myself writing data access layer select methods where the code all takes this general form:
```
public static DataTable GetSomeData( ... arguments)
{
string sql = " ... sql string here: often it's just a stored procedure name ... ";
DataTable result = new DataTable();
// GetOpenConnection(... | One pattern I've enjoyed looks like this as far as client code goes:
```
DataTable data = null;
using (StoredProcedure proc = new StoredProcedure("MyProcName","[Connection]"))
{
proc.AddParameter("@LoginName", loginName);
data = proc.ExecuteDataTable();
}
```
I... |