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 |
|---|---|---|---|---|---|---|
436,034 | <p>Im trying to set up a session and i am getting a header error, dispite as far as i can tell i am telling it to start the session before the header is sent. any help here would be useful.</p>
<pre><code><?php
ob_start();
session_start();
$_SESSION['active'] = 1;
ob_end_flush();
?>
<html>
<body>
200... | [
{
"answer_id": 436057,
"author": "Piskvor left the building",
"author_id": 19746,
"author_profile": "https://Stackoverflow.com/users/19746",
"pm_score": 2,
"selected": false,
"text": "<p>See the output: <code>Cannot send session cookie - headers already sent by (output started at /home/c... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436034",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54229/"
] | Im trying to set up a session and i am getting a header error, dispite as far as i can tell i am telling it to start the session before the header is sent. any help here would be useful.
```
<?php
ob_start();
session_start();
$_SESSION['active'] = 1;
ob_end_flush();
?>
<html>
<body>
2009c Christ Redeemer Catholic Chur... | If you use UTF-8, be sure to save the file without [BOM](http://en.wikipedia.org/wiki/Byte-order_mark). |
436,064 | <p>Is it possible to dynamically the URL of a feed that has been instantiated in the header of a page via JavaScript?</p>
<p>For example, is it possible to update the URL of the rss feed in the following snippet:</p>
<pre><code><html>
<head>
<link rel="alternate" title="Feed" href="/rss.feed" typ... | [
{
"answer_id": 436090,
"author": "TheTXI",
"author_id": 22164,
"author_profile": "https://Stackoverflow.com/users/22164",
"pm_score": 2,
"selected": false,
"text": "<p>You could just a different theme of colors (more brights and pastels, chunkier buttons, etc.) for a child versus an adul... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436064",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12037/"
] | Is it possible to dynamically the URL of a feed that has been instantiated in the header of a page via JavaScript?
For example, is it possible to update the URL of the rss feed in the following snippet:
```
<html>
<head>
<link rel="alternate" title="Feed" href="/rss.feed" type="application/rss+xml">
</head>
... | You could just a different theme of colors (more brights and pastels, chunkier buttons, etc.) for a child versus an adult.
You could also change up the layouts.
These changes could all be done with CSS and switching up the CSS Classes of your items based on the type of visitor you are receiving. |
436,120 | <p>Is there any way to make “private” variables (those defined in the constructor), available to prototype-defined methods?</p>
<pre><code>TestClass = function(){
var privateField = "hello";
this.nonProtoHello = function(){alert(privateField)};
};
TestClass.prototype.prototypeHello = function(){alert(privateFi... | [
{
"answer_id": 436147,
"author": "Kenan Banks",
"author_id": 43089,
"author_profile": "https://Stackoverflow.com/users/43089",
"pm_score": 9,
"selected": true,
"text": "<p>No, there's no way to do it. That would essentially be scoping in reverse. </p>\n\n<p>Methods defined inside the c... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44683/"
] | Is there any way to make “private” variables (those defined in the constructor), available to prototype-defined methods?
```
TestClass = function(){
var privateField = "hello";
this.nonProtoHello = function(){alert(privateField)};
};
TestClass.prototype.prototypeHello = function(){alert(privateField)};
```
T... | No, there's no way to do it. That would essentially be scoping in reverse.
Methods defined inside the constructor have access to private variables because all functions have access to the scope in which they were defined.
Methods defined on a prototype are not defined within the scope of the constructor, and will n... |
436,154 | <p>I have the following line of code in a link on my webpage:</p>
<pre><code><a href="javascript:$('#comment_form').toggle('normal')" title="Comment on this post">
</code></pre>
<p>This produces a link that should pop open a hidden form. It works on Safari, but in Firefox, I just get an almost-empty page with n... | [
{
"answer_id": 436160,
"author": "Ates Goral",
"author_id": 23501,
"author_profile": "https://Stackoverflow.com/users/23501",
"pm_score": 3,
"selected": false,
"text": "<p>Try:</p>\n\n<pre><code><a href=\"javascript:void($('#comment_form').toggle('normal'))\" title=\"Comment on this p... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28804/"
] | I have the following line of code in a link on my webpage:
```
<a href="javascript:$('#comment_form').toggle('normal')" title="Comment on this post">
```
This produces a link that should pop open a hidden form. It works on Safari, but in Firefox, I just get an almost-empty page with nothing but the following text:
... | For the love of...
```
<script type='text/javascript'>
jQuery(function($){ # Document ready, access $ as jQuery in this scope
$("a#comment").click(function(){ # bind a click event on the A like with ID='comment'
$('#comment_form').toggleClass('normal'); # Toggle the class on the ID comment form
... |
436,156 | <p>I'm using HibernateDaoSupport in Spring for Spring-Hibernate integration. I need to intercept all getCurrentSession calls and enable a filter and set a filter parameter value.</p>
<p>Hibernate supports CurrentSessionContext impls to intercept getCurrentSession calls. Spring provides an implementation of this called... | [
{
"answer_id": 436160,
"author": "Ates Goral",
"author_id": 23501,
"author_profile": "https://Stackoverflow.com/users/23501",
"pm_score": 3,
"selected": false,
"text": "<p>Try:</p>\n\n<pre><code><a href=\"javascript:void($('#comment_form').toggle('normal'))\" title=\"Comment on this p... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436156",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/51402/"
] | I'm using HibernateDaoSupport in Spring for Spring-Hibernate integration. I need to intercept all getCurrentSession calls and enable a filter and set a filter parameter value.
Hibernate supports CurrentSessionContext impls to intercept getCurrentSession calls. Spring provides an implementation of this called SpringSes... | For the love of...
```
<script type='text/javascript'>
jQuery(function($){ # Document ready, access $ as jQuery in this scope
$("a#comment").click(function(){ # bind a click event on the A like with ID='comment'
$('#comment_form').toggleClass('normal'); # Toggle the class on the ID comment form
... |
436,186 | <p>I'm building a client/server application to make periodic backups of certain files. Basically, the client will monitor certain files for changes, and upload them to the server. The server will then receive them and will save them with an incrementing postfix.(i.e. "<code>filename_v1</code>", "<code>filename_v2</code... | [
{
"answer_id": 436303,
"author": "Steve Wranovsky",
"author_id": 3429,
"author_profile": "https://Stackoverflow.com/users/3429",
"pm_score": 1,
"selected": false,
"text": "<p>I've done some work on a socket library that is used to transfer medical images in .NET over the past year or so.... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436186",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54246/"
] | I'm building a client/server application to make periodic backups of certain files. Basically, the client will monitor certain files for changes, and upload them to the server. The server will then receive them and will save them with an incrementing postfix.(i.e. "`filename_v1`", "`filename_v2`", etc). Now, I managed ... | Does your callback implement EndReceive?
Are you passing a state object? If so, have one of the properties be the buffer you pass to BeginReceive, then in your callback, check the state buffer to see if any data was received. If not, don't continue the loop.
```
struct SocketStateObject
{
public byte[] Buffer;
pu... |
436,189 | <p>When I read a directory in Perl with <code>opendir</code>, <code>readdir</code>, and <code>closedir</code>, the <code>readdir</code> function doesn't seem to read the files in any specific order (that I can tell).</p>
<p>I am reading a directory that has subdirectories named by epoch timestamp:</p>
<pre><code>1224... | [
{
"answer_id": 436286,
"author": "Andrew Barnett",
"author_id": 16780,
"author_profile": "https://Stackoverflow.com/users/16780",
"pm_score": 5,
"selected": true,
"text": "<p><strong>readdir</strong> can be called in array context, so just do this:</p>\n\n<pre><code>opendir( my $data_dh,... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40619/"
] | When I read a directory in Perl with `opendir`, `readdir`, and `closedir`, the `readdir` function doesn't seem to read the files in any specific order (that I can tell).
I am reading a directory that has subdirectories named by epoch timestamp:
```
1224161460
1228324260
1229698140
```
I want to read in these direct... | **readdir** can be called in array context, so just do this:
```
opendir( my $data_dh, $data_dir) or die "Cannot open $data_dir\n";
my @files = sort { $a <=> $b } readdir($data_dh);
while ( my $name = shift @files ) {
...
``` |
436,198 | <p>It seems they canceled in Python 3 all the easy way to quickly load a script by removing <code>execfile()</code> </p>
<p>Is there an obvious alternative I'm missing?</p>
| [
{
"answer_id": 436214,
"author": "ascobol",
"author_id": 49886,
"author_profile": "https://Stackoverflow.com/users/49886",
"pm_score": 4,
"selected": false,
"text": "<p>If the script you want to load is in the same directory than the one you run, maybe \"import\" will do the job ?</p>\n\... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54248/"
] | It seems they canceled in Python 3 all the easy way to quickly load a script by removing `execfile()`
Is there an obvious alternative I'm missing? | [According to the documentation](https://docs.python.org/3.3/whatsnew/3.0.html?highlight=execfile#builtins), instead of
```
execfile("./filename")
```
Use
```
exec(open("./filename").read())
```
See:
* [What’s New In Python 3.0](http://docs.python.org/3.3/whatsnew/3.0.html?highlight=execfile#builtins) |
436,234 | <p>This is a follow up to a question I just posted.
I'm wondering how you all handle member variables in javascript clases when using MyClass.prototype to define methods.</p>
<p>If you define all of the methods in the constructor function:</p>
<pre><code>function MyClass(){
this.myMethod = function(){}
}
</code></pr... | [
{
"answer_id": 436249,
"author": "Luca Matteis",
"author_id": 50394,
"author_profile": "https://Stackoverflow.com/users/50394",
"pm_score": 2,
"selected": false,
"text": "<p>You should use the prototype to store methods, because when you find yourself with 100 methods, they're not copied... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436234",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44683/"
] | This is a follow up to a question I just posted.
I'm wondering how you all handle member variables in javascript clases when using MyClass.prototype to define methods.
If you define all of the methods in the constructor function:
```
function MyClass(){
this.myMethod = function(){}
}
```
You can very nicely declar... | You should get over your aversion to using the `this` pointer to access member variables.
Assign member variables in the constructor, and you can access them with prototype methods:
```
function Cat(){
this.legs = 4;
this.temperament = 'Apathetic';
this.sound = 'Meow';
}
Cat.prototype.speak = function()... |
436,235 | <p>I am displaying Microsoft Office Web Components (Microsoft Data Access Controls) on my Sharepoint site. Clients need to enable "Access Data Sources Across Domains" in IE in order to view the page. Unfortunately, clients cannot modify their IE settings. Is there anyway I can get these components to display?</p>
| [
{
"answer_id": 436249,
"author": "Luca Matteis",
"author_id": 50394,
"author_profile": "https://Stackoverflow.com/users/50394",
"pm_score": 2,
"selected": false,
"text": "<p>You should use the prototype to store methods, because when you find yourself with 100 methods, they're not copied... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19875/"
] | I am displaying Microsoft Office Web Components (Microsoft Data Access Controls) on my Sharepoint site. Clients need to enable "Access Data Sources Across Domains" in IE in order to view the page. Unfortunately, clients cannot modify their IE settings. Is there anyway I can get these components to display? | You should get over your aversion to using the `this` pointer to access member variables.
Assign member variables in the constructor, and you can access them with prototype methods:
```
function Cat(){
this.legs = 4;
this.temperament = 'Apathetic';
this.sound = 'Meow';
}
Cat.prototype.speak = function()... |
436,243 | <p>Log files are often large an unwieldy. Is there a way to "backup" a SQL Server database without any log files (or with empty log files)?</p>
| [
{
"answer_id": 436658,
"author": "SqlRyan",
"author_id": 8114,
"author_profile": "https://Stackoverflow.com/users/8114",
"pm_score": 0,
"selected": false,
"text": "<p>Just before you take the full database backup, execute:</p>\n\n<pre><code>BACKUP LOG databasename WITH TRUNCATE_ONLY\n</c... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436243",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38522/"
] | Log files are often large an unwieldy. Is there a way to "backup" a SQL Server database without any log files (or with empty log files)? | Portions of the log are actually included in the backup. It's how you get consistency on a restore. The pages that change while the backup is running are grabbed from the log( or the logged changes) and then those are applied at the end of the restore process.
You can't get around that, but you can limit the amount of... |
436,250 | <p>Does any one know from where can I download source code for Cassini. I tried the link <a href="http://www.asp.net/Projects/Cassini/Download" rel="nofollow noreferrer">http://www.asp.net/Projects/Cassini/Download</a> but this page does not exist now.</p>
| [
{
"answer_id": 436658,
"author": "SqlRyan",
"author_id": 8114,
"author_profile": "https://Stackoverflow.com/users/8114",
"pm_score": 0,
"selected": false,
"text": "<p>Just before you take the full database backup, execute:</p>\n\n<pre><code>BACKUP LOG databasename WITH TRUNCATE_ONLY\n</c... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45280/"
] | Does any one know from where can I download source code for Cassini. I tried the link <http://www.asp.net/Projects/Cassini/Download> but this page does not exist now. | Portions of the log are actually included in the backup. It's how you get consistency on a restore. The pages that change while the backup is running are grabbed from the log( or the logged changes) and then those are applied at the end of the restore process.
You can't get around that, but you can limit the amount of... |
436,251 | <p>I have a rather simple query</p>
<pre><code>SELECT col1 FROM table1
</code></pre>
<p>This command outputs about 300K+ entries per second, which sounds reasonable, yet other methods for mass decoding of saved data (e.g. array deserialization) works at the limit of what the hard drive enables, i.e. 40-50 MB/s, compa... | [
{
"answer_id": 436268,
"author": "Filip Ekberg",
"author_id": 39106,
"author_profile": "https://Stackoverflow.com/users/39106",
"pm_score": 2,
"selected": false,
"text": "<p>Store the database in memory. Makes it Really fast!</p>\n"
},
{
"answer_id": 436304,
"author": "Yuval ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436251",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28772/"
] | I have a rather simple query
```
SELECT col1 FROM table1
```
This command outputs about 300K+ entries per second, which sounds reasonable, yet other methods for mass decoding of saved data (e.g. array deserialization) works at the limit of what the hard drive enables, i.e. 40-50 MB/s, compared with 2-3 MB/s with MyS... | Store the database in memory. Makes it Really fast! |
436,265 | <p>Often I add an <code>Empty</code> method to my C++ objects to clear the internal state using code similar to the following.</p>
<pre><code>class Foo
{
private:
int n_;
std::string str_;
public:
Foo() : n_(1234), str_("Hello, world!")
{
}
void Empty()
{
*this = Foo();
}
};
</... | [
{
"answer_id": 436284,
"author": "Ates Goral",
"author_id": 23501,
"author_profile": "https://Stackoverflow.com/users/23501",
"pm_score": 5,
"selected": true,
"text": "<p>I'd let the constructor call my function instead:</p>\n\n<pre><code>class Foo\n{\nprivate:\n int n_;\n std::str... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436265",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9236/"
] | Often I add an `Empty` method to my C++ objects to clear the internal state using code similar to the following.
```
class Foo
{
private:
int n_;
std::string str_;
public:
Foo() : n_(1234), str_("Hello, world!")
{
}
void Empty()
{
*this = Foo();
}
};
```
This seems to be bett... | I'd let the constructor call my function instead:
```
class Foo
{
private:
int n_;
std::string str_;
public:
Foo()
{
Reset();
}
void Reset()
{
n_ = 1234;
str_ = "Hello, world!";
}
};
```
Yes, you're unnecessarily initializing the string as an empty string firs... |
436,266 | <p>I am building an email which will be used via a web form to transmit data to a mailbox. I am looking to timestamp the XML portion of the email using ISO 8601 format. I need to get the time the email is sent then convert it all using PHP. Any ideas?</p>
| [
{
"answer_id": 436573,
"author": "Ry Biesemeyer",
"author_id": 53098,
"author_profile": "https://Stackoverflow.com/users/53098",
"pm_score": 1,
"selected": false,
"text": "<p><a href=\"http://us3.php.net/date\" rel=\"nofollow noreferrer\">php manual - date</a></p>\n\n<pre><code>date('c')... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I am building an email which will be used via a web form to transmit data to a mailbox. I am looking to timestamp the XML portion of the email using ISO 8601 format. I need to get the time the email is sent then convert it all using PHP. Any ideas? | [php manual - date](http://us3.php.net/date)
```
date('c')
```
will output the current *server* time in iso8601. If you're looking to read in a date, you can pass a timestamp into the function like this
```
date('c',strtotime('January 4th 2001 4:30pm'))
```
where the argument for [strtotime](http://us3.php.net/st... |
436,276 | <p>I haven't been able to find any documentation on how to configure Hibernate's logging using the XML style configuration file for Log4j.</p>
<p>Is this even possible or do I have use a properties style configuration file to control Hibernate's logging?</p>
<p>If anyone has any information or links to documentation ... | [
{
"answer_id": 436687,
"author": "Loki",
"author_id": 39057,
"author_profile": "https://Stackoverflow.com/users/39057",
"pm_score": 8,
"selected": true,
"text": "<p>From <a href=\"http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html#configuration-logging\... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436276",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20774/"
] | I haven't been able to find any documentation on how to configure Hibernate's logging using the XML style configuration file for Log4j.
Is this even possible or do I have use a properties style configuration file to control Hibernate's logging?
If anyone has any information or links to documentation it would apprecia... | From <http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html#configuration-logging>
Here's the list of logger categories:
```
Category Function
org.hibernate.SQL Log all SQL DML statements as they are executed
org.hibernate.type Log all JDBC parame... |
436,294 | <p>Consider the following snippet:</p>
<pre><code>if(form1.isLoggedIn)
{
//Create a wait handle for the UI thread.
//the "false" specifies that it is non-signalled
//therefore a blocking on the waitone method.
AutoResetEvent hold = new AutoResetEvent(false);
filename = Path.Combine(E... | [
{
"answer_id": 436687,
"author": "Loki",
"author_id": 39057,
"author_profile": "https://Stackoverflow.com/users/39057",
"pm_score": 8,
"selected": true,
"text": "<p>From <a href=\"http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html#configuration-logging\... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436294",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50312/"
] | Consider the following snippet:
```
if(form1.isLoggedIn)
{
//Create a wait handle for the UI thread.
//the "false" specifies that it is non-signalled
//therefore a blocking on the waitone method.
AutoResetEvent hold = new AutoResetEvent(false);
filename = Path.Combine(Environment.Get... | From <http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html#configuration-logging>
Here's the list of logger categories:
```
Category Function
org.hibernate.SQL Log all SQL DML statements as they are executed
org.hibernate.type Log all JDBC parame... |
436,300 | <p>If I write a <em>#define</em> that performs an operation using other preprocessor constants, is the final value computed each time the macro appears at runtime? Does this depend on optimizations in the compiler, or is it covered under a standard?</p>
<p>Example:</p>
<pre><code>#define EXTERNAL_CLOCK_FREQUENCY 3... | [
{
"answer_id": 436326,
"author": "David Lehavi",
"author_id": 50761,
"author_profile": "https://Stackoverflow.com/users/50761",
"pm_score": -1,
"selected": false,
"text": "<p>At compile time. This is a language standard (and always have been) and independent on the compiler.</p>\n\n<p><s... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1491/"
] | If I write a *#define* that performs an operation using other preprocessor constants, is the final value computed each time the macro appears at runtime? Does this depend on optimizations in the compiler, or is it covered under a standard?
Example:
```
#define EXTERNAL_CLOCK_FREQUENCY 32768
#define TIMER_1_S ... | Macros are simply textual substitution, so in your example writing `TIMER_100_MS` in a program is a fancy way of writing `32768 / 10`.
Therefore, the question is when the compiler would evaluate `32768 / 10`, which is a constant integral expression. I don't think the standard requires any particular behavior here (sin... |
436,301 | <p>I have a dynamically created menu which I have a menuItemClick event tied in. In this event I want to execute a simple window.open script that uses the clicked items' url. The reason I need to do this is I need to set the parameters of the window opening (i.e. no scroll bars, no toolbars, etc...).</p>
<p>My ques... | [
{
"answer_id": 436318,
"author": "bdukes",
"author_id": 2688,
"author_profile": "https://Stackoverflow.com/users/2688",
"pm_score": 0,
"selected": false,
"text": "<p>You'll want to use <a href=\"http://msdn.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.registerstartupscri... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436301",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20748/"
] | I have a dynamically created menu which I have a menuItemClick event tied in. In this event I want to execute a simple window.open script that uses the clicked items' url. The reason I need to do this is I need to set the parameters of the window opening (i.e. no scroll bars, no toolbars, etc...).
My question is, is t... | You can put the window.open (...) code inside a javascript function called onButtonClick (item) and emit it with RegisterStartupScript () just as bdukes suggested, then in the aspx code for the page you can add an eventHandler like
```
<a id="bla" onclick="javascript:onButtonClick(this);" >Dummy item</a>
```
Then w... |
436,305 | <p>I was kind of shocked by this. Could someone explain why this works? A good example of when to use it would also be nice.</p>
<pre><code>Public Interface IFoo
Sub DoIt()
End Interface
Public Class Bar
Implements IFoo
Private DoIt() implements IFoo.DoIt
End Class
...
Dim b as new Bar()
b.DoIt() 'error
CTyp... | [
{
"answer_id": 436314,
"author": "Konrad Rudolph",
"author_id": 1968,
"author_profile": "https://Stackoverflow.com/users/1968",
"pm_score": 3,
"selected": false,
"text": "<blockquote>\n <p>I was kind of shocked by this. Could someone explain why this works? A good example of when to use... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436305",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40822/"
] | I was kind of shocked by this. Could someone explain why this works? A good example of when to use it would also be nice.
```
Public Interface IFoo
Sub DoIt()
End Interface
Public Class Bar
Implements IFoo
Private DoIt() implements IFoo.DoIt
End Class
...
Dim b as new Bar()
b.DoIt() 'error
CType(b, IFoo).DoI... | Having a private interface implementation basically just allows you to implement an interface without having to muddy your class' API. You can implement `IFoo`, but only APIs that treat you as an `IFoo` need to know that.
[MSDN](http://msdn.microsoft.com/en-us/library/4b3c4by9.aspx) says
>
> You can use a private me... |
436,319 | <p>So I'm trying my hands at a css menu and I have a simple bug that I cannot fix and haven't found any help searching for it. The issue is that when I hover over a drop down menu the parent link stays highlighted and the text reverts back to the original color. Hopefully that explains it. Here's the css code, I'm sure... | [
{
"answer_id": 436314,
"author": "Konrad Rudolph",
"author_id": 1968,
"author_profile": "https://Stackoverflow.com/users/1968",
"pm_score": 3,
"selected": false,
"text": "<blockquote>\n <p>I was kind of shocked by this. Could someone explain why this works? A good example of when to use... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54264/"
] | So I'm trying my hands at a css menu and I have a simple bug that I cannot fix and haven't found any help searching for it. The issue is that when I hover over a drop down menu the parent link stays highlighted and the text reverts back to the original color. Hopefully that explains it. Here's the css code, I'm sure it... | Having a private interface implementation basically just allows you to implement an interface without having to muddy your class' API. You can implement `IFoo`, but only APIs that treat you as an `IFoo` need to know that.
[MSDN](http://msdn.microsoft.com/en-us/library/4b3c4by9.aspx) says
>
> You can use a private me... |
436,322 | <p>Ayende has a <a href="http://ayende.com/Blog/archive/2006/05/02/CombatingTheSelectN1ProblemInNHibernate.aspx" rel="nofollow noreferrer">blog post</a> detailing how to combat the "n+1" problem in nHibernate. In essence, the problem is this:</p>
<p>Assume you have two tables, "BlogPosts" and "Comments" with a one-to... | [
{
"answer_id": 436346,
"author": "John Sheehan",
"author_id": 1786,
"author_profile": "https://Stackoverflow.com/users/1786",
"pm_score": 2,
"selected": false,
"text": "<p>Unless you create a query to select from Comment based on post IDs, I don't think there's a way to combat it. This w... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1574/"
] | Ayende has a [blog post](http://ayende.com/Blog/archive/2006/05/02/CombatingTheSelectN1ProblemInNHibernate.aspx) detailing how to combat the "n+1" problem in nHibernate. In essence, the problem is this:
Assume you have two tables, "BlogPosts" and "Comments" with a one-to-many relationship between them (i.e. each BlogP... | Unless you create a query to select from Comment based on post IDs, I don't think there's a way to combat it. This would get you down to two. One query to select the post IDs you want, then another to get all the comments for that list of post IDs. |
436,351 | <p>Given a number, how do I discover in what table and column it could be found within?</p>
<p>I don't care if it's fast, it just needs to work.</p>
| [
{
"answer_id": 436382,
"author": "Ta01",
"author_id": 7280,
"author_profile": "https://Stackoverflow.com/users/7280",
"pm_score": 9,
"selected": true,
"text": "<p><a href=\"http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm\" rel=\"noreferrer\">This might help you</a>. - from ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2443/"
] | Given a number, how do I discover in what table and column it could be found within?
I don't care if it's fast, it just needs to work. | [This might help you](http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm). - from Narayana Vyas. It searches all columns of all tables in a given database. I have used it before and it works.
This is the Stored Proc from the above link - the only change I made was substituting the temp table for a table var... |
436,362 | <p>Aside from writing an alias or script, is there a shorter command for getting the diff for a particular commit?</p>
<pre><code>git diff 15dc8^..15dc8
</code></pre>
<p>If you only give the single commit id <code>git diff 15dc8</code>, it diffs that commit against HEAD.</p>
| [
{
"answer_id": 436368,
"author": "mipadi",
"author_id": 28804,
"author_profile": "https://Stackoverflow.com/users/28804",
"pm_score": 10,
"selected": true,
"text": "<p>Use <code>git show $COMMIT</code>. It'll show you the log message for the commit, and the diff of that particular commit... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436362",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25848/"
] | Aside from writing an alias or script, is there a shorter command for getting the diff for a particular commit?
```
git diff 15dc8^..15dc8
```
If you only give the single commit id `git diff 15dc8`, it diffs that commit against HEAD. | Use `git show $COMMIT`. It'll show you the log message for the commit, and the diff of that particular commit. |
436,363 | <p>I was just participating in Stack Overflow question <em><a href="https://stackoverflow.com/questions/436211/is-everything-in-c-an-object">Is everything in .NET an object?</a></em>.</p>
<p>And one poster (in comments of accepted answer) seemed to think that performing a method call on a value type resulted in boxing... | [
{
"answer_id": 436407,
"author": "plinth",
"author_id": 20481,
"author_profile": "https://Stackoverflow.com/users/20481",
"pm_score": 5,
"selected": true,
"text": "<p>Here's the IL for your code:</p>\n\n<pre><code>L_0001: ldc.i4.5 // get a 5 on the stack\nL_0002: stloc.0 // st... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1143/"
] | I was just participating in Stack Overflow question *[Is everything in .NET an object?](https://stackoverflow.com/questions/436211/is-everything-in-c-an-object)*.
And one poster (in comments of accepted answer) seemed to think that performing a method call on a value type resulted in boxing. He pointed me to *[Boxing ... | Here's the IL for your code:
```
L_0001: ldc.i4.5 // get a 5 on the stack
L_0002: stloc.0 // store into x
L_0003: ldloca.s x // get the address of x on the stack
L_0005: call instance string [mscorlib]System.Int32::ToString() // ToString
L_000a: stloc.1 // store in s
```
So the answer in this ca... |
436,367 | <p>Does anyone know a good safe way to redirect the output of a printf-style function to a string? The obvious ways result in buffer overflows.</p>
<p>Something like:</p>
<pre><code>string s;
output.beginRedirect( s ); // redirect output to s
... output.print( "%s%d", foo, bar );
output.endRedirect();
</code></pre... | [
{
"answer_id": 436373,
"author": "Stefan",
"author_id": 48003,
"author_profile": "https://Stackoverflow.com/users/48003",
"pm_score": -1,
"selected": false,
"text": "<p>Microsoft introduce the '<a href=\"http://msdn.microsoft.com/en-us/library/239ffwa0(VS.80).aspx\" rel=\"nofollow norefe... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436367",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48956/"
] | Does anyone know a good safe way to redirect the output of a printf-style function to a string? The obvious ways result in buffer overflows.
Something like:
```
string s;
output.beginRedirect( s ); // redirect output to s
... output.print( "%s%d", foo, bar );
output.endRedirect();
```
I think the problem is the ... | [This StackOverflow question](https://stackoverflow.com/questions/69738/c-how-to-get-fprintf-results-as-a-stdstring-w-o-sprintf#69911) has a similar discussion. Also in that question I present my favorite solution, a "format" function that takes identical arguments to printf and returns a std::string. |
436,369 | <p>I want to compile a project differently, according to a constant defined by #define, like this:</p>
<pre><code>#define USE_COMPONENT_X
#if USE_COMPONENT_X
...
#endif
</code></pre>
<p>and I can do that in C#. But when I go to another file in the same project, this constant is not defined. Can I in some way define... | [
{
"answer_id": 436386,
"author": "Jason Diller",
"author_id": 2187,
"author_profile": "https://Stackoverflow.com/users/2187",
"pm_score": 6,
"selected": true,
"text": "<p>You can add the /define compiler switch. </p>\n\n<ol>\n<li>Open the project's Property Pages dialog box. </li>\n<li>... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21668/"
] | I want to compile a project differently, according to a constant defined by #define, like this:
```
#define USE_COMPONENT_X
#if USE_COMPONENT_X
...
#endif
```
and I can do that in C#. But when I go to another file in the same project, this constant is not defined. Can I in some way define a constant to all the pro... | You can add the /define compiler switch.
1. Open the project's Property Pages dialog box.
2. Click the Configuration Properties folder.
3. Click the Build property page.
4. Modify the Conditional Compilation Constants property. |
436,374 | <p>I have a page that is currently using the <a href="http://microformats.org/wiki/datetime-design-pattern" rel="nofollow noreferrer">datetime microformat</a> to display a timestamp, but I have only been showing the human-readable time for my own time zone:</p>
<pre><code><abbr class="published" title="2009-01-09T0... | [
{
"answer_id": 436562,
"author": "Tony",
"author_id": 34101,
"author_profile": "https://Stackoverflow.com/users/34101",
"pm_score": 4,
"selected": true,
"text": "<p>Here is code of mine that parses an ISO timestamp:</p>\n\n<pre><code>function isoDateStringToDate (datestr) {\n if (! this... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18511/"
] | I have a page that is currently using the [datetime microformat](http://microformats.org/wiki/datetime-design-pattern) to display a timestamp, but I have only been showing the human-readable time for my own time zone:
```
<abbr class="published" title="2009-01-09T09:16:00-05:00">
Friday, January 9, 2009 at 9:16 am (ES... | Here is code of mine that parses an ISO timestamp:
```
function isoDateStringToDate (datestr) {
if (! this.re) {
// The date in YYYY-MM-DD or YYYYMMDD format
var datere = "(\\d{4})-?(\\d{2})-?(\\d{2})";
// The time in HH:MM:SS[.uuuu] or HHMMSS[.uuuu] format
var timere = "(\\d{2}):?(\\d{2}):?(\\d{2}(?... |
436,375 | <p>Does anyone know what is the behavior for C#? Is it the same for all .NET languages?</p>
| [
{
"answer_id": 436402,
"author": "Ecton",
"author_id": 457,
"author_profile": "https://Stackoverflow.com/users/457",
"pm_score": 3,
"selected": false,
"text": "<p>Yes, it automatically calls the default constructor of the base class. A default constructor has no parameters.</p>\n\n<p>If ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22769/"
] | Does anyone know what is the behavior for C#? Is it the same for all .NET languages? | Yes - this happens with *any* constructor in the derived class if you don't explicitly call a base class constructor.
```
class Base
{
Base(){}
Base(int i){}
}
class Derived : Base
{
Derived(bool x) {} // calls Base.Base()
}
class Derived2 : Base
{
Derived2() : base(10) {} // calls Base.Base(int)
}
``` |
436,394 | <p>Lets say we have this string: <code>[18] email@email.com:pwd:</code></p>
<p><code>email@email.com</code> is the email and <code>pwd</code> is the password.</p>
<p>Also, lets say we have this variable with a value</p>
<pre><code>f = "[18] email@email.com:pwd:"
</code></pre>
<p>I would like to know if there is a w... | [
{
"answer_id": 436412,
"author": "Aaron Maenpaa",
"author_id": 2603,
"author_profile": "https://Stackoverflow.com/users/2603",
"pm_score": 3,
"selected": false,
"text": "<pre><code>>>> var1, var2, _ = \"[18] email@email.com:pwd:\"[5:].split(\":\")\n>>> var1, var2\n('ema... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436394",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Lets say we have this string: `[18] email@email.com:pwd:`
`email@email.com` is the email and `pwd` is the password.
Also, lets say we have this variable with a value
```
f = "[18] email@email.com:pwd:"
```
I would like to know if there is a way to make two other variables named `var1` and `var2`, where the `var1` ... | ```
>>> var1, var2, _ = "[18] email@email.com:pwd:"[5:].split(":")
>>> var1, var2
('email@email.com', 'pwd')
```
Or if the "[18]" is not a fixed prefix:
```
>>> var1, var2, _ = "[18] email@email.com:pwd:".split("] ")[1].split(":")
>>> var1, var2
('email@email.com', 'pwd')
``` |
436,411 | <p>When embedding JavaScript in an HTML document, where is the proper place to put the <code><script></code> tags and included JavaScript? I seem to recall that you are not supposed to place these in the <code><head></code> section, but placing at the beginning of the <code><body></code> section is ba... | [
{
"answer_id": 436422,
"author": "Andrew Hare",
"author_id": 34211,
"author_profile": "https://Stackoverflow.com/users/34211",
"pm_score": 5,
"selected": false,
"text": "<p>If you are using jQuery then put the JavaScript code wherever you find it best and use <code>$(document).ready()</c... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28804/"
] | When embedding JavaScript in an HTML document, where is the proper place to put the `<script>` tags and included JavaScript? I seem to recall that you are not supposed to place these in the `<head>` section, but placing at the beginning of the `<body>` section is bad, too, since the JavaScript will have to be parsed be... | Here's what happens when a browser loads a website with a `<script>` tag on it:
1. Fetch the HTML page (e.g. *index.html*)
2. Begin parsing the HTML
3. The parser encounters a `<script>` tag referencing an external script file.
4. The browser requests the script file. Meanwhile, the parser blocks and stops parsing the... |
436,413 | <p>I have a UIView with a navigation bar. How can I hide the navigation bar when the user puts the iPhone in landscape orientation, and have it show again on portrait view?</p>
| [
{
"answer_id": 436598,
"author": "August",
"author_id": 30966,
"author_profile": "https://Stackoverflow.com/users/30966",
"pm_score": 4,
"selected": true,
"text": "<p>This is very easy to find in the documentation. In the UINavigationController docs, to hide the nav bar, you use:</p>\n\n... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436413",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/53677/"
] | I have a UIView with a navigation bar. How can I hide the navigation bar when the user puts the iPhone in landscape orientation, and have it show again on portrait view? | This is very easy to find in the documentation. In the UINavigationController docs, to hide the nav bar, you use:
```
- (void)setNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated
```
If you want to do this when the device rotates, you'll want to do this in your the view controller method (mentioned in the UIV... |
436,418 | <p>Is it possible to embed Ruby into Erlang? Would Yecc be the correct tool for that? If it is possible how many man hours would it take, rough estimate?</p>
| [
{
"answer_id": 436727,
"author": "JesperE",
"author_id": 13051,
"author_profile": "https://Stackoverflow.com/users/13051",
"pm_score": 2,
"selected": false,
"text": "<p>You need to explain in a little more detail what you want to do. \"Embed\" is a rather vague word in this context.</p>\... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436418",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45160/"
] | Is it possible to embed Ruby into Erlang? Would Yecc be the correct tool for that? If it is possible how many man hours would it take, rough estimate? | There is something called Elixir by Jose Valim url <http://elixir-lang.org/> this lets you write code that is ruby like and run it on erlang VM.
So code looks similar in many places like:
```
iex> name = "world"
iex> "hello #{name}"
"hello world"
```
in many is more Erlang'y:
```
# function
iex> x = fn(a, b) -> a ... |
436,458 | <p>When I submit my basic form from the html file, it gives me the option to save the exe<br>
I just want the exe to run instead. (To re-populate the template html file)<br>
What do I need to do to just run the exe once the form is submitted? </p>
<pre><code><form action="Lib.exe" method=POST ID="Form1">
Enter ... | [
{
"answer_id": 436475,
"author": "Otávio Décio",
"author_id": 48684,
"author_profile": "https://Stackoverflow.com/users/48684",
"pm_score": 2,
"selected": false,
"text": "<p>This is a kind of \"distributed transaction\" system. You probably want to write a consolidation routine and run i... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436458",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/52256/"
] | When I submit my basic form from the html file, it gives me the option to save the exe
I just want the exe to run instead. (To re-populate the template html file)
What do I need to do to just run the exe once the form is submitted?
```
<form action="Lib.exe" method=POST ID="Form1">
Enter Index to DELETE<br>
<in... | Store the files in the database. Then you can have referential integrity without adding complexity (MSMQ etc) to your application. Yes, this will increase the size of your db. But the files are already on your server, so it's just the same bits in a different place. |
436,474 | <p>Following this example, I can list all elements into a pdf file</p>
<pre><code>import pyPdf
pdf = pyPdf.PdfFileReader(open("pdffile.pdf"))
list(pdf.pages) # Process all the objects.
print pdf.resolvedObjects
</code></pre>
<p>now, I need to extract a non-standard object from the pdf file. </p>
<p>My object is the ... | [
{
"answer_id": 441747,
"author": "Jehiah",
"author_id": 51022,
"author_profile": "https://Stackoverflow.com/users/51022",
"pm_score": 4,
"selected": true,
"text": "<p>each element in <code>pdf.pages</code> is a dictionary, so assuming it's on page 1, <code>pdf.pages[0]['/MYOBJECT']</code... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39339/"
] | Following this example, I can list all elements into a pdf file
```
import pyPdf
pdf = pyPdf.PdfFileReader(open("pdffile.pdf"))
list(pdf.pages) # Process all the objects.
print pdf.resolvedObjects
```
now, I need to extract a non-standard object from the pdf file.
My object is the one named MYOBJECT and it is a st... | each element in `pdf.pages` is a dictionary, so assuming it's on page 1, `pdf.pages[0]['/MYOBJECT']` should be the element you want.
You can try to print that individually or poke at it with `help` and `dir` in a python prompt for more about how to get the string you want
Edit:
after receiving a copy of the pdf, i ... |
436,488 | <p>I am having a problem with custom components in facelets. The first time that the page is rendered, the attributes are set properly on the component class. When a form is submitted however, the attributes are not set.</p>
<p>Here is the class that I am using to test this.</p>
<pre><code>public class TestEcho ext... | [
{
"answer_id": 441747,
"author": "Jehiah",
"author_id": 51022,
"author_profile": "https://Stackoverflow.com/users/51022",
"pm_score": 4,
"selected": true,
"text": "<p>each element in <code>pdf.pages</code> is a dictionary, so assuming it's on page 1, <code>pdf.pages[0]['/MYOBJECT']</code... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436488",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1322/"
] | I am having a problem with custom components in facelets. The first time that the page is rendered, the attributes are set properly on the component class. When a form is submitted however, the attributes are not set.
Here is the class that I am using to test this.
```
public class TestEcho extends UIData
{
/** L... | each element in `pdf.pages` is a dictionary, so assuming it's on page 1, `pdf.pages[0]['/MYOBJECT']` should be the element you want.
You can try to print that individually or poke at it with `help` and `dir` in a python prompt for more about how to get the string you want
Edit:
after receiving a copy of the pdf, i ... |
436,497 | <p>In a module residing inside a package, i have the need to use a function defined within the <code>__init__.py</code> of that package. how can i import the package within the module that resides within the package, so i can use that function?</p>
<p>Importing <code>__init__</code> inside the module will not import t... | [
{
"answer_id": 436511,
"author": "mipadi",
"author_id": 28804,
"author_profile": "https://Stackoverflow.com/users/28804",
"pm_score": 5,
"selected": false,
"text": "<p>This doesn't exactly answer your question, but I'm going to suggest that you move the function outside of the <code>__in... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436497",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | In a module residing inside a package, i have the need to use a function defined within the `__init__.py` of that package. how can i import the package within the module that resides within the package, so i can use that function?
Importing `__init__` inside the module will not import the package, but instead a module... | Also, starting in Python 2.5, relative imports are possible. e.g.:
```
from . import foo
```
Quoting from <http://docs.python.org/tutorial/modules.html#intra-package-references>:
---
Starting with Python 2.5, in addition to the implicit relative imports described above, you can write explicit relative imports with... |
436,513 | <p>The code below compiles, but has different behavior for the char type than for the int types.</p>
<p>In particular</p>
<pre><code> cout << getIsTrue< isX<int8>::ikIsX >() << endl;
cout << getIsTrue< isX<uint8>::ikIsX >() << endl;
cout << getIsTrue<... | [
{
"answer_id": 436538,
"author": "Evan Teran",
"author_id": 13430,
"author_profile": "https://Stackoverflow.com/users/13430",
"pm_score": 4,
"selected": false,
"text": "<p>that's correct, <code>char</code>, <code>unsigned char</code> and <code>signed char</code> are separate types. It pr... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436513",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48956/"
] | The code below compiles, but has different behavior for the char type than for the int types.
In particular
```
cout << getIsTrue< isX<int8>::ikIsX >() << endl;
cout << getIsTrue< isX<uint8>::ikIsX >() << endl;
cout << getIsTrue< isX<char>::ikIsX >() << endl;
```
result in 3 instantiations of templates ... | Here is your answer from the standard:
>
> 3.9.1 Fundamental types [basic.fundamental]
>
>
> Objects declared as characters (`char`) shall be large enough to store any member of the implementation's basic character set. If a character from this set is stored in a character object, the integral value of that charact... |
436,520 | <p>In a WinApp I am simply trying to get the absolute path from a Uri object:</p>
<pre><code>Uri myUri = new Uri(myPath); //myPath is a string
//somewhere else in the code
string path = myUri.AbsolutePath;
</code></pre>
<p>This works fine if no spaces in my original path. If spaces are in there the string gets mangle... | [
{
"answer_id": 436537,
"author": "Steven Robbins",
"author_id": 26507,
"author_profile": "https://Stackoverflow.com/users/26507",
"pm_score": 5,
"selected": true,
"text": "<p>It's encoding it as it should, you could probably UrlDecode it to get it back with spaces, but it's not \"mangled... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1311500/"
] | In a WinApp I am simply trying to get the absolute path from a Uri object:
```
Uri myUri = new Uri(myPath); //myPath is a string
//somewhere else in the code
string path = myUri.AbsolutePath;
```
This works fine if no spaces in my original path. If spaces are in there the string gets mangled; for example 'Documents ... | It's encoding it as it should, you could probably UrlDecode it to get it back with spaces, but it's not "mangled" it's just correctly encoded.
I'm not sure what you're writing, but to convert it back in asp.net it's Server.UrlDecode(path). You also might be able to use LocalPath, rather than AbsolutePath, if it's a Wi... |
436,522 | <p>We utilise a third party web service that returns XML which looks something like (cut down for brevity):</p>
<pre><code><Response>
<block name="availability">
<block name="cqual">
<a name="result-code" format="text">L</a>
</block>
<block name="exchange">... | [
{
"answer_id": 436575,
"author": "configurator",
"author_id": 9536,
"author_profile": "https://Stackoverflow.com/users/9536",
"pm_score": 0,
"selected": false,
"text": "<p>It seems so, but why do you need all of the <code>ToList()</code> calls? I see three of these calls and I don't thin... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/419/"
] | We utilise a third party web service that returns XML which looks something like (cut down for brevity):
```
<Response>
<block name="availability">
<block name="cqual">
<a name="result-code" format="text">L</a>
</block>
<block name="exchange">
<a name="code" format="text">MRDEN</a>
</bloc... | **The definition of `realm` as provided is the equivalent of the simpler**:
```
string realm = (string) products.XPathEvaluate(
"string(
/*/blocks[@name='products']
/*/a[@name='product-id' and . = '1236']
/following-sibling::block[1]
)
"
... |
436,524 | <p>A certain form in our application displays a graphical view of a model. The user can, amongst loads of other stuff, initiate a transformation of the model that can take quite some time. This transformation sometimes proceeds without any user interaction, at other times frequent user input is necessary. While it last... | [
{
"answer_id": 436533,
"author": "duffymo",
"author_id": 37213,
"author_profile": "https://Stackoverflow.com/users/37213",
"pm_score": 1,
"selected": false,
"text": "<p>Process asynchronously by sending a message to a queue and have the listener do the processing. The controller sends a... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1431618/"
] | A certain form in our application displays a graphical view of a model. The user can, amongst loads of other stuff, initiate a transformation of the model that can take quite some time. This transformation sometimes proceeds without any user interaction, at other times frequent user input is necessary. While it lasts t... | I think as long as your long-running transformations require user interaction, you're not going to be truly happy with any answer you get. So let's back up for a moment: Why do you need to interrupt the transformation with requests for more information? Are these really questions you couldn't have anticipated before st... |
436,563 | <p>In a client-side web application, I would like to:</p>
<ol>
<li>open an Excel spreadsheet,</li>
<li>export some application data to Excel,</li>
<li>allow the user to work with it, and</li>
<li>when they are done, read the (potentially changed) data back into my application.</li>
</ol>
<p>I would like the user to h... | [
{
"answer_id": 438264,
"author": "Anton",
"author_id": 20526,
"author_profile": "https://Stackoverflow.com/users/20526",
"pm_score": -1,
"selected": false,
"text": "<p>I don't believe this is possible. The reason being, when you call the following code:</p>\n\n<pre><code>var excel = new ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436563",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/53564/"
] | In a client-side web application, I would like to:
1. open an Excel spreadsheet,
2. export some application data to Excel,
3. allow the user to work with it, and
4. when they are done, read the (potentially changed) data back into my application.
I would like the user to have a fluid experience and detect when they a... | After doing some research, I have discovered that I cannot hook up events to dynamic ActiveX objects (i.e., the ones that are created by the `new ActiveXObject` constructor) in javascript.
One idea is that I create a wrapper Windows Form user control that would be hosted inside of an `<object>` tag in the web app. Th... |
436,576 | <p>I'm trying to run <code>rake test:units</code> and I keep getting this:</p>
<pre><code>Mysql::Error: Duplicate entry '2147483647' for key 1: INSERT INTO `ts_schema_migrations` (version) VALUES ('20081008010000')
</code></pre>
<p>The "<code>ts_</code>" is there because I have <code>ActiveRecord::Base.table_name_pre... | [
{
"answer_id": 438264,
"author": "Anton",
"author_id": 20526,
"author_profile": "https://Stackoverflow.com/users/20526",
"pm_score": -1,
"selected": false,
"text": "<p>I don't believe this is possible. The reason being, when you call the following code:</p>\n\n<pre><code>var excel = new ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436576",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1190/"
] | I'm trying to run `rake test:units` and I keep getting this:
```
Mysql::Error: Duplicate entry '2147483647' for key 1: INSERT INTO `ts_schema_migrations` (version) VALUES ('20081008010000')
```
The "`ts_`" is there because I have `ActiveRecord::Base.table_name_prefix` set. I'm confused because there is no value '200... | After doing some research, I have discovered that I cannot hook up events to dynamic ActiveX objects (i.e., the ones that are created by the `new ActiveXObject` constructor) in javascript.
One idea is that I create a wrapper Windows Form user control that would be hosted inside of an `<object>` tag in the web app. Th... |
436,577 | <p>I'm using jquery in a greasemonkey user script. I'm trying to add a bunch of options to a select based on an array and also stick the corresponding object in the element with jquery.data like this:</p>
<pre><code>$.each(some_array, function(item){
// These next 2 statements seem awkward to me and I was also hopin... | [
{
"answer_id": 437152,
"author": "jcampbell1",
"author_id": 20512,
"author_profile": "https://Stackoverflow.com/users/20512",
"pm_score": 1,
"selected": false,
"text": "<p>theObj should be undefined unless the last option of the first select box on the page is selected, because the data ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436577",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3636/"
] | I'm using jquery in a greasemonkey user script. I'm trying to add a bunch of options to a select based on an array and also stick the corresponding object in the element with jquery.data like this:
```
$.each(some_array, function(item){
// These next 2 statements seem awkward to me and I was also hoping
// a jque... | I found that all I needed to get it to work was this:
```
$.each(some_array, function(item){
$('select').append('<option>dummy</option>');
$('select option:last-child').each(function(index, elem){
$(elem.wrappedJSObject).data('obj', item);
});
});
$('select').change(function(){
var theObj = $('option:selecte... |
436,580 | <p>Anyone know what's wrong with this? I have some Classic ASP code that checks for the value of a checkbox, like so:</p>
<pre><code><!-- HTML page: page1.asp --->
<input id="useBilling" name="useBilling" value="Y" type="checkbox" />
</code></pre>
<p>And in my code page (let's call it page2.asp):</p>
<p... | [
{
"answer_id": 437054,
"author": "John Rose",
"author_id": 46947,
"author_profile": "https://Stackoverflow.com/users/46947",
"pm_score": 3,
"selected": true,
"text": "<blockquote>\n <p>Been wracking my brain trying to\n figure out why the hell this isn't\n working, because everything ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436580",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40667/"
] | Anyone know what's wrong with this? I have some Classic ASP code that checks for the value of a checkbox, like so:
```
<!-- HTML page: page1.asp --->
<input id="useBilling" name="useBilling" value="Y" type="checkbox" />
```
And in my code page (let's call it page2.asp):
```
' code
useBilling = Request.Form("useBil... | >
> Been wracking my brain trying to
> figure out why the hell this isn't
> working, because everything seems to
> be right, just Request.Form sometimes
> picks up the value and sometimes
> doesn't, even when it's checked.
>
>
>
Not a direct answer, but just to be totally clear: Request.Form("useBilling") wil... |
436,587 | <p>In previous versions of <code>jQuery tabs</code> there was an option to automatically set the height of the tab to that of the tallest tab in the group using: </p>
<pre><code>$('#container').tabs({ fxAutoHeight: true });
</code></pre>
<p>However this does not seem to work in <code>jQuery UI 1.5.3</code>.</p>
<p>H... | [
{
"answer_id": 436809,
"author": "gabriel",
"author_id": 5447,
"author_profile": "https://Stackoverflow.com/users/5447",
"pm_score": 3,
"selected": false,
"text": "<p>After reading over <a href=\"http://docs.jquery.com/UI/Tabs/tabs#options\" rel=\"nofollow noreferrer\">the documentation<... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436587",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/52130/"
] | In previous versions of `jQuery tabs` there was an option to automatically set the height of the tab to that of the tallest tab in the group using:
```
$('#container').tabs({ fxAutoHeight: true });
```
However this does not seem to work in `jQuery UI 1.5.3`.
Has this option been removed? If so is there another way... | It looks like it's no longer there, check out this plugin for the same functionality
[Equal Heights Plugin](http://www.cssnewbie.com/equalheights-jquery-plugin/) |
436,590 | <p>In JSF, is it possible to solve the following validation / updating scenario using the validation framework of JSF (aka validators, immediate, required, etc.)?</p>
<pre><code>+-- Form ----------------------------------------------------+
| |
| Field A: |___... | [
{
"answer_id": 438641,
"author": "McDowell",
"author_id": 304,
"author_profile": "https://Stackoverflow.com/users/304",
"pm_score": 2,
"selected": true,
"text": "<p>Technically, yes, it is possible to do this with validators/immediate. However, it wouldn't be particularly simple.</p>\n\n... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436590",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39057/"
] | In JSF, is it possible to solve the following validation / updating scenario using the validation framework of JSF (aka validators, immediate, required, etc.)?
```
+-- Form ----------------------------------------------------+
| |
| Field A: |____________|v| ... | Technically, yes, it is possible to do this with validators/immediate. However, it wouldn't be particularly simple.
If you add validators, the logic in *[Update C using A and B]* will only run if all validators pass or if its immediate attribute has been set to true. If its immediate attribute has been set to true, th... |
436,592 | <p>I wonder if is possible in obj-c to acces the parent instance from a property, like:</p>
<pre><code>@interface AObject : NSObject {
}
-(void) sample{
NSLog("%@", [[self parentInstance] Id]);
}
@interface DbObject : NSObject {
NSInteger Id;
AObject* ob;
}
</code></pre>
| [
{
"answer_id": 436854,
"author": "Marc Charbonneau",
"author_id": 35136,
"author_profile": "https://Stackoverflow.com/users/35136",
"pm_score": 0,
"selected": false,
"text": "<p>I'm not entirely sure what you're asking. Are you looking for the <code>super</code> keyword?</p>\n"
},
{
... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436592",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/53185/"
] | I wonder if is possible in obj-c to acces the parent instance from a property, like:
```
@interface AObject : NSObject {
}
-(void) sample{
NSLog("%@", [[self parentInstance] Id]);
}
@interface DbObject : NSObject {
NSInteger Id;
AObject* ob;
}
``` | You would have to make `AObject` aware of `DbObject`, but also you should access the properties of `DbObject` using selectors.
```
@interface AObject : NSObject
{
id father;
}
- (id) initWithFather:(id) theFather;
- (void) sample;
@end
@implementation AObject
- (id) initWithFather:(id) theFather
{
father = th... |
436,599 | <p>Lets Say we have <code>Zaptoit:685158:zaptoit@hotmail.com</code> </p>
<p>How do you split so it only be left <code>685158:zaptoit@hotmail.com</code></p>
| [
{
"answer_id": 436613,
"author": "Federico A. Ramponi",
"author_id": 18770,
"author_profile": "https://Stackoverflow.com/users/18770",
"pm_score": 3,
"selected": false,
"text": "<p>Another solution:</p>\n\n<pre><code>s = 'Zaptoit:685158:zaptoit@hotmail.com'\ns.split(':', 1)[1]\n</code></... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Lets Say we have `Zaptoit:685158:zaptoit@hotmail.com`
How do you split so it only be left `685158:zaptoit@hotmail.com` | ```
>>> s = 'Zaptoit:685158:zaptoit@hotmail.com'
>>> s.split( ':', 1 )[1]
'685158:zaptoit@hotmail.com'
``` |
436,608 | <p>I'm trying to use the jQuery alerts dialog library from <a href="http://abeautifulsite.net/notebook/87" rel="noreferrer">http://abeautifulsite.net/notebook/87</a> instead of the default alerts (which look pretty awful in my opinion). This seems to be a great library, but there is not an example of how to use the jCo... | [
{
"answer_id": 436638,
"author": "Diodeus - James MacFarlane",
"author_id": 12579,
"author_profile": "https://Stackoverflow.com/users/12579",
"pm_score": 0,
"selected": false,
"text": "<p>I would assume you'd have to grab the response like this. I don't think you need a callback.</p>\n\n... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436608",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54288/"
] | I'm trying to use the jQuery alerts dialog library from <http://abeautifulsite.net/notebook/87> instead of the default alerts (which look pretty awful in my opinion). This seems to be a great library, but there is not an example of how to use the jConfirm library.
I need to do something like this:
```
function confir... | ```
jConfirm('are you sure?', 'Confirmation Dialog',
function(r) {
result = r;
response = true;
return r;
}
);
if (response == true) {
```
This betrays a misunderstanding of the sequence of events that occurs using asynchronous code. Just because you've written it inline doesn't mean i... |
436,622 | <p>In my classes I often write a quick <code>operator!=</code> by returning <code>!(*this == rhs)</code>, e.g.:</p>
<pre><code>class Foo
{
private:
int n_;
std::string str_;
public:
...
bool operator==(const Foo& rhs) const
{
return n_ == rhs.n_ && str_ == rhs.str_;
}
b... | [
{
"answer_id": 436640,
"author": "Mark Ingram",
"author_id": 986,
"author_profile": "https://Stackoverflow.com/users/986",
"pm_score": 0,
"selected": false,
"text": "<p>No, that's absolutely fine - I do exactly the same.</p>\n"
},
{
"answer_id": 436644,
"author": "bdukes",
... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9236/"
] | In my classes I often write a quick `operator!=` by returning `!(*this == rhs)`, e.g.:
```
class Foo
{
private:
int n_;
std::string str_;
public:
...
bool operator==(const Foo& rhs) const
{
return n_ == rhs.n_ && str_ == rhs.str_;
}
bool operator!=(const Foo& rhs) const
{
... | I believe that's the preferred method of implementing `operator!=` so that you don't repeat yourself, and you have a guaranteed correct relationship with `operator==`. |
436,627 | <p>I'm trying to use a Thread in a simple winform. I have a ListBox which I want to fill with numbers at the form's load method. I don't want to wait until it is filled. I'm using something like this:</p>
<pre><code>void fillList()
{
Invoke(new MethodInvoker(
delegate
... | [
{
"answer_id": 436642,
"author": "Ed Guiness",
"author_id": 4200,
"author_profile": "https://Stackoverflow.com/users/4200",
"pm_score": 3,
"selected": true,
"text": "<pre><code> Thread tr = new Thread(fillList); \n</code></pre>\n"
},
{
"answer_id": 436668,
"author": "Rob Pro... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436627",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54295/"
] | I'm trying to use a Thread in a simple winform. I have a ListBox which I want to fill with numbers at the form's load method. I don't want to wait until it is filled. I'm using something like this:
```
void fillList()
{
Invoke(new MethodInvoker(
delegate
{
... | ```
Thread tr = new Thread(fillList);
``` |
436,629 | <p>I have a small problem with a script.<br>
I want to have a default action on <code>:hover</code> for clients with Javascript disabled, but for those with Javascript enabled I want another action (actually... same action, but I want to add a small transition effect).</p>
<p>So... How can I do this? I am using jQuery... | [
{
"answer_id": 436653,
"author": "benlumley",
"author_id": 39161,
"author_profile": "https://Stackoverflow.com/users/39161",
"pm_score": 6,
"selected": true,
"text": "<p>Apply two classes to the relvant element. one contains the hover behaviour, and one contains all the other styling.</p... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436629",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23810/"
] | I have a small problem with a script.
I want to have a default action on `:hover` for clients with Javascript disabled, but for those with Javascript enabled I want another action (actually... same action, but I want to add a small transition effect).
So... How can I do this? I am using jQuery. | Apply two classes to the relvant element. one contains the hover behaviour, and one contains all the other styling.
You can then use the jquery
```
$(element).removeClass('hover');
```
method to remove the class with the hover behaviour and then apply whatever you want using
```
$(element).bind('mouseover', func... |
436,661 | <p>I have a problem with my website and how it appears in some browsers:</p>
<blockquote>
<p><a href="http://www.karentiede.com" rel="nofollow noreferrer">http://www.karentiede.com</a></p>
</blockquote>
<p>In Firefox 2.0 and many other browsers, the "content" column overflows to the left and appears on top of the d... | [
{
"answer_id": 436782,
"author": "savageguy",
"author_id": 52555,
"author_profile": "https://Stackoverflow.com/users/52555",
"pm_score": 2,
"selected": false,
"text": "<p>I took a look at the page and the problem only appears when you re-size the page.</p>\n\n<p>The problem is your right... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have a problem with my website and how it appears in some browsers:
>
> <http://www.karentiede.com>
>
>
>
In Firefox 2.0 and many other browsers, the "content" column overflows to the left and appears on top of the decorative border, making some of the content unreadable.
One Q&A in here suggested that making... | I took a look at the page and the problem only appears when you re-size the page.
The problem is your right div is 80% so when the screen becomes smaller and ratios change and that 80% then overlaps into your left background.
Take a look at <http://www.dynamicdrive.com/style/layouts/item/css-liquid-layout-21-fixed-fl... |
436,666 | <p>Dan Webb's <a href="http://www.danwebb.net/2006/9/3/low-pro-unobtrusive-scripting-for-prototype" rel="nofollow noreferrer">Low Pro</a> UJS extension to Prototype offers the following elegant DOM Builder:</p>
<pre><code>var listItem = $li({ id : 'item-1' },
$strong("Some text")
);
/... | [
{
"answer_id": 436740,
"author": "Diodeus - James MacFarlane",
"author_id": 12579,
"author_profile": "https://Stackoverflow.com/users/12579",
"pm_score": 0,
"selected": false,
"text": "<p>Since v1.6, <a href=\"http://www.prototypejs.org/api/element\" rel=\"nofollow noreferrer\">Prototype... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436666",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/53166/"
] | Dan Webb's [Low Pro](http://www.danwebb.net/2006/9/3/low-pro-unobtrusive-scripting-for-prototype) UJS extension to Prototype offers the following elegant DOM Builder:
```
var listItem = $li({ id : 'item-1' },
$strong("Some text")
);
// returns a node equivalent to: <li id="item-1"><st... | I would imagine the "Object doesn't support this property or method" error is coming from a call to one of Prototype's extended element methods (which are not applied automatically in IE). However, all the elements you're dealing with are coming from LowPro or the $() function, which *should* extend the elements for yo... |
436,670 | <p>I'm working on a offline version of a website using jQuery and some xml files. I'm running in to a problem in jQuery when I do a $.ajax call on a xml file jQuery throws a error.</p>
<p>When I look at the error I can tell its loading the XML file because its in the error's responceText property. It seams to work jus... | [
{
"answer_id": 436729,
"author": "ohnoes",
"author_id": 53330,
"author_profile": "https://Stackoverflow.com/users/53330",
"pm_score": 0,
"selected": false,
"text": "<p>Just a thought: I remember some GET requests failures with IE. Have you tried POSTing it?</p>\n"
},
{
"answer_id... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20183/"
] | I'm working on a offline version of a website using jQuery and some xml files. I'm running in to a problem in jQuery when I do a $.ajax call on a xml file jQuery throws a error.
When I look at the error I can tell its loading the XML file because its in the error's responceText property. It seams to work just fine in ... | From the [link](http://docs.jquery.com/Specifying_the_Data_Type_for_AJAX_Requests) that the OP posted with the answer:
>
> When loading XML files locally, e.g. a
> CD-ROM etc., the data received by
> Internet Explorer is plain-text, not
> text/xml. In this case, use the
> dataType parameter to load the xml
> fil... |
436,702 | <p>Since IE6 does not support the child selector (see <a href="http://kimblim.dk/csstest/#ex1" rel="noreferrer">http://kimblim.dk/csstest/#ex1</a>), what is the alternative when dealing with this browser?</p>
<p>I do not want to modify the markup, and I'd much much prefer a CSS-only solution...</p>
<p>And yes, it is ... | [
{
"answer_id": 436711,
"author": "Nick Berardi",
"author_id": 17,
"author_profile": "https://Stackoverflow.com/users/17",
"pm_score": 2,
"selected": false,
"text": "<p>You can use jQuery, not a pretty solution, but it is one option that I have used in the past:</p>\n\n<pre><code>$(\"pare... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1943/"
] | Since IE6 does not support the child selector (see <http://kimblim.dk/csstest/#ex1>), what is the alternative when dealing with this browser?
I do not want to modify the markup, and I'd much much prefer a CSS-only solution...
And yes, it is the direct child that I wish to target.
Thanks! | I've come across something of a hack: <http://meyerweb.com/eric/thoughts/2005/05/31/universal-child-replacement/>
Using the '[star html](http://www.positioniseverything.net/articles/poll/star-html.php "star html")' hack for IE (6 and below) in combination with this allows me to select the direct child. Let's say we wan... |
436,710 | <p>I have the following javascript:</p>
<pre><code> css = document.createElement('style');
css.setAttribute('type', 'text/css');
css_data = document.createTextNode('');
css.appendChild(css_data);
document.getElementsByTagName("head")[0].appendChild(css);
</code></pre>
<p>for some reason, in IE only, it choke... | [
{
"answer_id": 436750,
"author": "Crescent Fresh",
"author_id": 45433,
"author_profile": "https://Stackoverflow.com/users/45433",
"pm_score": 5,
"selected": true,
"text": "<p>Try instead:</p>\n\n<pre><code>var css = document.createElement('style');\ncss.setAttribute('type', 'text/css');\... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436710",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194/"
] | I have the following javascript:
```
css = document.createElement('style');
css.setAttribute('type', 'text/css');
css_data = document.createTextNode('');
css.appendChild(css_data);
document.getElementsByTagName("head")[0].appendChild(css);
```
for some reason, in IE only, it chokes on "css.appendChild(css\... | Try instead:
```
var css = document.createElement('style');
css.setAttribute('type', 'text/css');
var cssText = '';
if(css.styleSheet) { // IE does it this way
css.styleSheet.cssText = cssText
} else { // everyone else does it this way
css.appendChild(document.createTextNode(cssText));
}
document.getElements... |
436,715 | <p>I have been getting a number of attacks on my website lately, with a User-Agent of NV32ts.</p>
<p>They all are some variation of the following injection attacks against a querystring variable (where 99999 represents a valid querystring value, the attack is appended to the value):</p>
<p>(For convenience I have url... | [
{
"answer_id": 436771,
"author": "Joel Coehoorn",
"author_id": 3043,
"author_profile": "https://Stackoverflow.com/users/3043",
"pm_score": 4,
"selected": true,
"text": "<p>I read this one two ways, but I'm not 100% sure which:</p>\n\n<ol>\n<li>At this point they're just fishing. The scr... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436715",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24954/"
] | I have been getting a number of attacks on my website lately, with a User-Agent of NV32ts.
They all are some variation of the following injection attacks against a querystring variable (where 99999 represents a valid querystring value, the attack is appended to the value):
(For convenience I have urldecoded the follo... | I read this one two ways, but I'm not 100% sure which:
1. At this point they're just fishing. The script is looking for web sites that have both open injection vulnerabilities and access to the sysobjects table in sql server. That table will provide a list of all tables and columns (and their types) in the database. I... |
436,716 | <p>I want to do this:</p>
<pre><code>MethodInfo m = myList.GetType().GetMethod("ConvertAll", System.Reflection.BindingFlags.InvokeMethod).MakeGenericMethod(typeof(object));
List<object> myConvertedList = (List<object>)m.Invoke(myList, new object[]{ (t => (object)t)});
</code></pre>
<p>myList is a gener... | [
{
"answer_id": 436734,
"author": "Konrad Rudolph",
"author_id": 1968,
"author_profile": "https://Stackoverflow.com/users/1968",
"pm_score": 2,
"selected": false,
"text": "<p>A lambda forms a method <em>group</em> (basically this is a method identified by name (and scope) only. Since meth... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1782/"
] | I want to do this:
```
MethodInfo m = myList.GetType().GetMethod("ConvertAll", System.Reflection.BindingFlags.InvokeMethod).MakeGenericMethod(typeof(object));
List<object> myConvertedList = (List<object>)m.Invoke(myList, new object[]{ (t => (object)t)});
```
myList is a generic list of a specific type (unknown to th... | A lambda expression is convertible to either a delegate type or an expression tree with the right signature - but you need to specify which delegate type it is.
I think your code would be *much* simpler if you made this a generic method:
```
public static List<object> ConvertToListOfObjects<T>(List<T> list)
{
ret... |
436,731 | <p>I'm looking to develop an app which features worksheets subclassed from DataGridView. Users can paste (or import) CSV-like data into the worksheet and it will be reflected in a data structure in memory - my first guess would be a 2D array of floats. </p>
<p>DataGridView can be bound to objects with a certain set of... | [
{
"answer_id": 436775,
"author": "BFree",
"author_id": 15861,
"author_profile": "https://Stackoverflow.com/users/15861",
"pm_score": 2,
"selected": false,
"text": "<p>Think of it this way. An IList can be a collection of objects. Each object can then have multiple properties within them.... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/199/"
] | I'm looking to develop an app which features worksheets subclassed from DataGridView. Users can paste (or import) CSV-like data into the worksheet and it will be reflected in a data structure in memory - my first guess would be a 2D array of floats.
DataGridView can be bound to objects with a certain set of interface... | Think of it this way. An IList can be a collection of objects. Each object can then have multiple properties within them. So essentially, that's like a 2D array. The first dimension is the object, and all of it's properties, and the second dimension, is a collection of said objects. Something like this:
```
list[0] --... |
436,742 | <p>Given a class "Bar" that extends class "Foo" which implements interface "DeeDum"</p>
<pre><code>public interface DeeDum {
public String getDee();
public String getDum();
}
public class Foo implements DeeDum {
public String dee = "D";
public String dum;
public String getDee() { return dee; }
... | [
{
"answer_id": 436754,
"author": "Michael Myers",
"author_id": 13531,
"author_profile": "https://Stackoverflow.com/users/13531",
"pm_score": 2,
"selected": false,
"text": "<p>Accessor methods themselves (e.g. <code>getDee()</code>) are inherited, but instance variables are not.</p>\n\n<p... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436742",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54311/"
] | Given a class "Bar" that extends class "Foo" which implements interface "DeeDum"
```
public interface DeeDum {
public String getDee();
public String getDum();
}
public class Foo implements DeeDum {
public String dee = "D";
public String dum;
public String getDee() { return dee; }
public Strin... | The problem is that your duplicate declaration of the members `dee` and `dum` of `Foo` in `Bar` hides those of `Foo`. `Bar` has its **own** members; those of `Foo` will never be used by `Bar`. What you mean is something like
```
public class Bar extends Foo {
{
dee = "DEE";
dum = "DUM";
}
}
``` |
436,759 | <p><strong>UPDATE So totally pulled a tool moment. I really meant by reference versus Out/Ref. Anything that says 'ref' I really meant by reference as in</strong> </p>
<p>SomeMethod(Object someObject)</p>
<p><strong>Versus</strong></p>
<p>SomeMethod(out someObject)</p>
<p><strong>Sorry. Just don't want to chang... | [
{
"answer_id": 436769,
"author": "leppie",
"author_id": 15541,
"author_profile": "https://Stackoverflow.com/users/15541",
"pm_score": 2,
"selected": false,
"text": "<p>ref and out is exactly the same, as far I know, with the exception that an out parameter cannot be initialized. Hence bo... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21691/"
] | **UPDATE So totally pulled a tool moment. I really meant by reference versus Out/Ref. Anything that says 'ref' I really meant by reference as in**
SomeMethod(Object someObject)
**Versus**
SomeMethod(out someObject)
**Sorry. Just don't want to change the code so the answers already make sense.**
Far as I understan... | Just because the variable lives on the stack (if it's a local variable) doesn't mean you can't create a pointer to it - and indeed that's the case with reference types as well.
The pointer within RefMethod is to the "outer" variable - and the variable itself lives on the stack as it's an uncaptured local variable.
As... |
436,760 | <p>I have a customer that has a SQL database on a hosted server; call the db "myDatabase".<br>
<br />The hosting co. has locked down object explorer - I can't see myDatabase in the database listed (I see tempdb and master). However, if I "use myDatabase" and then "select * from myTable", all works fine.</p>
<p>Since ... | [
{
"answer_id": 436769,
"author": "leppie",
"author_id": 15541,
"author_profile": "https://Stackoverflow.com/users/15541",
"pm_score": 2,
"selected": false,
"text": "<p>ref and out is exactly the same, as far I know, with the exception that an out parameter cannot be initialized. Hence bo... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436760",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3331/"
] | I have a customer that has a SQL database on a hosted server; call the db "myDatabase".
Since we have no access to object explorer, I can't right click and generate scripts. I thought that I might be able to use SMO to accomplish what I want, but when I attempt something similar to this:
```
Server myServer = new S... | Just because the variable lives on the stack (if it's a local variable) doesn't mean you can't create a pointer to it - and indeed that's the case with reference types as well.
The pointer within RefMethod is to the "outer" variable - and the variable itself lives on the stack as it's an uncaptured local variable.
As... |
436,776 | <p>This is the code I am using to call a function <code>calc</code> in javascript:</p>
<pre><code>import flash.external.ExternalInterface;
ExternalInterface.addCallback("asFunc", this, asFunc);
function asFunc(str:String):Void {
out.text = "JS > Hello " + str;
}
send_btn.addEventListener(MouseEvent.CLICK, c... | [
{
"answer_id": 436769,
"author": "leppie",
"author_id": 15541,
"author_profile": "https://Stackoverflow.com/users/15541",
"pm_score": 2,
"selected": false,
"text": "<p>ref and out is exactly the same, as far I know, with the exception that an out parameter cannot be initialized. Hence bo... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16458/"
] | This is the code I am using to call a function `calc` in javascript:
```
import flash.external.ExternalInterface;
ExternalInterface.addCallback("asFunc", this, asFunc);
function asFunc(str:String):Void {
out.text = "JS > Hello " + str;
}
send_btn.addEventListener(MouseEvent.CLICK, clickListener);
function cli... | Just because the variable lives on the stack (if it's a local variable) doesn't mean you can't create a pointer to it - and indeed that's the case with reference types as well.
The pointer within RefMethod is to the "outer" variable - and the variable itself lives on the stack as it's an uncaptured local variable.
As... |
436,778 | <p>I have an application that sends broadcast messages and listens for response packets. Below is the code snippet.</p>
<pre><code>m_socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
m_socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1);
m_socket.Bind(ne... | [
{
"answer_id": 436815,
"author": "Jon B",
"author_id": 27414,
"author_profile": "https://Stackoverflow.com/users/27414",
"pm_score": 3,
"selected": false,
"text": "<p>When you call Bind(), you are setting the local IP end point. Instead of using IPAddress.Any, use the IP address of the N... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/53450/"
] | I have an application that sends broadcast messages and listens for response packets. Below is the code snippet.
```
m_socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
m_socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1);
m_socket.Bind(new IPEndPoint(IP... | You can use the following to get all your IP Addresses (and a lot more). So you can iterate through the list and bind (like Jon B said) to the specific IP you want when you send out your multicast.
```
foreach (var i in System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces())
foreach (var ua in i.... |
436,801 | <p>I am trying to use Amazon Web Services to query Artist and title information and receive album art back. Using C# I cannot find any examples that come even close to this. All of the examples online are outdated and do not work with AWS' newer version.</p>
| [
{
"answer_id": 436808,
"author": "cgreeno",
"author_id": 6088,
"author_profile": "https://Stackoverflow.com/users/6088",
"pm_score": 2,
"selected": false,
"text": "<p>There is an open Source project on <a href=\"http://www.codeplex.com/aws\" rel=\"nofollow noreferrer\">CodePlex</a> you m... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54316/"
] | I am trying to use Amazon Web Services to query Artist and title information and receive album art back. Using C# I cannot find any examples that come even close to this. All of the examples online are outdated and do not work with AWS' newer version. | Here you go for what it's worth. This is code within an Asp.Net control to display book information. You can probably adapt it for your purposes easily enough. Or at least give you a starting-point. If you really want, I'd be happy to bundle the control up and send it your way.
```
if (!(string.IsNullOrEmpty(ISBN) && ... |
436,804 | <p>What is the best approach to encapsulate objects and manage their lifetime? Example: I have a class <em>A</em>, that contains an object of type <em>B</em> and is <strong>solely responsible</strong> for it. </p>
<p><strong>Solution 1</strong>, clone <em>b</em> object to ensure that only <em>A</em> is able to clean i... | [
{
"answer_id": 436830,
"author": "Saulius Žemaitaitis",
"author_id": 35685,
"author_profile": "https://Stackoverflow.com/users/35685",
"pm_score": 2,
"selected": false,
"text": "<p>If you are writing code that someone else will be using later, these issues must be addressed. In this case... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436804",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50430/"
] | What is the best approach to encapsulate objects and manage their lifetime? Example: I have a class *A*, that contains an object of type *B* and is **solely responsible** for it.
**Solution 1**, clone *b* object to ensure that only *A* is able to clean it up.
```
class A
{
B *b;
public:
A(B &b)
{
... | You should define your object so that the ownership semantics are, as much as possible, defined by the interface. As David Thornley pointed out, std::auto\_ptr is the smart pointer of choice to indicate *transfer of ownership*. Define your class like so:
```
class A
{
std::auto_ptr<B> b;
public:
A(std:... |
436,806 | <p>I'm currently trying to add a regular line shape to both the canvas and a custom object. I'm not getting an error, but the line is not being added to the canvas</p>
<p>The relevant bit of code is below</p>
<pre><code>lh = new LineHolder();
Line lnx = new Line();
lnx.StrokeThickness = 1;
MainCan.Children.Add(lnx... | [
{
"answer_id": 436830,
"author": "Saulius Žemaitaitis",
"author_id": 35685,
"author_profile": "https://Stackoverflow.com/users/35685",
"pm_score": 2,
"selected": false,
"text": "<p>If you are writing code that someone else will be using later, these issues must be addressed. In this case... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436806",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54042/"
] | I'm currently trying to add a regular line shape to both the canvas and a custom object. I'm not getting an error, but the line is not being added to the canvas
The relevant bit of code is below
```
lh = new LineHolder();
Line lnx = new Line();
lnx.StrokeThickness = 1;
MainCan.Children.Add(lnx);
lh.MainLiner = lnx... | You should define your object so that the ownership semantics are, as much as possible, defined by the interface. As David Thornley pointed out, std::auto\_ptr is the smart pointer of choice to indicate *transfer of ownership*. Define your class like so:
```
class A
{
std::auto_ptr<B> b;
public:
A(std:... |
436,807 | <p>Typically languages have keywords that you are unable to use directly with the exact same spelling and case for naming things (variables,functions,classes ...) in your program. Yet sometimes a keyword is the only natural choice for naming something. What is your system for avoiding/getting around this clash in your ... | [
{
"answer_id": 436817,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 4,
"selected": true,
"text": "<p>I just avoid the name, usually. Either find a different name or change it slightly - e.g. <code>clazz</code> instead o... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436807",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/53722/"
] | Typically languages have keywords that you are unable to use directly with the exact same spelling and case for naming things (variables,functions,classes ...) in your program. Yet sometimes a keyword is the only natural choice for naming something. What is your system for avoiding/getting around this clash in your cho... | I just avoid the name, usually. Either find a different name or change it slightly - e.g. `clazz` instead of `class` in C# or Java. In C# you *can* use the @ prefix, but it's horrible:
```
int @int = 5; // Ick!
``` |
436,816 | <p>I have an SQL Server 2000 query which performs an clustered index scan and displays a very high number of rows. For a table where I have 260.000 records, the actual number of rows displayed in the plan execution is ... 34.000.000. </p>
<p>Does this makes sense? What am I misunderstanding?</p>
<p>Thanks.</p>
| [
{
"answer_id": 436820,
"author": "Michael Haren",
"author_id": 29,
"author_profile": "https://Stackoverflow.com/users/29",
"pm_score": 2,
"selected": false,
"text": "<p>The values displayed on the execution plan are estimates based on statistics. Normal queries like:</p>\n\n<pre><code>SE... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436816",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44962/"
] | I have an SQL Server 2000 query which performs an clustered index scan and displays a very high number of rows. For a table where I have 260.000 records, the actual number of rows displayed in the plan execution is ... 34.000.000.
Does this makes sense? What am I misunderstanding?
Thanks. | The values displayed on the execution plan are estimates based on statistics. Normal queries like:
```
SELECT COUNT(*) FROM Table
```
are 100% accurate for your transaction\*.
Here's a [related question](https://stackoverflow.com/questions/93150/sql-server-post-join-rowcount-underestimate).
\*Edge cases may vary d... |
436,823 | <p>There are four kinds of 'dashes' in LaTeX: hyphen, en-dash(--), em-dash(---) and minus $-$. They are used for, respectively, hyphenation and joining words, indicating a range, punctuation, and a mathematical symbol. My question is: how do I indicate an en-dash (range) in math mode? (as in <code>$S=1 to 2$</code>)?... | [
{
"answer_id": 436856,
"author": "dmckee --- ex-moderator kitten",
"author_id": 2509,
"author_profile": "https://Stackoverflow.com/users/2509",
"pm_score": 2,
"selected": false,
"text": "<p>Well, you could use <code>$1\\mbox{--}2$</code>, but I'd look at the list of math symbols in the <... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48915/"
] | There are four kinds of 'dashes' in LaTeX: hyphen, en-dash(--), em-dash(---) and minus $-$. They are used for, respectively, hyphenation and joining words, indicating a range, punctuation, and a mathematical symbol. My question is: how do I indicate an en-dash (range) in math mode? (as in `$S=1 to 2$`)? Do I have to dr... | The simplest way is to use `$S=1\mbox{--}2$`. If you already have `\usepackage{amsmath}` in your document's preamble, however, you're better off using `\text`: `$S=1\text{--}2$` because `\text` will adjust the size of the font when used in super- and subscripts: `$S_{1\text{--}2}=0$`.
An en dash used in math may easil... |
436,829 | <p>I use Google Apps for my domain email, and I was wondering if I could use that account for OpenID instead of the regular Gmail account. </p>
<p>I know I can delegate Openid to some other URL using this:</p>
<pre><code><link rel="openid.server" href="http://www.myopenid.com/server" />
<link rel="openid.del... | [
{
"answer_id": 436873,
"author": "Nathan Feger",
"author_id": 8563,
"author_profile": "https://Stackoverflow.com/users/8563",
"pm_score": 1,
"selected": false,
"text": "<p>My understanding is that Google is not exposing that server url, and as such makes this technique inoperable for a G... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54320/"
] | I use Google Apps for my domain email, and I was wondering if I could use that account for OpenID instead of the regular Gmail account.
I know I can delegate Openid to some other URL using this:
```
<link rel="openid.server" href="http://www.myopenid.com/server" />
<link rel="openid.delegate" href="http://samruby.my... | Google recently (an hour or so ago) announced OpenID support for Google Apps customers.
Check out [the discovery protocol on Google Groups](http://groups.google.com/group/google-federated-login-api/web/openid-discovery-for-hosted-domains). Should be a good start.
I believe the endpoint is ht tps://www.google.com/acco... |
436,850 | <p>I want to do the following with regular expressions but not sure how to do it. I want it to match <code>one two</code> when <code>one two</code> is the beginning of the line unless the string contains <code>three</code> anywhere after <code>one two</code>.</p>
| [
{
"answer_id": 436863,
"author": "PEZ",
"author_id": 44639,
"author_profile": "https://Stackoverflow.com/users/44639",
"pm_score": 3,
"selected": false,
"text": "<pre><code>^one two(?!.*three)\n</code></pre>\n"
},
{
"answer_id": 436872,
"author": "Paul Dixon",
"author_id"... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436850",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14744/"
] | I want to do the following with regular expressions but not sure how to do it. I want it to match `one two` when `one two` is the beginning of the line unless the string contains `three` anywhere after `one two`. | You need a [negative lookahead assertion](http://www.perl.com/doc/manual/html/pod/perlre.html#item__pattern_) - something like this:
```
/^one two(?!.*three)/m
```
Here's [a tutorial on lookahead/lookbehind assertions](http://www.regular-expressions.info/lookaround.html)
Note: I've added the 'm' modifier so that ^ ... |
436,852 | <p>I'm using Java HashMap in MATLAB</p>
<pre><code>h = java.util.HashMap;
</code></pre>
<p>And while strings, arrays and matrices works seemlessly with it</p>
<pre><code>h.put(5, 'test');
h.put(7, magic(4));
</code></pre>
<p>Structs do not</p>
<pre><code>h=java.util.HashMap;
st.val = 7;
h.put(7, st);
??? No meth... | [
{
"answer_id": 436946,
"author": "gnovice",
"author_id": 52738,
"author_profile": "https://Stackoverflow.com/users/52738",
"pm_score": 1,
"selected": false,
"text": "<p>I'm not familiar with Java HashMaps, but could you try using a cell array to store the data instead of a struct?</p>\n\... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436852",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28772/"
] | I'm using Java HashMap in MATLAB
```
h = java.util.HashMap;
```
And while strings, arrays and matrices works seemlessly with it
```
h.put(5, 'test');
h.put(7, magic(4));
```
Structs do not
```
h=java.util.HashMap;
st.val = 7;
h.put(7, st);
??? No method 'put' with matching signature found for class 'java.util.... | You need to ensure that the data passed from MATLAB to Java can be properly converted. See MATLAB's [External Interfaces document](http://www.mathworks.com/help/pdf_doc/matlab/apiext.pdf) for the conversion matrix of which types get converted to which other types.
MATLAB treats most data as pass-by-value (with the exc... |
436,864 | <p>I have encountered this problem a couple of times, in the last few days. So, it happens occasionally. I have setup mysql on a remote machine, and there is a java program on another machine querying the database to read and write records every few seconds. </p>
<p>I am using phpMyAdmin to administer my database. And... | [
{
"answer_id": 437039,
"author": "Ry Biesemeyer",
"author_id": 53098,
"author_profile": "https://Stackoverflow.com/users/53098",
"pm_score": 1,
"selected": false,
"text": "<p>I'd highly recommend using MySQL's own <a href=\"http://dev.mysql.com/downloads/gui-tools/5.0.html\" rel=\"nofoll... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436864",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/48725/"
] | I have encountered this problem a couple of times, in the last few days. So, it happens occasionally. I have setup mysql on a remote machine, and there is a java program on another machine querying the database to read and write records every few seconds.
I am using phpMyAdmin to administer my database. And, at times... | Use a mysqlclient to make a connection and keep it open.
I personally use the mysql from the commandline.
If the server becomes unresponsive execute
```
SHOW PROCESSLIST;
```
It will list all mysql processes and will show how long queries are waiting/executing.
Optionally use the KILL statement to terminate the qu... |
436,866 | <p>I'm curious to see if you can overload controller methods in ASP.NET MVC. Whenever I try, I get the error below. The two methods accept different arguments. Is this something that cannot be done?</p>
<blockquote>
<p>The current request for action 'MyMethod' on controller type 'MyController' is ambiguous betwee... | [
{
"answer_id": 436922,
"author": "keeney",
"author_id": 48046,
"author_profile": "https://Stackoverflow.com/users/48046",
"pm_score": 4,
"selected": false,
"text": "<p>As far as I know you can only have the same method when using different http methods.</p>\n\n<p>i.e.</p>\n\n<pre><code>[... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/47576/"
] | I'm curious to see if you can overload controller methods in ASP.NET MVC. Whenever I try, I get the error below. The two methods accept different arguments. Is this something that cannot be done?
>
> The current request for action 'MyMethod' on controller type 'MyController' is ambiguous between the following action ... | You can use the attribute if you want your code to do overloading.
```
[ActionName("MyOverloadedName")]
```
But, you'll have to use a different action name for the same http method (as others have said). So it's just semantics at that point. Would you rather have the name in your code or your attribute?
Phil has an... |
436,870 | <p>MGraph is a great textual data format brought by Microsoft "Oslo".</p>
<p>Do you think it has a chance to get as broad as XML is today?</p>
<p>Example (Google Geocode):</p>
<pre><code>{
name = "waltrop, lehmstr 1d",
Status {
code = 200,
request: "geocode"
},
Placemark [
{
... | [
{
"answer_id": 436881,
"author": "Kev",
"author_id": 419,
"author_profile": "https://Stackoverflow.com/users/419",
"pm_score": 1,
"selected": false,
"text": "<p>I can't help it, but I kinda feel Oslo is a solution looking for a really excellent concrete problem to solve. I truly hope the... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11562/"
] | MGraph is a great textual data format brought by Microsoft "Oslo".
Do you think it has a chance to get as broad as XML is today?
Example (Google Geocode):
```
{
name = "waltrop, lehmstr 1d",
Status {
code = 200,
request: "geocode"
},
Placemark [
{
id = "p1",
address ... | ...and what does it do that JSON doesn't do? |
436,889 | <p>In the path:</p>
<p><strong>Format:</strong> <a href="http://mydomain.com/" rel="nofollow noreferrer">http://mydomain.com/</a>{category}/{subcategory}/{pageNumber}/{pageSize}</p>
<p><strong>Example:</strong> <a href="http://mydomain.com/books/thriller/3/25" rel="nofollow noreferrer">http://mydomain.com/books/thril... | [
{
"answer_id": 436903,
"author": "matt b",
"author_id": 4249,
"author_profile": "https://Stackoverflow.com/users/4249",
"pm_score": 1,
"selected": false,
"text": "<blockquote>\n <p>Is there a canonical method for determining what goes where in MVC, or is it really just up to the dev?</p... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2596/"
] | In the path:
**Format:** <http://mydomain.com/>{category}/{subcategory}/{pageNumber}/{pageSize}
**Example:** <http://mydomain.com/books/thriller/3/25>
In the querystring:
**Format:** <http://mydomain.com/>{category}/{subcategory}? pageNumber={pageNumber}&pageSize={pageSize}
**Example:** <http://mydomain.com/books/... | I prefer things like pagenumbers to be in the querystring variables. I think there's a difference in descriptiveness between
```
http://mydomain.com/books/thriller?pagesize=50&page=4
```
and
```
http://mydomain.com/books/thriller/50/4
```
The point (to me) of having clean url's is for them to be more descriptive... |
436,896 | <p>i want to mark a method as obsolete, but Delphi 5 doesn't have such a feature.</p>
<p>For the sake of an example, here is a made-up method with it's deprecated and new preferred form:</p>
<pre><code>procedure TStormPeaksQuest.BlowHodirsHorn; overload; //obsolete
procedure TStormPeaksQuest.BlowHodirsHorn(UseProtect... | [
{
"answer_id": 436996,
"author": "Toon Krijthe",
"author_id": 18061,
"author_profile": "https://Stackoverflow.com/users/18061",
"pm_score": 0,
"selected": false,
"text": "<p>Why do you want to do this and why don't you want to upgrade the Delphi version?</p>\n\n<p>Without the deprecated ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12597/"
] | i want to mark a method as obsolete, but Delphi 5 doesn't have such a feature.
For the sake of an example, here is a made-up method with it's deprecated and new preferred form:
```
procedure TStormPeaksQuest.BlowHodirsHorn; overload; //obsolete
procedure TStormPeaksQuest.BlowHodirsHorn(UseProtection: Boolean); overlo... | What I've ended up using was a combination of opting into a system where you agree to not have any deprecated code, with output debug strings and breakpoints otherwise.
Like `strict` html, I've created a `Strict` define.
All the common units have the obsolete code defined out if `Strict` is defined. That way the deve... |
436,944 | <p>I'm trying to build my own custom django form widgets (putting them in widgets.py of my project directory). What should the value "value_from_datadict()" return? Is it returning a string or the actual expected value of the field?</p>
<p>I'm building my own version of a split date/time widget using JQuery objects,... | [
{
"answer_id": 437354,
"author": "Jeff Bauer",
"author_id": 41759,
"author_profile": "https://Stackoverflow.com/users/41759",
"pm_score": 4,
"selected": true,
"text": "<p>For <code>value_from_datadict()</code> you want to return the value you expect or None. The source in <a href=\"http... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36680/"
] | I'm trying to build my own custom django form widgets (putting them in widgets.py of my project directory). What should the value "value\_from\_datadict()" return? Is it returning a string or the actual expected value of the field?
I'm building my own version of a split date/time widget using JQuery objects, what shou... | For `value_from_datadict()` you want to return the value you expect or None. The source in [django/forms/widgets.py](https://github.com/django/django/blob/master/django/forms/widgets.py) provides some examples.
But you should be able to build a DatePicker widget by just providing a `render` method:
```
DATE_FORMAT = ... |
436,954 | <p>What is the meaning of the .NET 3.5 extension method <code>Enumerable.First()</code> when you call it on an instance of the <code>Dictionary</code> collection?</p>
<p>Does the set of keys determine which item is first, or is it just not defined?</p>
| [
{
"answer_id": 436957,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 5,
"selected": true,
"text": "<p>Well, I believe the set of keys <em>will</em> determine which item is first, but not in a well-defined (or easy to pre... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43795/"
] | What is the meaning of the .NET 3.5 extension method `Enumerable.First()` when you call it on an instance of the `Dictionary` collection?
Does the set of keys determine which item is first, or is it just not defined? | Well, I believe the set of keys *will* determine which item is first, but not in a well-defined (or easy to predict) way. In other words, don't assume that it will always work the same way - it's as unsafe as relying on a hash code implementation staying the same between runs.
EDIT: I believe that in fact, the orderin... |
436,956 | <p>I want to run a console application that will output a file.</p>
<p>I user the following code:</p>
<pre><code>Process barProcess = Process.Start("bar.exe", @"C:\foo.txt");
</code></pre>
<p>When this runs the console window appears. I want to hide the console window so it is not seen by the user.</p>
<p>Is this ... | [
{
"answer_id": 436962,
"author": "Victor",
"author_id": 42518,
"author_profile": "https://Stackoverflow.com/users/42518",
"pm_score": -1,
"selected": false,
"text": "<p>We have done this in the past by executing our processes using the Command Line programatically.</p>\n"
},
{
"a... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436956",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2469/"
] | I want to run a console application that will output a file.
I user the following code:
```
Process barProcess = Process.Start("bar.exe", @"C:\foo.txt");
```
When this runs the console window appears. I want to hide the console window so it is not seen by the user.
Is this possible? Is using Process.Start the best... | ```
Process p = new Process();
StreamReader sr;
StreamReader se;
StreamWriter sw;
ProcessStartInfo psi = new ProcessStartInfo(@"bar.exe");
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
psi.Redire... |
436,966 | <p>What would be the best approach to have Thinking Sphinx only index records where Today's date is less than or equal to the record's "expires_at" field?</p>
<p>Thanks in advance.</p>
| [
{
"answer_id": 438330,
"author": "pat",
"author_id": 54500,
"author_profile": "https://Stackoverflow.com/users/54500",
"pm_score": 2,
"selected": false,
"text": "<p>The easiest approach is adding the following statement to your define_index block:</p>\n\n<p><pre>where \"expired_at >= NOW... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | What would be the best approach to have Thinking Sphinx only index records where Today's date is less than or equal to the record's "expires\_at" field?
Thanks in advance. | The easiest approach is adding the following statement to your define\_index block:
```
where "expired_at >= NOW()"
```
That's the MySQL version, anyway. PostgreSQL will be pretty similar:
```
where "expired_at >= current_timestamp"
```
Although, I'm no PostgreSQL expert, but hopefully that's close enough to what's... |
436,976 | <p>We have an SELinux client that authenticates network users using LDAP connecting to an Active Directory server. Since our machines have to operate "untethered," we have to use nscd to cache group and passwd info.</p>
<p>Here's the issue. If we change group information on the Active Directory server, then log in on ... | [
{
"answer_id": 437528,
"author": "Patrick",
"author_id": 54396,
"author_profile": "https://Stackoverflow.com/users/54396",
"pm_score": 1,
"selected": false,
"text": "<p>If you don't want to cache results from active directory then you need to either turn off nscd or set its cache life ti... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24309/"
] | We have an SELinux client that authenticates network users using LDAP connecting to an Active Directory server. Since our machines have to operate "untethered," we have to use nscd to cache group and passwd info.
Here's the issue. If we change group information on the Active Directory server, then log in on the client... | We finally resolved this by using nss\_updatedb to cache the group and passwd databases locally. We then turned off nscd.
We added the pam\_exec module to the pam.d listing and use it to run nss\_updatedb before authentication to make sure the local cache is up to date. |
436,980 | <p>I'm starting to get a bit desperate in my attempts to get a ruby script to connect to MySQL.</p>
<p>I've given up on DBI, as I just don't seem to be able to get it to work no matter what I do. I figured I might have more luck with just using mysql.rb from ruby-mysql. However, in using that I get the following error... | [
{
"answer_id": 436990,
"author": "Jason Miesionczek",
"author_id": 18811,
"author_profile": "https://Stackoverflow.com/users/18811",
"pm_score": 1,
"selected": false,
"text": "<p>What are you looking to do? I think it is possible to use the ActiveRecord component of Rails to establish a ... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11522/"
] | I'm starting to get a bit desperate in my attempts to get a ruby script to connect to MySQL.
I've given up on DBI, as I just don't seem to be able to get it to work no matter what I do. I figured I might have more luck with just using mysql.rb from ruby-mysql. However, in using that I get the following error:
```
./m... | Sounds like you've run in to a MySQL quirk. Some time around version 5.0 they changed the format of connect passwords. It's an easy fix, though: <http://dev.mysql.com/doc/refman/5.1/en/old-client.html>
(Also, check out the Ruby Sequel gem, it lets you do some real fun stuff with all sorts of databases and without the ... |
436,986 | <p>Common question but I could use an "english" explanation. </p>
<p>Is it like Java where</p>
<pre><code>Cat myCat
</code></pre>
<p>actually is a pointer to <code>Cat</code>? </p>
<p>Should I really create copy constructors in C#?</p>
<hr>
<p>I understand we are passing by value, but now my question is are we pa... | [
{
"answer_id": 436991,
"author": "mmmmmmmm",
"author_id": 44086,
"author_profile": "https://Stackoverflow.com/users/44086",
"pm_score": 2,
"selected": false,
"text": "<p>If you delacred Cat as</p>\n\n<pre><code>class Cat {...}\n</code></pre>\n\n<p>then it is.</p>\n\n<p>If you delcared Ca... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436986",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50312/"
] | Common question but I could use an "english" explanation.
Is it like Java where
```
Cat myCat
```
actually is a pointer to `Cat`?
Should I really create copy constructors in C#?
---
I understand we are passing by value, but now my question is are we passing by pointer value or full copy of the object?
If it's... | As @rstevens answered, if it is a class, myCat is a reference. But if you pass myCat to a method call, then the reference itself is passed by value - i.e. the parameter itself will reference the same object, but it's a completely new reference, so if you assign it to null, or create a new object, the old myCat referenc... |
436,989 | <p>In C if you have a certain type of packet, what you generally do is define some struct and cast the char * into a pointer to the struct. After this you have direct programmatic access to all data fields in the network packet. Like so :</p>
<pre><code>struct rdp_header {
int version;
char serverId[20];
};
</code... | [
{
"answer_id": 436994,
"author": "Alnitak",
"author_id": 6782,
"author_profile": "https://Stackoverflow.com/users/6782",
"pm_score": 2,
"selected": false,
"text": "<p>Read your packet into a byte array, and then extract the bits and bytes you want from that.</p>\n\n<p>Here's a sample, sa... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436989",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54335/"
] | In C if you have a certain type of packet, what you generally do is define some struct and cast the char \* into a pointer to the struct. After this you have direct programmatic access to all data fields in the network packet. Like so :
```
struct rdp_header {
int version;
char serverId[20];
};
```
When you get ... | Read your packet into a byte array, and then extract the bits and bytes you want from that.
Here's a sample, sans exception handling:
```
DatagramSocket s = new DatagramSocket(port);
DatagramPacket p;
byte buffer[] = new byte[4096];
while (true) {
p = new DatagramPacket(buffer, buffer.length);
s.receive(p);
... |
436,998 | <p>I am having a difficult time trying to do something that seems like it should be really easy to do. I basically want to multiply 2 numbers in a node and then sum the total of those numbers for all the nodes. Here is the XSLT code I have tried.</p>
<pre><code><xsl:value-of select="sum(Parts/Part/Quantity * Parts/... | [
{
"answer_id": 437643,
"author": "Dimitre Novatchev",
"author_id": 36305,
"author_profile": "https://Stackoverflow.com/users/36305",
"pm_score": 5,
"selected": false,
"text": "<p><strong>Here are three possible solutions</strong>:</p>\n\n<h1>Solution1 XSLT2:</h1>\n\n<pre><code><xsl:st... | 2009/01/12 | [
"https://Stackoverflow.com/questions/436998",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I am having a difficult time trying to do something that seems like it should be really easy to do. I basically want to multiply 2 numbers in a node and then sum the total of those numbers for all the nodes. Here is the XSLT code I have tried.
```
<xsl:value-of select="sum(Parts/Part/Quantity * Parts/Part/Rate)"/>
``... | **Here are three possible solutions**:
Solution1 XSLT2:
================
```
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:sequence select="sum(/*/*/(rate * quantity))"/>
</xsl:template>
</xsl:stylesheet>
```... |
437,002 | <p>I'm very new to both the Mvc framework as well as JavaScript and JQuery. I'm trying to understand the right way to structure Ajax calls.</p>
<p>Let's say I have a <code>Vote Up</code> button similar to what you see on StackOverflow. When the user clicks it I need to update the vote count in the database and return ... | [
{
"answer_id": 437100,
"author": "Craig Stuntz",
"author_id": 7714,
"author_profile": "https://Stackoverflow.com/users/7714",
"pm_score": 5,
"selected": true,
"text": "<p>Yes, it sounds like you've got it about right.</p>\n\n<p>Note, however, that if you change postId to Id, then you cou... | 2009/01/12 | [
"https://Stackoverflow.com/questions/437002",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17744/"
] | I'm very new to both the Mvc framework as well as JavaScript and JQuery. I'm trying to understand the right way to structure Ajax calls.
Let's say I have a `Vote Up` button similar to what you see on StackOverflow. When the user clicks it I need to update the vote count in the database and return the new value to the ... | Yes, it sounds like you've got it about right.
Note, however, that if you change postId to Id, then you could call with a URL like:
<http://example.com/posts/voteUp/5>
(With the default routing.) It's a question of personal preference. |
437,010 | <p>In Microsoft's UnitTesting namespace (<code>Microsoft.VisualStudio.TestTools.UnitTesting</code>) there are <code>AssemblyInitialize</code> and <code>AssemblyCleanup</code> attributes you can apply to static methods and they will be called before and after all tests respectively.</p>
<pre><code>[AssemblyInitialize]
... | [
{
"answer_id": 437100,
"author": "Craig Stuntz",
"author_id": 7714,
"author_profile": "https://Stackoverflow.com/users/7714",
"pm_score": 5,
"selected": true,
"text": "<p>Yes, it sounds like you've got it about right.</p>\n\n<p>Note, however, that if you change postId to Id, then you cou... | 2009/01/12 | [
"https://Stackoverflow.com/questions/437010",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9642/"
] | In Microsoft's UnitTesting namespace (`Microsoft.VisualStudio.TestTools.UnitTesting`) there are `AssemblyInitialize` and `AssemblyCleanup` attributes you can apply to static methods and they will be called before and after all tests respectively.
```
[AssemblyInitialize]
static public void AssemblyInitialize(TestConte... | Yes, it sounds like you've got it about right.
Note, however, that if you change postId to Id, then you could call with a URL like:
<http://example.com/posts/voteUp/5>
(With the default routing.) It's a question of personal preference. |
437,011 | <p>For a given report, the user will want to have multiple filtering options. This isn't bad when the options are enumerations, and other 'static' data types, however things can get silly fast when you need a select list that is populated by fields stored in a table in the backend. </p>
<p>How do you handle this scena... | [
{
"answer_id": 437317,
"author": "Odd",
"author_id": 11908,
"author_profile": "https://Stackoverflow.com/users/11908",
"pm_score": 1,
"selected": false,
"text": "<p>You could go and retrieve the data asynchronously on the screen using jQuery and JsonResults from your MVC application, thi... | 2009/01/12 | [
"https://Stackoverflow.com/questions/437011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46449/"
] | For a given report, the user will want to have multiple filtering options. This isn't bad when the options are enumerations, and other 'static' data types, however things can get silly fast when you need a select list that is populated by fields stored in a table in the backend.
How do you handle this scenario? I fin... | I’m currently building out a new reporting section for one of our products at work and am dealing with this same issue. The solution I’ve come up with so far, though it hasn’t been implemented yet so this is still a work in progress, is along the lines of this.
There will be a class that will represent a report filter... |
437,022 | <p>When is the "unit of work" no longer a "unit"? Which scenario is better on resources? THe first creates one connection wheras the second creates 4. </p>
<pre><code>using (DataContext dc=new DataContext)
{
var orders= from o in dc.orders
select ( new Product { property a= from a in ..join... selec... | [
{
"answer_id": 437238,
"author": "JD Conley",
"author_id": 51769,
"author_profile": "https://Stackoverflow.com/users/51769",
"pm_score": 1,
"selected": false,
"text": "<p>Generally speaking the less round trips to your database the better. However, in high scale apps we often make our da... | 2009/01/12 | [
"https://Stackoverflow.com/questions/437022",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49632/"
] | When is the "unit of work" no longer a "unit"? Which scenario is better on resources? THe first creates one connection wheras the second creates 4.
```
using (DataContext dc=new DataContext)
{
var orders= from o in dc.orders
select ( new Product { property a= from a in ..join... select x,
... | When using LINQ if you add one entity to another and they use a different data context you are going to get an error. I would suggest keeping the same data context for each unit of work you are using. You can easily identify the unit of work you are processing by using the repository pattern to write your data access c... |
437,025 | <p>I have a Python-based app that can accept a few commands in a simple read-eval-print-loop. I'm using <code>raw_input('> ')</code> to get the input. On Unix-based systems, I also <code>import readline</code> to make things behave a little better. All this is working fine.</p>
<p>The problem is that there are asyn... | [
{
"answer_id": 437088,
"author": "cdleary",
"author_id": 3594,
"author_profile": "https://Stackoverflow.com/users/3594",
"pm_score": 4,
"selected": true,
"text": "<p>Maybe something like this will do the trick:</p>\n\n<pre><code>#!/usr/bin/env python2.6\n\nfrom __future__ import print_fu... | 2009/01/12 | [
"https://Stackoverflow.com/questions/437025",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21482/"
] | I have a Python-based app that can accept a few commands in a simple read-eval-print-loop. I'm using `raw_input('> ')` to get the input. On Unix-based systems, I also `import readline` to make things behave a little better. All this is working fine.
The problem is that there are asynchronous events coming in, and I'd ... | Maybe something like this will do the trick:
```
#!/usr/bin/env python2.6
from __future__ import print_function
import readline
import threading
PROMPT = '> '
def interrupt():
print() # Don't want to end up on the same line the user is typing on.
print('Interrupting cow -- moo!')
print(PROMPT, readline... |
437,026 | <p>I'm having a hard time understanding what the difference is between incrementing a variable in C# this way:</p>
<pre><code>myInt++;
</code></pre>
<p>and </p>
<pre><code>++myInt;
</code></pre>
<p>When would ever matter which one you use?</p>
<p>I'll give voteCount++ for the best answer. Or should I give it ++vot... | [
{
"answer_id": 437035,
"author": "ng.",
"author_id": 21896,
"author_profile": "https://Stackoverflow.com/users/21896",
"pm_score": 3,
"selected": false,
"text": "<p>In assignment or expressions, for example</p>\n\n<pre><code>x = ++myInt; // x = myInt + 1\nx = myInt++; // x = myInt\n</cod... | 2009/01/12 | [
"https://Stackoverflow.com/questions/437026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17744/"
] | I'm having a hard time understanding what the difference is between incrementing a variable in C# this way:
```
myInt++;
```
and
```
++myInt;
```
When would ever matter which one you use?
I'll give voteCount++ for the best answer. Or should I give it ++voteCount... | There is no difference when written on its own (as shown) - in both cases myInt will be incremented by 1.
But there is a difference when you use it in an expression, e.g. something like this:
```
MyFunction(++myInt);
MyFunction(myInt++);
```
In the first case, myInt is incremented and the new/incremented value is p... |
437,061 | <p>We are looking for a Wireshark-like tool to use on the iPhone to test a 3rd party application before partnering with the 3rd party. Any suggestions?</p>
| [
{
"answer_id": 437084,
"author": "Chris Ballance",
"author_id": 1551,
"author_profile": "https://Stackoverflow.com/users/1551",
"pm_score": 4,
"selected": false,
"text": "<p>Run it through a proxy and monitor the traffic using <a href=\"http://www.wireshark.org/download.html\" rel=\"nore... | 2009/01/12 | [
"https://Stackoverflow.com/questions/437061",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | We are looking for a Wireshark-like tool to use on the iPhone to test a 3rd party application before partnering with the 3rd party. Any suggestions? | A man-in-the-middle proxy, like suggested by other answers, is a good solution if you only want to see HTTP/HTTPS traffic.
The best solution for packet sniffing (though it only works for *actual* iOS devices, not the simulator) I've found is to use `rvictl`. [This blog post](http://useyourloaf.com/blog/2012/02/07/remo... |
437,067 | <p>In <a href="https://stackoverflow.com/questions/428859/what-goes-in-your-domain-model-objects-and-what-goes-in-your-services">this</a> question someone <a href="https://stackoverflow.com/questions/428859/what-goes-in-your-domain-model-objects-and-what-goes-in-your-services#428902">replies</a> "You never let the doma... | [
{
"answer_id": 437109,
"author": "Otávio Décio",
"author_id": 48684,
"author_profile": "https://Stackoverflow.com/users/48684",
"pm_score": 2,
"selected": false,
"text": "<p>One disadvantage I see is that allowing your domain object to call services may make it harder to serialize, or at... | 2009/01/12 | [
"https://Stackoverflow.com/questions/437067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31624/"
] | In [this](https://stackoverflow.com/questions/428859/what-goes-in-your-domain-model-objects-and-what-goes-in-your-services) question someone [replies](https://stackoverflow.com/questions/428859/what-goes-in-your-domain-model-objects-and-what-goes-in-your-services#428902) "You never let the domain object implementations... | This is the [Spreadsheet Conundrum](http://moffdub.wordpress.com/2008/09/10/the-spreadsheet-conundrum/): [does the phone dial the phone number, or does the phone number dial itself on the phone](https://stackoverflow.com/questions/68617/design-question-does-the-phone-dial-the-phonenumber-or-does-the-phonenumber-dia)?
... |
437,075 | <p>I am attempting to create a LinkLabel control for WPF. Essentially, I'm going to create the LinkLabel from a TextBlock and handle MouseEnter, MouseLeave, and MouseLeftButtonUp events. In the back end I have a base class that has properties that you would expect to see with a LinkLabel. With most other clickable cont... | [
{
"answer_id": 437106,
"author": "Matt Hamilton",
"author_id": 615,
"author_profile": "https://Stackoverflow.com/users/615",
"pm_score": 2,
"selected": false,
"text": "<p>You can create the equivalent of WinForms' LinkLabel right now using a combination of TextBlock and HyperLink:</p>\n\... | 2009/01/12 | [
"https://Stackoverflow.com/questions/437075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/42858/"
] | I am attempting to create a LinkLabel control for WPF. Essentially, I'm going to create the LinkLabel from a TextBlock and handle MouseEnter, MouseLeave, and MouseLeftButtonUp events. In the back end I have a base class that has properties that you would expect to see with a LinkLabel. With most other clickable control... | You can create the equivalent of WinForms' LinkLabel right now using a combination of TextBlock and HyperLink:
```
<TextBlock>Here is a <Hyperlink NavigateUri="http://example.com">link</Hyperlink></TextBlock>
```
You won't get the "ice blue" mouse-over effect, but you will get the hand cursor. I'm sure you can intro... |
437,082 | <p>I have a question on how best to get xhtml into excel. let the user edit it in excel and then get back to xhtml at the end.</p>
<p>The background is that I have a web app in which the texts are stored in xhtml. These I can export to an excel file with the html in the excel cell. </p>
<p>I can also reimport this ce... | [
{
"answer_id": 437124,
"author": "Mostlyharmless",
"author_id": 12881,
"author_profile": "https://Stackoverflow.com/users/12881",
"pm_score": 0,
"selected": false,
"text": "<p>A solution I once implemented for my own personal use was that I wrote a macro in excel that parsed the html fil... | 2009/01/12 | [
"https://Stackoverflow.com/questions/437082",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/54344/"
] | I have a question on how best to get xhtml into excel. let the user edit it in excel and then get back to xhtml at the end.
The background is that I have a web app in which the texts are stored in xhtml. These I can export to an excel file with the html in the excel cell.
I can also reimport this cell back to xhtml ... | If you're already familiar with XSLT, it sounds like that would be the best option. Although Excel 2003 doesn't use the .xlsx format, it does read (and save) what they call "SpreadsheetML", which is also XML. I've found that the easiest way to learn how to do the transforms to SpreadsheetML is just to open up a spreads... |
437,085 | <p>What is the proper way to do mvn release:perform so that source code does not
end up in my artifactory?</p>
<p>All help appreciated. I know I have seen this documented somewhere</p>
<p>Thanks</p>
| [
{
"answer_id": 487888,
"author": "maskefjes",
"author_id": 27743,
"author_profile": "https://Stackoverflow.com/users/27743",
"pm_score": -1,
"selected": false,
"text": "<p>You could (should) do a dry run to verify that everything is OK before doing the real release. This is done by setti... | 2009/01/12 | [
"https://Stackoverflow.com/questions/437085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | What is the proper way to do mvn release:perform so that source code does not
end up in my artifactory?
All help appreciated. I know I have seen this documented somewhere
Thanks | Try setting the attach property of the maven-source-plugin to false, e.g:
```
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<configuration>
<attach>false</attach>
</configuration>... |