qid int64 4 22.2M | question stringlengths 18 48.3k | answers list | date stringlengths 10 10 | metadata list |
|---|---|---|---|---|
44,817 | <p>Has anyone used ADO.NET Data Services as a data source for Adobe Flex applications? If so, any success stories or tragedies to avoid? If you did use it, how did you handle security?</p>
| [
{
"answer_id": 45891,
"author": "Adam Cuzzort",
"author_id": 4760,
"author_profile": "https://Stackoverflow.com/users/4760",
"pm_score": 3,
"selected": true,
"text": "this.DeferredLoadingEnabled = false;\nDataLoadOptions dlo = new DataLoadOptions();\ndlo.LoadWith<Order>(q => q.Payments);... | 2008/09/04 | [
"https://Stackoverflow.com/questions/44817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4541/"
] |
44,834 | <p>I see <code>__all__</code> in <code>__init__.py</code> files. What does it do?</p>
| [
{
"answer_id": 44842,
"author": "Jimmy",
"author_id": 4435,
"author_profile": "https://Stackoverflow.com/users/4435",
"pm_score": 11,
"selected": true,
"text": "import *"
},
{
"answer_id": 64130,
"author": "Alec Thomas",
"author_id": 7980,
"author_profile": "https://S... | 2008/09/04 | [
"https://Stackoverflow.com/questions/44834",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1794/"
] |
44,853 | <p>I'm using ant to generate javadocs, but get this exception over and over - why?</p>
<p>I'm using JDK version <strong>1.6.0_06</strong>.</p>
<pre><code>[javadoc] java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl cannot be cast to com.sun.javadoc.AnnotationTypeDoc
[javadoc] at com.sun.tools.javadoc.AnnotationDescImpl.annotationType(AnnotationDescImpl.java:46)
[javadoc] at com.sun.tools.doclets.formats.html.HtmlDocletWriter.getAnnotations(HtmlDocletWriter.java:1739)
[javadoc] at com.sun.tools.doclets.formats.html.HtmlDocletWriter.writeAnnotationInfo(HtmlDocletWriter.java:1713)
[javadoc] at com.sun.tools.doclets.formats.html.HtmlDocletWriter.writeAnnotationInfo(HtmlDocletWriter.java:1702)
[javadoc] at com.sun.tools.doclets.formats.html.HtmlDocletWriter.writeAnnotationInfo(HtmlDocletWriter.java:1681)
[javadoc] at com.sun.tools.doclets.formats.html.FieldWriterImpl.writeSignature(FieldWriterImpl.java:130)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.FieldBuilder.buildSignature(FieldBuilder.java:184)
[javadoc] at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
[javadoc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[javadoc] at java.lang.reflect.Method.invoke(Method.java:597)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.FieldBuilder.invokeMethod(FieldBuilder.java:114)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.AbstractMemberBuilder.build(AbstractMemberBuilder.java:56)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.FieldBuilder.buildFieldDoc(FieldBuilder.java:158)
[javadoc] at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)
[javadoc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[javadoc] at java.lang.reflect.Method.invoke(Method.java:597)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.FieldBuilder.invokeMethod(FieldBuilder.java:114)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.AbstractMemberBuilder.build(AbstractMemberBuilder.java:56)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.buildFieldDetails(ClassBuilder.java:301)
[javadoc] at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source)
[javadoc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[javadoc] at java.lang.reflect.Method.invoke(Method.java:597)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.invokeMethod(ClassBuilder.java:101)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.buildClassDoc(ClassBuilder.java:124)
[javadoc] at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
[javadoc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[javadoc] at java.lang.reflect.Method.invoke(Method.java:597)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.invokeMethod(ClassBuilder.java:101)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
[javadoc] at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.build(ClassBuilder.java:108)
[javadoc] at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:155)
[javadoc] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:164)
[javadoc] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:106)
[javadoc] at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:64)
[javadoc] at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:42)
[javadoc] at com.sun.tools.doclets.standard.Standard.start(Standard.java:23)
[javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[javadoc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[javadoc] at java.lang.reflect.Method.invoke(Method.java:597)
[javadoc] at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:215)
[javadoc] at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:91)
[javadoc] at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
[javadoc] at com.sun.tools.javadoc.Start.begin(Start.java:128)
[javadoc] at com.sun.tools.javadoc.Main.execute(Main.java:41)
[javadoc] at com.sun.tools.javadoc.Main.main(Main.java:31)
</code></pre>
| [
{
"answer_id": 2030179,
"author": "KasthuriRengan",
"author_id": 246673,
"author_profile": "https://Stackoverflow.com/users/246673",
"pm_score": 1,
"selected": false,
"text": "//"
},
{
"answer_id": 23737003,
"author": "Cataclysm",
"author_id": 1531064,
"author_profile... | 2008/09/04 | [
"https://Stackoverflow.com/questions/44853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1310/"
] |
44,903 | <p>I have multiple selects:</p>
<pre><code><select id="one">
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
</select>
<select id="two">
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
</select>
</code></pre>
<p>What I want is to select "one" from the first select, then have that option be removed from the second one.
Then if you select "two" from the second one, I want that one removed from the first one.</p>
<p>Here's the JS I have currently:</p>
<pre><code>$(function () {
var $one = $("#one");
var $two = $("#two");
var selectOptions = [];
$("select").each(function (index) {
selectOptions[index] = [];
for (var i = 0; i < this.options.length; i++) {
selectOptions[index][i] = this.options[i];
}
});
$one.change(function () {
var selectedValue = $("option:selected", this).val();
for (var i = 0; i < selectOptions[1].length; i++) {
var exists = false;
for (var x = 0; x < $two[0].options.length; x++) {
if ($two[0].options[x].value == selectOptions[1][i].value)
exists = true;
}
if (!exists)
$two.append(selectOptions[1][i]);
}
$("option[value='" + selectedValue + "']", $two).remove();
});
$two.change(function () {
var selectedValue = $("option:selected", this).val();
for (var i = 0; i < selectOptions[0].length; i++) {
var exists = false;
for (var x = 0; x < $one[0].options.length; x++) {
if ($one[0].options[x].value == selectOptions[0][i].value)
exists = true;
}
if (!exists)
$one.append(selectOptions[0][i]);
}
$("option[value='" + selectedValue + "']", $one).remove();
});
});
</code></pre>
<p>But when the elements get repopulated, it fires the change event in the select whose options are changing. I tried just setting the <code>disabled</code> attribute on the option I want to remove, but that doesn't work with IE6.</p>
| [
{
"answer_id": 45906,
"author": "travis",
"author_id": 1414,
"author_profile": "https://Stackoverflow.com/users/1414",
"pm_score": 2,
"selected": false,
"text": "changeOnce"
},
{
"answer_id": 48034,
"author": "Vincent Robert",
"author_id": 268,
"author_profile": "http... | 2008/09/04 | [
"https://Stackoverflow.com/questions/44903",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1414/"
] |
44,905 | <p>When writing a switch statement, there appears to be two limitations on what you can switch on in case statements.</p>
<p>For example (and yes, I know, if you're doing this sort of thing it probably means your <a href="https://en.wikipedia.org/wiki/Object-oriented_programming" rel="noreferrer">object-oriented</a> (OO) architecture is iffy - this is just a contrived example!),</p>
<pre><code> Type t = typeof(int);
switch (t) {
case typeof(int):
Console.WriteLine("int!");
break;
case typeof(string):
Console.WriteLine("string!");
break;
default:
Console.WriteLine("unknown!");
break;
}
</code></pre>
<p>Here the switch() statement fails with 'A value of an integral type expected' and the case statements fail with 'A constant value is expected'.</p>
<p>Why are these restrictions in place, and what is the underlying justification? I don't see any reason why the switch statement <em>has</em> to succumb to static analysis only, and why the value being switched on has to be integral (that is, primitive). What is the justification?</p>
| [
{
"answer_id": 44930,
"author": "Rob Walker",
"author_id": 3631,
"author_profile": "https://Stackoverflow.com/users/3631",
"pm_score": 0,
"selected": false,
"text": "if (t == typeof(int))\n{\n...\n}\nelseif (t == typeof(string))\n{\n...\n}\n...\n"
},
{
"answer_id": 44936,
"au... | 2008/09/04 | [
"https://Stackoverflow.com/questions/44905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3394/"
] |
44,912 | <p>Does the Java language have delegate features, similar to how C# has support for delegates?</p>
| [
{
"answer_id": 44916,
"author": "Patrick",
"author_id": 429,
"author_profile": "https://Stackoverflow.com/users/429",
"pm_score": 5,
"selected": false,
"text": "delegate"
},
{
"answer_id": 2075606,
"author": "Lawrence Dol",
"author_id": 8946,
"author_profile": "https:... | 2008/09/04 | [
"https://Stackoverflow.com/questions/44912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3498/"
] |
44,914 | <p>My app has many controls on its surface, and more are added dynamically at runtime.</p>
<p>Although i am using tabs to limit the number of controls shown, and double-buffering too, it still flickers and stutters when it has to redraw (resize, maximize, etc).</p>
<p>What are your tips and tricks to improve WinForms app performance?</p>
| [
{
"answer_id": 44933,
"author": "Jim Harte",
"author_id": 4544,
"author_profile": "https://Stackoverflow.com/users/4544",
"pm_score": 1,
"selected": false,
"text": "SuspendLayout()"
}
] | 2008/09/04 | [
"https://Stackoverflow.com/questions/44914",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1587/"
] |
44,917 | <p>Is there any efficiency difference in an explicit vs implicit inner join?
For example:</p>
<pre><code>SELECT * FROM
table a INNER JOIN table b
ON a.id = b.id;
</code></pre>
<p>vs.</p>
<pre><code>SELECT a.*, b.*
FROM table a, table b
WHERE a.id = b.id;
</code></pre>
| [
{
"answer_id": 44932,
"author": "lomaxx",
"author_id": 493,
"author_profile": "https://Stackoverflow.com/users/493",
"pm_score": 8,
"selected": true,
"text": "IMPLICIT OUTER JOIN"
},
{
"answer_id": 44982,
"author": "deadbug",
"author_id": 4646,
"author_profile": "http... | 2008/09/04 | [
"https://Stackoverflow.com/questions/44917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4316/"
] |
44,937 | <p>I want to make an etag that matches what Apache produces. How does apache create it's etags?</p>
| [
{
"answer_id": 44939,
"author": "Chris Bartow",
"author_id": 497,
"author_profile": "https://Stackoverflow.com/users/497",
"pm_score": 5,
"selected": true,
"text": "$fs = stat($file);\nheader(\"Etag: \".sprintf('\"%x-%x-%s\"', $fs['ino'], $fs['size'],base_convert(str_pad($fs['mtime'],16,... | 2008/09/04 | [
"https://Stackoverflow.com/questions/44937",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/497/"
] |
44,942 | <p>Can you cast a <code>List<int></code> to <code>List<string></code> somehow?</p>
<p>I know I could loop through and .ToString() the thing, but a cast would be awesome.</p>
<p>I'm in C# 2.0 (so no <a href="http://en.wikipedia.org/wiki/Language_Integrated_Query" rel="noreferrer">LINQ</a>).</p>
| [
{
"answer_id": 44949,
"author": "Erik van Brakel",
"author_id": 909,
"author_profile": "https://Stackoverflow.com/users/909",
"pm_score": 3,
"selected": false,
"text": "List<T>.Convert"
},
{
"answer_id": 44950,
"author": "Curt Hagenlocher",
"author_id": 533,
"author_p... | 2008/09/04 | [
"https://Stackoverflow.com/questions/44942",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/493/"
] |
44,961 | <p>I've searched on the Internet for comparisons between <a href="http://en.wikipedia.org/wiki/F_Sharp_%28programming_language%29" rel="noreferrer">F#</a> and <a href="http://en.wikipedia.org/wiki/Haskell_%28programming_language%29" rel="noreferrer">Haskell</a> but haven't found anything really definitive. What are the primary differences and why would I want to choose one over the other?</p>
| [
{
"answer_id": 44995,
"author": "Xian",
"author_id": 4642,
"author_profile": "https://Stackoverflow.com/users/4642",
"pm_score": 8,
"selected": true,
"text": "if(IsSomethingTrue() && AnotherThingTrue())\n{\n do something;\n}\n"
}
] | 2008/09/04 | [
"https://Stackoverflow.com/questions/44961",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3394/"
] |
44,965 | <p>Having briefly looked at Haskell recently, what would be a <em>brief, succinct, practical</em> explanation as to what a monad essentially is?</p>
<p>I have found most explanations I've come across to be fairly inaccessible and lacking in practical detail.</p>
| [
{
"answer_id": 45151,
"author": "Chris Conway",
"author_id": 1412,
"author_profile": "https://Stackoverflow.com/users/1412",
"pm_score": 6,
"selected": false,
"text": ">>="
},
{
"answer_id": 71697,
"author": "Arnar",
"author_id": 10442,
"author_profile": "https://Stac... | 2008/09/04 | [
"https://Stackoverflow.com/questions/44965",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3394/"
] |
44,973 | <p>Is it currently possible with pre release of ironruby to run rubygems? It seems as if I have to set an environment variable to find them? </p>
| [
{
"answer_id": 44986,
"author": "Orion Edwards",
"author_id": 234,
"author_profile": "https://Stackoverflow.com/users/234",
"pm_score": 4,
"selected": true,
"text": "igem"
},
{
"answer_id": 488664,
"author": "Jirapong",
"author_id": 28843,
"author_profile": "https://S... | 2008/09/04 | [
"https://Stackoverflow.com/questions/44973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4642/"
] |
44,980 | <p>How can one determine, in code, how long the machine is locked?</p>
<p>Other ideas outside of C# are also welcome.</p>
<hr>
<p>I like the windows service idea (and have accepted it) for simplicity and cleanliness, but unfortunately I don't think it will work for me in this particular case. I wanted to run this on my workstation at work rather than home (or in addition to home, I suppose), but it's locked down pretty hard courtesy of the DoD. That's part of the reason I'm rolling my own, actually.</p>
<p>I'll write it up anyway and see if it works. Thanks everyone!</p>
| [
{
"answer_id": 44987,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": -1,
"selected": false,
"text": "System.Runtime.InteropServices"
},
{
"answer_id": 45134,
"author": "Timothy Carter",
"author_id": 4660,
"a... | 2008/09/04 | [
"https://Stackoverflow.com/questions/44980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1588/"
] |
44,989 | <p>I'm trying to get the following bit of code to work in LINQPad but am unable to index into a var. Anybody know how to index into a var in LINQ?</p>
<pre><code>string[] sa = {"one", "two", "three"};
sa[1].Dump();
var va = sa.Select( (a,i) => new {Line = a, Index = i});
va[1].Dump();
// Cannot apply indexing with [] to an expression of type 'System.Collections.Generic.IEnumerable<AnonymousType#1>'
</code></pre>
| [
{
"answer_id": 44991,
"author": "Joseph Daigle",
"author_id": 507,
"author_profile": "https://Stackoverflow.com/users/507",
"pm_score": 5,
"selected": true,
"text": "[]"
},
{
"answer_id": 45944,
"author": "Keith",
"author_id": 905,
"author_profile": "https://Stackover... | 2008/09/04 | [
"https://Stackoverflow.com/questions/44989",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1463/"
] |
44,999 | <p>I have a "showall" query string parameter in the url, the parameter is being added dynamically when "Show All/Show Pages" button is clicked. </p>
<p>I want the ability to toggle "showall" query string parameter value depending on user clicking the "Show All/Show Pages" button.</p>
<p>I'm doing some nested "if's" and <code>string.Replace()</code> on the url, is there a better way?</p>
<p>All manipulations are done on the server.</p>
<p><strong>p.s.</strong> Toran, good suggestion, however I HAVE TO USE URL PARAMETER due to some other issues.</p>
| [
{
"answer_id": 45028,
"author": "chrisntr",
"author_id": 4455,
"author_profile": "https://Stackoverflow.com/users/4455",
"pm_score": 0,
"selected": false,
"text": "booleanVar = !booleanVar;"
},
{
"answer_id": 45034,
"author": "bentford",
"author_id": 946,
"author_prof... | 2008/09/04 | [
"https://Stackoverflow.com/questions/44999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3661/"
] |
45,004 | <p>Is there a way to select a parent element based on the class of a child element in the class? The example that is relevant to me relating to HTML output by a nice menu plugin for <a href="http://drupal.org" rel="noreferrer">http://drupal.org</a>. The output renders like this: </p>
<pre><code><ul class="menu">
<li>
<a class="active">Active Page</a>
</li>
<li>
<a>Some Other Page</a>
</li>
</ul>
</code></pre>
<p>My question is whether or not it is possible to apply a style to the list item that contains the anchor with the active class on it. Obviously, I'd prefer that the list item be marked as active, but I don't have control of the code that gets produced. I could perform this sort of thing using javascript (JQuery springs to mind), but I was wondering if there is a way to do this using CSS selectors.</p>
<p>Just to be clear, I want to apply a style to the list item, not the anchor.</p>
| [
{
"answer_id": 45008,
"author": "Dave Ward",
"author_id": 60,
"author_profile": "https://Stackoverflow.com/users/60",
"pm_score": 8,
"selected": true,
"text": "// JavaScript code:\ndocument.getElementsByClassName(\"active\")[0].parentNode;\n\n// jQuery code:\n$('.active').parent().get(0)... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4640/"
] |
45,015 | <p>Given a string of JSON data, how can I safely turn that string into a JavaScript object?</p>
<p>Obviously I can do this unsafely with something like:</p>
<pre><code>var obj = eval("(" + json + ')');
</code></pre>
<p>but that leaves me vulnerable to the JSON string containing other code, which it seems very dangerous to simply eval.</p>
| [
{
"answer_id": 45019,
"author": "Mark Biek",
"author_id": 305,
"author_profile": "https://Stackoverflow.com/users/305",
"pm_score": 5,
"selected": false,
"text": "new Ajax.Request('/some_url', {\n method:'get',\n requestHeaders: {Accept: 'application/json'},\n onSuccess: function(tran... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45015",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/797/"
] |
45,030 | <p>I'm wanting to parse a string into a nullable int in C#. ie. I want to get back either the int value of the string or null if it can't be parsed.</p>
<p>I was kind of hoping that this would work</p>
<pre><code>int? val = stringVal as int?;
</code></pre>
<p>But that won't work, so the way I'm doing it now is I've written this extension method</p>
<pre><code>public static int? ParseNullableInt(this string value)
{
if (value == null || value.Trim() == string.Empty)
{
return null;
}
else
{
try
{
return int.Parse(value);
}
catch
{
return null;
}
}
}
</code></pre>
<p>Is there a better way of doing this?</p>
<p><strong>EDIT:</strong> Thanks for the TryParse suggestions, I did know about that, but it worked out about the same. I'm more interested in knowing if there is a built-in framework method that will parse directly into a nullable int?</p>
| [
{
"answer_id": 45037,
"author": "Matt Hamilton",
"author_id": 615,
"author_profile": "https://Stackoverflow.com/users/615",
"pm_score": 10,
"selected": true,
"text": "int.TryParse"
},
{
"answer_id": 45039,
"author": "Joseph Daigle",
"author_id": 507,
"author_profile":... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2975/"
] |
45,036 | <p>The .NET <a href="http://msdn.microsoft.com/en-us/library/system.idisposable.aspx" rel="noreferrer">IDisposable Pattern</a> <em>implies</em> that if you write a finalizer, and implement IDisposable, that your finalizer needs to explicitly call Dispose.
This is logical, and is what I've always done in the rare situations where a finalizer is warranted.</p>
<p>However, what happens if I just do this:</p>
<pre><code>class Foo : IDisposable
{
public void Dispose(){ CloseSomeHandle(); }
}
</code></pre>
<p>and don't implement a finalizer, or anything. Will the framework call the Dispose method for me?</p>
<p>Yes I realise this sounds dumb, and all logic implies that it won't, but I've always had 2 things at the back of my head which have made me unsure.</p>
<ol>
<li><p>Someone a few years ago once told me that it would in fact do this, and that person had a very solid track record of "knowing their stuff."</p></li>
<li><p>The compiler/framework does other 'magic' things depending on what interfaces you implement (eg: foreach, extension methods, serialization based on attributes, etc), so it makes sense that this might be 'magic' too. </p></li>
</ol>
<p>While I've read a lot of stuff about it, and there's been lots of things implied, I've never been able to find a <strong>definitive</strong> Yes or No answer to this question.</p>
| [
{
"answer_id": 45043,
"author": "Matt Bishop",
"author_id": 4301,
"author_profile": "https://Stackoverflow.com/users/4301",
"pm_score": 3,
"selected": false,
"text": "class Program\n{\n static void Main(string[] args)\n {\n Fred f = new Fred();\n f = null;\n GC... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45036",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/234/"
] |
45,042 | <p>I need to deploy a few files that were checked in sometime ago (can't remember the exact ones), so I'm looking to get a list so I can deploy just those files. What is the svn command to do this?</p>
| [
{
"answer_id": 45046,
"author": "John Millikin",
"author_id": 3560,
"author_profile": "https://Stackoverflow.com/users/3560",
"pm_score": 3,
"selected": true,
"text": "svn log"
},
{
"answer_id": 45063,
"author": "pix0r",
"author_id": 72,
"author_profile": "https://Sta... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45042",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2567/"
] |
45,045 | <p>When executing SubmitChanges to the DataContext after updating a couple properties with a LINQ to SQL connection (against SQL Server Compact Edition) I get a "Row not found or changed." ChangeConflictException.</p>
<pre><code>var ctx = new Data.MobileServerDataDataContext(Common.DatabasePath);
var deviceSessionRecord = ctx.Sessions.First(sess => sess.SessionRecId == args.DeviceSessionId);
deviceSessionRecord.IsActive = false;
deviceSessionRecord.Disconnected = DateTime.Now;
ctx.SubmitChanges();
</code></pre>
<p>The query generates the following SQL:</p>
<pre><code>UPDATE [Sessions]
SET [Is_Active] = @p0, [Disconnected] = @p1
WHERE 0 = 1
-- @p0: Input Boolean (Size = 0; Prec = 0; Scale = 0) [False]
-- @p1: Input DateTime (Size = 0; Prec = 0; Scale = 0) [9/4/2008 5:12:02 PM]
-- Context: SqlProvider(SqlCE) Model: AttributedMetaModel Build: 3.5.21022.8
</code></pre>
<p>The obvious problem is the <strong>WHERE 0=1</strong>, After the record was loaded, I've confirmed that all the properties in the "deviceSessionRecord" are correct to include the primary key. Also when catching the "ChangeConflictException" there is no additional information about why this failed. I've also confirmed that this exception get's thrown with exactly one record in the database (the record I'm attempting to update)</p>
<p>What's strange is that I have a very similar update statement in a different section of code and it generates the following SQL and does indeed update my SQL Server Compact Edition database.</p>
<pre><code>UPDATE [Sessions]
SET [Is_Active] = @p4, [Disconnected] = @p5
WHERE ([Session_RecId] = @p0) AND ([App_RecId] = @p1) AND ([Is_Active] = 1) AND ([Established] = @p2) AND ([Disconnected] IS NULL) AND ([Member_Id] IS NULL) AND ([Company_Id] IS NULL) AND ([Site] IS NULL) AND (NOT ([Is_Device] = 1)) AND ([Machine_Name] = @p3)
-- @p0: Input Guid (Size = 0; Prec = 0; Scale = 0) [0fbbee53-cf4c-4643-9045-e0a284ad131b]
-- @p1: Input Guid (Size = 0; Prec = 0; Scale = 0) [7a174954-dd18-406e-833d-8da650207d3d]
-- @p2: Input DateTime (Size = 0; Prec = 0; Scale = 0) [9/4/2008 5:20:50 PM]
-- @p3: Input String (Size = 0; Prec = 0; Scale = 0) [CWMOBILEDEV]
-- @p4: Input Boolean (Size = 0; Prec = 0; Scale = 0) [False]
-- @p5: Input DateTime (Size = 0; Prec = 0; Scale = 0) [9/4/2008 5:20:52 PM]
-- Context: SqlProvider(SqlCE) Model: AttributedMetaModel Build: 3.5.21022.8
</code></pre>
<p>I have confirmed that the proper primary fields values have been identified in both the Database Schema and the DBML that generates the LINQ classes.</p>
<p>I guess this is almost a two part question:</p>
<ol>
<li>Why is the exception being thrown?</li>
<li>After reviewing the second set of generated SQL, it seems like for detecting conflicts it would be nice to check all the fields, but I imagine this would be fairly inefficient. Is this the way this always works? Is there a setting to just check the primary key?</li>
</ol>
<p>I've been fighting with this for the past two hours so any help would be appreciated.</p>
| [
{
"answer_id": 6101981,
"author": "Chris Moschini",
"author_id": 176877,
"author_profile": "https://Stackoverflow.com/users/176877",
"pm_score": 4,
"selected": false,
"text": "protected async Task loginUser(string username)\n{\n using(var db = new Db())\n {\n var user = awai... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2723/"
] |
45,075 | <p>Is there a better way to flash a window in Java than this:</p>
<pre><code>public static void flashWindow(JFrame frame) throws InterruptedException {
int sleepTime = 50;
frame.setVisible(false);
Thread.sleep(sleepTime);
frame.setVisible(true);
Thread.sleep(sleepTime);
frame.setVisible(false);
Thread.sleep(sleepTime);
frame.setVisible(true);
Thread.sleep(sleepTime);
frame.setVisible(false);
Thread.sleep(sleepTime);
frame.setVisible(true);
}
</code></pre>
<p>I know that this code is scary...But it works alright. (I should implement a loop...)</p>
| [
{
"answer_id": 45234,
"author": "David Crow",
"author_id": 2783,
"author_profile": "https://Stackoverflow.com/users/2783",
"pm_score": 1,
"selected": false,
"text": "import java.util.Map;\nimport java.util.Timer;\nimport java.util.TimerTask;\nimport java.util.concurrent.ConcurrentHashMap... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2598/"
] |
45,078 | <p>Ok, I asked a question earlier about Flex and ADO.NET Data Services but didn't get much response so I thought I'd rephrase. Does anyone have any experience building Adobe Flex applications with a .NET back-end? If so, what architecture did you use and what third-party tools if any did you employ. I've read a little about doing Flex remoting with WebORB but it seems more complicated than it should be, are web services an adequate alternative?</p>
| [
{
"answer_id": 67865,
"author": "user10440",
"author_id": 10440,
"author_profile": "https://Stackoverflow.com/users/10440",
"pm_score": 2,
"selected": false,
"text": "/bin"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4541/"
] |
45,086 | <p>I have a C++ app that needs to connect to a JAVA web app, are there any good, open source SOAP packages for this, or would it be easier to just roll my own?</p>
| [
{
"answer_id": 84771,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 1,
"selected": false,
"text": "#define SOAP_FMAC2 __attribute__ ((visibility (\"hidden\")))\n#define SOAP_FMAC4 __attribute__ ((visibility (\"hidden\")))\n#... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45086",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2066/"
] |
45,093 | <p>Is there a Regular Expression that can detect SQL in a string? Does anyone have a sample of something that they have used before to share?</p>
| [
{
"answer_id": 45096,
"author": "Hank Gay",
"author_id": 4203,
"author_profile": "https://Stackoverflow.com/users/4203",
"pm_score": 6,
"selected": true,
"text": "PreparedStatement"
},
{
"answer_id": 45099,
"author": "SQLMenace",
"author_id": 740,
"author_profile": "h... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4541/"
] |
45,097 | <p>I assume that you can't use a JavaScript code snippet to validate if the browser user has turned off JavaScript. So what can I use instead? Can someone offer a code sample?</p>
<p>I'm looking to wrap an if/then statement around it.</p>
<p>I often code in CFML, if that helps.</p>
| [
{
"answer_id": 45104,
"author": "Chris Marasti-Georg",
"author_id": 96,
"author_profile": "https://Stackoverflow.com/users/96",
"pm_score": 1,
"selected": false,
"text": "<noscript>\n ...some non-js code\n</noscript>\n"
},
{
"answer_id": 45133,
"author": "Community",
"... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45097",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
45,123 | <p>I am designing a new System and I have a lot of Interfaces that will grow over time with the system. What is the best practice to name this interfaces</p>
<pre><code>ISomethingV01
ISomethingV02
etc
</code></pre>
<p>and I do this</p>
<pre><code>public interface ISomething{
void method();
}
</code></pre>
<p>then I have to add method 2 so now what I do?</p>
<pre><code>public interface ISomethingV2:ISomething{
void method2();
}
</code></pre>
<p>or same other way?</p>
| [
{
"answer_id": 45127,
"author": "FlySwat",
"author_id": 1965,
"author_profile": "https://Stackoverflow.com/users/1965",
"pm_score": 2,
"selected": false,
"text": "public interface ISomething\n\npublic class Something1 : ISomething\npublic class Something2 : ISomething\n"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1154/"
] |
45,132 | <p>In particular, I have to extract all the messages and attachments from Lotus Notes files in the fastest and most reliable way. Another point that may be relevant is that I need to do this from a secondary thread.</p>
<p><strong>Edit</strong></p>
<p>Thanks for the answers - both of which are good. I should provide more background information. </p>
<p>We currently have a WinForms application with a background thread using the Notes COM API. </p>
<p>However it seems to be unstable. (Of course it may be we are doing something wrong.) For example, we have found we have to preinitialize the Notes session on the main thread or else the call to session.CreateDXLExporter() on the background thread throws an exception.</p>
| [
{
"answer_id": 226491,
"author": "GvS",
"author_id": 11492,
"author_profile": "https://Stackoverflow.com/users/11492",
"pm_score": 2,
"selected": false,
"text": "Dim oSess As Object = Nothing\noSess = CreateObject(\"Notes.NotesSession\")\n"
},
{
"answer_id": 3267347,
"author"... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45132",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1899/"
] |
45,135 | <p>Why does the order in which libraries are linked sometimes cause errors in GCC?</p>
| [
{
"answer_id": 409470,
"author": "Johannes Schaub - litb",
"author_id": 34509,
"author_profile": "https://Stackoverflow.com/users/34509",
"pm_score": 9,
"selected": false,
"text": "// a depends on b, b depends on d\n$ cat a.cpp\nextern int a;\nint main() {\n return a;\n}\n\n$ cat b.cpp\... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45135",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1597/"
] |
45,152 | <p>What particular method/application are you using to communicate between your application and a database? Custom code with stored procedures? SubSonic? nHibernate? Entity Framework? LINQ?</p>
| [
{
"answer_id": 45257,
"author": "Lars Mæhlum",
"author_id": 960,
"author_profile": "https://Stackoverflow.com/users/960",
"pm_score": 0,
"selected": false,
"text": "IPersonRepository : IReadRepository<Person>, ICreateRepository<Person>, IUpdateRepository<Person> //and so on..\n"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45152",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4550/"
] |
45,163 | <p>Given this HTML:</p>
<pre><code><ul id="topnav">
<li id="topnav_galleries"><a href="#">Galleries</a></li>
<li id="topnav_information"><a href="#">Information</a></li>
</ul>
</code></pre>
<p>And this CSS:</p>
<pre class="lang-css prettyprint-override"><code>#topnav_galleries a, #topnav_information a {
background-repeat: no-repeat;
text-indent: -9000px;
padding: 0;
margin: 0 0;
overflow: hidden;
height: 46px;
width: 136px;
display: block;
}
#topnav { list-style-type: none; }
#topnav_galleries a { background-image: url('image1.jpg'); }
#topnav_information a { background-image: url('image2.jpg'); }
</code></pre>
<p>How would I go about turning the <code>topnav</code> list into an inline list?</p>
| [
{
"answer_id": 45429,
"author": "Ian Oxley",
"author_id": 1904,
"author_profile": "https://Stackoverflow.com/users/1904",
"pm_score": 3,
"selected": true,
"text": "#topnav {\n overflow:hidden;\n}\n#topnav li {\n float:left;\n}\n"
},
{
"answer_id": 77974,
"author": "Spoo... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45163",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1306/"
] |
45,169 | <p>I need to call into a Win32 API to get a series of strings, and I would like to return an array of those strings to JavaScript. This is for script that runs on local machine for administration scripts, not for the web browser.</p>
<p>My IDL file for the COM object has the interface that I am calling into as:</p>
<pre>
HRESULT GetArrayOfStrings([out, retval] SAFEARRAY(BSTR) * rgBstrStringArray);
</pre>
<p>The function returns correctly, but the strings are getting 'lost' when they are being assigned to a variable in JavaScript.</p>
<p>The question is:
What is the proper way to get the array of strings returned to a JavaScript variable?
</p>
| [
{
"answer_id": 45211,
"author": "Shog9",
"author_id": 811,
"author_profile": "https://Stackoverflow.com/users/811",
"pm_score": 4,
"selected": true,
"text": "SAFEARRAY"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45169",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1462171/"
] |
45,176 | <p>I have a rather complex page that dynamically builds user controls inside of a repeater. This repeater must be bound during the Init page event before <code>ViewState</code> is initialized or the dynamically created user controls will not retain their state.</p>
<p>This creates an interesting Catch-22 because the object I bind the repeater to needs to be created on initial page load, and then persisted in memory until the user opts to leave or save.</p>
<p>Because I cannot use <code>ViewState</code> to store this object, yet have it available during Init, I have been forced to store it in Session.</p>
<p>This also has issues, because I have to explicitly null the session value during non postbacks in order to emulate how <code>ViewState</code> works.</p>
<p>There has to be a better way to state management in this scenario. Any ideas?</p>
<p><strong>Edit:</strong> Some good suggestions about using <code>LoadViewState</code>, but I'm still having issues with state not being restored when I do that.</p>
<p>Here is somewhat if the page structure</p>
<p>Page --> UserControl --> Repeater --> N amount of UserControls Dynamicly Created.</p>
<p>I put the overridden <code>LoadViewState</code> in the parent <code>UserControl</code>, as it is designed to be completely encapsulated and independent of the page it is on. I am wondering if that is where the problem is.</p>
| [
{
"answer_id": 46306,
"author": "Daniel Auger",
"author_id": 1644,
"author_profile": "https://Stackoverflow.com/users/1644",
"pm_score": 0,
"selected": false,
"text": "protected override void LoadViewState(object savedState)\n{\n // Put your code here before base is called\n base.Loa... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45176",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1965/"
] |
45,179 | <p>Having worked with Classic ASP for about 2 years now by creating a few 100 simple web forms I can't see a good reason for switching to .net; however, I'm not that versed in .net so I'm sure I could be missing a few things.</p>
<p>Some points that I often hear around work can be found here: <a href="http://www.packtpub.com/article/Classic-ASP" rel="noreferrer"><a href="http://www.packtpub.com/article/Classic-ASP" rel="noreferrer">http://www.packtpub.com/article/Classic-ASP</a></a> (not that I share all of these thoughts, but it's a good jumping off point)</p>
<p>I'm very interested to hear what others have to say on this matter.</p>
| [
{
"answer_id": 2077403,
"author": "D'Arcy Rittich",
"author_id": 39430,
"author_profile": "https://Stackoverflow.com/users/39430",
"pm_score": 3,
"selected": false,
"text": "char"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45179",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3349/"
] |
45,207 | <p>Is there a way to <em>always</em> have LF line endings in Visual Studio? I can never seem to find it!</p>
| [
{
"answer_id": 14201090,
"author": "user1955769",
"author_id": 1955769,
"author_profile": "https://Stackoverflow.com/users/1955769",
"pm_score": 2,
"selected": false,
"text": "Tools | Options... | Environment | Documents"
},
{
"answer_id": 20077654,
"author": "renadeen",
... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45207",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4121/"
] |
45,227 | <p>I have been searching everywhere for the following functionality in Lisp, and have gotten nowhere:</p>
<ol>
<li><p>find the index of something in a list. example:</p>
<pre><code>(index-of item InThisList)
</code></pre></li>
<li><p>replace something at a specific spot in a list. example:</p>
<pre><code>(replace item InThisList AtThisIndex) ;i think this can be done with 'setf'?
</code></pre></li>
<li><p>return an item at a specific index. example:</p>
<pre><code>(return InThisList ItemAtThisIndex)
</code></pre></li>
</ol>
<p>Up until this point, I've been faking it with my own functions. I'm wondering if I'm just creating more work for myself.</p>
<p>This is how I've been faking number 1:</p>
<pre><code>(defun my-index (findMe mylist)
(let ((counter 0) (found 1))
(dolist (item mylist)
(cond
((eq item findMe) ;this works because 'eq' checks place in memory,
;and as long as 'findMe' was from the original list, this will work.
(setq found nil)
(found (incf counter))))
counter))
</code></pre>
| [
{
"answer_id": 45233,
"author": "Jeremy",
"author_id": 1114,
"author_profile": "https://Stackoverflow.com/users/1114",
"pm_score": 6,
"selected": true,
"text": "setf"
},
{
"answer_id": 45670,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackover... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50/"
] |
45,228 | <p>I've been unable to find a source for this information, short of looking through the Python source code myself to determine how the objects work. Does anyone know where I could find this online?</p>
| [
{
"answer_id": 45538,
"author": "Will Harris",
"author_id": 4702,
"author_profile": "https://Stackoverflow.com/users/4702",
"pm_score": 4,
"selected": false,
"text": "set"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1114/"
] |
45,230 | <p>I have a small local network. Only one of the machines is available to the outside world (this is not easily changeable). I'd like to be able to set it up such that ssh requests that don't come in on the standard port go to another machine. Is this possible? If so, how?</p>
<p>Oh and all of these machines are running either Ubuntu or OS X. </p>
| [
{
"answer_id": 45237,
"author": "Mark Biek",
"author_id": 305,
"author_profile": "https://Stackoverflow.com/users/305",
"pm_score": 5,
"selected": true,
"text": "ssh -L 8022:myinsideserver:22 paul@myoutsideserver\n"
},
{
"answer_id": 45254,
"author": "Mike Stone",
"author... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/85/"
] |
45,239 | <p>Short version: What is the cleanest and most maintainable technique for consistant presentation and AJAX function across all browsers used by both web developers and web developers' end-users?</p>
<ul>
<li>IE 6, 7, 8</li>
<li>Firefox 2, 3</li>
<li>Safari</li>
<li>Google Chrome</li>
<li>Opera</li>
</ul>
<p>Long version: I wrote a <a href="http://con.appspot.com" rel="nofollow noreferrer">web app aimed at other web developers</a>. I want my app to support the major web browsers (plus Google Chrome) in both presentation and AJAX behavior.</p>
<p>I began on Firefox/Firebug, then added conditional comments for a consistent styling under IE 6 and 7. Next, to my amazement, I discovered that jQuery does not behave identically in IE; so I <a href="http://github.com/jhs/app-engine-console/commit/4fe7741ad1856208b565eeab4260a64933929c01" rel="nofollow noreferrer">changed my Javascript to be portable on FF and IE</a> using conditionals and less pure jQuery.</p>
<p>Today, I started testing on Webkit and Google Chrome and discovered that, not only are the styles inconsistant with both FF and IE, but Javascript is not executing at all, probably due to a syntax or parse error. I expected some CSS work, but now I have more Javascript debugging to do! At this point, I want to step back and think before writing piles of special cases for all situations.</p>
<p>I am <b>not looking for a silver bullet, just best practices</b> to keep things as understandable and maintainable as possible. I prefer if this works with no server-side intelligence; however if there is a advantage to, for example, check the user-agent and then return different files to different browsers, that is fine if the total comprehensibility and maintainability of the web app is lower. Thank you all very much!</p>
| [
{
"answer_id": 679997,
"author": "system PAUSE",
"author_id": 52963,
"author_profile": "https://Stackoverflow.com/users/52963",
"pm_score": 5,
"selected": true,
"text": "if(node.addEventListener)..."
},
{
"answer_id": 691048,
"author": "aleemb",
"author_id": 50475,
"a... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45239",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2938/"
] |
45,253 | <p>I'm working on a Rails app and am looking to include some functionality from "<a href="https://stackoverflow.com/questions/42566/getting-the-hostname-or-ip-in-ruby-on-rails">Getting the Hostname or IP in Ruby on Rails</a>" that I asked.</p>
<p>I'm having problems getting it to work. I was under the impression that I should just make a file in the lib directory, so I named it 'get_ip.rb', with the contents:</p>
<pre><code>require 'socket'
module GetIP
def local_ip
orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true # turn off reverse DNS resolution temporarily
UDPSocket.open do |s|
s.connect '64.233.187.99', 1
s.addr.last
end
ensure
Socket.do_not_reverse_lookup = orig
end
end
</code></pre>
<p>I had also tried defining GetIP as a class but when I do the usual <code>ruby script/console</code>, I'm not able to use the <code>local_ip</code> method at all. Any ideas?</p>
| [
{
"answer_id": 45261,
"author": "Curt Hagenlocher",
"author_id": 533,
"author_profile": "https://Stackoverflow.com/users/533",
"pm_score": 3,
"selected": true,
"text": "require 'socket'\n\nclass GetIP\n def self.local_ip\n orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lo... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45253",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/422/"
] |
45,277 | <p>I see a similar question <a href="https://stackoverflow.com/questions/28588/how-do-you-set-up-an-openid-provider-server-in-ubuntu">for Ubuntu</a>, but I'm interested in hosting my own OpenID provider through my Rails-based site that already has an identity and authentication system in place.</p>
<p>Note that I'm not looking for the delegate method to <a href="https://stackoverflow.com/questions/4661/can-you-apply-more-than-one-openid-to-a-stackoverflow-account#4777">use the site as an OpenID</a>.</p>
<p>What's the best way to do this properly?</p>
| [
{
"answer_id": 45618,
"author": "dbr",
"author_id": 745,
"author_profile": "https://Stackoverflow.com/users/745",
"pm_score": 2,
"selected": false,
"text": "gem install openid-server"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45277",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4647/"
] |
45,286 | <p>I have a console app that needs to display the state of items, but rather than having text scroll by like mad I'd rather see the current status keep showing up on the same lines. For the sake of example:</p>
<blockquote>
<p><code>Running... nn% complete</code><br>
<code>Buffer size: bbbb bytes</code></p>
</blockquote>
<p>should be the output, where 'nn' is the current percentage complete, and 'bbbb' is a buffer size, updated periodically on the same lines of the console.</p>
<p>The first approach I took simply printed the correct number of backspaces to the console before printing the new state, but this has an obnoxious flicker that I want to get rid of. I also want to stick to either standard library or MS-provided functionality (VC 8) so as not to introduce another dependency for this one simple need.</p>
| [
{
"answer_id": 49884,
"author": "Patrick Johnmeyer",
"author_id": 363,
"author_profile": "https://Stackoverflow.com/users/363",
"pm_score": 3,
"selected": false,
"text": "// before entering update loop\nHANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);\nCONSOLE_SCREEN_BUFFER_INFO bufferInfo;\n... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45286",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/363/"
] |
45,301 | <p>How can I change the title of the command prompt window every time I execute a dos-based program by double clicking it, in c language. Should I use the Windows API?</p>
| [
{
"answer_id": 2198756,
"author": "F. Kam",
"author_id": 266061,
"author_profile": "https://Stackoverflow.com/users/266061",
"pm_score": 2,
"selected": false,
"text": "title"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45301",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/130278/"
] |
45,325 | <p>Sometimes when I'm editing page or control the .designer files stop being updated with the new controls I'm putting on the page. I'm not sure what's causing this to happen, but I'm wondering if there's any way of forcing Visual Studio to regenerate the .designer file. I'm using Visual Studio 2008</p>
<p><strong>EDIT:</strong> Sorry I should have noted I've already tried:</p>
<ul>
<li>Closing & re-opening all the files & Visual Studio</li>
<li>Making a change to a runat="server" control on the page</li>
<li>Deleting & re-adding the page directive</li>
</ul>
| [
{
"answer_id": 4264088,
"author": "WynandB",
"author_id": 192886,
"author_profile": "https://Stackoverflow.com/users/192886",
"pm_score": 0,
"selected": false,
"text": "CodeBehind"
},
{
"answer_id": 4770314,
"author": "Geoff",
"author_id": 569317,
"author_profile": "h... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45325",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2975/"
] |
45,340 | <p>Python frameworks always provide ways to handle URLs that convey the data of the request in an elegant way, like for example <a href="http://somewhere.overtherainbow.com/userid/123424/" rel="noreferrer">http://somewhere.overtherainbow.com/userid/123424/</a></p>
<p>I want you to notice the ending path <strong>/userid/123424/</strong></p>
<p>How do you do this in ASP.NET?</p>
| [
{
"answer_id": 406947,
"author": "Dominic Betts",
"author_id": 50911,
"author_profile": "https://Stackoverflow.com/users/50911",
"pm_score": 5,
"selected": false,
"text": "<system.web>\n<compilation debug=\"true\">\n <assemblies>\n …\n <add assembly=\"System.... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45340",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4491/"
] |
45,372 | <p>Let's say that I want to have a table that logs the date and the number of columns in some other table (or really any sort of math / string concat etc).</p>
<pre><code>CREATE TABLE `log` (
`id` INTEGER NOT NULL AUTO_INCREMENT ,
`date` DATETIME NOT NULL ,
`count` INTEGER NOT NULL ,
PRIMARY KEY (`id`)
);
</code></pre>
<p>Is it possible to have the count column calculated for me whenever I do an insert?</p>
<p>e.g. do something like:</p>
<pre><code>INSERT INTO log (date='foo');
</code></pre>
<p>and have count calculated by mysql.</p>
<p>Obviously I could do it myself by doing a query to get the count and inserting it, but this would be better.</p>
| [
{
"answer_id": 45382,
"author": "Thomas Watnedal",
"author_id": 4059,
"author_profile": "https://Stackoverflow.com/users/4059",
"pm_score": 0,
"selected": false,
"text": "INSERT INTO log (date, count)\n SELECT DATE() as date, count(id) as count\n from foo;\n"
},
{
"answer_i... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1666/"
] |
45,399 | <p>I've worked on a number of database systems in the past where moving entries between databases would have been made a lot easier if all the database keys had been <a href="http://en.wikipedia.org/wiki/Globally_Unique_Identifier" rel="noreferrer">GUID / UUID</a> values. I've considered going down this path a few times, but there's always a bit of uncertainty, especially around performance and un-read-out-over-the-phone-able URLs.</p>
<p>Has anyone worked extensively with GUIDs in a database? What advantages would I get by going that way, and what are the likely pitfalls?</p>
| [
{
"answer_id": 71069249,
"author": "J Scott",
"author_id": 2932782,
"author_profile": "https://Stackoverflow.com/users/2932782",
"pm_score": 1,
"selected": false,
"text": "stackoverflow.com/questions/45399"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/797/"
] |
45,407 | <p>What are the main differences (if any) between the box models of IE8 and Firefox3?</p>
<p>Are they the same now?</p>
<p>What are the other main differences between these two browsers? Can a web developer assume that these two browsers as the same since they (seem to) support the latest web standards?</p>
| [
{
"answer_id": 45483,
"author": "Brian Warshaw",
"author_id": 1344,
"author_profile": "https://Stackoverflow.com/users/1344",
"pm_score": 1,
"selected": false,
"text": "margin: 0 auto"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/184/"
] |
45,408 | <p>How does a virtual machine generate native machine code on the fly and execute it?</p>
<p>Assuming you can figure out what are the native machine op-codes you want to emit, how do you go about actually running it?</p>
<p>Is it something as hacky as mapping the mnemonic instructions to binary codes, stuffing it into an char* pointer and casting it as a function and executing?</p>
<p>Or would you generate a temporary shared library (.dll or .so or whatever) and load it into memory using standard functions like <code>LoadLibrary</code> ?</p>
| [
{
"answer_id": 3160622,
"author": "Maruf Maniruzzaman",
"author_id": 381397,
"author_profile": "https://Stackoverflow.com/users/381397",
"pm_score": 1,
"selected": false,
"text": "void (*MyFunc)() = (void (*)()) VirtualAlloc(NULL, sizeofblock, MEM_COMMIT, PAGE_EXECUTE_READWRITE);\n\n//N... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/618/"
] |
45,414 | <p>I'm using Eclipse 3.4 and have configured the Java code formatter with all of the options on the <em>Comments</em> tab enabled. The problem is that when I format a document comment that contains:</p>
<pre><code>* @see <a href="test.html">test</a>
</code></pre>
<p>the code formatter inserts a space in the closing HTML, breaking it:</p>
<pre><code>* @see <a href="test.html">test< /a>
</code></pre>
<p>Why? How do I stop this happening?</p>
<p>This is not fixed by disabling any of the options on the <em>Comments</em> tab, such as <em>Format HTML tags</em>. The only work-around I found is to disable Javadoc formatting completely by disabling both the <em>Enable Javadoc comment formatting</em> and <em>Enable block comment formatting</em> options, which means I then have to format comment blocks manually.</p>
| [
{
"answer_id": 45574,
"author": "Ishmaeel",
"author_id": 227,
"author_profile": "https://Stackoverflow.com/users/227",
"pm_score": 1,
"selected": false,
"text": "<gcServer enabled=\"true\" /> <!-- note the space just after \"true\" -->\n"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2670/"
] |
45,424 | <p>I'm using <b>Struts 2</b>.</p>
<p>I'd like to return from an Action to the page which invoked it.</p>
<p>Say I'm in page <strong>x.jsp</strong>, I invoke Visual action to change CSS preferences in the session; I want to return to <strong>x.jsp</strong> rather than to a fixed page (i.e. <strong>home.jsp</strong>)<br/></p>
<p>Here's the relevant <strong>struts.xml</strong> fragment:
<br/></p>
<pre>
<action
name="Visual"
class="it.___.web.actions.VisualizationAction">
<result name="home">/pages/home.jsp</result>
</action>
</pre>
<p>Of course my <code>VisualizationAction.execute()</code> returns <strong>home</strong>.</p>
<p>Is there any "magic" constant (like, say, INPUT_PAGE) that I may return to do the trick?<br/></p>
<p>Must I use a more involved method (i.e. extracting the request page and forwarding to it)?<br/></p>
<p>T.I.A.</p>
| [
{
"answer_id": 45595,
"author": "nikhilbelsare",
"author_id": 4705,
"author_profile": "https://Stackoverflow.com/users/4705",
"pm_score": 1,
"selected": false,
"text": "return INPUT;\n"
},
{
"answer_id": 202693,
"author": "Vincent Ramdhanie",
"author_id": 27439,
"auth... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45424",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4690/"
] |
45,437 | <p>I wondered whether anybody knows how to obtain membership of local groups on a remote server programmatically via C#. Would this require administrator permissions? And if so is there any way to confirm the currently logged in user's membership (or not) of these groups?</p>
| [
{
"answer_id": 45458,
"author": "Espo",
"author_id": 2257,
"author_profile": "https://Stackoverflow.com/users/2257",
"pm_score": 2,
"selected": false,
"text": "public ArrayList Groups(string userDn, bool recursive)\n{\n ArrayList groupMemberships = new ArrayList();\n return Attribu... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3394/"
] |
45,453 | <p>I'm generating ICalendar (.ics) files.</p>
<p>Using the UID and SEQUENCE fields I can update existing events in Google Calendar and in Windows Calendar <strong><em>BUT NOT</em></strong> in MS Outlook 2007 - it just creates a second event</p>
<p>How do I get them to work for Outlook ?</p>
<p>Thanks</p>
<p>Tom</p>
| [
{
"answer_id": 45703,
"author": "Hank Gay",
"author_id": 4203,
"author_profile": "https://Stackoverflow.com/users/4203",
"pm_score": 0,
"selected": false,
"text": "VERSION"
},
{
"answer_id": 45969,
"author": "Tom Carter",
"author_id": 2839,
"author_profile": "https://... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2839/"
] |
45,470 | <p>Can you suggest some good MVC framework for perl -- one I am aware of is <a href="http://www.catalystframework.org/" rel="noreferrer">catalyst</a></p>
<p>The need is to be able to expose services on the perl infrastructure which can be called by Java/.Net applications seamlessly.</p>
| [
{
"answer_id": 70871,
"author": "Aristotle Pagaltzis",
"author_id": 9410,
"author_profile": "https://Stackoverflow.com/users/9410",
"pm_score": 3,
"selected": false,
"text": "uri_for"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45470",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4406/"
] |
45,475 | <p>I'm presenting information from a DataTable on my page and would like to add some sorting functionality which goes a bit beyond a straight forward column sort. As such I have been trying to place LinkButtons in the HeaderItems of my GridView which post-back to functions that change session information before reloading the page.</p>
<p>Clicking my links <em>DOES</em> cause a post-back but they don't seem to generate any <em>OnClick</em> events as my <em>OnClick</em> functions don't get executed. I have <code>AutoEventWireup</code> set to true and if I move the links out of the GridView they work fine.</p>
<p>I've got around the problem by creating regular anchors, appending queries to their <strong>hrefs</strong> and checking for them at page load but I'd prefer C# to be doing the grunt work. Any ideas?</p>
<p><strong>Update:</strong> To clarify the IDs of the controls match their <em>OnClick</em> function names.</p>
| [
{
"answer_id": 45513,
"author": "NakedBrunch",
"author_id": 3742,
"author_profile": "https://Stackoverflow.com/users/3742",
"pm_score": 2,
"selected": false,
"text": "<HeaderTemplate> \n <asp:LinkButton ID=\"LinkButton1\" runat=\"server\" CommandName=\"sort\" CommandArgument=\"Product... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45475",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4431/"
] |
45,481 | <p>How can you do a streaming read on a large XML file that contains a xs:sequence just below root element, without loading the whole file into a XDocument instance in memory?</p>
| [
{
"answer_id": 45493,
"author": "Hirvox",
"author_id": 4674,
"author_profile": "https://Stackoverflow.com/users/4674",
"pm_score": 4,
"selected": true,
"text": "void ParseURL(string strUrl)\n{\n try\n {\n using (var reader = XmlReader.Create(strUrl))\n {\n while (reader.Read... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4685/"
] |
45,485 | <p>Are there conventions for function names when using the Perl Test::More or Test::Simple modules?</p>
<p>I'm specifically asking about the names of functions that are used to set up a test environment before the test and to tear down the environment after successful completion of the test(s).</p>
<p>cheers,</p>
<p>Rob</p>
| [
{
"answer_id": 45542,
"author": "Jagmal",
"author_id": 4406,
"author_profile": "https://Stackoverflow.com/users/4406",
"pm_score": 3,
"selected": true,
"text": "BEGIN {\n # If you want to set some global db setting/file setting/INC changes etc\n}\n\n# Tests functionality 1...\n{\n ... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2974/"
] |
45,494 | <p>I have a table <code>story_category</code> in my database with corrupt entries. The next query returns the corrupt entries:</p>
<pre><code>SELECT *
FROM story_category
WHERE category_id NOT IN (
SELECT DISTINCT category.id
FROM category INNER JOIN
story_category ON category_id=category.id);
</code></pre>
<p>I tried to delete them executing:</p>
<pre><code>DELETE FROM story_category
WHERE category_id NOT IN (
SELECT DISTINCT category.id
FROM category
INNER JOIN story_category ON category_id=category.id);
</code></pre>
<p>But I get the next error: </p>
<blockquote>
<p>#1093 - You can't specify target table 'story_category' for update in FROM clause </p>
</blockquote>
<p>How can I overcome this?</p>
| [
{
"answer_id": 45498,
"author": "Cheekysoft",
"author_id": 1820,
"author_profile": "https://Stackoverflow.com/users/1820",
"pm_score": 11,
"selected": true,
"text": "UPDATE tbl AS a\nINNER JOIN tbl AS b ON ....\nSET a.col = b.col\n"
},
{
"answer_id": 694011,
"author": "Tom Sc... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2138/"
] |
45,507 | <p>I'm looking to create <code>favicon.ico</code> files programatically from Python, but PIL only has support for reading <code>ico</code> files.</p>
| [
{
"answer_id": 36168447,
"author": "Ronan Paixão",
"author_id": 3754432,
"author_profile": "https://Stackoverflow.com/users/3754432",
"pm_score": 6,
"selected": false,
"text": "from PIL import Image\nfilename = r'logo.png'\nimg = Image.open(filename)\nimg.save('logo.ico')\n"
},
{
... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45507",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4203/"
] |
45,510 | <p>I want to call a function from a .NET DLL (coded in C#) from an Inno Setup script.</p>
<p>I have:</p>
<ol>
<li>marked the <em>Register for COM interop</em> option in the project properties,</li>
<li>changed the <em>ComVisible</em> setting in the <em>AssemblyInfo.cs</em> file,</li>
<li>added these lines to the ISS script:</li>
</ol>
<blockquote>
<p>[Files]</p>
<p>Source: c:\temp\1\MyDLL.dll; Flags: dontcopy</p>
<p>[Code]</p>
<p>function MyFunction(): string;</p>
<p>external 'MyFunction@files:MyDLL.dll stdcall setuponly';</p>
</blockquote>
<p>but I still get the following error:</p>
<blockquote>
<p>Runtime Error (at -1:0):</p>
<p>Cannot Import dll:C:\DOCUME~1\foo\LOCALS~1\Temp\is-LRL3E.tmp\MyDLL.dll.</p>
</blockquote>
<p>What am I doing wrong?</p>
| [
{
"answer_id": 45590,
"author": "Marek Grzenkowicz",
"author_id": 95,
"author_profile": "https://Stackoverflow.com/users/95",
"pm_score": 2,
"selected": false,
"text": "[Code]\nprocedure MyFunction();\nvar\n oleObject: Variant;\nbegin\n oleObject := CreateOleObject('MyDLL.MyDLL');\n\n ... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45510",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95/"
] |
45,528 | <p>I'm trying to find a simple way to change the colour of the text and background in <code>listview</code> and <code>treeview</code> controls in WTL or plain Win32 code.</p>
<p>I really don't want to have to implement full owner drawing for these controls, simply change the colours used.</p>
<p>I want to make sure that the images are still drawn with proper transparency.</p>
<p>Any suggestions?</p>
| [
{
"answer_id": 49257,
"author": "macbirdie",
"author_id": 5049,
"author_profile": "https://Stackoverflow.com/users/5049",
"pm_score": 2,
"selected": false,
"text": "CListViewCtrl"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45528",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4591/"
] |
45,535 | <p>I need the month+year from the datetime in SQL Server like 'Jan 2008'. I'm grouping the query by month, year. I've searched and found functions like datepart, convert, etc., but none of them seem useful for this. Am I missing something here? Is there a function for this?</p>
| [
{
"answer_id": 45543,
"author": "SQLMenace",
"author_id": 740,
"author_profile": "https://Stackoverflow.com/users/740",
"pm_score": 3,
"selected": false,
"text": "select convert(varchar(4),getdate(),100) + convert(varchar(4),year(getdate()))\n"
},
{
"answer_id": 45548,
"auth... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1688440/"
] |
45,540 | <p>I’ve writen a little python script that just pops up a message box containing the text passed on the command line. I want to pop it up only when the window —resulting from a previous call— is not open.</p>
<pre><code>from Tkinter import *
import tkMessageBox
root = Tk()
root.withdraw()
# TODO not if a window with this title exists
tkMessageBox.showinfo("Key you!", " ".join(sys.argv[1:]))
</code></pre>
<p>Any idea how to check that?</p>
| [
{
"answer_id": 46205,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 2,
"selected": false,
"text": "if 'normal' != root.state():\n tkMessageBox.showinfo(\"Key you!\", \" \".join(sys.argv[1:]))\n"
},
{
"answer_id": 47... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4717/"
] |
45,545 | <p>How can I add horizontal scroll capabilities to the asp.net listbox control?</p>
| [
{
"answer_id": 45549,
"author": "Espo",
"author_id": 2257,
"author_profile": "https://Stackoverflow.com/users/2257",
"pm_score": 1,
"selected": false,
"text": "<div style=\"width:200px; height:100px; overflow:auto;\">\n<SELECT size=\"4\">\n<OPTION\nValue=\"1\">blahblahblahblahblahblahbla... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45545",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1360/"
] |
45,546 | <p>I want my controller to return the right HTTP response code when the user lacks permission to view a particular page.</p>
| [
{
"answer_id": 45568,
"author": "John Boker",
"author_id": 2847,
"author_profile": "https://Stackoverflow.com/users/2847",
"pm_score": 3,
"selected": false,
"text": "response.setStatus(403)"
},
{
"answer_id": 45585,
"author": "Cheekysoft",
"author_id": 1820,
"author_p... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45546",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4702/"
] |
45,577 | <p>This happened to me in Visual Studio 2008 pre and post 2008 sp1 on more than one computer and to someone else I know, so it can't be an isolated incident.</p>
<p>Seemingly random, every so often I lose all syntax highlighting in my aspx page (the html) so that Visual Studio now looks like a really expensive version of notepad.</p>
<p>Does anyone know why does happens? Better yet, anyone know how to fix it?</p>
| [
{
"answer_id": 215482,
"author": "Herb Caudill",
"author_id": 239663,
"author_profile": "https://Stackoverflow.com/users/239663",
"pm_score": 1,
"selected": false,
"text": "Couldn't reformat due to line 123"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45577",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4050/"
] |
45,582 | <p>I'm trying to use Groovy to create an interactive scripting / macro mode for my application. The application is OSGi and much of the information the scripts may need is not know up front. I figured I could use GroovyShell and call eval() multiple times continually appending to the namespace as OSGi bundles are loaded. GroovyShell maintains variable state over multiple eval calls, but not class definitions or methods.</p>
<p>goal: Create a base class during startup. As OSGi bundles load, create derived classes as needed. </p>
| [
{
"answer_id": 46115,
"author": "toolkit",
"author_id": 3295,
"author_profile": "https://Stackoverflow.com/users/3295",
"pm_score": 0,
"selected": false,
"text": "def binding = new Binding(x: 6, y: 4)\ndef shell = new GroovyShell(binding)\ndef expression = '''f = x * y'''\nshell.evaluate... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/287/"
] |
45,600 | <p>The <a href="http://dev.jquery.com/view/trunk/ui/demos/functional/#ui.dialog" rel="nofollow noreferrer">demos</a> for the jquery ui dialog all use the "flora" theme. I wanted a customized theme, so I used the themeroller to generate a css file. When I used it, everything seemed to be working fine, but later I found that I can't control any input element contained in the dialog (i.e, can't type into a text field, can't check checkboxes). Further investigation revealed that this happens if I set the dialog attribute "modal" to true. This doesn't happen when I use the flora theme. </p>
<p>Here is the js file:</p>
<pre><code>topMenu = {
init: function(){
$("#my_button").bind("click", function(){
$("#SERVICE03_DLG").dialog("open");
$("#something").focus();
});
$("#SERVICE03_DLG").dialog({
autoOpen: false,
modal: true,
resizable: false,
title: "my title",
overlay: {
opacity: 0.5,
background: "black"
},
buttons: {
"OK": function() {
alert("hi!");
},
"cancel": function() {
$(this).dialog("close");
}
},
close: function(){
$("#something").val("");
}
});
}
}
$(document).ready(topMenu.init);
</code></pre>
<p>Here is the html that uses the flora theme:</p>
<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<title>sample</title>
<script src="jquery-1.2.6.min.js" language="JavaScript"></script>
<link rel="stylesheet" href="flora/flora.all.css" type="text/css">
<script src="jquery-ui-personalized-1.5.2.min.js" language="JavaScript"></script>
<script src="TopMenu.js" language="JavaScript"></script>
</head>
<body>
<input type="button" value="click me!" id="my_button">
<div id="SERVICE03_DLG" class="flora">please enter something<br><br>
<label for="something">somthing:</label>&nbsp;<input name="something" id="something" type="text" maxlength="20" size="24">
</div>
</body>
</html>
</code></pre>
<p>Here is the html that uses the downloaded themeroller theme:</p>
<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<title>sample</title>
<script src="jquery-1.2.6.min.js" language="JavaScript"></script>
<link rel="stylesheet" href="jquery-ui-themeroller.css" type="text/css">
<script src="jquery-ui-personalized-1.5.2.min.js" language="JavaScript"></script>
<script src="TopMenu.js" language="JavaScript"></script>
</head>
<body>
<input type="button" value="click me!" id="my_button">
<div id="SERVICE03_DLG" class="ui-dialog">please enter something<br><br>
<label for="something">somthing:</label>&nbsp;<input name="something" id="something" type="text" maxlength="20" size="24">
</div>
</body>
</html>
</code></pre>
<p>As you can see, only the referenced css file and class names are different.
Anybody have a clue as to what could be wrong?</p>
<p>@David: I tried it, and it doesn't seem to work (neither on FF or IE). I tried inline css:</p>
<pre class="lang-none prettyprint-override"><code>style="z-index:5000"
</code></pre>
<p>and I've also tried it referencing an external css file:</p>
<pre class="lang-none prettyprint-override"><code>#SERVICE03_DLG{z-index:5000;}
</code></pre>
<p>But neither of these work. Am I missing something in what you suggested?</p>
<p><strong>Edit:</strong><br>
Solve by brostbeef!<br>
Since I was originally using flora, I had mistakenly assumed that I have to specify a class attribute. Turns out, this is only true when you actually use the flora theme (as in the samples). If you use the customized theme, specifying a class attribute causes that strange behaviour.</p>
| [
{
"answer_id": 231357,
"author": "brostbeef",
"author_id": 16437,
"author_profile": "https://Stackoverflow.com/users/16437",
"pm_score": 3,
"selected": true,
"text": "<div id=\"SERVICE03_DLG\" class=\"flora\">"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3751/"
] |
45,604 | <p>C# doesn't require you to specify a generic type parameter if the compiler can infer it, for instance:</p>
<pre><code>List<int> myInts = new List<int> {0,1,1,
2,3,5,8,13,21,34,55,89,144,233,377,
610,987,1597,2584,4181,6765};
//this statement is clunky
List<string> myStrings = myInts.
Select<int,string>( i => i.ToString() ).
ToList<string>();
//the type is inferred from the lambda expression
//the compiler knows that it's taking an int and
//returning a string
List<string> myStrings = myInts.
Select( i => i.ToString() ).
ToList();
</code></pre>
<p>This is needed for anonymous types where you don't know what the type parameter would be (in intellisense it shows up as <code>'a</code>) because it's added by the compiler.</p>
<p>Class-level type parameters don't let you do this:</p>
<pre><code>//sample generic class
public class GenericDemo<T>
{
public GenericDemo ( T value )
{
GenericTypedProperty = value;
}
public T GenericTypedProperty {get; set;}
}
//why can't I do:
int anIntValue = 4181;
var item = new GenericDemo( anIntValue ); //type inference fails
//however I can create a wrapper like this:
public static GenericDemo<T> Create<T> ( T value )
{
return new GenericDemo<T> ( value );
}
//then this works - type inference on the method compiles
var item = Create( anIntValue );
</code></pre>
<p>Why doesn't C# support this class level generic type inference?</p>
| [
{
"answer_id": 45612,
"author": "Konrad Rudolph",
"author_id": 1968,
"author_profile": "https://Stackoverflow.com/users/1968",
"pm_score": 3,
"selected": false,
"text": "class Foo<T> {\n public Foo<U>(U x) { }\n}\n\nvar x = new Foo(1);\n"
},
{
"answer_id": 45706,
"author":... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/905/"
] |
45,611 | <p>I have a database with a few dozen tables interlinked with foreign keys. Under normal circumstances, I want the default <code>ON DELETE RESTRICT</code> behavior for those constraints. But when trying to share a snapshot of the database with a consultant, I needed to remove some sensitive data. I wish that my memory of a <code>DELETE FROM Table CASCADE</code> command hadn't been pure hallucination.</p>
<p>What I ended out doing was dumping the database, writing a script to process the dump by adding <code>ON DELETE CASCADE</code> clauses too all the foreign key constraints, restoring from that, performing my deletes, dumping again, removing the <code>ON DELETE CASCADE</code>, and finally restoring again. That was easier than writing the deletion query I'd have needed to do this in SQL -- removing whole slices of the database isn't a normal operation, so the schema isn't exactly adapted to it.</p>
<p>Does anyone have a better solution for the next time something like this comes up?</p>
| [
{
"answer_id": 56978,
"author": "angch",
"author_id": 5386,
"author_profile": "https://Stackoverflow.com/users/5386",
"pm_score": 0,
"selected": false,
"text": "createdb -h scratchserver scratchdb\ncreatedb -h scratchserver sanitizeddb\n\npg_dump -h liveserver livedb --schema-only | psql... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
45,613 | <p>What could be the problem with reversing the array of DOM objects as in the following code:</p>
<pre><code>var imagesArr = new Array();
imagesArr = document.getElementById("myDivHolderId").getElementsByTagName("img");
imagesArr.reverse();
</code></pre>
<p>In Firefox 3, when I call the <code>reverse()</code> method the script stops executing and shows the following error in the console of the Web Developer Toolbar:</p>
<pre class="lang-none prettyprint-override"><code>imagesArr.reverse is not a function
</code></pre>
<p>The <code>imagesArr</code> variable can be iterated through with a for loop and elements like <code>imagesArr[i]</code> can be accessed, so why is it not seen as an array when calling the <code>reverse()</code> method?</p>
| [
{
"answer_id": 45740,
"author": "Vincent Robert",
"author_id": 268,
"author_profile": "https://Stackoverflow.com/users/268",
"pm_score": 3,
"selected": false,
"text": "getElementsByTag()"
},
{
"answer_id": 28211790,
"author": "iProDev",
"author_id": 4506730,
"author_p... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45613",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4723/"
] |
45,621 | <p>Example</p>
<p>I have <code>Person</code>, <code>SpecialPerson</code>, and <code>User</code>. <code>Person</code> and <code>SpecialPerson</code> are just people - they don't have a user name or password on a site, but they are stored in a database for record keeping. User has all of the same data as <code>Person</code> and potentially <code>SpecialPerson</code>, along with a user name and password as they are registered with the site.</p>
<hr>
<p>How would you address this problem? Would you have a <code>Person</code> table which stores all data common to a person and use a key to look up their data in <code>SpecialPerson</code> (if they are a special person) and User (if they are a user) and vice-versa?</p>
| [
{
"answer_id": 45770,
"author": "Radu094",
"author_id": 3263,
"author_profile": "https://Stackoverflow.com/users/3263",
"pm_score": 3,
"selected": false,
"text": "PERSON (personid,persontype, name,address, phone, XMLOtherProperties)\n"
},
{
"answer_id": 28781045,
"author": "O... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/572/"
] |
45,623 | <p>In Java, what would the best way be to have a constantly listening port open, and still send upon receipt of a packet. I am not particularly savvy with network programming at the moment, so the tutorials I have found on the net aren't particularly helpful.</p>
<p>Would it make sense to have the listening socket as a serversocket and run it in a separate thread to the socket I'm using to send data to the server?</p>
<p>In a loosely related question. Does anyone know if programming simply for java, in netbeans then exporting it for use on a blackberry (using a plugin) the sockets would still work ?</p>
| [
{
"answer_id": 45630,
"author": "basszero",
"author_id": 287,
"author_profile": "https://Stackoverflow.com/users/287",
"pm_score": 5,
"selected": true,
"text": "SocketChannels"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45623",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4739/"
] |
45,624 | <p>I use TortoiseSVN to access file based local repo. In all my commits an author is my Windows login name. Is it possible to use different name?</p>
<p>I know how to change author after commit but how to change before? Installing apache/svnserver is not an option. </p>
| [
{
"answer_id": 45673,
"author": "Brock Boland",
"author_id": 2185,
"author_profile": "https://Stackoverflow.com/users/2185",
"pm_score": 0,
"selected": false,
"text": "msznajder"
},
{
"answer_id": 265268,
"author": "Rômulo Ceccon",
"author_id": 23193,
"author_profile"... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45624",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/501/"
] |
45,626 | <p>I have a basic CRUD form that uses PageMethods to update the user details, however the Validators don't fire off, I think I need to manually initialize the validators and check whether the validation has passed in my javascript save method. Any ideas on how to do this?</p>
| [
{
"answer_id": 49371,
"author": "Nicholas",
"author_id": 2808,
"author_profile": "https://Stackoverflow.com/users/2808",
"pm_score": 2,
"selected": true,
"text": "Page_ClientValidate()"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45626",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2808/"
] |
45,627 | <p>In unmanaged C/C++ code, what are the best practices to detect memory leaks? And coding guidelines to avoid? (As if it's that simple ;)</p>
<p>We have used a bit of a silly way in the past: having a counter increment for every memory allocation call and decrement while freeing. At the end of the program, the counter value should be zero.</p>
<p>I know this is not a great way and there are a few catches. (For instance, if you are freeing memory which was allocated by a platform API call, your allocation count will not exactly match your freeing count. Of course, then we incremented the counter when calling API calls that allocated memory.)</p>
<p>I am expecting your experiences, suggestions and maybe some references to tools which simplify this.</p>
| [
{
"answer_id": 45652,
"author": "Serge",
"author_id": 1007,
"author_profile": "https://Stackoverflow.com/users/1007",
"pm_score": 3,
"selected": false,
"text": "vector"
},
{
"answer_id": 45717,
"author": "John Sibly",
"author_id": 1078,
"author_profile": "https://Stac... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123/"
] |
45,634 | <p>How do you rewrite this in Linq?</p>
<pre><code>SELECT Id, Name FROM TableA WHERE TableA.Id IN (SELECT xx from TableB INNER JOIN Table C....)
</code></pre>
<p>So in plain english, I want to select Id and Name from TableA where TableA's Id is in a result set from a second query.</p>
| [
{
"answer_id": 45648,
"author": "John Boker",
"author_id": 2847,
"author_profile": "https://Stackoverflow.com/users/2847",
"pm_score": 4,
"selected": true,
"text": "from a in TableA \nwhere (from b in TableB \n join c in TableC on b.id equals c.id\n where .. select b.id)\n.Co... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45634",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3047/"
] |
45,642 | <p>I was wondering if there is an open source library or algorithm that can expand a non-numeric range. For example, if you have <code>1A</code> to <code>9A</code> you should get </p>
<pre><code>1A, 2A, 3A, 4A, 5A, 6A, 7A, 8A, 9A.
</code></pre>
<p>I've tried Googling for this and the best I could come up with were Regex that would expand numerics with dashes (1-3 becoming 1,2,3).</p>
| [
{
"answer_id": 47126,
"author": "Emperor XLII",
"author_id": 2495,
"author_profile": "https://Stackoverflow.com/users/2495",
"pm_score": 0,
"selected": false,
"text": "0-9"
},
{
"answer_id": 47373,
"author": "mweerden",
"author_id": 4285,
"author_profile": "https://St... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45642",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1210/"
] |
45,650 | <p>Many times I have seen Visual Studio solutions which have multiple projects that share source files. These common source files are usually out in a common directory and in the solution explorer their icon shows up with a link arrow in the bottom left.</p>
<p>However, any time I try to add a source file to the project that is outside of that project's main directory, it just automatically copies it into the directory so that I no longer have a shared copy.</p>
<p>I found that I can get around this by manually opening the project file in a text editor and modifying the path to something like "../../../Common/Source.cs" but this is more of a hack then I would like.</p>
<p>Is there a setting or something I can change that will allow me to do this from within the IDE?</p>
| [
{
"answer_id": 45677,
"author": "David Mohundro",
"author_id": 4570,
"author_profile": "https://Stackoverflow.com/users/4570",
"pm_score": 2,
"selected": false,
"text": "<Compile Include=\"..\\CommonAssemblyInfo.cs\">\n <Link>CommonAssemblyInfo.cs</Link>\n</Compile>\n"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45650",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194/"
] |
45,651 | <p>I inserted some values into a table. There is a column whose value is auto-generated. In the next statement of my code, I want to retrieve this value.</p>
<p>Can you tell me how to do it the right way?</p>
| [
{
"answer_id": 45657,
"author": "DevelopingChris",
"author_id": 1220,
"author_profile": "https://Stackoverflow.com/users/1220",
"pm_score": 0,
"selected": false,
"text": "SELECT @@Scope_Identity as Id\n"
},
{
"answer_id": 45665,
"author": "David Basarab",
"author_id": 246... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/184/"
] |
45,653 | <p>We use QuickBooks for financial management, and feed it from a variety of sources. I now need to hook it up to BizTalk, and I'd hate to reinvent the wheel. I've done searches, and as far as I can tell there's no QuickBooks adapter for BizTalk. Does anyone know of anything that'll do the job, preferably something that doesn't suck? </p>
<hr>
<p>Doesn't the QB SDK require that Quickbooks be running on the client machine? Is there any way around it?</p>
| [
{
"answer_id": 45735,
"author": "seanyboy",
"author_id": 1726,
"author_profile": "https://Stackoverflow.com/users/1726",
"pm_score": 2,
"selected": true,
"text": "Imports QBFC7Lib\n\nSub AttachToDB()\n If isAttachedtoQB Then Exit Sub\n\n Lasterror = \"Unknown QuickBooks Error\"\n ... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2757/"
] |
45,658 | <p>I wrote an Active X plugin for IE7 which implements IObjectWithSite besides some other necessary interfaces (note no IOleClient). This interface is queried and called by IE7. During the SetSite() call I retrieve a pointer to IE7's site interface which I can use to retrieve the IHTMLDocument2 interface using the following approach:</p>
<pre><code>IUnknown *site = pUnkSite; /* retrieved from IE7 during SetSite() call */
IServiceProvider *sp = NULL;
IHTMLWindow2 *win = NULL;
IHTMLDocument2 *doc = NULL;
if(site) {
site->QueryInterface(IID_IServiceProvider, (void **)&sp);
if(sp) {
sp->QueryService(IID_IHTMLWindow2, IID_IHTMLWindow2, (void **)&win);
if(win) {
win->get_document(&doc);
}
}
}
if(doc) {
/* found */
}
</code></pre>
<p>I tried a similiar approach on PIE as well using the following code, however, even the IPIEHTMLWindow2 interface cannot be acquired, so I'm stuck:</p>
<pre><code>IUnknown *site = pUnkSite; /* retrieved from PIE during SetSite() call */
IPIEHTMLWindow2 *win = NULL;
IPIEHTMLDocument1 *tmp = NULL;
IPIEHTMLDocument2 *doc = NULL;
if(site) {
site->QueryInterface(__uuidof(*win), (void **)&win);
if(win) { /* never the case */
win->get_document(&tmp);
if(tmp) {
tmp->QueryInterface(__uuidof(*doc), (void **)&doc);
}
}
}
if(doc) {
/* found */
}
</code></pre>
<p>Using the IServiceProvider interface doesn't work either, so I already tested this.</p>
<p>Any ideas?</p>
| [
{
"answer_id": 63430,
"author": "gnobal",
"author_id": 7748,
"author_profile": "https://Stackoverflow.com/users/7748",
"pm_score": 3,
"selected": true,
"text": "#ifdef WINCE\n// We can't get IWebBrowser2 for WinCE.\n#else\nHRESULT ActiveXUtils::GetWebBrowser2(IUnknown *site, IWebBrowser2... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4735/"
] |
45,702 | <p>Let's say I want to run a .NET application on a machine where the .NET framework is not available; Is there any way to compile the application to native code?</p>
| [
{
"answer_id": 35467422,
"author": "James Ko",
"author_id": 4077294,
"author_profile": "https://Stackoverflow.com/users/4077294",
"pm_score": 5,
"selected": false,
"text": "cd"
},
{
"answer_id": 55796754,
"author": "kbridge4096",
"author_id": 4379906,
"author_profile"... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/184/"
] |
45,729 | <p>I want to use the <a href="http://msdn.microsoft.com/en-us/library/system.enterpriseservices.internal.publish.gacremove(VS.80).aspx" rel="nofollow noreferrer">Publish.GacRemove</a> function to remove an assembly from GAC. However, I don't understand what path I should pass as an argument.</p>
<p>Should it be a path to the original DLL (what if I removed it after installing it in the GAC?) or the path to the assembly in the GAC?</p>
<p><strong>UPDATE:</strong></p>
<p>I finally used <a href="http://blogs.msdn.com/junfeng/articles/229649.aspx" rel="nofollow noreferrer">these API wrappers</a>.</p>
| [
{
"answer_id": 45747,
"author": "Espo",
"author_id": 2257,
"author_profile": "https://Stackoverflow.com/users/2257",
"pm_score": 3,
"selected": true,
"text": "GacInstall"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95/"
] |
45,732 | <p>I have an object graph serialized to xaml. A rough sample of what it looks like is:</p>
<pre><code><MyObject xmlns.... >
<MyObject.TheCollection>
<PolymorphicObjectOne .../>
<HiImPolymorphic ... />
</MyObject.TheCollection>
</MyObject>
</code></pre>
<p>I want to use Linq to XML in order to extract the serialized objects within the TheCollection.</p>
<p><strong>Note</strong>: <code>MyObject</code> may be named differently at runtime; I'm interested in any object that implements the same interface, which has a public collection called <code>TheCollection</code> that contains types of <code>IPolymorphicLol</code>.</p>
<p>The only things I know at runtime are the depth at which I will find the collection and that the collection element is named ``*.TheCollection`. Everything else will change.</p>
<p>The xml will be retrieved from a database using Linq; if I could combine both queries so instead of getting the entire serialized graph and then extracting the collection objects I would just get back the collection that would be sweet.</p>
| [
{
"answer_id": 45747,
"author": "Espo",
"author_id": 2257,
"author_profile": "https://Stackoverflow.com/users/2257",
"pm_score": 3,
"selected": true,
"text": "GacInstall"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
45,769 | <p>I'm curious about everyones practices when it comes to using or distributing libraries for an application that you write.</p>
<p>First of all, when developing your application do you link the debug or release version of the libraries? (For when you run your application in debug mode)</p>
<p>Then when you run your app in release mode just before deploying, which build of the libraries do you use?</p>
<p>How do you perform the switch between your debug and release version of the libraries? Do you do it manually, do you use macros, or whatever else is it that you do?</p>
| [
{
"answer_id": 46120,
"author": "Henk",
"author_id": 4613,
"author_profile": "https://Stackoverflow.com/users/4613",
"pm_score": 2,
"selected": false,
"text": "$(ConfigurationName)"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45769",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4225/"
] |
45,779 | <p>How would you dynamically subscribe to a C# event so that given a Object instance and a String name containing the name of the event, you subscribe to that event and do something (write to the console for example) when that event has been fired?</p>
<p>It would seem using Reflection this isn't possible and I would like to avoid having to use Reflection.Emit if possible, as this currently (to me) seems like the only way of doing it.</p>
<p><strong>/EDIT:</strong> I do not know the signature of the delegate needed for the event, this is the core of the problem</p>
<p><strong>/EDIT 2:</strong> Although delegate contravariance seems like a good plan, I can not make the assumption necessary to use this solution</p>
| [
{
"answer_id": 45797,
"author": "Nick Berardi",
"author_id": 17,
"author_profile": "https://Stackoverflow.com/users/17",
"pm_score": 2,
"selected": false,
"text": "var o = new SomeObjectWithEvent;\no.GetType().GetEvent(\"SomeEvent\").AddEventHandler(...);\n"
},
{
"answer_id": 458... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1111/"
] |
45,783 | <p>My team is currently trying to automate the deployment of our .Net and PHP web applications. We want to streamline deployments, and to avoid the hassle and many of the headaches caused by doing it manually.</p>
<p>We require a solution that will enable us to:</p>
<pre><code>- Compile the application
- Version the application with the SVN version number
- Backup the existing site
- Deploy to a web farm
</code></pre>
<p>All our apps are source controlled using SVN and our .Net apps use CruiseControl.
We have been trying to use MSBuild and NAnt deployment scripts with limited success. We have also used Capistrano in the past, but wish to avoid using Ruby if possible.</p>
<p>Are there any other deployment tools out there that would help us?</p>
| [
{
"answer_id": 70621,
"author": "Paul Shannon",
"author_id": 11503,
"author_profile": "https://Stackoverflow.com/users/11503",
"pm_score": 1,
"selected": false,
"text": "msdeploy -verb:sync -source:dirpath=\\\\build\\e$\\app -dest:dirpath=\\\\live\\d$\\app,ignoreAcls=true\n"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45783",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4734/"
] |
45,792 | <p>I've had some trouble forking of processes from a Perl CGI script when running on Windows. The main issue seems to be that 'fork' is emulated when running on windows, and doesn't actually seem to create a new process (just another thread in the current one). This means that web servers (like IIS) which are waiting for the process to finish continue waiting until the 'background' process finishes.</p>
<p>Is there a way of forking off a background process from a CGI script under Windows? Even better, is there a single function I can call which will do this in a cross platform way?</p>
<p>(And just to make life extra difficult, I'd really like a good way to redirect the forked processes output to a file at the same time).</p>
| [
{
"answer_id": 49216535,
"author": "Jeffrey Tackett",
"author_id": 6789640,
"author_profile": "https://Stackoverflow.com/users/6789640",
"pm_score": 0,
"selected": false,
"text": " (All the CGI code that is standard stuff. Calls the subroutine needed, and then)\n\n my $randnum = int(r... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/797/"
] |
45,796 | <p>Our ASP.NET 3.5 website running on IIS 6 has two teams that are adding content: </p>
<ul>
<li>Development team adding code. </li>
<li>Business team adding simple web pages. </li>
</ul>
<p>For sanity and organization, we would like for the business team to add their web pages to a sub-folder in the project: </p>
<blockquote>
<p>Root: for pages of development team </p>
<p>Content: for pages of business team </p>
</blockquote>
<p><strong>But</strong> </p>
<p>We would like for users to be able to navigate to the business team content without having to append "Content" in their URLs, as described below:</p>
<blockquote>
<p><strong>Root</strong>: Default.aspx (<em>Available at: www.oursite.com/default.aspx</em>)</p>
<p><strong>Content</strong>: Popcorn.aspx (<em>Available at: www.oursite.com/popcorn.aspx</em>)</p>
</blockquote>
<p>Is there a way we can accomplish for making a config entry in an ISAPI rewrite tool for every one of these pages?</p>
| [
{
"answer_id": 45926,
"author": "Adam Cuzzort",
"author_id": 4760,
"author_profile": "https://Stackoverflow.com/users/4760",
"pm_score": 2,
"selected": true,
"text": "RewriteCond %{REQUEST_FILENAME} -!f\nRewriteCond Content/%{REQUEST_FILENAME} -f\nRewriteRule (.*) Content/(.*)\n"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45796",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/308/"
] |
45,803 | <ol>
<li>Video podcast</li>
<li>???</li>
<li>Audio only mp3 player</li>
</ol>
<p>I'm looking for somewhere which will extract audio from video, but instead of a single file, for an on going video podcast.</p>
<p>I would most like a website which would suck in the RSS and spit out an RSS (I'm thinking of something like Feedburner), though would settle for something on my own machine.</p>
<p>If it must be on my machine, it should be quick, transparent, and automatic when I download each episode. </p>
<p>What would you use?</p>
<p><b>Edit:</b> I'm on an Ubuntu 8.04 machine; so running ffmpeg is no problem; however, I'm looking for automation and feed awareness.</p>
<p>Here's my use case: I want to listen to <a href="http://video.google.com/videosearch?q=google+techtalks&so=1&output=rss" rel="nofollow noreferrer">lectures</a> at Google Video, or <a href="http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/" rel="nofollow noreferrer">Structure and Interpretation of Computer Programs</a>. These videos come out fairly often, so anything that's needed to be done manually will also be done fairly often. </p>
<p>Here's one approach I'd thought of:</p>
<ul>
<li>download the RSS</li>
<li>parse the RSS for enclosures, </li>
<li>download the enclosures, keeping a track what has already been downloaded previously</li>
<li>transcode the files, but not the ones done already</li>
<li>reconstruct an RSS with the audio files, remembering to change the metadata.</li>
<li>schedule to be run periodically</li>
<li>point podcatcher at new RSS feed.</li>
</ul>
<p>I also liked the approach of gPodder of using a <a href="http://wiki.gpodder.org/wiki/Time_stretching#Using_the_post-download_script_hook" rel="nofollow noreferrer">post-download script</a>.</p>
<p>I wish the <a href="http://www.openp2p.com/pub/a/p2p/2003/01/07/lazyweb.html" rel="nofollow noreferrer">Lazy Web</a> still worked.</p>
| [
{
"answer_id": 45823,
"author": "Tim Farley",
"author_id": 4425,
"author_profile": "https://Stackoverflow.com/users/4425",
"pm_score": 4,
"selected": true,
"text": "ffmpeg -i episode1.mov -ab 128000 episode1.mp3\n"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45803",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4737/"
] |
45,813 | <p>Is there a way with WPF to get an array of elements under the mouse on a MouseMove event?</p>
| [
{
"answer_id": 182363,
"author": "David Schmitt",
"author_id": 4918,
"author_profile": "https://Stackoverflow.com/users/4918",
"pm_score": 6,
"selected": true,
"text": "Visual"
}
] | 2008/09/05 | [
"https://Stackoverflow.com/questions/45813",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3291/"
] |
45,824 | <p>I notice that StackOverflow has a views count for each question and that these view numbers are fairly low and accurate. </p>
<p>I have a similar thing on one of my sites. It basically logs a "hit" whenever the page is loaded in the backend code. Unfortunately it also does this for search engine hits giving bloated and inaccurate numbers.</p>
<p>I guess one way to not count a robot would be to do the view counting with an AJAX call once the page has loaded, but I'm sure there's other, better ways to ignore search engines in your hit counters whilst still letting them in to crawl your site. Do you know any?</p>
| [
{
"answer_id": 45835,
"author": "Matt Sheppard",
"author_id": 797,
"author_profile": "https://Stackoverflow.com/users/797",
"pm_score": 4,
"selected": true,
"text": "<link href=\"empty.css?log=example.html\" rel=\"stylesheet\" type=\"text/css\" />\n"
},
{
"answer_id": 45844,
... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3404/"
] |
45,827 | <p>How do you automatically set the focus to a textbox when a web page loads?</p>
<p>Is there an HTML tag to do it or does it have to be done via Javascript?</p>
| [
{
"answer_id": 45833,
"author": "Espo",
"author_id": 2257,
"author_profile": "https://Stackoverflow.com/users/2257",
"pm_score": 4,
"selected": false,
"text": "<BODY onLoad=\"document.getElementById('myButton').focus();\">\n"
},
{
"answer_id": 45843,
"author": "Joel Coehoorn"... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45827",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/305/"
] |
45,861 | <p>I am using <a href="http://code.google.com/p/js2-mode/" rel="noreferrer">js2-mode</a> to edit Javascript in Emacs, but I can't seem to get it to stop using tabs instead of spaces for indentation. My other modes work fine, just having issues w/ js2.</p>
| [
{
"answer_id": 7957258,
"author": "john_fries",
"author_id": 998684,
"author_profile": "https://Stackoverflow.com/users/998684",
"pm_score": 3,
"selected": false,
"text": ".emacs"
},
{
"answer_id": 30416044,
"author": "user1629060",
"author_id": 1629060,
"author_profi... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45861",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4748/"
] |
45,865 | <p>I'm writing a wizard for an Eclipse RCP application. After doing some processing on a file and taking some user input, I don't want to let the user go back to make changes. At this point they must either accept or reject the changes they are about to make to the system.</p>
<p>What I can't seem to find is a method call that lets me override the buttons that display or the user's ability to hit the back button. I'd prefer that it not be there or at least be disabled.</p>
<p>Has anyone found a way to do this using the <a href="http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/wizard/package-summary.html" rel="noreferrer">JFace Wizard</a> and <a href="http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/wizard/package-summary.html" rel="noreferrer">WizardPage</a>?</p>
<p>Usability-wise, am I breaking wizard conventions? Should I consider a different approach to the problem?</p>
| [
{
"answer_id": 6780595,
"author": "Nick Sawadsky",
"author_id": 856583,
"author_profile": "https://Stackoverflow.com/users/856583",
"pm_score": 3,
"selected": false,
"text": "public abstract class MyWizardPage extends WizardPage {\n private boolean backButtonEnabled = true;\n\n pub... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4513/"
] |
45,888 | <p>I have jQuery but I'm not sure if it has any built-in sorting helpers. I could make a 2d array of each item's <code>text</code>, <code>value</code>, and <code>selected</code> properties, but I don't think that javascript's built in <code>Array.sort()</code> would work correctly.</p>
| [
{
"answer_id": 45890,
"author": "travis",
"author_id": 1414,
"author_profile": "https://Stackoverflow.com/users/1414",
"pm_score": 3,
"selected": false,
"text": "function sortSelect(selectToSort) {\n var arrOptions = [];\n\n for (var i = 0; i < selectToSort.options.length; i++) {\... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1414/"
] |
45,898 | <p>In an application that I'm writing I have some code like this:</p>
<pre><code>NSWorkspace* ws = [NSWorkspace sharedWorkspace];
NSString* myurl = @"http://www.somewebsite.com/method?a=%d";
NSURL* url = [NSURL URLWithString:myurl];
[ws openURL:url];
</code></pre>
<p>The main difference being that <em>myurl</em> comes from somewhere outside my control. Note the %d in the URL which isn't entirely correct and means that URLWithString fails, returning <em>nil</em>.</p>
<p>What is the "correct" way of handling this? Do I need to parse the string and properly encode the arguments? Or is there some clever method in Cocoa that does all the hard work for me?</p>
| [
{
"answer_id": 45905,
"author": "Matt Sheppard",
"author_id": 797,
"author_profile": "https://Stackoverflow.com/users/797",
"pm_score": 2,
"selected": false,
"text": "http://www.somewebsite.com/method?a=%25d\n"
},
{
"answer_id": 8665933,
"author": "nverinaud",
"author_id"... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45898",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2998/"
] |
45,904 | <p><strong>Situation:</strong></p>
<p>I have a simple <em>XML</em> document that contains image information. I need to transform it into <em>HTML</em>. However, I can't see where the open tag is and when I use the <em>XSL</em> code below, it shows the following error message: </p>
<blockquote>
<p>"Cannot write an attribute node when no element start tag is open."</p>
</blockquote>
<p><strong>XML content:</strong></p>
<pre><code><root>
<HeaderText>
<HeaderText>Dan Testing</HeaderText>
</HeaderText>
<Image>
<img width="100" height="100" alt="FPO lady" src="/uploadedImages/temp_photo_small.jpg"/>
</Image>
<BodyText>
<p>This is a test of the body text<br /></p>
</BodyText>
<ShowLinkArrow>false</ShowLinkArrow>
</root>
</code></pre>
<p><strong>XSL code:</strong></p>
<pre><code><xsl:stylesheet version="1.0" extension-element-prefixes="msxsl"
exclude-result-prefixes="msxsl js dl" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:js="urn:custom-javascript" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:dl="urn:datalist">
<xsl:output method="xml" version="1.0" omit-xml-declaration="yes" indent="yes" encoding="utf-8"/>
<xsl:template match="/" xml:space="preserve">
<img>
<xsl:attribute name="width">
100
</xsl:attribute>
<xsl:attribute name="height">
100
</xsl:attribute>
<xsl:attribute name="class">
CalloutRightPhoto
</xsl:attribute>
<xsl:attribute name="src">
<xsl:copy-of select="/root/Image/node()"/>
</xsl:attribute>
</img>
</xsl:template>
</xsl:stylesheet>
</code></pre>
| [
{
"answer_id": 45912,
"author": "Cory Foy",
"author_id": 4083,
"author_profile": "https://Stackoverflow.com/users/4083",
"pm_score": 2,
"selected": false,
"text": "<xsl:value-of select=\"/root/Image/img/@src\"/>\n"
},
{
"answer_id": 45955,
"author": "samjudson",
"author_i... | 2008/09/05 | [
"https://Stackoverflow.com/questions/45904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2757/"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.