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 |
|---|---|---|---|---|---|---|
450,471 | <p>I recently wrote a program to help me understand the basics of memory pointers in C++, I chose a simple prime number finder.</p>
<p>I finally got it to work. (yay for debugging!)</p>
<p>And I let it run to see how far it goes, it gets to prime #815389 with my verbose tells me is the 65076th prime, I get an app cra... | [
{
"answer_id": 450495,
"author": "Jeff Yates",
"author_id": 23234,
"author_profile": "https://Stackoverflow.com/users/23234",
"pm_score": 3,
"selected": false,
"text": "<p>Stack overflow? I see that <code>check</code> is recursive.</p>\n"
},
{
"answer_id": 450496,
"author": "... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450471",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/55842/"
] | I recently wrote a program to help me understand the basics of memory pointers in C++, I chose a simple prime number finder.
I finally got it to work. (yay for debugging!)
And I let it run to see how far it goes, it gets to prime #815389 with my verbose tells me is the 65076th prime, I get an app crash. The one thing... | Sean is right, two.nxt is never initialised. In fact, num.nxt is never initialised for any instance of num. The member nxt is unnecessary if the class is made more robust. The nxt pointer can be used instead:
```
class num
{
private:
long i;
num *nxtnum;
public:
num (long value) : i (value), nxtnum (0) { }... |
450,486 | <p>Does anyone know of any templating engines for generating images, preferably Java-based? </p>
<p>What I have in mind is something like <a href="http://stringtemplate.org" rel="noreferrer">StringTemplate</a> where a you have a set of parameterized templates that render to an image (or SVG, etc) rather than text. It... | [
{
"answer_id": 450517,
"author": "Fabian Steeg",
"author_id": 18154,
"author_profile": "https://Stackoverflow.com/users/18154",
"pm_score": 0,
"selected": false,
"text": "<p>Not sure if it is what you are looking for but maybe something like <a href=\"http://www.graphviz.org/\" rel=\"nof... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40310/"
] | Does anyone know of any templating engines for generating images, preferably Java-based?
What I have in mind is something like [StringTemplate](http://stringtemplate.org) where a you have a set of parameterized templates that render to an image (or SVG, etc) rather than text. It needs to be more general purpose than ... | I'm not sure I understand your needs, but how about creating a JPanel (you can use layouts, labels, other shapes ...) and save it as an image?
[Here](http://forums.sun.com/thread.jspa?threadID=173336&start=0) you can find information about how to save a JPanel as an image. |
450,491 | <p>I am developing a .NET windows app that needs to insert text in the place where the cursor is. The cursor will be in a different application that I have no control over. I think the operating system needs to be used here to achieve this. Can you help please?</p>
| [
{
"answer_id": 450532,
"author": "Catalin DICU",
"author_id": 13030,
"author_profile": "https://Stackoverflow.com/users/13030",
"pm_score": 3,
"selected": true,
"text": "<p>Put the text you want to insert into the clipboard</p>\n\n<p>Find the window's handle:</p>\n\n<pre><code>Process[] ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/55844/"
] | I am developing a .NET windows app that needs to insert text in the place where the cursor is. The cursor will be in a different application that I have no control over. I think the operating system needs to be used here to achieve this. Can you help please? | Put the text you want to insert into the clipboard
Find the window's handle:
```
Process[] processes = Process.GetProcessesByName("notepad");
foreach (Process p in processes)
{
IntPtr pFoundWindow = p.MainWindowHandle;
// Do something with the handle...
}
```
Send a "Ctrl+V" message to the window using pinv... |
450,498 | <p>What are DF Diagrams , and how they help project managers in their job?</p>
| [
{
"answer_id": 450503,
"author": "Toon Krijthe",
"author_id": 18061,
"author_profile": "https://Stackoverflow.com/users/18061",
"pm_score": 2,
"selected": true,
"text": "<p>As you can see, is a <a href=\"http://en.wikipedia.org/wiki/Data_flow_diagram\" rel=\"nofollow noreferrer\">data fl... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450498",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/55750/"
] | What are DF Diagrams , and how they help project managers in their job? | As you can see, is a [data flow diagram](http://en.wikipedia.org/wiki/Data_flow_diagram) a diagram that shows the dataflow in an application.
At the highest level you have the context diagram that can be represented as:
```
+-------------+
input --> | Application | --> output
+-------------+
You ... |
450,538 | <p>I'm using Emacs, with CLISP and Slime, and want to be able to draw pictures on the screen. I'm specifically thinking about drawing graphs, but anything that would let me draw basic shapes and manipulate them would be able to get me started.</p>
| [
{
"answer_id": 453826,
"author": "Doug Currie",
"author_id": 33252,
"author_profile": "https://Stackoverflow.com/users/33252",
"pm_score": 2,
"selected": false,
"text": "<p>You could switch from CLISP to the <a href=\"http://www.lispworks.com/\" rel=\"nofollow noreferrer\">free LispWorks... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450538",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16593/"
] | I'm using Emacs, with CLISP and Slime, and want to be able to draw pictures on the screen. I'm specifically thinking about drawing graphs, but anything that would let me draw basic shapes and manipulate them would be able to get me started. | I think I've found my own answer. [Clojure](http://clojure.org/"Clojure") seems to have everything I was looking for, just because I can now use all of the Java GUI items natively in LISP. It is a different dialect of LISP than the Common-Lisp I was using, but seems to have a lot of community support, and integrates wi... |
450,546 | <p>I created a simple master/detail using myfaces and richfaces. By clicking a h:commandLink in the rich:dataTable the user is able to open the detail view and edit the entity. </p>
<p>Now I want to create a URL that allows the user to open the detail view directly. Normally I would to this by creating an URL like /de... | [
{
"answer_id": 453322,
"author": "McDowell",
"author_id": 304,
"author_profile": "https://Stackoverflow.com/users/304",
"pm_score": 3,
"selected": true,
"text": "<p>You can construct the URL using parameters on a link control:</p>\n\n<pre><code> <h:outputLink value=\"reqscope.faces... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450546",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30967/"
] | I created a simple master/detail using myfaces and richfaces. By clicking a h:commandLink in the rich:dataTable the user is able to open the detail view and edit the entity.
Now I want to create a URL that allows the user to open the detail view directly. Normally I would to this by creating an URL like /detail.jsp?i... | You can construct the URL using parameters on a link control:
```
<h:outputLink value="reqscope.faces">
<f:param name="id" value="#{row.id}" />
<h:outputText value="link" />
</h:outputLink>
```
On the target page, you can read the id from the parameter map, either directly using the expressio... |
450,547 | <p>I am using Lucene to allow a user to search for words in a large number of documents. Lucene seems to default to returning all documents containing any of the words entered.</p>
<p>Is it possible to change this behaviour? I know that '+' can be use to force a term to be included but I would like to make that the de... | [
{
"answer_id": 450590,
"author": "tvanfosson",
"author_id": 12950,
"author_profile": "https://Stackoverflow.com/users/12950",
"pm_score": 0,
"selected": false,
"text": "<p>Why not just <a href=\"http://lucene.apache.org/java/2_3_2/api/index.html\" rel=\"nofollow noreferrer\">preparse</a>... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450547",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11249/"
] | I am using Lucene to allow a user to search for words in a large number of documents. Lucene seems to default to returning all documents containing any of the words entered.
Is it possible to change this behaviour? I know that '+' can be use to force a term to be included but I would like to make that the default acti... | This looks similar to the [Lucene Sentence Search](https://stackoverflow.com/questions/465118/lucene-sentence-search) question. If you're interested, this is how I answered that question:
```
String defaultField = ...;
Analyzer analyzer = ...;
QueryParser queryParser = new QueryParser(defaultField, analyzer);
queryPa... |
450,552 | <p>I was just reviewing some old code and found the following (inside foo.asp):</p>
<pre><code>Const ASP_FILENAME = "foo.asp" ' TODO: Update this to the name of this file (if changed)
</code></pre>
<p>The variable is only used for logging errors. (ie. "Error in foo.asp - Could not create xxxxx object.") Is there an... | [
{
"answer_id": 450579,
"author": "Martijn Laarman",
"author_id": 47020,
"author_profile": "https://Stackoverflow.com/users/47020",
"pm_score": 2,
"selected": false,
"text": "<p>You could parse <code>Request.ServerVariables(\"url\")</code> to get the filename portion. A google search foun... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450552",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13348/"
] | I was just reviewing some old code and found the following (inside foo.asp):
```
Const ASP_FILENAME = "foo.asp" ' TODO: Update this to the name of this file (if changed)
```
The variable is only used for logging errors. (ie. "Error in foo.asp - Could not create xxxxx object.") Is there any way to avoid this?
Than... | From the now-defunct Aspfaq.com (thanks to [Archive.org](https://web.archive.org/web/20070203053627/http://classicasp.aspfaq.com/files/directories-fso/how-do-i-get-the-name-of-the-current-url/page.html)):
**How do I get the name of the current URL / page?**
This one is pretty easy, but there are two parts.
To retri... |
450,558 | <p>I was wonder if there is a simpler (single) way to calculate the remaining space in a circular buffer than this?</p>
<pre><code>int remaining = (end > start)
? end-start
: bufferSize - start + end;
</code></pre>
| [
{
"answer_id": 450572,
"author": "recursive",
"author_id": 44743,
"author_profile": "https://Stackoverflow.com/users/44743",
"pm_score": 0,
"selected": false,
"text": "<p>Lose the conditional:</p>\n\n<pre><code>int remaining = (end + bufferSize - start - 1) % bufferSize + 1\n</code></pre... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16177/"
] | I was wonder if there is a simpler (single) way to calculate the remaining space in a circular buffer than this?
```
int remaining = (end > start)
? end-start
: bufferSize - start + end;
``` | If you're worried about poorly-predicted conditionals slowing down your CPU's pipeline, you could use this:
```
int remaining = (end - start) + (-((int) (end <= start)) & bufferSize);
```
But that's likely to be premature optimisation (unless you have really identified this as a hotspot). Stick with your current tec... |
450,573 | <p>So firstly here's my query: (<em>NOTE:I know SELECT * is bad practice I just switched it in to make the query more readable</em>)</p>
<pre><code>SELECT pcln_cities.*,COUNT(pcln_hotels.cityid) AS hotelcount
FROM pcln_cities
LEFT OUTER JOIN pcln_hotels ON pcln_hotels.cityid=pcln_cities.cityid
WHERE pcln_cities.... | [
{
"answer_id": 450587,
"author": "Paul Tomblin",
"author_id": 3333,
"author_profile": "https://Stackoverflow.com/users/3333",
"pm_score": 0,
"selected": false,
"text": "<p>It looks like you don't have an index on pcln_cities.state_name, or pcln_cities.cityid? Try adding them.</p>\n\n<p>... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450573",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/428190/"
] | So firstly here's my query: (*NOTE:I know SELECT \* is bad practice I just switched it in to make the query more readable*)
```
SELECT pcln_cities.*,COUNT(pcln_hotels.cityid) AS hotelcount
FROM pcln_cities
LEFT OUTER JOIN pcln_hotels ON pcln_hotels.cityid=pcln_cities.cityid
WHERE pcln_cities.state_name='Californ... | Hmm, there's something not very right in your query.
You use an aggregate function (count), but you simply group by on id.
Normally, you should group on all columns in your select list, that are not an aggregate function.
As you've specified the query now, IMHO, the DBMS can never correctly determine which values he s... |
450,581 | <p>In Oracle 10g I have a table that holds timestamps showing how long certain operations took. It has two timestamp fields: starttime and endtime. I want to find averages of the durations given by these timestamps. I try:</p>
<pre><code>select avg(endtime-starttime) from timings;
</code></pre>
<p>But get: </p>
<bl... | [
{
"answer_id": 450651,
"author": "Adam Bellaire",
"author_id": 21632,
"author_profile": "https://Stackoverflow.com/users/21632",
"pm_score": 2,
"selected": false,
"text": "<p>It doesn't look like there is any function to do an explicit conversion of <code>INTERVAL DAY TO SECOND</code> to... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450581",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13693/"
] | In Oracle 10g I have a table that holds timestamps showing how long certain operations took. It has two timestamp fields: starttime and endtime. I want to find averages of the durations given by these timestamps. I try:
```
select avg(endtime-starttime) from timings;
```
But get:
>
> SQL Error: ORA-00932: inconsi... | There is a shorter, faster and nicer way to get DATETIME difference in seconds in Oracle than that hairy formula with multiple extracts.
Just try this to get response time in seconds:
```
(sysdate + (endtime - starttime)*24*60*60 - sysdate)
```
It also preserves fractional part of seconds when subtracting TIMESTAMP... |
450,598 | <p>You can change the connection string at run-time like this. You make the connection string setting available for writing as a separate property inside the MySettings class:</p>
<pre><code>Partial Friend NotInheritable Class MySettings
Public WriteOnly Property RunTimeConnectionString()
Set(ByVal value)
... | [
{
"answer_id": 450731,
"author": "Dragoljub Ćurčić",
"author_id": 44918,
"author_profile": "https://Stackoverflow.com/users/44918",
"pm_score": 0,
"selected": false,
"text": "<p>I searched more, and found a way, but it isn't really runtime. At least not as runtime as I would like it to b... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44918/"
] | You can change the connection string at run-time like this. You make the connection string setting available for writing as a separate property inside the MySettings class:
```
Partial Friend NotInheritable Class MySettings
Public WriteOnly Property RunTimeConnectionString()
Set(ByVal value)
My... | I tested a little more, and found out that **the same solution** ***can*** **be used inside a class library**.
I made a new class (in the class library) with a shared (static) method like this:
```
Public Class MySettingsChanger
Public Shared Sub SetConnectionString(ByVal cnnString As String)
My.Settings.... |
450,601 | <p>I want to invoke a validation function inside the entities objects right before they are stored with ObjectContext#SaveChanges(). Now, I can keep track of all changed objects myself and then loop through all of them and invoke their validation methods, but I suppose an easier approach would be implement some callba... | [
{
"answer_id": 450750,
"author": "Craig Stuntz",
"author_id": 7714,
"author_profile": "https://Stackoverflow.com/users/7714",
"pm_score": 0,
"selected": false,
"text": "<p>Well, you could do it that way, but it means that you're allowing your clients to directly access the ObjectContext,... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450601",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17815/"
] | I want to invoke a validation function inside the entities objects right before they are stored with ObjectContext#SaveChanges(). Now, I can keep track of all changed objects myself and then loop through all of them and invoke their validation methods, but I suppose an easier approach would be implement some callback t... | I've figured out how. Basically, we can intercept SavingChanges event of ObjectContext and loop through the newly added/modified entities to invoke their validation function. Here's the code I used.
```
partial void OnContextCreated()
{
SavingChanges += PerformValidation;
}
void PerformValidat... |
450,617 | <p>I have 4 binary bits</p>
<pre><code>Bit 3 Bit 2 Bit 1 Bit 0
</code></pre>
<p>Normally the answer is simple: 2^4, or 16 different combinations; and it would looks something like the following:</p>
<p>0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111</p>
<p>However, The LSB (Bit 0)... | [
{
"answer_id": 450627,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 3,
"selected": false,
"text": "<p>You want a <a href=\"http://en.wikipedia.org/wiki/Gray_code\" rel=\"nofollow noreferrer\">Gray Code</a>. Look about h... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450617",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/338360/"
] | I have 4 binary bits
```
Bit 3 Bit 2 Bit 1 Bit 0
```
Normally the answer is simple: 2^4, or 16 different combinations; and it would looks something like the following:
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
However, The LSB (Bit 0) changes state every iteration.
I need ... | 1. There are 4 bits.
2. Each bit may change state only once.
3. For each new value, at least one of the bits must have changed state from the previous value.
Therefore, you can have at most 4 state changes, and at most 5 different values.
Example:
```
0000 -> 0001 -> 0011 -> 0111 -> 1111
```
**Edit:**
Very well, ... |
450,620 | <p>I would like to change the name of the ruby process that gets displayed in the linux/unix top command. I have tried the </p>
<pre><code>$0='miname'
</code></pre>
<p>approach but it only works with the ps command and in top the process keeps getting displayed as "ruby"</p>
| [
{
"answer_id": 450663,
"author": "Keltia",
"author_id": 16143,
"author_profile": "https://Stackoverflow.com/users/16143",
"pm_score": 3,
"selected": false,
"text": "<p>I don't think Ruby has the facility builtin (<code>setproctitle(3)</code>). You should probably try to look at <a href=\... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450620",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22154/"
] | I would like to change the name of the ruby process that gets displayed in the linux/unix top command. I have tried the
```
$0='miname'
```
approach but it only works with the ps command and in top the process keeps getting displayed as "ruby" | Dave Thomas had an interesting [post](http://pragdave.blogs.pragprog.com/pragdave/2008/11/trivial-request-logging-for-rails.html) on doing this in rails. There's nothing rails specific about the actual process name change code. He uses the `$0='name'` approach. When I followed his steps the name was changed in `ps` and... |
450,632 | <p>For our VB.NET websites we use SVN for Source Control and CruiseControl.NET for continuous integration. </p>
<p>To use the SVN build number in the compilation by CruiseControl.NET we need to use Web Deployment Projects. We then replace in the configuration file the Version field with this variable from SVN Labeller... | [
{
"answer_id": 450650,
"author": "Jeff Martin",
"author_id": 13100,
"author_profile": "https://Stackoverflow.com/users/13100",
"pm_score": 1,
"selected": false,
"text": "<p>If you used Nant in your build script you could just have it re-write the version prior to compile, and you wouldn'... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450632",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/982/"
] | For our VB.NET websites we use SVN for Source Control and CruiseControl.NET for continuous integration.
To use the SVN build number in the compilation by CruiseControl.NET we need to use Web Deployment Projects. We then replace in the configuration file the Version field with this variable from SVN Labeller
* $(CCNe... | It is possible to ignore errors, it is just in a weird place for vb.net.
Open the .vbproj file with notepad or an equivalent and find the <NoWarn> tag and add the id of the error there.
in a default 2008 winforms, I have these warnings already ignored.
```
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,4202... |
450,637 | <p>How would one get columns information on table which he doesn't own, but has select granted? This is, without using <code>DESCRIBE table_name</code>. Consider this example:</p>
<pre>
<code>
// user bob owns table STUDENTS
grant select on students to josh;
// now josh logs in, normally he would do
describe bob.stude... | [
{
"answer_id": 450662,
"author": "tuinstoel",
"author_id": 43901,
"author_profile": "https://Stackoverflow.com/users/43901",
"pm_score": 5,
"selected": true,
"text": "<pre><code>select column_name from all_tab_columns where table_name = 'STUDENTS';\n</code></pre>\n\n<p><strong>edit:</str... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450637",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36890/"
] | How would one get columns information on table which he doesn't own, but has select granted? This is, without using `DESCRIBE table_name`. Consider this example:
```
// user bob owns table STUDENTS
grant select on students to josh;
// now josh logs in, normally he would do
describe bob.students;
// but he's looking f... | ```
select column_name from all_tab_columns where table_name = 'STUDENTS';
```
**edit:** or, even better
```
select owner, column_name from all_tab_columns where table_name = 'STUDENTS';
``` |
450,640 | <p>Okay so, i am totally new to MVC and I'm trying to wrap my head around a few of the concepts. I've created a small application...</p>
<p>This application has a view for creating a new Individual record. The view is bound to a model <strong>ViewPage</strong>... And I have a associated <strong>IndividualController</s... | [
{
"answer_id": 450688,
"author": "tvanfosson",
"author_id": 12950,
"author_profile": "https://Stackoverflow.com/users/12950",
"pm_score": 1,
"selected": false,
"text": "<p>Your New controller method doesn't need to create an individual, you probably just want it to set the title and retu... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/55862/"
] | Okay so, i am totally new to MVC and I'm trying to wrap my head around a few of the concepts. I've created a small application...
This application has a view for creating a new Individual record. The view is bound to a model **ViewPage**... And I have a associated **IndividualController** which has a **New** method...... | Your New controller method doesn't need to create an individual, you probably just want it to set the title and return the view, although you may need to do some authorization processing. Here's an example from one of my projects:
```
[AcceptVerbs( HttpVerbs.Get )]
[Authorization( Roles = "SuperUser, EditEvent... |
450,646 | <p>I have two elements (a button and an anchor tag) both with a dynamical text inside that grow to the length of their content.<br>
I cannot know which one of them will be the longest at compile time, nor can I know what the maximum/minimum width will be.<br>
The shorter one should always adapt to the longest one.</p>
... | [
{
"answer_id": 450751,
"author": "Powerlord",
"author_id": 15880,
"author_profile": "https://Stackoverflow.com/users/15880",
"pm_score": 0,
"selected": false,
"text": "<p>As I see it, you could do it two ways:</p>\n\n<ol>\n<li>Figure out the length on the ASP side and set a variable with... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450646",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11333/"
] | I have two elements (a button and an anchor tag) both with a dynamical text inside that grow to the length of their content.
I cannot know which one of them will be the longest at compile time, nor can I know what the maximum/minimum width will be.
The shorter one should always adapt to the longest one.
```
<spa... | You could try something like this:
```
#buttonsColumn {
display: block;
float: left;
background-color: #F88;
}
#buttonsColumn button,
#buttonsColumn a {
display: block;
}
#buttonsColumn button {
width: 100%;
background-color: #8F8;
}
#buttonsColumn a {
width: 100%;
background-color: #88... |
450,675 | <p>I am working with a .NET WinForms app in C#, running against the 3.5 .NET framework. In this app, I am setting the .Expression member of a <code>DataColumn</code> in a <code>DataTable</code>, like so:</p>
<pre><code>DataColumn column = dtData.Columns["TestColumn"];
column.Expression = "some expression";
</code></pr... | [
{
"answer_id": 451951,
"author": "balexandre",
"author_id": 28004,
"author_profile": "https://Stackoverflow.com/users/28004",
"pm_score": 0,
"selected": false,
"text": "<p>can't you just use:</p>\n\n<pre><code>dtData.Columns.Add(\"TestColumn\", typeof(Decimal), \"Price * Quantity\");\n</... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2111811/"
] | I am working with a .NET WinForms app in C#, running against the 3.5 .NET framework. In this app, I am setting the .Expression member of a `DataColumn` in a `DataTable`, like so:
```
DataColumn column = dtData.Columns["TestColumn"];
column.Expression = "some expression";
```
The 2nd line, where I actually set `Expre... | I just had the same issue while importing rows, as it seems, calling `DataTable.BeginLoadData` before the insert fixed it for me.
**Edit:** As it turns out, this only fixed it on one side, now adding rows throws this exception.
**Edit2:** Suspending binding as suggested by [Robert Rossney](https://stackoverflow.com/q... |
450,679 | <p>[update2] One of those problems I solved & can't remember how... :)</p>
<p>[update1] could this be a problem in the model?</p>
<pre><code> PAYPAL_CERT_PEM = File.read("#{Rails.root}/certs/paypal_cert.pem")
APP_CERT_PEM = File.read("#{Rails.root}/certs/app_cert.pem")
APP_KEY_PEM = File.read("#{Rails.root}... | [
{
"answer_id": 451588,
"author": "RichH",
"author_id": 16779,
"author_profile": "https://Stackoverflow.com/users/16779",
"pm_score": 0,
"selected": false,
"text": "<p>Not an answer to your question, but something that will help.</p>\n\n<p>I've recently come to love the <a href=\"http://h... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450679",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33287/"
] | [update2] One of those problems I solved & can't remember how... :)
[update1] could this be a problem in the model?
```
PAYPAL_CERT_PEM = File.read("#{Rails.root}/certs/paypal_cert.pem")
APP_CERT_PEM = File.read("#{Rails.root}/certs/app_cert.pem")
APP_KEY_PEM = File.read("#{Rails.root}/certs/app_key.pem")
```
... | The `ActionView::TemplateError` you've posted is caused by a failure of Exception Notifier in rendering a 500 error page (line #3 of Exception Notifier's own `_request.html` partial). The more interesting exception is probably the one that came before and caused the 500 in the first place. |
450,682 | <p>I want to do something like this </p>
<pre><code>INSERT INTO t (t.a, t.b, t.c)
VALUES ('key1','key2','value')
ON DUPLICATE KEY UPDATE
t.c = 'value';
INSERT INTO t (t.a, t.b, t.c)
VALUES ('key1','key3','value2')
ON DUPLICATE KEY UPDATE
t.c = 'value2';
</code></pre>
<p>t.a and t.b are keys. This all works fine... | [
{
"answer_id": 450695,
"author": "ʞɔıu",
"author_id": 41613,
"author_profile": "https://Stackoverflow.com/users/41613",
"pm_score": 8,
"selected": true,
"text": "<p>Use the VALUES() function</p>\n\n<pre><code>INSERT INTO t (t.a, t.b, t.c)\nVALUES ('key1','key2','value'), ('key1','key3','... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6037/"
] | I want to do something like this
```
INSERT INTO t (t.a, t.b, t.c)
VALUES ('key1','key2','value')
ON DUPLICATE KEY UPDATE
t.c = 'value';
INSERT INTO t (t.a, t.b, t.c)
VALUES ('key1','key3','value2')
ON DUPLICATE KEY UPDATE
t.c = 'value2';
```
t.a and t.b are keys. This all works fine but i get an error on the... | Use the VALUES() function
```
INSERT INTO t (t.a, t.b, t.c)
VALUES ('key1','key2','value'), ('key1','key3','value2')
ON DUPLICATE KEY UPDATE
t.c = VALUES(t.c)
```
see <http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html> |
450,687 | <p>I'm developing a PHP application and I'm wondering about the best way to include multi-language support for users in other countries.</p>
<p>I'm proficient with PHP but have never developed anything with support for other languages.</p>
<p>I was thinking of putting the language into a PHP file with constants, exam... | [
{
"answer_id": 450701,
"author": "Rad",
"author_id": 1349,
"author_profile": "https://Stackoverflow.com/users/1349",
"pm_score": 2,
"selected": false,
"text": "<p>You might want to look at a framework like CakePHP or CodeIgniter that make writing internationalized applications much easie... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450687",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28261/"
] | I'm developing a PHP application and I'm wondering about the best way to include multi-language support for users in other countries.
I'm proficient with PHP but have never developed anything with support for other languages.
I was thinking of putting the language into a PHP file with constants, example:
en.php coul... | Weird. People seem to be ignoring the obvious solution. Your idea of locale-specific files is fine. Have en.php:
```
define('LOGIN_INCORRECT','Your login details are incorrect.');
...
```
Then, assuming you have a global config/constants file (which I'd suggest for many reasons), have code like this:
```
if ($langu... |
450,717 | <p>Can jQuery test an array for the presence of an object (either as part of the core functionality or via an avaible plugin)?</p>
<p>Also, I'm looking for something like <code>array.remove</code>, which would remove a given object from an array. Can jQuery handle this for me?</p>
| [
{
"answer_id": 450730,
"author": "Prestaul",
"author_id": 5628,
"author_profile": "https://Stackoverflow.com/users/5628",
"pm_score": 8,
"selected": true,
"text": "<p><a href=\"http://docs.jquery.com/Utilities/jQuery.inArray\" rel=\"noreferrer\">jQuery.inArray</a> returns the first index... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450717",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44683/"
] | Can jQuery test an array for the presence of an object (either as part of the core functionality or via an avaible plugin)?
Also, I'm looking for something like `array.remove`, which would remove a given object from an array. Can jQuery handle this for me? | [jQuery.inArray](http://docs.jquery.com/Utilities/jQuery.inArray) returns the first index that matches the item you searched for or -1 if it is not found:
```
if($.inArray(valueToMatch, theArray) > -1) alert("it's in there");
```
You shouldn't need an array.remove. Use splice:
```
theArray.splice(startRemovingAtThi... |
450,729 | <p>Essentially I need a count of each Entries Comments:</p>
<pre><code>SELECT e.*, COUNT(c.id) as comments FROM blog_entry e LEFT JOIN blog_comment c ON e.id = c.entry_id GROUP BY e.id, e.name, e.name_slug, e.date_published, e.category, e.image, e.body, e.is_published, e.views, e.subscription_sent ORDER BY e.date_publ... | [
{
"answer_id": 450743,
"author": "Tiago",
"author_id": 55283,
"author_profile": "https://Stackoverflow.com/users/55283",
"pm_score": 4,
"selected": true,
"text": "<p>django 1.1 have support for aggregate queries, you can grab the last version via the svn trunk.\nThe doc is already update... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/53390/"
] | Essentially I need a count of each Entries Comments:
```
SELECT e.*, COUNT(c.id) as comments FROM blog_entry e LEFT JOIN blog_comment c ON e.id = c.entry_id GROUP BY e.id, e.name, e.name_slug, e.date_published, e.category, e.image, e.body, e.is_published, e.views, e.subscription_sent ORDER BY e.date_published DESC LIM... | django 1.1 have support for aggregate queries, you can grab the last version via the svn trunk.
The doc is already updated
<http://docs.djangoproject.com/en/dev/topics/db/aggregation/> |
450,740 | <p>I need help i want to code a program that search for a word inside the source code. </p>
<p>Here a Example in Python: </p>
<pre><code>import urllib2, re
site = "http://stackoverflow.com/"
tosearch = "Questions"
source = urllib2.urlopen(site).read()
if re.search(tosearch,source):
print "Found The Word", tosea... | [
{
"answer_id": 450780,
"author": "Julio Greff",
"author_id": 55868,
"author_profile": "https://Stackoverflow.com/users/55868",
"pm_score": 3,
"selected": false,
"text": "<pre><code><?php\n\n$site = \"http://stackoverflow.com/\";\n$tosearch = \"Questions\";\n$source = file_get_contents... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I need help i want to code a program that search for a word inside the source code.
Here a Example in Python:
```
import urllib2, re
site = "http://stackoverflow.com/"
tosearch = "Questions"
source = urllib2.urlopen(site).read()
if re.search(tosearch,source):
print "Found The Word", tosearch
``` | ```
<?php
$site = "http://stackoverflow.com/";
$tosearch = "Questions";
$source = file_get_contents($site);
if(preg_match("/{$tosearch}/", $source)): // fixed, thanks meouw
echo "Found the the word {$tosearch}";
endif;
?>
``` |
450,787 | <p>I'm working on a simple HTML scraper for Hulu in python 2.6 and am having problems with logging on to my account. Here's my code so far:</p>
<pre><code>import urllib
import urllib2
from cookielib import CookieJar
#make a cookie and redirect handlers
cookies = CookieJar()
cookie_handler= urllib2.HTTPCookieProcesso... | [
{
"answer_id": 451306,
"author": "jacobangel",
"author_id": 31318,
"author_profile": "https://Stackoverflow.com/users/31318",
"pm_score": 2,
"selected": false,
"text": "<p>What you're seeing is a ajax return. It is probably using javascript to set the cookie, and screwing up your attempt... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450787",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/53646/"
] | I'm working on a simple HTML scraper for Hulu in python 2.6 and am having problems with logging on to my account. Here's my code so far:
```
import urllib
import urllib2
from cookielib import CookieJar
#make a cookie and redirect handlers
cookies = CookieJar()
cookie_handler= urllib2.HTTPCookieProcessor(cookies)
redi... | The error message you are getting back could be misleading. For example the server might be looking at *user-agent* and seeing that say it's not one of the supported browsers, or looking at *HTTP\_REFERER* expecting it to be coming from hulu domain. My point is there are two many variables coming in the request to keep... |
450,789 | <p>I wrote a batch file that reads in a text file which contains a list of file name, and then delete and rename them one by one. I did this by using a for loop, and it works perfectly by double clicking it.</p>
<p>But when I tried to call this batch from a Java program. It's no longer working for this part:</p>
<pre... | [
{
"answer_id": 450809,
"author": "Michael Borgwardt",
"author_id": 16883,
"author_profile": "https://Stackoverflow.com/users/16883",
"pm_score": 1,
"selected": false,
"text": "<p>How are you calling it from Java?</p>\n\n<p>What exactly is happening when you do?</p>\n\n<p>Why do you call ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450789",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I wrote a batch file that reads in a text file which contains a list of file name, and then delete and rename them one by one. I did this by using a for loop, and it works perfectly by double clicking it.
But when I tried to call this batch from a Java program. It's no longer working for this part:
```
for /f %%a in ... | How are you calling it from Java?
What exactly is happening when you do?
Why do you call a batch file instead of doing the same thing in Java, when you're calling it from Java anyway? |
450,799 | <p>I am looking for a command that will accept (as input) multiple lines of text, each line containing a single integer, and output the sum of these integers.</p>
<p>As a bit of background, I have a log file which includes timing measurements. Through grepping for the relevant lines and a bit of <code>sed</code> refor... | [
{
"answer_id": 450819,
"author": "j_random_hacker",
"author_id": 47984,
"author_profile": "https://Stackoverflow.com/users/47984",
"pm_score": 5,
"selected": false,
"text": "<pre><code>perl -lne '$x += $_; END { print $x; }' < infile.txt\n</code></pre>\n"
},
{
"answer_id": 450... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450799",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45664/"
] | I am looking for a command that will accept (as input) multiple lines of text, each line containing a single integer, and output the sum of these integers.
As a bit of background, I have a log file which includes timing measurements. Through grepping for the relevant lines and a bit of `sed` reformatting I can list al... | Bit of awk should do it?
```
awk '{s+=$1} END {print s}' mydatafile
```
Note: some versions of awk have some odd behaviours if you are going to be adding anything exceeding 2^31 (2147483647). See comments for more background. One suggestion is to use `printf` rather than `print`:
```
awk '{s+=$1} END {printf "%.0f... |
450,807 | <p>Consider this example (typical in OOP books): </p>
<p>I have an <code>Animal</code> class, where each <code>Animal</code> can have many friends.<br>
And subclasses like <code>Dog</code>, <code>Duck</code>, <code>Mouse</code> etc which add specific behavior like <code>bark()</code>, <code>quack()</code> etc.</p>
<... | [
{
"answer_id": 450840,
"author": "David Schmitt",
"author_id": 4918,
"author_profile": "https://Stackoverflow.com/users/4918",
"pm_score": 7,
"selected": false,
"text": "<p>No. The compiler can't know what type <code>jerry.callFriend(\"spike\")</code> would return. Also, your implementat... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450807",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/51402/"
] | Consider this example (typical in OOP books):
I have an `Animal` class, where each `Animal` can have many friends.
And subclasses like `Dog`, `Duck`, `Mouse` etc which add specific behavior like `bark()`, `quack()` etc.
Here's the `Animal` class:
```
public class Animal {
private Map<String,Animal> friends =... | You could define `callFriend` this way:
```
public <T extends Animal> T callFriend(String name, Class<T> type) {
return type.cast(friends.get(name));
}
```
Then call it as such:
```
jerry.callFriend("spike", Dog.class).bark();
jerry.callFriend("quacker", Duck.class).quack();
```
This code has the benefit of n... |
450,816 | <p>I have a class, that wrapps a Stream instance, so I can use it for wrapping FileStreams and NetworkStreams. Now, I want to test if the stream is still delivering any data, in other words, I want to test the NetworkStream if it is still connected or the FileStream if it reached its end.</p>
<p>Is there any function ... | [
{
"answer_id": 450881,
"author": "mmx",
"author_id": 33708,
"author_profile": "https://Stackoverflow.com/users/33708",
"pm_score": 0,
"selected": false,
"text": "<pre><code>stream.CanRead\n</code></pre>\n"
},
{
"answer_id": 450886,
"author": "Marc Gravell",
"author_id": 2... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450816",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44107/"
] | I have a class, that wrapps a Stream instance, so I can use it for wrapping FileStreams and NetworkStreams. Now, I want to test if the stream is still delivering any data, in other words, I want to test the NetworkStream if it is still connected or the FileStream if it reached its end.
Is there any function whose retu... | `Stream.Read` shouldn't throw an exception at the end; it returns something non-positive. I just Read(...) until I get back this - i.e.
```
int read;
while((read = stream.Read(buffer, 0, buffer.Length) > 0) {
// process "read"-many bytes
}
```
Note that `NetworkStream` has a [`DataAvailable`](http://msdn.microso... |
450,820 | <p>I need a generic container that keeps its elements sorted and can be asked where (at which position) it would insert a new element, without actually inserting it.</p>
<p>Does such a container exist in the .NET libraries?
The best illustration is an example (container sorts characters by ASCII value, let's assume un... | [
{
"answer_id": 450856,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 4,
"selected": true,
"text": "<p>If you sort a <a href=\"http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx\" rel=\"nofollow noreferrer\"><code>List... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11545/"
] | I need a generic container that keeps its elements sorted and can be asked where (at which position) it would insert a new element, without actually inserting it.
Does such a container exist in the .NET libraries?
The best illustration is an example (container sorts characters by ASCII value, let's assume unicode does... | If you sort a [`List<T>`](http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx) and then use [`List<T>.BinarySearch`](http://msdn.microsoft.com/en-us/library/3f90y839.aspx) it will give you the index of the entry if it exists, or the bitwise complement of the index of where it *would* be inserted if you inserted then ... |
450,822 | <p>Is it possible with WPF to create a window that has the shape of a circle and uses a playing movie as the background?</p>
| [
{
"answer_id": 450847,
"author": "Blounty",
"author_id": 33944,
"author_profile": "https://Stackoverflow.com/users/33944",
"pm_score": 0,
"selected": false,
"text": "<p>you can have a canvas as your parent container (set to transparent) then add a circle with a media brush as it's backgr... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450822",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Is it possible with WPF to create a window that has the shape of a circle and uses a playing movie as the background? | You should just need to throw something like this in your xaml:
```
<Ellipse Height="80" Width="80">
<Ellipse.Fill>
<VisualBrush TileMode="None">
<VisualBrush.Visual>
<MediaElement Source="myMovie.wmv" />
</VisualBrush.Visual>
</VisualBrush>
</Ellipse.Fil... |
450,864 | <p>What are the lightweight options one has to persist Java objects ?</p>
<p>I'm looking for the easiest possible solution. I don't want anything fancy featurewise just something simple that works with reasonnably simple objects (some collections, relationships and simple inheritance) and doesn't bring too much appar... | [
{
"answer_id": 450882,
"author": "Sarel Botha",
"author_id": 35264,
"author_profile": "https://Stackoverflow.com/users/35264",
"pm_score": 3,
"selected": false,
"text": "<p>The ObjectOutputStream and ObjectInputStream can do this. It's built into Java and allows you to serialize/deserial... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450864",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5788/"
] | What are the lightweight options one has to persist Java objects ?
I'm looking for the easiest possible solution. I don't want anything fancy featurewise just something simple that works with reasonnably simple objects (some collections, relationships and simple inheritance) and doesn't bring too much apparent complex... | The ObjectOutputStream and ObjectInputStream can do this. It's built into Java and allows you to serialize/deserialize objects quite easily.
The bad thing about these is that if you change your objects you can't import existing old objects. You'll have to think of a way to stay compatible with existing objects that mi... |
450,866 | <p>For those of you who name you member variables with no special notation like <code>m_foo</code> or <code>foo_</code>, how do you name parameters to your ctors and setters?</p>
<p>Some options I've tried so far...</p>
<pre><code>Obj(int foo) : foo(foo) { }
void set_foo(int foo) { this->foo = foo; }
Obj(int _foo... | [
{
"answer_id": 450877,
"author": "Yann Semet",
"author_id": 5788,
"author_profile": "https://Stackoverflow.com/users/5788",
"pm_score": 0,
"selected": false,
"text": "<p>I always go for a Param or Arg suffix but only when disambiguation is necessary.</p>\n\n<pre><code>Obj(int fooArg) : f... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | For those of you who name you member variables with no special notation like `m_foo` or `foo_`, how do you name parameters to your ctors and setters?
Some options I've tried so far...
```
Obj(int foo) : foo(foo) { }
void set_foo(int foo) { this->foo = foo; }
Obj(int _foo) : foo(_foo) { }
void set_foo(int _foo) { foo... | I'm using foo\_, it's better than \_foo since it won't conflict with implementation specific function names and keywords. |
450,876 | <p>Hi I have read many forums and websites that tell you how to upload an image to a server and I have managed to get this working, I can upload a file to a my server but storing the file name does work on the following example I found and I also need to create a form that allows more data to be entered to the database... | [
{
"answer_id": 451255,
"author": "Sampson",
"author_id": 54680,
"author_profile": "https://Stackoverflow.com/users/54680",
"pm_score": 0,
"selected": false,
"text": "<p>If you want to input more data into the form, you simply access the submitted data through $_POST. </p>\n\n<p>If you ha... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Hi I have read many forums and websites that tell you how to upload an image to a server and I have managed to get this working, I can upload a file to a my server but storing the file name does work on the following example I found and I also need to create a form that allows more data to be entered to the database. I... | **Here is the *answer* for those of you looking like I did all over the web trying to find out how to do this task. Uploading a photo to a server with the file name stored in a mysql database and other form data you want in your Database.** Please let me know if it helped.
Firstly the form you need:
```
<form m... |
450,883 | <p>When I add the following line to Google's helloworld example:</p>
<pre><code> from reportlab.pdfgen import canvas
</code></pre>
<p>I get the following error:</p>
<pre><code> <type 'exceptions.ImportError'>: No module named reportlab.pdfgen
</code></pre>
<p>I can get at the reportlab.pdfgen library from ... | [
{
"answer_id": 450944,
"author": "Adam Tegen",
"author_id": 4066,
"author_profile": "https://Stackoverflow.com/users/4066",
"pm_score": 2,
"selected": false,
"text": "<p>Copying the module locally worked.</p>\n\n<p>From </p>\n\n<pre><code>Python\\Lib\\site-packages\\reportlab\n</code></p... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4066/"
] | When I add the following line to Google's helloworld example:
```
from reportlab.pdfgen import canvas
```
I get the following error:
```
<type 'exceptions.ImportError'>: No module named reportlab.pdfgen
```
I can get at the reportlab.pdfgen library from the python console. Why can't I get at it from google's... | Copying the module locally worked.
From
```
Python\Lib\site-packages\reportlab
```
to
```
helloworld\reportlab
``` |
450,897 | <p>EDIT:</p>
<p>Is there a better way of doing this ?</p>
<pre><code>TPendingBets = class(TDataModule)
private
public
function GetBdy(out IdEvent : Integer ) : Boolean; overload;
function GetBdy(out IdEvent : Integer... | [
{
"answer_id": 451192,
"author": "Uwe Raabe",
"author_id": 26833,
"author_profile": "https://Stackoverflow.com/users/26833",
"pm_score": 4,
"selected": true,
"text": "<p>I think the overload solution is quite a good solution, at least it is one. Other programming languages require you to... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450897",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17560/"
] | EDIT:
Is there a better way of doing this ?
```
TPendingBets = class(TDataModule)
private
public
function GetBdy(out IdEvent : Integer ) : Boolean; overload;
function GetBdy(out IdEvent : Integer; out idBetType : TBe... | I think the overload solution is quite a good solution, at least it is one. Other programming languages require you to declare functions with different names.
Another approach may be a dynamic array parameter like:
```
type
TExtendedDynArray = array of Extended; // if not already declared elsewhere
function Fn1(... |
450,903 | <p>I have a layout similar to:</p>
<pre><code><div>
<table>
</table>
</div>
</code></pre>
<p>I would like for the <code>div</code> to only expand to as wide as my <code>table</code> becomes.</p>
| [
{
"answer_id": 450927,
"author": "falstro",
"author_id": 46991,
"author_profile": "https://Stackoverflow.com/users/46991",
"pm_score": 6,
"selected": false,
"text": "<p>Not knowing in what context this will appear, but I believe the CSS-style property <code>float</code> either <code>left... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450903",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have a layout similar to:
```
<div>
<table>
</table>
</div>
```
I would like for the `div` to only expand to as wide as my `table` becomes. | The solution is to set your `div` to `display: inline-block`. |
450,936 | <p>I am using the jquery tablesorter plugin to sort a table. On of my the columns in my table shows the date in mm/yy format.</p>
<pre><code><tr>
<td class="col-name">...</td>
...
<td rel="2000" class="col-dob">10/00</td>
...
</tr>
<tr>
<td class="col-na... | [
{
"answer_id": 450970,
"author": "Cade Roux",
"author_id": 18255,
"author_profile": "https://Stackoverflow.com/users/18255",
"pm_score": 0,
"selected": false,
"text": "<p>I think you will find that your problem is the Date constructor and the 2-digit year string you are passing without d... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450936",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/120/"
] | I am using the jquery tablesorter plugin to sort a table. On of my the columns in my table shows the date in mm/yy format.
```
<tr>
<td class="col-name">...</td>
...
<td rel="2000" class="col-dob">10/00</td>
...
</tr>
<tr>
<td class="col-name">...</td>
...
<td rel="1986" class="col-dob">11/... | The tablesorter documentation is often rather unhelpful, I've found. It *looks* like it says a lot, but is lacking in the details.
In this case, it doesn't tell you the function signature for a parser. Fortunately, you can read [the unminified code](http://tablesorter.com/jquery.tablesorter.js) to find it.
There we f... |
450,953 | <p>I'm trying to modify the contents of an MSI file using Powershell. To do so I create an instance of a WindowsInstaller.Installer then use $installer.OpenDatabase and $database.OpenView. Similar functionality works in VBScript and I've seen samples on-line that appear to work.</p>
<pre><code>$installer = new-objec... | [
{
"answer_id": 450998,
"author": "EBGreen",
"author_id": 1358,
"author_profile": "https://Stackoverflow.com/users/1358",
"pm_score": 3,
"selected": true,
"text": "<p>See the <a href=\"http://www.vistax64.com/powershell/12743-windows-installer-automation-interface-problems-powershell.html... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/81/"
] | I'm trying to modify the contents of an MSI file using Powershell. To do so I create an instance of a WindowsInstaller.Installer then use $installer.OpenDatabase and $database.OpenView. Similar functionality works in VBScript and I've seen samples on-line that appear to work.
```
$installer = new-object -comobject "Wi... | See the [this](http://www.vistax64.com/powershell/12743-windows-installer-automation-interface-problems-powershell.html) thread for some guidance. Basically the MSI COM object is implemented in a way that confuses PS. There is a link to a blog post discussing it in that thread. |
450,965 | <p>I have a JAR file for authorization. I need it for each of my WAR files. All the WAR files are packaged in an EAR file. Do I have to repeat this common JAR in every WAR, or is there a structure for common libraries?</p>
<p>So my example looks something like this...</p>
<pre><code>big.ear
- META-INF
- MANI... | [
{
"answer_id": 451037,
"author": "neesh",
"author_id": 43864,
"author_profile": "https://Stackoverflow.com/users/43864",
"pm_score": -1,
"selected": false,
"text": "<p>Your app server should have a folder like shared/lib where you can put jar files that can be shared by multiple webapps ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450965",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13930/"
] | I have a JAR file for authorization. I need it for each of my WAR files. All the WAR files are packaged in an EAR file. Do I have to repeat this common JAR in every WAR, or is there a structure for common libraries?
So my example looks something like this...
```
big.ear
- META-INF
- MANIFEST.MF
- applicatio... | The standard way is to put the JARs at the root of your EAR and reference them in the `Class-Path` attribute of the WARs' `META-INF/MANIFEST.MF`. See [this article](http://java.sun.com/j2ee/verified/packaging.html).
Check your container's documentation to make sure it is supported. |
450,976 | <p>I'm a complete Flex noob, so I apologize in advance if I'm missing something obvious.</p>
<p>I wrote a fairly simple file uploader in Flex, which calls my Django back-end via URLRequest (the FileReference object handles the upload). My upload works as intended and I have Django return a HTTPResponse object. As su... | [
{
"answer_id": 450987,
"author": "Andy Baker",
"author_id": 45955,
"author_profile": "https://Stackoverflow.com/users/45955",
"pm_score": 2,
"selected": false,
"text": "<p>By the time it gets to the client it's just a normal HTTP response so treat it like any other response </p>\n"
},
... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10040/"
] | I'm a complete Flex noob, so I apologize in advance if I'm missing something obvious.
I wrote a fairly simple file uploader in Flex, which calls my Django back-end via URLRequest (the FileReference object handles the upload). My upload works as intended and I have Django return a HTTPResponse object. As such, I'd like... | something along the lines of
```
<mx:HTTPService id="myHTTPRequest"
url="{whatever your url request is}"
result="resultHandler(event)"
fault="faultHandler(event)"
showBusyCursor="true"
resultFormat="object">
```
then inside the resultHandler something like this
```
private function resultHan... |
450,995 | <p>I have a large MS Access application with a lot of computations in VBA code. When I run it it eventually crashes due to excessive file size. There are a lot of intermediate tables and queries created and subsequently deleted, but Access does not reclaim the space. I have diligently closed all intermediate record ... | [
{
"answer_id": 451008,
"author": "duffymo",
"author_id": 37213,
"author_profile": "https://Stackoverflow.com/users/37213",
"pm_score": 0,
"selected": false,
"text": "<p>I'm not an MVP, but Google found these. Maybe they'll help you:</p>\n\n<p><a href=\"http://www.mvps.org/access/general... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450995",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/55886/"
] | I have a large MS Access application with a lot of computations in VBA code. When I run it it eventually crashes due to excessive file size. There are a lot of intermediate tables and queries created and subsequently deleted, but Access does not reclaim the space. I have diligently closed all intermediate record sets a... | You should be able to run the compact function from within your VBA code.
I had the below snippet bookmarked from a long time ago when I was doing access work.
```
Public Sub CompactDB()
CommandBars("Menu Bar").Controls("Tools").Controls("Database utilities").Controls("Compact and repair database...").accDoDefau... |
450,997 | <p>My application uses some session variables that are timing out even though I thought they would not because I've got the following setting in php.ini:</p>
<p>session.cookie_lifetime = 0</p>
<p>The other session settings in php.ini are pretty much set as their defaults. How do I make sure the session variables stay... | [
{
"answer_id": 451008,
"author": "duffymo",
"author_id": 37213,
"author_profile": "https://Stackoverflow.com/users/37213",
"pm_score": 0,
"selected": false,
"text": "<p>I'm not an MVP, but Google found these. Maybe they'll help you:</p>\n\n<p><a href=\"http://www.mvps.org/access/general... | 2009/01/16 | [
"https://Stackoverflow.com/questions/450997",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39653/"
] | My application uses some session variables that are timing out even though I thought they would not because I've got the following setting in php.ini:
session.cookie\_lifetime = 0
The other session settings in php.ini are pretty much set as their defaults. How do I make sure the session variables stay around until th... | You should be able to run the compact function from within your VBA code.
I had the below snippet bookmarked from a long time ago when I was doing access work.
```
Public Sub CompactDB()
CommandBars("Menu Bar").Controls("Tools").Controls("Database utilities").Controls("Compact and repair database...").accDoDefau... |
451,004 | <p>I'm in the process of writing a client/server application which should work message based. I would like re-use as much as possible instead of writing another implementation and curious what others are using.</p>
<p>Features the library should offer:</p>
<ul>
<li><strong>client and server side</strong> functionalit... | [
{
"answer_id": 451022,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 2,
"selected": false,
"text": "<p>Well, HTTP is probably the best supported in terms of client and server code implementing it - but it may well be com... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33429/"
] | I'm in the process of writing a client/server application which should work message based. I would like re-use as much as possible instead of writing another implementation and curious what others are using.
Features the library should offer:
* **client and server side** functionality
* should work **message based**
... | Well, HTTP is probably the best supported in terms of client and server code implementing it - but it may well be completely inappropriate based on your requirements. We'll need to actually *see* some requirements (or at least a vague idea of what the application is like) before we can really advise you properly. |
451,035 | <p>I have the following snippet of code that's generating the "Use new keyword if hiding was intended" warning in VS2008:</p>
<pre><code>public double Foo(double param)
{
return base.Foo(param);
}
</code></pre>
<p>The <code>Foo()</code> function in the base class is protected and I want to expose it to a unit test... | [
{
"answer_id": 451049,
"author": "Marc Gravell",
"author_id": 23354,
"author_profile": "https://Stackoverflow.com/users/23354",
"pm_score": 7,
"selected": true,
"text": "<p>The <code>new</code> just makes it absolutely clear that you know you are stomping over an existing method. Since t... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451035",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1463/"
] | I have the following snippet of code that's generating the "Use new keyword if hiding was intended" warning in VS2008:
```
public double Foo(double param)
{
return base.Foo(param);
}
```
The `Foo()` function in the base class is protected and I want to expose it to a unit test by putting it in wrapper class solel... | The `new` just makes it absolutely clear that you know you are stomping over an existing method. Since the existing code was `protected`, it isn't as big a deal - you can safely add the `new` to stop it moaning.
The difference comes when your method does something different; any variable that references the *derived* ... |
451,047 | <p>In Oracle Forms 6i, you could enter query mode in your form, and type <strong>&</strong> or <strong>:A</strong> in a field, and when you executed the query, a Query/Where dialog box would open, allowing you to enter more complex query or sorting criteria than just entering data in the fields allows.</p>
<p>This... | [
{
"answer_id": 452531,
"author": "gareth.roberts",
"author_id": 56065,
"author_profile": "https://Stackoverflow.com/users/56065",
"pm_score": 0,
"selected": false,
"text": "<p>This functionality used to be in Oracle eBusiness Suite, but possibly was removed I think due to SQL Injection v... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451047",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19376/"
] | In Oracle Forms 6i, you could enter query mode in your form, and type **&** or **:A** in a field, and when you executed the query, a Query/Where dialog box would open, allowing you to enter more complex query or sorting criteria than just entering data in the fields allows.
This doesn't seem to work in Forms 10g: I ge... | I came across the answer after I posted this question here. In 10g forms, this functionality is disabled by default, but can be enabled by setting
```
FORMS_RESTRICT_ENTER_QUERY=FALSE
```
in the default.env file. We have now enabled this in our test environment, and it is working as expected. |
451,058 | <p>I'd like to create a derived control from System.Windows.Forms.ComboBox that is bound to a list of objects that I retrieve from the database. Idea is other developers can just drop this control on their form without having to worry about the datasource, binding, unless they want to.</p>
<p>I have tried to extend c... | [
{
"answer_id": 451225,
"author": "Benjamin Autin",
"author_id": 1440933,
"author_profile": "https://Stackoverflow.com/users/1440933",
"pm_score": 3,
"selected": false,
"text": "<p>The problem is that the designer actually does some compilation and execution in a slightly different contex... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451058",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/55899/"
] | I'd like to create a derived control from System.Windows.Forms.ComboBox that is bound to a list of objects that I retrieve from the database. Idea is other developers can just drop this control on their form without having to worry about the datasource, binding, unless they want to.
I have tried to extend combobox and... | DesignMode property doesn't work in a constructor. From googling for a while, found this LicenseManager thing.
```
if (LicenseManager.UsageMode != LicenseUsageMode.Designtime)
{
// Do your database/IO/remote call
}
```
However LicenseManager only works in constructors. For eventhandlers use DesignMode.
Source: ... |
451,060 | <p>Are there any nvl() equivalent functions in SQL?</p>
<p>Or something close enough to be used in the same way in certain scenarios?</p>
<p><hr>
UPDATE:
<br>no if statements<br>no case statements<br>no isnull<br>no coalesce<hr><br></p>
<pre><code>select nvl (purge_date,"SODIUFOSDIUFSDOIFUDSF") from id_rec where id=... | [
{
"answer_id": 451069,
"author": "BradC",
"author_id": 21398,
"author_profile": "https://Stackoverflow.com/users/21398",
"pm_score": 3,
"selected": false,
"text": "<p><a href=\"http://msdn.microsoft.com/en-us/library/ms184325.aspx\" rel=\"noreferrer\">ISNULL</a> (for a single replace)</p... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451060",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42229/"
] | Are there any nvl() equivalent functions in SQL?
Or something close enough to be used in the same way in certain scenarios?
---
UPDATE:
no if statements
no case statements
no isnull
no coalesce
---
```
select nvl (purge_date,"SODIUFOSDIUFSDOIFUDSF") from id_rec where id=36581;
(expression)
SODIUFOSDIUFSDO... | You seem to be using Informix.
AFAIK, there is DECODE there:
`DECODE(field, NULL, 'it is null, man', field)` should give you same result as `NVL(field, 'it is null, man')`
Please post exact name and version of the RDBMS you are using. |
451,070 | <p>I have a fillable, saveable PDF file that has an owner password (that I don't have access to). I can fill it out in Adobe reader, export the FDF file, modify the FDF file, and then import it. </p>
<p>Then I tried to do it with iText for .NET. I can't create a PdfStamper from my PdfReader because I didn't provide th... | [
{
"answer_id": 469716,
"author": "CMPalmer",
"author_id": 14894,
"author_profile": "https://Stackoverflow.com/users/14894",
"pm_score": 0,
"selected": false,
"text": "<p>Unless someone else chimes in, I'll assume the answer is \"No\"</p>\n\n<p>I wound up regenerating the PDF in an unencr... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have a fillable, saveable PDF file that has an owner password (that I don't have access to). I can fill it out in Adobe reader, export the FDF file, modify the FDF file, and then import it.
Then I tried to do it with iText for .NET. I can't create a PdfStamper from my PdfReader because I didn't provide the owner pa... | This line will bypass edit password checking in iTextSharp:
```
PdfReader.unethicalreading = true;
``` |
451,090 | <p>I have a function that loads a user object from a web service asynchronously.</p>
<p>I wrap this function call in another function and make it synchronous.</p>
<p>For example:</p>
<pre><code> private function getUser():User{
var newUser:User;
var f:UserFactory = new UserFactory();
... | [
{
"answer_id": 451112,
"author": "vava",
"author_id": 6258,
"author_profile": "https://Stackoverflow.com/users/6258",
"pm_score": 0,
"selected": false,
"text": "<p>You can't convert async call into sync one without something like \"sleep()\" function and as far as I know it is missing in... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451090",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have a function that loads a user object from a web service asynchronously.
I wrap this function call in another function and make it synchronous.
For example:
```
private function getUser():User{
var newUser:User;
var f:UserFactory = new UserFactory();
f.GetCurrent(functio... | This way madness lies.
Seriously, you're better off not trying to force an asynchronous call into some kind of synchronous architecture. Learn how the event handling system works in your favour and add a handler for the result event. In fact, here's the advice straight from the [flexcoders](http://tech.groups.yahoo.c... |
451,095 | <p><em>Pre-Problem: our office was hit by a worm due to a corporate patching oversight, and the boys in the lab repaved my machine. I needed to re-install all my development tools (Visual Studio 2005, SP1, and the Web Application Project Setup patch) again. The following problem did not occur before this event.</em></p... | [
{
"answer_id": 451112,
"author": "vava",
"author_id": 6258,
"author_profile": "https://Stackoverflow.com/users/6258",
"pm_score": 0,
"selected": false,
"text": "<p>You can't convert async call into sync one without something like \"sleep()\" function and as far as I know it is missing in... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6624/"
] | *Pre-Problem: our office was hit by a worm due to a corporate patching oversight, and the boys in the lab repaved my machine. I needed to re-install all my development tools (Visual Studio 2005, SP1, and the Web Application Project Setup patch) again. The following problem did not occur before this event.*
I've been w... | This way madness lies.
Seriously, you're better off not trying to force an asynchronous call into some kind of synchronous architecture. Learn how the event handling system works in your favour and add a handler for the result event. In fact, here's the advice straight from the [flexcoders](http://tech.groups.yahoo.c... |
451,096 | <p>I am not too familiar with database triggers and/or views. I am currently using PostgreSQL and HSQL; although the database is not too important. I am just wondering if <em>any</em> database offers something like this:</p>
<p>I have an (example) table like this:</p>
<pre><code>CREATE TABLE DUMMY_TABLE (ID INTEGER... | [
{
"answer_id": 451137,
"author": "DanSingerman",
"author_id": 43965,
"author_profile": "https://Stackoverflow.com/users/43965",
"pm_score": 2,
"selected": false,
"text": "<p>I think you have to put the trigger on the table, not the view.</p>\n\n<p>The trigger could use a query on the vie... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451096",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33863/"
] | I am not too familiar with database triggers and/or views. I am currently using PostgreSQL and HSQL; although the database is not too important. I am just wondering if *any* database offers something like this:
I have an (example) table like this:
```
CREATE TABLE DUMMY_TABLE (ID INTEGER, NUMBER INTEGER);
```
I cre... | It should be noted that PostgreSQL 9.1+ supports triggers on views. See [WAITING FOR 9.1 – TRIGGERS ON VIEWS](http://www.depesz.com/index.php/2010/10/16/waiting-for-9-1-triggers-on-views/) for a brief look at this. |
451,102 | <p>I have to do some work work with integers, but I am interested in treat them as binary data, in a way that for example I can take the 4 most significant bits of an 32 bit value. What I am trying to do is, I have several 32 bit value I want to take for example, in the first one 4 bits, the second one 6 bits and the l... | [
{
"answer_id": 451129,
"author": "PolyThinker",
"author_id": 47707,
"author_profile": "https://Stackoverflow.com/users/47707",
"pm_score": 3,
"selected": true,
"text": "<p>It seems that you don't need a library for that. Just bit shifting, logical and, or and xor should be sufficient for... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39160/"
] | I have to do some work work with integers, but I am interested in treat them as binary data, in a way that for example I can take the 4 most significant bits of an 32 bit value. What I am trying to do is, I have several 32 bit value I want to take for example, in the first one 4 bits, the second one 6 bits and the last... | It seems that you don't need a library for that. Just bit shifting, logical and, or and xor should be sufficient for what you want to do.
EDIT: Just to give an example. Suppose `a` is a 32-bit `int`, and you want to take the first 4 bit and store it in the lowest bit positions in another integer `b`, you could do thi... |
451,125 | <p>Here is the scenario: I have two asp pages. a.aspx is layout and b.aspx is content. I want to display the contents of b.aspx inside a <code><div></code> on a.aspx. I know with PHP you can do it like so:</p>
<pre><code>//a.php
<html>
<head>
<title>test</title>
</head&g... | [
{
"answer_id": 451147,
"author": "Jimmy",
"author_id": 4435,
"author_profile": "https://Stackoverflow.com/users/4435",
"pm_score": 1,
"selected": false,
"text": "<p>create a B.ascx that does everything you need, and then both B.aspx and A.aspx can include that control.</p>\n"
},
{
... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451125",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25515/"
] | Here is the scenario: I have two asp pages. a.aspx is layout and b.aspx is content. I want to display the contents of b.aspx inside a `<div>` on a.aspx. I know with PHP you can do it like so:
```
//a.php
<html>
<head>
<title>test</title>
</head>
<body>
<?PHP
include "b.php";
?>
<... | Probably `Server.Execute` will help.
```
//a.aspx
<html>
<head>
<title>test</title>
</head>
<body>
<% Server.Execute("b.aspx"); %>
</body>
</html>
//b.aspx
Content String
//result
<html>
<head>
<title>test</title>
</head>
<body>
Content String
</body>
</html>
```
... |
451,126 | <p>I am wondering how I can define an object in C whose reference will be null?</p>
<pre><code>// definition of foo
...
void * bar = &foo; // bar must be null
</code></pre>
<p>There is some ways I could find to do it, but none fit my needs.</p>
<pre><code>__attribute__((weak)) extern int foo; //not working with... | [
{
"answer_id": 451146,
"author": "Yuliy",
"author_id": 47527,
"author_profile": "https://Stackoverflow.com/users/47527",
"pm_score": 4,
"selected": false,
"text": "<p>I've got to be missing something, but what doesn't work about <code>void * bar = NULL</code>?</p>\n"
},
{
"answer... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26074/"
] | I am wondering how I can define an object in C whose reference will be null?
```
// definition of foo
...
void * bar = &foo; // bar must be null
```
There is some ways I could find to do it, but none fit my needs.
```
__attribute__((weak)) extern int foo; //not working with cygwin/gcc 3.4
__attribute__((at(0))) in... | You are trying to create a symbol with an address of zero. Your last example is probably the only way of doing this within the C compiler / language.
The approach that is most likely to solve your problem is to look at the input file to the linker program. Most linkers allow you to define the label foo as zero.
In a ... |
451,142 | <p>Note: I've made a few edits here as I didn't get my question across very well the first time around.</p>
<hr>
<p><strong>Update</strong>: After doing some of my own research on this subject, I've come up with a perfect example of why I'm searching out the perfect list of font-family with fall-backs: <a href="http:... | [
{
"answer_id": 451154,
"author": "Dave Rutledge",
"author_id": 2486915,
"author_profile": "https://Stackoverflow.com/users/2486915",
"pm_score": 1,
"selected": false,
"text": "<p>A good term to search for is web-safe fonts:</p>\n\n<p><a href=\"http://dustinbrewer.com/fonts-on-the-web-and... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16124/"
] | Note: I've made a few edits here as I didn't get my question across very well the first time around.
---
**Update**: After doing some of my own research on this subject, I've come up with a perfect example of why I'm searching out the perfect list of font-family with fall-backs: <http://www.brownbatterystudios.com/si... | I use [fonttester](http://www.fonttester.com/) to test and try web safe fonts combinations
**EDIT:**
in fonttester if you ask "Trebuchet" you'll get:
```
font-family: 'Trebuchet MS', Helvetica, sans-serif;
``` |
451,159 | <p>How can I map to a private field with fluent NHibernate AutoPersistenceModel?</p>
<pre><code> public class A
{
private List<B> myField;
public A()
{
myField = new List<B>();
}
public IList<B> MyBs
{
get { return myFi... | [
{
"answer_id": 616323,
"author": "Paco",
"author_id": 13376,
"author_profile": "https://Stackoverflow.com/users/13376",
"pm_score": 2,
"selected": true,
"text": "<p>The answer:</p>\n\n<p>It's not possible yet. Maybe I should submit a patch for it...</p>\n"
},
{
"answer_id": 15998... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13376/"
] | How can I map to a private field with fluent NHibernate AutoPersistenceModel?
```
public class A
{
private List<B> myField;
public A()
{
myField = new List<B>();
}
public IList<B> MyBs
{
get { return myField; }
}
}
```
Is ... | The answer:
It's not possible yet. Maybe I should submit a patch for it... |
451,182 | <p>Is there any other method of stopping inheritance of a class apart from declaring it as final or by declaring its constructor as private?</p>
| [
{
"answer_id": 451189,
"author": "vava",
"author_id": 6258,
"author_profile": "https://Stackoverflow.com/users/6258",
"pm_score": 5,
"selected": false,
"text": "<p>A comment</p>\n\n<pre><code>//Do not inherit please\n</code></pre>\n"
},
{
"answer_id": 451200,
"author": "NotMe... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451182",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Is there any other method of stopping inheritance of a class apart from declaring it as final or by declaring its constructor as private? | A comment
```
//Do not inherit please
``` |
451,227 | <p>Yes, the problem is with a library I'm using, and no, I cannot modify it. I need a workaround.</p>
<p>Basically, I'm dealing with a badly written Perl library, that exits with 'die' when a certain error condition is encountered reading a file. I call this routine from a program which is looping through thousands of... | [
{
"answer_id": 451236,
"author": "Jon Ericson",
"author_id": 1438,
"author_profile": "https://Stackoverflow.com/users/1438",
"pm_score": 7,
"selected": true,
"text": "<p>You could wrap it in an <code>eval</code>. See:</p>\n\n<pre><code>perldoc -f eval\n</code></pre>\n\n<p>For instance, ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41194/"
] | Yes, the problem is with a library I'm using, and no, I cannot modify it. I need a workaround.
Basically, I'm dealing with a badly written Perl library, that exits with 'die' when a certain error condition is encountered reading a file. I call this routine from a program which is looping through thousands of files, a ... | You could wrap it in an `eval`. See:
```
perldoc -f eval
```
For instance, you could write:
```
# warn if routine calls die
eval { routine_might_die }; warn $@ if $@;
```
This will turn the fatal error into a warning, which is more or less what you suggested. If `die` is called, `$@` contains the string passed to... |
451,228 | <p>This is my problem. I have a program that has to run in a TTY, cygwin provides this TTY. When I redirect stdIn the program fails because it does not have a TTY. I cannot modify this program, and need some way of automating it. </p>
<p><strong>How can I grab the cmd.exe window and send it data and make it think the ... | [
{
"answer_id": 451237,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 1,
"selected": false,
"text": "<p>Can you start the program (or cygwin) within your code, using <code>ProcessStartInfo.RedirectStandardInput</code> (an... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12243/"
] | This is my problem. I have a program that has to run in a TTY, cygwin provides this TTY. When I redirect stdIn the program fails because it does not have a TTY. I cannot modify this program, and need some way of automating it.
**How can I grab the cmd.exe window and send it data and make it think the user is typing i... | This sounds like a task for [`SendKeys()`](http://msdn.microsoft.com/en-us/library/8c6yea83(VS.85).aspx). It's not C#, but VBScript, but nontheless - you asked for *some* way of automating it:
```
Set Shell = CreateObject("WScript.Shell")
Shell.Run "cmd.exe /k title RemoteControlShell"
WScript.Sleep 250
Shell.AppAct... |
451,247 | <p>I have a WinForms app with a datagridview and a bindingsource. I want the user to confirm changes before I save them to the database. </p>
<p>I don't want to pop up the confirmation dialog unless I know the user has made changes. So I need a way to check if changes have been made. Any suggestions?</p>
| [
{
"answer_id": 451237,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 1,
"selected": false,
"text": "<p>Can you start the program (or cygwin) within your code, using <code>ProcessStartInfo.RedirectStandardInput</code> (an... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451247",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2342/"
] | I have a WinForms app with a datagridview and a bindingsource. I want the user to confirm changes before I save them to the database.
I don't want to pop up the confirmation dialog unless I know the user has made changes. So I need a way to check if changes have been made. Any suggestions? | This sounds like a task for [`SendKeys()`](http://msdn.microsoft.com/en-us/library/8c6yea83(VS.85).aspx). It's not C#, but VBScript, but nontheless - you asked for *some* way of automating it:
```
Set Shell = CreateObject("WScript.Shell")
Shell.Run "cmd.exe /k title RemoteControlShell"
WScript.Sleep 250
Shell.AppAct... |
451,280 | <p>I am trying to test a proof of concept that I can run a distributed transaction across two linked SQL Servers, linked using sp_addlinkedserver - their names are Server1 and Server2, both running under default instances. Each server holds a single database, Source and Destination respectively and the destination dat... | [
{
"answer_id": 451369,
"author": "Lance McNearney",
"author_id": 25549,
"author_profile": "https://Stackoverflow.com/users/25549",
"pm_score": 0,
"selected": false,
"text": "<p>Assuming these servers are both on the same domain - have you enabled trusted delegation to allow your server t... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40650/"
] | I am trying to test a proof of concept that I can run a distributed transaction across two linked SQL Servers, linked using sp\_addlinkedserver - their names are Server1 and Server2, both running under default instances. Each server holds a single database, Source and Destination respectively and the destination databa... | If you're on a domain, then the setting should be "Be made using the login's current security context", but there's one more step - you need to grant an SPN to each of the servers involved in the transaction.
Assuming you're running the SQL Services on both servers as a domain user (which you'll need to in order to ma... |
451,302 | <p>I have an Informix stored procedure that returns two columns and multiple rows. I can use "EXECUTE FUNCTION curr_sess(2009,'SP')" fine, but how do I get the results into a temp table.</p>
<p>EDIT: We are on version 10.00.HC5</p>
<hr>
<p>Testing Jonathan Leffler's idea didn't work.</p>
<pre><code>EXECUTE FUNCTION... | [
{
"answer_id": 452769,
"author": "Jonathan Leffler",
"author_id": 15168,
"author_profile": "https://Stackoverflow.com/users/15168",
"pm_score": 2,
"selected": false,
"text": "<p>One possibility is a stored procedure. Another (tested on IDS 11.50.FC1), which I wasn't sure would work, is:... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13832/"
] | I have an Informix stored procedure that returns two columns and multiple rows. I can use "EXECUTE FUNCTION curr\_sess(2009,'SP')" fine, but how do I get the results into a temp table.
EDIT: We are on version 10.00.HC5
---
Testing Jonathan Leffler's idea didn't work.
```
EXECUTE FUNCTION curr_sess(2009,'SP')
```
... | One possibility is a stored procedure. Another (tested on IDS 11.50.FC1), which I wasn't sure would work, is:
```
CREATE PROCEDURE r12() RETURNING INT, INT;
RETURN 1, 2 WITH RESUME;
RETURN 2, 3 WITH RESUME;
END PROCEDURE;
CREATE TEMP TABLE t12(c1 INT, c2 INT);
INSERT INTO t12 EXECUTE PROCEDURE r12();
```
The... |
451,338 | <p>I'm working on an application that allows users to add their own RSS feeds to a simple reader of sorts.</p>
<p>Currently, I'm using <code>xml_domit_rss</code> as the parser but I'm unsure if it's actually validating the URL before parsing.</p>
<p>From what I can gather online, it looks as if validating is separate... | [
{
"answer_id": 451352,
"author": "Johannes Weiss",
"author_id": 55925,
"author_profile": "https://Stackoverflow.com/users/55925",
"pm_score": 1,
"selected": false,
"text": "<p>You could validate the RSS with a RelaxNG schema. Schemas for all the different feed formats should be available... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451338",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/55689/"
] | I'm working on an application that allows users to add their own RSS feeds to a simple reader of sorts.
Currently, I'm using `xml_domit_rss` as the parser but I'm unsure if it's actually validating the URL before parsing.
From what I can gather online, it looks as if validating is separate from the parse, either by u... | It's simple, You can do that using **[SyndicationFeed](http://msdn.microsoft.com/en-us/library/system.servicemodel.syndication.syndicationfeed.aspx)**.
It supports [Atom 1.0](http://www.ietf.org/rfc/rfc4287.txt) and [RSS 2.0](http://validator.w3.org/feed/docs/rss2.html) versions.
```
try
{
SyndicationFeed fetched... |
451,345 | <p>I have a Linq to SQL query that was working just fine with SQL Server 2005 but, I have to deploy the web app with a SQL Server 2000 and, when executing that query, I get his error:</p>
<p>"System.Data.SqlClient.SqlException: The column prefix 't0' does not match with a table name or alias name used in the query."</... | [
{
"answer_id": 451462,
"author": "TGnat",
"author_id": 25121,
"author_profile": "https://Stackoverflow.com/users/25121",
"pm_score": 0,
"selected": false,
"text": "<p>Do you have the latest Service Pack for Visual Studio and the framework?</p>\n\n<p>I just checked some of my Linq generat... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451345",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have a Linq to SQL query that was working just fine with SQL Server 2005 but, I have to deploy the web app with a SQL Server 2000 and, when executing that query, I get his error:
"System.Data.SqlClient.SqlException: The column prefix 't0' does not match with a table name or alias name used in the query."
I have mor... | after several testing and review the DB, I found that the problem was a **legacy table** I was working on: that table has **"text" type fields**. Also, I had to **remove** some "**Distinct**" instructions in a nested query I had.
I found [this](http://msdn.microsoft.com/en-us/library/bb399342.aspx) and, after review t... |
451,347 | <p>In ruby, if I do "require foo", is there a way to subsequently determine the name of the module or modules defined in foo.rb?</p>
<p>For example, say I have a ruby file named foo.rb that looks like this:</p>
<pre><code># foo.rb
module MyModule
def self.summary
"this does something useful"
end
.... | [
{
"answer_id": 451423,
"author": "Jordan Liggitt",
"author_id": 54696,
"author_profile": "https://Stackoverflow.com/users/54696",
"pm_score": 3,
"selected": true,
"text": "<p>One approach would be to use <a href=\"http://www.ruby-doc.org/core/classes/ObjectSpace.html\" rel=\"nofollow nor... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7432/"
] | In ruby, if I do "require foo", is there a way to subsequently determine the name of the module or modules defined in foo.rb?
For example, say I have a ruby file named foo.rb that looks like this:
```
# foo.rb
module MyModule
def self.summary
"this does something useful"
end
...
end
```
In anoth... | One approach would be to use [ObjectSpace](http://www.ruby-doc.org/core/classes/ObjectSpace.html).each\_object(Module) to find all defined modules before requiring the file. Then, after you require the file, loop over all defined modules again and see if there are any new ones.
```
require "set"
old_modules = SortedSe... |
451,348 | <p>i've tried and tried and tried but i cannot manage to step into the XslCompiledTransform without having to load the stylesheet from disk (by passing a URI into the XslCompiledTransform.Load() method).</p>
<p>I am fully aware that you can only step into the XslCompiledTransform.Transform() method if you loaded the s... | [
{
"answer_id": 451423,
"author": "Jordan Liggitt",
"author_id": 54696,
"author_profile": "https://Stackoverflow.com/users/54696",
"pm_score": 3,
"selected": true,
"text": "<p>One approach would be to use <a href=\"http://www.ruby-doc.org/core/classes/ObjectSpace.html\" rel=\"nofollow nor... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451348",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | i've tried and tried and tried but i cannot manage to step into the XslCompiledTransform without having to load the stylesheet from disk (by passing a URI into the XslCompiledTransform.Load() method).
I am fully aware that you can only step into the XslCompiledTransform.Transform() method if you loaded the stylesheet ... | One approach would be to use [ObjectSpace](http://www.ruby-doc.org/core/classes/ObjectSpace.html).each\_object(Module) to find all defined modules before requiring the file. Then, after you require the file, loop over all defined modules again and see if there are any new ones.
```
require "set"
old_modules = SortedSe... |
451,351 | <p>I've been handed a Flex project that was originally built and compiled using Flex3 and CF7. My setup is Flex3 with CF8. Everything works fine when I initially pull the project over but as soon as I recompile, remote calls to the CFCs begin to fail. I used Charles Web Proxy debugger and discovered that the failure... | [
{
"answer_id": 451423,
"author": "Jordan Liggitt",
"author_id": 54696,
"author_profile": "https://Stackoverflow.com/users/54696",
"pm_score": 3,
"selected": true,
"text": "<p>One approach would be to use <a href=\"http://www.ruby-doc.org/core/classes/ObjectSpace.html\" rel=\"nofollow nor... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28701/"
] | I've been handed a Flex project that was originally built and compiled using Flex3 and CF7. My setup is Flex3 with CF8. Everything works fine when I initially pull the project over but as soon as I recompile, remote calls to the CFCs begin to fail. I used Charles Web Proxy debugger and discovered that the failure appea... | One approach would be to use [ObjectSpace](http://www.ruby-doc.org/core/classes/ObjectSpace.html).each\_object(Module) to find all defined modules before requiring the file. Then, after you require the file, loop over all defined modules again and see if there are any new ones.
```
require "set"
old_modules = SortedSe... |
451,362 | <p>Several of my pages use both JQuery and Protoype. Since I upgraded to version 1.3 of JQuery this appears to be causing problems, because both libraries define a function named '$'.</p>
<p>JQuery provides a function noConflict() which relinquishes control of $ to other libraries that may be using it. So it seems lik... | [
{
"answer_id": 451373,
"author": "Sampson",
"author_id": 54680,
"author_profile": "https://Stackoverflow.com/users/54680",
"pm_score": 3,
"selected": false,
"text": "<p>It would seem that the most simple answer would be to bite the bullet, and include your noConflict lines. Of course if ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451362",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2648/"
] | Several of my pages use both JQuery and Protoype. Since I upgraded to version 1.3 of JQuery this appears to be causing problems, because both libraries define a function named '$'.
JQuery provides a function noConflict() which relinquishes control of $ to other libraries that may be using it. So it seems like I need t... | Currently you can do something like this:
```
<head>
<script type="text/javascript" src="/obp/js/prototype.js"></script>
<script type="text/javascript" src="/obp/js/jquery.js"></script>
<script type="text/javascript">
var $j = jQuery.noConflict();
</script>
</head>
```
Then, use jQu... |
451,366 | <p>i wish to modify a string. In ssis I have a step which is a "Derived column transformation editior". I have a string such as:</p>
<pre><code>edit=style?form=exy?test=x~~StringIWantToRemove
</code></pre>
<p>I wish to remove "~~StringIWantToRemove"
"~~" is the delimiter
"StringIWantToRemove" is a random string og a... | [
{
"answer_id": 452234,
"author": "Cade Roux",
"author_id": 18255,
"author_profile": "https://Stackoverflow.com/users/18255",
"pm_score": 1,
"selected": false,
"text": "<p>I would consider using a script task with a regex - it's probably easier than trying to distill it down into a one-li... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451366",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/52843/"
] | i wish to modify a string. In ssis I have a step which is a "Derived column transformation editior". I have a string such as:
```
edit=style?form=exy?test=x~~StringIWantToRemove
```
I wish to remove "~~StringIWantToRemove"
"~~" is the delimiter
"StringIWantToRemove" is a random string og any value (apart from the d... | in the end I used a script component:
```
Dim debugOn As Boolean
debugOn = False
If debugOn Then MsgBox(Row.trackingCode)
If Row.trackingCode <> "" Then
' find the delimiter location
Dim endLocation As Integer
If debugOn Then MsgBox("index of ~~ is " & Row.trackingCode.ToString().IndexOf("~~", 0))
' c... |
451,376 | <p>The following method (in which I hopefully did not make any mistakes while dramatically simplifying it for this post) is working properly and set up using the Streamed transfer mode over the net.tcp protocol. The problem is that the performance is significantly worse than downloading the same file through IIS over ... | [
{
"answer_id": 453569,
"author": "Sailing Judo",
"author_id": 42620,
"author_profile": "https://Stackoverflow.com/users/42620",
"pm_score": 2,
"selected": false,
"text": "<p>I don't know the answer to your first question (I think you need to provide more code to show what you are doing f... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34290/"
] | The following method (in which I hopefully did not make any mistakes while dramatically simplifying it for this post) is working properly and set up using the Streamed transfer mode over the net.tcp protocol. The problem is that the performance is significantly worse than downloading the same file through IIS over http... | After 8 months of working on this problem, 3 of them with Microsoft, here is the solution. The short answer is that the server side (the side sending the large file) needed to use the following for a binding:
```
<customBinding>
<binding name="custom_tcp">
<binaryMessageEncoding />
<tcpTransport connectionBuf... |
451,380 | <p>I'm trying to add a listener to DOM change events. I was hoping something as simple as 'dom:loaded' was baked into Prototype. I'm not sure of the 'Prototype-way' to handle this.</p>
<p>EDIT: I cannot control every case in which the DOM may be altered, so I can't get away with firing a custom event on every DOM chan... | [
{
"answer_id": 451630,
"author": "Noah Goodrich",
"author_id": 20178,
"author_profile": "https://Stackoverflow.com/users/20178",
"pm_score": 1,
"selected": false,
"text": "<p>I would recommend that you take a look at the documentation for <a href=\"http://prototypejs.org/api/event/observ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I'm trying to add a listener to DOM change events. I was hoping something as simple as 'dom:loaded' was baked into Prototype. I'm not sure of the 'Prototype-way' to handle this.
EDIT: I cannot control every case in which the DOM may be altered, so I can't get away with firing a custom event on every DOM change. | There is no standard handler to watch this. However, you can fire custom events in Prototype. Combined with Function.wrap, you should be able to do exactly what you need.
Essentially, you take any function that can modify the DOM, such as Element.insert(), and wrap it with a function that fires your change event:
```... |
451,404 | <p>I'm new to MySQL and I'm figuring out the best way to perform an on-line hot logical backup using <code>mysqldump</code>. <a href="http://dev.mysql.com/doc/refman/5.1/en/backup-policy.html" rel="noreferrer">This page</a> suggests this command line:</p>
<pre><code>mysqldump --single-transaction --flush-logs --maste... | [
{
"answer_id": 474652,
"author": "Bill Karwin",
"author_id": 20860,
"author_profile": "https://Stackoverflow.com/users/20860",
"pm_score": 4,
"selected": true,
"text": "<p>Open a <code>mysql</code> command window and issue this command:</p>\n\n<pre><code>mysql> FLUSH TABLES WITH READ ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451404",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46405/"
] | I'm new to MySQL and I'm figuring out the best way to perform an on-line hot logical backup using `mysqldump`. [This page](http://dev.mysql.com/doc/refman/5.1/en/backup-policy.html) suggests this command line:
```
mysqldump --single-transaction --flush-logs --master-data=2
--all-databases > backup_sunday_1_P... | Open a `mysql` command window and issue this command:
```
mysql> FLUSH TABLES WITH READ LOCK;
```
This will lock *all* tables in *all* databases on this MySQL instance until you issue `UNLOCK TABLES` (or terminate the client connection that holds these read locks).
To confirm this, you can open another command wind... |
451,413 | <p><strong>Look at this makefile, it has some sort of primitive progress indication (could have been a progress bar).</strong></p>
<p><strong>Please give me suggestions/comments on it!</strong></p>
<hr>
<pre>
# BUILD is initially undefined
ifndef BUILD
# max equals 256 x's
sixteen := x x x x x x x x x x x x x x x ... | [
{
"answer_id": 451490,
"author": "Rob Wells",
"author_id": 2974,
"author_profile": "https://Stackoverflow.com/users/2974",
"pm_score": 2,
"selected": false,
"text": "<p>Nice trick! (-:</p>\n\n<p>But not really scalable for growing projects that are distributed across many directories wit... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451413",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/55935/"
] | **Look at this makefile, it has some sort of primitive progress indication (could have been a progress bar).**
**Please give me suggestions/comments on it!**
---
```
# BUILD is initially undefined
ifndef BUILD
# max equals 256 x's
sixteen := x x x x x x x x x x x x x x x x
MAX := $(foreach x,$(sixteen),$(sixteen))... | This one is less intrusive and more awesome.
```
ifneq ($(words $(MAKECMDGOALS)),1)
.DEFAULT_GOAL = all
%:
@$(MAKE) $@ --no-print-directory -rRf $(firstword $(MAKEFILE_LIST))
else
ifndef ECHO
T := $(shell $(MAKE) $(MAKECMDGOALS) --no-print-directory \
-nrRf $(firstword $(MAKEFILE_LIST)) \
ECHO="COU... |
451,415 | <p>I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life).</p>
<p>In the original app, we used <em>almost</em> entirely ANSI-SQL compliant statements, with one significant exception -- we used MySQL's <code>group_concat</code> function fairly frequently.</p>
<p><cod... | [
{
"answer_id": 451441,
"author": "BradC",
"author_id": 21398,
"author_profile": "https://Stackoverflow.com/users/21398",
"pm_score": 8,
"selected": true,
"text": "<p>No REAL easy way to do this. Lots of ideas out there, though.</p>\n\n<p><a href=\"http://blog.shlomoid.com/2008/11/emulati... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451415",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/47450/"
] | I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life).
In the original app, we used *almost* entirely ANSI-SQL compliant statements, with one significant exception -- we used MySQL's `group_concat` function fairly frequently.
`group_concat`, by the way, does this: ... | No REAL easy way to do this. Lots of ideas out there, though.
[Best one I've found](http://blog.shlomoid.com/2008/11/emulating-mysqls-groupconcat-function.html):
```
SELECT table_name, LEFT(column_names , LEN(column_names )-1) AS column_names
FROM information_schema.columns AS extern
CROSS APPLY
(
SELECT column_n... |
451,420 | <p>I'm currently enabling JSON calls to my web services using the ScriptService attribute. The problem is that one of my classes references a second class and .Net is not picking up and writing out the JavaScript for the second class. </p>
<p>As a workaround I can write a dummy method that just returns the second cl... | [
{
"answer_id": 452622,
"author": "Conceptdev",
"author_id": 25673,
"author_profile": "https://Stackoverflow.com/users/25673",
"pm_score": 0,
"selected": false,
"text": "<p>Lee, not sure if this works in your JSON/<code>[ScriptService]</code> scenario, but to serialize an object graph in ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451420",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40783/"
] | I'm currently enabling JSON calls to my web services using the ScriptService attribute. The problem is that one of my classes references a second class and .Net is not picking up and writing out the JavaScript for the second class.
As a workaround I can write a dummy method that just returns the second class. Then .N... | You need to use [System.Web.Script.Services.GenerateScriptTypeAttribute](http://msdn.microsoft.com/en-us/library/system.web.script.services.generatescripttypeattribute.aspx), which specifies that a server type should be included in the generated proxy code. You can apply this attribute to the web service itself or any ... |
451,424 | <p>I've seen a lot of links to MSDN and "works on my machine!" answers so I'd like to ask my question with the exact steps to duplicate what I'm doing. Because we are using an already existing webservice, I'm asking with the context of having a webservice hosted outside of my project, unlike many of the tutorials and v... | [
{
"answer_id": 451473,
"author": "Jeff Yates",
"author_id": 23234,
"author_profile": "https://Stackoverflow.com/users/23234",
"pm_score": 2,
"selected": false,
"text": "<h3>Client Configuration</h3>\n\n<p>Maybe your <code>ServiceReferences.ClientConfig</code> for your Silverlight client ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451424",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64/"
] | I've seen a lot of links to MSDN and "works on my machine!" answers so I'd like to ask my question with the exact steps to duplicate what I'm doing. Because we are using an already existing webservice, I'm asking with the context of having a webservice hosted outside of my project, unlike many of the tutorials and vide... | I've had this same problem a couple of times. In the past I've solved this by using the Web App as start up, but it looks like you've already done that.
My post on the subject: <http://www.donnfelker.com/silverlight-cross-domain-issue/> |
451,426 | <p>Assuming a series of points in 2d space that do not self-intersect, what is an efficient method of determining the area of the resulting polygon?</p>
<p>As a side note, this is not homework and I am not looking for code. I am looking for a description I can use to implement my own method. I have my ideas about pu... | [
{
"answer_id": 451443,
"author": "Loren Pechtel",
"author_id": 10659,
"author_profile": "https://Stackoverflow.com/users/10659",
"pm_score": 0,
"selected": false,
"text": "<p>My inclination would be to simply start slicing off triangles. I don't see how anything else could avoid being a... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2470/"
] | Assuming a series of points in 2d space that do not self-intersect, what is an efficient method of determining the area of the resulting polygon?
As a side note, this is not homework and I am not looking for code. I am looking for a description I can use to implement my own method. I have my ideas about pulling a sequ... | Here is [the standard method](https://web.archive.org/web/20100405070507/http://valis.cs.uiuc.edu/~sariel/research/CG/compgeom/msg00831.html), AFAIK. Basically sum the cross products around each vertex. Much simpler than triangulation.
Python code, given a polygon represented as a list of (x,y) vertex coordinates, imp... |
451,449 | <p>I have a large query (not written by me, but I'm making some modifications). One thing that kind of bugs me is that I've got the same COALESCE function in about four places. Is there a way to factor that out, possibly by joining with a select from DUAL? Is there a performance benefit to factoring it out?</p>
<p>... | [
{
"answer_id": 451467,
"author": "tuinstoel",
"author_id": 43901,
"author_profile": "https://Stackoverflow.com/users/43901",
"pm_score": 1,
"selected": false,
"text": "<p>Maybe you can use a with clause?</p>\n\n<pre><code>with data as\n(\n select COALESCE(t1_end_dt, t6_actl_end_dt,t6_c... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3333/"
] | I have a large query (not written by me, but I'm making some modifications). One thing that kind of bugs me is that I've got the same COALESCE function in about four places. Is there a way to factor that out, possibly by joining with a select from DUAL? Is there a performance benefit to factoring it out?
Here is the q... | You should be able to replace the occurrence in the GROUP BY clause with your column alias `perd_end_dt`. But the occurrences in JOIN conditions cannot use the column alias.
This does have an impact on performance. I don't think the JOIN
conditions can use an index the way they are written currently. However,
it's onl... |
451,452 | <p>In Java, we're using the following package to programmatically create excel documents:</p>
<pre><code>org.apache.poi.hssf
</code></pre>
<p>If you attempt to set a sheet's name (NOT file, but internal Excel sheet), you will get an error if:</p>
<ul>
<li>The name is over 31 characters</li>
<li>The name contains any... | [
{
"answer_id": 451488,
"author": "BradC",
"author_id": 21398,
"author_profile": "https://Stackoverflow.com/users/21398",
"pm_score": 6,
"selected": true,
"text": "<p>I think the problem is the colon, not the exclamation point.</p>\n\n<p>If you open Excel and try to manually edit a sheet ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19147/"
] | In Java, we're using the following package to programmatically create excel documents:
```
org.apache.poi.hssf
```
If you attempt to set a sheet's name (NOT file, but internal Excel sheet), you will get an error if:
* The name is over 31 characters
* The name contains any of the following characters: / \ \* ? [ ]
... | I think the problem is the colon, not the exclamation point.
If you open Excel and try to manually edit a sheet name, the only characters it doesn't let you type are [ ] \* / \ ? :
If you paste one of those characters in, you get the following error: (Excel 2003)
>
> While renaming a sheet or chart, you
> entered ... |
451,453 | <p>So this seems pretty basic but I can't get it to work. I have an Object, and I am using reflection to get to it's public properties. One of these properties is static and I'm having no luck getting to it.</p>
<pre><code>Public Function GetProp(ByRef obj As Object, ByVal propName as String) as PropertyInfo
Ret... | [
{
"answer_id": 451471,
"author": "earlNameless",
"author_id": 27107,
"author_profile": "https://Stackoverflow.com/users/27107",
"pm_score": 6,
"selected": false,
"text": "<p>This is C#, but should give you the idea:</p>\n\n<pre><code>public static void Main() {\n typeof(Program).GetPr... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44861/"
] | So this seems pretty basic but I can't get it to work. I have an Object, and I am using reflection to get to it's public properties. One of these properties is static and I'm having no luck getting to it.
```
Public Function GetProp(ByRef obj As Object, ByVal propName as String) as PropertyInfo
Return obj.GetType.... | Ok so the key for me was to use the .FlattenHierarchy BindingFlag. I don't really know why I just added it on a hunch and it started working. So the final solution that allows me to get Public Instance or Static Properties is:
```
obj.GetType.GetProperty(propName, Reflection.BindingFlags.Public _
Or Reflection.Bindi... |
451,460 | <p>I recently needed to serialize a datatable to JSON. Where I'm at we're still on .Net 2.0, so I can't use the JSON serializer in .Net 3.5. I figured this must have been done before, so I went looking online and <a href="http://www.codeproject.com/KB/aspnet/ASPNET_DataTable_to_JSON.aspx" rel="nofollow noreferrer">fo... | [
{
"answer_id": 451509,
"author": "tuinstoel",
"author_id": 43901,
"author_profile": "https://Stackoverflow.com/users/43901",
"pm_score": 1,
"selected": false,
"text": "<p>I found this: <a href=\"http://www.bramstein.com/projects/xsltjson/\" rel=\"nofollow noreferrer\">http://www.bramstei... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3043/"
] | I recently needed to serialize a datatable to JSON. Where I'm at we're still on .Net 2.0, so I can't use the JSON serializer in .Net 3.5. I figured this must have been done before, so I went looking online and [found](http://www.codeproject.com/KB/aspnet/ASPNET_DataTable_to_JSON.aspx) a [number](http://www.dennydotnet.... | Would it help you convince your bosses to install a library if it's Microsoft's [AJAX extensions for .NET 2.0](https://web.archive.org/web/20100906013249/http://www.microsoft.com:80/downloads/details.aspx?familyid=ca9d90fa-e8c9-42e3-aa19-08e2c027f5d6&displaylang=en)?
Included in them is [System.Web.Script.Serializatio... |
451,475 | <p>As of now I'm using below line to print with out dot's</p>
<pre><code>fprintf( stdout, "%-40s[%d]", tag, data);
</code></pre>
<p>I'm expecting the output would be something like following,</p>
<pre>
Number of cards..................................[500]
Fixed prize amount [in whole dollars]............[10]
Is thi... | [
{
"answer_id": 451483,
"author": "Lawrence Dol",
"author_id": 8946,
"author_profile": "https://Stackoverflow.com/users/8946",
"pm_score": 2,
"selected": false,
"text": "<p>You are going to have to output the string with the dot or dash padding yourself.</p>\n\n<p>Something like (forgive ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451475",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/51529/"
] | As of now I'm using below line to print with out dot's
```
fprintf( stdout, "%-40s[%d]", tag, data);
```
I'm expecting the output would be something like following,
```
Number of cards..................................[500]
Fixed prize amount [in whole dollars]............[10]
Is this a high winner prize?............ | A faster approach:
If the maximum amount of padding that you'll ever need is known in advance (which is normally the case when you're formatting a fixed-width table like the one you have), you can use a static "padder" string and just grab a chunk out of it. This will be faster than calling `printf` or `cout` in a loo... |
451,479 | <p>So, I'm getting some compile errors on netbeans 6.5 generated web service code for a java ME client to a c# (vs2005) web service. I've trimmed my example significantly, and it still shows the problem, and not being able to return a collection of things is pretty much a deal-breaker. </p>
<p>c# web service (Simple... | [
{
"answer_id": 451582,
"author": "sphereinabox",
"author_id": 2775,
"author_profile": "https://Stackoverflow.com/users/2775",
"pm_score": 3,
"selected": true,
"text": "<p><em>Clearly</em> you shouldn't be using fancy built-in things like netbeans's stub generator. Noes, you should be us... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451479",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2775/"
] | So, I'm getting some compile errors on netbeans 6.5 generated web service code for a java ME client to a c# (vs2005) web service. I've trimmed my example significantly, and it still shows the problem, and not being able to return a collection of things is pretty much a deal-breaker.
c# web service (SimpleWebService.a... | *Clearly* you shouldn't be using fancy built-in things like netbeans's stub generator. Noes, you should be using the Sun (or Sprint branded...) stub generator which you can get to by:
1. Right-Clicking your project
2. select **Properties**
3. Select **Platform** on the left side of new dialog
4. Click on **Manage Emul... |
451,486 | <p>I'm using Prototype's PeriodicalUpdater to update a div with the results of an ajax call. As I understand it, the div is updated by setting its innerHTML.</p>
<p>The div is wrapped in a <code><pre></code> tag. In Firefox, the <code><pre></code> formatting works as expected, but in IE, the text all end... | [
{
"answer_id": 451558,
"author": "EndangeredMassa",
"author_id": 106,
"author_profile": "https://Stackoverflow.com/users/106",
"pm_score": 5,
"selected": true,
"text": "<p>Setting innerHTML fires up an HTML parser, which ignores excess whitespace including hard returns. If you change you... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1094969/"
] | I'm using Prototype's PeriodicalUpdater to update a div with the results of an ajax call. As I understand it, the div is updated by setting its innerHTML.
The div is wrapped in a `<pre>` tag. In Firefox, the `<pre>` formatting works as expected, but in IE, the text all ends up on one line.
Here's some sample code fou... | Setting innerHTML fires up an HTML parser, which ignores excess whitespace including hard returns. If you change your method to include the <pre> tag in the string, it works fine because the HTML parser retains the hard returns.
You can see this in action by doing a View Generated Source after you run your sample page... |
451,491 | <p>An HTML text input has an attribute called "maxlength", implemented by browsers, which if set blocks user input after a certain number of characters.</p>
<p>An HTML textarea element, on the other hand, does not have this attribute. My goal is to emulate the behavior of maxlength on an HTML textarea. Requirements:</... | [
{
"answer_id": 451514,
"author": "MrChrister",
"author_id": 24229,
"author_profile": "https://Stackoverflow.com/users/24229",
"pm_score": 4,
"selected": false,
"text": "<p>Look at the comments on this site, with a count down. I have done it like this before, and it is simple and effectiv... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5144/"
] | An HTML text input has an attribute called "maxlength", implemented by browsers, which if set blocks user input after a certain number of characters.
An HTML textarea element, on the other hand, does not have this attribute. My goal is to emulate the behavior of maxlength on an HTML textarea. Requirements:
* At a min... | Look at the comments on this site, with a count down. I have done it like this before, and it is simple and effective. Stack Overflow makes good use of color too.
Perhaps you don't have enough rep to see the comment box.
It runs a little countdown while you type. At it approaches a threshold, the color changes from y... |
451,494 | <p>Now I appreciate the moral of the story is "don't hog the UI thread" but we tried to KISS by keeping things on the UI thread for as long as possible but I think we've just hit the tipping point and we're going to have to change our design. </p>
<p>But anyway..... something I noticed on our device that doesn't happe... | [
{
"answer_id": 451507,
"author": "ctacke",
"author_id": 13154,
"author_profile": "https://Stackoverflow.com/users/13154",
"pm_score": 1,
"selected": false,
"text": "<p>Windows CE won't \"drop\" any keys once the message gets into the queue. My guess is that you're using so much quantum ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1143/"
] | Now I appreciate the moral of the story is "don't hog the UI thread" but we tried to KISS by keeping things on the UI thread for as long as possible but I think we've just hit the tipping point and we're going to have to change our design.
But anyway..... something I noticed on our device that doesn't happen on deskt... | The issue was to do with a bug in the BSP (apparently from some Freescale code) that meant that the keyboard driver was functioning at a much lower priority interrupt than was intended.
This is now fixed and everything works awesome fine. :) |
451,499 | <p>When I run a Test Project on Visual Studio I use the code below to access a file inside the test project code folder</p>
<pre><code>var Location = System.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName
);
var FileLocation = Path.Combine(
... | [
{
"answer_id": 451517,
"author": "ctacke",
"author_id": 13154,
"author_profile": "https://Stackoverflow.com/users/13154",
"pm_score": 4,
"selected": true,
"text": "<p>Are you saying that you're trying to find the file in the context of a running test itself? If so you should look at the... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451499",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48465/"
] | When I run a Test Project on Visual Studio I use the code below to access a file inside the test project code folder
```
var Location = System.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName
);
var FileLocation = Path.Combine(
Location
... | Are you saying that you're trying to find the file in the context of a running test itself? If so you should look at the [TestContext](http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.testcontext(VS.80).aspx) object, specifically at the [TestDeploymentDir](http://msdn.microsoft.com/e... |
451,501 | <p>I have a very thin interface that's going to define one method. Should I require the type parameter on the class definition?</p>
<pre><code>public interface ISomethingFun<T>
{
void Do(T item);
}
</code></pre>
<p>or method definition?</p>
<pre><code>public interface ISomethingFun
{
void Do<T>(T... | [
{
"answer_id": 451511,
"author": "JaredPar",
"author_id": 23283,
"author_profile": "https://Stackoverflow.com/users/23283",
"pm_score": 2,
"selected": true,
"text": "<p>The advantage to having the generic on the method is that it facilitates type inference. </p>\n\n<pre><code>void Examp... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3619/"
] | I have a very thin interface that's going to define one method. Should I require the type parameter on the class definition?
```
public interface ISomethingFun<T>
{
void Do(T item);
}
```
or method definition?
```
public interface ISomethingFun
{
void Do<T>(T item);
}
```
What rationale? Is one easier to ... | The advantage to having the generic on the method is that it facilitates type inference.
```
void Example(ISomethingFun fun) {
fun.Do(42);
}
```
There you go, a completely generic call, no generic parameters. Putting the generic Parameter on the type forces you to add generic signatures or bindings whenever the t... |
451,505 | <p>Let's say I have a table "foo" that I want to script out using SMO. Is there a way to have it so that in the generated script the table has a different name such as "foo2"?</p>
<pre><code>Database db = sqlServer.Databases["testdb"];
Table foo = db.Tables["foo"];
foo.Name = "foo2";
</code></pre>
<p>If I do this, I... | [
{
"answer_id": 451572,
"author": "John Mo",
"author_id": 38988,
"author_profile": "https://Stackoverflow.com/users/38988",
"pm_score": 0,
"selected": false,
"text": "<p>You'll have to put the output of the Script method into a string variable and use Replace to substitute the name.</p>\n... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451505",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/815/"
] | Let's say I have a table "foo" that I want to script out using SMO. Is there a way to have it so that in the generated script the table has a different name such as "foo2"?
```
Database db = sqlServer.Databases["testdb"];
Table foo = db.Tables["foo"];
foo.Name = "foo2";
```
If I do this, I get this exception when I ... | For people like me who are trying to find out how to rename a column using SMO, if you're using the same method as above
```
foo.Name = "foo2";
```
you will get the same exception message in this thread. To rename the column you simply need to go
```
foo.Rename("foo2");
```
See [MSDN](http://msdn.microsoft.com/en... |
451,518 | <p>Emacs has <a href="http://mumble.net/~campbell/emacs/paredit.el" rel="noreferrer">Paredit</a> which actively prevents you from typing unbalanced parentheses (short of <code>C-Q (</code> to force-insert a literal one, or other craziness). Inserting an open paren also inserts a closing one. Backspacing over a paren ... | [
{
"answer_id": 451972,
"author": "Luc Hermitte",
"author_id": 15934,
"author_profile": "https://Stackoverflow.com/users/15934",
"pm_score": 3,
"selected": true,
"text": "<p>May I suggest <a href=\"http://code.google.com/p/lh-vim/wiki/lhBrackets\" rel=\"nofollow noreferrer\">my bracketing... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23070/"
] | Emacs has [Paredit](http://mumble.net/~campbell/emacs/paredit.el) which actively prevents you from typing unbalanced parentheses (short of `C-Q (` to force-insert a literal one, or other craziness). Inserting an open paren also inserts a closing one. Backspacing over a paren either deletes both the opening and closing ... | May I suggest [my bracketing](http://code.google.com/p/lh-vim/wiki/lhBrackets) system?
NB: prefer to fetch it directly from the svn repository, the new version is much more easier to tune to our needs.
If you are interested in the details/do-it-yourself-way, have a look at the [related tip on vim.wikia](http://vim.w... |
451,520 | <p>From my database I am getting a very long string which is basically xml.
I need to change it to a byte array.</p>
<p>I can't get my head around the potential encoding issues.</p>
<p>What do I need to be careful of when doing this conversion?</p>
<pre><code> public static byte[] StringToByteArray1(string str)
... | [
{
"answer_id": 451545,
"author": "Jon B",
"author_id": 27414,
"author_profile": "https://Stackoverflow.com/users/27414",
"pm_score": 0,
"selected": false,
"text": "<p>You should only use ASCII for legacy code compatibility, where it truly is ASCII. Note that this is 7 bits, and will not ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32670/"
] | From my database I am getting a very long string which is basically xml.
I need to change it to a byte array.
I can't get my head around the potential encoding issues.
What do I need to be careful of when doing this conversion?
```
public static byte[] StringToByteArray1(string str)
{
return Encoding.AS... | If you are dealing with ASCII characters then the result is identical.
On the other hand if you have non-ASCII characters in your string (for example π) then:
in ASCII encoding these will be replaced by "?".
in UTF8 they will be represented by a (possibly several byte character).
It is probably worth pointing out th... |
451,521 | <p>I am working on a little Perl module and for some reason I had the test driver script that was using my new module call one of the functions that I thought would be private, and it was successful. I was surprised, so I started searching google and I couldn't really find any documentation on how to make private func... | [
{
"answer_id": 451571,
"author": "jedihawk",
"author_id": 54322,
"author_profile": "https://Stackoverflow.com/users/54322",
"pm_score": 6,
"selected": true,
"text": "<p>From <code>perldoc perltoot</code> (about a quarter way through the document):</p>\n\n<blockquote>\n <p>Perl doesn't i... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40619/"
] | I am working on a little Perl module and for some reason I had the test driver script that was using my new module call one of the functions that I thought would be private, and it was successful. I was surprised, so I started searching google and I couldn't really find any documentation on how to make private function... | From `perldoc perltoot` (about a quarter way through the document):
>
> Perl doesn't impose restrictions on who gets to use which methods. The
> public-versus-private distinction is by convention, not syntax. (Well,
> unless you use the Alias module described below in "Data Members as
> Variables".) Occasionally y... |
451,523 | <p>I am trying to send email from an ASP.NET web application using the SmtpClient class. So far I have granted relay access to 127.0.0.1. I am trying to send test emails to my gmail account. The EML files get stuck in the mailroot's queue folder. My WinXP firewall is disabled. I dont get any exceptions in the code ... | [
{
"answer_id": 451816,
"author": "Brettski",
"author_id": 5836,
"author_profile": "https://Stackoverflow.com/users/5836",
"pm_score": 0,
"selected": false,
"text": "<p>I am still testing this Jim, one thing that I have noticed is that you are not setting your from address correctly. Fro... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I am trying to send email from an ASP.NET web application using the SmtpClient class. So far I have granted relay access to 127.0.0.1. I am trying to send test emails to my gmail account. The EML files get stuck in the mailroot's queue folder. My WinXP firewall is disabled. I dont get any exceptions in the code but the... | Depending on how your network is set up, you might need to tell IIS to pass on emails to your Exchange server to be passed on to the outside world. To do this:
1. Right-click on the Default SMTP Virtual Server node in the IIS MMC Snap-in and open the Properties dialog.
2. Go to the Delivery tab and click on the A... |
451,529 | <p>So i am working with some email header data, and for the to:, from:, cc:, and bcc: fields the email address(es) can be expressed in a number of different ways:</p>
<pre><code>First Last <name@domain.com>
Last, First <name@domain.com>
name@domain.com
</code></pre>
<p>And these variations can appear in t... | [
{
"answer_id": 451550,
"author": "Sarel Botha",
"author_id": 35264,
"author_profile": "https://Stackoverflow.com/users/35264",
"pm_score": 2,
"selected": false,
"text": "<p>There isn't really an easy solution to this. I would recommend making a little state machine that reads char-by-cha... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451529",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18811/"
] | So i am working with some email header data, and for the to:, from:, cc:, and bcc: fields the email address(es) can be expressed in a number of different ways:
```
First Last <name@domain.com>
Last, First <name@domain.com>
name@domain.com
```
And these variations can appear in the same message, in any order, all in ... | Here is the solution i came up with to accomplish this:
```
String str = "Last, First <name@domain.com>, name@domain.com, First Last <name@domain.com>, \"First Last\" <name@domain.com>";
List<string> addresses = new List<string>();
int atIdx = 0;
int commaIdx = 0;
int lastComma = 0;
for (int c = 0; c < str.Length; c+... |
451,541 | <p>I am writing a small app to teach myself ASP.NET MVC, and one of its features is the ability to search for books at Amazon (or other sites) and add them to a "bookshelf".</p>
<p>So I created an interface called IBookSearch (with a method DoSearch), and an implementation AmazonSearch that looks like this</p>
<pre><... | [
{
"answer_id": 451565,
"author": "MattK",
"author_id": 52734,
"author_profile": "https://Stackoverflow.com/users/52734",
"pm_score": 3,
"selected": true,
"text": "<p>It seems that your main issue here is knowing when to write mock code. I see your point: if you haven't written the code ... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451541",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/79101/"
] | I am writing a small app to teach myself ASP.NET MVC, and one of its features is the ability to search for books at Amazon (or other sites) and add them to a "bookshelf".
So I created an interface called IBookSearch (with a method DoSearch), and an implementation AmazonSearch that looks like this
```
public class Ama... | It seems that your main issue here is knowing when to write mock code. I see your point: if you haven't written the code yet, how can you mock it?
I think the answer is that you want to start your TDD with very, very simple tests, as Kent Beck does in [*Test Driven Development*](https://rads.stackoverflow.com/amzn/cli... |
451,583 | <p>Trying to get two erlang nodes talking to each other : one on a Ubuntu machine and one on Windows XP.</p>
<p>We're getting a "<strong>Connection attempt from disallowed node</strong>" message which prevents one node receiving messages from the other.</p>
<p>They're both using 5.XXX versions of Erlang OTP. </p>
<p... | [
{
"answer_id": 451764,
"author": "Stefan Schmidt",
"author_id": 1958045,
"author_profile": "https://Stackoverflow.com/users/1958045",
"pm_score": 1,
"selected": false,
"text": "<p>A couple of things come to mind:</p>\n\n<ol>\n<li>Have you tried setting the cookie via erlang:set_cookie on... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451583",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8482/"
] | Trying to get two erlang nodes talking to each other : one on a Ubuntu machine and one on Windows XP.
We're getting a "**Connection attempt from disallowed node**" message which prevents one node receiving messages from the other.
They're both using 5.XXX versions of Erlang OTP.
Both nodes have the same cookie ( .e... | Also, when you start the Erlang system, there is a commandline flag `-setcookie` which will let you specify the cookie at start time.
```
erl -name fred@ipaddress -setcookie FOOBAR
```
Hope that helps,
Jacob |
451,595 | <p>I have this program in c++:</p>
<pre><code>#include <iostream>
using namespace std;
int main()
{
char buf[50];
cin.getline(buf,49);
system(buf);
return 0;
}
</code></pre>
<p>When I run and compile it and type for example "helo", my program prints the error: </p>
<pre><code> "helo" not found.
</code></pre>
... | [
{
"answer_id": 451602,
"author": "Giovanni Funchal",
"author_id": 55935,
"author_profile": "https://Stackoverflow.com/users/55935",
"pm_score": 2,
"selected": false,
"text": "<p>Are you on linux? Try typing \"./hello\"</p>\n\n<p>If this works, the reason is that the current directory (\"... | 2009/01/16 | [
"https://Stackoverflow.com/questions/451595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have this program in c++:
```
#include <iostream>
using namespace std;
int main()
{
char buf[50];
cin.getline(buf,49);
system(buf);
return 0;
}
```
When I run and compile it and type for example "helo", my program prints the error:
```
"helo" not found.
```
Can I stop this error from being displayed? Is ther... | You can't change the way `system` displays errors. C and C++ put very little to no requirements on implementations in that regard, so that large parts of it are left unspecified, to allow them to be as flexible as possible.
If you want more precise control, you should use the functions of your runtime library or opera... |