qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
40,698,535 | Disclaimer: I am not going to use any other ways I have a specific requirement.
All I want is to Join from posts table to the posts meta so that I can get the featured image per post. I am able to get the post via where clause post type is post and published but I don't know how to write join for MySql to get the feat... | 2016/11/19 | [
"https://Stackoverflow.com/questions/40698535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4582545/"
] | You mention " i don't want to mix up js and jQuery on the following code" but you are actually mixing vanilla DOM APIs with jQuery methods. `.parent` and `.addClass` are jQuery functions. You can code:
```
btn.parentNode.classList.add("active");
``` | Also consider `parentElement` as an alternative to `parentNode`:
```
btn.parentElement.classList.add("active");
``` |
40,698,535 | Disclaimer: I am not going to use any other ways I have a specific requirement.
All I want is to Join from posts table to the posts meta so that I can get the featured image per post. I am able to get the post via where clause post type is post and published but I don't know how to write join for MySql to get the feat... | 2016/11/19 | [
"https://Stackoverflow.com/questions/40698535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4582545/"
] | Also consider `parentElement` as an alternative to `parentNode`:
```
btn.parentElement.classList.add("active");
``` | You need .parentNode on the element.
Something like this.
```
var clickedPath = this.getElement();
clickedPath.classList.add("active");
var classes = clickedPath.getAttribute('class').match(/\d+/g) || [];
buttons.forEach(function(btn) {
var method = classes.indexOf(btn.getAttribute('data-date')) > -1 ? 'add' : 'rem... |
2,807 | Is it true that when someone uses the word うるさい, it means that there is a feeling of *"discontent"* ?
Like for example, we will take this sentence: "It will be noisy in the factory"
"It will be noisy in the factory" is neutral. (no nuance of *annoyance* )
But is it true that if we translate that sentence into japan... | 2011/08/23 | [
"https://japanese.stackexchange.com/questions/2807",
"https://japanese.stackexchange.com",
"https://japanese.stackexchange.com/users/264/"
] | `うるさい` definitely conveys a negative attribute which you could reasonably call "annoyance".
This is why in Japanese, the equivalent of "shut up!" is `「うるさい!」`. It's saying the noise you're making is annoying, and *therefor* you should "shut up".
So if you say:
>
> 工場{こうじょう}の中{なか}はうるさい
>
>
>
... you're definitel... | Yes. It has negative connotation. I think the English `noisy` has it as well. The neutral way of saying it in Japanese is `音が大きい`, and in English `the sound is loud`. |
2,807 | Is it true that when someone uses the word うるさい, it means that there is a feeling of *"discontent"* ?
Like for example, we will take this sentence: "It will be noisy in the factory"
"It will be noisy in the factory" is neutral. (no nuance of *annoyance* )
But is it true that if we translate that sentence into japan... | 2011/08/23 | [
"https://japanese.stackexchange.com/questions/2807",
"https://japanese.stackexchange.com",
"https://japanese.stackexchange.com/users/264/"
] | `うるさい` definitely conveys a negative attribute which you could reasonably call "annoyance".
This is why in Japanese, the equivalent of "shut up!" is `「うるさい!」`. It's saying the noise you're making is annoying, and *therefor* you should "shut up".
So if you say:
>
> 工場{こうじょう}の中{なか}はうるさい
>
>
>
... you're definitel... | I think it has a negative nuance.
The other day, I was walking next to a laboratory with a lot of computers. It made hell of a noise. I said "うるさいですね" as we passed by, and some people around me told me that I had just done a blatant impoliteness.
I still think that it's no more impolite than saying "it's hot" during ... |
19,862,777 | I have a query that takes 20 min to executed... I remember in one project we used /\*+ PARALLEL(T,8) */ or we would use the with clause and /*+ materialize \*/ and it would make the query responds time really fast withing seconds. How can I do this to this query?
```
select count(*) from (
... | 2013/11/08 | [
"https://Stackoverflow.com/questions/19862777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2475251/"
] | Try this, might be faster:
```
select count(*)
from RPT_7330_HDR hdr
JOIN LS_DT_MODIFIED LS ON LS.NAME = 'RPT_7330_HDR' AND hdr.DT_MODIFIED = LS.DT_MODIFIED
JOIN RPT_7330_DTL dtl on hdr.EID = dtl.EID
JOIN CODE_LKUP2 lkup ON LKUP.CODE1 = hdr.ACCESS_IND AND LKUP.CATEGORY='ACCESS_MAPPING'
```
The SQL engi... | ```
SELECT /*+ PARALLEL */ ...
```
You do *not* want to use a magic number and you do *not* want to list any objects.
A degree of parallelism of 8 is probably too high on your laptop, yet too low on your production server. If the query simply specifies `PARALLEL`, Oracle will automatically determine the DOP if it's... |
19,862,777 | I have a query that takes 20 min to executed... I remember in one project we used /\*+ PARALLEL(T,8) */ or we would use the with clause and /*+ materialize \*/ and it would make the query responds time really fast withing seconds. How can I do this to this query?
```
select count(*) from (
... | 2013/11/08 | [
"https://Stackoverflow.com/questions/19862777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2475251/"
] | If you want data then
```
SELECT /*+ PARALLEL(DTL,4) */
HDR.ACCESS_IND,
HDR.SID,
HDR.CLLI,
HDR.DA,
HDR.TAPER_CODE,
HDR.CFG_TYPE AS CFG_TYPE,
HDR.IP_ADDR,
HDR.IOS_VERSION,
HDR.ADMIN_STATE,
HDR.WIRE_C... | ```
SELECT /*+ PARALLEL */ ...
```
You do *not* want to use a magic number and you do *not* want to list any objects.
A degree of parallelism of 8 is probably too high on your laptop, yet too low on your production server. If the query simply specifies `PARALLEL`, Oracle will automatically determine the DOP if it's... |
50,685,507 | I want to seed R's internal `unif_rand()` in a multithreaded environment. The code below generates a 2-column matrix of uniform random numbers within 2 threads. The results are interesting.
```
struct mtRunif: public RcppParallel::Worker
{
int Nrow; // number of rows in matrix.
double *v; // point to the 0th eleme... | 2018/06/04 | [
"https://Stackoverflow.com/questions/50685507",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2961927/"
] | After advertising [dqrng](https://cran.r-project.org/package=dqrng) in the comments I realized that I had not written any documentation on how to use the RNGs from that package for parallel usage. So I started a [new vignette](https://cran.r-project.org/web/packages/dqrng/vignettes/parallel.html), that will be part of ... | In short: you can't do this with R for R-internal reasons, and that has been documented extensively.
There are also statistical issues about RNGs and streams. So you most likely want to look into "streaming RNGs" suitable for drawing from multiple threads. There are some on CRAN
* [doRNG](https://cran.r-project.org/... |
13,323,370 | I'm importing a font with CSS. However, it does not seem to work in IE. I don't know why.
Here's my CSS code:
```
@font-face {
font-family: 'bello';
src: url('../fonts/bello.eot?');
src: url('../fonts/bello.eot?#iefix') format('embedded-opentype'),
url('../fonts/bello.woff') format('woff'),
... | 2012/11/10 | [
"https://Stackoverflow.com/questions/13323370",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559962/"
] | solved the problem, it was not problem of the eot file. It seems IE has a problem finding the .eot file if the family name is different as the full name of the font. In my case font name was bello-script and font family was bello. Changed both of them and everything worked fine. | I was experiencing a similar issue. As with the other response it didn't appear to be a problem with the .eot file but rather with the font-family value length.
Changing the @font-face and references of:
```
font-family: Titillium Web Extra Light Italic
```
To:
```
font-family: Titillium Web Light Italic
```
Fix... |
20,647 | I am currently programming, but I messed up my code. What is the best way to clean this?
buttonUitvoeren\_Click\_1:
```
private void buttonUitvoeren_Click_1(object sender, EventArgs e)
{
buttonNoodstop.Enabled = true;
buttonPauze.Enabled = true;
buttonUitvoeren.Enabled = false;
// Orderlijst uitvoere... | 2013/01/17 | [
"https://codereview.stackexchange.com/questions/20647",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/21235/"
] | I would start by trying to extract methods from your code. My general rule of thumb is that a method should be small enough to fit on the screen without having to scroll up or down.
Here is an example:
```
if (t > 0 && t < orderLijst.Count)
{
if (orderLijst[t].BekerList[(orderLijst[t].BekerList.Count - 1)].Percen... | I see a problem in here:
```
for (int t = 0; t < orderLijst.Count; t++)
{
// kijk naar laatste beker in huidige en eerste in volgende om te kijken of er gespoeld moet worden
if (t > 0 && t < orderLijst.Count)
{
if (orderLijst[t].BekerList[(orderLijst[t].BekerList.Count - 1)].Per... |
33,326,940 | I have a array like
```
var abc = ["mon","Thu","Fri","Tue","Wed","Sun","Sat"]
```
So next I want these days in order like
```
["mon","Tue","Wed","Thu","Fri","Sat","Sun"]
```
Is there any inbuilt functions or any logic for it? | 2015/10/25 | [
"https://Stackoverflow.com/questions/33326940",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3101792/"
] | The callback function doesn't sort itself. It just needs to compare any two items that are passed to it. So you have to write the logic that translates strings starting with 'translate' come before strings starting with 'rotate'.
```js
// Very simple, rudimentary function to translate a type to number. Improve at will... | The sort function can be based on the words you want to sort on in sequence, provided they have unique sequences of characters:
```js
var p = ['skewX', 'translateY', 'scale', 'rotateX'];
p.sort(function(a, b) {
var order = 'transrotaskewscal';
return order.indexOf(a.slice(0,4)) - order.indexOf(b.slice(0,4));
... |
68,955,883 | I want to color my ridgeline plot with gradient fill colors depending on the height of the area instead of depending on the X axis. It would be somthing like this:
```
library(ggplot2)
library(ggridges)
ggplot(lincoln_weather, aes(x = `Mean Temperature [F]`, y = `Month`, fill = stat(x))) +
geom_density_ridges... | 2021/08/27 | [
"https://Stackoverflow.com/questions/68955883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4768667/"
] | The [linked answer](https://stackoverflow.com/questions/58525699/how-can-i-add-a-vertical-colour-gradient-to-a-ridgeplot-in-ggridges) is still valid, provided you bypass the `encode_pattern_params_as_hex_colour()` function and create the pattern gradient yourself (via `svgpatternsimple::create_pattern_gradient()`):
``... | You want to color the ridges according to the `density` of the individual traces, so you have to get access to that statistic. Fortunately, `ggridges` allows that with the `stat='density'` option and the `..density..` input to the asthetic.
The code:
```
ggplot(lincoln_weather, aes(x = `Mean Temperature [F]`, y = `Mo... |
68,955,883 | I want to color my ridgeline plot with gradient fill colors depending on the height of the area instead of depending on the X axis. It would be somthing like this:
```
library(ggplot2)
library(ggridges)
ggplot(lincoln_weather, aes(x = `Mean Temperature [F]`, y = `Month`, fill = stat(x))) +
geom_density_ridges... | 2021/08/27 | [
"https://Stackoverflow.com/questions/68955883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4768667/"
] | An option often overlooked by people is that you can pretty much draw anything in ggplot2 as long as you can express it in polygons. The downside is that it is a lot more work.
The following approach mimics my answer given [here](https://stackoverflow.com/a/64695516/11374827) but adapted a little bit to work more cons... | You want to color the ridges according to the `density` of the individual traces, so you have to get access to that statistic. Fortunately, `ggridges` allows that with the `stat='density'` option and the `..density..` input to the asthetic.
The code:
```
ggplot(lincoln_weather, aes(x = `Mean Temperature [F]`, y = `Mo... |
68,955,883 | I want to color my ridgeline plot with gradient fill colors depending on the height of the area instead of depending on the X axis. It would be somthing like this:
```
library(ggplot2)
library(ggridges)
ggplot(lincoln_weather, aes(x = `Mean Temperature [F]`, y = `Month`, fill = stat(x))) +
geom_density_ridges... | 2021/08/27 | [
"https://Stackoverflow.com/questions/68955883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4768667/"
] | An option often overlooked by people is that you can pretty much draw anything in ggplot2 as long as you can express it in polygons. The downside is that it is a lot more work.
The following approach mimics my answer given [here](https://stackoverflow.com/a/64695516/11374827) but adapted a little bit to work more cons... | The [linked answer](https://stackoverflow.com/questions/58525699/how-can-i-add-a-vertical-colour-gradient-to-a-ridgeplot-in-ggridges) is still valid, provided you bypass the `encode_pattern_params_as_hex_colour()` function and create the pattern gradient yourself (via `svgpatternsimple::create_pattern_gradient()`):
``... |
1,700,091 | How can I know on which port my application is running? | 2009/11/09 | [
"https://Stackoverflow.com/questions/1700091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/96180/"
] | If your app is a server, and you need to test if it's listening, you can use
```
netstat -ltpn
```
The meaning of the switches:
* -l for "listening", that is, server sockets only
* -t for "tcp only"; note that you may need udp, then use -u
* -p for "program": show which process opened which socket
* -n for "numeric... | There is a nice util at SysInternals called TCPView.exe
<http://live.sysinternals.com/Tcpview.exe>
That shows all connections and process IDs |
1,700,091 | How can I know on which port my application is running? | 2009/11/09 | [
"https://Stackoverflow.com/questions/1700091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/96180/"
] | If your app is a server, and you need to test if it's listening, you can use
```
netstat -ltpn
```
The meaning of the switches:
* -l for "listening", that is, server sockets only
* -t for "tcp only"; note that you may need udp, then use -u
* -p for "program": show which process opened which socket
* -n for "numeric... | Inside a Servlet you can ask the HttpRequest object how it was invoked including the port and hostname. There is no standard API for a servlet interrogating the container. |
1,700,091 | How can I know on which port my application is running? | 2009/11/09 | [
"https://Stackoverflow.com/questions/1700091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/96180/"
] | That's not a lot of information to go on, but if your app is a general purpose TCP server and you're really not sure whether it's running or not, or on what port, try:
```
netstat -an -p tcp
```
(This is a UNIX/Linux/OS X command... not sure what the Windows equivalent is but it will be similar)
This will show you ... | if you're using tcp\ip or udp fport should fit your needs
[link text](http://www.foundstone.com/us/resources/proddesc/fport.htm) |
1,700,091 | How can I know on which port my application is running? | 2009/11/09 | [
"https://Stackoverflow.com/questions/1700091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/96180/"
] | There is a nice util at SysInternals called TCPView.exe
<http://live.sysinternals.com/Tcpview.exe>
That shows all connections and process IDs | Inside a Servlet you can ask the HttpRequest object how it was invoked including the port and hostname. There is no standard API for a servlet interrogating the container. |
1,700,091 | How can I know on which port my application is running? | 2009/11/09 | [
"https://Stackoverflow.com/questions/1700091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/96180/"
] | That's not a lot of information to go on, but if your app is a general purpose TCP server and you're really not sure whether it's running or not, or on what port, try:
```
netstat -an -p tcp
```
(This is a UNIX/Linux/OS X command... not sure what the Windows equivalent is but it will be similar)
This will show you ... | If your app is a server, and you need to test if it's listening, you can use
```
netstat -ltpn
```
The meaning of the switches:
* -l for "listening", that is, server sockets only
* -t for "tcp only"; note that you may need udp, then use -u
* -p for "program": show which process opened which socket
* -n for "numeric... |
1,700,091 | How can I know on which port my application is running? | 2009/11/09 | [
"https://Stackoverflow.com/questions/1700091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/96180/"
] | What port did you *tell* it to run on?
(You're going to have to give us more details about exactly what you/your program are/is doing for us to be able to give you a more helpful answer than the above.) | if you're using tcp\ip or udp fport should fit your needs
[link text](http://www.foundstone.com/us/resources/proddesc/fport.htm) |
1,700,091 | How can I know on which port my application is running? | 2009/11/09 | [
"https://Stackoverflow.com/questions/1700091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/96180/"
] | That's not a lot of information to go on, but if your app is a general purpose TCP server and you're really not sure whether it's running or not, or on what port, try:
```
netstat -an -p tcp
```
(This is a UNIX/Linux/OS X command... not sure what the Windows equivalent is but it will be similar)
This will show you ... | Inside a Servlet you can ask the HttpRequest object how it was invoked including the port and hostname. There is no standard API for a servlet interrogating the container. |
1,700,091 | How can I know on which port my application is running? | 2009/11/09 | [
"https://Stackoverflow.com/questions/1700091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/96180/"
] | That's not a lot of information to go on, but if your app is a general purpose TCP server and you're really not sure whether it's running or not, or on what port, try:
```
netstat -an -p tcp
```
(This is a UNIX/Linux/OS X command... not sure what the Windows equivalent is but it will be similar)
This will show you ... | What port did you *tell* it to run on?
(You're going to have to give us more details about exactly what you/your program are/is doing for us to be able to give you a more helpful answer than the above.) |
1,700,091 | How can I know on which port my application is running? | 2009/11/09 | [
"https://Stackoverflow.com/questions/1700091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/96180/"
] | What port did you *tell* it to run on?
(You're going to have to give us more details about exactly what you/your program are/is doing for us to be able to give you a more helpful answer than the above.) | There is a nice util at SysInternals called TCPView.exe
<http://live.sysinternals.com/Tcpview.exe>
That shows all connections and process IDs |
1,700,091 | How can I know on which port my application is running? | 2009/11/09 | [
"https://Stackoverflow.com/questions/1700091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/96180/"
] | There is a nice util at SysInternals called TCPView.exe
<http://live.sysinternals.com/Tcpview.exe>
That shows all connections and process IDs | if you're using tcp\ip or udp fport should fit your needs
[link text](http://www.foundstone.com/us/resources/proddesc/fport.htm) |
68,902,062 | here is my code
```
def computepay(h,r):
if h>40.0:
OT = 1.5*float(r)
p=OT
else:
ck = float(h)*float(r)
p=ck
return 'p'
hrs = input("Enter Hours:")
rate = input("Enter rate:")
h = float(hrs)
r = float(rate)
p = computepay(h,r)
print("Pay", p)
```
here are t... | 2021/08/24 | [
"https://Stackoverflow.com/questions/68902062",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16738393/"
] | Pivot to longer format on model columns and filter only those rows that have value TRUE. Group by model and summarise wanted values.
```
shared %>%
pivot_longer(
cols = matches("^model[0-9]+$"),
names_to = "model"
) %>%
filter(value == TRUE) %>%
group_by(model) %>%
summarise(
n_transcripts = n(),... | Here is my way of doing this.
My approach is to use the package `dplyr` which excels at summarizing data like this. However, it works best when your data is in tidy form, meaning it is perfectly square and each column is a variable. This means that the two columns "model1" and "model2" have to become one, like this:
... |
10,195,384 | I would like to be able to setup my GitHub repo to integrate with my Netbeans project. I'm a super noob at versioning in general, so this may be a pretty easy question. Any help would be appreciated!
*My question is*: What do I insert as my Repository URL?
Here are the options I'm given when I try to push to remote: ... | 2012/04/17 | [
"https://Stackoverflow.com/questions/10195384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/971592/"
] | You first need to initialize a git repository in your existing project then you can push using the ssh protocol and git@github.com:Username/repositoryname.git it should ask you for your private key file select it from .ssh in your user folder | The remote repository location refers to somewhere outside of the local repository that you would like to push to. This can be any of those protocols listed (i.e., you can "push" to a local repository on the disk, or somewhere on the internet). A popular remote repository service for git is [Github](http://github.com).... |
3,325,781 | The following image has both the problem and its solution. I have a doubt in the solution, the details of which I have included below the image.
[](https://i.stack.imgur.com/39zbP.jpg)
**(Assume the terms in given series are generated from a polynomi... | 2019/08/17 | [
"https://math.stackexchange.com/questions/3325781",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | The author is assuming the original terms of the series are values from a polynomial at increasing integral values. Thus, when a sequence of differences causes all of the terms to be the same at some level $m$, the sequence $T\_n$ represents a polynomial of degree $m$. For more information, see Theorem $1$ in [Differen... | (Assuming the terms in given series are generated from a polynomial)
When you take the difference, you reduce the degree by $1$.
As an example, for a quadratic $T\_n = n^2$, the first order differences would be in A.P: $$(n+1)^2 - n^2 = 2n+1$$
And for a cubic $T\_n = n^3$, the first order differences gives you a q... |
28,967,618 | Is it possible for an Android Library to have its own context? The reason I ask is because I am using an Android Library that is used by multiple applications(APKs) and to store something in the database, it needs a context. If the Android Library can have it's own context, the Android Library can view all the data sto... | 2015/03/10 | [
"https://Stackoverflow.com/questions/28967618",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1270257/"
] | No, it is not possible for android library to have it's own context.
As context is runtime property of application, hence application pass it's own context only when it is running. | Yes it is possible like Google play service,
But at that time library itself work as another application may be in background process.
And use of library will work as communication between two applications. |
401,959 | Using gzip 1.3.12 / ubuntu 64bit I am getting "No space left on device" yet there appears to be plenty of disk space remaining.
```
gunzip 03-05-2012--22-52-01.tar.gz
gzip: 03-05-2012--22-52-01.tar: No space left on device
```
If you run the above gunzip twice in a row the first time it takes a while before showing... | 2012/06/25 | [
"https://serverfault.com/questions/401959",
"https://serverfault.com",
"https://serverfault.com/users/4803/"
] | What is the question you are asking exactly?
>
> “No space left on device”
>
>
>
Would indicate that you've run out of disk space. Change the current working directory to another directory mounted on a larger partition and try again ...
Also, bear in mind that `du` won't always match `df`. It is possible for fil... | `"No space left on device"`
This error can also indicate permission issues. Check that your are executing the command as the appropriate user. Obviously `/root/` requires root permissions. |
401,959 | Using gzip 1.3.12 / ubuntu 64bit I am getting "No space left on device" yet there appears to be plenty of disk space remaining.
```
gunzip 03-05-2012--22-52-01.tar.gz
gzip: 03-05-2012--22-52-01.tar: No space left on device
```
If you run the above gunzip twice in a row the first time it takes a while before showing... | 2012/06/25 | [
"https://serverfault.com/questions/401959",
"https://serverfault.com",
"https://serverfault.com/users/4803/"
] | What is the question you are asking exactly?
>
> “No space left on device”
>
>
>
Would indicate that you've run out of disk space. Change the current working directory to another directory mounted on a larger partition and try again ...
Also, bear in mind that `du` won't always match `df`. It is possible for fil... | It was permissions in my case. Anyone facing this issue must check for the file permissions first and the owner. |
401,959 | Using gzip 1.3.12 / ubuntu 64bit I am getting "No space left on device" yet there appears to be plenty of disk space remaining.
```
gunzip 03-05-2012--22-52-01.tar.gz
gzip: 03-05-2012--22-52-01.tar: No space left on device
```
If you run the above gunzip twice in a row the first time it takes a while before showing... | 2012/06/25 | [
"https://serverfault.com/questions/401959",
"https://serverfault.com",
"https://serverfault.com/users/4803/"
] | `"No space left on device"`
This error can also indicate permission issues. Check that your are executing the command as the appropriate user. Obviously `/root/` requires root permissions. | It was permissions in my case. Anyone facing this issue must check for the file permissions first and the owner. |
44,649,699 | I'm trying to mock a call to a service but I'm struggeling with the following message: **The module factory of `jest.mock()` is not allowed to reference any out-of-scope variables**.
I'm using babel with ES6 syntax, jest and enzyme.
I have a simple component called `Vocabulary` which gets a list of `VocabularyEntry`-... | 2017/06/20 | [
"https://Stackoverflow.com/questions/44649699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4652967/"
] | The problem is that all `jest.mock` will be hoisted to the top of actual code block at compile time, which in this case is the top of the file. At this point `VocabularyEntry` is not imported. You could either put the `mock` in a `beforeAll` block in your test or use `jest.mock` like this:
```
import {shallow} from 'e... | When implementing a `jest.fn()` in a module, which was mocked with `jest.mock`, make sure you do the following two steps:
1. The variable name should begin with `mock`.
2. If you wrote something like `coolFunction: mockCoolFunction`, make sure to change it to `coolFunction: (...args) => mockCoolFunction(...args)`. Thi... |
44,649,699 | I'm trying to mock a call to a service but I'm struggeling with the following message: **The module factory of `jest.mock()` is not allowed to reference any out-of-scope variables**.
I'm using babel with ES6 syntax, jest and enzyme.
I have a simple component called `Vocabulary` which gets a list of `VocabularyEntry`-... | 2017/06/20 | [
"https://Stackoverflow.com/questions/44649699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4652967/"
] | You need to store your mocked component in a variable with a name prefixed by "mock".
This solution is based on the Note at the end of the error message I was getting.
>
> Note: This is a precaution to guard against uninitialized mock
> variables. If it is ensured that the mock is required lazily, variable
> names pr... | When implementing a `jest.fn()` in a module, which was mocked with `jest.mock`, make sure you do the following two steps:
1. The variable name should begin with `mock`.
2. If you wrote something like `coolFunction: mockCoolFunction`, make sure to change it to `coolFunction: (...args) => mockCoolFunction(...args)`. Thi... |
44,649,699 | I'm trying to mock a call to a service but I'm struggeling with the following message: **The module factory of `jest.mock()` is not allowed to reference any out-of-scope variables**.
I'm using babel with ES6 syntax, jest and enzyme.
I have a simple component called `Vocabulary` which gets a list of `VocabularyEntry`-... | 2017/06/20 | [
"https://Stackoverflow.com/questions/44649699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4652967/"
] | If you are getting similar error when upgrading to newer Jest [19 to 21 in my case], you can try changing `jest.mock` to `jest.doMock`.
Found this here – <https://github.com/facebook/jest/commit/6a8c7fb874790ded06f4790fdb33d8416a7284c8> | In my case this issue started after I was upgrade my react-native project to v0.61 using react-native-git-upgrade.
After I have tried everything I could. I decide to clean the project and all my tests back to work.
```
# react-native-clean-project
```
However watch out when running the react-native-clean-project, i... |
44,649,699 | I'm trying to mock a call to a service but I'm struggeling with the following message: **The module factory of `jest.mock()` is not allowed to reference any out-of-scope variables**.
I'm using babel with ES6 syntax, jest and enzyme.
I have a simple component called `Vocabulary` which gets a list of `VocabularyEntry`-... | 2017/06/20 | [
"https://Stackoverflow.com/questions/44649699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4652967/"
] | If you are getting similar error when upgrading to newer Jest [19 to 21 in my case], you can try changing `jest.mock` to `jest.doMock`.
Found this here – <https://github.com/facebook/jest/commit/6a8c7fb874790ded06f4790fdb33d8416a7284c8> | ```js
jest.mock("../../../src/services/vocabularyService", () => {
// eslint-disable-next-line global-require
const VocabularyEntry = require("../../../src/model/VocabularyEntry");
return {
vocabulary: [new VocabularyEntry("a", "a1")]
};
});
```
I think it should work with dynamic imports as well instead... |
44,649,699 | I'm trying to mock a call to a service but I'm struggeling with the following message: **The module factory of `jest.mock()` is not allowed to reference any out-of-scope variables**.
I'm using babel with ES6 syntax, jest and enzyme.
I have a simple component called `Vocabulary` which gets a list of `VocabularyEntry`-... | 2017/06/20 | [
"https://Stackoverflow.com/questions/44649699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4652967/"
] | The problem is that all `jest.mock` will be hoisted to the top of actual code block at compile time, which in this case is the top of the file. At this point `VocabularyEntry` is not imported. You could either put the `mock` in a `beforeAll` block in your test or use `jest.mock` like this:
```
import {shallow} from 'e... | If you are getting similar error when upgrading to newer Jest [19 to 21 in my case], you can try changing `jest.mock` to `jest.doMock`.
Found this here – <https://github.com/facebook/jest/commit/6a8c7fb874790ded06f4790fdb33d8416a7284c8> |
44,649,699 | I'm trying to mock a call to a service but I'm struggeling with the following message: **The module factory of `jest.mock()` is not allowed to reference any out-of-scope variables**.
I'm using babel with ES6 syntax, jest and enzyme.
I have a simple component called `Vocabulary` which gets a list of `VocabularyEntry`-... | 2017/06/20 | [
"https://Stackoverflow.com/questions/44649699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4652967/"
] | If you are getting similar error when upgrading to newer Jest [19 to 21 in my case], you can try changing `jest.mock` to `jest.doMock`.
Found this here – <https://github.com/facebook/jest/commit/6a8c7fb874790ded06f4790fdb33d8416a7284c8> | When implementing a `jest.fn()` in a module, which was mocked with `jest.mock`, make sure you do the following two steps:
1. The variable name should begin with `mock`.
2. If you wrote something like `coolFunction: mockCoolFunction`, make sure to change it to `coolFunction: (...args) => mockCoolFunction(...args)`. Thi... |
44,649,699 | I'm trying to mock a call to a service but I'm struggeling with the following message: **The module factory of `jest.mock()` is not allowed to reference any out-of-scope variables**.
I'm using babel with ES6 syntax, jest and enzyme.
I have a simple component called `Vocabulary` which gets a list of `VocabularyEntry`-... | 2017/06/20 | [
"https://Stackoverflow.com/questions/44649699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4652967/"
] | ```js
jest.mock("../../../src/services/vocabularyService", () => {
// eslint-disable-next-line global-require
const VocabularyEntry = require("../../../src/model/VocabularyEntry");
return {
vocabulary: [new VocabularyEntry("a", "a1")]
};
});
```
I think it should work with dynamic imports as well instead... | In my case this issue started after I was upgrade my react-native project to v0.61 using react-native-git-upgrade.
After I have tried everything I could. I decide to clean the project and all my tests back to work.
```
# react-native-clean-project
```
However watch out when running the react-native-clean-project, i... |
44,649,699 | I'm trying to mock a call to a service but I'm struggeling with the following message: **The module factory of `jest.mock()` is not allowed to reference any out-of-scope variables**.
I'm using babel with ES6 syntax, jest and enzyme.
I have a simple component called `Vocabulary` which gets a list of `VocabularyEntry`-... | 2017/06/20 | [
"https://Stackoverflow.com/questions/44649699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4652967/"
] | You need to store your mocked component in a variable with a name prefixed by "mock".
This solution is based on the Note at the end of the error message I was getting.
>
> Note: This is a precaution to guard against uninitialized mock
> variables. If it is ensured that the mock is required lazily, variable
> names pr... | ```js
jest.mock("../../../src/services/vocabularyService", () => {
// eslint-disable-next-line global-require
const VocabularyEntry = require("../../../src/model/VocabularyEntry");
return {
vocabulary: [new VocabularyEntry("a", "a1")]
};
});
```
I think it should work with dynamic imports as well instead... |
44,649,699 | I'm trying to mock a call to a service but I'm struggeling with the following message: **The module factory of `jest.mock()` is not allowed to reference any out-of-scope variables**.
I'm using babel with ES6 syntax, jest and enzyme.
I have a simple component called `Vocabulary` which gets a list of `VocabularyEntry`-... | 2017/06/20 | [
"https://Stackoverflow.com/questions/44649699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4652967/"
] | When implementing a `jest.fn()` in a module, which was mocked with `jest.mock`, make sure you do the following two steps:
1. The variable name should begin with `mock`.
2. If you wrote something like `coolFunction: mockCoolFunction`, make sure to change it to `coolFunction: (...args) => mockCoolFunction(...args)`. Thi... | In my case this issue started after I was upgrade my react-native project to v0.61 using react-native-git-upgrade.
After I have tried everything I could. I decide to clean the project and all my tests back to work.
```
# react-native-clean-project
```
However watch out when running the react-native-clean-project, i... |
44,649,699 | I'm trying to mock a call to a service but I'm struggeling with the following message: **The module factory of `jest.mock()` is not allowed to reference any out-of-scope variables**.
I'm using babel with ES6 syntax, jest and enzyme.
I have a simple component called `Vocabulary` which gets a list of `VocabularyEntry`-... | 2017/06/20 | [
"https://Stackoverflow.com/questions/44649699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4652967/"
] | The problem is that all `jest.mock` will be hoisted to the top of actual code block at compile time, which in this case is the top of the file. At this point `VocabularyEntry` is not imported. You could either put the `mock` in a `beforeAll` block in your test or use `jest.mock` like this:
```
import {shallow} from 'e... | In my case this issue started after I was upgrade my react-native project to v0.61 using react-native-git-upgrade.
After I have tried everything I could. I decide to clean the project and all my tests back to work.
```
# react-native-clean-project
```
However watch out when running the react-native-clean-project, i... |
72,743,019 | I am trying to bind host dir to some dir inside container and expecting changes done inside container should reflect on host.
Here is the steps I have followed
created /hostdir on host and run ubuntu container in privileged mode
```
[root@nhbdlin03 ~]# mkdir /hostdir
[root@nhbdlin03 ~]# docker run -itd --privileged ... | 2022/06/24 | [
"https://Stackoverflow.com/questions/72743019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2294755/"
] | Your bind mount made with `mount --bind /container_dir /hostdir` will override volume mount inside the container. You simply bind-mount `/container_dir` over it (same as when you mount e.g. `/boot` partition over `/boot` directory on your root filesystem); so anything you write to `/hostdir` from that point will go onl... | I am able to achieve above using bind mount type and bind-propagation=shared
```
[root@nhbdlin03 ~]# docker run -itd --name ubuntu --privileged --mount type=bind,source=/hostdir,target=/hostdir,bind-propagation=shared ubuntu
2cb814f600ed261ae5e50fcdaec6b5a5a17f3d41d37be307765e20274d918a25
[root@nhbdlin03 ~]# docker ex... |
69,213,411 | There are many questions about CORS policy in JSON. But I did not find any solution which does not need a server side change. I have no access to the server.
My code is:
```
$.getJSON('https://app-prod-ws.meteoswiss-app.ch/v1/forecast?plz=800000&callback=?', function(data){});
```
Is there any client only workaroun... | 2021/09/16 | [
"https://Stackoverflow.com/questions/69213411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/957052/"
] | So, the purpose of CORS is to prevent a Website from accessing data it's not supposed to see. For example, a malicious Website shouldn't see anything from Facebook.
Having said that, there are a few options:
1. The client can use a CORS extension to bypass CORS protection.
2. You can use a CORS proxy (not recommended... | The above solutions seemed too complicated to me. I found an easier one via php. I am not sure if this works in all cases but it does for mine.
```
<?php
$meteoschweizData = file_get_contents("https://app-prod-ws.meteoswiss-app.ch/v1/forecast?plz=800000");
echo "const meteoschweizJSON = '" . $meteoschweizData . ... |
44,866,266 | I have an Array of Objects with a structure like this:
```
[
{
title: "",
imagePoster: "",
episodes: "",
score: "",
genres: ["Comedy", "Drama", ...],
description: ""
},
...
]
```
I need to return an Object which contains specific value like `"Comedy"` in the `genres` Array. I've been... | 2017/07/01 | [
"https://Stackoverflow.com/questions/44866266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7700400/"
] | You could use [`Array#find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) to find the first element that satisfies the condition:
```
const search = "Comedy";
const found = array.find(obj => obj.genres.includes(search));
```
This also uses [`Array#includes`](https://de... | `Array.find` & `Array.includes` are your friends. There are also polyfills for non-browsers :)
The most supported way would be to use `Array.filter` & `Array.indexOf`
```
function getMovieByGenre(genre) {
return movies.filter(function(movie) {
return movies.genres.indexOf(genre) >= 0
})[0];
}
var someComedy... |
4,630,142 | In an attempt to find another issue, my tests came up with the following bit of code.
```
public class TestPersistance {
private static final PersistenceManagerFactory PMF = JDOHelper.getPersistenceManagerFactory("datanucleus.properties");
public static final PersistenceManager pm = PMF.getPersistenceManager();
sta... | 2011/01/07 | [
"https://Stackoverflow.com/questions/4630142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/468854/"
] | Why are you accessing fields directly ? Is the accessing class declared as PersistenceAware ? Well it isn't so you can't do that - use the getters.
What is "ud" object state before persist ? (transient?) what is it after persist ? (hollow?) What does the log say ? Chances are that it is in hollow state and then you acc... | In some cases, it is necessary to access deserialized objects' attributes directly (i.e. if using GSON library for JSON serialization). In that case you can use:
```
MyClass copy = myPersistencyManager.detachCopy(myRetrievedInstance);
``` |
34,051,162 | I'm trying to use EF6.1.3 and Visual Studio 2015 to make some simple CRUD pages, but I keep getting errors whenever I go to "Add Controller"
I tried everything from reinstalling Entity Framework to reinstalling Visual Studio completely. I've created a new empty web app and tried to add a controller and I get the same ... | 2015/12/02 | [
"https://Stackoverflow.com/questions/34051162",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/339332/"
] | This helps me:
1. Close Visual Studio.
2. Open administrative cmd in folder `C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE`
3. `devenv.exe /resetsettings`
4. `devenv.exe /resetuserdata`
Open Visual Studio. | I had the same issue as you after the October update. Aram's answer is the method I used to solve my issue. However, looking closely at the dump, your issue is in the MSVCR120\_CLR0400.dll basically uninstall this dll and re-install it then follow Aram's list.
MSVCR120\_CLR0400.dll is a security update that resolves ... |
47,346,369 | I am using pactNet to test an API which should return an array of a flexible length.
If i call "myApi/items/" it should return a list of items where the consumer does not know the exact size of.
So the answer should look like this:
```
[
{
"id": "1",
"description": "foo"
},... | 2017/11/17 | [
"https://Stackoverflow.com/questions/47346369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8956409/"
] | Sounds like you are looking for the MinTypeMatcher.
The body part would look something like below:
```
Body = Match.MinType(new { id: "1", description: "foo" }, 1)
``` | So, what if I want to Match the type of an object that has a property that is a list or array?
if you do a Match.Type(new myType()) and the number of elements in the array or list property is not exactly the same, the test will fail. You will see an error like this:
```
Description of differences
--------------------... |
47,346,369 | I am using pactNet to test an API which should return an array of a flexible length.
If i call "myApi/items/" it should return a list of items where the consumer does not know the exact size of.
So the answer should look like this:
```
[
{
"id": "1",
"description": "foo"
},... | 2017/11/17 | [
"https://Stackoverflow.com/questions/47346369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8956409/"
] | Sounds like you are looking for the MinTypeMatcher.
The body part would look something like below:
```
Body = Match.MinType(new { id: "1", description: "foo" }, 1)
``` | For a nested array scenario like @SlimSjakie asked, just repeat Match.MinType at the property that has array. For example, the following Person object has Address property as an array.
```
Person = Match.MinType(new
{
FirstName = Match.Type("string"),
LastName = Match.Type("string"),
Address = Match.MinTyp... |
47,346,369 | I am using pactNet to test an API which should return an array of a flexible length.
If i call "myApi/items/" it should return a list of items where the consumer does not know the exact size of.
So the answer should look like this:
```
[
{
"id": "1",
"description": "foo"
},... | 2017/11/17 | [
"https://Stackoverflow.com/questions/47346369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8956409/"
] | For a nested array scenario like @SlimSjakie asked, just repeat Match.MinType at the property that has array. For example, the following Person object has Address property as an array.
```
Person = Match.MinType(new
{
FirstName = Match.Type("string"),
LastName = Match.Type("string"),
Address = Match.MinTyp... | So, what if I want to Match the type of an object that has a property that is a list or array?
if you do a Match.Type(new myType()) and the number of elements in the array or list property is not exactly the same, the test will fail. You will see an error like this:
```
Description of differences
--------------------... |
27,039,199 | I am attempting to use GDI+ in my C application to take a screenshot and save it as JPEG. I am using GDI+ to convert the BMP to JPEG but apparently when calling the GdiplusStartup function, the return code is 2(invalid parameter) instead of 0:
```
int main()
{
GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR... | 2014/11/20 | [
"https://Stackoverflow.com/questions/27039199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4241337/"
] | Initialize `gdiplusStartupInput` variable with the following values: `GdiplusVersion = 1, DebugEventCallback = NULL, SuppressBackgroundThread = FALSE, SuppressExternalCodecs = FALSE`
According to MSDN article `GdiplusStartup function` <http://msdn.microsoft.com/en-us/library/windows/desktop/ms534077%28v=vs.85%29.aspx... | ```
// As Global
ULONG_PTR gdiplusToken;
// In top of main
GdiplusStartupInput gdiplusStartupInput;
GdiplusStartup(&programInfo.gdiplusToken, &gdiplusStartupInput, NULL);
```
works for me. |
24,244,620 | I have a method to get fields from related tables in my Table1 model:
```
public function getFields()
{
$sort = new CSort();
$sort->attributes = array('field1','field2');
$criteria = new CDbCriteria();
$criteria->select = "t3.xxx as field1, count(t1.id) as field2";
$criteria->alias = "t1";
$c... | 2014/06/16 | [
"https://Stackoverflow.com/questions/24244620",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3570546/"
] | Change -
`$sort->attributes = array('field1', 'field2');`
with
```
$sort->attributes = array(
'field1' => array(
'asc'=>'field1 ASC',
'desc'=>'field1 DESC',
),
'field2' => array(
'asc'=>'field2 ASC',
'desc'=>'field2 DESC',
)
);
```
It works. | >
> I also don't know if I am doing the right way what I want. I first
> tryed to accomplish this by using plain SQL. I could bring the values
> of the fields, but I could not order them in the gridview.
>
>
>
This is probably because the SQLDataProvider returns an Array instead of an object. |
2,694,289 | I want to prove that the equation $f(x)=x^3-x-1=0$ has only one real root, which is on the intervall $[1,2]$.
$$$$
I have done the following:
$f(1)=-1<0$ and $f(2)=5>0$ so $f(1)\cdot f(2)<0$ and so from Bolzano's Theorem we have that the function has at least one root on $[1,2]$.
We suppose that there are two r... | 2018/03/16 | [
"https://math.stackexchange.com/questions/2694289",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/80708/"
] | The derivative $3x^2-1$ has roots $\pm\dfrac{\sqrt 3}3$, and $-
\dfrac{\sqrt 3}3$ corresponds to a local *maximum*, which happens to be $-
\dfrac{2\sqrt 9}3-1<0$. Hence $f(x)\le-\dfrac{2\sqrt 9}3-1$ for $x\le \dfrac{\sqrt 3}3$, then it is monotonically increasing to $+\infty$. Therefore, it has only one (real) root. | The solutions of $3c^2-1=0$ are $\pm1/\sqrt{3}$ outside $[1,2]$.
That gives you a contradiction with the assumption that there are two roots inside $[1,2]$. |
2,694,289 | I want to prove that the equation $f(x)=x^3-x-1=0$ has only one real root, which is on the intervall $[1,2]$.
$$$$
I have done the following:
$f(1)=-1<0$ and $f(2)=5>0$ so $f(1)\cdot f(2)<0$ and so from Bolzano's Theorem we have that the function has at least one root on $[1,2]$.
We suppose that there are two r... | 2018/03/16 | [
"https://math.stackexchange.com/questions/2694289",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/80708/"
] | We have that $f'(x)=3x^2-1$ so $f$ has critical points at $x\_0=-1/\sqrt3$ and $x\_1=1/\sqrt3$.
It's easy to check that these are not roots of $f$, and hence $f$ has no double root.
It follows that $f$ has either $1$ real root, or $3$ real roots: one in $(-\infty,x\_0)$, one in $(x\_0,x\_1)$ and one in $(x\_1,+\infty)... | The solutions of $3c^2-1=0$ are $\pm1/\sqrt{3}$ outside $[1,2]$.
That gives you a contradiction with the assumption that there are two roots inside $[1,2]$. |
2,694,289 | I want to prove that the equation $f(x)=x^3-x-1=0$ has only one real root, which is on the intervall $[1,2]$.
$$$$
I have done the following:
$f(1)=-1<0$ and $f(2)=5>0$ so $f(1)\cdot f(2)<0$ and so from Bolzano's Theorem we have that the function has at least one root on $[1,2]$.
We suppose that there are two r... | 2018/03/16 | [
"https://math.stackexchange.com/questions/2694289",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/80708/"
] | **Without derivative:**
Let $r$ be the root. Then the polynomial factorizes as
$$(x-r)(x^2+rx+r^2-1)$$ and there are other real roots iff
$$\Delta=r^2-4(r^2-1)\ge0,$$
$$|r|\le\frac2{\sqrt3}.$$
But $f\left(\dfrac2{\sqrt3}\right)<0$ implies $r>\dfrac2{\sqrt3}$, a contradiction. | **HINT**
We can observe that
* $f(x)$ is continuous and limits for $x\to \pm \infty$ are $\pm \infty$ thus we have at least one real root
then consider
* $f'(x)=3x^2-1=0\implies x=\pm \frac{\sqrt 3}{3}$ and study max/min
then by IVT you'll be able to prove that $f(x)$ has exactly one root. |
2,694,289 | I want to prove that the equation $f(x)=x^3-x-1=0$ has only one real root, which is on the intervall $[1,2]$.
$$$$
I have done the following:
$f(1)=-1<0$ and $f(2)=5>0$ so $f(1)\cdot f(2)<0$ and so from Bolzano's Theorem we have that the function has at least one root on $[1,2]$.
We suppose that there are two r... | 2018/03/16 | [
"https://math.stackexchange.com/questions/2694289",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/80708/"
] | The derivative $3x^2-1$ has roots $\pm\dfrac{\sqrt 3}3$, and $-
\dfrac{\sqrt 3}3$ corresponds to a local *maximum*, which happens to be $-
\dfrac{2\sqrt 9}3-1<0$. Hence $f(x)\le-\dfrac{2\sqrt 9}3-1$ for $x\le \dfrac{\sqrt 3}3$, then it is monotonically increasing to $+\infty$. Therefore, it has only one (real) root. | One can notice, that $f(1)f(2) = -5 < 0$, so there must be root of the equation. Also $f'(x) = 3x^2 - 1$, so it is monotonically increasing in range [1, 2] - there is only one root.
Next step is to prove that $x^3 < x + 1 $ for $x<1$. For $0 < x < 1$ we have $x + 1 > x > x^3$. For $-1 < x < 0$ following is met: $x + 1... |
2,694,289 | I want to prove that the equation $f(x)=x^3-x-1=0$ has only one real root, which is on the intervall $[1,2]$.
$$$$
I have done the following:
$f(1)=-1<0$ and $f(2)=5>0$ so $f(1)\cdot f(2)<0$ and so from Bolzano's Theorem we have that the function has at least one root on $[1,2]$.
We suppose that there are two r... | 2018/03/16 | [
"https://math.stackexchange.com/questions/2694289",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/80708/"
] | **Without derivative:**
Let $r$ be the root. Then the polynomial factorizes as
$$(x-r)(x^2+rx+r^2-1)$$ and there are other real roots iff
$$\Delta=r^2-4(r^2-1)\ge0,$$
$$|r|\le\frac2{\sqrt3}.$$
But $f\left(\dfrac2{\sqrt3}\right)<0$ implies $r>\dfrac2{\sqrt3}$, a contradiction. | The solutions of $3c^2-1=0$ are $\pm1/\sqrt{3}$ outside $[1,2]$.
That gives you a contradiction with the assumption that there are two roots inside $[1,2]$. |
2,694,289 | I want to prove that the equation $f(x)=x^3-x-1=0$ has only one real root, which is on the intervall $[1,2]$.
$$$$
I have done the following:
$f(1)=-1<0$ and $f(2)=5>0$ so $f(1)\cdot f(2)<0$ and so from Bolzano's Theorem we have that the function has at least one root on $[1,2]$.
We suppose that there are two r... | 2018/03/16 | [
"https://math.stackexchange.com/questions/2694289",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/80708/"
] | **Without derivative:**
Let $r$ be the root. Then the polynomial factorizes as
$$(x-r)(x^2+rx+r^2-1)$$ and there are other real roots iff
$$\Delta=r^2-4(r^2-1)\ge0,$$
$$|r|\le\frac2{\sqrt3}.$$
But $f\left(\dfrac2{\sqrt3}\right)<0$ implies $r>\dfrac2{\sqrt3}$, a contradiction. | One can notice, that $f(1)f(2) = -5 < 0$, so there must be root of the equation. Also $f'(x) = 3x^2 - 1$, so it is monotonically increasing in range [1, 2] - there is only one root.
Next step is to prove that $x^3 < x + 1 $ for $x<1$. For $0 < x < 1$ we have $x + 1 > x > x^3$. For $-1 < x < 0$ following is met: $x + 1... |
2,694,289 | I want to prove that the equation $f(x)=x^3-x-1=0$ has only one real root, which is on the intervall $[1,2]$.
$$$$
I have done the following:
$f(1)=-1<0$ and $f(2)=5>0$ so $f(1)\cdot f(2)<0$ and so from Bolzano's Theorem we have that the function has at least one root on $[1,2]$.
We suppose that there are two r... | 2018/03/16 | [
"https://math.stackexchange.com/questions/2694289",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/80708/"
] | The derivative $3x^2-1$ has roots $\pm\dfrac{\sqrt 3}3$, and $-
\dfrac{\sqrt 3}3$ corresponds to a local *maximum*, which happens to be $-
\dfrac{2\sqrt 9}3-1<0$. Hence $f(x)\le-\dfrac{2\sqrt 9}3-1$ for $x\le \dfrac{\sqrt 3}3$, then it is monotonically increasing to $+\infty$. Therefore, it has only one (real) root. | We have that $f'(x)=3x^2-1$ so $f$ has critical points at $x\_0=-1/\sqrt3$ and $x\_1=1/\sqrt3$.
It's easy to check that these are not roots of $f$, and hence $f$ has no double root.
It follows that $f$ has either $1$ real root, or $3$ real roots: one in $(-\infty,x\_0)$, one in $(x\_0,x\_1)$ and one in $(x\_1,+\infty)... |
2,694,289 | I want to prove that the equation $f(x)=x^3-x-1=0$ has only one real root, which is on the intervall $[1,2]$.
$$$$
I have done the following:
$f(1)=-1<0$ and $f(2)=5>0$ so $f(1)\cdot f(2)<0$ and so from Bolzano's Theorem we have that the function has at least one root on $[1,2]$.
We suppose that there are two r... | 2018/03/16 | [
"https://math.stackexchange.com/questions/2694289",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/80708/"
] | The derivative $3x^2-1$ has roots $\pm\dfrac{\sqrt 3}3$, and $-
\dfrac{\sqrt 3}3$ corresponds to a local *maximum*, which happens to be $-
\dfrac{2\sqrt 9}3-1<0$. Hence $f(x)\le-\dfrac{2\sqrt 9}3-1$ for $x\le \dfrac{\sqrt 3}3$, then it is monotonically increasing to $+\infty$. Therefore, it has only one (real) root. | **HINT**
We can observe that
* $f(x)$ is continuous and limits for $x\to \pm \infty$ are $\pm \infty$ thus we have at least one real root
then consider
* $f'(x)=3x^2-1=0\implies x=\pm \frac{\sqrt 3}{3}$ and study max/min
then by IVT you'll be able to prove that $f(x)$ has exactly one root. |
2,694,289 | I want to prove that the equation $f(x)=x^3-x-1=0$ has only one real root, which is on the intervall $[1,2]$.
$$$$
I have done the following:
$f(1)=-1<0$ and $f(2)=5>0$ so $f(1)\cdot f(2)<0$ and so from Bolzano's Theorem we have that the function has at least one root on $[1,2]$.
We suppose that there are two r... | 2018/03/16 | [
"https://math.stackexchange.com/questions/2694289",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/80708/"
] | One can notice, that $f(1)f(2) = -5 < 0$, so there must be root of the equation. Also $f'(x) = 3x^2 - 1$, so it is monotonically increasing in range [1, 2] - there is only one root.
Next step is to prove that $x^3 < x + 1 $ for $x<1$. For $0 < x < 1$ we have $x + 1 > x > x^3$. For $-1 < x < 0$ following is met: $x + 1... | The solutions of $3c^2-1=0$ are $\pm1/\sqrt{3}$ outside $[1,2]$.
That gives you a contradiction with the assumption that there are two roots inside $[1,2]$. |
2,694,289 | I want to prove that the equation $f(x)=x^3-x-1=0$ has only one real root, which is on the intervall $[1,2]$.
$$$$
I have done the following:
$f(1)=-1<0$ and $f(2)=5>0$ so $f(1)\cdot f(2)<0$ and so from Bolzano's Theorem we have that the function has at least one root on $[1,2]$.
We suppose that there are two r... | 2018/03/16 | [
"https://math.stackexchange.com/questions/2694289",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/80708/"
] | **Without derivative:**
Let $r$ be the root. Then the polynomial factorizes as
$$(x-r)(x^2+rx+r^2-1)$$ and there are other real roots iff
$$\Delta=r^2-4(r^2-1)\ge0,$$
$$|r|\le\frac2{\sqrt3}.$$
But $f\left(\dfrac2{\sqrt3}\right)<0$ implies $r>\dfrac2{\sqrt3}$, a contradiction. | We have that $f'(x)=3x^2-1$ so $f$ has critical points at $x\_0=-1/\sqrt3$ and $x\_1=1/\sqrt3$.
It's easy to check that these are not roots of $f$, and hence $f$ has no double root.
It follows that $f$ has either $1$ real root, or $3$ real roots: one in $(-\infty,x\_0)$, one in $(x\_0,x\_1)$ and one in $(x\_1,+\infty)... |
49,352,559 | How can I replace a NA value by the average of the previous non-NA and next non-NA values?
For example, I want to replace the first NA value by -0.873, and the 4th/5th by the average of -0.497+53.200.
Thanks!
```
t <- c(NA, -0.873, -0.497, NA, NA, 53.200, NA, NA, NA, 26.100)
```
=================== ADD ON ========... | 2018/03/18 | [
"https://Stackoverflow.com/questions/49352559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9513287/"
] | This function imputes values for `NA` in a vector based on the average of the non-`NA` values in a rolling window from the first element to the next element.
```
t <- c(NA, -0.873, -0.497, NA, NA, 53.200, NA, NA, NA, 26.100)
roll_impute <- function(x){
n <- length(x)
res <- x
for (i in seq_along(x)){
... | One `dplyr` and `tidyr` based solution could be:
```
library(dplyr)
library(tidyr)
t <- c(NA, -0.873, -0.497, NA, NA, 53.200, NA, NA, NA, 26.100)
data.frame(t) %>%
mutate(last_nonNA = ifelse(!is.na(t), t, NA)) %>%
mutate(next_nonNA = ifelse(!is.na(t), t, NA)) %>%
fill(last_nonNA) %>%
fill(next... |
49,352,559 | How can I replace a NA value by the average of the previous non-NA and next non-NA values?
For example, I want to replace the first NA value by -0.873, and the 4th/5th by the average of -0.497+53.200.
Thanks!
```
t <- c(NA, -0.873, -0.497, NA, NA, 53.200, NA, NA, NA, 26.100)
```
=================== ADD ON ========... | 2018/03/18 | [
"https://Stackoverflow.com/questions/49352559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9513287/"
] | Here's a possible vectorized approach using base R (some steps could be probably improved but I have no time to look into it right now)
```
x <- c(NA, -0.873, -0.497, NA, NA, 53.200, NA, NA, NA, 26.100)
# Store a boolean vector of NA locaiotns for firther use
na_vals <- is.na(x)
# Find the NAs location compaed to th... | This function imputes values for `NA` in a vector based on the average of the non-`NA` values in a rolling window from the first element to the next element.
```
t <- c(NA, -0.873, -0.497, NA, NA, 53.200, NA, NA, NA, 26.100)
roll_impute <- function(x){
n <- length(x)
res <- x
for (i in seq_along(x)){
... |
49,352,559 | How can I replace a NA value by the average of the previous non-NA and next non-NA values?
For example, I want to replace the first NA value by -0.873, and the 4th/5th by the average of -0.497+53.200.
Thanks!
```
t <- c(NA, -0.873, -0.497, NA, NA, 53.200, NA, NA, NA, 26.100)
```
=================== ADD ON ========... | 2018/03/18 | [
"https://Stackoverflow.com/questions/49352559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9513287/"
] | Here's a possible vectorized approach using base R (some steps could be probably improved but I have no time to look into it right now)
```
x <- c(NA, -0.873, -0.497, NA, NA, 53.200, NA, NA, NA, 26.100)
# Store a boolean vector of NA locaiotns for firther use
na_vals <- is.na(x)
# Find the NAs location compaed to th... | One `dplyr` and `tidyr` based solution could be:
```
library(dplyr)
library(tidyr)
t <- c(NA, -0.873, -0.497, NA, NA, 53.200, NA, NA, NA, 26.100)
data.frame(t) %>%
mutate(last_nonNA = ifelse(!is.na(t), t, NA)) %>%
mutate(next_nonNA = ifelse(!is.na(t), t, NA)) %>%
fill(last_nonNA) %>%
fill(next... |
3,315,760 | I have to use key down event on text box. Code for the event looks like this:
```
Private Sub TextBox1_Keydown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles textBox1.KeyDown
If e.KeyCode = keys.Enter Then
MessageBox.Show("Hello")
End If
End Sub
```
But it gives the foll... | 2010/07/23 | [
"https://Stackoverflow.com/questions/3315760",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/399935/"
] | Function names are not the same in the libs - c++ standard does not define it so both msvc and g++ define them their own way.
Check this post.
[Qt/mingw32 undefined reference errors... unable to link a .lib](https://stackoverflow.com/questions/1137323/qt-mingw32-undefined-reference-errors-unable-to-link-a-lib)
There... | If you are getting an undefined reference error then you haven't linked to the correct library. |
3,315,760 | I have to use key down event on text box. Code for the event looks like this:
```
Private Sub TextBox1_Keydown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles textBox1.KeyDown
If e.KeyCode = keys.Enter Then
MessageBox.Show("Hello")
End If
End Sub
```
But it gives the foll... | 2010/07/23 | [
"https://Stackoverflow.com/questions/3315760",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/399935/"
] | Function names are not the same in the libs - c++ standard does not define it so both msvc and g++ define them their own way.
Check this post.
[Qt/mingw32 undefined reference errors... unable to link a .lib](https://stackoverflow.com/questions/1137323/qt-mingw32-undefined-reference-errors-unable-to-link-a-lib)
There... | You use Qt Creator?
Say you have a lib file named libodbc32.a Then you should add a lib like this:
LIBS += -L [path to the libodbc32.a] -L [path to libsystemc.a] -lodbc32 -lsystemc
So I think you have linked not in an appropriate way. |
2,134,120 | Considering such an enumeration :
```
type
TTypeOfData = (
[XmlName('ABC')] todABC,
[XmlName('DEF')] todDEF,
[XmlName('GHI')] todGHI
);
```
Where XmlName is a custom attribute used to define the serialization string for members of this enumeration.
How can I explore the attributes attached to each... | 2010/01/25 | [
"https://Stackoverflow.com/questions/2134120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/258622/"
] | These is a good overview of RTTI in Delphi 2010 on the web: <http://robstechcorner.blogspot.com/2009/09/so-what-is-rtti-rtti-is-acronym-for-run.html>
You can get the enumeration values and back the ordinals using the "OLD" RTTI functions in the unit TypInfo (GetEnumValue, GetEnumName). And clip off the lowercase lette... | I use and array of string in the const section:
```
type
TTypeOfData = (
todABC,
todDEF,
todGHI
);
const
TypeOfDataText: array[TTypeOfData] of string = (
'ABC',
'DEF',
'GHI'
);
``` |
2,134,120 | Considering such an enumeration :
```
type
TTypeOfData = (
[XmlName('ABC')] todABC,
[XmlName('DEF')] todDEF,
[XmlName('GHI')] todGHI
);
```
Where XmlName is a custom attribute used to define the serialization string for members of this enumeration.
How can I explore the attributes attached to each... | 2010/01/25 | [
"https://Stackoverflow.com/questions/2134120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/258622/"
] | While Barry clearly answered your question regarding the attributes on enum elements, I'll take a stab at another suggestion. From your example, you're prefixing each enum element with 'tod' as is traditional in Delphi because enum elements are global in scope (ie. if you had an identifier todABC in scope in addition t... | These is a good overview of RTTI in Delphi 2010 on the web: <http://robstechcorner.blogspot.com/2009/09/so-what-is-rtti-rtti-is-acronym-for-run.html>
You can get the enumeration values and back the ordinals using the "OLD" RTTI functions in the unit TypInfo (GetEnumValue, GetEnumName). And clip off the lowercase lette... |
2,134,120 | Considering such an enumeration :
```
type
TTypeOfData = (
[XmlName('ABC')] todABC,
[XmlName('DEF')] todDEF,
[XmlName('GHI')] todGHI
);
```
Where XmlName is a custom attribute used to define the serialization string for members of this enumeration.
How can I explore the attributes attached to each... | 2010/01/25 | [
"https://Stackoverflow.com/questions/2134120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/258622/"
] | These is a good overview of RTTI in Delphi 2010 on the web: <http://robstechcorner.blogspot.com/2009/09/so-what-is-rtti-rtti-is-acronym-for-run.html>
You can get the enumeration values and back the ordinals using the "OLD" RTTI functions in the unit TypInfo (GetEnumValue, GetEnumName). And clip off the lowercase lette... | For those who are interrested in a practical solution to that problem, I solved it that way :
```
type
TTypeOfData = (todABC, todDEF, todGHI);
TMySerializableClass = class
private
FType: TTypeOfData;
public
property &Type: TTypeOfData read FType write FType;
class function TypeOfDataAsString(&Type... |
2,134,120 | Considering such an enumeration :
```
type
TTypeOfData = (
[XmlName('ABC')] todABC,
[XmlName('DEF')] todDEF,
[XmlName('GHI')] todGHI
);
```
Where XmlName is a custom attribute used to define the serialization string for members of this enumeration.
How can I explore the attributes attached to each... | 2010/01/25 | [
"https://Stackoverflow.com/questions/2134120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/258622/"
] | Attributes associated with elements in enumerations are not currently stored in Win32 RTTI data in the executable. RTTI is already responsible for a fair increase in the size of executables, so some lines had to be drawn somewhere. Attributes in Delphi Win32 are supported on types, on fields of records, and fields, met... | While Barry clearly answered your question regarding the attributes on enum elements, I'll take a stab at another suggestion. From your example, you're prefixing each enum element with 'tod' as is traditional in Delphi because enum elements are global in scope (ie. if you had an identifier todABC in scope in addition t... |
2,134,120 | Considering such an enumeration :
```
type
TTypeOfData = (
[XmlName('ABC')] todABC,
[XmlName('DEF')] todDEF,
[XmlName('GHI')] todGHI
);
```
Where XmlName is a custom attribute used to define the serialization string for members of this enumeration.
How can I explore the attributes attached to each... | 2010/01/25 | [
"https://Stackoverflow.com/questions/2134120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/258622/"
] | Attributes associated with elements in enumerations are not currently stored in Win32 RTTI data in the executable. RTTI is already responsible for a fair increase in the size of executables, so some lines had to be drawn somewhere. Attributes in Delphi Win32 are supported on types, on fields of records, and fields, met... | These is a good overview of RTTI in Delphi 2010 on the web: <http://robstechcorner.blogspot.com/2009/09/so-what-is-rtti-rtti-is-acronym-for-run.html>
You can get the enumeration values and back the ordinals using the "OLD" RTTI functions in the unit TypInfo (GetEnumValue, GetEnumName). And clip off the lowercase lette... |
2,134,120 | Considering such an enumeration :
```
type
TTypeOfData = (
[XmlName('ABC')] todABC,
[XmlName('DEF')] todDEF,
[XmlName('GHI')] todGHI
);
```
Where XmlName is a custom attribute used to define the serialization string for members of this enumeration.
How can I explore the attributes attached to each... | 2010/01/25 | [
"https://Stackoverflow.com/questions/2134120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/258622/"
] | Ok I think I have found a better solution. I declare a new attribute type, e.g.:
```
TEnumAttribute = class (TCustomAttribute)
private
FCaption : string;
public
constructor Create (const Caption : string);
property Caption : string read FCaption write FCaption;
end;
```
Now I add attributes to my en... | I use and array of string in the const section:
```
type
TTypeOfData = (
todABC,
todDEF,
todGHI
);
const
TypeOfDataText: array[TTypeOfData] of string = (
'ABC',
'DEF',
'GHI'
);
``` |
2,134,120 | Considering such an enumeration :
```
type
TTypeOfData = (
[XmlName('ABC')] todABC,
[XmlName('DEF')] todDEF,
[XmlName('GHI')] todGHI
);
```
Where XmlName is a custom attribute used to define the serialization string for members of this enumeration.
How can I explore the attributes attached to each... | 2010/01/25 | [
"https://Stackoverflow.com/questions/2134120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/258622/"
] | Attributes associated with elements in enumerations are not currently stored in Win32 RTTI data in the executable. RTTI is already responsible for a fair increase in the size of executables, so some lines had to be drawn somewhere. Attributes in Delphi Win32 are supported on types, on fields of records, and fields, met... | I use and array of string in the const section:
```
type
TTypeOfData = (
todABC,
todDEF,
todGHI
);
const
TypeOfDataText: array[TTypeOfData] of string = (
'ABC',
'DEF',
'GHI'
);
``` |
2,134,120 | Considering such an enumeration :
```
type
TTypeOfData = (
[XmlName('ABC')] todABC,
[XmlName('DEF')] todDEF,
[XmlName('GHI')] todGHI
);
```
Where XmlName is a custom attribute used to define the serialization string for members of this enumeration.
How can I explore the attributes attached to each... | 2010/01/25 | [
"https://Stackoverflow.com/questions/2134120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/258622/"
] | Ok I think I have found a better solution. I declare a new attribute type, e.g.:
```
TEnumAttribute = class (TCustomAttribute)
private
FCaption : string;
public
constructor Create (const Caption : string);
property Caption : string read FCaption write FCaption;
end;
```
Now I add attributes to my en... | For those who are interrested in a practical solution to that problem, I solved it that way :
```
type
TTypeOfData = (todABC, todDEF, todGHI);
TMySerializableClass = class
private
FType: TTypeOfData;
public
property &Type: TTypeOfData read FType write FType;
class function TypeOfDataAsString(&Type... |
2,134,120 | Considering such an enumeration :
```
type
TTypeOfData = (
[XmlName('ABC')] todABC,
[XmlName('DEF')] todDEF,
[XmlName('GHI')] todGHI
);
```
Where XmlName is a custom attribute used to define the serialization string for members of this enumeration.
How can I explore the attributes attached to each... | 2010/01/25 | [
"https://Stackoverflow.com/questions/2134120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/258622/"
] | While Barry clearly answered your question regarding the attributes on enum elements, I'll take a stab at another suggestion. From your example, you're prefixing each enum element with 'tod' as is traditional in Delphi because enum elements are global in scope (ie. if you had an identifier todABC in scope in addition t... | Ok I think I have found a better solution. I declare a new attribute type, e.g.:
```
TEnumAttribute = class (TCustomAttribute)
private
FCaption : string;
public
constructor Create (const Caption : string);
property Caption : string read FCaption write FCaption;
end;
```
Now I add attributes to my en... |
2,134,120 | Considering such an enumeration :
```
type
TTypeOfData = (
[XmlName('ABC')] todABC,
[XmlName('DEF')] todDEF,
[XmlName('GHI')] todGHI
);
```
Where XmlName is a custom attribute used to define the serialization string for members of this enumeration.
How can I explore the attributes attached to each... | 2010/01/25 | [
"https://Stackoverflow.com/questions/2134120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/258622/"
] | For those who are interrested in a practical solution to that problem, I solved it that way :
```
type
TTypeOfData = (todABC, todDEF, todGHI);
TMySerializableClass = class
private
FType: TTypeOfData;
public
property &Type: TTypeOfData read FType write FType;
class function TypeOfDataAsString(&Type... | I use and array of string in the const section:
```
type
TTypeOfData = (
todABC,
todDEF,
todGHI
);
const
TypeOfDataText: array[TTypeOfData] of string = (
'ABC',
'DEF',
'GHI'
);
``` |
36,628,862 | Can anyone please help to solve the edittext label floating issue, As per my requirement the hint text should be there in editbox itself when error text is displayed. Right now what is happening that whenever I show the error text the label also moving, i don't want to move the labeluntil and unless user start typing
... | 2016/04/14 | [
"https://Stackoverflow.com/questions/36628862",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/487219/"
] | Say you read a row from a CSV:
```
from StringIO import StringIO
import csv
infile = StringIO('hello,"foo, bar"')
reader = csv.reader(infile)
row = reader.next() # row is ['hello', 'foo, bar']
```
The second value in the row is `foo, bar` instead of `"foo, bar"`. This isn't some Python oddity, it's a reasonable in... | Alright so this took a long time to get a solution and it is in no way pretty, but:
```
>>> import re
>>> s = 'hello,"foo, bar"'
>>>
>>> replacements = {}
>>> m = re.search("\".*\"", s)
>>> while m:
... key = 'unique_phrase_' + str(len(replacements))
... replacements[key] = s[m.span()[0]:m.span()[1]]
... ... |
36,628,862 | Can anyone please help to solve the edittext label floating issue, As per my requirement the hint text should be there in editbox itself when error text is displayed. Right now what is happening that whenever I show the error text the label also moving, i don't want to move the labeluntil and unless user start typing
... | 2016/04/14 | [
"https://Stackoverflow.com/questions/36628862",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/487219/"
] | Kinda depends upon you Use Case. If the only "s are there for values containing commas (e.g. "foo,bar"), then you can use CSV writer to put them back in.
```
import io
import csv
infile = io.StringIO('hello,"foo, bar"')
outfile = io.StringIO()
reader = csv.reader(infile)
for row in reader:
inList = row
break
... | Alright so this took a long time to get a solution and it is in no way pretty, but:
```
>>> import re
>>> s = 'hello,"foo, bar"'
>>>
>>> replacements = {}
>>> m = re.search("\".*\"", s)
>>> while m:
... key = 'unique_phrase_' + str(len(replacements))
... replacements[key] = s[m.span()[0]:m.span()[1]]
... ... |
36,628,862 | Can anyone please help to solve the edittext label floating issue, As per my requirement the hint text should be there in editbox itself when error text is displayed. Right now what is happening that whenever I show the error text the label also moving, i don't want to move the labeluntil and unless user start typing
... | 2016/04/14 | [
"https://Stackoverflow.com/questions/36628862",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/487219/"
] | Say you read a row from a CSV:
```
from StringIO import StringIO
import csv
infile = StringIO('hello,"foo, bar"')
reader = csv.reader(infile)
row = reader.next() # row is ['hello', 'foo, bar']
```
The second value in the row is `foo, bar` instead of `"foo, bar"`. This isn't some Python oddity, it's a reasonable in... | A little late to the party but in the CSV library there's [quoting](https://docs.python.org/2/library/csv.html#csv.Dialect.quoting) which should do what you want (set to QUOTE\_NONE) |
36,628,862 | Can anyone please help to solve the edittext label floating issue, As per my requirement the hint text should be there in editbox itself when error text is displayed. Right now what is happening that whenever I show the error text the label also moving, i don't want to move the labeluntil and unless user start typing
... | 2016/04/14 | [
"https://Stackoverflow.com/questions/36628862",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/487219/"
] | Kinda depends upon you Use Case. If the only "s are there for values containing commas (e.g. "foo,bar"), then you can use CSV writer to put them back in.
```
import io
import csv
infile = io.StringIO('hello,"foo, bar"')
outfile = io.StringIO()
reader = csv.reader(infile)
for row in reader:
inList = row
break
... | A little late to the party but in the CSV library there's [quoting](https://docs.python.org/2/library/csv.html#csv.Dialect.quoting) which should do what you want (set to QUOTE\_NONE) |
36,628,862 | Can anyone please help to solve the edittext label floating issue, As per my requirement the hint text should be there in editbox itself when error text is displayed. Right now what is happening that whenever I show the error text the label also moving, i don't want to move the labeluntil and unless user start typing
... | 2016/04/14 | [
"https://Stackoverflow.com/questions/36628862",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/487219/"
] | Say you read a row from a CSV:
```
from StringIO import StringIO
import csv
infile = StringIO('hello,"foo, bar"')
reader = csv.reader(infile)
row = reader.next() # row is ['hello', 'foo, bar']
```
The second value in the row is `foo, bar` instead of `"foo, bar"`. This isn't some Python oddity, it's a reasonable in... | Kinda depends upon you Use Case. If the only "s are there for values containing commas (e.g. "foo,bar"), then you can use CSV writer to put them back in.
```
import io
import csv
infile = io.StringIO('hello,"foo, bar"')
outfile = io.StringIO()
reader = csv.reader(infile)
for row in reader:
inList = row
break
... |
39,658,219 | I have a query which is pretty that contains `LEFT JOIN` subquery. It takes 20 minutes to load completely.
Here is my query:
```
UPDATE orders AS o
LEFT JOIN (
SELECT obe_order_master_id, COUNT(id) AS count_files, id, added
FROM customer_instalments
GROUP BY obe_order_master_id
) AS oci ON oci.obe_order... | 2016/09/23 | [
"https://Stackoverflow.com/questions/39658219",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1626398/"
] | Move `Where` condition in Temp Table and replace `WHERE` with `HAVING` Clause, this will eliminate unnecessary rows from temp table so reduce the filtering and may help to improve performance
```
UPDATE orders AS o
LEFT JOIN (
SELECT obe_order_master_id, id, added
FROM customer_instalments
GROUP BY obe_orde... | I would suggest to create separate column for Order\_id substring and make index on it. Then use this column in WHERE. |
12,841,925 | When I test a perl script under linux and use `time sh -c` to measure the time spent, I got a weird result:
```
real 14m11.903s
user 34m39.319s
sys 16m54.074s
```
which means the real time spent is even less than user time. And visually counting the time by myself, the script didn't spent as much as 34 min... | 2012/10/11 | [
"https://Stackoverflow.com/questions/12841925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1354285/"
] | The script could have used more than 1 core. | The user line is showing the total CPU time that the process used directly. If your process has more than one thread and your cpu has more than one core then you may use more CPU time than wall clock time. |
27,630,975 | I need help in displaying the output of a rails helper method inside the script tags in the application.html.erb layout file.
I put the following code just before the closing html tag:
```
<script>
App.ready = function() {
App.initApp(jQuery.parseJSON("<%= current_user_json %>"));
}
</script>
```
Thi... | 2014/12/24 | [
"https://Stackoverflow.com/questions/27630975",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3746444/"
] | If the filename is `BX-Book-Ratings.csv` then you need to use that instead of `BX-Book-Ratings:` in the command line. This is not a `sed` error, it's a problem from your shell. | Why do you use so many pipes? What about such approach:
```
sed 's/\&\;/\&/g;1d;s/;/$$$/g;s/"$$$"/";"/g;s/"//g' BX-Book-Ratings.csv > corrected_rating
```
Or if you want to store the result to a variable do it like this:
```
var=$(sed 's/\&\;/\&/g;1d;s/;/$$$/g;s/"$$$"/";"/g;s/"//g' BX-Book-Ratings.csv)
``` |
72,429,276 | I am trying to create a form in vuejs, where a group of inputs can be append onclick. It works fine, but the problem is, All inputs return the same value. I am sharing an image here :
[](https://i.stack.imgur.com/bmv1Y.png)
I am sharing my code from ... | 2022/05/30 | [
"https://Stackoverflow.com/questions/72429276",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13754248/"
] | It's incorrect, you can't use single name for same columns,
```
'e.code as branch_code',
'e.id as branch_code',
```
change to
```
'e.code as branch_code',
'e.id as branch_id',
``` | go to config/database.php
strict set false |
236,157 | Lean is a theorem prover and programming language. It's also as of writing the [Language of the Month](https://codegolf.meta.stackexchange.com/q/23916/56656)!
What tips do people have for golfing in Lean? As always, tips should be specific to to Lean (e.g. "Remove comments" is not an answer), and stick to a single tip... | 2021/10/08 | [
"https://codegolf.stackexchange.com/questions/236157",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/56656/"
] | Introductions
=============
If you've just finished the natural number game you may be familiar with the `intro` tactic, this can be used to create implications / functions. However this tactic is rarely the golfiest.
If your intro is the first part of your proof then an implicit forall is probably better. Compare:
... | Use `by` instead of `begin ... end`
-----------------------------------
`by` can be shorter than `begin` and `end`.
```
def foo(m:ℕ):m=m:=begin refl,end
```
is longer than
```
def bar(m:ℕ):m=m :=by refl
```
You can also use it for multiple tactics, though you'll need to encase the tactics in braces, as Wheat Wiz... |
236,157 | Lean is a theorem prover and programming language. It's also as of writing the [Language of the Month](https://codegolf.meta.stackexchange.com/q/23916/56656)!
What tips do people have for golfing in Lean? As always, tips should be specific to to Lean (e.g. "Remove comments" is not an answer), and stick to a single tip... | 2021/10/08 | [
"https://codegolf.stackexchange.com/questions/236157",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/56656/"
] | Introductions
=============
If you've just finished the natural number game you may be familiar with the `intro` tactic, this can be used to create implications / functions. However this tactic is rarely the golfiest.
If your intro is the first part of your proof then an implicit forall is probably better. Compare:
... | The `;` and `<|>` combinators.
------------------------------
`;` makes it so that all subgoals created by the last tactic have the next tactic applied; for example, `lemma asda (n : ℕ) : n = n := by { induction n; refl }` is a valid proof. As a bonus, it also allows you to not use the braces (e.g. `def k(n:ℕ):n=n:=by... |
2,219,216 | The question is:
>
> Find the vector equation of the line with Cartesian equation:
>
>
> $$5x + 1 = -10y - 4 = 2z$$
>
>
>
I know the vector equation of a line is $\textbf{r} × \textbf{v} = \textbf{a} × \textbf{v}$,
where $\textbf{r}$ is the position vector of a point on the line, $\textbf{a}$ is a fixed point o... | 2017/04/05 | [
"https://math.stackexchange.com/questions/2219216",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | u-substitution!
Let $u=(x+5)^{1/2}$ so that $du=\frac{1}{2\sqrt{x+5}}dx$, or $2udu=dx$. Then your integral is given by
\begin{align\*}
I&=3\int (u^2-5)u2udu\\
&=6\int u^4-5u^2du\\
&=\frac{6}{5}u^5-10u^2+C\\
&=\frac{6}{5}(x+5)^{\frac{5}{2}}-10(x+5)^\frac{3}{2}+C
\end{align\*} | **Hint**: rationalize by taking $u = \sqrt{x+5}$.
Alternatively, and perhaps even simpler:
$$x\sqrt{x+5} = \left(x+5-5\right)\sqrt{x+5} = \left(x+5\right)^{3/2}-5\left(x+5\right)^{1/2}$$
So:
$$\int x\sqrt{x+5} \,\mbox{d}x = \int \left(x+5\right)^{3/2} \,\mbox{d}x -5\int \left(x+5\right)^{1/2} \,\mbox{d}x = \ldots$$ |
2,219,216 | The question is:
>
> Find the vector equation of the line with Cartesian equation:
>
>
> $$5x + 1 = -10y - 4 = 2z$$
>
>
>
I know the vector equation of a line is $\textbf{r} × \textbf{v} = \textbf{a} × \textbf{v}$,
where $\textbf{r}$ is the position vector of a point on the line, $\textbf{a}$ is a fixed point o... | 2017/04/05 | [
"https://math.stackexchange.com/questions/2219216",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Set $u=x+5$, so the integrand becomes $3(u-5)\sqrt{u} = 3u^{3/2}-15u^{1/2}.$ (And here $dx=du$.) In general, square roots and addition don't get along well together, so when you see $\sqrt{a\pm b}$, you can make the difficulty go away by substituting $u=a \pm b.$ | **Hint**: rationalize by taking $u = \sqrt{x+5}$.
Alternatively, and perhaps even simpler:
$$x\sqrt{x+5} = \left(x+5-5\right)\sqrt{x+5} = \left(x+5\right)^{3/2}-5\left(x+5\right)^{1/2}$$
So:
$$\int x\sqrt{x+5} \,\mbox{d}x = \int \left(x+5\right)^{3/2} \,\mbox{d}x -5\int \left(x+5\right)^{1/2} \,\mbox{d}x = \ldots$$ |
2,219,216 | The question is:
>
> Find the vector equation of the line with Cartesian equation:
>
>
> $$5x + 1 = -10y - 4 = 2z$$
>
>
>
I know the vector equation of a line is $\textbf{r} × \textbf{v} = \textbf{a} × \textbf{v}$,
where $\textbf{r}$ is the position vector of a point on the line, $\textbf{a}$ is a fixed point o... | 2017/04/05 | [
"https://math.stackexchange.com/questions/2219216",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | u-substitution!
Let $u=(x+5)^{1/2}$ so that $du=\frac{1}{2\sqrt{x+5}}dx$, or $2udu=dx$. Then your integral is given by
\begin{align\*}
I&=3\int (u^2-5)u2udu\\
&=6\int u^4-5u^2du\\
&=\frac{6}{5}u^5-10u^2+C\\
&=\frac{6}{5}(x+5)^{\frac{5}{2}}-10(x+5)^\frac{3}{2}+C
\end{align\*} | Hint : Take $x+5=t^2$. Then the integral reduces to $$3\int (t^2-5)t 2t dt=6\int t^4-5t^2 $$ |
2,219,216 | The question is:
>
> Find the vector equation of the line with Cartesian equation:
>
>
> $$5x + 1 = -10y - 4 = 2z$$
>
>
>
I know the vector equation of a line is $\textbf{r} × \textbf{v} = \textbf{a} × \textbf{v}$,
where $\textbf{r}$ is the position vector of a point on the line, $\textbf{a}$ is a fixed point o... | 2017/04/05 | [
"https://math.stackexchange.com/questions/2219216",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Set $u=x+5$, so the integrand becomes $3(u-5)\sqrt{u} = 3u^{3/2}-15u^{1/2}.$ (And here $dx=du$.) In general, square roots and addition don't get along well together, so when you see $\sqrt{a\pm b}$, you can make the difficulty go away by substituting $u=a \pm b.$ | Hint : Take $x+5=t^2$. Then the integral reduces to $$3\int (t^2-5)t 2t dt=6\int t^4-5t^2 $$ |
2,219,216 | The question is:
>
> Find the vector equation of the line with Cartesian equation:
>
>
> $$5x + 1 = -10y - 4 = 2z$$
>
>
>
I know the vector equation of a line is $\textbf{r} × \textbf{v} = \textbf{a} × \textbf{v}$,
where $\textbf{r}$ is the position vector of a point on the line, $\textbf{a}$ is a fixed point o... | 2017/04/05 | [
"https://math.stackexchange.com/questions/2219216",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | u-substitution!
Let $u=(x+5)^{1/2}$ so that $du=\frac{1}{2\sqrt{x+5}}dx$, or $2udu=dx$. Then your integral is given by
\begin{align\*}
I&=3\int (u^2-5)u2udu\\
&=6\int u^4-5u^2du\\
&=\frac{6}{5}u^5-10u^2+C\\
&=\frac{6}{5}(x+5)^{\frac{5}{2}}-10(x+5)^\frac{3}{2}+C
\end{align\*} | Set $u=x+5$, so the integrand becomes $3(u-5)\sqrt{u} = 3u^{3/2}-15u^{1/2}.$ (And here $dx=du$.) In general, square roots and addition don't get along well together, so when you see $\sqrt{a\pm b}$, you can make the difficulty go away by substituting $u=a \pm b.$ |
2,219,216 | The question is:
>
> Find the vector equation of the line with Cartesian equation:
>
>
> $$5x + 1 = -10y - 4 = 2z$$
>
>
>
I know the vector equation of a line is $\textbf{r} × \textbf{v} = \textbf{a} × \textbf{v}$,
where $\textbf{r}$ is the position vector of a point on the line, $\textbf{a}$ is a fixed point o... | 2017/04/05 | [
"https://math.stackexchange.com/questions/2219216",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | u-substitution!
Let $u=(x+5)^{1/2}$ so that $du=\frac{1}{2\sqrt{x+5}}dx$, or $2udu=dx$. Then your integral is given by
\begin{align\*}
I&=3\int (u^2-5)u2udu\\
&=6\int u^4-5u^2du\\
&=\frac{6}{5}u^5-10u^2+C\\
&=\frac{6}{5}(x+5)^{\frac{5}{2}}-10(x+5)^\frac{3}{2}+C
\end{align\*} | Or it can be used the integration by parts:
$u = x, dv=\sqrt{x+5}dx \Rightarrow du=dx,v=\frac{2}{3}(x+5)^{\frac{3}{2}}.$
$\int 3x\sqrt{x+5}dx=3\left[x\cdot\frac{2}{3}(x+5)^{\frac{3}{2}}-\int\frac{2}{3}(x+5)^{\frac{3}{2}}dx \right]=2x(x+5)^{\frac{3}{2}}-\frac{4}{5}(x+5)^{\frac{5}{2}}+C=\frac{2}{5}(x+5)^{\frac{3}{2}}(... |
2,219,216 | The question is:
>
> Find the vector equation of the line with Cartesian equation:
>
>
> $$5x + 1 = -10y - 4 = 2z$$
>
>
>
I know the vector equation of a line is $\textbf{r} × \textbf{v} = \textbf{a} × \textbf{v}$,
where $\textbf{r}$ is the position vector of a point on the line, $\textbf{a}$ is a fixed point o... | 2017/04/05 | [
"https://math.stackexchange.com/questions/2219216",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Set $u=x+5$, so the integrand becomes $3(u-5)\sqrt{u} = 3u^{3/2}-15u^{1/2}.$ (And here $dx=du$.) In general, square roots and addition don't get along well together, so when you see $\sqrt{a\pm b}$, you can make the difficulty go away by substituting $u=a \pm b.$ | Or it can be used the integration by parts:
$u = x, dv=\sqrt{x+5}dx \Rightarrow du=dx,v=\frac{2}{3}(x+5)^{\frac{3}{2}}.$
$\int 3x\sqrt{x+5}dx=3\left[x\cdot\frac{2}{3}(x+5)^{\frac{3}{2}}-\int\frac{2}{3}(x+5)^{\frac{3}{2}}dx \right]=2x(x+5)^{\frac{3}{2}}-\frac{4}{5}(x+5)^{\frac{5}{2}}+C=\frac{2}{5}(x+5)^{\frac{3}{2}}(... |
3,981,419 | Let $f:\mathbb{Z}\_{>0} \rightarrow \mathbb{C}$ be a function. Now require $f$ to satisfy the condition
$$
|f(n)|\leq n^{o(1)}
$$
where $o(1)$ is any function $g(n)$ satisfy $\frac{g(n)}{1}\rightarrow 0$ as $n\rightarrow\infty$.
Can someone give some example of such $f(n)$ besides constant functions? | 2021/01/11 | [
"https://math.stackexchange.com/questions/3981419",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/813593/"
] | It's a Monday afternoon, so let's have some fun:
Let's start with the assumption that there is a set $S = \{e, a, b, c\}$ with binary operation $\*$ having Cayley table:
$$\begin{array} {|r|r|}\hline \cdot & e & a & b & c \\ \hline e & e & a & b & c \\ \hline a & a & e & c & b \\ \hline b & b & c & e & a \\ \hline c &... | Thank you all for your help! I will post here my final answer:
First, we'll write down the Cayley Table:
$\begin{array} {|r|r|}\hline \* & e & a & b & c \\ \hline e & e & a & b & c \\ \hline a & a & e & c & b \\ \hline b & b & c & e & a \\ \hline c & c & b & a & e \\ \hline \end{array}$
From the symmetry along the ma... |
3,981,419 | Let $f:\mathbb{Z}\_{>0} \rightarrow \mathbb{C}$ be a function. Now require $f$ to satisfy the condition
$$
|f(n)|\leq n^{o(1)}
$$
where $o(1)$ is any function $g(n)$ satisfy $\frac{g(n)}{1}\rightarrow 0$ as $n\rightarrow\infty$.
Can someone give some example of such $f(n)$ besides constant functions? | 2021/01/11 | [
"https://math.stackexchange.com/questions/3981419",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/813593/"
] | Using the $K\_4$ properties:
: elements are self-inverse
: operation is commutative
Consider $x,y,z \in K\_4$, not necessarily distinct. We ask if $x\cdot (y \cdot z) = (x\cdot y) \cdot z$.
If any of $x,y,z$ is the identity, the equality is immediately true.
If $x,y,z$ are distinct, the result is the identity ... | Thank you all for your help! I will post here my final answer:
First, we'll write down the Cayley Table:
$\begin{array} {|r|r|}\hline \* & e & a & b & c \\ \hline e & e & a & b & c \\ \hline a & a & e & c & b \\ \hline b & b & c & e & a \\ \hline c & c & b & a & e \\ \hline \end{array}$
From the symmetry along the ma... |
53,345,594 | I'm hoping to groupby users and find the first two uploads. I've figured out how to get the first date via minimum, but I'm having trouble getting that second upload date. Then would like to get the average time between the two upload dates for all users.
df:
```
Date_Uploaded User_ID Display_Status
2018-10-27 ... | 2018/11/16 | [
"https://Stackoverflow.com/questions/53345594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9712631/"
] | Using `sort_values` + `head`
```
df.sort_values('Date_Uploaded').groupby('User_ID').head(2)
Out[152]:
Date_Uploaded User_ID Display_Status
6 2018-07-25 efg123 Pending
5 2018-08-01 efg123 Pending
3 2018-09-21 abc123 Pending
0 2018-10-27 abc123 Cleared
``` | `sort`, calculate the difference and then `groupby` + `nth(1)` to get the difference between the first uploads, if it exists (users with 1 date will not show up).
```
import pandas as pd
df['Date_Uploaded'] = pd.to_datetime(df.Date_Uploaded)
df = df.sort_values(['User_ID', 'Date_Uploaded'])
df.Date_Uploaded.diff().g... |
53,345,594 | I'm hoping to groupby users and find the first two uploads. I've figured out how to get the first date via minimum, but I'm having trouble getting that second upload date. Then would like to get the average time between the two upload dates for all users.
df:
```
Date_Uploaded User_ID Display_Status
2018-10-27 ... | 2018/11/16 | [
"https://Stackoverflow.com/questions/53345594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9712631/"
] | Using `sort_values` + `head`
```
df.sort_values('Date_Uploaded').groupby('User_ID').head(2)
Out[152]:
Date_Uploaded User_ID Display_Status
6 2018-07-25 efg123 Pending
5 2018-08-01 efg123 Pending
3 2018-09-21 abc123 Pending
0 2018-10-27 abc123 Cleared
``` | Since the other answers explain pretty well how to achieve this, I'll give you a one-liner for a change
```
In [1]: df.groupby('User_ID').apply(lambda g: g.sort_values('Date_Uploaded')['Date_Uploaded'][:2].diff()).mean()
Out[1]: Timedelta('21 days 12:00:00')
``` |
61,916,754 | During request GET in Postman (<https://localhost:9001/test>)
I've received an error:
*Error: write EPROTO 8768:error:1408F10B:SSL **routines:ssl3\_get\_record:wrong version number**:c:\users\administrator\buildkite-agent\builds\pm-electron\postman\electron-release\vendor\node\deps\openssl\openssl\ssl\record\ssl3\_rec... | 2020/05/20 | [
"https://Stackoverflow.com/questions/61916754",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6730856/"
] | For Localhost we don't really need https, please try with <http://localhost:9001/test> | the reason was in an incorrect link.
In the controller I have used
@RequestMapping(value="/{baseSiteId}/test")
And this {baseSiteId} was not what I expected. |
61,916,754 | During request GET in Postman (<https://localhost:9001/test>)
I've received an error:
*Error: write EPROTO 8768:error:1408F10B:SSL **routines:ssl3\_get\_record:wrong version number**:c:\users\administrator\buildkite-agent\builds\pm-electron\postman\electron-release\vendor\node\deps\openssl\openssl\ssl\record\ssl3\_rec... | 2020/05/20 | [
"https://Stackoverflow.com/questions/61916754",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6730856/"
] | ```
const transporter = nodemailer.createTransport({
host:'smtp.gmail.com',
port:587,
secure:false,
requireTLC:true,
auth: {
user:'youmail@gmail.com',
pass:'youpass'
}
}
```
Notice that `secure:` is `false`.
The error occurs when `secure:` is `true`. | the reason was in an incorrect link.
In the controller I have used
@RequestMapping(value="/{baseSiteId}/test")
And this {baseSiteId} was not what I expected. |
61,916,754 | During request GET in Postman (<https://localhost:9001/test>)
I've received an error:
*Error: write EPROTO 8768:error:1408F10B:SSL **routines:ssl3\_get\_record:wrong version number**:c:\users\administrator\buildkite-agent\builds\pm-electron\postman\electron-release\vendor\node\deps\openssl\openssl\ssl\record\ssl3\_rec... | 2020/05/20 | [
"https://Stackoverflow.com/questions/61916754",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6730856/"
] | check that you are using the `HTTP` protocol not `HTTPS` to send requests to the server:
### example
```js
export const config = {
baseUrl: "http://localhost:4000"
}
``` | the reason was in an incorrect link.
In the controller I have used
@RequestMapping(value="/{baseSiteId}/test")
And this {baseSiteId} was not what I expected. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.