qid int64 4 22.2M | question stringlengths 18 48.3k | answers list | date stringlengths 10 10 | metadata list |
|---|---|---|---|---|
301,528 | <p>I've got this date time string:</p>
<pre><code>post["date"] = "2007-07-18 10:03:19"
</code></pre>
<p>I'd like to extract just "2007-07-18" as a date. I've seen some reference to <code>strptime</code> but I'm not sure how to use it. How can I extract the date from this string?</p>
| [
{
"answer_id": 301537,
"author": "gimel",
"author_id": 6491,
"author_profile": "https://Stackoverflow.com/users/6491",
"pm_score": 3,
"selected": false,
"text": ">>> d1=\"2007-07-18 10:03:19\"\n>>> d1.split()[0]\n'2007-07-18'\n>>> \n"
},
{
"answer_id": 301542,
"author": "Ashy... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301528",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16974/"
] |
301,532 | <p>I'm using the <a href="http://www.microsoft.com/unlimitedpotential/programs/multipoint.mspx" rel="nofollow noreferrer">MultiPoint</a> SDK to create a collaborative educational application for children in less affluent countries, where there is not one computer for each student in the classroom.</p>
<p>Because we need to support up to 40 mice connected to one computer, we need an automated way to test our software. The SDK will support as many mice that it can find on the system and detects when mice are added and removed. Each mouse appears as a 'virtual' mouse pointer within a WPF window. Each child has independent control of 'their' pointer on the screen.</p>
<p>We would like to create a test harness that tricks Windows into thinking that it has more than one mouse. The harness would need to create these fake devices (40+) and use them to send mouse messages like move, button down, etc</p>
<p>Any help would be greatly appreciated.</p>
| [
{
"answer_id": 302221,
"author": "Sunlight",
"author_id": 33650,
"author_profile": "https://Stackoverflow.com/users/33650",
"pm_score": 2,
"selected": true,
"text": "DeviceIoControl"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/301532",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21606/"
] |
301,536 | <p><strong>PHP has a <a href="http://php.net/var_dump" rel="noreferrer">var_dump()</a> function which outputs the internal contents of an object, showing an object's type and content.</strong></p>
<p>For example:</p>
<pre><code>class Person {
private $firstName;
private $lastName;
public function __construct($firstName, $lastName) {
$this->firstName = $firstName;
$this->lastName = $lastName;
}
}
$person = new Person('Jon', 'Smith');
var_dump($person);
</code></pre>
<p>will output:</p>
<pre><code>object(Person)#1 (2) {
["firstName:private"]=>
string(3) "Jon"
["lastName:private"]=>
string(5) "Smith"
}
</code></pre>
<p><strong>What is the equivalent in Java that will do the same?</strong></p>
| [
{
"answer_id": 301575,
"author": "serg10",
"author_id": 1853,
"author_profile": "https://Stackoverflow.com/users/1853",
"pm_score": 7,
"selected": true,
"text": "toString"
},
{
"answer_id": 301581,
"author": "Harry Lime",
"author_id": 21590,
"author_profile": "https:/... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301536",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5343/"
] |
301,544 | <p>I have this SQL query:</p>
<pre><code>SELECT * FROM IMAGES WHERE
IMAGENAME in ('IMG1', 'IMG2', 'IMG3', 'IMG4', 'IMG5', 'IMG6')
ORDER BY CASE IMAGENAME
WHEN 'IMG1' THEN 1
WHEN 'IMG2' THEN 2
WHEN 'IMG3' THEN 3
WHEN 'IMG4' THEN 4
WHEN 'IMG5' THEN 5
WHEN 'IMG6' THEN 6
ELSE 7
END
</code></pre>
<p>I cannot guarantee that the list of IMAGENAMEs will be in alphabetical order, hence the case statement, but I would prefer to sort in the DB rather than in code because I trust their sorting code better than mine :)</p>
<p>SQL server analyses that 78% of the execution time is spent sorting - can I reduce this?</p>
<p>It needs to be fairly vanilla SQL as we target SQL Server and Oracle.</p>
<p>Any tuning advice would be fantastic.</p>
| [
{
"answer_id": 301596,
"author": "Andrew",
"author_id": 5662,
"author_profile": "https://Stackoverflow.com/users/5662",
"pm_score": 0,
"selected": false,
"text": "IMG"
},
{
"answer_id": 301601,
"author": "Tom Haigh",
"author_id": 22224,
"author_profile": "https://Stac... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301544",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38883/"
] |
301,546 | <p>There's a web services I want to call in my application, I can use it with importing the WSDL or by just use "HTTP GET" with the URL and parameters, so I prefer the later because it's simple thing.</p>
<p>I know I can use indy idhttp.get, to do the job, but this is very simple thing and I don't want to add complex indy code to my application.</p>
<p><strong>UPDATE</strong>: sorry if I was not clear, I meant by "not to add complex indy code", that I don't want add indy components for just this simple task, and prefer more lighter way for that.</p>
| [
{
"answer_id": 301598,
"author": "Bruce McGee",
"author_id": 19183,
"author_profile": "https://Stackoverflow.com/users/19183",
"pm_score": 5,
"selected": false,
"text": "function GetURLAsString(const aURL: string): string;\nvar\n lHTTP: TIdHTTP;\nbegin\n lHTTP := TIdHTTP.Create;\n try... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301546",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24462/"
] |
301,551 | <p>If I'm using ConcurrentHashMap (where the put is thread safe) , and I supply a public function myPut that uses the ConcurrentHashMap put - do I need to synchronize my function? </p>
<p>meaning : should this be synchronized?</p>
<pre><code>ConcurrentHashMap map;
public void myPut(int something) {
this.map.put(something);
}
</code></pre>
| [
{
"answer_id": 301816,
"author": "Bill Michell",
"author_id": 7938,
"author_profile": "https://Stackoverflow.com/users/7938",
"pm_score": 0,
"selected": false,
"text": "ConcurrentHashMap"
},
{
"answer_id": 302201,
"author": "Tom Hawtin - tackline",
"author_id": 4725,
... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301551",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4038/"
] |
301,552 | <p>Is it possible (by using the stock c# TreeView) to have Multiline TreeNodes? </p>
<p>Also, is it possible to add control characters to TreeNode's text e.g. '\t'? This same effect could also be achieved by adding columns to the TreeNode. is this possible?</p>
| [
{
"answer_id": 43540335,
"author": "Simon Philipp Schmidt",
"author_id": 6508198,
"author_profile": "https://Stackoverflow.com/users/6508198",
"pm_score": 0,
"selected": false,
"text": "mynode.NodeFont = new System.Drawing.Font(\"Consolas\", 9,FontStyle.Regular);\n\nstring displaytext = ... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301552",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1816/"
] |
301,555 | <p>The 'attach to process' dialogue box on VC6 running on win 2003 (I believe vista as well) has no processes to attach to in it... I've tried logging on as an administrator and running as an administrator but no luck. Any other ideas?</p>
| [
{
"answer_id": 43540335,
"author": "Simon Philipp Schmidt",
"author_id": 6508198,
"author_profile": "https://Stackoverflow.com/users/6508198",
"pm_score": 0,
"selected": false,
"text": "mynode.NodeFont = new System.Drawing.Font(\"Consolas\", 9,FontStyle.Regular);\n\nstring displaytext = ... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301555",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38892/"
] |
301,563 | <p>Whats this syntax useful for : </p>
<pre><code> function(String... args)
</code></pre>
<p>Is this same as writing </p>
<pre><code> function(String[] args)
</code></pre>
<p>with difference only while invoking this method or is there any other feature involved with it ?</p>
| [
{
"answer_id": 301599,
"author": "bruno conde",
"author_id": 31136,
"author_profile": "https://Stackoverflow.com/users/31136",
"pm_score": 8,
"selected": true,
"text": "public static void main(String[] args) {\n callMe1(new String[] {\"a\", \"b\", \"c\"});\n callMe2(\"a\", \"b\", \... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301563",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11614/"
] |
301,566 | <p>I am having a postgres production database in production (which contains a lot of Data). now I need to modify the model of the tg-app to add couple of new tables to the database. </p>
<p>How do i do this? I am using sqlAlchemy.</p>
| [
{
"answer_id": 301706,
"author": "EoghanM",
"author_id": 6691,
"author_profile": "https://Stackoverflow.com/users/6691",
"pm_score": 0,
"selected": false,
"text": "tg-admin sql create\n"
},
{
"answer_id": 390485,
"author": "James Brady",
"author_id": 29903,
"author_pr... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2220518/"
] |
301,577 | <p>I wrote a simple add-in for Visual Studio 2008 that opens a dockable window pane. </p>
<p><a href="http://www.codeplex.com/ora" rel="noreferrer">You can download the source and a binary installer by clicking here.</a></p>
<p>The nature of the add-in means that it is ideally going to stay docked next to where you edit your source. But sometimes, on some installs, it won't stay docked. You run VS, you dock my pane, you shutdown VS, you restart VS, and dang it - the pane is floating again. On some machines I have to re-dock it every time.</p>
<p>But on other installs it stays docked wherever I put it forever. I originally thought it might be a difference between Vista and XP but now I have reports of it coming unstuck on XP as well.</p>
<p>From what I've read (and the fact that it sometimes stays docked) I get the impression that VS is supposed to take care of saving the docking state for me. But it isn't doing that. And yet other plugins on the same VS install don't have this problem. So there has to be something I can do to improve the situation.</p>
<p>I suspect the only relevant part of my code is this:</p>
<pre><code>public class Connect : IDTExtensibility2
{
private static DTE2 _applicationObject;
private AddIn _addInInstance;
private static CodeModelEvents _codeModelEvents;
public static DTE2 VisualStudioApplication
{
get { return _applicationObject; }
}
public static CodeModelEvents CodeModelEvents
{
get { return _codeModelEvents; }
}
public static event EventHandler SourceChanged = delegate { };
public void OnConnection(object application,
ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
_applicationObject = (DTE2)application;
_addInInstance = (AddIn)addInInst;
}
public void OnStartupComplete(ref Array custom)
{
try
{
Events2 events = (Events2)_applicationObject.Events;
_codeModelEvents = events.get_CodeModelEvents(null);
object objTemp = null;
Windows2 toolWins = (Windows2)_applicationObject.Windows;
Window toolWin = toolWins.CreateToolWindow2(
_addInInstance, GetType().Assembly.Location, "Ora.OraPane", "Ora",
"{DC8A399C-D9B3-40f9-90E2-EAA16F0FBF94}", ref objTemp);
toolWin.Visible = true;
}
catch (Exception ex)
{
MessageBox.Show("Exception: " + ex.Message);
}
}
public void OnBeginShutdown(ref Array custom) { }
public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom) { }
public void OnAddInsUpdate(ref Array custom) { }
}
</code></pre>
<p>(The MSDN docs suggest that the window should be created in OnConnection, but if I do that then the window mostly doesn't appear.)</p>
| [
{
"answer_id": 313046,
"author": "JB Brown",
"author_id": 21360,
"author_profile": "https://Stackoverflow.com/users/21360",
"pm_score": 4,
"selected": true,
"text": "EnvDTE80.Window2 frame = toolWins.CreateLinkedWindowFrame(toolWin, toolWin, vsLinkedWindowType.vsLinkedWindowTypeTabbed);\... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301577",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27423/"
] |
301,579 | <p>I have created a windows installer for a windows forms app as an MSI.
I have published this and put it in a zip file and sent it to the client.
When they try to run the installer they get the message
'The publisher could not be verified. Are you sure you want to run this software?’</p>
<p>Is there a setting or something i need to do to stop this message appearing when the client clicks on the installer?</p>
<p>Cheers</p>
| [
{
"answer_id": 301609,
"author": "Pablo Retyk",
"author_id": 30729,
"author_profile": "https://Stackoverflow.com/users/30729",
"pm_score": 1,
"selected": false,
"text": "signtool"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/301579",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35441/"
] |
301,586 | <p>What is the difference between using <code>#include<filename> and #include<filename.h</code>> in <a href="http://en.wikipedia.org/wiki/C%2B%2B" rel="noreferrer">C++</a>? Which of the two is used and why is it is used?</p>
| [
{
"answer_id": 301589,
"author": "Robert Gould",
"author_id": 15124,
"author_profile": "https://Stackoverflow.com/users/15124",
"pm_score": 2,
"selected": false,
"text": "#include< header >\n//my code\n"
},
{
"answer_id": 301600,
"author": "CAdaker",
"author_id": 30579,
... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301586",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22076/"
] |
301,590 | <p>I have a few longtables that stretch several pages and I want to use pageref and hyperref to link to these rows.</p>
<p>But whatever I try, the links always refer to the start of the table.
When I look into the aux file, the labels all seem to be re-defined into table.[number of table].</p>
<p>I tried putting invisible dummy figures into the table, but that just gives me errors of too many floats.</p>
<p>I also tried putting the labels into minipages, to no avail.</p>
<p>Even putting the labels into footnotes doesn't work, somehow longtable always seems to get to them.</p>
| [
{
"answer_id": 919492,
"author": "heeen",
"author_id": 38893,
"author_profile": "https://Stackoverflow.com/users/38893",
"pm_score": 3,
"selected": true,
"text": "\\newcounter{mycounter}\n\\newcommand{\\mylabel}[1]{\\refstepcounter{mycounter} \\label{#1}}\n"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/301590",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38893/"
] |
301,604 | <p>How to create a WCF application without using the svcutil.exe tool?</p>
| [
{
"answer_id": 310898,
"author": "Jeremy Wiebe",
"author_id": 11807,
"author_profile": "https://Stackoverflow.com/users/11807",
"pm_score": 3,
"selected": false,
"text": "var factory = new ChannelFactory<IMyWcfService>();\nvar wcfClient = factory.CreateChannel();\nbool closedSuccessfully... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
301,613 | <p>I'm using Visual Studio 2008 and I want to automate the process of building the installer by running a batch file.</p>
<p>The batch file should first sign the assemblies and than start the building of the installer. After the installer is created the batch file should sign the <code>.msi</code> file too.</p>
<p>Is this possible? </p>
| [
{
"answer_id": 310898,
"author": "Jeremy Wiebe",
"author_id": 11807,
"author_profile": "https://Stackoverflow.com/users/11807",
"pm_score": 3,
"selected": false,
"text": "var factory = new ChannelFactory<IMyWcfService>();\nvar wcfClient = factory.CreateChannel();\nbool closedSuccessfully... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301613",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
301,622 | <p>I found this in the code I'm working on at the moment and thought it was the cause of some problems I'm having.</p>
<p>In a header somewhere:</p>
<pre><code>enum SpecificIndexes{
//snip
INVALID_INDEX = -1
};
</code></pre>
<p>Then later - initialization:</p>
<pre><code>nextIndex = INVALID_INDEX;
</code></pre>
<p>and use</p>
<pre><code>if(nextIndex != INVALID_INDEX)
{
//do stuff
}
</code></pre>
<p>Debugging the code, the values in nextIndex didn't quite make sence (they were very large), and I found that it was declared:</p>
<pre><code>unsigned int nextIndex;
</code></pre>
<p>So, the initial setting to INVALID_INDEX was underflowing the unsigned int and setting it to a huge number. I assumed that was what was causing the problem, but looking more closely, the test</p>
<pre><code>if(nextIndex != INVALID_INDEX)
</code></pre>
<p>Was behaving correctly, i.e, it never executed the body of the if when nextIndex was the "large +ve value".</p>
<p>Is this correct? How is this happening? Is the enum value being implicitly cast to an unsigned int of the same type as the variable, and hence being wrapped in the same way?</p>
| [
{
"answer_id": 301657,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "unsigned int nextIndex;\n"
},
{
"answer_id": 308693,
"author": "Steve Jessop",
"author_id": 13005,
"author... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15667/"
] |
301,624 | <p>I'm trying to load spring beans using XmlWebApplicationContext setConfigLocations method. However, I keep getting a </p>
<pre><code>BeanIsAbstractException
</code></pre>
<p>I know that the bean is abstract, I have it configured this way, so Spring should know not to try to instantiate it.</p>
<p>I'm using Spring2.0.8.jar with jetspeed2.1.</p>
<p>Spring bean:</p>
<pre><code><bean id="ThreadPool" abstract="true" class="com.sample.ThreadPoolFactoryBean"/>
</code></pre>
<p>Code:</p>
<pre><code>ctx = appContext;
appContext.refresh();
BeanFactory factory = appContext.getBeanFactory();
String[] beansName = appContext.getBeanFactory()
.getBeanDefinitionNames();
...
map.put(beansName[mnCnt], factory.getBean(beansName[mnCnt]));
</code></pre>
<p>Anyone have any ideas?</p>
| [
{
"answer_id": 301645,
"author": "toolkit",
"author_id": 3295,
"author_profile": "https://Stackoverflow.com/users/3295",
"pm_score": 2,
"selected": false,
"text": "map.put(beansName[mnCnt], factory.getBean(beansName[mnCnt]));\n"
},
{
"answer_id": 301654,
"author": "cdugga",
... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301624",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24481/"
] |
301,637 | <p>I need to perform a HTTP GET from PHP. </p>
<p>More specifically, from within /index.php I need to get the content of /trac/ and /svn/, find the "ul" element and then render then inline on the index.php.</p>
<p>/trac and /svn are relative URLs and not filesystem folders.
<a href="http://myserver/trac" rel="nofollow noreferrer">http://myserver/trac</a> and <a href="http://myserver/svn" rel="nofollow noreferrer">http://myserver/svn</a></p>
| [
{
"answer_id": 301664,
"author": "Greg",
"author_id": 24181,
"author_profile": "https://Stackoverflow.com/users/24181",
"pm_score": 4,
"selected": true,
"text": "file_get_contents()"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/301637",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29075/"
] |
301,639 | <p>We have a huge web application running on lasso, mainly because it first was a huge internal Filemaker database, that was to be opened to the public as a web app.</p>
<p>The web application doesn't use Filemaker though, it runs on a MySQL database, recreated every day.</p>
<p>The only reason I know of for using lasso is it's easy integration with Filemaker, but I never used lasso. (I'm a perl/php/mysql/javascript guy)</p>
<hr>
<p>So I have three questions:<br>
Is lasso a viable language for a web app? Are there any important benefits it offers over other languages?</p>
<p>Should we want to upgrade that app, should we use a more widely used and know language, or should we stick with lasso?</p>
<p>Is there anyone here that actually uses lasso?</p>
| [
{
"answer_id": 677851,
"author": "Sam",
"author_id": 81767,
"author_profile": "https://Stackoverflow.com/users/81767",
"pm_score": 2,
"selected": true,
"text": "[SquareBrackets]"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/301639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2452/"
] |
301,655 | <p>Can anyone explain to me what this means?</p>
<p>"Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention."</p>
| [
{
"answer_id": 301952,
"author": "Andreas Magnusson",
"author_id": 5811,
"author_profile": "https://Stackoverflow.com/users/5811",
"pm_score": 0,
"selected": false,
"text": "DialogBox(hInstance, MAKEINTRESOURCE(MY_DIALOG), hWnd, &dlgProc);\n"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/301655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18664/"
] |
301,658 | <p>How do you set a break points in server tags in .aspx pages. e.g.</p>
<pre><code><% dim breakhere =new object() %>
</code></pre>
<p>The web application is running in debug mode with the <code><compilation debug="true" ...</code> in the web.config. But the page says:</p>
<blockquote>
<p>The break point will not currently be
hit. No symbols have been loaded for
this document.</p>
</blockquote>
<p>Is there anything else i need to set?</p>
| [
{
"answer_id": 301950,
"author": "rams",
"author_id": 3635,
"author_profile": "https://Stackoverflow.com/users/3635",
"pm_score": -1,
"selected": false,
"text": "<%\nSTOP\nDim o as Object = new Object()\n%>\n"
},
{
"answer_id": 302146,
"author": "Scott Ivey",
"author_id":... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29547/"
] |
301,667 | <p>I would like to replace "&gt" with ">" and "&lt" with "<" but only when they occur outside "<pre>" and "</pre>". Is this possible?</p>
<pre><code>$newText = preg_replace('&gt', '>', $text);
</code></pre>
<p>I would be using the preg_replace in PHP as above.</p>
| [
{
"answer_id": 301753,
"author": "annakata",
"author_id": 13018,
"author_profile": "https://Stackoverflow.com/users/13018",
"pm_score": 0,
"selected": false,
"text": "/(?<!(<pre>[^(<\\/pre>)]*))XXX(?!(.*<\\/pre>))/\n"
},
{
"answer_id": 301768,
"author": "Tom Haigh",
"auth... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301667",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4639/"
] |
301,669 | <p>to do some visualization of data I would like to include rectangles, circles and text within my graphs. Does anyone know a Java based framework (maybe similar to very basic Powerpoint functionality) that can export SVG graphics?</p>
| [
{
"answer_id": 301721,
"author": "Nailer",
"author_id": 37346,
"author_profile": "https://Stackoverflow.com/users/37346",
"pm_score": 0,
"selected": false,
"text": "public void draw(Graphics graphicsIn)"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/301669",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39444/"
] |
301,678 | <p>Is it possible to embed a windows form within another windows form?</p>
<p>I have created a windows form in Visual Studio along with all its associated behaviour.</p>
<p>I now want to create another windows form containing a tab view, and I want to embed the first windows form into the tab view. Is this possible?</p>
| [
{
"answer_id": 893369,
"author": "Refracted Paladin",
"author_id": 46724,
"author_profile": "https://Stackoverflow.com/users/46724",
"pm_score": 4,
"selected": false,
"text": "public static void ShowFormInContainerControl(Control ctl, Form frm)\n{\n frm.TopLevel = false;\n frm.Form... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301678",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38900/"
] |
301,679 | <p>I'm trying to print a RDLC file directly without showing Microsoft Report Viewer, I have followed the <a href="http://msdn.microsoft.com/en-us/library/ms252172.aspx" rel="noreferrer">MSDN's example</a> but now, every time I call the "Render" method of my instance of LocalReport class it throws the "One or more parameters required to run the report have not been specified." exception.</p>
<p>Can anyone tell me which parameter is required that I missed? or how can I find more detail about this exception?</p>
<pre><code> LocalReport report = new LocalReport();
report.ReportPath = System.Windows.Forms.Application.StartupPath + "\\" + rdlcFileName;
report.EnableExternalImages = true;
ReportParameter[] reportParams = new ReportParameter[]
{
new ReportParameter("LogoAddress", settings.LogoFileName),
new ReportParameter("FooterValue", settings.InvoicesFooter)
};
report.SetParameters(reportParams);
report.DataSources.Add(new ReportDataSource("Invoice", new PrintableInvoice[] { invoice }));
report.DataSources.Add(new ReportDataSource("InvoiceItem", invoiceItems));
Warning[] warnings;
try
{
string deviceInfo =
"<DeviceInfo>" +
" <OutputFormat>EMF</OutputFormat>" +
" <PageWidth>8.5in</PageWidth>" +
" <PageHeight>11in</PageHeight>" +
" <MarginTop>0.25in</MarginTop>" +
" <MarginLeft>0.25in</MarginLeft>" +
" <MarginRight>0.25in</MarginRight>" +
" <MarginBottom>0.25in</MarginBottom>" +
"</DeviceInfo>";
m_streams = new List<Stream>();
report.Render("Image", deviceInfo, _CreateStream, out warnings);
foreach( Stream stream in m_streams )
stream.Position = 0;
}
catch( Exception ex )
{
System.Diagnostics.Debug.WriteLine(ex.Message);
}
</code></pre>
<p>and the _CreateStream is:</p>
<pre><code> private Stream _CreateStream(string name, string fileNameExtension, Encoding encoding, string mimeType, bool willSeek)
{
Stream stream = new FileStream(name + "." + fileNameExtension, FileMode.Create);
m_streams.Add(stream);
return stream;
}
</code></pre>
| [
{
"answer_id": 34086732,
"author": "Konstantine Muradov",
"author_id": 2714152,
"author_profile": "https://Stackoverflow.com/users/2714152",
"pm_score": 2,
"selected": false,
"text": "var result = report.LocalReport.GetParameters();"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/301679",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34623/"
] |
301,681 | <p>Edit: This behaviour is reproducible with <a href="https://stackoverflow.com/questions/301766/mutability-and-reference-of-php5-get-variables">query globals</a> on.</p>
<p>I have the following:</p>
<pre><code> $_SESSION['query_key'] = $_GET['query_key'];
print($query_key);
</code></pre>
<p>Vs.</p>
<pre><code> $_SESSION['query_key'] = clone $_GET['query_key'];
print($query_key);
</code></pre>
<p>The former prints out the value of $query_key, while the latter prints nothing.
What sort of weird side effect is this of clone?</p>
| [
{
"answer_id": 301888,
"author": "Tom Haigh",
"author_id": 22224,
"author_profile": "https://Stackoverflow.com/users/22224",
"pm_score": 0,
"selected": false,
"text": "$_SESSION['query_key'] = 'anything'\n"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/301681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6691/"
] |
301,683 | <p>In the grails-framework some objects are using log. This is normally injected by grails. It works on execution of <code>grails test-app</code>. But the same test (an integration-test) fails on execution of <code>grails test-app -integration</code>.</p>
<p>What goes wrong here and can I force the injection of the log-object somehow?</p>
| [
{
"answer_id": 303441,
"author": "Ted Naleid",
"author_id": 8912,
"author_profile": "https://Stackoverflow.com/users/8912",
"pm_score": 2,
"selected": false,
"text": "class FooService {\n def logSomething(message) {\n log.error(message)\n return true\n }\n}\n"
},
... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21005/"
] |
301,695 | <p>This is an SQL problem I can't wrap my head around in a simple query Is it possible?</p>
<p>The data set is (letters added for ease of understanding):</p>
<pre><code>Start End
10:01 10:12 (A)
10:03 10:06 (B)
10:05 10:25 (C)
10:14 10:42 (D)
10:32 10:36 (E)
</code></pre>
<p>The desired output is:</p>
<pre><code>PeriodStart New ActiveAtEnd MinActive MaxActive
09:50 0 0 0 0
10:00 3 (ABC) 2 (AC) 0 3 (ABC)
10:10 1 (D) 2 (CD) 1 (C) 2 (AC or CD)
10:20 0 1 (D) 1 (C) 2 (CD)
10:30 1 (E) 1 (D) 1 (D) 2 (DE)
10:40 0 0 0 1 (D)
10:50 0 0 0 0
</code></pre>
<p>So, the query needed is a summary of the first table, calculating the minimum overlapping time periods (Start-End) and the maximum overlapping time periods (Start-End) from the first table within a 10 minute period.</p>
<p>'New' is the number of rows with a Start in the summary period. 'ActiveAtEnd' is the number of rows active at the end of the summary period.</p>
<p>I'm using Oracle, but I'm sure a solution can be adjusted. Stored procedures not allowed - just plain SELECT/INSERT (views are allowed). Its also OK to run one SQL command per 10 minute output (as once populated, that will be how it keeps up to date.</p>
<p>Thanks for any ideas, including 'not possible' ;-)</p>
| [
{
"answer_id": 301740,
"author": "Unsliced",
"author_id": 2902,
"author_profile": "https://Stackoverflow.com/users/2902",
"pm_score": 0,
"selected": false,
"text": "select @periodStart PeriodStart\n, @periodEnd PeriodEnd \n, n.[new]\n, ae.ActiveAtEnd\nfrom (\nselect count(*) [new] \nfr... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301695",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38896/"
] |
301,696 | <p>I have a web app that is heavily loaded in javascript and css. First time users log in it takes some time to load once it is downloading js etc. Then the caching will make everything faster.</p>
<p>I want my users to be aware of this loading time. How can I add some code to "show" some loading information while js and css are downloaded?</p>
| [
{
"answer_id": 301736,
"author": "Alexander Malfait",
"author_id": 27449,
"author_profile": "https://Stackoverflow.com/users/27449",
"pm_score": 3,
"selected": true,
"text": "<html>\n <head>\n ... a bunch of CSS and JS files ...\n\n <script type=\"text/javascript\" src=\... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19224/"
] |
301,711 | <p>I would like to do the equivalent of the following:</p>
<pre><code>#define print_max(TYPE) \
# ifdef TYPE##_MAX \
printf("%lld\n", TYPE##_MAX); \
# endif
print_max(INT);
</code></pre>
<p>Now the <code>#ifdef</code> or any nested preprocessor directive is
not allowed as far as I can see in a function macro.
Any ideas?</p>
<p>Update: So it seems like this is not possible. Even a hack to check at runtime seems unachievable. So I think I'll go with something like:</p>
<pre><code>#ifndef BLAH_MAX
# define BLAH_MAX 0
#endif
# etc... for each type I'm interested in
#define print_max(TYPE) \
if (TYPE##_MAX) \
printf("%lld\n", TYPE##_MAX);
print_max(INT);
print_max(BLAH);
</code></pre>
| [
{
"answer_id": 301819,
"author": "Ferruccio",
"author_id": 4086,
"author_profile": "https://Stackoverflow.com/users/4086",
"pm_score": 0,
"selected": false,
"text": "#define _print_max(TYPE) \\\n#ifdef TYPE \\\nprintf(\"%lld\\n\", _TYPE); \\\n#endif\n\n#define print_max(TYPE) _print_max(... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301711",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4421/"
] |
301,714 | <p>I am using the following html page:</p>
<pre><code><html>
<head>
<title>AJAX Example</title>
<meta http-equiv="Content-Type" content="text/html"; charset="iso-8859-1">
</head>
<script language="JavaScript" src="ajaxlib.js"></script>
<!--define the ajax javascript library-->
<body>
Click this <a href="#" OnClick="GetEmployee()">link</a> to show ajax
content (will be processed backgroundly without
refreshing whole page)<br/>
<!--a href=# OnClick=GetEmployee() is the javascript event on a
link to execute javascript function (GetEmployee) inside ajaxlib.js-->
<div id="Result">< the result will be fetched here ></div>
<!--javascript use GetElementById function to replace the data
backgroundly, we use <div> tag with id Result here so javascript
can replace this value-->
</body>
</html>
</code></pre>
<p>The Javascript is here: <a href="http://www.nomorepasting.com/getpaste.php?pasteid=22046" rel="nofollow noreferrer">http://www.nomorepasting.com/getpaste.php?pasteid=22046</a></p>
<p>And the PHP is here: <a href="http://www.nomorepasting.com/getpaste.php?pasteid=22047" rel="nofollow noreferrer">http://www.nomorepasting.com/getpaste.php?pasteid=22047</a></p>
<p>The problem is, everything seems logical and there are no errors, but the javascript does not seem to be called, and calling the php file directly gives a result such as this:</p>
<p>Well the characters will not even paste in apparently...., but lots of little boxes with like this:</p>
<pre><code>10
01
</code></pre>
| [
{
"answer_id": 301745,
"author": "Greg",
"author_id": 24181,
"author_profile": "https://Stackoverflow.com/users/24181",
"pm_score": 2,
"selected": true,
"text": "getEmployee()"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/301714",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1246613/"
] |
301,716 | <p>My scenario is:</p>
<p>I have a WPF Window with 3 data-bound text boxes</p>
<pre class="lang-xml prettyprint-override"><code>SettingsUI : Window
<Grid Name="SettingsUIGrid1">
<TextBox Text="{Binding val1}" ....
<TextBox Text="{Binding val2}" ....
<TextBox Text="{Binding val3}" ....
</Grid>
</code></pre>
<p>In the constructor I do this:</p>
<pre><code>SettingsUIGrid1.DataContext = coll[0]; // collection first value
</code></pre>
<p>When the Cancel button is clicked, I close my window:</p>
<pre><code>private void btnCancel_Click(object sender, RoutedEventArgs e) {
Close();
}
</code></pre>
<p>When I click the Show button, is shows values from the DB in text boxes, if user changes a text box value, and reloads the window the new value is displayed not the old one. Can someone suggest what to do to reload the values again and clear the in memory object?</p>
| [
{
"answer_id": 301818,
"author": "Bijington",
"author_id": 32348,
"author_profile": "https://Stackoverflow.com/users/32348",
"pm_score": 0,
"selected": false,
"text": "private static bool DataRowReallyChanged(DataRow row)\n {\n if (row == null)\n {\n return fa... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
301,722 | <p>I have a form with a DIV, 3 INPUTS, each INPUT sits within a LABEL element. I would like to change the background image of the DIV element when focusing on each INPUT.</p>
<p>I can't move back up the DOM to fix this with CSS, so could someone suggest a few lines of jQuery please?</p>
<p>Thanks</p>
| [
{
"answer_id": 301748,
"author": "Pat",
"author_id": 238,
"author_profile": "https://Stackoverflow.com/users/238",
"pm_score": 1,
"selected": false,
"text": "$('input').focus(function(){\n $(this).parent().parent().addClass('highlight');\n}).blur(function(){\n $(this).parent().par... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301722",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
301,725 | <p>I need to find out the position of the TR.</p>
<p>Actually, I got the index of the TD which is 291,
But I need to get the index of the TR contains the TD.</p>
<p>We can get the <code>innerHTML</code> by</p>
<pre><code>document.getElementsByTagName("td")[291].parentNode.innerHTML..
</code></pre>
<p>How to get the index of that <code>parentNode</code> I mean the TR.</p>
<p>Please help me</p>
| [
{
"answer_id": 301758,
"author": "Tor Haugen",
"author_id": 32050,
"author_profile": "https://Stackoverflow.com/users/32050",
"pm_score": 2,
"selected": false,
"text": "var parent = document.getElementsByTagName(\"td\")[291].parentNode;\nvar index = -1;\nfor (var i = 0; i < parent.childN... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301725",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38172/"
] |
301,759 | <p>How can I return to the start of a line and overwrite what has already been output on the console? The following does not appear to work:</p>
<pre><code>System.out.print(mystuff+'\r');
</code></pre>
| [
{
"answer_id": 301779,
"author": "Avi",
"author_id": 1605,
"author_profile": "https://Stackoverflow.com/users/1605",
"pm_score": 2,
"selected": false,
"text": "System.out.println(mystuff);\n"
},
{
"answer_id": 302055,
"author": "mtruesdell",
"author_id": 6479,
"author... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
301,766 | <p>I have the following in a page e.g. <code>/mypage?myvar=oldvalue</code></p>
<pre><code>$_SESSION['myvar'] = $_GET['myvar'];
$myvar = 'a_new_string'
</code></pre>
<p>Now <code>$_SESSION['myvar']</code> has the value <code>'a_new_string'</code></p>
<p>Is this by design?</p>
<p>How can I copy the <em>value</em> of <code>'myvar'</code> rather than a reference to it?</p>
| [
{
"answer_id": 301788,
"author": "Adriano Varoli Piazza",
"author_id": 22184,
"author_profile": "https://Stackoverflow.com/users/22184",
"pm_score": 0,
"selected": false,
"text": "<?php\nsession_start(); \n$_GET['myvar'] = ''; \n$_SESSION['myvar'] = $_GET['myvar']; \n$myvar = 'a_new_stri... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301766",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6691/"
] |
301,770 | <p>All the examples that I can search online use the App.Config mode of specifying the context definition retrieved by </p>
<pre><code>contextToGetSprungObjects = ContextRegistry.GetContext(contextname)
</code></pre>
<p>I want to use </p>
<pre><code>contextToGetSprungObjects = new XmlApplicationContext(sXmlFileName)
</code></pre>
<p>(I'm calling into a DLL (that needs Spring.net) from another executable (MsWord) so app.config approach is out). I tried sneaking in MyDll.dll.config.. didn't fly.
On using the XmlApplicationContext approach to read it from a specified xml file, I get the following error </p>
<pre><code>{"Error registering object with name '' defined in 'file [D:\\Work\\Seven\\WordAutomation\\ContentControls\\WordDocument1\\bin\\debug\\MyWPFPlotPopup.dll.config]' : There is no parser registered for namespace ''\r\n<configSections><sectionGroup name=\"spring\"><section name=\"context\" type=\"Spring.Context.Support.ContextHandler, Spring.Core\" /></sectionGroup><section name=\"log4net\" type=\"log4net.Config.Log4NetConfigurationSectionHandler, log4net\" /></configSections>"}
</code></pre>
<p>Which leads me to believe that the two approaches need their xml in a differently shaped bottle. I searched high and low but the schema for the xml that is needed eludes me.. everything I can find uses X.exe.config or Web.config. Can someone point me to a valid xml context defintion for Spring.net?</p>
<pre><code><spring>
<context>
<context name="MyApplication">
<resource uri="file://Resources/MyApplicationContext.xml"/>
</context>
</context>
</spring>
</code></pre>
<p>I think this is the relevant section of the app.config that I want Spring.net to readd</p>
| [
{
"answer_id": 301788,
"author": "Adriano Varoli Piazza",
"author_id": 22184,
"author_profile": "https://Stackoverflow.com/users/22184",
"pm_score": 0,
"selected": false,
"text": "<?php\nsession_start(); \n$_GET['myvar'] = ''; \n$_SESSION['myvar'] = $_GET['myvar']; \n$myvar = 'a_new_stri... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1695/"
] |
301,772 | <p>I am using Rob Connery's excellent MVC Storefront as a loose basis for my new MVC Web App but I'm having trouble porting the LazyList code to VB.NET (don't ask).</p>
<p>It seems that VB doesn't allow the GetEnumerator function to be specified twice with only differing return types. Does anyone know how I might get around this?</p>
<p>Thanks</p>
<pre><code>Private Function GetEnumerator() As IEnumerator(Of T) Implements IEnumerable(Of T).GetEnumerator
Return Inner.GetEnumerator()
End Function
Public Function GetEnumerator() As IEnumerator Implements IList(Of T).GetEnumerator
Return DirectCast(Inner, IEnumerable).GetEnumerator()
End Function
</code></pre>
| [
{
"answer_id": 322884,
"author": "BlackMael",
"author_id": 19377,
"author_profile": "https://Stackoverflow.com/users/19377",
"pm_score": 3,
"selected": true,
"text": "Public Function GetEnumerator() As IEnumerator(Of T) _\n Implements IEnumerable(Of T).GetEnumerator\n\n Return Inner.Ge... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38911/"
] |
301,776 | <p>I would like to know if there is any easy way to print multiple emails(about 200) so that they continue on as opposed to printing one per page. I have tried with thunderbird and evolution and this does not seem possible. Would concatenating the individual mail files work or are there other unix utilities that could do this? WOuld sed or awk be suited for this?</p>
| [
{
"answer_id": 301796,
"author": "boutta",
"author_id": 15108,
"author_profile": "https://Stackoverflow.com/users/15108",
"pm_score": 3,
"selected": true,
"text": "cat *.eml > file.txt\n"
},
{
"answer_id": 317717,
"author": "shank",
"author_id": 24697,
"author_profile... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1246613/"
] |
301,793 | <p>I am trying to accomplish the following in MySQL (see <code>pseudo</code> code)</p>
<pre><code>SELECT DISTINCT gid
FROM `gd`
WHERE COUNT(*) > 10
ORDER BY lastupdated DESC
</code></pre>
<p>Is there a way to do this without using a (SELECT...) in the WHERE clause because that would seem like a waste of resources.</p>
| [
{
"answer_id": 301804,
"author": "Winston Smith",
"author_id": 35086,
"author_profile": "https://Stackoverflow.com/users/35086",
"pm_score": 5,
"selected": false,
"text": "SELECT COUNT(*)\nFROM `gd`\nGROUP BY gid\nHAVING COUNT(gid) > 10\nORDER BY lastupdated DESC;\n"
},
{
"answer... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
301,809 | <p>There has been a lot of sentiment to include a <code>nameof</code> operator in C#. As an example of how this operator would work, <code>nameof(Customer.Name)</code> would return the string <code>"Name"</code>.</p>
<p>I have a domain object. And I have to bind it. And I need names of properties as strings then. And I want them to be type-safe.</p>
<p>I remember coming across a workaround in .NET 3.5 which provided the functionality of <code>nameof</code> and involved lambda expressions. However, I have not been able to locate this workaround. Can anyone provide that workaround to me?</p>
<p>I am also interested in a way to implement the functionality of <code>nameof</code> in .NET 2.0 if that is possible.</p>
| [
{
"answer_id": 301812,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 2,
"selected": false,
"text": "MemberInfo"
},
{
"answer_id": 301957,
"author": "reshefm",
"author_id": 30717,
"author_profile": "ht... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38325/"
] |
301,817 | <p>I have some data of the form</p>
<pre><code>Key ID Link
1 MASTER 123
2 AA 123
3 AA 123
4 BB 123
5 MASTER 456
6 CC 456
</code></pre>
<p>I would like to be able to select in the same select all linked items matching the selection criteria, plus the linked master. For example, if I have an ID of 'AA', I want the rows with ID = 'AA' to be returned, plus the row with ID = 'MASTER' and a link of 123:</p>
<pre><code>1 MASTER 123
2 AA 123
3 AA 123
</code></pre>
<p>I'm using Oracle 10.2g, so if any special Oracle syntax will make this easier, then that would be ok.</p>
| [
{
"answer_id": 301843,
"author": "rich",
"author_id": 25502,
"author_profile": "https://Stackoverflow.com/users/25502",
"pm_score": 0,
"selected": false,
"text": "select * from my_table where link in\n(select link\nfrom my_table\nwhere id = 'AA')\nand id in ('AA','MASTER')\n"
},
{
... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8163/"
] |
301,839 | <p>Currently, I am splitting all my tests by package (projects). So if I have 12 projects, I will create 1 more project for Unit Test with 12 classes that will test all my package. </p>
<p>Do you do the same way or do you have 1 testing class by class? How do you organize all your test?</p>
| [
{
"answer_id": 301866,
"author": "David Holm",
"author_id": 22247,
"author_profile": "https://Stackoverflow.com/users/22247",
"pm_score": 2,
"selected": false,
"text": "package/Class.cpp\npackage/Class.hpp\npackage/test/ClassUnitTest.cpp\npackage/test/ClassIntegrationTest.cpp\ntest/unit-... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13913/"
] |
301,844 | <p>I'm currently writing some methods that do some basic operations on form controls eg Textbox, Groupbox, these operations are generic and can be used in any application. </p>
<p>I started to write some unit tests and was just wondering should I use the real form controls found in System.Windows.Forms or should I just mock up the sections that I'm trying to test. So for example:</p>
<p>Say I have this method which takes a control and if it is a textbox it will clear the text property like this:</p>
<pre><code> public static void clearall(this Control control)
{
if (control.GetType() == typeof(TextBox))
{
((TextBox)control).Clear();
}
}
</code></pre>
<p>Then I want to test this method so I do something like this:</p>
<pre><code> [TestMethod]
public void TestClear()
{
List<Control> listofcontrols = new List<Control>();
TextBox textbox1 = new TextBox() {Text = "Hello World" };
TextBox textbox2 = new TextBox() { Text = "Hello World" };
TextBox textbox3 = new TextBox() { Text = "Hello World" };
TextBox textbox4 = new TextBox() { Text = "Hello World" };
listofcontrols.Add(textbox1);
listofcontrols.Add(textbox2);
listofcontrols.Add(textbox3);
listofcontrols.Add(textbox4);
foreach (Control control in listofcontrols)
{
control.clearall();
Assert.AreEqual("", control.Text);
}
}
</code></pre>
<p>Should I be adding a referance to System.Window.Forms to my unit test and use the real Textbox object? or am I doing it wrong? </p>
<p>NOTE: The above code is only an example, I didn't compile or run it.</p>
| [
{
"answer_id": 301884,
"author": "Brian Genisio",
"author_id": 36687,
"author_profile": "https://Stackoverflow.com/users/36687",
"pm_score": 2,
"selected": false,
"text": "public interface ITextBox\n{\n public string Text {get; set;}\n}\n\npublic class TextBoxAdapter : ITextBox\n{\n ... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6335/"
] |
301,854 | <p>Am I right to think that there is no way to set the selected value in the C# class SelectList after it is created?
Isn't that a bit silly?</p>
| [
{
"answer_id": 301923,
"author": "Tor Haugen",
"author_id": 32050,
"author_profile": "https://Stackoverflow.com/users/32050",
"pm_score": 0,
"selected": false,
"text": "var select = document.getElementById('mySelect');\nselect.options[newIndex].selected = true;\n"
},
{
"answer_id... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11333/"
] |
301,860 | <p>I need to check whether the user executing the script has administrative privileges on the machine.</p>
<p>I have specified the user executing the script because the script could have been executed with a user other than the logged on using something similar to "Runas".</p>
<p>@Javier: Both solutions work in a PC with an English version of Windows installed but not if the installed is in different language. This is because the Administrators group doesn't exist, the name is different for instance in Spanish. I need the solution to work in all configurations. </p>
| [
{
"answer_id": 301920,
"author": "Tim C",
"author_id": 7585,
"author_profile": "https://Stackoverflow.com/users/7585",
"pm_score": 3,
"selected": true,
"text": "Set objNetwork = CreateObject(\"Wscript.Network\")\nstrComputer = objNetwork.ComputerName\nstrUser = objNetwork.UserName\n\nisA... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14053/"
] |
301,865 | <p>So our scenario is this: We have multiple Sharepoint sites that are created dynamically on a "as requested" basis. Basically there's a new site for each new project. Now, for every site we want to add a search clause that says that only contents with a metadata tag value equal to the sitename should be found. Quick example:
There are 2 sites/projects: Bear and Wolf. Sharepoint Search has index all of the documents/lists/etc from these sites and a common archive for them. All documents in the common archive has a property called "ProjectName". When Bill, who's on the Wolf team, wants to search for "specifications" in his project site (Wolf) he only wants to see documents relevant to that project.
So how do I make sure that all the documents have the "ProjectName" value set to "Wolf"?</p>
<p>I'm guessing I <em>could</em> use Scopes here, but currently there are ~200 sites and this is growing every month and so maintaining that manually is not an option. If there's a relativly easy way of automating Scopes; excellent.</p>
| [
{
"answer_id": 301920,
"author": "Tim C",
"author_id": 7585,
"author_profile": "https://Stackoverflow.com/users/7585",
"pm_score": 3,
"selected": true,
"text": "Set objNetwork = CreateObject(\"Wscript.Network\")\nstrComputer = objNetwork.ComputerName\nstrUser = objNetwork.UserName\n\nisA... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11220/"
] |
301,869 | <p>There seem to be so many color wheel, color picker, and color matcher web apps out there, where you give one color and the they'll find a couple of other colors that will create a harmonic layout when being used in combination. However most of them focus on background colors only and any text printed on each background color (if text is printed at all in the preview) is either black or white.</p>
<p>My problem is different. I know the background color I want to use for a text area. What I need help with is choosing a couple of colors (the more, the merrier) I can use as font colors on this background. Most important is that the color will make sure the font is readable (contrast not being too low, also maybe not being too high to avoid that eyes are stressed) and of course that the combination of foreground and background just looks good.</p>
<p>Anyone being aware of such an application? I'd prefer a web application to anything I have to download. Thanks.</p>
| [
{
"answer_id": 302091,
"author": "Aaron Digulla",
"author_id": 34088,
"author_profile": "https://Stackoverflow.com/users/34088",
"pm_score": 6,
"selected": true,
"text": "h = (h + 180) % 360;\n"
},
{
"answer_id": 302961,
"author": "Mecki",
"author_id": 15809,
"author_... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301869",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15809/"
] |
301,882 | <p>Thats what I am using to read e-mail using C#:</p>
<pre><code>outLookApp.NewMailEx += new ApplicationEvents_11_NewMailExEventHandler(outLookApp_NewMailEx);
Outlook.NameSpace olNameSpace = outLookApp.GetNamespace("mapi");
olNameSpace.Logon("xxxx", "xxxxx", false, true);
Outlook.MAPIFolder oInbox = olNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
Outlook.Items oItems = oInbox.Items;
MessageBox.Show("Total : " + oItems.Count); //Total Itemin inbox
oItems = oItems.Restrict("[Unread] = true");
MessageBox.Show("Total Unread : " + oItems.Count); //Unread Items
Outlook.MailItem oMsg;
Outlook.Attachment mailAttachement;
for (int i = 0; i < oItems.Count; i++)
{
oMsg = (Outlook.MailItem)oItems.GetFirst();
MessageBox.Show(i.ToString());
MessageBox.Show(oMsg.SenderName);
MessageBox.Show(oMsg.Subject);
MessageBox.Show(oMsg.ReceivedTime.ToString());
MessageBox.Show(oMsg.Body);
</code></pre>
<p>The problem that I am facing is this application only works if the Outlook is open on the machine. If Outlook is closed it throws an exception:</p>
<blockquote>
<p>The server is not available. Contact your administrator if this condition persists.</p>
</blockquote>
<p>Is there anyway I can read e-mail with Outlook open?</p>
| [
{
"answer_id": 22501981,
"author": "theAlse",
"author_id": 576671,
"author_profile": "https://Stackoverflow.com/users/576671",
"pm_score": 1,
"selected": false,
"text": "using Outlook = Microsoft.Office.Interop.Outlook;\n\n// Create the Outlook application.\nOutlook.Application oApp = nu... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301882",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
301,922 | <p>"Fatal error: Allowed memory size of 31457280 bytes exhausted (tried to allocate 9828 bytes)".</p>
<p>This is the error i get but I am only trying to upload a 1mb image. I have increased the memory limit in php.ini and the execution time. I am trying this on a local MAMP server, on a Mac using firefox. This going to be for an online image gallery.
Any ideas?
Below is the code:</p>
<pre><code> ini_set("memory_limit","30M");
if(isset($_POST['submit'])){
if (isset ($_FILES['new_image'])){
$imagename = $_FILES['new_image']['name'];
$source = $_FILES['new_image']['tmp_name'];
$target = "images/".$imagename;
move_uploaded_file($source, $target);
$imagepath = $imagename;
//below here for the removed code
$save = "thumbs/uploads/" . $imagepath; //This is the new file you saving
$file = "images/" . $imagepath; //This is the original file
$imagesize = getimagesize($file);
list($width, $height) = $imagesize;
unset($imagesize);
if($width>$height)
{
$modwidth = 150;
$diff = $width / $modwidth;
$modheight = $height / $diff;
}else{
$modheight = 150;
$diff = $height / $modheight;
$modwidth = $width / $diff;
}
$tn = imagecreatetruecolor($modwidth, $modheight);
$image = imagecreatefromjpeg($file);
$imagecopy = imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height);
imagedestroy($image);
imagedestroy($im);
imagedestroy($imagecopy);
imagedestroy($source);
$imagejpg = imagejpeg($tn, $save, 100);
imagedestroy($tn);
imagedestroy($imagejpg);
</code></pre>
<hr>
<p>EDIT</p>
<p>This has now been sorted out hopefully. One of my colleagues had a solution all along but neglected to tell me!</p>
| [
{
"answer_id": 302209,
"author": "Ciaran McNulty",
"author_id": 34024,
"author_profile": "https://Stackoverflow.com/users/34024",
"pm_score": 2,
"selected": false,
"text": "anytopnm <file> | pnmscale -xysize <dimensions> | pnmtojpg > <outfile> \n"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/301922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31677/"
] |
301,924 | <p>I'm trying to test the functionality of a web app by scripting a login sequence in Python, but I'm having some troubles.</p>
<p>Here's what I need to do:</p>
<ol>
<li>Do a POST with a few parameters and headers.</li>
<li>Follow a redirect</li>
<li>Retrieve the HTML body.</li>
</ol>
<p>Now, I'm relatively new to python, but the two things I've tested so far haven't worked. First I used httplib, with putrequest() (passing the parameters within the URL), and putheader(). This didn't seem to follow the redirects.</p>
<p>Then I tried urllib and urllib2, passing both headers and parameters as dicts. This seems to return the login page, instead of the page I'm trying to login to, I guess it's because of lack of cookies or something.</p>
<p>Am I missing something simple?</p>
<p>Thanks.</p>
| [
{
"answer_id": 301987,
"author": "gimel",
"author_id": 6491,
"author_profile": "https://Stackoverflow.com/users/6491",
"pm_score": 3,
"selected": false,
"text": "Python"
},
{
"answer_id": 302099,
"author": "S.Lott",
"author_id": 10661,
"author_profile": "https://Stack... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18673/"
] |
301,937 | <p>I have the following table in MySQL (version 5):</p>
<pre><code>id int(10) UNSIGNED No auto_increment
year varchar(4) latin1_swedish_ci No
title varchar(250) latin1_swedish_ci Yes NULL
body text latin1_swedish_ci Yes NULL
</code></pre>
<p>And I want the db to auto add the current year on insert, I've tried the following SQL statement:</p>
<pre><code>ALTER TABLE `tips` CHANGE `year` `year` VARCHAR(4) NOT NULL DEFAULT year(now())
</code></pre>
<p>But it gives the following error:</p>
<pre><code>1067 - Invalid default value for 'year'
</code></pre>
<p>What can I do to get this functionality? Thanks in advance!</p>
| [
{
"answer_id": 301944,
"author": "Noah Goodrich",
"author_id": 20178,
"author_profile": "https://Stackoverflow.com/users/20178",
"pm_score": 3,
"selected": false,
"text": "ALTER TABLE tips MODIFY COLUMN year YEAR(4) NOT NULL DEFAULT CURRENT_TIMESTAMP\n"
},
{
"answer_id": 301955,
... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301937",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
301,959 | <p>I have an abstract base class called Shape from which both Circle and Rectangle are derived, but when I execute the following code in VS 2005 I get the error Debug assertion failed. At the same time I have not overloaded == operator in any class</p>
<p>Expression:Vector iterator not dereferencable, what is the reason for this.</p>
<pre><code> vector<Shape*> s1;
s1.push_back(new Circle(point(1,2),3));
s1.push_back(new Circle(point(4,3),5));
s1.push_back(new Rectangle(point(1,1),4,5));
vector<Shape*> s2(s1);
reverse(s1.begin(),s1.end());
(*find(s1.begin(),s1.end(),new Circle(point(1,2),3)))->move(point(10,20));
</code></pre>
| [
{
"answer_id": 302057,
"author": "xtofl",
"author_id": 6610,
"author_profile": "https://Stackoverflow.com/users/6610",
"pm_score": 3,
"selected": false,
"text": "new Circle(point(1,2),3)"
},
{
"answer_id": 303143,
"author": "Martin York",
"author_id": 14065,
"author_p... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7965/"
] |
301,965 | <p>This is my first crack at a method that is run periodically during the lifetime of my ASP.NET application to clean up expired sessions stored in my database. It seems to work pretty well, but the software engineer in me doesn't feel "right" about this code. I've been working with LINQ to SQL for a few months now, but I'm not very confident in the following code. I'm worried about a few things:</p>
<ol>
<li><p>Is the following code safe to run in a situation where the database is being accessed by different threads in my application? I have a decent understanding of the idea of transactions, but I want to make sure I'm using them properly.</p></li>
<li><p>Is my query going to cause performance issues? Or is it appropriate in this case to select all of the records in this particular table? This method only runs every 15 minutes, so it's not like that query will be made over and over again in a short period of time.</p></li>
<li><p>Is there a better way that I could do this? I have a nagging feeling that there is.</p></li>
</ol>
<p>Code:</p>
<pre><code>/// <summary>
/// Method, run periodically, to remove all sign in records that correspond to expired sessions.
/// </summary>
/// <param name="connectionString">Database connection string</param>
/// <returns>Number of expired sign in records removed</returns>
public static int Clean(String connectionString)
{
MyDatabaseDataContext db = new MyDatabaseDataContext(connectionString);
var signIns = db.SignIns.Select(x => x);
int removeCount = 0;
using (TransactionScope scope = new TransactionScope())
{
foreach (SignIn signIn in signIns)
{
DateTime currentTime = DateTime.Now;
TimeSpan span = currentTime.Subtract(signIn.LastActivityTime);
if (span.Minutes > 10)
{
db.SignIns.DeleteOnSubmit(signIn);
++removeCount;
}
}
db.SubmitChanges();
scope.Complete();
}
return removeCount;
}
</code></pre>
| [
{
"answer_id": 302023,
"author": "Coderer",
"author_id": 26286,
"author_profile": "https://Stackoverflow.com/users/26286",
"pm_score": 4,
"selected": true,
"text": " DELETE * FROM tblSignIns \n WHERE LastActivityTime < DATEADD(\"minute\", -10, GETDATE());\n"
},
{
"answer_id": 302... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301965",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18505/"
] |
301,968 | <p>I heard that Visual Studio came with an Image Library, but I can't find it anywhere. Does anyone know where it is?</p>
| [
{
"answer_id": 60420692,
"author": "greg",
"author_id": 5266970,
"author_profile": "https://Stackoverflow.com/users/5266970",
"pm_score": 3,
"selected": false,
"text": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\Assets"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/301968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1204/"
] |
301,983 | <p>I am working on a project that I want to implement AJAX, and I have decided on jQuery as a JavaScript Library. Here is the HTML:</p>
<pre><code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>jQuery AJAX</title>
<!--<script language="javascript" type="text/javascript" src="inc/scripts.js"></script>-->
<script language="javascript" type="text/javascript" src="inc/jquery-1.2.6-intellisense.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("#clicker").click(function () {
$.ajax({
type: "POST",
url: "test.aspx/randomString",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
$("#result").append(msg.d);
}
});
});
});
</script>
</head>
<body runat="server">
<form id="form1" runat="server">
<div id="result" runat="server" style="margin-bottom:5em;"></div>
<div id="clicker" runat="server" style="cursor:pointer;">Click Here to Refresh</div>
</form>
</body>
</html>
</code></pre>
<p>And here is the back-end on <strong><code>test.aspx</code></strong>:</p>
<pre><code><WebMethod()> _
Public Shared Function randomString() As String
Dim KeyGen As RandomKeyGenerator
Dim NumKeys As Integer
Dim i_Keys As Integer
Dim RandomKey As String
Dim oRet As New StringBuilder
NumKeys = 20
KeyGen = New RandomKeyGenerator
KeyGen.KeyLetters = "abcdefghijklmnopqrstuvwxyz"
KeyGen.KeyNumbers = "0123456789"
KeyGen.KeyChars = 12
For i_Keys = 1 To NumKeys
RandomKey = KeyGen.Generate()
oRet.AppendLine(String.Format("{0}{1}", RandomKey, ControlChars.NewLine))
Next
Return oRet.ToString
End Function
</code></pre>
<p>I have tried <strong><code>$("#result).text(msg.d)</code></strong> as well as forming a list, <strong><code>String.Format("<li>{0}</li>",RandomKey)</code></strong>, and adding a break tag <strong><code>String.Format("{0}<br />",RandomKey)</code></strong>. </p>
<p>When I run the page it returns as one line, all HTML is shown. What do I need to do to make it render the HTML?</p>
<p>I got the information on how to call a page without a ScriptManager from <a href="http://encosia.com/2008/05/29/using-jquery-to-directly-call-aspnet-ajax-page-methods/" rel="nofollow noreferrer">this site</a>.</p>
| [
{
"answer_id": 302044,
"author": "Dave Ward",
"author_id": 60,
"author_profile": "https://Stackoverflow.com/users/60",
"pm_score": 3,
"selected": true,
"text": "$(\"#result\").html(msg.d)\n"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/301983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25515/"
] |
301,991 | <p>Inspired by the question <a href="https://stackoverflow.com/questions/301546/whats-the-simplest-way-to-call-http-get-url-using-delphi">What’s the simplest way to call Http GET url using Delphi?</a>
I really would like to see a sample of how to use POST. Preferably to receive XML from the call.</p>
<p>Added: What about including an image or other file in the post data?</p>
| [
{
"answer_id": 302061,
"author": "Bruce McGee",
"author_id": 19183,
"author_profile": "https://Stackoverflow.com/users/19183",
"pm_score": 7,
"selected": true,
"text": "function PostExample: string;\nvar\n lHTTP: TIdHTTP;\n lParamList: TStringList;\nbegin\n lParamList := TStringList.C... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301991",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13219/"
] |
301,999 | <p>What's the best way to move a document from one doc library to another? I don't care about version history or preserving CreatedBy and ModifiedBy metadata...</p>
<pre><code>SPList lib1 = (SPDocumentLibrary) web.Lists["lib1"];
SPList lib2 = (SPDocumentLibrary) web.Lists["lib2"];
SPItem item1 = lib1.Items[0];
//insert code to move item1 to lib2
</code></pre>
<p>I'm currently looking at <code>SPItem.MoveTo()</code> but wonder if anyone already solved this problem and has some advice.<br>
Thanks in advance.</p>
| [
{
"answer_id": 302117,
"author": "vitule",
"author_id": 1287,
"author_profile": "https://Stackoverflow.com/users/1287",
"pm_score": 4,
"selected": true,
"text": "SPList lib1 = (SPDocumentLibrary) web.Lists[\"lib1\"];\nSPList lib2 = (SPDocumentLibrary) web.Lists[\"lib2\"];\nSPListItem ite... | 2008/11/19 | [
"https://Stackoverflow.com/questions/301999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1287/"
] |
302,017 | <p>Is there a way to browse and edit/delete saved form entries in Firefox?</p>
<p>I know I can:</p>
<ul>
<li>Delete all form data, using the <em>Clear Private Data</em> dialog;</li>
<li><a href="http://kb.mozillazine.org/Deleting_autocomplete_entries" rel="nofollow noreferrer">Delete specific entries</a> in a form using shift-delete when the cursor is over them (*).</li>
</ul>
<p>I want is way to see all saved entries for a specific keyword, edit them, and easily delete all or selectively.</p>
<p>I expected to find a plugin that does it, but I couldn't find any. Or is there an external tool that manipulates the <em>formhistory.sqlite</em> file?</p>
<p>(*) For those of you that don't know this: go to your favorite search engine's search box, and press the down key to see the history. <kbd>Shift</kbd> + <kbd>Delete</kbd> will delete the "current" entry from saved form data.</p>
| [
{
"answer_id": 302040,
"author": "Greg",
"author_id": 24181,
"author_profile": "https://Stackoverflow.com/users/24181",
"pm_score": 4,
"selected": false,
"text": "sqlite"
},
{
"answer_id": 1550680,
"author": "Cactus",
"author_id": 187963,
"author_profile": "https://St... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38557/"
] |
302,026 | <p><strong>For a particular segment of Java code, I'd like to measure:</strong></p>
<ul>
<li><strong>Execution time (most likely <em>thread execution time</em>)</strong></li>
<li><strong>Memory usage</strong></li>
<li><strong>CPU load (specifically attributable to the code segment)</strong></li>
</ul>
<p>I'm a relative Java novice and am not familiar with how this might be achieved. I've been referred to <a href="http://en.wikipedia.org/wiki/JMX" rel="nofollow noreferrer">JMX</a>, however I'm not sure how that might be used, and JMX looks a bit 'heavy' for what I'm looking to do.</p>
<p>Ideally I'd like some measurement class that can be told what I would like to measure, with the option of calling a <code>start()</code> method prior to a code segment and a <code>stop()</code> method after. Relevant metrics would be logged to a file I specify.</p>
<p>For example:</p>
<pre><code>import com.example.metricLogger;
metricLogger logger = new metricLogger();
logger.setLogPath(pathToLogFile);
logger.monitor(executionTime);
logger.monitor(memoryUsage);
logger.monitor(cpuLoad);
logger.start();
/* Code to be measured */
logger.stop();
</code></pre>
<p><strong>Is there any standard/common/conventional way of achieving this in Java?</strong></p>
<p>Such measurements are for one-off performance comparisons, and so I'm not looking for any in-production long-term monitoring processes.</p>
<p>I'm more than happy to be referred to tutorials or external examples and don't expect a full answer here. That said, if anything as simple as the above can be achieved a realistic example would go down really well.</p>
| [
{
"answer_id": 302077,
"author": "basszero",
"author_id": 287,
"author_profile": "https://Stackoverflow.com/users/287",
"pm_score": 5,
"selected": true,
"text": "long start = System.nanoTime(); // requires java 1.5\n// Segment to monitor\ndouble elapsedTimeInSec = (System.nanoTime() - st... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5343/"
] |
302,047 | <p>In VB.NET, what is the difference between <code>And</code> and <code>AndAlso</code>? Which should I use?</p>
| [
{
"answer_id": 302067,
"author": "Nico",
"author_id": 22970,
"author_profile": "https://Stackoverflow.com/users/22970",
"pm_score": 10,
"selected": true,
"text": "And"
},
{
"answer_id": 302070,
"author": "Bryan Anderson",
"author_id": 21186,
"author_profile": "https:/... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302047",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34588/"
] |
302,064 | <p>I want to allow only users with a 3G phone to use a particular GPS function. How do I run a check on the device before allowing that feature to be used?</p>
| [
{
"answer_id": 303606,
"author": "wisequark",
"author_id": 33159,
"author_profile": "https://Stackoverflow.com/users/33159",
"pm_score": 2,
"selected": false,
"text": "- (NSString *)deviceModel\n{\n NSString *deviceModel = nil;\n char buffer[32];\n size_t length = sizeof(buffer)... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302064",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38953/"
] |
302,082 | <p>I'm using a SqlDataSource to populate my GridView, because the two seem to be so tightly coupled together. Since this grid shows results of a search, I have a dynamic sql string being written in my codebehind that references parameters I pass in, such as below:</p>
<pre><code>sdsResults.SelectParameters.Add("CodeID", TypeCode.String, strCodeID)
</code></pre>
<p>My problem is that the CodeID field is a varchar field. As you may have experienced, passing in an nvarchar field to be evaluated against a varchar field can be very detrimental to sql performance. However, SelectParameters.Add only takes in TypeCode types, which seems to only give me the unicode TypeCode.String as my viable option.</p>
<p>How do I force my SqlDataSource to use varchars? I can't change the datatype at this point--it's a main key of a large 10 year old app, and frankly, varchar is right for the application. </p>
| [
{
"answer_id": 406975,
"author": "Coentje",
"author_id": 41424,
"author_profile": "https://Stackoverflow.com/users/41424",
"pm_score": 0,
"selected": false,
"text": "using System.Data;\n\nsdsResults.SelectParameters.Add(\"CodeID\", SqlDbType.VarChar, strCodeID);\n"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/302082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
302,086 | <p>I have a lengthy user-interface operation on my form which is triggered whenever an event is fired. Rather than have the UI block while the operation takes place, I'd like to perform the operation in another thread, and abort that thread and start again if the event fires again.</p>
<p>However, to safely alter controls on my form, I need to use the form's Invoke or BeginInvoke methods. If I do that, then I could put all my UI operations in one function like this:</p>
<pre><code>private delegate void DoUIStuffDelegate(Thing1 arg1, Thing2 arg2);
private void doUIStuff(Thing1 arg1, Thing2 arg2)
{
control1.Visible = false;
this.Controls.Add(arg1.ToButton());
...
control100.Text = arg2.ToString();
}
...
private void backgroundThread()
{
Thing1 arg1 = new Thing1();
Thing2 arg2 = new Thing2();
this.Invoke(new DoUIStuffDelegate(doUIStuff), arg1, arg2);
}
Thread uiStuffThread = null;
public void OnEventFired()
{
if (uiStuffThread != null)
uiStuffThread.Abort();
uiStuffThread = new Thread(backgroundThread);
uiStuffThread.Start();
}
</code></pre>
<p>but if I do that, then I lose the benefit of working in a separate thread. Alternatively, I could put them each in their own function like this:</p>
<pre><code>private delegate void DoUIStuffLine1Delegate();
private delegate void DoUIStuffLine2Delegate(Thing1 arg1);
...
private delegate void DoUIStuffLine100Delegate(Thing2 arg2);
private void doUIStuffLine1()
{
control1.Visible = false;
}
private void doUIStuffLine2()
{
this.Controls.Add(arg1.ToButton());
}
...
private void doUIStuffLine100(Thing2 arg2)
{
control100.Text = arg2.ToString();
}
...
private void backgroundThread()
{
Thing1 arg1 = new Thing1();
Thing2 arg2 = new Thing2();
this.Invoke(new DoUIStuffLine1Delegate(doUIStuffLine1));
this.Invoke(new DoUIStuffLine2Delegate(doUIStuffLine2), arg1);
...
this.Invoke(new DoUIStuffLine100Delegate(doUIStuffLine100), arg2);
}
Thread uiStuffThread = null;
public void OnEventFired()
{
if (uiStuffThread != null)
uiStuffThread.Abort();
uiStuffThread = new Thread(backgroundThread);
uiStuffThread.Start();
}
</code></pre>
<p>but that's a horrible, unmaintainable mess. Is there a way to create a thread that can modify the user interface, and that I can abort? So that I can just do something like this:</p>
<pre><code>private void doUIStuff()
{
Thing1 arg1 = new Thing1();
Thing2 arg2 = new Thing2();
control1.Visible = false;
this.Controls.Add(arg1.ToButton());
...
control100.Text = arg2.ToString();
}
Thread uiStuffThread = null;
public void OnEventFired()
{
if (uiStuffThread != null)
uiStuffThread.Abort();
uiStuffThread = this.GetNiceThread(doUIStuff);
uiStuffThread.Start();
}
</code></pre>
<p>without having to disable cross-thread checks on my form? Ideally I'd like to be able to set some attribute on the thread or the method which individually wrapped all of the operations in delegates that then got invoked on the form's thread.</p>
| [
{
"answer_id": 302106,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 2,
"selected": false,
"text": " void worker_DoWork(object sender, DoWorkEventArgs e)\n {\n try {\n Action<Action> update = thi... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302086",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15371/"
] |
302,087 | <p>I am designing the (G)UI of a program, and have stumbled across a problem; The program will convert a number into different units, and the layout of a unit been converted to is:</p>
<p>[Unit name (when clicked gives information)]
[Special status, if any]
[Output in textfield that can also be used for input (to convert to other units)]</p>
<p>I want the user to be able to copy an outputnumber onto the clipboard, without having to mess around with highlighting and finding the right buttons to press. So, I thought I'd make a button after the text-output field, saying something like "C" or "Copy".</p>
<p>But I was reading on <a href="http://www.joelonsoftware.com/uibook/chapters/fog0000000063.html" rel="nofollow noreferrer">joelonsoftware.com</a> yesterday, and discovered that users seem to be cursorclumsy. So what should I do?</p>
<p>I've thought about a number of different options:</p>
<ol>
<li>Click on textfield to copy to clipboard - BUT: I want to use it for input as well</li>
<li>Pressing a numeral on the keyboard to copy the respective one - BUT: There will probably be more than 10, and I need them for new input</li>
<li>Bigger Copy button, like on that actually says "Copy" - Hmm, would this work? I know that I like to use the keyboard when I can, so a solution involving it would be nice.</li>
<li>Each unit will have its own space, where everything (name, textfield etc.) fits in. What if it would copy to clipboard when clicked anywhere in that space except for on the name or textfield. - BUT: What if you miss, meaning to click below one textfield, and clicking above another?</li>
<li>But what about highlighting the unit's space as I went along? - Could still mean trouble...</li>
</ol>
<p>What do you think? I think I just might opt for #3 - Bigger copy-button..</p>
| [
{
"answer_id": 302104,
"author": "Ed Marty",
"author_id": 36007,
"author_profile": "https://Stackoverflow.com/users/36007",
"pm_score": 0,
"selected": false,
"text": "ctrl-click"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/302087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36948/"
] |
302,096 | <p>I have a generic method with this (dummy) code (yes I'm aware IList has predicates, but my code is not using IList but some other collection, anyway this is irrelevant for the question...)</p>
<pre class="lang-cs prettyprint-override"><code> static T FindThing<T>(IList collection, int id) where T : IThing, new()
{
foreach (T thing in collection)
{
if (thing.Id == id)
return thing;
}
return null; // ERROR: Cannot convert null to type parameter 'T' because it could be a value type. Consider using 'default(T)' instead.
}
</code></pre>
<p>This gives me a build error</p>
<blockquote>
<p>"Cannot convert null to type parameter
'T' because it could be a value type.
Consider using 'default(T)' instead."</p>
</blockquote>
<p>Can I avoid this error?</p>
| [
{
"answer_id": 302111,
"author": "Ricardo Villamil",
"author_id": 19314,
"author_profile": "https://Stackoverflow.com/users/19314",
"pm_score": 7,
"selected": false,
"text": "return default(T);\n"
},
{
"answer_id": 302112,
"author": "Mitchel Sellers",
"author_id": 13279,
... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302096",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6399/"
] |
302,110 | <p>I have been searching for info on this to no avail. The context of why i need this is <a href="https://stackoverflow.com/questions/271944/storing-temporary-user-files-in-aspnet-in-medium-trust">another question I asked here</a>. More specifically, does creating/updating/deleting files in App_Data cause a pool recycle?</p>
<p>If someone could provide a detailed list of what causes a recycle, that would be great.</p>
<p><strong>UPDATE</strong>: As two users already noticed I would also be happy to an answer specifying reasons for recycling the AppDomain only and not the whole pool.</p>
| [
{
"answer_id": 305966,
"author": "Christopher G. Lewis",
"author_id": 13532,
"author_profile": "https://Stackoverflow.com/users/13532",
"pm_score": 5,
"selected": false,
"text": "cscript adsutil.vbs Set w3svc/AppPools/DefaultAppPool/LogEventOnRecycle 255 \n"
},
{
"answer_id": 519... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1801/"
] |
302,122 | <p>With jQuery, how do I find out which key was pressed when I bind to the keypress event?</p>
<pre><code>$('#searchbox input').bind('keypress', function(e) {});
</code></pre>
<p>I want to trigger a submit when <kbd>ENTER</kbd> is pressed.</p>
<p><strong>[Update]</strong></p>
<p>Even though I found the (or better: one) answer myself, there seems to be some room for variation ;)</p>
<p>Is there a difference between <code>keyCode</code> and <code>which</code> - especially if I'm just looking for <kbd>ENTER</kbd>, which will never be a unicode key?</p>
<p>Do some browsers provide one property and others provide the other one? </p>
| [
{
"answer_id": 302140,
"author": "BlaM",
"author_id": 999,
"author_profile": "https://Stackoverflow.com/users/999",
"pm_score": 3,
"selected": false,
"text": "e.which\n"
},
{
"answer_id": 302154,
"author": "Vladimir Prudnikov",
"author_id": 29364,
"author_profile": "h... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/999/"
] |
302,131 | <p>I'm writing a CLR stored procedure to take XML data in the form of a string, then use the data to execute certain commands etc. </p>
<p>The problem that I'm running into is that whenever I try to send XML that is longer than 4000 characters, I get an error, as the XmlDocument object can't load the XML as a lot of the closing tags are missing, due to the text being truncated after 4000 chars.</p>
<p>I think this problem boils down to the CLR stored procedure mapping the string parameter onto nvarchar(4000), when I'm thinking something like nvarchar(max) or ntext would be what I need. </p>
<p>Unfortunately, I can't find a mapping from a .NET type onto ntext, and the string type automatically goes to nvarchar(max).</p>
<p>Does anyone know of a solution to my problem?</p>
<p>Thanks for any help</p>
| [
{
"answer_id": 533745,
"author": "Dave Cluderay",
"author_id": 30933,
"author_profile": "https://Stackoverflow.com/users/30933",
"pm_score": 2,
"selected": false,
"text": "System.Data.SqlTypes.SqlXml"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/302131",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
302,136 | <p>I'm currently designing a database schema that's used to store recipes. In this database there are different types of entities that I want to be able to tag (ingredients, recipe issuers, recipes, etc). So a tag has multiple n:m relations. If I use the "three table design", this would result in tables (cross table) for every entity type (recipes, ingredients, issuers) that I have. In other words every time I introduce an entity I have to add a cross table for it.</p>
<p>I was thinking of creating one table which has a unique id, that all the entities refer to, and a n:m relation between the tags table and the "unique id"-table. This way there is just one cross table between the "unique id"-table and the tag table.</p>
<p>Just in case that some people will think this question already was asked. I already read <a href="https://stackoverflow.com/questions/48475/database-design-for-tagging">Database Design for Tagging</a>. And there the three table design is mentioned.</p>
| [
{
"answer_id": 302770,
"author": "Yarik",
"author_id": 31415,
"author_profile": "https://Stackoverflow.com/users/31415",
"pm_score": 2,
"selected": false,
"text": "- - - - - - - - - -\nTag\n ID // PK\n Name\n ...\n\n- - - - - - - - - -\nTaggable\n ID // PK... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302136",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33110/"
] |
302,157 | <p>I have a base class vehicle and some children classes like car, motorbike etc.. inheriting from vehicle.
In each children class there is a function Go();
now I want to log information on every vehicle when the function Go() fires, and on that log I want to know which kind of vehicle did it.</p>
<p>Example:</p>
<pre><code>public class vehicle
{
public void Go()
{
Log("vehicle X fired");
}
}
public class car : vehicle
{
public void Go() : base()
{
// do something
}
}
</code></pre>
<hr>
<p>How can I know in the function Log that car called me during the base()?
Thanks,</p>
<p>Omri</p>
| [
{
"answer_id": 302172,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 5,
"selected": true,
"text": "GetType()"
},
{
"answer_id": 302185,
"author": "Brian Genisio",
"author_id": 36687,
"author_profile":... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38963/"
] |
302,160 | <p>Good morning,</p>
<p>Apologies for the newbie question. I'm just getting started with ASP.NET internationalization settings.</p>
<p>Background info:</p>
<p>I have a website which displays a <code><table></code> HTML object. In that <code><table></code> HTML object, I have a column which displays dates. My server being in the US, those dates show up as <code>MM/DD/YYYY</code>. Many of my users plug into this webpage through Excel, via the Data --> Import External Data --> Import Web Query interface. My users, for the most part, are in the US, so those dates show up correctly in their Excel screens.</p>
<p>Now I need to make the webpage work for UK users. As is, they are downloading the dates as <code>MM/DD/YYYY</code>, which makes their spreadsheets unusable since their regional settings are set to <code>DD/MM/YYYY</code>.</p>
<p>My question is:</p>
<p>How do I make it so the web server realizes that the incoming request has a <code>en-GB</code> culture setting? I could engineer my own little custom workaround, but I'm sure I'm not the first programmer to come across this. How do the pro's handle this? I'm looking for a solution that would be relatively simple and quick to put up, but I don't want to just put some crappy buggy piece of my own logic togethe that I'm going to dread 6 months from now.</p>
<p>Thanks a lot in advance,
-Alan.</p>
| [
{
"answer_id": 302180,
"author": "Ben Scheirman",
"author_id": 3381,
"author_profile": "https://Stackoverflow.com/users/3381",
"pm_score": 2,
"selected": false,
"text": "<configuration>\n <system.web> \n <globalization uiCulture=\"auto\" />\n ...\n"
},
{
"answer_... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7311/"
] |
302,166 | <p>I've recently been exposed to the fluent interface in nUnit and I love it; however, I am using msTest. </p>
<p>Does anyone know if there is a fluent interface that is either testing framework agnostic or for msTest? </p>
| [
{
"answer_id": 2048227,
"author": "nietras",
"author_id": 98692,
"author_profile": "https://Stackoverflow.com/users/98692",
"pm_score": 3,
"selected": false,
"text": "true.Should().Be.True();\nfalse.Should().Be.False();\n\nconst string something = \"something\";\nsomething.Should().Conta... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302166",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26160/"
] |
302,171 | <p>I'm compiling library for a private project, which depends on a number of libraries. Specifically one of the dependencies is compiled with Fortran. On some instances, I've seen the dependency compiled with <code>g77</code>, on others I've seen it compiled with <code>gfortran</code>. My project then is <code>./configure</code>'d to link with either <code>-lg2c</code> or <code>-lgfortran</code>, but so far I've been doing it by hand.</p>
<p>If it is possible, how can I find out, from looking into the dependent library (via e.g. <code>nm</code> or some other utility?), whether the used compiler was <code>g77</code> (and then I'll use <code>-lg2c</code> in my link options) or <code>gfortran</code> (and then I'll use <code>-lgfortran</code>)?</p>
<p>Thanks in advance!</p>
| [
{
"answer_id": 303165,
"author": "geocar",
"author_id": 37507,
"author_profile": "https://Stackoverflow.com/users/37507",
"pm_score": 4,
"selected": true,
"text": "nm filename | fgrep ' __g77'\n"
},
{
"answer_id": 1170330,
"author": "F'x",
"author_id": 143495,
"author... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302171",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36145/"
] |
302,181 | <p>I've got two ASP.Net applications residing in two different folders on my server:</p>
<ul>
<li><code>/Foo</code> <-- this is the standard unsecure application</li>
<li><code>/Secure</code> <-- this is a separate application that requires SSL by IIS</li>
</ul>
<p>The problem is that by default, the <code>ASP.NET_SessionId</code> cookie is specified on the domain and is shared between the two applications in different directories. I need the session cookie to be different because I can't allow a hijacked cookie on <code>/Foo</code> to be used to grant access to the <code>/Secure</code> application.</p>
<p>Ideally, I would like each application's cookie to be limited by the cookie <code>Path</code> property. There's apparently no way to do this in .Net out of the box.</p>
<p>As an added headache, even if I write custom code to set the cookie path, I'm fearful that some browsers are case sensitive and won't use the same session cookie for <code>/Foo</code> and <code>/foo</code>, which, depending on how the links are built, can result in multiple sessions in the same application.</p>
<p>Has anyone encountered and overcome this issue?</p>
| [
{
"answer_id": 302248,
"author": "Kev",
"author_id": 419,
"author_profile": "https://Stackoverflow.com/users/419",
"pm_score": 1,
"selected": false,
"text": "/Secure"
},
{
"answer_id": 11860233,
"author": "ZokiPoki",
"author_id": 1584014,
"author_profile": "https://St... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302181",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34409/"
] |
302,195 | <p>Im trying to extract a line from wget's result but having trouble with it.
This is my wget call:</p>
<pre><code>$ wget -SO- -T 1 -t 1 http://myurl.com:15000/myhtml.html
</code></pre>
<p>Output:</p>
<pre>
--18:24:12-- http://xxx.xxxx.xxxx:15000/myhtml.html
=> `-'
Resolving xxx.xxxx.xxxx... xxx.xxxx.xxxx
Connecting to xxx.xxxx.xxxx|xxx.xxxx.xxxx|:15000... connected.
HTTP request sent, awaiting response...
HTTP/1.1 302 Found
Date: Tue, 18 Nov 2008 23:24:12 GMT
Server: IBM_HTTP_Server
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Location: https://xxx.xxxx.xxxx/siteminderagent/...
Content-Length: 508
Keep-Alive: timeout=10, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1
Location: https://xxx.xxxx.xxxx//siteminderagent/...
--18:24:13-- https://xxx.xxxx.xxxx/siteminderagent/...
=> `-'
Resolving xxx.xxxx.xxxx... failed: Name or service not known.
</pre>
<p>if I do this: <br/><br/></p>
<pre><code>$ wget -SO- -T 1 -t 1 http://myurl.com:15000/myhtml.html | egrep -i "302" <br/>
</code></pre>
<p>It doesnt return me the line that contains the string. I just want to check if the site or siteminder is up.</p>
| [
{
"answer_id": 302213,
"author": "Piotr Lesnicki",
"author_id": 38796,
"author_profile": "https://Stackoverflow.com/users/38796",
"pm_score": 5,
"selected": true,
"text": "$ wget -SO- -T 1 -t 1 http://myurl.com:15000/myhtml.html 2>&1 | egrep -i \"302\" \n"
},
{
"answer_id": 30223... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38961/"
] |
302,208 | <p>I've built the x86 Boost libraries many times, but I can't seem to build x64 libraries. I start the "Visual Studio 2005 x64 Cross Tools Command Prompt" and run my usual build:</p>
<pre><code>bjam --toolset=msvc --build-type=complete --build-dir=c:\build install
</code></pre>
<p>But it still produces x86 .lib files (I verified this with dumpbin /headers).
What am I doing wrong?</p>
| [
{
"answer_id": 302257,
"author": "macbirdie",
"author_id": 5049,
"author_profile": "https://Stackoverflow.com/users/5049",
"pm_score": 7,
"selected": true,
"text": "address-model=64"
},
{
"answer_id": 30814129,
"author": "sergtk",
"author_id": 13441,
"author_profile":... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4086/"
] |
302,219 | <p>I'm using the following logon trigger on an Oracle 10.2 database:</p>
<pre><code>CREATE OR REPLACE TRIGGER AlterSession_trg
AFTER LOGON ON DATABASE
BEGIN
EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_COMP=LINGUISTIC';
EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_SORT=BINARY_AI';
END AlterSession_trg;
</code></pre>
<p>This is intended to make case sensitive queries a thing of the past, and when I connect from PL/SQL Developer this is indeed the case. However, when I connect from SQL Developer or the ASP.NET application I'm working on queries are again case sensitive. Is there anyway that SQL Developer/.NET could be skipping over this trigger? Have I set the trigger up wrong?</p>
| [
{
"answer_id": 302832,
"author": "Serxipc",
"author_id": 34009,
"author_profile": "https://Stackoverflow.com/users/34009",
"pm_score": 3,
"selected": true,
"text": "NLS_COMP"
},
{
"answer_id": 304634,
"author": "Dave Lewis",
"author_id": 29740,
"author_profile": "http... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302219",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29740/"
] |
302,223 | <p>I have a PHP-generated page which is displaying some data about a set of films. The page is updated using POST. The form only shows films starting with a particular letter. I want to present a set of clickable options at the top of the screen, each of which is a letter. So if you click on "B" it submits the form and re-draws the page showing only films that start with B. (I know, Ajax would be a better way to do this, but I'm trying to get something done quickly).</p>
<p>Anyway, I know I can do this by having each link be a Javascript call which sets the value of a hidden field and then submits the form, or I could do it by having each letter be a button which has a particular value and submits the form directly, but neither of those strikes me as particularly elegant. Is there a standard way to do this? Am I missing something really obvious?</p>
| [
{
"answer_id": 302400,
"author": "Piskvor left the building",
"author_id": 19746,
"author_profile": "https://Stackoverflow.com/users/19746",
"pm_score": 0,
"selected": false,
"text": "<input type=\"submit\" name=\"letter\" value=\"A\" />\n<input type=\"submit\" name=\"letter\" value=\"B\... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302223",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11522/"
] |
302,234 | <p>In my asp.net mvc page I create a link that renders as followed:</p>
<p><code>http://localhost:3035/Formula/OverView?colorId=349405&paintCode=744&name=BRILLANT%20SILVER&formulaId=570230</code></p>
<p>According to the W3C validator, this is not correct and it errors after the first ampersand. It complains about the & not being encoded and the entity &p not recognised etc.</p>
<p>AFAIK the & shouldn't be encoded because it is a separator for the key value pair.</p>
<p>For those who care: I send these pars as querystring and not as "/" seperated values because there is no decent way of passing on optional parameters that I know of.</p>
<p>To put all the bits together:</p>
<ul>
<li>an anchor (<a>) tag's href attribute needs an encoded value</li>
<li>& encodes to &amp;</li>
<li>to encode an '&' when it is part of your parameter's value, use %26</li>
</ul>
<p>Wouldn't encoding the ampersand into & make it part of my parameter's value?
I need it to seperate the second variable from the first</p>
<p>Indeed, by encoding my href value, I do get rid of the errors. What I'm wondering now however is what to do if for example my colorId would be "123&456", where the ampersand is part of the value.
Since the separator has to be encoded, what to do with encoded ampersands. Do they need to be encoded twice so to speak?</p>
<p>So to get the url: </p>
<p><code>www.mySite.com/search?query=123&amp;456&page=1</code></p>
<p>What should my href value be?</p>
<p>Also, I think I'm about the first person in the world to care about this.. go check the www and count the pages that get their query string validated in the W3C validator..</p>
| [
{
"answer_id": 302255,
"author": "Illandril",
"author_id": 17887,
"author_profile": "https://Stackoverflow.com/users/17887",
"pm_score": 3,
"selected": true,
"text": "<a href=\"http://localhost:3035/Formula/OverView?colorId=349405&paintCode=744&name=BRILLANT%20SILVER&formulaI... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302234",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11333/"
] |
302,239 | <p>I'm trying to add a publisher policy file to the gac as per this <a href="https://stackoverflow.com/questions/283419/how-to-just-load-the-latest-version-of-dll-from-gac">thread</a> but I'm having problems when I try and add the file on my test server. </p>
<p>I get "A module specified in the manifest of assembly 'policy.3.0.assemblyname.dll' could not be found"</p>
<p>My policy file looks like this:</p>
<pre><code><configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="*assemblyname*"
publicKeyToken="7a19eec6f55e2f84"
culture="neutral" />
<bindingRedirect oldVersion="3.0.0.0"
newVersion="3.0.0.1"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
</code></pre>
<p>Please help!</p>
<p>Thanks</p>
<p>Ben</p>
<hr>
<p>I've recreated the problem from scratch with a new assembly that has no dependancies (apart from the defaults) itself - all works fine on my local development machine (and redirects fine too) but gives the same error adding the policy file to the GAC on the server!</p>
<pre><code><configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="TestAsm"
publicKeyToken="5f55456fdcc9b528"
culture="neutral" />
<bindingRedirect oldVersion="3.0.0.0"
newVersion="3.0.0.1"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
</code></pre>
<p>linked in the following way</p>
<pre><code>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\al.exe /link:PublisherPolicy.xml /out:policy.3.0.TestAsm.dll /keyfile:..\..\key.snk /version:3.0.0.0
pause
</code></pre>
<p>Please help!</p>
| [
{
"answer_id": 302417,
"author": "Kev",
"author_id": 419,
"author_profile": "https://Stackoverflow.com/users/419",
"pm_score": 1,
"selected": false,
"text": "al.exe /link:assembly.config /out:policy.3.0.assembly.dll \n /keyfile:mykey.snk /version:3.0.0.0\n"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/302239",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36852/"
] |
302,244 | <p>I'm working on a .NET web application and I'm using a CalendarExtender control within it to have the user specify a date. For some reason, when I click the icon to display the calendar, the background seems to be transparent.</p>
<p>I'm using the extender on other pages and do not run into this issue.</p>
<p>I'm not sure if it is worth mentioning, but the calendar is nested within a panel that has a rounded corner extender attached to it, as well as the panel below it (where the "From" is overlapping).</p>
<p>Within that panel, I do have a div layout setup to create two columns.</p>
<p>EDIT: The other thing to note here is that the section that has the name and "placeholders" for nickname are all ASP.NET label controls, if that matters.</p>
| [
{
"answer_id": 306595,
"author": "Dillie-O",
"author_id": 71,
"author_profile": "https://Stackoverflow.com/users/71",
"pm_score": 6,
"selected": true,
"text": ".ajax__calendar_container { z-index : 1000 ; }\n"
},
{
"answer_id": 866281,
"author": "Paul Rowland",
"author_id... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/71/"
] |
302,252 | <p>I have a class that looks like this:</p>
<pre><code>public class TextField : TextBox
{
public bool Required { get; set; }
RequiredFieldValidator _validator;
protected override void CreateChildControls()
{
base.CreateChildControls();
_validator = new RequiredFieldValidator();
_validator.ControlToValidate = this.ID;
if(Required)
Controls.Add(_validator);
}
public override void Render(HtmlTextWriter tw)
{
base.Render(tw);
if(Required)
_validator.RenderControl(tw);
}
}
</code></pre>
<p>This has been working for a while in a internal application where javascript is always enabled. I recently noticed that an upstream javascript error can prevent the validators from firing, so the server side validation should kick in... right? right?</p>
<p>So the Page.IsValid property always returns true (I even tried explicitly calling Page.Validate() before-hand). </p>
<p>After some digging, I found that the validator init method should add the validator to the page, but due to the way I'm building it up, I don't think this ever happens. Thus, client side validation works, but server side validation does not.</p>
<p>I've tried this:</p>
<pre><code>protected override OnInit()
{
base.OnInit();
Page.Validators.Add(_validator); // <-- validator is null here
}
</code></pre>
<p>But of course the validator is null here (and sometimes it's not required so it shouldn't be added)... but OnInit() is really early for me to make those decisions (the Required property won't have been loaded from ViewState for example).</p>
<p>Ideas?</p>
| [
{
"answer_id": 302468,
"author": "azamsharp",
"author_id": 3797,
"author_profile": "https://Stackoverflow.com/users/3797",
"pm_score": 2,
"selected": true,
"text": "public class RequiredTextBox : TextBox\n {\n private RequiredFieldValidator _req;\n private string _errorM... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302252",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3381/"
] |
302,258 | <p>does anybody know how to save and retrieve files in MS SQL-Server 2000? I guess the image data type could be used as a container.</p>
<p>I want to import/export the following file types: DOC, XLS, PDF, BMP, TIFF, etc.</p>
<p>Due to resource issues we are using MS-Access 2007 as the front end, so I am looking for VBA code.</p>
<p>Thanks in Advance.</p>
| [
{
"answer_id": 319332,
"author": "Philippe Grondier",
"author_id": 11436,
"author_profile": "https://Stackoverflow.com/users/11436",
"pm_score": 2,
"selected": false,
"text": "Tbl_Folder"
},
{
"answer_id": 324790,
"author": "Birger",
"author_id": 11485,
"author_profil... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302258",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
302,271 | <p>I am trying to use the <code>System.Net.Mail.MailMessage</code> class in C# to create an email that is sent to a list of email addresses all via <code>BCC</code>. I do not want to include a <code>TO</code> address, but it seems that I must because I get an exception if I use an empty string for the <code>TO</code> address in the <code>MailMessage</code> constructor. The error states: </p>
<pre><code>ArgumentException
The parameter 'addresses' cannot be an empty string.
Parameter name: addresses
</code></pre>
<p>Surely it is possible to send an email using only <code>BCC</code> as this is not a limitation of SMTP.</p>
<p><strong>Is there a way around this?</strong></p>
| [
{
"answer_id": 302335,
"author": "FlySwat",
"author_id": 1965,
"author_profile": "https://Stackoverflow.com/users/1965",
"pm_score": 2,
"selected": false,
"text": "Mailer@CompanyName.com"
},
{
"answer_id": 1045761,
"author": "Community",
"author_id": -1,
"author_profi... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302271",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12081/"
] |
302,277 | <p>I was wondering whether the object to test should be a field and thus set up during a <code>SetUp</code> method (ie. JUnit, nUnit, MS Test, …).</p>
<p>Consider the following examples (this is C♯ with MsTest, but the idea should be similar for any other language and testing framework):</p>
<pre><code>public class SomeStuff
{
public string Value { get; private set; }
public SomeStuff(string value)
{
this.Value = value;
}
}
[TestClass]
public class SomeStuffTestWithSetUp
{
private string value;
private SomeStuff someStuff;
[TestInitialize]
public void MyTestInitialize()
{
this.value = Guid.NewGuid().ToString();
this.someStuff = new SomeStuff(this.value);
}
[TestCleanup]
public void MyTestCleanup()
{
this.someStuff = null;
this.value = string.Empty;
}
[TestMethod]
public void TestGetValue()
{
Assert.AreEqual(this.value, this.someStuff.Value);
}
}
[TestClass]
public class SomeStuffTestWithoutSetup
{
[TestMethod]
public void TestGetValue()
{
string value = Guid.NewGuid().ToString();
SomeStuff someStuff = new SomeStuff(value);
Assert.AreEqual(value, someStuff.Value);
}
}
</code></pre>
<p>Of course, with just one test method, the first example is much too long, but with more test methods, this could be safe quite some redundant code.</p>
<p>What are the pros and cons of each approach? Are there any “Best Practices”?</p>
| [
{
"answer_id": 302541,
"author": "silverbugg",
"author_id": 29650,
"author_profile": "https://Stackoverflow.com/users/29650",
"pm_score": 0,
"selected": false,
"text": "[Test]\npublic void TestSomething()\n{\n _myVar = \"value\";\n InstantiateClass();\n RunTheClass();\n Asser... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302277",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11963/"
] |
302,279 | <p>I want to know if I'm missing something.
Here's how I would do it:
For SPFolder I would change the associtaed item's permissions (SPFolder.Item).
So I suppose managing SPFolder permissions boils down to managing SPListItem permissions.
For SPListItem I would frist break role inheritance with <code>SPListItem.BreakRoleInheritance()</code> and then work with <code>RoleAssignments</code> collections adding and removing roles there.</p>
<p>I wonder if RoleAssignments is the only way to manage SPListItem's permissions (besides inheritance) and is there a way to manage individual permissions without roles.
There is also EffectiveBasePermissions property but I'm not sure.</p>
<p>So the question is
is there other ways (besides inheritance) to manage SPListItem permissions apart from the RoleAssignments collection?</p>
<p><strong>@Edit:</strong> there's also AllRolesForCurrentUser, but I guess you can get the same info from the RoleAssignments property, so this one is just for convenience.</p>
<p><strong>@Edit:</strong> As Flo notes in his answer there is a problem with setting</p>
<pre><code>folder.ParentWeb.AllowUnsafeUpdates = true;
</code></pre>
<p>And using <code>BreakRoleInheritance</code> with argument of 'false' (i.e. without copying permissions of the parent object).</p>
<pre><code>folder.Item.BreakRoleInheritance(false);
</code></pre>
<p><code>BreakRoleInheritance</code> simply won't work on GET request as you'd expect after allowing unsafe updates. Presumably the method resets <code>AllowUnsafeUpdates</code> back to 'false'.</p>
<p>One workaround I know for this is to manually delete the inherited permissions after you BreakRoleInheritance(true), like this:</p>
<pre><code>folder.Item.BreakRoleInheritance(false);
while(folder.Item.RoleAssignments.Count > 0) {
folder.Item.RoleAssignments.Remove(0);
}
</code></pre>
<p>Thanks!</p>
| [
{
"answer_id": 302541,
"author": "silverbugg",
"author_id": 29650,
"author_profile": "https://Stackoverflow.com/users/29650",
"pm_score": 0,
"selected": false,
"text": "[Test]\npublic void TestSomething()\n{\n _myVar = \"value\";\n InstantiateClass();\n RunTheClass();\n Asser... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302279",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/578/"
] |
302,294 | <p>Where does Firefox store cookies and in what format are they stored</p>
| [
{
"answer_id": 302308,
"author": "VonC",
"author_id": 6309,
"author_profile": "https://Stackoverflow.com/users/6309",
"pm_score": 6,
"selected": true,
"text": "cookies.txt"
},
{
"answer_id": 302394,
"author": "Brian",
"author_id": 18192,
"author_profile": "https://Sta... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302294",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1443363/"
] |
302,303 | <p>Good morning,</p>
<p>I am working on a C# winform application that is using validation for the controls. The issue I'm having is that when a user clicks into a textbox and attempts to click out, the validation fires and re-focuses the control, basically the user cannot click out of the control to another control.</p>
<p>My desired result is to have ALL of the controls on the form validate when the user clicks the submit button. I would like to have the errorProvider icon appear next to the fields that are in error and allow the user to correct them as they see fit.</p>
<p>My question is, how do I setup a control to allow a user to click outside of it when there is an error. I'd like the user to have the ability to fill in the rest of the form and come back to the error on their own instead of being forced to deal with it immediately.</p>
<p>Thank you in advance for any help and advice,</p>
| [
{
"answer_id": 302590,
"author": "Hath",
"author_id": 5186,
"author_profile": "https://Stackoverflow.com/users/5186",
"pm_score": 2,
"selected": false,
"text": " private void OnSave()\n {\n if(ValidateData())\n {\n //do save\n }\n }\n\n public bool Valid... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] |
302,310 | <p>What does it mean that a Transaction Log is Full? I have it the file set to grow 20% when needed. I have 4GBs left on the drive. How do I solve this issue permanently?
Running these commands solves the issue temporarily:</p>
<pre>
DBCC SHRINKFILE('MyDatabase_log', 1)
BACKUP LOG MyDatabase WITH TRUNCATE_ONLY
DBCC SHRINKFILE('MyDatabase_log', 1)
</pre>
| [
{
"answer_id": 319574,
"author": "Astra",
"author_id": 5862,
"author_profile": "https://Stackoverflow.com/users/5862",
"pm_score": 0,
"selected": false,
"text": "BACKUP LOG MyDatabase WITH TRUNCATE_ONLY"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/302310",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36590/"
] |
302,312 | <p>I have a tab page that should be hidden if a property (BlahType) is set to 1 and shown if set to 0. This is what I <em>WANT</em> to do:</p>
<pre><code><TabItem Header="Blah">
<TabItem.Triggers>
<DataTrigger Binding="{Binding BlahType}" Value="0">
<Setter Property="TabItem.Visibility" Value="Hidden" />
</DataTrigger>
</TabItem.Triggers>
</TabItem>
</code></pre>
<p>The problem is, I get this error:</p>
<pre><code>"Triggers collection members must be of type EventTrigger"
</code></pre>
<p>If you Google that error, you'll see that <a href="http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/f816fd72-4f41-4a1a-b0a2-4e409e89c75c/" rel="nofollow noreferrer">Dr. WPF explains the error</a>. Is there a clean way to do what I'm trying to achieve here?</p>
| [
{
"answer_id": 302358,
"author": "David Padbury",
"author_id": 26401,
"author_profile": "https://Stackoverflow.com/users/26401",
"pm_score": 5,
"selected": true,
"text": "<TabItem Header=\"Blah\">\n <TabItem.Style>\n <Style>\n <Style.Triggers>\n <DataT... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11917/"
] |
302,365 | <p>A class has a property (and instance var) of type NSMutableArray with synthesized accessors (via <code>@property</code>). If you observe this array using:</p>
<pre><code>[myObj addObserver:self forKeyPath:@"theArray" options:0 context:NULL];
</code></pre>
<p>And then insert an object in the array like this:</p>
<pre><code>[myObj.theArray addObject:NSString.string];
</code></pre>
<p>An observeValueForKeyPath... notification is <strong>not</strong> sent. However, the following does send the proper notification:</p>
<pre><code>[[myObj mutableArrayValueForKey:@"theArray"] addObject:NSString.string];
</code></pre>
<p>This is because <code>mutableArrayValueForKey</code> returns a proxy object that takes care of notifying observers.</p>
<p>But shouldn't the synthesized accessors automatically return such a proxy object? What's the proper way to work around this--should I write a custom accessor that just invokes <code>[super mutableArrayValueForKey...]</code>?</p>
| [
{
"answer_id": 302763,
"author": "Ben Gottlieb",
"author_id": 6694,
"author_profile": "https://Stackoverflow.com/users/6694",
"pm_score": 0,
"selected": false,
"text": "addObject:"
},
{
"answer_id": 303128,
"author": "Marc Charbonneau",
"author_id": 35136,
"author_pro... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/79/"
] |
302,369 | <p>The hover "joke" in #505 <a href="http://en.wikipedia.org/wiki/Xkcd" rel="noreferrer">xkcd</a> touts "I call rule 34 on Wolfram's Rule 34".</p>
<p>I know <a href="http://www.urbandictionary.com/define.php?term=Rule%2034" rel="noreferrer">what rule 34 is in Internet terms</a> and I've googled up <a href="http://en.wikipedia.org/wiki/Stephen_Wolfram" rel="noreferrer">who Wolfram is</a> but I'm having a hard time figuring out what Wolfram's Rule 34 is.</p>
<p>So what exactly is this "Rule 34"?</p>
<p>Here's the comic: <a href="http://xkcd.com/505/" rel="noreferrer">http://xkcd.com/505/</a>.</p>
| [
{
"answer_id": 302411,
"author": "Lucas Oman",
"author_id": 6726,
"author_profile": "https://Stackoverflow.com/users/6726",
"pm_score": 7,
"selected": true,
"text": "RULES:\n0: 0 0 0\n1: 0 0 1\n2: 0 1 0\n3: 0 1 ... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8724/"
] |
302,371 | <p><strong>Description |</strong> A Java program to read a text file and print each of the unique words in alphabetical order together with the number of times the word occurs in the text. </p>
<p>The program should declare a variable of type <code>Map<String, Integer></code> to store the words and corresponding frequency of occurrence. Which concrete type, though? <code>TreeMap<String, Number></code> or <code>HashMap<String, Number></code> ?</p>
<p>The input should be converted to lower case.</p>
<p>A word does not contain any of these characters: <code>\t\t\n]f.,!?:;\"()'</code></p>
<p><strong>Example output |</strong> </p>
<pre><code> Word Frequency
a 1
and 5
appearances 1
as 1
.
.
.
</code></pre>
<p><strong>Remark |</strong> I know, I've seen elegant solutions to this in Perl with roughly two lines of code. However, I want to see it in Java. </p>
<p>Edit: Oh yeah, it be helpful to show an implementation using one of these structures (in Java). </p>
| [
{
"answer_id": 302378,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 7,
"selected": true,
"text": "TreeMap"
},
{
"answer_id": 302402,
"author": "JodaStephen",
"author_id": 38896,
"author_profile": "ht... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302371",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38696/"
] |
302,379 | <p>Okay, this bugged me for several years, now. If you sucked in statistics and higher math at school, turn away, <em>now</em>. Too late.</p>
<p>Okay. Take a deep breath. Here are the rules. Take <em>two</em> thirty sided dice (yes, <a href="http://paizo.com/store/byCompany/k/koplow/dice/d30" rel="nofollow noreferrer">they do exist</a>) and roll them simultaneously.</p>
<ul>
<li>Add the two numbers</li>
<li>If both dice show <= 5 or >= 26, throw again and <em>add</em> the result to what you have</li>
<li>If one is <= 5 and the other >= 26, throw again and <em>subtract</em> the result from what
you have</li>
<li>Repeat until either is > 5 and < 26!</li>
</ul>
<p>If you write some code (see below), roll those dice a few million times and you count how often you receive each number as the final result, you get a curve that is pretty flat left of 1, around 45° degrees between 1 and 60 and flat above 60. The chance to roll 30.5 or better is greater than 50%, to roll better than 18 is 80% and to roll better than 0 is 97%.</p>
<p>Now the question: Is it possible to write a program to <em>calculate</em> the <em>exact</em> value f(x), i.e. the probability to roll a certain value?</p>
<p>Background: For our role playing game "Jungle of Stars" we looked for a way to keep random events in check. The rules above guarantee a much more stable outcome for something you try :)</p>
<p>For the geeks around, the code in Python:</p>
<pre><code>import random
import sys
def OW60 ():
"""Do an open throw with a "60" sided dice"""
val = 0
sign = 1
while 1:
r1 = random.randint (1, 30)
r2 = random.randint (1, 30)
#print r1,r2
val = val + sign * (r1 + r2)
islow = 0
ishigh = 0
if r1 <= 5:
islow += 1
elif r1 >= 26:
ishigh += 1
if r2 <= 5:
islow += 1
elif r2 >= 26:
ishigh += 1
if islow == 2 or ishigh == 2:
sign = 1
elif islow == 1 and ishigh == 1:
sign = -1
else:
break
#print sign
#print val
return val
result = [0] * 2000
N = 100000
for i in range(N):
r = OW60()
x = r+1000
if x < 0:
print "Too low:",r
if i % 1000 == 0:
sys.stderr.write('%d\n' % i)
result[x] += 1
i = 0
while result[i] == 0:
i += 1
j = len(result) - 1
while result[j] == 0:
j -= 1
pSum = 0
# Lower Probability: The probability to throw this or less
# Higher Probability: The probability to throw this or higher
print "Result;Absolut Count;Probability;Lower Probability;Rel. Lower Probability;Higher Probability;Rel. Higher Probability;"
while i <= j:
pSum += result[i]
print '%d;%d;%.10f;%d;%.10f;%d;%.10f' % (i-1000, result[i], (float(result[i])/N), pSum, (float(pSum)/N), N-pSum, (float(N-pSum)/N))
i += 1
</code></pre>
| [
{
"answer_id": 305649,
"author": "ShreevatsaR",
"author_id": 4958,
"author_profile": "https://Stackoverflow.com/users/4958",
"pm_score": 4,
"selected": true,
"text": "def OW60(sign=1):\n r1 = random.randint (1, 30)\n r2 = random.randint (1, 30)\n val = sign * (r1 + r2)\n\n is... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302379",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34088/"
] |
302,381 | <p>There's an in-house program we use and it's stored on a UNC share so that updates are transparent. I'd like to supply it some command line parameters like so:</p>
<pre><code>\\server\share\in_house_thingy.exe myusername mypassword
</code></pre>
<p>But I can't seem to get it to work in either CMD or PowerShell or via a shortcut.</p>
<p>Anyone got any ideas?</p>
| [
{
"answer_id": 305407,
"author": "Steven Murawski",
"author_id": 1233,
"author_profile": "https://Stackoverflow.com/users/1233",
"pm_score": 3,
"selected": false,
"text": "$app = '\\\\server\\share\\in_house_thingy.exe'\n$arguments = 'myusername mypassword'\n$process = [System.Diagnostic... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/549/"
] |
302,393 | <p>I'm just starting out with WiX as I need to be able to automate building an MSI on our CI server. Is there anyway to automatically include all the dependencies of a project?</p>
| [
{
"answer_id": 18517549,
"author": "Eric Craeymeersch",
"author_id": 2730260,
"author_profile": "https://Stackoverflow.com/users/2730260",
"pm_score": 2,
"selected": false,
"text": "call \"$(ProjectDir)GenerateDependency.bat\" \"$(SolutionDir)\" \"$(ProjectDir)Dependencies.wxs\"\n"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/302393",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5802/"
] |
302,399 | <p>Somehow my iPhone Simulator is unable to play sounds. First an app I'm working on using <code>AudioServicesPlaySystemSound()</code> stopped working.. I spent a while debugging this but sound is still working on the iPhone when I run the app on the device. I get the same results with other iPhone apps such as the sample Crash Landing app.</p>
<p>I can't find a sound setting anywhere in the simulator or Xcode preferences. I've tried resetting the simulator through "Reset Content and Settings" menu item to no avail.</p>
| [
{
"answer_id": 303102,
"author": "Marc Novakowski",
"author_id": 27020,
"author_profile": "https://Stackoverflow.com/users/27020",
"pm_score": 2,
"selected": false,
"text": "AudioSessionInitialize"
}
] | 2008/11/19 | [
"https://Stackoverflow.com/questions/302399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72/"
] |
302,409 | <p>Delphi strings use single quotes, for example '<code>a valid string</code>'. How does one specify the <code>'</code> character within a literal string? How would one refer to the null byte (Unicode code point <code>U+0000</code>)? </p>
| [
{
"answer_id": 302431,
"author": "Jamie",
"author_id": 922,
"author_profile": "https://Stackoverflow.com/users/922",
"pm_score": 7,
"selected": true,
"text": "'"
},
{
"answer_id": 302437,
"author": "vrad",
"author_id": 12891,
"author_profile": "https://Stackoverflow.c... | 2008/11/19 | [
"https://Stackoverflow.com/questions/302409",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2892/"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.