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 |
|---|---|---|---|---|---|---|
274,586 | <p>In ASP.NET MVC, I'm trying to create a link that includes an anchor tag (that is, directing the user to a page, and a specific section of the page).</p>
<p>The URL I am trying to create should look like the following:</p>
<pre><code><a href="/category/subcategory/1#section12">Title for a section on the page&... | [
{
"answer_id": 274637,
"author": "LorenzCK",
"author_id": 3118,
"author_profile": "https://Stackoverflow.com/users/3118",
"pm_score": 8,
"selected": true,
"text": "<p>I would probably build the link manually, like this:</p>\n\n<pre><code><a href=\"<%=Url.Action(\"Subcategory\", \"C... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274586",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29092/"
] | In ASP.NET MVC, I'm trying to create a link that includes an anchor tag (that is, directing the user to a page, and a specific section of the page).
The URL I am trying to create should look like the following:
```
<a href="/category/subcategory/1#section12">Title for a section on the page</a>
```
My routing is set... | I would probably build the link manually, like this:
```
<a href="<%=Url.Action("Subcategory", "Category", new { categoryID = parent.ID }) %>#section12">link text</a>
``` |
274,619 | <p>My platform: Visual C# 2008 Express Edition with NUnit 2.2.7</p>
<p>I have a solution with my code in one project and my NUnit unit tests in a different project in the same solution.</p>
<p>I have been struggling hard to debug and single-step through the NUnit tests. I found some references online that suggested ... | [
{
"answer_id": 274624,
"author": "David Schmitt",
"author_id": 4918,
"author_profile": "https://Stackoverflow.com/users/4918",
"pm_score": 0,
"selected": false,
"text": "<p>At my shop, we're doing it exactly as you do. On the downside, this means that setup might not be exactly as NUnit ... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274619",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18542/"
] | My platform: Visual C# 2008 Express Edition with NUnit 2.2.7
I have a solution with my code in one project and my NUnit unit tests in a different project in the same solution.
I have been struggling hard to debug and single-step through the NUnit tests. I found some references online that suggested calling the follow... | Since you're using an Express version of Visual Studio, you cannot use the free TestDriven.NET add-in. That's unfortunate, because that really is the best tool I've used to debug unit tests.
The `Runner` class can be found in the *nunit-console-runner.dll* assembly, so be sure to add a reference to that. I'm not sure ... |
274,626 | <p>In c++ what is object slicing and when does it occur?</p>
| [
{
"answer_id": 274630,
"author": "The Archetypal Paul",
"author_id": 21755,
"author_profile": "https://Stackoverflow.com/users/21755",
"pm_score": 5,
"selected": false,
"text": "<p>Third match in google for \"C++ slicing\" gives me this Wikipedia article <a href=\"http://en.wikipedia.org... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274626",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35737/"
] | In c++ what is object slicing and when does it occur? | "Slicing" is where you assign an object of a derived class to an instance of a base class, thereby losing part of the information - some of it is "sliced" away.
For example,
```
class A {
int foo;
};
class B : public A {
int bar;
};
```
So an object of type `B` has two data members, `foo` and `bar`.
Then i... |
274,646 | <p>I am getting the following error while loading a page.</p>
<p>[HttpException (0x80004005): Cannot use a leading .. to exit above the top directory.]</p>
<p>No idea what to do ? Can anyone help me ?</p>
| [
{
"answer_id": 274688,
"author": "Martin Brown",
"author_id": 20553,
"author_profile": "https://Stackoverflow.com/users/20553",
"pm_score": 2,
"selected": false,
"text": "<p>I'm guessing you have done something like this:</p>\n\n<pre><code>Response.Redirect(\"../SomePage.aspx\");\n</code... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274646",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29982/"
] | I am getting the following error while loading a page.
[HttpException (0x80004005): Cannot use a leading .. to exit above the top directory.]
No idea what to do ? Can anyone help me ? | I'm guessing you have done something like this:
```
Response.Redirect("../SomePage.aspx");
```
When using relative paths, you can only navigate to pages that are in the same Virtual Directory as the one the page making the request is in. What you have done is called this from a page that is at the top of the Virtual... |
274,656 | <p>I've been trying to build subversion (on a limited account) for a long time but without any luck :(</p>
<p>The instructions I'm following: <a href="http://wiki.dreamhost.com/Subversion_Installation" rel="nofollow noreferrer">http://wiki.dreamhost.com/Subversion_Installation</a></p>
<p>Running this:</p>
<pre><code... | [
{
"answer_id": 274661,
"author": "Martin v. Löwis",
"author_id": 33006,
"author_profile": "https://Stackoverflow.com/users/33006",
"pm_score": 3,
"selected": false,
"text": "<ol>\n<li>you don't have libcrypto.a and libcrypto.so on your system</li>\n<li>you need to install install libcryp... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274656",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18274/"
] | I've been trying to build subversion (on a limited account) for a long time but without any luck :(
The instructions I'm following: <http://wiki.dreamhost.com/Subversion_Installation>
Running this:
```
./configure --prefix=${RUN} --without-berkeley-db --with-ssl --with-zlib --enable-shared
```
Gives me this error:... | Check out my response over [here](https://stackoverflow.com/questions/189906/upgrade-subversion-143-to-152-on-debian-hosted-account#330061). |
274,718 | <p>I'm attempting to create an audio filter using the JavaSound API to read and write the audio files. Currently my code is structured as follows:</p>
<pre><code> ByteArrayOutputStream b_out = new ByteArrayOutputStream();
// Read a frame from the file.
while (audioInputStream.read(audioBytes) ... | [
{
"answer_id": 274811,
"author": "kasperjj",
"author_id": 34240,
"author_profile": "https://Stackoverflow.com/users/34240",
"pm_score": 1,
"selected": false,
"text": "<p>Some audio formats require metadata describing the length of the stream (or the number of chunks) in their header, thu... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12226/"
] | I'm attempting to create an audio filter using the JavaSound API to read and write the audio files. Currently my code is structured as follows:
```
ByteArrayOutputStream b_out = new ByteArrayOutputStream();
// Read a frame from the file.
while (audioInputStream.read(audioBytes) != -1) {
... | kasperjj's answer is right. You are probably working with WAV files. Look at [this](http://ccrma.stanford.edu/CCRMA/Courses/422/projects/WaveFormat/)
for the layout of a wave file. Note that the size of the entire WAV file is encoded in its header.
I don't know if this is applicable in your case, but to process WAV sa... |
274,753 | <p>There seem to be 3 ways of telling GCC to weak link a symbol:</p>
<ul>
<li><code>__attribute__((weak_import))</code></li>
<li><code>__attribute__((weak))</code></li>
<li><code>#pragma weak symbol_name</code></li>
</ul>
<p>None of these work for me:</p>
<pre><code>#pragma weak asdf
extern void asdf(void) __attribu... | [
{
"answer_id": 274808,
"author": "Nicola Bonelli",
"author_id": 19630,
"author_profile": "https://Stackoverflow.com/users/19630",
"pm_score": 1,
"selected": false,
"text": "<p>From the gcc doc manual:</p>\n\n<p><strong>weak</strong></p>\n\n<blockquote>\n <p>The weak attribute causes the... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | There seem to be 3 ways of telling GCC to weak link a symbol:
* `__attribute__((weak_import))`
* `__attribute__((weak))`
* `#pragma weak symbol_name`
None of these work for me:
```
#pragma weak asdf
extern void asdf(void) __attribute__((weak_import, weak));
...
{
if(asdf != NULL) asdf();
}
```
I always get a l... | I just looked into this and thought some others might be interested in my findings.
Weak linking with weak\_import really only works well with dynamic libraries. You can get it to work with static linking (by specifying -undefined dynamic\_lookup as suggested above) but this isn't such a hot idea. It means that no und... |
274,755 | <p>I've seen (and used) on various projects this layout, with a group of fields followed by a group of properties:</p>
<pre><code>private int MyIntField;
private string MyStringField;
public int MyInt {
get { return MyIntField; }
set { MyIntField = value; }
}
public string MyString {
get { return My... | [
{
"answer_id": 274759,
"author": "kenny",
"author_id": 3225,
"author_profile": "https://Stackoverflow.com/users/3225",
"pm_score": 4,
"selected": true,
"text": "<p>I think it is whatever the team feels comfortable with. Settle on a standard for the project/company/language and stick to i... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274755",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6408/"
] | I've seen (and used) on various projects this layout, with a group of fields followed by a group of properties:
```
private int MyIntField;
private string MyStringField;
public int MyInt {
get { return MyIntField; }
set { MyIntField = value; }
}
public string MyString {
get { return MyStringField; }... | I think it is whatever the team feels comfortable with. Settle on a standard for the project/company/language and stick to it. I prefer the private variables all together, the methods/interfaces together, the private members....I think you get the point. |
274,796 | <p>I have the following code which plays a video clip but when it is finished it does not release the form but instead leaves the last frame of the video. how do I get it to clear when playback ends so that I can see the orignal contents of the form it took over to play the video?</p>
<pre><code>_video = new Video("vi... | [
{
"answer_id": 274803,
"author": "Patrick Desjardins",
"author_id": 13913,
"author_profile": "https://Stackoverflow.com/users/13913",
"pm_score": 0,
"selected": false,
"text": "<p>Release the form you mean to close it? You might want to check for an event in your Video object that will r... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274796",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38275/"
] | I have the following code which plays a video clip but when it is finished it does not release the form but instead leaves the last frame of the video. how do I get it to clear when playback ends so that I can see the orignal contents of the form it took over to play the video?
```
_video = new Video("video.wmv");
_vi... | [Daok](https://stackoverflow.com/users/13913/daok) pointed me in the correct direction. An event handler on the video ending and then setting the Owner of the Video object to null.
```
_video.Ending += new System.EventHandler(this.video_stopped);
private void video_stopped(object sender, EventArgs e)
{
_video.Own... |
274,814 | <p>How do I get a list of all the headings in a word document by using VBA?</p>
| [
{
"answer_id": 274830,
"author": "VonC",
"author_id": 6309,
"author_profile": "https://Stackoverflow.com/users/6309",
"pm_score": 6,
"selected": true,
"text": "<p>You mean like this <a href=\"http://msdn.microsoft.com/en-us/library/bb960898.aspx\" rel=\"nofollow noreferrer\">createOutlin... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35762/"
] | How do I get a list of all the headings in a word document by using VBA? | You mean like this [createOutline](http://msdn.microsoft.com/en-us/library/bb960898.aspx) function (which actually copy all headings from a source word document into a new word document):
(I believe the `astrHeadings = docSource.**[GetCrossReferenceItems](http://msdn.microsoft.com/en-us/library/aa201500(office.10).asp... |
274,840 | <p>I have a Perl module that I would like to use from Java. Is there a way to call this code using either ActiveState Perl on Windows or the generic Perl that comes with Linux? I have found references to JPL but it doesn’t appear to be maintained anymore.</p>
| [
{
"answer_id": 274849,
"author": "VonC",
"author_id": 6309,
"author_profile": "https://Stackoverflow.com/users/6309",
"pm_score": 5,
"selected": true,
"text": "<p><a href=\"http://search.cpan.org/~patl/Inline-Java-0.52/Java.pod\" rel=\"noreferrer\">Inline-Java</a> is the usual library to... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14744/"
] | I have a Perl module that I would like to use from Java. Is there a way to call this code using either ActiveState Perl on Windows or the generic Perl that comes with Linux? I have found references to JPL but it doesn’t appear to be maintained anymore. | [Inline-Java](http://search.cpan.org/~patl/Inline-Java-0.52/Java.pod) is the usual library to call java from Perl, and this [post propose a **org.perl.java**](http://www.piersharding.com/blog/archives/2004/04/calling_perl_fr.html) module which should allow calling Perl from Java, as asked.
However, because of the unpr... |
274,841 | <p>I am writing multi-thread socket chat in C++Builder 2009.<br>
It is almost complete in accordance with what I need to do but I have a little problem.
I need to pass the TMemo* pointer into CreateThread WinAPI function which upcasts it to void*.</p>
<p>I tryed this way:<br></p>
<pre><code>HANDLE xxx = MemoChat->... | [
{
"answer_id": 274856,
"author": "Martin v. Löwis",
"author_id": 33006,
"author_profile": "https://Stackoverflow.com/users/33006",
"pm_score": 2,
"selected": false,
"text": "<p>Please understand that a HANDLE is <strong>not</strong> a pointer, but a concept of the Win32 API. So the first... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274841",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28298/"
] | I am writing multi-thread socket chat in C++Builder 2009.
It is almost complete in accordance with what I need to do but I have a little problem.
I need to pass the TMemo\* pointer into CreateThread WinAPI function which upcasts it to void\*.
I tryed this way:
```
HANDLE xxx = MemoChat->Handle;
hNetThread = Crea... | Call:
```
TMemo* MemoChat = // You defined that somewhere I assume
HANDLE hNetThread = CreateThread(NULL, 0, NetThread, MemoChat, 0, &dwNetThreadId);
```
What is happening here is that any pointer you pass as the third parameter is being auto converted into a void pointer (or in WinTerms LPVOID). That's fi... |
274,843 | <p>I have some elements on a page which are draggable. These same elements have a click event which navigates to another page. I'm trying to determine the best way of preventing the click event from firing if the user is dragging but still allow the click event if not dragging. Anyone have any ideas of the best way to ... | [
{
"answer_id": 274875,
"author": "VonC",
"author_id": 6309,
"author_profile": "https://Stackoverflow.com/users/6309",
"pm_score": 0,
"selected": false,
"text": "<p>Something like the following might do the trick (and prevent the click event to be fired up)</p>\n\n<pre><code>new Draggable... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22436/"
] | I have some elements on a page which are draggable. These same elements have a click event which navigates to another page. I'm trying to determine the best way of preventing the click event from firing if the user is dragging but still allow the click event if not dragging. Anyone have any ideas of the best way to acc... | I solved this by using something like the following:
```
new Draggable('id', {
onStart: function() {
dPhoto = $('id');
Event.stopObserving('id', 'click');
},
onEnd : function() {
setTimeout("Event.observe('id', 'click', function() { location.href = 'url'; });", 500);
},
reve... |
274,857 | <p>is there an easy way to reset ALL text fields in an asp.net form - like the reset button for html controls?</p>
| [
{
"answer_id": 274862,
"author": "DaveK",
"author_id": 4244,
"author_profile": "https://Stackoverflow.com/users/4244",
"pm_score": 1,
"selected": false,
"text": "<p>Some solutions are listed here:</p>\n\n<p><a href=\"http://www.webdeveloper.com/forum/archive/index.php/t-42337.html\" rel=... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | is there an easy way to reset ALL text fields in an asp.net form - like the reset button for html controls? | Depends on your definition of reset. A trivial way to do something like this could be a button with codebehind:
```
Response.Redirect(Request.Url.PathAndQuery, true);
```
Or a variation thereof. |
274,861 | <p>If I have a date, how do I calculate the week number for that date within that year?</p>
<p>For example, in 2008, January 1st to January 6th are in week 1 and January 7th to the 13th are in week 2, so if my date was January 10th 2008, my week number would be 2.</p>
<p>An algorithm would be great to get me started an... | [
{
"answer_id": 274913,
"author": "Olie",
"author_id": 34820,
"author_profile": "https://Stackoverflow.com/users/34820",
"pm_score": 6,
"selected": true,
"text": "<p>Pseudocode:</p>\n\n<pre><code>int julian = getDayOfYear(myDate) // Jan 1 = 1, Jan 2 = 2, etc...\nint dow = getDayOfWeek(my... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274861",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15669/"
] | If I have a date, how do I calculate the week number for that date within that year?
For example, in 2008, January 1st to January 6th are in week 1 and January 7th to the 13th are in week 2, so if my date was January 10th 2008, my week number would be 2.
An algorithm would be great to get me started and sample code w... | Pseudocode:
```
int julian = getDayOfYear(myDate) // Jan 1 = 1, Jan 2 = 2, etc...
int dow = getDayOfWeek(myDate) // Sun = 0, Mon = 1, etc...
int dowJan1 = getDayOfWeek("1/1/" + thisYear) // find out first of year's day
// int badWeekNum = (julian / 7) + 1 // Get our week# (wrong! Don't use this)
int weekNum =... |
274,865 | <p>I am modifying some code and came across a declaration that I am having trouble understanding:</p>
<pre><code>int *userMask[3][4] = {0};
</code></pre>
<p>What exactly is this pointing to? Is it a matrix where every element is a pointer? Or is it pointing to a matrix of size [3][4]?</p>
<p>Thanks</p>
<hr>
<p>I... | [
{
"answer_id": 274869,
"author": "ChrisN",
"author_id": 3853,
"author_profile": "https://Stackoverflow.com/users/3853",
"pm_score": 4,
"selected": false,
"text": "<p>This is a two-dimensional array where each element is a pointer to an <code>int</code>, and all the pointers are initialis... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35767/"
] | I am modifying some code and came across a declaration that I am having trouble understanding:
```
int *userMask[3][4] = {0};
```
What exactly is this pointing to? Is it a matrix where every element is a pointer? Or is it pointing to a matrix of size [3][4]?
Thanks
---
I guess my question is how `userMask[2][mask... | Short answer
------------
Given userMask is declared as
```
int *userMask[3][4];
```
then `userMask` has type `int*[3][4]`. It's a 2d array of pointers to int. The size of the outer dimension is 3, the size of the inner dimension is 4. Really that is nothing more than a 3-element 1d array which element type is ano... |
274,892 | <p>I have information spread out across a few databases and want to put all the information onto one webpage using PHP. I was wondering how I can connect to multiple databases on a single PHP webpage.</p>
<p>I know how to connect to a single database using:</p>
<pre><code>$dbh = mysql_connect($hostname, $username, $... | [
{
"answer_id": 274919,
"author": "Tom Haigh",
"author_id": 22224,
"author_profile": "https://Stackoverflow.com/users/22224",
"pm_score": 9,
"selected": true,
"text": "<p><strong>Warning :</strong> <code>mysql_xx</code> functions are deprecated since php 5.5 and removed since php 7.0 (see... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33194/"
] | I have information spread out across a few databases and want to put all the information onto one webpage using PHP. I was wondering how I can connect to multiple databases on a single PHP webpage.
I know how to connect to a single database using:
```
$dbh = mysql_connect($hostname, $username, $password)
or ... | **Warning :** `mysql_xx` functions are deprecated since php 5.5 and removed since php 7.0 (see <http://php.net/manual/intro.mysql.php>), use `mysqli_xx` functions or see the answer below from @Troelskn
---
You can make multiple calls to `mysql_connect()`, but if the parameters are the same you need to pass true for t... |
274,899 | <p>How have you guys handled working with jQuery includes </p>
<pre><code><script type="text/javascript" src="jquery.js"></script>
</code></pre>
<p>in Asp.Net MVC when working with partial views/view controls? Basically, I don't want to make the jquery include in the master page because I am not using jq... | [
{
"answer_id": 274906,
"author": "FlySwat",
"author_id": 1965,
"author_profile": "https://Stackoverflow.com/users/1965",
"pm_score": 0,
"selected": false,
"text": "<p>You could always do this:</p>\n\n<p>make a lightweight util.js that is in every page, in it you could put various common ... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8534/"
] | How have you guys handled working with jQuery includes
```
<script type="text/javascript" src="jquery.js"></script>
```
in Asp.Net MVC when working with partial views/view controls? Basically, I don't want to make the jquery include in the master page because I am not using jquery in all of my views, but I also wan... | If you use JQuery in a high percentage of your pages, I'd just put it in the master page. It's only going to be downloaded once at which point it's cached on the browser and will have negligible impact on perf for rendering your page. |
274,915 | <p>What is the best way to call C/C++ from other languages such as Java, Python, Perl, PHP, etc?</p>
| [
{
"answer_id": 274916,
"author": "Jared",
"author_id": 14744,
"author_profile": "https://Stackoverflow.com/users/14744",
"pm_score": 2,
"selected": false,
"text": "<p>Use Swig, it allows you to generate code for multiple languages that calls any C/C++ functions.\n<a href=\"http://www.swi... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14744/"
] | What is the best way to call C/C++ from other languages such as Java, Python, Perl, PHP, etc? | From Perl
---------
[Inline::C](http://search.cpan.org/perldoc?Inline::C)
[Inline::CPP](http://search.cpan.org/perldoc?Inline::CPP)
[Inline::Java](http://search.cpan.org/perldoc?Inline::Java)
[Inline::Python](http://search.cpan.org/perldoc?Inline::Python)
[Inline::Lua](http://search.cpan.org/perldoc?Inline... |
274,918 | <p>The CSS Friendly Control Adapters for ASP.NET are great for creating markup that is easy to style. A big benefit of the GridView adapter is that it generates THEAD, TBODY, and TFOOT tags, which allow you to do some really great things with libraries like jQuery - for instance, <a href="http://tablesorter.com/docs/"... | [
{
"answer_id": 276469,
"author": "tvanfosson",
"author_id": 12950,
"author_profile": "https://Stackoverflow.com/users/12950",
"pm_score": 0,
"selected": false,
"text": "<p>CSS Friendly...</p>\n\n<blockquote>\n <p>Disabling Adapters</p>\n \n <p>If you explicitly add\n AdapterEnabled=\... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10039/"
] | The CSS Friendly Control Adapters for ASP.NET are great for creating markup that is easy to style. A big benefit of the GridView adapter is that it generates THEAD, TBODY, and TFOOT tags, which allow you to do some really great things with libraries like jQuery - for instance, [Tablesorter](http://tablesorter.com/docs/... | I just did something similar to this after doing a little research
you need to subclass the control you want to use (gridview in your case, radiobuttonlist in my case)
```
public class UlRadioButtonList : RadioButtonList
{
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
... |
274,951 | <p>You can pass a function pointer, function object (or boost lambda) to std::sort to define a strict weak ordering of the elements of the container you want sorted.</p>
<p>However, sometimes (enough that I've hit this several times), you want to be able to chain "primitive" comparisons.</p>
<p>A trivial example woul... | [
{
"answer_id": 274963,
"author": "Konrad Rudolph",
"author_id": 1968,
"author_profile": "https://Stackoverflow.com/users/1968",
"pm_score": 2,
"selected": false,
"text": "<p>One conventional way to handle this is to sort in multiple passes and use a stable sort. Notice that <code>std::so... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32136/"
] | You can pass a function pointer, function object (or boost lambda) to std::sort to define a strict weak ordering of the elements of the container you want sorted.
However, sometimes (enough that I've hit this several times), you want to be able to chain "primitive" comparisons.
A trivial example would be if you were ... | You could build a little chaining system like so:
```
struct Type {
string first, last;
int age;
};
struct CmpFirst {
bool operator () (const Type& lhs, const Type& rhs) { return lhs.first < rhs.first; }
};
struct CmpLast {
bool operator () (const Type& lhs, const Type& rhs) { return lhs.last < rhs.last; }
}... |
274,952 | <p>Say I have the following interface that I want to share between my server (a regular web service) and my client (a silverlight 2.0 application):</p>
<pre><code>public interface ICustomerService
{
Customer GetCustomer(string name);
}
</code></pre>
<p>My web service implements this interface, and references a cl... | [
{
"answer_id": 274962,
"author": "Cristian Libardo",
"author_id": 16526,
"author_profile": "https://Stackoverflow.com/users/16526",
"pm_score": 3,
"selected": true,
"text": "<p>I think you will find this <a href=\"http://silverlight.net/forums/t/34368.aspx\" rel=\"nofollow noreferrer\">t... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274952",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4687/"
] | Say I have the following interface that I want to share between my server (a regular web service) and my client (a silverlight 2.0 application):
```
public interface ICustomerService
{
Customer GetCustomer(string name);
}
```
My web service implements this interface, and references a class library where `Custome... | I think you will find this [thread](http://silverlight.net/forums/t/34368.aspx) interesting. You can share code files between separate projects or compile a single project against multiple targets. |
274,984 | <p>How can I correctly serve WSDL of a WCF webservice located in a private LAN from behind a reverse proxy listening on public IP?</p>
<p>I have an Apache webserver configured in reverse proxy mode which listens for requests on a public IP address and serves them from the internal IIS host. WCF webservice generates WS... | [
{
"answer_id": 399780,
"author": "Nicolas Dorier",
"author_id": 19803,
"author_profile": "https://Stackoverflow.com/users/19803",
"pm_score": 0,
"selected": false,
"text": "<p><strong>See</strong>: <a href=\"https://learn.microsoft.com/en-us/archive/msdn-magazine/2007/june/service-statio... | 2008/11/08 | [
"https://Stackoverflow.com/questions/274984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5970/"
] | How can I correctly serve WSDL of a WCF webservice located in a private LAN from behind a reverse proxy listening on public IP?
I have an Apache webserver configured in reverse proxy mode which listens for requests on a public IP address and serves them from the internal IIS host. WCF webservice generates WSDL using t... | Add the following attribute to your service class:
```xml
<ServiceBehavior(AddressFilterMode:=AddressFilterMode.Any)>
```
This allows the service to be addressed by the client as `https://...` but the service can still be hosted on `http://.....`
See my answer on [How to specify AddressFilterMode.Any declaratively]... |
275,004 | <p>I wish to calculate the time it took for an API to return a value.
The time taken for such an action is in the space of nanoseconds. As the API is a C++ class/function, I am using the timer.h to calculate the same:</p>
<pre><code> #include <ctime>
#include <iostream>
using namespace std;
int mai... | [
{
"answer_id": 275012,
"author": "Greg Hewgill",
"author_id": 893,
"author_profile": "https://Stackoverflow.com/users/893",
"pm_score": 3,
"selected": false,
"text": "<p>In general, for timing how long it takes to call a function, you want to do it many more times than just once. If you ... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35416/"
] | I wish to calculate the time it took for an API to return a value.
The time taken for such an action is in the space of nanoseconds. As the API is a C++ class/function, I am using the timer.h to calculate the same:
```
#include <ctime>
#include <iostream>
using namespace std;
int main(int argc, char** argv) ... | What others have posted about running the function repeatedly in a loop is correct.
For Linux (and BSD) you want to use [clock\_gettime()](http://opengroup.org/onlinepubs/007908799/xsh/clock_gettime.html).
```
#include <sys/time.h>
int main()
{
timespec ts;
// clock_gettime(CLOCK_MONOTONIC, &ts); // Works on F... |
275,005 | <p>I am writing a program that will draw a solid along the curve of a spline. I am using visual studio 2005, and writing in C++ for OpenGL. I'm using FLTK to open my windows (fast and light toolkit).</p>
<p>I currently have an algorithm that will draw a Cardinal Cubic Spline, given a set of control points, by breaking... | [
{
"answer_id": 275040,
"author": "Sunlight",
"author_id": 33650,
"author_profile": "https://Stackoverflow.com/users/33650",
"pm_score": 0,
"selected": false,
"text": "<p>Have you considered <a href=\"http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/glu/lookat.html\" r... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275005",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33583/"
] | I am writing a program that will draw a solid along the curve of a spline. I am using visual studio 2005, and writing in C++ for OpenGL. I'm using FLTK to open my windows (fast and light toolkit).
I currently have an algorithm that will draw a Cardinal Cubic Spline, given a set of control points, by breaking the inter... | You are correct in forming two vectors from the three points in two adjacent line segments and then using the arccosine of the dot product to get the angle between them. To make use of this angle you need to determine the axis around which the rotation should occur. Take the cross product of the same two vectors to get... |
275,011 | <p>I am having a problem displaying a Javascript string with embedded Unicode character escape sequences (\uXXXX) where the initial "\" character is itself escaped as "&#92;"
What do I need to do to transform the string so that it properly evaluates the escape sequences and produces output with the correct Unicode ... | [
{
"answer_id": 275021,
"author": "Kev",
"author_id": 16777,
"author_profile": "https://Stackoverflow.com/users/16777",
"pm_score": 0,
"selected": false,
"text": "<p>I'm not sure if this is it, but the answer might have something to do with eval(), if you can trust your input.</p>\n"
},... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I am having a problem displaying a Javascript string with embedded Unicode character escape sequences (\uXXXX) where the initial "\" character is itself escaped as "\"
What do I need to do to transform the string so that it properly evaluates the escape sequences and produces output with the correct Unicode charact... | As it turns out, it's unescape() we want, but with '%uXXXX' rather than '\uXXXX':
unescape(yourteststringhere.replace(/\/g,'%')) |
275,018 | <p>How do I remove the last character of a string if it is a newline?</p>
<pre><code>"abc\n" --> "abc"
</code></pre>
| [
{
"answer_id": 275025,
"author": "Rich Bradshaw",
"author_id": 16511,
"author_profile": "https://Stackoverflow.com/users/16511",
"pm_score": 11,
"selected": false,
"text": "<p>Try the method <code>rstrip()</code> (see doc <a href=\"http://docs.python.org/2/library/stdtypes.html#str.rstri... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275018",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | How do I remove the last character of a string if it is a newline?
```
"abc\n" --> "abc"
``` | Try the method `rstrip()` (see doc [Python 2](http://docs.python.org/2/library/stdtypes.html#str.rstrip) and [Python 3](https://docs.python.org/3/library/stdtypes.html#str.rstrip))
```
>>> 'test string\n'.rstrip()
'test string'
```
Python's `rstrip()` method strips *all* kinds of trailing whitespace by default, not ... |
275,022 | <p>With squid, we can cache webpages. I am not sure if it provides the same number of caching methods as ASP.NET caching (I primarily use ASP.NET), but it's a tool to cache webpages.</p>
<p>Then we have memcached, which can cache database tables. I believe this is correct, and it is like SqlCacheDependency (correct me... | [
{
"answer_id": 275025,
"author": "Rich Bradshaw",
"author_id": 16511,
"author_profile": "https://Stackoverflow.com/users/16511",
"pm_score": 11,
"selected": false,
"text": "<p>Try the method <code>rstrip()</code> (see doc <a href=\"http://docs.python.org/2/library/stdtypes.html#str.rstri... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275022",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32484/"
] | With squid, we can cache webpages. I am not sure if it provides the same number of caching methods as ASP.NET caching (I primarily use ASP.NET), but it's a tool to cache webpages.
Then we have memcached, which can cache database tables. I believe this is correct, and it is like SqlCacheDependency (correct me if I am w... | Try the method `rstrip()` (see doc [Python 2](http://docs.python.org/2/library/stdtypes.html#str.rstrip) and [Python 3](https://docs.python.org/3/library/stdtypes.html#str.rstrip))
```
>>> 'test string\n'.rstrip()
'test string'
```
Python's `rstrip()` method strips *all* kinds of trailing whitespace by default, not ... |
275,034 | <p>One of the features of the modern (64 bit OS X and iPhone OS) Objective C runtime is the ability for properties to dynamically synthesize ivars without explicitly declaring them in the class:</p>
<pre><code>@interface MyClass : NSObject {
// NSString *name; unnecessary on modern runtimes
}
@property (retain) NSSt... | [
{
"answer_id": 275134,
"author": "Mark Bessey",
"author_id": 17826,
"author_profile": "https://Stackoverflow.com/users/17826",
"pm_score": 5,
"selected": true,
"text": "<p>I went and looked at the documentation again just now, and I think you're misreading it. Synthesized ivars are creat... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275034",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30506/"
] | One of the features of the modern (64 bit OS X and iPhone OS) Objective C runtime is the ability for properties to dynamically synthesize ivars without explicitly declaring them in the class:
```
@interface MyClass : NSObject {
// NSString *name; unnecessary on modern runtimes
}
@property (retain) NSStrng *name;
@e... | I went and looked at the documentation again just now, and I think you're misreading it. Synthesized ivars are created at compile time, not at run time.
According to the [Objective-C 2.0 documentation](http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_5_section_3.html):
>
> There ... |
275,038 | <p>I wish to convert a single string with multiple delimiters into a key=>value hash structure. Is there a simple way to accomplish this? My current implementation is:</p>
<pre><code>sub readConfigFile() {
my %CONFIG;
my $index = 0;
open(CON_FILE, "config");
my @lines = <CON_FILE>;
close(CON_... | [
{
"answer_id": 275079,
"author": "Martin Redmond",
"author_id": 30541,
"author_profile": "https://Stackoverflow.com/users/30541",
"pm_score": 0,
"selected": false,
"text": "<p>Here's one way. </p>\n\n<pre>\n\nforeach ( @lines ) {\n chomp;\n my %CONFIG;\n # Extract the last digit firs... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275038",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35416/"
] | I wish to convert a single string with multiple delimiters into a key=>value hash structure. Is there a simple way to accomplish this? My current implementation is:
```
sub readConfigFile() {
my %CONFIG;
my $index = 0;
open(CON_FILE, "config");
my @lines = <CON_FILE>;
close(CON_FILE);
my @arra... | What is your configuration data structure supposed to look like? So far the solutions only record the last line because they are stomping on the same hash keys every time they add a record.
Here's something that might get you closer, but you still need to figure out what the data structure should be.
* I pass in the... |
275,039 | <p>I got an image with which links to another page using <code><a href="..."> <img ...> </a></code>.</p>
<p>How can I make it make a post like if it was a button <code><input type="submit"...></code>?</p>
| [
{
"answer_id": 275047,
"author": "Tim Howland",
"author_id": 4276,
"author_profile": "https://Stackoverflow.com/users/4276",
"pm_score": 3,
"selected": false,
"text": "<p><a href=\"http://webdesign.about.com/od/htmltags/p/bltags_inputimg.htm\" rel=\"noreferrer\">input type=image</a> will... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26004/"
] | I got an image with which links to another page using `<a href="..."> <img ...> </a>`.
How can I make it make a post like if it was a button `<input type="submit"...>`? | ```
<input type="image" name="your_image_name" src="your_image_url.png" />
```
This will send the `your_image_name.x` and `your_image_name.y` values as it submits the form, which are the x and y coordinates of the position the user clicked the image. |
275,063 | <p>I would like to be able to set "Extend my Windows desktop onto this monitor" via code. A PowerShell script would be ideal. WMI seems the way forward but I have zero knowledge in WMI.</p>
| [
{
"answer_id": 275123,
"author": "VonC",
"author_id": 6309,
"author_profile": "https://Stackoverflow.com/users/6309",
"pm_score": 2,
"selected": false,
"text": "<p>One first possible solution is... through the GUI (but without user interaction)</p>\n\n<p><a href=\"https://web.archive.org... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275063",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/176626/"
] | I would like to be able to set "Extend my Windows desktop onto this monitor" via code. A PowerShell script would be ideal. WMI seems the way forward but I have zero knowledge in WMI. | Windows 7, 8 and 10 are supposed to come with a small program that does exactly this: displayswitch.exe. [This page](http://jeffwouters.nl/index.php/2012/06/switch-your-display-through-the-command-line/) lists the following parameters:
```
displayswitch.exe /internal Disconnect projector (same as "Show only on 1" from... |
275,064 | <p>I read a properties-file at the webapplication startup phase (contextInitialized()) and I started to think about how to make these settings 'visible' to the servlets. Do I need to loop through the keys and add each and every one to the context, like this</p>
<pre><code>Iterator i = settings.keySet().iterator();
whi... | [
{
"answer_id": 275065,
"author": "Josh",
"author_id": 2204759,
"author_profile": "https://Stackoverflow.com/users/2204759",
"pm_score": 1,
"selected": false,
"text": "<p>Have you considered the possibility of defining the settings in web.xml?</p>\n\n<p>Also, if that's not possible, use g... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275064",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31518/"
] | I read a properties-file at the webapplication startup phase (contextInitialized()) and I started to think about how to make these settings 'visible' to the servlets. Do I need to loop through the keys and add each and every one to the context, like this
```
Iterator i = settings.keySet().iterator();
while (i.hasNext(... | why not store the entire contents in your servlet context?
```
context.setAttribute("mySettings", settings);
```
setAttribute's signature is:
```
public void setAttribute(String name, Object object)
``` |
275,073 | <p>I have just noticed that a multidimensional array in C# does not implement <code>IEnumerable<T></code>, while it does implement <code>IEnumerable</code>. For single-dimensional arrays, both <code>IEnumerable<T></code> and <code>IEnumerable</code> are implemented.</p>
<p>Why this difference? If a multi-d... | [
{
"answer_id": 275107,
"author": "Matthew Scharley",
"author_id": 15537,
"author_profile": "https://Stackoverflow.com/users/15537",
"pm_score": 1,
"selected": false,
"text": "<p>Jagged arrays don't support <code>IEnumerable<int></code> either, because multidimensional structures ar... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13627/"
] | I have just noticed that a multidimensional array in C# does not implement `IEnumerable<T>`, while it does implement `IEnumerable`. For single-dimensional arrays, both `IEnumerable<T>` and `IEnumerable` are implemented.
Why this difference? If a multi-dimensional array is `IEnumerable`, surely it should also implement... | The CLR has two different kinds of arrays: *vectors* which are guaranteed to be one-dimensional with a lower bound of 0, and more general arrays which can have non-zero bounds and a rank other than 0.
From section 8.9.1 of the CLI spec:
>
> Additionally, a created vector with
> element type T, implements the
> in... |
275,092 | <p>We have a JavaScript function named "move" which does just "windows.location.href = <em>any given anchor</em>". <br/>
This function works on IE, Opera and Safari, but somehow is ignored in Firefox. Researching on Google doesn't produce a satisfactory answer <strong>why</strong> it doesn't work. <br/>
Does any JavaSc... | [
{
"answer_id": 275102,
"author": "Dan Herbert",
"author_id": 392,
"author_profile": "https://Stackoverflow.com/users/392",
"pm_score": 6,
"selected": true,
"text": "<p>Have you tried just using </p>\n\n<pre><code>window.location = 'url';\n</code></pre>\n\n<p>In some browsers, <code>wind... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275092",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34815/"
] | We have a JavaScript function named "move" which does just "windows.location.href = *any given anchor*".
This function works on IE, Opera and Safari, but somehow is ignored in Firefox. Researching on Google doesn't produce a satisfactory answer **why** it doesn't work.
Does any JavaScript guru knows about this ... | Have you tried just using
```
window.location = 'url';
```
In some browsers, `window.location.href` is a read-only property and is not the best way to set the location (even though technically it should allow you to). If you use the `location` property on its own, that should redirect for you in all browsers.
Mozi... |
275,109 | <p>I'm writing a url rewrite in django that when a person goes to <a href="http://mysite.com/urlchecker/http://www.google.com" rel="nofollow noreferrer">http://mysite.com/urlchecker/http://www.google.com</a> it sends the url: <a href="http://ww.google.com" rel="nofollow noreferrer">http://ww.google.com</a> to a view ... | [
{
"answer_id": 275117,
"author": "Peter Rowell",
"author_id": 17017,
"author_profile": "https://Stackoverflow.com/users/17017",
"pm_score": 3,
"selected": true,
"text": "<p>Try this instead:</p>\n\n<p><code>(r'^urlchecker/(?P<url>.+)$', 'mysite.main.views.urlchecker'),</code></p>\n... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23695/"
] | I'm writing a url rewrite in django that when a person goes to <http://mysite.com/urlchecker/http://www.google.com> it sends the url: <http://ww.google.com> to a view as a string variable.
I tried doing:
```
(r'^urlchecker/(?P<url>\w+)/$', 'mysite.main.views.urlchecker'),
```
But that didn't work. Anyone know what... | Try this instead:
`(r'^urlchecker/(?P<url>.+)$', 'mysite.main.views.urlchecker'),`
This differs from yours in that:
* It will take anything after 'urlcheck/', not just "word" characters.
* It does not force the url to end in a slash. |
275,120 | <p>Given a class, <a href="http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/views/navigator/ResourceNavigator.html" rel="noreferrer">org.eclipse.ui.views.navigator.ResourceNavigator</a> for example, how do I find out which jar file to use? I know it's in org.ecli... | [
{
"answer_id": 275125,
"author": "PhiLho",
"author_id": 15459,
"author_profile": "https://Stackoverflow.com/users/15459",
"pm_score": 1,
"selected": false,
"text": "<p>Usually, I do <code>jar -vtf foo.jar</code> to get a list of all the class files.<br>\nNot the most practical way, but h... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3827/"
] | Given a class, [org.eclipse.ui.views.navigator.ResourceNavigator](http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/views/navigator/ResourceNavigator.html) for example, how do I find out which jar file to use? I know it's in org.eclipse.ui.ide, but how would I fin... | You also have this eclipse plugin: [jarclassfinder](http://www.alphaworks.ibm.com/tech/jarclassfinder)
The user enters the name of the class not found (or the name of the class that the Java project needs to access). The plug-in will search the selected directory (and subdirectories) for JAR files containing that clas... |
275,128 | <p>Is there any way of doing parallel assignment in C++? Currently, the below compiles (with warnings)</p>
<pre><code>#include <iostream>
int main() {
int a = 4;
int b = 5;
a, b = b, a;
std::cout << "a: " << a << endl
<< "b: " << b << endl;
return 0;
... | [
{
"answer_id": 275146,
"author": "Matthew Scharley",
"author_id": 15537,
"author_profile": "https://Stackoverflow.com/users/15537",
"pm_score": 1,
"selected": false,
"text": "<p>Or Perl. But no, it's not possible (as far as I'm aware), you need to use a temporary variable, as in:</p>\n\n... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35807/"
] | Is there any way of doing parallel assignment in C++? Currently, the below compiles (with warnings)
```
#include <iostream>
int main() {
int a = 4;
int b = 5;
a, b = b, a;
std::cout << "a: " << a << endl
<< "b: " << b << endl;
return 0;
}
```
and prints:
```
a: 4
b: 5
```
What I'd like i... | That's not possible. Your code example
```
a, b = b, a;
```
is interpreted in the following way:
```
a, (b = b), a
```
It does nothing. The comma operator makes it return the value of a (the right most operand). Because assignment binds tighter, b = b is in parens.
The proper way doing this is just
```
std::s... |
275,150 | <p>My website is XHTML Transitional compliant <strong>except for one thing</strong>: the & (ampersand) in the URL are written as it is, instead of <code>&amp;</code></p>
<p>That is, all the URLs in my pages are usually like this:</p>
<pre><code><a href="http://www.example.org/page.aspx?x=1&y=2"... | [
{
"answer_id": 275154,
"author": "VonC",
"author_id": 6309,
"author_profile": "https://Stackoverflow.com/users/6309",
"pm_score": 3,
"selected": false,
"text": "<p>You could use <code>&amp;</code> instead of <code>&</code> in your URL within your page.</p>\n<p>That should allow i... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275150",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | My website is XHTML Transitional compliant **except for one thing**: the & (ampersand) in the URL are written as it is, instead of `&`
That is, all the URLs in my pages are usually like this:
```
<a href="http://www.example.org/page.aspx?x=1&y=2">Foo</a>
```
But [XHTML validator](http://validator.w3.org/) gener... | I have just tried this. What you attempted to do is correct. In HTML if you are writing a link the `&` characters should be encoded as `&` You would only encode the `&` as `%26` if you wanted a parameter value to contain an ampersand. I just wrote a simple HTML page that contained a link: `<a href="Default2.aspx?pa... |
275,160 | <p>Just starting to explore the 'wonders' of regex. Being someone who learns from trial and error, I'm really struggling because my trials are throwing up a disproportionate amount of errors... My experiments are in PHP using ereg().</p>
<p>Anyway. I work with first and last names separately but for now using the s... | [
{
"answer_id": 275172,
"author": "Osama Al-Maadeed",
"author_id": 25544,
"author_profile": "https://Stackoverflow.com/users/25544",
"pm_score": 0,
"selected": false,
"text": "<p>if you add spaces then \"He went to the market on Sunday\" would be a valid name.</p>\n\n<p>I don't think you ... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1444/"
] | Just starting to explore the 'wonders' of regex. Being someone who learns from trial and error, I'm really struggling because my trials are throwing up a disproportionate amount of errors... My experiments are in PHP using ereg().
Anyway. I work with first and last names separately but for now using the same regex. So... | * Hyphenated Names (Worthington-Smythe)
Add a - into the second character class. The easiest way to do that is to add it at the start so that it can't possibly be interpreted as a range modifier (as in `a-z`).
```
^[A-Z][-a-zA-Z]+$
```
* Names with Apostophies (D'Angelo)
A naive way of doing this would be as above,... |
275,169 | <p>I have 2 files:</p>
<pre><code>/****demo.cpp****/
#include <iostream.h>
#include "gc.h"
class foo{};
int main(){
gc<foo> x1;
cout<<x1;
}
/*****gc.h*****/
template <class T> class gc
{
T* ptr;
public:
operator T*(){}
};
</code></pre>
<p>If I don't write <code>operator T*(... | [
{
"answer_id": 275176,
"author": "Rob Walker",
"author_id": 3631,
"author_profile": "https://Stackoverflow.com/users/3631",
"pm_score": 2,
"selected": false,
"text": "<p>operator <code>T*(){}</code> is a <a href=\"http://msdn.microsoft.com/en-us/library/ts48df3y.aspx\" rel=\"nofollow no... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275169",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I have 2 files:
```
/****demo.cpp****/
#include <iostream.h>
#include "gc.h"
class foo{};
int main(){
gc<foo> x1;
cout<<x1;
}
/*****gc.h*****/
template <class T> class gc
{
T* ptr;
public:
operator T*(){}
};
```
If I don't write `operator T*(){}` then I get a lot of compiler errors.
So plz tell ... | operator `T*(){}` is a [cast operator](http://msdn.microsoft.com/en-us/library/ts48df3y.aspx). You are providing a function that can be used to convert from a `gc<T>` to a `T*` ... though it should require that you actually return something, presumably `ptr` in this case.
The problem is that the compiler doesn't know ... |
275,174 | <p>I have a string that is HTML encoded: </p>
<pre><code>'''&lt;img class=&quot;size-medium wp-image-113&quot;\
style=&quot;margin-left: 15px;&quot; title=&quot;su1&quot;\
src=&quot;http://blah.org/wp-content/uploads/2008/10/su1-300x194.jpg&quot;\
alt=&quot;&quot; width=&... | [
{
"answer_id": 275195,
"author": "Jake",
"author_id": 24730,
"author_profile": "https://Stackoverflow.com/users/24730",
"pm_score": 2,
"selected": false,
"text": "<p>I found this in the Cheetah source code (<a href=\"http://www.koders.com/python/fid549827F97513858275EEA43DC0135AC97AEAEF5... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275174",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23695/"
] | I have a string that is HTML encoded:
```
'''<img class="size-medium wp-image-113"\
style="margin-left: 15px;" title="su1"\
src="http://blah.org/wp-content/uploads/2008/10/su1-300x194.jpg"\
alt="" width="300" height="194" />'''
```
I wan... | Given the Django use case, there are two answers to this. Here is its `django.utils.html.escape` function, for reference:
```
def escape(html):
"""Returns the given HTML with ampersands, quotes and carets encoded."""
return mark_safe(force_unicode(html).replace('&', '&').replace('<', '&l
t;').replace('>', ... |
275,194 | <p>How can I format data coming from a DataBinder.Eval statement in an ASPX page?</p>
<p>For example, I want to display the published date of the news items in a particular format in the homepage. I'm using the ASP.NET 2.0 Repeater control to show the list of news items.</p>
<p>The code for this goes like this:</p>
... | [
{
"answer_id": 275218,
"author": "DOK",
"author_id": 27637,
"author_profile": "https://Stackoverflow.com/users/27637",
"pm_score": 7,
"selected": true,
"text": "<p>There is an optional overload for DataBinder.Eval to supply formatting:</p>\n\n<pre><code><%# DataBinder.Eval(Container.D... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275194",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11172/"
] | How can I format data coming from a DataBinder.Eval statement in an ASPX page?
For example, I want to display the published date of the news items in a particular format in the homepage. I'm using the ASP.NET 2.0 Repeater control to show the list of news items.
The code for this goes like this:
```
<asp:Repeater ID=... | There is an optional overload for DataBinder.Eval to supply formatting:
```
<%# DataBinder.Eval(Container.DataItem, "expression"[, "format"]) %>
```
The format parameter is a String value, using the value placeholder replacement syntax (called composite formatting) like this:
```
<asp:Label id="lblNewsDate" runat="... |
275,199 | <p>How do you do the following operations in C++?</p>
<ol>
<li>Opening Files</li>
<li>Closing Files</li>
<li>Reading Files</li>
<li>Writing Files</li>
</ol>
| [
{
"answer_id": 275201,
"author": "grieve",
"author_id": 34329,
"author_profile": "https://Stackoverflow.com/users/34329",
"pm_score": 2,
"selected": false,
"text": "<p><a href=\"http://www.cplusplus.com/doc/tutorial/files.html\" rel=\"nofollow noreferrer\">http://www.cplusplus.com/doc/tu... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35821/"
] | How do you do the following operations in C++?
1. Opening Files
2. Closing Files
3. Reading Files
4. Writing Files | Reading
-------
```
#include <fstream>
int main()
{
std::ifstream inputFile("MyFileName") // Opens a File.
int x;
inputFile >> x; // Reads an integer from a file.
std::string word;
inputFile >> word; // Reads a space separated word from a file.
double y;
inputFile >> y; // Reads a f... |
275,207 | <p>My friend produced a small proof-of-concept assembler that worked on x86. I decided to port it for x86_64 as well, but I immediately hit a problem.</p>
<p>I wrote a small piece of program in C, then compiled and objdumped the code. After that I inserted it to my python script, therefore the x86_64 code is correct:<... | [
{
"answer_id": 275300,
"author": "artificialidiot",
"author_id": 7988,
"author_profile": "https://Stackoverflow.com/users/7988",
"pm_score": 0,
"selected": false,
"text": "<p>Does python even allow such usage? I should learn it then...</p>\n\n<p>I think the interpreter doesn't expect any... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275207",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21711/"
] | My friend produced a small proof-of-concept assembler that worked on x86. I decided to port it for x86\_64 as well, but I immediately hit a problem.
I wrote a small piece of program in C, then compiled and objdumped the code. After that I inserted it to my python script, therefore the x86\_64 code is correct:
```
fro... | As [vincent](https://stackoverflow.com/questions/275207/python-ctypes-and-function-calls#275333) mentioned, this is due to the allocated page being marked as non executable. Newer processors support this [functionality](http://en.wikipedia.org/wiki/NX_bit), and its used as an added layer of security by OS's which suppo... |
275,213 | <p>Previously, I had a class that wrapped an internal <code>System.Collections.Generic.List<Item></code> (where Item is a class I created). The wrapper class provided several collection-level properties that provided totals, averages, and other computations on items in the list. I was creating a <code>BindingSo... | [
{
"answer_id": 275318,
"author": "Timothy Khouri",
"author_id": 11917,
"author_profile": "https://Stackoverflow.com/users/11917",
"pm_score": 0,
"selected": false,
"text": "<p>The problem here is that you want to use your one class for two completely different purposes (in terms of bindi... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275213",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4849/"
] | Previously, I had a class that wrapped an internal `System.Collections.Generic.List<Item>` (where Item is a class I created). The wrapper class provided several collection-level properties that provided totals, averages, and other computations on items in the list. I was creating a `BindingSource` around this wrapped `... | The system treats anything that implements `IList` (or `IListSource`) as a container, rather than an item. As such, you cannot bind to properties of anything that implements `IList`. As such, *encapsulation* (i.e. what you already have) is the best approach if you want to be able to bind to properties of the container.... |
275,233 | <p>What I would like to do is the following. I have a single table, Products, containing a private key ProductID. Instead of having SQL Server auto-increment ProductID on inserts, I want to increment it in the DataContext partial method "InsertProduct":</p>
<pre><code>Partial Public Class MyDataContext
Private Su... | [
{
"answer_id": 275308,
"author": "tvanfosson",
"author_id": 12950,
"author_profile": "https://Stackoverflow.com/users/12950",
"pm_score": 0,
"selected": false,
"text": "<p>InsertProduct isn't declared as a partial method in the code above. Is this a typo in your post or have you declare... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9919/"
] | What I would like to do is the following. I have a single table, Products, containing a private key ProductID. Instead of having SQL Server auto-increment ProductID on inserts, I want to increment it in the DataContext partial method "InsertProduct":
```
Partial Public Class MyDataContext
Private Sub InsertProduc... | I would really recommend letting SQL Server do the incremental numbering. The above approach even if you do get it working would fail under load in a multi-user scenario where they both get the same ID and try to insert the same one. |
275,250 | <p>I'm writing some disposable Haskell scripts to solve some of the <a href="http://projecteuler.net" rel="nofollow noreferrer">Project Euler</a> problems. I don't really want to have to compile them because of the number of changes I'm constantly having to make, but in a few cases I've found that I've run out of stack... | [
{
"answer_id": 275619,
"author": "ja.",
"author_id": 15467,
"author_profile": "https://Stackoverflow.com/users/15467",
"pm_score": 4,
"selected": true,
"text": "<p>I'm guessing you're using GHC. Chapter 4 of the User's Guide of the newly released 6.10.1 says: </p>\n\n<blockquote>\n <p>... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27779/"
] | I'm writing some disposable Haskell scripts to solve some of the [Project Euler](http://projecteuler.net) problems. I don't really want to have to compile them because of the number of changes I'm constantly having to make, but in a few cases I've found that I've run out of stack space.
The documentation for `runhaske... | I'm guessing you're using GHC. Chapter 4 of the User's Guide of the newly released 6.10.1 says:
>
> The only runghc flag currently is -f
> /path/to/ghc, which tells runghc which
> GHC to use to run the program.
>
>
>
I don't see a bug logged at <http://hackage.haskell.org/trac/ghc> . Seems pretty lame to me. I... |
275,273 | <p>I recently downloaded PLT Scheme and DrScheme. When I open DrScheme, I am told to choose a language. However, I'm not familiar with any of my options, and the help guides don't really break it down to help me easily choose which choice.</p>
<p>So, first - is DrScheme and PLT Scheme really the tools I need to learn ... | [
{
"answer_id": 275291,
"author": "Aditya Mukherji",
"author_id": 25990,
"author_profile": "https://Stackoverflow.com/users/25990",
"pm_score": 0,
"selected": false,
"text": "<p>Standard (R5RS) is the actual thing so that would be your best bet<br>\ni learnt it from <a href=\"http://group... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275273",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/572/"
] | I recently downloaded PLT Scheme and DrScheme. When I open DrScheme, I am told to choose a language. However, I'm not familiar with any of my options, and the help guides don't really break it down to help me easily choose which choice.
So, first - is DrScheme and PLT Scheme really the tools I need to learn Lisp and/o... | Just go for "Pretty Big". That will be all you need until you know what the rest are for. I find that R5RS is good, but it does lack the extensions that PLT has added to DrScheme.
*edit:* I just checked and I guess that both "Pretty Big" and "R5RS" are considered "legacy" in DrScheme 4 and the "Module" language is fav... |
275,338 | <p>What is the <em>best</em> way to print the cells of a <code>String[][]</code> array as a right-justified table? For example, the input</p>
<pre><code>{ { "x", "xxx" }, { "yyy", "y" }, { "zz", "zz" } }
</code></pre>
<p>should yield the output</p>
<pre><code> x xxx
yyy y
zz zz
</code></pre>
<p>This seems like... | [
{
"answer_id": 275339,
"author": "Aditya Mukherji",
"author_id": 25990,
"author_profile": "https://Stackoverflow.com/users/25990",
"pm_score": 1,
"selected": false,
"text": "<p>find the length of the longest string..<br>\nleft pad all the strings with spaces until they r that length + 1<... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275338",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1412/"
] | What is the *best* way to print the cells of a `String[][]` array as a right-justified table? For example, the input
```
{ { "x", "xxx" }, { "yyy", "y" }, { "zz", "zz" } }
```
should yield the output
```
x xxx
yyy y
zz zz
```
This seems like something that one *should* be able to accomplish using `java.util... | Indeed, if you specify a width for the fields, it should be right-justified.
If you need to have a dynamic padding, minimal for the longest string, you have to walk the array, getting the maximal width, generate the format string with the width computed from this maxima, and use it for format the output. |
275,351 | <p>Is there a way to get all methods (private, privileged, or public) of a javascript object from within? Here's the sample object:</p>
<pre><code>var Test = function() {
// private methods
function testOne() {}
function testTwo() {}
function testThree() {}
// public methods
function getMethods() {
... | [
{
"answer_id": 275362,
"author": "Oli",
"author_id": 12870,
"author_profile": "https://Stackoverflow.com/users/12870",
"pm_score": 0,
"selected": false,
"text": "<p>If you call getMethods() like that, isn't it static? Surely you'd need to properly init the class for <code>this</code> to ... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4853/"
] | Is there a way to get all methods (private, privileged, or public) of a javascript object from within? Here's the sample object:
```
var Test = function() {
// private methods
function testOne() {}
function testTwo() {}
function testThree() {}
// public methods
function getMethods() {
for (i in t... | The technical reason why those methods are hidden is twofold.
First, when you execute a method on the Test object, "this" will be the untyped object returned at the end of the anonymous function that contains the public methods per the [Module Pattern](http://yuiblog.com/blog/2007/06/12/module-pattern/).
Second, th... |
275,355 | <p>another request sorry..
Right now I am reading the tokens in one by one and it works, but I want to know when there is a new line..</p>
<p>if my file contains</p>
<pre><code>Hey Bob
Now
</code></pre>
<p>should give me</p>
<pre><code>Hey
Bob
[NEW LINE]
NOW
</code></pre>
<p>Is there a way to do this without using... | [
{
"answer_id": 275405,
"author": "Martin York",
"author_id": 14065,
"author_profile": "https://Stackoverflow.com/users/14065",
"pm_score": 5,
"selected": true,
"text": "<p>Yes the operator>> when used with string read 'white space' separated words. A 'White space' includes space tab and ... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33481/"
] | another request sorry..
Right now I am reading the tokens in one by one and it works, but I want to know when there is a new line..
if my file contains
```
Hey Bob
Now
```
should give me
```
Hey
Bob
[NEW LINE]
NOW
```
Is there a way to do this without using getline? | Yes the operator>> when used with string read 'white space' separated words. A 'White space' includes space tab and new line characters.
If you want to read a line at a time use std::getline()
The line can then be tokenized separately with a string stream.
```
std::string line;
while(std::getline(std::cin,line))... |
275,375 | <p>From googling around it looks like Xcode (3.1 in my case) should be at least trying to give me a sane debug view of STL containers - or at least vectors.</p>
<p>However, whenever I go to look at a vector in the debugger I just see M_impl, with M_start and M_finish members (and a couple of others) - but nothing in-b... | [
{
"answer_id": 275381,
"author": "Jasper Bekkers",
"author_id": 31486,
"author_profile": "https://Stackoverflow.com/users/31486",
"pm_score": 2,
"selected": false,
"text": "<p>You can create <a href=\"https://web.archive.org/web/20090812202145/http://developer.apple.com/documentation/Dev... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32136/"
] | From googling around it looks like Xcode (3.1 in my case) should be at least trying to give me a sane debug view of STL containers - or at least vectors.
However, whenever I go to look at a vector in the debugger I just see M\_impl, with M\_start and M\_finish members (and a couple of others) - but nothing in-between!... | The ability to view the container's items may rely on the complexity of the templated type. For trivial objects like int, bool, etc., and even simple class templates like
```
template <class T> struct S { T m_t; }
```
I *normally* have no problem viewing vector items in the debugger variable view. I say normally be... |
275,382 | <p>I currently have 2 domain names that I want to setup different websites for. I am currently looking at using some free hosting that works well for my current needs but doesn't give me any way to point "mydomain.com" to the actual site. Instead I have to give users a longer, harder to remember url.</p>
<p>My propose... | [
{
"answer_id": 275388,
"author": "Cristian Libardo",
"author_id": 16526,
"author_profile": "https://Stackoverflow.com/users/16526",
"pm_score": 1,
"selected": false,
"text": "<p>From asp.net code you can access the host from the request object:</p>\n\n<pre><code>if(Request.Url.Authority ... | 2008/11/08 | [
"https://Stackoverflow.com/questions/275382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20489/"
] | I currently have 2 domain names that I want to setup different websites for. I am currently looking at using some free hosting that works well for my current needs but doesn't give me any way to point "mydomain.com" to the actual site. Instead I have to give users a longer, harder to remember url.
My proposed solution... | Here is one way to do it (as recommended by 1and1.com if you host multiple domains). Put this at the root of your web space. All of your websites will point to this root. The script below will forward the requests to the proper subfolder. It's kind of a hack, but if you don't have complete control over the IIS settings... |
275,404 | <p>How do you split a string into tokens in C++?</p>
| [
{
"answer_id": 275410,
"author": "Michel",
"author_id": 31122,
"author_profile": "https://Stackoverflow.com/users/31122",
"pm_score": 1,
"selected": false,
"text": "<p>It depends on how complex the token delimiter is and if there are more than one. For easy problems, just use std::istri... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275404",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33481/"
] | How do you split a string into tokens in C++? | this works nicely for me :), it puts the results in `elems`. `delim` can be any `char`.
```
std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::string> &elems) {
std::stringstream ss(s);
std::string item;
while(std::getline(ss, item, delim)) {
elems.push_back(item);
... |
275,411 | <p>I'm writing a php program that pulls from a database source. Some of the varchars have quotes that are displaying as black diamonds with a question mark in them (�, <a href="http://www.fileformat.info/info/unicode/char/fffd/index.htm" rel="noreferrer">REPLACEMENT CHARACTER</a>, I assume from Microsoft Word text).</p... | [
{
"answer_id": 275420,
"author": "che",
"author_id": 7806,
"author_profile": "https://Stackoverflow.com/users/7806",
"pm_score": 1,
"selected": false,
"text": "<p>That can be caused by unicode or other charset mismatch. Try changing charset in your browser, in of the settings the text wi... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I'm writing a php program that pulls from a database source. Some of the varchars have quotes that are displaying as black diamonds with a question mark in them (�, [REPLACEMENT CHARACTER](http://www.fileformat.info/info/unicode/char/fffd/index.htm), I assume from Microsoft Word text).
How can I use php to strip these... | If you see that character (� U+FFFD "REPLACEMENT CHARACTER") it usually means that the text itself is encoded in some form of single byte encoding but interpreted in one of the unicode encodings (UTF8 or UTF16).
If it were the other way around it would (usually) look something like this: ä.
Probably the original enc... |
275,421 | <p>I trying to implement a typical languages menu where users can select the language they want to view the site in through a menu that appears throughout all pages in the site.</p>
<p>The menu will appear on multiple master pages (currently one for pages where users are logged in and one for pages where users are not... | [
{
"answer_id": 275492,
"author": "Brad Wilson",
"author_id": 1554,
"author_profile": "https://Stackoverflow.com/users/1554",
"pm_score": 4,
"selected": true,
"text": "<p>How about <a href=\"http://www.ericmmartin.com/projects/simplemodal/\" rel=\"nofollow noreferrer\">SimpleModal</a> for... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8280/"
] | I trying to implement a typical languages menu where users can select the language they want to view the site in through a menu that appears throughout all pages in the site.
The menu will appear on multiple master pages (currently one for pages where users are logged in and one for pages where users are not).
My cur... | How about [SimpleModal](http://www.ericmmartin.com/projects/simplemodal/) for jQuery? |
275,437 | <p>I want to display the "infinity" symbol using </p>
<pre><code>CGContextSelectFont(context, "HelveticaNeue", textSize, kCGEncodingMacRoman);
CGContextShowTextAtPoint(context, myCenter.x, myCenter.y + textHeight, [sName cStringUsingEncoding:NSMacOSRomanStringEncoding], [sName length]);
</code></pre>
<p>It i... | [
{
"answer_id": 275447,
"author": "Jason Coco",
"author_id": 34218,
"author_profile": "https://Stackoverflow.com/users/34218",
"pm_score": 5,
"selected": true,
"text": "<p>It turns out that CGContextSelectFont only supports MacRoman encoding, which is basically has only a small set of cha... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29642/"
] | I want to display the "infinity" symbol using
```
CGContextSelectFont(context, "HelveticaNeue", textSize, kCGEncodingMacRoman);
CGContextShowTextAtPoint(context, myCenter.x, myCenter.y + textHeight, [sName cStringUsingEncoding:NSMacOSRomanStringEncoding], [sName length]);
```
It is displayed as a square bo... | It turns out that CGContextSelectFont only supports MacRoman encoding, which is basically has only a small set of characters. In order to display Unicode characters in a string, you have to use CGSetFont or the Cocoa drawing system. CGSetFont requires that you use Cocoa anyway to map characters to glyphs and then draw ... |
275,439 | <p>Is there a problem using VMware on Windows to host a virtual linux box running iptables? I have a configuration that seems to work on physical hardware but is flaky under VMware.</p>
<p>I'm using VMware to run a virtual linux 2.6.24 machine on a Windows 2003 Server host. The linux application is essentially a NAT... | [
{
"answer_id": 279254,
"author": "Magus",
"author_id": 2188,
"author_profile": "https://Stackoverflow.com/users/2188",
"pm_score": 1,
"selected": false,
"text": "<p>Your second log line is trying to match packets sent to 10.10.1.33, but you changed the destination address to 192.168.0.33... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29157/"
] | Is there a problem using VMware on Windows to host a virtual linux box running iptables? I have a configuration that seems to work on physical hardware but is flaky under VMware.
I'm using VMware to run a virtual linux 2.6.24 machine on a Windows 2003 Server host. The linux application is essentially a NATting router ... | Your second log line is trying to match packets sent to 10.10.1.33, but you changed the destination address to 192.168.0.33 on the line above it.
I'm not sure why you don't see the outgoing packets in tcpdump yet. I assume you're running tcpdump on the linux VM itself. Is the VM sending packets on the same interface ... |
275,442 | <p>How can I make a local drive visible to a Windows XP VMWare image?</p>
<p>Preferably, I'd like to make local drives available as Drive Letters within the VM Ware Image.</p>
| [
{
"answer_id": 275443,
"author": "Adam Liss",
"author_id": 29157,
"author_profile": "https://Stackoverflow.com/users/29157",
"pm_score": 1,
"selected": false,
"text": "<p>Use samba (linux host) or sharing (windows host), then map them as network drives on the virtual machine.</p>\n"
},... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275442",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9467/"
] | How can I make a local drive visible to a Windows XP VMWare image?
Preferably, I'd like to make local drives available as Drive Letters within the VM Ware Image. | If both OSs are windows:
```
vm > settings > options > shared folders
```
That way you can map a drive in the virtual machine as a folder on the host. :) |
275,444 | <p>What are the things that Medium Trust stops you from doing? For example, I've already learned that Medium Trust stops you from using System.IO.Path.GetTempPath(). What other things like that?</p>
| [
{
"answer_id": 275445,
"author": "Shawn",
"author_id": 26,
"author_profile": "https://Stackoverflow.com/users/26",
"pm_score": 2,
"selected": false,
"text": "<p>Who can be sure? That's why you should develop with a trust level of medium set in your web.config.</p>\n\n<pre><code> <trus... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275444",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9328/"
] | What are the things that Medium Trust stops you from doing? For example, I've already learned that Medium Trust stops you from using System.IO.Path.GetTempPath(). What other things like that? | Here's how to learn about and resolve trust issues.
1) Search your Windows\Microsoft.NET\Framework[YOUR VERSION]\CONFIG folders for the files:
* web.config (this is the root config file)
* web\_mediumtrust.config
* web\_hightrust.config
2) Change the web.config to say
```
<trust level="Medium" originUrl="" />
```... |
275,453 | <p>I can't seem to get a scrollbar to work in an inner stack/flow. Does anyone know how to?</p>
| [
{
"answer_id": 281506,
"author": "Ben5e",
"author_id": 36333,
"author_profile": "https://Stackoverflow.com/users/36333",
"pm_score": -1,
"selected": false,
"text": "<p>I'm not sure what exactly you mean by \"an inner stack/flow\", but we use iframes for our subpane windows which has a sc... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35852/"
] | I can't seem to get a scrollbar to work in an inner stack/flow. Does anyone know how to? | Just fix height and add ":scroll => true" parameter:
```
Shoes.app(:title => "Scrolll!" ) do
flow :margin => 10 do
stack :width => "150px", :height => "200px", :scroll => true do
para "all you need is love", "all you need is love", "all you need is love", "all you need is love", "all you need is love", "... |
275,456 | <p>Working with a traditional listener callback model. I have several listeners that collect various stuff. Each listener's collected stuff is inside the listener in internal structures.</p>
<p>The problem is that I want some of the listeners to be aware of some of the "stuff" in the other listeners.</p>
<p>I enforce... | [
{
"answer_id": 275470,
"author": "sblundy",
"author_id": 4893,
"author_profile": "https://Stackoverflow.com/users/4893",
"pm_score": 2,
"selected": false,
"text": "<p>You've describing a lot of coupling here. Best would be to eliminate all this back-channel dependency, but failing that m... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275456",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2204759/"
] | Working with a traditional listener callback model. I have several listeners that collect various stuff. Each listener's collected stuff is inside the listener in internal structures.
The problem is that I want some of the listeners to be aware of some of the "stuff" in the other listeners.
I enforce listener registr... | Why not have a central object that will keep track of how many times the onEvent method was fired for all the listener classes
```
public interface CountObserver {
public void updateCount(String className);
public int getCount(String className);
}
public class CentralObserver implements CountObserver {
private ... |
275,471 | <p>I'm trying to use GDB to debug (to find an annoying segfault). When I run:</p>
<pre><code>gdb ./filename
</code></pre>
<p>from the command line, I get the following error:</p>
<pre><code>This GDB was configured as "i686-pc-linux-
gnu"..."/path/exec": not in executable
format: File format not recognized
</code><... | [
{
"answer_id": 275472,
"author": "ConcernedOfTunbridgeWells",
"author_id": 15401,
"author_profile": "https://Stackoverflow.com/users/15401",
"pm_score": 5,
"selected": true,
"text": "<p>The executable is 64-bit (x86-64) and the debugger is a 32 bit (i686-pc-linux) build. You may need to... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275471",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1266/"
] | I'm trying to use GDB to debug (to find an annoying segfault). When I run:
```
gdb ./filename
```
from the command line, I get the following error:
```
This GDB was configured as "i686-pc-linux-
gnu"..."/path/exec": not in executable
format: File format not recognized
```
When I execute:
```
file /path/executab... | The executable is 64-bit (x86-64) and the debugger is a 32 bit (i686-pc-linux) build. You may need to install a 64-bit (x86-64) version of the debugger. |
275,484 | <p>I'm pretty sure this is a simple question in regards to formatting but here's what I want to accomplish:</p>
<p>I want to output data onto the screen using <code>cout</code>. I want to output this in the form of a table format. What I mean by this is the columns and rows should be properly aligned. Example:</p>
... | [
{
"answer_id": 275489,
"author": "Leon Timmermans",
"author_id": 4727,
"author_profile": "https://Stackoverflow.com/users/4727",
"pm_score": 3,
"selected": false,
"text": "<p>I advise using <a href=\"http://www.boost.org/doc/libs/1_37_0/libs/format/index.html\" rel=\"noreferrer\">Boost F... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33481/"
] | I'm pretty sure this is a simple question in regards to formatting but here's what I want to accomplish:
I want to output data onto the screen using `cout`. I want to output this in the form of a table format. What I mean by this is the columns and rows should be properly aligned. Example:
```
Test 1
... | [setw](http://www.cplusplus.com/reference/iomanip/setw/).
```
#include <iostream>
#include <iomanip>
using namespace std;
int main () {
cout << setw(21) << left << "Test" << 1 << endl;
cout << setw(21) << left << "Test2" << 2 << endl;
cout << setw(21) << left << "Iamlongverylongblah" << 2 << endl;
co... |
275,493 | <p>I'm using a RichTextBox in WinForms 3.5 and I found that when I programmatically edit the contained text, those changes are no longer available to the built in undo functionality.</p>
<p>Is there a way to make it so these changes are available for undo/redo?</p>
| [
{
"answer_id": 275621,
"author": "BFree",
"author_id": 15861,
"author_profile": "https://Stackoverflow.com/users/15861",
"pm_score": 3,
"selected": true,
"text": "<p>Here's just some code I decided to mess around with:</p>\n\n<pre><code> string buffer = String.Empty;\n stri... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275493",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194/"
] | I'm using a RichTextBox in WinForms 3.5 and I found that when I programmatically edit the contained text, those changes are no longer available to the built in undo functionality.
Is there a way to make it so these changes are available for undo/redo? | Here's just some code I decided to mess around with:
```
string buffer = String.Empty;
string buffer2 = String.Empty;
public Form3()
{
InitializeComponent();
this.richTextBox1.KeyDown += new KeyEventHandler(richTextBox1_KeyDown);
this.richTextBox1.Tex... |
275,514 | <p>Something is eluding me ... it seems obvious, but I can't quite figure it out.</p>
<p>I want to add/remove a couple of HTML controls to a page (plain old html) when a user changes value of a dropdown list. An example is to add or remove a "number of guests in this room" textbox for each (of a number) of rooms requ... | [
{
"answer_id": 275521,
"author": "scunliffe",
"author_id": 6144,
"author_profile": "https://Stackoverflow.com/users/6144",
"pm_score": 2,
"selected": false,
"text": "<p>for your select list of rooms, add an onchange event handler that will show/hide the text boses.</p>\n\n<pre><code><... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275514",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34770/"
] | Something is eluding me ... it seems obvious, but I can't quite figure it out.
I want to add/remove a couple of HTML controls to a page (plain old html) when a user changes value of a dropdown list. An example is to add or remove a "number of guests in this room" textbox for each (of a number) of rooms requested ...
... | Using straight DOM and Javascript you would want to modify the InnterHtml property of a DOM object which will contain the text boxes...most likely a div. So it would look something like:
```
var container = document.getElementById("myContainerDiv");
var html;
for(var i = 0; i < selectedRooms; i++)
{
html = html + ... |
275,536 | <p>Where would the physical files be?</p>
| [
{
"answer_id": 275538,
"author": "Blair Conrad",
"author_id": 1199,
"author_profile": "https://Stackoverflow.com/users/1199",
"pm_score": 6,
"selected": true,
"text": "<p>It depends on the OS and whether or not roaming user profiles are enabled.</p>\n\n<p>For example, on XP, with non-roa... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275536",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9328/"
] | Where would the physical files be? | It depends on the OS and whether or not roaming user profiles are enabled.
For example, on XP, with non-roaming profiles, the location is
```
<SYSTEMDRIVE>\Documents and Settings\<user>\Local Settings\Application Data\Microsoft\IsolatedStorage
```
On Vista with roaming profile storage,
```
<SYSTEMDRIVE>\Users\<us... |
275,540 | <p>I would like to call an ejb3 at runtime. The name of the ejb and the method name will only be available at runtime, so I cannot include any remote interfaces at compile time.</p>
<pre><code>String bean = 'some/Bean';
String meth = 'doStuff';
//lookup the bean
Object remoteInterface = (Object) new InitialContext().... | [
{
"answer_id": 275662,
"author": "james",
"author_id": 17156,
"author_profile": "https://Stackoverflow.com/users/17156",
"pm_score": 1,
"selected": false,
"text": "<p>ejb3 calls use RMI. RMI supports remote class loading, so i'd suggest looking into that.</p>\n\n<p>also, JMX mbeans supp... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I would like to call an ejb3 at runtime. The name of the ejb and the method name will only be available at runtime, so I cannot include any remote interfaces at compile time.
```
String bean = 'some/Bean';
String meth = 'doStuff';
//lookup the bean
Object remoteInterface = (Object) new InitialContext().lookup(bean);
... | ejb3 calls use RMI. RMI supports remote class loading, so i'd suggest looking into that.
also, JMX mbeans support fully untyped, remote invocations. so, if you could use mbeans instead of session beans, that could work. (JBoss, for instance, supports ejb3-like mbeans with some custom annotations).
lastly, many app se... |
275,541 | <p>In a latin-1 database i have '<code>\222\222\223\225</code>', when I try to pull this field from the django models I get back <code>u'\u2019\u2019\u201c\u2022'</code>.</p>
<pre><code>from django.db import connection ... | [
{
"answer_id": 276108,
"author": "Peter Rowell",
"author_id": 17017,
"author_profile": "https://Stackoverflow.com/users/17017",
"pm_score": 2,
"selected": false,
"text": "<p>A little browsing of already-asked questions would have led you to <a href=\"https://stackoverflow.com/questions/2... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275541",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35697/"
] | In a latin-1 database i have '`\222\222\223\225`', when I try to pull this field from the django models I get back `u'\u2019\u2019\u201c\u2022'`.
```
from django.db import connection ... | A little browsing of already-asked questions would have led you to [UTF-8 latin-1 conversion issues](https://stackoverflow.com/questions/274361/utf-8-latin-1-conversion-issues-python-django), which was asked and answered yesterday.
BTW, I couldn't remember the exact title, so I just googled on django+'\222\222\223\225... |
275,544 | <p>I know in a lot of asynchronous communication, the packet begins starts with a start bit.</p>
<p>But a start bit is just a 1 or 0. How do you differentiate a start bit from the end bit from the last packet?</p>
<p>Ex.
If I choose my start bit to be 0 and my end bit to be 1.
and I receive 0 (data stream A) 1 0 (da... | [
{
"answer_id": 275554,
"author": "Adam Liss",
"author_id": 29157,
"author_profile": "https://Stackoverflow.com/users/29157",
"pm_score": 3,
"selected": false,
"text": "<p>Great question! Most asynchronous communication also specifies a <em>stop</em> bit, which is the complement of the s... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275544",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28462/"
] | I know in a lot of asynchronous communication, the packet begins starts with a start bit.
But a start bit is just a 1 or 0. How do you differentiate a start bit from the end bit from the last packet?
Ex.
If I choose my start bit to be 0 and my end bit to be 1.
and I receive 0 (data stream A) 1 0 (data stream B) 1,
wh... | Great question! Most asynchronous communication also specifies a *stop* bit, which is the complement of the start bit, ensuring each new symbol begins with a stop-to-start transition.
Example: let's transmit the characters `ABC`, which are ASCII 65, 66, and 67:
```
A = 65 = 0x41 = 0100 0001
B = 66 = 0x42 = 0100 0010
... |
275,550 | <p>I know how to include files that are in folders further down the heirachy but I have trouble finding my way back up.
I decided to go with the set_include_path to default all further includes relative to a path 2 levels up but don't have the slightest clue how to write it out.</p>
<p>Is there a guide somewhere that ... | [
{
"answer_id": 275556,
"author": "Owen",
"author_id": 4853,
"author_profile": "https://Stackoverflow.com/users/4853",
"pm_score": 1,
"selected": false,
"text": "<p>it's probably easier to just use an absolute path to reference:</p>\n\n<pre><code>set_include_path('/path/to/files');\n</cod... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24416/"
] | I know how to include files that are in folders further down the heirachy but I have trouble finding my way back up.
I decided to go with the set\_include\_path to default all further includes relative to a path 2 levels up but don't have the slightest clue how to write it out.
Is there a guide somewhere that details ... | I tend to use **[dirname](http://uk3.php.net/dirname)** to get the current path and then use this as a base to calculate all future path names.
For example,
```
$base = dirname( __FILE__ ); # Path to directory containing this file
include( "{$base}/includes/Common.php" ); # Kick off some magic
``` |
275,562 | <p>I'm writing a simple time tracking program to manage my own projects. I'm a big fan of keeping reporting code in the database, so I've been attempting to create a few sprocs that generate the invoices and timesheets etc.</p>
<p>I have a table that contains Clock Actions, IE "Punch In", and "Punch Out". It also cont... | [
{
"answer_id": 275570,
"author": "DevCodex",
"author_id": 35872,
"author_profile": "https://Stackoverflow.com/users/35872",
"pm_score": 1,
"selected": false,
"text": "<p>I think your original storage schema is flawed. You're looking at it from the perspective of the clock, hence ClockAc... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1965/"
] | I'm writing a simple time tracking program to manage my own projects. I'm a big fan of keeping reporting code in the database, so I've been attempting to create a few sprocs that generate the invoices and timesheets etc.
I have a table that contains Clock Actions, IE "Punch In", and "Punch Out". It also contains the u... | I agree that the design isn't the greatest--an event based structure with a single row for start-end will probably save you a lot of time. In that case, you could create a record with a null end-date when someone clocks in. Then, fill in the end date when they clock out.
But, that's not what you asked. This is the sol... |
275,566 | <p>We are currently working on an application that will use a WCF service. The host (the client) is using the excellent <a href="http://bloggingabout.net/blogs/erwyn/archive/2006/12/09/WCF-Service-Proxy-Helper.aspx" rel="nofollow noreferrer">WCF Service Proxy Helper from Erwyn van der Meer</a>.</p>
<p>What I would lik... | [
{
"answer_id": 275624,
"author": "Paul Lalonde",
"author_id": 5782,
"author_profile": "https://Stackoverflow.com/users/5782",
"pm_score": 3,
"selected": true,
"text": "<p>You should try to minimize the number of proxy objects you create. Proxies in WCF are quite expensive to set up, so ... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24975/"
] | We are currently working on an application that will use a WCF service. The host (the client) is using the excellent [WCF Service Proxy Helper from Erwyn van der Meer](http://bloggingabout.net/blogs/erwyn/archive/2006/12/09/WCF-Service-Proxy-Helper.aspx).
What I would like to know... is if I open this object multiple ... | You should try to minimize the number of proxy objects you create. Proxies in WCF are quite expensive to set up, so creating one and calling functions on it multiple times is definitely more efficient than creating a new one for each method invocation.
The relationship between proxy objects and connections depends on ... |
275,569 | <p>This is kind of a brainteaser question, since the code works perfectly fine as-is, it just irritates my aesthetic sense ever so slightly. I'm turning to Stack Overflow because my own brain is failing me right now.</p>
<p>Here's a snippet of code that looks up an address using the Google Maps JS API and places a mar... | [
{
"answer_id": 275582,
"author": "Jay Kominek",
"author_id": 32878,
"author_profile": "https://Stackoverflow.com/users/32878",
"pm_score": 1,
"selected": false,
"text": "<p>How about this?</p>\n\n<pre><code>function place_point(mapstrings,idx)\n{\n if(idx>=mapstrings.length) return... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/56817/"
] | This is kind of a brainteaser question, since the code works perfectly fine as-is, it just irritates my aesthetic sense ever so slightly. I'm turning to Stack Overflow because my own brain is failing me right now.
Here's a snippet of code that looks up an address using the Google Maps JS API and places a marker on a m... | The other answers are good, but here's one more option. This allows you to keep the same form you started with but uses the trick of naming your lambda function so that you can refer to it recursively:
```
mapstrings = ['mapstring1', 'mapstring2', 'mapstring3'];
geocoder.getLatLng(mapstrings.shift(), function lambda(... |
275,577 | <p>If I have a char which holds a hex value such has 0x53, (S), how can I display this as "S"?</p>
<p>Code:</p>
<pre><code>char test = 0x53;
cout << test << endl;
</code></pre>
<p>Thanks!</p>
| [
{
"answer_id": 275646,
"author": "Paige Ruten",
"author_id": 813,
"author_profile": "https://Stackoverflow.com/users/813",
"pm_score": 3,
"selected": false,
"text": "<p>There's no such thing as a variable that stores a hex value, or a decimal or octal value. Hex, octal, and decimal are j... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275577",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33481/"
] | If I have a char which holds a hex value such has 0x53, (S), how can I display this as "S"?
Code:
```
char test = 0x53;
cout << test << endl;
```
Thanks! | There's no such thing as a variable that stores a hex value, or a decimal or octal value. Hex, octal, and decimal are just different ways of representing numbers to the compiler. The compiled code will represent everything in binary.
These statements all have the **exact** same effect (assuming the charset is ASCII):
... |
275,625 | <pre><code>var pattern = /^0+$/;
</code></pre>
<p>My guess is this:</p>
<p>"Take a look at both the beginning and the end of the string, and if there's a pattern of one or more zeros at the beginning and the end, then return that pattern."</p>
<p>I'm sure that's wrong, though, because when I run the expression with ... | [
{
"answer_id": 275628,
"author": "billjamesdev",
"author_id": 13824,
"author_profile": "https://Stackoverflow.com/users/13824",
"pm_score": 3,
"selected": false,
"text": "<p>It's saying your string contains only 0... it must begin, then have 1 or more 0's, then end.</p>\n"
},
{
"... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275625",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | ```
var pattern = /^0+$/;
```
My guess is this:
"Take a look at both the beginning and the end of the string, and if there's a pattern of one or more zeros at the beginning and the end, then return that pattern."
I'm sure that's wrong, though, because when I run the expression with this string:
```
var string = "0... | It's saying your string contains only 0... it must begin, then have 1 or more 0's, then end. |
275,630 | <p>I'm trying to automate some stuff in MS Excel. When I try to set the Calculation property I get the following error message: 'Unable to set the Calculation property of the Application class'</p>
<p>I believe this property should be settable.</p>
<p>Any advice appreciated!</p>
| [
{
"answer_id": 275635,
"author": "BradC",
"author_id": 21398,
"author_profile": "https://Stackoverflow.com/users/21398",
"pm_score": 1,
"selected": false,
"text": "<p>Make sure you are setting it to a proper value.</p>\n\n<pre><code> Application.Calculation = xlCalculationManual\n</code>... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I'm trying to automate some stuff in MS Excel. When I try to set the Calculation property I get the following error message: 'Unable to set the Calculation property of the Application class'
I believe this property should be settable.
Any advice appreciated! | You need to have an open workbook, ie
```py
import win32com
# Create new Excel instance
xl = win32com.client.DispatchEx("Excel.Application")
# Open blank workbook
xl.Workbooks.Add()
# Set property
xl.Calculation = win32com.client.constants.xlCalculationManual
``` |
275,683 | <p>Using <a href="http://imdbpy.sourceforge.net" rel="noreferrer">IMDbPy</a> it is painfully easy to access movies from the IMDB site:</p>
<pre><code>import imdb
access = imdb.IMDb()
movie = access.get_movie(3242) # random ID
print "title: %s year: %s" % (movie['title'], movie['year'])
</code></pre>
<p>However I se... | [
{
"answer_id": 275774,
"author": "Tim Kersten",
"author_id": 33514,
"author_profile": "https://Stackoverflow.com/users/33514",
"pm_score": 4,
"selected": true,
"text": "<p><strong>Note:</strong></p>\n\n<ul>\n<li>Not every movie has a cover url. (The random ID in your example doesn't.)</l... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/432/"
] | Using [IMDbPy](http://imdbpy.sourceforge.net) it is painfully easy to access movies from the IMDB site:
```
import imdb
access = imdb.IMDb()
movie = access.get_movie(3242) # random ID
print "title: %s year: %s" % (movie['title'], movie['year'])
```
However I see no way to get the picture or thumbnail of the movie ... | **Note:**
* Not every movie has a cover url. (The random ID in your example doesn't.)
* Make sure you're using an up-to-date version of IMDbPy. (IMDb changes, and IMDbPy with it.)
...
```
import imdb
access = imdb.IMDb()
movie = access.get_movie(1132626)
print "title: %s year: %s" % (movie['title'], movie['year'])... |
275,689 | <p>There's a part in my apps that displays the file path loaded by the user through OpenFileDialog. It's taking up too much space to display the whole path, but I don't want to display only the filename as it might be ambiguous. So I would prefer to show the file path relative to the assembly/exe directory.</p>
<p>For... | [
{
"answer_id": 275691,
"author": "Kevin",
"author_id": 40,
"author_profile": "https://Stackoverflow.com/users/40",
"pm_score": 2,
"selected": false,
"text": "<p>Use:</p>\n\n<pre><code>RelPath = AbsPath.Replace(ApplicationPath, \".\")\n</code></pre>\n"
},
{
"answer_id": 275703,
... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20007/"
] | There's a part in my apps that displays the file path loaded by the user through OpenFileDialog. It's taking up too much space to display the whole path, but I don't want to display only the filename as it might be ambiguous. So I would prefer to show the file path relative to the assembly/exe directory.
For example, ... | .NET Core 2.0 has `Path.GetRelativePath`, else, use this.
```
/// <summary>
/// Creates a relative path from one file or folder to another.
/// </summary>
/// <param name="fromPath">Contains the directory that defines the start of the relative path.</param>
/// <param name="toPath">Contains the path that defines the e... |
275,707 | <p>Create a file called Valid[File].txt and stick some text in it. Start powershell and go to the directory.<br>
<PRE>
gc Valid[File].txt
</PRE>
should display the value in the file. It returns blank. If you use tab auto-completion it escapes the name:
<PRE>
gc 'Valid<code>[File</code>].txt'
</PRE>
but still returns... | [
{
"answer_id": 275718,
"author": "Jeff Hubbard",
"author_id": 8844,
"author_profile": "https://Stackoverflow.com/users/8844",
"pm_score": 0,
"selected": false,
"text": "<p>You probably need to enclose it in quotation marks: gc \"Valid[File].txt\"</p>\n"
},
{
"answer_id": 275719,
... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275707",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32992/"
] | Create a file called Valid[File].txt and stick some text in it. Start powershell and go to the directory.
```
gc Valid[File].txt
```
should display the value in the file. It returns blank. If you use tab auto-completion it escapes the name:
```
gc 'Valid[File].txt'
```
but still returns nothing.
How do I ref... | Turns out the key was `-literalpath`. For details see [this technet article](http://www.microsoft.com/technet/scriptcenter/resources/pstips/jun08/pstip0620.mspx) |
275,711 | <p>Is there a better way of getting this result? This function fails if num has more digits than digits, and I feel like it should be in the library somewhere (like Integer.toString(x,"%3d") or something)</p>
<pre><code>static String intToString(int num, int digits) {
StringBuffer s = new StringBuffer(digits);
... | [
{
"answer_id": 275715,
"author": "begray",
"author_id": 12123,
"author_profile": "https://Stackoverflow.com/users/12123",
"pm_score": 12,
"selected": true,
"text": "<p>String.format (<a href=\"https://docs.oracle.com/javase/1.5.0/docs/api/java/util/Formatter.html#syntax\" rel=\"noreferre... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275711",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34910/"
] | Is there a better way of getting this result? This function fails if num has more digits than digits, and I feel like it should be in the library somewhere (like Integer.toString(x,"%3d") or something)
```
static String intToString(int num, int digits) {
StringBuffer s = new StringBuffer(digits);
int zeroes = ... | String.format (<https://docs.oracle.com/javase/1.5.0/docs/api/java/util/Formatter.html#syntax>)
In your case it will be:
```
String formatted = String.format("%03d", num);
```
* 0 - to pad with zeros
* 3 - to set width to 3 |
275,717 | <p>I have a very weird problem which I cannot seem to figure out. Unfortunately, I'm not even sure how to describe it without describing my entire application. What I am trying to do is:</p>
<pre>
1) read a byte from the serial port
2) store each char into tagBuffer as they are read
3) run a query using tagBuffer to... | [
{
"answer_id": 275723,
"author": "Martin Beckett",
"author_id": 10897,
"author_profile": "https://Stackoverflow.com/users/10897",
"pm_score": 1,
"selected": false,
"text": "<p>Where are you allocating tagbuffer, how large is it?<br>\nIt's possible that you are overwriting 'buf' because y... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275717",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28462/"
] | I have a very weird problem which I cannot seem to figure out. Unfortunately, I'm not even sure how to describe it without describing my entire application. What I am trying to do is:
```
1) read a byte from the serial port
2) store each char into tagBuffer as they are read
3) run a query using tagBuffer to see what ... | Where are you allocating tagbuffer, how large is it?
It's possible that you are overwriting 'buf' because you are writing past the end of tagbuffer. |
275,736 | <p>I use the dark-blue2 color theme but it seems ugly under console.
So I want to use no color theme under terminal, what can I do then?</p>
| [
{
"answer_id": 275755,
"author": "Samuel Tardieu",
"author_id": 22890,
"author_profile": "https://Stackoverflow.com/users/22890",
"pm_score": 2,
"selected": true,
"text": "<p>Set a \"TERM\" variable corresponding to a monochrome terminal before launching Emacs. For example, if you are in... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/34924/"
] | I use the dark-blue2 color theme but it seems ugly under console.
So I want to use no color theme under terminal, what can I do then? | Set a "TERM" variable corresponding to a monochrome terminal before launching Emacs. For example, if you are in an xterm, use:
```
TERM=xterm-mono emacs -nw
```
If by "console" you mean the Linux console in text mode, you can try using "vt100" (or "vt320") instead. |
275,737 | <pre><code>DECLARE @p_date DATETIME
SET @p_date = CONVERT( DATETIME, '14 AUG 2008 10:45:30',?)
SELECT *
FROM table1
WHERE column_datetime = @p_date
</code></pre>
<p>I need to compare date time like:</p>
<pre><code>@p_date=14 AUG 2008 10:45:30
column_datetime=14 AUG 2008 10:45:30
</code></pre>
<p>How ... | [
{
"answer_id": 275766,
"author": "Kaniu",
"author_id": 3236,
"author_profile": "https://Stackoverflow.com/users/3236",
"pm_score": 0,
"selected": false,
"text": "<p>I don't quite understand your problem, but <a href=\"http://msdn.microsoft.com/en-us/library/ms189794.aspx\" rel=\"nofollow... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | ```
DECLARE @p_date DATETIME
SET @p_date = CONVERT( DATETIME, '14 AUG 2008 10:45:30',?)
SELECT *
FROM table1
WHERE column_datetime = @p_date
```
I need to compare date time like:
```
@p_date=14 AUG 2008 10:45:30
column_datetime=14 AUG 2008 10:45:30
```
How can I do this? | The question is unclear, but it looks like you are trying to do the equality match that isn't returning the rows you expect, so I'm guessing that the problem is that the milliseconds are being problematic. There are several approaches here:
1. format both values (as varchar
etc) using CONVERT : expensive for
CPU, can'... |
275,761 | <p>I have a textbox and a link button.
When I write some text, select some of it and then click the link button, the selected text from textbox must be show with a message box.</p>
<p>How can I do it?</p>
<hr />
<p>When I click the submit button for the textbox below, the message box must show <em>Lorem ipsum</em>. Bec... | [
{
"answer_id": 275797,
"author": "Shadow2531",
"author_id": 1697,
"author_profile": "https://Stackoverflow.com/users/1697",
"pm_score": 2,
"selected": false,
"text": "<p>For Opera, Firefox and Safari, you can use the following function:</p>\n\n<pre><code>function getTextFieldSelection(te... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/439507/"
] | I have a textbox and a link button.
When I write some text, select some of it and then click the link button, the selected text from textbox must be show with a message box.
How can I do it?
---
When I click the submit button for the textbox below, the message box must show *Lorem ipsum*. Because "Lorem ipsum" is se... | OK, here is the code I have:
```
function ShowSelection()
{
var textComponent = document.getElementById('Editor');
var selectedText;
if (textComponent.selectionStart !== undefined)
{ // Standards-compliant version
var startPos = textComponent.selectionStart;
var endPos = textComponent.selectionEnd;
... |
275,771 | <p>I need to get the values in the registers with GCC.</p>
<p>Something similar to this:</p>
<pre>
EAX=00000002 EBX=00000001 ECX=00000005 EDX=BFFC94C0
ESI=8184C544 EDI=00000000 EBP=0063FF78 ESP=0063FE3C
CF=0 SF=0 ZF=0 OF=0
</pre>
<p>Getting the 32-bit registers is easy enough, but I'm not sure what the simp... | [
{
"answer_id": 275775,
"author": "Marcos Lara",
"author_id": 30626,
"author_profile": "https://Stackoverflow.com/users/30626",
"pm_score": 0,
"selected": false,
"text": "<p>I think using Jcc's would be longer and not as clear using inline assembly.</p>\n\n<p>Here is what I currently have... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30626/"
] | I need to get the values in the registers with GCC.
Something similar to this:
```
EAX=00000002 EBX=00000001 ECX=00000005 EDX=BFFC94C0
ESI=8184C544 EDI=00000000 EBP=0063FF78 ESP=0063FE3C
CF=0 SF=0 ZF=0 OF=0
```
Getting the 32-bit registers is easy enough, but I'm not sure what the simplest way to get the ... | There is no need to use assembler just to get the registers.
You can just use setjmp. That will write all registers into a stucture of type jmp\_buf. It even kind of Works cross platform except for the fact that jmp\_buf itself is different for each architecture.
However, calling setjmp (and calling your assembler co... |
275,778 | <p>How can I draw something in JPanel that will stay the same and not be repainted, I am doing a traffic simulation program and I want the road to be drawn once because It will not change.
Thanks </p>
| [
{
"answer_id": 275783,
"author": "PhiLho",
"author_id": 15459,
"author_profile": "https://Stackoverflow.com/users/15459",
"pm_score": 2,
"selected": false,
"text": "<p>To my knowledge, no, unless there is a trick with transparent overlays.</p>\n\n<p>Most graphical applications I saw (and... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4885/"
] | How can I draw something in JPanel that will stay the same and not be repainted, I am doing a traffic simulation program and I want the road to be drawn once because It will not change.
Thanks | I'm not sure you actually want your road to never be repainted - repaint events fire (for example) when your window is resized, or when it becomes visible following another window obstructing it. If your panel never repaints then it'll look peculiar.
As far as I remember, Swing will only fire appropriate paint events ... |
275,781 | <p>Can anyone explain the difference between <code>Server.MapPath(".")</code>, <code>Server.MapPath("~")</code>, <code>Server.MapPath(@"\")</code> and <code>Server.MapPath("/")</code>?</p>
| [
{
"answer_id": 275791,
"author": "splattne",
"author_id": 6461,
"author_profile": "https://Stackoverflow.com/users/6461",
"pm_score": 11,
"selected": true,
"text": "<p><strong>Server.MapPath</strong> specifies the relative or virtual path to map <strong>to a physical directory</strong>.<... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275781",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2133/"
] | Can anyone explain the difference between `Server.MapPath(".")`, `Server.MapPath("~")`, `Server.MapPath(@"\")` and `Server.MapPath("/")`? | **Server.MapPath** specifies the relative or virtual path to map **to a physical directory**.
* `Server.MapPath(".")`1 returns the current physical directory of the file (e.g. aspx) being executed
* `Server.MapPath("..")` returns the parent directory
* `Server.MapPath("~")` returns the physical path to the root of the... |
275,795 | <p>E.g.</p>
<p>What's best out of these:</p>
<pre><code>std::string f() {}
</code></pre>
<p>or </p>
<pre><code>const std::string& f() {}
</code></pre>
| [
{
"answer_id": 275802,
"author": "OJ.",
"author_id": 611,
"author_profile": "https://Stackoverflow.com/users/611",
"pm_score": 2,
"selected": false,
"text": "<p>If you return a reference to a variable that is local to the function then you're going to end up with issues (depending on the... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275795",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | E.g.
What's best out of these:
```
std::string f() {}
```
or
```
const std::string& f() {}
``` | A function **should never return** a reference to a local object/variable since such objects go out of the scope and get destroyed when the function returns.
Differently, the function can return a const or non const reference to an object whose scope is not limited by the function context. Typical example is a custom... |
275,810 | <p>Is anyone using Castle MonoRail and ELMAH with success?</p>
<p>We are using a number of Resuces to present users with friendly error messages, but if we do this the exceptions never get as far as ELMAH as the MonoRail rescue intercepts them.</p>
<p>Ideally we want the user to see the rescue, but for the exception ... | [
{
"answer_id": 277626,
"author": "BigJump",
"author_id": 8542,
"author_profile": "https://Stackoverflow.com/users/8542",
"pm_score": 2,
"selected": false,
"text": "<p>After also posting on <a href=\"http://groups.google.com/group/elmah/browse_thread/thread/c81280722a05602f\" rel=\"nofoll... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8542/"
] | Is anyone using Castle MonoRail and ELMAH with success?
We are using a number of Resuces to present users with friendly error messages, but if we do this the exceptions never get as far as ELMAH as the MonoRail rescue intercepts them.
Ideally we want the user to see the rescue, but for the exception to be logged in E... | After looking at the links Macka posted, I wrote this simple monorail exception handler:
```
public class ElmahExceptionHandler : AbstractExceptionHandler {
public override void Process(IRailsEngineContext context) {
ErrorSignal.FromCurrentContext().Raise(context.LastException);
}
}
```
Then I regist... |
275,824 | <p>I am getting an 'Access to the path is denied" error message when running in debug mode. I have tried granting permissions to {MACHINENAME}\ASPNET and to NETWORK SERVICE but this hasn't made any difference. I have also tried < impersonate = true /> using an admin account, this also made no difference. So how do I... | [
{
"answer_id": 275830,
"author": "mdb",
"author_id": 8562,
"author_profile": "https://Stackoverflow.com/users/8562",
"pm_score": 5,
"selected": true,
"text": "<p>To find out which NT account your app is running under at any given time, do something like (in VB.NET):</p>\n\n<pre><code> ... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27805/"
] | I am getting an 'Access to the path is denied" error message when running in debug mode. I have tried granting permissions to {MACHINENAME}\ASPNET and to NETWORK SERVICE but this hasn't made any difference. I have also tried < impersonate = true /> using an admin account, this also made no difference. So how do I estab... | To find out which NT account your app is running under at any given time, do something like (in VB.NET):
```
Dim User = System.Security.Principal.WindowsIdentity.GetCurrent.User
Dim UserName = User.Translate(GetType(System.Security.Principal.NTAccount)).Value
```
When using ASP.NET, this account will match t... |
275,836 | <p>I'm looking for a way to display multiple colors in a single C#/.NET label. E.g the label is displaying a series of csv separated values that each take on a color depending on a bucket they fall into. I would prefer not to use multiple labels, as the values are variable length and I don't want to play with dynamic... | [
{
"answer_id": 275841,
"author": "ljs",
"author_id": 3394,
"author_profile": "https://Stackoverflow.com/users/3394",
"pm_score": -1,
"selected": false,
"text": "<p>There is no native support for this; you will either have to use multiple labels or find a 3rd-party control that will provi... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8207/"
] | I'm looking for a way to display multiple colors in a single C#/.NET label. E.g the label is displaying a series of csv separated values that each take on a color depending on a bucket they fall into. I would prefer not to use multiple labels, as the values are variable length and I don't want to play with dynamic layo... | There is no native control in .NET that does this. Your best bet is to write your own UserControl (call it RainbowLabel or something). Normally you would have a custom label control inherit directly from Label, but since you can't get multi-colored text in one label, you would just inherit from UserControl.
For render... |
275,842 | <p>Frequently, I've dug into apropos and docs looking for something like the following only to give up to get back to the task at hand:</p>
<p>(repeat-last-command)</p>
<p>do the last C- or M- command I just executed (to be rebound to a fn key)</p>
<p>or sometimes the related: </p>
<p>(describe-last-function)</p>
... | [
{
"answer_id": 275861,
"author": "Emerick Rogul",
"author_id": 33837,
"author_profile": "https://Stackoverflow.com/users/33837",
"pm_score": 7,
"selected": false,
"text": "<p>Repeat functionality is provided by the <code>repeat.el</code> Emacs Lisp package, which is included with standar... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35911/"
] | Frequently, I've dug into apropos and docs looking for something like the following only to give up to get back to the task at hand:
(repeat-last-command)
do the last C- or M- command I just executed (to be rebound to a fn key)
or sometimes the related:
(describe-last-function)
what keystroke did I just mistakenl... | with regards to '**describe-last-function**':
There's a variable `last-command` which is set to a symbol representative of the last thing you did. So this elisp snippet - `(describe-function last-command)` - ought to bring up the documentation for the thing that immediately happened.
So you could make a trivial worki... |
275,853 | <p>I myself am convinced that in a project I'm working on signed integers are the best choice in the majority of cases, even though the value contained within can never be negative. (Simpler reverse for loops, less chance for bugs, etc., in particular for integers which can only hold values between 0 and, say, 20, anyw... | [
{
"answer_id": 275873,
"author": "Johannes Schaub - litb",
"author_id": 34509,
"author_profile": "https://Stackoverflow.com/users/34509",
"pm_score": 3,
"selected": true,
"text": "<h2>I made this community wiki... Please edit it. I don't agree with the advice against \"int\" anymore. I n... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5422/"
] | I myself am convinced that in a project I'm working on signed integers are the best choice in the majority of cases, even though the value contained within can never be negative. (Simpler reverse for loops, less chance for bugs, etc., in particular for integers which can only hold values between 0 and, say, 20, anyway.... | I made this community wiki... Please edit it. I don't agree with the advice against "int" anymore. I now see it as not bad.
---------------------------------------------------------------------------------------------------------------------------
Yes, i agree with Richard. You should never use `'int'` as the counting... |
275,855 | <p>I have a custom attribute which can be assigned to a class, <code>[FooAttribute]</code>. What I would like to do, from within the attribute, is determine which type has actually used me. e.g. If I have:</p>
<pre><code>[FooAttribute]
public class Bar
{
}
</code></pre>
<p>In the code for FooAttribute, how can I dete... | [
{
"answer_id": 275887,
"author": "bruno conde",
"author_id": 31136,
"author_profile": "https://Stackoverflow.com/users/31136",
"pm_score": 1,
"selected": false,
"text": "<p>From your sentence \"I just want to set a friendly name using reflection\" I think you want to set the \"MyFriendly... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/986/"
] | I have a custom attribute which can be assigned to a class, `[FooAttribute]`. What I would like to do, from within the attribute, is determine which type has actually used me. e.g. If I have:
```
[FooAttribute]
public class Bar
{
}
```
In the code for FooAttribute, how can I determine it was Bar class that added me?... | First off, you might consider the existing `[DisplayName]` for keeping friendly names. As has already been covered, you simply can't get this information inside the attribute. You can look up the attribute from Bar, but in general, the only way to do it from the attribute would be to pass the type *into* the attribute ... |
275,868 | <p>How would I go about having a CMake buildsystem, which scans for source files now using <a href="http://www.cmake.org/cmake/help/cmake2.6docs.html#command:aux_source_directory" rel="noreferrer">AUX_SOURCE_DIRECTORY</a>, scan for header files too in the same directory, preferably using a similar command?</p>
<p>I di... | [
{
"answer_id": 293202,
"author": "JesperE",
"author_id": 13051,
"author_profile": "https://Stackoverflow.com/users/13051",
"pm_score": -1,
"selected": false,
"text": "<p>The documentation to AUX_SOURCE_DIRECTORY suggests that it was not intended to be used that way, so I'd rather doubt t... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5422/"
] | How would I go about having a CMake buildsystem, which scans for source files now using [AUX\_SOURCE\_DIRECTORY](http://www.cmake.org/cmake/help/cmake2.6docs.html#command:aux_source_directory), scan for header files too in the same directory, preferably using a similar command?
I didn't find an easy way to do this in ... | You can use the file(GLOB ... ) command. For example:
```
set(dir my_search_dir)
file (GLOB headers "${dir}/*.h")
message("My headers: " ${headers})
```
This command can also recurse, and list your files relative to a given path. See the ["file" command entry](http://www.cmake.org/cmake/help/cmake2.6docs.html#comman... |
275,871 | <p>Suppose I have code like this:</p>
<pre><code>template<class T, T initial_t> class Bar {
// something
}
</code></pre>
<p>And then try to use it like this:</p>
<pre><code>Bar<Foo*, NULL> foo_and_bar_whatever_it_means_;
</code></pre>
<p>GCC bails out with error (on the above line):</p>
<blockquote>
... | [
{
"answer_id": 275884,
"author": "Assaf Lavie",
"author_id": 11208,
"author_profile": "https://Stackoverflow.com/users/11208",
"pm_score": 0,
"selected": false,
"text": "<p>Have you tried:</p>\n\n<pre><code>Bar<Foo*, (Foo*)NULL> foo_and_bar_whatever_it_means_;\n</code></pre>\n\n<p>... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275871",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9403/"
] | Suppose I have code like this:
```
template<class T, T initial_t> class Bar {
// something
}
```
And then try to use it like this:
```
Bar<Foo*, NULL> foo_and_bar_whatever_it_means_;
```
GCC bails out with error (on the above line):
>
> could not convert template argument
> '0' to 'Foo\*'
>
>
>
I found t... | Rethinking your code is probably the best way to get around it. The thread you linked to includes a clear quote from the standard indicating that this isn't allowed. |
275,878 | <p>My client gets a <code>sec_error_unknown_issuer</code> error message when visiting <a href="https://mediant.ipmail.nl" rel="noreferrer">https://mediant.ipmail.nl</a> with Firefox.
I can't reproduce the error myself. I installed FF on a Vista and a XP machine and had no problems. FF on Ubuntu also works fine.</p>
<p... | [
{
"answer_id": 275882,
"author": "splattne",
"author_id": 6461,
"author_profile": "https://Stackoverflow.com/users/6461",
"pm_score": 2,
"selected": false,
"text": "<p>Which version of Firefox on which platform is your client using?</p>\n\n<p>The are people having the same problem as doc... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21238/"
] | My client gets a `sec_error_unknown_issuer` error message when visiting <https://mediant.ipmail.nl> with Firefox.
I can't reproduce the error myself. I installed FF on a Vista and a XP machine and had no problems. FF on Ubuntu also works fine.
Does anyone get the same error and does anyone have some clues for me so I ... | Just had the same problem with a Comodo Wildcard SSL cert. After reading the docs the solution is to ensure you include the certificate chain file they send you in your config i.e.
```
SSLCertificateChainFile /etc/ssl/crt/yourSERVERNAME.ca-bundle
```
Full details on [Comodo site](https://support.comodo.com/index.php... |
275,880 | <p>I'm working with JSTL in Eclipse, using the WTP. I have jstl and standard.jar in my WEB-INF/lib directory, and everything works. Eclipse is giving me this warning in my JSP:</p>
<p>The TagExtraInfo class for c:forEach (org.apache.taglibs.standard.tei.ForEachTEI) was not found on the build path.</p>
<p>I have JST... | [
{
"answer_id": 282338,
"author": "nitind",
"author_id": 27905,
"author_profile": "https://Stackoverflow.com/users/27905",
"pm_score": 1,
"selected": false,
"text": "<p>Are the jars actually on the build path? If so, you might try closing and reopening the project. Otherwise that messag... | 2008/11/09 | [
"https://Stackoverflow.com/questions/275880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2348/"
] | I'm working with JSTL in Eclipse, using the WTP. I have jstl and standard.jar in my WEB-INF/lib directory, and everything works. Eclipse is giving me this warning in my JSP:
The TagExtraInfo class for c:forEach (org.apache.taglibs.standard.tei.ForEachTEI) was not found on the build path.
I have JSTL included:
```
<%... | Eventually, I accidentally double-clicked the warning, and it took me to the source, which was editable. Then I fixed the problem myself. |