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 |
|---|---|---|---|---|---|---|
209,793 | <p>Kind of a random question...</p>
<p>What I'm looking for is a way to express a cast operation which uses a defined operator of the class instance I'm casting from, and generates a compile-time error if there is not a defined cast operator for the type. So, for example, what I'm looking for is something like:</p>
<... | [
{
"answer_id": 209889,
"author": "Greg Rogers",
"author_id": 5963,
"author_profile": "https://Stackoverflow.com/users/5963",
"pm_score": 1,
"selected": false,
"text": "<p>Using a converting constructor marked <a href=\"https://stackoverflow.com/questions/121162/what-does-the-explicit-key... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26240/"
] | Kind of a random question...
What I'm looking for is a way to express a cast operation which uses a defined operator of the class instance I'm casting from, and generates a compile-time error if there is not a defined cast operator for the type. So, for example, what I'm looking for is something like:
```
template< t... | The code you posted works with the [Cameau compiler](http://www.comeaucomputing.com/tryitout/) (which is usually a good indication that it's valid C++).
As you know a valid cast consists of no more than one user defined cast, so a possible solution I was thinking of was adding another user defined cast by defining a ... |
209,804 | <p>What reason is there for C# or java having lambdas? Neither language is based around them, it appears to be another coding method to do the same thing that C# already did.<br>
I'm not being confrontational, if there is a reason I would like to know the reason why. For the purpose of full disclosure I am a Java progr... | [
{
"answer_id": 209810,
"author": "tvanfosson",
"author_id": 12950,
"author_profile": "https://Stackoverflow.com/users/12950",
"pm_score": 3,
"selected": false,
"text": "<p>I see lambdas in C# as a very convenient short-cut for doing delegates. Much more readable to have the code right t... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209804",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13491/"
] | What reason is there for C# or java having lambdas? Neither language is based around them, it appears to be another coding method to do the same thing that C# already did.
I'm not being confrontational, if there is a reason I would like to know the reason why. For the purpose of full disclosure I am a Java programme... | There are common use-cases which require passing (or storing) a block of code to be executed later. The most common would be event listeners. Believe it or not, the following bit of code uses a lambda-ish construct in Java:
```
JButton button = new JButton("Push me!");
button.addActionListener(new ActionListener() {
... |
209,812 | <p>I'm using NetBeans, trying to change the familiar Java coffee cup icon to a png file that I have saved in a resources directory in the jar file. I've found many different web pages that claim they have a solution, but so far none of them work.</p>
<p>Here's what I have at the moment (leaving out the try-catch bloc... | [
{
"answer_id": 209824,
"author": "JeeBee",
"author_id": 17832,
"author_profile": "https://Stackoverflow.com/users/17832",
"pm_score": 7,
"selected": true,
"text": "<pre><code>java.net.URL url = ClassLoader.getSystemResource(\"com/xyz/resources/camera.png\");\n</code></pre>\n\n<p>May or m... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1288/"
] | I'm using NetBeans, trying to change the familiar Java coffee cup icon to a png file that I have saved in a resources directory in the jar file. I've found many different web pages that claim they have a solution, but so far none of them work.
Here's what I have at the moment (leaving out the try-catch block):
```
UR... | ```
java.net.URL url = ClassLoader.getSystemResource("com/xyz/resources/camera.png");
```
May or may not require a '/' at the front of the path. |
209,820 | <p>I want to be able to introduce new 'tag lines' into a database that are shown 'randomly' to users. (These tag lines are shown as an introduction as animated text.)</p>
<p>Based upon the number of sales that result from those taglines I'd like the good ones to trickle to the top, but still show the others less frequ... | [
{
"answer_id": 209857,
"author": "EBGreen",
"author_id": 1358,
"author_profile": "https://Stackoverflow.com/users/1358",
"pm_score": 0,
"selected": false,
"text": "<p>I would suggest randomly choosing with a weighting factor based on previous sales. So let's say you had this:</p>\n\n<ul>... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24727/"
] | I want to be able to introduce new 'tag lines' into a database that are shown 'randomly' to users. (These tag lines are shown as an introduction as animated text.)
Based upon the number of sales that result from those taglines I'd like the good ones to trickle to the top, but still show the others less frequently.
I ... | Looking at your problem, I would modify the requirements a bit -
1) The most popular one should be shown most often.
2) Taglines should "age", so one that got a lot of votes (purchase) in the past, but none recently should be shown less often
3) Brand new taglines should be shown more often during their first days.
I... |
209,840 | <p>I want to combine these:</p>
<pre class="lang-py prettyprint-override"><code>keys = ['name', 'age', 'food']
values = ['Monty', 42, 'spam']
</code></pre>
<p>Into a single dictionary:</p>
<pre class="lang-py prettyprint-override"><code>{'name': 'Monty', 'age': 42, 'food': 'spam'}
</code></pre>
| [
{
"answer_id": 209854,
"author": "Dan Lenski",
"author_id": 20789,
"author_profile": "https://Stackoverflow.com/users/20789",
"pm_score": 12,
"selected": true,
"text": "<p>Like this:</p>\n<pre><code>keys = ['a', 'b', 'c']\nvalues = [1, 2, 3]\ndictionary = dict(zip(keys, values))\nprint(d... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12388/"
] | I want to combine these:
```py
keys = ['name', 'age', 'food']
values = ['Monty', 42, 'spam']
```
Into a single dictionary:
```py
{'name': 'Monty', 'age': 42, 'food': 'spam'}
``` | Like this:
```
keys = ['a', 'b', 'c']
values = [1, 2, 3]
dictionary = dict(zip(keys, values))
print(dictionary) # {'a': 1, 'b': 2, 'c': 3}
```
Voila :-) The pairwise [`dict`](https://docs.python.org/3/library/functions.html#func-dict) constructor and [`zip`](https://docs.python.org/3/library/functions.html#zip) func... |
209,861 | <p>I have a HTML page that scrolls up and down (not a lot, but it does scroll). How can I set the scroll position in the page after executing some JavaScript?</p>
<p>I'm using jQuery to inject some additional HTML at the bottom of the page and I'd like to programmatically scroll to the position of that new content aft... | [
{
"answer_id": 209881,
"author": "KernelM",
"author_id": 22328,
"author_profile": "https://Stackoverflow.com/users/22328",
"pm_score": 3,
"selected": false,
"text": "<p>Try using <a href=\"http://developer.mozilla.org/en/DOM/window.scroll\" rel=\"nofollow noreferrer\"><code>window.scroll... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209861",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2536/"
] | I have a HTML page that scrolls up and down (not a lot, but it does scroll). How can I set the scroll position in the page after executing some JavaScript?
I'm using jQuery to inject some additional HTML at the bottom of the page and I'd like to programmatically scroll to the position of that new content after it's ad... | Another way to do this, so that you have the option:
In the HTML you are adding to the bottom of the page, you can insert a named anchor tag and then change the URL so that the page moves there (FYI: it will not refresh the page).
```
// add HTML like this, dynamically:
// <a name="moveHere" />
// the javascript to ... |
209,862 | <p>This page displays beautifully in firefox but i get all kinds of problems when testing the site in opera or internet explorer, mostly with the menu. I would like to know what techniques have caused this and how to avoid them. </p>
<p><a href="http://www.jkhbdesign.se/" rel="nofollow noreferrer">http://www.jkhbdesig... | [
{
"answer_id": 209934,
"author": "Geoff",
"author_id": 1097,
"author_profile": "https://Stackoverflow.com/users/1097",
"pm_score": 3,
"selected": true,
"text": "<p>At the very least you are going to have to deal with the fact that the CSS :hover is not supported in IE for any tag except ... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209862",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28668/"
] | This page displays beautifully in firefox but i get all kinds of problems when testing the site in opera or internet explorer, mostly with the menu. I would like to know what techniques have caused this and how to avoid them.
<http://www.jkhbdesign.se/>
Edit 2: Here are some screenshots of some specific problems
Th... | At the very least you are going to have to deal with the fact that the CSS :hover is not supported in IE for any tag except the anchor tag. You'll need to use onmouseover, onmouseout in IE to accomplish the same thing. Or change the li:hover to an a:hover but that would be a bigger overhaul of your design I think.
Spe... |
209,869 | <p>Some of my data are 64-bit integers. I would like to send these to a JavaScript program running on a page.</p>
<p>However, as far as I can tell, integers in most JavaScript implementations are 32-bit signed quantities.</p>
<p>My two options seem to be:</p>
<ol>
<li>Send the values as strings</li>
<li>Send the val... | [
{
"answer_id": 209877,
"author": "Javier",
"author_id": 11649,
"author_profile": "https://Stackoverflow.com/users/11649",
"pm_score": 0,
"selected": false,
"text": "<p>JSON itself doesn't care about implementation limits.\nyour problem is that JS can't handle your data, not the protocol.... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209869",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/338/"
] | Some of my data are 64-bit integers. I would like to send these to a JavaScript program running on a page.
However, as far as I can tell, integers in most JavaScript implementations are 32-bit signed quantities.
My two options seem to be:
1. Send the values as strings
2. Send the values as 64-bit floating point numb... | This seems to be less a problem with JSON and more a problem with Javascript itself. What are you planning to do with these numbers? If it's just a magic token that you need to pass back to the website later on, by all means simply use a string containing the value. If you actually have to do arithmetic on the value, y... |
209,874 | <p>New to javascript/jquery and having a hard time with using <code>this</code> or <code>$(this)</code> to get the current object.</p>
<p>I have a table with a set of <code>radio buttons</code> on each row, each named <code>s_<rowindex></code>. None of the radio buttons are checked by default:</p>
<pre><code>&l... | [
{
"answer_id": 209926,
"author": "MDCore",
"author_id": 1896,
"author_profile": "https://Stackoverflow.com/users/1896",
"pm_score": 0,
"selected": false,
"text": "<p>Here's some untested code, off the top of my head:</p>\n\n<pre><code>$(\"#div_s_0 input[type='radio']\").onclick = functio... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209874",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23585/"
] | New to javascript/jquery and having a hard time with using `this` or `$(this)` to get the current object.
I have a table with a set of `radio buttons` on each row, each named `s_<rowindex>`. None of the radio buttons are checked by default:
```
<tr>
<td align="left" style="width: 300px">
<div id="div_s_0">
... | This will get you the index, using the HTML you've provided:
```
$(document).ready(function() {
$("input:radio").click(function() {
var index = parseInt(this.name.split('_')[1])
});
});
```
Another thing that may help you: retrieving the number of rows in your table:
```
$($("table").children()[0]).... |
209,890 | <p>I'm looking for a regex that can pull out quoted sections in a string, both single and double quotes.</p>
<p>IE:</p>
<pre><code>"This is 'an example', \"of an input string\""
</code></pre>
<p>Matches:</p>
<ul>
<li>an example</li>
<li>of an input string</li>
</ul>
<p>I wrote up this:</p>
<pre><code> [\"|'][A-Za... | [
{
"answer_id": 209898,
"author": "Chris Bunch",
"author_id": 422,
"author_profile": "https://Stackoverflow.com/users/422",
"pm_score": 0,
"selected": false,
"text": "<p>It works but doesn't match other characters in quotes (e.g., non-alphanumeric, like binary or foreign language chars). ... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209890",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1965/"
] | I'm looking for a regex that can pull out quoted sections in a string, both single and double quotes.
IE:
```
"This is 'an example', \"of an input string\""
```
Matches:
* an example
* of an input string
I wrote up this:
```
[\"|'][A-Za-z0-9\\W]+[\"|']
```
It works but does anyone see any flaws with it?
EDIT... | How does it handle single quotes inside of double quotes (or vice versa)?
```
"This is 'an example', \"of 'quotes within quotes'\""
```
should match
* an example
* of 'quotes within quotes'
Use a backreference if you need to support this.
```
(\"|')[A-Za-z0-9\\W]+?\1
```
EDIT: Fixed to use a reluctant quantifie... |
209,924 | <p>My code for sql connection using linq is:</p>
<pre><code>var query1 = from u in dc.Usage_Computers
where u.DomainUser == s3
select u; // selects all feilds from table
GridView1.DataSource = query1;
GridView1.DataBind();
</code></pre>
<p>I have a field called "Operation" in the table "Domainuse... | [
{
"answer_id": 209944,
"author": "tvanfosson",
"author_id": 12950,
"author_profile": "https://Stackoverflow.com/users/12950",
"pm_score": 0,
"selected": false,
"text": "<p>I've done something similar using TemplateFields. Using an ASP:Label bound to the property and adding an OnPreRende... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | My code for sql connection using linq is:
```
var query1 = from u in dc.Usage_Computers
where u.DomainUser == s3
select u; // selects all feilds from table
GridView1.DataSource = query1;
GridView1.DataBind();
```
I have a field called "Operation" in the table "Domainuser" which has values like "... | This technique does not seem particularly applicable to your problem, but here it is anyway.
You can create a SQL case statement in LinqToSql by using the C# **? :** operator.
```
var query1 =
from u in dc.Usage_Computers
where u.DomainUser == s3
select new {usage = u,
operation =
u.DomainUser.Opera... |
209,935 | <p>I'm trying to set up a virtual host on a new VPS using apache 2.x on a Ubuntu server.</p>
<p>When starting apache I get the error " xxx.241.214.xxx:80 has no VirtualHosts", and the url for the site still points to the default location which means my virtual host file isn't taking effect:</p>
<pre><code><Virtual... | [
{
"answer_id": 209954,
"author": "Richard Harrison",
"author_id": 19624,
"author_profile": "https://Stackoverflow.com/users/19624",
"pm_score": 0,
"selected": false,
"text": "<p>I always use</p>\n\n<pre><code><VirtualHost *>\n</code></pre>\n\n<p>(and ISTR always having problems spe... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I'm trying to set up a virtual host on a new VPS using apache 2.x on a Ubuntu server.
When starting apache I get the error " xxx.241.214.xxx:80 has no VirtualHosts", and the url for the site still points to the default location which means my virtual host file isn't taking effect:
```
<VirtualHost xxx.241.214.xxx:80>... | I know its been a while since you posted your question but I thought id throw in my thoughts
We currently run a few internal sites here for different purposes, all of them listen of standard port 80 and apache is set up simply as follows
```
Listen 80
NameVirtualHost *:80
# Site 1 Comment
<VirtualHost *:80>
Serv... |
209,963 | <p>I've got a table of hardware and a table of incidents. Each hardware has a unique tag, and the incidents are tied to the tag.</p>
<p>How can I select all the hardware which has at least one incident listed as unresolved?</p>
<p>I can't just do a join, because then if one piece of hardware had multiple unresolved i... | [
{
"answer_id": 209967,
"author": "Richard Harrison",
"author_id": 19624,
"author_profile": "https://Stackoverflow.com/users/19624",
"pm_score": 4,
"selected": true,
"text": "<pre><code>select distinct(hardware_name) \nfrom hardware,incidents \nwhere hardware.id = incidents.hardware_id an... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18210/"
] | I've got a table of hardware and a table of incidents. Each hardware has a unique tag, and the incidents are tied to the tag.
How can I select all the hardware which has at least one incident listed as unresolved?
I can't just do a join, because then if one piece of hardware had multiple unresolved issues, it would s... | ```
select distinct(hardware_name)
from hardware,incidents
where hardware.id = incidents.hardware_id and incidents.resolved=0;
``` |
209,980 | <p>I have tried</p>
<pre><code><ul id="contact_list">
<li id="phone">Local 604-555-5555</li>
<li id="i18l_phone">Toll-Free 1-800-555-5555</li>
</ul>
</code></pre>
<p>with</p>
<pre><code>#contact_list
{
list-style: disc none inside;
}
#contact_list #phone
{
list-st... | [
{
"answer_id": 209994,
"author": "Eric Wendelin",
"author_id": 25066,
"author_profile": "https://Stackoverflow.com/users/25066",
"pm_score": 1,
"selected": false,
"text": "<p>Could you try adding list-style-type: none; to #contact-list? Perhaps even instead of your list-style: declaratio... | 2008/10/16 | [
"https://Stackoverflow.com/questions/209980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16398/"
] | I have tried
```
<ul id="contact_list">
<li id="phone">Local 604-555-5555</li>
<li id="i18l_phone">Toll-Free 1-800-555-5555</li>
</ul>
```
with
```
#contact_list
{
list-style: disc none inside;
}
#contact_list #phone
{
list-style-image: url(images/small_wood_phone.png);
}
#contact_list #i18l_phone... | First determine whether you are in "quirks" mode or not, because for many CSS properties it makes a difference.
Secondly, the W3c [specifies](http://www.w3.org/TR/CSS21/generate.html#propdef-list-style-image) that the URL should be in double quotes (although I don't use the quotes, either). Go with the spec to save yo... |
210,020 | <p>I have multiple threads (C# application running on IIS) running that all need to communicate with the same MQ backend. To minimize network traffic, I need to only send a backend request when there is work to be done. There will be one thread to monitor if there is work to be done, and it needs to notify the other ... | [
{
"answer_id": 210031,
"author": "Kent Boogaart",
"author_id": 5380,
"author_profile": "https://Stackoverflow.com/users/5380",
"pm_score": 3,
"selected": true,
"text": "<p>Check out <a href=\"http://msdn.microsoft.com/en-us/library/system.threading.waithandle.aspx\" rel=\"nofollow norefe... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210020",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4555/"
] | I have multiple threads (C# application running on IIS) running that all need to communicate with the same MQ backend. To minimize network traffic, I need to only send a backend request when there is work to be done. There will be one thread to monitor if there is work to be done, and it needs to notify the other threa... | Check out [WaitHandle](http://msdn.microsoft.com/en-us/library/system.threading.waithandle.aspx) and its descending classes. [EventWaitHandle](http://msdn.microsoft.com/en-us/library/system.threading.eventwaithandle.aspx) may suit your needs. |
210,026 | <p>I have some C++ source code with templates maybe like this - doxygen runs without errors but none of the documentation is added to the output, what is going on?</p>
<pre><code>///
/// A class
///
class A
{
///
/// A typedef
///
typedef B<C<D>> SomeTypedefOfTemplates;
};
</code></pre>
| [
{
"answer_id": 210043,
"author": "1800 INFORMATION",
"author_id": 3146,
"author_profile": "https://Stackoverflow.com/users/3146",
"pm_score": 3,
"selected": true,
"text": "<p>Yeah, so what is going on is the template instantiation is bogus. The \">>\" like that is ambiguous and is meant ... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3146/"
] | I have some C++ source code with templates maybe like this - doxygen runs without errors but none of the documentation is added to the output, what is going on?
```
///
/// A class
///
class A
{
///
/// A typedef
///
typedef B<C<D>> SomeTypedefOfTemplates;
};
``` | Yeah, so what is going on is the template instantiation is bogus. The ">>" like that is ambiguous and is meant to be a compile time error. You couldn't see it because maybe your compiler (VC++) let it slip by but I guess doxygen was stricter on that. Add a space like shown.
```
///
/// A class
///
class A
{
///
//... |
210,068 | <p>What's the shortest Perl one-liner that print out the first 9 powers of a hard-coded 2 digit decimal (say, for example, .37), each on its own line? </p>
<p>The output would look something like:</p>
<pre><code>1
0.37
0.1369
[etc.]
</code></pre>
<p>Official Perl golf rules:</p>
<ol>
<li>Smallest number of (key)st... | [
{
"answer_id": 210107,
"author": "willasaywhat",
"author_id": 12234,
"author_profile": "https://Stackoverflow.com/users/12234",
"pm_score": 0,
"selected": false,
"text": "<pre><code>perl -e \"for(my $i = 1; $i < 10; $i++){ print((.37**$i). \\\"\\n\\\"); }\"\n</code></pre>\n\n<p>Just a... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2683/"
] | What's the shortest Perl one-liner that print out the first 9 powers of a hard-coded 2 digit decimal (say, for example, .37), each on its own line?
The output would look something like:
```
1
0.37
0.1369
[etc.]
```
Official Perl golf rules:
1. Smallest number of (key)strokes wins
2. Your stroke count includes the... | With perl 5.10.0 and above:
```
perl -E'say 0.37**$_ for 0..8'
```
With older perls you don't have `say` and -E, but this works:
```
perl -le'print 0.37**$_ for 0..8'
```
Update: the first solution is made of 30 key strokes. Removing the first 0 gives 29. Another space can be saved, so my final solution is this w... |
210,069 | <p>In ASP.NET what's the best way to do the following:</p>
<ol>
<li>Show certain controls based on your rights?</li>
<li>For a gridview control, how do you show certain columns based on your role?</li>
</ol>
<p>I'm thinking for number 2, have the data come from a role specific view on the database.</p>
| [
{
"answer_id": 210117,
"author": "Elijah Manor",
"author_id": 4481,
"author_profile": "https://Stackoverflow.com/users/4481",
"pm_score": 4,
"selected": true,
"text": "<p>Instead of actually using roles to hide/show certain controls, I would suggest having another layer of permissions fo... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210069",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/781/"
] | In ASP.NET what's the best way to do the following:
1. Show certain controls based on your rights?
2. For a gridview control, how do you show certain columns based on your role?
I'm thinking for number 2, have the data come from a role specific view on the database. | Instead of actually using roles to hide/show certain controls, I would suggest having another layer of permissions for each role and show/hide based on those instead.
That way you can redefine what permissions a role has and won't have to change your code.
Also, this allows you to make new roles in the future and jus... |
210,080 | <p>I'm sure this one is easy but I've tried a ton of variations and still cant match what I need. The thing is being too greedy and I cant get it to stop being greedy.</p>
<p>Given the text:</p>
<pre><code>test=this=that=more text follows
</code></pre>
<p>I want to just select:</p>
<pre><code>test=
</code></pre>
... | [
{
"answer_id": 210102,
"author": "Owen",
"author_id": 4853,
"author_profile": "https://Stackoverflow.com/users/4853",
"pm_score": 5,
"selected": true,
"text": "<p>here:</p>\n\n<pre><code>// matches \"test=, test\"\n(\\S+?)=\n\nor\n\n// matches \"test=, test\" too\n(\\S[^=]+)=\n</code></p... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14230/"
] | I'm sure this one is easy but I've tried a ton of variations and still cant match what I need. The thing is being too greedy and I cant get it to stop being greedy.
Given the text:
```
test=this=that=more text follows
```
I want to just select:
```
test=
```
I've tried the following regex
```
(\S+)=(\S.*)
(\S+)... | here:
```
// matches "test=, test"
(\S+?)=
or
// matches "test=, test" too
(\S[^=]+)=
```
you should consider using the second version over the first. given your string `"test=this=that=more text follows"`, version 1 will match `test=this=that=` then continue parsing to the end of the string. it will then backtrac... |
210,088 | <p>I have a website that is deployed between 3 different environments - Dev, Stage, and Prod. For Stage and Prod, the site can resolve local paths to images with just the base url to the file, such as /SiteImages/banner.png. However, on the Dev server I have to hard code the full URL of the image path for the image to ... | [
{
"answer_id": 210102,
"author": "Owen",
"author_id": 4853,
"author_profile": "https://Stackoverflow.com/users/4853",
"pm_score": 5,
"selected": true,
"text": "<p>here:</p>\n\n<pre><code>// matches \"test=, test\"\n(\\S+?)=\n\nor\n\n// matches \"test=, test\" too\n(\\S[^=]+)=\n</code></p... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1284/"
] | I have a website that is deployed between 3 different environments - Dev, Stage, and Prod. For Stage and Prod, the site can resolve local paths to images with just the base url to the file, such as /SiteImages/banner.png. However, on the Dev server I have to hard code the full URL of the image path for the image to be ... | here:
```
// matches "test=, test"
(\S+?)=
or
// matches "test=, test" too
(\S[^=]+)=
```
you should consider using the second version over the first. given your string `"test=this=that=more text follows"`, version 1 will match `test=this=that=` then continue parsing to the end of the string. it will then backtrac... |
210,120 | <p>I have a symlink to an important directory. I want to get rid of that symlink, while keeping the directory behind it. </p>
<p>I tried <code>rm</code> and get back <code>rm: cannot remove 'foo'</code>.<br>
I tried <code>rmdir</code> and got back <code>rmdir: failed to remove 'foo': Directory not empty</code><br>
I ... | [
{
"answer_id": 210125,
"author": "Greg Hewgill",
"author_id": 893,
"author_profile": "https://Stackoverflow.com/users/893",
"pm_score": 3,
"selected": false,
"text": "<p>If rm cannot remove a symlink, perhaps you need to look at the permissions on the directory that contains the symlink.... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8508/"
] | I have a symlink to an important directory. I want to get rid of that symlink, while keeping the directory behind it.
I tried `rm` and get back `rm: cannot remove 'foo'`.
I tried `rmdir` and got back `rmdir: failed to remove 'foo': Directory not empty`
I then progressed through `rm -f`, `rm -rf` and `sudo rm -r... | ```
# this works:
rm foo
# versus this, which doesn't:
rm foo/
```
Basically, you need to tell it to delete a *file*, not delete a *directory*. I believe the difference between `rm` and `rmdir` exists because of differences in the way the C library treats each.
At any rate, the first should work, while the second sh... |
210,145 | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/144833/most-useful-attributes-in-c">Most Useful Attributes in C#</a> </p>
</blockquote>
<p>besides:</p>
<pre><code>[DefaultValue(100)]
[Description("Some descriptive field here")]
public int MyProperty{get; se... | [
{
"answer_id": 210154,
"author": "Greg D",
"author_id": 6932,
"author_profile": "https://Stackoverflow.com/users/6932",
"pm_score": 2,
"selected": false,
"text": "<pre><code>[Browsable]\n</code></pre>\n\n<p>is a favorite of mine. (<a href=\"http://msdn.microsoft.com/en-us/library/system.... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210145",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28717/"
] | >
> **Possible Duplicate:**
>
> [Most Useful Attributes in C#](https://stackoverflow.com/questions/144833/most-useful-attributes-in-c)
>
>
>
besides:
```
[DefaultValue(100)]
[Description("Some descriptive field here")]
public int MyProperty{get; set;}
```
What other C# Attributes are useful for Properties, ... | ```
[Obsolete("This is an obsolete property")]
```
That's one of my favourites. Allows you to mark a property/method obsolete, which will cause a compiler warning (optionally, a compiler error) on build. |
210,171 | <p>I guess the real question is: </p>
<p>If I don't care about dirty reads, will adding the <strong>with (NOLOCK)</strong> hint to a SELECT statement affect the performance of:</p>
<ol>
<li>the current SELECT statement </li>
<li>other transactions against the given table</li>
</ol>
<p>Example:</p>
<pre><code>Sele... | [
{
"answer_id": 210179,
"author": "StingyJack",
"author_id": 16391,
"author_profile": "https://Stackoverflow.com/users/16391",
"pm_score": 3,
"selected": false,
"text": "<p>It will be faster because it doesnt have to wait for locks</p>\n"
},
{
"answer_id": 210227,
"author": "t... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210171",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12424/"
] | I guess the real question is:
If I don't care about dirty reads, will adding the **with (NOLOCK)** hint to a SELECT statement affect the performance of:
1. the current SELECT statement
2. other transactions against the given table
Example:
```
Select *
from aTable with (NOLOCK)
``` | 1) **Yes**, a select with `NOLOCK` will complete faster than a normal select.
2) **Yes**, a select with `NOLOCK` will allow other queries against the effected table to complete faster than a normal select.
**Why would this be?**
`NOLOCK` typically (depending on your DB engine) means give me your data, and I don't c... |
210,178 | <p>Given the Below Tables. How do I get the Distinct name given the other ID of 76 in LINQ?</p>
<pre><code>**Table S**
SID OtherID
------------------------------
1 77
2 76
**Table Q**
QID SID HighLevelNAme LoweLevelName
---------------------------------------
10 1 Name1 Engi... | [
{
"answer_id": 210217,
"author": "Troy Howard",
"author_id": 19258,
"author_profile": "https://Stackoverflow.com/users/19258",
"pm_score": 4,
"selected": true,
"text": "<p>If you have the foreign key relationships defined in your database, and generated the LINQ classes via the designer,... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210178",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2469/"
] | Given the Below Tables. How do I get the Distinct name given the other ID of 76 in LINQ?
```
**Table S**
SID OtherID
------------------------------
1 77
2 76
**Table Q**
QID SID HighLevelNAme LoweLevelName
---------------------------------------
10 1 Name1 Engine
11 1 ... | If you have the foreign key relationships defined in your database, and generated the LINQ classes via the designer, then the joins should be represented in the object model, right? So each QItem has a property SItem? If not, I guess you can use the Join extension method for that part.
Anyhow, I didn't test this IRL,... |
210,180 | <p>I've noticed for quite a long time that strange domains such like jsev.com, cssxx.com appered in my firefox status bar from time to time, I always wonder why so many web pages contains resources from these strange domains. I googled it, but found nothing. I guess it's some kind of virus which infect the servers and ... | [
{
"answer_id": 210203,
"author": "mucit",
"author_id": 9609,
"author_profile": "https://Stackoverflow.com/users/9609",
"pm_score": 2,
"selected": false,
"text": "<p>It may be a browser worm installed on your machine. Should scan entire system.</p>\n"
},
{
"answer_id": 210212,
... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1925263/"
] | I've noticed for quite a long time that strange domains such like jsev.com, cssxx.com appered in my firefox status bar from time to time, I always wonder why so many web pages contains resources from these strange domains. I googled it, but found nothing. I guess it's some kind of virus which infect the servers and ins... | This happens if you are using one of Princeton university's CoDeeN project proxy servers. CoDeeN is an academic testbed content distribution network. When you browse a web page using CoDeeN proxy it injects some HTML code to the site's original HTML and redirects requests sent to pseudo adresses to the project's server... |
210,201 | <p>Can somebody remember what was the command to create an empty file in MSDOS using BAT file?</p>
| [
{
"answer_id": 210209,
"author": "TheSmurf",
"author_id": 1975282,
"author_profile": "https://Stackoverflow.com/users/1975282",
"pm_score": 9,
"selected": true,
"text": "<pre><code>echo. 2>EmptyFile.txt\n</code></pre>\n"
},
{
"answer_id": 211045,
"author": "ephemient",
... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/446104/"
] | Can somebody remember what was the command to create an empty file in MSDOS using BAT file? | ```
echo. 2>EmptyFile.txt
``` |
210,206 | <p>I have this regex I built and tested in regex buddy.</p>
<pre><code>"_ [ 0-9]{10}+ {1}+[ 0-9]{10}+ {2}+[ 0-9]{6}+ {2}[ 0-9]{2}"
</code></pre>
<p>When I use this in .Net C# </p>
<p>I receive the exception</p>
<pre><code>"parsing \"_ [ 0-9]{10}+ +[ 0-9]{10}+ +[ 0-9]{6}+ [ 0-9]{2}\" - Nested quantifier +."
</code... | [
{
"answer_id": 210243,
"author": "Duncan",
"author_id": 25035,
"author_profile": "https://Stackoverflow.com/users/25035",
"pm_score": 5,
"selected": true,
"text": "<p>.NET is complaining about the <code>+</code> after the <code>{n}</code> style quantifier as it doesn't make any sense. <... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6161/"
] | I have this regex I built and tested in regex buddy.
```
"_ [ 0-9]{10}+ {1}+[ 0-9]{10}+ {2}+[ 0-9]{6}+ {2}[ 0-9]{2}"
```
When I use this in .Net C#
I receive the exception
```
"parsing \"_ [ 0-9]{10}+ +[ 0-9]{10}+ +[ 0-9]{6}+ [ 0-9]{2}\" - Nested quantifier +."
```
What does this error mean? Apparently .net d... | .NET is complaining about the `+` after the `{n}` style quantifier as it doesn't make any sense. `{n}` means match exactly n of a given group. `+` means match one or more of a given group. Remove the `+`'s and it'll compile fine.
```
"_ [ 0-9]{10} {1}[ 0-9]{10} {2}[ 0-9]{6} {2}[ 0-9]{2}"
``` |
210,256 | <p>I have an XML document, and contained within one of the nodes, I have <code><li></code> tags. I don't need <code><ul></ul></code> tags for Flash because it only accepts <code><li></code> tags anyway. For example, here's part of the XML doc:</p>
<pre><code><node>
<li>item1</li... | [
{
"answer_id": 210252,
"author": "StingyJack",
"author_id": 16391,
"author_profile": "https://Stackoverflow.com/users/16391",
"pm_score": 7,
"selected": true,
"text": "<p>open project properties, go to the web tab and choose the option for IIS.</p>\n\n<p>That actually starts an instance ... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210256",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/557/"
] | I have an XML document, and contained within one of the nodes, I have `<li>` tags. I don't need `<ul></ul>` tags for Flash because it only accepts `<li>` tags anyway. For example, here's part of the XML doc:
```
<node>
<li>item1</li>
<li>item2</li>
</node>
```
I want to put all the data within the `<node>` tags, *... | open project properties, go to the web tab and choose the option for IIS.
That actually starts an instance of the app in IIS and attaches the debugger. If you only wanted to attach to an existing IIS instance, choose attach to process from the debug menu. |
210,261 | <p>I'm debugging a Cocoa application that can act as a handler to a custom URL protocol. The application works fine when I click on a link after the application has launched, but something is causing the app to crash if it has not launched at the time the link is clicked.</p>
<p>Is there any way that I can start the a... | [
{
"answer_id": 210457,
"author": "Andy",
"author_id": 3857,
"author_profile": "https://Stackoverflow.com/users/3857",
"pm_score": 0,
"selected": false,
"text": "<p>Could you attach to your process from XCode once the URL handler has been invoked? You could try putting a modal NSAlert in ... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26628/"
] | I'm debugging a Cocoa application that can act as a handler to a custom URL protocol. The application works fine when I click on a link after the application has launched, but something is causing the app to crash if it has not launched at the time the link is clicked.
Is there any way that I can start the app in the ... | You can do
```
gdb --wait myAppName
```
and then click on the link to launch your app. This will cause your app to break into the debugger very, very early, before main has started. |
210,266 | <p>In the Java code I'm working with we have an interface to define our Data Access Objects(DAO). Most of the methods take a parameter of a Data Transfer Object (DTO). The problem occurs when an implementation of the DAO needs to refer to a specific type of DTO. The method then needs to do a (to me completely unnecessa... | [
{
"answer_id": 210282,
"author": "johnstok",
"author_id": 27929,
"author_profile": "https://Stackoverflow.com/users/27929",
"pm_score": 4,
"selected": false,
"text": "<p>You could use generics:</p>\n\n<pre><code>DAO<SpecificDTO> dao = new SpecificDAO();\ndao.save(new SpecificDTO())... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | In the Java code I'm working with we have an interface to define our Data Access Objects(DAO). Most of the methods take a parameter of a Data Transfer Object (DTO). The problem occurs when an implementation of the DAO needs to refer to a specific type of DTO. The method then needs to do a (to me completely unnecessary ... | You could use generics:
```
DAO<SpecificDTO> dao = new SpecificDAO();
dao.save(new SpecificDTO());
etc.
```
Your DAO class would look like:
```
interface DAO<T extends DTO> {
void save(T);
}
class SpecificDAO implements DAO<SpecificDTO> {
void save(SpecificDTO) {
// implementation.
}
// etc... |
210,296 | <p>I've got a website that has windows authentication enable on it. From a page in the website, the users have the ability to start a service that does some stuff with the database.</p>
<p>It works fine for me to start the service because I'm a local admin on the server. But I just had a user test it and they can't ge... | [
{
"answer_id": 210813,
"author": "Rich",
"author_id": 28442,
"author_profile": "https://Stackoverflow.com/users/28442",
"pm_score": 1,
"selected": false,
"text": "<p>You can try using ASP.NET impersonation in your web.config file and specify a user account that has the appropriate permis... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210296",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21828/"
] | I've got a website that has windows authentication enable on it. From a page in the website, the users have the ability to start a service that does some stuff with the database.
It works fine for me to start the service because I'm a local admin on the server. But I just had a user test it and they can't get the serv... | *Note: This doesn't address enumerating services as a different user, but given the broader description of what you're doing, I think it's a good answer.*
I think you can simplify this a lot, and possibly avoid part of the security problem, if you go directly to the service of interest. Instead of calling GetServices,... |
210,342 | <p>I have a html page open on my webbrowser object, I can enter username and password okay, but I'm stuck and don't know how to submit the info. Here is the html code for the username/password submit:</p>
<pre><code><div id="signin">
<h2 class="ir">
<em></em>Sign in</h2>
... | [
{
"answer_id": 210453,
"author": "cdeszaq",
"author_id": 20770,
"author_profile": "https://Stackoverflow.com/users/20770",
"pm_score": 0,
"selected": false,
"text": "<p>You could try giving an ID to the form, in order to get ahold of it, and then call form.submit() from a Javascript call... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have a html page open on my webbrowser object, I can enter username and password okay, but I'm stuck and don't know how to submit the info. Here is the html code for the username/password submit:
```
<div id="signin">
<h2 class="ir">
<em></em>Sign in</h2>
<form action="/login/" method="post">
<in... | `WebBrowser1.Document.GetElementById(*element id string*).InvokeMember("submit")` |
210,344 | <p>I just installed the first release candidate of Python 3.0 and got this error after typing:</p>
<pre><code>>>> help('modules foo')
</code></pre>
<pre>[...]
LookupError: unknown encoding: uft-8</pre>
<p>Notice that it says <strong>uft</strong>-8 and not <strong>utf</strong>-8</p>
<p>Is this a py3k specif... | [
{
"answer_id": 210395,
"author": "Dan Lenski",
"author_id": 20789,
"author_profile": "https://Stackoverflow.com/users/20789",
"pm_score": 0,
"selected": false,
"text": "<p>Looks like a typo in a config file somewhere, whether in the Py3k package or on your machine. You might try install... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23002/"
] | I just installed the first release candidate of Python 3.0 and got this error after typing:
```
>>> help('modules foo')
```
```
[...]
LookupError: unknown encoding: uft-8
```
Notice that it says **uft**-8 and not **utf**-8
Is this a py3k specific bug or a misconfiguration on my part? I do not have any other versio... | It's not a typo, it's a deliberate error in a test module.
```
met% pwd
/home/coventry/src/Python-3.0rc1
met% rgrep uft-8 .
./Lib/test/bad_coding.py:# -*- coding: uft-8 -*-
./py3k/Lib/test/bad_coding.py:# -*- coding: uft-8 -*-
```
Removing this module causes the `help` command to fall over in a different way.
It is... |
210,353 | <p>I have a class that compares 2 instances of the same objects, and generates a list of their differences. This is done by looping through the key collections and filling a set of other collections with a list of what has changed (this may make more sense after viewing the code below). This works, and generates an o... | [
{
"answer_id": 210361,
"author": "Jon Skeet",
"author_id": 22656,
"author_profile": "https://Stackoverflow.com/users/22656",
"pm_score": 3,
"selected": false,
"text": "<p>Are you using .NET 3.5? I'm sure LINQ to Objects would make a lot of this <em>much</em> simpler.</p>\n\n<p>Another th... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210353",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18449/"
] | I have a class that compares 2 instances of the same objects, and generates a list of their differences. This is done by looping through the key collections and filling a set of other collections with a list of what has changed (this may make more sense after viewing the code below). This works, and generates an object... | Are you using .NET 3.5? I'm sure LINQ to Objects would make a lot of this *much* simpler.
Another thing to think about is that if you've got a lot of code with a common pattern, where just a few things change (e.g. "which property am I comparing?" then that's a good candidate for a generic method taking a delegate to ... |
210,354 | <p>I have a .net web-service hosted in IIS 6.0 that periodically fails with an http 500 because a client connects to it with data that does not match the wsdl.</p>
<p>Things like having an element specified in a method as being of type int and the inbound xml element contains a decimal number.</p>
<p>WSDL element def... | [
{
"answer_id": 210445,
"author": "Tony Lee",
"author_id": 5819,
"author_profile": "https://Stackoverflow.com/users/5819",
"pm_score": 2,
"selected": false,
"text": "<p>I'd try <a href=\"http://msdn.microsoft.com/en-us/library/bb250446(VS.85).aspx\" rel=\"nofollow noreferrer\">fiddler</a>... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2660/"
] | I have a .net web-service hosted in IIS 6.0 that periodically fails with an http 500 because a client connects to it with data that does not match the wsdl.
Things like having an element specified in a method as being of type int and the inbound xml element contains a decimal number.
WSDL element definition:
```
<s:... | You could implement a global exception handler in your web service that logs the details of any exceptions that occur. This is useful for your current problem, plus it's very useful in a production environment as it gives you an insight into how many exceptions are being thrown and by what code.
To implement an except... |
210,359 | <p>I have a <code>textbox</code> whose input is being handled by jQuery.</p>
<pre><code>$('input.Search').bind("keyup", updateSearchTextbox);
</code></pre>
<p>When I press <code>Enter</code> in the textbox, I get a postback, which messes everything up. How can I trap that Enter and ignore it?</p>
<p>(Just to preempt... | [
{
"answer_id": 210366,
"author": "FlySwat",
"author_id": 1965,
"author_profile": "https://Stackoverflow.com/users/1965",
"pm_score": 5,
"selected": true,
"text": "<p>Your browser is automatically submitting the form when you press enter. To cancel this, add return false to your updateSea... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210359",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/239663/"
] | I have a `textbox` whose input is being handled by jQuery.
```
$('input.Search').bind("keyup", updateSearchTextbox);
```
When I press `Enter` in the textbox, I get a postback, which messes everything up. How can I trap that Enter and ignore it?
(Just to preempt one possible suggestion: The textbox has to be an `<as... | Your browser is automatically submitting the form when you press enter. To cancel this, add return false to your updateSearchTextBox function.
if that doesn't work, try this:
```
<script language="JavaScript">
function disableEnterKey(e)
{
var key;
if(window.event)
key = window.event.keyCode... |
210,371 | <p>I've had success with <a href="http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/" rel="nofollow noreferrer">LuaSocket</a>'s TCP facility, but I'm having trouble with its FTP module. I always get a timeout when trying to retrieve a (small) file. I can download the file just fine using Firefox or ftp in p... | [
{
"answer_id": 214462,
"author": "Anders Eurenius",
"author_id": 1421,
"author_profile": "https://Stackoverflow.com/users/1421",
"pm_score": 3,
"selected": true,
"text": "<p>Hm. It looks like the problem is that LuaSocket uses \"pasv\" in lower case. I'm going try to figure out a work-ar... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210371",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4323/"
] | I've had success with [LuaSocket](http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/)'s TCP facility, but I'm having trouble with its FTP module. I always get a timeout when trying to retrieve a (small) file. I can download the file just fine using Firefox or ftp in passive mode (on Ubuntu Dapper Linux).
I t... | Hm. It looks like the problem is that LuaSocket uses "pasv" in lower case. I'm going try to figure out a work-around.
---
Hm. Nope, it looks quite elegantly welded shut. The easiest thing to do is probably to copy *that particular file* to its equivalent place in a hierarchy in an earlier path in LUA\_PATH. That is, ... |
210,375 | <p>I have been attempting to write some routines to read RSS and ATOM feeds using the new routines available in System.ServiceModel.Syndication, but unfortunately the Rss20FeedFormatter bombs out on about half the feeds I try with the following exception:</p>
<blockquote>
<pre><code>An error was encountered when parsi... | [
{
"answer_id": 215936,
"author": "smaclell",
"author_id": 22914,
"author_profile": "https://Stackoverflow.com/users/22914",
"pm_score": 2,
"selected": false,
"text": "<p>Interesting. It would looks like the datetime formatting is not one of the ones naturally expected by the datetime par... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4253/"
] | I have been attempting to write some routines to read RSS and ATOM feeds using the new routines available in System.ServiceModel.Syndication, but unfortunately the Rss20FeedFormatter bombs out on about half the feeds I try with the following exception:
>
>
> ```
> An error was encountered when parsing a DateTime val... | RSS 2.0 formatted syndication feeds utilize the [RFC 822 date-time specification](http://www.w3.org/Protocols/rfc822/#z28) when serializing elements like *pubDate* and *lastBuildDate*. The RFC 822 date-time specification is unfortunately a very 'flexible' syntax for expressing the time-zone component of a DateTime.
*T... |
210,383 | <p>If I have a VB.Net function that returns an Int32, but uses an unsigned int (UInt32) for calculations, etc. How can I convert a variable "MyUintVar32" with a value of say "3392918397 into a standard Int32 in VB.Net? </p>
<p>In c# if I just do a "return (int)(MyUintVar32);", I get -902048899, not an error.</p>
<p... | [
{
"answer_id": 210401,
"author": "Juanma",
"author_id": 3730,
"author_profile": "https://Stackoverflow.com/users/3730",
"pm_score": 2,
"selected": false,
"text": "<p>It's not an optimal solution, but you can use BitConverter to get a byte array from the uint and convert the byte array to... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | If I have a VB.Net function that returns an Int32, but uses an unsigned int (UInt32) for calculations, etc. How can I convert a variable "MyUintVar32" with a value of say "3392918397 into a standard Int32 in VB.Net?
In c# if I just do a "return (int)(MyUintVar32);", I get -902048899, not an error.
I've tried several... | I realize this is an old post, but the question has not been answered. Other people my want to know:
```
Dim myUInt32 As UInt32 = 3392918397
Dim myInt32 As Int32 = Convert.ToInt32(myUInt32.ToString("X"), 16)
```
the reverse operation:
```
myUInt32 = Convert.ToUInt32(myInt32.ToString("X"), 16)
```
Also, one c... |
210,397 | <p>I want to get other process' argv like ps.</p>
<p>I'm using Mac OS X 10.4.11 running on Intel or PowerPC.</p>
<p>First, I read code of ps and man kvm, then I wrote some C code.</p>
<pre><code>#include <kvm.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/sysctl... | [
{
"answer_id": 210407,
"author": "JamesSugrue",
"author_id": 1075,
"author_profile": "https://Stackoverflow.com/users/1075",
"pm_score": 3,
"selected": true,
"text": "<p>Have you <a href=\"http://hubpages.com/hub/Interop_Forms_Toolkit_10\" rel=\"nofollow noreferrer\">looked at this?</a> ... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210397",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28720/"
] | I want to get other process' argv like ps.
I'm using Mac OS X 10.4.11 running on Intel or PowerPC.
First, I read code of ps and man kvm, then I wrote some C code.
```
#include <kvm.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/sysctl.h>
#include <paths.h>
int
main(void) {
char errbu... | Have you [looked at this?](http://hubpages.com/hub/Interop_Forms_Toolkit_10) Direct Link to [Product here](http://msdn.microsoft.com/en-us/vbasic/bb419144.aspx) |
210,428 | <p>Is it possible to somehow mark a <code>System.Array</code> as immutable. When put behind a public-get/private-set they can't be added to, since it requires re-allocation and re-assignment, but a consumer can still set any subscript they wish:</p>
<pre><code>public class Immy
{
public string[] { get; private se... | [
{
"answer_id": 210441,
"author": "Matt",
"author_id": 2338,
"author_profile": "https://Stackoverflow.com/users/2338",
"pm_score": 2,
"selected": false,
"text": "<p>I believe best practice is to use <code>IList<></code> rather than arrays in public APIs for this exact reason. <stron... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210428",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9642/"
] | Is it possible to somehow mark a `System.Array` as immutable. When put behind a public-get/private-set they can't be added to, since it requires re-allocation and re-assignment, but a consumer can still set any subscript they wish:
```
public class Immy
{
public string[] { get; private set; }
}
```
I thought the... | [`ReadOnlyCollection<T>`](http://msdn.microsoft.com/en-us/library/ms132474) is probably what you are looking for. It doesn't have an `Add()` method. |
210,446 | <p>The client connects to the server using GenuineChannels (we are considering switching to DotNetRemoting). What I mean by find is obtain the IP and port number of a server to connect to.</p>
<p>It seems like a brute-force approach would be try every IP on the network try the active ports (not even sure if that's po... | [
{
"answer_id": 210462,
"author": "Ovidiu Pacurar",
"author_id": 28419,
"author_profile": "https://Stackoverflow.com/users/28419",
"pm_score": 2,
"selected": false,
"text": "<p>Have the server listen for broadcast on a specific port on the network (must use UDP), When client starts have i... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210446",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23822/"
] | The client connects to the server using GenuineChannels (we are considering switching to DotNetRemoting). What I mean by find is obtain the IP and port number of a server to connect to.
It seems like a brute-force approach would be try every IP on the network try the active ports (not even sure if that's possible) but... | Consider broadcasting a specific UDP packet. When the server or servers see the broadcasted UDP packet they send a reply. The client can collect the replies from all the servers and start connecting to them or based on an election algorithm.
See example for client (**untested code**):
---
```
using System.Net;
using... |
210,460 | <p>How can polymorphism be described in an easy-to-understand way?</p>
<p>We can find a lot of information about the subject on the Internet and books, like in <em><a href="http://en.wikipedia.org/wiki/Type_polymorphism" rel="noreferrer">Type polymorphism</a></em>. But let's try to make it as simple as we can.</p>
| [
{
"answer_id": 210472,
"author": "Craig",
"author_id": 27294,
"author_profile": "https://Stackoverflow.com/users/27294",
"pm_score": 0,
"selected": false,
"text": "<p>The way I try and think of it is something that looks the same but can have different functionality depending on the inst... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1409636/"
] | How can polymorphism be described in an easy-to-understand way?
We can find a lot of information about the subject on the Internet and books, like in *[Type polymorphism](http://en.wikipedia.org/wiki/Type_polymorphism)*. But let's try to make it as simple as we can. | This is from my [answer](https://stackoverflow.com/questions/154577/polymorphism-vs-overriding-vs-overloading#154628) from a similiar question. Here's an example of polymorphism in pseudo-C#/Java:
```
class Animal
{
abstract string MakeNoise ();
}
class Cat : Animal {
string MakeNoise () {
return "Meo... |
210,470 | <p>Anyone know a QR decoder that works on mac or that might be online? I just need to decode one single image.</p>
| [
{
"answer_id": 22144524,
"author": "clt60",
"author_id": 632407,
"author_profile": "https://Stackoverflow.com/users/632407",
"pm_score": 4,
"selected": true,
"text": "<p>Unfortunately, the most used library <a href=\"http://trac.koka-in.org/libdecodeqr\" rel=\"noreferrer\">libdecodeqr</a... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210470",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26004/"
] | Anyone know a QR decoder that works on mac or that might be online? I just need to decode one single image. | Unfortunately, the most used library [libdecodeqr](http://trac.koka-in.org/libdecodeqr) is depends on OpenCV (gtk2) and it is too hard to compile it on OS X. (Tried to compile it because it is needed by `Image::DecodeQR` perl module - but unsuccessful).
Fortunately, found this link: <http://macscripter.net/viewtopic.p... |
210,496 | <p>I continue to get this error:</p>
<pre><code>Object '%s' cannot be renamed because the object participates in enforced dependencies
</code></pre>
<p>I need to find a script that will help me to find all the dependencies that there is with this table. I will need to drop them, rename, then bring them back.</p>
<p>... | [
{
"answer_id": 210512,
"author": "Craig",
"author_id": 27294,
"author_profile": "https://Stackoverflow.com/users/27294",
"pm_score": 3,
"selected": true,
"text": "<p>To disable all contraints</p>\n\n<pre><code>sp_msforeachtable \"ALTER TABLE ? NOCHECK CONSTRAINT all\"\ngo\nsp_msforeachta... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210496",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7952/"
] | I continue to get this error:
```
Object '%s' cannot be renamed because the object participates in enforced dependencies
```
I need to find a script that will help me to find all the dependencies that there is with this table. I will need to drop them, rename, then bring them back.
SQL Server 2005 | To disable all contraints
```
sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"
go
sp_msforeachtable "ALTER TABLE ? DISABLE TRIGGER all"
go
```
To Re-enable
```
sp_msforeachtable"ALTER TABLE ? CHECK CONSTRAINT all"
go
sp_msforeachtable "ALTER TABLE ? ENABLE TRIGGER all"
go
```
You should easily be able t... |
210,504 | <p>I'm creating an alt-tab replacement for Vista but I have some problems listing all active programs.</p>
<p>I'm using EnumWindows to get a list of Windows, but this list is huge. It contains about 400 items when I only have 10 windows open. It seems to be a hwnd for every single control and a lot of other stuff.</p>... | [
{
"answer_id": 210519,
"author": "Michael Burr",
"author_id": 12711,
"author_profile": "https://Stackoverflow.com/users/12711",
"pm_score": 5,
"selected": false,
"text": "<p>Raymond Chen answered this a while back<br>\n(<a href=\"https://devblogs.microsoft.com/oldnewthing/20071008-00/?p=... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210504",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I'm creating an alt-tab replacement for Vista but I have some problems listing all active programs.
I'm using EnumWindows to get a list of Windows, but this list is huge. It contains about 400 items when I only have 10 windows open. It seems to be a hwnd for every single control and a lot of other stuff.
So I have to... | Raymond Chen answered this a while back
(<https://devblogs.microsoft.com/oldnewthing/20071008-00/?p=24863>):
>
> It's actually pretty simple although
> hardly anything you'd be able to guess
> on your own. Note: The details of this
> algorithm are an implementation
> detail. It can change at any time, so
> do... |
210,506 | <p>This may not be possible, but I figured I'd ask...</p>
<p>Is there any way anyone can think of to track whether or not an automatic variable has been deleted without modifying the class of the variable itself? For example, consider this code:</p>
<pre><code>const char* pStringBuffer;
{
std::string sString( "fo... | [
{
"answer_id": 210593,
"author": "Henk",
"author_id": 4613,
"author_profile": "https://Stackoverflow.com/users/4613",
"pm_score": 0,
"selected": false,
"text": "<p>One technique you may find useful is to replace the <code>new</code>/<code>delete</code> operators with your own implementat... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26240/"
] | This may not be possible, but I figured I'd ask...
Is there any way anyone can think of to track whether or not an automatic variable has been deleted without modifying the class of the variable itself? For example, consider this code:
```
const char* pStringBuffer;
{
std::string sString( "foo" );
pStringBuff... | In general, it's simply not possible from within C++ as pointers are too 'raw'. Also, looking to see if you were allocated later than the referenced class wouldn't work, because if you change the string, then the c\_str pointer may well change.
In this particular case, you could check to see if the string is still ret... |
210,509 | <p>I have a bunch of records in several tables in a database that have a "process number" field, that's basically a number, but I have to store it as a string both because of some legacy data that has stuff like "89a" as a number and some numbering system that requires that process numbers be represented as number/year... | [
{
"answer_id": 210521,
"author": "Paolo Bergantino",
"author_id": 16417,
"author_profile": "https://Stackoverflow.com/users/16417",
"pm_score": 1,
"selected": false,
"text": "<p><a href=\"http://blog.feedmarker.com/2006/02/01/how-to-do-natural-alpha-numeric-sort-in-mysql/\" rel=\"nofollo... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2841/"
] | I have a bunch of records in several tables in a database that have a "process number" field, that's basically a number, but I have to store it as a string both because of some legacy data that has stuff like "89a" as a number and some numbering system that requires that process numbers be represented as number/year.
... | [Maybe this will help.](http://blog.feedmarker.com/2006/02/01/how-to-do-natural-alpha-numeric-sort-in-mysql/)
Essentially:
```
SELECT process_order FROM your_table ORDER BY process_order + 0 ASC
``` |
210,515 | <p>Assume a table with the following columns:</p>
<p><code>pri_id</code>, <code>item_id</code>, <code>comment</code>, <code>date</code></p>
<p>What I want to have is a SQL query that will delete any records, for a specific <code>item_id</code> that are older than a given date, BUT only as long as there are more than ... | [
{
"answer_id": 210532,
"author": "Robert C. Barth",
"author_id": 9209,
"author_profile": "https://Stackoverflow.com/users/9209",
"pm_score": 4,
"selected": true,
"text": "<p>Something like this should work for you:</p>\n\n<pre><code>delete\nfrom\n MyTable\nwhere\n item_id in\n (\n ... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14230/"
] | Assume a table with the following columns:
`pri_id`, `item_id`, `comment`, `date`
What I want to have is a SQL query that will delete any records, for a specific `item_id` that are older than a given date, BUT only as long as there are more than 15 rows for that `item_id`.
This will be used to purge out comment reco... | Something like this should work for you:
```
delete
from
MyTable
where
item_id in
(
select
item_id
from
MyTable
group by
item_id
having
count(item_id) > 15
)
and
Date < @tDate
``` |
210,518 | <p>What do I use to search for multiple words in a string? I would like the logical operation to be AND so that all the words are in the string somewhere. I have a bunch of nonsense paragraphs and one plain English paragraph, and I'd like to narrow it down by specifying a couple common words like, "the" and "and", bu... | [
{
"answer_id": 210538,
"author": "Jonathan Leffler",
"author_id": 15168,
"author_profile": "https://Stackoverflow.com/users/15168",
"pm_score": 0,
"selected": false,
"text": "<p>Assuming PCRE (Perl regexes), I am not sure that you can do it at all easily. The AND operation is concatenat... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13611/"
] | What do I use to search for multiple words in a string? I would like the logical operation to be AND so that all the words are in the string somewhere. I have a bunch of nonsense paragraphs and one plain English paragraph, and I'd like to narrow it down by specifying a couple common words like, "the" and "and", but wou... | Maybe using a [language recognition chart](http://en.wikipedia.org/wiki/Wikipedia:Language_recognition_chart#English) to recognize english would work. Some quick tests seem to work (this assumes paragraphs separated by newlines only).
The regexp will match one of any of those conditions... \bword\b is word separated b... |
210,522 | <p>I'm building a code in which I'd like to be able to generate an event when the user changes the focus of the cursor from an Entry widget to anywhere, for example another entry widget, a button...</p>
<p>So far i only came out with the idea to bind to TAB and mouse click, although if i bind the mouse click to the Ent... | [
{
"answer_id": 211283,
"author": "monkut",
"author_id": 24718,
"author_profile": "https://Stackoverflow.com/users/24718",
"pm_score": 0,
"selected": false,
"text": "<p>This isn't specific to tkinter, and it's not focus based, but I got an answer to a similar question here:</p>\n\n<p><a h... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I'm building a code in which I'd like to be able to generate an event when the user changes the focus of the cursor from an Entry widget to anywhere, for example another entry widget, a button...
So far i only came out with the idea to bind to TAB and mouse click, although if i bind the mouse click to the Entry widget... | The events <FocusIn> and <FocusOut> are what you want. Run the following example and you'll see you get focus in and out bindings whether you click or press tab (or shift-tab) when focus is in one of the entry widgets.
```
from Tkinter import *
def main():
global text
root=Tk()
l1=Label(root,text="Field... |
210,547 | <p>I have some source files that have comments written in Japanese. When I open these files in Visual Studio they appear like this:</p>
<pre><code>à–¾FNCAP‰¹—p‚̃XƒŒƒbƒh
</code></pre>
<p>I am using the English version of WinXP, but is there a way to get Visual Studio to display the actual Japanese characters rather t... | [
{
"answer_id": 210555,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 4,
"selected": true,
"text": "<p>Presumably VS is interpreting the file with the wrong encoding.</p>\n\n<p>Reopen it using \"File -> Open -> File... -> Open ... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210547",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2045/"
] | I have some source files that have comments written in Japanese. When I open these files in Visual Studio they appear like this:
```
à–¾FNCAP‰¹—p‚̃XƒŒƒbƒh
```
I am using the English version of WinXP, but is there a way to get Visual Studio to display the actual Japanese characters rather than the random jibberish i... | Presumably VS is interpreting the file with the wrong encoding.
Reopen it using "File -> Open -> File... -> Open -> Open With... -> Source Code (Text) Editor With Encoding" and try various encodings. |
210,564 | <p>Is there a way to get the raw SQL string executed when calling PDOStatement::execute() on a prepared statement? For debugging purposes this would be extremely useful.</p>
| [
{
"answer_id": 210586,
"author": "Glass Robot",
"author_id": 1745,
"author_profile": "https://Stackoverflow.com/users/1745",
"pm_score": 3,
"selected": false,
"text": "<p>PDOStatement has a public property $queryString. It should be what you want.</p>\n\n<p>I've just notice that PDOState... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5291/"
] | Is there a way to get the raw SQL string executed when calling PDOStatement::execute() on a prepared statement? For debugging purposes this would be extremely useful. | I assume you mean that you want the final SQL query, with parameter values interpolated into it. I understand that this would be useful for debugging, but it is not the way prepared statements work. Parameters are not combined with a prepared statement on the client-side, so PDO should never have access to the query st... |
210,590 | <p>Why is it that <code>scanf()</code> needs the <code>l</code> in "<code>%lf</code>" when reading a <code>double</code>, when <code>printf()</code> can use "<code>%f</code>" regardless of whether its argument is a <code>double</code> or a <code>float</code>?</p>
<p>Example code:</p>
<pre><code>double d;
scanf("%lf",... | [
{
"answer_id": 210591,
"author": "MSN",
"author_id": 6210,
"author_profile": "https://Stackoverflow.com/users/6210",
"pm_score": 9,
"selected": true,
"text": "<p>Because C will promote floats to doubles for functions that take variable arguments. Pointers aren't promoted to anything, so ... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210590",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7598/"
] | Why is it that `scanf()` needs the `l` in "`%lf`" when reading a `double`, when `printf()` can use "`%f`" regardless of whether its argument is a `double` or a `float`?
Example code:
```
double d;
scanf("%lf", &d);
printf("%f", d);
``` | Because C will promote floats to doubles for functions that take variable arguments. Pointers aren't promoted to anything, so you should be using `%lf`, `%lg` or `%le` (or `%la` in C99) to read in doubles. |
210,601 | <p>In C#, what is the best way to access a property of the derived class when the generic list contains just the base class.</p>
<pre><code>public class ClassA : BaseClass
{
public object PropertyA { get; set; }
}
public class ClassB: BaseClass
{
public object PropertyB { get; set; }
}
public class BaseClass
... | [
{
"answer_id": 210610,
"author": "Adam Wright",
"author_id": 1200,
"author_profile": "https://Stackoverflow.com/users/1200",
"pm_score": 1,
"selected": false,
"text": "<p>The whole premise doesn't make sense - what would PropertyB be for the a instance?</p>\n\n<p>You can do this if you d... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210601",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26327/"
] | In C#, what is the best way to access a property of the derived class when the generic list contains just the base class.
```
public class ClassA : BaseClass
{
public object PropertyA { get; set; }
}
public class ClassB: BaseClass
{
public object PropertyB { get; set; }
}
public class BaseClass
{
}
public vo... | Certainly you can downcast, like so:
```
for (int i = 0; i < MyList.Count; i++)
{
if (MyList[i] is ClassA)
{
var a = ((ClassA)MyList[i]).PropertyA;
// do stuff with a
}
if (MyList[i] is ClassB)
{
var b = ((ClassB)MyList[i]).PropertyB;
// do stuff with b
}
}
```... |
210,606 | <p>Is there a way to invoke an external script or batch file from VC6 (and later) project files?</p>
<p>I have a background process that I need to kill before attempting to build certain projects (DLLS, executables) and haven't found a way to successfully do so from the project itself. I'd like simply to call a batch... | [
{
"answer_id": 210624,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 0,
"selected": false,
"text": "<p>You could invoke it from a <a href=\"http://msdn.microsoft.com/en-us/library/e85wte0k(VS.80).aspx\" rel=\"nofollow noreferr... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Is there a way to invoke an external script or batch file from VC6 (and later) project files?
I have a background process that I need to kill before attempting to build certain projects (DLLS, executables) and haven't found a way to successfully do so from the project itself. I'd like simply to call a batch file with ... | You can create a utility project (configuration type: Utility in the project property pages) that has a post build event. You then call the batch file from that Post-Build event. If I remember correctly, utility configuration appeared in VS2005. But I believe the same can be achieved with another type of configuration ... |
210,607 | <p>I would like to know many minutes between 2 dates?</p>
<p>Example : Now - tommorow at the exact time would return me 1440.</p>
| [
{
"answer_id": 210609,
"author": "FlySwat",
"author_id": 1965,
"author_profile": "https://Stackoverflow.com/users/1965",
"pm_score": 3,
"selected": false,
"text": "<p>Look at the TimeSpan class.</p>\n\n<pre><code> DateTime date1 = DateTime.Now;\n DateTime date2 = DateTime.N... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14441/"
] | I would like to know many minutes between 2 dates?
Example : Now - tommorow at the exact time would return me 1440. | ```
DateTime dt1 = DateTime.Now;
DateTime dt2 = DateTime.Now.AddDays(1);
int diff = dt2.Subtract(dt1).TotalMinutes;
``` |
210,616 | <p>I'm reading this C++ open source code and I came to a constructor but I don't get it ( basically because I don't know C++ :P ) </p>
<p>I understand C and Java very well.</p>
<pre><code> TransparentObject::TransparentObject( int w, int x, int y, int z ) :
_someMethod( 0 ),
_someOtherMethod( 0 ),
_so... | [
{
"answer_id": 210630,
"author": "mdec",
"author_id": 15534,
"author_profile": "https://Stackoverflow.com/users/15534",
"pm_score": 3,
"selected": false,
"text": "<p>:: Actually means contains (see comments for clarification), however the _someMethods and so forth is what's called an <a ... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210616",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20654/"
] | I'm reading this C++ open source code and I came to a constructor but I don't get it ( basically because I don't know C++ :P )
I understand C and Java very well.
```
TransparentObject::TransparentObject( int w, int x, int y, int z ) :
_someMethod( 0 ),
_someOtherMethod( 0 ),
_someOtherOtherMethod( 0... | The most common case is this:
```
class foo{
private:
int x;
int y;
public:
foo(int _x, int _y) : x(_x), y(_y) {}
}
```
This will set `x` and `y` to the values that are given in `_x` and `_y` in the constructor parameters. This is often the best way to construct any objects that are declared as data memb... |
210,620 | <p>I have created HTTP handlers. </p>
<p>How do I create global variables for these handlers like I can with ASP.net web pages in global.asax?</p>
| [
{
"answer_id": 210626,
"author": "Jason Bunting",
"author_id": 1790,
"author_profile": "https://Stackoverflow.com/users/1790",
"pm_score": 4,
"selected": true,
"text": "<p>Add the variables to the Application instance:</p>\n\n<pre><code>System.Web.HttpContext.Current.Application[\"MyGlob... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210620",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1100768/"
] | I have created HTTP handlers.
How do I create global variables for these handlers like I can with ASP.net web pages in global.asax? | Add the variables to the Application instance:
```
System.Web.HttpContext.Current.Application["MyGlobalVariable"] = myValue;
```
Or, if the variable only need to live for the life of an individual request, use the Context object's Items collection:
```
System.Web.HttpContext.Current.Items["MyGlobalVariable"] = myVa... |
210,629 | <p>Trying to answer to another post whose solution deals with IP addresses and netmasks, I got stuck with plain bitwise arithmetic.</p>
<p>Is there a standard way, in Python, to carry on bitwise AND, OR, XOR, NOT operations assuming that the inputs are "32 bit" (maybe negative) integers or longs, and that the result m... | [
{
"answer_id": 210707,
"author": "pixelbeat",
"author_id": 4421,
"author_profile": "https://Stackoverflow.com/users/4421",
"pm_score": 4,
"selected": false,
"text": "<pre><code>from numpy import uint32\n</code></pre>\n"
},
{
"answer_id": 210740,
"author": "DzinX",
"author... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210629",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18770/"
] | Trying to answer to another post whose solution deals with IP addresses and netmasks, I got stuck with plain bitwise arithmetic.
Is there a standard way, in Python, to carry on bitwise AND, OR, XOR, NOT operations assuming that the inputs are "32 bit" (maybe negative) integers or longs, and that the result must be a l... | You can mask everything by `0xFFFFFFFF`:
```
>>> m = 0xFFFFFF00
>>> allf = 0xFFFFFFFF
>>> ~m & allf
255L
``` |
210,637 | <p>I have been looking at <a href="http://jquery.com/demo/thickbox/" rel="nofollow noreferrer">jQUery thickbox</a> for showing modal dialogs with images, it is great. But now I have the need to display a hidden div of content that contains an iFrame in a similar fashion, with a link to open the content. So I'd have s... | [
{
"answer_id": 210644,
"author": "John Sheehan",
"author_id": 1786,
"author_profile": "https://Stackoverflow.com/users/1786",
"pm_score": 4,
"selected": true,
"text": "<p>Thickbox supports that. See inline content demo at <a href=\"http://jquery.com/demo/thickbox/\" rel=\"noreferrer\">ht... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210637",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13279/"
] | I have been looking at [jQUery thickbox](http://jquery.com/demo/thickbox/) for showing modal dialogs with images, it is great. But now I have the need to display a hidden div of content that contains an iFrame in a similar fashion, with a link to open the content. So I'd have something like this.
```
<a href="">Open w... | Thickbox supports that. See inline content demo at <http://jquery.com/demo/thickbox/> |
210,646 | <p>I'm trying to determine how I can detect when the user changes the Windows Font Size from Normal to Extra Large Fonts, the font size is selected by executing the following steps on a Windows XP machine:</p>
<ol>
<li>Right-click on the desktop and select Properties.</li>
<li>Click on the Appearance Tab.</li>
<li>Sel... | [
{
"answer_id": 211790,
"author": "Tim Farley",
"author_id": 4425,
"author_profile": "https://Stackoverflow.com/users/4425",
"pm_score": 2,
"selected": false,
"text": "<p>When you call GetDeviceCaps() on the Desktop DC, are you perhaps using a DC that might be cached by MFC, and therefore... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210646",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28760/"
] | I'm trying to determine how I can detect when the user changes the Windows Font Size from Normal to Extra Large Fonts, the font size is selected by executing the following steps on a Windows XP machine:
1. Right-click on the desktop and select Properties.
2. Click on the Appearance Tab.
3. Select the Font Size: Normal... | [EDIT after re-read] I'm almost positive that changing to "Large fonts" does not cause a DPI change, rather it's a theme setting. You should be able to verify by applying the "Large fonts" change and then opening the advanced display properties where the DPI setting lives, it should have remained at 96dpi.
---
DPI ch... |
210,650 | <p>I'm loading an image from a file, and I want to know how to validate the image before it is fully read from the file.</p>
<pre><code>string filePath = "image.jpg";
Image newImage = Image.FromFile(filePath);
</code></pre>
<p>The problem occurs when image.jpg isn't really a jpg. For example, if I create an empty te... | [
{
"answer_id": 210660,
"author": "Enrico Murru",
"author_id": 68336,
"author_profile": "https://Stackoverflow.com/users/68336",
"pm_score": 0,
"selected": false,
"text": "<p>I would create a method like:</p>\n\n<pre><code>Image openImage(string filename);\n</code></pre>\n\n<p>in which I ... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210650",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1994/"
] | I'm loading an image from a file, and I want to know how to validate the image before it is fully read from the file.
```
string filePath = "image.jpg";
Image newImage = Image.FromFile(filePath);
```
The problem occurs when image.jpg isn't really a jpg. For example, if I create an empty text file and rename it to im... | JPEG's don't have a formal header definition, but they do have a small amount of metadata you can use.
* Offset 0 (Two Bytes): JPEG SOI marker (FFD8 hex)
* Offset 2 (Two Bytes): Image width in pixels
* Offset 4 (Two Bytes): Image height in pixels
* Offset 6 (Byte): Number of components (1 = grayscale, 3 = RGB)
There ... |
210,657 | <p>I've defined an error-page in my web.xml:</p>
<pre><code> <error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.jsp</location>
</error-page>
</code></pre>
<p>In that error page, I have a custom tag that I created. The tag handler for this tag ... | [
{
"answer_id": 210673,
"author": "Eric Wendelin",
"author_id": 25066,
"author_profile": "https://Stackoverflow.com/users/25066",
"pm_score": 1,
"selected": false,
"text": "<p>Have you tried using the <%@ page errorPage=\"/myerrorpage.jsp\" %> directive?</p>\n\n<p>You also need to use ... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2527/"
] | I've defined an error-page in my web.xml:
```
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.jsp</location>
</error-page>
```
In that error page, I have a custom tag that I created. The tag handler for this tag e-mails me the stacktrace of whatever error occurred. For the ... | The errorPage isn't going to be used if you've already started sending data to the client.
What I do is use a JavaScript callback to check for an incomplete page and then redirect to the error page. At the beginning of your page in an includes header or something, initialize a boolean javascript variable to false, and ... |
210,666 | <p>I have a CircleButton class in Actionscript.
I want to know when someone externally has changed the 'on' property.
I try listening to 'onChange' but it never hits that event handler.</p>
<p>I know I can write the 'on' property as a get/setter but I like the simplicity of just using [Bindable]</p>
<p>Can an object ... | [
{
"answer_id": 210966,
"author": "Brandon",
"author_id": 23133,
"author_profile": "https://Stackoverflow.com/users/23133",
"pm_score": 1,
"selected": false,
"text": "<p>You could use BindingUtils.bindSetter()</p>\n\n<p>An example is found <a href=\"http://blog.flexexamples.com/2007/10/01... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210666",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24727/"
] | I have a CircleButton class in Actionscript.
I want to know when someone externally has changed the 'on' property.
I try listening to 'onChange' but it never hits that event handler.
I know I can write the 'on' property as a get/setter but I like the simplicity of just using [Bindable]
Can an object not listen to its... | If you use the [Bindable] tag without specifying an event type, then when the property changes its value, an event of type: PropertyChangeEvent.PROPERTY\_CHANGE, which is the string 'propertyChange', will be dispatched.
Therefore, to be able to register to listen to that event, you need to say:
```
this.addEventList... |
210,682 | <p>our partners sites leverages our iframes in their own websites. I was wondering if there is a way to track the analytics on the iframes. </p>
<p>The problem is, if we also utilize these iframes on our own website, how do i avoid duplicate tracking where a visit is counted on our domain's analytics and also counted ... | [
{
"answer_id": 210704,
"author": "stevemegson",
"author_id": 25028,
"author_profile": "https://Stackoverflow.com/users/25028",
"pm_score": 2,
"selected": false,
"text": "<p>Adding the Google Analytics code to the iframe should work just fine. The easiest way to avoid duplicate tracking i... | 2008/10/16 | [
"https://Stackoverflow.com/questions/210682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | our partners sites leverages our iframes in their own websites. I was wondering if there is a way to track the analytics on the iframes.
The problem is, if we also utilize these iframes on our own website, how do i avoid duplicate tracking where a visit is counted on our domain's analytics and also counted again in i... | Adding the Google Analytics code to the iframe should work just fine. The easiest way to avoid duplicate tracking is probably to add a query parameter like ?partner=foo to the URLs that your partners use. You can check for your own site's value and not run the Google Analytics code at all, and also pass the partner ID ... |
210,717 | <p>How do I go about setting a <code><div></code> in the center of the screen using jQuery?</p>
| [
{
"answer_id": 210733,
"author": "Tony L.",
"author_id": 21905,
"author_profile": "https://Stackoverflow.com/users/21905",
"pm_score": 11,
"selected": true,
"text": "<p>I like adding functions to jQuery so this function would help:</p>\n\n<pre><code>jQuery.fn.center = function () {\n ... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210717",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27294/"
] | How do I go about setting a `<div>` in the center of the screen using jQuery? | I like adding functions to jQuery so this function would help:
```
jQuery.fn.center = function () {
this.css("position","absolute");
this.css("top", Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) +
$(window).scrollTop()) + "px");
this.css("le... |
210,724 | <p>I am working with some tables where I want the C# class to have a different property name than the underlying table column. However, when I use the Translate method to read the results, the properties that don't match the source name never get populated. Even when I use Linq to generate the SQL.</p>
<p>For instance... | [
{
"answer_id": 210765,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 1,
"selected": false,
"text": "<p>I'll start. <strong>feel free to edit and improve this</strong></p>\n\n<p>This is for a ficticious product called: dundermi... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210724",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16387/"
] | I am working with some tables where I want the C# class to have a different property name than the underlying table column. However, when I use the Translate method to read the results, the properties that don't match the source name never get populated. Even when I use Linq to generate the SQL.
For instance, my table... | I'll start. **feel free to edit and improve this**
This is for a ficticious product called: dundermifflin.com
1. Setup a development virtual machine running the same software you plan on using in production: e.g. Ubuntu with PostgreSQL, Apache and PHP5.
2. Each developer runs their own copy of this VM with the hostna... |
210,725 | <p>I have a drop down like this on my page:</p>
<pre><code><p>
<%= f.label :episode_id %><br />
<%= f.collection_select(:episode_id, @episodes, :id, :show) %>
</p>
</code></pre>
<p>An episode has an id and <code>belongs_to</code> to a show which has a name. In the dropdown, I'... | [
{
"answer_id": 210825,
"author": "Michael Sepcot",
"author_id": 6033,
"author_profile": "https://Stackoverflow.com/users/6033",
"pm_score": 2,
"selected": true,
"text": "<p>One way to do this would be to create a method in your Episode class called <code>show_name</code> like so:</p>\n\n... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210725",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2109/"
] | I have a drop down like this on my page:
```
<p>
<%= f.label :episode_id %><br />
<%= f.collection_select(:episode_id, @episodes, :id, :show) %>
</p>
```
An episode has an id and `belongs_to` to a show which has a name. In the dropdown, I'd like to display the show name. `:show.name` doesn't work to displa... | One way to do this would be to create a method in your Episode class called `show_name` like so:
```
def show_name
show.name
end
```
The last symbol you are passing into collection\_select is the name of the method that you want to call to get the option text. |
210,729 | <p>I need a data structure that can store non-overlapping ranges within a single dimension. The entire range of the dimension need not be completely covered.</p>
<p>An example would be a conference room scheduler. The dimension is time. No two schedules may overlap. The conference room isn't always scheduled. In other... | [
{
"answer_id": 210750,
"author": "Sklivvz",
"author_id": 7028,
"author_profile": "https://Stackoverflow.com/users/7028",
"pm_score": 1,
"selected": false,
"text": "<p>The <em>normalized</em> way to represent your data would be to store a record for each unit of time. This can be done in ... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24396/"
] | I need a data structure that can store non-overlapping ranges within a single dimension. The entire range of the dimension need not be completely covered.
An example would be a conference room scheduler. The dimension is time. No two schedules may overlap. The conference room isn't always scheduled. In other words, fo... | The *normalized* way to represent your data would be to store a record for each unit of time. This can be done in the example of the conference scheduling application. Your constraint would be a unique constraint for
```
(RoomId, StartTime)
```
In the case of continuous ranges, you necessarily need to store 2 thing... |
210,751 | <p>MSDN says</p>
<blockquote>
<p>If the function fails, the return value is WAIT_FAILED. To get extended error information, call GetLastError.</p>
</blockquote>
<p>The code is:</p>
<pre><code>HANDLE m_mutex_handle; /**< m_mutex_handle. The handle to the created mutex. */
m_mutex_handle = ::CreateMutex( ... | [
{
"answer_id": 210758,
"author": "Community",
"author_id": -1,
"author_profile": "https://Stackoverflow.com/users/-1",
"pm_score": 2,
"selected": false,
"text": "<p>Passing in a bogus object might cause that.</p>\n"
},
{
"answer_id": 210768,
"author": "Windows programmer",
... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210751",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11032/"
] | MSDN says
>
> If the function fails, the return value is WAIT\_FAILED. To get extended error information, call GetLastError.
>
>
>
The code is:
```
HANDLE m_mutex_handle; /**< m_mutex_handle. The handle to the created mutex. */
m_mutex_handle = ::CreateMutex( 0, false, NULL );
::WaitForSingleObject( m_mut... | If you lack the SYNCHRONIZE privilege on the object, then you cannot wait. WAIT\_FAILED will be returned. |
210,761 | <p>Upon page load I want to move the cursor to a particular field. No problem. But I also need to select and highlight the default value that is placed in that text field.</p>
| [
{
"answer_id": 210764,
"author": "John Millikin",
"author_id": 3560,
"author_profile": "https://Stackoverflow.com/users/3560",
"pm_score": 8,
"selected": true,
"text": "<p>From <a href=\"http://www.codeave.com/javascript/code.asp?u_log=7004\" rel=\"noreferrer\">http://www.codeave.com/jav... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4444/"
] | Upon page load I want to move the cursor to a particular field. No problem. But I also need to select and highlight the default value that is placed in that text field. | From <http://www.codeave.com/javascript/code.asp?u_log=7004>:
```js
var input = document.getElementById('myTextInput');
input.focus();
input.select();
```
```html
<input id="myTextInput" value="Hello world!" />
``` |
210,787 | <p>I have a xml which is max 3 levels deep. Now by using C# or Xpath what the best method to check the whether all the child nodes under a parent node are empty.</p>
<p>Thanks in Advance.</p>
| [
{
"answer_id": 210822,
"author": "C. K. Young",
"author_id": 13,
"author_profile": "https://Stackoverflow.com/users/13",
"pm_score": 4,
"selected": true,
"text": "<p>Given a sample document of:</p>\n\n<pre><code><foo>\n <bar>\n <baz/>\n <baz>Hello, world!&l... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210787",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28773/"
] | I have a xml which is max 3 levels deep. Now by using C# or Xpath what the best method to check the whether all the child nodes under a parent node are empty.
Thanks in Advance. | Given a sample document of:
```
<foo>
<bar>
<baz/>
<baz>Hello, world!</baz>
<baz><qux/></baz>
</bar>
</foo>
```
This expression tells you which children of `foo/bar` have any child elements:
```
foo/bar/*[count(*)>0]
```
This expression tells you which children of `foo/bar` have any child text nod... |
210,809 | <p>Essentially my question is, does anyone know of a utility for inspecting the <strong>buffer cache</strong> in linux?</p>
| [
{
"answer_id": 18398941,
"author": "slm",
"author_id": 33204,
"author_profile": "https://Stackoverflow.com/users/33204",
"pm_score": 4,
"selected": true,
"text": "<p>Take a look at <a href=\"http://code.google.com/p/linux-ftools/\" rel=\"nofollow\">linux-ftools</a>. This suite of tools i... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10747/"
] | Essentially my question is, does anyone know of a utility for inspecting the **buffer cache** in linux? | Take a look at [linux-ftools](http://code.google.com/p/linux-ftools/). This suite of tools is specifically designed to analyze the buffers and cache. It includes the following tools:
* fincore
* fadvise
* fallocate
Of these 3 tools the one that will show you the list of files in the buffers & cache is `fincore`.
```... |
210,820 | <p>I have a webpage that redirects to another webpage like this:</p>
<pre><code>http://www.myOtherServer.com/Sponsor.php?RedirectPage=http://mylink.com/whereIwasgoingtogo.html
</code></pre>
<p>Then the Sponsor.php page displays an ad with a link saying "Continue to your page" that links to the passed in RedirectPage.... | [
{
"answer_id": 210878,
"author": "PHLAK",
"author_id": 27025,
"author_profile": "https://Stackoverflow.com/users/27025",
"pm_score": 0,
"selected": false,
"text": "<p>This is definitely a security risk. You should avoid using in-URL variables when security is involved.</p>\n\n<p>While n... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3291/"
] | I have a webpage that redirects to another webpage like this:
```
http://www.myOtherServer.com/Sponsor.php?RedirectPage=http://mylink.com/whereIwasgoingtogo.html
```
Then the Sponsor.php page displays an ad with a link saying "Continue to your page" that links to the passed in RedirectPage. Are there security/spoofi... | It's a big problem. If I send you a link that looks like this:
```
http://cnn.com/sponsor.php?redirectpage=http://bit.ly/jh2l14
```
You're going to think "Oh, CNN, that's a legit site", and you'll open it and click the 'Continue to Your Page' link. And then you'll be on one of the nastiest porn sites on the net and... |
210,821 | <p>I have read the post <a href="http://www.julienlecomte.net/blog/2007/10/28/" rel="noreferrer">here</a> about using setTimeout() during intensive DOM processing (using JavaScript), but how can I integrate this function with the below code? The below code works fine for a small number of options, but when the number o... | [
{
"answer_id": 210852,
"author": "Geoff",
"author_id": 10427,
"author_profile": "https://Stackoverflow.com/users/10427",
"pm_score": -1,
"selected": false,
"text": "<p>You would need to rewrite the function to cache the element list, then loop over the list using a counter of some sort.<... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210821",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2755/"
] | I have read the post [here](http://www.julienlecomte.net/blog/2007/10/28/) about using setTimeout() during intensive DOM processing (using JavaScript), but how can I integrate this function with the below code? The below code works fine for a small number of options, but when the number of options gets too big my "plea... | Here is a solution:
```
function appendToSelect() {
$("#mySelect").children().remove();
$("#mySelect").html(
'<option selected value="'+obj.data[0].value+'">'
+ obj.data[0].name
+ '</option>'
);
obj.data.splice(0, 1); // we only want remaining data
var appendOptions = function() {
var dataChu... |
210,826 | <p>I have a mobile .NET solution and decided to sign the assemblies.
Compilation completes without errors but gives the warning</p>
<p><strong>'CompactUI.Business.PocketPC.asmmeta, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not signed correctly.</strong></p>
<p>The application is working fine but I can... | [
{
"answer_id": 222801,
"author": "Marcus King",
"author_id": 19840,
"author_profile": "https://Stackoverflow.com/users/19840",
"pm_score": 0,
"selected": false,
"text": "<p>I'm confused, you say that you signed the assmeblies but yet your public key token is null, if you had signed this ... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14027/"
] | I have a mobile .NET solution and decided to sign the assemblies.
Compilation completes without errors but gives the warning
**'CompactUI.Business.PocketPC.asmmeta, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not signed correctly.**
The application is working fine but I can't open the designer for forms... | Verify that the assembly wasn't generated with "delay sign" set. This would cause the assembly to advertise that it was signed, when it only has a `null` placeholder instead. This will cause strong-name verification to fail. For more information you can also check out this page on MSDN: "[Assemblies should have valid s... |
210,836 | <p>In xp 32bit this line compiles with not problem however in vista 64bit this line:</p>
<pre><code>m_FuncAddr = ::GetProcAddress (somthing);
</code></pre>
<p>gives the following error</p>
<blockquote>
<p>error C2440: '=' : cannot convert from
'FARPROC' to 'int (__cdecl *)(void)'</p>
</blockquote>
<p>GetProcAdd... | [
{
"answer_id": 210857,
"author": "Nick",
"author_id": 26240,
"author_profile": "https://Stackoverflow.com/users/26240",
"pm_score": 2,
"selected": false,
"text": "<p>It's a coincidence that it compiles correctly in 32bit; the correct syntax is:</p>\n\n<pre><code>typedef int (WINAPI *FFun... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14587/"
] | In xp 32bit this line compiles with not problem however in vista 64bit this line:
```
m_FuncAddr = ::GetProcAddress (somthing);
```
gives the following error
>
> error C2440: '=' : cannot convert from
> 'FARPROC' to 'int (\_\_cdecl \*)(void)'
>
>
>
GetProcAddress is defined as
```
WINBASEAPI FARPROC WINAPI G... | The return type should be INT\_PTR (a 64-bit value in 64-bit builds). You shouldn't cast around this error -- the compiler is trying to tell you that something is wrong.
From WinDef.h:
```
#ifdef _WIN64
typedef INT_PTR (FAR WINAPI *FARPROC)();
```
So the declaration of m\_FuncAddr should be:
```
INT_PTR (WINAPI *m... |
210,837 | <p>How do I share state amongst TestMethods in MSTest. These tests would be run as Ordered Tests and in sequence.</p>
<pre><code> private TestContext testContext;
public TestContext TestContext
{
get { return this.testContext; }
set { this.testContext = value;}
}
[TestMethod]
... | [
{
"answer_id": 210928,
"author": "NotMe",
"author_id": 2424,
"author_profile": "https://Stackoverflow.com/users/2424",
"pm_score": 1,
"selected": false,
"text": "<p>Vyas, I agree with Chad that you're still doing it wrong. </p>\n\n<p>That said, you can look into using the TestContext ob... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210837",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28413/"
] | How do I share state amongst TestMethods in MSTest. These tests would be run as Ordered Tests and in sequence.
```
private TestContext testContext;
public TestContext TestContext
{
get { return this.testContext; }
set { this.testContext = value;}
}
[TestMethod]
public void Sub... | Vyas, I agree with Chad that you're still doing it wrong.
That said, you can look into using the TestContext object.
See <http://blogs.msdn.com/vstsqualitytools/archive/2006/01/10/511030.aspx> |
210,881 | <p>I have a KML file overlay on an embedded Google Map using the GGeoXml object. I'd like to be able to access specific placemarks in the KML file from Javascript (for example to highlight a selected polygon on the map in response to user action). </p>
<p>Ideally what I'd like to do is something like this (pseudo-code... | [
{
"answer_id": 219828,
"author": "Thedric Walker",
"author_id": 26166,
"author_profile": "https://Stackoverflow.com/users/26166",
"pm_score": 2,
"selected": false,
"text": "<p>Have you looked at <a href=\"http://www.dyasdesigns.com/geoxml/\" rel=\"nofollow noreferrer\">GeoXML</a>?</p>\n"... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/239663/"
] | I have a KML file overlay on an embedded Google Map using the GGeoXml object. I'd like to be able to access specific placemarks in the KML file from Javascript (for example to highlight a selected polygon on the map in response to user action).
Ideally what I'd like to do is something like this (pseudo-code):
```
g... | Have you looked at [GeoXML](http://www.dyasdesigns.com/geoxml/)? |
210,922 | <p>What control type should I use - <code>Image</code>, <code>MediaElement</code>, etc.?</p>
| [
{
"answer_id": 213786,
"author": "Joel B Fant",
"author_id": 22211,
"author_profile": "https://Stackoverflow.com/users/22211",
"pm_score": 5,
"selected": false,
"text": "<p>I, too, did a search and found several different solution in just a thread on the old MSDN forums. (link no longer ... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2522462/"
] | What control type should I use - `Image`, `MediaElement`, etc.? | I couldn't get the most popular answer to this question (above by Dario) to work properly. The result was weird, choppy animation with weird artifacts.
Best solution I have found so far:
<https://github.com/XamlAnimatedGif/WpfAnimatedGif>
You can install it with NuGet
`PM> Install-Package WpfAnimatedGif`
and to use ... |
210,936 | <p>Having an issue with some images using IE7 - work fine in 6 and in all versions of Firefox.</p>
<p>Has anyone run across this before? I know I've had it happen in the past (and I googled a fix, but darned if I can find the fix again... note to self, document things like this for future ;) )</p>
<pre><code><div ... | [
{
"answer_id": 210959,
"author": "Ryan Sampson",
"author_id": 1375,
"author_profile": "https://Stackoverflow.com/users/1375",
"pm_score": 0,
"selected": false,
"text": "<p>I have had similar issues in the past running the page locally on my machine with IE7. That could be the issue.</p>\... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210936",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Having an issue with some images using IE7 - work fine in 6 and in all versions of Firefox.
Has anyone run across this before? I know I've had it happen in the past (and I googled a fix, but darned if I can find the fix again... note to self, document things like this for future ;) )
```
<div class="contextBlock">
<p... | I've come across this type of problem before when images uploaded to our site were JPEGs in [CMYK](http://en.wikipedia.org/wiki/CMYK_color_model) format - Internet explorer would show them as a small red x, but Firefox would show them OK (definitely as of version 3, not sure about earlier releases).
Could you post the... |
210,939 | <p>I've been developing a GUI library for Windows (as a personal side project, no aspirations of usefulness). For my main window class, I've set up a hierarchy of option classes (using the <a href="http://www.parashift.com/c++-faq-lite/named-parameter-idiom.html" rel="nofollow noreferrer">Named Parameter Idiom</a>), be... | [
{
"answer_id": 210990,
"author": "Moishe Lettvin",
"author_id": 23786,
"author_profile": "https://Stackoverflow.com/users/23786",
"pm_score": 2,
"selected": false,
"text": "<p>Could you just chain the method calls by reverse order of inheritance?</p>\n\n<p>So in your example you'd do som... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210939",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12193/"
] | I've been developing a GUI library for Windows (as a personal side project, no aspirations of usefulness). For my main window class, I've set up a hierarchy of option classes (using the [Named Parameter Idiom](http://www.parashift.com/c++-faq-lite/named-parameter-idiom.html)), because some options are shared and others... | Maybe not what you want to hear, but I for one think it's ok to have lots of ugly type-casts and template parameters in library-code that's (more or less) hidden from the client *as long as* it is safe *and* makes the life of the client a lot easier. The beauty in library code is not in the code itself, but in the code... |
210,978 | <p>I have a question about using <code>os.execvp</code> in Python. I have the following bit of code that's used to create a list of arguments:</p>
<pre>
args = [ "java"
, classpath
, "-Djava.library.path=" + lib_path()
, ea
, "-Xmx1000m"
, "-server"
, "code_swarm"
, par... | [
{
"answer_id": 210982,
"author": "CesarB",
"author_id": 28258,
"author_profile": "https://Stackoverflow.com/users/28258",
"pm_score": 5,
"selected": true,
"text": "<p>If your \"classpath\" variable contains for instance \"-classpath foo.jar\", it will not work, since it is thinking the o... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210978",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28804/"
] | I have a question about using `os.execvp` in Python. I have the following bit of code that's used to create a list of arguments:
```
args = [ "java"
, classpath
, "-Djava.library.path=" + lib_path()
, ea
, "-Xmx1000m"
, "-server"
, "code_swarm"
, params
]
```
... | If your "classpath" variable contains for instance "-classpath foo.jar", it will not work, since it is thinking the option name is "-classpath foo.jar". Split it in two arguments: [..., "-classpath", classpath, ...].
The other ways (copy and paste and system()) work because the shell splits the command line at the spa... |
210,986 | <p>Newbie question...</p>
<p>If I have a file that is in the root of the web app. How do I programmaticaly query the path of that file? ie, what directory it is in?</p>
| [
{
"answer_id": 210993,
"author": "harpo",
"author_id": 4525,
"author_profile": "https://Stackoverflow.com/users/4525",
"pm_score": 2,
"selected": false,
"text": "<pre><code>System.Web.HttpServerUtility.MapPath( \"~/filename.ext\" );\n</code></pre>\n\n<p>will give you the physical (disk) ... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210986",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10431/"
] | Newbie question...
If I have a file that is in the root of the web app. How do I programmaticaly query the path of that file? ie, what directory it is in? | ```
System.Web.HttpServerUtility.MapPath( "~/filename.ext" );
```
will give you the physical (disk) path, which you would use with System.IO methods and such.
```
System.Web.Hosting.VirtualPathUtility.ToAbsolute( "~/filename.ext" );
```
will give you the "absolute" virtual path. This won't be the full url, but isn... |
210,996 | <p>In spring you can initialize a bean by having the applicationContext.xml invoke a constructor, or you can set properties on the bean. What are the trade offs between the two approaches? Is it better to have a constructor (which enforces the contract of having everything it needs in one method) or is it better to h... | [
{
"answer_id": 211112,
"author": "Dónal",
"author_id": 2648,
"author_profile": "https://Stackoverflow.com/users/2648",
"pm_score": 2,
"selected": false,
"text": "<p>IMO the major advantage of constructor injection is that it is compatible with immutability. However, if a class has more t... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210996",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6580/"
] | In spring you can initialize a bean by having the applicationContext.xml invoke a constructor, or you can set properties on the bean. What are the trade offs between the two approaches? Is it better to have a constructor (which enforces the contract of having everything it needs in one method) or is it better to have a... | I'm not sure there is a "best" way to initialize a bean. I think there are pros and cons to each, and depending on the situation, one or the other might be appropriate. This certainly isn't an exhaustive list, but here are some things to consider.
Using a constructor allows you to have an immutable bean. Immutable obj... |
210,998 | <p>I am attempting to insert a Canvas3D object inside a Swing JPanel, but the code doesn't seem to be working (i.e. nothing happens):</p>
<pre>
Canvas3D canvas = new Canvas3D(SimpleUniverse.getPreferredConfiguration());
SimpleUniverse universe = new SimpleUniverse(canvas);
BranchGroup root = ne... | [
{
"answer_id": 211010,
"author": "Edward Z. Yang",
"author_id": 23845,
"author_profile": "https://Stackoverflow.com/users/23845",
"pm_score": 0,
"selected": false,
"text": "<p>Canvas3D needs a size passed to it; setting the preferred configuration from SimpleUniverse is not enough. In my... | 2008/10/17 | [
"https://Stackoverflow.com/questions/210998",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23845/"
] | I am attempting to insert a Canvas3D object inside a Swing JPanel, but the code doesn't seem to be working (i.e. nothing happens):
```
Canvas3D canvas = new Canvas3D(SimpleUniverse.getPreferredConfiguration());
SimpleUniverse universe = new SimpleUniverse(canvas);
BranchGroup root = new Branch... | Probably you have to set a layout manager on the panel, which automatically expands the child components to the full area. A JPanel has a FlowLayout by default, which *does not* expand the child components. You could try a BorderLayout instead by calling:
```
canvasPanel.setLayout(new BorderLayout());
``` |
211,001 | <p>In a normal web app w/ login and secure data, what is an easy way to secure that data and prevent it from being seen by using the browser's back button, once a user logs out? </p>
| [
{
"answer_id": 211033,
"author": "tsilb",
"author_id": 11112,
"author_profile": "https://Stackoverflow.com/users/11112",
"pm_score": 0,
"selected": false,
"text": "<p>Depends on your login solution (SSO - Windows Live / OpenID vs homegrown, where login info is stored, etc)... Since 'back... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211001",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4444/"
] | In a normal web app w/ login and secure data, what is an easy way to secure that data and prevent it from being seen by using the browser's back button, once a user logs out? | [Here's a useful browser caching guide](http://www.mnot.net/cache_docs/).
You want to set the cache-control and expiration date headers (setting a date in the past), e.g.
```
Cache-Control: no-cache
Expires: Fri, 31 Dec 1998 12:00:00 GMT
``` |
211,008 | <p>How can I detect in C# whether two files are absolutely identical (size, content, etc.)?</p>
| [
{
"answer_id": 211039,
"author": "yfeldblum",
"author_id": 12349,
"author_profile": "https://Stackoverflow.com/users/12349",
"pm_score": 1,
"selected": false,
"text": "<p>Or you can compare the two files byte-for-byte....</p>\n"
},
{
"answer_id": 211042,
"author": "Charlie",
... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | How can I detect in C# whether two files are absolutely identical (size, content, etc.)? | Here's a simple solution, which just reads both files and compares the data. It should be no slower than the hash method, since both methods will have to read the entire file. **EDIT** As noted by others, this implementation is actually somewhat slower than the hash method, because of its simplicity. See below for a fa... |
211,025 | <p>I have been maintaining <a href="http://github.com/Pistos/watir-mirror" rel="noreferrer">the git mirror</a> of <a href="http://wtr.rubyforge.org/" rel="noreferrer">the watir project</a>. Some time a couple weeks ago, we had someone ready to submit their first git-based patch. Unfortunately, we ran into some issues... | [
{
"answer_id": 211036,
"author": "CesarB",
"author_id": 28258,
"author_profile": "https://Stackoverflow.com/users/28258",
"pm_score": 3,
"selected": false,
"text": "<p>From personal experience, git-svn always generates the exact same commits when cloning or fetching from a svn repository... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211025",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28558/"
] | I have been maintaining [the git mirror](http://github.com/Pistos/watir-mirror) of [the watir project](http://wtr.rubyforge.org/). Some time a couple weeks ago, we had someone ready to submit their first git-based patch. Unfortunately, we ran into some issues regarding line endings (CRLF vs. LF, etc.) because of the mu... | I had this same problem in trying to create a git repository from the brlcad svn repository. I solved it by doing `git svn reset --r XXXXX`, where I set XXXXX to be about 50 revisions prior to the one that originally produced the error.
Stepping back a single revision was not successful in resolving the error. As par... |
211,034 | <p>I'm working on a small UML editor project, in Java, that I started a couple of months ago. After a few weeks, I got a working copy for a UML class diagram editor.</p>
<p>But now, I'm redesigning it completely to support other types of diagrams, such a sequence, state, class, etc. This is done by implementing a grap... | [
{
"answer_id": 211105,
"author": "Justin Bozonier",
"author_id": 9401,
"author_profile": "https://Stackoverflow.com/users/9401",
"pm_score": 3,
"selected": true,
"text": "<p>I think you just need to decompose your problem into smaller ones.</p>\n\n<p>First problem:\nQ: How to represent t... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211034",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10687/"
] | I'm working on a small UML editor project, in Java, that I started a couple of months ago. After a few weeks, I got a working copy for a UML class diagram editor.
But now, I'm redesigning it completely to support other types of diagrams, such a sequence, state, class, etc. This is done by implementing a graph construc... | I think you just need to decompose your problem into smaller ones.
First problem:
Q: How to represent the steps in your app with the memento/command pattern?
First off, I have no idea exactly how your app works but hopefully you will see where I am going with this. Say I want to place a ClassNode on the diagram that w... |
211,035 | <p>Today is officially my first day with C++ :P</p>
<p>I've downloaded Visual C++ 2005 Express Edition and Microsoft Platform SDK for Windows Server 2003 SP1, because I want to get my hands on the open source <a href="http://code.google.com/p/enso" rel="nofollow noreferrer">Enso Project</a>. </p>
<p>So, after install... | [
{
"answer_id": 211050,
"author": "Windows programmer",
"author_id": 23705,
"author_profile": "https://Stackoverflow.com/users/23705",
"pm_score": 0,
"selected": false,
"text": "<p>You show us how you configured Visual Studio for compilations within Visual Studio but you didn't show us wh... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211035",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20654/"
] | Today is officially my first day with C++ :P
I've downloaded Visual C++ 2005 Express Edition and Microsoft Platform SDK for Windows Server 2003 SP1, because I want to get my hands on the open source [Enso Project](http://code.google.com/p/enso).
So, after installing scons I went to the console and tried to compile i... | Using the above recommendations will not work with scons: scons does not import the user environment (PATH and other variables). The fundamental problem is that scons does not handle recent versions of SDKs/VS .
I am an occasional contributor to scons, and am working on this feature ATM. Hopefully, it will be included... |
211,037 | <p>Similar question as <a href="https://stackoverflow.com/questions/56722/automated-processing-of-an-email-in-java">this one</a> but for a Microsoft Environment.</p>
<p>Email --> Exchange Server -->[something]</p>
<p>For the [something] I was using Outlook 2003 & C# but it <em>feels</em> messy (A program is tryin... | [
{
"answer_id": 211070,
"author": "Christian C. Salvadó",
"author_id": 5445,
"author_profile": "https://Stackoverflow.com/users/5445",
"pm_score": 2,
"selected": true,
"text": "<p><a href=\"http://www.codeproject.com/KB/IP/NetPopMimeClient.aspx\" rel=\"nofollow noreferrer\">This</a> libra... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5188/"
] | Similar question as [this one](https://stackoverflow.com/questions/56722/automated-processing-of-an-email-in-java) but for a Microsoft Environment.
Email --> Exchange Server -->[something]
For the [something] I was using Outlook 2003 & C# but it *feels* messy (A program is trying to access outlook, this could be a vi... | [This](http://www.codeproject.com/KB/IP/NetPopMimeClient.aspx) library provides you basic support for the POP3 protocol and MIME, you can use it to check specified mailboxes and retrieve emails and attachments, you can tweak it to your needs.
Here is [another library](http://www.codeproject.com/KB/IP/imaplibrary.aspx)... |
211,041 | <p>Should I be writing Doc Comments for all of my java methods? </p>
| [
{
"answer_id": 211047,
"author": "Daniel Spiewak",
"author_id": 9815,
"author_profile": "https://Stackoverflow.com/users/9815",
"pm_score": 5,
"selected": false,
"text": "<p>I <em>thoroughly</em> document every public method in every API class. Classes which have public members but whic... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24717/"
] | Should I be writing Doc Comments for all of my java methods? | @Claudiu
>
> When I write code that others will use - Yes. Every method that somebody else can use (any public method) should have a javadoc at least stating its obvious purpose.
>
>
>
@Daniel Spiewak
>
> I thoroughly document every public method in every API class. Classes which have public members but which a... |
211,046 | <p>What's a good way to generate an icon in-memory in python? Right now I'm forced to use pygame to draw the icon, then I save it to disk as an .ico file, and then I load it from disk as an ICO resource...</p>
<p>Something like this:</p>
<pre><code> if os.path.isfile(self.icon):
icon_flags = win32con.LR_LO... | [
{
"answer_id": 211110,
"author": "monkut",
"author_id": 24718,
"author_profile": "https://Stackoverflow.com/users/24718",
"pm_score": 0,
"selected": false,
"text": "<p>You can probably create a object that mimics the python file-object interface.</p>\n\n<p><a href=\"http://docs.python.or... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211046",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15055/"
] | What's a good way to generate an icon in-memory in python? Right now I'm forced to use pygame to draw the icon, then I save it to disk as an .ico file, and then I load it from disk as an ICO resource...
Something like this:
```
if os.path.isfile(self.icon):
icon_flags = win32con.LR_LOADFROMFILE | win32con... | You can use [wxPython](http://wxpython.org/) for this.
```
from wx import EmptyIcon
icon = EmptyIcon()
icon.CopyFromBitmap(your_wxBitmap)
```
The [wxBitmap](http://docs.wxwidgets.org/stable/wx_wxbitmap.html#wxbitmap) can be generated in memory using [wxMemoryDC](http://docs.wxwidgets.org/stable/wx_wxmemorydc.html#wx... |
211,051 | <p>Because Canvas3D doesn't have the ability to resize dynamically with the parent frame, I would like to be able to track when a user resizes a window and then resize it manually myself. (If this ends up crashing Canvas3D, as some docs suggest, I will simply destroy and recreate it when the user resizes their window).... | [
{
"answer_id": 211095,
"author": "Simon Lehmann",
"author_id": 27011,
"author_profile": "https://Stackoverflow.com/users/27011",
"pm_score": 5,
"selected": true,
"text": "<p>To determine the size of a component you have to either:</p>\n\n<ul>\n<li>have set it manually at some point</li>\... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211051",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23845/"
] | Because Canvas3D doesn't have the ability to resize dynamically with the parent frame, I would like to be able to track when a user resizes a window and then resize it manually myself. (If this ends up crashing Canvas3D, as some docs suggest, I will simply destroy and recreate it when the user resizes their window). Pa... | To determine the size of a component you have to either:
* have set it manually at some point
* run the layout manager responsible for layouting the component
Generally, you get the exact size of a component via the getSize() method, which returns a Dimension object containing width and height, but getWidth/Height() ... |
211,062 | <p>I have an Excel spreadsheet with 1 column, 700 rows. I care about every seventh line. I don't want to have to go in and delete the 6 rows between each row I care about. So my solution was to create another sheet and specify a reference to each cell I want.</p>
<pre><code>=sheet1!a1
=sheet1!a8
=sheet1!a15
</code></p... | [
{
"answer_id": 211090,
"author": "AquilaX",
"author_id": 17734,
"author_profile": "https://Stackoverflow.com/users/17734",
"pm_score": -1,
"selected": false,
"text": "<p>Add new column and fill it with ascending numbers. Then filter by ([column] mod 7 = 0) or something like that (don't h... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211062",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23105/"
] | I have an Excel spreadsheet with 1 column, 700 rows. I care about every seventh line. I don't want to have to go in and delete the 6 rows between each row I care about. So my solution was to create another sheet and specify a reference to each cell I want.
```
=sheet1!a1
=sheet1!a8
=sheet1!a15
```
But I don't want t... | In A1 of your new sheet, put this:
```
=OFFSET(Sheet1!$A$1,(ROW()-1)*7,0)
```
... and copy down. If you start somewhere other than row 1, change ROW() to ROW(A1) or some other cell on row 1, then copy down again.
If you want to copy the nth line but multiple columns, use the formula:
```
=OFFSET(Sheet1!A$1,(ROW()-... |
211,074 | <p>The mouse hovers over an element and a tip appears. The tip overflows the page, triggering a scrollbar, which changes the layout just enough so that the underlying element that triggered the tip is no longer under the mouse pointer, so the tip goes away.</p>
<p>The tip goes away, so the scrollbar goes away, and n... | [
{
"answer_id": 211078,
"author": "Owen",
"author_id": 4853,
"author_profile": "https://Stackoverflow.com/users/4853",
"pm_score": 1,
"selected": false,
"text": "<p><strong>edit</strong>: in response to the comments, it sounds like you're trying to have the tooltip appear, without affecti... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9328/"
] | The mouse hovers over an element and a tip appears. The tip overflows the page, triggering a scrollbar, which changes the layout just enough so that the underlying element that triggered the tip is no longer under the mouse pointer, so the tip goes away.
The tip goes away, so the scrollbar goes away, and now the mouse... | **edit**: in response to the comments, it sounds like you're trying to have the tooltip appear, without affecting the positioning of existing elements (and thus causing the scrollbar on the main window).
if that's the case, you want to define your tooltip's position as absolute, as this will remove it from the flow of... |
211,099 | <p>I've recently gotten my hobby java project embedded into a page <a href="https://stackoverflow.com/questions/138157/java-console-like-web-applet">thanks to this very site</a>, but now I'm having some security issues.</p>
<p>I have the include:</p>
<pre><code>import java.sql.*;
</code></pre>
<p>and the line:</p>
... | [
{
"answer_id": 211140,
"author": "Cem Catikkas",
"author_id": 3087,
"author_profile": "https://Stackoverflow.com/users/3087",
"pm_score": 0,
"selected": false,
"text": "<p>Try getting rid of the <code>newInstance()</code> part. I think just having the <code>Class.forName()</code> does it... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211099",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14966/"
] | I've recently gotten my hobby java project embedded into a page [thanks to this very site](https://stackoverflow.com/questions/138157/java-console-like-web-applet), but now I'm having some security issues.
I have the include:
```
import java.sql.*;
```
and the line:
```
Class.forName("com.mysql.jdbc.Driver").newIn... | I think the security exception is actually from a System.exit() call in your applet, after the Class.forName(). Generally you are not allowed to call System.exit() in unsigned applets as it shuts the whole JVM down. Have you checked if line 80 is actually the Class.forName() line, or does line 80 have some kind of exce... |
211,100 | <p>When using <code>__import__</code> with a dotted name, something like: <code>somepackage.somemodule</code>, the module returned isn't <code>somemodule</code>, whatever is returned seems to be mostly empty! what's going on here?</p>
| [
{
"answer_id": 211101,
"author": "dwestbrook",
"author_id": 3119,
"author_profile": "https://Stackoverflow.com/users/3119",
"pm_score": 7,
"selected": true,
"text": "<p>From the python docs on <code>__import__</code>:</p>\n\n<blockquote>\n<pre><code>__import__( name[, globals[, locals[, ... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3119/"
] | When using `__import__` with a dotted name, something like: `somepackage.somemodule`, the module returned isn't `somemodule`, whatever is returned seems to be mostly empty! what's going on here? | From the python docs on `__import__`:
>
>
> ```
> __import__( name[, globals[, locals[, fromlist[, level]]]])
>
> ```
>
> ...
>
>
> When the name variable is of the form
> package.module, normally, the
> top-level package (the name up till
> the first dot) is returned, not the
> module named by name. However... |