qid int64 4 22.2M | question stringlengths 18 48.3k | answers list | date stringlengths 10 10 | metadata list |
|---|---|---|---|---|
313,643 | <p>How can I differentiate a Workflow system from a normal application that automates some work? Are there any specific feature a system must have to be categorized as a workflow system?</p>
| [
{
"answer_id": 313716,
"author": "Eugene Yokota",
"author_id": 3827,
"author_profile": "https://Stackoverflow.com/users/3827",
"pm_score": 0,
"selected": false,
"text": "*participant = resource (human or machine)\n"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/313643",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/74340/"
] |
313,649 | <p>When I publish my ASP.NET site in RELEASE mode, and set compilation debug="false", will my ASP.NET and System.Diagnostics Tracing still work?</p>
| [
{
"answer_id": 313654,
"author": "tvanfosson",
"author_id": 12950,
"author_profile": "https://Stackoverflow.com/users/12950",
"pm_score": 2,
"selected": true,
"text": "<configuration>\n <system.web>\n <trace enabled=\"true\" requestLimit=\"40\" localOnly=\"false\"/>\n </system.web>\n</c... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22702/"
] |
313,652 | <p>I have a self-developed program which I want to use as the default opening tool for .jpg and .bmp files. How can I achieve the goal progrmmatically? </p>
<p>Some said that I have to add some registry entries. But I don't konw exactly what I should do. Can anyone tell me the method?</p>
<p>Thank you!</p>
| [
{
"answer_id": 313689,
"author": "schnaader",
"author_id": 34065,
"author_profile": "https://Stackoverflow.com/users/34065",
"pm_score": 0,
"selected": false,
"text": "[HKEY_CLASSES_ROOT\\.txt]\n@=\"textfile\"\n\n[HKEY_CLASSES_ROOT\\textfile\\shell\\open\\command]\n@=\"C:\\\\WINDOWS\\\\N... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313652",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26404/"
] |
313,653 | <p>Is there a way to set "work offline" in TFS without having to try opening a solution, waiting for it to time out, and then having Visual Studio work out that it has failed?</p>
<p>It seems a touch ridiculous that I can't just tick a box to tell it myself, seeing as I'm probably the one most qualified to know when I'm not in the office!</p>
| [
{
"answer_id": 2271119,
"author": "Richard Berg",
"author_id": 74439,
"author_profile": "https://Stackoverflow.com/users/74439",
"pm_score": 4,
"selected": true,
"text": "C:\\Users\\Richard> tfpt tweakui /?\ntfpt tweakui - Enhance how client connects to Team Foundation Server\n\nAllows c... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/192/"
] |
313,693 | <p>I want to run program on background . pref C#
I want put icon in the tray.
On specified time it’s synchronizes folders (I know how to sync folders) .
How to run it on background and start sync ( for example at 2am)?</p>
| [
{
"answer_id": 313705,
"author": "Vincent Van Den Berghe",
"author_id": 39259,
"author_profile": "https://Stackoverflow.com/users/39259",
"pm_score": 1,
"selected": false,
"text": "Form.Visible = False\nForm.ShowInTaskbar = False\n"
},
{
"answer_id": 11197360,
"author": "user... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313693",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
313,712 | <p>I have to call ping from c++ code.I'd like to easily read the output for further utilizations.</p>
<p>I have come up with two solutions:</p>
<ul>
<li>use a fork and a pipe, redirect ping output to the pipe and then parse it</li>
<li>find a library suited for the purpose to use a ping(ip_addresss) function directly</li>
</ul>
<p>I'd like the latter but i didn't find anything that was clearly a standard solution.</p>
<p>How would you do it ?</p>
| [
{
"answer_id": 313760,
"author": "orip",
"author_id": 37020,
"author_profile": "https://Stackoverflow.com/users/37020",
"pm_score": 2,
"selected": false,
"text": "ping4"
},
{
"answer_id": 15573612,
"author": "omeraygor",
"author_id": 969263,
"author_profile": "https:/... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38507/"
] |
313,718 | <p>While working on an existing project I suddenly got the following error when trying to compile the solution:</p>
<p><em>error MSB3105: The item "[filename]" was specified more than once in the "Resources" parameter. Duplicate items are not supported by the "Resources" parameter.</em></p>
<p>Now, as far as I'm aware, I did not make any change to the project that affects the resources. Also I have checked each and every file within the project, but there is no duplicate reference anywhere to this file.
Now I already found some forum entries regarding this error:</p>
<p>1) Open the .csproj file and remove the duplicate reference. [Tried this, but I cannot find any duplicates in it]</p>
<p>2) In a 'partial class' project, move everything to a single class. [ Could try this, but the project has been split up into partial classes since the start, and I do not want to change this just because of the error ]</p>
<p>So what else could cause this ?</p>
| [
{
"answer_id": 59934672,
"author": "Xav987",
"author_id": 2546739,
"author_profile": "https://Stackoverflow.com/users/2546739",
"pm_score": 1,
"selected": false,
"text": "MyFile.cs"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/313718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4313/"
] |
313,729 | <ul>
<li>How can we implement the Builder
pattern of <a href="http://developers.sun.com/learning/javaoneonline/2006/coreplatform/TS-1512.pdf?" rel="noreferrer">Joshua's
Effective Java</a> in C#?</li>
</ul>
<p>Below is the code I have tried, is there a better way to do this?</p>
<pre><code> public class NutritionFacts
{
public static NutritionFacts.Builder Build(string name, int servingSize, int servingsPerContainer)
{
return new NutritionFacts.Builder(name, servingSize, servingsPerContainer);
}
public sealed class Builder
{
public Builder(String name, int servingSize,
int servingsPerContainer)
{
}
public Builder totalFat(int val) { }
public Builder saturatedFat(int val) { }
public Builder transFat(int val) { }
public Builder cholesterol(int val) { }
//... 15 more setters
public NutritionFacts build()
{
return new NutritionFacts(this);
}
}
private NutritionFacts(Builder builder) { }
protected NutritionFacts() { }
}
</code></pre>
<ul>
<li><p>How do we extend such a class? Do
we need to write separate builder
classes for each of the derived
classes?</p>
<pre><code>public class MoreNutritionFacts : NutritionFacts
{
public new static MoreNutritionFacts.Builder Build(string name, int servingSize, int servingsPerContainer)
{
return new MoreNutritionFacts.Builder(name, servingSize, servingsPerContainer);
}
public new sealed class Builder
{
public Builder(String name, int servingSize,
int servingsPerContainer) {}
public Builder totalFat(int val) { }
public Builder saturatedFat(int val) { }
public Builder transFat(int val) { }
public Builder cholesterol(int val) { }
//... 15 more setters
public Builder newProperty(int val) { }
public MoreNutritionFacts build()
{
return new MoreNutritionFacts(this);
}
}
private MoreNutritionFacts(MoreNutritionFacts.Builder builder) { }
}
</code></pre></li>
</ul>
| [
{
"answer_id": 313747,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 5,
"selected": false,
"text": "public sealed class SomeMessage\n{\n public string Name { get; private set; }\n public int Age { get; private set; }\n... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26036/"
] |
313,737 | <p>For a certain inputform, I'd like to make it possible to do input with the keyboard. I know how to read the keys through KeyPressed and KeyUp, but the problem is that when a control has got the focus and the user presses the Enter key, that control receives the a Click event. Is it possible to prevent that behaviour ? Or is it possible to know if a Click Event was fired by the mouse or by the keyboard ?</p>
| [
{
"answer_id": 313795,
"author": "Vincent Van Den Berghe",
"author_id": 39259,
"author_profile": "https://Stackoverflow.com/users/39259",
"pm_score": 2,
"selected": false,
"text": "Form.KeyPreview = True\n"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/313737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34723/"
] |
313,746 | <p>I am mulling over a web-app in Perl that will allow users to create bug monitors. So essentially each "bug watch" will be a bug ID that will be passed to a sub routine along with the "sleep" time, and once the "sleep time" is over it must recur without blocking the parent process or the peer processes.</p>
<ul>
<li><p>I tried <a href="http://search.cpan.org/dist/Schedule-Cron" rel="nofollow noreferrer">Schedule::Cron</a>. It supports cron-like format but here the arguments to the subs must be simple scalars hence I ruled it out.</p>
</li>
<li><p>POE/Coro seem to be another options but I don't have much idea about it/ :(</p>
</li>
</ul>
<p>Any insights ? TIA</p>
<p>-Matt.</p>
| [
{
"answer_id": 314510,
"author": "converter42",
"author_id": 28974,
"author_profile": "https://Stackoverflow.com/users/28974",
"pm_score": 2,
"selected": false,
"text": "$cron->add_entry(\n '* * * * *',\n subroutine => \\&mysub,\n arguments => \\@data,\n);\n"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/313746",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
313,753 | <p>I have a incoming stream of bytes (unsigned char) from either a file or network. I need this data placed in a class, and is looking for a NET-way of doing this. </p>
<p>I bet some does this all the time, so I guess there is a better method to do this than using BitConverter. </p>
<p>I realize I supplied too litle information. Let me try with an example class: </p>
<pre><code>class data {
void doSmething();
int var1;
float var2;
}
</code></pre>
<p>Then I want to transfer the data (var1 and var2) contained in this class over f.ex. a network socket and receive the data on the other end</p>
| [
{
"answer_id": 313823,
"author": "netadictos",
"author_id": 31791,
"author_profile": "https://Stackoverflow.com/users/31791",
"pm_score": 1,
"selected": false,
"text": " [Serializable]\n [XmlRoot(\"CONFIGURATION\")]\n public class Configuration\n {\n EnterpriseCollection ... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37583/"
] |
313,754 | <p>What is your preferred way of keeping controls centered on its parent when the parent change width or height? </p>
| [
{
"answer_id": 313867,
"author": "mj2008",
"author_id": 5544,
"author_profile": "https://Stackoverflow.com/users/5544",
"pm_score": 0,
"selected": false,
"text": "procedure TMyForm.FormResize(Sender: TObject);\nvar\n nNewTop : Integer;\nbegin\n inherited;\n pnlRegenerating.Left := (Cl... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313754",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11956/"
] |
313,769 | <p>What is best way to allow user to pick date from a mobile device from usability prospective?</p>
| [
{
"answer_id": 1296513,
"author": "davewasthere",
"author_id": 376,
"author_profile": "https://Stackoverflow.com/users/376",
"pm_score": 3,
"selected": true,
"text": "DateTime.TryParse(String, out DateTime)"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/313769",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/191/"
] |
313,778 | <p>I have a project that has a makefile with broken dependencies. Is there any best known way to generate a list of dependencies for the project that I can use in the makefile, other than examining each source file by hand or with a hand written perl script?</p>
| [
{
"answer_id": 313787,
"author": "Stefan Mai",
"author_id": 13257,
"author_profile": "https://Stackoverflow.com/users/13257",
"pm_score": 7,
"selected": true,
"text": "g++ -MM <your file>"
},
{
"answer_id": 10168396,
"author": "Christopher Smith",
"author_id": 60871,
... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1084/"
] |
313,781 | <p>I am working on localization for an app where custom patterns are used to format the date-time.</p>
<p>one example is:
dd-MM HH:mm</p>
<p>I need to get localized versions of this custom format for dates, so that I get the date using numbers, and the time, basically using the local order (dd MM or MM dd) and the local seperator for both date and time.</p>
<p>This is fairly trivial, as long as I am using the default formatting, but as soon as I stray from these, the formatting becomes hardcoded.</p>
<p>Any ideas?</p>
<p>Thanks, Jonas</p>
<p>edit:
I have the cultureInfo objects, the problem is that when I do a DateTime.ToString("ES-es"), I get too much info - I need only month+day, but with the default ToString, I get year+month+day</p>
<p>Edit again:
I see how I can change the ShortDate pattern for each CultureInfo object I use. However, I also need the default ShortDate pattern in some situations, so changing that would, unfortunately, leave me with another, equivalent problem.</p>
<p>Final edit: in case anyone cares. I never did find a solution, so I ended up coding a static function that checks the current CultureInfo, and returns the correctly formatted date, sans year.</p>
| [
{
"answer_id": 313809,
"author": "netadictos",
"author_id": 31791,
"author_profile": "https://Stackoverflow.com/users/31791",
"pm_score": 2,
"selected": false,
"text": "DateTime.Now.ToString(new System.Globalization.CultureInfo(Thread.CurrentThread.CurrentCulture.Name));\n"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/313781",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1090/"
] |
313,786 | <p>Hej, </p>
<p>assuming I have a code that looks like this:</p>
<pre><code>List<User> userList = GetUserByName (u => u.Name == name);
DoSomethingWithTheUsers (userList.ToArray ());
</code></pre>
<p>Now I want to know the type of the objects in the Array in the method <em>DoSomethingWithTheUsers (object[] myObjects)</em></p>
<p>Simply done by <em>myObjects.First ().GetType ()</em> but what is to be done if the array is empty?
Is there a possibility to still get the Type?</p>
| [
{
"answer_id": 313790,
"author": "Barry Kelly",
"author_id": 3712,
"author_profile": "https://Stackoverflow.com/users/3712",
"pm_score": 5,
"selected": true,
"text": "myObjects.GetType().GetElementType()\n"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/313786",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33111/"
] |
313,792 | <p>I'm using a Delphi 2009 VCL TProgressBar as a kind of "empty/full" gauge.</p>
<p>On Vista, with Aero theme enabled, this has an animation associated with it, which is annoying and inappropriate for an gauge.</p>
<p>Is there any way of disabling this (NOT by adjusting user's theme settings!) to prevent the animation on this control?</p>
<p>To clarify, I want something basically identical to the 'disk space used' meters in Windows Explorer. No animation, but still with a nice border and shading effects.</p>
<p>Update:</p>
<p>I understand that I need a "meter", rather than a true progress bar. How can a themed meter be implemented using the standard windows progress bar control?</p>
| [
{
"answer_id": 315742,
"author": "Tim Knipe",
"author_id": 10493,
"author_profile": "https://Stackoverflow.com/users/10493",
"pm_score": 3,
"selected": false,
"text": "SetWindowTheme(ProgressBar.Handle, ' ', ' ');\n"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/313792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1737/"
] |
313,794 | <p>I would like to automate the deployment of my SSIS and SSAS artifacts to remote development SQL Server 2005 & 2008 instances on a scheduled basis. </p>
<p>What would be the best solution for this? I am using TFS 2008 as the source control system, so I'd like to integrate the solution with MSBuild and a scheduled Team Build.</p>
| [
{
"answer_id": 5189822,
"author": "Darren",
"author_id": 6065,
"author_profile": "https://Stackoverflow.com/users/6065",
"pm_score": 2,
"selected": false,
"text": " <Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n <Target Name=\... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313794",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5132/"
] |
313,796 | <p>How can you get castle Windsor to choose the right implantation of a interface at run time when you have multiple implementations in the container.</p>
<p>For example lets say i have a simple interface called IExamCalc that does calculations to work out how someone did in that exam.</p>
<p>No we have several implementation of this like bellow for example,</p>
<pre><code>public interface IExamCalc
{
int CalculateMark(ExamAnswers examAnswers)
}
public class WritenExam : IExamCalc
{
public int CalculateMark(ExamAnswers examAnswers)
{
return 4;
}
}
public class OralExam : IExamCalc
{
public int CalculateMark(ExamAnswers examAnswers)
{
return 8;
}
}
public class ExamMarkService
{
private IExamCalc _examCalc;
public ExamMarkService(IExamCalc examCalc)
{
_examCalc = examCalc;
}
public int[] CalculateExamMarks(ExamAnswers[] examAnswers)
{
IList<int> marks = new List<int>;
foreach(ExamAnswers examanswer in examaAnswers)
{
marks.Add(_examCalc.CalculateMark);
}
}
}
</code></pre>
<p>Say the ExamMarkService is being resloved through Windor how can i make sure that the correct implementation is injected in the constructor and is this an example of a multi-tenancy problem?</p>
<p>Hope that all makes sence</p>
<p>Colin G</p>
| [
{
"answer_id": 313804,
"author": "kͩeͣmͮpͥ ͩ",
"author_id": 26479,
"author_profile": "https://Stackoverflow.com/users/26479",
"pm_score": 1,
"selected": false,
"text": "container.Resolve<IExamCalc>"
},
{
"answer_id": 313851,
"author": "mookid8000",
"author_id": 6560,
... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313796",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1213936/"
] |
313,805 | <p>I don't want to have the user install Google Gears so I can show him his guessed location. Is there a way to get the location without having to use Google Gears?</p>
<p>I have found <a href="http://www.wipmania.com/de/blog/google-geolocation-api/" rel="noreferrer">http://www.wipmania.com/de/blog/google-geolocation-api/</a> but it does not offer an example.</p>
| [
{
"answer_id": 313812,
"author": "Stefan Mai",
"author_id": 13257,
"author_profile": "https://Stackoverflow.com/users/13257",
"pm_score": 4,
"selected": true,
"text": "<?php\n if(isset($_GET[\"ip\"])){\n echo geolocate($_GET[\"ip\"]);\n }\n\n function geolocate($ip){\n $raw_html = fi... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19929/"
] |
313,813 | <pre><code><?php
class Box {
var $contents;
function Box($contents) {
$this-&gt;contents = $contents;
}
function get_whats_inside() {
return $this-&gt;contents;
}
}
?>
</code></pre>
<p>I am going through a OO tutorial. I am familiar with PHP and the concept of OO but it is still an uphill struggle most of the time! However, the code above returns the error "Unexpected & on line 7". I cannot find anyone else having had problems with the tutorial. I am running MAMP with php version 5.2.5. Anyone have any ideas?</p>
| [
{
"answer_id": 313817,
"author": "schnaader",
"author_id": 34065,
"author_profile": "https://Stackoverflow.com/users/34065",
"pm_score": 0,
"selected": false,
"text": "$this->contents = $contents;\nreturn $this->contents;\n"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/313813",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31677/"
] |
313,822 | <p>How do you modify a propertygrid at runtime in every way? I want to be able to add and remove properties and add "dynamic types", what I mean with that is a type that result in a runtime generated dropdown in the propertygrid using a TypeConverter.</p>
<p>I have actually been able to do both those things (add/remove properties and add dynamic type) but only separately not at the same time.</p>
<p>To implement the support to add and remove properties at runtime I used <a href="http://www.codeproject.com/KB/tabs/Dynamic_Propertygrid.aspx?msg=1027628" rel="noreferrer">this codeproject article</a> and modified the code a bit to support different types (not just strings).</p>
<pre><code>private System.Windows.Forms.PropertyGrid propertyGrid1;
private CustomClass myProperties = new CustomClass();
public Form1()
{
InitializeComponent();
myProperties.Add(new CustomProperty("Name", "Sven", typeof(string), false, true));
myProperties.Add(new CustomProperty("MyBool", "True", typeof(bool), false, true));
myProperties.Add(new CustomProperty("CaptionPosition", "Top", typeof(CaptionPosition), false, true));
myProperties.Add(new CustomProperty("Custom", "", typeof(StatesList), false, true)); //<-- doesn't work
}
/// <summary>
/// CustomClass (Which is binding to property grid)
/// </summary>
public class CustomClass: CollectionBase,ICustomTypeDescriptor
{
/// <summary>
/// Add CustomProperty to Collectionbase List
/// </summary>
/// <param name="Value"></param>
public void Add(CustomProperty Value)
{
base.List.Add(Value);
}
/// <summary>
/// Remove item from List
/// </summary>
/// <param name="Name"></param>
public void Remove(string Name)
{
foreach(CustomProperty prop in base.List)
{
if(prop.Name == Name)
{
base.List.Remove(prop);
return;
}
}
}
</code></pre>
<p>etc...</p>
<pre><code>public enum CaptionPosition
{
Top,
Left
}
</code></pre>
<p>My complete solution can be downloaded <a href="http://helgo.net/salle/misc/PropertyGrid_2005.zip" rel="noreferrer">here</a>.</p>
<p>It works fine when I add strings, bools or enums, but when I try to add a "dynamic type" like StatesList it doesn't work. Does anyone know why and can help me to solve it?</p>
<pre><code>public class StatesList : System.ComponentModel.StringConverter
{
private string[] _States = { "Alabama", "Alaska", "Arizona", "Arkansas" };
public override System.ComponentModel.TypeConverter.StandardValuesCollection
GetStandardValues(ITypeDescriptorContext context)
{
return new StandardValuesCollection(_States);
}
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
{
return true;
}
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
{
return true;
}
}
</code></pre>
<p>The method of using a TypeConverter works fine when you don't try to add the property at runtime, for example <a href="http://www.megasolutions.net/cSharp/PropertyGrid-dynamic-Dropdown-List-4124.aspx" rel="noreferrer">this code</a> works without any problem, but I want to be able to do both.</p>
<p>Please take a look at <a href="http://helgo.net/salle/misc/PropertyGrid_2005.zip" rel="noreferrer">my project</a>.
Thanks!</p>
| [
{
"answer_id": 314025,
"author": "salle55",
"author_id": 39636,
"author_profile": "https://Stackoverflow.com/users/39636",
"pm_score": 3,
"selected": false,
"text": "myProperties.Add(new CustomProperty(\"Custom\", \"\", typeof(States), false, true));\n\n[TypeConverter(typeof(StatesList))... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313822",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39636/"
] |
313,824 | <p>all! Typing from Italy
This little piece of code works if the matrix size is less then 800 and fails with a segmentation fault for higher sizes....
I have tried it with gcc 4.3.2 compiler in linux and macosx and VisualStudio compiler in windows.
Seemsthe problem is in the stack size..... how can I increase it ?
How can I solve the problem for bigger matrix sizes ?
The code works fine in serial put fails in parallel execution.
Thanks.</p>
<pre><code>#include <omp.h>
#include <stdio.h>
#define Nu 4000
int main() {
float A[Nu][Nu],B[Nu][Nu],C[Nu][Nu];
int i,j;
#pragma omp parallel
printf("Hello from thread %d, nthreads %d\n", omp_get_thread_num(), omp_get_num_threads());
#pragma omp parallel for private(j,i) shared(A,B,C) schedule(static)
for(j=0;j<Nu;j++){
for(i=0;i<Nu;i++){
//printf("Hello from thread %d, i,j %d %d\n", omp_get_thread_num(),i,j );
A[i][j]=0;
B[i][j]=0;
C[i][j]=0;
}}
}
</code></pre>
| [
{
"answer_id": 403341,
"author": "eyberg",
"author_id": 39110,
"author_profile": "https://Stackoverflow.com/users/39110",
"pm_score": 0,
"selected": false,
"text": "'ulimit -s newstacksize'"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/313824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
313,831 | <p>I'm trying to use powershell to configure the account credentials, but I need to grant the account "Log on as a service" right in order for it to work. How can I do this in powershell?</p>
| [
{
"answer_id": 21235462,
"author": "grenade",
"author_id": 68115,
"author_profile": "https://Stackoverflow.com/users/68115",
"pm_score": 5,
"selected": false,
"text": "<#\n.Synopsis\n Grant logon as a service right to the defined user.\n.Parameter computerName\n Defines the name of the... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7618/"
] |
313,839 | <p>I recently had a problem during the deployment of a windows service. Four computers did not cause any problems, but on the fifth any attempt to start the service failed due to an exception. The exception stack trace is written to the event log, so I though it should be easy to identify the cause:</p>
<pre><code>protected override void OnStart(string[] args)
{
EventLog.WriteEntry("Starting service", EventLogEntryType.Information);
try
{
//...
base.OnStart(args);
}
catch (Exception ex)
{
EventLog.WriteEntry("Service can not start. Stack trace:" + ex.StackTrace, EventLogEntryType.Error);
Stop();
return;
}
EventLog.WriteEntry("Service started", EventLogEntryType.Information);
}
</code></pre>
<p>But alas, no information was ever written to the log. I finally traced it to the first log entry being written. It threw an exception because the application event log was full with recent entries, and configured to only overwrite entries older than 7 days.</p>
<p>What are the best practices on writing to the event log, considering that I can not change the configuration of the application event log? </p>
<p>Should I always put <code>EventLog.WriteEntry</code> in a try block, if yes, how should I handle the exception (writing it to the event log is probably a bad idea), should I check on the event log status in my <code>OnStart</code> method, or do you have any better suggestion?</p>
| [
{
"answer_id": 314118,
"author": "MusiGenesis",
"author_id": 14606,
"author_profile": "https://Stackoverflow.com/users/14606",
"pm_score": 2,
"selected": false,
"text": "System.Diagnostics.EventLog log = \n new System.Diagnostics.EventLog(\"YourLogNameHere\");\nlog.ModifyOverflowPolic... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22114/"
] |
313,848 | <p>I have a space delimited list of files names, where spaces in the file names are prefixed by '\'</p>
<p>e.g. "first\ file second\ file"</p>
<p>How can I get my regex to match each file name?</p>
| [
{
"answer_id": 313857,
"author": "Stefan Mai",
"author_id": 13257,
"author_profile": "https://Stackoverflow.com/users/13257",
"pm_score": 5,
"selected": true,
"text": "(\\\\ |[^ ])+\n"
},
{
"answer_id": 313872,
"author": "Tomalak",
"author_id": 18771,
"author_profile"... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313848",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/259/"
] |
313,859 | <p>Are there Windows API functions that allows reading what the current password policy is? For instance, minimum length, complexity etc.</p>
<p>If not reading, is there a way to verify a password against the policy programmatically?</p>
| [
{
"answer_id": 313907,
"author": "Eugene Yokota",
"author_id": 3827,
"author_profile": "https://Stackoverflow.com/users/3827",
"pm_score": 4,
"selected": true,
"text": "Sub ListPasswordPolicyInfo( strDomain )\n Dim objComputer\n Set objComputer = GetObject(\"WinNT://\" & strDomain ... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313859",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10644/"
] |
313,880 | <p>If you type</p>
<pre><code>nslookup -type=SRV _xmpp-server._tcp.gmail.com
</code></pre>
<p>(or use the dig command in OSX) you get some SRV records relating to google chat</p>
<p>I would like to replicate this functionality in PHP, does anyone have any good ideas how to do this?</p>
<p>I would like to avoid using exec() as this does not return 100% standard responses across OSX/*NIX/WINDOWS</p>
<p>Thanks!</p>
| [
{
"answer_id": 313898,
"author": "Tom Haigh",
"author_id": 22224,
"author_profile": "https://Stackoverflow.com/users/22224",
"pm_score": 4,
"selected": true,
"text": "require_once('Net/DNS.php');\n$resolver = new Net_DNS_Resolver();\n$response = $resolver->query('_xmpp-server._tcp.gmail.... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33604/"
] |
313,882 | <p>After creating a instance of a class, can we invoke the constructor explicitly?
For example</p>
<pre><code>class A{
A(int a)
{
}
}
A instance;
instance.A(2);
</code></pre>
<p>Can we do this?</p>
| [
{
"answer_id": 313883,
"author": "Michael Platings",
"author_id": 2651243,
"author_profile": "https://Stackoverflow.com/users/2651243",
"pm_score": 5,
"selected": true,
"text": "new (&instance) A(2);\n"
},
{
"answer_id": 313906,
"author": "brofield",
"author_id": 31423,
... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313882",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40236/"
] |
313,893 | <p>I need to get execution time in milliseconds.</p>
<blockquote>
<p>I originally asked this question back in 2008. The accepted answer then was to use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime" rel="noreferrer"><code>new Date().getTime()</code></a> However, we can all agree now that using the standard <a href="https://developer.mozilla.org/en-US/docs/Web/API/Performance.now" rel="noreferrer"><code>performance.now()</code></a> API is more appropriate. I am therefore changing the accepted answer to this one.</p>
</blockquote>
| [
{
"answer_id": 313903,
"author": "Owen",
"author_id": 4853,
"author_profile": "https://Stackoverflow.com/users/4853",
"pm_score": 9,
"selected": false,
"text": "var start = new Date().getTime();\n\nfor (i = 0; i < 50000; ++i) {\n// do something\n}\n\nvar end = new Date().getTime();\nvar ... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313893",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13370/"
] |
313,900 | <p>Using ICU 4.0 regex library, I find that the following regex is exhibiting exponential time:</p>
<pre><code>actual: "[^<]*<\?"
C code: "[^<]*<\\?"
</code></pre>
<p>Aim: find "<?" where there is no other "<" before it</p>
<p>When running this regex on plain text with no "<" characters at all it appears to take exponential time. If the text has at least a single "<" then it is quick. I don't understand why. </p>
<p>Shouldn't the required match on "<?" prevent this from needing to backtrack? I would have thought that it would try to find the first "<" and then test the rest of the expression. If it can't find a "<" then it would give up because the pattern obviously can't match.</p>
<p>Is this a bug in the ICU regex or is it expected?</p>
| [
{
"answer_id": 313925,
"author": "Markus Jarderot",
"author_id": 22364,
"author_profile": "https://Stackoverflow.com/users/22364",
"pm_score": 1,
"selected": false,
"text": "<?"
},
{
"answer_id": 313939,
"author": "PhiLho",
"author_id": 15459,
"author_profile": "https... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313900",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31423/"
] |
313,910 | <p>At the moment, I have some functions which look like this:</p>
<pre><code>private bool inFunction1 = false;
public void function1()
{
if (inFunction1) return;
inFunction1 = true;
// do stuff which might cause function1 to get called
...
inFunction1 = false;
}
</code></pre>
<p>I'd like to be able to declare them like this:</p>
<pre><code>[NoReEntry]
public void function1()
{
// do stuff which might cause function1 to get called
...
}
</code></pre>
<p>Is there an attribute I can add to a function to prevent reentry? If not, how would I go about making one? I've heard about AOP attributes that can be used to add code before and after function calls; would they be suitable?</p>
| [
{
"answer_id": 313923,
"author": "Anthony",
"author_id": 5599,
"author_profile": "https://Stackoverflow.com/users/5599",
"pm_score": 1,
"selected": false,
"text": "if (inFunction1) \n return;\n\ntry\n{\n inFunction1 = true;\n\n // do stuff which might cause function1 to get called\n ... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15371/"
] |
313,916 | <p>I have a Java Swing application, developed on Mac OS X 10.5 using Java 1.5.</p>
<p>I'm trying to make a custom cursor appear when the user moves the mouse over some text in a dialog. The cursor never changes, though. </p>
<p>When I don't use a JFrame instead of a JDialog, the cursor does change. But then I'll have to write all the dialog code myself.</p>
<p>How can I get the cursor to appear?</p>
<p>Here's the simplest code I could create to demonstrate the problem:</p>
<pre><code>import javax.swing.*;
import java.awt.*;
public class CursorTest {
public static void main(String[] args) {
JLabel label = new JLabel("Move mouse here for hand cursor");
label.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
JOptionPane pane = new JOptionPane(label);
pane.setOptions(new Object[]{"OK"});
JDialog dialog = pane.createDialog(null, "Test Dialog");
dialog.setVisible(true);
}
}
</code></pre>
| [
{
"answer_id": 313985,
"author": "PhiLho",
"author_id": 15459,
"author_profile": "https://Stackoverflow.com/users/15459",
"pm_score": 3,
"selected": true,
"text": "public class CursorTest extends JFrame\n{\n private CursorTest()\n {\n }\n\n private void ShowDialog()\n {\n JLa... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2959/"
] |
313,917 | <p>I've got a 1-based array of four items which I need to traverse. For a given index in the array, I need to work out the index of the next item, and the index of the previous item. This sounds simple but the array needs to wrap around. So when you are at the beginning of the array, the previous item is considered to be the last item. Likewise, if you are at the end of the array, the next item is considered to be the first item.</p>
<p>I realise this can be solved by using conditional statements, but I wondered if it was possible to do it using mathematical equations. I've got one that works nicely for the next item</p>
<pre><code>NextItem = Modulus(CurrentItem, 4) + 1
</code></pre>
<p>(the modulus function returns the remainder of one number divided by another).</p>
<p>Has anyone got any ideas as to how I can work out the previous item?</p>
| [
{
"answer_id": 313928,
"author": "paxdiablo",
"author_id": 14860,
"author_profile": "https://Stackoverflow.com/users/14860",
"pm_score": 3,
"selected": true,
"text": "CurrentItem - 1"
},
{
"answer_id": 313956,
"author": "Tom",
"author_id": 3715,
"author_profile": "htt... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12277/"
] |
313,921 | <pre><code>class Score
{
var $score;
var $name;
var $dept;
var $date;
function Score($score, $name, $dept, $date)
{
$this->scores = ($score);
$this->name = ($name);
$this->dept = ($dept);
$this->date = ($date);
}
function return_score(){
return $this->scores;
return $this->name;
return $this->dept;
return $this->date;
}
}
$newscore = new Score("131313","James", "Marketing", "19/05/2008");
echo $newscore->return_score();
</code></pre>
<p>The above code is only echoing 131313. I am just beginning to learn OO PHP so please go easy! Totally lost, so any help would be much appreciated.</p>
| [
{
"answer_id": 313936,
"author": "Davide Gualano",
"author_id": 28582,
"author_profile": "https://Stackoverflow.com/users/28582",
"pm_score": 2,
"selected": false,
"text": "public function getScore() {\n return $this->score;\n}\n\npublic function getName() {\n return $this->name;\n}\... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31677/"
] |
313,924 | <p>(EDIT: This question is now outdated for my particular issue, as Google Code supports git now and I've converted Protocol Buffers to Mercurial anyway. However, it's still of general interest, IMO.)</p>
<p>My <a href="http://github.com/jskeet/dotnet-protobufs/tree/master" rel="noreferrer">C# Protocol Buffers Port</a> uses github for its source control, and I'm beginning to really enjoy using git. However, as far as I can tell, github doesn't provide any project management tools: defect and feature tracking, discussions, feature requests, docs etc. Given my affiliations, <a href="http://code.google.com" rel="noreferrer">Google Code</a> would be a natural choice, but it would seem odd to create a project there but host the source on github.</p>
<p><a href="https://stackoverflow.com/questions/39186/should-i-use-githubfogbugz-or-assembla">This question about Fogbugz/Assembla</a> seems to mostly focus on the defect tracking. I was wondering what experiences others have had when it comes to a more "complete" project management solution. Does Fogbugz actually do everything I need? (Using a wiki for docs has its advantages, although I also want to be able to distribute documentation with the code.) Beyond the explicit features mentioned in the first paragraph, are there other project aspects I <em>should</em> be considering which I may have missed?</p>
<p>This will definitely stay an open source project, and although I'd rather not pay I don't mind if a small fee is required. Currently I'm the only developer, but that may change and there may very well be lots of people filing bugs and feature requests. (In other words, I hope and expect it to be popular, but with me doing most of the work.)</p>
<p>Previously I've <em>contributed</em> to various open source projects, but haven't done much in the way of running a very visible and active one. (<a href="http://pobox.com/~skeet/csharp/miscutil" rel="noreferrer">MiscUtil</a> is currently still "hosted" on my website, with occasional releases - the actual source control is on my local NAS.)</p>
<p>Anyone care to share their experiences?</p>
<p>EDIT: Another option I'm now considering is a Google Code project (I really would like to be loyal to my employer) and an occasional merge from git to svn (at the very least, every time I do a release). This would allow non-git users to get hold of the source easily too.</p>
| [
{
"answer_id": 314031,
"author": "Ali Afshar",
"author_id": 28380,
"author_profile": "https://Stackoverflow.com/users/28380",
"pm_score": 3,
"selected": false,
"text": "*"
},
{
"answer_id": 11584054,
"author": "Sudhir Jonathan",
"author_id": 73831,
"author_profile": "... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22656/"
] |
313,935 | <p>I have a sql query that runs super fast, around one second, when not using variables, like:</p>
<pre><code>WHERE id BETWEEN 5461094 and 5461097
</code></pre>
<p>But when I have:</p>
<pre><code>declare @firstId int
declare @lastId int
set @firstId = 5461094
set @lastId = 5461097
...
WHERE id BETWEEN @firstId and @lastId
</code></pre>
<p>... the query runs really slow, finishing only after some minutes. Why does it happen? I need to use variables. Can I do any improvement to avoid this performance problems?</p>
| [
{
"answer_id": 314032,
"author": "DiGi",
"author_id": 12042,
"author_profile": "https://Stackoverflow.com/users/12042",
"pm_score": 2,
"selected": false,
"text": "DECLARE @sql VARCHAR(8000)\n\nSET @sql = 'SELECT * FROM table_x WHERE id BETWEEN ' + CAST(@firstId AS VARCHAR) + ' AND ' + CA... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21668/"
] |
313,962 | <p>I'm currently using the following SQL for retrieving the last seven days worth of entries from a table:</p>
<pre><code>purchased >= date_sub(now() ,interval 7 day)
</code></pre>
<p>However, I need to change this so it retrieves the last full weeks worth of entries (midnight Saturday to midnight Saturday). So basically, throughout the week the results never change, but when someone visits on Sunday morning they will have refreshed.</p>
<p>I just can't get my head around how to work out the days etc. Also, are there built in MySQL functions for doing this?</p>
<p>I hope I've explained that clearly enough.
This is in a PHP application.</p>
| [
{
"answer_id": 313995,
"author": "Tom Haigh",
"author_id": 22224,
"author_profile": "https://Stackoverflow.com/users/22224",
"pm_score": 3,
"selected": true,
"text": "SELECT * FROM table WHERE YEARWEEK(purchased) = YEARWEEK(NOW());\n"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/313962",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39428/"
] |
313,969 | <p>I have the the following html elements:</p>
<pre><code><tr>
<td> <label for="casenumber">Case:</label></td>
<td>
<%=Html.TextBox("casenumber", "", new Dictionary<string, object>
{
{"id", "casenumberID"}
})%>
</td>
</tr>
<tr>
<td><label for="fogbugzUser">Users:</label></td>
<td>
<%=Html.DropDownList("UserList", (SelectList)ViewData["UserList"], new Dictionary<string, object>
{
{"id", "userlistid"}
})%>
</td>
</tr>
</code></pre>
<p>Now, when the <code>casenumber</code> loses focus, I want to call the database to return me a selected value in the <code>UserList</code>.</p>
<p>Here's the Javascript:</p>
<pre><code>$(function() {
$("#casenumberID").blur(function() {
//don't know how to do!!);
});
});
</code></pre>
<p>And here's the client side scripting:</p>
<pre><code>public JsonResult GetOpenByUser(string casenumber)
{
return Json(userContext.OpenBy(casenumber));
}
</code></pre>
<p>The question is how to write the function "blur" so that I can pass in the value of the textbox <code>casenumber</code> to the <code>GetOpenByUser</code>? </p>
<p>Also, how to complete the function <code>blur</code> so that the option that has the same value as the one that is returned by <code>GetOpenByUser</code> will be selected?</p>
| [
{
"answer_id": 314172,
"author": "Tomalak",
"author_id": 18771,
"author_profile": "https://Stackoverflow.com/users/18771",
"pm_score": 1,
"selected": false,
"text": "#fogbugzUser"
},
{
"answer_id": 316344,
"author": "Graviton",
"author_id": 3834,
"author_profile": "ht... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313969",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3834/"
] |
313,970 | <p>I want to convert a <code>std::string</code> to lowercase. I am aware of the function <code>tolower()</code>. However, in the past I have had issues with this function and it is hardly ideal anyway as using it with a <code>std::string</code> would require iterating over each character.</p>
<p>Is there an alternative which works 100% of the time?</p>
| [
{
"answer_id": 313988,
"author": "Rob",
"author_id": 9236,
"author_profile": "https://Stackoverflow.com/users/9236",
"pm_score": 9,
"selected": false,
"text": "#include <boost/algorithm/string.hpp>\n\nstd::string str = \"HELLO, WORLD!\";\nboost::algorithm::to_lower(str); // modifies str\... | 2008/11/24 | [
"https://Stackoverflow.com/questions/313970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18664/"
] |
313,998 | <p>In <strong>classic ASP</strong> there is a global object called <strong>"Application"</strong> that is accessed simultaniously by all sessions.</p>
<p>As the "Application" object is a shared resource, can it cause <strong>dead locks?</strong></p>
<p>EDIT: If not, why does it has <strong>lock</strong> and <strong>unlock</strong> methods for? <a href="http://www.w3schools.com/asp/asp_ref_application.asp" rel="nofollow noreferrer">Reference</a></p>
| [
{
"answer_id": 314588,
"author": "dariom",
"author_id": 12389,
"author_profile": "https://Stackoverflow.com/users/12389",
"pm_score": 2,
"selected": false,
"text": "Application"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/313998",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1100/"
] |
314,008 | <p>This is a contrived example, but lets say I have declared objects:</p>
<pre><code>CustomObj fooObj;
CustomObj barObj;
CustomObj bazObj;
</code></pre>
<p>And I have an string array:</p>
<pre><code>string[] stringarray = new string[] {"foo","bar","baz"};
</code></pre>
<p>How can I programmatically access and instantiate those objects using the string array, iterating using something like a foreach:</p>
<pre><code>foreach (string i in stringarray) {
`i`Obj = new CustomObj(i);
}
</code></pre>
<p>Hope the idea I'm trying to get across is clear. Is this possible in C#?</p>
| [
{
"answer_id": 314010,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 6,
"selected": true,
"text": "Dictionary<string, CustomObj>"
},
{
"answer_id": 314011,
"author": "Lasse V. Karlsen",
"author_id": 267,
... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35463/"
] |
314,012 | <p>I have a function which searches an STL container then returns the iterator when it finds the position, however I am getting some funny error messages, can tell me what I am doing wrong?</p>
<p>Function:</p>
<pre><code>std::vector< CClass >::iterator CClass::SearchFunction( const std::string& strField )
{
...
return it;
...
}
</code></pre>
<p>Error:</p>
<pre><code>error C2664: 'std::_Vector_iterator<_Ty,_Alloc>::_Vector_iterator(const std::_Vector_iterator<_Ty,_Alloc> &)' : cannot convert parameter 1 from 'std::_Vector_const_iterator<_Ty,_Alloc> *__w64 ' to 'const std::_Vector_iterator<_Ty,_Alloc> &'
</code></pre>
| [
{
"answer_id": 314018,
"author": "Ferruccio",
"author_id": 4086,
"author_profile": "https://Stackoverflow.com/users/4086",
"pm_score": 4,
"selected": true,
"text": "std::vector< CClass >::const_iterator"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/314012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18664/"
] |
314,024 | <p>My understanding is that you have to write unit tests that isolate functionality. So given a repository class that has this method:</p>
<pre><code>Entity GetById(Guid id)
</code></pre>
<p>and a <em>fake</em> implementation (using a Dictionary for storage), how would you write a test without first <em>adding</em> an entity? Is it ok to use a known set of guids for testing? Then in the fake repository constructor I could fill the dictionary with a couple of entities where the guids follow a pattern, so that I can test the GetById() method with a guid that I know will return an entity. </p>
<p>Thanks for reading!</p>
<p>PS. This is my first time writing unit tests.</p>
| [
{
"answer_id": 314041,
"author": "Chris Kimpton",
"author_id": 48310,
"author_profile": "https://Stackoverflow.com/users/48310",
"pm_score": 2,
"selected": false,
"text": "Expect.Call(repository.GetById(\"someObject\")).Return(new RepositoryThing());\n"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/314024",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4830/"
] |
314,054 | <p>I'm looking for a way to query the ink level for my Epson DX 4050 on Mac OS X. There is some UI called EPSON StatusMonitor to display cartridges levels graphically, but I'd like to get it from the command-line so it can feed a robot.</p>
<p>Any idea ?</p>
| [
{
"answer_id": 43123592,
"author": "tseeling",
"author_id": 919085,
"author_profile": "https://Stackoverflow.com/users/919085",
"pm_score": 0,
"selected": false,
"text": "#!/bin/sh\n\nme=\"${0##*/}\"\n\nhost=\"${1:-wp4535}\"\n\nbase=1.3.6.1.2.1.43.11.1.1\n\nname=\"WP-4535\"\n\ntype=$(snm... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314054",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20302/"
] |
314,055 | <p>I know there is <a href="https://stackoverflow.com/questions/63546/vs2005-c-programmatically-change-connection-string-contained-in-appconfig">some similar issue</a>.</p>
<p>But, still the question is not answered! I need to <strong>modify</strong> the connection string not add a new one.</p>
| [
{
"answer_id": 314060,
"author": "MysticSlayer",
"author_id": 28139,
"author_profile": "https://Stackoverflow.com/users/28139",
"pm_score": 3,
"selected": false,
"text": " /// <summary>\n /// Add a connection string to the connection\n /// strings section and store i... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314055",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
314,058 | <p>Is there a way to get MVEL 2.0 ( <a href="http://mvel.codehaus.org/" rel="nofollow noreferrer">http://mvel.codehaus.org/</a> ) to work with functions with optional parameters?</p>
<p>I would like to be able to eval this:</p>
<p>trunc('blahblah',2)</p>
<p>but also</p>
<p>trunc('blahblah',2,'[...]');</p>
<p>Now i have tried: </p>
<p>def trunc(param1,param2,param3) { ... impl ... }</p>
<p>That gives an exception if i try to call it with only 3 parameters.
I also tried:</p>
<p>def trunc(param1,param2,param3) { ... impl ... }
def trunc(param1,param2) { ... impl ... }</p>
<p>But the second one seems to completely overwrite the first definition.</p>
<p>Thanks</p>
| [
{
"answer_id": 4429797,
"author": "Kr1z",
"author_id": 513690,
"author_profile": "https://Stackoverflow.com/users/513690",
"pm_score": 1,
"selected": false,
"text": "private void method(Object obj1) {\n Object obj2 = new Object(\"Default\");\n method(obj1, obj2);\n}\n\nprivate void... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314058",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40254/"
] |
314,068 | <p>Even before telling my question, will tell you that this is a very vague question. But please let me know if you have any similar ideas. </p>
<p>I am actually trying to write a website of my own locally using ASP.Net. I actually wanted to try and simulate a website with trading and stock details. I wanted to actually fetch the details from some were. Please let me know if it is possible to fetch data from another website or is there any site where i can fetch such details. Also please let me know of what all parameters i need to keep in mind before and while designing a website. Please let me know any such ideas which i can make use of. Thank you one and all very very much. Any comment from you is appreciated.</p>
| [
{
"answer_id": 314403,
"author": "Gavin Miller",
"author_id": 33226,
"author_profile": "https://Stackoverflow.com/users/33226",
"pm_score": 1,
"selected": false,
"text": " // Create an HttpWebRequest using WebRequest.Create (see .NET docs)!\n HttpWebRequest request = (HttpWebReques... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20951/"
] |
314,085 | <p>I know questions of this kind <a href="https://stackoverflow.com/questions/24298/best-solution-for-authentication-in-ruby-on-rails">have</a> <a href="https://stackoverflow.com/questions/13254/open-id-authentication-in-ruby-on-rails">been</a> <a href="https://stackoverflow.com/questions/38901/strange-rails-authentication-issue">asked</a> before, but my situation differs a little.</p>
<p>On my rails app I have to validate the user login against an existing repository and then control authorization to given modules. So, I don't want the solution I go for to generate a model for my users and rely on that. The authetication per se needs to be customized.</p>
<p>Under that scenario, what would be the best plugin to use?</p>
| [
{
"answer_id": 316418,
"author": "Purfideas",
"author_id": 4615,
"author_profile": "https://Stackoverflow.com/users/4615",
"pm_score": 2,
"selected": false,
"text": "SecureSessions::Password.validate_proc = proc do |ctrl| \n # define any proc here which validates username/password etc, ... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14540/"
] |
314,095 | <p><strong>Is there a way that I can configure Visual Studio 2008 to understand CamelCase?</strong> Specifically, I'd like to be able to get <code>Ctrl + right</code> or <code>left</code> cursor to take me to a subsection of a variable or type name.</p>
<p>i.e., if my cursor was at the start of this line:</p>
<pre class="lang-cs prettyprint-override"><code>LongNamedExampleClass longNamed = new LongNamedExampleClass();
</code></pre>
<p>and I hit <code>Ctrl + right</code>, I'd like to jump to "<code>Named</code>" in the class name, rather than the start of the variable name. If I hit it again, I'd like to go to "<code>Example</code>". I hope that makes sense.</p>
<p>I used this navigational feature in Eclipse quite a lot, and find it difficult to unlearn something so ingrained.</p>
| [
{
"answer_id": 29357666,
"author": "jsea",
"author_id": 1682070,
"author_profile": "https://Stackoverflow.com/users/1682070",
"pm_score": 7,
"selected": false,
"text": "Visual Studio 2019"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/314095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1853/"
] |
314,098 | <p>Is the following scenario possible in SQL Server using a single active connection?</p>
<p>Inside a READCOMMITED transaction I need to update one table without locking it. For example each time I execute a statement I increase a field in that table. This operation doesn't need to be rolled back in case the transaction fails. Also, this update shouldn't block other concurrent users which try to update the same position.</p>
| [
{
"answer_id": 29357666,
"author": "jsea",
"author_id": 1682070,
"author_profile": "https://Stackoverflow.com/users/1682070",
"pm_score": 7,
"selected": false,
"text": "Visual Studio 2019"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/314098",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
314,100 | <p>I'm working with LINQ to objects and have a function where in some cases I need to modify the underlying collection before calling <code>Aggregate(...)</code> and then return it to its original state before the funciton returns the results of <code>Aggregate(...)</code>. My current code looks something like this:</p>
<pre><code>bool collectionModified = false;
if(collectionNeedsModification)
{
modifyCollection();
collectionModified = true;
}
var aggregationResult = from a in
(from b in collection
where b.SatisfysCondition)
.Aggregate(aggregationFunction)
select a.NeededValue;
if(collectionModified)
modifyCollection();
return aggregationResult;
</code></pre>
<p>However, as written, if I modify the collection, I will get the wrong result because I'm putting the collection back in its original state before <code>aggregationResult</code> is enumerated and LINQ results are lazy-evaluated. My current solution is to use <code>.ToArray()</code> on my LINQ query like this:</p>
<pre><code>var aggregationResult = (from a in
(from b in collection
where b.SatisfysCondition)
.Aggregate(aggregationFunction)
select a.NeededValue).ToArray();
</code></pre>
<p>The size of the resulting array will always be small (< 100 items) so memory / processing time is not a concern. Is this the best way to handle my problem, or is there a better way to force the evaluation of a LINQ query?</p>
| [
{
"answer_id": 314122,
"author": "Aleris",
"author_id": 20417,
"author_profile": "https://Stackoverflow.com/users/20417",
"pm_score": 2,
"selected": false,
"text": "var modifiedCollection = ModifyCollection(collection, collectionNeedsModification);\n\nvar aggregationResult = from a in\n ... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4797/"
] |
314,108 | <p>How can I make this java generic cast ?</p>
<pre><code>public interface IField {
}
class Field implements IField { // package private class
}
public class Form {
private List<Field> fields;
public List<IField> getFields() {
return this.fields;
}
}
</code></pre>
<p>The return statement throws a compiler error (I know the reason - I read the generics tutorial) but it would be very handy to write such code.</p>
<p>If I declared "fields" as List I would need to use a lot of casts to Field in other methods of a Form class .</p>
<p>Can I force that damn compiler to bend it's rules and compile that return statement ?</p>
<p>Thanks in advance.</p>
| [
{
"answer_id": 314112,
"author": "Sunlight",
"author_id": 33650,
"author_profile": "https://Stackoverflow.com/users/33650",
"pm_score": 4,
"selected": false,
"text": "return (List<IField>)(Object)this.fields;\n"
},
{
"answer_id": 314127,
"author": "Dan Vinton",
"author_id... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24028/"
] |
314,109 | <p>With PHP, I can make numerous PHP websites locally and then upload each of them to its own sub-directory of my PHP hosting service. </p>
<p>However, with ASP.NET, it seems that I can only upload my ASP.NET to the root of my hosting service. If I upload to a sub-directory, I get an error in </p>
<pre><code>section registered as allowDefinition='MachineToApplication' beyond application level
<authentication mode="Windows"/>
</code></pre>
<ul>
<li>is there a way to get around this so I can have numerous ASP.NET websites each in its own directory?</li>
<li>if not, would using ASP.NET MVC be able to get around this problem?</li>
<li>or is it generally not possible to FTP multiple ASP.NET sites to a shared hosting provider?</li>
</ul>
| [
{
"answer_id": 314112,
"author": "Sunlight",
"author_id": 33650,
"author_profile": "https://Stackoverflow.com/users/33650",
"pm_score": 4,
"selected": false,
"text": "return (List<IField>)(Object)this.fields;\n"
},
{
"answer_id": 314127,
"author": "Dan Vinton",
"author_id... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4639/"
] |
314,110 | <p>Having a fully internationalised application is a necessity if you want to sell worldwide.
In Java we're using resource bundles and that solves things for static text codeside.</p>
<p>But what do you do about text that is stored in the database? Starting with static definitions, to user modifiable objects, ending with user entered data.</p>
<p>Assuming you have a database used by users with different Locales - how do you handle this? How far do you internationalise? Where do you draw the line?
What workaround can keep users from receiving text in a language they don't understand?</p>
| [
{
"answer_id": 314244,
"author": "Dylan Beattie",
"author_id": 5017,
"author_profile": "https://Stackoverflow.com/users/5017",
"pm_score": 2,
"selected": false,
"text": "SELECT *"
},
{
"answer_id": 21948179,
"author": "Neil McGuigan",
"author_id": 223478,
"author_prof... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23428/"
] |
314,152 | <p>Consider the following use of template template parameters...</p>
<pre><code>#include <iostream>
template <typename X>
class A
{
X _t;
public:
A(X t)
:_t(t)
{
}
X GetValue()
{
return _t;
}
};
template <typename T, template <typename T> class C >
class B
{
C<T> _c;
public:
B(T t)
:_c(t)
{
}
T GetValue()
{
return _c.GetValue();
}
};
using namespace std;
int main()
{
B<int, A> b(10);
cout<<b.GetValue();
return 0;
}
</code></pre>
<p>Is there a way by which the template parameter T can be removed? For example is there a way to make the following work?</p>
<pre><code>//Does not compile
template <template <typename T> class C >
class B
{
C _c;
public:
B(T t)
:_c(t)
{
}
T GetValue()
{
return _c.GetValue();
}
};
int main()
{
B< A<int> > b(10);
cout<<b.GetValue();
return 0;
}
</code></pre>
| [
{
"answer_id": 314177,
"author": "coryan",
"author_id": 33325,
"author_profile": "https://Stackoverflow.com/users/33325",
"pm_score": 1,
"selected": false,
"text": "template <typename C >\nstruct B\n{\n C c;\n};\n\nint main()\n{\n B< A<int> > b;\n return 0;\n}\n"
},
{
"a... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314152",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39648/"
] |
314,164 | <p>I am not familiar with this website but I am desperately seeking help with the website I am building. I'm sorry if I'm not in the right place or asking my question incorrectly, so please tell me if I do something wrong!</p>
<p>I have built a simple website, consisting of four pages (index.html plus three others). In FF everything seems to work fine, but in IE it doesn't. I know there are a lot of similar problems, but after hours of searching I cannot find a solution. I have a sidebar on the left, which in FF appears in place, but in IE comes up below the content. The strange thing is that on the fourth page it does work, so I'm lost as to if it is a css or html error on my account. For the time being the website is to be found at <a href="http://www.kids2move.nl/djctapas" rel="nofollow noreferrer">http://www.kids2move.nl/djctapas</a></p>
<p>I hope there is anyone out there that sees what I have done wrong and how I can fix it. I will check this page regularly so I can add additional information if needed, like my css-file or the htmlcode. Thanks in advance!!</p>
| [
{
"answer_id": 314271,
"author": "mike nvck",
"author_id": 36531,
"author_profile": "https://Stackoverflow.com/users/36531",
"pm_score": 0,
"selected": false,
"text": "<div id=page>\n <div id=content></div>\n</div>\n<div id=sidebar></div>\n"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/314164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
314,165 | <p>I would like to do the following:</p>
<p>when a Sales person assigns a custom entity (let's call it 'Primary Expertise') to an Opportunity in MS CRM 4.0, the system would share the Opportunity with the user that is defined as the Owner of the associated 'Primary Expertise' record.</p>
<p>I would like to do it automatically via workflow but cannot find the workflow step that would accomplish that. Yes, and I read on some forums that it's actually not possible yet, only via a .NET assembly.</p>
<p>Experience, anyone?</p>
| [
{
"answer_id": 16037613,
"author": "shytikov",
"author_id": 1047741,
"author_profile": "https://Stackoverflow.com/users/1047741",
"pm_score": 2,
"selected": false,
"text": "var rights = AccessRights.ReadAccess | AccessRights.WriteAccess;\n\nvar principalAccess = new PrincipalAccess\n{\n ... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314165",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2706/"
] |
314,176 | <p>A cancer CT picture is stored inside a unsigned short array (1-dimensional).</p>
<p>I have the location information of the cancer region inside the picture, but the coordinates (x,y) are in superpixel (128x128 unsigned short). My task is to highlight this region. </p>
<p>I already solved this one by converting superpixel coordinates into a offset a can use for the unsigned short array. It works fine but i wonder if there is a smarter way to solve this problem, since my solution needs 3 nested for-loops.</p>
<p>Is it possible to access the ushort array "superpixelwise", so i can navigate the ushort array in superpixels.</p>
<p>I know this does not work. To give you an idea what I was thinking of:</p>
<pre><code>typedef struct
{
unsigned short[128x128]
}
spix;
spix *spixptr;
unsigned short * bufptr = img->getBuf();
spixptr = bufptr;
</code></pre>
<p><strong>Update 1:</strong></p>
<p>Yep its vague, let me try again with a picture:</p>
<pre><code>[0][1][2] ... [127]| ... [x] |
[1] | |
[2] | |
. | |
. | <-- this is a superpixel
. | |
[127] | |
-------------------- |
. |
. |
. |
[y] |<--whole picture stored in a ushort* buf = new ushort[x*y]
------------------------------
</code></pre>
<p>I like to access the 128x128 <code>ushorts</code> at once with a pointer, so I can <code>memcpy</code> data into the 128x128 field. </p>
<p><strong>Update 2:</strong></p>
<p>The bitblit transfer hint helped a lot.</p>
| [
{
"answer_id": 314204,
"author": "unwind",
"author_id": 28169,
"author_profile": "https://Stackoverflow.com/users/28169",
"pm_score": 1,
"selected": false,
"text": "typedef struct\n{\n unsigned short data[128 * 128]; // This was broken in the question.\n} spix;\n\n\nvoid spix_set_pixe... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314176",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40260/"
] |
314,181 | <p>Is there a way of automatically generating a HTML-Map compatible list of coordinates of polygon-like objects (e.g. countries on a map) with very distinctive borders?</p>
<p>Example image:</p>
<p><a href="http://www.bankaustria.at/landkarten/CEE_2007_w524.jpg">Map of CEE countries http://www.bankaustria.at/landkarten/CEE_2007_w524.jpg</a></p>
<p>Final output:</p>
<pre><code><map id ="ceemap" name="ceemap">
<area shape="poly" coords="149,303,162,301,162,298,171,293,180,299,169,309,159,306,148,306,149,303" href="austria.html" target ="_blank" alt="Austria" />
<!-- ... -->
</map>
</code></pre>
<p>Any tools/scripts extracting the coordinates of a polygon-like selection would be helpful.</p>
| [
{
"answer_id": 323703,
"author": "Gerhard Dinhof",
"author_id": 898,
"author_profile": "https://Stackoverflow.com/users/898",
"pm_score": 3,
"selected": false,
"text": "// input format: M 166,362.27539 C 163.525,360.86029 161.3875,359.43192 161.25,359.10124 C ...\nprivate static void Svg... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314181",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/898/"
] |
314,187 | <p>Here's a simplified version of my scenario:</p>
<ul>
<li>I have a table named <strong>Project</strong> that I reference via an 'id' field.</li>
<li>I have a table named <strong>Photo</strong> that has a field named 'project_id' which I use to relate multiple photos to a single project. The Photo table also has an auto-incrementing 'id' field that I use for ordering, amongst other things.</li>
</ul>
<p>Here's what I want to accomplish: <em>For a collection of Project id values, I wish to retrieve the last 5 photos added to each project</em> -- ideally in a single query, of course. :-)</p>
<p>Put another way, instead of imposing a single query limit, I would ideally like to specify a per project limit on the number of photos returned.</p>
<p>I am currently implementing this as one-query per project, so N projects = N queries (a good caching strategy will certainly reduce the hurt, but that'll come later).</p>
<p>Anyone have a solution?</p>
<p>Thanks.</p>
| [
{
"answer_id": 314207,
"author": "Tomalak",
"author_id": 18771,
"author_profile": "https://Stackoverflow.com/users/18771",
"pm_score": 1,
"selected": false,
"text": "Projects"
},
{
"answer_id": 314231,
"author": "philistyne",
"author_id": 16597,
"author_profile": "htt... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314187",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40123/"
] |
314,203 | <p>Can I collapse those two "getFields" methods into one using generics (the second method is intended to package private access) or should I rename the second one into something ugly like "getFieldPackagePrivate"?</p>
<pre><code>public interface IField {
}
class Field implements IField { // package private class
}
public class IForm {
public List<IField> getFields();
}
public class Form {
private List<Field> fields;
public List<IField> getFields() {
return this.fields;
}
List<Field> getFields() { // package visible
return this.fields;
}
}
</code></pre>
<p>the basic usage would be like this</p>
<pre><code>// by interfece - from client code
IForm form;
List<IField> list = form.getFields();
// by class - from other classes in the same package
Form form2;
List<Field> list2 = forms2.getFields();
</code></pre>
<p>The idea is to have a clean, save interface for an outside world and a convenient access (without downcasts) from package visible implementation clacces. My Field Class has a few methods that I don't want do be seen by a client but need to invoke from other classes in the same packege (like for example setLabel etc.)</p>
| [
{
"answer_id": 314208,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 2,
"selected": false,
"text": "public List<? extends IField> getFields()\n"
},
{
"answer_id": 314365,
"author": "Łukasz Bownik",
"autho... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314203",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24028/"
] |
314,213 | <p>How do I check that I have an open network connection and can contact a specific ip address in c#? I have seen example in VB.Net but they all use the 'My' structure.
Thank you.</p>
| [
{
"answer_id": 314261,
"author": "Patrick Desjardins",
"author_id": 13913,
"author_profile": "https://Stackoverflow.com/users/13913",
"pm_score": 3,
"selected": false,
"text": "IPEndPoint ipep = new IPEndPoint(Ipaddress.Parse(\"IP TO CHECK\"), YOUR_PORT_INTEGER);\nSocket server = new Soc... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314213",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37350/"
] |
314,232 | <p>I have a DateTime object that I need to print in a custom gridlike control.
The type of the data I want to print is a date in the format dd-mm-yyyy.
This value can be either filled or blank.
If it's filled it will be parsed into a <code>DateTime</code> and then printed as the default <code>ToString</code>.</p>
<p>For each row, I can use</p>
<pre><code><CellTemplate>
<asp:Literal ID="Literal2" runat="server" Text="<%# Container.Value %>"></asp:Literal>
</CellTemplate>
</code></pre>
<p>But this prints the default long version of the date. I'd like the format from <code>ToShortDateString()</code>.</p>
<p>So I tried modifying to:</p>
<pre><code><CellTemplate>
<asp:Literal ID="Literal2" runat="server" Text="<%# Convert.ToDateTime(Container.Value).ToShortTimeString()%>"></asp:Literal>
</CellTemplate>
</code></pre>
<p>This works as intended.</p>
<p>Now I have a problem with empty dates,</p>
<pre><code>Convert.ToDateTime()
</code></pre>
<p>On an empty string, it will print the default DateTime.</p>
<p>Is there a way that I can fashion an If-Statement in my aspx code, to only perform <code>Convert.ToDateTime</code>, if it's not an empty string?</p>
| [
{
"answer_id": 314263,
"author": "Mark Cidade",
"author_id": 1659,
"author_profile": "https://Stackoverflow.com/users/1659",
"pm_score": 3,
"selected": true,
"text": "Container.Value.Length > 0 ? Convert.ToDateTime(Container.Value).ToShortTimeString() : \"\"\n"
},
{
"answer_id": ... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314232",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40274/"
] |
314,245 | <p>I have this code:</p>
<pre><code>db = "C:\Dokumente und Einstellungen\hom\Anwendungsdaten\BayWotch4\Neuer Ordner\baywotch.db5"
TextExportFile = "C:\Dokumente und Einstellungen\hom\Anwendungsdaten\BayWotch4\Neuer Ordner\Exp.txt"
Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
cn.Open _
"Provider = Microsoft.Jet.OLEDB.4.0; " & _
"Data Source =" & db
strSQL = "SELECT * FROM tblAuction1"
rs.Open strSQL, cn, 3, 3
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.CreateTextFile(TextExportFile, True)
a = rs.GetString
f.WriteLine a
f.Close
</code></pre>
<p>Which is meant to connect to an access database and produce a tab delimited text file. tblAuction1 is a query in the database, and definitly exists and is not misspelt in any way, but I get an error that it cannot be found or does not exist. When I change it to tblAuction which is the name of the table, I get an error stating f.WriteLine a has been called incorrectly.</p>
<p>edit: I now only get a problem with f.writeline a, saying an incorrect argument has been supplied. I no longer have a problem with tblAuction1</p>
<p>edit: the sql code used for my query:</p>
<pre><code>SELECT tblAuction.article_no, tblAuction.article_name, tblAuction.subtitle, tblAuction.current_bid, tblAuction.start_price, tblAuction.bid_count, tblAuction.quant_total, tblAuction.quant_sold, tblAuction.start, tblAuction.ends, tblAuction.origin_end, tblUser.user_name, tblAuction.best_bidder_id, tblAuction.finished, tblAuction.watch, tblAuction.buyitnow_price, tblAuction.pic_url, tblAuction.private_auction, tblAuction.auction_type, tblAuction.insert_date, tblAuction.update_date, tblAuction.cat_1_id, tblAuction.cat_2_id, tblAuction.article_desc, tblAuction.countrycode, tblAuction.location, tblAuction.condition, tblAuction.revised, tblAuction.paypal_accept, tblAuction.pre_terminated, tblAuction.shipping_to, tblAuction.fee_insertion, tblAuction.fee_final, tblAuction.fee_listing, tblAuction.pic_xxl, tblAuction.pic_diashow, tblAuction.pic_count, tblAuction.item_site_id
FROM tblUser INNER JOIN tblAuction ON tblUser.id = tblAuction.seller_id;
</code></pre>
| [
{
"answer_id": 314285,
"author": "Daniel Kreiseder",
"author_id": 31406,
"author_profile": "https://Stackoverflow.com/users/31406",
"pm_score": 0,
"selected": false,
"text": "cn.Provider = \"Microsoft.Jet.OLEDB.4.0\"\ncn.ConnectionString = db\ncn.Open\n"
},
{
"answer_id": 315291,... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314245",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1246613/"
] |
314,254 | <p>I'm looking for way to grab the content of my opengl (as UIImage) and then save it into a file. I'm now giving glReadPixels a try though I'm not sure I'm doing the right thing as of what kind of malloc I should be doing. I gather that on OSX it's GL_BGRA but on the iPhone that doesn't work...</p>
| [
{
"answer_id": 314337,
"author": "Nils Pipenbrinck",
"author_id": 15955,
"author_profile": "https://Stackoverflow.com/users/15955",
"pm_score": 2,
"selected": false,
"text": "GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES \n"
},
{
"answer_id": 3333682,
"author": "Alastair Stuart",
... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314254",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
314,256 | <p>My Cocoa app needs some small dynamically generated windows. How can I programmatically create Cocoa windows at runtime?</p>
<p>This is my non-working attempt so far. I see no result whatsoever.</p>
<pre><code>NSRect frame = NSMakeRect(0, 0, 200, 200);
NSUInteger styleMask = NSBorderlessWindowMask;
NSRect rect = [NSWindow contentRectForFrameRect:frame styleMask:styleMask];
NSWindow * window = [[NSWindow alloc] initWithContentRect:rect styleMask:styleMask backing: NSBackingStoreRetained defer:false];
[window setBackgroundColor:[NSColor blueColor]];
[window display];
</code></pre>
| [
{
"answer_id": 314308,
"author": "Steve McLeod",
"author_id": 2959,
"author_profile": "https://Stackoverflow.com/users/2959",
"pm_score": 2,
"selected": false,
"text": "NSRect frame = NSMakeRect(100, 100, 200, 200);\nNSUInteger styleMask = NSBorderlessWindowMask;\nNSRect rect = [NSWin... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314256",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2959/"
] |
314,258 | <p>I'm creating some big files (DB exports) with Java and I need to put them somewhere on our SharePoint server. Right now, I'm doing this with IE but I'd like to automate this step, too.</p>
<p>I searched the web and I found some hints to use SOAP but I don't really see to the ground of all this, yet. Can someone provide me with some sample code or a recipe what I need to do?</p>
<p>Please note: the SharePoint server asks for NT domain authentication. I can't even login with Firefox :(</p>
<p><strong>EDIT</strong></p>
<ul>
<li>How do I convert the scary URL in IE into a WebDAV path?</li>
<li>Is there a WebDAV "explorer" which I can use before I ruin the production system with my code? I tried "DAV Explorer 0.91" from <a href="http://www.davexplorer.org/" rel="noreferrer">http://www.davexplorer.org/</a> but that can't connect (probably because of NT domain auth).</li>
</ul>
| [
{
"answer_id": 314477,
"author": "dariom",
"author_id": 12389,
"author_profile": "https://Stackoverflow.com/users/12389",
"pm_score": 3,
"selected": false,
"text": "http://<Site>/_vti_bin/"
},
{
"answer_id": 16188830,
"author": "DMEx38",
"author_id": 584142,
"author_p... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314258",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34088/"
] |
314,268 | <p>I have an application that needs to send a moderately high volume of messages between a number of AppDomains. I know that I could implement this using remoting, but I have also noticed that there are cross-domain delegates. Has anyone looked at this kind of problem?</p>
| [
{
"answer_id": 11071232,
"author": "notmii",
"author_id": 1260962,
"author_profile": "https://Stackoverflow.com/users/1260962",
"pm_score": 3,
"selected": false,
"text": "static void RunInChildDomain()\n{\n AppDomain childDomain = AppDomain.CreateDomain(\"friendlyName\");\n strin... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314268",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21686/"
] |
314,275 | <p>I am running a java program that sets up a database connection to an SQL database. It works fine on Mac OS X, but when I try to run the same code on Linux, I get a Exception in thread "main" java.lang.NoClassDefFoundError: java/sql/SQLClientInfoException.</p>
<p>I am using jdk-1.6.0_02 - if I unzip src.zip, it turns out that SQLClientInfoException.java is not contained therein.</p>
<p>Also, the API documentation shows that there are exactly two methods that use this exception, both in java.sql.Connection. However, if I look at both methods in the source code, both of them seem to throw the more general SQLException instead.</p>
<p>Is that a bug in my java version or am I doing something wrong?</p>
| [
{
"answer_id": 314325,
"author": "kgiannakakis",
"author_id": 24054,
"author_profile": "https://Stackoverflow.com/users/24054",
"pm_score": 2,
"selected": true,
"text": "jdk1.6.0_03"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/314275",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
314,277 | <p>I am getting an vba error 3271; Invalid property value. This happens when trying to append a memo field in a querydef. Any ideas on how to get around this?</p>
<p>Example:</p>
<pre><code>public sub TestMemoField
Dim qdf As QueryDef
Set qdf = CurrentDb.QueryDefs("AppendRecord")
qdf.Parameters("@SomeBigText").value = string(1000,"A")
qdf.Execute
end sub
</code></pre>
<p>Thanks in advance.</p>
| [
{
"answer_id": 314486,
"author": "Fionnuala",
"author_id": 2548,
"author_profile": "https://Stackoverflow.com/users/2548",
"pm_score": 2,
"selected": false,
"text": "qdf.SQL=\"INSERT INTO Sometable (SomeField) Values('\" & String(1000, \"A\") & \"')\"\n"
},
{
"answer_id": 316217,... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314277",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37797/"
] |
314,300 | <p>I would like to upload files from java application/applet using POST http event. I would like to avoid to use any library not included in SE, unless there is no other (feasible) option. <br>
So far I come up only with very simple solution. <br>
- Create String (Buffer) and fill it with compatible header (<a href="http://www.ietf.org/rfc/rfc1867.txt" rel="nofollow noreferrer">http://www.ietf.org/rfc/rfc1867.txt</a>)<br>
- Open connection to server URL.openConnection() and write content of this file to OutputStream. <br>
I also need to manually convert binary file into POST event. <br><br>
I hope there is some better, simpler way to do this?</p>
| [
{
"answer_id": 324046,
"author": "Alnitak",
"author_id": 6782,
"author_profile": "https://Stackoverflow.com/users/6782",
"pm_score": 3,
"selected": false,
"text": "java.net.URL"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/314300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40271/"
] |
314,301 | <p>I am creating a large table dynamically using Javascript.
I have realised the time taken to add a new row grows exponentially as the number of rows increase.</p>
<p>I suspect the Page is getting refreshed in each loop per row (I am also adding input elements of type text on each cell)</p>
<p>Is there a way to stop the page "refreshing" until I am done with the whole table?</p>
<p>Any suggestion on how to do this or go around it?</p>
<hr>
<p>I have tried all the suggestions above, but I am still getting the performance bottlenecks.</p>
<p>I tried to analyse line after line, and I have noted that document.getElementById() is one of the lines taking a lot of time to execute when the table is very large.
I am using getElementById() to dynamically access an HTML input of type text loaded on each cell of the table.</p>
<p>Any ideas on which DOM method I should use instead of getElementById()?</p>
| [
{
"answer_id": 314326,
"author": "Aleris",
"author_id": 20417,
"author_profile": "https://Stackoverflow.com/users/20417",
"pm_score": 2,
"selected": false,
"text": "var theTable = document.createElement(\"table\");\n// ... \n// add all the rows to theTable\n// ...\ndocument.body.appendCh... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314301",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13370/"
] |
314,305 | <p>I am using Oracle BPEL Process manager and have a task assigned to a group of users.
I try to mark it approved using Java class oracle.bpel.services.workflow.task.ITaskService.updateTaskOutcome(). This works if the task is assigned to an individual user, but if the task is assigned to a group of users, I get an error message about the task not being acquired. </p>
<p>If I acquire the task using oracle.bpel.services.workflow.task.ITaskService.acquireTask(), I get an error message when trying to mark it approved: "The task has been acquired by some other user".</p>
<p>Can anybody point to sample code that changes status of an Oracle BPEL task <em>assigned to a group</em> programmatically?</p>
| [
{
"answer_id": 1558200,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 1,
"selected": false,
"text": "updateTaskOutcomes()"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/314305",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9363/"
] |
314,307 | <p>I have two tables: a source table and a target table. The target table will have a subset of the columns of the source table. I need to update a single column in the target table by joining with the source table based on another column. The update statement is as follows:</p>
<pre><code>UPDATE target_table tt
SET special_id = ( SELECT source_special_id
FROM source_table st
WHERE tt.another_id = st.another_id )
</code></pre>
<p>For some reason, this statement seems to run indefinitely. The inner select happens almost immediately when executed by itself. The table has roughly 50,000 records and its hosted on a powerful machine (resources are not an issue). </p>
<p>Am I doing this correctly? Any reasons the above wouldn't work in a timely manner? Any better way to do this?</p>
| [
{
"answer_id": 314330,
"author": "Codewerks",
"author_id": 17729,
"author_profile": "https://Stackoverflow.com/users/17729",
"pm_score": 4,
"selected": true,
"text": "UPDATE target_table \nSET special_id = st.source_special_id\nFROM \n target_table tt\n INNER JOIN\n source_table... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20133/"
] |
314,313 | <p>I use Jasper reports with the <a href="http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/web/servlet/view/jasperreports/JasperReportsMultiFormatView.html" rel="nofollow noreferrer">JasperReportsMultiFormatView</a> class provided by the Spring framework. This class takes care of compiling the source .jrxml files to their compiled .jasper format when the Spring application context is created.</p>
<p>However, this compilation process is really slowing down the application startup time. Is it possible for the reports to be lazily compiled instead of compiled at startup time, i.e. a report is only compiled the first time it is requested?</p>
<p>If this is not possible, alternative suggestions for how I can reduce/eliminate the report compilation time would be welcome. Of course, I could mandate that the compiled reports must be checked into SVN along with the .jrxml files, but it's only a matter of time, before someone (most likely me) forgets.</p>
<p>Cheers,
Don</p>
| [
{
"answer_id": 14611708,
"author": "andrewps",
"author_id": 2022484,
"author_profile": "https://Stackoverflow.com/users/2022484",
"pm_score": 1,
"selected": false,
"text": "import net.sf.jasperreports.engine.JasperReport;\nimport org.apache.log4j.Logger;\nimport org.springframework.web.s... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2648/"
] |
314,314 | <p>I have a rather large (many gigabytes) table of data in SQL Server that I wish to move to a table in another database on the same server.</p>
<p>The tables are the same layout.</p>
<p>What would be the most effecient way of going about doing this?</p>
<p>This is a one off operation so no automation is required.</p>
<p>Many thanks.</p>
| [
{
"answer_id": 314338,
"author": "Tomalak",
"author_id": 18771,
"author_profile": "https://Stackoverflow.com/users/18771",
"pm_score": 4,
"selected": true,
"text": "SELECT * INTO OtherDatabase..NewTable FROM ThisDatabase..OldTable\n"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/314314",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/770/"
] |
314,321 | <p>I've looked this up a thousand times, and I always forget it, so, here for eternity:</p>
<p>Solaris has a bit of an awkward syntax for <code>tail</code>.</p>
<p>How do I do the equivalent of BSD's <code>tail -n<i>N</i></code>?</p>
<p>What I want are the last N lines from tail's input.</p>
| [
{
"answer_id": 314341,
"author": "Ulf Lindback",
"author_id": 30354,
"author_profile": "https://Stackoverflow.com/users/30354",
"pm_score": 5,
"selected": true,
"text": "tail -100\n"
},
{
"answer_id": 314367,
"author": "VonC",
"author_id": 6309,
"author_profile": "htt... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314321",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13989/"
] |
314,329 | <p>OK, this is my own fault, but I can't seem to rescue myself.</p>
<p>Whenever I try to step into a class that has fields with assignments calling into .NET code, I get a dialog box that contains the text "There is no source code available for the current location.":</p>
<p><img src="https://i.stack.imgur.com/3pfTr.png" alt="Screenshot of error message"></p>
<p>For instance, stepping into the constructor of the following class would give me the above message:</p>
<pre><code>public class Test
{
private Stack<String> _Dummy = new Stack<String>();
public Test() { }
}
</code></pre>
<p>I assume this is because at some point I fiddled with the settings for the symbol server, but no matter what I fiddle with now, I can't seem to get rid of that message.</p>
<p>Where has my stupidity forgotten what it did?</p>
<hr>
<p>Summary of my current <a href="https://stackoverflow.com/questions/4649093/visual-studio-2010-debugger-steps-over-methods-and-doesnt-stop-at-breakpoints/4649220#4649220">options</a>:</p>
<ul>
<li>[ ] Enable address-level debugging</li>
<li>[x] Enable Just My Code (Managed Only)</li>
<li>[ ] Enable .NET framework source stepping</li>
<li>[ ] Enable source server support</li>
<li>Symbol file .pdb locations - empty</li>
<li>Cache symbols from symbol servers to this directory: C:\temp (empty)</li>
</ul>
| [
{
"answer_id": 10750386,
"author": "psur",
"author_id": 1113539,
"author_profile": "https://Stackoverflow.com/users/1113539",
"pm_score": 2,
"selected": false,
"text": "main"
},
{
"answer_id": 21388966,
"author": "Peter Mortensen",
"author_id": 63550,
"author_profile"... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267/"
] |
314,332 | <p>Which is a better way to force GC on ThreadLocal instance?</p>
| [
{
"answer_id": 314785,
"author": "James Van Huis",
"author_id": 31828,
"author_profile": "https://Stackoverflow.com/users/31828",
"pm_score": 2,
"selected": false,
"text": "System.gc();\n"
},
{
"answer_id": 6915168,
"author": "shams",
"author_id": 356645,
"author_prof... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26365/"
] |
314,334 | <p>Say I have a file with any number of lines, say, 125. I want to get all the lines except the first n, say, 20. So, I want lines 21–125.</p>
<p>Is there a way to do this with with <code>tail</code>/<code>head</code>, or some other tool?</p>
| [
{
"answer_id": 314352,
"author": "unwind",
"author_id": 28169,
"author_profile": "https://Stackoverflow.com/users/28169",
"pm_score": 6,
"selected": true,
"text": "tail -n +21 myfile.txt\n"
},
{
"answer_id": 314362,
"author": "Johannes Schaub - litb",
"author_id": 34509,
... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314334",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13989/"
] |
314,336 | <p>How to generate the Symbols file of a PowerBuilder program for dump analysis?</p>
| [
{
"answer_id": 314352,
"author": "unwind",
"author_id": 28169,
"author_profile": "https://Stackoverflow.com/users/28169",
"pm_score": 6,
"selected": true,
"text": "tail -n +21 myfile.txt\n"
},
{
"answer_id": 314362,
"author": "Johannes Schaub - litb",
"author_id": 34509,
... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314336",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1100/"
] |
314,357 | <p>I am using an Infragistics UltraGrid in a WinForms application.<br>
Which event is raised on "check change" of checkbox in Infragistics UltraGrid?</p>
| [
{
"answer_id": 314378,
"author": "Kevin Fairchild",
"author_id": 3743,
"author_profile": "https://Stackoverflow.com/users/3743",
"pm_score": 3,
"selected": true,
"text": "Private Sub YourGridcontrol_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34588/"
] |
314,382 | <p>My application is pretty simple: it starts up with a view controller that holds a table view (in grouped view layout) with a few options. When the user taps on one of the options, I push another view controller onto my navigation controller.</p>
<p>This second view controller simply displays a UIImageView, and the user can change the screen orientation on this view controller between portrait/landscape modes. This works just fine, and all is happy.</p>
<p>However, if the user taps on the "Back" button on my navigation bar while on the landscape mode, the first controller's layout is all messed up. See below for before/after screenshots:</p>
<p><a href="https://i.stack.imgur.com/HCftn.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HCftn.jpg" alt="before"></a><br>
<sub>(source: <a href="http://pessoal.org/shot1.jpg" rel="nofollow noreferrer">pessoal.org</a>)</sub><br>
<a href="https://i.stack.imgur.com/D0qzp.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D0qzp.jpg" alt="after"></a><br>
<sub>(source: <a href="http://pessoal.org/shot2.jpg" rel="nofollow noreferrer">pessoal.org</a>)</sub> </p>
<p>Any clues on how to force the first view controller (second screenshot in this post) to stay within the portrait screen orientation?</p>
| [
{
"answer_id": 431974,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{\n // don't let user press \"bac... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35478/"
] |
314,384 | <p>How do you parse a CSV file using gawk? Simply setting <code>FS=","</code> is not enough, as a quoted field with a comma inside will be treated as multiple fields.</p>
<p>Example using <code>FS=","</code> which does not work:</p>
<p>file contents:</p>
<pre><code>one,two,"three, four",five
"six, seven",eight,"nine"
</code></pre>
<p>gawk script:</p>
<pre><code>BEGIN { FS="," }
{
for (i=1; i<=NF; i++) printf "field #%d: %s\n", i, $(i)
printf "---------------------------\n"
}
</code></pre>
<p>bad output:</p>
<pre><code>field #1: one
field #2: two
field #3: "three
field #4: four"
field #5: five
---------------------------
field #1: "six
field #2: seven"
field #3: eight
field #4: "nine"
---------------------------
</code></pre>
<p>desired output:</p>
<pre><code>field #1: one
field #2: two
field #3: "three, four"
field #4: five
---------------------------
field #1: "six, seven"
field #2: eight
field #3: "nine"
---------------------------
</code></pre>
| [
{
"answer_id": 314421,
"author": "MCS",
"author_id": 1094969,
"author_profile": "https://Stackoverflow.com/users/1094969",
"pm_score": 0,
"selected": false,
"text": "BEGIN { FS=\",\" }\n{\n for (i=1; i<=NF; i++) {\n f[++n] = $i\n if (substr(f[n],1,1)==\"\\\"\") {\n while (sub... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1094969/"
] |
314,397 | <p>More detail to my question:</p>
<p>HTML and JavaScript are called "client-side code".</p>
<p>C# and VB in the code behind files are termed "server-side code".</p>
<p>So what is inline-asp, and 'runat=server' code blocks called?</p>
<pre><code><!-- This is called "client-side" -->
<p>Hello World</p>
<script>alert("Hello World");</script>
</code></pre>
<p>...</p>
<pre><code>// This is called "server-side"
public void Page_Load(object sender, EventArgs e)
{
Response.Write("Hello World");
}
</code></pre>
<p>...</p>
<pre><code><%-- What is this called ??? --%>
<asp:Label ID="MyLabel" runat="server" />
<% Response.Write("Hello World"); %>
</code></pre>
<p>The best term I can come up with is "Web Forms Code".</p>
| [
{
"answer_id": 314420,
"author": "Joel Coehoorn",
"author_id": 3043,
"author_profile": "https://Stackoverflow.com/users/3043",
"pm_score": 0,
"selected": false,
"text": "<% %>"
},
{
"answer_id": 314434,
"author": "Mark Cidade",
"author_id": 1659,
"author_profile": "ht... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314397",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11917/"
] |
314,401 | <p>What is the simplest way to read a full line in a C console program
The text entered might have a variable length and we can't make any assumption about its content.</p>
| [
{
"answer_id": 314422,
"author": "Johannes Schaub - litb",
"author_id": 34509,
"author_profile": "https://Stackoverflow.com/users/34509",
"pm_score": 8,
"selected": true,
"text": "fgets"
},
{
"answer_id": 314427,
"author": "Paul Kapustin",
"author_id": 38325,
"author_... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314401",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2011/"
] |
314,408 | <p>I am building a Facebook App which is heavy on Javascript. For this I have multiple Javascript files. Since in Facebook development, the page is served over a tunnel, there is excessive latency added while requesting multiple javascript files. Is it possible to combine the contents of multiple javascript files at runtime? Having multiple files makes it easy to develop, and hence I am avoiding having to combine it while development itself.</p>
| [
{
"answer_id": 314462,
"author": "John Topley",
"author_id": 1450,
"author_profile": "https://Stackoverflow.com/users/1450",
"pm_score": 4,
"selected": false,
"text": ":cache"
},
{
"answer_id": 14175203,
"author": "Kristian",
"author_id": 680578,
"author_profile": "ht... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29653/"
] |
314,412 | <p>If you were to build a badge system similiar to how SO does it, would you put the logic/business layer in the database directly (via stored procedure, scheduled sql jobs) or put it in the server side?</p>
<p>From what I can think of, you have to:</p>
<ol>
<li>list badges that pertain to the current user action</li>
<li>check if the user has a badge already or not</li>
<li>insert badge for user </li>
</ol>
<p><b>Potential options</b></p>
<ol>
<li>business logic in the web application that calls stored procedures etc.</li>
<li>stored procedures ONLY</li>
<li>sql server job that runs every x minutes</li>
<li>windows service that runs every x minutes</li>
</ol>
<p>Would a combination of these be required? I think it would since some badges are based on milestones for a given question, maybe a batch job is better?</p>
<p><b>Update</b></p>
<p>A system where you can modify the badge system, then re-run the entire badge linking for everyone would be even better. i.e. say you change the logic for some badges, now you have to re-apply it to all the questions/answers/votes/etc.</p>
<p><b>interesting problem to solve!!</b></p>
| [
{
"answer_id": 314453,
"author": "Tony Andrews",
"author_id": 18747,
"author_profile": "https://Stackoverflow.com/users/18747",
"pm_score": 1,
"selected": false,
"text": "IF eligible for <new badge> THEN\n INSERT INTO user_badges\n SELECT <new_badge>\n WHERE NOT EXISTS (SELECT N... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314412",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39677/"
] |
314,415 | <p>Why use a GlobalClass? What are they for? I have inherited some code (shown below) and as far as I can see there is no reason why strUserName needs this. What is all for?</p>
<pre><code>public static string strUserName
{
get { return m_globalVar; }
set { m_globalVar = value; }
}
</code></pre>
<p>Used later as:</p>
<pre><code>GlobalClass.strUserName
</code></pre>
<p>Thanks</p>
| [
{
"answer_id": 314429,
"author": "mmx",
"author_id": 33708,
"author_profile": "https://Stackoverflow.com/users/33708",
"pm_score": 0,
"selected": false,
"text": "ClassName.MemberName"
}
] | 2008/11/24 | [
"https://Stackoverflow.com/questions/314415",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
314,423 | <p>I've been tasked with integration testing of a large system. Presently, I have a COM dll that I'm testing useing a UI that I created that kicks off a series of unit tests that call into the dll. This works, but I'm wanting to migrate this over to MbUnit. When I start the first test in MbUnit, it seems to hang at "Found 1 tests". I end up having to close the IDE. Could someone please point me in the right direction?</p>
<p>Thanks.</p>
| [
{
"answer_id": 448702,
"author": "Craigger",
"author_id": 18924,
"author_profile": "https://Stackoverflow.com/users/18924",
"pm_score": 1,
"selected": false,
"text": "namespace UnitTest\n{\n class Program\n {\n static void Main(string[] args_)\n {\n // run unit test\n A... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314423",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
314,424 | <p>I have a report reading records out of a DMS system and I thought it would be nice to have a link to the documents that it is listing so that the users could view the actual documents. </p>
<p>However when it displays a Word doc it allows you to make changes and then save them, which rather undermines the DMS system. </p>
<p>I don't think there is a parameter (/r) in Word that does this so do any of you clever people out there have a solution please?</p>
| [
{
"answer_id": 448702,
"author": "Craigger",
"author_id": 18924,
"author_profile": "https://Stackoverflow.com/users/18924",
"pm_score": 1,
"selected": false,
"text": "namespace UnitTest\n{\n class Program\n {\n static void Main(string[] args_)\n {\n // run unit test\n A... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314424",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
314,426 | <p>How can I go through each of the properties in my custom object? It is not a collection object, but is there something like this for non-collection objects?</p>
<pre><code>For Each entry as String in myObject
' Do stuff here...
Next
</code></pre>
<p>There are string, integer and boolean properties in my object.</p>
| [
{
"answer_id": 314436,
"author": "Ali Ersöz",
"author_id": 4215,
"author_profile": "https://Stackoverflow.com/users/4215",
"pm_score": 7,
"selected": true,
"text": "PropertyInfo[] propertyInfo = myobject.GetType().GetProperties();\n"
},
{
"answer_id": 314443,
"author": "Charl... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25515/"
] |
314,432 | <p>I am using Visual Studio 2005 and StarTeam 2008 (cross-platform client and VS integration). At some point, I added an 'App.config' to a project. I notice now that this file will not check-in.</p>
<ol>
<li><p>The 'StarTeam Pending Checkins' window in VS reports the file 'Not in View'. Selecting it for check in and clicking 'Check In Files' causes a dialog to appear - 'Any operation... requires completing the pending renames/deletes'. I click 'Yes' to proceed and nothing happens.</p></li>
<li><p>The StarTeam client reports this file as 'Modified'. If I check-in from the client, I get no 'complete pending renames/deletes' dialog and the file quickly appears with a 'Current' status.</p></li>
<li><p>Refreshing StarTeam from VS, I still see the file as 'Not in View'.</p></li>
</ol>
<p>I have tried forcing the check-in. I completely removed my working files and pulled the solution fresh in hopes that the StarTeam status ('Current') would apply in VS.</p>
| [
{
"answer_id": 314436,
"author": "Ali Ersöz",
"author_id": 4215,
"author_profile": "https://Stackoverflow.com/users/4215",
"pm_score": 7,
"selected": true,
"text": "PropertyInfo[] propertyInfo = myobject.GetType().GetProperties();\n"
},
{
"answer_id": 314443,
"author": "Charl... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3619/"
] |
314,433 | <p>If you call a web service from Silverlight like this:</p>
<pre><code>MyServiceClient serviceClient = new MyServiceClient();
void MyMethod()
{
serviceClient.GetDataCompleted += new EventHandler<GetDataCompletedEventArgs>(serviceClient_GetDataCompleted);
serviceClient.GetDataAsync();
// HOW DO I WAIT/JOIN HERE ON THE ASYNC CALL, RATHER THAN BEING FORCE TO LEAVE THIS METHOD?
}
</code></pre>
<p>I would rather wait/join with the asych service thread inside "MyMethod" rather than leaving "MyMethod" after calling "GetDataAsync", what is the best way to do this?</p>
<p>Thanks,
Jeff</p>
| [
{
"answer_id": 314854,
"author": "Bryant",
"author_id": 10893,
"author_profile": "https://Stackoverflow.com/users/10893",
"pm_score": 1,
"selected": true,
"text": "void MyMethod()\n{\n wait = new ManualResetEvent(false);\n // call your service\n wait.WaitOne();\n // finish working\n}... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314433",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12172/"
] |
314,437 | <p>I have a list of images that i’ve loaded with the Loader class, but I’m having a tough time assigning them unique names.
I need unique names because I want to remove certain images after a while.
Is there a way to assign loaders a name or some unique tag so i can remove them later? thanks.</p>
<p>Here's part of my code</p>
<pre><code>for (var i = startnum; i < endnum; i++){
var thumb = panels[i].@THUMB;
var thumb_loader = new Loader();
thumb_loader.load(new URLRequest(thumb));
thumb_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded);
thumb_loader.name = i;
thumb_loader.x = (thumb_width + 20)*i;
}
</code></pre>
<p>I tried to use getChildByName in another function..</p>
<pre><code>var myLoader:Loader = getChildByName( "1" ) as Loader;
myLoader.unload();
</code></pre>
<p>But it's giving me
Error #1009: Cannot access a property or method of a null object reference.</p>
<p>I tried to put thumb_loader as global variable, and do this</p>
<pre><code>var myLoader:Loader = thumb_loader.getChildByName( "1" ) as Loader;
</code></pre>
<p>But it's still not working.
Thanks.</p>
| [
{
"answer_id": 314476,
"author": "Simon",
"author_id": 24039,
"author_profile": "https://Stackoverflow.com/users/24039",
"pm_score": 0,
"selected": false,
"text": "var img:Image;\nvar img_map:Object = new Object();\nvar last_added:int = 0;\nfor each (img in yourListOfImages)\n{\n img_... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34797/"
] |
314,457 | <p>Usually, I've seen it with forms, but I've found it helpful to group related sets of data (eg when you have multiple tables on a page, using a fieldset around each table or group of related tables to define a visible meaning and a group name (legend)). Is this abusing the fieldset tag to the point where, in my uses, it no longer has semantic meaning?</p>
| [
{
"answer_id": 314496,
"author": "VonC",
"author_id": 6309,
"author_profile": "https://Stackoverflow.com/users/6309",
"pm_score": 2,
"selected": false,
"text": ".fieldset {\nborder-right: 1px solid #75736E;\nborder-bottom: 1px solid #75736E;\nborder-left: 1px solid #F2F0EE;\nborder-top: ... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/572/"
] |
314,459 | <p>I´m using <code>Transaction Binding=Explicit Unbind</code> in the connection string as recommended <a href="http://weblogs.asp.net/ryangaraygay/archive/2008/04/14/issue-with-system-transactions-sqlconnection-and-timeout.aspx" rel="noreferrer">here</a> since I´m also using TransactionScope with timeout. The problem is that the connections does not seem to close after being disposed and eventually there are no more connections available in the connection pool. I got the same result when I modified the TransactionTimeoutIssueDemo (see the link) and ran TransactionScopeTest() (with the explicit unbind connection string) enough times in a loop to use up all available connections in the connection pool. Default value for connections in the pool is 100 but this can be changed by using the setting <code>Max Pool Size =10</code> for instance. It seems that the connections will not be released when using explicit unbind even though both the SqlConnection and the TransactionScope are used with the <code>using</code> clause. Anyone know how to handle this?</p>
| [
{
"answer_id": 315109,
"author": "Magnus Lindhe",
"author_id": 966,
"author_profile": "https://Stackoverflow.com/users/966",
"pm_score": 3,
"selected": true,
"text": "using (SqlConnection con = new SqlConnection(connectionString))\n{\n con.Open();\n try\n {\n Console.Writ... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314459",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30790/"
] |
314,463 | <p>In Team Build 2008, the Drop Location for a build is no longer specified in the .proj file, and instead is stored in the database and maintained in the GUI tool.</p>
<p>The GUI tool only accepts a network path as a drop location (i.e. \\server\share) and will not accept a local path.</p>
<p>Our build server also hosts the dropped files, so it seems that forcing a file copy operation to go through the network share introduces a lot of lag time when copying a large number of files. I would like to override this feature so that I can specify a local directory for drop location, but I can't figure out how.</p>
| [
{
"answer_id": 315109,
"author": "Magnus Lindhe",
"author_id": 966,
"author_profile": "https://Stackoverflow.com/users/966",
"pm_score": 3,
"selected": true,
"text": "using (SqlConnection con = new SqlConnection(connectionString))\n{\n con.Open();\n try\n {\n Console.Writ... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34409/"
] |
314,465 | <p>I have a MasterPage and a Content Page</p>
<p>My Content Page has a number of controls, - dropdownlist, text boxes, radio buttons.</p>
<p>I want to loop through all the control and if its one of the controls above then i want to obtain the selectedvalue, text etc</p>
<p>I know I can access the control directly by name, but as this is my learning experience on asp.net, I want to be able to go through the Controls collection</p>
<p>I tried</p>
<pre><code>foreach(Controls ctrl in Master.Controls)
{
}
</code></pre>
<p>but I wasnt able to get to the controls I needed.</p>
<p>Edit:: I guess i drew the gun a bit too quick as my intellisense kept failing on me. I solved my issue with this in code behind on my content page</p>
<pre><code>protected void btnSearch_Click(object sender, EventArgs e)
{
foreach (Control ctrl in Master.Controls)
{
if (ctrl is HtmlForm)
{
foreach(Control formControl in ctrl.Controls)
{
if (formControl is ContentPlaceHolder)
{
foreach (Control placeHolderControl in formControl.Controls)
{
if (placeHolderControl is DropDownList)
{
string test = "AA";
}
}
}
}
}
}
}
</code></pre>
<p>Now to build a recursive routine</p>
| [
{
"answer_id": 314548,
"author": "AlexCuse",
"author_id": 794,
"author_profile": "https://Stackoverflow.com/users/794",
"pm_score": 0,
"selected": false,
"text": "foreach (Control c in ContentPlaceHolder1.Controls)\n{\n Response.Write(c.ID );\n}\n"
},
{
"answer_id": 314559,
... | 2008/11/24 | [
"https://Stackoverflow.com/questions/314465",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38230/"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.