qid int64 4 8.14M | question stringlengths 20 48.3k | answers list | date stringlengths 10 10 | metadata list | input stringlengths 12 45k | output stringlengths 2 31.8k |
|---|---|---|---|---|---|---|
297,213 | <p>Given a columns' index, how can you get an Excel column name?</p>
<p>The problem is trickier than it sounds because it's <strong>not just base-26</strong>. The columns don't wrap over like normal digits would. Even the <a href="http://support.microsoft.com/kb/833402" rel="nofollow noreferrer">Microsoft Support Examp... | [
{
"answer_id": 297214,
"author": "Joel Coehoorn",
"author_id": 3043,
"author_profile": "https://Stackoverflow.com/users/3043",
"pm_score": 6,
"selected": true,
"text": "<p>The answer I came up with is to get a little recursive. This code is in VB.Net:</p>\n<pre class=\"lang-vb prettypri... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297213",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3043/"
] | Given a columns' index, how can you get an Excel column name?
The problem is trickier than it sounds because it's **not just base-26**. The columns don't wrap over like normal digits would. Even the [Microsoft Support Example](http://support.microsoft.com/kb/833402) doesn't scale beyond ZZZ.
*Disclaimer: This is some... | The answer I came up with is to get a little recursive. This code is in VB.Net:
```vb
Function ColumnName(ByVal index As Integer) As String
Static chars() As Char = {"A"c, "B"c, "C"c, "D"c, "E"c, "F"c, "G"c, "H"c, "I"c, "J"c, "K"c, "L"c, "M"c, "N"c, "O"c, "P"c, "Q"c, "R"c, "S"c, "T"c, "U"c, "V"c, "W"c, "X"c, "... |
297,217 | <p>I got a web application, the problem is that the text in the label will not update on the first click, I need to click the button twice, I debugged to code, and I found out that the label does not recive the data until after the second click,</p>
<p>Here is my code:</p>
<pre><code>System.Data.SqlClient.SqlCommand ... | [
{
"answer_id": 297230,
"author": "Dillie-O",
"author_id": 71,
"author_profile": "https://Stackoverflow.com/users/71",
"pm_score": 2,
"selected": false,
"text": "<p>I'm not seeing the typical</p>\n\n<pre><code>if (!Page.IsPostBack)\n{\n ...\n}\n</code></pre>\n\n<p>in your Page_Load meth... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I got a web application, the problem is that the text in the label will not update on the first click, I need to click the button twice, I debugged to code, and I found out that the label does not recive the data until after the second click,
Here is my code:
```
System.Data.SqlClient.SqlCommand command = new System.... | To be very clear. The button click event happens after the Page\_Load event meaning that the filtering does not get applied on the first postback. It has been updated on the second postback and you see the filtering. The simplest change to get your code to work is to move all the code in your Page\_Load event into OnPr... |
297,226 | <p>I remember reading about an automation program for windows that would accept a list of commands like this:</p>
<pre><code>press the ok button
put "hello world" into the text control
press the add button
</code></pre>
<p>etc etc. Can anyone name this program? A thousand thankyous.</p>
| [
{
"answer_id": 297295,
"author": "John",
"author_id": 2168,
"author_profile": "https://Stackoverflow.com/users/2168",
"pm_score": 0,
"selected": false,
"text": "<p>Maybe look for a port of AppleScript to Windows? Assuming such a beast does not exist, perhaps something like <a href=\"htt... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297226",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13500/"
] | I remember reading about an automation program for windows that would accept a list of commands like this:
```
press the ok button
put "hello world" into the text control
press the add button
```
etc etc. Can anyone name this program? A thousand thankyous. | Take a look at watin. <http://watin.sourceforge.net/>
Combined with Microsoft Oslo DSL. You can achieve this easily |
297,236 | <p>I am developing a site that makes extensive use of JavaScript (jQuery). I regularly get the IE 'Stop running this script?' error dialog when I try to close the browser. </p>
<p>I'm guessing the problem occurs because the site is a single page that uses AJAX, so there are no postbacks to reset IE's count of commands... | [
{
"answer_id": 297266,
"author": "Eric Wendelin",
"author_id": 25066,
"author_profile": "https://Stackoverflow.com/users/25066",
"pm_score": 2,
"selected": false,
"text": "<p>Do you by chance use a window.onunload handler? If you do, you might check that you don't have an infinite loop i... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297236",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2785/"
] | I am developing a site that makes extensive use of JavaScript (jQuery). I regularly get the IE 'Stop running this script?' error dialog when I try to close the browser.
I'm guessing the problem occurs because the site is a single page that uses AJAX, so there are no postbacks to reset IE's count of commands executed.... | Do you by chance use a window.onunload handler? If you do, you might check that you don't have an infinite loop in there.
To check, at the bottom of your javascript do:
```
window.onunload = null;
```
and test again. |
297,238 | <p>How do you repopulate a form in ASP.NET MVC that contains a DropDownList?</p>
| [
{
"answer_id": 316240,
"author": "BigJoe714",
"author_id": 37786,
"author_profile": "https://Stackoverflow.com/users/37786",
"pm_score": 3,
"selected": false,
"text": "<p>I believe you are asking how to maintain the value for a dropdown list after a form is submitted and re-displayed. I... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297238",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | How do you repopulate a form in ASP.NET MVC that contains a DropDownList? | I believe you are asking how to maintain the value for a dropdown list after a form is submitted and re-displayed. If so, please see below for a **VERY SIMPLE** example:
Create a new MVC app (using MVC beta) and place the following in HomeController:
```
private Dictionary<string, string> getListItems()
{
Diction... |
297,239 | <p>I am testing against the following test document:</p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
... | [
{
"answer_id": 297243,
"author": "Ned Batchelder",
"author_id": 14343,
"author_profile": "https://Stackoverflow.com/users/14343",
"pm_score": 6,
"selected": true,
"text": "<p>The problem is the namespaces. When parsed as XML, the img tag is in the <a href=\"http://www.w3.org/1999/xhtml\... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297239",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2168/"
] | I am testing against the following test document:
```
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>hi there</title>
</h... | The problem is the namespaces. When parsed as XML, the img tag is in the <http://www.w3.org/1999/xhtml> namespace since that is the default namespace for the element. You are asking for the img tag in no namespace.
Try this:
```
>>> tree.getroot().xpath(
... "//xhtml:img",
... namespaces={'xhtml':'http://www... |
297,245 | <p>Does anyone know of some good tutorials that explain how to use the JQuery Slider.</p>
<p>I've found a few, but none of them really present what I need in clear terms. What I really need to figure out how to do is make the slider go from 1.0 - 5.0 (including all tenths) and when it changes set a hidden control bas... | [
{
"answer_id": 297338,
"author": "nickf",
"author_id": 9021,
"author_profile": "https://Stackoverflow.com/users/9021",
"pm_score": 3,
"selected": true,
"text": "<p>The <a href=\"http://docs.jquery.com/UI/Slider/slider#options\" rel=\"nofollow noreferrer\">documentation on the jQuery site... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297245",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10420/"
] | Does anyone know of some good tutorials that explain how to use the JQuery Slider.
I've found a few, but none of them really present what I need in clear terms. What I really need to figure out how to do is make the slider go from 1.0 - 5.0 (including all tenths) and when it changes set a hidden control based on that ... | The [documentation on the jQuery site](http://docs.jquery.com/UI/Slider/slider#options) is pretty good.
```
$('#mySlider').slider({
min : 1,
max : 5,
stepping: .1, // or, steps: 40
change : function (e, ui) {
$('#myHiddenInput').val(ui.value);
}
})
``` |
297,251 | <p>I have a vertical menu in my system which is basically made of HTML <code>ul</code>/<code>li</code> with CSS styling (see image below). However I don't want the <code>li</code> items which are wider than the menu to wrap, I would prefer them to overflow with a horizontal scroll bar at the bottom of the menu. How can... | [
{
"answer_id": 297255,
"author": "sblundy",
"author_id": 4893,
"author_profile": "https://Stackoverflow.com/users/4893",
"pm_score": 3,
"selected": false,
"text": "<p>Use <code>white-space:nowrap</code>. Like so:</p>\n\n<pre><code>li {\n white-space:nowrap;\n}\n</code></pre>\n\n<p>Here'... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297251",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27294/"
] | I have a vertical menu in my system which is basically made of HTML `ul`/`li` with CSS styling (see image below). However I don't want the `li` items which are wider than the menu to wrap, I would prefer them to overflow with a horizontal scroll bar at the bottom of the menu. How can I do this in CSS? | ```
ul {
overflow: auto; // allow li's to overflow w/ scroll bar
// at the bottom of the menu
}
li {
white-space: nowrap; // stop the wrapping in the first place
}
``` |
297,269 | <p>Is there a tool which tells you (or gives you a hint) why a particular select statement dose not return any rows given the current data in your database. </p>
<p>eg if you had the following 4 table join</p>
<pre><code>select *
from a, b, c, d
where a.b_id = b.id
and b.c_id = c.id
and c.d_id = d.id
</code></pre>
... | [
{
"answer_id": 297289,
"author": "Cade Roux",
"author_id": 18255,
"author_profile": "https://Stackoverflow.com/users/18255",
"pm_score": 4,
"selected": false,
"text": "<p>I never have this problem, but I also use explicit joins so it's usually as simple as running parts of the query unti... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38383/"
] | Is there a tool which tells you (or gives you a hint) why a particular select statement dose not return any rows given the current data in your database.
eg if you had the following 4 table join
```
select *
from a, b, c, d
where a.b_id = b.id
and b.c_id = c.id
and c.d_id = d.id
```
If there were rows which satis... | This will get you started...
select count(1) from a, b where a.b\_id = b.id
select count(1) from b, c where b.c\_id = c.id
select count(1) from c, d where c.d\_id = d.id
Note that you are using AND so the overlap of the above queries may not be what you expect.
OR
Using MS-SQL Server Management Studio...
Display ... |
297,277 | <p>I am trying to do some prime factorisation with my VBA excel and I am hitting the limit of the <code>long</code> data type - </p>
<blockquote>
<p>Runtime Error 6 Overflow </p>
</blockquote>
<p>Is there any way to get around this and still stay within VBA? I am aware that the obvious one would be to use another m... | [
{
"answer_id": 297304,
"author": "Arvo",
"author_id": 35777,
"author_profile": "https://Stackoverflow.com/users/35777",
"pm_score": 2,
"selected": false,
"text": "<p>You can use Decimal data type. Quick hint from google: <a href=\"http://www.ozgrid.com/VBA/convert-to-decimal.htm\" rel=\"... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297277",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22972/"
] | I am trying to do some prime factorisation with my VBA excel and I am hitting the limit of the `long` data type -
>
> Runtime Error 6 Overflow
>
>
>
Is there any way to get around this and still stay within VBA? I am aware that the obvious one would be to use another more appropriate programming language.
---
... | MOD is trying to convert your DECIMAL type to LONG before operating on it. You may need to write your own MOD function for the DECIMAL type. You might try this:
```
r = A - Int(A / B) * B
```
where A & B are DECIMAL subtype of VARIANT variables, and r might have to be that large also (depending on your needs), thoug... |
297,280 | <p>I have a databases table with ~50K rows in it, each row represents a job that need to be done. I have a program that extracts a job from the DB, does the job and puts the result back in the db. (this system is running right now)</p>
<p>Now I want to allow more than one processing task to do jobs but be sure that no... | [
{
"answer_id": 297296,
"author": "Krunch",
"author_id": 35831,
"author_profile": "https://Stackoverflow.com/users/35831",
"pm_score": -1,
"selected": false,
"text": "<p>You are trying to implement de \"Database as IPC\" antipattern. Look it up to understand why you should consider redesi... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1343/"
] | I have a databases table with ~50K rows in it, each row represents a job that need to be done. I have a program that extracts a job from the DB, does the job and puts the result back in the db. (this system is running right now)
Now I want to allow more than one processing task to do jobs but be sure that no task is d... | Here's what I've used successfully in the past:
MsgQueue table schema
```
MsgId identity -- NOT NULL
MsgTypeCode varchar(20) -- NOT NULL
SourceCode varchar(20) -- process inserting the message -- NULLable
State char(1) -- 'N'ew if queued, 'A'(ctive) if processing, 'C'ompleted, default 'N' -- NOT NULL
CreateTime... |
297,294 | <p>My build environment is configured to compile, run and create coverage file at the command line (using Ned Batchelder coverage.py tool). </p>
<p>I'm using Eclipse with PyDev as my editor, but for practical reasons, it's not possible/convenient for me to convert my whole build environment to Eclipse (and thus genera... | [
{
"answer_id": 297296,
"author": "Krunch",
"author_id": 35831,
"author_profile": "https://Stackoverflow.com/users/35831",
"pm_score": -1,
"selected": false,
"text": "<p>You are trying to implement de \"Database as IPC\" antipattern. Look it up to understand why you should consider redesi... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297294",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8027/"
] | My build environment is configured to compile, run and create coverage file at the command line (using Ned Batchelder coverage.py tool).
I'm using Eclipse with PyDev as my editor, but for practical reasons, it's not possible/convenient for me to convert my whole build environment to Eclipse (and thus generate the cov... | Here's what I've used successfully in the past:
MsgQueue table schema
```
MsgId identity -- NOT NULL
MsgTypeCode varchar(20) -- NOT NULL
SourceCode varchar(20) -- process inserting the message -- NULLable
State char(1) -- 'N'ew if queued, 'A'(ctive) if processing, 'C'ompleted, default 'N' -- NOT NULL
CreateTime... |
297,299 | <p>I have my enumHelper class that contains these:</p>
<pre><code>public static IList<T> GetValues()
{
IList<T> list = new List<T>();
foreach (object value in Enum.GetValues(typeof(T)))
{
list.Add((T)value);
}
return list;
}
</code></pre>
<p>and</p>
<pre><code>public static string Des... | [
{
"answer_id": 297333,
"author": "nsayer",
"author_id": 13757,
"author_profile": "https://Stackoverflow.com/users/13757",
"pm_score": -1,
"selected": false,
"text": "<p>Enum doesn't have a Description() method. The best you could do is have your enum implement an interface that has the D... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297299",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have my enumHelper class that contains these:
```
public static IList<T> GetValues()
{
IList<T> list = new List<T>();
foreach (object value in Enum.GetValues(typeof(T)))
{
list.Add((T)value);
}
return list;
}
```
and
```
public static string Description(Enum value)
{
Attribute DescAttribute = LMIG... | Take a look at this [article](http://www.codeproject.com/KB/cs/enumdatabinding.aspx). You can do this using the System.ComponentModel.DescriptionAttribute or creating your own attribute:
```
/// <summary>
/// Provides a description for an enumerated type.
/// </summary>
[AttributeUsage(AttributeTargets.Enum | Attribut... |
297,335 | <p>I've got some code that will generically get all Controls in a form and put them in a list. Here's some of the code:</p>
<pre><code> private List<Control> GetControlList(Form parentForm)
{
List<Control> controlList = new List<Control>();
AddControlsToList(par... | [
{
"answer_id": 297365,
"author": "NotMe",
"author_id": 2424,
"author_profile": "https://Stackoverflow.com/users/2424",
"pm_score": 0,
"selected": false,
"text": "<p>The items such as ToolStripItem etc aren't actually controls, they are simply components that make up a ToolStrip or MenuSt... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297335",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21828/"
] | I've got some code that will generically get all Controls in a form and put them in a list. Here's some of the code:
```
private List<Control> GetControlList(Form parentForm)
{
List<Control> controlList = new List<Control>();
AddControlsToList(parentForm.Controls, controlList);
... | I believe the VS designer does it by getting an instance of the control's designer (see the [`Designer` attribute](http://msdn.microsoft.com/en-us/library/system.componentmodel.designerattribute.aspx)), and, if the designer is a [`ComponentDesigner`](http://msdn.microsoft.com/en-us/library/system.componentmodel.design.... |
297,345 | <p>I've got a large amount of data (a couple gigs) I need to write to a zip file in Python. I can't load it all into memory at once to pass to the .writestr method of ZipFile, and I really don't want to feed it all out to disk using temporary files and then read it back.</p>
<p>Is there a way to feed a generator or a... | [
{
"answer_id": 297376,
"author": "altunyurt",
"author_id": 37491,
"author_profile": "https://Stackoverflow.com/users/37491",
"pm_score": 2,
"selected": false,
"text": "<p>gzip.GzipFile writes the data in gzipped chunks , which you can set the size of your chunks according to the numbers ... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297345",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9161/"
] | I've got a large amount of data (a couple gigs) I need to write to a zip file in Python. I can't load it all into memory at once to pass to the .writestr method of ZipFile, and I really don't want to feed it all out to disk using temporary files and then read it back.
Is there a way to feed a generator or a file-like ... | The only solution is to rewrite the method it uses for zipping files to read from a buffer. It would be trivial to add this to the standard libraries; I'm kind of amazed it hasn't been done yet. I gather there's a lot of agreement the entire interface needs to be overhauled, and that seems to be blocking any incrementa... |
297,349 | <p>I am trying to use google search for my site:</p>
<p><a href="http://www.houseofhawkins.com/search.php" rel="noreferrer">http://www.houseofhawkins.com/search.php</a></p>
<p>It is not playing nice with some screen resolutions. Here is the code given from google:</p>
<pre><code><div id="cse-search-results">&... | [
{
"answer_id": 1085229,
"author": "Thomas Beck",
"author_id": 131794,
"author_profile": "https://Stackoverflow.com/users/131794",
"pm_score": 3,
"selected": false,
"text": "<p>I have three settings that you can tweak, a combination of which I hope will get you where you need to go:</p>\n... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297349",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6486/"
] | I am trying to use google search for my site:
<http://www.houseofhawkins.com/search.php>
It is not playing nice with some screen resolutions. Here is the code given from google:
```
<div id="cse-search-results"></div>
<script type="text/javascript">
var googleSearchIframeName = "cse-search-results";
var googleSe... | Ran into the same trouble you did wanting to resize the iFrame. You'd think changing the `googleSearchFrameWidth` value would do the trick, but nope.
So I resorted to DOM manipulation. Since the name of the iFrame is "`googleSearchFrame`", Right after the
```
<script type="text/javascript" src="http://www.google.com/... |
297,380 | <p>Ok, this has got to be a super simple problem. I just can't seem to find the answer anywhere. First - I'm not a web developer of any kind, I'm an old school c programmer - so don't flame me for what's probably something quite trivial :)</p>
<p>I need to write a small proof-of-concept web app using ASP.NET. My fi... | [
{
"answer_id": 297388,
"author": "GEOCHET",
"author_id": 5640,
"author_profile": "https://Stackoverflow.com/users/5640",
"pm_score": 3,
"selected": true,
"text": "<p>Your best bet is to use 'Publish website' from the Visual Studio Solution Explorer.</p>\n\n<p><a href=\"https://stackoverf... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33152/"
] | Ok, this has got to be a super simple problem. I just can't seem to find the answer anywhere. First - I'm not a web developer of any kind, I'm an old school c programmer - so don't flame me for what's probably something quite trivial :)
I need to write a small proof-of-concept web app using ASP.NET. My first attempt h... | Your best bet is to use 'Publish website' from the Visual Studio Solution Explorer.
[Chris Lively](https://stackoverflow.com/users/2424/chris-lively) adds:
>
> Just a minor add: Publish Website can
> be found by Right Clicking on the
> project name. The command will be
> named "Publish..."
>
>
> |
297,383 | <p>I am hoping to dynamically update a ModelForm's inline Meta class from my view. Although this code seems to update the exclude list in the Meta class, the output from <code>as_p()</code>, <code>as_ul()</code>, etc does not reflect the updated Meta exclude.</p>
<p>I assume then that the html is generated when the Mo... | [
{
"answer_id": 297478,
"author": "Daniel Naab",
"author_id": 32638,
"author_profile": "https://Stackoverflow.com/users/32638",
"pm_score": 7,
"selected": true,
"text": "<p>The Meta class is used to dynamically construct the form definition - so by the time you've created the ModelForm in... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22306/"
] | I am hoping to dynamically update a ModelForm's inline Meta class from my view. Although this code seems to update the exclude list in the Meta class, the output from `as_p()`, `as_ul()`, etc does not reflect the updated Meta exclude.
I assume then that the html is generated when the ModelForm is created not when the ... | The Meta class is used to dynamically construct the form definition - so by the time you've created the ModelForm instance, the fields not in the exclude have already been added as the new object's attributes.
The normal way to do it would be to just have multiple class definitions for each possible exclude list. But ... |
297,387 | <p>I have a problem where I am attempting to update a set of attributes with a fixed value contained within a repeating section of an XML document using the <code>Microsoft.BizTalk.Streaming.ValueMutator</code>. </p>
<p>For example the XML document which I am attempting to update contains the following input:</p>
<pr... | [
{
"answer_id": 297453,
"author": "Dimitre Novatchev",
"author_id": 36305,
"author_profile": "https://Stackoverflow.com/users/36305",
"pm_score": 0,
"selected": false,
"text": "<p>The XPath expression used:</p>\n\n<p> <strong><code>//namespace-uri()='http://Test.Schemas']... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297387",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3810/"
] | I have a problem where I am attempting to update a set of attributes with a fixed value contained within a repeating section of an XML document using the `Microsoft.BizTalk.Streaming.ValueMutator`.
For example the XML document which I am attempting to update contains the following input:
```
<ns0:TestXML xmlns:ns0="... | You need to include the alpha element in your XPath expression.
I ran your code using the expression below:
```
string xpathToUpdate = "/*[namespace-uri()='http://Test.Schemas']/*[local-name()='NodeA']/*[local-name()='NodeB']/*[local-name()='alpha']/@Type";
```
and got the following XML
```
<ns0:TestXML xmlns:ns0... |
297,392 | <p>I'm preferably looking for a SQL query to accomplish this, but other options might be useful too.</p>
| [
{
"answer_id": 297400,
"author": "WW.",
"author_id": 14663,
"author_profile": "https://Stackoverflow.com/users/14663",
"pm_score": 6,
"selected": true,
"text": "<pre><code>SELECT LAST_DDL_TIME, TIMESTAMP\nFROM USER_OBJECTS\nWHERE OBJECT_TYPE = 'PROCEDURE'\nAND OBJECT_NAME = 'MY_PROC';\n<... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1030/"
] | I'm preferably looking for a SQL query to accomplish this, but other options might be useful too. | ```
SELECT LAST_DDL_TIME, TIMESTAMP
FROM USER_OBJECTS
WHERE OBJECT_TYPE = 'PROCEDURE'
AND OBJECT_NAME = 'MY_PROC';
```
**`LAST_DDL_TIME`** is the last time it was compiled.
**`TIMESTAMP`** is the last time it was changed.
Procedures may need to be recompiled even if they have not changed when a dependency changes. |
297,398 | <p>How can I validate date strings in Perl? I'd like to account for leap years and also time zones. Someone may enter dates in the following formats:</p>
<pre>
11/17/2008
11/17/2008 3pm
11/17/2008 12:01am
11/17/2008 12:01am EST
11/17/2008 12:01am CST
</pre>
| [
{
"answer_id": 297402,
"author": "brian d foy",
"author_id": 2766176,
"author_profile": "https://Stackoverflow.com/users/2766176",
"pm_score": 3,
"selected": false,
"text": "<p><a href=\"http://search.cpan.org\" rel=\"noreferrer\">CPAN</a> has many packages for dealing with dates, such a... | 2008/11/17 | [
"https://Stackoverflow.com/questions/297398",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | How can I validate date strings in Perl? I'd like to account for leap years and also time zones. Someone may enter dates in the following formats:
```
11/17/2008
11/17/2008 3pm
11/17/2008 12:01am
11/17/2008 12:01am EST
11/17/2008 12:01am CST
``` | I use [DateTime::Format::DateManip](http://search.cpan.org/dist/DateTime-Format-DateManip/lib/DateTime/Format/DateManip.pm) for things like this. Using your dates....
```
use DateTime::Format::DateManip;
my @dates = (
'11/17/2008',
'11/17/2008 3pm',
'11/17/2008 12:01am',
'11/17/2008 12:01am EST',
... |
297,417 | <p>Can someone show me a regex to select <strong>#OnlinePopup_AFE53E2CACBF4D8196E6360D4DDB6B70</strong> its okay to assume <code>#OnlinePopup</code></p>
<pre><code>~DCTM~dctm://aicpcudev/37004e1f8000219e?DMS_OBJECT_SPEC=RELATION_ID#OnlinePopup_AFE53E2CACBF4D8196E6360D4DDB6B70_11472026_1214836152225_6455280574472127786... | [
{
"answer_id": 297428,
"author": "Robert Wagner",
"author_id": 10784,
"author_profile": "https://Stackoverflow.com/users/10784",
"pm_score": 3,
"selected": true,
"text": "<p>NB: The following is .NET Regex syntax, modify for your flavour.</p>\n<p>The following:</p>\n<pre><code>#[^_]+_[^_... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297417",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5653/"
] | Can someone show me a regex to select **#OnlinePopup\_AFE53E2CACBF4D8196E6360D4DDB6B70** its okay to assume `#OnlinePopup`
```
~DCTM~dctm://aicpcudev/37004e1f8000219e?DMS_OBJECT_SPEC=RELATION_ID#OnlinePopup_AFE53E2CACBF4D8196E6360D4DDB6B70_11472026_1214836152225_6455280574472127786
``` | NB: The following is .NET Regex syntax, modify for your flavour.
The following:
```
#[^_]+_[^_]+
```
will match:
* Hash
* One or more characters until an underscore
* Underscore
* One or more characters until an underscore
If the first bit is constant, and you want to be more specific you could use:
```
#OnlineP... |
297,431 | <p>When I create a new instance of a ChannelFactory:</p>
<pre><code>var factory = new ChannelFactory<IMyService>();
</code></pre>
<p>and that I create a new channel, I have an exception saying that the address of the Endpoint is null. </p>
<p>My configuration inside my web.config is as mentioned and everything... | [
{
"answer_id": 298110,
"author": "AnAngel",
"author_id": 38482,
"author_profile": "https://Stackoverflow.com/users/38482",
"pm_score": 3,
"selected": false,
"text": "<p>Will it work if you provide the endpoint with a name like this in Web.Config:</p>\n\n<pre><code><endpoint address=\"... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297431",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24975/"
] | When I create a new instance of a ChannelFactory:
```
var factory = new ChannelFactory<IMyService>();
```
and that I create a new channel, I have an exception saying that the address of the Endpoint is null.
My configuration inside my web.config is as mentioned and everything is as it is supposed to be (especially... | I finally found the answer. ChannelFactory doesn't read information from your Web.Config/app.config. ClientBase (which then work with a ChannelFactory) does.
All this costed me a few hours of work but I finally found a valid reason.
:) |
297,435 | <p>If I have...</p>
<pre><code>class Bunny < ActiveRecord::Base
has_many :carrots
end
</code></pre>
<p>...how can I check in the View if <code>@bunny</code> has any carrots? I want to do something like this:</p>
<pre><code><% if @bunny.carrots? %>
<strong>Yay! Carrots!</strong>
<% for ... | [
{
"answer_id": 297451,
"author": "JasonTrue",
"author_id": 13433,
"author_profile": "https://Stackoverflow.com/users/13433",
"pm_score": 1,
"selected": false,
"text": "<p>either:</p>\n\n<pre><code> if @bunny.carrots.length>0\n</code></pre>\n\n<p>or</p>\n\n<pre><code>unless @bunny.car... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297435",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32154/"
] | If I have...
```
class Bunny < ActiveRecord::Base
has_many :carrots
end
```
...how can I check in the View if `@bunny` has any carrots? I want to do something like this:
```
<% if @bunny.carrots? %>
<strong>Yay! Carrots!</strong>
<% for carrot in @bunny.carrots %>
You got a <%=h carrot.color %> carrot!<br... | ```
<% if @bunny.carrots.any? %>
<strong>Yay! Carrots!</strong>
<% for carrot in @bunny.carrots %>
You got a <%=h carrot.color %> carrot!<br />
<% end %>
<% end %>
``` |
297,449 | <p>Does anyone know how to disable authenticode signature verification in a .NET executable (to avoid slow startup) without using an application config file? In other words, do this:</p>
<pre><code><configuration>
<runtime>
<generatePublisherEvidence enabled="false"/>
</runtime>... | [
{
"answer_id": 327490,
"author": "Dirk Vollmar",
"author_id": 40347,
"author_profile": "https://Stackoverflow.com/users/40347",
"pm_score": 0,
"selected": false,
"text": "<p>Well, according to MSDN the element generatePublishersEvidence can only be used in a configuration file:</p>\n\n<b... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Does anyone know how to disable authenticode signature verification in a .NET executable (to avoid slow startup) without using an application config file? In other words, do this:
```
<configuration>
<runtime>
<generatePublisherEvidence enabled="false"/>
</runtime>
</configuration>
```
without an app... | If you are allowed to modify the Main() method, then what you could do is the following in your Main:
1. Create an application config file in memory with generatePublisherEvidence
2. Create a new application domain using the newly created application config file
3. Run the original Main in the other application domain... |
297,465 | <p>Is it possible to write a PL/SQL query to identify a complete list of a stored procedures dependencies? I'm only interested in identifying other stored procedures and I'd prefer not to limit the depth of nesting that it gets too either. For example, if A calls B, which calls C, which calls D, I'd want B, C and D rep... | [
{
"answer_id": 297492,
"author": "Eddie Awad",
"author_id": 17273,
"author_profile": "https://Stackoverflow.com/users/17273",
"pm_score": 4,
"selected": true,
"text": "<p>On <a href=\"http://www.oracle.com/technology/oramag/code/tips2004/091304.html\" rel=\"noreferrer\">this page</a>, yo... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297465",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1030/"
] | Is it possible to write a PL/SQL query to identify a complete list of a stored procedures dependencies? I'm only interested in identifying other stored procedures and I'd prefer not to limit the depth of nesting that it gets too either. For example, if A calls B, which calls C, which calls D, I'd want B, C and D report... | On [this page](http://www.oracle.com/technology/oramag/code/tips2004/091304.html), you will find the following query which uses the [PUBLIC\_DEPENDENCY](http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/statviews_5132.htm#REFRN29106) dictionary table:
```
SELECT lvl
, u.object_id
, u.object_typ... |
297,471 | <p>I get an error when I compile this code:</p>
<pre><code>using System;
public struct Vector2
{
public event EventHandler trigger;
public float X;
public float Y;
public Vector2 func()
{
Vector2 vector;
vector.X = 1;
vector.Y = 2;
return vector; // error CS0165:... | [
{
"answer_id": 297481,
"author": "Rob Walker",
"author_id": 3631,
"author_profile": "https://Stackoverflow.com/users/3631",
"pm_score": 5,
"selected": true,
"text": "<p>In C# you still need to 'new' a struct to call a constructor unless you are initializing <strong>all</strong> the field... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297471",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38413/"
] | I get an error when I compile this code:
```
using System;
public struct Vector2
{
public event EventHandler trigger;
public float X;
public float Y;
public Vector2 func()
{
Vector2 vector;
vector.X = 1;
vector.Y = 2;
return vector; // error CS0165: Use of unassi... | In C# you still need to 'new' a struct to call a constructor unless you are initializing **all** the fields. You left EventHandler member 'trigger' unassigned.
Try either assigning to 'trigger' or using:
```
Vector2 vector = new Vector2()
```
The new object is **not** allocated on the heap, it is still allocated on... |
297,472 | <p>I am trying to do a simple datagrid in Flex with a doubleclick event, but I cannot get <code>itemDoubleClick</code> to fire:</p>
<pre><code><mx:DataGrid id="gridReportConversions" height="100%" width="100%" mouseEnabled="true" doubleClickEnabled="true" itemDoubleClick="refererRowDoubleClicked(event)">
... | [
{
"answer_id": 297481,
"author": "Rob Walker",
"author_id": 3631,
"author_profile": "https://Stackoverflow.com/users/3631",
"pm_score": 5,
"selected": true,
"text": "<p>In C# you still need to 'new' a struct to call a constructor unless you are initializing <strong>all</strong> the field... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297472",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16940/"
] | I am trying to do a simple datagrid in Flex with a doubleclick event, but I cannot get `itemDoubleClick` to fire:
```
<mx:DataGrid id="gridReportConversions" height="100%" width="100%" mouseEnabled="true" doubleClickEnabled="true" itemDoubleClick="refererRowDoubleClicked(event)">
<mx:columns>
... | In C# you still need to 'new' a struct to call a constructor unless you are initializing **all** the fields. You left EventHandler member 'trigger' unassigned.
Try either assigning to 'trigger' or using:
```
Vector2 vector = new Vector2()
```
The new object is **not** allocated on the heap, it is still allocated on... |
297,482 | <p>I would like to be able to manipulate the DOM just before my page is sent to be printed. Internet Explorer has an event on the window object called "onbeforeprint" but this is proprietary and isn't supported by other browsers. Is it possible to do this via javascript (jQuery in particular, if possible)?</p>
<p>Befo... | [
{
"answer_id": 297545,
"author": "foxy",
"author_id": 30119,
"author_profile": "https://Stackoverflow.com/users/30119",
"pm_score": 3,
"selected": true,
"text": "<p>Adding <code>!important</code> after a property in your CSS will allow it to override the inline styles. For example:</p>\n... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32935/"
] | I would like to be able to manipulate the DOM just before my page is sent to be printed. Internet Explorer has an event on the window object called "onbeforeprint" but this is proprietary and isn't supported by other browsers. Is it possible to do this via javascript (jQuery in particular, if possible)?
Before you ask... | Adding `!important` after a property in your CSS will allow it to override the inline styles. For example:
```
<div class="test" style="color: blue;">Some Text</div>
```
css:
```
.test {
color: red !important;
}
```
will be displayed red. |
297,498 | <p>I am wondering if it is possible to use Code Access Security, and a custom permission class (and attribute), without having to register the assembly that the attribute is in, in the GAC.</p>
<p>At the moment, I get a TypeLoadException when the method with my attribute is called, and I can't seem to get around it. E... | [
{
"answer_id": 297545,
"author": "foxy",
"author_id": 30119,
"author_profile": "https://Stackoverflow.com/users/30119",
"pm_score": 3,
"selected": true,
"text": "<p>Adding <code>!important</code> after a property in your CSS will allow it to override the inline styles. For example:</p>\n... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297498",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/489/"
] | I am wondering if it is possible to use Code Access Security, and a custom permission class (and attribute), without having to register the assembly that the attribute is in, in the GAC.
At the moment, I get a TypeLoadException when the method with my attribute is called, and I can't seem to get around it. Everything ... | Adding `!important` after a property in your CSS will allow it to override the inline styles. For example:
```
<div class="test" style="color: blue;">Some Text</div>
```
css:
```
.test {
color: red !important;
}
```
will be displayed red. |
297,500 | <p>I am trying to make a gridview sortable which uses a stored procedure as a datasource, I would not want it to rerun the query each time to achieve this. How would I get it to work my current code is:</p>
<pre><code>protected override void OnPreRender(EventArgs e)
{
if (!IsPostBack)
{
SqlCommand cmd2 = n... | [
{
"answer_id": 297503,
"author": "Robert Wagner",
"author_id": 10784,
"author_profile": "https://Stackoverflow.com/users/10784",
"pm_score": 0,
"selected": false,
"text": "<p>You could try storing the data in view state (or cache).</p>\n"
},
{
"answer_id": 297613,
"author": "... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297500",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16989/"
] | I am trying to make a gridview sortable which uses a stored procedure as a datasource, I would not want it to rerun the query each time to achieve this. How would I get it to work my current code is:
```
protected override void OnPreRender(EventArgs e)
{
if (!IsPostBack)
{
SqlCommand cmd2 = new SqlCommand(... | If you are not paging the results, and just doing a read, then something like the jquery tablesorter plugin would be a quick and easy fix. I have used this on tables of up to 1400 rows and works great, although ~> few hundred probably better on slow putas.
If the gridview is editable, then aspnet event/input validatio... |
297,504 | <p>Is there a way in MySQL to select rows which fall on a specific day, as in Mondays, using a date column?</p>
| [
{
"answer_id": 297510,
"author": "Grant Limberg",
"author_id": 27314,
"author_profile": "https://Stackoverflow.com/users/27314",
"pm_score": 2,
"selected": false,
"text": "<p>Look up the DAYOFWEEK() function <a href=\"http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#fu... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297504",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3410/"
] | Is there a way in MySQL to select rows which fall on a specific day, as in Mondays, using a date column? | MySQL [DAYOFWEEK](http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_dayofweek) function.
E.g. to select Mondays:
```
SELECT * FROM foo WHERE DAYOFWEEK(bar) = 2
``` |
297,514 | <p>I have the following makefile that I use to build a program (a kernel, actually) that I'm working on. Its from scratch and I'm learning about the process, so its not perfect, but I think its powerful enough at this point for my level of experience writing makefiles.</p>
<pre><code>AS = nasm
CC = gcc
LD = l... | [
{
"answer_id": 297523,
"author": "mipadi",
"author_id": 28804,
"author_profile": "https://Stackoverflow.com/users/28804",
"pm_score": 3,
"selected": false,
"text": "<p>You'll have to make individual targets for each C file, and then list the header file as a dependency. You can still use... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297514",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19521/"
] | I have the following makefile that I use to build a program (a kernel, actually) that I'm working on. Its from scratch and I'm learning about the process, so its not perfect, but I think its powerful enough at this point for my level of experience writing makefiles.
```
AS = nasm
CC = gcc
LD = ld
TARGET ... | As already pointed out elsewhere on this site, see this page:
[Auto-Dependency Generation](http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/)
In short, gcc can automatically create .d dependency files for you, which are mini makefile fragments containing the dependencies of the .c file you comp... |
297,526 | <p>I do remember seeing someone ask something along these lines a while ago but I did a search and couldn't find anything. </p>
<p>I'm trying to come up with the cleanest way to clear all the controls on a form back to their defaults (e.g., clear textboxes, uncheck checkboxes).</p>
<p>How would you go about this?</p>... | [
{
"answer_id": 297529,
"author": "Nathan W",
"author_id": 6335,
"author_profile": "https://Stackoverflow.com/users/6335",
"pm_score": 5,
"selected": true,
"text": "<p>What I have come up with so far is something like this:</p>\n\n<pre><code>public static class extenstions\n{\n private... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297526",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6335/"
] | I do remember seeing someone ask something along these lines a while ago but I did a search and couldn't find anything.
I'm trying to come up with the cleanest way to clear all the controls on a form back to their defaults (e.g., clear textboxes, uncheck checkboxes).
How would you go about this? | What I have come up with so far is something like this:
```
public static class extenstions
{
private static Dictionary<Type, Action<Control>> controldefaults = new Dictionary<Type, Action<Control>>() {
{typeof(TextBox), c => ((TextBox)c).Clear()},
{typeof(CheckBox), c => ((CheckBox)c).Che... |
297,530 | <p>I have a view that I would like the user to rotate around its center, by tapping and holding somewhere and just move their finger round and round.</p>
<p>I have all the geometry worked out; What I do is store the initial touch angle relative to the center as offsetAngle, then my touchesMoved method looks like this:... | [
{
"answer_id": 299787,
"author": "e.James",
"author_id": 33686,
"author_profile": "https://Stackoverflow.com/users/33686",
"pm_score": 2,
"selected": false,
"text": "<p>I would use the coordinate system of the superview, since it is unaffected by the rotation:</p>\n\n<pre><code>- (void)t... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297530",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32617/"
] | I have a view that I would like the user to rotate around its center, by tapping and holding somewhere and just move their finger round and round.
I have all the geometry worked out; What I do is store the initial touch angle relative to the center as offsetAngle, then my touchesMoved method looks like this:
```
- (v... | I would use the coordinate system of the superview, since it is unaffected by the rotation:
```
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
CGPoint location = [[touches anyObject] locationInView:self.superview];
CGPoint relativeTouch = [MathHelper translatePoint:location relativeTo:self.... |
297,555 | <p>I have a multipart form that takes basic user information at the beginning with some jquery.validate error checking to see if the fields have been filled in and the email address is valid.</p>
<p>Below that there is a series of check boxes (type_of_request) for new accounts, delete accounts, new software etc which ... | [
{
"answer_id": 297597,
"author": "tvanfosson",
"author_id": 12950,
"author_profile": "https://Stackoverflow.com/users/12950",
"pm_score": 2,
"selected": false,
"text": "<p>Assuming that you are using the jQuery <a href=\"http://bassistance.de/jquery-plugins/jquery-plugin-validation/\" re... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297555",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38419/"
] | I have a multipart form that takes basic user information at the beginning with some jquery.validate error checking to see if the fields have been filled in and the email address is valid.
Below that there is a series of check boxes (type\_of\_request) for new accounts, delete accounts, new software etc which show/hid... | The solution I ended up going with was to link the jquery.validate.js and jquery.metadata.js from <http://bassistance.de/jquery-plugins/jquery-plugin-validation/>
I then had a check list of request types at the top of the form which show/hide the id element when you checked the item (show/hide function not shown).
``... |
297,563 | <p>I have a property defined in my HBM file like this:</p>
<pre><code><property name="OwnerId" column="OwnerID" type="System.Int32" not-null="false" />
</code></pre>
<p>It is defined as a nullable field in the database also. If a record in the DB has the OwnerID column set to an integer, this object is correct... | [
{
"answer_id": 297597,
"author": "tvanfosson",
"author_id": 12950,
"author_profile": "https://Stackoverflow.com/users/12950",
"pm_score": 2,
"selected": false,
"text": "<p>Assuming that you are using the jQuery <a href=\"http://bassistance.de/jquery-plugins/jquery-plugin-validation/\" re... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297563",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10475/"
] | I have a property defined in my HBM file like this:
```
<property name="OwnerId" column="OwnerID" type="System.Int32" not-null="false" />
```
It is defined as a nullable field in the database also. If a record in the DB has the OwnerID column set to an integer, this object is correctly loaded by NHibernate. But if t... | The solution I ended up going with was to link the jquery.validate.js and jquery.metadata.js from <http://bassistance.de/jquery-plugins/jquery-plugin-validation/>
I then had a check list of request types at the top of the form which show/hide the id element when you checked the item (show/hide function not shown).
``... |
297,589 | <p>There's some object-oriented engineering principle that states something along the lines of "a class should only know about the contracts of the classes that it takes as arguments, or any internal ones it uses."</p>
<p>The counter-example, in C++, is:</p>
<pre><code>Foo::bar( Baz* baz)
{
baz()->blargh()->p... | [
{
"answer_id": 297604,
"author": "Steven A. Lowe",
"author_id": 9345,
"author_profile": "https://Stackoverflow.com/users/9345",
"pm_score": 4,
"selected": true,
"text": "<p>The <a href=\"http://en.wikipedia.org/wiki/Law_of_Demeter\" rel=\"nofollow noreferrer\">law of demeter</a> <sub>tha... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297589",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37834/"
] | There's some object-oriented engineering principle that states something along the lines of "a class should only know about the contracts of the classes that it takes as arguments, or any internal ones it uses."
The counter-example, in C++, is:
```
Foo::bar( Baz* baz)
{
baz()->blargh()->pants()->soil(); // this is... | The [law of demeter](http://en.wikipedia.org/wiki/Law_of_Demeter) thanks to [Jim Burger](https://stackoverflow.com/users/20164/jim-burger) says:
>
> The Law of Demeter (LoD), or Principle of Least Knowledge, is a design guideline for developing software, particularly object-oriented programs. The guideline was invent... |
297,592 | <p>Im sure this will be a simple one but have a project that started as a test.<br>
When it was created it was saved as "Project2.dpr"</p>
<p>Now the test is no longer a 'test', i would like to change the projects name to something more meaningful. </p>
<p>whats the best way to do this?</p>
<p>Any issues with just c... | [
{
"answer_id": 297714,
"author": "Francesca",
"author_id": 9842,
"author_profile": "https://Stackoverflow.com/users/9842",
"pm_score": 6,
"selected": true,
"text": "<p>Just do \"Save Project as\" from the file menu in Delphi giving it the name you want and, later on when you feel like, r... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297592",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11016/"
] | Im sure this will be a simple one but have a project that started as a test.
When it was created it was saved as "Project2.dpr"
Now the test is no longer a 'test', i would like to change the projects name to something more meaningful.
whats the best way to do this?
Any issues with just changing the file name and... | Just do "Save Project as" from the file menu in Delphi giving it the name you want and, later on when you feel like, remove the Project2.\* files from your folder as they are not needed anymore. |
297,609 | <p>What is the simplest way to get the NT-ID of a user in a C# application? I would probably need to get it only having a name of the user, or maybe an email address.</p>
| [
{
"answer_id": 297805,
"author": "DylanW",
"author_id": 13463,
"author_profile": "https://Stackoverflow.com/users/13463",
"pm_score": 2,
"selected": true,
"text": "<p>From within SharePoint, you can get a user's Active Directory information (including display name and email) using SPUtil... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297609",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29227/"
] | What is the simplest way to get the NT-ID of a user in a C# application? I would probably need to get it only having a name of the user, or maybe an email address. | From within SharePoint, you can get a user's Active Directory information (including display name and email) using SPUtility.ResolveWindowsPrincipal:
<http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.utilities.sputility.resolvewindowsprincipal.aspx>
For example:
```
SPPrincipalInfo pi = SPUtility.Resolve... |
297,636 | <pre><code>System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. at
System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams) at
System.Drawing.Image.Save(String filename, ImageFormat format) at
System.Drawing.Image.Save(String filename) at
Content... | [
{
"answer_id": 297658,
"author": "Dino Viehland",
"author_id": 37940,
"author_profile": "https://Stackoverflow.com/users/37940",
"pm_score": 2,
"selected": false,
"text": "<p>There's no release of VB (or C#) that is hostable via the DLR hosting APIs. In general the DLR hosting APIs, and... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297636",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31065/"
] | ```
System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. at
System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams) at
System.Drawing.Image.Save(String filename, ImageFormat format) at
System.Drawing.Image.Save(String filename) at
Content.btnAdd... | There's no release of VB (or C#) that is hostable via the DLR hosting APIs. In general the DLR hosting APIs, and the possibility of getting more MS created languages to support them, are tenatively thought to be post-Dev10. So it won't happen anytime in the short term. |
297,654 | <p>I'm learning about Win32 programming, and the <code>WinMain</code> prototype looks like:</p>
<pre><code>int WINAPI WinMain ( HINSTANCE instance, HINSTANCE prev_instance, PSTR cmd_line, int cmd_show )
</code></pre>
<p>I was confused as to what this <code>WINAPI</code> identifier was for and found:</p>
<pre><code>#... | [
{
"answer_id": 297661,
"author": "Rob Walker",
"author_id": 3631,
"author_profile": "https://Stackoverflow.com/users/3631",
"pm_score": 9,
"selected": true,
"text": "<p><code>__stdcall</code> is the calling convention used for the function. This tells the compiler the rules that apply f... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30529/"
] | I'm learning about Win32 programming, and the `WinMain` prototype looks like:
```
int WINAPI WinMain ( HINSTANCE instance, HINSTANCE prev_instance, PSTR cmd_line, int cmd_show )
```
I was confused as to what this `WINAPI` identifier was for and found:
```
#define WINAPI __stdcall
```
What does this do? I'm c... | `__stdcall` is the calling convention used for the function. This tells the compiler the rules that apply for setting up the stack, pushing arguments and getting a return value.
There are a number of other calling conventions, `__cdecl`, `__thiscall`, `__fastcall` and the wonderfully named `__declspec(naked)`. `__stdc... |
297,656 | <p>I'm having a syntax error.
I want to take the floor of a function that returns a floating point number.</p>
<p>I <em>thought</em> this would give me the right answer</p>
<pre><code>let cyclesPerInterrupt bps bpw cpu factor =
floor (fudge (float(factor) cyclesPerWord cpu wordsPerSec bps bpw))
</code></pre>
<p>Bu... | [
{
"answer_id": 297752,
"author": "Brian",
"author_id": 19299,
"author_profile": "https://Stackoverflow.com/users/19299",
"pm_score": 2,
"selected": false,
"text": "<p>Note also that you can use parens to nest the function calls the way you were originally trying to, e.g.</p>\n\n<pre><cod... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297656",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26227/"
] | I'm having a syntax error.
I want to take the floor of a function that returns a floating point number.
I *thought* this would give me the right answer
```
let cyclesPerInterrupt bps bpw cpu factor =
floor (fudge (float(factor) cyclesPerWord cpu wordsPerSec bps bpw))
```
But it doesn't. I've tried everything I ca... | Note also that you can use parens to nest the function calls the way you were originally trying to, e.g.
```
...(cyclesPerWord cpu (wordsPerSec bps bpw))
```
(Without the inner set of parens above, it's kinda like you're trying to pass 4 arguments to cyclesPerWord, which is not what you want.) |
297,671 | <p>I have read a book whose title is "Oracle PL SQL Programming" (2nd ed.) by Steven Feuerstein & Bill Pribyl. On page 99, there is a point suggested that </p>
<p><strong>Do not "SELECT COUNT(*)" from a table unless you really need to know the total number of "hits." If you only need to know whether there is more ... | [
{
"answer_id": 297699,
"author": "Cade Roux",
"author_id": 18255,
"author_profile": "https://Stackoverflow.com/users/18255",
"pm_score": 1,
"selected": false,
"text": "<p>He means open a cursor and fetch not only the first record but the second, and then you will know there is more than ... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1602746/"
] | I have read a book whose title is "Oracle PL SQL Programming" (2nd ed.) by Steven Feuerstein & Bill Pribyl. On page 99, there is a point suggested that
**Do not "SELECT COUNT(\*)" from a table unless you really need to know the total number of "hits." If you only need to know whether there is more than one match, sim... | There are a number of reasons why developers might perform select COUNT(\*) from a table in a PL/SQL program:
1) They genuinely need to know how many rows there are in the table.
====================================================================
In this case there is no choice: select COUNT(\*) and wait for the res... |
297,678 | <p>I am implementing an asynchronous command pattern for the "client" class in a client/server application. I have done some socket coding in the past and I like the new Async pattern that they used in the Socket / SocketAsyncEventArgs classes.</p>
<p>My async method looks like this: <code>public bool ExecuteAsync(Com... | [
{
"answer_id": 297706,
"author": "cstick",
"author_id": 2735,
"author_profile": "https://Stackoverflow.com/users/2735",
"pm_score": 1,
"selected": false,
"text": "<p>I would throw a custom exception and not call the completed callback. After all, the command was not completed if an exce... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297678",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16387/"
] | I am implementing an asynchronous command pattern for the "client" class in a client/server application. I have done some socket coding in the past and I like the new Async pattern that they used in the Socket / SocketAsyncEventArgs classes.
My async method looks like this: `public bool ExecuteAsync(Command cmd);` It ... | throwing an exception from the dispatch point may or may not be useful
calling the callback passing an exception argument requires the completion callback to do 2 distinct things
a second callback for exception reporting might make sense instead |
297,680 | <p>I have a code sample that gets a <code>SEL</code> from the current object, </p>
<pre><code>SEL callback = @selector(mymethod:parameter2);
</code></pre>
<p>And I have a method like </p>
<pre><code> -(void)mymethod:(id)v1 parameter2;(NSString*)v2 {
}
</code></pre>
<p>Now I need to move <code>mymethod</code> to ano... | [
{
"answer_id": 297695,
"author": "Grant Limberg",
"author_id": 27314,
"author_profile": "https://Stackoverflow.com/users/27314",
"pm_score": 4,
"selected": false,
"text": "<p>You can't pass a parameter in a @selector().</p>\n\n<p>It looks like you're trying to implement a callback. The ... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32096/"
] | I have a code sample that gets a `SEL` from the current object,
```
SEL callback = @selector(mymethod:parameter2);
```
And I have a method like
```
-(void)mymethod:(id)v1 parameter2;(NSString*)v2 {
}
```
Now I need to move `mymethod` to another object, say `myDelegate`.
I have tried:
```
SEL callback = @sele... | SEL is a type that represents a selector in Objective-C. The @selector() keyword returns a SEL that you describe. It's not a function pointer and you can't pass it any objects or references of any kind. For each variable in the selector (method), you have to represent that in the call to @selector. For example:
```
-(... |
297,686 | <p>Is there a good <strong>cross-browser</strong> way to set a <code>max-height</code> property of a DIV and when that DIV goes beyond the <code>max-height</code>, it turns into an overflow with scrollbars?</p>
| [
{
"answer_id": 297688,
"author": "RedWolves",
"author_id": 648,
"author_profile": "https://Stackoverflow.com/users/648",
"pm_score": 1,
"selected": false,
"text": "<p>Could you have a wrapper div with the height set as your height and overflow: scrolling. Then the inner div has no heigh... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10420/"
] | Is there a good **cross-browser** way to set a `max-height` property of a DIV and when that DIV goes beyond the `max-height`, it turns into an overflow with scrollbars? | Sadly IE6 doesn't so you have to use an expression for IE6, then set the max-height for all other browsers:
```
div{
_height: expression( this.scrollHeight > 332 ? "333px" : "auto" ); /* sets max-height for IE6 */
max-height: 333px; /* sets max-height value for all standards-compliant browsers */
... |
297,687 | <p>I haven't worked much with Visual Studio before. I've started a personal project in my spare time and I would like to use test-driven development since it has been a huge benefit to me in my Java development. I started this project quite a while ago, and I used CppUnit. I know there are probably other frameworks tha... | [
{
"answer_id": 297688,
"author": "RedWolves",
"author_id": 648,
"author_profile": "https://Stackoverflow.com/users/648",
"pm_score": 1,
"selected": false,
"text": "<p>Could you have a wrapper div with the height set as your height and overflow: scrolling. Then the inner div has no heigh... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297687",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I haven't worked much with Visual Studio before. I've started a personal project in my spare time and I would like to use test-driven development since it has been a huge benefit to me in my Java development. I started this project quite a while ago, and I used CppUnit. I know there are probably other frameworks that a... | Sadly IE6 doesn't so you have to use an expression for IE6, then set the max-height for all other browsers:
```
div{
_height: expression( this.scrollHeight > 332 ? "333px" : "auto" ); /* sets max-height for IE6 */
max-height: 333px; /* sets max-height value for all standards-compliant browsers */
... |
297,713 | <p>I would like to convert an array if IDs, into a string of comma separated values, to use in a MySQL UPDATE query. How would I do this?</p>
| [
{
"answer_id": 297719,
"author": "Eran Galperin",
"author_id": 10585,
"author_profile": "https://Stackoverflow.com/users/10585",
"pm_score": 4,
"selected": false,
"text": "<pre><code>implode(',', $array);\n</code></pre>\n"
},
{
"answer_id": 297825,
"author": "Dana the Sane",
... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297713",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I would like to convert an array if IDs, into a string of comma separated values, to use in a MySQL UPDATE query. How would I do this? | Remember to escape values:
```
'"' . implode('","', array_map('mysql_real_escape_string', $data)) . '"'
``` |
297,749 | <p>Given:</p>
<pre><code>CR = %0d = \r
LF = %0a = \n
</code></pre>
<p>What does</p>
<p>%3E,
%3C </p>
<p>Mean?</p>
| [
{
"answer_id": 297756,
"author": "Chris Marasti-Georg",
"author_id": 96,
"author_profile": "https://Stackoverflow.com/users/96",
"pm_score": 4,
"selected": true,
"text": "<p>They are URL encoded characters. %3C is <, %3E is ></p>\n\n<p>More info on <a href=\"http://www.blooberry.c... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4960/"
] | Given:
```
CR = %0d = \r
LF = %0a = \n
```
What does
%3E,
%3C
Mean? | They are URL encoded characters. %3C is <, %3E is >
More info on [URL Encoding](http://www.blooberry.com/indexdot/html/topics/urlencoding.htm), and [a chart](http://www.asciitable.com/) of some of the lower ASCII values. |
297,822 | <p>As the title says. How would I create an instance of a class that is globally available(for example I have a functor for printing and i want to have a single global instance of this(though the possibility of creating more)).</p>
| [
{
"answer_id": 297826,
"author": "Joel Martinez",
"author_id": 5416,
"author_profile": "https://Stackoverflow.com/users/5416",
"pm_score": 0,
"selected": false,
"text": "<p>the <a href=\"http://en.wikipedia.org/wiki/Singleton_pattern\" rel=\"nofollow noreferrer\">Singleton pattern</a> is... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297822",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37181/"
] | As the title says. How would I create an instance of a class that is globally available(for example I have a functor for printing and i want to have a single global instance of this(though the possibility of creating more)). | Going to all the effort of making a singleton object using the usual pattern isn't addressing the second part of your question - the ability to make more if needed. The singleton "pattern" is very restrictive and isn't anything more than a global variable by another name.
```
// myclass.h
class MyClass {
public:
... |
297,850 | <p>I have spent several hours trying to find a means of writing a cross platform password prompt in php that hides the password that is input by the user. While this is easily accomplished in Unix environments through the use of stty -echo, I have tried various means of passthru() and system() calls to make windows do... | [
{
"answer_id": 297943,
"author": "Bill Karwin",
"author_id": 20860,
"author_profile": "https://Stackoverflow.com/users/20860",
"pm_score": 3,
"selected": false,
"text": "<p>There doesn't seem to be an IOCTL or STTY extension for PHP. I found the following trick <a href=\"http://www.usen... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297850",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have spent several hours trying to find a means of writing a cross platform password prompt in php that hides the password that is input by the user. While this is easily accomplished in Unix environments through the use of stty -echo, I have tried various means of passthru() and system() calls to make windows do the... | Here's a Windows solution, using the COM extension for PHP. I tested this on Windows XP with PHP 5.2.6.
```
<?php
$pwObj = new Com('ScriptPW.Password');
print "Password: ";
$passwd = $pwObj->getPassword();
echo "Your password is $passwd\n";
?>
``` |
297,889 | <p>I have an MDI application that allows me to open different types of child windows. I can open multiple (but different) instances of the same type of child window. (Example: I can open 3 instances of child window type A and 2 instances of child window type B. All 5 windows are distinct entities and do not share da... | [
{
"answer_id": 377487,
"author": "Hinek",
"author_id": 20580,
"author_profile": "https://Stackoverflow.com/users/20580",
"pm_score": 0,
"selected": false,
"text": "<p>Have you tried to use the DragEnter and DragLeave Events of the ToolStripContainer to identify a ToolStrip dragged over t... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20788/"
] | I have an MDI application that allows me to open different types of child windows. I can open multiple (but different) instances of the same type of child window. (Example: I can open 3 instances of child window type A and 2 instances of child window type B. All 5 windows are distinct entities and do not share data unt... | This feels like a hack, but it works (kind of) (sorry, vb.net not c#):
```
Public Class UserControl2
Private Sub tsMainMenu_BeginDrag(ByVal sender As Object, ByVal e As System.EventArgs) Handles tsMainMenu.BeginDrag
tsMainMenu.Tag = tsMainMenu.Parent
End Sub
Private Sub ToolStrip1_EndDrag(ByVal... |
297,895 | <p>I've been trying with the idea of taking an existing ASP.NET Webforms application and converting it to a hybrid so that going forward, we can do ASP.NET MVC.</p>
<p>In order to do this, I created an ASP.NET MVC application and started copying some of the folders from the ASP.NET webforms projects that contain webfo... | [
{
"answer_id": 297901,
"author": "Kyle West",
"author_id": 34133,
"author_profile": "https://Stackoverflow.com/users/34133",
"pm_score": 2,
"selected": false,
"text": "<p>I think you'd have a lot easier conversion adding the System.Web.Mvc assemblies to your current project and updating ... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297895",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7961/"
] | I've been trying with the idea of taking an existing ASP.NET Webforms application and converting it to a hybrid so that going forward, we can do ASP.NET MVC.
In order to do this, I created an ASP.NET MVC application and started copying some of the folders from the ASP.NET webforms projects that contain webforms. I'm h... | I think you'd have a lot easier conversion adding the System.Web.Mvc assemblies to your current project and updating the web.config file and global.asax.
You have to make sure your current application is a web application (not site) project. If it isn't convert it and make sure it compiles first. |
297,899 | <p>I am trying to import an existing PDF as a template with FPDI. The template is in landscape format. If I import the template into a new document the template page is inserted in portrait form with the content rotated 90 degrees. If my new document is in portrait the full content appears, but if the new document i... | [
{
"answer_id": 300565,
"author": "crono",
"author_id": 1462,
"author_profile": "https://Stackoverflow.com/users/1462",
"pm_score": 6,
"selected": true,
"text": "<p>sure, it is no problem. Just add \"L\" as parameter when calling \"addPage()\". Here is a sample which works fine for me (th... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38458/"
] | I am trying to import an existing PDF as a template with FPDI. The template is in landscape format. If I import the template into a new document the template page is inserted in portrait form with the content rotated 90 degrees. If my new document is in portrait the full content appears, but if the new document is also... | sure, it is no problem. Just add "L" as parameter when calling "addPage()". Here is a sample which works fine for me (the template is in landscape)
```
<?php
require_once('fpdf.php');
require_once('fpdi.php');
$pdf =& new FPDI();
$pdf->addPage('L');
$pagecount = $pdf->setSourceFile('template.pdf');
$tplIdx = $pdf->im... |
297,909 | <p>I have a question about variable initialization in MASM's assembly. </p>
<p>How can I initialize 2^32 to a variable and to what kind of variable should I initialize? DWORD or REAL4?</p>
<p>I try to do it like:</p>
<pre><code>val DWORD 2.0E+32
</code></pre>
<p>When I assign var to a register(e.g. mov eax,val) and... | [
{
"answer_id": 297957,
"author": "Artelius",
"author_id": 31945,
"author_profile": "https://Stackoverflow.com/users/31945",
"pm_score": 2,
"selected": false,
"text": "<p>2^32 = 4294967296 = 0x100000000 (that's 8 zeroes).</p>\n\n<p><strong><code>2.0E+32</code></strong> is 2 * 10^32 = 2000... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297909",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26379/"
] | I have a question about variable initialization in MASM's assembly.
How can I initialize 2^32 to a variable and to what kind of variable should I initialize? DWORD or REAL4?
I try to do it like:
```
val DWORD 2.0E+32
```
When I assign var to a register(e.g. mov eax,val) and try to write the value, I see something... | 2^32 = 4294967296 = 0x100000000 (that's 8 zeroes).
**`2.0E+32`** is 2 \* 10^32 = 200000000000000000000000000000000, a *completely* different number. It's also a floating-point number, whereas **`0x100000000`** is an integer. |
297,938 | <p>In Java, is there a way to have a window that is "Always on top" regardless if the user switches focus to another application? I've searched the web, and all of the solutions lean to some sort of JNI interface with native bindings. Truly this can't be the only way to do it?.. or is it?</p>
| [
{
"answer_id": 297948,
"author": "OscarRyz",
"author_id": 20654,
"author_profile": "https://Stackoverflow.com/users/20654",
"pm_score": 8,
"selected": true,
"text": "<p>Try this method of the <code>Window</code> class:</p>\n\n<p><a href=\"http://java.sun.com/javase/6/docs/api/java/awt/Wi... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297938",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14204/"
] | In Java, is there a way to have a window that is "Always on top" regardless if the user switches focus to another application? I've searched the web, and all of the solutions lean to some sort of JNI interface with native bindings. Truly this can't be the only way to do it?.. or is it? | Try this method of the `Window` class:
[Window.setAlwaysOnTop(boolean)](http://java.sun.com/javase/6/docs/api/java/awt/Window.html#setAlwaysOnTop%28boolean%29)
It works the same way as the default in the Windows TaskManager: switch to another app but it shows always on top.
This was added in Java 1.5
Sample code:
... |
297,945 | <p>Using Flex 3, I have a Button which is skinned using PNGs specified in a CSS style sheet.</p>
<pre><code>Button.addextra {
downSkin : Embed( source="img/add-extra-icon.png" );
overSkin : Embed( source="img/add-extra-icon.png" );
upSkin : Embed( source="img/add-extra-icon.png" );
disabledSkin : ... | [
{
"answer_id": 303301,
"author": "Ryan Guill",
"author_id": 7186,
"author_profile": "https://Stackoverflow.com/users/7186",
"pm_score": 1,
"selected": true,
"text": "<p>I believe you will need to change the overSkin, i think that would be the only way.</p>\n"
},
{
"answer_id": 10... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15525/"
] | Using Flex 3, I have a Button which is skinned using PNGs specified in a CSS style sheet.
```
Button.addextra {
downSkin : Embed( source="img/add-extra-icon.png" );
overSkin : Embed( source="img/add-extra-icon.png" );
upSkin : Embed( source="img/add-extra-icon.png" );
disabledSkin : Embed( source=... | I believe you will need to change the overSkin, i think that would be the only way. |
297,951 | <p>my goal is to get lots of rows from a translation table. I use an ID to get a subset of the table (say 50 rows) then I use another ID to the rows I want from this subset. Using typed datasets I do the following to get the main dataset: </p>
<pre><code>funderTextsDS.tbl_funderTextsDataTable fd =
(funderTextsDS.tbl_... | [
{
"answer_id": 297979,
"author": "Nathan W",
"author_id": 6335,
"author_profile": "https://Stackoverflow.com/users/6335",
"pm_score": 0,
"selected": false,
"text": "<p>I'm not sure if this will help but try and use a .where instead of .single. Somthing like this:</p>\n\n<pre><code>var da... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37083/"
] | my goal is to get lots of rows from a translation table. I use an ID to get a subset of the table (say 50 rows) then I use another ID to the rows I want from this subset. Using typed datasets I do the following to get the main dataset:
```
funderTextsDS.tbl_funderTextsDataTable fd =
(funderTextsDS.tbl_funderTextsDat... | Ah, so in the TableAdapter method, you're pulling rows into memory and then querying those in-memory rows further. That's easy to do in LINQ.
```
myDataContext dc = new myDataContext();
List<FunderText> myList = myDataContext.tbl_funderTexts.ToList();
List<string> result1 = new List<string>();
foreach(var theValue in... |
297,954 | <p>I have this form in my view: </p>
<pre><code><!-- Bug (extra 'i') right here-----------v -->
<!-- was: <form method="post" enctype="mulitipart/form-data" action="/Task/SaveFile"> -->
<form method="post" enctype="multipart/form-data" action="/Task/SaveFile">
<input type="file" id="FileBlo... | [
{
"answer_id": 297966,
"author": "Pure.Krome",
"author_id": 30674,
"author_profile": "https://Stackoverflow.com/users/30674",
"pm_score": 2,
"selected": false,
"text": "<pre><code>var file = Request.Files[sFileName];\n</code></pre>\n\n<p>should be...</p>\n\n<pre><code>var file = Request.... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2187/"
] | I have this form in my view:
```
<!-- Bug (extra 'i') right here-----------v -->
<!-- was: <form method="post" enctype="mulitipart/form-data" action="/Task/SaveFile"> -->
<form method="post" enctype="multipart/form-data" action="/Task/SaveFile">
<input type="file" id="FileBlob" name="FileBlob"/>
<input type="submit"... | I don't know what the policy is on posting profanity, but here's the problem:
```
enctype="mulitipart/form-data"
```
The extra `i` in there stopped the file from uploading. Had to run Fiddler to see that it was never sending the file in the first place.
It should read:
```
enctype="multipart/form-data"
``` |
297,955 | <p>I am developing a .NET CF based Graphics Application, my project involves a lot of drawing images, We have decided to go for porting the application on different handset resolution.(240 X 240 , 480 X 640) etc. </p>
<p>How would i go onto achieve this within single solution/project?</p>
<p>Is there a need to create... | [
{
"answer_id": 298025,
"author": "kgiannakakis",
"author_id": 24054,
"author_profile": "https://Stackoverflow.com/users/24054",
"pm_score": 2,
"selected": false,
"text": "<p>This code has worked for me in determining the resolution of the screen dynamically:</p>\n\n<pre><code>[DllImport(... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13046/"
] | I am developing a .NET CF based Graphics Application, my project involves a lot of drawing images, We have decided to go for porting the application on different handset resolution.(240 X 240 , 480 X 640) etc.
How would i go onto achieve this within single solution/project?
Is there a need to create different projec... | Don't listen to that idiot MusiGenesis. A much better way of handling different screen resolutions for Windows Mobile devices is to use **forms inheritance**, which can be tacked onto an existing CF application with minimal effort.
Basically, you design each form for a standard 240x320 screen. When you need to re-arra... |
297,996 | <p>I'm currently working on a very short project on Prolog, and just got stuck trying to apply a "filter" I have created to a list. I have what you could call the filter ready, but I can't apply it. It'd be better if I illustrate:</p>
<pre><code>filter(A, B)
</code></pre>
<p>...outputs 'true' if certain conditions a... | [
{
"answer_id": 298022,
"author": "Sergio Morales",
"author_id": 9506,
"author_profile": "https://Stackoverflow.com/users/9506",
"pm_score": 0,
"selected": false,
"text": "<p>Well what'd you know I just figured it out. So, here's me submitting an answer to my own question, as expected a r... | 2008/11/18 | [
"https://Stackoverflow.com/questions/297996",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9506/"
] | I'm currently working on a very short project on Prolog, and just got stuck trying to apply a "filter" I have created to a list. I have what you could call the filter ready, but I can't apply it. It'd be better if I illustrate:
```
filter(A, B)
```
...outputs 'true' if certain conditions are met.
```
filterList(A,... | If you are searching for higher-order functions in Prolog, you should definetly consult [Naish (1995)](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.35.4505), a very good resource on this.
His definition of `filter/3` is the following (he uses difference-list notation, therefore escapes having to define `fil... |
298,004 | <p>Is there a neat archiving library that automatically handles archiving a folder or directories for you out there?
I am using Jython, so Java libs are also open for use.
-UPDATE-
Also Im looking for timestamp archiving. ie </p>
<p>archive-dir/2008/11/16/zipfilebypreference.zip</p>
<p>then the next day call it again... | [
{
"answer_id": 298027,
"author": "Andrew Cox",
"author_id": 27907,
"author_profile": "https://Stackoverflow.com/users/27907",
"pm_score": 1,
"selected": false,
"text": "<p>You can use java.util.zip, when I was using Jython the built in zip library in python didn't work </p>\n"
},
{
... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21537/"
] | Is there a neat archiving library that automatically handles archiving a folder or directories for you out there?
I am using Jython, so Java libs are also open for use.
-UPDATE-
Also Im looking for timestamp archiving. ie
archive-dir/2008/11/16/zipfilebypreference.zip
then the next day call it again and it creates a... | You have either the:
* [gzip library](http://www.xhaus.com/alan/python/httpcomp.html) used here in a Jython servlet:
```
import javax.servlet.http.HttpServlet
import cStringIO
import gzip
import string
def compressBuf(buf):
zbuf = cStringIO.StringIO()
zfile = gzip.GzipFile(mode = 'wb', fileobj = zbuf, ... |
298,009 | <p>Is there any way to direct C# to ignore <code>NullReferenceException</code> (or any specific exception for that matter) for a set of statements.
This is useful when trying to read properties from a deserialized object that may contain many null objects in it.
Having a helper method to check for null could be one wa... | [
{
"answer_id": 298012,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 3,
"selected": false,
"text": "<p>In short: no. Null-check the reference before trying to use it. One useful trick here might be C# 3.0 extension me... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298009",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7722/"
] | Is there any way to direct C# to ignore `NullReferenceException` (or any specific exception for that matter) for a set of statements.
This is useful when trying to read properties from a deserialized object that may contain many null objects in it.
Having a helper method to check for null could be one way but I'm look... | now I'm using delegate and NullReferenceException handling
```
public delegate string SD();//declare before class definition
string X = GetValue(() => Message.instance[0].prop1.prop2.ID); //usage
//GetValue defintion
private string GetValue(SD d){
try
{
return d();
}
catc... |
298,011 | <p>I have seen posts that show three ways to reset the DMV views:</p>
<ol>
<li>Reset the SQL Service</li>
<li>Detatch the database</li>
<li>Close the database</li>
</ol>
<p>All of these methods seem to require taking the system off-line for a few moments. Is there a way to reset the statistics on demand without inte... | [
{
"answer_id": 298666,
"author": "Jonas Lincoln",
"author_id": 17436,
"author_profile": "https://Stackoverflow.com/users/17436",
"pm_score": 0,
"selected": false,
"text": "<p>As far as I know, these views will only be updated when the instance is restarted.</p>\n\n<p>However, for some vi... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32992/"
] | I have seen posts that show three ways to reset the DMV views:
1. Reset the SQL Service
2. Detatch the database
3. Close the database
All of these methods seem to require taking the system off-line for a few moments. Is there a way to reset the statistics on demand without interrupting use of the database? When we ha... | You can [reset exactly 2 DMVs](http://msdn.microsoft.com/en-us/library/ms189768(SQL.90).aspx) only (BOL link)
```
sys.dm_os_latch_stats
sys.dm_os_wait_stats
``` |
298,013 | <p>Say I have entities organized in a hierarchy with <code>Parent</code> being the root entity and <code>Child</code> being a subclass of <code>Parent</code>. I'd like to setup an <code>NSArrayController</code> to fetch only entities of <code>Parent</code>, but not <code>Child</code>.</p>
<p>If you set the Entity Nam... | [
{
"answer_id": 298119,
"author": "Chris Hanson",
"author_id": 714,
"author_profile": "https://Stackoverflow.com/users/714",
"pm_score": 3,
"selected": false,
"text": "<p>Leopard introduced the <code>includesSubentities</code> property to NSFetchRequest for exactly this purpose. You'll h... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298013",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26825/"
] | Say I have entities organized in a hierarchy with `Parent` being the root entity and `Child` being a subclass of `Parent`. I'd like to setup an `NSArrayController` to fetch only entities of `Parent`, but not `Child`.
If you set the Entity Name of the array controller in Interface Builder to `Parent`, it fetches all `P... | I tried using `includesSubentities`, but it ended up not working completely. It turns out changes to subentities cause the array controller's content to get updated without doing a fetch if you have "automatically prepares content" set to "Yes", thus bypassing the custom fetch predicate. The backtrace shows `setContent... |
298,015 | <p>Do developers have to put certain/extra elements in the feed's XML file or attributes in the hyperlink for the browser to recognize that it's a feed that can be subscribed to? Or do browsers do that automatically as long as the XML validates?</p>
<p>(showing users that "Subscribe to this feed using..." interface in... | [
{
"answer_id": 298021,
"author": "Oddthinking",
"author_id": 8014,
"author_profile": "https://Stackoverflow.com/users/8014",
"pm_score": 0,
"selected": false,
"text": "<p>The feed isn't just XML, but should follow a format such as <a href=\"http://en.wikipedia.org/wiki/ATOM\" rel=\"nofol... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298015",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/57936/"
] | Do developers have to put certain/extra elements in the feed's XML file or attributes in the hyperlink for the browser to recognize that it's a feed that can be subscribed to? Or do browsers do that automatically as long as the XML validates?
(showing users that "Subscribe to this feed using..." interface in Firefox o... | Most modern browsers are intelligent enough to inspect an XML data source and HTTP headers and determine if it represents a syndication feed (typically formatted as Atom or RSS). However, there are a couple of things you can do to improve auto-discovery of syndication feeds within a web site and when dynamically genera... |
298,016 | <p>What are all the problem that you foresee in doing that.</p>
| [
{
"answer_id": 298077,
"author": "Robert Gould",
"author_id": 15124,
"author_profile": "https://Stackoverflow.com/users/15124",
"pm_score": 2,
"selected": false,
"text": "<p>How big of a code base are you talking about?</p>\n\n<p>Porting a little program (that is mostly non-templated C++... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22076/"
] | What are all the problem that you foresee in doing that. | 1. **VC 6 is no longer supported by Microsoft**, in any way. If something goes wrong and for whatever reason we were not able to compile, we would be completely on our own unable to get any assistance from Microsoft. It seems unlikely that something could go wrong in this way, but if the code in question is a main sour... |
298,039 | <p>I have a custom control that I need to use in another custom control. I have written all code at server side (no HTML). Can anyone tell me how to write below line of code in code behind using <code>htmlTextWriter</code> and how to register this control or how to write custom control within another where html is writ... | [
{
"answer_id": 298061,
"author": "Chris Fulstow",
"author_id": 38126,
"author_profile": "https://Stackoverflow.com/users/38126",
"pm_score": 2,
"selected": false,
"text": "<p>First, build a simple custom web control:</p>\n\n<pre><code>namespace My.Controls\n{\n public class InnerContr... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have a custom control that I need to use in another custom control. I have written all code at server side (no HTML). Can anyone tell me how to write below line of code in code behind using `htmlTextWriter` and how to register this control or how to write custom control within another where html is written from code ... | First, build a simple custom web control:
```
namespace My.Controls
{
public class InnerControl : Control
{
protected override void Render(HtmlTextWriter writer)
{
writer.WriteLine("<h1>Inner Control</h1>");
}
}
}
```
Then build your second web control that contains an... |
298,048 | <p><a href="http://mumble.net/~campbell/emacs/paredit.el" rel="noreferrer">paredit</a> binds <code>M-<up></code> and <code>M-<down></code>, but I want <a href="http://www.emacswiki.org/emacs/WindMove" rel="noreferrer">windmove</a> to own those keybindings. I have paredit-mode set to activate in certain mod... | [
{
"answer_id": 298685,
"author": "Emerick Rogul",
"author_id": 33837,
"author_profile": "https://Stackoverflow.com/users/33837",
"pm_score": 5,
"selected": true,
"text": "<p>You can use <code>eval-after-load</code> to configure paredit's behavior after loading it, as described in its com... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23070/"
] | [paredit](http://mumble.net/~campbell/emacs/paredit.el) binds `M-<up>` and `M-<down>`, but I want [windmove](http://www.emacswiki.org/emacs/WindMove) to own those keybindings. I have paredit-mode set to activate in certain modes only, but windmove is set to run globally. I want windmove to win, but paredit steals those... | You can use `eval-after-load` to configure paredit's behavior after loading it, as described in its comments:
```
;;; Customize paredit using `eval-after-load':
;;;
;;; (eval-after-load 'paredit
;;; '(progn ...redefine keys, &c....))
```
So, for example:
```
(eval-after-load 'paredit
'(progn
(define-ke... |
298,049 | <p>I want to, from JavaScript, access as a variable the file that is loaded as an image in an img tag. </p>
<h2>I don't want to access its name, but the actual data.</h2>
<p>The reason for this is that I want to be able to copy it to and from variables so that I can , among other things, change the image without relo... | [
{
"answer_id": 298050,
"author": "Falco Foxburr",
"author_id": 37266,
"author_profile": "https://Stackoverflow.com/users/37266",
"pm_score": -1,
"selected": false,
"text": "<p>Try this:</p>\n\n<pre><code>img = new Image(); \nimg.src = \"imagefile.jpg\";\n</code></pre>\n"
},
{
"an... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298049",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1343/"
] | I want to, from JavaScript, access as a variable the file that is loaded as an image in an img tag.
I don't want to access its name, but the actual data.
-----------------------------------------------------
The reason for this is that I want to be able to copy it to and from variables so that I can , among other th... | ```
// Download the image data using AJAX, I'm using jQuery
var imageData = $.ajax({ url: "MyImage.gif", async: false }).responseText;
// Image data updating magic
imageDataChanged = ChangeImage(imageData);
// Encode to base64, maybe try the webtoolkit.base64.js library
imageDataEncoded = Base64Encode(imageDataChange... |
298,064 | <p>When trying to work with Qt's signal/slot mechanisms over more than one level of inheritance, I ran into a problem: When my class does not directly inherit from QObject, signals and slots don't seem to work any more.</p>
<p>The output of the following program illustrates the case:</p>
<pre><code>require 'Qt'
clas... | [
{
"answer_id": 406675,
"author": "Henrik Hartz",
"author_id": 50830,
"author_profile": "https://Stackoverflow.com/users/50830",
"pm_score": 1,
"selected": false,
"text": "<p>To be able to utilize signals and slots - or more importantly the meta object system in Qt, the class has to inher... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298064",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34039/"
] | When trying to work with Qt's signal/slot mechanisms over more than one level of inheritance, I ran into a problem: When my class does not directly inherit from QObject, signals and slots don't seem to work any more.
The output of the following program illustrates the case:
```
require 'Qt'
class A < Qt::Object
si... | As Terence Simpson pointed out, this is a bug that was still present in Qt Ruby 1.4.9. It got fixed in the meantime. |
298,074 | <p>I would like to add a method to a built-in type (e.g. Double), so that I can use an <code>infix</code> operator. Is that possible?</p>
| [
{
"answer_id": 298087,
"author": "Daniel Spiewak",
"author_id": 9815,
"author_profile": "https://Stackoverflow.com/users/9815",
"pm_score": 5,
"selected": true,
"text": "<p>Yes and no. Yes, you can make it <em>seem</em> like you have added a method to <code>double</code>. For example:<... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34596/"
] | I would like to add a method to a built-in type (e.g. Double), so that I can use an `infix` operator. Is that possible? | Yes and no. Yes, you can make it *seem* like you have added a method to `double`. For example:
```
class MyRichDouble(d: Double) {
def <>(other: Double) = d != other
}
implicit def doubleToSyntax(d: Double) = new MyRichDouble(d)
```
This code adds the previously-unavailable `<>` operator to any object of type `Do... |
298,116 | <p>In a JSF dataTable I want to display the row index next to the rows... like:</p>
<pre><code>Column A Column B
1 xxx
2 yyy
</code></pre>
<p>I thought that I could use an implicit el variable like #{rowIndex} but this is not working.</p>
<p>A solution I found is to create a binding for the da... | [
{
"answer_id": 298612,
"author": "McDowell",
"author_id": 304,
"author_profile": "https://Stackoverflow.com/users/304",
"pm_score": 5,
"selected": true,
"text": "<p>The existing solution does not strike me as a bad one. The rowIndex should work in nested tables so long as you're referenc... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298116",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19331/"
] | In a JSF dataTable I want to display the row index next to the rows... like:
```
Column A Column B
1 xxx
2 yyy
```
I thought that I could use an implicit el variable like #{rowIndex} but this is not working.
A solution I found is to create a binding for the data table and use the binding like... | The existing solution does not strike me as a bad one. The rowIndex should work in nested tables so long as you're referencing the model of the nested table.
```
<h:dataTable border="1" value="#{nestedDataModel}" var="nested">
<h:column>
<h:dataTable border="1" value="#{nested}" var="item">
... |
298,139 | <p>I'm passing a reference of a form to a class. Within this class I believed I could use <code>formRef->Controls["controlName"]</code> to access properties on the control.</p>
<p>This works for a few labels, but on a button I receive a "Object reference not set to an instance of an object." when I try to change th... | [
{
"answer_id": 298146,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 1,
"selected": false,
"text": "<p>That suggests that the control with the given name wasn't found.</p>\n\n<p>Don't forget that the name of the control ... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/37583/"
] | I'm passing a reference of a form to a class. Within this class I believed I could use `formRef->Controls["controlName"]` to access properties on the control.
This works for a few labels, but on a button I receive a "Object reference not set to an instance of an object." when I try to change the Text property.
Help o... | I did this, and it's working. Could possibly be safer as I can check if the control actually exists...
```
array<Control^>^ id = myForm->Controls->Find("myButton", true);
id[0]->Text = "new text";
```
I think the reason it breaks is that the button is on another panel. I didn't think of that when I posted. The new s... |
298,162 | <p>Ok well I've been trying to convert my model to use LINQ but didn't want to throw away my current DTO's and their interfaces which are scattered through the domain.</p>
<p>I managed to find this blog post which has outlined the process quite nicely:</p>
<p><a href="http://www.sidarok.com/web/blog/content/2008/10/1... | [
{
"answer_id": 298248,
"author": "GeekyMonkey",
"author_id": 29900,
"author_profile": "https://Stackoverflow.com/users/29900",
"pm_score": 0,
"selected": false,
"text": "<p>I'd suggest sending your code to Sidar Ok. He's a nice guy and will point you in the right direction. Or at least... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298162",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12948/"
] | Ok well I've been trying to convert my model to use LINQ but didn't want to throw away my current DTO's and their interfaces which are scattered through the domain.
I managed to find this blog post which has outlined the process quite nicely:
[Achieving POCOs in LINQ To SQL](http://www.sidarok.com/web/blog/content/20... | I guess the problem is in your test method. You created a Repository with a DataContext but you did your submits with another one.
```
[Test]
public void AddSelectionShouldAddSelectionToMarket()
{
Market market = (Market) new Repository().GetMarket(1);
Selection selection = new Selection();
selection.Mark... |
298,167 | <p>Instead of writing</p>
<pre><code>((x: Double) => (((y: Double) => y*y))(x+x))(3)
</code></pre>
<p>I would like to write something like</p>
<pre><code>((x: Double) => let y=x+x in y*y)(3)
</code></pre>
<p>Is there anything like this sort of syntactic sugar in Scala?</p>
| [
{
"answer_id": 299310,
"author": "Daniel Spiewak",
"author_id": 9815,
"author_profile": "https://Stackoverflow.com/users/9815",
"pm_score": 5,
"selected": true,
"text": "<p>Indeed there is: it's called \"<code>val</code>\". :-)</p>\n\n<pre><code>({ x: Double =>\n val y = x + x\n y ... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34596/"
] | Instead of writing
```
((x: Double) => (((y: Double) => y*y))(x+x))(3)
```
I would like to write something like
```
((x: Double) => let y=x+x in y*y)(3)
```
Is there anything like this sort of syntactic sugar in Scala? | Indeed there is: it's called "`val`". :-)
```
({ x: Double =>
val y = x + x
y * y
})(3)
```
The braces are of course optional here, I just prefer them to parentheses when defining functions (after all, this isn't Lisp). The `val` keyword defines a new binding within the current lexical scope. Scala doesn't force... |
298,169 | <p>Ok guys any idea how i may go about creating an answers file for an unattended install for say WinAmp?</p>
<p>So far all my research points to is doing an unattended install for windows or some other OS. What I want to do is create an unattended install for a 3rd party software. Are there tools to do this? Or is un... | [
{
"answer_id": 298178,
"author": "workmad3",
"author_id": 16035,
"author_profile": "https://Stackoverflow.com/users/16035",
"pm_score": 0,
"selected": false,
"text": "<p>AFAIK, it's just a pipe dream for software that doesn't provide you with a mechanism in the installer to do one. </p>\... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298169",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38210/"
] | Ok guys any idea how i may go about creating an answers file for an unattended install for say WinAmp?
So far all my research points to is doing an unattended install for windows or some other OS. What I want to do is create an unattended install for a 3rd party software. Are there tools to do this? Or is unattended i... | The term you should be googling is "silent install" rather than "unattended install".
Most likely you're looking for MSI based installation which can be silently installed by
```
MSIEXEC /I file.msi /QUIET
```
For non-MSI installs, you can either repackage them or follow the documentation for the specific product.
... |
298,183 | <p>Is it better to initialize class member variables on declaration</p>
<pre><code>private List<Thing> _things = new List<Thing>();
private int _arb = 99;
</code></pre>
<p>or in the default constructor?</p>
<pre><code>private List<Thing> _things;
private int _arb;
public TheClass()
{
_things = n... | [
{
"answer_id": 298193,
"author": "Kent Boogaart",
"author_id": 5380,
"author_profile": "https://Stackoverflow.com/users/5380",
"pm_score": 2,
"selected": false,
"text": "<p>For instance variables, it is largely a matter of style (I prefer using a constructor). For static variables, there... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298183",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1535/"
] | Is it better to initialize class member variables on declaration
```
private List<Thing> _things = new List<Thing>();
private int _arb = 99;
```
or in the default constructor?
```
private List<Thing> _things;
private int _arb;
public TheClass()
{
_things = new List<Thing>();
_arb = 99;
}
```
Is it simply a m... | In terms of performance, there is no real difference; field initializers are implemented as constructor logic. The only difference is that field initializers happen before any "base"/"this" constructor.
The constructor approach can be used with auto-implemented properties (field initializers cannot) - i.e.
```
[Defau... |
298,185 | <p>Google app engine tells me to optimize this code. Anybody any ideas what I could do?</p>
<pre><code>def index(request):
user = users.get_current_user()
return base.views.render('XXX.html',
dict(profiles=Profile.gql("").fetch(limit=100), user=user))
</code></pre>
<p>And later in the templa... | [
{
"answer_id": 298204,
"author": "macbirdie",
"author_id": 5049,
"author_profile": "https://Stackoverflow.com/users/5049",
"pm_score": 2,
"selected": false,
"text": "<p>I would guess that performing an md5 hash on every item every time is pretty costly. Better store the gravatar email ha... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298185",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Google app engine tells me to optimize this code. Anybody any ideas what I could do?
```
def index(request):
user = users.get_current_user()
return base.views.render('XXX.html',
dict(profiles=Profile.gql("").fetch(limit=100), user=user))
```
And later in the template I do:
```
{% for profi... | The high CPU usage will be due to fetching 100 entities per request. You have several options here:
* Using Profile.all().fetch(100) will be ever so slightly faster, and easier to read besides.
* Remove any extraneous properties from the Profile model. There's significant per-property overhead deserializing entities.
... |
298,194 | <p>I develop one application using VB.net (200%) that connects to MS-Access Database, I use TableAdapter and Dataset for connection to the Access DB file.</p>
<p>I need to implement a simple transaction method (commit, rollback) in saving to the DB?</p>
<p>Is there a way to do that without the need to use inline SQL ... | [
{
"answer_id": 298249,
"author": "user38123",
"author_id": 38123,
"author_profile": "https://Stackoverflow.com/users/38123",
"pm_score": -1,
"selected": false,
"text": "<p>You can find a bunch of data access tutorials at <a href=\"http://www.asp.net/learn/data-access/\" rel=\"nofollow no... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298194",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I develop one application using VB.net (200%) that connects to MS-Access Database, I use TableAdapter and Dataset for connection to the Access DB file.
I need to implement a simple transaction method (commit, rollback) in saving to the DB?
Is there a way to do that without the need to use inline SQL statement?
Thank... | As I read Microsoft Jet (Access DB Engine) supports transactions. So you can create a transaction like this (example from [CodeProject](http://www.codeproject.com/KB/database/transactions.aspx)):
```
SqlConnection db = new SqlConnection("connstringhere");
SqlTransaction transaction;
db.Open();
... |
298,219 | <p>I'm looking to find a way to access the .net query string contained in the standard ASP.NET request object inside a web service. In other words if I set a SOAP web service to this url:</p>
<p><a href="http://localhost/service.asmx?id=2" rel="noreferrer">http://localhost/service.asmx?id=2</a></p>
<p>Can I access th... | [
{
"answer_id": 298229,
"author": "Ali Ersöz",
"author_id": 4215,
"author_profile": "https://Stackoverflow.com/users/4215",
"pm_score": 5,
"selected": true,
"text": "<p>I just looked for \"Request\" of the context in asmx file and I saw that. But I'm not sure if it is right.</p>\n\n<pre><... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298219",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32582/"
] | I'm looking to find a way to access the .net query string contained in the standard ASP.NET request object inside a web service. In other words if I set a SOAP web service to this url:
<http://localhost/service.asmx?id=2>
Can I access the ID Get variable? | I just looked for "Request" of the context in asmx file and I saw that. But I'm not sure if it is right.
```
this.Context.Request.QueryString["id"];
``` |
298,228 | <p>This led on from the question about asking if Apache Maven and IBM Rational ClearCase integrated well. Thought I should write up what I found out - will require various edits, but I shall eventually get round to adding it all I hope.</p>
<h2>Environment</h2>
<p><strong>ClearCase</strong> - Version 7.0.1.2 of ClearCa... | [
{
"answer_id": 298239,
"author": "Romain Linsolas",
"author_id": 26457,
"author_profile": "https://Stackoverflow.com/users/26457",
"pm_score": 1,
"selected": false,
"text": "<p>I am not using this SCM, but there is a <a href=\"http://maven.apache.org/scm/clearcase.html\" rel=\"nofollow n... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31161/"
] | This led on from the question about asking if Apache Maven and IBM Rational ClearCase integrated well. Thought I should write up what I found out - will require various edits, but I shall eventually get round to adding it all I hope.
Environment
-----------
**ClearCase** - Version 7.0.1.2 of ClearCase.
**Maven** - A... | I have some Maven repositories outside of ClearCase, for some third-parties libraries referential.
But I have never used Maven **with** ClearCase since they follow a different logic (Maven needs signed names for files, like myfile-1.2.jar, whereas ClearCase can store only myfile.jar, and record the fact it is version ... |
298,231 | <p>I have following string</p>
<pre><code>String str = "replace :) :) with some other string";
</code></pre>
<p>And I want to replace first occurance of <code>:)</code> with some other string</p>
<p>And I used <code>str.replaceFirst(":)","hi");</code></p>
<p>it gives following exception</p>
<blockquote>
<p>"Unma... | [
{
"answer_id": 298240,
"author": "Greg Hewgill",
"author_id": 893,
"author_profile": "https://Stackoverflow.com/users/893",
"pm_score": 3,
"selected": false,
"text": "<p>The <code>replaceFirst</code> method takes a regular expression as its first parameter. Since <code>)</code> is a spec... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25778/"
] | I have following string
```
String str = "replace :) :) with some other string";
```
And I want to replace first occurance of `:)` with some other string
And I used `str.replaceFirst(":)","hi");`
it gives following exception
>
> "Unmatched closing ')'"
>
>
>
I tried using `replace` function but it replaced a... | [Apache Jakarta Commons](http://commons.apache.org/) are often the solution for this class of problems. In this case, I would have a look at [commons-lang](http://commons.apache.org/lang/), espacially [StringUtils.replaceOnce()](http://commons.apache.org/lang/api-2.3/org/apache/commons/lang/StringUtils.html#replaceOnce... |
298,261 | <p>If I have the following code:</p>
<pre><code>MyClass pClass = new MyClass();
pClass.MyEvent += MyFunction;
pClass = null;
</code></pre>
<p>Will pClass be garbage collected? Or will it hang around still firing its events whenever they occur? Will I need to do the following in order to allow garbage collection?</p>
... | [
{
"answer_id": 298276,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 9,
"selected": true,
"text": "<p>For the specific question \"Will pClass be garbage collected\": the event subscription has no effect on the collect... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/986/"
] | If I have the following code:
```
MyClass pClass = new MyClass();
pClass.MyEvent += MyFunction;
pClass = null;
```
Will pClass be garbage collected? Or will it hang around still firing its events whenever they occur? Will I need to do the following in order to allow garbage collection?
```
MyClass pClass = new MyCl... | For the specific question "Will pClass be garbage collected": the event subscription has no effect on the collection of pClass (as the publisher).
For GC in general (in particular, the target): it depends whether MyFunction is static or instance-based.
A delegate (such as an event subscription) to an instance method ... |
298,277 | <p>When C# 4.0 comes out and we have the dynamic keyword as described in this <a href="http://channel9.msdn.com/pdc2008/TL16/" rel="noreferrer">excellent presentation by Anders Hejlsberg</a>, (C# is evolving faster than I can keep up.. I didn't have much time to acquaint myself with the var keyword)</p>
<p>Would I sti... | [
{
"answer_id": 298287,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 7,
"selected": true,
"text": "<p>No, they're very different.</p>\n\n<p><code>var</code> means \"infer the type of the variable at compile-time\" - but ... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298277",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1695/"
] | When C# 4.0 comes out and we have the dynamic keyword as described in this [excellent presentation by Anders Hejlsberg](http://channel9.msdn.com/pdc2008/TL16/), (C# is evolving faster than I can keep up.. I didn't have much time to acquaint myself with the var keyword)
Would I still need the var keyword ? Is there any... | No, they're very different.
`var` means "infer the type of the variable at compile-time" - but it's still entirely statically bound.
`dynamic` means "assume I can do anything I want with this variable" - i.e. the compiler doesn't know what operations are available, and the DLR will work out what the calls *really* me... |
298,281 | <p>Is it possible to create a list that can be access by either an index or a key?</p>
<p><em>I am looking for a Collection type that already exists but has this facility, I want to avoid redefining the indexers</em> </p>
| [
{
"answer_id": 298295,
"author": "Robert Wagner",
"author_id": 10784,
"author_profile": "https://Stackoverflow.com/users/10784",
"pm_score": 0,
"selected": false,
"text": "<p>You can add an indexer by adding the following property to your collection:</p>\n\n<pre><code>public object this[... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298281",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3834/"
] | Is it possible to create a list that can be access by either an index or a key?
*I am looking for a Collection type that already exists but has this facility, I want to avoid redefining the indexers* | System.Collections.Specialized.NameValueCollection can do this, but it can only store strings as values.
```
System.Collections.Specialized.NameValueCollection k =
new System.Collections.Specialized.NameValueCollection();
k.Add("B", "Brown");
k.Add("G", "Green");
Console.WriteLine(k[0]); ... |
298,288 | <p>I have the following code</p>
<pre><code><html>
<head>
<title>Test</title>
<style type="text/css">
<!--
body,td,th {
color: #FFFFFF;
}
body {
background-color: #000000;
}
#Pictures {
position:absolute;
width:591px;
height:214px;
z-index:1;
... | [
{
"answer_id": 298318,
"author": "Phil Jenkins",
"author_id": 35496,
"author_profile": "https://Stackoverflow.com/users/35496",
"pm_score": 1,
"selected": true,
"text": "<p>I think a <code>display: block;</code> on your <code>links2</code> class should put the links under the images corr... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1246613/"
] | I have the following code
```
<html>
<head>
<title>Test</title>
<style type="text/css">
<!--
body,td,th {
color: #FFFFFF;
}
body {
background-color: #000000;
}
#Pictures {
position:absolute;
width:591px;
height:214px;
z-index:1;
left: 17%;
top: 30%;
text-align:center;... | I think a `display: block;` on your `links2` class should put the links under the images correctly.
Also, to get the images to line up horizontally, use `<span>`s instead of `<div>`s inside the 'Pictures' div, and float them left.
```
#Pictures span
{
float: left;
margin-right: 5px;
}
``` |
298,289 | <p>I have the following code that I need to add an additonal object to after the results have been retrieved from the databse. Any Ideas on how I might to this ?</p>
<pre><code> public IEnumerable<ProdPriceDisplay> GetShopProductsPrices()
{
//ProdPriceDisplay ProdPrice = new ProdPriceDisplay();
var Pr... | [
{
"answer_id": 298304,
"author": "Ali Ersöz",
"author_id": 4215,
"author_profile": "https://Stackoverflow.com/users/4215",
"pm_score": 0,
"selected": false,
"text": "<p>That could be a solution;</p>\n\n<pre><code>var productsAsList = Products.ToList();\nproductsAsList.Add(new ProdPriceDi... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26809/"
] | I have the following code that I need to add an additonal object to after the results have been retrieved from the databse. Any Ideas on how I might to this ?
```
public IEnumerable<ProdPriceDisplay> GetShopProductsPrices()
{
//ProdPriceDisplay ProdPrice = new ProdPriceDisplay();
var Products = from shop i... | Use [`Enumerable.Concat`](http://msdn.microsoft.com/en-us/library/bb302894.aspx):
```
public IEnumerable<ProdPriceDisplay> GetShopProductsPrices()
{
var products = from shop in db.SHOPs
select new ProdPriceDisplay
{
ProdPrice = shop.S_NAME + " - £" + sho... |
298,292 | <p>I'm trying to read a value from a file and use it in a subsequent command.</p>
<p>I have a file called <code>AppServer.pid</code> which contains the process id of my app server (just the number, it's not a properties file or anything like that).</p>
<p>The app server is hanging, so I want to take this value and pa... | [
{
"answer_id": 298374,
"author": "RuntimeException",
"author_id": 15789,
"author_profile": "https://Stackoverflow.com/users/15789",
"pm_score": 1,
"selected": false,
"text": "<pre><code>for /f %%G in (appid.txt) do (SET PID=%%G)\necho %PID%\ntaskkill etc here... \n</code></pre>\n\n<p>Thi... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21590/"
] | I'm trying to read a value from a file and use it in a subsequent command.
I have a file called `AppServer.pid` which contains the process id of my app server (just the number, it's not a properties file or anything like that).
The app server is hanging, so I want to take this value and pass it to the kill command. S... | This works:
```
SET /P VALUE_FROM_FILE= < AppServer.pid
taskkill /pid %VALUE_FROM_FILE% /f
```
The /P parameter used with SET allows you to set the value of a parameter using input from the user (or in this case, input from a file) |
298,301 | <p>Can anyone provide some pseudo code for a roulette selection function? How would I implement this: I don't really understand how to read this math notation.I want General algorithm to this.</p>
| [
{
"answer_id": 298315,
"author": "Bork Blatt",
"author_id": 5381,
"author_profile": "https://Stackoverflow.com/users/5381",
"pm_score": 2,
"selected": false,
"text": "<p>There are 2 steps to this: First create an array with all the values on the wheel. This can be a 2 dimensional array w... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298301",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Can anyone provide some pseudo code for a roulette selection function? How would I implement this: I don't really understand how to read this math notation.I want General algorithm to this. | The other answers seem to be assuming that you are trying to implement a roulette game. I think that you are asking about roulette wheel selection in evolutionary algorithms.
[Here is some Java code](https://github.com/dwdyer/watchmaker/blob/master/framework/src/java/main/org/uncommons/watchmaker/framework/selection/R... |
298,305 | <p>How to do this in Java - passing a collection of subtype to a method requiring a collection of base type?</p>
<p>The example below gives:</p>
<pre><code>The method foo(Map<String,List>) is not applicable for the arguments (Map<String,MyList>)
</code></pre>
<p>I can implement by creating a class hierar... | [
{
"answer_id": 298332,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 5,
"selected": true,
"text": "<p>Change <code>foo</code> to:</p>\n\n<pre><code>private void foo(Map <String, ? extends List> in) {\n}\n</code></p... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298305",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2887/"
] | How to do this in Java - passing a collection of subtype to a method requiring a collection of base type?
The example below gives:
```
The method foo(Map<String,List>) is not applicable for the arguments (Map<String,MyList>)
```
I can implement by creating a class hierarchy for the typed collections - but is it pos... | Change `foo` to:
```
private void foo(Map <String, ? extends List> in) {
}
```
That will restrict what you can do within `foo`, but that's reasonable. You know that any value you fetch from the map will be a list, but you don't know what kind of value is valid to put into the map. |
298,314 | <p>I have a Git repository I store random things in. Mostly random scripts, text files, websites I've designed and so on.</p>
<p>There are some large binary files I have deleted over time (generally 1-5MB), which are sitting around increasing the size of the repository, which I don't need in the revision history.</p>
... | [
{
"answer_id": 298888,
"author": "Aristotle Pagaltzis",
"author_id": 9410,
"author_profile": "https://Stackoverflow.com/users/9410",
"pm_score": 7,
"selected": true,
"text": "<p>This is an adaptation of <a href=\"https://stackoverflow.com/questions/223678/git-which-commit-has-this-blob#2... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298314",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/745/"
] | I have a Git repository I store random things in. Mostly random scripts, text files, websites I've designed and so on.
There are some large binary files I have deleted over time (generally 1-5MB), which are sitting around increasing the size of the repository, which I don't need in the revision history.
Basically I w... | This is an adaptation of [the `git-find-blob` script I posted previously](https://stackoverflow.com/questions/223678/git-which-commit-has-this-blob#223890):
```perl
#!/usr/bin/perl
use 5.008;
use strict;
use Memoize;
sub usage { die "usage: git-large-blob <size[b|k|m]> [<git-log arguments ...>]\n" }
@ARGV or usage()... |
298,319 | <p>I have a list of tables i.e. student, teacher, staff, dept. and so on and each of these tables have comments specific to them. Now one record in a table can have one or many comments that shows it's a one to many relation from any table to comments table. I don't know what the best way is to relate comments table to... | [
{
"answer_id": 298336,
"author": "Zoredache",
"author_id": 20267,
"author_profile": "https://Stackoverflow.com/users/20267",
"pm_score": 4,
"selected": true,
"text": "<p>Lets assume that your tables (student, teacher, staff, dept) all have a int primary key named Id.</p>\n\n<p>For your c... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29656/"
] | I have a list of tables i.e. student, teacher, staff, dept. and so on and each of these tables have comments specific to them. Now one record in a table can have one or many comments that shows it's a one to many relation from any table to comments table. I don't know what the best way is to relate comments table to ea... | Lets assume that your tables (student, teacher, staff, dept) all have a int primary key named Id.
For your comments table you could create a table.
```
Id int
CommentType enum (student, teacher, staff, dept)
LinkId int
Comment
```
A row in Comments might look like this
```
1,'Student',347,'text'
``` |
298,326 | <p>When we use getstring to get data from a recordset (ADO) then it returns all the columns.</p>
<p>If only certain columns are required, how do we modify the getstring statement?</p>
| [
{
"answer_id": 298353,
"author": "Tor Haugen",
"author_id": 32050,
"author_profile": "https://Stackoverflow.com/users/32050",
"pm_score": 2,
"selected": false,
"text": "<p>You can't. GetString returns all columns of all or a specified number of rows. You'll need to loop through the recor... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298326",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31132/"
] | When we use getstring to get data from a recordset (ADO) then it returns all the columns.
If only certain columns are required, how do we modify the getstring statement? | You can take a step back and build the recordset with only the fields (columns) that you want, for example:
```
strSQL="SELECT ID, FName, SName FROM Members"
rs.Open strSQL, cn
a=rs.GetString
``` |
298,346 | <p>I have written C# code for ascx. I am trying to send an email on click of image button which works in Mozilla Firefox but not in Internet Explorer.</p>
<p>This function is called on button click:</p>
<pre><code><%@ Control Language="C#" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="Syste... | [
{
"answer_id": 304625,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 1,
"selected": false,
"text": "<p>In code behind just change \nprotected void btnSubmit_Click(object sender, EventArgs e)</p>\n\n<p>with\nprotected void btnS... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298346",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30394/"
] | I have written C# code for ascx. I am trying to send an email on click of image button which works in Mozilla Firefox but not in Internet Explorer.
This function is called on button click:
```
<%@ Control Language="C#" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import ... | hai all,
This code is working in IE not mozilla,anyone give idea
document.onkeypress = KeyCheck;
function KeyCheck(e) {
```
var KeyID = (window.event) ? event.keyCode : e.keyCode;
if (KeyID == 0) {
var image = document.getElementById("<%= imagetirukural.ClientID%>");
var labe... |
298,347 | <p>I have a flash file that loads an XML file at runtime. When the <code>.swf</code> file is run locally or on an Apache server it works fine but when hosted on an IIS6 based server the file won't load. </p>
<p>Can anyone help with this?</p>
| [
{
"answer_id": 304625,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 1,
"selected": false,
"text": "<p>In code behind just change \nprotected void btnSubmit_Click(object sender, EventArgs e)</p>\n\n<p>with\nprotected void btnS... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have a flash file that loads an XML file at runtime. When the `.swf` file is run locally or on an Apache server it works fine but when hosted on an IIS6 based server the file won't load.
Can anyone help with this? | hai all,
This code is working in IE not mozilla,anyone give idea
document.onkeypress = KeyCheck;
function KeyCheck(e) {
```
var KeyID = (window.event) ? event.keyCode : e.keyCode;
if (KeyID == 0) {
var image = document.getElementById("<%= imagetirukural.ClientID%>");
var labe... |
298,359 | <p>Currently I have a ListView (using the Details View). I would like to implement the behaviour whereby when a user selects a single item (log entry) the log entry expands (from one line to multiple lines) to provide more detailed information about the error that occured.</p>
<p>My question is this: Is this possible?... | [
{
"answer_id": 298386,
"author": "axk",
"author_id": 578,
"author_profile": "https://Stackoverflow.com/users/578",
"pm_score": 0,
"selected": false,
"text": "<p>Not a direct answer to your question, but I think\nyou're better off with a grid in this case.</p>\n"
},
{
"answer_id":... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298359",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1816/"
] | Currently I have a ListView (using the Details View). I would like to implement the behaviour whereby when a user selects a single item (log entry) the log entry expands (from one line to multiple lines) to provide more detailed information about the error that occured.
My question is this: Is this possible? If so, is... | Edit: sorry this is wpf
The trick I used to achieve the same thing was creating a trigger to show a secondary grid which is defaulted to collapsed.
Try this out:
```
<ListBox ItemsSource="{Binding}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.RowDef... |
298,361 | <p>In previous releases there were 3 ways to pass data from controller to view AFAIK (shown below). </p>
<p>I want to use method (2) with MVC Beta 1, but I can't find the renderView method. So what's the new syntax (if it's still possible)? Thanks in advance.</p>
<p>Ben.</p>
<p>Syntax #1: Old-school dictionary</p>
... | [
{
"answer_id": 298383,
"author": "Kieron",
"author_id": 5791,
"author_profile": "https://Stackoverflow.com/users/5791",
"pm_score": 3,
"selected": true,
"text": "<p>In beta 1, use the View method:</p>\n\n<pre><code>return View (\"ShowCat\", <TYPED_DATA_SET_OR_OTHER_MODEL>);\n</code... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298361",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38522/"
] | In previous releases there were 3 ways to pass data from controller to view AFAIK (shown below).
I want to use method (2) with MVC Beta 1, but I can't find the renderView method. So what's the new syntax (if it's still possible)? Thanks in advance.
Ben.
Syntax #1: Old-school dictionary
```
ViewData["Name"] = "Moo-... | In beta 1, use the View method:
```
return View ("ShowCat", <TYPED_DATA_SET_OR_OTHER_MODEL>);
```
The View method has replaced the RenderView method. |
298,363 | <p>I create new ASP.NET web application that use SMTP to send message. The problem is the smtp was not authenticated from who send the message. </p>
<p>How can I make SMTP authenticated in my program? does C# have a class that have attribute for enter username and password?</p>
| [
{
"answer_id": 298379,
"author": "Arief",
"author_id": 34096,
"author_profile": "https://Stackoverflow.com/users/34096",
"pm_score": 8,
"selected": true,
"text": "<pre><code>using System.Net;\nusing System.Net.Mail;\n\nusing(SmtpClient smtpClient = new SmtpClient())\n{\n var basicCred... | 2008/11/18 | [
"https://Stackoverflow.com/questions/298363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36446/"
] | I create new ASP.NET web application that use SMTP to send message. The problem is the smtp was not authenticated from who send the message.
How can I make SMTP authenticated in my program? does C# have a class that have attribute for enter username and password? | ```
using System.Net;
using System.Net.Mail;
using(SmtpClient smtpClient = new SmtpClient())
{
var basicCredential = new NetworkCredential("username", "password");
using(MailMessage message = new MailMessage())
{
MailAddress fromAddress = new MailAddress("from@yourdomain.com");
smtpClien... |