qid int64 4 22.2M | question stringlengths 18 48.3k | answers list | date stringlengths 10 10 | metadata list |
|---|---|---|---|---|
363,596 | <p>What is the best way to unit test a method that calls into multiple methods, for example:</p>
<pre><code>modify(string value)
{
if(value.Length > 5) replaceit(value);
else changeit(value);
}
</code></pre>
<p>This pseudo code has a modify method that (currently) calls either <code>replaceit()</code> or <code>changeit()</code>. I have already wrote tests for <code>replaceit</code> and <code>changeit</code>, so writing a new test for modify will be 99% the same set of code. I need to test it thought because it may change in the future. </p>
<p>So do I copy paste the existing test code? Move the test code to a common function? Any other ideas? I'm not sure of the best practice here.</p>
| [
{
"answer_id": 363615,
"author": "Bill the Lizard",
"author_id": 1288,
"author_profile": "https://Stackoverflow.com/users/1288",
"pm_score": 4,
"selected": false,
"text": "replaceit()"
},
{
"answer_id": 363649,
"author": "Ian Boyd",
"author_id": 12597,
"author_profile... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3291/"
] |
363,655 | <p>I'm using C# on Framework 3.5. I'm looking to quickly group a Generic List<> by two properties. For the sake of this example lets say I have a List of an Order type with properties of CustomerId, ProductId, and ProductCount. How would I get the sum of ProductCounts grouped by CustomerId and ProductId using a lambda expression?</p>
| [
{
"answer_id": 363756,
"author": "Jimmy",
"author_id": 4435,
"author_profile": "https://Stackoverflow.com/users/4435",
"pm_score": 7,
"selected": true,
"text": "var sums = Orders.GroupBy(x => new { x.CustomerID, x.ProductID })\n .Select(group => group.Sum(x => x.ProductCo... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7215/"
] |
363,660 | <p>I have a collection of orders. I would like to hit the database once, retrieve the orders, store them and then be able to access this collection over multiple forms. I know in asp.net, you can use things like Application Object or Session Object but how do you do it in a win form app? I was thinking of creating a static collection that could be accessed through multiple forms, classes, or wherever. Does this sound right and is it even feasible?</p>
<p>thanks</p>
| [
{
"answer_id": 363733,
"author": "Vyas Bharghava",
"author_id": 28413,
"author_profile": "https://Stackoverflow.com/users/28413",
"pm_score": 2,
"selected": true,
"text": "\nCacheList.OrderCache[orderNo].Customer.Address.City = \"Las Vegas\";"
}
] | 2008/12/12 | [
"https://Stackoverflow.com/questions/363660",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45429/"
] |
363,680 | <p>We mostly tend to following the above best practice.</p>
<p>Have a look at <a href="https://stackoverflow.com/questions/73883/string-vs-stringbuilder">String vs StringBuilder</a></p>
<p>But StringBuilder could throw <strong>OutOfMemoryException even when there is sufficient memory available</strong>. It throws OOM exception because it needs "continuous block of memory".</p>
<p>Some links for reference
<a href="http://bytes.com/groups/net-c/501231-stringbuilder-outofmemory" rel="nofollow noreferrer">StringBuilder OutOfMemoryException</a></p>
<p>and there are many more.....</p>
<p>How many of you faced this problem or aware and what did you do to resolve it?</p>
<p>Is there anything I am missing?</p>
<p><strong>P.S: I wasn't aware of this.</strong></p>
<p>I have rephrased the question.</p>
<p>*** The same thing worked with manual concatenation(I'll verify this and update SO). The other thing that caused me concern was that there is enough memory in the system. That's the reason I raised this question here to check whether any one faced this problem or there was something drastically wrong with the code. </p>
| [
{
"answer_id": 363877,
"author": "Brian Rasmussen",
"author_id": 38206,
"author_profile": "https://Stackoverflow.com/users/38206",
"pm_score": 2,
"selected": false,
"text": "StringBuilder"
},
{
"answer_id": 8609950,
"author": "archangel76",
"author_id": 1106463,
"auth... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34644/"
] |
363,681 | <p>How do I generate a random <code>int</code> value in a specific range?</p>
<p>The following methods have bugs related to integer overflow:</p>
<pre class="lang-java prettyprint-override"><code>randomNum = minimum + (int)(Math.random() * maximum);
// Bug: `randomNum` can be bigger than `maximum`.
</code></pre>
<pre class="lang-java prettyprint-override"><code>Random rn = new Random();
int n = maximum - minimum + 1;
int i = rn.nextInt() % n;
randomNum = minimum + i;
// Bug: `randomNum` can be smaller than `minimum`.
</code></pre>
| [
{
"answer_id": 363691,
"author": "krosenvold",
"author_id": 23691,
"author_profile": "https://Stackoverflow.com/users/23691",
"pm_score": 8,
"selected": false,
"text": "minValue + rn.nextInt(maxValue - minValue + 1)\n"
},
{
"answer_id": 363692,
"author": "Greg Case",
"aut... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42155/"
] |
363,706 | <p>This error should be a simple one but I cant seem to make it work. The problem lies in the fact that this very same code works earlier in the program. I don's see any reason for it to be sending an error on this instance and not the four previous ones. Reference the code below, and feel free to provide any criticism you may have as it should make me better. If it matters, I am using Sharp Develop 2.2.</p>
<p>Here is an example of the code that works:</p>
<pre><code>void calc2Click(object sender, EventArgs e)
{
if (!String.IsNullOrEmpty(tb2_fla.Text) & String.IsNullOrEmpty(tb2_e.Text) | String.IsNullOrEmpty(tb2_fla.Text) & String.IsNullOrEmpty(tb2_e.Text) | String.IsNullOrEmpty(tb2_e.Text))
{
MessageBox.Show("Enter either kVA and Voltage or FLA and Voltage", "Invalid Data Entry", MessageBoxButtons.OK);
}
if (!String.IsNullOrEmpty(tb2_kva.Text) & !String.IsNullOrEmpty(tb2_e.Text))
{
decimal x, y, z;
x = decimal.Parse(tb2_kva.Text);
y = decimal.Parse(tb2_e.Text);
z = (x * 1000) / (1.732050808m * y); //the m at the end of the decimal allows for the multiplication of decimals
tb2_fla.Text = z.ToString();
tb2_fla.Text = Math.Round(z,2).ToString();
}
else
{
if (!String.IsNullOrEmpty(tb2_fla.Text) & !String.IsNullOrEmpty(tb2_e.Text))
{
decimal x, y, z;
x = decimal.Parse(tb2_fla.Text);
y = decimal.Parse(tb2_e.Text);
z = (x * y * 1.732050808m) / 1000; //the m at the end of the decimal allows for the multiplication of decimals
tb2_kva.Text = Math.Round(z,2).ToString();
}
</code></pre>
<p>Here is the example of the code that sends the error in the subject line of this post:</p>
<pre><code>void Calc4Click(object sender, EventArgs e)
{
if (!String.IsNullOrEmpty(tb4_fla.Text) && String.IsNullOrEmpty(tb4_e.Text) || String.IsNullOrEmpty(tb4_kw.Text) & String.IsNullOrEmpty(tb4_e.Text) || String.IsNullOrEmpty(tb4_e.Text))
{ //If values are entered improperly, the following message box will appear
MessageBox.Show("Enter either FLA and Voltage or kW and Voltage", "Invalid Data Entry", MessageBoxButtons.OK);
}
if (!String.IsNullOrEmpty(tb4_fla.Text)&& !String.IsNullOrEmpty(tb4_e.Text)&& String.IsNullOrEmpty(tb4_kw.Text))
{//If the user eneters FLA and Voltage calculate for kW
decimal x, y, z;
x = decimal.Parse(tb4_fla.Text);
y = decimal.Parse(tb4_e.Text);
z = (x*y)*(.8 * 1.732050808m);
tb4_kw.Text = Math.Round(z,0).ToString();
}
if (!String.IsNullOrEmpty(tb4_kw.Text) && !String.IsNullOrEmpty(tb4_e.Text) && String.IsNullOrEmpty(tb4_fla.Text))
{;//If the user enters kW and Voltage calculate for FLA
decimal x, y, z;
x = decimal.Parse(tb4_kw.Text);
y = decimal.Parse(tb4_e.Text);
z = (1000 * x)/(y * 1.732050808m)* .8;
tb4_fla.Text = Math.Round(z,0).ToString();
}
}
</code></pre>
<p>I appreciate any help that I can get.
Thank you.</p>
| [
{
"answer_id": 363714,
"author": "Jimmy",
"author_id": 4435,
"author_profile": "https://Stackoverflow.com/users/4435",
"pm_score": 6,
"selected": true,
"text": ".8m instead of .8\n"
},
{
"answer_id": 363719,
"author": "Harper Shelby",
"author_id": 21196,
"author_profi... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45151/"
] |
363,718 | <p>My designer handed me a design I'm not 100% sure how to do with jquery and css.
I am basicly trying to allow a user to "slide" the footer up to reveal more conent.</p>
<p>My html..</p>
<pre><code> <div id="footer">
<div id="expandingFooter"> hidden content</div>
content that is always visible
</div>
</code></pre>
<p>I have a toggle button that onclick</p>
<pre><code>$('#expandingFooter').slideToggle();
</code></pre>
<p>This slides the expanding footer content open downward, then slides back up to close.
I would like it to slide up and then close down.</p>
<p>Thanks</p>
| [
{
"answer_id": 363759,
"author": "cLFlaVA",
"author_id": 45109,
"author_profile": "https://Stackoverflow.com/users/45109",
"pm_score": 1,
"selected": false,
"text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4568/"
] |
363,720 | <p>I have a slow custom data source in a SSIS Dataa Flow Task.I have to run the package with multiple parameters</p>
<p>If I want to upload data to a DB using SQL Data Destination(Bulk Insert) the connection times out</p>
<p>If I write the data to a flat file I cannot run multiple instances of the package, since they will write to the same file. Can I pass the file name as a parameter somewhere?</p>
<p>Do I need to write a custom Script Destination as the last resort?</p>
| [
{
"answer_id": 363759,
"author": "cLFlaVA",
"author_id": 45109,
"author_profile": "https://Stackoverflow.com/users/45109",
"pm_score": 1,
"selected": false,
"text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30546/"
] |
363,725 | <p>I have the following property in a custom control:</p>
<pre><code>List<myClass> _items;
public List<myClass> Items{
get { return _items; }
set { _items= value; }
}
</code></pre>
<p>In my codebehind, I add items to the collection as in...</p>
<pre><code>myCustomControl.items.Add(new myClass());
</code></pre>
<p>However, these are not persisted across postbacks. What is the proper way to allow persistance in custom controls?</p>
| [
{
"answer_id": 382388,
"author": "Corey Downie",
"author_id": 44861,
"author_profile": "https://Stackoverflow.com/users/44861",
"pm_score": 1,
"selected": false,
"text": "public List<myClass> Items{\n get { return this.ViewState[\"itemsKey\"] }\n set { this.ViewState[\"itemsKey\"]=... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363725",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/337/"
] |
363,729 | <p>Is there a way to say something like:</p>
<p>sizeof(type)? Or type.Size? </p>
<p>Right now I am looking at using code like:</p>
<pre><code>if (type.Equals(typeof(int)))
return sizeof(int);
else if (type.Equals(typeof(long)))
return sizeof(long);
</code></pre>
<p>etc, etc, for every single data type. </p>
<p>There must be an cleaner solution, no?</p>
| [
{
"answer_id": 2652040,
"author": "Stupid Girl",
"author_id": 318374,
"author_profile": "https://Stackoverflow.com/users/318374",
"pm_score": -1,
"selected": false,
"text": "Convert.ToString(type.MaxValue, 2).Length / 8"
}
] | 2008/12/12 | [
"https://Stackoverflow.com/questions/363729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
363,730 | <pre><code> public sealed class UserLoginSingleton
{
UserLoginCollection _userLoginCol = new UserLoginCollection();
UserLoginSingleton()
{
}
public static UserLoginSingleton Instance
{
get
{
IDictionary items = HttpContext.Current.Items;
if (!items.Contains("TheInstance"))
{
items["TheInstance"] = new UserLoginSingleton();
}
return items["TheInstance"] as UserLoginSingleton;
}
}
public void CreateUserObj(string xmlData)
{
_userLoginCol = (UserLoginCollection)_xmlUtil.Deserialize(xmlData, typeof(UserLoginCollection));
}
public UserLoginCollection getUserObj()
{
return _userLoginCol;
}
}
</code></pre>
<p>Usage:</p>
<p>Page 1.aspx</p>
<pre><code>UserLoginSingleton.Instance.CreateUserObj(xml);
</code></pre>
<p>Pase2.aspx:</p>
<blockquote>
<p>UserLoginCollection
userLoginCollection =
UserLoginSingleton.Instance.getUserObj();</p>
</blockquote>
<p>Followed the article here:
<a href="https://stackoverflow.com/questions/194999/are-static-class-instances-unique-to-a-request-or-a-server-in-aspnet">link text</a></p>
<p>I set my collection object in page 1 and then do a response.redirect or click on link to get me to page 2.aspx. However, my singleton instance has no collection object i set. How do i persist my collection object across diff pages per each session?</p>
<p>I know static's wont work as every instance will see the object and i want that to specific per each user.</p>
| [
{
"answer_id": 363763,
"author": "Mike Powell",
"author_id": 205,
"author_profile": "https://Stackoverflow.com/users/205",
"pm_score": 2,
"selected": false,
"text": "HttpContext.Items"
},
{
"answer_id": 364031,
"author": "Chris Marisic",
"author_id": 37055,
"author_pr... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38230/"
] |
363,740 | <p>I want to try PartCover for code coverage. I'm running Visual Studio 2008 Professional with MSTest. The Professional Edition does not include the Team Testing tools, like Code Coverage.</p>
<p>So, I'm trying PartCover, but I can't get it to work. In the PartCover.Browser I've selected the MSTest executable, I've pointed the working arguments to my tests.dll, and I've tried pointing my Working Directory to the TestResults folder, but I get an error:</p>
<p>"Report is empty. Check settings and run target again."</p>
<p>I don't know what to try next.</p>
<p><strong>Edit</strong></p>
<p>It turns out I had two problems. First, I wasn't putting my Rules right. Second, I had spaces in my working arguments. The spaces were giving an error, but not showing up anywhere.</p>
| [
{
"answer_id": 363771,
"author": "Hamish Smith",
"author_id": 15572,
"author_profile": "https://Stackoverflow.com/users/15572",
"pm_score": 5,
"selected": true,
"text": "+[MyNamespace.MyAssemblyName]*"
},
{
"answer_id": 1902164,
"author": "pelazem",
"author_id": 140761,
... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1204/"
] |
363,760 | <p>I have been investigating for some time now a way to prevent my user from accidently entering a data directory of my application.</p>
<p>My application uses a folder to store a structured project. The folder internal structure is critic and should not be messed up. I would like my user to see this folder as a whole and not be able to open it (like a Mac bundle).</p>
<p>Is there a way to do that on Windows?</p>
<p><strong>Edit from current answers</strong></p>
<p>Of course I am not trying to prevent my users from accessing their data, just protecting them from accidentally destroying the data integrity. So encryption or password protection are not needed. </p>
<p>Thank you all for your .Net answers but unfortunately, this is mainly a C++ project without any dependency to the .Net framework.</p>
<p>The data I am mentioning are not light, they are acquired images from an electronic microscope. These data can be huge (~100 MiB to ~1 GiB) so loading everything in memory is not an option. These are huge images so the storage must provide a way to read the data incrementally by accessing one file at a time without loading the whole archive in memory.</p>
<p>Besides, the application is mainly legacy with some components we are not even responsible of. A solution that allows me to keep the current IO code is preferable.</p>
<p>Shell Extension looks interesting, I will investigate the solution further.</p>
<p>LarryF, can you elaborate on Filter Driver or DefineDOSDevice ? I am not familiar with these concepts.</p>
| [
{
"answer_id": 370046,
"author": "LarryF",
"author_id": 18518,
"author_profile": "https://Stackoverflow.com/users/18518",
"pm_score": 0,
"selected": false,
"text": "DefineDOSDevice()"
}
] | 2008/12/12 | [
"https://Stackoverflow.com/questions/363760",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/268/"
] |
363,768 | <p>I'm using <a href="http://en.wikipedia.org/wiki/Eclipse_%28software%29#Releases" rel="noreferrer">Eclipse Ganymede</a>. Everything works fine, but I have an anal-retentive yearning for a warning-free Problems tab. Right now it (correctly) complains about my <a href="http://en.wikipedia.org/wiki/Apache_Ant" rel="noreferrer">Ant</a> scripts: "No grammar constraints (DTD or XML schema) detected for the document." Is there any way to turn that off for just those files? Ideally I'd like it to still warn me if my other schema-constrained files were missing the schema declarations.</p>
| [
{
"answer_id": 483260,
"author": "David Pierre",
"author_id": 18296,
"author_profile": "https://Stackoverflow.com/users/18296",
"pm_score": 8,
"selected": true,
"text": "<!DOCTYPE project>\n"
}
] | 2008/12/12 | [
"https://Stackoverflow.com/questions/363768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/409/"
] |
363,770 | <p>Let's say I have the following component called <strong><em>Base</em></strong>:</p>
<pre><code><cfcomponent output="false">
<cffunction name="init" access="public" returntype="Any" output="false">
<cfset variables.metadata = getmetadata(this)>
<cfreturn this>
</cffunction>
<cffunction name="getmeta" access="public" returntype="Any" output="false">
<cfreturn variables.metadata>
</cffunction>
</cfcomponent>
</code></pre>
<p>and I want to extend base in another component called <strong><em>Admin</em></strong>:</p>
<pre><code><cfcomponent output="false" extends="Base">
</cfcomponent>
</code></pre>
<p>Now within my application if I do the following when creating the object:</p>
<pre><code><cfset obj = createobject("component", "Admin").init()>
<cfdump var="#obj.getmeta()#">
</code></pre>
<p>The metadata I get back tells me that the name of the component is <strong><em>Admin</em></strong> and it's extending my <strong><em>Base</em></strong> component. That's all good, but I don't want to have to call the <strong><em>init()</em></strong> method explicitly when creating the object.</p>
<p>I would be nice if I could do something like this in my <strong><em>Base</em></strong> component:</p>
<pre><code><cfcomponent output="false">
<cfset init()>
<cffunction name="init" access="public" returntype="Any" output="false">
<cfset variables.metadata = getmetadata(this)>
<cfreturn this>
</cffunction>
<cffunction name="getmeta" access="public" returntype="Any" output="false">
<cfreturn variables.metadata>
</cffunction>
</cfcomponent>
</code></pre>
<p>However then the metadata returned by the getmeta() method telling me that the component name is <strong><em>Base</em></strong> even though it's still being extended. Any thoughts on how to accomplish this?</p>
| [
{
"answer_id": 483260,
"author": "David Pierre",
"author_id": 18296,
"author_profile": "https://Stackoverflow.com/users/18296",
"pm_score": 8,
"selected": true,
"text": "<!DOCTYPE project>\n"
}
] | 2008/12/12 | [
"https://Stackoverflow.com/questions/363770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31278/"
] |
363,776 | <p>Is there any way that I can reference a var or const as the default value for a function argument in actionscript 3.</p>
<p>I can define default values like null, string, int.</p>
<pre>function a( b = null ) {
blah...
}</pre>
<p>But what I want to do is <pre>function a( b = function(){} ) {
blah...
}</pre></p>
<p>which it seems like there would be a way to do. Presumably through a const</p>
| [
{
"answer_id": 365120,
"author": "grapefrukt",
"author_id": 914,
"author_profile": "https://Stackoverflow.com/users/914",
"pm_score": 4,
"selected": true,
"text": "public function myFunction(functionArgument:Function = null):void {\n if (functionArgument != null) {\n functionAr... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40397/"
] |
363,784 | <p>I want my JTextPane to insert spaces whenever I press Tab. Currently it inserts the tab character (ASCII 9). </p>
<p>Is there anyway to customize the tab policy of JTextPane (other than catching "tab-key" events and inserting the spaces myself seems an)?</p>
| [
{
"answer_id": 363967,
"author": "Kai Mechel",
"author_id": 39893,
"author_profile": "https://Stackoverflow.com/users/39893",
"pm_score": 4,
"selected": true,
"text": "import java.awt.Dimension;\n\nimport javax.swing.JFrame;\nimport javax.swing.JTextPane;\nimport javax.swing.text.Attribu... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27198/"
] |
363,819 | <p>I have been trying to extract last six numbers of an URL in each line of the original text and add it to another code that must be added to the result text. There also need to remove some code of each line from the original text and replace it with new code in the result text.</p>
<p>input
<a href="http://riyajr.googlepages.com/original.txt" rel="nofollow noreferrer">http://riyajr.googlepages.com/original.txt</a></p>
<p>output
<a href="http://riyajr.googlepages.com/result.txt" rel="nofollow noreferrer">http://riyajr.googlepages.com/result.txt</a></p>
<p>Is there any software that can do the above task? Please help me with any other options available. It would be great if someone could provide me with the full script code that could do above task.</p>
| [
{
"answer_id": 363883,
"author": "Byron Whitlock",
"author_id": 42304,
"author_profile": "https://Stackoverflow.com/users/42304",
"pm_score": 0,
"selected": false,
"text": "$infile = \"in.txt\";\n$outfile = \"out.txt\";\n\nforeach (file($url) as $line)\n{\n\n //extract last 6 chars\n ... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363819",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45614/"
] |
363,833 | <p>I have implemented a session timeout warning using javascript that simply asks the user if they want to extend their session or logout. The problem is that this is for an intranet portal where power users will often have several browser windows or tabs open at the same time to the application. Currently, they will be prompted that they are about to be logged out from every browser window. How can I make the code smarter to detect that they are actively using another browser session?</p>
| [
{
"answer_id": 58095998,
"author": "ajay hariyal",
"author_id": 5746644,
"author_profile": "https://Stackoverflow.com/users/5746644",
"pm_score": 0,
"selected": false,
"text": "npm install --save @ng-idle/core @ng-idle/keepalive angular2-moment\n"
}
] | 2008/12/12 | [
"https://Stackoverflow.com/questions/363833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45814/"
] |
363,838 | <p>I have a user defined function in SQL called getBuisnessDays it takes @startdate and @enddate and returns the number of business days between the two dates. How can I call that function within my select?</p>
<p>Here's what I'd like to do.. </p>
<pre><code>SELECT getBusinessDays(a.opendate,a.closedate)
FROM account a
WHERE ...
</code></pre>
| [
{
"answer_id": 363857,
"author": "user17670",
"author_id": 17670,
"author_profile": "https://Stackoverflow.com/users/17670",
"pm_score": 8,
"selected": true,
"text": "SELECT dbo.GetBusinessDays(a.opendate,a.closedate) as BusinessDays\nFROM account a\nWHERE...\n"
},
{
"answer_id":... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363838",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13954/"
] |
363,845 | <p>I have an element that is similar to a tag (because it has word-wrap: pre;) to display code on a website. The only problem is that the tab size is too large and causes the element to horizontally scroll often because it is of fixed width.</p>
<p>Is it possible to change the tab size?</p>
| [
{
"answer_id": 363888,
"author": "cLFlaVA",
"author_id": 45109,
"author_profile": "https://Stackoverflow.com/users/45109",
"pm_score": 0,
"selected": false,
"text": "text-indent"
}
] | 2008/12/12 | [
"https://Stackoverflow.com/questions/363845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29595/"
] |
363,848 | <p>Due to the packaged nature of the release, a SQL Server script (well more of a statement) needs to be created that can execute correctly on SQL Server 7.0 thru 2008 which can essentially achieve this:</p>
<pre><code>if exists(select * from sys.databases where name = 'Blah')
</code></pre>
<p>Reasons this is difficult:</p>
<p>SQL 7 'sys.databases' is not valid</p>
<p>SQL 2008 'sysdatabases' is not valid</p>
<p>I stupidly parsed out the version number using serverproperty, to allow an IF depending on the version:</p>
<pre><code>if (select CONVERT(int,replace(CONVERT(char(3),serverproperty ('productversion')),'.',''))) >= 80
</code></pre>
<p>Then discovered serverproperty does not exist under SQL 7.</p>
<p>Note that the SQL can be remote from the install, so no futzing around on the local machine - reg entries/file versions etc is of any use. </p>
<p>SQL Server error handling (especially 7.0) is poor, or maybe I don't understand it well enough to make it do a kind of try/catch.</p>
<p>I am now getting problem blindness to this, so any pointers would be appreciated.</p>
<p>Thanks,</p>
<p>Gareth</p>
| [
{
"answer_id": 364049,
"author": "George Mastros",
"author_id": 1408129,
"author_profile": "https://Stackoverflow.com/users/1408129",
"pm_score": 0,
"selected": false,
"text": "sp_helpDB\n"
},
{
"answer_id": 364124,
"author": "aristippus303",
"author_id": 45822,
"auth... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363848",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
363,864 | <p>This code throws up the compile error given in the title, can anyone tell me what to change?</p>
<pre><code>#include <iostream>
using namespace std;
int main(){
int myArray[10][10][10];
for (int i = 0; i <= 9; ++i){
for (int t = 0; t <=9; ++t){
for (int x = 0; x <= 9; ++x){
for (int y = 0; y <= 9; ++y){
myArray[i][t][x][y] = i+t+x+y; //This will give each element a value
}
}
}
}
for (int i = 0; i <= 9; ++i){
for (int t = 0; t <=9; ++t){
for (int x = 0; x <= 9; ++x){
for (int y = 0; y <= 9; ++y){
cout << myArray[i][t][x][y] << endl;
}
}
}
}
system("pause");
}
</code></pre>
<p>thanks in advance</p>
| [
{
"answer_id": 363873,
"author": "coppro",
"author_id": 16855,
"author_profile": "https://Stackoverflow.com/users/16855",
"pm_score": 5,
"selected": true,
"text": "myArray[10][10][10]"
},
{
"answer_id": 363874,
"author": "DShook",
"author_id": 370,
"author_profile": "... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363864",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33061/"
] |
363,884 | <p>I've seen the <code>@</code> symbol used in PowerShell to initialise arrays.</p>
<p>What exactly does the <code>@</code> symbol denote and where can I read more about it?</p>
| [
{
"answer_id": 363894,
"author": "Cadoo",
"author_id": 42583,
"author_profile": "https://Stackoverflow.com/users/42583",
"pm_score": 4,
"selected": false,
"text": "$strComputers = @(\"Server1\", \"Server2\", \"Server3\")<enter>\n"
},
{
"answer_id": 363927,
"author": "Don Jone... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45817/"
] |
363,889 | <p>I've written a screen saver that displays a web page. It works exactly as I want it to on my main display, but in the preview and secondary displays, the web view is hanging off the top of the screen.</p>
<p>Example (from preview):</p>
<a href="http://skitch.com/dlsspy/6mds/screen-saver-bug" rel="nofollow noreferrer">screen saver bug http://img.skitch.com/20081212-nk5cqrgfds1funr1a3p72aw25q.preview.jpg</a><br />Uploaded with <a href="http://plasq.com/" rel="nofollow noreferrer">plasq</a>'s <a href="http://skitch.com" rel="nofollow noreferrer">Skitch</a>!
<p>My code is pretty straightforward. From within <code>initWithFrame:isPreview:</code> I have the following code:</p>
<pre><code>webview = [[WebView alloc] initWithFrame:frame
frameName:@"main"
groupName:@"main"];
[self addSubview:webview];
</code></pre>
<p>Does anyone have any idea what's happening?</p>
<p>If anyone wants to play with the project, <a href="http://github.com/dustin/websaver" rel="nofollow noreferrer">the code</a> is on github.</p>
| [
{
"answer_id": 363894,
"author": "Cadoo",
"author_id": 42583,
"author_profile": "https://Stackoverflow.com/users/42583",
"pm_score": 4,
"selected": false,
"text": "$strComputers = @(\"Server1\", \"Server2\", \"Server3\")<enter>\n"
},
{
"answer_id": 363927,
"author": "Don Jone... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39975/"
] |
363,892 | <p>I am using My.Settings in visual studio 2008 to store information, for when the user runs the program again.</p>
<p>I have that working fine... but as I am using 12 textboxes I don't want to write...</p>
<p>my.settings.grade1 = textbox1.text</p>
<p>for each one, and I am also making calculations using the stored information, so I dont want to be writing my.settings.grade1 + my.settings.grade2 etc..</p>
<p>Any help welcome</p>
<p>Thanks =)</p>
| [
{
"answer_id": 363915,
"author": "Jayden",
"author_id": 44873,
"author_profile": "https://Stackoverflow.com/users/44873",
"pm_score": 1,
"selected": false,
"text": "For Each c as Control in Me.Controls\n\n If c.Tag.ToString() = \"Grade\" Then\n ' Add Items to collection here '\n End If\... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
363,899 | <p>I've several web user controls on my asp.net page and I wanna pass values between them. For example :</p>
<p>There is a dropDownList in one of them and when user selects any item from dropDownList, it can pass the selected value to the other user control which includes GridView to show related data of selected item value from the user control which contains the dropdownlist. (woow pretty awkward sentence tho) </p>
<p>Thanks and Regards..</p>
<p>P.s : Can we use User controls as class in the way to return values ?</p>
| [
{
"answer_id": 363912,
"author": "Victor",
"author_id": 42518,
"author_profile": "https://Stackoverflow.com/users/42518",
"pm_score": 3,
"selected": true,
"text": "public string needData { \nget { return MyData; }\nset { \n MyData = value;\n //do whatever you need to do with that data ... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44852/"
] |
363,908 | <p>Here's an example:</p>
<pre><code>>git status
# On branch master
nothing to commit (working directory clean)
>git checkout -b test-branch
>vi test.c
>git add test.c
>git commit -m "modified test.c"
>vi README
>git add README
>git commit -m "modified README"
</code></pre>
<p>Now I want to do a '<code>git rebase -i</code>' that will let me rebase all commits for this branch. Is there something like '<code>git rebase -i HEAD~MASTER</code>' or similar. I figure I could do '<code>git rebase -i HEAD~2</code>', but I really don't want to have to count how many commits have been made. I could also do '<code>git rebase -i sha1</code>' but I don't want to comb through git log to find the first commit sha1. Any ideas?</p>
| [
{
"answer_id": 364065,
"author": "ididak",
"author_id": 28888,
"author_profile": "https://Stackoverflow.com/users/28888",
"pm_score": 7,
"selected": true,
"text": "git rebase -i master"
},
{
"answer_id": 364646,
"author": "Otto",
"author_id": 9594,
"author_profile": "... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363908",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45824/"
] |
363,930 | <p>Anyone done this and can share? I see an option or two but want to know what others have accomplished.</p>
| [
{
"answer_id": 13262628,
"author": "Carlos D. Garza",
"author_id": 1094641,
"author_profile": "https://Stackoverflow.com/users/1094641",
"pm_score": 1,
"selected": false,
"text": "public static Calendar parseCalendar(DateTime dt){\n return dt.toGregorianCalendar();\n}\n"
}
] | 2008/12/12 | [
"https://Stackoverflow.com/questions/363930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
363,944 | <p>I'm calling a bunch of methods that return a list. The list may be empty. If the list is non-empty, I want to return the first item; otherwise, I want to return <code>None</code>. This code works:</p>
<pre class="lang-py prettyprint-override"><code>def main():
my_list = get_list()
if len(my_list) > 0:
return my_list[0]
return None
</code></pre>
<p>but it seems to me that there should be a simple one-line idiom for doing this. Is there?</p>
| [
{
"answer_id": 363955,
"author": "recursive",
"author_id": 44743,
"author_profile": "https://Stackoverflow.com/users/44743",
"pm_score": 7,
"selected": false,
"text": "(get_list() or [None])[0]\n"
},
{
"answer_id": 363995,
"author": "efotinis",
"author_id": 12320,
"au... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19403/"
] |
363,969 | <p>I have the following code</p>
<pre><code>Try
'Some code that causes exception
Catch ex as ExceptionType1
'Handle Section - 1
Catch ex as ExceptionType2
'Handle section - 2
Catch ex as ExceptionType3
'Handle section - 3
Finally
' Clean up
End Try
</code></pre>
<p>Suppose ExceptionType1 is thrown by the code which is handled by section - 1. After handling that in section-1, can I have control passed to section-2/section-3? Is that possible?</p>
| [
{
"answer_id": 363986,
"author": "acrosman",
"author_id": 24215,
"author_profile": "https://Stackoverflow.com/users/24215",
"pm_score": 2,
"selected": false,
"text": "Try\n'Some code that causes exception'\nCatch ex as ExceptionType1\n handler_1()\n handler_2()\n handler_3()\nCatch ex... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363969",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38997/"
] |
363,998 | <p>I have this:</p>
<pre><code>template <typename T>
class myList
{
...
class myIterator
{
...
T& operator*();
}
}
...
template<typename T>
T& myList<T>::myIterator::operator*()
{
...
}
</code></pre>
<p>That is giving me the following error: "expected initializer before '&' token". What exactly am I supposed to do? I already tried adding "template myList::myIterator" before it, but that didn't work.</p>
| [
{
"answer_id": 364013,
"author": "David Norman",
"author_id": 34502,
"author_profile": "https://Stackoverflow.com/users/34502",
"pm_score": 2,
"selected": false,
"text": "template <typename T>\nclass myList\n{\npublic:\n class myIterator\n {\n public:\n T& operator*();\n ... | 2008/12/12 | [
"https://Stackoverflow.com/questions/363998",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
364,001 | <p>My goal is to make a Button that has two Content values. </p>
<p>Imagine a Scrabble tile as a button: it has the large letter in the center and a small number in the lower right. This is the effect I am going for.</p>
<p>I made a button that has two ContentPresenter objects in it, and I have given each of the ContentPresenters a different style. However, I have not found a way to give each of the presenters a separate value (ie, if I set the Content of the button to "X" then both ContentPresenters show "X", albeit in different styles).</p>
<p>How can I achieve my objective? I'm guessing my approach is completely wrong....</p>
| [
{
"answer_id": 1034123,
"author": "Tomáš Kafka",
"author_id": 38729,
"author_profile": "https://Stackoverflow.com/users/38729",
"pm_score": 0,
"selected": false,
"text": "<Window x:Class=\"TkMVVMContainersSample.Services.TaskEditDialog.ItemEditView\"\n xmlns=\"http://schemas.microsoft... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364001",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42620/"
] |
364,007 | <p>I'm learning WPF, and seem to have found something a little odd, which I can't find the reason to anywhere I've searched.</p>
<p>I have a window with one checkbox on it called "chkTest". I have it set to be true by default.</p>
<p>The following code is what I don't understand. Basically I'm trying to set the "chkTest" control to a control I create on the fly. The message box displays the value I set in code, but the control on the window is still set to be true.</p>
<p>Can someone explain the process behind this?</p>
<pre><code>public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
CheckBox chk = new CheckBox();
chk.IsChecked = false;
this.chkTest = chk;
MessageBox.Show(chk.IsChecked.Value.ToString());
}
}
</code></pre>
<p>Thanks</p>
| [
{
"answer_id": 1034123,
"author": "Tomáš Kafka",
"author_id": 38729,
"author_profile": "https://Stackoverflow.com/users/38729",
"pm_score": 0,
"selected": false,
"text": "<Window x:Class=\"TkMVVMContainersSample.Services.TaskEditDialog.ItemEditView\"\n xmlns=\"http://schemas.microsoft... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364007",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
364,009 | <pre><code>Regex.IsMatch( "foo", "[\U00010000-\U0010FFFF]" )
</code></pre>
<p>Throws: System.ArgumentException: parsing "[-]" - [x-y] range in reverse order.</p>
<p>Looking at the hex values for \U00010000 and \U0010FFF I get: 0xd800 0xdc00 for the first character and 0xdbff 0xdfff for the second.</p>
<p>So I guess I have really have one problem. Why are the Unicode characters formed with \U split into two chars in the string?</p>
| [
{
"answer_id": 14326180,
"author": "Andriy K",
"author_id": 307584,
"author_profile": "https://Stackoverflow.com/users/307584",
"pm_score": 3,
"selected": false,
"text": "\"[\\U010000-\\U10FFFF]\""
}
] | 2008/12/12 | [
"https://Stackoverflow.com/questions/364009",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1455/"
] |
364,014 | <p>I wonder if there is a way to use ungreedy matching in JavaScript? I tried the U modifer, but it doesn't seem to work.</p>
<p>I want to write a small BBCode parser in JavaScript, but without ungreedy matching it isn't possible (at least as far as I see it) to do something like this:</p>
<pre><code>'[b]one[/b] two [b]three[/b]'.replace( /\[b\](.*)\[\/b\]/, '<b>$1</b>' );
</code></pre>
<p>But such a replacement would be nice since there is no need to check for HTML validity then. Unclosed markups will stay simple text.</p>
| [
{
"answer_id": 364029,
"author": "Greg",
"author_id": 24181,
"author_profile": "https://Stackoverflow.com/users/24181",
"pm_score": 7,
"selected": true,
"text": "?"
},
{
"answer_id": 364051,
"author": "cLFlaVA",
"author_id": 45109,
"author_profile": "https://Stackover... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364014",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35903/"
] |
364,017 | <p>I have a file of about 30000 lines of data that I want to load into a sqlite3 database. Is there a faster way than generating insert statements for each line of data?</p>
<p>The data is space-delimited and maps directly to an sqlite3 table. Is there any sort of bulk insert method for adding volume data to a database?</p>
<p>Has anyone devised some deviously wonderful way of doing this if it's not built in?</p>
<p>I should preface this by asking, is there a C++ way to do it from the API?</p>
| [
{
"answer_id": 364156,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 6,
"selected": true,
"text": "PRAGMA synchronous = OFF;"
},
{
"answer_id": 364557,
"author": "oz10",
"author_id": 14069,
"author_profile"... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9450/"
] |
364,019 | <p>I'd like to have revision number of source code to Delphi's source code and exe version. What is the best way to do this automatically?</p>
<p>I'd like to display the revision number in "About" screen and in the version info of the project.</p>
<p>I'm using currently Delphi IDE (2006/2007) and Tortoise SVN.</p>
| [
{
"answer_id": 364046,
"author": "ieure",
"author_id": 45224,
"author_profile": "https://Stackoverflow.com/users/45224",
"pm_score": 1,
"selected": false,
"text": "$Revision$"
},
{
"answer_id": 364195,
"author": "Rob Kennedy",
"author_id": 33732,
"author_profile": "ht... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7735/"
] |
364,055 | <p>Using NUnit 2.2 on .NET 3.5, the following test fails when using DateTime.Equals. Why?</p>
<pre><code>[TestFixture]
public class AttributeValueModelTest
{
public class HasDate
{
public DateTime? DateValue
{
get
{
DateTime value;
return DateTime.TryParse(ObjectValue.ToString(), out value) ? value : new DateTime?();
}
}
public object ObjectValue { get; set; }
}
[Test]
public void TwoDates()
{
DateTime actual = DateTime.Now;
var date = new HasDate {ObjectValue = actual};
Assert.IsTrue(date.DateValue.Value.Equals(actual));
}
}
</code></pre>
| [
{
"answer_id": 364075,
"author": "shahkalpesh",
"author_id": 23574,
"author_profile": "https://Stackoverflow.com/users/23574",
"pm_score": 0,
"selected": false,
"text": "\npublic DateTime? DateValue\n {\n get\n {\n DateTime value;\n ... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364055",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470/"
] |
364,066 | <p>When Internet Explorers AutoComplete is turned on for Forms the entries for each field in the HTML form should be cached and displayed as a prompt when the user starts entering content into the form the second time around. </p>
<p>On my website the AutoComplete feature is never displayed for any forms that exist on that site. But yet other websites retain and deliver that content without problem.</p>
<p>My site is using PHP as the scripting language and all content is delivered over SSL.</p>
| [
{
"answer_id": 364076,
"author": "cLFlaVA",
"author_id": 45109,
"author_profile": "https://Stackoverflow.com/users/45109",
"pm_score": 1,
"selected": false,
"text": "autocomplete=\"off\""
},
{
"answer_id": 364094,
"author": "dgavey",
"author_id": 10350,
"author_profil... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10350/"
] |
364,073 | <p>I have a table "A" with 2 columns "Foo" and "Bar". I have a formula with the structured reference A[Foo]. When I fill this formula horizontally I want the reference to stay A[Foo] but now, in the second column, the reference turns to A[Bar]. Is there a way to make this structured reference absolute? </p>
<p>It'd be shocking that this isn't supported if not.</p>
<p>Example Formula:</p>
<p>=A[Foo]</p>
<p>Drag that horizontally and Foo changes if the table has multiple columns</p>
| [
{
"answer_id": 8650635,
"author": "tekNorah",
"author_id": 1118446,
"author_profile": "https://Stackoverflow.com/users/1118446",
"pm_score": 1,
"selected": false,
"text": " A B C D\n1 Item Base Price 5% ... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1946/"
] |
364,083 | <p>What would be the bast way to change the orientation of the WPF treeview. I would like to work the expand-collapse-functionality to work left to right instead of top to down. I.e. when I click on on the expand button of a treenode I would its subnode to appear right of the parent and the indent should work top-down instead. Also the vertical lines that connect the node must now be horizontal.</p>
| [
{
"answer_id": 42860839,
"author": "Matt Thomas",
"author_id": 3063273,
"author_profile": "https://Stackoverflow.com/users/3063273",
"pm_score": 2,
"selected": false,
"text": "ItemsPanel"
}
] | 2008/12/12 | [
"https://Stackoverflow.com/questions/364083",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4227/"
] |
364,096 | <p>I’m attempting to check the rights on a particular file for a specific
trustee and am using the win32 API GetEffectiveRightsFromAcl(). When
the file is accessible by a domain group, the function
returns 5 (Access Denied) when a local account (admin or other) is
used to execute the function.</p>
<p>These three statements summarize the behavior I am seeing with
GetEffectiveRightsFromAcl():</p>
<ul>
<li>When domain group has rights to the file and the program runs under a
local account: Access Denied.</li>
<li>When domain group has rights to the file and the program runs
under a domain account or Local System: Success</li>
<li>When domain group doesn't have rights to the file and the
program runs under any account: Success</li>
</ul>
<p>Does anyone know the reason behind this? It looks to me like this is
related to Active Directory security. What settings could affect this
and what would be a good way to debug this? </p>
<p>Also, I've heard that GetEffectiveRightsFromAcl() may be generally problematic and to use AccessCheck() instead. However I need to be able to take an arbitrary SID and check it's access against a file and since AccessCheck() requires an impersonation token I don't know how I could greate a token out of an arbitrary SID... Any ideas? Thanks</p>
<p>Bob</p>
| [
{
"answer_id": 688912,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 2,
"selected": false,
"text": "using System;\nusing System.Runtime.InteropServices;\nusing System.Security.Principal;\nusing System.Security.AccessControl;\n... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364096",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
364,105 | <p>I'm trying to use grep with -v for invert-match along with -e for regular expression. I'm having trouble getting the syntax right. </p>
<p>I'm trying something like</p>
<pre><code>tail -f logFile | grep -ve "string one|string two"
</code></pre>
<p>If I do it this way it doesn't filter
If I change it to</p>
<pre><code>tail -f logFile | grep -ev "string one|string two"
</code></pre>
<p>I get </p>
<pre><code>grep: string one|string two: No such file or directory
</code></pre>
<p>I have tried using () or quotes, but haven't been able to find anything that works.</p>
<p>How can I do this?</p>
| [
{
"answer_id": 364113,
"author": "Adam Rosenfield",
"author_id": 9530,
"author_profile": "https://Stackoverflow.com/users/9530",
"pm_score": 8,
"selected": true,
"text": "tail -f logFile | grep -vE 'string one|string two'\n"
},
{
"answer_id": 364115,
"author": "Jay",
"aut... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364105",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16584/"
] |
364,114 | <p>Maven 2 is driving me crazy during the experimentation / quick and dirty mock-up phase of development.</p>
<p>I have a <code>pom.xml</code> file that defines the dependencies for the web-app framework I want to use, and I can quickly generate starter projects from that file. However, sometimes I want to link to a 3rd party library that doesn't already have a <code>pom.xml</code> file defined, so rather than create the <code>pom.xml</code> file for the 3rd party lib by hand and install it, and add the dependency to my <code>pom.xml</code>, I would just like to tell Maven: "In addition to my defined dependencies, include any jars that are in <code>/lib</code> too."</p>
<p>It seems like this ought to be simple, but if it is, I am missing something.</p>
<p>Any pointers on how to do this are greatly appreciated. Short of that, if there is a simple way to point maven to a <code>/lib</code> directory and easily create a <code>pom.xml</code> with all the enclosed jars mapped to a single dependency which I could then name / install and link to in one fell swoop would also suffice.</p>
| [
{
"answer_id": 364188,
"author": "Pyrolistical",
"author_id": 21838,
"author_profile": "https://Stackoverflow.com/users/21838",
"pm_score": 9,
"selected": false,
"text": "<dependency>\n <groupId>org.swinglabs</groupId>\n <artifactId>swingx</artifactId>\n <version>0.9.2</version>... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364114",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
364,141 | <p>If I have, say, a table of films which amongs other things has a int FilmTypeId field and a table of film types, with the id and a meaningful description along the lines of:</p>
<ul>
<li>1 - horror</li>
<li>2 - comedy</li>
<li>...</li>
</ul>
<p>Whats the best way of using that information in a C# class?</p>
<p>currently I would have them as Constants in a helper class (unsuprisingly air code):</p>
<pre><code>public class FilmHelper
{
public const int HorrorFilmType = 1;
public const int ComedyFilmType = 2;
...
}
</code></pre>
<p>but this doesn't seem that maintainable. But I would like to avoid a database call everytime I came to use the constant or an additional db call everytime I used either the helper or the main entity.</p>
| [
{
"answer_id": 364154,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 4,
"selected": true,
"text": "public enum FilmType {\n Horror = 1,\n Comedy = 2\n}\n"
},
{
"answer_id": 364158,
"author": "Chris Mar... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364141",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39643/"
] |
364,148 | <p>I'm trying to use the Kowalski graph algorithm for resolution theorem
proving. The description of the algorithm at
<a href="http://www.doc.ic.ac.uk/~rak/" rel="nofollow noreferrer">http://www.doc.ic.ac.uk/~rak/</a> is silent on what to do about the large
number of duplicate clauses it generates. I'm wondering if there's a
well-known technique for dealing with them?</p>
<p>In particular, you can't simply suppress the generation of duplicate
clauses, because the links that come with them are relevant.</p>
<p>It seems to me that it's probably necessary to track the set of all
clauses generated thus far, and when a duplicate is generated, add the
new links to the existing instance instead. This probably needs to be
maintained even when a clause is nominally deleted, for when it is
regenerated.</p>
<p>Duplication probably needs to be defined in terms of textual
representation, rather than object equality, because literals of
different clauses are distinct objects even when they are identical.</p>
<p>Can anyone confirm whether I'm on the right track here? Also, the only
significant online reference I could find to this algorithm was the
link above, does anyone know of any others, or any existing code
implementing it?</p>
| [
{
"answer_id": 364154,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 4,
"selected": true,
"text": "public enum FilmType {\n Horror = 1,\n Comedy = 2\n}\n"
},
{
"answer_id": 364158,
"author": "Chris Mar... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45843/"
] |
364,159 | <p>I have a table with 3 columns. I want to write a formula that, given a structured reference, returns the index of the column. This will help me write VLookup formulas using the structured reference.</p>
<p>So, for example, for the table <code>MyTable</code> with columns <code>A</code>, <code>B</code>, <code>C</code> I'd like to be able to write:</p>
<pre><code>=GetIndex(MyTable[C])
</code></pre>
<p>and have it return 3.</p>
<p>Right now I just make sure the table range starts on the sheet's first column and I write</p>
<pre><code>=Column(MyTable[C])
</code></pre>
<p>but I want something a more robust.</p>
| [
{
"answer_id": 364264,
"author": "e.James",
"author_id": 33686,
"author_profile": "https://Stackoverflow.com/users/33686",
"pm_score": 0,
"selected": false,
"text": "=COLUMN(MyTable[*]) - COLUMN(MyTable[A]) + 1"
},
{
"answer_id": 364314,
"author": "Fionnuala",
"author_id"... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1946/"
] |
364,172 | <p>I decided to use the GC for memory management for my latest Cocoa project, and I discovered something interesting--if I create a brand new Cocoa app project in Xcode, turn GC to supported or required (I tried both), build, and run it it leaks, it shows memory leaks!</p>
<p>Mostly large numbers of tiny leaks of objects of type NSCFData, GeneralBlock, CGEvent, CFDictionary, CGSRegion, etc.</p>
<p>Steps to reproduce:</p>
<ol>
<li>File->new project->Cocoa app</li>
<li>Project->Edit Project settings->GC Required (or supported, either one)</li>
<li>Build->Build</li>
<li>Run->Run with performance tool->Leaks</li>
<li>Wait for leak detection to trigger (I have it set to 10 secs, it defaults to 30)</li>
</ol>
<p>80% of the time or so I get a leak of around 2-20 Kb of various objects of the sort listed above.</p>
<p>Does anybody else have this same behavior?</p>
<hr>
<p>EDIT: I tested the below circumstance by renaming the InputManagers folder (at which point the log messages went away, so they were definitely no longer being loaded) and am still getting the memory leaks. So it doesn't seem likely that had anything to do with it. I'm leaving the text there so Ashley Clark's answer still makes sense. </p>
<p>The only odd circumstance I know if is I'm getting the following message in the console any time I run an app with GC enabled:</p>
<pre><code>2008-12-12 13:03:09.829 MemLeakTest[41819:813] Error loading /Library/InputManagers/Inquisitor/Inquisitor.bundle/Contents/MacOS/Inquisitor: dlopen(/Library/InputManagers/Inquisitor/Inquisitor.bundle/Contents/MacOS/Inquisitor, 265): no suitable image found. Did find:
/Library/InputManagers/Inquisitor/Inquisitor.bundle/Contents/MacOS/Inquisitor: GC capability mismatch
2008-12-12 13:03:09.840 MemLeakTest[41819:813] Error loading /Library/InputManagers/Saft/SaftLoader.bundle/Contents/MacOS/SaftLoader: dlopen(/Library/InputManagers/Saft/SaftLoader.bundle/Contents/MacOS/SaftLoader, 265): no suitable image found. Did find:
/Library/InputManagers/Saft/SaftLoader.bundle/Contents/MacOS/SaftLoader: GC capability mismatch
</code></pre>
<p>which I'm guessing has something to do with those two plug-ins trying to load into every single program that starts, not just Safari (which they're plug-ins for). I'm not sure if that has anything do do with this or not, but it definitely seems like a possibility. I don't have convenient access to a clean instead of OS X 10.5 with Dev tools to test whether or not this same thing happens on a virgin install without SAFT or Inquisitor.</p>
| [
{
"answer_id": 364994,
"author": "Chris Hanson",
"author_id": 714,
"author_profile": "https://Stackoverflow.com/users/714",
"pm_score": 4,
"selected": true,
"text": "leaks"
}
] | 2008/12/12 | [
"https://Stackoverflow.com/questions/364172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1512/"
] |
364,178 | <p>I have ANOTHER serialization question, but this time it is in regards to Java's native serialization import when serializing to binary. I have to serialize a random tree that is generated in another java file. I know how serialization and deserialization works, but the example I followed when using binary serialization with java.io.Serializable did not work in the same fashion as when I did it with, say a simple object. Here is my code segment:</p>
<pre><code>import java.io.*;
import java.io.FileInputStream;
public class BinaryS
{
public static void main(String[] args) {
Tree randomTree = RandomTreeBuilder.randomTree(10);
FileOutputStream fOut=null;
ObjectOutputStream oOut=null;
try{
fOut= new FileOutputStream("/Users/Pat/programs/binaryfile.txt");
oOut = new ObjectOutputStream(fOut);
oOut.writeObject(randomTree); //serializing randomTree
System.out.println("An employee is serialized into /Users/Pat/binaryfile.txt");
}catch(IOException e){
e.printStackTrace();
}finally{
try {
oOut.flush();
oOut.close();
fOut.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
});
</code></pre>
<p>I believe the problem is when I use writeObject(randomTree). I get some terminal exceptions when this happens... they are below:</p>
<p>java.io.NotSerializableException: GeneralTree
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
at BinaryS.main(BinaryS.java:24)</p>
<p>edit: I know it says GeneralTree, but at the start of the class it was in I put </p>
<pre><code>print("public class RandomTreeBuilder implements java.io.Serializable");
</code></pre>
<p>then, GeneralTree is found below it</p>
<pre><code>print(" protected static Tree tree;
protected static ArrayList names;
//e6.1
/**
*Builds a random tree. The build method does the work.
*/
//b6.2
public static Tree randomTree(int n) {
// Create a random binary tree with n external nodes
tree = new GeneralTree();
names = NameGenerator.getNames();
build(tree.getRoot(), n); // auxiliary recursive method
return tree;
</code></pre>
<p>");</p>
<p>Update: Hey guys, I figured out my own problem, turns out I am an idiot and didn't realize I had to download an additional .java file, an easy fix now! Thanks for your help!</p>
| [
{
"answer_id": 365195,
"author": "McDowell",
"author_id": 304,
"author_profile": "https://Stackoverflow.com/users/304",
"pm_score": 0,
"selected": false,
"text": "print(\"public class RandomTreeBuilder implements java.io.Serializable\");\n"
}
] | 2008/12/12 | [
"https://Stackoverflow.com/questions/364178",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36268/"
] |
364,184 | <p>In my Delphi7 this code</p>
<pre><code>var MStr: TMemoryStream;
...
FreeAndNil(MStr);
MStr.Size:=0;
</code></pre>
<p>generates an AV: Access violation at address 0041D6D1 in module 'Project1.exe'. Read of address 00000000.
But somebody insists that it should not raise any exception, no matter what. He also says that his Delphi 5 indeed raises no exceptions. He calls this a “stale pointer bug”.
In other words he says that FreeAndNil cannot be used as debugger to detect a double attempt to free an object or to use a freed object. </p>
<p>Can anybody enlighten me? Should this raise and error (always/randomly) or the program should run over this bug without problems? </p>
<p>Thanks</p>
<hr>
<p>I ask this because I believe I have a "double free object" or "free and re-access" bug in my program. How can I fill the memory allocated to an object with zeros AFTER I freed the object? I want this way to detect where the bug is, by getting and AV.
Initially, I hoped that if I set the object to FreeAndNil, I will ALWAYS get an AV when trying to re-access it. </p>
| [
{
"answer_id": 364231,
"author": "Rob Kennedy",
"author_id": 33732,
"author_profile": "https://Stackoverflow.com/users/33732",
"pm_score": 4,
"selected": false,
"text": "FreeAndNil"
}
] | 2008/12/12 | [
"https://Stackoverflow.com/questions/364184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
364,187 | <p>I found an example on registering DLLs, <em><a href="http://blogs.msdn.com/robmen/archive/2004/04/28/122491.aspx" rel="noreferrer">Registering an Assembly for COM Interop in a MSI file with the Windows Installer XML toolset.</a></em>, and WiX complains about the "AssemblyRegisterComInterop" attribute.</p>
<p>I removed that and changed the "Assembly" attribute to win32, and it says I need to specify the AssemblyManifest attribute, but what should I put there?</p>
| [
{
"answer_id": 364210,
"author": "Troy Howard",
"author_id": 19258,
"author_profile": "https://Stackoverflow.com/users/19258",
"pm_score": 6,
"selected": true,
"text": "SelfRegCost=1"
},
{
"answer_id": 364544,
"author": "Rob Mensching",
"author_id": 23852,
"author_pro... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23822/"
] |
364,193 | <p>Erm - what the question said. It's something I keep hearing about, but I've not got round to looking into it yet.</p>
<hr>
<p>(updated) I could look up the definition... but why not (as pointed out by @erikson) get insight into your real experiences and anecdotes. Community Wiki'd incase that helps folks vote up the most insightful answer. Interesting reading so far, thanks!</p>
| [
{
"answer_id": 364234,
"author": "Bob Cross",
"author_id": 5812,
"author_profile": "https://Stackoverflow.com/users/5812",
"pm_score": 5,
"selected": true,
"text": " _\n ( ) \nA --> B --> C\n"
}
] | 2008/12/12 | [
"https://Stackoverflow.com/questions/364193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2362/"
] |
364,194 | <p>We currently have an application that works with Outlook 2003. In order to get the owner of a shared contact folder, we simply call:
Redemption.RDOSessionClass.GetFolderFromID() and then took that folder and got the RDOFolder.Store.Name property.</p>
<p>However, when trying this with a shared contact folder in Outlook 2007, the RDOFolder.Store.Name is null.</p>
<p>Everything still works fine for normal contacts and for contacts in "Additional Mailboxes" that I've added to my account.</p>
<p>The approach mentioned in <a href="http://blogs.msdn.com/mstehle/archive/2006/09/07/744798.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/mstehle/archive/2006/09/07/744798.aspx</a> appears to work, but I would prefer to not release a new version of our application unless I have to.</p>
<p>Basically I want to understand why this is working differently and what I can do, if anything, to fix this from the server end.</p>
| [
{
"answer_id": 364234,
"author": "Bob Cross",
"author_id": 5812,
"author_profile": "https://Stackoverflow.com/users/5812",
"pm_score": 5,
"selected": true,
"text": " _\n ( ) \nA --> B --> C\n"
}
] | 2008/12/12 | [
"https://Stackoverflow.com/questions/364194",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32518/"
] |
364,206 | <p>Our company is considering using the <a href="http://msdn.microsoft.com/en-us/vsx2008/products/bb933751.aspx" rel="nofollow noreferrer">Visual Studio Shell</a> for one of our products.</p>
<p>Does anyone have any experience using it? Was it easy to work with? Did it save time? Are there any things that you weren't able to get it to do? Have you shipped anything with it?</p>
| [
{
"answer_id": 54887999,
"author": "SherlockSpreadsheets",
"author_id": 5335644,
"author_profile": "https://Stackoverflow.com/users/5335644",
"pm_score": 0,
"selected": false,
"text": "Visual Studio Community"
}
] | 2008/12/12 | [
"https://Stackoverflow.com/questions/364206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34502/"
] |
364,209 | <p>I have a function called:</p>
<pre><code>void initializeJSP(string Experiment)
</code></pre>
<p>And in my MyJSP.h file I have:</p>
<pre><code>2: void initializeJSP(string Experiment);
</code></pre>
<p>And when I compile I get this error:</p>
<blockquote>
<p>MyJSP.h:2 error: variable or field initializeJSP declared void</p>
</blockquote>
<p>Where is the problem?</p>
| [
{
"answer_id": 364224,
"author": "Johannes Schaub - litb",
"author_id": 34509,
"author_profile": "https://Stackoverflow.com/users/34509",
"pm_score": 7,
"selected": true,
"text": "void initializeJSP(unknownType Experiment);\n"
},
{
"answer_id": 7551394,
"author": "Paul Price"... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39160/"
] |
364,219 | <p>I have an app that creates a couple of WebView instances and I'd like to have them operate as independently as possible.</p>
<p>At the very least, I don't want them sharing cookies. A quick google search gave me results liking "you can't." I'm hoping someone has a better answer.</p>
| [
{
"answer_id": 365080,
"author": "Lily Ballard",
"author_id": 582,
"author_profile": "https://Stackoverflow.com/users/582",
"pm_score": 5,
"selected": true,
"text": "-webView:resource:willSendRequest:redirectResponse:fromDataSource:"
}
] | 2008/12/12 | [
"https://Stackoverflow.com/questions/364219",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39975/"
] |
364,230 | <p>I have three tables. This query will write down the right answer (x-lines for btv.id_user with appropriate btv.cas and race.id_zavod</p>
<pre><code>SELECT `btv.id_user`, `btv.id_zavod`,`btv.cas`
FROM `btv`
JOIN `btu` ON `btv.id_user` = `btu.id_user`
JOIN `race` ON 'btv.id_zavod' = `race.id_zavod`
WHERE `race.type` = '8' AND `btv.id_user` = '607'
</code></pre>
<p>Result:</p>
<pre><code>| 607 | 512 | 03:15:58 |
| 607 | 730 | 03:01:18 |
| 607 | 164 | 03:07:26 |
| 607 | 767 | 02:58:31 |
| 607 | 1147 | 03:06:47 |
| 607 | 1149 | 03:09:41 |
| 607 | 1178 | 03:24:20 |
</code></pre>
<p>But when I try to aggregate it to one row by the id_user it return correct min btv.cas but wrong join wrong race.id_zavod</p>
<pre><code>SELECT `btv.id_user`, `btv.id_zavod`, MIN( `btv.cas` )
FROM `btv`
JOIN `btu` ON `btv.id_user` = `btu.id_user`
JOIN `race` ON 'btv.id_zavod' = `race.id_zavod`
WHERE `race.type` = '8' AND `btv.id_user` = '607'
GROUP BY `btv.id_user`
</code></pre>
<p>Result:</p>
<pre><code>| 607 | 512 | 02:58:31 |
</code></pre>
| [
{
"answer_id": 364260,
"author": "user12861",
"author_id": 12861,
"author_profile": "https://Stackoverflow.com/users/12861",
"pm_score": 1,
"selected": false,
"text": "SELECT `btv.id_user`, `btv.id_zavod`, MIN( `btv.cas` )\nFROM `btv`\nJOIN `btu` ON `btv.id_user` = `btu.id_user`\nJOIN `r... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45846/"
] |
364,240 | <p>How do YOU reduce compile time, and linking time for VC++ projects (native C++)?</p>
<p>Please specify if each suggestion applies to debug, release, or both.</p>
| [
{
"answer_id": 364257,
"author": "Johannes Schaub - litb",
"author_id": 34509,
"author_profile": "https://Stackoverflow.com/users/34509",
"pm_score": 7,
"selected": true,
"text": "// Forward declaration stuff\nnamespace plotter { namespace logic { class Plotter; } }\n\n// Real stuff\nnam... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3153/"
] |
364,253 | <p>How do I Deserialize this XML document:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<Cars>
<Car>
<StockNumber>1020</StockNumber>
<Make>Nissan</Make>
<Model>Sentra</Model>
</Car>
<Car>
<StockNumber>1010</StockNumber>
<Make>Toyota</Make>
<Model>Corolla</Model>
</Car>
<Car>
<StockNumber>1111</StockNumber>
<Make>Honda</Make>
<Model>Accord</Model>
</Car>
</Cars>
</code></pre>
<p>I have this:</p>
<pre><code>[Serializable()]
public class Car
{
[System.Xml.Serialization.XmlElementAttribute("StockNumber")]
public string StockNumber{ get; set; }
[System.Xml.Serialization.XmlElementAttribute("Make")]
public string Make{ get; set; }
[System.Xml.Serialization.XmlElementAttribute("Model")]
public string Model{ get; set; }
}
</code></pre>
<p>.</p>
<pre><code>[System.Xml.Serialization.XmlRootAttribute("Cars", Namespace = "", IsNullable = false)]
public class Cars
{
[XmlArrayItem(typeof(Car))]
public Car[] Car { get; set; }
}
</code></pre>
<p>.</p>
<pre><code>public class CarSerializer
{
public Cars Deserialize()
{
Cars[] cars = null;
string path = HttpContext.Current.ApplicationInstance.Server.MapPath("~/App_Data/") + "cars.xml";
XmlSerializer serializer = new XmlSerializer(typeof(Cars[]));
StreamReader reader = new StreamReader(path);
reader.ReadToEnd();
cars = (Cars[])serializer.Deserialize(reader);
reader.Close();
return cars;
}
}
</code></pre>
<p>that don't seem to work :-(</p>
| [
{
"answer_id": 364325,
"author": "Joel Coehoorn",
"author_id": 3043,
"author_profile": "https://Stackoverflow.com/users/3043",
"pm_score": 5,
"selected": false,
"text": "[Serializable()]\n[System.Xml.Serialization.XmlRootAttribute(\"Cars\", Namespace = \"\", IsNullable = false)]\npublic ... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364253",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41508/"
] |
364,292 | <p>I have a table for which I want to select top the 5 rows by some column A. I also want to have a 6th row titled 'Other' which sums the values in column A for all but the top 5 rows.</p>
<p>Is there an easy way to do this? I'm starting with:</p>
<pre><code>select top 5
columnB, columnA
from
someTable t
order by
columnA desc
</code></pre>
| [
{
"answer_id": 364310,
"author": "D'Arcy Rittich",
"author_id": 39430,
"author_profile": "https://Stackoverflow.com/users/39430",
"pm_score": 3,
"selected": true,
"text": "select * from (\n select top 5 \n columnB, columnA \n from \n someTable t\n order by\n ... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34942/"
] |
364,301 | <p>I posted this message to the Solr mailing list, but I'm trying here too in case there's a Solr expert lurking around.</p>
<p>I am trying to use the regex fragmenter and am having a hard time getting the results I want. I am trying to get fragments that start on a word character and end on punctuation, but for some reason the fragments being returned to me seem to be very inflexible, despite that I've provided a large slop. Here are the relevant parameters I'm using, maybe someone can help point out where I've gone wrong:</p>
<pre><code><str name="hl.fragsize">500</str>
<str name="hl.fragmenter">regex</str>
<str name="hl.regex.slop">0.8</str>
<str name="hl.regex.pattern">[\w].*{400,600}[.!?]</str>
<str name="hl">true</str>
<str name="q">chinese</str>
</code></pre>
<p>This should be matching between 400-600 characters, beginning with a word character and ending with one of .!?. Here is an example of a typical result:</p>
<blockquote>
<p>. Check these pictures out. Nine panda
cubs on display for the first time
Thursday in southwest China. They're
less than a year old. They just
recently stopped nursing. There are
only 1,600 of these guys left in the
mountain forests of central China,
another 120 in Chinese breeding
facilities and zoos. And they're about
20 that live outside China in zoos.
They exist almost entirely on bamboo.
They can live to be 30 years old. And
these little guys will eventually get
much bigger. They'll grow</p>
</blockquote>
<p>As you can see, it is starting with a period and ending on a word character! It's almost as if the fragments are just coming out as they will and the regex isn't doing anything at all, but the results are different when I use the gap fragmenter. In the above result I don't see any reason why it shouldn't have stripped out the preceding period and the last two words, there is plenty of room in the slop and in the regex pattern. Please help me figure out what I'm doing wrong...</p>
<p>Thanks a lot,</p>
<p>Mark</p>
| [
{
"answer_id": 364342,
"author": "VonC",
"author_id": 6309,
"author_profile": "https://Stackoverflow.com/users/6309",
"pm_score": 3,
"selected": true,
"text": "\\w[^\\.!\\?]{400,600}[\\.!\\?]\n"
},
{
"answer_id": 365180,
"author": "Jan Goyvaerts",
"author_id": 33358,
... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364301",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45856/"
] |
364,327 | <p>I want to get myself into programming some serious GUI based applications, but when I look at things like Swing/SWT from Java, I can't help but HATE programming a GUI interface by creating "widget" objects and populating them and calling methods on them. </p>
<p>I think GUI design should be done in a separate text-based file in some markup format, which is read and rendered (e.g. HTML), so that the design of the interface is not tightly coupled with the rest of the code.</p>
<p>I've seen <a href="http://www.terrainformatica.com/htmlayout/" rel="nofollow noreferrer">HTMLayout</a> and I love the idea, but so far it seems be only in C++. </p>
<p>I'm looking for a python library (or even a WIP project) for doing markup-based gui.</p>
<p><strong>UPDATE</strong></p>
<p>The reason I can't accept QT's xml is the same reason I hate the programatic approach; you're assembling each widget separately, and specifying each property of it on a separate line. It doesn't provide any advantage over doing it the programatic way.</p>
| [
{
"answer_id": 768777,
"author": "Bryan Oakley",
"author_id": 7432,
"author_profile": "https://Stackoverflow.com/users/7432",
"pm_score": 2,
"selected": false,
"text": "menubar {\n File => {\n Open => cmd.open\n Save => cmd.save\n Exit => cmd.exit\n }\n Edit... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364327",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35364/"
] |
364,336 | <p>I am getting a strange error on a remote windows clients (WinForm application using C# 2.0)</p>
<p>Error Message: Access to the path 'c:\ApplicationFolder' is denied.</p>
<p>Stack Trace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)</p>
<p>Let me say I know I should not put the application folder directly off the c:\ folder. This an old application that I have no control over. </p>
| [
{
"answer_id": 402075,
"author": "Dour High Arch",
"author_id": 22437,
"author_profile": "https://Stackoverflow.com/users/22437",
"pm_score": 0,
"selected": false,
"text": "System.IO.FileStream.Init"
},
{
"answer_id": 10764280,
"author": "techno",
"author_id": 848968,
... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364336",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
364,347 | <p>One example is described <strong><a href="http://sujitmanolikar.blogspot.com/2007/07/generic-statemanagedcollection.html" rel="nofollow noreferrer">here</a></strong>. But the author apparently forgot to include the code for download.</p>
<p>Another example is shown <strong><a href="http://blog.spontaneouspublicity.com/child-collections-in-asp-net-custom-controls" rel="nofollow noreferrer">here</a></strong>. However, this one doesn't quite work (as described in comments).</p>
<p>How do you do this correctly?</p>
| [
{
"answer_id": 500077,
"author": "Dan Herbert",
"author_id": 392,
"author_profile": "https://Stackoverflow.com/users/392",
"pm_score": 2,
"selected": false,
"text": "AppointmentControl.cs"
},
{
"answer_id": 500106,
"author": "davogones",
"author_id": 59631,
"author_pr... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/337/"
] |
364,360 | <pre><code>test[_nObjectives].pool[j].feedbackCorrect =
oQuestions[j].getElementsByTagName("feedbackCorrect")[0].firstChild.data;
</code></pre>
<p>and the XML in this case contains this: </p>
<pre><code> <feedbackCorrect>
</feedbackCorrect>
</code></pre>
<p>When executing that line of code the following error occurs: Message: Object required</p>
<p>I don't get it. The tag is there, if it is empty the error occurs and even has spaces chars it doesn't work.</p>
| [
{
"answer_id": 364366,
"author": "FallenAvatar",
"author_id": 36965,
"author_profile": "https://Stackoverflow.com/users/36965",
"pm_score": 1,
"selected": false,
"text": "oQuestions[j].getElementsByTagName(\"feedbackCorrect\")[0]\n"
},
{
"answer_id": 364386,
"author": "Commun... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
364,367 | <p>I want to <strong>move about 800gb of data from an NTFS storage device to a FAT32 device</strong> (both are external hard drives), on a Windows System.</p>
<p>What is the best way to achieve this?</p>
<ol>
<li>Simply using cut-paste?</li>
<li>Using the command prompt ? (<code>move</code>)</li>
<li>Writing a batch file to copy a small chunks of data on a given interval ?</li>
<li>Use some specific application that does the job for me?</li>
<li>Or any better idea...?</li>
</ol>
<p>What is the most safe, efficient and fast way to achieve such a time consuming process?</p>
| [
{
"answer_id": 45422837,
"author": "kumar chandraketu",
"author_id": 7008922,
"author_profile": "https://Stackoverflow.com/users/7008922",
"pm_score": 1,
"selected": false,
"text": "powershell \"robocopy 'Source' 'destination' /E /R:3 /W:10 /FP /MT:25 /V\" \n\n/E - Copy subdirectory inc... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364367",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44084/"
] |
364,412 | <p>In a previous life, I might have done something like this:</p>
<pre><code><a href="#" onclick="f(311);return false;">Click</a><br/>
<a href="#" onclick="f(412);return false;">Click</a><br/>
<a href="#" onclick="f(583);return false;">Click</a><br/>
<a href="#" onclick="f(624);return false;">Click</a><br/>
</code></pre>
<p>Now with jQuery, I might do something like this:</p>
<pre><code><a class="clicker" alt="311">Click</a><br/>
<a class="clicker" alt="412">Click</a><br/>
<a class="clicker" alt="583">Click</a><br/>
<a class="clicker" alt="624">Click</a><br/>
<script language="javascript" type="text/javascript">
$(".clicker").bind("click", function(e) {
e.preventDefault();
f($(this).attr("alt"));
});
</script>
</code></pre>
<p>Except that using the alt attribute to pass the data from the DOM to jQuery feels like a hack, since that's not its intended purpose. What's the best practice here for storing/hiding data in the DOM for jQuery to access?</p>
| [
{
"answer_id": 364462,
"author": "Mark Brackett",
"author_id": 2199,
"author_profile": "https://Stackoverflow.com/users/2199",
"pm_score": 3,
"selected": true,
"text": "<a class=\"clicker\">Click</a><br/>\n<a class=\"clicker\">Click</a><br/>\n<a class=\"clicker\">Click</a><br/>\n<a class... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364412",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3420/"
] |
364,428 | <p>The project I am working on were are trying to come up with a solution for having the database and code be agile and be able to be built and deployed together.</p>
<p>Since the application is a combination of code plus the database schema, and database code tables, you can not truly have a full build of the application unless you have a database that is versioned along with the code.</p>
<p>We have not yet been able to come up with a good agile method of doing the database development along with the code in an agile/scrum environment.</p>
<p>Here are some of my requirements:</p>
<ol>
<li>I want to be able to have a svn revision # that corresponds to a complete build of the system.</li>
<li>I do not want to check in binary files into source control for the database.</li>
<li>Developers need to be able to commit code to the continuous integration server and build the entire system and database together.</li>
<li>Must be able to automate deployment to different environments without doing a rebuild other than the original build on the build server.</li>
</ol>
<p>(Update)
I'll add some more info here to explain a bit further.</p>
<p>No OR/M tool, since its a legacy project with a huge amount of code.
I have read the agile database design information, and that process in isolation seems to work, but I am talking about combining it with active code development.</p>
<p>Here are two scenario's</p>
<ol>
<li><p>Developer checks in a code change, that requires a database change. The developer should be able to check in a database change at the same time, so that the automated build doesn't fail.</p></li>
<li><p>Developer checks in a DB change, that should break code. The automated build needs to run and fail.</p></li>
</ol>
<p>The biggest problem is, how do these things synch up. There is no such thing as "checking in a database change". Right now the application of the DB changes is a manual process someone has to do, while code change are constantly being made. They need to be made together and checked together, the build system needs to be able to build the entire system.</p>
<p>(Update 2)
One more add here:</p>
<p>You can't bring down production, you must patch it. Its not acceptable to rebuild the entire production database.</p>
| [
{
"answer_id": 364458,
"author": "Tom",
"author_id": 40620,
"author_profile": "https://Stackoverflow.com/users/40620",
"pm_score": 3,
"selected": true,
"text": "db/\ndb/Makefile (run `make` to rebuild db from scratch, `make clean` to close db)\ndb/01_type.sql\ndb/02_table.sql\ndb/03_func... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364428",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45365/"
] |
364,440 | <p>I have 2 objects, both from different Model classes, and want to show a form containing some fields from each one. How can I do this?</p>
| [
{
"answer_id": 364527,
"author": "Oli",
"author_id": 12870,
"author_profile": "https://Stackoverflow.com/users/12870",
"pm_score": -1,
"selected": false,
"text": "Form"
},
{
"answer_id": 365300,
"author": "ayaz",
"author_id": 23191,
"author_profile": "https://Stackove... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45870/"
] |
364,448 | <p>Does anyone know how to show a asp:TreeView always expanded to the leaves? So if I have a 2-level tree, I want it to be expanded at all times. Is there a property on TreeView that does this or could you show the code snippet on how to do this?</p>
<p>Thank you very much!
Ray.</p>
| [
{
"answer_id": 364487,
"author": "maxnk",
"author_id": 45862,
"author_profile": "https://Stackoverflow.com/users/45862",
"pm_score": 3,
"selected": true,
"text": "protected void Page_Load(object sender, EventArgs e)\n{\n TreeView1.ExpandAll();\n}\n"
},
{
"answer_id": 2034747,
... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364448",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32240/"
] |
364,454 | <p>When running FindBugs on my project, I got a few instances of the error described above.</p>
<p>Namely, my overriding versions of equals cast the RHS object into the same type as the object in which the overriding version is defined.</p>
<p>However, I'm not sure whether a better design is possible, since AFAIK Java does not allow variance in method parameters, so it is not possible to define any other type for the equals parameter.</p>
<p>Am I doing something very wrong, or is FindBugs too eager? </p>
<p>A different way to phrase this question is: what is the correct behavior if the object passed to equals is not the same type as an LHS: Is this a false, or should there be an exception?</p>
<p>For example:</p>
<pre><code>public boolean equals(Object rhs)
{
MyType rhsMyType = (MyType)rhs; // Should throw exception
if(this.field1().equals(rhsMyType.field1())... // Or whatever
}
</code></pre>
| [
{
"answer_id": 364464,
"author": "Dave L.",
"author_id": 3093,
"author_profile": "https://Stackoverflow.com/users/3093",
"pm_score": 7,
"selected": true,
"text": "if (getClass() != obj.getClass())\n return false;\nMyObj myObj = (MyObj) obj;\n"
},
{
"answer_id": 364471,
"au... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364454",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23072/"
] |
364,472 | <p>Is there an easy or straightforward way in Java to output the results of a DB Query to a file (either csv, tab, etc). Perhaps even in Hibernate?</p>
<p>I know that a query results can be dumped to a flat file on the DB Server. I am looking for a way that an application can run a query and get those results into a file.</p>
<p>I realize one option is to just iterate over the result set and output the records one row at a time separating with a delimiter. But if there is a built in way, or a Hibernate way - that would be much better!</p>
<p>What I am really looking for was a way to do this in code (like - when an application is running). That way a server could take a query, run it against the database, send the output to a flat-file.</p>
<p>The server sending the query doesn't really need the file itself, just to know it worked. So if there is SQL (for an Oracle DB) that could redirect the output to a flat-file in a directory that the Oracle DB Server has access to - that would work too. I don't really have to actually write the file in the Java Server - just trigger the file creation based on the query it has.</p>
<p>Hopefully that makes sense.</p>
| [
{
"answer_id": 372338,
"author": "cliff.meyers",
"author_id": 41754,
"author_profile": "https://Stackoverflow.com/users/41754",
"pm_score": 1,
"selected": false,
"text": "xmlSession = session.getSession(EntityMode.DOM4J);\nElement elem = (Element) xmlSession.load(SomePersistentClass.clas... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364472",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
364,478 | <p>I asked a related question about findbugs, but let's ask a more general question.</p>
<p>Suppose that I am working with an object-oriented language in which polymorphism is possible.</p>
<p>Suppose that the language supports static type checking (e.g., Java, C++)</p>
<p>Suppose that the language does not allow variance in parameters (e.g., Java, again...)</p>
<p>If I am overriding the equality operation, which takes Object as a parameter, what should I do in a situation where the parameter is not the same type or a subtype as the LHS that equals had been called upon?</p>
<p>Option 1 - Return false because the objects are clearly not equals</p>
<p>Option 2 - Throw a casting exception because if the language actually supported variance (which would have been preferable), this would have been caught at compile time as an error; thus, detecting this error at runtime makes sense since a situation where another type is sent should have been illegal.</p>
| [
{
"answer_id": 364484,
"author": "Daniel Schaffer",
"author_id": 2596,
"author_profile": "https://Stackoverflow.com/users/2596",
"pm_score": 0,
"selected": false,
"text": "SomeClass obj1 = new SomeClass();\nobject other = (object)obj1;\n\nreturn obj1.Equals(other); // should return \"tru... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23072/"
] |
364,483 | <p>Can the alignment of a structure type be found if the alignments of the structure members are known? </p>
<p>Eg. for:</p>
<pre><code>struct S
{
a_t a;
b_t b;
c_t c[];
};
</code></pre>
<p>is the alignment of S = max(alignment_of(a), alignment_of(b), alignment_of(c))?</p>
<p>Searching the internet I found that "for structured types the largest alignment requirement of any of its elements determines the alignment of the structure" (in <a href="http://people.redhat.com/drepper/cpumemory.pdf" rel="noreferrer">What Every Programmer Should Know About Memory</a>) but I couldn't find anything remotely similar in the standard (latest draft more exactly). </p>
<hr>
<p><strong>Edited:</strong>
Many thanks for all the answers, especially to Robert Gamble who provided a really good answer to the original question and the others who contributed.</p>
<p>In short:</p>
<p><strong><em>To ensure alignment requirements for structure members, the alignment of a structure must be at least as strict as the alignment of its strictest member.</em></strong></p>
<p>As for determining the alignment of structure a few options were presented and with a bit of research this is what I found:</p>
<ul>
<li>c++ std::tr1::alignment_of
<ul>
<li>not standard yet, but close (technical report 1), should be in the C++0x</li>
<li>the following restrictions are present in the latest draft: Precondition:T shall be a complete type, a reference type, or an array of
unknown bound, but shall not be a function type or (possibly
cv-qualified) void.
<ul>
<li>this means that my presented use case with the C99 flexible array won't work (this is not that surprising since flexible arrays are not standard c++) </li>
</ul></li>
<li>in the latest c++ draft it is defined in the terms of a new keyword - alignas (this has the same complete type requirement)</li>
<li>in my opinion, should c++ standard ever support C99 flexible arrays, the requirement could be relaxed (the alignment of the structure with the flexible array should not change based on the number of the array elements)</li>
</ul></li>
<li>c++ boost::alignment_of
<ul>
<li>mostly a tr1 replacement</li>
<li>seems to be specialized for void and returns 0 in that case (this is forbidden in the c++ draft)</li>
<li>Note from developers: strictly speaking you should only rely on the value of ALIGNOF(T) being a multiple of the true alignment of T, although in practice it does compute the correct value in all the cases we know about.</li>
<li>I don't know if this works with flexible arrays, it should (might not work in general, this resolves to compiler intrinsic on my platform so I don't know how it will behave in the general case)</li>
</ul></li>
<li>Andrew Top presented a simple template solution for calculating the alignment in the answers
<ul>
<li>this seems to be very close to what boost is doing (boost will additionally return the object size as the alignment if it is smaller than the calculated alignment as far as I can see) so probably the same notice applies</li>
<li>this works with flexible arrays</li>
</ul></li>
<li>use Windbg.exe to find out the alignment of a symbol
<ul>
<li>not compile time, compiler specific, didn't test it</li>
</ul></li>
<li>using offsetof on the anonymous structure containing the type
<ul>
<li>see the answers, not reliable, not portable with c++ non-POD</li>
</ul></li>
<li>compiler intrinsics, eg. MSVC __alignof
<ul>
<li>works with flexible arrays</li>
<li>alignof keyword is in the latest c++ draft</li>
</ul></li>
</ul>
<hr>
<p>If we want to use the "standard" solution we're limited to std::tr1::alignment_of, but that won't work if you mix your c++ code with c99's flexible arrays.</p>
<p>As I see it there is only 1 solution - use the old struct hack: </p>
<pre><code>struct S
{
a_t a;
b_t b;
c_t c[1]; // "has" more than 1 member, strictly speaking this is undefined behavior in both c and c++ when used this way
};
</code></pre>
<p>The diverging c and c++ standards and their growing differences are unfortunate in this case (and every other case).</p>
<hr>
<p>Another interesting question is (if we can't find out the alignment of a structure in a portable way) what is the most strictest alignment requirement possible. There are a couple of solutions I could find:</p>
<ul>
<li>boost (internally) uses a union of variety of types and uses the boost::alignment_of on it</li>
<li>the latest c++ draft contains std::aligned_storage
<ul>
<li>The value of default-alignment shall be the most stringent alignment requirement for any C++ object type whose size is no greater than Len
<ul>
<li>so the <code>std::alignment_of< std::aligned_storage<BigEnoughNumber>>::value</code> should give us the maximum alignment </li>
<li>draft only, not standard yet (if ever), <code>tr1::aligned_storage</code> does not have this property</li>
</ul></li>
</ul></li>
</ul>
<p>Any thoughts on this would also be appreciated. </p>
<p><em>I have temporarily unchecked the accepted answer to get more visibility and input on the new sub-questions</em></p>
| [
{
"answer_id": 364562,
"author": "Andrew Top",
"author_id": 30036,
"author_profile": "https://Stackoverflow.com/users/30036",
"pm_score": 4,
"selected": false,
"text": "template <class T>\nclass Traits\n{\npublic:\n struct AlignmentFinder\n {\n char a; \n T b;\n };... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364483",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45875/"
] |
364,495 | <p>So, i'm running emacs over a crappy ssh connection and I have it set up to use cscope. I can not use X because of this...hence I'm running emacs inside putty. However, when I search for something with cscope and it opens up the other buffer, I can not
follow the links where cscope tells me which file and line number the item is on. When I go t a line number and hit enter, emacs tells me 'buffer is read-only' (it is trying to actually put in a new line instead of following the link). anyone know how I can follow those links?</p>
| [
{
"answer_id": 7285012,
"author": "जलजनक",
"author_id": 835145,
"author_profile": "https://Stackoverflow.com/users/835145",
"pm_score": 0,
"selected": false,
"text": "GNU find version 4.2"
},
{
"answer_id": 21122987,
"author": "Peng",
"author_id": 3195561,
"author_pro... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/440177/"
] |
364,501 | <p>We've got a few pages in our web systems that use the .net system.net.mail control to send emails. The thing has been working great, except it's now starting to look like the smptclient class may not actually be disconnecting from the server, such that the SMTP server leaves that connection open, and we ended up maxing out the number of connections we were allowed to have open at a time on the SMTP server, despite only sending one email at a time.</p>
<p>(For the record, this is a .net 2.0 asp.net application written in VB, and we're fairly confident this isn't some kind of security / virus / spam passthrough situation.)</p>
<p>Google and MSDN didn't turn up anything conclusive, but just enough heresy in blog entries to confirm that we might not be hallucinating.</p>
<p>Any one else out there ever have this problem? (And manage to fix it?)</p>
<p>Of course, if it does work fine, and we <em>are</em> hallucinating, that would be nice to know too. ;)</p>
| [
{
"answer_id": 364576,
"author": "Chris",
"author_id": 34942,
"author_profile": "https://Stackoverflow.com/users/34942",
"pm_score": 3,
"selected": true,
"text": "var smtp = new SmtpClient();\nsmtp.ServicePoint.MaxIdleTime = 1;\nsmtp.ServicePoint.ConnectionLimit = 1;\nsmtp.Send(message);... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19074/"
] |
364,505 | <pre><code><% using (Html.BeginForm() { %>
<%=Html.DropDownList("TopItemsList", ViewData["ListData"], new { onchange="[???]" })%>
<% } %>
</code></pre>
<p>In the above example, what value should you set onchange to? Or, how do you get the correct form?</p>
<p>Is there any difference with Ajax.BeginFrom?</p>
| [
{
"answer_id": 364508,
"author": "maxnk",
"author_id": 45862,
"author_profile": "https://Stackoverflow.com/users/45862",
"pm_score": 7,
"selected": true,
"text": "<%=Html.DropDownList(\"TopItemsList\", ViewData[\"ListData\"], new { onchange=\"this.form.submit();\" })%>\n"
},
{
"a... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364505",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
364,514 | <p>I know that -applicationWillResignActive gets called upon an incoming call, but is there a standard method that gets called if the user hits the "exit" button (the only button on the front of the iPhone)? </p>
| [
{
"answer_id": 364520,
"author": "Marc Charbonneau",
"author_id": 35136,
"author_profile": "https://Stackoverflow.com/users/35136",
"pm_score": 4,
"selected": true,
"text": "- (void)applicationWillTerminate:(UIApplication *)application"
},
{
"answer_id": 3288414,
"author": "N... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364514",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21293/"
] |
364,519 | <p>There's an existing function that ends in the following, where <code>d</code> is a dictionary:</p>
<pre><code>return d.iteritems()
</code></pre>
<p>that returns an unsorted iterator for a given dictionary. I would like to return an iterator that goes through the items sorted <em>by key</em>. How do I do that?</p>
| [
{
"answer_id": 364521,
"author": "Greg Hewgill",
"author_id": 893,
"author_profile": "https://Stackoverflow.com/users/893",
"pm_score": 6,
"selected": false,
"text": "sorted()"
},
{
"answer_id": 364524,
"author": "Claudiu",
"author_id": 15055,
"author_profile": "https... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364519",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91385/"
] |
364,522 | <p>How do you correct use frame on a asp.net page, so I have a left frame and a right frame, when I click the links on the page presented in the left frame, it loads the according page in the right frame? On top of this, I need to have a master page on all the right frame's pages.</p>
<p>How do I do this? or is there another way to achieve the same effect?</p>
<p>Thanks,
Ray.</p>
| [
{
"answer_id": 364536,
"author": "Dan Herbert",
"author_id": 392,
"author_profile": "https://Stackoverflow.com/users/392",
"pm_score": 2,
"selected": false,
"text": "#main"
},
{
"answer_id": 364732,
"author": "seanb",
"author_id": 3354,
"author_profile": "https://Stac... | 2008/12/12 | [
"https://Stackoverflow.com/questions/364522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32240/"
] |
364,523 | <p>I'm currently working with a specialized, interpreted, programming language implemented in Java. As a very small part of the language, I'd like to add the ability to make calls into Java. Before I dive into all of the nitty-gritty of reflection, I was wondering if anyone knew of a general library for doing the "back-end" part of invoking Java code reflectively.</p>
<p>That is, I parse a string (I define the grammar) into some data structure that represents a Java method call (or constructor, or field access) and then pass that data structure to this library that invokes the call and returns the result. In particular, I'd like it to already handle all the edge cases that I don't want to figure out:</p>
<ul>
<li>Automagically pick the right method based on the types of arguments (like an intelligent Class.getDeclaredMethod())</li>
<li>Handle distinction between arrays and normal object references</li>
<li>etc</li>
</ul>
<p>I've spent a little time looking at the implementations of dynamic languages on the JVM, but these are generally much more complicated than I'm looking for, or highly optimized for the particular language.</p>
<p>Another option is to convert my grammar into a string in some dynamic language and invoke it with Rhino or something, but that's a little more overhead than I'm looking for.</p>
| [
{
"answer_id": 365724,
"author": "flicken",
"author_id": 12880,
"author_profile": "https://Stackoverflow.com/users/12880",
"pm_score": 3,
"selected": false,
"text": " String name = method(\"get\").withReturnType(String.class)\n .withParameterTypes(int.class)\n ... | 2008/12/13 | [
"https://Stackoverflow.com/questions/364523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40310/"
] |
364,539 | <p>I'm not sure if Vim makes me more productive compared to other editors/ide's like Eclipse for example.</p>
<p>But somehow I get an empowering feeling when using Vim and noticed resistance to trying others editors.</p>
<p>Example: As soon a I see some cool feature in an other editor I'm thinking "<em>Vi can do that</em> (i just have to find the keystroke or configure a plugin)"</p>
<p>How can I benchmark editor productivity objectively?</p>
<p>My ideal editor would be: <a href="https://netbeans.org" rel="nofollow noreferrer">Netbeans</a> feature set and ease of use, but with SublimeText's performance and slick looks.</p>
<p><strong>Update</strong><br>
<a href="https://code.visualstudio.com" rel="nofollow noreferrer">Visual Studio Code</a> is now my primary code editor.<br>
<a href="http://sublimetext.com/" rel="nofollow noreferrer">Sublime Text</a> for config files and quick edits.<br>
<a href="http://vim.org/" rel="nofollow noreferrer">Vim</a> for ssh sessions or editing with macros.</p>
| [
{
"answer_id": 16605610,
"author": "Mikko Rantalainen",
"author_id": 334451,
"author_profile": "https://Stackoverflow.com/users/334451",
"pm_score": 0,
"selected": false,
"text": "V"
}
] | 2008/12/13 | [
"https://Stackoverflow.com/questions/364539",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19165/"
] |
364,558 | <p>It's been a while since I was in college and knew how to calculate a best fit line, but I find myself needing to. Suppose I have a set of points, and I want to find the line that is the best of those points.</p>
<p>What is the equation to determine a best fit line?
How would I do that with PHP?</p>
| [
{
"answer_id": 364571,
"author": "Tim Whitcomb",
"author_id": 24895,
"author_profile": "https://Stackoverflow.com/users/24895",
"pm_score": 2,
"selected": false,
"text": "a"
},
{
"answer_id": 364585,
"author": "FryGuy",
"author_id": 28776,
"author_profile": "https://S... | 2008/12/13 | [
"https://Stackoverflow.com/questions/364558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12930/"
] |
364,564 | <p>I am writing a Cocoa application with Mono embedded. I want to run and see my debug output in Terminal. On the Cocoa side I am using <code>NSLog()</code>, and on the Mono side I am using <code>Debug.Write()</code>. I can see my debug output in Xcode's console, but not in Terminal. This is what I tried: </p>
<pre>
$: open /path/build/Debug/MyProgram.app
$: open /path/build/Debug/MyProgram.app > output
$: open /path/build/Debug/MyProgram.app 2> output
</pre>
<p>in a terminal but I do not my output on the console or in 'ouput'.</p>
<p>What's the correct command?</p>
<p>PS. My ultimate goal is to write a vim plugin to manage, build, run, debug the xcode project. You can save me this hassle if you can get this <a href="http://www.corsofamily.net/jcorso/vi/" rel="noreferrer">vi input manager</a> to work with xcode.</p>
| [
{
"answer_id": 365000,
"author": "Chris Hanson",
"author_id": 714,
"author_profile": "https://Stackoverflow.com/users/714",
"pm_score": 4,
"selected": false,
"text": "open /path/to/MyApp.app"
},
{
"answer_id": 365062,
"author": "Lily Ballard",
"author_id": 582,
"autho... | 2008/12/13 | [
"https://Stackoverflow.com/questions/364564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45890/"
] |
364,621 | <p>I am iterating over a list and I want to print out the index of the item if it meets a certain condition. How would I do this?</p>
<p>Example: </p>
<pre><code>testlist = [1,2,3,5,3,1,2,1,6]
for item in testlist:
if item == 1:
print position
</code></pre>
| [
{
"answer_id": 364638,
"author": "jakber",
"author_id": 29812,
"author_profile": "https://Stackoverflow.com/users/29812",
"pm_score": 3,
"selected": false,
"text": "for i in xrange(len(testlist)):\n if testlist[i] == 1:\n print i\n"
},
{
"answer_id": 364641,
"author": "zd... | 2008/12/13 | [
"https://Stackoverflow.com/questions/364621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44133/"
] |
364,631 | <p>Given the following code snippet from inside a method; </p>
<pre><code>NSBezierPath * tempPath = [NSBezierPath bezierPathWithOvalInRect:pathRect];
[tempPath retain];
[path release];
[self setPath:tempPath];
</code></pre>
<p>Am I responsible for releasing <code>tempPath</code> or will it be done for me?
<br />The setPath is <code>@synthesize</code>d so I probably would be able to leave out the <code>[path release]</code> as well?</p>
<p>I know the better way of doing this is simply;</p>
<pre><code>[path appendBezierPathWithOvalInRect:pathRect];
</code></pre>
<p>But, being new to Objective C and Cocoa, I'm trying to understand how things stick together.
<br />
<br />
---ADDED CONTENT<br /><br />
Leaving out the <code>[tempPath retain]</code> results in a crash in the <code>NSView</code> object that uses the paths. <br />The result from the debugger:<br /></p>
<blockquote>
<pre><code>(gdb) po [0x145dc0 path]
Program received signal EXC_BAD_ACCESS, Could not access
</code></pre>
<p>memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000021
0x93c56688 in objc_msgSend ()</p>
</blockquote>
<p><br /><br />
<strong>CONFESSION OF GUILT</strong> - my mistake. Hope someone else will get something useful from my mistake. I had used <code>assign</code> in place of <code>retain</code> in the <code>@property</code> declaration. Fixing those made the code work as expected.</p>
<p>THANKS FOR THE HELP GUYS</p>
| [
{
"answer_id": 364647,
"author": "Max Stewart",
"author_id": 18338,
"author_profile": "https://Stackoverflow.com/users/18338",
"pm_score": 1,
"selected": false,
"text": "[tempPath retain]"
},
{
"answer_id": 364649,
"author": "Ashley Clark",
"author_id": 4556,
"author_... | 2008/12/13 | [
"https://Stackoverflow.com/questions/364631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41880/"
] |
364,642 | <p>I want to know the basic principle used for WYSIWYG pages on the web. I started coding it and made it using a text area, but very soon I realized that I cannot add or show images or any HTML in the text area. So I made it using DIV, but I did not understand how I could make it editable.</p>
<p>So, in gist, <strong>I want to know how(in principle) to make an editable DIV section on a web page, something similar to Google docs or FCKEditor or TinyMCE.</strong></p>
<p>I would be very grateful for any pointers and info.</p>
<p>Thanks!</p>
| [
{
"answer_id": 364651,
"author": "coobird",
"author_id": 17172,
"author_profile": "https://Stackoverflow.com/users/17172",
"pm_score": 2,
"selected": false,
"text": "form"
},
{
"answer_id": 364689,
"author": "olliej",
"author_id": 784,
"author_profile": "https://Stack... | 2008/12/13 | [
"https://Stackoverflow.com/questions/364642",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
364,655 | <p>I'm trying to run Python scripts using Xcode's User Scripts menu.</p>
<p>The issue I'm having is that my usual os.sys.path (taken from ~/.profile) does not seem to be imported when running scripts from XCode the way it is when running them at the Terminal (or with IPython). All I get is the default path, which means I can't do things like</p>
<pre><code>#!/usr/bin/python
import myScript
myScript.foo()
</code></pre>
<p>Where myScript is a module in a folder I've added to my path.</p>
<p>I can append a specific path to os.sys.path manually easily enough, but I have to do it in every single script for every single path I want to use modules from</p>
<p>Is there a way to set this up so it uses the same path I use everywhere else?</p>
<p>EDIT: After looking into things a bit more, it seems like scripts executed from Xcode use a completely different PATH than normal. The path I get by running a script in Xcode is:</p>
<pre><code>PATH=/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin
</code></pre>
<p>and I'm sure my regular path doesn't have /Developer/usr/bin in it. Does anybody have any idea where this path is coming from?</p>
| [
{
"answer_id": 364691,
"author": "Toby White",
"author_id": 45891,
"author_profile": "https://Stackoverflow.com/users/45891",
"pm_score": 1,
"selected": false,
"text": "cat > $HOME/bin/mypython << EOF\n#!/usr/bin/python\nimport os\nos.path = ['/list/of/paths/you/want']\nEOF\n"
},
{
... | 2008/12/13 | [
"https://Stackoverflow.com/questions/364655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1512/"
] |
364,664 | <p>I would like to restrict access to my <code>/admin</code> URL to internal IP addresses only. Anyone on the open Internet should not be able to login to my web site. Since I'm using Lighttpd my first thought was to use <code>mod_rewrite</code> to redirect any outside request for the <code>/admin</code> URL back to my home page, but I don't know much about Lighty and the docs don't say much about detecting a 192.168.0.0 IP range.</p>
| [
{
"answer_id": 364991,
"author": "Patryk Kordylewski",
"author_id": 30927,
"author_profile": "https://Stackoverflow.com/users/30927",
"pm_score": 2,
"selected": true,
"text": "$HTTP[\"remoteip\"] == \"192.168.0.0/16\" {\n /* your rules here */\n}\n"
},
{
"answer_id": 15464922,... | 2008/12/13 | [
"https://Stackoverflow.com/questions/364664",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21512/"
] |
364,671 | <p>I have a problem with a many-to-many relation in my tables, which is between an employee and instructor who work in a training centre. I cannot find the link between them, and I don't know how to get it. The employee fields are:</p>
<ul>
<li>employee no.</li>
<li>employee name</li>
<li>company name</li>
<li>department job title</li>
<li>business area</li>
<li>mobile number</li>
<li>ext </li>
<li>ranking</li>
</ul>
<p>The Instructors fields are</p>
<ul>
<li>instructor name</li>
<li>institute</li>
<li>mobile number</li>
<li>email address</li>
<li>fees</li>
</ul>
| [
{
"answer_id": 364677,
"author": "Jimmy",
"author_id": 4435,
"author_profile": "https://Stackoverflow.com/users/4435",
"pm_score": 3,
"selected": false,
"text": "table EmployeeInstructor \n EmployeeID\n InstructorID\n"
}
] | 2008/12/13 | [
"https://Stackoverflow.com/questions/364671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
364,676 | <p>I have an array filled with values (twitter ids) and I would like to find the missing data between the lowest id and the highest id? Any care to share a simple function or idea on how to do this?</p>
<p>Also, I was wondering if I can do the same with mySQL? I have the key indexed. The table contains 250k rows right now, so a temporary table and then a join wouldn't be very fast or efficient. I could do a PHP loop to loop through the data, but that would also take a long time, and a great deal of memory. Is there a specific mysql query I can run? or can I somehow use the function from above with this?</p>
<p>Thanks,
James Hartig
<a href="http://twittertrend.net" rel="nofollow noreferrer">http://twittertrend.net</a></p>
| [
{
"answer_id": 364677,
"author": "Jimmy",
"author_id": 4435,
"author_profile": "https://Stackoverflow.com/users/4435",
"pm_score": 3,
"selected": false,
"text": "table EmployeeInstructor \n EmployeeID\n InstructorID\n"
}
] | 2008/12/13 | [
"https://Stackoverflow.com/questions/364676",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45530/"
] |
364,687 | <p>so i have a winforms apps that downloads a set of data syncronously on startup. This obviously takes a while but then when any of the services or GUI classes load, they all have this data. I could change this to put on a background thread but then every component that needs access to this data would continuously have to get notified when this data was ready. This seems like bad design for every one of my classes that depends on this data to be loaded to have a If (Loaded) check or have to subscribe to a loaded event . . . any ideas?</p>
<p>Any other ideas?</p>
| [
{
"answer_id": 365456,
"author": "Jason Jackson",
"author_id": 13103,
"author_profile": "https://Stackoverflow.com/users/13103",
"pm_score": 1,
"selected": false,
"text": "DataManager.LoadDataAsync(dataCommandPatternObject, CallBackFunction);\n\n...\n\npublic void CallbackFunction(SomeDa... | 2008/12/13 | [
"https://Stackoverflow.com/questions/364687",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4653/"
] |
364,730 | <p>Screenshot of the problem:</p>
<p><img src="https://i.stack.imgur.com/qutvW.jpg" alt="http://i36.tinypic.com/dfxdmd.jpg"></p>
<p>The yellow block is the logo and the blue box is the nav links (I have blanked them out). I would like to align the links at the bottom so they are stuck to the top of the body content (white box). How would I do this?
Here is the relevant CSS and HTML.</p>
<pre><code>#header {
height: 42px;
}
#logo {
width: 253px;
height: 42px;
background-image:url(logo.png);
float: left;
}
#nav {
width: 100%;
border-bottom: 2px solid #3edff2;
vertical-align: bottom;
}
#nav ul {
list-style-type: none;
margin: 0;
padding: 0;
margin-bottom: 4px;
text-align: right;
font-size: 1.25em;
}
#nav ul li {
display: inline;
background-color: #3edff2;
padding: 5px;
}
<div id="header">
<div id="logo"><a href="/"></a></div>
<div id="nav">
<ul>
<li><a href="#">*****</a></li>
[...]
</ul>
</div>
</div>
</code></pre>
<p>Thanks in advance.</p>
| [
{
"answer_id": 364737,
"author": "John Dunagan",
"author_id": 28939,
"author_profile": "https://Stackoverflow.com/users/28939",
"pm_score": 0,
"selected": false,
"text": "clear: both;"
},
{
"answer_id": 364772,
"author": "tvanfosson",
"author_id": 12950,
"author_profi... | 2008/12/13 | [
"https://Stackoverflow.com/questions/364730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
364,731 | <p>I have this code that generates markets I want to be clickable with a pop up info window. </p>
<pre><code>for (i = 0; i < marker_array.length; i++) {
var point = new GLatLng(marker_array[i][0], marker_array[i][1]);
var marker = new GMarker(point, markerOptions);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html_data);
});
map.addOverlay(marker);
}
</code></pre>
<p>The problem is that only one market ends up clickable. No matter which one gets clicked, an info window with the one clickable marker's data pops up over that one clickable marker. All of the markers load and are in the correct locations, so the problem is only with getting the pop up window data to appear for each one. </p>
<p>I've checked out the section about "unrolling" the marker function <a href="http://mapki.com/wiki/Read_This_First" rel="nofollow noreferrer">here</a> and it seems like that's probably where I'm going wrong, but I have not been able to get this to work through testing the changes they suggest.</p>
| [
{
"answer_id": 365560,
"author": "Diodeus - James MacFarlane",
"author_id": 12579,
"author_profile": "https://Stackoverflow.com/users/12579",
"pm_score": 0,
"selected": false,
"text": "function createMarker(posn, title, icon, i) {\n var marker = new GMarker(posn, {title: title, icon: ... | 2008/12/13 | [
"https://Stackoverflow.com/questions/364731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30098/"
] |
364,740 | <p>I am starting to design a new application and what I am wondering is peoples opinions on Linq2SQL or Linq2Entities and what they feel is the better technology for rapid development.</p>
<p>I am also doing some research into ADO.net data services.</p>
| [
{
"answer_id": 365041,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 2,
"selected": false,
"text": "IUpdatable"
}
] | 2008/12/13 | [
"https://Stackoverflow.com/questions/364740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45909/"
] |
364,757 | <p>I am restricted to C (cannot use C++). I wish C had stricter type checking.</p>
<p>Is there a way to get compile errors on the commented lines? If it helps, the enum values cannot overlap.</p>
<hr>
<pre><code>enum hundred {
VALUE_HUNDRED_A = 100,
VALUE_HUNDRED_B
};
enum thousand {
VALUE_THOUSAND_A = 1000,
VALUE_THOUSAND_B
};
void print_hundred(enum hundred foo)
{
switch (foo) {
case VALUE_HUNDRED_A: printf("hundred:a\n"); break;
case VALUE_HUNDRED_B: printf("hundred:b\n"); break;
default: printf("hundred:error(%d)\n", foo); break;
}
}
void print_thousand(enum thousand bar)
{
switch (bar) {
case VALUE_THOUSAND_A: printf("thousand:a\n"); break;
case VALUE_THOUSAND_B: printf("thousand:b\n"); break;
default: printf("thousand:error(%d)\n", bar); break;
}
}
int main(void)
{
print_hundred(VALUE_HUNDRED_A);
print_hundred(VALUE_THOUSAND_A); /* Want a compile error here */
print_thousand(VALUE_THOUSAND_A);
print_thousand(VALUE_HUNDRED_A); /* Want a compile error here */
return 0;
}
</code></pre>
| [
{
"answer_id": 364781,
"author": "Charlie Martin",
"author_id": 35092,
"author_profile": "https://Stackoverflow.com/users/35092",
"pm_score": -1,
"selected": false,
"text": "assert()"
},
{
"answer_id": 364784,
"author": "Johannes Schaub - litb",
"author_id": 34509,
"a... | 2008/12/13 | [
"https://Stackoverflow.com/questions/364757",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45908/"
] |
364,775 | <p>We are using Maven for a large build process (> 100 modules). We have been storing our external dependencies in source control, and using that to update a local repo.</p>
<p>However, we are ready to graduate to a local repo that can cache central so that we don't have to proactively download all 3rd parties (but we can still have a local repo to pull from). In addition we want to publish our internal build artifacts from a nightly build so that developers don't have to build the world.</p>
<p>We are considering Nexus and Artifactory. What are the reasons for preferring one over the other? Are there others we should be considering?</p>
| [
{
"answer_id": 4092349,
"author": "Evgeny Goldin",
"author_id": 472153,
"author_profile": "https://Stackoverflow.com/users/472153",
"pm_score": 7,
"selected": false,
"text": "mvn deploy"
}
] | 2008/12/13 | [
"https://Stackoverflow.com/questions/364775",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5874/"
] |
364,788 | <p>Is there an easier way to achieve the following?</p>
<pre><code>var obj = from row in table.AsEnumerable()
select row["DOUBLEVALUE"];
double[] a = Array.ConvertAll<object, double>(obj.ToArray(), o => (double)o);
</code></pre>
<p>I'm extracting a column from a <code>DataTable</code> and storing the column in an array of <code>double</code>s.</p>
<p>Assume that <code>table</code> is a <code>DataTable</code> containing a column called "DOUBLEVALUE" of type <code>typeof(Double)</code>.</p>
| [
{
"answer_id": 4092349,
"author": "Evgeny Goldin",
"author_id": 472153,
"author_profile": "https://Stackoverflow.com/users/472153",
"pm_score": 7,
"selected": false,
"text": "mvn deploy"
}
] | 2008/12/13 | [
"https://Stackoverflow.com/questions/364788",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45914/"
] |
364,791 | <p>Consider the following HTML:</p>
<pre><code><div class="foo" id="obj">
I should be changed red
<div class="bar" style="color:black;">
I should not be changed red.
<div class="foo">I should be changed red.</div>
</div>
</div>
</code></pre>
<p>Given a DOM element <code>obj</code> and an expression, how do I go about selecting any children and possibly <code>obj</code>? I'm looking for something similar to "select descendants" but also including the parent, if it matches the expression.</p>
<pre><code>var obj = $("#obj")[0];
//wrong, may include siblings of 'obj'
$(".foo", $(obj).parent()).css("color", "red");
//wrong -- excludes 'obj'
$(".foo", obj).css("color", "red");
//correct way, but it's annoying
var matches = $(".foo", obj);
if ($(obj).is(".foo")) matches = matches.add(obj);
matches.css("color", "red");
</code></pre>
<p>Is there a more elegant solution to this?</p>
| [
{
"answer_id": 364798,
"author": "rz.",
"author_id": 7407,
"author_profile": "https://Stackoverflow.com/users/7407",
"pm_score": -1,
"selected": false,
"text": " $('div.foo, div.foo > *').css('color','red');\n"
},
{
"answer_id": 364800,
"author": "Sam",
"author_id": 43005... | 2008/12/13 | [
"https://Stackoverflow.com/questions/364791",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43005/"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.