qid int64 1 74.6M | question stringlengths 45 24.2k | date stringlengths 10 10 | metadata stringlengths 101 178 | response_j stringlengths 32 23.2k | response_k stringlengths 21 13.2k |
|---|---|---|---|---|---|
51,317 | [Danny Schoemmann](https://judaism.stackexchange.com/users/501/danny-schoemann) mentions a ceremony called a chol-kreisch in [this answer](https://judaism.stackexchange.com/a/7500/4504) for giving the secular name of a child. Is this custom still observed, and if so, how is it practiced? | 2015/01/04 | ['https://judaism.stackexchange.com/questions/51317', 'https://judaism.stackexchange.com', 'https://judaism.stackexchange.com/users/4504/'] | A description of the ceremony is given in [מדריך
למנהג אשכנז המובהק](http://www.moreshesashkenaz.org/mm/publications/Madrich.pdf).
My translation:
>
> On that Shabbos when the mother of the new born goes to synagogue, a
> "Chol Kreisch"is made for the child. On the day of the miloh the
> child acquired his Jewis... | My family origins are in Alsace and various places in Germany, which are places where the minhag was practiced historically. I have a 10 month old son, and I made a chol kreisch for him. I did it as it says in the Rodelheim siddur.
I'm not sure why it seems odd to give the child a "street name". The names that were gi... |
15,719,092 | I am having a problem in getting the string name of the currently selected database.
this is what i did.. i am trying to echo the name of the database but it produces an error "Warning: mysql\_fetch\_array() expects parameter 1 to be resource"
```
<?php
$dbcon = mysql_connect("localhost", "root", "")
or die(my... | 2013/03/30 | ['https://Stackoverflow.com/questions/15719092', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1647596/'] | You yourself need to select a database after connecting to MySQL, it's not selected by default, like this:
```
$dbcon = mysql_connect("localhost", "root", "")
or die(mysql_error()."Not Connected");
mysql_select_db("databasename"); # add this line
$sql = mysql_query("select database()");
$row = mysql_fetch_array... | first, I would suggest you use mysqli functions instead of mysql as they are being deprecated.
Then, you just select the database by adding the database name in the parameter to mysql\_select\_db():
```
mysql_select_db('dbname');
```
note that another advantage of mysqli is you can specify the database in the co... |
15,719,092 | I am having a problem in getting the string name of the currently selected database.
this is what i did.. i am trying to echo the name of the database but it produces an error "Warning: mysql\_fetch\_array() expects parameter 1 to be resource"
```
<?php
$dbcon = mysql_connect("localhost", "root", "")
or die(my... | 2013/03/30 | ['https://Stackoverflow.com/questions/15719092', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1647596/'] | You should either select a database right after connecting using your login credentials. Or, if you want to see what databases the `root` user has access to, use:
```
SHOW DATABASES;
``` | first, I would suggest you use mysqli functions instead of mysql as they are being deprecated.
Then, you just select the database by adding the database name in the parameter to mysql\_select\_db():
```
mysql_select_db('dbname');
```
note that another advantage of mysqli is you can specify the database in the co... |
15,719,092 | I am having a problem in getting the string name of the currently selected database.
this is what i did.. i am trying to echo the name of the database but it produces an error "Warning: mysql\_fetch\_array() expects parameter 1 to be resource"
```
<?php
$dbcon = mysql_connect("localhost", "root", "")
or die(my... | 2013/03/30 | ['https://Stackoverflow.com/questions/15719092', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1647596/'] | `select Database()` shows the name of the name of the slected database.
It will work only after you have already selected the database using `mysql_select_db()`.
If you want to get the name of the databases available to you then use `SHOW DATABASES` | first, I would suggest you use mysqli functions instead of mysql as they are being deprecated.
Then, you just select the database by adding the database name in the parameter to mysql\_select\_db():
```
mysql_select_db('dbname');
```
note that another advantage of mysqli is you can specify the database in the co... |
33,886,993 | For Marklogic, it's a NoSQL db and powerful server engine. I use \*.xqy file to write code before,but marklogic 8 has an advanced function is that it can write javascript code directly.For more speed to search at database, I want to transplant the xquery project to javascript project.But there is no existing frame to b... | 2015/11/24 | ['https://Stackoverflow.com/questions/33886993', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5319952/'] | There’s a lot to untangle here.
First, the runtime performance differences between the equivalent functionality written in XQuery and JavaScript will be negligible. I’d suggest you weigh other factors more heavily when deciding between them. For example, what will your developers be most productive with? What parts o... | If you are talking about a server-side MVC model, then it's true there is no JS framework available yet. There is a lot going on though:
* Christy Haragan is putting a lot of effort in various [TypeScript-related projects](http://github-search.demo.marklogic.com/search?f=owner:christyharagan) that cover the full stack... |
19,669,054 | I have an excel sheet that contains phone calls with Start day, Start Time and End Time. I would like to find a way to loop through the calls to see how many of our phone trunks are in use during each call. There may be a better way to check this but here is the logic I was thinking of using.
In Cell C1 I have the St... | 2013/10/29 | ['https://Stackoverflow.com/questions/19669054', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2933813/'] | You do not necessarily need VBA. Try the following, adjusting for your data ranges. You cannot use full column references in this case, or else the formula will take a long time to run.
```
=SUM(IF(C$1:C$11<=C1,IF(D$1:D$11>=C1,1,0),0))
```
When you enter this, you'll have to press `CTRL+SHIFT+ENTER` instead of just ... | The basic idea of looping through a bunch of cells, comparing it with values in another column is shown in the following. I have used a similar one in one of the programs. Now you can use if/else logic matching your requirement.
```
For rowIndex = 2 To lr2
calcFormula1 = (Application.SumIf(Range("C2:C100"), Range(ro... |
48,374,126 | [](https://i.stack.imgur.com/WDUOp.png)
I do have a problem when I'm going to submit my form, i dont have any idea to add this format "2018-00XX" automatically when someone submitted a form and the data will be transferred to google spreadsheet... | 2018/01/22 | ['https://Stackoverflow.com/questions/48374126', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5330802/'] | A2:
```
=ARRAYFORMULA("201800"&text(ROW(A$1:INDEX(B:B,COUNTA(B:B)-1)),"00"))
``` | You can use formula like this in the 1st Column
```
=if(EQ(B2,),"", A1+1)
```
This will check if column 2 is empty or not if, it isn't then it'll set value of cell just above it plus one.
NOTE : For 1st cell you'll need to set value 20180001 manually and apply this formula to rest of the whole column one cells. |
48,374,126 | [](https://i.stack.imgur.com/WDUOp.png)
I do have a problem when I'm going to submit my form, i dont have any idea to add this format "2018-00XX" automatically when someone submitted a form and the data will be transferred to google spreadsheet... | 2018/01/22 | ['https://Stackoverflow.com/questions/48374126', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5330802/'] | A2:
```
=ARRAYFORMULA("201800"&text(ROW(A$1:INDEX(B:B,COUNTA(B:B)-1)),"00"))
``` | With *2018* hardcoded in,
```
=text(row(1:1), "\2\0\1\80000")
```
Using the date from column B,
```
=year(B2)&text(COUNTIFS(B$2:B2, ">="&date(year(B2), 1, 1), B$2:B2, "<"&date(year(B2)+1, 1, 1)), "0000")
``` |
7,903,423 | I am displaying a graph using jQplot to monitor data.
To refresh the div holding the graph, I invoke an ajax call every 5 seconds (see JavaScript excerpt below).
On the server, a PHP script retrieves the data from a database.
On success, the ajax call is reinvoked after 5 seconds with a JavaScript setTimeout(ajax,5000)... | 2011/10/26 | ['https://Stackoverflow.com/questions/7903423', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1014584/'] | Since you're re-calling ajax() after a good or fail ajax call, you're starting multiple timers. This is why your browser is crashing.
you may want to try to clear the current timer and then start the next timer
```
var t; //global
```
In each of your call back functions:
```
if(t)
clearTimeout(t);
t = setTi... | I removed the jqplot call as suggested and the problem disappeared.
Apparently jqplot is the culprit and I found numerous entries referring to jqPlot memory leaks.
I use jQuery 1.6.4 and installed jqPlot Charts version 1.0.0b2\_r792 which supposedly addresses memory leak issues.
Furthermore, I replaced
```
$('#char... |
15,711,158 | My program calls exec() on a binary that has been written to a directory specified by the user. If the directory resides in a tree mounted with "noexec", the exec() fails with EACCES.
Instead of failing the exec(), I would like to be able to figure out if a directory was mounted with noexec, but none of fcntl(), stat(... | 2013/03/29 | ['https://Stackoverflow.com/questions/15711158', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/901185/'] | You can use [statvfs](http://man7.org/linux/man-pages/man3/fstatvfs.3.html)()
```
struct statvfs st;
inr rc = statvfs("/mnt/foo", &st);
if (rc == -1)
error();
if (st.f_flag & ST_NOEXEC) {
//no exec flags was set
}
``` | Did you consider reading `/proc/mounts` then determining which file system your program binary resides on, perhaps using [statfs(2)](http://man7.org/linux/man-pages/man2/fstatfs.2.html) and/or [realpath(3)](http://man7.org/linux/man-pages/man3/realpath.3.html)?
But you always should care about, and handle, the failure... |
1,620,729 | For a hostname to resolve into its IP address, there are several DNS servers that may be queried. Assuming caching doesn't happen, it goes from whoever made the request (the client), the recursive DNS, the root DNS, the TLD DNS and finally the authoritative name server.
Do I have the order right? Are requests forwarde... | 2021/01/25 | ['https://superuser.com/questions/1620729', 'https://superuser.com', 'https://superuser.com/users/699180/'] | To start with, the type `[Microsoft.Update.Session]` is not really a built-in Powershell object, but part of the [windows update agent (WUA) API](https://docs.microsoft.com/en-us/windows/win32/wua_sdk/searching--downloading--and-installing-updates). As such, it doesn't have any built-in help files or examples powershel... | The easiest is to use the `Get-Member` cmdlet, like:
```
$Updates | Get-Member
```
in this case it is most likely a COM object, but it should still show you the Methods and Properties |
15,164,450 | I try to run a Linux command and read the output from it by using C/C++ code.
I search for exec but this don't deal with input/output.
What I am trying to achieve is to get information about wireless LAN by using this command `iwconfig`, invoking it from C/C++ code.
also i need a suitable code to use it as lib for an... | 2013/03/01 | ['https://Stackoverflow.com/questions/15164450', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2110922/'] | You could try running the command and outputting the results to a file, then reading it
```
system("iwconfig > temp.txt");
FILE *fp=fopen("temp.txt","w");
``` | i see in android open source they called this function
what do you think about this code ?
```
int wpa_ctrl_request(struct wpa_ctrl *ctrl, const char *cmd, size_t cmd_len,
char *reply, size_t *reply_len,
void (*msg_cb)(char *msg, size_t len))
{
DWORD written;
DWORD r... |
6,473,882 | I have a custom control with a panel wrapping all the other controls. The control is in one of two states, edit-mode and normal. When in edit-mode I want the control to have the option of a different background color.
I have:
In Pre\_Render:
```
Panel1.BackColor = EditMode ? BackEditColor : BackColor;
```
And the... | 2011/06/24 | ['https://Stackoverflow.com/questions/6473882', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/353147/'] | ```js
var y = [1,2,3,4,5,6,7,8,9,10];
console.log(y.slice((y.length - 5), y.length))
```
you can do this! | ```
array.reverse()
.slice(0,5)
.reverse() //if you wanna keep the order of last 5
```
---
```
const myOriginalArray = [...Array(10).keys()] //making an array of numbers
const instanceFromlastFiveItemsOfMyArray = [
...myOriginalArray.reverse().slice(0,5).reverse()
]
``` |
6,473,882 | I have a custom control with a panel wrapping all the other controls. The control is in one of two states, edit-mode and normal. When in edit-mode I want the control to have the option of a different background color.
I have:
In Pre\_Render:
```
Panel1.BackColor = EditMode ? BackEditColor : BackColor;
```
And the... | 2011/06/24 | ['https://Stackoverflow.com/questions/6473882', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/353147/'] | Here is one I haven't seen that's even shorter
```
arr.slice(1).slice(-5)
```
Run the code snippet below for proof of it doing what you want
```js
const arr = [];
for (let i = 0; i < 8; i++) {
arr.push(i);
console.log(`Array ${i + 1}: ${arr} -> ${arr.slice(1).slice(-5)}`);
}
```
Another way to do it would ... | Beginner solution:
```
var givme = function(n) {
if(n.length == 1) {
return [];
}
if(n.length > 5) {
return n.slice(n.length-5, n.length);
}
if(n.length <= 5) {
return n.slice(1, n.length);
}
}
// console.log(givme([1, 55, 77, 88, 99, 22, 33, 44]));
``` |
6,473,882 | I have a custom control with a panel wrapping all the other controls. The control is in one of two states, edit-mode and normal. When in edit-mode I want the control to have the option of a different background color.
I have:
In Pre\_Render:
```
Panel1.BackColor = EditMode ? BackEditColor : BackColor;
```
And the... | 2011/06/24 | ['https://Stackoverflow.com/questions/6473882', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/353147/'] | If you are using lodash, its even simpler with [takeRight](https://lodash.com/docs#takeRight).
`_.takeRight(arr, 5);` | ES6 way:
I use [destructuring assignment](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) for array to get `first` and remaining `rest` elements and then I'll take last five of the `rest` with [slice](https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/G... |
6,473,882 | I have a custom control with a panel wrapping all the other controls. The control is in one of two states, edit-mode and normal. When in edit-mode I want the control to have the option of a different background color.
I have:
In Pre\_Render:
```
Panel1.BackColor = EditMode ? BackEditColor : BackColor;
```
And the... | 2011/06/24 | ['https://Stackoverflow.com/questions/6473882', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/353147/'] | You can call:
```
arr.slice(Math.max(arr.length - 5, 1))
```
If you don't want to exclude the first element, use
```
arr.slice(Math.max(arr.length - 5, 0))
``` | Here is one I haven't seen that's even shorter
```
arr.slice(1).slice(-5)
```
Run the code snippet below for proof of it doing what you want
```js
const arr = [];
for (let i = 0; i < 8; i++) {
arr.push(i);
console.log(`Array ${i + 1}: ${arr} -> ${arr.slice(1).slice(-5)}`);
}
```
Another way to do it would ... |
6,473,882 | I have a custom control with a panel wrapping all the other controls. The control is in one of two states, edit-mode and normal. When in edit-mode I want the control to have the option of a different background color.
I have:
In Pre\_Render:
```
Panel1.BackColor = EditMode ? BackEditColor : BackColor;
```
And the... | 2011/06/24 | ['https://Stackoverflow.com/questions/6473882', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/353147/'] | Try this:
```
var array = [1, 55, 77, 88, 76, 59];
var array_last_five;
array_last_five = array.slice(-5);
if (array.length < 6) {
array_last_five.shift();
}
``` | You can do it in one line like this:
```js
const y = [1,2,3,4,5,6,7,8,9,10];
const lastX = 5;
const res = y.filter((val, index, arr) => index > arr.length - lastX - 1);
console.log(res);
```
```
.filter((val, index, arr) => index > arr.length - 6)
``` |
6,473,882 | I have a custom control with a panel wrapping all the other controls. The control is in one of two states, edit-mode and normal. When in edit-mode I want the control to have the option of a different background color.
I have:
In Pre\_Render:
```
Panel1.BackColor = EditMode ? BackEditColor : BackColor;
```
And the... | 2011/06/24 | ['https://Stackoverflow.com/questions/6473882', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/353147/'] | Here is one I haven't seen that's even shorter
```
arr.slice(1).slice(-5)
```
Run the code snippet below for proof of it doing what you want
```js
const arr = [];
for (let i = 0; i < 8; i++) {
arr.push(i);
console.log(`Array ${i + 1}: ${arr} -> ${arr.slice(1).slice(-5)}`);
}
```
Another way to do it would ... | ES6 way:
I use [destructuring assignment](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) for array to get `first` and remaining `rest` elements and then I'll take last five of the `rest` with [slice](https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/G... |
6,473,882 | I have a custom control with a panel wrapping all the other controls. The control is in one of two states, edit-mode and normal. When in edit-mode I want the control to have the option of a different background color.
I have:
In Pre\_Render:
```
Panel1.BackColor = EditMode ? BackEditColor : BackColor;
```
And the... | 2011/06/24 | ['https://Stackoverflow.com/questions/6473882', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/353147/'] | You can call:
```
arr.slice(Math.max(arr.length - 5, 1))
```
If you don't want to exclude the first element, use
```
arr.slice(Math.max(arr.length - 5, 0))
``` | You can do it in one line like this:
```js
const y = [1,2,3,4,5,6,7,8,9,10];
const lastX = 5;
const res = y.filter((val, index, arr) => index > arr.length - lastX - 1);
console.log(res);
```
```
.filter((val, index, arr) => index > arr.length - 6)
``` |
6,473,882 | I have a custom control with a panel wrapping all the other controls. The control is in one of two states, edit-mode and normal. When in edit-mode I want the control to have the option of a different background color.
I have:
In Pre\_Render:
```
Panel1.BackColor = EditMode ? BackEditColor : BackColor;
```
And the... | 2011/06/24 | ['https://Stackoverflow.com/questions/6473882', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/353147/'] | Here is one I haven't seen that's even shorter
```
arr.slice(1).slice(-5)
```
Run the code snippet below for proof of it doing what you want
```js
const arr = [];
for (let i = 0; i < 8; i++) {
arr.push(i);
console.log(`Array ${i + 1}: ${arr} -> ${arr.slice(1).slice(-5)}`);
}
```
Another way to do it would ... | If you are using lodash, its even simpler with [takeRight](https://lodash.com/docs#takeRight).
`_.takeRight(arr, 5);` |
6,473,882 | I have a custom control with a panel wrapping all the other controls. The control is in one of two states, edit-mode and normal. When in edit-mode I want the control to have the option of a different background color.
I have:
In Pre\_Render:
```
Panel1.BackColor = EditMode ? BackEditColor : BackColor;
```
And the... | 2011/06/24 | ['https://Stackoverflow.com/questions/6473882', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/353147/'] | Here is one I haven't seen that's even shorter
```
arr.slice(1).slice(-5)
```
Run the code snippet below for proof of it doing what you want
```js
const arr = [];
for (let i = 0; i < 8; i++) {
arr.push(i);
console.log(`Array ${i + 1}: ${arr} -> ${arr.slice(1).slice(-5)}`);
}
```
Another way to do it would ... | ```js
var y = [1,2,3,4,5,6,7,8,9,10];
console.log(y.slice((y.length - 5), y.length))
```
you can do this! |
6,473,882 | I have a custom control with a panel wrapping all the other controls. The control is in one of two states, edit-mode and normal. When in edit-mode I want the control to have the option of a different background color.
I have:
In Pre\_Render:
```
Panel1.BackColor = EditMode ? BackEditColor : BackColor;
```
And the... | 2011/06/24 | ['https://Stackoverflow.com/questions/6473882', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/353147/'] | Try this:
```
var array = [1, 55, 77, 88, 76, 59];
var array_last_five;
array_last_five = array.slice(-5);
if (array.length < 6) {
array_last_five.shift();
}
``` | ```
array.reverse()
.slice(0,5)
.reverse() //if you wanna keep the order of last 5
```
---
```
const myOriginalArray = [...Array(10).keys()] //making an array of numbers
const instanceFromlastFiveItemsOfMyArray = [
...myOriginalArray.reverse().slice(0,5).reverse()
]
``` |
63,735,775 | Here is my `Get` request:
```
@GetMapping("/stats/{fromDate}/{toDate}")
public StatsSummary getStatsSummary(@PathVariable String fromDate, @PathVariable String toDate) {
logger.info("Calculating statistics between" + fromDate + ",to" + toDate);
return statsService.getStatsSummary(fromDate, toDate);
}
```
... | 2020/09/04 | ['https://Stackoverflow.com/questions/63735775', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/470184/'] | Actually Spring by sending 404 returns correct answer to a client.
When someone doesn't provide full URL, the 404 is the status to respond.
The proper way to validate that is to use some date class like **Date** or **LocalDate** or similar instead of **String**.
Probably you'll need to define proper formatting of date... | Add the following annotation to the class worked for me.(Not to the method)
```
@Validated
``` |
63,735,775 | Here is my `Get` request:
```
@GetMapping("/stats/{fromDate}/{toDate}")
public StatsSummary getStatsSummary(@PathVariable String fromDate, @PathVariable String toDate) {
logger.info("Calculating statistics between" + fromDate + ",to" + toDate);
return statsService.getStatsSummary(fromDate, toDate);
}
```
... | 2020/09/04 | ['https://Stackoverflow.com/questions/63735775', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/470184/'] | In REST, path variables are part of the resource URL. Therefore, if a part of the path/URL is missing, the resource is different.
That is why a 404 is the correct response code.
If those two variables can be empty, they should be @RequestParam. | Add the following annotation to the class worked for me.(Not to the method)
```
@Validated
``` |
63,735,775 | Here is my `Get` request:
```
@GetMapping("/stats/{fromDate}/{toDate}")
public StatsSummary getStatsSummary(@PathVariable String fromDate, @PathVariable String toDate) {
logger.info("Calculating statistics between" + fromDate + ",to" + toDate);
return statsService.getStatsSummary(fromDate, toDate);
}
```
... | 2020/09/04 | ['https://Stackoverflow.com/questions/63735775', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/470184/'] | In REST, path variables are part of the resource URL. Therefore, if a part of the path/URL is missing, the resource is different.
That is why a 404 is the correct response code.
If those two variables can be empty, they should be @RequestParam. | Actually Spring by sending 404 returns correct answer to a client.
When someone doesn't provide full URL, the 404 is the status to respond.
The proper way to validate that is to use some date class like **Date** or **LocalDate** or similar instead of **String**.
Probably you'll need to define proper formatting of date... |
74,610,023 | Hazelcast cluster running in different hosts IP1, IP2...
hazelcast.xml configure the TCP-IP members
[enter image description here](https://i.stack.imgur.com/RQCRa.png)
Now I want to expanding the cluster to support more service.
I install a new hazelcast in new IP3
How can I add the new IP3 to the exsiting cluster wi... | 2022/11/29 | ['https://Stackoverflow.com/questions/74610023', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/20630141/'] | You should pass `log` prop in Sign component and take it like this.
```
export default function Sign({ navigation, log }) {
async function onGoogleButtonPress() {
await GoogleSignin.hasPlayServices();
const userInfo = await GoogleSignin.signIn();
setuserInfo(userInfo);
navigation.navigate('dash', {user... | we can pass a value from one screen to another screen through `async-storage` `react-navigation` or declare a value globally.
To pass a value from login to dashboard I recommend you to see this async-storage Docs <https://react-native-async-storage.github.io/async-storage/docs/install>
async-storage store a value in... |
157,931 | From an outsider/student's view, STEM professors are:
1. not taking courses
2. mostly not doing things outside of their research comfort zones
3. not (?) studying up much except for their research, certainly not doing exercises from the back of a book and looking up solutions somewhere
4. some graduated 40 years ago o... | 2020/10/22 | ['https://academia.stackexchange.com/questions/157931', 'https://academia.stackexchange.com', 'https://academia.stackexchange.com/users/87227/'] | In short, your premises are wrong.
* Professors read papers to learn.
* Professors meet with their peers, both at conferences and informally, and learn from them.
* Professors do learn from their research students.
These are slow methods of learning, but over many years they add up.
Further, in fast-moving fields of... | By having PhD students and post docs. Not saying professors don't do research but a big part is having the idea then handing it off to a student/post doc who does the research. PhD students gets to spend 3-4 years becoming the expert in their tiny subfield. At some point the PhD student will start teaching the professo... |
11,826,441 | How can I reduce the clustered index scan cost of below mentioned query
```
DECLARE @PARAMVAL varchar(3)
set @PARAMVAL = 'CTD'
select * from MASTER_RECORD_TYPE where RECORD_TYPE_CODE=@PARAMVAL
```
if I run the above query it was showing index scan 99 %
Please find here below my table particularities:
![enter ima... | 2012/08/06 | ['https://Stackoverflow.com/questions/11826441', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1494292/'] | First of all - if you search for `RECORD_TYPE_CODE` you should make sure to have an index on that column.
Besides that mainly two things:
* **don't** use `SELECT *` - that'll always have to go back to the clustered index to get the full data page; use a `SELECT` that explicitly specifies which columns to use
* if ev... | You need to try and use a covered index. But the problem you're going to have is that you're using `SELECT *`. Do you really need the entire record?
Either way, add `RECORD_TYPE_CODE` to another index and it will help with the query because at least that field can be read off of an index page. |
11,826,441 | How can I reduce the clustered index scan cost of below mentioned query
```
DECLARE @PARAMVAL varchar(3)
set @PARAMVAL = 'CTD'
select * from MASTER_RECORD_TYPE where RECORD_TYPE_CODE=@PARAMVAL
```
if I run the above query it was showing index scan 99 %
Please find here below my table particularities:
![enter ima... | 2012/08/06 | ['https://Stackoverflow.com/questions/11826441', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1494292/'] | First of all - if you search for `RECORD_TYPE_CODE` you should make sure to have an index on that column.
Besides that mainly two things:
* **don't** use `SELECT *` - that'll always have to go back to the clustered index to get the full data page; use a `SELECT` that explicitly specifies which columns to use
* if ev... | In your query, you have used column `RECORD_TYPE_CODE` which is not part of `clustered index` and also not included in any `non-clustered index` too. So SQL Optimizer will decide to scan the clustered index to do comparison of where clause predicate.
[Why is there a scan on my clustered index?](https://stackoverflow.c... |
11,826,441 | How can I reduce the clustered index scan cost of below mentioned query
```
DECLARE @PARAMVAL varchar(3)
set @PARAMVAL = 'CTD'
select * from MASTER_RECORD_TYPE where RECORD_TYPE_CODE=@PARAMVAL
```
if I run the above query it was showing index scan 99 %
Please find here below my table particularities:
![enter ima... | 2012/08/06 | ['https://Stackoverflow.com/questions/11826441', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1494292/'] | You need to try and use a covered index. But the problem you're going to have is that you're using `SELECT *`. Do you really need the entire record?
Either way, add `RECORD_TYPE_CODE` to another index and it will help with the query because at least that field can be read off of an index page. | In your query, you have used column `RECORD_TYPE_CODE` which is not part of `clustered index` and also not included in any `non-clustered index` too. So SQL Optimizer will decide to scan the clustered index to do comparison of where clause predicate.
[Why is there a scan on my clustered index?](https://stackoverflow.c... |
55,196,362 | I have an array in for format as below (consol.log in browser). How would I iterate the array in php?
```
stdClass Object
(
[SIEcat7] => stdClass Object
(
[text] => test1
[amount] => 1 000.00
)
[SIEcat8] => stdClass Object
(
[text] => test2
... | 2019/03/16 | ['https://Stackoverflow.com/questions/55196362', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/712430/'] | When use `find_package(XXX)`, it can work in two modes: *MODULE* and *CONFIG*. And resulted variables and targets of this call **depend on the mode**.
If `FindXXX.cmake` file exists (and can be found), the *MODULE* mode is used and given file is processed. Otherwise, if the package is shipped with `XXXConfig.cmake` fi... | Not all packages provide a CMake library definition. If you're lucky, then `vcpkg install` will show you the name:
```
$ ./vcpkg install openssl
The package openssl is compatible with built-in CMake targets:
find_package(OpenSSL REQUIRED)
target_link_libraries(main PRIVATE OpenSSL::SSL OpenSSL::Crypto)
```
... |
15,729,395 | I created a small php site for gameserver management, but it is not forcing unlogged in users to login. I have added a redirect if a session is not active, and have destroyed the sessions on logout. The site is here <http://zelware.co.uk/gameman>
It forces you to login the first time but if you take login.php off of ... | 2013/03/31 | ['https://Stackoverflow.com/questions/15729395', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1593366/'] | The Linux kernel pages in the `man` program reside in section 9, which is (un)fortunately a non-standard section. See [this](http://manpages.ubuntu.com/manpages/lucid/man1/man.1.html). Popular Linux distributions like Ubuntu don't distribute the man pages that fall under this section through their software channels (?)... | Actually the kernel has an ABI and not an API, as the internal interface is changing quickly.
The best way to learn the Linux kernel is reading the source code. If you are interested in character device drivers, then I would recommend to read LDD3 book and have a look how other device driver use the mentioned calls in... |
26,279,114 | I would like to split a string at every blank character (' ', '\n', '\r', '\t', '\v', '\f')
The string is stored in UTF8 encoding in a byte array (char\*, or vector or string, for instance)
Can I just split the byte array at each splitting character? Said otherwise, am I sure that the byte values corresponding to thes... | 2014/10/09 | ['https://Stackoverflow.com/questions/26279114', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2042388/'] | Yes, you can.
Multibyte sequences necessarily include one lead byte (the two MSBs equal to `11`) and one ore more continuation bytes (two MSBs equal to `10`). The total length of the multibyte sequence (lead byte+continuation bytes) is equal to the number of count of MSBs equal to 1 in the lead byte, before the first ... | If you limit yourself to the set of whitespace characters you mention, the answer is definitely "yes".
Of course, there is always an issue of checking whether your text is valid UTF-8 in the first place... |
28,123 | I have created my entity-relationship diagram (ERD for brevity) and it has derived attributes.
When it comes to database design using a relational schema, I've designed my tables and linked everything properly.
I don't know if I should add a column to my table that has a derived attribute? For example, the derived ... | 2012/11/03 | ['https://dba.stackexchange.com/questions/28123', 'https://dba.stackexchange.com', 'https://dba.stackexchange.com/users/12845/'] | What you can do is not always appropriate for the various usages of your relational model. If you were creating a data warehouse in order to analyze customer sales then derived attributes would be appropriate. I have done this for a summary table for a reporting tool. The query would have joined upwards of thirty table... | we should not create our table with derived attributes in it. Instead, the values can be calculated at the time of retrieval. Assume we have millions of records of a table, the redundunt column (e.g. totall) is written for every field, while we can calculate it at the time of retrieval. |
30,347,289 | I'm doing an AJAX request and somehow a trailing newline is added somewhere.
My PHP script echoes (or is supposed to echo) `'SUCCESS'` if the request succeeded, `'ERROR'` otherwise.
But currently it returns: `'SUCCESS'` (i.e. `'SUCCESS\n'`).
I saw that by adding an `alert("!" + msg + "!")` that showed the line... | 2015/05/20 | ['https://Stackoverflow.com/questions/30347289', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4915360/'] | That is most likely caused by the end of the PHP file, where a newline follows the `?>`.
Now while it is possible to `die`/`exit` at a previous point, I consider it a much cleaner solution to simply remove the `?>`.
The closing tag is not required by PHP, and it is usually even considered better practise not to use... | add [die()](http://www.w3schools.com/php/func_misc_die.asp) or [exit()](http://www.w3schools.com/php/func_misc_exit.asp) after
```
echo 'SUCCESS'; die;
```
or
```
echo 'ERREUR'; die;
```
if you can't add `die` then code execute next line of code or in this case it will call 'view' in MVC. |
42,129,900 | ```
public class mychatorderdetails extends ActionBarActivity {
private MyApplication app;
private String order_id;
private String orderdate;
private String cust_name;
private String cust_address;
private String cust_pincode;
private String cust_mobile;
private String action;
private... | 2017/02/09 | ['https://Stackoverflow.com/questions/42129900', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7457008/'] | Use,
```
DROP DATABASE database_name CASCADE;
```
By default, the mode is `RESTRICT` which blocks the deletion of database if it holds tables. | You can use this command:
```
DROP DATABASE IF EXISTS HIVE_DATABASE_NAME CASCADE;
```
In case, you are using older version of Hive:
Drop all tables and views from hive database first, and then drop the database. You can consolidate below command in a shell script to execute.
```
hive -e 'use HIVE_DATABASE_NAME;show... |
42,129,900 | ```
public class mychatorderdetails extends ActionBarActivity {
private MyApplication app;
private String order_id;
private String orderdate;
private String cust_name;
private String cust_address;
private String cust_pincode;
private String cust_mobile;
private String action;
private... | 2017/02/09 | ['https://Stackoverflow.com/questions/42129900', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7457008/'] | Use,
```
DROP DATABASE database_name CASCADE;
```
By default, the mode is `RESTRICT` which blocks the deletion of database if it holds tables. | **General syntax is as follows:**
```
hive> DROP DATABASE [IF EXISTS] database_name [RESTRICT|CASCADE];
```
The default behaviour is RESTRICT, where DROP DATABASE will fail if the database is not empty. To drop the tables in the database as well, use DROP DATABASE … with CASCADE option.
***1. Drop database without ... |
12,207,102 | I am currently working on a University assignment, and have a (most likely simple) question regarding regex / regular expressions.
To summarize; this assignment is a simple RSS feed manager, which uses JSP and a RESTful web service.
I am currently working on a section of the assignment spec which requires me to be ab... | 2012/08/30 | ['https://Stackoverflow.com/questions/12207102', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1603861/'] | It is preferable, yes, since JSON is defined to be unicode.
If you have more specific things that are causing you trouble you should share them, otherwise I'd recommend watching [Ned Batchelder's Intro](http://bit.ly/unipain) if you're just generally uncomfortable with Unicode (in Python in particular). I don't know w... | You should keep everything internal to python in unicode if there's any chance you will need it. Where python speaks to other programs, use `s.encode('UTF-8')` to make a regular string that you can write to a file or socket or whatever. Use `s.decode('UTF-8')` to convert a string from a file/socket back to unicode. (UT... |
12,207,102 | I am currently working on a University assignment, and have a (most likely simple) question regarding regex / regular expressions.
To summarize; this assignment is a simple RSS feed manager, which uses JSP and a RESTful web service.
I am currently working on a section of the assignment spec which requires me to be ab... | 2012/08/30 | ['https://Stackoverflow.com/questions/12207102', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1603861/'] | There is nothing wrong with this, and you don't need to do anything about it.
In Python 2, a `str` is similar to a C string - it's just a sequence of bytes, sometimes incorrectly assumed to be ASCII text. It can contain *encoded* text, e.g. as UTF-8 or ASCII.
The `unicode` type represents an actual string of text, si... | You should keep everything internal to python in unicode if there's any chance you will need it. Where python speaks to other programs, use `s.encode('UTF-8')` to make a regular string that you can write to a file or socket or whatever. Use `s.decode('UTF-8')` to convert a string from a file/socket back to unicode. (UT... |
12,207,102 | I am currently working on a University assignment, and have a (most likely simple) question regarding regex / regular expressions.
To summarize; this assignment is a simple RSS feed manager, which uses JSP and a RESTful web service.
I am currently working on a section of the assignment spec which requires me to be ab... | 2012/08/30 | ['https://Stackoverflow.com/questions/12207102', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1603861/'] | There is nothing wrong with this, and you don't need to do anything about it.
In Python 2, a `str` is similar to a C string - it's just a sequence of bytes, sometimes incorrectly assumed to be ASCII text. It can contain *encoded* text, e.g. as UTF-8 or ASCII.
The `unicode` type represents an actual string of text, si... | It is preferable, yes, since JSON is defined to be unicode.
If you have more specific things that are causing you trouble you should share them, otherwise I'd recommend watching [Ned Batchelder's Intro](http://bit.ly/unipain) if you're just generally uncomfortable with Unicode (in Python in particular). I don't know w... |
40,956,103 | I want to stream multipart file directly to AWSS3 instead of saving file to disk at first. Receiving file of type \*multipart.FileHeader in my golang REST API. Now I want to stream this to AWSS3, using [s3manager](https://godoc.org/github.com/aws/aws-sdk-go/service/s3/s3manager) upload method where it's required to pas... | 2016/12/04 | ['https://Stackoverflow.com/questions/40956103', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3943467/'] | Call [Open](https://golang.org/pkg/mime/multipart/#FileHeader.Open) on the `multipart.FileHeader`. It will return a `multipart.File` which will provide a reader to the file (which will be held in memory). | If you have multipart.File, then you can use next solution:
```golang
file, ok := multipartFile.(*os.File)
if !ok {
responseError(w, errors.New("invalid file", errors.InvalidArguments))
return
}
``` |
33,584 | The body (身) is only one inch (寸), which should mean "矮".
Throwing (委) the arrow (矢), which should mean "射".
What is wrong here? | 2019/04/12 | ['https://chinese.stackexchange.com/questions/33584', 'https://chinese.stackexchange.com', 'https://chinese.stackexchange.com/users/21202/'] | >
> **The body (身) is only one inch (寸), which should mean "矮".**
>
>
>
Here are some characters containing「寸」as a semantic component, directly as part of the immediate decomposition or secondarily as part of one of the decomposed components:
* 得導持尋付尊奪肘專耐
It should be clear that「寸」probably never means *inch* as ... | >
> 射 <http://www.zdic.net/z/18/xs/5C04.htm>
>
>
> [](https://i.stack.imgur.com/uzI2G.gif)
>
>
> (1) (本作“射”。会意。金文字形,象箭在弦上,手(寸)在发放。**小篆把弓矢形讹变成“身”字,误。** 本义:用弓发箭使中远处目标)
>
>
>
射 is a 会意字 (ideogrammic compound character)
The 寸 part in 射 was origin... |
33,584 | The body (身) is only one inch (寸), which should mean "矮".
Throwing (委) the arrow (矢), which should mean "射".
What is wrong here? | 2019/04/12 | ['https://chinese.stackexchange.com/questions/33584', 'https://chinese.stackexchange.com', 'https://chinese.stackexchange.com/users/21202/'] | >
> **The body (身) is only one inch (寸), which should mean "矮".**
>
>
>
Here are some characters containing「寸」as a semantic component, directly as part of the immediate decomposition or secondarily as part of one of the decomposed components:
* 得導持尋付尊奪肘專耐
It should be clear that「寸」probably never means *inch* as ... | Looking at modern forms of characters and trying to analyze them for their meaning doesn't always work out. If you are planning to go deeper into these studies you might want to try out [Outlier Linguistics](https://www.outlier-linguistics.com)' Dictionary. You can see their analysis of the two characters you're asking... |
40,419,732 | I'm basically trying to call a function which is outside of my AJAX inside the AJAX success response.
To explain this better, this is what I have.
These are two functions:
```
function watchCurrentPosition() {
var positionTimer = navigator.geolocation.watchPosition(function(position) {
setMarkerPosition(... | 2016/11/04 | ['https://Stackoverflow.com/questions/40419732', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4517577/'] | You need to define `positionTimer` at global level outside of `function watchCurrentPosition()` like:
```
var positionTimer = null;
function watchCurrentPosition() {
positionTimer = navigator.geolocation.watchPosition(function(position) {
setMarkerPosition(userLocation, position);
map.panTo(new g... | `positionTimer` is local to `watchCurrentPosition`
**The better way to solve it without global variables is:**
```
function watchCurrentPosition() {
var positionTimer = navigator.geolocation.watchPosition(function(position) {
setMarkerPosition(userLocation, position);
map.panTo(new google.maps.L... |
61,356,244 | I'm developing a simple ecommerce store. Product information is stored in DynamoDB (NoSQL).
Items in Product table has an "image" attribute with a single URL, and also an "images" attribute which store multiple strings. I just added the "items" attribute to test if I can store multiple URLs (which point to images in S3... | 2020/04/22 | ['https://Stackoverflow.com/questions/61356244', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5041588/'] | You need to change,
```
{images[0]}
```
To,
```
{images && images[0] ? images[0] : null}
```
Reason for the above code is, the `images` array doesn't gets populated in template as it is async(as you are fetching from api).
So at initial stage it will be empty array and you are trying to access the first index va... | Looks like you are accessing the array before the data is populated.
You need to check the `loading` flag if you are using `react-apollo` query component. And if [loading](https://www.apollographql.com/docs/react/data/queries/#executing-a-query) is false then only you need to render your component.
Alternately you ca... |
822,920 | I was trying to prove that a continuous function $f:[a,b]\to\Bbb{R}$ is integrable and thought that I came up with an easy solution so I checked the internet and here is a long proof: <https://proofwiki.org/wiki/Continuous_Function_is_Riemann_Integrable>. This makes me think that something is wrong with my argument:
W... | 2014/06/06 | ['https://math.stackexchange.com/questions/822920', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/155603/'] | No, this proof is not correct - there's not a nice connection between the size of the mesh and the difference in $y$-values. Let's look at a specific function, $y = \sqrt x$, on the interval $[0,1]$. Choose $\epsilon = .1$, so the proposed mesh size is $0.1$.
Looking at the interval partitioned as $[0, .1] \cup [.1, ... | Consider $f\_c\colon[0,2\pi]\to\mathbb R$, $x\mapsto \sin cx$ where $c$ is some constant. For all $c\ge 1$m you will find $A=1$ and $B=-1$, so your proof suggests that $U(P)-L(P)<\epsilon$ as soon as the mesh is $\delta<\frac{\epsilon}{A-B}$ - no matter what $c$ is. But for suitable $c$ (namely $c>\frac{2\pi}\delta$), ... |
822,920 | I was trying to prove that a continuous function $f:[a,b]\to\Bbb{R}$ is integrable and thought that I came up with an easy solution so I checked the internet and here is a long proof: <https://proofwiki.org/wiki/Continuous_Function_is_Riemann_Integrable>. This makes me think that something is wrong with my argument:
W... | 2014/06/06 | ['https://math.stackexchange.com/questions/822920', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/155603/'] | No, this proof is not correct - there's not a nice connection between the size of the mesh and the difference in $y$-values. Let's look at a specific function, $y = \sqrt x$, on the interval $[0,1]$. Choose $\epsilon = .1$, so the proposed mesh size is $0.1$.
Looking at the interval partitioned as $[0, .1] \cup [.1, ... | Use the fact that a continuous function on a closed interval is uniformly continuous to find $\delta$ such that
$$|x-y| \leq \delta \rightarrow |f(x)-f(y)| \leq \frac{\epsilon}{b-a}$$ then $\delta$ is the size of the mesh. |
61,958,842 | I have a list of base files:
```
file1.txt
file2.txt
file3.txt
```
and a list of target files:
```
target1.txt
target2.txt
target3.txt
```
and I want to use bash to perform the following command using a loop:
```
grep -wf "file1.txt" "target1.txt" > "result1.txt"
grep -wf "file2.txt" "target2.txt" > "resu... | 2020/05/22 | ['https://Stackoverflow.com/questions/61958842', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/13456823/'] | With a for loop:
```
for((i=1; i<=22; i++)); do
grep -wf "file$i.txt" "target$i.txt" > "result$i.txt"
done
``` | This is a one-line version suitable for the command line with brace expanion:
```
for i in {1..22};do grep -wf "file$i.txt" "target$i.txt" > "result$i.txt"; done
``` |
61,958,842 | I have a list of base files:
```
file1.txt
file2.txt
file3.txt
```
and a list of target files:
```
target1.txt
target2.txt
target3.txt
```
and I want to use bash to perform the following command using a loop:
```
grep -wf "file1.txt" "target1.txt" > "result1.txt"
grep -wf "file2.txt" "target2.txt" > "resu... | 2020/05/22 | ['https://Stackoverflow.com/questions/61958842', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/13456823/'] | With a for loop:
```
for((i=1; i<=22; i++)); do
grep -wf "file$i.txt" "target$i.txt" > "result$i.txt"
done
``` | Do them all in parallel with **GNU Parallel**:
```
parallel 'grep -wf file{}.txt target{}.txt > result{}.txt' ::: {1..22}
``` |
61,958,842 | I have a list of base files:
```
file1.txt
file2.txt
file3.txt
```
and a list of target files:
```
target1.txt
target2.txt
target3.txt
```
and I want to use bash to perform the following command using a loop:
```
grep -wf "file1.txt" "target1.txt" > "result1.txt"
grep -wf "file2.txt" "target2.txt" > "resu... | 2020/05/22 | ['https://Stackoverflow.com/questions/61958842', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/13456823/'] | With arbitrary number of `file#.txt` and `target#.txt`:
```sh
#!/usr/bin/env bash
shopt -s extglob # Enable extended globbing patterns
# Iterate all file#.txt
for f in file+([[:digit:]]).txt; do
# Extract the index from the file name by stripping-out all non digit characters
i="${f//[^[:digit:]]//}"
file="$f"... | This is a one-line version suitable for the command line with brace expanion:
```
for i in {1..22};do grep -wf "file$i.txt" "target$i.txt" > "result$i.txt"; done
``` |
61,958,842 | I have a list of base files:
```
file1.txt
file2.txt
file3.txt
```
and a list of target files:
```
target1.txt
target2.txt
target3.txt
```
and I want to use bash to perform the following command using a loop:
```
grep -wf "file1.txt" "target1.txt" > "result1.txt"
grep -wf "file2.txt" "target2.txt" > "resu... | 2020/05/22 | ['https://Stackoverflow.com/questions/61958842', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/13456823/'] | With arbitrary number of `file#.txt` and `target#.txt`:
```sh
#!/usr/bin/env bash
shopt -s extglob # Enable extended globbing patterns
# Iterate all file#.txt
for f in file+([[:digit:]]).txt; do
# Extract the index from the file name by stripping-out all non digit characters
i="${f//[^[:digit:]]//}"
file="$f"... | Do them all in parallel with **GNU Parallel**:
```
parallel 'grep -wf file{}.txt target{}.txt > result{}.txt' ::: {1..22}
``` |
8,880 | 
I bought a Black Pearl Wax Apple tree to grow in the Bay Area in California. This fruit is popular in tropical areas of Asia, but it virtually impossible to find in supermarkets outside of Asia. I've scoured Google for how to grow Wax Apple, but coul... | 2014/01/20 | ['https://gardening.stackexchange.com/questions/8880', 'https://gardening.stackexchange.com', 'https://gardening.stackexchange.com/users/2709/'] | From what I can see from my online research, it looks like you will need to find a way to give your wax apple tree more heat than it probably will be getting outside in the Bay Area, given that it's a tropical fruit and the Bay Area is more of a cool maritime climate. [Here is a gentleman in Southern California who, ra... | From the comment:
>
> I got a response from the seller. The English is not very good and it is not detailed. *"Hi no cross-pollinate. Winter need protect. Grown in 5g until 12 "high go the ground. Midday sun. Evergreen. any soil ok."*
>
>
>
Trying to decipher this.
>
> *Hi*
>
>
>
**A greeting. :)**
>
> *n... |
8,880 | 
I bought a Black Pearl Wax Apple tree to grow in the Bay Area in California. This fruit is popular in tropical areas of Asia, but it virtually impossible to find in supermarkets outside of Asia. I've scoured Google for how to grow Wax Apple, but coul... | 2014/01/20 | ['https://gardening.stackexchange.com/questions/8880', 'https://gardening.stackexchange.com', 'https://gardening.stackexchange.com/users/2709/'] | From what I can see from my online research, it looks like you will need to find a way to give your wax apple tree more heat than it probably will be getting outside in the Bay Area, given that it's a tropical fruit and the Bay Area is more of a cool maritime climate. [Here is a gentleman in Southern California who, ra... | The grower that says any healthy soil is ok, is not familiar with some of the productive but alkaline soils in the USA such as in the Imperial Valley. The wax apple trees grow well in the mountains around Palm springs at about 3000 feet, BUT you must treat the soil to get it slightly acidic to acidic (5.5 is a good tar... |
8,880 | 
I bought a Black Pearl Wax Apple tree to grow in the Bay Area in California. This fruit is popular in tropical areas of Asia, but it virtually impossible to find in supermarkets outside of Asia. I've scoured Google for how to grow Wax Apple, but coul... | 2014/01/20 | ['https://gardening.stackexchange.com/questions/8880', 'https://gardening.stackexchange.com', 'https://gardening.stackexchange.com/users/2709/'] | From what I can see from my online research, it looks like you will need to find a way to give your wax apple tree more heat than it probably will be getting outside in the Bay Area, given that it's a tropical fruit and the Bay Area is more of a cool maritime climate. [Here is a gentleman in Southern California who, ra... | I live in the Caribbean where there is only a rainy and dry season. Temperatures range from low 60’s to 80’s.
I was given 2 cuttings of the Java apple branch. I kept them in water and they grew roots after about 2 months. I planted one in a concrete pot out in a very windy but full Sun location and the other in a mostl... |
8,880 | 
I bought a Black Pearl Wax Apple tree to grow in the Bay Area in California. This fruit is popular in tropical areas of Asia, but it virtually impossible to find in supermarkets outside of Asia. I've scoured Google for how to grow Wax Apple, but coul... | 2014/01/20 | ['https://gardening.stackexchange.com/questions/8880', 'https://gardening.stackexchange.com', 'https://gardening.stackexchange.com/users/2709/'] | I grow Wax Jambu in the Bay Area. They freeze outside in the winter, so I grow mine as a house plant in the sunniest window at my house. It does great. A big crop of fruit every year. You don't want to let it dry out too much. Down in Southern California, I've seen them thrive outdoors (in San Diego), but I don't think... | From the comment:
>
> I got a response from the seller. The English is not very good and it is not detailed. *"Hi no cross-pollinate. Winter need protect. Grown in 5g until 12 "high go the ground. Midday sun. Evergreen. any soil ok."*
>
>
>
Trying to decipher this.
>
> *Hi*
>
>
>
**A greeting. :)**
>
> *n... |
8,880 | 
I bought a Black Pearl Wax Apple tree to grow in the Bay Area in California. This fruit is popular in tropical areas of Asia, but it virtually impossible to find in supermarkets outside of Asia. I've scoured Google for how to grow Wax Apple, but coul... | 2014/01/20 | ['https://gardening.stackexchange.com/questions/8880', 'https://gardening.stackexchange.com', 'https://gardening.stackexchange.com/users/2709/'] | I grow Wax Jambu in the Bay Area. They freeze outside in the winter, so I grow mine as a house plant in the sunniest window at my house. It does great. A big crop of fruit every year. You don't want to let it dry out too much. Down in Southern California, I've seen them thrive outdoors (in San Diego), but I don't think... | The grower that says any healthy soil is ok, is not familiar with some of the productive but alkaline soils in the USA such as in the Imperial Valley. The wax apple trees grow well in the mountains around Palm springs at about 3000 feet, BUT you must treat the soil to get it slightly acidic to acidic (5.5 is a good tar... |
8,880 | 
I bought a Black Pearl Wax Apple tree to grow in the Bay Area in California. This fruit is popular in tropical areas of Asia, but it virtually impossible to find in supermarkets outside of Asia. I've scoured Google for how to grow Wax Apple, but coul... | 2014/01/20 | ['https://gardening.stackexchange.com/questions/8880', 'https://gardening.stackexchange.com', 'https://gardening.stackexchange.com/users/2709/'] | I grow Wax Jambu in the Bay Area. They freeze outside in the winter, so I grow mine as a house plant in the sunniest window at my house. It does great. A big crop of fruit every year. You don't want to let it dry out too much. Down in Southern California, I've seen them thrive outdoors (in San Diego), but I don't think... | I live in the Caribbean where there is only a rainy and dry season. Temperatures range from low 60’s to 80’s.
I was given 2 cuttings of the Java apple branch. I kept them in water and they grew roots after about 2 months. I planted one in a concrete pot out in a very windy but full Sun location and the other in a mostl... |
7,560 | I just read the following sentence
>
> Les voisins habitent dans la maison d'à côté
>
>
>
I couldn't understand why “maison” has been used in singular. Could you point out some rules with regard to plural formation?
Also, how would you say (in the sense of definition of neighbours) "Neighbours live in houses clo... | 2013/09/18 | ['https://french.stackexchange.com/questions/7560', 'https://french.stackexchange.com', 'https://french.stackexchange.com/users/1743/'] | Here, "les voisins" refers to a family, not to multiple separate neighbors living in separate houses, hence the singular. | Answering the second part of your question:
>
> Les voisins habitent dans des maisons proches les unes des autres.
>
>
> |
12,195,583 | I have an application which redirect `System.out` for example;
```
System.setOut(new PrintStream(System.out){
@Override
public void print(String string)
{
//TODO: find out who sent the print before processing string
}
});
```
I want to be able to determine which class is sending the call to... | 2012/08/30 | ['https://Stackoverflow.com/questions/12195583', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/340390/'] | Get the [stacktrace](http://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html#getStackTrace%28%29) and find the class name from the currect index.
```
StackTraceElement[] trace = Thread.currentThread().getStackTrace();
``` | You could throw an exception, and examine the stack trace. Obviously not great for production code. |
12,195,583 | I have an application which redirect `System.out` for example;
```
System.setOut(new PrintStream(System.out){
@Override
public void print(String string)
{
//TODO: find out who sent the print before processing string
}
});
```
I want to be able to determine which class is sending the call to... | 2012/08/30 | ['https://Stackoverflow.com/questions/12195583', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/340390/'] | You could throw an exception, and examine the stack trace. Obviously not great for production code. | There are a number of ways: SecurityManager might be the best. Check this post especially the second answer: [How do I find the caller of a method using stacktrace or reflection?](https://stackoverflow.com/questions/421280/in-java-how-do-i-find-the-caller-of-a-method-using-stacktrace-or-reflection) |
12,195,583 | I have an application which redirect `System.out` for example;
```
System.setOut(new PrintStream(System.out){
@Override
public void print(String string)
{
//TODO: find out who sent the print before processing string
}
});
```
I want to be able to determine which class is sending the call to... | 2012/08/30 | ['https://Stackoverflow.com/questions/12195583', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/340390/'] | If you have a recent version of HotSpot or OpenJDK you can use `Reflection.getCallerClass(2 or 3)` This is more efficient than generating a full stack trace but not portable.
Otherwise, the most efficient way to get the stack trace is
```
StackTraceElement[] stes = Thread.currentThread.getStackTrace();
```
This avo... | You could throw an exception, and examine the stack trace. Obviously not great for production code. |
12,195,583 | I have an application which redirect `System.out` for example;
```
System.setOut(new PrintStream(System.out){
@Override
public void print(String string)
{
//TODO: find out who sent the print before processing string
}
});
```
I want to be able to determine which class is sending the call to... | 2012/08/30 | ['https://Stackoverflow.com/questions/12195583', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/340390/'] | Get the [stacktrace](http://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html#getStackTrace%28%29) and find the class name from the currect index.
```
StackTraceElement[] trace = Thread.currentThread().getStackTrace();
``` | There are a number of ways: SecurityManager might be the best. Check this post especially the second answer: [How do I find the caller of a method using stacktrace or reflection?](https://stackoverflow.com/questions/421280/in-java-how-do-i-find-the-caller-of-a-method-using-stacktrace-or-reflection) |
12,195,583 | I have an application which redirect `System.out` for example;
```
System.setOut(new PrintStream(System.out){
@Override
public void print(String string)
{
//TODO: find out who sent the print before processing string
}
});
```
I want to be able to determine which class is sending the call to... | 2012/08/30 | ['https://Stackoverflow.com/questions/12195583', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/340390/'] | If you have a recent version of HotSpot or OpenJDK you can use `Reflection.getCallerClass(2 or 3)` This is more efficient than generating a full stack trace but not portable.
Otherwise, the most efficient way to get the stack trace is
```
StackTraceElement[] stes = Thread.currentThread.getStackTrace();
```
This avo... | There are a number of ways: SecurityManager might be the best. Check this post especially the second answer: [How do I find the caller of a method using stacktrace or reflection?](https://stackoverflow.com/questions/421280/in-java-how-do-i-find-the-caller-of-a-method-using-stacktrace-or-reflection) |
68,807,437 | I have a list of strings consisting of integers, and I am trying to replace them with the sum of their digits. E.g. `nums = ["12","23","33"]` -> `nums = [3,5,6]`
Here is my code:
```
strng = ['12','23','33']
for i in range(len(strng)):
print(list((map(lambda x:int[x],list(strng[i])))))
```
For the above I am g... | 2021/08/16 | ['https://Stackoverflow.com/questions/68807437', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/16510721/'] | The error you're getting is you because you wrote `int[x]` instead of `int(x)`. However, there are some additional issues with your existing solution.
The short and pythonic solution to this problem would be:
```py
answer = [sum(map(int, list(s))) for s in strng]
```
To break this down:
1. `[... for s in strng]`: ... | You can use comprehension, and iterate each digits, convert them to integer, finally pass it to `sum` builtin to get sum of the values.
```py
>>> [sum(int(i) for i in v) for v in strng]
[3, 5, 6]
``` |
68,807,437 | I have a list of strings consisting of integers, and I am trying to replace them with the sum of their digits. E.g. `nums = ["12","23","33"]` -> `nums = [3,5,6]`
Here is my code:
```
strng = ['12','23','33']
for i in range(len(strng)):
print(list((map(lambda x:int[x],list(strng[i])))))
```
For the above I am g... | 2021/08/16 | ['https://Stackoverflow.com/questions/68807437', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/16510721/'] | The error you're getting is you because you wrote `int[x]` instead of `int(x)`. However, there are some additional issues with your existing solution.
The short and pythonic solution to this problem would be:
```py
answer = [sum(map(int, list(s))) for s in strng]
```
To break this down:
1. `[... for s in strng]`: ... | Not really efficient, but try this :
```
strng = ['12','23','33']
def function(strng) :
my_list = []
for string in strng :
my_list.append(0)
for digit in string :
my_list[-1] += int(digit)
return my_list
strng = function(strng)
print(strng)
``` |
68,807,437 | I have a list of strings consisting of integers, and I am trying to replace them with the sum of their digits. E.g. `nums = ["12","23","33"]` -> `nums = [3,5,6]`
Here is my code:
```
strng = ['12','23','33']
for i in range(len(strng)):
print(list((map(lambda x:int[x],list(strng[i])))))
```
For the above I am g... | 2021/08/16 | ['https://Stackoverflow.com/questions/68807437', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/16510721/'] | You can use comprehension, and iterate each digits, convert them to integer, finally pass it to `sum` builtin to get sum of the values.
```py
>>> [sum(int(i) for i in v) for v in strng]
[3, 5, 6]
``` | Not really efficient, but try this :
```
strng = ['12','23','33']
def function(strng) :
my_list = []
for string in strng :
my_list.append(0)
for digit in string :
my_list[-1] += int(digit)
return my_list
strng = function(strng)
print(strng)
``` |
4,891,251 | A C++ program I'm working on is using lua for configuration. It sets up several lua functions using a hardcoded script:
```
luaL_loadbuffer(pmLuaState, headerscript, strlen(headerscript), "header script");
```
It then loads the configuration lua file (that calls the previously mentioned functions):
```
luaL_loadfil... | 2011/02/03 | ['https://Stackoverflow.com/questions/4891251', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/590988/'] | Your are missing a dot.
It should be `.GlobalStore` as long as this class resides in the package set in the package attribute on the manifest node.
So it should look like this.
```
<application android:icon="@drawable/icon"
android:label="@string/app_name"
android:name=".GlobalStore">
``` | ```
android:name="GlobalStore"
```
This needs to be the full path including your package. ie
```
android:name="com.example.GlobalStore"
```
or whatever your package name is. |
44,406,544 | Im still kind of new to scripts, but i know what im trying to do is not impossible. im trying to use a select option to show div's, I have it currently so it shows 1 div at a time currently but I cannot get it to show 2 separate divs at the same time. so for example im trying to select option 1, and to unhide the same ... | 2017/06/07 | ['https://Stackoverflow.com/questions/44406544', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8112511/'] | ```js
document.getElementById('target').addEventListener('change', function () {
let divs = document.querySelectorAll('.initial, .vis'); // grab all divs that have the class "initial" or "vis"
for (let i = 0; i < divs.length; i++) {
// loop over all divs
let div = divs[i];
if (div.classList.contains(th... | your selector was wrong its `document.getElementById()` not a `document.getElementByValue` .And you are using `querySelectorAll()` its matching all the `.vis` class element ,so you need to iterate with `forEach` .And change the if condition with `vis.length>0`
```js
document.getElementById('target').addEventListener('... |
808 | >
> **Possible Duplicate:**
>
> [Community Promotion Ads - 2013](https://wordpress.meta.stackexchange.com/questions/1309/community-promotion-ads-2013)
>
>
>
A new year means, a new start of ads! And hopefully better schedule adherence. Which we're doing by switching to a yearly cycle anyway.
### What are Comm... | 2011/12/02 | ['https://wordpress.meta.stackexchange.com/questions/808', 'https://wordpress.meta.stackexchange.com', 'https://wordpress.meta.stackexchange.com/users/7667/'] | [](http://queryposts.com/) | [](http://twitter.com/stackwordpress) |
808 | >
> **Possible Duplicate:**
>
> [Community Promotion Ads - 2013](https://wordpress.meta.stackexchange.com/questions/1309/community-promotion-ads-2013)
>
>
>
A new year means, a new start of ads! And hopefully better schedule adherence. Which we're doing by switching to a yearly cycle anyway.
### What are Comm... | 2011/12/02 | ['https://wordpress.meta.stackexchange.com/questions/808', 'https://wordpress.meta.stackexchange.com', 'https://wordpress.meta.stackexchange.com/users/7667/'] | [](http://queryposts.com/) | [](http://www.webmasters.stackexchange.com/) |
177,529 | I've been asked to look into placing a firewall between a webserver (Debian/Apache/PHP) in the DMZ and a backend MySQL database to achieve "isolation". Right now, iptables is running on the MySQL server and is only permitting TCP 22 and 3306 for SSH and MySQL respectively. However, this is apparently not good enough, a... | 2010/09/02 | ['https://serverfault.com/questions/177529', 'https://serverfault.com', 'https://serverfault.com/users/43041/'] | I'm not quite sure where you're getting your max. throughput numbers because [Cisco's website](http://www.cisco.com/en/US/products/ps6120/prod_models_comparison.html) tells a different story (150Mbps).
It's a 100Mb ethernet connection and of course your real-world throughput will depend entirely on numerous factors, i... | The throughput of asa 5505 is 150 mbit/s.
I do not see the benefit security wise.
Probably decided by someone who does not know much about firewalling. |
177,529 | I've been asked to look into placing a firewall between a webserver (Debian/Apache/PHP) in the DMZ and a backend MySQL database to achieve "isolation". Right now, iptables is running on the MySQL server and is only permitting TCP 22 and 3306 for SSH and MySQL respectively. However, this is apparently not good enough, a... | 2010/09/02 | ['https://serverfault.com/questions/177529', 'https://serverfault.com', 'https://serverfault.com/users/43041/'] | What about two NICs on the webserver, one on the DMZ and one on the LAN?
Edit: Since the answer was accepted I am putting more details.
The webserver is necessarily public facing, the idea is to firewall that so only ports 80,443 are publicly accessible. Then internally it can communicate with the database server on ... | The throughput of asa 5505 is 150 mbit/s.
I do not see the benefit security wise.
Probably decided by someone who does not know much about firewalling. |
177,529 | I've been asked to look into placing a firewall between a webserver (Debian/Apache/PHP) in the DMZ and a backend MySQL database to achieve "isolation". Right now, iptables is running on the MySQL server and is only permitting TCP 22 and 3306 for SSH and MySQL respectively. However, this is apparently not good enough, a... | 2010/09/02 | ['https://serverfault.com/questions/177529', 'https://serverfault.com', 'https://serverfault.com/users/43041/'] | Yes, it would be a bottleneck, and if you want to handle 1Gbps linespeed, you will probably need a bigger firewall.
However, do you really need to run at 1Gbps today? It might be a future requirement, but if you are currently only really using, for example, 5Mbps, you'd still have plenty of capacity left for now.
On ... | The throughput of asa 5505 is 150 mbit/s.
I do not see the benefit security wise.
Probably decided by someone who does not know much about firewalling. |
177,529 | I've been asked to look into placing a firewall between a webserver (Debian/Apache/PHP) in the DMZ and a backend MySQL database to achieve "isolation". Right now, iptables is running on the MySQL server and is only permitting TCP 22 and 3306 for SSH and MySQL respectively. However, this is apparently not good enough, a... | 2010/09/02 | ['https://serverfault.com/questions/177529', 'https://serverfault.com', 'https://serverfault.com/users/43041/'] | You're going to need to hook up some monitoring (there should be [munin](http://munin-monitoring.org/) packages that get it all going easy cheesy) and get an idea of what you really need.
If you find you really are pushing beyond 100Mbps then you're simply going to need a faster firewall (or even something like a coup... | The throughput of asa 5505 is 150 mbit/s.
I do not see the benefit security wise.
Probably decided by someone who does not know much about firewalling. |
177,529 | I've been asked to look into placing a firewall between a webserver (Debian/Apache/PHP) in the DMZ and a backend MySQL database to achieve "isolation". Right now, iptables is running on the MySQL server and is only permitting TCP 22 and 3306 for SSH and MySQL respectively. However, this is apparently not good enough, a... | 2010/09/02 | ['https://serverfault.com/questions/177529', 'https://serverfault.com', 'https://serverfault.com/users/43041/'] | What about two NICs on the webserver, one on the DMZ and one on the LAN?
Edit: Since the answer was accepted I am putting more details.
The webserver is necessarily public facing, the idea is to firewall that so only ports 80,443 are publicly accessible. Then internally it can communicate with the database server on ... | I'm not quite sure where you're getting your max. throughput numbers because [Cisco's website](http://www.cisco.com/en/US/products/ps6120/prod_models_comparison.html) tells a different story (150Mbps).
It's a 100Mb ethernet connection and of course your real-world throughput will depend entirely on numerous factors, i... |
177,529 | I've been asked to look into placing a firewall between a webserver (Debian/Apache/PHP) in the DMZ and a backend MySQL database to achieve "isolation". Right now, iptables is running on the MySQL server and is only permitting TCP 22 and 3306 for SSH and MySQL respectively. However, this is apparently not good enough, a... | 2010/09/02 | ['https://serverfault.com/questions/177529', 'https://serverfault.com', 'https://serverfault.com/users/43041/'] | I'm not quite sure where you're getting your max. throughput numbers because [Cisco's website](http://www.cisco.com/en/US/products/ps6120/prod_models_comparison.html) tells a different story (150Mbps).
It's a 100Mb ethernet connection and of course your real-world throughput will depend entirely on numerous factors, i... | You're going to need to hook up some monitoring (there should be [munin](http://munin-monitoring.org/) packages that get it all going easy cheesy) and get an idea of what you really need.
If you find you really are pushing beyond 100Mbps then you're simply going to need a faster firewall (or even something like a coup... |
177,529 | I've been asked to look into placing a firewall between a webserver (Debian/Apache/PHP) in the DMZ and a backend MySQL database to achieve "isolation". Right now, iptables is running on the MySQL server and is only permitting TCP 22 and 3306 for SSH and MySQL respectively. However, this is apparently not good enough, a... | 2010/09/02 | ['https://serverfault.com/questions/177529', 'https://serverfault.com', 'https://serverfault.com/users/43041/'] | What about two NICs on the webserver, one on the DMZ and one on the LAN?
Edit: Since the answer was accepted I am putting more details.
The webserver is necessarily public facing, the idea is to firewall that so only ports 80,443 are publicly accessible. Then internally it can communicate with the database server on ... | Yes, it would be a bottleneck, and if you want to handle 1Gbps linespeed, you will probably need a bigger firewall.
However, do you really need to run at 1Gbps today? It might be a future requirement, but if you are currently only really using, for example, 5Mbps, you'd still have plenty of capacity left for now.
On ... |
177,529 | I've been asked to look into placing a firewall between a webserver (Debian/Apache/PHP) in the DMZ and a backend MySQL database to achieve "isolation". Right now, iptables is running on the MySQL server and is only permitting TCP 22 and 3306 for SSH and MySQL respectively. However, this is apparently not good enough, a... | 2010/09/02 | ['https://serverfault.com/questions/177529', 'https://serverfault.com', 'https://serverfault.com/users/43041/'] | What about two NICs on the webserver, one on the DMZ and one on the LAN?
Edit: Since the answer was accepted I am putting more details.
The webserver is necessarily public facing, the idea is to firewall that so only ports 80,443 are publicly accessible. Then internally it can communicate with the database server on ... | You're going to need to hook up some monitoring (there should be [munin](http://munin-monitoring.org/) packages that get it all going easy cheesy) and get an idea of what you really need.
If you find you really are pushing beyond 100Mbps then you're simply going to need a faster firewall (or even something like a coup... |
177,529 | I've been asked to look into placing a firewall between a webserver (Debian/Apache/PHP) in the DMZ and a backend MySQL database to achieve "isolation". Right now, iptables is running on the MySQL server and is only permitting TCP 22 and 3306 for SSH and MySQL respectively. However, this is apparently not good enough, a... | 2010/09/02 | ['https://serverfault.com/questions/177529', 'https://serverfault.com', 'https://serverfault.com/users/43041/'] | Yes, it would be a bottleneck, and if you want to handle 1Gbps linespeed, you will probably need a bigger firewall.
However, do you really need to run at 1Gbps today? It might be a future requirement, but if you are currently only really using, for example, 5Mbps, you'd still have plenty of capacity left for now.
On ... | You're going to need to hook up some monitoring (there should be [munin](http://munin-monitoring.org/) packages that get it all going easy cheesy) and get an idea of what you really need.
If you find you really are pushing beyond 100Mbps then you're simply going to need a faster firewall (or even something like a coup... |
72,156,337 | This is my very first Rust program that actually has a purpose and I'm still lost with the syntax. So I have trait objects like these:
```
trait HC<'a> {
fn info(&self) -> TestInfo<'static>;
fn test(&self) -> HCResult<'a>;
}
#[allow(non_camel_case_types)]
struct Test_NTP;
impl<'a> HC<'a> for Test_NTP {
fn... | 2022/05/07 | ['https://Stackoverflow.com/questions/72156337', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6774964/'] | Your syntax is off just slightly. The error
`the trait `Sized` is not implemented for `[(i16, Box<&'static (dyn HC<'static> + 'static)>)]`
refers to the most outer `[...]`, which is a `slice`.
In
`const HC_TESTS: [(i16, Box<&dyn HC>)] =`
you explicitly set the type of `HC_TESTS` to be a `slice`, not an `array`. A... | ~~Your problem is that you cannot use `&`~~ ([you actually can](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=71f8cd8bebff8ce9aedf41eaa604786f), the problem is that you didn't actually set the **array length** `[(i16, &dyn HC); 2]`).
Also you could have use `Box`. But since `Box::new` is not ... |
8,150 | WE tried to unpublish a page from the CME in Tridion 2013 & it was marked successful. However, the unpublish was not successful because the page is still in the Broker DB. How do we get rid of the page? How do we diagnose issues like this? We looked through the Deployer logs & did not see any error related to that page... | 2014/10/15 | ['https://tridion.stackexchange.com/questions/8150', 'https://tridion.stackexchange.com', 'https://tridion.stackexchange.com/users/109/'] | With regards to your question about diagnosing this type of error, I would probably go through the following:
1. When you un-publish the Page, check that the (un)publish package is arriving in the `incoming` folder on the expected Deployer server correctly.
2. Check that the database connection string, and other `Stor... | This is one of those annoying issues where the CM and the CD DBs are out of sync for an item. I believe this was addressed sometime in the 2011 SP1 release, but it looks like you're still experiencing it.
There are two ways I've dealt with this:
1. Submit a support ticket, they'll give you a SQL script to run on you... |
8,150 | WE tried to unpublish a page from the CME in Tridion 2013 & it was marked successful. However, the unpublish was not successful because the page is still in the Broker DB. How do we get rid of the page? How do we diagnose issues like this? We looked through the Deployer logs & did not see any error related to that page... | 2014/10/15 | ['https://tridion.stackexchange.com/questions/8150', 'https://tridion.stackexchange.com', 'https://tridion.stackexchange.com/users/109/'] | Also, convince yourself the Structure Group the Page is in is marked 'Publishable'.
If this is not the case a Publish or Unpublish action will be 'Success' in the Queue, but nothing really happens. | This is one of those annoying issues where the CM and the CD DBs are out of sync for an item. I believe this was addressed sometime in the 2011 SP1 release, but it looks like you're still experiencing it.
There are two ways I've dealt with this:
1. Submit a support ticket, they'll give you a SQL script to run on you... |
8,150 | WE tried to unpublish a page from the CME in Tridion 2013 & it was marked successful. However, the unpublish was not successful because the page is still in the Broker DB. How do we get rid of the page? How do we diagnose issues like this? We looked through the Deployer logs & did not see any error related to that page... | 2014/10/15 | ['https://tridion.stackexchange.com/questions/8150', 'https://tridion.stackexchange.com', 'https://tridion.stackexchange.com/users/109/'] | With regards to your question about diagnosing this type of error, I would probably go through the following:
1. When you un-publish the Page, check that the (un)publish package is arriving in the `incoming` folder on the expected Deployer server correctly.
2. Check that the database connection string, and other `Stor... | Also, convince yourself the Structure Group the Page is in is marked 'Publishable'.
If this is not the case a Publish or Unpublish action will be 'Success' in the Queue, but nothing really happens. |
168,033 | I see lots of mentions of this option on Android sites, [including Android.StackExchange.com](https://android.stackexchange.com/questions/116508/how-do-you-enable-hotspot-wifi-sharing-on-nexus-5-android-m-version-on-sprint-t), but I don't see any technical exploitation for what it does. What does this option actually d... | 2017/01/30 | ['https://android.stackexchange.com/questions/168033', 'https://android.stackexchange.com', 'https://android.stackexchange.com/users/7425/'] | Tells telephony manager dial up networking emulation not required, not sure if thats actually required if you use net.tethering.noprovisioning=true in build.prop you can see the telephony and tethering code in the links below
<https://android.googlesource.com/platform/frameworks/base/+/master/telephony/java/android/te... | Not exactly sure what it does, but a lot of people seem tho think this in `adb shell` gets them free tethering.
```
su
settings put global tether_dun_required 0
exit
``` |
26,530,261 | I have a checkbox and i want to make my checkbox checked by default, if the user unchecks the checkbox and save the form, i need the checkbox to be unchecked while retrieving or editing the form data.
**My view page**
```
<div class="form-group {{ $errors->has('active') ? 'error' : '' }}">
<label for... | 2014/10/23 | ['https://Stackoverflow.com/questions/26530261', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3532653/'] | It sounds like you don't really care what the value of $assetdetail->active is, you just want the checkbox checked until the user unchecks it.
Does this do what you're looking for:
```
{{ Form::checkbox('active', 1, Session::hasOldInput() ? array_key_exists('active', Input::old()) : true, array('class'=>'isnesdbox'))... | Since Google apparently still thinks this answer is relevant, here's an updated answer for Laravel 5.8:
```html
<input type="checkbox" value="true" name="notify" @if(!old() || old('notify') == 'true') checked="checked" @endif />
``` |
26,530,261 | I have a checkbox and i want to make my checkbox checked by default, if the user unchecks the checkbox and save the form, i need the checkbox to be unchecked while retrieving or editing the form data.
**My view page**
```
<div class="form-group {{ $errors->has('active') ? 'error' : '' }}">
<label for... | 2014/10/23 | ['https://Stackoverflow.com/questions/26530261', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3532653/'] | It sounds like you don't really care what the value of $assetdetail->active is, you just want the checkbox checked until the user unchecks it.
Does this do what you're looking for:
```
{{ Form::checkbox('active', 1, Session::hasOldInput() ? array_key_exists('active', Input::old()) : true, array('class'=>'isnesdbox'))... | For variable-based default value
--------------------------------
In below, if `$myDefault` is set to `true`, it equals checking the check-box by default.
```html
<input type="checkbox" value="myOnValue"
name="myField"
@if((!old() && $myDefault) || old('myField') == 'myOnValue') checked="checked" @endif... |
26,530,261 | I have a checkbox and i want to make my checkbox checked by default, if the user unchecks the checkbox and save the form, i need the checkbox to be unchecked while retrieving or editing the form data.
**My view page**
```
<div class="form-group {{ $errors->has('active') ? 'error' : '' }}">
<label for... | 2014/10/23 | ['https://Stackoverflow.com/questions/26530261', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3532653/'] | Since Google apparently still thinks this answer is relevant, here's an updated answer for Laravel 5.8:
```html
<input type="checkbox" value="true" name="notify" @if(!old() || old('notify') == 'true') checked="checked" @endif />
``` | For variable-based default value
--------------------------------
In below, if `$myDefault` is set to `true`, it equals checking the check-box by default.
```html
<input type="checkbox" value="myOnValue"
name="myField"
@if((!old() && $myDefault) || old('myField') == 'myOnValue') checked="checked" @endif... |
29,825,154 | I'm working in a custom `keyboard` `(iOS App Extension)`. I have a `UICollectionView` in my `Keyboard` `Layout`, so when one `item` is selected I want to show a `message` (`UIAlerView` for example).
Here is my code:
```
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)... | 2015/04/23 | ['https://Stackoverflow.com/questions/29825154', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2274847/'] | Finally I solved the problem. It's not the best solution, but at least I get the effect that I wanted.
I've created a `View` simulating a `Toast` in the `xib` file and set it to `hidden`.
When the item is selected, I show the "faked" `Toast` for 2 seconds and hide it again.
```
self.popUpView.hidden = NO;
dispatch_... | Sad to say that, but there's no way to show a UIAlertView in keyboard extension. Actually, nothing above the frame of InputViewController can be showed. It's pretty clear in the Apple's doc:
>
> ...a custom keyboard can draw only within the primary view of its UIInputViewController object... it is not possible to dis... |
60,329,971 | I'm developing a quiz app and I'm this error:
>
> Fatal error: Uncaught Error: Call to a member function fetch\_assoc() on array in C:\wamp64\
>
>
>
What's going wrong?
```
/**
* Get the Question
*/
$query = "SELECT * FROM questions
WHERE question_number = $number";
//Get result
$result = mysqli_query ($conn,$q... | 2020/02/20 | ['https://Stackoverflow.com/questions/60329971', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/12915120/'] | The error indicates that you're trying to fetch from an array, rather than from a database result set.
In your code:
```
$choices = $result->fetch_assoc();
```
This [`fetch_assoc`](https://www.php.net/manual/en/mysqli-result.fetch-assoc.php) returns "an associative array of strings representing the fetched row in... | You are fetching a single row into PHP array with this line:
```
$choices = $result->fetch_assoc();
```
Then you use that array in your `while` loop:
```
while ($row = $choices->fetch_assoc())
```
You can't call `fetch_assoc()` on an array!
What you should have done is fetched all rows into a multi-dimensional a... |
59,812,671 | i have a NVIDIA GeFroce GTX 1650. This GPU is not CUDA enabled/supported ([as seen here](https://developer.nvidia.com/cuda-gpus)). However, I still want to use Tensorflow. Is there any possibility to do this? | 2020/01/19 | ['https://Stackoverflow.com/questions/59812671', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/'] | Yes, you can run `Tensorflow` on your CPU.
Use the following code block:
```
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
import tensorflow as tf
```
If you really want to install CUDA compatible version to your graphic card, check last message [here](https://de... | For anybody else looking for this info the GTX 1650 has compute capability of 7.5. See on the NVidia forums here: <https://forums.developer.nvidia.com/t/cuda-enabled-geforce-1650/81010/2> and also on the [CUDA Wikipedia page](https://en.wikipedia.org/wiki/CUDA) |
2,277,465 | I have been creating a 2D game in Qt and I want to allow others to connect to hosted games to play. Would I just make a "server" in the game and allow others to connect to it? | 2010/02/17 | ['https://Stackoverflow.com/questions/2277465', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/274437/'] | Generally, one will need a few things to get something like that going.
Namely, a directory server. Maybe everyone connects to other players who host games to play, but you need to run a directory for games to be listed in order for people to connect.
Either that or you need to run a server and host them there. The c... | If I were you, I would make a server separated from, but bundled with, the "client". Believe me or not, many games out there take similar approach. |
2,277,465 | I have been creating a 2D game in Qt and I want to allow others to connect to hosted games to play. Would I just make a "server" in the game and allow others to connect to it? | 2010/02/17 | ['https://Stackoverflow.com/questions/2277465', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/274437/'] | If this is just a small project and you aren't intended to mass distribute it across the web (it doesn't sound like you are), then you can code up a simple socket server. You will need to modify your existing game code to send the "moves" as a message to the server. It will probably be easiest if you make up a simple n... | If I were you, I would make a server separated from, but bundled with, the "client". Believe me or not, many games out there take similar approach. |
2,277,465 | I have been creating a 2D game in Qt and I want to allow others to connect to hosted games to play. Would I just make a "server" in the game and allow others to connect to it? | 2010/02/17 | ['https://Stackoverflow.com/questions/2277465', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/274437/'] | If this is just a small project and you aren't intended to mass distribute it across the web (it doesn't sound like you are), then you can code up a simple socket server. You will need to modify your existing game code to send the "moves" as a message to the server. It will probably be easiest if you make up a simple n... | Generally, one will need a few things to get something like that going.
Namely, a directory server. Maybe everyone connects to other players who host games to play, but you need to run a directory for games to be listed in order for people to connect.
Either that or you need to run a server and host them there. The c... |
42,236,697 | ```
@RequestMapping(value="/portfolios", method = RequestMethod.GET)
public @ResponseBody List<PortfolioVO> getPortfolios(HttpServletRequest request, @RequestParam(required= false) String region) {
List<PortfolioVO> portfolios = gmiCacheService.getPortoliosForRegion(user, region);
return portfolios; ... | 2017/02/14 | ['https://Stackoverflow.com/questions/42236697', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7470849/'] | In c#, I would use `Tuple` for storing those two list separately. But in Java, I didn't get similar data structure. But you can make your custom tuple structure.
[From this answer](https://stackoverflow.com/questions/2670982/using-pairs-or-2-tuples-in-java) :
```
public class Tuple<X, Y> {
public final X x;
p... | I see two ways:
1) return array of lists: `public @ResponseBody List[]<PortfolioVO> getPortfolios( ... )`
inside it: `return new List[] { list1, list2 };`
This is fast to implement, but it is not nice and little bit dirty.
2) More proper way, I think, create class for this case:
```
static class ListPairHolder {
... |
42,236,697 | ```
@RequestMapping(value="/portfolios", method = RequestMethod.GET)
public @ResponseBody List<PortfolioVO> getPortfolios(HttpServletRequest request, @RequestParam(required= false) String region) {
List<PortfolioVO> portfolios = gmiCacheService.getPortoliosForRegion(user, region);
return portfolios; ... | 2017/02/14 | ['https://Stackoverflow.com/questions/42236697', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7470849/'] | Since Java [doesn't have built-in pairs](https://stackoverflow.com/questions/156275/what-is-the-equivalent-of-the-c-pairl-r-in-java), the "Java way" of doing it is to return a custom class that has two `List` fields. Something like:
```
public class MyReturnType{
public List<PortfolioV0> l1,l2;
}
```
Another o... | I see two ways:
1) return array of lists: `public @ResponseBody List[]<PortfolioVO> getPortfolios( ... )`
inside it: `return new List[] { list1, list2 };`
This is fast to implement, but it is not nice and little bit dirty.
2) More proper way, I think, create class for this case:
```
static class ListPairHolder {
... |
47,644,183 | i am using spring boot and i want to deploy a rest API war file into tomcat server.
There is no errors in the tomcat server logs but when i call any endpoint i got 404 "not found" and i got the same from the tomcat server .
java version : 8.
tomcat version : 9.
maybe i miss something , here are my code samples :
P... | 2017/12/05 | ['https://Stackoverflow.com/questions/47644183', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9053563/'] | It's not possible.
an bn is not [regular](https://en.wikipedia.org/wiki/Regular_language), thus matching with a regular expression is mathematically not possible, even with enhanced regular expressions.
You can use the following function to get the range which doesn't use a regular expression:
```js
var input = "a c... | ```js
var a = 0,
b = 0;
var result = 0;
var patten = /./g;
for (;patten.exec("a cat bit a dog on the butt before running away") != null;) {
if (RegExp['$&'] == "a") {
a++;
if (a == b) {
result = patten.lastIndex;
}
}
if (RegExp['$&'] == "b") {
b++;
if (a == b) {
... |
39,099,218 | [](https://i.stack.imgur.com/PKlCN.png)I am using yii2 framework since last few weeks. But now I am getting some issues with composer itself.
Just for info, I am using ubuntu 14.04
When I require some new package / extensions, I do the composer add b... | 2016/08/23 | ['https://Stackoverflow.com/questions/39099218', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6608101/'] | Try
```
composer --no-update require dmstr/yii2-adminlte-asset:*
``` | To avoid uninstallation of other extensions just do following steps.
```
1) "dmstr/yii2-adminlte-asset" : "2.*"
2) "2amigos/yii2-file-upload-widget": "~1.0"
```
to the require section of your composer.json file.
```
2) php composer.phar update
```
run this command in Cmd. |
39,099,218 | [](https://i.stack.imgur.com/PKlCN.png)I am using yii2 framework since last few weeks. But now I am getting some issues with composer itself.
Just for info, I am using ubuntu 14.04
When I require some new package / extensions, I do the composer add b... | 2016/08/23 | ['https://Stackoverflow.com/questions/39099218', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6608101/'] | Try
```
composer --no-update require dmstr/yii2-adminlte-asset:*
``` | 1. Your problem is, that the packages which are removed are NOT in the `require` nor in `require-dev` section of your `composer.json`. So I assume that the removed packages formerly were (sub-)required by any of the other packages in your `composer.json` and with the newer version of these packages this requirement was... |
39,099,218 | [](https://i.stack.imgur.com/PKlCN.png)I am using yii2 framework since last few weeks. But now I am getting some issues with composer itself.
Just for info, I am using ubuntu 14.04
When I require some new package / extensions, I do the composer add b... | 2016/08/23 | ['https://Stackoverflow.com/questions/39099218', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6608101/'] | Try
```
composer --no-update require dmstr/yii2-adminlte-asset:*
``` | I had this problem few days ago to install a package but when I installed the package all the project updated and my project became broken.So I replace my last vendor again,So I found a safe way for better and safer upgrading packages:
1. archiving your vendor to a zip or rar file and copy composer.json too.
2. add pa... |
39,099,218 | [](https://i.stack.imgur.com/PKlCN.png)I am using yii2 framework since last few weeks. But now I am getting some issues with composer itself.
Just for info, I am using ubuntu 14.04
When I require some new package / extensions, I do the composer add b... | 2016/08/23 | ['https://Stackoverflow.com/questions/39099218', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6608101/'] | 1. Your problem is, that the packages which are removed are NOT in the `require` nor in `require-dev` section of your `composer.json`. So I assume that the removed packages formerly were (sub-)required by any of the other packages in your `composer.json` and with the newer version of these packages this requirement was... | To avoid uninstallation of other extensions just do following steps.
```
1) "dmstr/yii2-adminlte-asset" : "2.*"
2) "2amigos/yii2-file-upload-widget": "~1.0"
```
to the require section of your composer.json file.
```
2) php composer.phar update
```
run this command in Cmd. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.