qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
16,737,372 | I Have a `gridview` in ASP, having `template Fields` containing `select`, `edit` and `delete` links each row, and the footer containing `insert` link.
There are two `dropdownlists` in each row, let's say: `Category` and `sub-category`, when I change the contents of `category DropDownList` the `sub-category DropDownLis... | 2013/05/24 | [
"https://Stackoverflow.com/questions/16737372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1522782/"
] | FindControl is not recursive and you have a number of `TableCell` controls in the `Cells` property on your `GridViewRow` before you get to the level where your control is, so changing it to something like this will work:
```
TableCell cell = (TableCell)e.Row.FindControl("idOfMyCellIfItHasOne");
DropDownList ddlCategor... | use in your dropdown **AutoPostBack="true"**
like that:
```
<asp:DropDownList ID="footer_id" AutoPostBack="true"
OnSelectedIndexChanged="footer_id_SelectedIndexChanged"
runat="server"></asp:DropDownList>
``` |
16,737,372 | I Have a `gridview` in ASP, having `template Fields` containing `select`, `edit` and `delete` links each row, and the footer containing `insert` link.
There are two `dropdownlists` in each row, let's say: `Category` and `sub-category`, when I change the contents of `category DropDownList` the `sub-category DropDownLis... | 2013/05/24 | [
"https://Stackoverflow.com/questions/16737372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1522782/"
] | It sounds like you want to bind data to the subcategory dropdownlist using the value you have selected in the category dropdownlist. You can do:
```
protected void ddlCategory_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow row = (GridViewRow)((DropDownList)sender).Parent.Parent;
DropDownList dd... | use in your dropdown **AutoPostBack="true"**
like that:
```
<asp:DropDownList ID="footer_id" AutoPostBack="true"
OnSelectedIndexChanged="footer_id_SelectedIndexChanged"
runat="server"></asp:DropDownList>
``` |
63,088,206 | I want to replace:
```
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:backgroundTint = "..."
...
android:orientation="horizontal">
```
with
```
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
x... | 2020/07/25 | [
"https://Stackoverflow.com/questions/63088206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/311130/"
] | You can use:
```
<style name="My.Bg.Dark" parent="">
<item name="backgroundTint">@color/og_background_dark</item>
</style>
``` | just use this code
```
<style name="MyStyleName" parent="">
<item name="backgroundTint">@color/green</item>
</style>
``` |
67,630,701 | Hello I am new to Django, I saw a line `path('dashboard/(?P<user>.*)/$'),` . I didn't understand this. I want to learn this part. But I don't know how to search on google and youtube about this. | 2021/05/21 | [
"https://Stackoverflow.com/questions/67630701",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14793957/"
] | Mmm, `enumerate` should do the trick.
```
names = ['Ada Log\n', 'Ena Blue\n', 'Kin Wall\n', 'Kin Wall\n', 'Foxy Rex\n', 'Esk Brown']
#Note second argument in enumerate tells us where to start
for count,name in enumerate(names,1):
print(f'[{count}] {name}')
```
output
```
[1] Ada Log
[2] Ena Blue
[3] Kin Wall... | Similar to @BuddyBob's solution:
```
names = ['Ada Log\n', 'Ena Blue\n', 'Kin Wall\n', 'Kin Wall\n', 'Foxy Rex\n', 'Esk Brown']
for count,name in enumerate(names, 1):
print(f'[{count}] {name}')
``` |
67,630,701 | Hello I am new to Django, I saw a line `path('dashboard/(?P<user>.*)/$'),` . I didn't understand this. I want to learn this part. But I don't know how to search on google and youtube about this. | 2021/05/21 | [
"https://Stackoverflow.com/questions/67630701",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14793957/"
] | Using a list comprehension with enumeration:
```py
inp = ['Ada Log\n', 'Ena Blue\n', 'Kin Wall\n', 'Foxy Rex\n', 'Esk Brown']
output = ''.join(['[' + str(ind + 1) + '] ' + x for ind, x in enumerate(inp)])
print(output)
```
This prints:
```
[1] Ada Log
[2] Ena Blue
[3] Kin Wall
[4] Foxy Rex
[5] Esk Brown
``` | Similar to @BuddyBob's solution:
```
names = ['Ada Log\n', 'Ena Blue\n', 'Kin Wall\n', 'Kin Wall\n', 'Foxy Rex\n', 'Esk Brown']
for count,name in enumerate(names, 1):
print(f'[{count}] {name}')
``` |
271,107 | Let $f$ be a real-valued continuous function on the interval $[0,1]$ and satisfy the following estimate
$$
\left|\int\_0^1 f(t) e^{st}dt\right|\le Cs^{\frac12},\quad s>1,
$$
where the constant $C$ is independent of $s$.
Can we assert that $f$ is identically zero on $[0,1]$? | 2017/05/31 | [
"https://mathoverflow.net/questions/271107",
"https://mathoverflow.net",
"https://mathoverflow.net/users/33232/"
] | Michael has essentially answered this in his comment, but let me make this more explicit.
In fact, a stronger statement is true: If $F(z)=\int\_0^1 f(t)e^{tz}\, dt$ satisfies $|F(s)|\lesssim e^{(a+\epsilon)s}$ for $s>1$ and all $\epsilon>0$ (but with possibly $\epsilon$ dependent implied constants), then $f=0$ on $[a,... | The answer is, yes.
Suppose $f\not\equiv0$. By [Stone–Weierstrass theorem](https://en.wikipedia.org/wiki/Stone%E2%80%93Weierstrass_theorem), there is a sequence of non-trivial polynomials $P\_n(t)$ converging uniformly to $f(t)$. That means, the inequality
$$
\left|\int\_0^1 P\_n(t) e^{st}dt\right|\le C's^{\frac12},\q... |
44,856,152 | I'm using Leaflet library for maps and I run into a small problem.
I have simple non-geographical map and on it I have a simple line connecting two coordinates. When someone clicks anywhere on the line, a Popup opens up. I am trying to display the coordinates of the clicked spot in the popup itself.
I tried doing som... | 2017/06/30 | [
"https://Stackoverflow.com/questions/44856152",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6484612/"
] | Please follow the `xml` convention for defining `string` in `strings.xml`
```
<string name="kick_info_pertama">Kick info pertama</string>
```
Please detect if your string really existed in `strings.xml` and use this code in your `Fragment`
```
getActivity().getString(R.string.your_resource_id);
``` | You should not use uppercase letters in a string value :
change KickInfoPertama to kickinfopertama and :
Try this :
kickInfo.setText(getString(R.string.kickinfopertama)); |
21,692,645 | I have a `View` and it was giving me screen coordinate respect to its parent.
I have tried `getTop()` and `getLeft()` method of view, still it is not working for me.
I want a coordinate from main screen? | 2014/02/11 | [
"https://Stackoverflow.com/questions/21692645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3295536/"
] | Just tested it out, and the easiest way I can see (which seems to work in Chrome at least, but may need further testing) is setting a cookie.
On logout do something like `setcookie('loggedout',1)`. You'll also need to do the opposite on login - `unset($_COOKIE['loggedout'])`
Then you just need some simple Javascript.... | Here is my below code to solve the issue. I set the cookie While login and deleted at logout. viceversa at Logout and Login also.
Script:
-------
```
function readCookie(name) {
var nameEQ = escape(name) + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.... |
2,462,514 | I could not understand this question on my textbook. It's in the chapter of Metric Spaces, and I do think it's refering to a metric induced by a function $f$.
What is the maximum number of points that a subspace $X \subset \mathbb{R}^2$ can have so that $\mathbb{R}^2$ induces the discrete metric in $X$? | 2017/10/08 | [
"https://math.stackexchange.com/questions/2462514",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/488911/"
] | Take three points in $A,B,C\in\mathbb{R}^2$ such that the distance between any two of them is $1$. For instance, you can take $A=(0,0)$, $B=(1,0)$, and $C=\left(\frac12,\frac{\sqrt3}2\right)$. Could there be a fourth point $D\in\mathbb{R}^2$ whose distance to the other three is also $1$? No, because then it would belon... | Suppose we have such an $X$. Note that $\mathbb{R}^2$ has a countable base, so every subspace too. And a discrete second countable space has at most countably many points as all sets $\{x\}$ must be in any base for $X$.
Directly: for every $x \in X$ pick rationals $q\_1,q\_2,r\_1, r\_2$ such that $\{x\} = ((q\_1,q\_2)... |
8,537,119 | Is it possible to show on **page source** ( **ctrl+U** ) the HTML elements I've added in JavaScript and jQuery codes? | 2011/12/16 | [
"https://Stackoverflow.com/questions/8537119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1101391/"
] | **No.**
The page source will always show you the HTML retrieved from the server.
Inspect the generated DOM tree instead, e.g. with Firebug (Firefox) or the Developer Tools (Chrome, Safari). | Nope, you just can see it on you firebug, developer tools, etc... |
8,537,119 | Is it possible to show on **page source** ( **ctrl+U** ) the HTML elements I've added in JavaScript and jQuery codes? | 2011/12/16 | [
"https://Stackoverflow.com/questions/8537119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1101391/"
] | **No.**
The page source will always show you the HTML retrieved from the server.
Inspect the generated DOM tree instead, e.g. with Firebug (Firefox) or the Developer Tools (Chrome, Safari). | No, but ever modern browser has a way/extension to see the *current* sourcecode (actually, the DOM tree), i.e. including everything done by JavaScript. |
8,537,119 | Is it possible to show on **page source** ( **ctrl+U** ) the HTML elements I've added in JavaScript and jQuery codes? | 2011/12/16 | [
"https://Stackoverflow.com/questions/8537119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1101391/"
] | **No.**
The page source will always show you the HTML retrieved from the server.
Inspect the generated DOM tree instead, e.g. with Firebug (Firefox) or the Developer Tools (Chrome, Safari). | Depending on the browser (i like chrome / firefox / safari for this) you want to look at developer tools. In firefox you can use firebug, in chrome it's Developer Tools and in Safari you have to turn on Developer menu through preferences. In all three cases, you want to look at the DOM inspector. |
8,537,119 | Is it possible to show on **page source** ( **ctrl+U** ) the HTML elements I've added in JavaScript and jQuery codes? | 2011/12/16 | [
"https://Stackoverflow.com/questions/8537119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1101391/"
] | Nope, you just can see it on you firebug, developer tools, etc... | No, but ever modern browser has a way/extension to see the *current* sourcecode (actually, the DOM tree), i.e. including everything done by JavaScript. |
8,537,119 | Is it possible to show on **page source** ( **ctrl+U** ) the HTML elements I've added in JavaScript and jQuery codes? | 2011/12/16 | [
"https://Stackoverflow.com/questions/8537119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1101391/"
] | Nope, you just can see it on you firebug, developer tools, etc... | Depending on the browser (i like chrome / firefox / safari for this) you want to look at developer tools. In firefox you can use firebug, in chrome it's Developer Tools and in Safari you have to turn on Developer menu through preferences. In all three cases, you want to look at the DOM inspector. |
13,919,535 | I am using following VB.NET code to copy an excel sheet in a same workbook, but the sheet names are written with (2) every time, what is wrong here?
```
Dim inp as Integer
inp=Val(Textbox1.Text)
oWB = oXL.Workbooks.Open("D:\testfile.xlsx")
oSheet = oWB.Worksheets("base")
With oWB
For i = 0 To inp - 1
oSheet.C... | 2012/12/17 | [
"https://Stackoverflow.com/questions/13919535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1461150/"
] | Try this (assuming your time index is POSIXct):
```
library(zoo)
st <- as.POSIXct("2012-01-21 18:45")
g <- seq(st, end(z), by = "15 min") # grid
na.approx(z, xout = g)
```
See `?na.approx.zoo` for more info.
**Note:** Since the question did not provide the data in reproducible form we do so here:
```
Lines <- "Id ... | I can't find a function in xts package(or zoo ) that approximate the ts given dates.
So, my idea is to insert NA in the original ts , for the given dates.
```
ids <- as.POSIXct( align.time(index(dat.xts),60*5)) # range dates
# I create an xts with NA
y <- xts(x=matrix(data=NA,nrow=dim(dat.xts)[1],
... |
13,919,535 | I am using following VB.NET code to copy an excel sheet in a same workbook, but the sheet names are written with (2) every time, what is wrong here?
```
Dim inp as Integer
inp=Val(Textbox1.Text)
oWB = oXL.Workbooks.Open("D:\testfile.xlsx")
oSheet = oWB.Worksheets("base")
With oWB
For i = 0 To inp - 1
oSheet.C... | 2012/12/17 | [
"https://Stackoverflow.com/questions/13919535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1461150/"
] | You can see the process as follow:
1. Build a *sequence* based on the *data* ranges.
2. Merge the *sequence* and the *data*.
3. Interpolate the values: constant or linear method.
**Creating the dataset:**
```
data1 <- read.table(text="1 2012-01-21 18:41:50 47.7 14.12 13.870 1005.70 -0.05277778
1 20... | I can't find a function in xts package(or zoo ) that approximate the ts given dates.
So, my idea is to insert NA in the original ts , for the given dates.
```
ids <- as.POSIXct( align.time(index(dat.xts),60*5)) # range dates
# I create an xts with NA
y <- xts(x=matrix(data=NA,nrow=dim(dat.xts)[1],
... |
13,919,535 | I am using following VB.NET code to copy an excel sheet in a same workbook, but the sheet names are written with (2) every time, what is wrong here?
```
Dim inp as Integer
inp=Val(Textbox1.Text)
oWB = oXL.Workbooks.Open("D:\testfile.xlsx")
oSheet = oWB.Worksheets("base")
With oWB
For i = 0 To inp - 1
oSheet.C... | 2012/12/17 | [
"https://Stackoverflow.com/questions/13919535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1461150/"
] | Try this (assuming your time index is POSIXct):
```
library(zoo)
st <- as.POSIXct("2012-01-21 18:45")
g <- seq(st, end(z), by = "15 min") # grid
na.approx(z, xout = g)
```
See `?na.approx.zoo` for more info.
**Note:** Since the question did not provide the data in reproducible form we do so here:
```
Lines <- "Id ... | You can see the process as follow:
1. Build a *sequence* based on the *data* ranges.
2. Merge the *sequence* and the *data*.
3. Interpolate the values: constant or linear method.
**Creating the dataset:**
```
data1 <- read.table(text="1 2012-01-21 18:41:50 47.7 14.12 13.870 1005.70 -0.05277778
1 20... |
1,728,629 | I've got the following objects:
```
CREATE FUNCTION CONSTFUNC RETURN INT
DETERMINISTIC
AS
BEGIN
RETURN 1;
END;
CREATE TABLE "FUNCTABLE" (
"ID" NUMBER(*,0) NOT NULL,
"VIRT" NUMBER GENERATED ALWAYS AS ("CONSTFUNC"()) NULL
);
```
however, the functable => constfunc dependency is not listed in all\_ or user\_ depen... | 2009/11/13 | [
"https://Stackoverflow.com/questions/1728629",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/79439/"
] | I just created your function and table in 11G (11.1) and can confirm your findings. I couldn't find anything in the Oracle docs either.
If you drop the function, the table status remains "VALID", but when you select from the table you get ORA-00904: "CHAMP"."CONSTFUNC": invalid identifier. This suggests that Oracle i... | The expression used to generate the virtual column is listed in the DATA\_DEFAULT column of the [DBA|ALL|USER]\_TAB\_COLUMNS views. |
23,216,963 | ```
double similarity = matcher.Match(features1, features2);
if (similarity== ?? ) // What sould i write here
{
Application.Exit();
}
```
if feature1 and feature2 matches than application should exit please help me | 2014/04/22 | [
"https://Stackoverflow.com/questions/23216963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2560424/"
] | Since `Double` is a *floating point type* we usually compare `Double` using ***tolerance***, e.g.
```
Double tolerance = 0.001;
// Instead of just features1 == features2
if (Math.Abs(features1 - features2) <= tolerance) {
Application.Exit();
}
``` | You need a boolean not a double.
```
bool similarity = matcher.Match(features1, features2);
if (similarity)
{
Application.Exit();
}
```
Make sure your mather.Match method returns a bool.
If you really need matcher.Match to return a double then please share your code with us so we can understand why you need th... |
50,354,606 | I want to use linq where clause for the below code. I have tried foreach loop, its working perfect. But large amount of data the foreach loop takes more time to process. Please give any your valuable suggestion to get result by using linq where clause.
```
string path = @"D:/NewFolder";
var _path = Directory.GetFiles... | 2018/05/15 | [
"https://Stackoverflow.com/questions/50354606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9610968/"
] | Depends on what is a "better way" for you. An alternative is a [`FOR` loop with an implicit cursor over a `SELECT`](https://docs.oracle.com/cloud/latest/db112/LNPLS/cursor_for_loop_statement.htm#LNPLS1155) .
```
FOR R IN (SELECT COUNT(VALUE_TX) AS COUNTE
FROM VALUE
WHERE TRUNC(DATE) =... | >
> Is there a better way to do this?
>
>
>
Sure it is.
The problem is this condition: `where trunc(date) = ....`. This prevent RDBMS from using an an index on `date` column. If the table is big, this can cause performance problems. I am not going to explain the reason, you can find an explanation elsewhere, fo... |
7,352,856 | What are `:a` and `ta` in sed?
Example:
```
sed -e :a -e '/\\$/N; s/\\\n//; ta'
``` | 2011/09/08 | [
"https://Stackoverflow.com/questions/7352856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/935509/"
] | The best sed [manual](http://www.grymoire.com/Unix/Sed.html#uh-59).
`t label` is [testing](http://www.grymoire.com/Unix/Sed.html#toc-uh-59), which goes to `label` (in your case label is "a") is substitute was performed. | :a and ta are pair. ":a" fist makes a lable . if the sequence is completed before lable "ta",goto ":a" keep executing.Just like the loop. |
5,872,745 | Could anyone explain to me why this does not render "VALUE IS DEFAULT"?
```
<TextBlock Text="{Binding Fail, StringFormat=VALUE IS {0}, FallbackValue=DEFAULT}" />
```
There is something tricky about this syntax I am missing. Thank you in advance. | 2011/05/03 | [
"https://Stackoverflow.com/questions/5872745",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/265706/"
] | Binding in WPF does not consider *StringFormat* while falling back to *FallbackValue* in case it fails.
You can use what **leon** suggested or go with *PriorityBinding*.
--EDIT--
This should work:
```
<TextBlock DataContext="{Binding Fail, FallbackValue=DEFAULT}" Text="{Binding StringFormat=VALUE IS {0}}" />
``` | The default fallback value is used for priority bindings, if you'd like to display "VALUE IS DEFAULT" for a fallback value, try the following.
```
<TextBlock Text="{Binding Fail, StringFormat=VALUE IS {0}, FallbackValue='VALUE IS DEFAULT'}" />
``` |
5,872,745 | Could anyone explain to me why this does not render "VALUE IS DEFAULT"?
```
<TextBlock Text="{Binding Fail, StringFormat=VALUE IS {0}, FallbackValue=DEFAULT}" />
```
There is something tricky about this syntax I am missing. Thank you in advance. | 2011/05/03 | [
"https://Stackoverflow.com/questions/5872745",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/265706/"
] | I think it could also work using the runs inside the TextBlock :
```
<TextBlock>
<Run Text="Value is : "/>
<Run Text="{Binding Fail,FallbackValue=Default}"/>
</TextBlock>
```
? | The default fallback value is used for priority bindings, if you'd like to display "VALUE IS DEFAULT" for a fallback value, try the following.
```
<TextBlock Text="{Binding Fail, StringFormat=VALUE IS {0}, FallbackValue='VALUE IS DEFAULT'}" />
``` |
5,872,745 | Could anyone explain to me why this does not render "VALUE IS DEFAULT"?
```
<TextBlock Text="{Binding Fail, StringFormat=VALUE IS {0}, FallbackValue=DEFAULT}" />
```
There is something tricky about this syntax I am missing. Thank you in advance. | 2011/05/03 | [
"https://Stackoverflow.com/questions/5872745",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/265706/"
] | Binding in WPF does not consider *StringFormat* while falling back to *FallbackValue* in case it fails.
You can use what **leon** suggested or go with *PriorityBinding*.
--EDIT--
This should work:
```
<TextBlock DataContext="{Binding Fail, FallbackValue=DEFAULT}" Text="{Binding StringFormat=VALUE IS {0}}" />
``` | I think it could also work using the runs inside the TextBlock :
```
<TextBlock>
<Run Text="Value is : "/>
<Run Text="{Binding Fail,FallbackValue=Default}"/>
</TextBlock>
```
? |
18,518,455 | I'm running several free, single-dyno apps on Heroku that go to "sleep" when idle for some time. I have a master site that is always awake and links/utilises these other apps that sometimes go to sleep. When I link to the sleeping apps from the main site there is that long loading wait whilst the other app wakes up.
W... | 2013/08/29 | [
"https://Stackoverflow.com/questions/18518455",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/465388/"
] | Here is possible solution: <https://coderwall.com/p/u0x3nw>
As answers containing only a link are not welcome here, I'll just duplicate link contents.
---
A common way to work around Heroku's idling policy is to set up a script to send a ping once an hour to keep the dyno alive.
You can use the following to add New... | The error is because heroku is on a different domain, right? If so, one option is to send a request from your server to Heroku. Even better would be to setup an automated task via cron to regularly poll the server. I recommend curl, because it's already installed in most linux hosts. This would do the same as what Edwa... |
18,518,455 | I'm running several free, single-dyno apps on Heroku that go to "sleep" when idle for some time. I have a master site that is always awake and links/utilises these other apps that sometimes go to sleep. When I link to the sleeping apps from the main site there is that long loading wait whilst the other app wakes up.
W... | 2013/08/29 | [
"https://Stackoverflow.com/questions/18518455",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/465388/"
] | Here is possible solution: <https://coderwall.com/p/u0x3nw>
As answers containing only a link are not welcome here, I'll just duplicate link contents.
---
A common way to work around Heroku's idling policy is to set up a script to send a ping once an hour to keep the dyno alive.
You can use the following to add New... | just do `curl -I <name of project>.herokuapp.com/<some file like index.html or sometext.txt>`
then add this as a cronjob |
18,518,455 | I'm running several free, single-dyno apps on Heroku that go to "sleep" when idle for some time. I have a master site that is always awake and links/utilises these other apps that sometimes go to sleep. When I link to the sleeping apps from the main site there is that long loading wait whilst the other app wakes up.
W... | 2013/08/29 | [
"https://Stackoverflow.com/questions/18518455",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/465388/"
] | The error is because heroku is on a different domain, right? If so, one option is to send a request from your server to Heroku. Even better would be to setup an automated task via cron to regularly poll the server. I recommend curl, because it's already installed in most linux hosts. This would do the same as what Edwa... | just do `curl -I <name of project>.herokuapp.com/<some file like index.html or sometext.txt>`
then add this as a cronjob |
42,339,173 | I have an issue - with the following code I am trying to find out what is stored at a certain address and how long my static variable is stored at this specific position. (I read that static variables are stored infinitely and was quite surprised - wanted to test if this was true).
The code defines a static variable (i... | 2017/02/20 | [
"https://Stackoverflow.com/questions/42339173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7384720/"
] | In any given program, the object might, or might not be stored in the address 0x1000020c0. There are no guarantees either way. The address of the object is decided at compile (or possibly at link) time. A change to the program can change the address.
If you never take the address of the local static object, and never ... | 1. Assuming specific address of number is not the best idea.
2. In C++, `static` inside a function body is created at first invocation or when first time C++ program flow encounters the variable. They are never created if never used.
3. If possible, a compiler may choose to optimize the `static` and replace it with the... |
42,339,173 | I have an issue - with the following code I am trying to find out what is stored at a certain address and how long my static variable is stored at this specific position. (I read that static variables are stored infinitely and was quite surprised - wanted to test if this was true).
The code defines a static variable (i... | 2017/02/20 | [
"https://Stackoverflow.com/questions/42339173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7384720/"
] | 1. Assuming specific address of number is not the best idea.
2. In C++, `static` inside a function body is created at first invocation or when first time C++ program flow encounters the variable. They are never created if never used.
3. If possible, a compiler may choose to optimize the `static` and replace it with the... | You're missing one very major statement here - the platform you're running this code on.
A static variable isn't stored "infinitely"; it's stored in that location for the duration of the program execution. If you're running on an embedded platform where your code jumps to main() at power-up, then you don't have anythi... |
42,339,173 | I have an issue - with the following code I am trying to find out what is stored at a certain address and how long my static variable is stored at this specific position. (I read that static variables are stored infinitely and was quite surprised - wanted to test if this was true).
The code defines a static variable (i... | 2017/02/20 | [
"https://Stackoverflow.com/questions/42339173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7384720/"
] | In any given program, the object might, or might not be stored in the address 0x1000020c0. There are no guarantees either way. The address of the object is decided at compile (or possibly at link) time. A change to the program can change the address.
If you never take the address of the local static object, and never ... | You're missing one very major statement here - the platform you're running this code on.
A static variable isn't stored "infinitely"; it's stored in that location for the duration of the program execution. If you're running on an embedded platform where your code jumps to main() at power-up, then you don't have anythi... |
305,320 | I used the following command to name my tables in the supplementary file. A question is how can I remove the space in 'Table S 1', so that it becomes 'Table S1'?
```
\documentclass[12pt,a4paper]{article}
\begin{document}
\renewcommand{\tablename}{Table S}
\begin{table}
\centering
\caption{Remove the space in 'T... | 2016/04/20 | [
"https://tex.stackexchange.com/questions/305320",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/91455/"
] | The proper way to do this should not be to change the *table name* but the *table number*. Replace `\renewcommand{\tablename}{Table S}` with
```
\renewcommand{\thetable}{S\arabic{table}}
```
If you change the appearance of the regular table numbers, then the following code retains that look and just adds an S, which... | Add a negative space of the size of a space:
```
\documentclass[12pt,a4paper]{article}
\begin{document}
\renewcommand{\tablename}{Table S\hskip-\the\fontdimen2\font\space }
\begin{table}
\centering
\caption{Remove the space in 'Table S 1', so that it becomes 'Table S1'}
\begin{tabular*}{\textwidth}{lcc}
\hline
&... |
305,320 | I used the following command to name my tables in the supplementary file. A question is how can I remove the space in 'Table S 1', so that it becomes 'Table S1'?
```
\documentclass[12pt,a4paper]{article}
\begin{document}
\renewcommand{\tablename}{Table S}
\begin{table}
\centering
\caption{Remove the space in 'T... | 2016/04/20 | [
"https://tex.stackexchange.com/questions/305320",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/91455/"
] | If you want that the “S” also appears in cross references, the correct way is to add it to `\thetable`:
```
\renewcommand{\thetable}{S\arabic{table}}
```
would do good in `article`, but it would not be good in `book`. For a “class independent” solution, add
```
\usepackage{etoolbox}
```
to your set of packages an... | Add a negative space of the size of a space:
```
\documentclass[12pt,a4paper]{article}
\begin{document}
\renewcommand{\tablename}{Table S\hskip-\the\fontdimen2\font\space }
\begin{table}
\centering
\caption{Remove the space in 'Table S 1', so that it becomes 'Table S1'}
\begin{tabular*}{\textwidth}{lcc}
\hline
&... |
305,320 | I used the following command to name my tables in the supplementary file. A question is how can I remove the space in 'Table S 1', so that it becomes 'Table S1'?
```
\documentclass[12pt,a4paper]{article}
\begin{document}
\renewcommand{\tablename}{Table S}
\begin{table}
\centering
\caption{Remove the space in 'T... | 2016/04/20 | [
"https://tex.stackexchange.com/questions/305320",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/91455/"
] | The proper way to do this should not be to change the *table name* but the *table number*. Replace `\renewcommand{\tablename}{Table S}` with
```
\renewcommand{\thetable}{S\arabic{table}}
```
If you change the appearance of the regular table numbers, then the following code retains that look and just adds an S, which... | If you want that the “S” also appears in cross references, the correct way is to add it to `\thetable`:
```
\renewcommand{\thetable}{S\arabic{table}}
```
would do good in `article`, but it would not be good in `book`. For a “class independent” solution, add
```
\usepackage{etoolbox}
```
to your set of packages an... |
25,543,233 | The following code unable to send an emails to customers and it not throwing any exception. The code it not send any email or exception but executed.I am completely new about the asp.net. Some one can help me how to resolve the problem.
**Code:**
```
try
{
String userName = "ramesh";
String passWord = "12345... | 2014/08/28 | [
"https://Stackoverflow.com/questions/25543233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2830120/"
] | You have to set `smtp.EnableSsl=true` and use port number `587`. Your final code will be this:
```
try
{
String userName = "ramesh";
String passWord = "123456";
String sendr = "ramesh@gmail.com";
String recer = "customer@yahoo.com";
String subject = "Comformation ";
String body = "Dear Customer";
MailMessage msgMail ... | ```
System.Net.Mail.MailMessage mm = new System.Net.Mail.MailMessage();
mm.From = new MailAddress("email@gmail.com");
mm.To.Add("email@gmail.com");
System.Net.Mail.Attachment attachment;
string strFileName;
strFileName = "Uploadfile/" + "200814062455PM_Admin_Screenshot (10).JPEG... |
80,851 | As we all know when you have a configurable product such as a T-Shirt in blue and red, you would create 2 simple products and 1 configurable product and each simple product would have its own stock level as you have a certain number of red t-shirts and a certain number of blue t-shirts.
My issue is that I want to sell... | 2015/09/03 | [
"https://magento.stackexchange.com/questions/80851",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/6414/"
] | Change
```
setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')
```
to
```
setLocation('<?php echo Mage::helper('checkout/cart')->getAddUrl($_product) ?>')
``` | **app/design/frontend/default/ezzy/template/catalog/product/view/addtocart.phtml**
```
<?php $_product = $this->getProduct(); ?>
<?php $buttonTitle = $this->__('Add to cart'); ?>
<?php if($_product->isSaleable()): ?>
<div class="add-to-cart">
<?php if(!$_product->isGrouped()): ?>
<div class="qt... |
15,262,121 | My iOS app crashes when pressing a button found in a custom view for the rightBarButtonItem. A custom view is used because the barButtonItem design requires more than just a button.
Here is the output of the crash:
```
[UIViewControllerWrapperView buttonPressed:]: unrecognized selector sent to instance 0x7669430]
***... | 2013/03/07 | [
"https://Stackoverflow.com/questions/15262121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/869936/"
] | `UIViewControllerWrapperView` is not calling your selector; your button is calling `-buttonPressed:` on the `UIViewControllerWrapperView`. Try [enabling zombies](https://stackoverflow.com/questions/2190227/how-do-i-set-up-nszombieenabled-in-xcode-4).
It looks like you're using `RightBarButtonItemVC` simply as a view l... | Direct Answers:
---------------
1. As suggested by @tc.'s answer, there is a disconnect somewhere between defining the view in a xib and using a View Controller (RightBarButtonItemVC) to define a custom view on a UIBarButtonItem, which is evident in the fact that UIViewControllerWrapperView receives the buttonPressed ... |
44,287,903 | Currently I have my viewcontroller as below
```
--highestView--
--topView--
--tableView--
```
I would like to make the `topView` dissappear when I scroll down which means `tableView` will be exactly below the `highestView`.
So upon scrolling up, I would like them to go back to original view which is like above.
... | 2017/05/31 | [
"https://Stackoverflow.com/questions/44287903",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6259538/"
] | You simply cannot. The installation process of [`uwp`](https://stackoverflow.com/questions/tagged/uwp) apps is standartized to work on all devices supported by the OS. Custom install actions do not make sense when writing the app for e.g. Hololense, PC, mobile and XBOX. You'll get nowhere.
>
> detect the installed .n... | You're essentially going to have to understand the ins-and-outs of sideloading your UWP LOB App. Once that is understood, you can simply write an installer the way you used to, and the installer would call all of the appropriate powershell commands for most of the workflows, and setup scheduled tasks for when the user ... |
5,440,168 | I have below code and I am getting exception:
>
> There is already an open `DataReader` associated with this `Connection` which must be closed first.
>
>
>
I am using Visual Studio 2010/.Net 4.0 and MySQL for this project. Basically I am trying to run another SQL statement while using data reader to do my other t... | 2011/03/26 | [
"https://Stackoverflow.com/questions/5440168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552918/"
] | Just use `MultipleActiveResultSets=True` in your connection string. | Add `MultipleActiveResultSets=true` to the provider part of your connection string
example in the file appsettings.json
```
"ConnectionStrings": {
"EmployeeDBConnection": "server=(localdb)\\MSSQLLocalDB;database=YourDatabasename;Trusted_Connection=true;MultipleActiveResultSets=true"}
``` |
5,440,168 | I have below code and I am getting exception:
>
> There is already an open `DataReader` associated with this `Connection` which must be closed first.
>
>
>
I am using Visual Studio 2010/.Net 4.0 and MySQL for this project. Basically I am trying to run another SQL statement while using data reader to do my other t... | 2011/03/26 | [
"https://Stackoverflow.com/questions/5440168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552918/"
] | Add `MultipleActiveResultSets=true` to the provider part of your connection string
example in the file appsettings.json
```
"ConnectionStrings": {
"EmployeeDBConnection": "server=(localdb)\\MSSQLLocalDB;database=YourDatabasename;Trusted_Connection=true;MultipleActiveResultSets=true"}
``` | You have to close the reader on top of your else condition. |
5,440,168 | I have below code and I am getting exception:
>
> There is already an open `DataReader` associated with this `Connection` which must be closed first.
>
>
>
I am using Visual Studio 2010/.Net 4.0 and MySQL for this project. Basically I am trying to run another SQL statement while using data reader to do my other t... | 2011/03/26 | [
"https://Stackoverflow.com/questions/5440168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552918/"
] | Add `MultipleActiveResultSets=true` to the provider part of your connection string
example in the file appsettings.json
```
"ConnectionStrings": {
"EmployeeDBConnection": "server=(localdb)\\MSSQLLocalDB;database=YourDatabasename;Trusted_Connection=true;MultipleActiveResultSets=true"}
``` | There is another potential reason for this - missing `await` keyword. |
5,440,168 | I have below code and I am getting exception:
>
> There is already an open `DataReader` associated with this `Connection` which must be closed first.
>
>
>
I am using Visual Studio 2010/.Net 4.0 and MySQL for this project. Basically I am trying to run another SQL statement while using data reader to do my other t... | 2011/03/26 | [
"https://Stackoverflow.com/questions/5440168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552918/"
] | You are using the same connection for the `DataReader` and the `ExecuteNonQuery`. This is not supported, [according to MSDN](http://msdn.microsoft.com/en-us/library/haa3afyz(v=vs.80).aspx):
>
> Note that while a DataReader is open, the Connection is in use
> exclusively by that DataReader. You cannot execute any com... | Add `MultipleActiveResultSets=true` to the provider part of your connection string
example in the file appsettings.json
```
"ConnectionStrings": {
"EmployeeDBConnection": "server=(localdb)\\MSSQLLocalDB;database=YourDatabasename;Trusted_Connection=true;MultipleActiveResultSets=true"}
``` |
5,440,168 | I have below code and I am getting exception:
>
> There is already an open `DataReader` associated with this `Connection` which must be closed first.
>
>
>
I am using Visual Studio 2010/.Net 4.0 and MySQL for this project. Basically I am trying to run another SQL statement while using data reader to do my other t... | 2011/03/26 | [
"https://Stackoverflow.com/questions/5440168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552918/"
] | You are trying to to an Insert (with `ExecuteNonQuery()`) on a SQL connection that is used by this reader already:
```
while (myReader.Read())
```
Either read all the values in a list first, close the reader and then do the insert, or use a new SQL connection. | You have to close the reader on top of your else condition. |
5,440,168 | I have below code and I am getting exception:
>
> There is already an open `DataReader` associated with this `Connection` which must be closed first.
>
>
>
I am using Visual Studio 2010/.Net 4.0 and MySQL for this project. Basically I am trying to run another SQL statement while using data reader to do my other t... | 2011/03/26 | [
"https://Stackoverflow.com/questions/5440168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552918/"
] | You are trying to to an Insert (with `ExecuteNonQuery()`) on a SQL connection that is used by this reader already:
```
while (myReader.Read())
```
Either read all the values in a list first, close the reader and then do the insert, or use a new SQL connection. | The issue you are running into is that you are starting up a second `MySqlCommand` while still reading back data with the `DataReader`. The MySQL connector only allows one concurrent query. You need to read the data into some structure, then close the reader, then process the data. Unfortunately you can't process the d... |
5,440,168 | I have below code and I am getting exception:
>
> There is already an open `DataReader` associated with this `Connection` which must be closed first.
>
>
>
I am using Visual Studio 2010/.Net 4.0 and MySQL for this project. Basically I am trying to run another SQL statement while using data reader to do my other t... | 2011/03/26 | [
"https://Stackoverflow.com/questions/5440168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552918/"
] | You are using the same connection for the `DataReader` and the `ExecuteNonQuery`. This is not supported, [according to MSDN](http://msdn.microsoft.com/en-us/library/haa3afyz(v=vs.80).aspx):
>
> Note that while a DataReader is open, the Connection is in use
> exclusively by that DataReader. You cannot execute any com... | This exception also happens if you don't use transaction properly. In my case, I put `transaction.Commit()` right after `command.ExecuteReaderAsync()`, did not wait with the transaction commiting until `reader.ReadAsync()` was called. The proper order:
1. Create transaction.
2. Create reader.
3. Read the data.
4. Comm... |
5,440,168 | I have below code and I am getting exception:
>
> There is already an open `DataReader` associated with this `Connection` which must be closed first.
>
>
>
I am using Visual Studio 2010/.Net 4.0 and MySQL for this project. Basically I am trying to run another SQL statement while using data reader to do my other t... | 2011/03/26 | [
"https://Stackoverflow.com/questions/5440168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552918/"
] | You are using the same connection for the `DataReader` and the `ExecuteNonQuery`. This is not supported, [according to MSDN](http://msdn.microsoft.com/en-us/library/haa3afyz(v=vs.80).aspx):
>
> Note that while a DataReader is open, the Connection is in use
> exclusively by that DataReader. You cannot execute any com... | There is another potential reason for this - missing `await` keyword. |
5,440,168 | I have below code and I am getting exception:
>
> There is already an open `DataReader` associated with this `Connection` which must be closed first.
>
>
>
I am using Visual Studio 2010/.Net 4.0 and MySQL for this project. Basically I am trying to run another SQL statement while using data reader to do my other t... | 2011/03/26 | [
"https://Stackoverflow.com/questions/5440168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552918/"
] | Always, always, always put disposable objects inside of using statements. I can't see how you've instantiated your DataReader but you should do it like this:
```
using (Connection c = ...)
{
using (DataReader dr = ...)
{
//Work with dr in here.
}
}
//Now the connection and reader have been closed a... | You have to close the reader on top of your else condition. |
5,440,168 | I have below code and I am getting exception:
>
> There is already an open `DataReader` associated with this `Connection` which must be closed first.
>
>
>
I am using Visual Studio 2010/.Net 4.0 and MySQL for this project. Basically I am trying to run another SQL statement while using data reader to do my other t... | 2011/03/26 | [
"https://Stackoverflow.com/questions/5440168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/552918/"
] | You are trying to to an Insert (with `ExecuteNonQuery()`) on a SQL connection that is used by this reader already:
```
while (myReader.Read())
```
Either read all the values in a list first, close the reader and then do the insert, or use a new SQL connection. | This exception also happens if you don't use transaction properly. In my case, I put `transaction.Commit()` right after `command.ExecuteReaderAsync()`, did not wait with the transaction commiting until `reader.ReadAsync()` was called. The proper order:
1. Create transaction.
2. Create reader.
3. Read the data.
4. Comm... |
20,109,788 | I have two query's in C# running in a datagridview, one is to show all data. the other is set to display in the footer. The footer is showing, just not displaying my query.
**query one (with footer)**
```
protected void Button2_Click(object sender, EventArgs e)
{
MySqlCommand cmd = new MySqlCommand("SELECT * FROM ... | 2013/11/21 | [
"https://Stackoverflow.com/questions/20109788",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2975042/"
] | PHP's XPath Processor only supports XPath 1.0, which does not allow alternations in path steps. A valid **XPath 2.0** expression would have been
```none
//table/tbody/tr/td/(input, textarea)
```
---
**XPath 1.0** requires you to either provide full paths like this:
```none
//table/tbody/tr/td/input | //table/tbod... | Untested in Behat/PHP, but this is how it would look if following the XPath syntax.
```
//table/tbody/tr/td/input | //table/tbody/tr/td/textarea
``` |
7,921,689 | In my application some values internally have their range from 0. But user should see this range starting from 1. I thought it would be appropriate to move this offseting stuff into presentation. In this case it is JSpinner component. So that I could specify in contructor if there is an offset (not all values have it).... | 2011/10/27 | [
"https://Stackoverflow.com/questions/7921689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/966758/"
] | Don't mingle your program's data model and the spinner's number model; keep them separate. Delegate to a private `SpinnerNumberModel` having the correct presentation range, 1..*n*. Provide an accessor that returns values in the desired range, 0..*n*–1.
>
> Provide the method `getAdjustedValue()`, which is basically `... | I think that [CyclingSpinnerListModel](http://download.oracle.com/javase/tutorial/uiswing/examples/components/SpinnerDemoProject/src/components/CyclingSpinnerListModel.java) can do that |
72,761,100 | I want to print a javascript array of images in random order but expect the middle one I want this one g.jpg to stay in it is positions
right now all of them are shuffle, how to separate or absolute g.jpg position.
I think I need to add a different class name for g.jpg but I don't know how to do it.
```html
<html>
<h... | 2022/06/26 | [
"https://Stackoverflow.com/questions/72761100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15098759/"
] | ```js
curarr.splice(3, 0, ...otherObj)
``` | With the splice method, you can add or delete elements from a specific index.
For more resources.
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice>
```js
const currarr = [{id:1,name:"abc"},{id:2,name:"efg"},{id:3,name:"hij"},{id:4,name:"klm"},{id:5,name:"nop"}];
const o... |
72,761,100 | I want to print a javascript array of images in random order but expect the middle one I want this one g.jpg to stay in it is positions
right now all of them are shuffle, how to separate or absolute g.jpg position.
I think I need to add a different class name for g.jpg but I don't know how to do it.
```html
<html>
<h... | 2022/06/26 | [
"https://Stackoverflow.com/questions/72761100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15098759/"
] | ```js
curarr.splice(3, 0, ...otherObj)
``` | The slice() method returns a shallow copy of a portion of an array into a new array object selected from start to end (end not included) where start and end represent the index of items in that array. The original array will not be modified.
for more checkout below links
[Mozila](https://developer.mozilla.org/en-US/do... |
39,330,609 | I am new to Angularjs and wondering how to check the `token`'s expire date and time before sending any request.
I googled and found there are concepts like `interceptors` and `decorators` in angular but I am a bit confused which one to use and how. Or is there any better way to do it.
**What am I doing right now?**
... | 2016/09/05 | [
"https://Stackoverflow.com/questions/39330609",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4221433/"
] | Using php's [output buffering](http://php.net/manual/en/book.outcontrol.php)
```
// start output buffering
ob_start();
// create your page
// once the page is ready, measure the size of the output buffer
$length = ob_get_length();
// and emit the page, stop buffering and flush the buffer
ob_get_flush();
```
As usu... | You can see this in your webserver's access log file.
But you can also code some php to get an answer like this:
```
ob_start();
echo "your content"
$data = ob_get_contents();
$size = strlen($data);
```
see also: [Measure string size in Bytes in php](https://stackoverflow.com/questions/7568949/measure-string-siz... |
12,958,749 | I am learning operator overloading. "out" is being used instead of "cout" when overloading "<<" operator. I don't understand why.
```
ostream &operator<<( ostream &out, const IntList &L ) {
out << "[ ";
for (int k=0; k< L.numItems; k++) {
out << L.Items[k] << ' ';
}
out << ']';
}
```
I want to a... | 2012/10/18 | [
"https://Stackoverflow.com/questions/12958749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559792/"
] | What you are looking at is a overloaded "stream insertion" operator, allowing some custom class to be written to an `ostream` object using the typical `cout << myObject` syntax.
The variable in this case is called `out` because that's the name they've given to the `ostream` object being passed into the function, which... | >
> I want to ask differences between cout and out and what happens if I use cout instead of out. Thanks for answers.
>
>
>
In this case, an `ostream&` (`out`) is a parameter passed to the function. This allows the `operator<<` to work on *any* `ostream`.
[`cout`](http://www.cplusplus.com/reference/iostream/cout/... |
12,958,749 | I am learning operator overloading. "out" is being used instead of "cout" when overloading "<<" operator. I don't understand why.
```
ostream &operator<<( ostream &out, const IntList &L ) {
out << "[ ";
for (int k=0; k< L.numItems; k++) {
out << L.Items[k] << ' ';
}
out << ']';
}
```
I want to a... | 2012/10/18 | [
"https://Stackoverflow.com/questions/12958749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559792/"
] | What you are looking at is a overloaded "stream insertion" operator, allowing some custom class to be written to an `ostream` object using the typical `cout << myObject` syntax.
The variable in this case is called `out` because that's the name they've given to the `ostream` object being passed into the function, which... | out is the name of the ostream object passed to the overloaded operator (inside the implementation of the operator).
The overloaded operator allows you to write code like this
```
IntList i;
cout<<i;
```
or
```
cerr<<i;
```
In the implementation if you substituted *out* with *cout*, then the second call
```
ce... |
12,958,749 | I am learning operator overloading. "out" is being used instead of "cout" when overloading "<<" operator. I don't understand why.
```
ostream &operator<<( ostream &out, const IntList &L ) {
out << "[ ";
for (int k=0; k< L.numItems; k++) {
out << L.Items[k] << ' ';
}
out << ']';
}
```
I want to a... | 2012/10/18 | [
"https://Stackoverflow.com/questions/12958749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559792/"
] | What you are looking at is a overloaded "stream insertion" operator, allowing some custom class to be written to an `ostream` object using the typical `cout << myObject` syntax.
The variable in this case is called `out` because that's the name they've given to the `ostream` object being passed into the function, which... | The critical thing here is really the types in the function signature: as long as it's a freestanding function with two parameters - one of type `std::ostream&` and the other able to be matched by the value to be streamed, then the function body will be invoked. It should return a reference to the stream to allow chain... |
12,958,749 | I am learning operator overloading. "out" is being used instead of "cout" when overloading "<<" operator. I don't understand why.
```
ostream &operator<<( ostream &out, const IntList &L ) {
out << "[ ";
for (int k=0; k< L.numItems; k++) {
out << L.Items[k] << ' ';
}
out << ']';
}
```
I want to a... | 2012/10/18 | [
"https://Stackoverflow.com/questions/12958749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559792/"
] | >
> I want to ask differences between cout and out and what happens if I use cout instead of out. Thanks for answers.
>
>
>
In this case, an `ostream&` (`out`) is a parameter passed to the function. This allows the `operator<<` to work on *any* `ostream`.
[`cout`](http://www.cplusplus.com/reference/iostream/cout/... | out is the name of the ostream object passed to the overloaded operator (inside the implementation of the operator).
The overloaded operator allows you to write code like this
```
IntList i;
cout<<i;
```
or
```
cerr<<i;
```
In the implementation if you substituted *out* with *cout*, then the second call
```
ce... |
12,958,749 | I am learning operator overloading. "out" is being used instead of "cout" when overloading "<<" operator. I don't understand why.
```
ostream &operator<<( ostream &out, const IntList &L ) {
out << "[ ";
for (int k=0; k< L.numItems; k++) {
out << L.Items[k] << ' ';
}
out << ']';
}
```
I want to a... | 2012/10/18 | [
"https://Stackoverflow.com/questions/12958749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559792/"
] | >
> I want to ask differences between cout and out and what happens if I use cout instead of out. Thanks for answers.
>
>
>
In this case, an `ostream&` (`out`) is a parameter passed to the function. This allows the `operator<<` to work on *any* `ostream`.
[`cout`](http://www.cplusplus.com/reference/iostream/cout/... | The critical thing here is really the types in the function signature: as long as it's a freestanding function with two parameters - one of type `std::ostream&` and the other able to be matched by the value to be streamed, then the function body will be invoked. It should return a reference to the stream to allow chain... |
12,958,749 | I am learning operator overloading. "out" is being used instead of "cout" when overloading "<<" operator. I don't understand why.
```
ostream &operator<<( ostream &out, const IntList &L ) {
out << "[ ";
for (int k=0; k< L.numItems; k++) {
out << L.Items[k] << ' ';
}
out << ']';
}
```
I want to a... | 2012/10/18 | [
"https://Stackoverflow.com/questions/12958749",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559792/"
] | out is the name of the ostream object passed to the overloaded operator (inside the implementation of the operator).
The overloaded operator allows you to write code like this
```
IntList i;
cout<<i;
```
or
```
cerr<<i;
```
In the implementation if you substituted *out* with *cout*, then the second call
```
ce... | The critical thing here is really the types in the function signature: as long as it's a freestanding function with two parameters - one of type `std::ostream&` and the other able to be matched by the value to be streamed, then the function body will be invoked. It should return a reference to the stream to allow chain... |
4,875,075 | I'm working on a program that does heavy read/write random access on huge file (till 64 GB). Files are specifically structured and to make access on them I've created a framework; after a while I tried to test performance on it and I've noticed that on preallocated file sequential write operations are too slow to be ac... | 2011/02/02 | [
"https://Stackoverflow.com/questions/4875075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/600055/"
] | Overrides must be the same signature as what they are overriding, so you can't change the type of a field. | Another option than trying to override in this fashion is to make your class generic;
```
public abstract class MyClass<T>
{
public T MyValue{ get; set;}
}
public class MyIntClass : MyClass<int>
{}
public class MyLongClass : MyClass<long>
{}
``` |
4,875,075 | I'm working on a program that does heavy read/write random access on huge file (till 64 GB). Files are specifically structured and to make access on them I've created a framework; after a while I tried to test performance on it and I've noticed that on preallocated file sequential write operations are too slow to be ac... | 2011/02/02 | [
"https://Stackoverflow.com/questions/4875075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/600055/"
] | Overrides must be the same signature as what they are overriding, so you can't change the type of a field. | You're not overriding the `MyInt` field, you're creating a new field, through which you have to specified `new`:
```
protected new Long MyInt = 0;
```
If you code is accessing the class as an instance of your base class, it will access it as `Int32`, if you call your subclass directly, it will access it as `Long`:
... |
4,875,075 | I'm working on a program that does heavy read/write random access on huge file (till 64 GB). Files are specifically structured and to make access on them I've created a framework; after a while I tried to test performance on it and I've noticed that on preallocated file sequential write operations are too slow to be ac... | 2011/02/02 | [
"https://Stackoverflow.com/questions/4875075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/600055/"
] | Overrides must be the same signature as what they are overriding, so you can't change the type of a field. | You can use either the [override](http://msdn.microsoft.com/de-de/library/ebca9ah3%28v=vs.80%29.aspx) or the [new](http://msdn.microsoft.com/en-us/library/435f1dw2%28v=vs.80%29.aspx) modifier for the property to override it. Still, the two properties need to be the same type. The difference is that `override` is also c... |
4,875,075 | I'm working on a program that does heavy read/write random access on huge file (till 64 GB). Files are specifically structured and to make access on them I've created a framework; after a while I tried to test performance on it and I've noticed that on preallocated file sequential write operations are too slow to be ac... | 2011/02/02 | [
"https://Stackoverflow.com/questions/4875075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/600055/"
] | Another option than trying to override in this fashion is to make your class generic;
```
public abstract class MyClass<T>
{
public T MyValue{ get; set;}
}
public class MyIntClass : MyClass<int>
{}
public class MyLongClass : MyClass<long>
{}
``` | You can use either the [override](http://msdn.microsoft.com/de-de/library/ebca9ah3%28v=vs.80%29.aspx) or the [new](http://msdn.microsoft.com/en-us/library/435f1dw2%28v=vs.80%29.aspx) modifier for the property to override it. Still, the two properties need to be the same type. The difference is that `override` is also c... |
4,875,075 | I'm working on a program that does heavy read/write random access on huge file (till 64 GB). Files are specifically structured and to make access on them I've created a framework; after a while I tried to test performance on it and I've noticed that on preallocated file sequential write operations are too slow to be ac... | 2011/02/02 | [
"https://Stackoverflow.com/questions/4875075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/600055/"
] | You're not overriding the `MyInt` field, you're creating a new field, through which you have to specified `new`:
```
protected new Long MyInt = 0;
```
If you code is accessing the class as an instance of your base class, it will access it as `Int32`, if you call your subclass directly, it will access it as `Long`:
... | You can use either the [override](http://msdn.microsoft.com/de-de/library/ebca9ah3%28v=vs.80%29.aspx) or the [new](http://msdn.microsoft.com/en-us/library/435f1dw2%28v=vs.80%29.aspx) modifier for the property to override it. Still, the two properties need to be the same type. The difference is that `override` is also c... |
39,051,066 | I have been using `display: table` for my `html` along with `display: table-cell` for my `body` lately, to make all of the contents of my page appear at the very center of the screen. While, this works with paragraphs, headings, inputs and labels etc.(as far as I have tested at least), it doesn't seem to work with `div... | 2016/08/20 | [
"https://Stackoverflow.com/questions/39051066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1650200/"
] | Just add `margin: 0 auto;`.. Working right.
```css
html {
display: table;
height: 100%;
width: 100%;
text-align: center;
}
body {
display: table-cell;
vertical-align: middle;
}
.hidden {
display: none;
}
.leaf {
border-radius: 15px 2px 15px 2px;
border: 1px solid green;
background-c... | Just add *margin: 0 auto;* to .leaf class.
```css
html {
display: table;
height: 100%;
width: 100%;
text-align: center;
}
body {
display: table-cell;
vertical-align: middle;
}
.hidden {
display: none;
}
.leaf {
margin: 0 auto;
border-radius: 15px 2px 15px 2px;
border: 1px solid gree... |
9,618,820 | I'm working on an asp.net project which has a form with a file attachment capability. Since I'm uploading the form on a server, I can't use a physical path. How do I use the asp:FileUpload with a virtual path? | 2012/03/08 | [
"https://Stackoverflow.com/questions/9618820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/971115/"
] | If it's an offline app (ie, you've defined a cache manifest) be sure to allow the network request.
See [HTML5 Appcache causing problems with Google Analytics](https://stackoverflow.com/questions/14410974/html5-appcache-causing-problems-with-google-analytics) | I've noticed same thing on my browser some time ago.
Did you sing in to chrome using your Google account maybe? Or did you choose in any way to opt-out from collecting data on Google Analytics ?
Maybe Google remembers that option and uses it on Chrome when you are singed in..
BTW. I can normally open <http://www.goo... |
9,618,820 | I'm working on an asp.net project which has a form with a file attachment capability. Since I'm uploading the form on a server, I can't use a physical path. How do I use the asp:FileUpload with a virtual path? | 2012/03/08 | [
"https://Stackoverflow.com/questions/9618820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/971115/"
] | It could also be your hosts file, here's mine:
```
$ grep -ni "google-analytics.com" /etc/hosts
6203:# 127.0.0.1 ssl.google-analytics.com #[disabled = Firefox issues]
6204:127.0.0.1 www.google-analytics.com #[Google Analytics]
``` | I've noticed same thing on my browser some time ago.
Did you sing in to chrome using your Google account maybe? Or did you choose in any way to opt-out from collecting data on Google Analytics ?
Maybe Google remembers that option and uses it on Chrome when you are singed in..
BTW. I can normally open <http://www.goo... |
9,618,820 | I'm working on an asp.net project which has a form with a file attachment capability. Since I'm uploading the form on a server, I can't use a physical path. How do I use the asp:FileUpload with a virtual path? | 2012/03/08 | [
"https://Stackoverflow.com/questions/9618820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/971115/"
] | It could also be your hosts file, here's mine:
```
$ grep -ni "google-analytics.com" /etc/hosts
6203:# 127.0.0.1 ssl.google-analytics.com #[disabled = Firefox issues]
6204:127.0.0.1 www.google-analytics.com #[Google Analytics]
``` | The reason you are running into problems is because AdBlock will block this script if and only if it does not go through `https`. Notice the error you get it contains an `http:` protocol reference.
All you need to do is change the snippet to force it to go through an ssl connection by adding an explicit protocol inste... |
9,618,820 | I'm working on an asp.net project which has a form with a file attachment capability. Since I'm uploading the form on a server, I can't use a physical path. How do I use the asp:FileUpload with a virtual path? | 2012/03/08 | [
"https://Stackoverflow.com/questions/9618820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/971115/"
] | **2019 update**
This has become very widespread now.
**Solutions**
1. Ask people to unblock your website, (bad idea from personal experience)
2. Host google analytics script locally (bad idea) because google says so [HERE](https://support.google.com/analytics/answer/1032389?hl=en)
>
> Referencing the JavaScript fi... | Ensure [Fiddler](http://www.telerik.com/fiddler) (or similar proxy) is not active. |
9,618,820 | I'm working on an asp.net project which has a form with a file attachment capability. Since I'm uploading the form on a server, I can't use a physical path. How do I use the asp:FileUpload with a virtual path? | 2012/03/08 | [
"https://Stackoverflow.com/questions/9618820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/971115/"
] | **2019 update**
This has become very widespread now.
**Solutions**
1. Ask people to unblock your website, (bad idea from personal experience)
2. Host google analytics script locally (bad idea) because google says so [HERE](https://support.google.com/analytics/answer/1032389?hl=en)
>
> Referencing the JavaScript fi... | I've noticed same thing on my browser some time ago.
Did you sing in to chrome using your Google account maybe? Or did you choose in any way to opt-out from collecting data on Google Analytics ?
Maybe Google remembers that option and uses it on Chrome when you are singed in..
BTW. I can normally open <http://www.goo... |
9,618,820 | I'm working on an asp.net project which has a form with a file attachment capability. Since I'm uploading the form on a server, I can't use a physical path. How do I use the asp:FileUpload with a virtual path? | 2012/03/08 | [
"https://Stackoverflow.com/questions/9618820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/971115/"
] | The reason you are running into problems is because AdBlock will block this script if and only if it does not go through `https`. Notice the error you get it contains an `http:` protocol reference.
All you need to do is change the snippet to force it to go through an ssl connection by adding an explicit protocol inste... | Ensure [Fiddler](http://www.telerik.com/fiddler) (or similar proxy) is not active. |
9,618,820 | I'm working on an asp.net project which has a form with a file attachment capability. Since I'm uploading the form on a server, I can't use a physical path. How do I use the asp:FileUpload with a virtual path? | 2012/03/08 | [
"https://Stackoverflow.com/questions/9618820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/971115/"
] | It was a problem with AdBlock. I disabled it and now it loads it normally.
**yagudaev** suggests (read answers below) that in order to keep AdBlock from blocking Google Analytics, you need to edit the snippet provided and explicitly use `https://` instead of the protocol-relative URL by default. This means changing
... | If it's an offline app (ie, you've defined a cache manifest) be sure to allow the network request.
See [HTML5 Appcache causing problems with Google Analytics](https://stackoverflow.com/questions/14410974/html5-appcache-causing-problems-with-google-analytics) |
9,618,820 | I'm working on an asp.net project which has a form with a file attachment capability. Since I'm uploading the form on a server, I can't use a physical path. How do I use the asp:FileUpload with a virtual path? | 2012/03/08 | [
"https://Stackoverflow.com/questions/9618820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/971115/"
] | It was a problem with AdBlock. I disabled it and now it loads it normally.
**yagudaev** suggests (read answers below) that in order to keep AdBlock from blocking Google Analytics, you need to edit the snippet provided and explicitly use `https://` instead of the protocol-relative URL by default. This means changing
... | I've noticed same thing on my browser some time ago.
Did you sing in to chrome using your Google account maybe? Or did you choose in any way to opt-out from collecting data on Google Analytics ?
Maybe Google remembers that option and uses it on Chrome when you are singed in..
BTW. I can normally open <http://www.goo... |
9,618,820 | I'm working on an asp.net project which has a form with a file attachment capability. Since I'm uploading the form on a server, I can't use a physical path. How do I use the asp:FileUpload with a virtual path? | 2012/03/08 | [
"https://Stackoverflow.com/questions/9618820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/971115/"
] | This error is commonly caused due to one of [*the extensions installed*](https://stackoverflow.com/a/50151073/4058484) within Chrome.
There are a few ways to debug and solve an ERR\_BLOCKED\_BY\_CLIENT message.
>
> * Disable the extension.
> * Whitelist the domain.
> * Debug the issue.
>
>
>
I would recommend ... | I've noticed same thing on my browser some time ago.
Did you sing in to chrome using your Google account maybe? Or did you choose in any way to opt-out from collecting data on Google Analytics ?
Maybe Google remembers that option and uses it on Chrome when you are singed in..
BTW. I can normally open <http://www.goo... |
9,618,820 | I'm working on an asp.net project which has a form with a file attachment capability. Since I'm uploading the form on a server, I can't use a physical path. How do I use the asp:FileUpload with a virtual path? | 2012/03/08 | [
"https://Stackoverflow.com/questions/9618820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/971115/"
] | It was a problem with AdBlock. I disabled it and now it loads it normally.
**yagudaev** suggests (read answers below) that in order to keep AdBlock from blocking Google Analytics, you need to edit the snippet provided and explicitly use `https://` instead of the protocol-relative URL by default. This means changing
... | **2019 update**
This has become very widespread now.
**Solutions**
1. Ask people to unblock your website, (bad idea from personal experience)
2. Host google analytics script locally (bad idea) because google says so [HERE](https://support.google.com/analytics/answer/1032389?hl=en)
>
> Referencing the JavaScript fi... |
13,000,008 | I've been trying to make this program in c++ with opencv that converts the image to greyscale and rotates the image afterwards, but the output I get is all kinds of messed up.
I have been searching for solutions and looking for help everywhere, but I haven't been able to find out what the heck I have done wrong so if ... | 2012/10/21 | [
"https://Stackoverflow.com/questions/13000008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1755692/"
] | Please replace:
```
Mat imRotate(im.cols * 2, im.rows * 2, im.type());
```
to use this one:
```
int size = static_cast<int>(sqrt(im.cols * im.cols/4 + im.rows * im.rows/4) * 2) + 1;
Mat imRotate(size, size , im.type());
```
Then update FuncRotate. I think you need to do something like this:
```
void Func... | I think at least there is something wrong on this line:
```
imRotate.at<unsigned char>(i,j) = im.at<unsigned char>(NewXPixel,NewYPixel);
```
... because `i` and `j` are supposed to loop over the original image, right?
Perhaps you meant something like:
```
imRotate.at<unsigned char>(NewXPixel,NewYPixel) = im.at<uns... |
70,189 | Using a cisco ASA is it possible manually bring up a lan to lan VPN tunnel & SA from the device, rather than having one of the systems that is part of the VPN initiate traffic to start the VPN?
I'd like to avoid having to trigger a ping on one of the systems in a VPN to start the VPN, to make troubleshooting a bit qui... | 2009/10/01 | [
"https://serverfault.com/questions/70189",
"https://serverfault.com",
"https://serverfault.com/users/11495/"
] | You have to present "interesting traffic" to the ASA. There's no command that would bring up the tunnel without traffic. | I second the advice of ynguldyn.
On the ISR series router you can test the VPN by having the router generate traffic for you, but there is no such option on the ASA platform. |
70,189 | Using a cisco ASA is it possible manually bring up a lan to lan VPN tunnel & SA from the device, rather than having one of the systems that is part of the VPN initiate traffic to start the VPN?
I'd like to avoid having to trigger a ping on one of the systems in a VPN to start the VPN, to make troubleshooting a bit qui... | 2009/10/01 | [
"https://serverfault.com/questions/70189",
"https://serverfault.com",
"https://serverfault.com/users/11495/"
] | You have to present "interesting traffic" to the ASA. There's no command that would bring up the tunnel without traffic. | ping inside "ip address at the other end of the tunnel"
Inside interface will have to be in the encryption domain.
This requires that the management-interface command is set to the inside interface - like "management-interface inside".
Let's say you have a bunch of interface mappings in your VPN tunnel to the other e... |
70,189 | Using a cisco ASA is it possible manually bring up a lan to lan VPN tunnel & SA from the device, rather than having one of the systems that is part of the VPN initiate traffic to start the VPN?
I'd like to avoid having to trigger a ping on one of the systems in a VPN to start the VPN, to make troubleshooting a bit qui... | 2009/10/01 | [
"https://serverfault.com/questions/70189",
"https://serverfault.com",
"https://serverfault.com/users/11495/"
] | You have to present "interesting traffic" to the ASA. There's no command that would bring up the tunnel without traffic. | Using 8.4+ we just added a Meinberg Windows NTP server for network time on the receiving end of the tunnel and added this to the remote ASA config:
ntp server xxx.xxx.xxx.xxx source inside prefer
(where xxx.xxx.xxx.xxx is the ip address of the ntp server) - that keeps our tunnels up indefinitely due to NTP generating... |
70,189 | Using a cisco ASA is it possible manually bring up a lan to lan VPN tunnel & SA from the device, rather than having one of the systems that is part of the VPN initiate traffic to start the VPN?
I'd like to avoid having to trigger a ping on one of the systems in a VPN to start the VPN, to make troubleshooting a bit qui... | 2009/10/01 | [
"https://serverfault.com/questions/70189",
"https://serverfault.com",
"https://serverfault.com/users/11495/"
] | I second the advice of ynguldyn.
On the ISR series router you can test the VPN by having the router generate traffic for you, but there is no such option on the ASA platform. | ping inside "ip address at the other end of the tunnel"
Inside interface will have to be in the encryption domain.
This requires that the management-interface command is set to the inside interface - like "management-interface inside".
Let's say you have a bunch of interface mappings in your VPN tunnel to the other e... |
70,189 | Using a cisco ASA is it possible manually bring up a lan to lan VPN tunnel & SA from the device, rather than having one of the systems that is part of the VPN initiate traffic to start the VPN?
I'd like to avoid having to trigger a ping on one of the systems in a VPN to start the VPN, to make troubleshooting a bit qui... | 2009/10/01 | [
"https://serverfault.com/questions/70189",
"https://serverfault.com",
"https://serverfault.com/users/11495/"
] | In Cisco ASA7.0 or greater OS, you can establish the tunnel by simulating interesting traffic with the `packet-tracer` command. Here's an example - substitute IP addresses from your networks:
```
packet-tracer input inside tcp 10.100.0.50 1250 10.200.0.100 80
Source Interface^ | Src IP^ Src Port | ... | I second the advice of ynguldyn.
On the ISR series router you can test the VPN by having the router generate traffic for you, but there is no such option on the ASA platform. |
70,189 | Using a cisco ASA is it possible manually bring up a lan to lan VPN tunnel & SA from the device, rather than having one of the systems that is part of the VPN initiate traffic to start the VPN?
I'd like to avoid having to trigger a ping on one of the systems in a VPN to start the VPN, to make troubleshooting a bit qui... | 2009/10/01 | [
"https://serverfault.com/questions/70189",
"https://serverfault.com",
"https://serverfault.com/users/11495/"
] | I second the advice of ynguldyn.
On the ISR series router you can test the VPN by having the router generate traffic for you, but there is no such option on the ASA platform. | Using 8.4+ we just added a Meinberg Windows NTP server for network time on the receiving end of the tunnel and added this to the remote ASA config:
ntp server xxx.xxx.xxx.xxx source inside prefer
(where xxx.xxx.xxx.xxx is the ip address of the ntp server) - that keeps our tunnels up indefinitely due to NTP generating... |
70,189 | Using a cisco ASA is it possible manually bring up a lan to lan VPN tunnel & SA from the device, rather than having one of the systems that is part of the VPN initiate traffic to start the VPN?
I'd like to avoid having to trigger a ping on one of the systems in a VPN to start the VPN, to make troubleshooting a bit qui... | 2009/10/01 | [
"https://serverfault.com/questions/70189",
"https://serverfault.com",
"https://serverfault.com/users/11495/"
] | In Cisco ASA7.0 or greater OS, you can establish the tunnel by simulating interesting traffic with the `packet-tracer` command. Here's an example - substitute IP addresses from your networks:
```
packet-tracer input inside tcp 10.100.0.50 1250 10.200.0.100 80
Source Interface^ | Src IP^ Src Port | ... | ping inside "ip address at the other end of the tunnel"
Inside interface will have to be in the encryption domain.
This requires that the management-interface command is set to the inside interface - like "management-interface inside".
Let's say you have a bunch of interface mappings in your VPN tunnel to the other e... |
70,189 | Using a cisco ASA is it possible manually bring up a lan to lan VPN tunnel & SA from the device, rather than having one of the systems that is part of the VPN initiate traffic to start the VPN?
I'd like to avoid having to trigger a ping on one of the systems in a VPN to start the VPN, to make troubleshooting a bit qui... | 2009/10/01 | [
"https://serverfault.com/questions/70189",
"https://serverfault.com",
"https://serverfault.com/users/11495/"
] | In Cisco ASA7.0 or greater OS, you can establish the tunnel by simulating interesting traffic with the `packet-tracer` command. Here's an example - substitute IP addresses from your networks:
```
packet-tracer input inside tcp 10.100.0.50 1250 10.200.0.100 80
Source Interface^ | Src IP^ Src Port | ... | Using 8.4+ we just added a Meinberg Windows NTP server for network time on the receiving end of the tunnel and added this to the remote ASA config:
ntp server xxx.xxx.xxx.xxx source inside prefer
(where xxx.xxx.xxx.xxx is the ip address of the ntp server) - that keeps our tunnels up indefinitely due to NTP generating... |
48,039,835 | I am building an algebra calculator and I'm working on a recursive function to filter like terms from a polynomial. The function below works in that it produces the desired array of arrays of like terms. I can verify this by adding a console.log statement to the function. However, for some reason, the function won't re... | 2017/12/31 | [
"https://Stackoverflow.com/questions/48039835",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9157562/"
] | First off, remember that `const` applies to a specific variable. It prevents assignment of a different value to that variable. The value itself is not `const`. The `const` aspect only applies to the variable itself that is declared `const` and what value it holds. So, in your example, it only applies to the actual `myV... | It makes a BIG difference if your implementation fully complies to the ES6 module specification. Modules export bindings, not references. This is explained here:
<https://ponyfoo.com/articles/es6-modules-in-depth#bindings-not-values>
In (almost) all other aspects, Javascript purely uses references. A variable is a po... |
211,695 | I know the Airdrop uses WiFi direct to send the packet, but what is the radio frequency of it so I can capture the traffic.
Is the WiFi 2.4Ghz, 5Ghz or both? | 2015/10/19 | [
"https://apple.stackexchange.com/questions/211695",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/153173/"
] | You made some mistakes in your plist:
* /Applications/eXist-db/bin/startup.sh probably doesn't exist if you have installed eXist-db 2.2
A valid path is /Applications/eXist-db.app/Contents/Resources/eXist-db/bin/startup.sh
* StandardErorPath and StandardOutputPath are no valid keys
Valid keys are *StandardErrorPath* ... | You can't launch stuff as user `root` from your personal `LaunchAgents` folder as this would create a rather big security hole. There should be a message about this in `/var/log/system.log`.
From [man launchd.plist](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/launchd.plist.5.ht... |
16,999,763 | I was to understand that MVC templating was used as a means of locking down a view from using any substantial programming logic. Testing the Blade system for Laravel 4, I notice that I am still able to include PHP content into the view.
Can I disable PHP in a Blade template? Essentially turning the file into a .html f... | 2013/06/08 | [
"https://Stackoverflow.com/questions/16999763",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/446793/"
] | Blade templates compile to php, so you won't be able to eliminate php altogether.
There is something you can work around your project by creating your own compiler, or extending Blade's.
You will need to work your own solution out on how to handle rendering the parts in php that are used in your template, I would ju... | If you need programming logic in your views you're probably doing something wrong. Try to do the logic in your controller and inject the variables into your views. |
74,230,306 | I can match `#include<stdio.h>` using the following regular expression in c++.
```
regex ("( )*#( )*include( )*<(stdio.h)( )*>( )*")
```
But if I design a regular expression like `regex("( )*#( )*include( )*<(.)*.h( )*>( )*")`
in cpp then I find any type of header file.
But if I want to get a sub string from a heade... | 2022/10/28 | [
"https://Stackoverflow.com/questions/74230306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20255740/"
] | If `(item_id, property_type)` is defined as UNIQUE (which is reasonable) then joining 2 Item tables copies is more simple and maybe even more fast:
```sql
SELECT item_id,
i1.property_value fk_prod_id,
i2.property_value fk_cat_id,
p.prod_name,
c.cat_name
FROM Item i1
JOIN Item i2 USING (... | ```
SELECT
item_id,
fk_prod_id,
fk_cat_id,
prod_name,
cat_name
FROM (
SELECT
item_id,
MAX(CASE WHEN property_type = 'fk_prod_id' THEN property_value END) AS fk_prod_id,
MAX(CASE WHEN property_type = 'fk_cat_id' THEN property_value END) AS fk_cat_id
FROM item AS i
... |
10,073,261 | I am developing a VB application in which i need to know the native resolution of the monitor and not the one set by the user(current resolution). So i need to read the EDID (extended display identification data) directly from the monitor.
I did try to find the resolution of monitor through some programs...but all it... | 2012/04/09 | [
"https://Stackoverflow.com/questions/10073261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1321866/"
] | After a lot of research i was able to fix my problem..
Thanks for the the valuable info Yahia.
First, we need to find the EDID data . The physical display information is in fact available to the OS, via Extended Display Identification Data(EDID). A copy of the EDID block is kept in the windows registry. But the proble... | For some source code (although C/C++) to read the EDID block see Point 5 at [this link](http://thetweaker.wordpress.com/2011/11/13/reading-monitor-physical-dimensions-or-getting-the-edid-the-right-way/). The only official means to retrieve this information through [Windows Setup API](http://msdn.microsoft.com/en-us/lib... |
10,073,261 | I am developing a VB application in which i need to know the native resolution of the monitor and not the one set by the user(current resolution). So i need to read the EDID (extended display identification data) directly from the monitor.
I did try to find the resolution of monitor through some programs...but all it... | 2012/04/09 | [
"https://Stackoverflow.com/questions/10073261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1321866/"
] | For some source code (although C/C++) to read the EDID block see Point 5 at [this link](http://thetweaker.wordpress.com/2011/11/13/reading-monitor-physical-dimensions-or-getting-the-edid-the-right-way/). The only official means to retrieve this information through [Windows Setup API](http://msdn.microsoft.com/en-us/lib... | 'Here is a complete solution for everything except for actually setting the resolution. This will read out the native resolution settings from the EDID of the active monitor.
Set WshShell = WScript.CreateObject("WScript.Shell")
Const HKEY\_LOCAL\_MACHINE = &H80000002
Const DTD\_INDEX = 54
strComputer = "."
Set objW... |
10,073,261 | I am developing a VB application in which i need to know the native resolution of the monitor and not the one set by the user(current resolution). So i need to read the EDID (extended display identification data) directly from the monitor.
I did try to find the resolution of monitor through some programs...but all it... | 2012/04/09 | [
"https://Stackoverflow.com/questions/10073261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1321866/"
] | After a lot of research i was able to fix my problem..
Thanks for the the valuable info Yahia.
First, we need to find the EDID data . The physical display information is in fact available to the OS, via Extended Display Identification Data(EDID). A copy of the EDID block is kept in the windows registry. But the proble... | 'Here is a complete solution for everything except for actually setting the resolution. This will read out the native resolution settings from the EDID of the active monitor.
Set WshShell = WScript.CreateObject("WScript.Shell")
Const HKEY\_LOCAL\_MACHINE = &H80000002
Const DTD\_INDEX = 54
strComputer = "."
Set objW... |
45,272,138 | In `MyComponent`, I am trying to emit another event from an event handler. (This new event will be used by the parent component to take a few actions). I created an event emitter as a member of `MyComponent`, but the event handler method is not able to access the event emitter. It throws `ERROR TypeError: Cannot read p... | 2017/07/24 | [
"https://Stackoverflow.com/questions/45272138",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1892348/"
] | >
> Cannot read property 'emit' of undefined
>
>
>
Commonly caused by wrong `this`. Add the arrow lambda syntax `=>`
Fix
```
private onStateChangeEvent = (event: any) => {
console.log("reached here: " + event);
this.myEmitter.emit(1); // now correct this
}
```
More
====
<https://basarat.gitbook... | For anyone that came here to find this, if Basarats solution did not work, check to make sure that the line above the event emitter does not have any typos. I had an unnamed ViewChild above my undefined EventEmitter. |
20,905,925 | I have defined some custom constraints like that:
```
constraint(a,something).
constraint(a,something1).
constraint(a,something2).
```
and i need this logical conjunction of them all as a result.
( if one constraint fails, the result should fail )
```
result(X) :-
constraint(X,something),
constraint(X,somet... | 2014/01/03 | [
"https://Stackoverflow.com/questions/20905925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2468041/"
] | At some point, you need a predicate somewhere to actually list all the constraints you wish to apply. You could do something like this:
```
result(X) :-
constraints(X, [something, something1, something2]).
constraints(X, [H|T]) :-
constraint(X, H),
constraints(X, T).
constraints(_, []).
```
This mechani... | Consider using `maplist/2`:
```
all_true(X) :- maplist(constraint(X), [something, something1, something2]).
``` |
20,388,953 | I have issue here, inside my modal window got DropDownList as below
```
<div class="modal-body">
<div class="row">
<div class="col-lg-8">
<div class="form-horizontal" role="form">
<div class="form-group that">
<asp:Label ID="lblBrand" CssClass="col-sm-2 this" runat="server">Brand... | 2013/12/05 | [
"https://Stackoverflow.com/questions/20388953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2412351/"
] | Partitioning is a rather general concept and can be applied in many contexts. When it considers the partitioning of relational **data**, it usually refers to decomposing your tables either row-wise (horizontally) or column-wise (vertically).
Vertical partitioning, aka row splitting, uses the same splitting techniques ... | The difference between Normalization and splitting lies in the purpose of doing so.
The main purpose of Normalization is to remove redundant data Where as The purpose of Row splitting is to separate less required data.
eg:- Suppose you have a table All\_Details with columns- id , Emp\_name, Emp\_address, Emp\_phNo ,E... |
20,388,953 | I have issue here, inside my modal window got DropDownList as below
```
<div class="modal-body">
<div class="row">
<div class="col-lg-8">
<div class="form-horizontal" role="form">
<div class="form-group that">
<asp:Label ID="lblBrand" CssClass="col-sm-2 this" runat="server">Brand... | 2013/12/05 | [
"https://Stackoverflow.com/questions/20388953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2412351/"
] | Partitioning is a rather general concept and can be applied in many contexts. When it considers the partitioning of relational **data**, it usually refers to decomposing your tables either row-wise (horizontally) or column-wise (vertically).
Vertical partitioning, aka row splitting, uses the same splitting techniques ... | The problems with single database arises when it starts getting huge. So it is required to partition it, to reduce search space, so that it can execute required actions faster.There are various partition strategies available eg: horizontal partitioning, vertical partitioning, hash based partitioning, lookup based parti... |
20,388,953 | I have issue here, inside my modal window got DropDownList as below
```
<div class="modal-body">
<div class="row">
<div class="col-lg-8">
<div class="form-horizontal" role="form">
<div class="form-group that">
<asp:Label ID="lblBrand" CssClass="col-sm-2 this" runat="server">Brand... | 2013/12/05 | [
"https://Stackoverflow.com/questions/20388953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2412351/"
] | **Horizontal Partitioning in data base**
----------------------------------------
Keeping all the fields EG:Table `Employees` has
* id,
* name,
* Geographical location ,
* email,
* designation,
* phone
EG:1.Keeping all the fields and distributing records in multiple machines.say id= 1-100000 or 100000-200000 records... | The difference between Normalization and splitting lies in the purpose of doing so.
The main purpose of Normalization is to remove redundant data Where as The purpose of Row splitting is to separate less required data.
eg:- Suppose you have a table All\_Details with columns- id , Emp\_name, Emp\_address, Emp\_phNo ,E... |
20,388,953 | I have issue here, inside my modal window got DropDownList as below
```
<div class="modal-body">
<div class="row">
<div class="col-lg-8">
<div class="form-horizontal" role="form">
<div class="form-group that">
<asp:Label ID="lblBrand" CssClass="col-sm-2 this" runat="server">Brand... | 2013/12/05 | [
"https://Stackoverflow.com/questions/20388953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2412351/"
] | **Horizontal Partitioning in data base**
----------------------------------------
Keeping all the fields EG:Table `Employees` has
* id,
* name,
* Geographical location ,
* email,
* designation,
* phone
EG:1.Keeping all the fields and distributing records in multiple machines.say id= 1-100000 or 100000-200000 records... | The problems with single database arises when it starts getting huge. So it is required to partition it, to reduce search space, so that it can execute required actions faster.There are various partition strategies available eg: horizontal partitioning, vertical partitioning, hash based partitioning, lookup based parti... |
20,388,953 | I have issue here, inside my modal window got DropDownList as below
```
<div class="modal-body">
<div class="row">
<div class="col-lg-8">
<div class="form-horizontal" role="form">
<div class="form-group that">
<asp:Label ID="lblBrand" CssClass="col-sm-2 this" runat="server">Brand... | 2013/12/05 | [
"https://Stackoverflow.com/questions/20388953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2412351/"
] | The problems with single database arises when it starts getting huge. So it is required to partition it, to reduce search space, so that it can execute required actions faster.There are various partition strategies available eg: horizontal partitioning, vertical partitioning, hash based partitioning, lookup based parti... | The difference between Normalization and splitting lies in the purpose of doing so.
The main purpose of Normalization is to remove redundant data Where as The purpose of Row splitting is to separate less required data.
eg:- Suppose you have a table All\_Details with columns- id , Emp\_name, Emp\_address, Emp\_phNo ,E... |
21,588,692 | I'm new to Assembly Programming (x86), and cannot figure out where I am going wrong in my program. After I redisplay the value that was moved into the array, I then want to display the current 'SUM'. I thought that by using the 'ebx' register, since it is used nowhere else in the program except in Loop2, that the value... | 2014/02/05 | [
"https://Stackoverflow.com/questions/21588692",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1956099/"
] | Do this: (taken from: [How to create a passsword protected pdf file](https://stackoverflow.com/questions/2545804/how-to-create-a-passsword-protected-pdf-file))
<http://www.idsecuritysuite.com/blog/wp-content/uploads/fpdi.zip>
```
<?php
function pdfEncrypt ($origFile, $password, $destFile){
require_once('F... | It's not a very good idea because in that way you should:
1. Store a key or password inside the generated PDF file
that is obviously not reliable;
2. OR: Send the typed key to some server but PDF format
doesn't allow that;
3. OR: Implement your own PDF Reader with support of some
custom non-standart extensions that ... |
2,386,101 | I define Intermediate Value Property (IVP) and Extreme Value Property (EVP) as follows:
* IVP: If $I$ is an interval, and $f:I\rightarrow\mathbb{R}$, we say that
$f$ has the intermediate value property iff whenever $a<b$ are point's in $I$ and $f(a)\leq c\leq f(b)$, there is a $d\in$ $(a,b)$ such that $f(d)=c$.
* EVP... | 2017/08/07 | [
"https://math.stackexchange.com/questions/2386101",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/389367/"
] | Non-explicit example: Let $f$ be any differentiable function on an interval $I$ with unbounded derivative. Then $f'$ has the IVP by [Darboux's theorem](https://en.wikipedia.org/wiki/Darboux%27s_theorem_(analysis)), but misses either a maximum or minimum. | On the interval $0 < x < 1$, consider $f(x) = x$. It has the intermediate value property, but not the extreme value property. |
2,386,101 | I define Intermediate Value Property (IVP) and Extreme Value Property (EVP) as follows:
* IVP: If $I$ is an interval, and $f:I\rightarrow\mathbb{R}$, we say that
$f$ has the intermediate value property iff whenever $a<b$ are point's in $I$ and $f(a)\leq c\leq f(b)$, there is a $d\in$ $(a,b)$ such that $f(d)=c$.
* EVP... | 2017/08/07 | [
"https://math.stackexchange.com/questions/2386101",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/389367/"
] | Non-explicit example: Let $f$ be any differentiable function on an interval $I$ with unbounded derivative. Then $f'$ has the IVP by [Darboux's theorem](https://en.wikipedia.org/wiki/Darboux%27s_theorem_(analysis)), but misses either a maximum or minimum. | No, not at all.
Even if you stricten up your definition to avoid the most simple counter example, by borrowing from the IVT and EVT and replacing the requirement of continuity by IVP and EVP respectively. For example:
>
> A function $f$ is said to have the IVP in $E$ if for every closed interval $[a,b]\subseteq E$ a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.