qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
12,711,026 | I am using key identifers in my foreach loop in order to control how I echo strings next to the data. For example
The array
```
$array = array("name" => "Jim", "age" => 34);
array(2) {
["name"]=> string(3) "Jim"
["age"]=> int(34)
}
```
The loop
```
<?php
foreach ($array as $value) {
echo "Name " .$val... | 2012/10/03 | [
"https://Stackoverflow.com/questions/12711026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1181234/"
] | Why are you using the `foreach` functionality? If you remove that you will get exactly what you want. And you will change `$value` to `$array`. | you don't need a foreach loop for what you're trying to accomplish, it would be as simple as:
```
$array = array("name" => "Jim", "age" => 34);
echo "Name " . $array["name"] . "</br>";
echo "Age " . $array["age"];
``` |
12,711,026 | I am using key identifers in my foreach loop in order to control how I echo strings next to the data. For example
The array
```
$array = array("name" => "Jim", "age" => 34);
array(2) {
["name"]=> string(3) "Jim"
["age"]=> int(34)
}
```
The loop
```
<?php
foreach ($array as $value) {
echo "Name " .$val... | 2012/10/03 | [
"https://Stackoverflow.com/questions/12711026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1181234/"
] | Why are you using the `foreach` functionality? If you remove that you will get exactly what you want. And you will change `$value` to `$array`. | ```
<?php
foreach ($array as $key => $value) {
echo ucfirst($key).' '.$value.'<br />';
}
?>
``` |
12,711,026 | I am using key identifers in my foreach loop in order to control how I echo strings next to the data. For example
The array
```
$array = array("name" => "Jim", "age" => 34);
array(2) {
["name"]=> string(3) "Jim"
["age"]=> int(34)
}
```
The loop
```
<?php
foreach ($array as $value) {
echo "Name " .$val... | 2012/10/03 | [
"https://Stackoverflow.com/questions/12711026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1181234/"
] | Get rid of the foreach loop:
```
echo "Name " . $array["name"] . "</br>\n"
. "Age " . $array["age"] . "</br>\n";
```
Or, if you want to loop over multiple people, you need to make a nested array of arrays.
```
$people = array(
array("name" => "Jim", "age" => 34),
array("name" => "Bob", "age" => 42)
);
... | You can do that without a for loop...
```
<?php
$array = array("name" => "Jim", "age" => 34);
echo "Name " .$array["name"]."</br>
Age ".$array["age"]. "</br>";
}
?>
``` |
12,711,026 | I am using key identifers in my foreach loop in order to control how I echo strings next to the data. For example
The array
```
$array = array("name" => "Jim", "age" => 34);
array(2) {
["name"]=> string(3) "Jim"
["age"]=> int(34)
}
```
The loop
```
<?php
foreach ($array as $value) {
echo "Name " .$val... | 2012/10/03 | [
"https://Stackoverflow.com/questions/12711026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1181234/"
] | Get rid of the foreach loop:
```
echo "Name " . $array["name"] . "</br>\n"
. "Age " . $array["age"] . "</br>\n";
```
Or, if you want to loop over multiple people, you need to make a nested array of arrays.
```
$people = array(
array("name" => "Jim", "age" => 34),
array("name" => "Bob", "age" => 42)
);
... | you don't need a foreach loop for what you're trying to accomplish, it would be as simple as:
```
$array = array("name" => "Jim", "age" => 34);
echo "Name " . $array["name"] . "</br>";
echo "Age " . $array["age"];
``` |
12,711,026 | I am using key identifers in my foreach loop in order to control how I echo strings next to the data. For example
The array
```
$array = array("name" => "Jim", "age" => 34);
array(2) {
["name"]=> string(3) "Jim"
["age"]=> int(34)
}
```
The loop
```
<?php
foreach ($array as $value) {
echo "Name " .$val... | 2012/10/03 | [
"https://Stackoverflow.com/questions/12711026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1181234/"
] | Get rid of the foreach loop:
```
echo "Name " . $array["name"] . "</br>\n"
. "Age " . $array["age"] . "</br>\n";
```
Or, if you want to loop over multiple people, you need to make a nested array of arrays.
```
$people = array(
array("name" => "Jim", "age" => 34),
array("name" => "Bob", "age" => 42)
);
... | ```
<?php
foreach ($array as $key => $value) {
echo ucfirst($key).' '.$value.'<br />';
}
?>
``` |
12,711,026 | I am using key identifers in my foreach loop in order to control how I echo strings next to the data. For example
The array
```
$array = array("name" => "Jim", "age" => 34);
array(2) {
["name"]=> string(3) "Jim"
["age"]=> int(34)
}
```
The loop
```
<?php
foreach ($array as $value) {
echo "Name " .$val... | 2012/10/03 | [
"https://Stackoverflow.com/questions/12711026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1181234/"
] | ```
<?php
foreach ($array as $key => $value) {
echo ucfirst($key).' '.$value.'<br />';
}
?>
``` | You can do that without a for loop...
```
<?php
$array = array("name" => "Jim", "age" => 34);
echo "Name " .$array["name"]."</br>
Age ".$array["age"]. "</br>";
}
?>
``` |
12,711,026 | I am using key identifers in my foreach loop in order to control how I echo strings next to the data. For example
The array
```
$array = array("name" => "Jim", "age" => 34);
array(2) {
["name"]=> string(3) "Jim"
["age"]=> int(34)
}
```
The loop
```
<?php
foreach ($array as $value) {
echo "Name " .$val... | 2012/10/03 | [
"https://Stackoverflow.com/questions/12711026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1181234/"
] | ```
<?php
foreach ($array as $key => $value) {
echo ucfirst($key).' '.$value.'<br />';
}
?>
``` | you don't need a foreach loop for what you're trying to accomplish, it would be as simple as:
```
$array = array("name" => "Jim", "age" => 34);
echo "Name " . $array["name"] . "</br>";
echo "Age " . $array["age"];
``` |
52,948,562 | I have a mysql query to join four tables and I thought that it was just best to join tables but now that mysql data is getting bigger the query seems to cause the application to stop execution.
```
SELECT
`purchase_order`.`id`,
`purchase_order`.`po_date` AS po_date, ... | 2018/10/23 | [
"https://Stackoverflow.com/questions/52948562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4179779/"
] | You need to be sure that `purchase_order.po_date` and all id column are indexed. You can check it with below query.
```
SHOW INDEX FROM yourtable;
``` | Since you mentioned that data is getting bigger. I would suggest doing sharding and then you can parallelize multiple queries. Please refer to the following article
[Parallel Query for MySQL with Shard-Query](https://www.percona.com/blog/2014/05/01/parallel-query-mysql-shard-query/) |
52,948,562 | I have a mysql query to join four tables and I thought that it was just best to join tables but now that mysql data is getting bigger the query seems to cause the application to stop execution.
```
SELECT
`purchase_order`.`id`,
`purchase_order`.`po_date` AS po_date, ... | 2018/10/23 | [
"https://Stackoverflow.com/questions/52948562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4179779/"
] | You need to be sure that `purchase_order.po_date` and all id column are indexed. You can check it with below query.
```
SHOW INDEX FROM yourtable;
``` | First, I cleaned up readability a bit. You don't need `tick` marks around every table.column reference. Also, for short-hand, using aliases works well. Ex: "po" instead of "purchase\_order", "poi" instead of "purchase\_order\_items". The only time I would use tick marks is around reserved words that might cause a probl... |
52,948,562 | I have a mysql query to join four tables and I thought that it was just best to join tables but now that mysql data is getting bigger the query seems to cause the application to stop execution.
```
SELECT
`purchase_order`.`id`,
`purchase_order`.`po_date` AS po_date, ... | 2018/10/23 | [
"https://Stackoverflow.com/questions/52948562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4179779/"
] | Will this give you the correct list of ids?
```
SELECT id
FROM purchase_order
ORDER BY`po_date` DESC
LIMIT 0, 20
```
If so, then *start* with that before launching into the `JOIN`. You can also (I think) get rid of the `GROUP BY` that is causing an "explode-implode" of rows.
```
SELECT ...
FROM ( SE... | You need to be sure that `purchase_order.po_date` and all id column are indexed. You can check it with below query.
```
SHOW INDEX FROM yourtable;
``` |
52,948,562 | I have a mysql query to join four tables and I thought that it was just best to join tables but now that mysql data is getting bigger the query seems to cause the application to stop execution.
```
SELECT
`purchase_order`.`id`,
`purchase_order`.`po_date` AS po_date, ... | 2018/10/23 | [
"https://Stackoverflow.com/questions/52948562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4179779/"
] | Will this give you the correct list of ids?
```
SELECT id
FROM purchase_order
ORDER BY`po_date` DESC
LIMIT 0, 20
```
If so, then *start* with that before launching into the `JOIN`. You can also (I think) get rid of the `GROUP BY` that is causing an "explode-implode" of rows.
```
SELECT ...
FROM ( SE... | Since you mentioned that data is getting bigger. I would suggest doing sharding and then you can parallelize multiple queries. Please refer to the following article
[Parallel Query for MySQL with Shard-Query](https://www.percona.com/blog/2014/05/01/parallel-query-mysql-shard-query/) |
52,948,562 | I have a mysql query to join four tables and I thought that it was just best to join tables but now that mysql data is getting bigger the query seems to cause the application to stop execution.
```
SELECT
`purchase_order`.`id`,
`purchase_order`.`po_date` AS po_date, ... | 2018/10/23 | [
"https://Stackoverflow.com/questions/52948562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4179779/"
] | Will this give you the correct list of ids?
```
SELECT id
FROM purchase_order
ORDER BY`po_date` DESC
LIMIT 0, 20
```
If so, then *start* with that before launching into the `JOIN`. You can also (I think) get rid of the `GROUP BY` that is causing an "explode-implode" of rows.
```
SELECT ...
FROM ( SE... | First, I cleaned up readability a bit. You don't need `tick` marks around every table.column reference. Also, for short-hand, using aliases works well. Ex: "po" instead of "purchase\_order", "poi" instead of "purchase\_order\_items". The only time I would use tick marks is around reserved words that might cause a probl... |
16,767,241 | I have a `Treeview` in my `WPF` application. On the fly, in run time, If the element of the `Tree` meets certain condition, It should change its `Font color` from Black To Red.!
`XAML`
```
<TreeView Grid.Column="0" Grid.Row="0" HorizontalAlignment="Stretch" Name="treeView1"
VerticalAlignment="... | 2013/05/27 | [
"https://Stackoverflow.com/questions/16767241",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1957674/"
] | Just change the Foreground:
```
TreeViewItem ti = (TreeViewItem)treeView1.SelectedItem;
ti.Foreground = Brushes.Red;
``` | That is embedded into the template. You can only change the color by copying the default `Aero-Style` for the control and changing the hard-coded value.
Or by drilling down the visual tree on-load to change it that way.
To get the default style & tenmplate go through this [MSDN](http://msdn.microsoft.com/en-us/libra... |
16,767,241 | I have a `Treeview` in my `WPF` application. On the fly, in run time, If the element of the `Tree` meets certain condition, It should change its `Font color` from Black To Red.!
`XAML`
```
<TreeView Grid.Column="0" Grid.Row="0" HorizontalAlignment="Stretch" Name="treeView1"
VerticalAlignment="... | 2013/05/27 | [
"https://Stackoverflow.com/questions/16767241",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1957674/"
] | You could create a boolean property in the model which is true when the elements meets the condition. Then you bind the Foreground like so:
```
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Style.Triggers>
... | Just change the Foreground:
```
TreeViewItem ti = (TreeViewItem)treeView1.SelectedItem;
ti.Foreground = Brushes.Red;
``` |
16,767,241 | I have a `Treeview` in my `WPF` application. On the fly, in run time, If the element of the `Tree` meets certain condition, It should change its `Font color` from Black To Red.!
`XAML`
```
<TreeView Grid.Column="0" Grid.Row="0" HorizontalAlignment="Stretch" Name="treeView1"
VerticalAlignment="... | 2013/05/27 | [
"https://Stackoverflow.com/questions/16767241",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1957674/"
] | You could create a boolean property in the model which is true when the elements meets the condition. Then you bind the Foreground like so:
```
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Style.Triggers>
... | That is embedded into the template. You can only change the color by copying the default `Aero-Style` for the control and changing the hard-coded value.
Or by drilling down the visual tree on-load to change it that way.
To get the default style & tenmplate go through this [MSDN](http://msdn.microsoft.com/en-us/libra... |
56,939,030 | I have C# client that's making requests to another Web API.
The Web API I'm consuming can respond with 2 "successful" responses, both 200's.
I need to intercept the response before I map it to its corresponding object and am looking for the best practice.
I own both the client and the server, so either can be adjust... | 2019/07/08 | [
"https://Stackoverflow.com/questions/56939030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11627205/"
] | I am also doing the same in my application:
* Authenticate against the LDAP
* Authenticate against the database.
First of all LDAP server is already set up.
So in application.properties file we have all the information required to connect to the LDAP server and **a Boolean field to check whether we want to authentica... | I found the solution.
>
> Spring Security supports a wide range of authentication mechanisms. AuthenticationManagerBuilder object allows using multiple built-in authentication provider like In-Memory authentication, LDAP authentication, JDBC based authentication. In addition to its own set of authentication models, ... |
1,649,793 | I am learning about the fluid dynamics and I cam across the following phrase as I was reading about the Stokes operator on Wikipedia.
"Since the Stokes operator is unbounded, we must give its domain of definition"
What does the unboundeness of an operator have to do with its domain? | 2016/02/10 | [
"https://math.stackexchange.com/questions/1649793",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/144840/"
] | Almost always one studies closed operators. In fact, you rarely can do much of anything with an operator that is not closable. Closed operators that are everywhere defined on a Banach space are continuous by the closed graph theorem. So the best you can hope for is that the operator is densely-defined; that leaves you ... | An old result of functional analysis tells us that a symmetric, unbounded operator acting on a Hilbert space cannot be defined on the whole space but only in a dense subspace of it. It is a direct consequence of the Hellinger-Toeplitz theorem. (see for example: Riesz-Nagy, "Functional Analysis", 1955 and also Reed-Simo... |
37,088,512 | I'm new to Python and I'm wanting to print only the first 10 lines of a huge csv file.
Here's my code so far that prints all of the lines in the csv file
```
import csv
with open('titanic.csv') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
print(row['survived'], row['pclass'], row['... | 2016/05/07 | [
"https://Stackoverflow.com/questions/37088512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6303866/"
] | You could just `break` after 10 lines.
```
import csv
with open('titanic.csv') as csvfile:
reader = csv.DictReader(csvfile)
for i,row in enumerate(reader):
print(row['survived'], row['pclass'], row['name'], row['sex'], row['age'])
if(i >= 9):
break
``` | Use `itertools.islice`:
```
import csv
from itertools import islice
with open('titanic.csv') as csvfile:
reader = csv.DictReader(csvfile)
for row in islice(reader, 10): # first 10 only
print(row['survived'], row['pclass'], row['name'], row['sex'], row['age'])
```
While you're at it, you can also mak... |
37,088,512 | I'm new to Python and I'm wanting to print only the first 10 lines of a huge csv file.
Here's my code so far that prints all of the lines in the csv file
```
import csv
with open('titanic.csv') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
print(row['survived'], row['pclass'], row['... | 2016/05/07 | [
"https://Stackoverflow.com/questions/37088512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6303866/"
] | You could just `break` after 10 lines.
```
import csv
with open('titanic.csv') as csvfile:
reader = csv.DictReader(csvfile)
for i,row in enumerate(reader):
print(row['survived'], row['pclass'], row['name'], row['sex'], row['age'])
if(i >= 9):
break
``` | Adrien El Zein's answer is enough for your question. However, if you think it's slightly confusing (I don't think so):
```
import csv
counter = 0
with open('titanic.csv') as csvfile:
reader = csv.DictReader(csvfile)
for row in enumerate(reader):
print(row['survived'], row['pclass'], row['name'], row['s... |
37,088,512 | I'm new to Python and I'm wanting to print only the first 10 lines of a huge csv file.
Here's my code so far that prints all of the lines in the csv file
```
import csv
with open('titanic.csv') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
print(row['survived'], row['pclass'], row['... | 2016/05/07 | [
"https://Stackoverflow.com/questions/37088512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6303866/"
] | You could just `break` after 10 lines.
```
import csv
with open('titanic.csv') as csvfile:
reader = csv.DictReader(csvfile)
for i,row in enumerate(reader):
print(row['survived'], row['pclass'], row['name'], row['sex'], row['age'])
if(i >= 9):
break
``` | To get top N lines from a csv file, with select fields
```
#for python 3
import csv
from operator import itemgetter
N=11 # to get 10 rows need use 10+1=11
fname='titanic.csv'
get_columns=itemgetter('survived', 'pclass', 'name', 'sex', 'age')
with open(fname,'r') as csvfile:
reader = csv.DictReader(csvfile.readli... |
37,088,512 | I'm new to Python and I'm wanting to print only the first 10 lines of a huge csv file.
Here's my code so far that prints all of the lines in the csv file
```
import csv
with open('titanic.csv') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
print(row['survived'], row['pclass'], row['... | 2016/05/07 | [
"https://Stackoverflow.com/questions/37088512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6303866/"
] | You could just `break` after 10 lines.
```
import csv
with open('titanic.csv') as csvfile:
reader = csv.DictReader(csvfile)
for i,row in enumerate(reader):
print(row['survived'], row['pclass'], row['name'], row['sex'], row['age'])
if(i >= 9):
break
``` | May be this could help you
**Code :**
```
count = 0
rg = 10
with open('/content/gdrive/MyDrive/Colab Notebooks/employee.csv','r') as csvdt:
csv_rd = csv.reader(csvdt)
for j in csv_rd:
if count < rg:
print(j)
count = count + 1
``` |
37,088,512 | I'm new to Python and I'm wanting to print only the first 10 lines of a huge csv file.
Here's my code so far that prints all of the lines in the csv file
```
import csv
with open('titanic.csv') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
print(row['survived'], row['pclass'], row['... | 2016/05/07 | [
"https://Stackoverflow.com/questions/37088512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6303866/"
] | Use `itertools.islice`:
```
import csv
from itertools import islice
with open('titanic.csv') as csvfile:
reader = csv.DictReader(csvfile)
for row in islice(reader, 10): # first 10 only
print(row['survived'], row['pclass'], row['name'], row['sex'], row['age'])
```
While you're at it, you can also mak... | Adrien El Zein's answer is enough for your question. However, if you think it's slightly confusing (I don't think so):
```
import csv
counter = 0
with open('titanic.csv') as csvfile:
reader = csv.DictReader(csvfile)
for row in enumerate(reader):
print(row['survived'], row['pclass'], row['name'], row['s... |
37,088,512 | I'm new to Python and I'm wanting to print only the first 10 lines of a huge csv file.
Here's my code so far that prints all of the lines in the csv file
```
import csv
with open('titanic.csv') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
print(row['survived'], row['pclass'], row['... | 2016/05/07 | [
"https://Stackoverflow.com/questions/37088512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6303866/"
] | Use `itertools.islice`:
```
import csv
from itertools import islice
with open('titanic.csv') as csvfile:
reader = csv.DictReader(csvfile)
for row in islice(reader, 10): # first 10 only
print(row['survived'], row['pclass'], row['name'], row['sex'], row['age'])
```
While you're at it, you can also mak... | To get top N lines from a csv file, with select fields
```
#for python 3
import csv
from operator import itemgetter
N=11 # to get 10 rows need use 10+1=11
fname='titanic.csv'
get_columns=itemgetter('survived', 'pclass', 'name', 'sex', 'age')
with open(fname,'r') as csvfile:
reader = csv.DictReader(csvfile.readli... |
37,088,512 | I'm new to Python and I'm wanting to print only the first 10 lines of a huge csv file.
Here's my code so far that prints all of the lines in the csv file
```
import csv
with open('titanic.csv') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
print(row['survived'], row['pclass'], row['... | 2016/05/07 | [
"https://Stackoverflow.com/questions/37088512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6303866/"
] | Use `itertools.islice`:
```
import csv
from itertools import islice
with open('titanic.csv') as csvfile:
reader = csv.DictReader(csvfile)
for row in islice(reader, 10): # first 10 only
print(row['survived'], row['pclass'], row['name'], row['sex'], row['age'])
```
While you're at it, you can also mak... | May be this could help you
**Code :**
```
count = 0
rg = 10
with open('/content/gdrive/MyDrive/Colab Notebooks/employee.csv','r') as csvdt:
csv_rd = csv.reader(csvdt)
for j in csv_rd:
if count < rg:
print(j)
count = count + 1
``` |
2,028,915 | Let $\omega=xdx$.
>
> What is $\int\_{S^1}\omega$?
>
>
>
What I know:
The final result should be $1$.
We can take parametrization $p:[0,\pi]\rightarrow S^1$ with $p(t)=(\cos(t),\sin(t))$ and $Dp(t)=(\sin(t),\cos(t))$. Then
$$\int\_{S^1}\omega=\int\_{S^1}xdx=\int\_{p([0,\pi]}xdx=\int\_{[0,\pi]}p^\*xdx=\int\_... | 2016/11/24 | [
"https://math.stackexchange.com/questions/2028915",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | An interesting approach is to use Stokes, noting that $S^1$ is the boundary of the unit disk. Then $d\omega = dx\wedge dx=0$, so
$$\int\_{S^1} \omega = \int\_{B} d\omega=0$$
Alternatively, with the parametrization you gave the pullback of $\omega$ is
$$\cos t(\cos t)'=-\cos t\sin t=-\frac{\sin 2t}2$$
and this integ... | Notice that the integral on $S^1$ and the integral on $S^1 \setminus \{(1,0)\}$ are equal, because $\{(1,0)\}$ is a null set. A convenient parametrization is $p : (0, 2\pi) \to S^1 \setminus \{(1,0)\}$ given by $p(t) = (\cos t, \sin t)$. Then, as you say,
$$\int \limits \_{S^1} \omega = \int \limits \_{S^1 \setminus \... |
976,178 | So whenever I try to click a button in the menu option in firefox with my mouse it won't respond. I tried to reinstall firefox but it didn't help. The menu button is located on the top right side of firefox. | 2017/11/14 | [
"https://askubuntu.com/questions/976178",
"https://askubuntu.com",
"https://askubuntu.com/users/759647/"
] | Go to this website
<https://support.mozilla.org/en-US/kb/refresh-firefox-reset-add-ons-and-settings>
and select the button saying refresh firefox:
>
> 1. Click this Refresh Firefox button directly, if you are viewing this
> page in Firefox. **This won't work if you are using a different browser
> or on a mobile de... | In my case, refreshing Firefox didn't work. What worked for me was to turn KWin compositing on (which I didn't know I had deactivated). That can be achieved by pressing `Shift`+`Alt`+`F12` |
223,790 | I'd like to find minmum value in x^2\*y under equation constraint x^2 + y^2 == 1
Hence, I use following code:
```
Minimize[{x^2*y, x^2 + y^2 == 1}, {x, y}]
```
I got
$$\left\{-\frac{2}{3 \sqrt{3}},\left\{x\to -\sqrt{\frac{2}{3}},y\to -\frac{1}{\sqrt{3}}\right\}\right\}$$
For the method of Lagrange multipliers,
... | 2020/06/11 | [
"https://mathematica.stackexchange.com/questions/223790",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/67902/"
] | First, let's plot the surface $z=x^2y$ and a circle projected onto the surface. This should help you see that there are only two minima - the two warped down parts of the circle nearest to us in the plot:
```
Show[
Plot3D[x^2 y, {x, -1, 1}, {y, -1.3, 1.3}, PlotTheme -> "Classic",
BoxRatios -> 1],
ParametricPlot3D... | ```
f[x_, y_] = x^2*y;
g[x_, y_] = x^2 + y^2 - 1;
```
I take up Bob Hanlon's thoughts here:
```
min = Minimize[{f[x, y], g[x, y] == 0, #}, {x, y}] & /@ {x >= 0, x < 0}
```
[](https://i.stack.imgur.com/l6JD6.gif)
what kind of points are they?
```... |
4,192 | >
> **Possible Duplicate:**
>
> [What does “to cause” mean?](https://philosophy.stackexchange.com/questions/3639/what-does-to-cause-mean)
>
>
>
Take an example, It is reported that [short-circuit caused fire in city bakery](http://articles.timesofindia.indiatimes.com/2012-11-08/surat/34993969_1_short-circuit-b... | 2012/11/13 | [
"https://philosophy.stackexchange.com/questions/4192",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/1958/"
] | Causality as @glebovg states is a very basic understanding of the relation between two objects and the event which takes place based on the interaction. Because you have posted in Philosophy channel i am not sure you do not want the deterministic answer.
Personally i think the more interesting area of causality is fou... | Causality is essentially the relationship between cause and effect. Specific definitions depend on the context. For example, in physics, and in particular thermodynamics, we define an *arrow of time*. In the philosophy of science, one might talk about causality in special relativity. For example, special relativity doe... |
1,199,053 | I'm refactoring a function that, given a series of endpoints that implicitly define intervals, checks if a number is included in the interval, and then return a corresponding (not related in any computable way).
The code that is now handling the work is:
```
if p <= 100:
return 0
elif p > 100 and p <= 300:
ret... | 2009/07/29 | [
"https://Stackoverflow.com/questions/1199053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/107613/"
] | You could try a take on this:
```
def check_mapping(p):
mapping = [(100, 0), (300, 1), (500, 2)] # Add all your values and returns here
for check, value in mapping:
if p <= check:
return value
print check_mapping(12)
print check_mapping(101)
print check_mapping(303)
```
produces:
```
0... | ```
def which_interval(endpoints, number):
for n, endpoint in enumerate(endpoints):
if number <= endpoint:
return n
previous = endpoint
return n + 1
```
Pass your endpoints as a list in `endpoints`, like this:
```
which_interval([100, 300, 500, 800, 1000], 5)
```
Edit:
The abov... |
1,199,053 | I'm refactoring a function that, given a series of endpoints that implicitly define intervals, checks if a number is included in the interval, and then return a corresponding (not related in any computable way).
The code that is now handling the work is:
```
if p <= 100:
return 0
elif p > 100 and p <= 300:
ret... | 2009/07/29 | [
"https://Stackoverflow.com/questions/1199053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/107613/"
] | ```
import bisect
bisect.bisect_left([100,300,500,800,1000], p)
```
here the docs: [bisect](https://docs.python.org/3.7/library/bisect.html) | Another way ...
```
def which(lst, p):
return len([1 for el in lst if p > el])
lst = [100, 300, 500, 800, 1000]
which(lst, 2)
which(lst, 101)
which(lst, 1001)
``` |
1,199,053 | I'm refactoring a function that, given a series of endpoints that implicitly define intervals, checks if a number is included in the interval, and then return a corresponding (not related in any computable way).
The code that is now handling the work is:
```
if p <= 100:
return 0
elif p > 100 and p <= 300:
ret... | 2009/07/29 | [
"https://Stackoverflow.com/questions/1199053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/107613/"
] | ```
import bisect
bisect.bisect_left([100,300,500,800,1000], p)
```
here the docs: [bisect](https://docs.python.org/3.7/library/bisect.html) | ```
def which_interval(endpoints, number):
for n, endpoint in enumerate(endpoints):
if number <= endpoint:
return n
previous = endpoint
return n + 1
```
Pass your endpoints as a list in `endpoints`, like this:
```
which_interval([100, 300, 500, 800, 1000], 5)
```
Edit:
The abov... |
1,199,053 | I'm refactoring a function that, given a series of endpoints that implicitly define intervals, checks if a number is included in the interval, and then return a corresponding (not related in any computable way).
The code that is now handling the work is:
```
if p <= 100:
return 0
elif p > 100 and p <= 300:
ret... | 2009/07/29 | [
"https://Stackoverflow.com/questions/1199053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/107613/"
] | ```
import bisect
bisect.bisect_left([100,300,500,800,1000], p)
```
here the docs: [bisect](https://docs.python.org/3.7/library/bisect.html) | It is indeed quite horrible. Without a requirement to have no hardcoding, it should have been written like this:
```
if p <= 100:
return 0
elif p <= 300:
return 1
elif p <= 500:
return 2
elif p <= 800:
return 3
elif p <= 1000:
return 4
else:
return 5
```
Here are examples of creating a lookup... |
1,199,053 | I'm refactoring a function that, given a series of endpoints that implicitly define intervals, checks if a number is included in the interval, and then return a corresponding (not related in any computable way).
The code that is now handling the work is:
```
if p <= 100:
return 0
elif p > 100 and p <= 300:
ret... | 2009/07/29 | [
"https://Stackoverflow.com/questions/1199053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/107613/"
] | You could try a take on this:
```
def check_mapping(p):
mapping = [(100, 0), (300, 1), (500, 2)] # Add all your values and returns here
for check, value in mapping:
if p <= check:
return value
print check_mapping(12)
print check_mapping(101)
print check_mapping(303)
```
produces:
```
0... | Try something along the lines of:
```
d = {(None,100): 0,
(100,200): 1,
...
(1000, None): 5}
value = 300 # example value
for k,v in d.items():
if (k[0] is None or value > k[0]) and (k[1] is None or value <= k[1]):
return v
``` |
1,199,053 | I'm refactoring a function that, given a series of endpoints that implicitly define intervals, checks if a number is included in the interval, and then return a corresponding (not related in any computable way).
The code that is now handling the work is:
```
if p <= 100:
return 0
elif p > 100 and p <= 300:
ret... | 2009/07/29 | [
"https://Stackoverflow.com/questions/1199053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/107613/"
] | ```
import bisect
bisect.bisect_left([100,300,500,800,1000], p)
```
here the docs: [bisect](https://docs.python.org/3.7/library/bisect.html) | Try something along the lines of:
```
d = {(None,100): 0,
(100,200): 1,
...
(1000, None): 5}
value = 300 # example value
for k,v in d.items():
if (k[0] is None or value > k[0]) and (k[1] is None or value <= k[1]):
return v
``` |
1,199,053 | I'm refactoring a function that, given a series of endpoints that implicitly define intervals, checks if a number is included in the interval, and then return a corresponding (not related in any computable way).
The code that is now handling the work is:
```
if p <= 100:
return 0
elif p > 100 and p <= 300:
ret... | 2009/07/29 | [
"https://Stackoverflow.com/questions/1199053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/107613/"
] | It is indeed quite horrible. Without a requirement to have no hardcoding, it should have been written like this:
```
if p <= 100:
return 0
elif p <= 300:
return 1
elif p <= 500:
return 2
elif p <= 800:
return 3
elif p <= 1000:
return 4
else:
return 5
```
Here are examples of creating a lookup... | ```
def which_interval(endpoints, number):
for n, endpoint in enumerate(endpoints):
if number <= endpoint:
return n
previous = endpoint
return n + 1
```
Pass your endpoints as a list in `endpoints`, like this:
```
which_interval([100, 300, 500, 800, 1000], 5)
```
Edit:
The abov... |
1,199,053 | I'm refactoring a function that, given a series of endpoints that implicitly define intervals, checks if a number is included in the interval, and then return a corresponding (not related in any computable way).
The code that is now handling the work is:
```
if p <= 100:
return 0
elif p > 100 and p <= 300:
ret... | 2009/07/29 | [
"https://Stackoverflow.com/questions/1199053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/107613/"
] | ```
import bisect
bisect.bisect_left([100,300,500,800,1000], p)
```
here the docs: [bisect](https://docs.python.org/3.7/library/bisect.html) | You could try a take on this:
```
def check_mapping(p):
mapping = [(100, 0), (300, 1), (500, 2)] # Add all your values and returns here
for check, value in mapping:
if p <= check:
return value
print check_mapping(12)
print check_mapping(101)
print check_mapping(303)
```
produces:
```
0... |
1,199,053 | I'm refactoring a function that, given a series of endpoints that implicitly define intervals, checks if a number is included in the interval, and then return a corresponding (not related in any computable way).
The code that is now handling the work is:
```
if p <= 100:
return 0
elif p > 100 and p <= 300:
ret... | 2009/07/29 | [
"https://Stackoverflow.com/questions/1199053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/107613/"
] | It is indeed quite horrible. Without a requirement to have no hardcoding, it should have been written like this:
```
if p <= 100:
return 0
elif p <= 300:
return 1
elif p <= 500:
return 2
elif p <= 800:
return 3
elif p <= 1000:
return 4
else:
return 5
```
Here are examples of creating a lookup... | Try something along the lines of:
```
d = {(None,100): 0,
(100,200): 1,
...
(1000, None): 5}
value = 300 # example value
for k,v in d.items():
if (k[0] is None or value > k[0]) and (k[1] is None or value <= k[1]):
return v
``` |
1,199,053 | I'm refactoring a function that, given a series of endpoints that implicitly define intervals, checks if a number is included in the interval, and then return a corresponding (not related in any computable way).
The code that is now handling the work is:
```
if p <= 100:
return 0
elif p > 100 and p <= 300:
ret... | 2009/07/29 | [
"https://Stackoverflow.com/questions/1199053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/107613/"
] | It is indeed quite horrible. Without a requirement to have no hardcoding, it should have been written like this:
```
if p <= 100:
return 0
elif p <= 300:
return 1
elif p <= 500:
return 2
elif p <= 800:
return 3
elif p <= 1000:
return 4
else:
return 5
```
Here are examples of creating a lookup... | Another way ...
```
def which(lst, p):
return len([1 for el in lst if p > el])
lst = [100, 300, 500, 800, 1000]
which(lst, 2)
which(lst, 101)
which(lst, 1001)
``` |
73,087,509 | I tried to ask this in a different [question](https://stackoverflow.com/questions/73074936/namespaces-and-procedures-and-scope-inside-namespaces) but did a poor job of it. This first block of code is from a JS example in David Flanagan's book. The main point of the example is that after `getCounter()` returns, the scop... | 2022/07/23 | [
"https://Stackoverflow.com/questions/73087509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9852762/"
] | Not really - mainly because tcl does not really have references/pointers (everything is a value). The js mechanism you refer to is closures and you can't really have closures without references (multiple variables referring to the same object). See <https://wiki.tcl-lang.org/page/Closures> for a long discussion on this... | The following requires Tcl 8.7.
-------------------------------
You can create private variables in a TclOO class, which gives them a real name that is "hard to predict" and prevents most tampering.
```
oo::class create Counter {
private variable num
constructor {} { my reset }
method next {} { incr num... |
50,026,414 | I am working with Nodejs to create a tester module. So I need to use exec.
This code work and is doing well:
```
const { exec } = require('child_process');
var nb_test = 1
var return_array = [nb_test];
var finished = 0;
var i = 0;
while (i < nb_test)
{
var env = { "NB_MALLOC": i.toString()};
console.log("c... | 2018/04/25 | [
"https://Stackoverflow.com/questions/50026414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8919833/"
] | Your callbacks never run because you never exit the current event loop. Async actions like your callback to `exec` are set aside to be executed after the current loop is finished. So node will execute all of the synchronous code in the entire script and only after this will it start processing callbacks. By placing an ... | You are not incrementing `j` inside the while loop. Therefore it will never exit.
Try adding `j++;` inside the `while (j < nb_test){}` braces. |
68,344,168 | I have three divs. Each will have a different content that will be displayed when user click button so three divs with three buttons.
I want to put the first one as defult when the page is loaded so its content will be displayed.
Here is what I tried - it didnt work as I want please correct my code
```js
$(function(... | 2021/07/12 | [
"https://Stackoverflow.com/questions/68344168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16424472/"
] | It already works if you remove the `$('.target').show();` which will show all regardless of anything clicked
Note I added a display:none to the initial view
```js
$(function() {
$('#indexed').click();
});
$('.single').click(function() {
$('.target').hide();
$('#div' + $(this).attr('target')).show();
});
```
``... | ```
<section class="target_box">
<div id="div1" class="target">content 1</div>
<div id="div2" class="target" style="display:none;">content 2</div>
<div id="div3" class="target" style="display:none;">content 3</div>
</section>
```
Seems like you have to hide some content at the first. So only content 1... |
9,879,486 | I am using three tables and I am trying to calculate discounted price by using this.
```
(Price.price - ccons.discountPrice - mcons.discountPrice) "Discount Price"
```
However, when one of value is null, Discount price displays "NULL". How can I resolve it? Can I declare NULL value is saying "0"? Or do you have any... | 2012/03/26 | [
"https://Stackoverflow.com/questions/9879486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/725505/"
] | ```
Price.price - NVL(ccons.discountPrice, 0) - NVL(mcons.discountPrice, 0)
``` | Most likely, you just want to wrap all three components in `NVL` functions, i.e.
```
nvl(Price.price,0) -
nvl(ccons.discountPrice,0) -
nvl(mcons.discountPrice,0) "Discount Price"
```
If some of those columns are declared to be `NOT NULL` (it would seem unlikely that `Price.price` could legitimately be `NULL`),... |
95,829 | **Clarification**:
I'm looking for an electrical component to use in a device that will sense large physical impacts. When an impact event occurs, all it has to do is pull one line high for around a second. There is no requirement it pull the line back down.
I do not want this device tied to outputs from my quadcopte... | 2014/01/08 | [
"https://electronics.stackexchange.com/questions/95829",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/35276/"
] | One simple solution might be to watch an output from your receiver. For example if there is no throttle signal because you have landed the copter, then activate your sounder. You might not need an accelerometer if you can reuse a normal signal for the task. If the copter is not powered for flight, it's either on the gr... | Alright, I have a good one. Use a normally open reed switch, your preferred noise maker, a bolt, and a magnet.
Mount the bolt under a non-magnetic insulator with the reed switch near by. Adjust the bolt's distance from the insulator until the magnet sticks, but not too strongly.
When the UAV crashes the magnet will d... |
95,829 | **Clarification**:
I'm looking for an electrical component to use in a device that will sense large physical impacts. When an impact event occurs, all it has to do is pull one line high for around a second. There is no requirement it pull the line back down.
I do not want this device tied to outputs from my quadcopte... | 2014/01/08 | [
"https://electronics.stackexchange.com/questions/95829",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/35276/"
] | One simple solution might be to watch an output from your receiver. For example if there is no throttle signal because you have landed the copter, then activate your sounder. You might not need an accelerometer if you can reuse a normal signal for the task. If the copter is not powered for flight, it's either on the gr... | Since your goal is to find your drone once you have lost it, I would go in the autonomous beacon direction. Relying on the crashed drone battery seems a bit overconfident. Some of those key locator beacons have a pretty impressive range and would fulfill all your requirements, except for price. For instance:
www.loc8... |
95,829 | **Clarification**:
I'm looking for an electrical component to use in a device that will sense large physical impacts. When an impact event occurs, all it has to do is pull one line high for around a second. There is no requirement it pull the line back down.
I do not want this device tied to outputs from my quadcopte... | 2014/01/08 | [
"https://electronics.stackexchange.com/questions/95829",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/35276/"
] | One simple solution might be to watch an output from your receiver. For example if there is no throttle signal because you have landed the copter, then activate your sounder. You might not need an accelerometer if you can reuse a normal signal for the task. If the copter is not powered for flight, it's either on the gr... | So I've decided to go with an accelerometer after all. I know the question was looking for other answers, but this turned out to be the easiest. The one I got has free-fall detection built into it, so a simple microcontroller should be all I need to talk I2C to it. Thanks for all your suggestions. |
95,829 | **Clarification**:
I'm looking for an electrical component to use in a device that will sense large physical impacts. When an impact event occurs, all it has to do is pull one line high for around a second. There is no requirement it pull the line back down.
I do not want this device tied to outputs from my quadcopte... | 2014/01/08 | [
"https://electronics.stackexchange.com/questions/95829",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/35276/"
] | Alright, I have a good one. Use a normally open reed switch, your preferred noise maker, a bolt, and a magnet.
Mount the bolt under a non-magnetic insulator with the reed switch near by. Adjust the bolt's distance from the insulator until the magnet sticks, but not too strongly.
When the UAV crashes the magnet will d... | So I've decided to go with an accelerometer after all. I know the question was looking for other answers, but this turned out to be the easiest. The one I got has free-fall detection built into it, so a simple microcontroller should be all I need to talk I2C to it. Thanks for all your suggestions. |
95,829 | **Clarification**:
I'm looking for an electrical component to use in a device that will sense large physical impacts. When an impact event occurs, all it has to do is pull one line high for around a second. There is no requirement it pull the line back down.
I do not want this device tied to outputs from my quadcopte... | 2014/01/08 | [
"https://electronics.stackexchange.com/questions/95829",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/35276/"
] | Since your goal is to find your drone once you have lost it, I would go in the autonomous beacon direction. Relying on the crashed drone battery seems a bit overconfident. Some of those key locator beacons have a pretty impressive range and would fulfill all your requirements, except for price. For instance:
www.loc8... | So I've decided to go with an accelerometer after all. I know the question was looking for other answers, but this turned out to be the easiest. The one I got has free-fall detection built into it, so a simple microcontroller should be all I need to talk I2C to it. Thanks for all your suggestions. |
3,157,488 | >
> Show that the sequence of functions $\{f\_n(z)=e^{-(z-n)^2}\}$ converges uniformly on the set $E=D(0,1)$.
>
>
>
$|e^{-(z-n)^2}-0|=|e^{-z^2}.e^{-n^2}.e^{2nz}|\leqslant |e^{-n^2}.e^{2nz}| $
However I do not know how to proceed.
**Questions:**
Is the proof right till the last step? How should I finish the proo... | 2019/03/21 | [
"https://math.stackexchange.com/questions/3157488",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/400711/"
] | Yes, your proof that $d(x,y)=0$ implies $x=y$ makes sense. All you need is the fact that the $\log(s)$ function on $s > 0$ has only one zero, and that zero is $s=1$. Therefore, if $\log(s) = 0$, then $s$ can only be equal to $1$, hence if $1 = s = 1 + |x-y|$, then $|x-y|=0$, which implies $x=0$.
As for the triangle in... | The $d\left(x,y\right)=0$ proof is correct. For the triangle inequality, I would start out with the right hand side. Notice that
\begin{align\*}
\log\left(1+\left|x-z\right|\right)+\log\left(1+\left|z-y\right|\right)&=\log\left(\left(1+\left|x-z\right|\right)\left(1+\left|z-y\right|\right)\right)\\
&=\log\left(1+\left... |
3,157,488 | >
> Show that the sequence of functions $\{f\_n(z)=e^{-(z-n)^2}\}$ converges uniformly on the set $E=D(0,1)$.
>
>
>
$|e^{-(z-n)^2}-0|=|e^{-z^2}.e^{-n^2}.e^{2nz}|\leqslant |e^{-n^2}.e^{2nz}| $
However I do not know how to proceed.
**Questions:**
Is the proof right till the last step? How should I finish the proo... | 2019/03/21 | [
"https://math.stackexchange.com/questions/3157488",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/400711/"
] | Yes, your proof that $d(x,y)=0$ implies $x=y$ makes sense. All you need is the fact that the $\log(s)$ function on $s > 0$ has only one zero, and that zero is $s=1$. Therefore, if $\log(s) = 0$, then $s$ can only be equal to $1$, hence if $1 = s = 1 + |x-y|$, then $|x-y|=0$, which implies $x=0$.
As for the triangle in... | You have the right idea about how to show that $d(x,y)=0$ implies $x=y$.
Hints for the triangle inequality:
* \begin{aligned}d(x,z)+d(z,y)&=\log(1+|x-z|)+\log(1+|z-y|) \\&= \log(1+|x-z|+|z-y|+|x-z||z-y|)
\end{aligned}
* The function $d': \mathbb R \times \mathbb R \to \mathbb R$ given by $d'(x,y)=|x-y|$ is a metric o... |
3,157,488 | >
> Show that the sequence of functions $\{f\_n(z)=e^{-(z-n)^2}\}$ converges uniformly on the set $E=D(0,1)$.
>
>
>
$|e^{-(z-n)^2}-0|=|e^{-z^2}.e^{-n^2}.e^{2nz}|\leqslant |e^{-n^2}.e^{2nz}| $
However I do not know how to proceed.
**Questions:**
Is the proof right till the last step? How should I finish the proo... | 2019/03/21 | [
"https://math.stackexchange.com/questions/3157488",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/400711/"
] | Yes, your proof that $d(x,y)=0$ implies $x=y$ makes sense. All you need is the fact that the $\log(s)$ function on $s > 0$ has only one zero, and that zero is $s=1$. Therefore, if $\log(s) = 0$, then $s$ can only be equal to $1$, hence if $1 = s = 1 + |x-y|$, then $|x-y|=0$, which implies $x=0$.
As for the triangle in... | It is obvious that $1+a+b \leq (1+a)(1+b)$ for $a, b \geq 0$. Hence $\log(1+a+b) \leq \log(1+a)+\log(1+b)$. This and the fact that $\log$ is increasing show that for any metric $d$, $d'(x,y)=\log(1+d(x,y))$ is also a metric. |
3,157,488 | >
> Show that the sequence of functions $\{f\_n(z)=e^{-(z-n)^2}\}$ converges uniformly on the set $E=D(0,1)$.
>
>
>
$|e^{-(z-n)^2}-0|=|e^{-z^2}.e^{-n^2}.e^{2nz}|\leqslant |e^{-n^2}.e^{2nz}| $
However I do not know how to proceed.
**Questions:**
Is the proof right till the last step? How should I finish the proo... | 2019/03/21 | [
"https://math.stackexchange.com/questions/3157488",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/400711/"
] | The $d\left(x,y\right)=0$ proof is correct. For the triangle inequality, I would start out with the right hand side. Notice that
\begin{align\*}
\log\left(1+\left|x-z\right|\right)+\log\left(1+\left|z-y\right|\right)&=\log\left(\left(1+\left|x-z\right|\right)\left(1+\left|z-y\right|\right)\right)\\
&=\log\left(1+\left... | You have the right idea about how to show that $d(x,y)=0$ implies $x=y$.
Hints for the triangle inequality:
* \begin{aligned}d(x,z)+d(z,y)&=\log(1+|x-z|)+\log(1+|z-y|) \\&= \log(1+|x-z|+|z-y|+|x-z||z-y|)
\end{aligned}
* The function $d': \mathbb R \times \mathbb R \to \mathbb R$ given by $d'(x,y)=|x-y|$ is a metric o... |
3,157,488 | >
> Show that the sequence of functions $\{f\_n(z)=e^{-(z-n)^2}\}$ converges uniformly on the set $E=D(0,1)$.
>
>
>
$|e^{-(z-n)^2}-0|=|e^{-z^2}.e^{-n^2}.e^{2nz}|\leqslant |e^{-n^2}.e^{2nz}| $
However I do not know how to proceed.
**Questions:**
Is the proof right till the last step? How should I finish the proo... | 2019/03/21 | [
"https://math.stackexchange.com/questions/3157488",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/400711/"
] | The $d\left(x,y\right)=0$ proof is correct. For the triangle inequality, I would start out with the right hand side. Notice that
\begin{align\*}
\log\left(1+\left|x-z\right|\right)+\log\left(1+\left|z-y\right|\right)&=\log\left(\left(1+\left|x-z\right|\right)\left(1+\left|z-y\right|\right)\right)\\
&=\log\left(1+\left... | It is obvious that $1+a+b \leq (1+a)(1+b)$ for $a, b \geq 0$. Hence $\log(1+a+b) \leq \log(1+a)+\log(1+b)$. This and the fact that $\log$ is increasing show that for any metric $d$, $d'(x,y)=\log(1+d(x,y))$ is also a metric. |
3,157,488 | >
> Show that the sequence of functions $\{f\_n(z)=e^{-(z-n)^2}\}$ converges uniformly on the set $E=D(0,1)$.
>
>
>
$|e^{-(z-n)^2}-0|=|e^{-z^2}.e^{-n^2}.e^{2nz}|\leqslant |e^{-n^2}.e^{2nz}| $
However I do not know how to proceed.
**Questions:**
Is the proof right till the last step? How should I finish the proo... | 2019/03/21 | [
"https://math.stackexchange.com/questions/3157488",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/400711/"
] | You have the right idea about how to show that $d(x,y)=0$ implies $x=y$.
Hints for the triangle inequality:
* \begin{aligned}d(x,z)+d(z,y)&=\log(1+|x-z|)+\log(1+|z-y|) \\&= \log(1+|x-z|+|z-y|+|x-z||z-y|)
\end{aligned}
* The function $d': \mathbb R \times \mathbb R \to \mathbb R$ given by $d'(x,y)=|x-y|$ is a metric o... | It is obvious that $1+a+b \leq (1+a)(1+b)$ for $a, b \geq 0$. Hence $\log(1+a+b) \leq \log(1+a)+\log(1+b)$. This and the fact that $\log$ is increasing show that for any metric $d$, $d'(x,y)=\log(1+d(x,y))$ is also a metric. |
167,113 | In group theory we have encountered the concepts of homomorphisms as maps from one group to another, and the same thing with ring and field theory and we ave called them respectively homomorphisms of groups (of rings, and of fields). Also in linear algebra we have linear maps.
So my question is this:
What is the role o... | 2012/07/05 | [
"https://math.stackexchange.com/questions/167113",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/34920/"
] | Homomorphisms do a lot of things:
1. They can be used to show two structures are identical (isomorphism)
2. They can be used to show one structure is a substructure of another (monomorphism)
3. They can be used to show one structure is a quotient of another (epimorphism)
4. General homomorphisms are kind of a mixture ... | Another function of morphisms is as a way of taking an unfamiliar or apparently complex algebraic object, and placing it in a more familiar context, or one where there are known analytical tools and methods - as in representation theory.
The point of view you take depends rather on whether you are more interested in s... |
167,113 | In group theory we have encountered the concepts of homomorphisms as maps from one group to another, and the same thing with ring and field theory and we ave called them respectively homomorphisms of groups (of rings, and of fields). Also in linear algebra we have linear maps.
So my question is this:
What is the role o... | 2012/07/05 | [
"https://math.stackexchange.com/questions/167113",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/34920/"
] | Another function of morphisms is as a way of taking an unfamiliar or apparently complex algebraic object, and placing it in a more familiar context, or one where there are known analytical tools and methods - as in representation theory.
The point of view you take depends rather on whether you are more interested in s... | Let's suppose for the moment that you really only care about isomorphisms. That is, you really only care about telling whether two groups are isomorphic, or something. Great! But how do you write down isomorphisms? It's hard. Often you will be able to write down a map and you'll want to show it's an isomorphism. *Befor... |
167,113 | In group theory we have encountered the concepts of homomorphisms as maps from one group to another, and the same thing with ring and field theory and we ave called them respectively homomorphisms of groups (of rings, and of fields). Also in linear algebra we have linear maps.
So my question is this:
What is the role o... | 2012/07/05 | [
"https://math.stackexchange.com/questions/167113",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/34920/"
] | One of my professors once said this about ring theory:
>
> To study rings, you have two choices. You can take a particular ring, and stare at it intently for a long period of time until you discover interesting things about that ring. Then you write them down.
>
>
> Or you can study how the rings "acts" on other st... | I think the use of homomorphisms is to identify one algebraic structure with another. With that identification we can say that two algebraic structures are same structurally i.e they are same when we view them with respect to algebraic operations involved in them although they may seem different with open eye. |
167,113 | In group theory we have encountered the concepts of homomorphisms as maps from one group to another, and the same thing with ring and field theory and we ave called them respectively homomorphisms of groups (of rings, and of fields). Also in linear algebra we have linear maps.
So my question is this:
What is the role o... | 2012/07/05 | [
"https://math.stackexchange.com/questions/167113",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/34920/"
] | Another function of morphisms is as a way of taking an unfamiliar or apparently complex algebraic object, and placing it in a more familiar context, or one where there are known analytical tools and methods - as in representation theory.
The point of view you take depends rather on whether you are more interested in s... | I think the use of homomorphisms is to identify one algebraic structure with another. With that identification we can say that two algebraic structures are same structurally i.e they are same when we view them with respect to algebraic operations involved in them although they may seem different with open eye. |
167,113 | In group theory we have encountered the concepts of homomorphisms as maps from one group to another, and the same thing with ring and field theory and we ave called them respectively homomorphisms of groups (of rings, and of fields). Also in linear algebra we have linear maps.
So my question is this:
What is the role o... | 2012/07/05 | [
"https://math.stackexchange.com/questions/167113",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/34920/"
] | Groups, rings (especially fields) and many other objects in mathematics form so called categories. I.e. the collection of all rings (whatever this is) forms a category. To 'compare' the objects in a category, one needs morphisms between them. (This is not the only need for morphisms, but one of them). To say that one o... | I think the use of homomorphisms is to identify one algebraic structure with another. With that identification we can say that two algebraic structures are same structurally i.e they are same when we view them with respect to algebraic operations involved in them although they may seem different with open eye. |
167,113 | In group theory we have encountered the concepts of homomorphisms as maps from one group to another, and the same thing with ring and field theory and we ave called them respectively homomorphisms of groups (of rings, and of fields). Also in linear algebra we have linear maps.
So my question is this:
What is the role o... | 2012/07/05 | [
"https://math.stackexchange.com/questions/167113",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/34920/"
] | Groups, rings (especially fields) and many other objects in mathematics form so called categories. I.e. the collection of all rings (whatever this is) forms a category. To 'compare' the objects in a category, one needs morphisms between them. (This is not the only need for morphisms, but one of them). To say that one o... | Let's suppose for the moment that you really only care about isomorphisms. That is, you really only care about telling whether two groups are isomorphic, or something. Great! But how do you write down isomorphisms? It's hard. Often you will be able to write down a map and you'll want to show it's an isomorphism. *Befor... |
167,113 | In group theory we have encountered the concepts of homomorphisms as maps from one group to another, and the same thing with ring and field theory and we ave called them respectively homomorphisms of groups (of rings, and of fields). Also in linear algebra we have linear maps.
So my question is this:
What is the role o... | 2012/07/05 | [
"https://math.stackexchange.com/questions/167113",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/34920/"
] | One of my professors once said this about ring theory:
>
> To study rings, you have two choices. You can take a particular ring, and stare at it intently for a long period of time until you discover interesting things about that ring. Then you write them down.
>
>
> Or you can study how the rings "acts" on other st... | Another function of morphisms is as a way of taking an unfamiliar or apparently complex algebraic object, and placing it in a more familiar context, or one where there are known analytical tools and methods - as in representation theory.
The point of view you take depends rather on whether you are more interested in s... |
167,113 | In group theory we have encountered the concepts of homomorphisms as maps from one group to another, and the same thing with ring and field theory and we ave called them respectively homomorphisms of groups (of rings, and of fields). Also in linear algebra we have linear maps.
So my question is this:
What is the role o... | 2012/07/05 | [
"https://math.stackexchange.com/questions/167113",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/34920/"
] | Homomorphisms do a lot of things:
1. They can be used to show two structures are identical (isomorphism)
2. They can be used to show one structure is a substructure of another (monomorphism)
3. They can be used to show one structure is a quotient of another (epimorphism)
4. General homomorphisms are kind of a mixture ... | I think the use of homomorphisms is to identify one algebraic structure with another. With that identification we can say that two algebraic structures are same structurally i.e they are same when we view them with respect to algebraic operations involved in them although they may seem different with open eye. |
167,113 | In group theory we have encountered the concepts of homomorphisms as maps from one group to another, and the same thing with ring and field theory and we ave called them respectively homomorphisms of groups (of rings, and of fields). Also in linear algebra we have linear maps.
So my question is this:
What is the role o... | 2012/07/05 | [
"https://math.stackexchange.com/questions/167113",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/34920/"
] | Let's suppose for the moment that you really only care about isomorphisms. That is, you really only care about telling whether two groups are isomorphic, or something. Great! But how do you write down isomorphisms? It's hard. Often you will be able to write down a map and you'll want to show it's an isomorphism. *Befor... | I think the use of homomorphisms is to identify one algebraic structure with another. With that identification we can say that two algebraic structures are same structurally i.e they are same when we view them with respect to algebraic operations involved in them although they may seem different with open eye. |
167,113 | In group theory we have encountered the concepts of homomorphisms as maps from one group to another, and the same thing with ring and field theory and we ave called them respectively homomorphisms of groups (of rings, and of fields). Also in linear algebra we have linear maps.
So my question is this:
What is the role o... | 2012/07/05 | [
"https://math.stackexchange.com/questions/167113",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/34920/"
] | One of my professors once said this about ring theory:
>
> To study rings, you have two choices. You can take a particular ring, and stare at it intently for a long period of time until you discover interesting things about that ring. Then you write them down.
>
>
> Or you can study how the rings "acts" on other st... | Homomorphisms do a lot of things:
1. They can be used to show two structures are identical (isomorphism)
2. They can be used to show one structure is a substructure of another (monomorphism)
3. They can be used to show one structure is a quotient of another (epimorphism)
4. General homomorphisms are kind of a mixture ... |
1,234,472 | How can I take several dll's in my bin folder for my ASP.NET application organize them into seperate folders and leave them under the bin directory so that they still are readily accesible to the application as if they were in the root of the bin? I want to reduce the monstrous list of dlls and group them into folders ... | 2009/08/05 | [
"https://Stackoverflow.com/questions/1234472",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/77538/"
] | You can make your application probe other directories for loading assemblies by using the web.config file and specifying a [`<probing>`](http://msdn.microsoft.com/en-us/library/823z9h8w.aspx) element. I'm unclear as to whether or not this works now with website type projects, as it did not several years ago. It should,... | Don't do that. Even if it works, it will not be understood by anyone else.
If you're bothered by the number of assemblies in the bin folder, then don't look there. |
1,234,472 | How can I take several dll's in my bin folder for my ASP.NET application organize them into seperate folders and leave them under the bin directory so that they still are readily accesible to the application as if they were in the root of the bin? I want to reduce the monstrous list of dlls and group them into folders ... | 2009/08/05 | [
"https://Stackoverflow.com/questions/1234472",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/77538/"
] | Don't do that. Even if it works, it will not be understood by anyone else.
If you're bothered by the number of assemblies in the bin folder, then don't look there. | Are you trying to organize the dlls generated by the app after compilation or the 3rd party and external dlls used by your app?
If it is the latter and you are not doing so already you can organize these into any hierarchy you choose outside the app (but inside the solution). You can then reference the dlls from ther... |
1,234,472 | How can I take several dll's in my bin folder for my ASP.NET application organize them into seperate folders and leave them under the bin directory so that they still are readily accesible to the application as if they were in the root of the bin? I want to reduce the monstrous list of dlls and group them into folders ... | 2009/08/05 | [
"https://Stackoverflow.com/questions/1234472",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/77538/"
] | You can make your application probe other directories for loading assemblies by using the web.config file and specifying a [`<probing>`](http://msdn.microsoft.com/en-us/library/823z9h8w.aspx) element. I'm unclear as to whether or not this works now with website type projects, as it did not several years ago. It should,... | There was an article [Moving the Code-Behind Assemblies/DLLs to a different folder than /BIN with ASP.NET 1.1](http://www.hanselman.com/blog/PermaLink.aspx?guid=4d0ef4fb-f8ae-4355-a658-3c0432c98dbe)
I suppose the approach with using [assemblyBinding Element for runtime](http://msdn.microsoft.com/en-us/library/twy1dw1... |
1,234,472 | How can I take several dll's in my bin folder for my ASP.NET application organize them into seperate folders and leave them under the bin directory so that they still are readily accesible to the application as if they were in the root of the bin? I want to reduce the monstrous list of dlls and group them into folders ... | 2009/08/05 | [
"https://Stackoverflow.com/questions/1234472",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/77538/"
] | You can make your application probe other directories for loading assemblies by using the web.config file and specifying a [`<probing>`](http://msdn.microsoft.com/en-us/library/823z9h8w.aspx) element. I'm unclear as to whether or not this works now with website type projects, as it did not several years ago. It should,... | Are you trying to organize the dlls generated by the app after compilation or the 3rd party and external dlls used by your app?
If it is the latter and you are not doing so already you can organize these into any hierarchy you choose outside the app (but inside the solution). You can then reference the dlls from ther... |
1,234,472 | How can I take several dll's in my bin folder for my ASP.NET application organize them into seperate folders and leave them under the bin directory so that they still are readily accesible to the application as if they were in the root of the bin? I want to reduce the monstrous list of dlls and group them into folders ... | 2009/08/05 | [
"https://Stackoverflow.com/questions/1234472",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/77538/"
] | There was an article [Moving the Code-Behind Assemblies/DLLs to a different folder than /BIN with ASP.NET 1.1](http://www.hanselman.com/blog/PermaLink.aspx?guid=4d0ef4fb-f8ae-4355-a658-3c0432c98dbe)
I suppose the approach with using [assemblyBinding Element for runtime](http://msdn.microsoft.com/en-us/library/twy1dw1... | Are you trying to organize the dlls generated by the app after compilation or the 3rd party and external dlls used by your app?
If it is the latter and you are not doing so already you can organize these into any hierarchy you choose outside the app (but inside the solution). You can then reference the dlls from ther... |
74,670,258 | req.body returns undefined.
Here is my code.
```
const express = require('express');
const app = express();
const courses = [
{ id: 1, name: 'course1'},
{ id: 2, name: 'course2'},
{ id: 3, name: 'course3'},
];
app.use(express.json());
app.get('/api/courses', (req, res) => {
res.send(courses);
});
... | 2022/12/03 | [
"https://Stackoverflow.com/questions/74670258",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15963853/"
] | Add this line `app.use(express.urlencoded({}))` below `app.use(express.json())` line | From the [documentation](https://expressjs.com/en/5x/api.html):
>
> **req.body:**
> Contains key-value pairs of data submitted in the request body. By
> default, it is undefined, and is populated when you use body-parsing
> middleware such as body-parser and multer.
>
>
> |
74,670,258 | req.body returns undefined.
Here is my code.
```
const express = require('express');
const app = express();
const courses = [
{ id: 1, name: 'course1'},
{ id: 2, name: 'course2'},
{ id: 3, name: 'course3'},
];
app.use(express.json());
app.get('/api/courses', (req, res) => {
res.send(courses);
});
... | 2022/12/03 | [
"https://Stackoverflow.com/questions/74670258",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15963853/"
] | Add this line `app.use(express.urlencoded({}))` below `app.use(express.json())` line | The issue is that while using postman, i forgot to change the post input type from text to JSON. Once i set it to json, it works. |
3,224 | In a recent (otherwise quite solid) edit of [“Will changing an artifact sword to another weapon type impact game balance much?”](https://rpg.stackexchange.com/q/30616/4563), @okeefe changed the British spelling “artefact” to the American spelling “artifact.”
Searching our meta, I see no rule regarding whether a partic... | 2013/12/09 | [
"https://rpg.meta.stackexchange.com/questions/3224",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/4563/"
] | You might be overthinking it. This might not be a case of which English is The Correct English.
D&D 4e has a thing called artifacts. I live in Australia, where we spell it "artefacts", but nevertheless, in the context of D&D 4e I will happily and consistently call them artifacts. They consistently call it that, and as... | While there are a lot of good points, I want to bring up ONE thing:
Keep Game Terms as they appear in the books!
============================================
There are a lot of games out there. Some are in AE, some BE, some CanE, some in Aussie slang. And a lot appear first as PDFs these days. People can easily quote... |
3,224 | In a recent (otherwise quite solid) edit of [“Will changing an artifact sword to another weapon type impact game balance much?”](https://rpg.stackexchange.com/q/30616/4563), @okeefe changed the British spelling “artefact” to the American spelling “artifact.”
Searching our meta, I see no rule regarding whether a partic... | 2013/12/09 | [
"https://rpg.meta.stackexchange.com/questions/3224",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/4563/"
] | >
> Some common reasons to edit are:
>
>
> * **to fix grammatical or spelling mistakes**
> * to clarify the meaning of a post without changing it
> * to correct minor mistakes or add addendums / updates as the post ages
> * to add related resources or hyperlinks
>
>
> Try to make the post substantively better when... | As we are playing particular systems any terms that might have alternative spelling should first the same as the spelling used by that system. If it isn't referring to a specific term then leave as the author intended.
As for whether everyone should be aware of alternative spellings, well that's a hard one. I daresay ... |
3,224 | In a recent (otherwise quite solid) edit of [“Will changing an artifact sword to another weapon type impact game balance much?”](https://rpg.stackexchange.com/q/30616/4563), @okeefe changed the British spelling “artefact” to the American spelling “artifact.”
Searching our meta, I see no rule regarding whether a partic... | 2013/12/09 | [
"https://rpg.meta.stackexchange.com/questions/3224",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/4563/"
] | I follow the Wikipedia policy: for AmE, BrE, and CanE (&c) spelling variants, preserve the variant of the original and standardise to that, if necessary. If it's seems to be a mix of spellings from different countries but specific words are consistent, don't try to figure out why, and leave the spelling alone. Basicall... | While there are a lot of good points, I want to bring up ONE thing:
Keep Game Terms as they appear in the books!
============================================
There are a lot of games out there. Some are in AE, some BE, some CanE, some in Aussie slang. And a lot appear first as PDFs these days. People can easily quote... |
3,224 | In a recent (otherwise quite solid) edit of [“Will changing an artifact sword to another weapon type impact game balance much?”](https://rpg.stackexchange.com/q/30616/4563), @okeefe changed the British spelling “artefact” to the American spelling “artifact.”
Searching our meta, I see no rule regarding whether a partic... | 2013/12/09 | [
"https://rpg.meta.stackexchange.com/questions/3224",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/4563/"
] | While there are a lot of good points, I want to bring up ONE thing:
Keep Game Terms as they appear in the books!
============================================
There are a lot of games out there. Some are in AE, some BE, some CanE, some in Aussie slang. And a lot appear first as PDFs these days. People can easily quote... | As we are playing particular systems any terms that might have alternative spelling should first the same as the spelling used by that system. If it isn't referring to a specific term then leave as the author intended.
As for whether everyone should be aware of alternative spellings, well that's a hard one. I daresay ... |
3,224 | In a recent (otherwise quite solid) edit of [“Will changing an artifact sword to another weapon type impact game balance much?”](https://rpg.stackexchange.com/q/30616/4563), @okeefe changed the British spelling “artefact” to the American spelling “artifact.”
Searching our meta, I see no rule regarding whether a partic... | 2013/12/09 | [
"https://rpg.meta.stackexchange.com/questions/3224",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/4563/"
] | You might be overthinking it. This might not be a case of which English is The Correct English.
D&D 4e has a thing called artifacts. I live in Australia, where we spell it "artefacts", but nevertheless, in the context of D&D 4e I will happily and consistently call them artifacts. They consistently call it that, and as... | Personal feeling: the initial spelling in such cases should be left alone, even if you are already editing the question or answer for other reasons.
And even if we decide that we should standardize on a single spelling, seems to me that this would not be a large enough change on its own to justify making the edit in t... |
3,224 | In a recent (otherwise quite solid) edit of [“Will changing an artifact sword to another weapon type impact game balance much?”](https://rpg.stackexchange.com/q/30616/4563), @okeefe changed the British spelling “artefact” to the American spelling “artifact.”
Searching our meta, I see no rule regarding whether a partic... | 2013/12/09 | [
"https://rpg.meta.stackexchange.com/questions/3224",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/4563/"
] | You might be overthinking it. This might not be a case of which English is The Correct English.
D&D 4e has a thing called artifacts. I live in Australia, where we spell it "artefacts", but nevertheless, in the context of D&D 4e I will happily and consistently call them artifacts. They consistently call it that, and as... | As we are playing particular systems any terms that might have alternative spelling should first the same as the spelling used by that system. If it isn't referring to a specific term then leave as the author intended.
As for whether everyone should be aware of alternative spellings, well that's a hard one. I daresay ... |
3,224 | In a recent (otherwise quite solid) edit of [“Will changing an artifact sword to another weapon type impact game balance much?”](https://rpg.stackexchange.com/q/30616/4563), @okeefe changed the British spelling “artefact” to the American spelling “artifact.”
Searching our meta, I see no rule regarding whether a partic... | 2013/12/09 | [
"https://rpg.meta.stackexchange.com/questions/3224",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/4563/"
] | While there are a lot of good points, I want to bring up ONE thing:
Keep Game Terms as they appear in the books!
============================================
There are a lot of games out there. Some are in AE, some BE, some CanE, some in Aussie slang. And a lot appear first as PDFs these days. People can easily quote... | Personal feeling: the initial spelling in such cases should be left alone, even if you are already editing the question or answer for other reasons.
And even if we decide that we should standardize on a single spelling, seems to me that this would not be a large enough change on its own to justify making the edit in t... |
3,224 | In a recent (otherwise quite solid) edit of [“Will changing an artifact sword to another weapon type impact game balance much?”](https://rpg.stackexchange.com/q/30616/4563), @okeefe changed the British spelling “artefact” to the American spelling “artifact.”
Searching our meta, I see no rule regarding whether a partic... | 2013/12/09 | [
"https://rpg.meta.stackexchange.com/questions/3224",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/4563/"
] | >
> Some common reasons to edit are:
>
>
> * **to fix grammatical or spelling mistakes**
> * to clarify the meaning of a post without changing it
> * to correct minor mistakes or add addendums / updates as the post ages
> * to add related resources or hyperlinks
>
>
> Try to make the post substantively better when... | Personal feeling: the initial spelling in such cases should be left alone, even if you are already editing the question or answer for other reasons.
And even if we decide that we should standardize on a single spelling, seems to me that this would not be a large enough change on its own to justify making the edit in t... |
3,224 | In a recent (otherwise quite solid) edit of [“Will changing an artifact sword to another weapon type impact game balance much?”](https://rpg.stackexchange.com/q/30616/4563), @okeefe changed the British spelling “artefact” to the American spelling “artifact.”
Searching our meta, I see no rule regarding whether a partic... | 2013/12/09 | [
"https://rpg.meta.stackexchange.com/questions/3224",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/4563/"
] | I follow the Wikipedia policy: for AmE, BrE, and CanE (&c) spelling variants, preserve the variant of the original and standardise to that, if necessary. If it's seems to be a mix of spellings from different countries but specific words are consistent, don't try to figure out why, and leave the spelling alone. Basicall... | Personal feeling: the initial spelling in such cases should be left alone, even if you are already editing the question or answer for other reasons.
And even if we decide that we should standardize on a single spelling, seems to me that this would not be a large enough change on its own to justify making the edit in t... |
3,224 | In a recent (otherwise quite solid) edit of [“Will changing an artifact sword to another weapon type impact game balance much?”](https://rpg.stackexchange.com/q/30616/4563), @okeefe changed the British spelling “artefact” to the American spelling “artifact.”
Searching our meta, I see no rule regarding whether a partic... | 2013/12/09 | [
"https://rpg.meta.stackexchange.com/questions/3224",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/4563/"
] | >
> Some common reasons to edit are:
>
>
> * **to fix grammatical or spelling mistakes**
> * to clarify the meaning of a post without changing it
> * to correct minor mistakes or add addendums / updates as the post ages
> * to add related resources or hyperlinks
>
>
> Try to make the post substantively better when... | You might be overthinking it. This might not be a case of which English is The Correct English.
D&D 4e has a thing called artifacts. I live in Australia, where we spell it "artefacts", but nevertheless, in the context of D&D 4e I will happily and consistently call them artifacts. They consistently call it that, and as... |
21,508,816 | sorry if this is dumb question, but this is the first time i've used python and Mongo DB.
Anyway, the problem I have is that I am trying to insert() a string to be stored in my data base -by read()-ing data in with a loop and then giving insert() line 1 and line2 in a single string (This is probably a messy way of doin... | 2014/02/02 | [
"https://Stackoverflow.com/questions/21508816",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3196428/"
] | The relevant part of your code is this:
```
post=collection.insert()
```
What you're doing there is calling the `insert` method without arguments rather than assigning that method to `post`. As the [`insert` method](http://api.mongodb.org/python/current/api/pymongo/collection.html#pymongo.collection.Collection.inser... | It appears as has been pointing out that you are attempting to create a [closure](https://stackoverflow.com/questions/4020419/closures-in-python) on the insert method. In this case I don't see the point as it will never be passed anywhere and/or need to reference something in the scope outside of where it was used. Jus... |
11,664,083 | I am using [`spl_autoload_register()`](http://www.php.net/manual/en/function.spl-autoload-register.php) function to include all files . What i want that any class having extension `.class.php` or `.php` would includes directly. I made below class and register two different function and everything working fine, **BUT**
... | 2012/07/26 | [
"https://Stackoverflow.com/questions/11664083",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/155861/"
] | There is nothing wrong with the way you do it. Two distinctive autoloaders for two kinds of class files are fine, but I would give them slightly more descriptive names ;)
>
> Note : there is no effect on line `spl_autoload_extensions();` . why?
>
>
>
This only affects the builtin-autoloading [`spl_autoload()`](ht... | Maybe this will help:
<http://php.net/manual/de/function.spl-autoload-extensions.php>
>
> Jeremy Cook 03-Sep-2010 06:46
>
>
> A quick note for anyone using this function to add their own autoload
> extensions. I found that if I included a space in between the
> different extensions (i.e. '.php, .class.php') the ... |
41,434,704 | Trying to change the cmd window colors. this does not work?
```
ProcessStartInfo p1 = new ProcessStartInfo();
p1.Verb = "runas";
p1.FileName = "cmd.exe";
p1.Arguments = "color 80";
Process.Start(p1);
``` | 2017/01/02 | [
"https://Stackoverflow.com/questions/41434704",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7124031/"
] | Add `/K`:
```
ProcessStartInfo p1 = new ProcessStartInfo();
p1.Verb = "runas";
p1.FileName = "cmd.exe";
p1.Arguments = "/K color 80";
Process.Start(p1);
```
Reasoning: `COLOR` is an ["internal command"](http://ss64.com/nt/syntax-internal.html). | Do the following:
```
Process proc = new Process();
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.FileName = "cmd.exe";
proc.StartInfo.Arguments = "/T:17"; //this would be blue colour
proc.StartInfo.Domain = "domainname"; //use if domain user
proc.StartInfo.UserName = "username";
proc.StartInfo.Password = "pa... |
795,428 | I have a <input> with an onclick event which checks for the Enter key. The called function may do a window.location redirect.
However, when I press the Enter key, it apparently fires off the page validation. So I see the validation messages for a split second.
How can I tell the page not to fire any of the validation... | 2009/04/27 | [
"https://Stackoverflow.com/questions/795428",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/337/"
] | If it's an <asp:Button>, just set the [CausesValidation](http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.causesvalidation.aspx) property to false. But, I *suspect* that it's not actually the button that's causing it - but the form submit that happens as a resul of the Enter key.
If that's the ... | Set [ValidationGroup](http://msdn.microsoft.com/en-us/library/ms227424.aspx) property of your validation controls. After that define ValidationGroup property to your button that you want to fire validation.
Also setting [Causesvalidation](http://msdn.microsoft.com/en-us/library/system.windows.forms.control.causesvalid... |
48,055,376 | Here is my code if refresh my page its logout or also while when I change menu bar its also logout why?
```
<?php
$userid = ($_POST['userid']);
$pswd = ($_POST['pswd']);
$conn = oci_connect('user', 'pswrd', 'db');
$query = "SELECT userid, pswd FROM staff
WHERE userid=:userid AND pswd=:pswd";
$stmt = oci_parse($con... | 2018/01/02 | [
"https://Stackoverflow.com/questions/48055376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5184800/"
] | I thought this might lead you to what you want, however, not sure this will be totally helpful. Since you don't have a condition to filter data, I tried the following way to just get your desired output. Note, this is just a try to guide you towards pandas.
`pandas` would be the best way to go about this as you could... | The Pandas package has the tools you need. However I would recommend starting with [scipy](https://www.scipy.org/about.html "scipy") and [anaconda](https://www.anaconda.com/download/#linux "anaconda") since I found installing Pandas on its own to be quite difficult. |
48,055,376 | Here is my code if refresh my page its logout or also while when I change menu bar its also logout why?
```
<?php
$userid = ($_POST['userid']);
$pswd = ($_POST['pswd']);
$conn = oci_connect('user', 'pswrd', 'db');
$query = "SELECT userid, pswd FROM staff
WHERE userid=:userid AND pswd=:pswd";
$stmt = oci_parse($con... | 2018/01/02 | [
"https://Stackoverflow.com/questions/48055376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5184800/"
] | ```
import csv
from collections import namedtuple
with open('DataAnalizada.csv', 'rb') as f:
reader = csv.reader(f)
first_col = reader.next()
header = namedtuple('header', first_col)
data = {}
for val in reader:
get_ = header(*val)
if get_.Analisis == 'Estable':
get... | The Pandas package has the tools you need. However I would recommend starting with [scipy](https://www.scipy.org/about.html "scipy") and [anaconda](https://www.anaconda.com/download/#linux "anaconda") since I found installing Pandas on its own to be quite difficult. |
87,476 | In a [sister site](https://movies.stackexchange.com/questions/51752/if-fireflys-mal-reynolds-is-a-sergeant-why-does-zoe-call-him-sir) I saw the word ***sir*** written in IPA as **/sər/**
and not **/sɜ:r/** as it was in my OALD. So I looked it up at [Oxford Dictionary on-line](http://www.oxforddictionaries.com/definiti... | 2016/04/14 | [
"https://ell.stackexchange.com/questions/87476",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/30256/"
] | I've no idea when the change that you ask about occurred. The definition below from the OED has not been updated since 1982, indicating that back then it did not consider the schwa to be exclusively reserved for unstressed syllables.
*A Dictionary of Psychology* (4th edition, Oxford U Press) says:
>
> The neutral a... | First of all, let's figure out the case of the word **sir**. According to [Oxford Learners' Dictionary](http://www.oxfordlearnersdictionaries.com/definition/english/sir?q=sir), both /sɜːr/ and /sər/ are correct pronunciations of the word. I have seen both pronunciation in OLD only (However I didn't look in a lot of dic... |
87,476 | In a [sister site](https://movies.stackexchange.com/questions/51752/if-fireflys-mal-reynolds-is-a-sergeant-why-does-zoe-call-him-sir) I saw the word ***sir*** written in IPA as **/sər/**
and not **/sɜ:r/** as it was in my OALD. So I looked it up at [Oxford Dictionary on-line](http://www.oxforddictionaries.com/definiti... | 2016/04/14 | [
"https://ell.stackexchange.com/questions/87476",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/30256/"
] | I've no idea when the change that you ask about occurred. The definition below from the OED has not been updated since 1982, indicating that back then it did not consider the schwa to be exclusively reserved for unstressed syllables.
*A Dictionary of Psychology* (4th edition, Oxford U Press) says:
>
> The neutral a... | Although for someone learning English, prescription is pedagogically appropriate (tell them what they should do) I remind everyone that a dictionary's PURPOSE is to describe NOT to prescribe. (It says how things are, NOT how they should be). Language (pronunciation, usage, grammar, and meaning) all vary by location and... |
87,476 | In a [sister site](https://movies.stackexchange.com/questions/51752/if-fireflys-mal-reynolds-is-a-sergeant-why-does-zoe-call-him-sir) I saw the word ***sir*** written in IPA as **/sər/**
and not **/sɜ:r/** as it was in my OALD. So I looked it up at [Oxford Dictionary on-line](http://www.oxforddictionaries.com/definiti... | 2016/04/14 | [
"https://ell.stackexchange.com/questions/87476",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/30256/"
] | First of all, let's figure out the case of the word **sir**. According to [Oxford Learners' Dictionary](http://www.oxfordlearnersdictionaries.com/definition/english/sir?q=sir), both /sɜːr/ and /sər/ are correct pronunciations of the word. I have seen both pronunciation in OLD only (However I didn't look in a lot of dic... | Although for someone learning English, prescription is pedagogically appropriate (tell them what they should do) I remind everyone that a dictionary's PURPOSE is to describe NOT to prescribe. (It says how things are, NOT how they should be). Language (pronunciation, usage, grammar, and meaning) all vary by location and... |
13,019,793 | I am creating some stuff on a `.on()` jquery handler like that
```
$('#idhere').on('click', function(){
//create a couple of divs with a class
});
```
Now I also want to add an event on the divs created, I have tried:
```
$('.divcreated').bind('mouseover', function(){
//do some magic
});
```
For some ... | 2012/10/22 | [
"https://Stackoverflow.com/questions/13019793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1447885/"
] | Assuming that `X` is the type of the objects in the list, then you can do something like this:
```
void DoSomething(X& object) {
object.count, object.avg;
}
void DoSomethingElse(int& count, int& average) {
...
}
int main() {
...
for(std::list<X>::iterator it=myList.begin(), end=myList.end(); it != end; ++it... | Think of an iterator as a pointer to an element in the list. So, instead of making the `calc_average` function act on individual members of `mystruct` you may want to have it take a reference to a `mystruct` object and doing something with that.
For instance:
```
void do_work( mystruct& s )
{
++s.count;
}
std::lis... |
13,019,793 | I am creating some stuff on a `.on()` jquery handler like that
```
$('#idhere').on('click', function(){
//create a couple of divs with a class
});
```
Now I also want to add an event on the divs created, I have tried:
```
$('.divcreated').bind('mouseover', function(){
//do some magic
});
```
For some ... | 2012/10/22 | [
"https://Stackoverflow.com/questions/13019793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1447885/"
] | Assuming that `X` is the type of the objects in the list, then you can do something like this:
```
void DoSomething(X& object) {
object.count, object.avg;
}
void DoSomethingElse(int& count, int& average) {
...
}
int main() {
...
for(std::list<X>::iterator it=myList.begin(), end=myList.end(); it != end; ++it... | Yes, it all seems correct to me. You can think of iterators (especially iterators of standard containers) as just pointers, though in practice they're actually classes that look like pointers. Still, you can think of them as pointers. |
13,019,793 | I am creating some stuff on a `.on()` jquery handler like that
```
$('#idhere').on('click', function(){
//create a couple of divs with a class
});
```
Now I also want to add an event on the divs created, I have tried:
```
$('.divcreated').bind('mouseover', function(){
//do some magic
});
```
For some ... | 2012/10/22 | [
"https://Stackoverflow.com/questions/13019793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1447885/"
] | Assuming that `X` is the type of the objects in the list, then you can do something like this:
```
void DoSomething(X& object) {
object.count, object.avg;
}
void DoSomethingElse(int& count, int& average) {
...
}
int main() {
...
for(std::list<X>::iterator it=myList.begin(), end=myList.end(); it != end; ++it... | I am currently working with dynamic content and I found
I have a SPRITE structure
std::list characters\_spr;
I declare a character by SPRITE character then I use
```
characters_spr.push_back(character)
```
then
I use a for loop to iterate over the list
```
for(SPRITE &character : characters_spr){
somefunction(ch... |
13,019,793 | I am creating some stuff on a `.on()` jquery handler like that
```
$('#idhere').on('click', function(){
//create a couple of divs with a class
});
```
Now I also want to add an event on the divs created, I have tried:
```
$('.divcreated').bind('mouseover', function(){
//do some magic
});
```
For some ... | 2012/10/22 | [
"https://Stackoverflow.com/questions/13019793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1447885/"
] | Think of an iterator as a pointer to an element in the list. So, instead of making the `calc_average` function act on individual members of `mystruct` you may want to have it take a reference to a `mystruct` object and doing something with that.
For instance:
```
void do_work( mystruct& s )
{
++s.count;
}
std::lis... | Yes, it all seems correct to me. You can think of iterators (especially iterators of standard containers) as just pointers, though in practice they're actually classes that look like pointers. Still, you can think of them as pointers. |
13,019,793 | I am creating some stuff on a `.on()` jquery handler like that
```
$('#idhere').on('click', function(){
//create a couple of divs with a class
});
```
Now I also want to add an event on the divs created, I have tried:
```
$('.divcreated').bind('mouseover', function(){
//do some magic
});
```
For some ... | 2012/10/22 | [
"https://Stackoverflow.com/questions/13019793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1447885/"
] | Think of an iterator as a pointer to an element in the list. So, instead of making the `calc_average` function act on individual members of `mystruct` you may want to have it take a reference to a `mystruct` object and doing something with that.
For instance:
```
void do_work( mystruct& s )
{
++s.count;
}
std::lis... | I am currently working with dynamic content and I found
I have a SPRITE structure
std::list characters\_spr;
I declare a character by SPRITE character then I use
```
characters_spr.push_back(character)
```
then
I use a for loop to iterate over the list
```
for(SPRITE &character : characters_spr){
somefunction(ch... |
8,543,603 | hi there I wanted to use Ajax in a drop down list using Drupal form API. the problem is that i want to prevent the user submit the form before the Ajax response from server comes back. how it is possible to disable the submit button or to prevent any other user actions when the select list state is being changed and th... | 2011/12/17 | [
"https://Stackoverflow.com/questions/8543603",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/435245/"
] | Ajax in Drupal has a public method called .ajaxStart
You can do a
```
jQuery('#form_id').ajaxStart(function(){ //Here you prevent shit } );
```
And also has a method named .ajaxSuccess for the finish action | jQuery allows you to run code after an AJAX call has finished. You could disable your elements when the combo box is changed and then enable everything on `success`. Here's an example I pulled from the [jQuery.ajax() Docs](http://api.jquery.com/jQuery.ajax/).
```
$.ajax({
url: 'ajax/test.html',
success: function(d... |
8,543,603 | hi there I wanted to use Ajax in a drop down list using Drupal form API. the problem is that i want to prevent the user submit the form before the Ajax response from server comes back. how it is possible to disable the submit button or to prevent any other user actions when the select list state is being changed and th... | 2011/12/17 | [
"https://Stackoverflow.com/questions/8543603",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/435245/"
] | Ajax in Drupal has a public method called .ajaxStart
You can do a
```
jQuery('#form_id').ajaxStart(function(){ //Here you prevent shit } );
```
And also has a method named .ajaxSuccess for the finish action | Its just a trick that you should use to prevent submitting during ajax loading.
During ajax loading just disabled the submit button and enable it on success.
Like that:
Suppose submit button's id is: submit\_button, then
```
$("#submit_button").attr("disabled", "disabled");
$.ajax({
url: 'html-data/demo.html',
su... |
8,543,603 | hi there I wanted to use Ajax in a drop down list using Drupal form API. the problem is that i want to prevent the user submit the form before the Ajax response from server comes back. how it is possible to disable the submit button or to prevent any other user actions when the select list state is being changed and th... | 2011/12/17 | [
"https://Stackoverflow.com/questions/8543603",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/435245/"
] | Ajax in Drupal has a public method called .ajaxStart
You can do a
```
jQuery('#form_id').ajaxStart(function(){ //Here you prevent shit } );
```
And also has a method named .ajaxSuccess for the finish action | Set a global flag
```
var flag = true;
```
Then in your AJAX before your post set the flag to false
```
flag = false;
```
As part of your success function
```
flag = true;
```
And then on your submit buttons
```
onclick="return(if(flag));"
``` |
8,543,603 | hi there I wanted to use Ajax in a drop down list using Drupal form API. the problem is that i want to prevent the user submit the form before the Ajax response from server comes back. how it is possible to disable the submit button or to prevent any other user actions when the select list state is being changed and th... | 2011/12/17 | [
"https://Stackoverflow.com/questions/8543603",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/435245/"
] | Ajax in Drupal has a public method called .ajaxStart
You can do a
```
jQuery('#form_id').ajaxStart(function(){ //Here you prevent shit } );
```
And also has a method named .ajaxSuccess for the finish action | here is my take on it
```
$(document).ajaxComplete(function(){
// the code to be fired after the AJAX is completed
$('#edit-submit').removeAttr("disabled");
});
$(document).ajaxStart(function(){
event.preventDefault();
$("#edit-submit").attr("disabled", "disabled");
} );
`... |
9,320,773 | If I use any of the CRUD methods of SocialDataService (eg: AddComment), I find that even once the POST has returned successfully SharePoint has not actually processed the change. By that I mean that a quick call to GetCommentsOnUrl will return the old data, even though I am clearly making my request only after receivin... | 2012/02/16 | [
"https://Stackoverflow.com/questions/9320773",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/848249/"
] | ```
lista = list.sort(lista)
```
This should be
```
lista.sort()
```
The `.sort()` method is in-place, and returns None. If you want something not in-place, which returns a value, you could use
```
sorted_list = sorted(lista)
```
Aside #1: please don't call your lists `list`. That clobbers the builtin list type... | The exception `TypeError: 'NoneType' object is not subscriptable` happens because the value of `lista` is actually `None`. You can reproduce `TypeError` that you get in your code if you try this at the Python command line:
```
None[0]
```
The reason that `lista` gets set to None is because the return value of `list.... |
9,320,773 | If I use any of the CRUD methods of SocialDataService (eg: AddComment), I find that even once the POST has returned successfully SharePoint has not actually processed the change. By that I mean that a quick call to GetCommentsOnUrl will return the old data, even though I am clearly making my request only after receivin... | 2012/02/16 | [
"https://Stackoverflow.com/questions/9320773",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/848249/"
] | ```
lista = list.sort(lista)
```
This should be
```
lista.sort()
```
The `.sort()` method is in-place, and returns None. If you want something not in-place, which returns a value, you could use
```
sorted_list = sorted(lista)
```
Aside #1: please don't call your lists `list`. That clobbers the builtin list type... | At this link <https://docs.python.org/2/tutorial/datastructures.html> you can read this method
"Sort the items of the list in place" this means that the result value will on sorted and
the result will be on itself. The function returns None.
When you assign the result to "lista" in line 14
```
lista = list.sort(l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.