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 |
|---|---|---|---|---|---|
226,609 | The goal of this challenge is to generalise the bitwise XOR function to other bases. Given two non-negative integers \$ x \$ and \$ y \$, and another integer \$ b \$ such that \$ b \geq 2 \$, write a program/function which computes the generalised XOR, described the following algorithm:
1. First, find the base \$ b \$... | 2021/06/01 | [
"https://codegolf.stackexchange.com/questions/226609",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/96156/"
] | [Jelly](https://github.com/DennisMitchell/jelly), 7 bytes
=========================================================
```
bUSN%Uḅ
```
[Try it online!](https://tio.run/##y0rNyan8/z8pNNhPNfThjtb/D3euOrzcQfP//2gjc0MjHQUTA2MdBWODWB2FaCMTC0NTHQWIOFTIXEfB0AQoBuKYgGRNTYGEIVjSAMSAcUAsOMcUaAAIQ3gmQJaZBVyhoYkZkG8GVGxiFAsA "Jell... | [R](https://www.r-project.org/), ~~57~~ 53 bytes
================================================
```r
f=function(x,b)"if"(any(x),-sum(x)%%b+f(x%/%b,b)*b,0)
```
[Try it online!](https://tio.run/##fc/BDsIgDAbgu0/RaEhAMQIDNg/zXWQJyQ5uyXQJPv0sG6jz4AnC97e0wxT6oZ587ceuebR9RwN3bNv6Lb12TxoYP97HG56EuIOngZyIw8DeccFiKW2oKqXio... |
226,609 | The goal of this challenge is to generalise the bitwise XOR function to other bases. Given two non-negative integers \$ x \$ and \$ y \$, and another integer \$ b \$ such that \$ b \geq 2 \$, write a program/function which computes the generalised XOR, described the following algorithm:
1. First, find the base \$ b \$... | 2021/06/01 | [
"https://codegolf.stackexchange.com/questions/226609",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/96156/"
] | [C (gcc)](https://gcc.gnu.org/), ~~65~~ ~~47~~ 45 bytes
=======================================================
No bytes added or saved but thanks for a bug fix by [Chris Bouchard](https://codegolf.stackexchange.com/users/45870/chris-bouchard)!!!
```c
f(x,y,b){x=x+y?~-b*(x+y)%b+b*f(x/b,y/b,b):0;}
```
[Try it online... | [05AB1E](https://github.com/Adriandmen/05AB1E), 11 bytes
========================================================
Last 5 bytes very similar to the [Vyxal answer](https://codegolf.stackexchange.com/a/226610/64121) ;)
```
вí0ζO(¹%R¹β
```
[Try it online!](https://tio.run/##ASkA1v9vc2FiaWX//9Cyw60wzrZPKMK5JVLCuc6y//8zM... |
226,609 | The goal of this challenge is to generalise the bitwise XOR function to other bases. Given two non-negative integers \$ x \$ and \$ y \$, and another integer \$ b \$ such that \$ b \geq 2 \$, write a program/function which computes the generalised XOR, described the following algorithm:
1. First, find the base \$ b \$... | 2021/06/01 | [
"https://codegolf.stackexchange.com/questions/226609",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/96156/"
] | [J](http://jsoftware.com/), 16 bytes
====================================
```
[#.[|[:-@+/#.inv
```
[Try it online!](https://tio.run/##XY0/C8IwEMV3P8XDDkW0MZdeYg0UBMHJyTWjWKqDbk5@93hpagvC/eP33t094lKVHVqPEhtoeMlK4Xg5n2IoVPgEXx3W20Ldn@@4Wtyu/QuGG7JoUWt0MDsyYF1nSYZJGFxJHrdIFDNsgDgzYi2Qkp3FbK3NfD9hLe2fSRmZ@yFrJDKbLxq4Zma... | [05AB1E](https://github.com/Adriandmen/05AB1E), 11 bytes
========================================================
Last 5 bytes very similar to the [Vyxal answer](https://codegolf.stackexchange.com/a/226610/64121) ;)
```
вí0ζO(¹%R¹β
```
[Try it online!](https://tio.run/##ASkA1v9vc2FiaWX//9Cyw60wzrZPKMK5JVLCuc6y//8zM... |
226,609 | The goal of this challenge is to generalise the bitwise XOR function to other bases. Given two non-negative integers \$ x \$ and \$ y \$, and another integer \$ b \$ such that \$ b \geq 2 \$, write a program/function which computes the generalised XOR, described the following algorithm:
1. First, find the base \$ b \$... | 2021/06/01 | [
"https://codegolf.stackexchange.com/questions/226609",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/96156/"
] | [Red](http://www.red-lang.org), 78 bytes
========================================
```
f: func[x y b][either x + y = 0[0][(b * f x / b y / b b)-(x + y % b - b % b)]]
```
[Try it online!](https://tio.run/##LU7RCsIwDHzvV9yLsCnDtmu7IfgTvoY@2K1jvkwpE@bXz7QKyV3uEpKkOO63OJLfpwum9zLQhg@Cp/hY55iw4cT6CknSUxVwxMTeGYHdjKFuqt/Mg... | [Core Maude](http://maude.cs.illinois.edu/w/index.php/The_Maude_System), 155 bytes
==================================================================================
```
mod X is pr INT . vars B X Y : Nat . op f : Nat Nat Nat -> Nat . eq f(0,0,B)=
0 . eq f(X,Y,B)= B * f(X quo B,Y quo B,B)+((B - 1)*(X + Y))rem B[owise]... |
226,609 | The goal of this challenge is to generalise the bitwise XOR function to other bases. Given two non-negative integers \$ x \$ and \$ y \$, and another integer \$ b \$ such that \$ b \geq 2 \$, write a program/function which computes the generalised XOR, described the following algorithm:
1. First, find the base \$ b \$... | 2021/06/01 | [
"https://codegolf.stackexchange.com/questions/226609",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/96156/"
] | [C (gcc)](https://gcc.gnu.org/), ~~65~~ ~~47~~ 45 bytes
=======================================================
No bytes added or saved but thanks for a bug fix by [Chris Bouchard](https://codegolf.stackexchange.com/users/45870/chris-bouchard)!!!
```c
f(x,y,b){x=x+y?~-b*(x+y)%b+b*f(x/b,y/b,b):0;}
```
[Try it online... | JavaScript (ES6), 44 bytes
==========================
* -1 byte by applying a crazy bit-wise expression as suggested by [Arnauld](https://codegolf.stackexchange.com/users/58563/arnauld).
```javascript
b=>g=(x,y)=>(s=~-x-~y)&&s*~-b%b+g(x/b,y/b)*b
```
[Try it online!](https://tio.run/##ZZBRb4IwEIDf@yvuZdpqgRYLczHlbb9... |
226,609 | The goal of this challenge is to generalise the bitwise XOR function to other bases. Given two non-negative integers \$ x \$ and \$ y \$, and another integer \$ b \$ such that \$ b \geq 2 \$, write a program/function which computes the generalised XOR, described the following algorithm:
1. First, find the base \$ b \$... | 2021/06/01 | [
"https://codegolf.stackexchange.com/questions/226609",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/96156/"
] | [Python 2](https://docs.python.org/2/), 45 bytes
================================================
```python
f=lambda b,x,y:x+y and-(x+y)%b+f(b,x/b,y/b)*b
```
[Try it online!](https://tio.run/##ZdDRaoMwGAXg@zzFQRhN1n9tYqPrCvZJdmOosoCzYsMwT@/@VL0YCxjid06UZIjh697n89xWXf3tbjUcTRQv0z6i7m9vkhfqxe1byX50FI9Ovbo5oEKWZSJ/NznB... | [R](https://www.r-project.org/), ~~57~~ 53 bytes
================================================
```r
f=function(x,b)"if"(any(x),-sum(x)%%b+f(x%/%b,b)*b,0)
```
[Try it online!](https://tio.run/##fc/BDsIgDAbgu0/RaEhAMQIDNg/zXWQJyQ5uyXQJPv0sG6jz4AnC97e0wxT6oZ587ceuebR9RwN3bNv6Lb12TxoYP97HG56EuIOngZyIw8DeccFiKW2oKqXio... |
226,609 | The goal of this challenge is to generalise the bitwise XOR function to other bases. Given two non-negative integers \$ x \$ and \$ y \$, and another integer \$ b \$ such that \$ b \geq 2 \$, write a program/function which computes the generalised XOR, described the following algorithm:
1. First, find the base \$ b \$... | 2021/06/01 | [
"https://codegolf.stackexchange.com/questions/226609",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/96156/"
] | JavaScript (ES6), 44 bytes
==========================
* -1 byte by applying a crazy bit-wise expression as suggested by [Arnauld](https://codegolf.stackexchange.com/users/58563/arnauld).
```javascript
b=>g=(x,y)=>(s=~-x-~y)&&s*~-b%b+g(x/b,y/b)*b
```
[Try it online!](https://tio.run/##ZZBRb4IwEIDf@yvuZdpqgRYLczHlbb9... | [Charcoal](https://github.com/somebody1234/Charcoal), 18 bytes
==============================================================
```
I↨⮌E↨Σθη﹪±Σ÷θXηκηη
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMM5sbhEwymxOFUjKLUstQhI@yYWQASCS3M1CjV1FDKA2Dc/pTQnX8MvNT2xBCLjmVfiklmWmZKqUaijEJBfnlqkkaGjkK0JBCAtMNL6///oa... |
226,609 | The goal of this challenge is to generalise the bitwise XOR function to other bases. Given two non-negative integers \$ x \$ and \$ y \$, and another integer \$ b \$ such that \$ b \geq 2 \$, write a program/function which computes the generalised XOR, described the following algorithm:
1. First, find the base \$ b \$... | 2021/06/01 | [
"https://codegolf.stackexchange.com/questions/226609",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/96156/"
] | [Red](http://www.red-lang.org), 78 bytes
========================================
```
f: func[x y b][either x + y = 0[0][(b * f x / b y / b b)-(x + y % b - b % b)]]
```
[Try it online!](https://tio.run/##LU7RCsIwDHzvV9yLsCnDtmu7IfgTvoY@2K1jvkwpE@bXz7QKyV3uEpKkOO63OJLfpwum9zLQhg@Cp/hY55iw4cT6CknSUxVwxMTeGYHdjKFuqt/Mg... | [Pip](https://github.com/dloscutoff/pip), ~~29~~ 23 bytes
=========================================================
```
{Y-$+ay&y%b+b*(fa//bb)}
```
Stretching the input format a bit, this submission is function that takes two arguments: a two-element list containing \$x\$ and \$y\$, and an integer \$b\$. [Try it onl... |
3,463,452 | If I have a query, such as:
```
select column1, (
select count(*) from table2
) as some_count
from table1
where column1 = 'foo'
```
I can use `column1` in the where clause, but if I try to add
```
and some_count > 0
```
then I get an error that `some_count` doesn't exist. How can I use that in a where clause... | 2010/08/11 | [
"https://Stackoverflow.com/questions/3463452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84478/"
] | Use [HAVING](http://dev.mysql.com/doc/refman/5.1/en/select.html)
```
select column1, (
select count(*) from table2
) as some_count
from table1
HAVING some_count > 0
``` | As is, the only way is to use a derived table:
```
SELECT x.*
FROM (select column1,
(select count(*) from table2) as some_count
from table1
where column1 = 'foo') x
WHERE x.some_count > 0
```
Do you realize that without correlation, `some_count` is going to return the same value... |
74,157 | I'm fairly new to freelancing and have an issue that I'm not sure how to tackle.
I'm still struggling to get paid work so every potential job is very important, however I've had so many time wasters. One of whom has got in touch with me several times over the past few months, always asking for a quotation on a differe... | 2016/07/01 | [
"https://graphicdesign.stackexchange.com/questions/74157",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/70675/"
] | Something to consider: Charging a consultation fee then offering half or all of the fee as a credit when the contract is signed. | This is something some people do. I don't know you, the client or anything about the situation so it's hard to tell but it is likely one of two scenarios.
1. Your client is indecisive and not very serious about her ideas. An idea pops in to her head and the first thing she does is arrange a meeting with you to run thr... |
74,157 | I'm fairly new to freelancing and have an issue that I'm not sure how to tackle.
I'm still struggling to get paid work so every potential job is very important, however I've had so many time wasters. One of whom has got in touch with me several times over the past few months, always asking for a quotation on a differe... | 2016/07/01 | [
"https://graphicdesign.stackexchange.com/questions/74157",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/70675/"
] | This is something some people do. I don't know you, the client or anything about the situation so it's hard to tell but it is likely one of two scenarios.
1. Your client is indecisive and not very serious about her ideas. An idea pops in to her head and the first thing she does is arrange a meeting with you to run thr... | There's a lot of different solutions and it's mostly going to depend on your personality, your work style and what solution works best for you.
Like others have suggested, charging a consultation fee can be a good solution... the problem with that though is you might wind up turning away potential clients who don't w... |
74,157 | I'm fairly new to freelancing and have an issue that I'm not sure how to tackle.
I'm still struggling to get paid work so every potential job is very important, however I've had so many time wasters. One of whom has got in touch with me several times over the past few months, always asking for a quotation on a differe... | 2016/07/01 | [
"https://graphicdesign.stackexchange.com/questions/74157",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/70675/"
] | This is something some people do. I don't know you, the client or anything about the situation so it's hard to tell but it is likely one of two scenarios.
1. Your client is indecisive and not very serious about her ideas. An idea pops in to her head and the first thing she does is arrange a meeting with you to run thr... | Being afraid of ruining reputation and wanting to earn money is natural for freelancer.
First, there is no reputation to ruin. From my experience clients like her use people as a free idea well, brainstormers etc. What she can do to ruin your reputation? Say that you are hard to work with when there is no money invol... |
74,157 | I'm fairly new to freelancing and have an issue that I'm not sure how to tackle.
I'm still struggling to get paid work so every potential job is very important, however I've had so many time wasters. One of whom has got in touch with me several times over the past few months, always asking for a quotation on a differe... | 2016/07/01 | [
"https://graphicdesign.stackexchange.com/questions/74157",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/70675/"
] | If I were you, I would deffinetely tell her that I'm working on another project and if she wants to discuss anything she'd have to first gather any materials relating to it and then in one single E-MAIL describe what she wants and send you those materials.
That will show that she is serious enough. Describe you EMAIL r... | There's a lot of different solutions and it's mostly going to depend on your personality, your work style and what solution works best for you.
Like others have suggested, charging a consultation fee can be a good solution... the problem with that though is you might wind up turning away potential clients who don't w... |
74,157 | I'm fairly new to freelancing and have an issue that I'm not sure how to tackle.
I'm still struggling to get paid work so every potential job is very important, however I've had so many time wasters. One of whom has got in touch with me several times over the past few months, always asking for a quotation on a differe... | 2016/07/01 | [
"https://graphicdesign.stackexchange.com/questions/74157",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/70675/"
] | Something to consider: Charging a consultation fee then offering half or all of the fee as a credit when the contract is signed. | Being afraid of ruining reputation and wanting to earn money is natural for freelancer.
First, there is no reputation to ruin. From my experience clients like her use people as a free idea well, brainstormers etc. What she can do to ruin your reputation? Say that you are hard to work with when there is no money invol... |
74,157 | I'm fairly new to freelancing and have an issue that I'm not sure how to tackle.
I'm still struggling to get paid work so every potential job is very important, however I've had so many time wasters. One of whom has got in touch with me several times over the past few months, always asking for a quotation on a differe... | 2016/07/01 | [
"https://graphicdesign.stackexchange.com/questions/74157",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/70675/"
] | Being afraid of ruining reputation and wanting to earn money is natural for freelancer.
First, there is no reputation to ruin. From my experience clients like her use people as a free idea well, brainstormers etc. What she can do to ruin your reputation? Say that you are hard to work with when there is no money invol... | I had such a person waste my time regularly. I knew that he would not follow up on the quotation but I still did it for some reason.
I don't do this anymore.
My current opinion is that you could charge for estimates. And not make quotations at all, make it clear they're estimates, not quotations.
Personally I don't ... |
74,157 | I'm fairly new to freelancing and have an issue that I'm not sure how to tackle.
I'm still struggling to get paid work so every potential job is very important, however I've had so many time wasters. One of whom has got in touch with me several times over the past few months, always asking for a quotation on a differe... | 2016/07/01 | [
"https://graphicdesign.stackexchange.com/questions/74157",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/70675/"
] | Something to consider: Charging a consultation fee then offering half or all of the fee as a credit when the contract is signed. | I had such a person waste my time regularly. I knew that he would not follow up on the quotation but I still did it for some reason.
I don't do this anymore.
My current opinion is that you could charge for estimates. And not make quotations at all, make it clear they're estimates, not quotations.
Personally I don't ... |
74,157 | I'm fairly new to freelancing and have an issue that I'm not sure how to tackle.
I'm still struggling to get paid work so every potential job is very important, however I've had so many time wasters. One of whom has got in touch with me several times over the past few months, always asking for a quotation on a differe... | 2016/07/01 | [
"https://graphicdesign.stackexchange.com/questions/74157",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/70675/"
] | Something to consider: Charging a consultation fee then offering half or all of the fee as a credit when the contract is signed. | If I were you, I would deffinetely tell her that I'm working on another project and if she wants to discuss anything she'd have to first gather any materials relating to it and then in one single E-MAIL describe what she wants and send you those materials.
That will show that she is serious enough. Describe you EMAIL r... |
74,157 | I'm fairly new to freelancing and have an issue that I'm not sure how to tackle.
I'm still struggling to get paid work so every potential job is very important, however I've had so many time wasters. One of whom has got in touch with me several times over the past few months, always asking for a quotation on a differe... | 2016/07/01 | [
"https://graphicdesign.stackexchange.com/questions/74157",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/70675/"
] | I had such a person waste my time regularly. I knew that he would not follow up on the quotation but I still did it for some reason.
I don't do this anymore.
My current opinion is that you could charge for estimates. And not make quotations at all, make it clear they're estimates, not quotations.
Personally I don't ... | There's a lot of different solutions and it's mostly going to depend on your personality, your work style and what solution works best for you.
Like others have suggested, charging a consultation fee can be a good solution... the problem with that though is you might wind up turning away potential clients who don't w... |
74,157 | I'm fairly new to freelancing and have an issue that I'm not sure how to tackle.
I'm still struggling to get paid work so every potential job is very important, however I've had so many time wasters. One of whom has got in touch with me several times over the past few months, always asking for a quotation on a differe... | 2016/07/01 | [
"https://graphicdesign.stackexchange.com/questions/74157",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/70675/"
] | This is something some people do. I don't know you, the client or anything about the situation so it's hard to tell but it is likely one of two scenarios.
1. Your client is indecisive and not very serious about her ideas. An idea pops in to her head and the first thing she does is arrange a meeting with you to run thr... | If I were you, I would deffinetely tell her that I'm working on another project and if she wants to discuss anything she'd have to first gather any materials relating to it and then in one single E-MAIL describe what she wants and send you those materials.
That will show that she is serious enough. Describe you EMAIL r... |
4,568,304 | Suppose $X\_n$ and $Y\_n$ are independent martingales with respect to filtration $\mathcal{F}\_n$. Is $Z\_n$ a martingale with respect to the same filtration, where $Z\_n = X\_n Y\_n$ and we know that $\mathbb{E}\left[X\_n^2\right] < \infty,\mathbb{E}\left[Y\_n^2\right] < \infty$?
Well I did the first step and found t... | 2022/11/03 | [
"https://math.stackexchange.com/questions/4568304",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1053531/"
] | I was somewhat surprised that the answer is negative.
(However, see the answer by John Dawkins, who notes that $Z\_n$ is a Martingale with respect to some filtration.)
Let $\{\xi\_n\}$ and $\{\eta\_n\}$ be i.i.d. variables of mean zero, taking values $\pm 1$. Consider the partial sums $X\_n:=\sum\_{k=1}^n \xi\_k$ and
... | **Partial answer**: $(X\_n)$ is a martingale with respect to its natural filtration $\mathcal F\_n^X:=\sigma\{X\_k: k\le n\}$, and likewise for $(Y\_n)$. Let $\mathcal G\_n:=\mathcal F^X\_n\vee\mathcal F^Y\_n$. Using the independence of $(X\_n)$ and $(Y\_n)$ its eeasy to check that $(Z\_n)$ is a martingale with respect... |
10,454,047 | I have made a plot in Matlab, using:
```
hold on
plot(t1,Dx1,'r')
xlabel('t (ps)')
ylabel('Deviation of coordinate from initial coordinate (Å)')
plot(t1,Dy1,'g')
plot(t1,Dz1,'b')
hold off
```
However, the tick labels on the y axis are generated in scientific notation:
;
for i = 1:length(ytick)
yticklabel{i} = sprintf(y_formatstring, ytick(i));... |
10,454,047 | I have made a plot in Matlab, using:
```
hold on
plot(t1,Dx1,'r')
xlabel('t (ps)')
ylabel('Deviation of coordinate from initial coordinate (Å)')
plot(t1,Dy1,'g')
plot(t1,Dz1,'b')
hold off
```
However, the tick labels on the y axis are generated in scientific notation:

``` | On newer versions of matlab (2016b) you can use the functions ytickformat and xtickformat to easily change the format of the labels. |
10,454,047 | I have made a plot in Matlab, using:
```
hold on
plot(t1,Dx1,'r')
xlabel('t (ps)')
ylabel('Deviation of coordinate from initial coordinate (Å)')
plot(t1,Dy1,'g')
plot(t1,Dz1,'b')
hold off
```
However, the tick labels on the y axis are generated in scientific notation:
 you can use the functions ytickformat and xtickformat to easily change the format of the labels. |
10,454,047 | I have made a plot in Matlab, using:
```
hold on
plot(t1,Dx1,'r')
xlabel('t (ps)')
ylabel('Deviation of coordinate from initial coordinate (Å)')
plot(t1,Dy1,'g')
plot(t1,Dz1,'b')
hold off
```
However, the tick labels on the y axis are generated in scientific notation:
;
set(gca,'YTickLabel', sprintf('%.4f|',yt))
``` | You can use this code to control the format of tick labels of y axis. This code originates from ticks\_format.m .
% Set the preferred tick format here.
```
y_formatstring = '%3.4f';
```
% Here's the code.
```
ytick = get(gca, 'ytick');
for i = 1:length(ytick)
yticklabel{i} = sprintf(y_formatstring, ytick(i));... |
10,454,047 | I have made a plot in Matlab, using:
```
hold on
plot(t1,Dx1,'r')
xlabel('t (ps)')
ylabel('Deviation of coordinate from initial coordinate (Å)')
plot(t1,Dy1,'g')
plot(t1,Dz1,'b')
hold off
```
However, the tick labels on the y axis are generated in scientific notation:
;
set(gca,'YTickLabel', sprintf('%.4f|',yt))
``` | On newer versions of matlab (2016b) you can use the functions ytickformat and xtickformat to easily change the format of the labels. |
10,454,047 | I have made a plot in Matlab, using:
```
hold on
plot(t1,Dx1,'r')
xlabel('t (ps)')
ylabel('Deviation of coordinate from initial coordinate (Å)')
plot(t1,Dy1,'g')
plot(t1,Dz1,'b')
hold off
```
However, the tick labels on the y axis are generated in scientific notation:

``` |
10,454,047 | I have made a plot in Matlab, using:
```
hold on
plot(t1,Dx1,'r')
xlabel('t (ps)')
ylabel('Deviation of coordinate from initial coordinate (Å)')
plot(t1,Dy1,'g')
plot(t1,Dz1,'b')
hold off
```
However, the tick labels on the y axis are generated in scientific notation:

plot(x,y)
%Plot without exponent:
subplot(1,2,2)
plot(x,y)
ax = gca
ax.YAxis.Exponent = 0;
``` | You can use this code to control the format of tick labels of y axis. This code originates from ticks\_format.m .
% Set the preferred tick format here.
```
y_formatstring = '%3.4f';
```
% Here's the code.
```
ytick = get(gca, 'ytick');
for i = 1:length(ytick)
yticklabel{i} = sprintf(y_formatstring, ytick(i));... |
10,454,047 | I have made a plot in Matlab, using:
```
hold on
plot(t1,Dx1,'r')
xlabel('t (ps)')
ylabel('Deviation of coordinate from initial coordinate (Å)')
plot(t1,Dy1,'g')
plot(t1,Dz1,'b')
hold off
```
However, the tick labels on the y axis are generated in scientific notation:

plot(x,y)
%Plot without exponent:
subplot(1,2,2)
plot(x,y)
ax = gca
ax.YAxis.Exponent = 0;
``` | You have to write the following:
```
set(gcf, 'renderer', 'zbuffer')
``` |
10,454,047 | I have made a plot in Matlab, using:
```
hold on
plot(t1,Dx1,'r')
xlabel('t (ps)')
ylabel('Deviation of coordinate from initial coordinate (Å)')
plot(t1,Dy1,'g')
plot(t1,Dz1,'b')
hold off
```
However, the tick labels on the y axis are generated in scientific notation:

plot(x,y)
%Plot without exponent:
subplot(1,2,2)
plot(x,y)
ax = gca
ax.YAxis.Exponent = 0;
``` | I also fought with getting my plot axes to display in fixed notion instead of scientific notation. The most frustrating part for me was that the "x10^4" label would remain on the edge of the plot box even after I reassigned the tick labels manually to fixed notation. Finally, thanks to the post above I tracked the prob... |
10,454,047 | I have made a plot in Matlab, using:
```
hold on
plot(t1,Dx1,'r')
xlabel('t (ps)')
ylabel('Deviation of coordinate from initial coordinate (Å)')
plot(t1,Dy1,'g')
plot(t1,Dz1,'b')
hold off
```
However, the tick labels on the y axis are generated in scientific notation:
;
for i = 1:length(ytick)
yticklabel{i} = sprintf(y_formatstring, ytick(i));... | On newer versions of matlab (2016b) you can use the functions ytickformat and xtickformat to easily change the format of the labels. |
31,368,548 | I have a structure interval and `*re[]` as array of pointers to structure. In function `insert()`, I am able to store the required data in an array of pointers but when I return the array of pointers as `return re`, a warning is shown "*return from incompatible type*".
```
typedef struct interval
{
int start;
int end;... | 2015/07/12 | [
"https://Stackoverflow.com/questions/31368548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5026644/"
] | `re` is of type `interval **` and so the return type of your function should be `interval **`. Corresponding changes should be made.
Or,
`re` is already declared global, so it is not needed to be returned from the function.
There are several other areas in your code which may give a compiler warning.
* `interval ne... | The `insert()` function should return `interval**` because your `re` is an array of pointers. Now your code is:
```
interval** insert(interval *intervals,interval newInterval,int sz, int *len)
...
interval** ret;
...
printf("\n%d,%d",ret[0]->start,ret[0]->end);
printf("\n%d,%d",ret[1]->start,ret[1]->end);
``` |
315,052 | when i run this command php bin/magento setup:upgrade
>
> /home/vitalticks/public\_html/generated/code/Codazon/ThemeLayoutPro/Console/Command/BuildAssets/Interceptor.php" file can't be deleted. Warning!unlink(/home/vitalticks/public\_html/generated/code/Codazon/ThemeLayoutPro/Console/Command/BuildAssets/Interceptor.p... | 2020/06/15 | [
"https://magento.stackexchange.com/questions/315052",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/80024/"
] | Please check your permission of "generated" folder first.
set permission from CLI using below command :
sudo chmod -R 777 var/ pub/ generated/
It may help you to resolve issue. | If you are using linux based system than run following command.
```
sudo chmod -R 777 generated pub var
sudo chown root:root generated
```
(replace root:root with your system user)
Let me know if further help is required. |
315,052 | when i run this command php bin/magento setup:upgrade
>
> /home/vitalticks/public\_html/generated/code/Codazon/ThemeLayoutPro/Console/Command/BuildAssets/Interceptor.php" file can't be deleted. Warning!unlink(/home/vitalticks/public\_html/generated/code/Codazon/ThemeLayoutPro/Console/Command/BuildAssets/Interceptor.p... | 2020/06/15 | [
"https://magento.stackexchange.com/questions/315052",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/80024/"
] | Please check your permission of "generated" folder first.
set permission from CLI using below command :
sudo chmod -R 777 var/ pub/ generated/
It may help you to resolve issue. | if someone is using dockergento go inside a bash with command
```
dockergento bash --root
```
and use command mentioned above there.
```
sudo chmod -R 777 var/ pub/ generated/
``` |
3,177,686 | I want to implement is\_pointer. I want something like this:
```
template <typename T >
bool is_pointer( T t )
{
// implementation
} // return true or false
int a;
char *c;
SomeClass sc;
someAnotherClass *sac;
is_pointer( a ); // return false
is_pointer( c ); // return true
is_pointer( sc ); // return false
is... | 2010/07/05 | [
"https://Stackoverflow.com/questions/3177686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/181797/"
] | [From Dr. Dobbs](http://www.drdobbs.com/184404270).
```
template <typename T>
struct is_pointer
{ static const bool value = false; };
template <typename T>
struct is_pointer<T*>
{ static const bool value = true; };
```
You can't do *exactly* what you want to do. You'll have to use this like:
```
is_pointer<int... | ```
template <typename T>
bool is_pointer(T const &t) // edited: was "T t"; see the comments
{
return false;
}
template <typename T>
bool is_pointer(T *t)
{
return true;
}
```
You might not believe it, but it works. The reason is that the most specific template implementation will be chosen, which is the one w... |
3,177,686 | I want to implement is\_pointer. I want something like this:
```
template <typename T >
bool is_pointer( T t )
{
// implementation
} // return true or false
int a;
char *c;
SomeClass sc;
someAnotherClass *sac;
is_pointer( a ); // return false
is_pointer( c ); // return true
is_pointer( sc ); // return false
is... | 2010/07/05 | [
"https://Stackoverflow.com/questions/3177686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/181797/"
] | ```
template <typename T>
struct is_pointer_type
{
enum { value = false };
};
template <typename T>
struct is_pointer_type<T*>
{
enum { value = true };
};
template <typename T>
bool is_pointer(const T&)
{
return is_pointer_type<T>::value;
}
```
Johannes noted:
>
> This is actually missing specializati... | [From Dr. Dobbs](http://www.drdobbs.com/184404270).
```
template <typename T>
struct is_pointer
{ static const bool value = false; };
template <typename T>
struct is_pointer<T*>
{ static const bool value = true; };
```
You can't do *exactly* what you want to do. You'll have to use this like:
```
is_pointer<int... |
3,177,686 | I want to implement is\_pointer. I want something like this:
```
template <typename T >
bool is_pointer( T t )
{
// implementation
} // return true or false
int a;
char *c;
SomeClass sc;
someAnotherClass *sac;
is_pointer( a ); // return false
is_pointer( c ); // return true
is_pointer( sc ); // return false
is... | 2010/07/05 | [
"https://Stackoverflow.com/questions/3177686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/181797/"
] | [From Dr. Dobbs](http://www.drdobbs.com/184404270).
```
template <typename T>
struct is_pointer
{ static const bool value = false; };
template <typename T>
struct is_pointer<T*>
{ static const bool value = true; };
```
You can't do *exactly* what you want to do. You'll have to use this like:
```
is_pointer<int... | You can use "typeid" operator defined in typeinfo.h for this.
check this link : <http://en.wikipedia.org/wiki/Typeid>
The typeid operator will give an object of std::type\_info class, which has a name() function returning char \*. Once you get the type in string form, you can identify the pointer easily.
Hope it hel... |
3,177,686 | I want to implement is\_pointer. I want something like this:
```
template <typename T >
bool is_pointer( T t )
{
// implementation
} // return true or false
int a;
char *c;
SomeClass sc;
someAnotherClass *sac;
is_pointer( a ); // return false
is_pointer( c ); // return true
is_pointer( sc ); // return false
is... | 2010/07/05 | [
"https://Stackoverflow.com/questions/3177686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/181797/"
] | ```
template <typename T>
struct is_pointer_type
{
enum { value = false };
};
template <typename T>
struct is_pointer_type<T*>
{
enum { value = true };
};
template <typename T>
bool is_pointer(const T&)
{
return is_pointer_type<T>::value;
}
```
Johannes noted:
>
> This is actually missing specializati... | ```
template <typename T>
bool is_pointer(T const &t) // edited: was "T t"; see the comments
{
return false;
}
template <typename T>
bool is_pointer(T *t)
{
return true;
}
```
You might not believe it, but it works. The reason is that the most specific template implementation will be chosen, which is the one w... |
3,177,686 | I want to implement is\_pointer. I want something like this:
```
template <typename T >
bool is_pointer( T t )
{
// implementation
} // return true or false
int a;
char *c;
SomeClass sc;
someAnotherClass *sac;
is_pointer( a ); // return false
is_pointer( c ); // return true
is_pointer( sc ); // return false
is... | 2010/07/05 | [
"https://Stackoverflow.com/questions/3177686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/181797/"
] | ```
template <typename T>
bool is_pointer(T const &t) // edited: was "T t"; see the comments
{
return false;
}
template <typename T>
bool is_pointer(T *t)
{
return true;
}
```
You might not believe it, but it works. The reason is that the most specific template implementation will be chosen, which is the one w... | You can use "typeid" operator defined in typeinfo.h for this.
check this link : <http://en.wikipedia.org/wiki/Typeid>
The typeid operator will give an object of std::type\_info class, which has a name() function returning char \*. Once you get the type in string form, you can identify the pointer easily.
Hope it hel... |
3,177,686 | I want to implement is\_pointer. I want something like this:
```
template <typename T >
bool is_pointer( T t )
{
// implementation
} // return true or false
int a;
char *c;
SomeClass sc;
someAnotherClass *sac;
is_pointer( a ); // return false
is_pointer( c ); // return true
is_pointer( sc ); // return false
is... | 2010/07/05 | [
"https://Stackoverflow.com/questions/3177686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/181797/"
] | ```
template <typename T>
struct is_pointer_type
{
enum { value = false };
};
template <typename T>
struct is_pointer_type<T*>
{
enum { value = true };
};
template <typename T>
bool is_pointer(const T&)
{
return is_pointer_type<T>::value;
}
```
Johannes noted:
>
> This is actually missing specializati... | You can use "typeid" operator defined in typeinfo.h for this.
check this link : <http://en.wikipedia.org/wiki/Typeid>
The typeid operator will give an object of std::type\_info class, which has a name() function returning char \*. Once you get the type in string form, you can identify the pointer easily.
Hope it hel... |
53,003,318 | Is there anyone who can help me to obtain user client IP from docker container that runs on Azure container instance ?
My code gets only local IP of something , i guess it is revers proxy.
So ip is 10.240.255.106;
Is headers I also have host IP (Public container IP) but nothing more.
Headers
>
> {"Cache-Control":["... | 2018/10/26 | [
"https://Stackoverflow.com/questions/53003318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1875855/"
] | No, ACI doesn't preserve the client IP.
You can create a feature request in the user voice.
<https://feedback.azure.com/forums/602224-azure-container-instances?filter=top&page=1> | To get the client IP in asp.net core inside the controller action:
```
var ip = Request.HttpContext.Connection.RemoteIpAddress;
``` |
51,610,240 | Imagine you have a database, which stores barters. For simplicity let's assume the barter system only allows you to exchange cats for dogs or dogs for cats (but IRL there might be more combinations).
To keep track of each barter act, one has `barters` table. A barter act consist of input and output (e.g. I trade one c... | 2018/07/31 | [
"https://Stackoverflow.com/questions/51610240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4806797/"
] | First of all, **I would advise against editing the core files** as it will be overwritten when you next update WordPress.
To create an extra field on your login page, you may use the login\_form action hook:
```
add_action('login_form','my_added_login_field');
function my_added_login_field(){
//Output your HTML
?... | For custom login page
<https://codex.wordpress.org/Customizing_the_Login_Form#Login_Hooks>
>
> So my question is: Is there a way to alter these screens html (without using frontend languages).
>
>
>
Without JS and CSS, it's difficult |
51,610,240 | Imagine you have a database, which stores barters. For simplicity let's assume the barter system only allows you to exchange cats for dogs or dogs for cats (but IRL there might be more combinations).
To keep track of each barter act, one has `barters` table. A barter act consist of input and output (e.g. I trade one c... | 2018/07/31 | [
"https://Stackoverflow.com/questions/51610240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4806797/"
] | First of all, **I would advise against editing the core files** as it will be overwritten when you next update WordPress.
To create an extra field on your login page, you may use the login\_form action hook:
```
add_action('login_form','my_added_login_field');
function my_added_login_field(){
//Output your HTML
?... | Maartjie
Here's the reasonably full list of wordpress actions and filters, with link to the admin actions: <https://codex.wordpress.org/Plugin_API/Action_Reference#Administrative_Actions>. login\_form is the one you should be looking at. NO js or css needed, but yes you will need php. |
3,939,896 | ```
#include <stdio.h>
#define SIZE 5
void func(int*);
int main(void)
{
int i, arr[SIZE];
for(i=0; i<SIZE; i++)
{
printf("Enter the element arr[%d]: ", i);
scanf("%d", &arr[i]);
}//End of for loop
func(arr);
printf("The modified array is : ");
for(i=0; i<SIZE; i++)
print... | 2010/10/15 | [
"https://Stackoverflow.com/questions/3939896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/463688/"
] | When you `scanf("%d")` a value like `1.5` the scanning will stop at the decimal point and return 1.
The *next* time you call `scanf`, the pointer will *still* point to the decimal point and your scan will return immediately because there are no digits there to scan.
You should be checking the return value from `scanf... | Problem with buffer - I think the remaining part (.5) remains on the buffer.
use `flushall();` after your `scanf("%d..` |
3,939,896 | ```
#include <stdio.h>
#define SIZE 5
void func(int*);
int main(void)
{
int i, arr[SIZE];
for(i=0; i<SIZE; i++)
{
printf("Enter the element arr[%d]: ", i);
scanf("%d", &arr[i]);
}//End of for loop
func(arr);
printf("The modified array is : ");
for(i=0; i<SIZE; i++)
print... | 2010/10/15 | [
"https://Stackoverflow.com/questions/3939896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/463688/"
] | What's happening is that `scanf` stops reading an integer when it sees the `'.'` character, and leaves it in the input buffer. Then subsequent calls to `scanf` fail because the next character is `'.'` and not something parseable as an integer.
How do you fix this? The first step is to forget you ever heard of `scanf` ... | Problem with buffer - I think the remaining part (.5) remains on the buffer.
use `flushall();` after your `scanf("%d..` |
3,939,896 | ```
#include <stdio.h>
#define SIZE 5
void func(int*);
int main(void)
{
int i, arr[SIZE];
for(i=0; i<SIZE; i++)
{
printf("Enter the element arr[%d]: ", i);
scanf("%d", &arr[i]);
}//End of for loop
func(arr);
printf("The modified array is : ");
for(i=0; i<SIZE; i++)
print... | 2010/10/15 | [
"https://Stackoverflow.com/questions/3939896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/463688/"
] | When you `scanf("%d")` a value like `1.5` the scanning will stop at the decimal point and return 1.
The *next* time you call `scanf`, the pointer will *still* point to the decimal point and your scan will return immediately because there are no digits there to scan.
You should be checking the return value from `scanf... | What's happening is that `scanf` stops reading an integer when it sees the `'.'` character, and leaves it in the input buffer. Then subsequent calls to `scanf` fail because the next character is `'.'` and not something parseable as an integer.
How do you fix this? The first step is to forget you ever heard of `scanf` ... |
32,317,783 | I hope somebody can help.
I've spent some time researching the best way to bind an event to a ViewModel command using the MVVM pattern when developing a Universal App. I'm using MVVM Light.
As a test I'm using the SelectionChanged event of a ComboBox.
I've read a few people that have pinched the Behaviours SDK from t... | 2015/08/31 | [
"https://Stackoverflow.com/questions/32317783",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2099266/"
] | We seem to be getting this question a lot lately, in several different variants...
I'm not familiar with Universal App but is there any specific reason you're trying to use an event? WPF/Silverlight etc are designed to be data driven, all you need to do is bind the ComboBox's SelectedItem member to a property in your ... | Check this link: [MVVM EventBinding Library](http://www.mobilemotion.eu/?page_id=1203) ,explains about MVVM EventBinding. This purely decouples the View & View model & pass only the arguements to the command. |
16,318,533 | EDIT ::: For people who may be searching for a solution, Here it is.. (using ZXing 2.1)
Follow the steps below :::
1. First you have to import the existing code into your workspace
File -> import -> android -> existing android code into workspace
2. Browse to the unzipped folder of ZXing 2.1
3. You will have two pro... | 2013/05/01 | [
"https://Stackoverflow.com/questions/16318533",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1777523/"
] | The classes are found in `core.jar`. You build this from the source code you downloaded.
I suggest you use the latest code from Subversion actually. If you do that, here's how you can get a pre-compiled JAR, or build one yourself: <https://code.google.com/p/zxing/wiki/GettingStarted>
(We are releasing 2.2 in a week o... | Extract zip
Right click on project-> properties-> Java Build Path-> Libraries-> Add External Jars-> select the jar file where it is in your Pc-> click ok. |
859,158 | It's 2017 and I'm looking for some "best practices" guidance with IIS Web Farms across multiple VM servers. Pre-Server 2016 recommendations like
* Distributed File System-Replication (DFS-R)
* Application Request Routing (ARR) and Network Load Balancing (NLB)
might not make sense anymore given Server 2016, Clustered... | 2017/07/03 | [
"https://serverfault.com/questions/859158",
"https://serverfault.com",
"https://serverfault.com/users/55636/"
] | You won't be able to deploy DFS-R because it can't replicate open files, and third-party locks like one from PeerLock are both expensive and unreliable. TL;DR: Stick with a recommended solution: SOFS. | >
> Server 2016, Clustered Shared Volumes (CSV).
>
>
>
Which ins 2016 are NOT meant to be used outside VERY specific use cases, and no, websites inot one of them. This HAS changed with 2019, but even then I would go for independent farms as much as possible. Yes, a clustered shared volume means nearly similar redu... |
57,854,462 | Is there a way to select all active stored procedures in my database? I recently dropped a couple thousand and want to make sure I didn't miss any. It will be easier for me to pinpoint them if I can see what is active. | 2019/09/09 | [
"https://Stackoverflow.com/questions/57854462",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12021364/"
] | Weird issue. I have a customer with a similar symptom you mention.
Finally, after reproducing the problem at my end: the webrequest landing on the DNN page after the redirection of the Azure login creates two requests for "*ExchangeCodeForToken*" (the first one is accepted, but the second is invalid because the code w... | Due to the recent update in Azure AD this behavior is to be expected. As of October 10 Azure AD will no longer accept authorization codes to issue tokens that have already been used. To fix the error try changing your code to request a refresh token that will be passed to /used by additional resources as the refresh to... |
57,854,462 | Is there a way to select all active stored procedures in my database? I recently dropped a couple thousand and want to make sure I didn't miss any. It will be easier for me to pinpoint them if I can see what is active. | 2019/09/09 | [
"https://Stackoverflow.com/questions/57854462",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12021364/"
] | Have you tried again in a incognito mode? By the way, tenant parameter is not needed if you enable useCommonEndpoint.
I can login in with external tenant users with a code returned by following [this document](https://github.com/auth0/passport-azure-ad-oauth2). Can you paste your code here which for login? | Due to the recent update in Azure AD this behavior is to be expected. As of October 10 Azure AD will no longer accept authorization codes to issue tokens that have already been used. To fix the error try changing your code to request a refresh token that will be passed to /used by additional resources as the refresh to... |
57,854,462 | Is there a way to select all active stored procedures in my database? I recently dropped a couple thousand and want to make sure I didn't miss any. It will be easier for me to pinpoint them if I can see what is active. | 2019/09/09 | [
"https://Stackoverflow.com/questions/57854462",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12021364/"
] | Add guest users to the directory
Sign in to the Azure portal as a user who is assigned a limited administrator directory role or the Guest Inviter role.
In the navigation pane, select Azure Active Directory.
Under Manage, select Users.
Select New guest user. ...
Under User name, enter the email address of the external ... | Due to the recent update in Azure AD this behavior is to be expected. As of October 10 Azure AD will no longer accept authorization codes to issue tokens that have already been used. To fix the error try changing your code to request a refresh token that will be passed to /used by additional resources as the refresh to... |
972,961 | On an Ubuntu 16.04 system on Google GCP, I need to create a new user `hello` and allow other users to SSH to the system as user `hello` using their current SSH keys.
Here's what I did to add my SSH public key to `hello`'s `authorized_keys`:
```
sudo useradd -m hello -s /bin/bash
sudo mkdir /home/hello/.ssh
sudo chown... | 2017/11/04 | [
"https://askubuntu.com/questions/972961",
"https://askubuntu.com",
"https://askubuntu.com/users/95436/"
] | You need to change the owner of the file `authorized_keys` after it is created, since it will be owned by the user running the script.
Adding this as last line to your script should do the trick.
`sudo chown hello:hello /home/hello/.ssh/authorized_keys` | Maybe in server site this user "hello" is blacklisted
try this:
```
grep **AllowUsers** /etc/ssh/sshd_config
```
or this:
```
grep **DenyUsers** /etc/ssh/sshd_config
```
try with groups too `AllowGroups` and `DenyGroups`. |
972,961 | On an Ubuntu 16.04 system on Google GCP, I need to create a new user `hello` and allow other users to SSH to the system as user `hello` using their current SSH keys.
Here's what I did to add my SSH public key to `hello`'s `authorized_keys`:
```
sudo useradd -m hello -s /bin/bash
sudo mkdir /home/hello/.ssh
sudo chown... | 2017/11/04 | [
"https://askubuntu.com/questions/972961",
"https://askubuntu.com",
"https://askubuntu.com/users/95436/"
] | Maybe in server site this user "hello" is blacklisted
try this:
```
grep **AllowUsers** /etc/ssh/sshd_config
```
or this:
```
grep **DenyUsers** /etc/ssh/sshd_config
```
try with groups too `AllowGroups` and `DenyGroups`. | Check the /home directory permissions. It should be
* `drwxr-xr-x. 9 root root 113 Jun 28 22:57 home`
and then your home directory detail:
* `drwxr----- 5 user group 124 May 18 17:00 User
drwx------ 2 user group 29 May 18 12:05 .ssh
-rw------- 1 user group 2235 Jun 28 23:09 authorized_keys`
**My error messages in... |
972,961 | On an Ubuntu 16.04 system on Google GCP, I need to create a new user `hello` and allow other users to SSH to the system as user `hello` using their current SSH keys.
Here's what I did to add my SSH public key to `hello`'s `authorized_keys`:
```
sudo useradd -m hello -s /bin/bash
sudo mkdir /home/hello/.ssh
sudo chown... | 2017/11/04 | [
"https://askubuntu.com/questions/972961",
"https://askubuntu.com",
"https://askubuntu.com/users/95436/"
] | You need to change the owner of the file `authorized_keys` after it is created, since it will be owned by the user running the script.
Adding this as last line to your script should do the trick.
`sudo chown hello:hello /home/hello/.ssh/authorized_keys` | Check the /home directory permissions. It should be
* `drwxr-xr-x. 9 root root 113 Jun 28 22:57 home`
and then your home directory detail:
* `drwxr----- 5 user group 124 May 18 17:00 User
drwx------ 2 user group 29 May 18 12:05 .ssh
-rw------- 1 user group 2235 Jun 28 23:09 authorized_keys`
**My error messages in... |
18,532,714 | I use tinymce editor version 4.0.5.i want to use Math/Graph Plugins in updated tinymce when I add math plugin in new version of tinymce its not working and give the error plugin.min.js not found .How can i convert plugins file into plugin.min.js or any other solution. | 2013/08/30 | [
"https://Stackoverflow.com/questions/18532714",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2721443/"
] | I think this is almost there, accomplishes what you ask, but I see it's deleting one undo point (I think this is expected from `undojoin`):
```
function! GoFmt()
try
exe "undojoin"
exe "Fmt"
catch
endtry
endfunction
au FileType go au BufWritePre <buffer> call G... | I just have this in my .vimrc:
```
au BufWritePost *.go !gofmt -w %
```
Automatically runs gofmt on the file when I save. It doesn't actually reformat it in the buffer so it doesn't interrupt what I'm looking at, but it's correctly formatted on disk so all check ins are properly formatted. If you want to see the cor... |
18,532,714 | I use tinymce editor version 4.0.5.i want to use Math/Graph Plugins in updated tinymce when I add math plugin in new version of tinymce its not working and give the error plugin.min.js not found .How can i convert plugins file into plugin.min.js or any other solution. | 2013/08/30 | [
"https://Stackoverflow.com/questions/18532714",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2721443/"
] | I think this is almost there, accomplishes what you ask, but I see it's deleting one undo point (I think this is expected from `undojoin`):
```
function! GoFmt()
try
exe "undojoin"
exe "Fmt"
catch
endtry
endfunction
au FileType go au BufWritePre <buffer> call G... | You can install the vim plugins from the default repository. Alternatively, a pathogen friendly mirror is here:
<https://github.com/jnwhiteh/vim-golang>
Then you can use the :Fmt command to safely do a go fmt! |
18,532,714 | I use tinymce editor version 4.0.5.i want to use Math/Graph Plugins in updated tinymce when I add math plugin in new version of tinymce its not working and give the error plugin.min.js not found .How can i convert plugins file into plugin.min.js or any other solution. | 2013/08/30 | [
"https://Stackoverflow.com/questions/18532714",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2721443/"
] | I think this is almost there, accomplishes what you ask, but I see it's deleting one undo point (I think this is expected from `undojoin`):
```
function! GoFmt()
try
exe "undojoin"
exe "Fmt"
catch
endtry
endfunction
au FileType go au BufWritePre <buffer> call G... | I attempted to use @pepper\_chino's answer but ran into issues where if fmt errors then vim would undo the last change prior to running `GoFmt`. I worked around this in a long and slightly convoluted way:
```
" Fmt calls 'go fmt' to convert the file to go's format standards. This being
" run often makes the undo buffe... |
18,532,714 | I use tinymce editor version 4.0.5.i want to use Math/Graph Plugins in updated tinymce when I add math plugin in new version of tinymce its not working and give the error plugin.min.js not found .How can i convert plugins file into plugin.min.js or any other solution. | 2013/08/30 | [
"https://Stackoverflow.com/questions/18532714",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2721443/"
] | I think this is almost there, accomplishes what you ask, but I see it's deleting one undo point (I think this is expected from `undojoin`):
```
function! GoFmt()
try
exe "undojoin"
exe "Fmt"
catch
endtry
endfunction
au FileType go au BufWritePre <buffer> call G... | Here is my go at this. It seems to be working well both with read/write autocmds and bound to a key. It puts the cursor back
and doesn't include the top-of-file event in the undos.
```
function! GoFormatBuffer()
if &modifiable == 1
let l:curw=winsaveview()
let l:tmpname=tempname()
call writ... |
18,532,714 | I use tinymce editor version 4.0.5.i want to use Math/Graph Plugins in updated tinymce when I add math plugin in new version of tinymce its not working and give the error plugin.min.js not found .How can i convert plugins file into plugin.min.js or any other solution. | 2013/08/30 | [
"https://Stackoverflow.com/questions/18532714",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2721443/"
] | I just have this in my .vimrc:
```
au BufWritePost *.go !gofmt -w %
```
Automatically runs gofmt on the file when I save. It doesn't actually reformat it in the buffer so it doesn't interrupt what I'm looking at, but it's correctly formatted on disk so all check ins are properly formatted. If you want to see the cor... | You can install the vim plugins from the default repository. Alternatively, a pathogen friendly mirror is here:
<https://github.com/jnwhiteh/vim-golang>
Then you can use the :Fmt command to safely do a go fmt! |
18,532,714 | I use tinymce editor version 4.0.5.i want to use Math/Graph Plugins in updated tinymce when I add math plugin in new version of tinymce its not working and give the error plugin.min.js not found .How can i convert plugins file into plugin.min.js or any other solution. | 2013/08/30 | [
"https://Stackoverflow.com/questions/18532714",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2721443/"
] | I attempted to use @pepper\_chino's answer but ran into issues where if fmt errors then vim would undo the last change prior to running `GoFmt`. I worked around this in a long and slightly convoluted way:
```
" Fmt calls 'go fmt' to convert the file to go's format standards. This being
" run often makes the undo buffe... | I just have this in my .vimrc:
```
au BufWritePost *.go !gofmt -w %
```
Automatically runs gofmt on the file when I save. It doesn't actually reformat it in the buffer so it doesn't interrupt what I'm looking at, but it's correctly formatted on disk so all check ins are properly formatted. If you want to see the cor... |
18,532,714 | I use tinymce editor version 4.0.5.i want to use Math/Graph Plugins in updated tinymce when I add math plugin in new version of tinymce its not working and give the error plugin.min.js not found .How can i convert plugins file into plugin.min.js or any other solution. | 2013/08/30 | [
"https://Stackoverflow.com/questions/18532714",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2721443/"
] | Here is my go at this. It seems to be working well both with read/write autocmds and bound to a key. It puts the cursor back
and doesn't include the top-of-file event in the undos.
```
function! GoFormatBuffer()
if &modifiable == 1
let l:curw=winsaveview()
let l:tmpname=tempname()
call writ... | I just have this in my .vimrc:
```
au BufWritePost *.go !gofmt -w %
```
Automatically runs gofmt on the file when I save. It doesn't actually reformat it in the buffer so it doesn't interrupt what I'm looking at, but it's correctly formatted on disk so all check ins are properly formatted. If you want to see the cor... |
18,532,714 | I use tinymce editor version 4.0.5.i want to use Math/Graph Plugins in updated tinymce when I add math plugin in new version of tinymce its not working and give the error plugin.min.js not found .How can i convert plugins file into plugin.min.js or any other solution. | 2013/08/30 | [
"https://Stackoverflow.com/questions/18532714",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2721443/"
] | I attempted to use @pepper\_chino's answer but ran into issues where if fmt errors then vim would undo the last change prior to running `GoFmt`. I worked around this in a long and slightly convoluted way:
```
" Fmt calls 'go fmt' to convert the file to go's format standards. This being
" run often makes the undo buffe... | You can install the vim plugins from the default repository. Alternatively, a pathogen friendly mirror is here:
<https://github.com/jnwhiteh/vim-golang>
Then you can use the :Fmt command to safely do a go fmt! |
18,532,714 | I use tinymce editor version 4.0.5.i want to use Math/Graph Plugins in updated tinymce when I add math plugin in new version of tinymce its not working and give the error plugin.min.js not found .How can i convert plugins file into plugin.min.js or any other solution. | 2013/08/30 | [
"https://Stackoverflow.com/questions/18532714",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2721443/"
] | Here is my go at this. It seems to be working well both with read/write autocmds and bound to a key. It puts the cursor back
and doesn't include the top-of-file event in the undos.
```
function! GoFormatBuffer()
if &modifiable == 1
let l:curw=winsaveview()
let l:tmpname=tempname()
call writ... | You can install the vim plugins from the default repository. Alternatively, a pathogen friendly mirror is here:
<https://github.com/jnwhiteh/vim-golang>
Then you can use the :Fmt command to safely do a go fmt! |
6,965,191 | I would like to be able to cycle anchor selection using jQuery 1.4.4.
The following works when targetting LI elements:
HTML:
```
<ul class="rotating-banner">
<li class="active"><a>1</a></li>
<li><a>2</a></li>
<li><a>3</a></li>
<li><a>4</a></li>
</ul>
```
JavaScript (against jQuery 1.4.4):
```
rota... | 2011/08/06 | [
"https://Stackoverflow.com/questions/6965191",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/388267/"
] | To get to anchor tags, I changed the selectors as such:
```
var active = $('ul.rotating-banner li a.active');
var next = active.parent().next().find('a');
```
Here a working fiddle (that cycles indefinitely): <http://jsfiddle.net/Yq9AA/1/>
I missed the *ad infinitum* part, updated my fiddle (this cycles only once):... | Try this
```
rotateBanner = function() {
var active = $('ul.rotating-banner a.active');
var next = active.parent().next();
if (next.length === 0) {
next = $('ul.rotating-banner a:first');
}
else{
next = next.find("a");
}
active.removeClass('active');
next.addClass('acti... |
42,570,278 | I am starting with an inner Observable from Angular's `route.params`.
I would like to be able to retain the values from the params 'beyond' the higher order observable `switchMap`, which in my cases performs an http call.
For instance:
```
this.data$ = this.route.params
.switchMap(params => this.http.get('/api',... | 2017/03/03 | [
"https://Stackoverflow.com/questions/42570278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2275792/"
] | You could use forkJoin:
```
this.data$ = this.route.params
.switchMap(params =>
Observable.forkJoin([
Observable.of(params),
this.http.get('/api', { param1: params.param1, param2: params.param2 })
])
.map(([params, data]) => {
return something
})
``` | use ResultSelector argument of switchMap
>
> A function to produce the value on the output Observable based on the values and the indices of the source (outer) emission and the inner Observable emission. The arguments passed to this function are
>
>
>
<http://reactivex.io/rxjs/class/es6/Observable.js~Observable.h... |
67,479 | I am reading how the TCP states work and especially the connection termination part.
All of the books or online material I read, shows that for the termination procedure these states are followed from the side initiated (active) the connection termination:
**ESTABLISHED, FIN-WAIT-1, FIN-WAIT-2, TIME-WAIT, CLOSED**
A... | 2013/03/10 | [
"https://unix.stackexchange.com/questions/67479",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/17971/"
] | The Linux TCP stack and conntrack have two different visions of the TCP connection. What you're seeing in `/proc/net/ip_conntrack` is different from what the kernel sees. The kernel state is stored in `/proc/net/tcp` and `/proc/net/tcp6` and can be displayed with `netstat`.
As seen here: <https://serverfault.com/quest... | This is to prevent a new connection getting stale segments still floating around in the 'net from the old connection messing it up. |
54,994,872 | First, let me say that I am a newbie and that I have read many other posts with the same problem. I have a table called "AllPeople", and in that table I have an integer column called "Ethnicity", which I want to be a foreign key that points at a record in my "RefEthnicities" table. I keep getting the following message:... | 2019/03/05 | [
"https://Stackoverflow.com/questions/54994872",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9419696/"
] | `NULL` doesn't work with `=`, so you need more explicit logic:
```
WHERE (MT.ReqType = @param1 OR
(MT.ReqType IS NULL AND @param1 IS NULL)
)
``` | Works the same as Gordon's, a little more compact, note the use of coalesce. I don't think this is Index friendly so you might want to be careful how you use it.
```
declare @test table
(
ReqFld1 varchar(4),
ReqType varchar(3)
)
insert into @test values ('FLD1', 'LTL')
insert into @test values ('FLD2', 'TL... |
54,994,872 | First, let me say that I am a newbie and that I have read many other posts with the same problem. I have a table called "AllPeople", and in that table I have an integer column called "Ethnicity", which I want to be a foreign key that points at a record in my "RefEthnicities" table. I keep getting the following message:... | 2019/03/05 | [
"https://Stackoverflow.com/questions/54994872",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9419696/"
] | `NULL` doesn't work with `=`, so you need more explicit logic:
```
WHERE (MT.ReqType = @param1 OR
(MT.ReqType IS NULL AND @param1 IS NULL)
)
``` | If `@param1` (can be) `SQL` `NULL` then you could also do:
```
SELECT * FROM MyTable MT
WHERE isnull(MT.ReqType, '') = isnull(@param1,'')
```
\*That would not work if you are allowing empty string for your MT.ReqType. In that case you could pick another char to replace null values with. |
54,994,872 | First, let me say that I am a newbie and that I have read many other posts with the same problem. I have a table called "AllPeople", and in that table I have an integer column called "Ethnicity", which I want to be a foreign key that points at a record in my "RefEthnicities" table. I keep getting the following message:... | 2019/03/05 | [
"https://Stackoverflow.com/questions/54994872",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9419696/"
] | If `@param1` (can be) `SQL` `NULL` then you could also do:
```
SELECT * FROM MyTable MT
WHERE isnull(MT.ReqType, '') = isnull(@param1,'')
```
\*That would not work if you are allowing empty string for your MT.ReqType. In that case you could pick another char to replace null values with. | Works the same as Gordon's, a little more compact, note the use of coalesce. I don't think this is Index friendly so you might want to be careful how you use it.
```
declare @test table
(
ReqFld1 varchar(4),
ReqType varchar(3)
)
insert into @test values ('FLD1', 'LTL')
insert into @test values ('FLD2', 'TL... |
3,503,054 | I'm implementing a messaging system in my program. It functions just like e-mail except that it is entirely contained within the system.
I was wondering if anyone has seen an e-mail control template that I could modify. It would have stuff like an inbox, message viewing and message sending parts.
I would just rewire ... | 2010/08/17 | [
"https://Stackoverflow.com/questions/3503054",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/102526/"
] | I ended up creating my own user control. If anyone is interested message and I'll post the details.
Edit:
Ok I didn't realize I wrote so much. Make sure you credit Biff\_MaGriff if you use this. :D
Tech is .net 3.5 with SubSonic 3.0
Should look like this in the end.
Hmm, can't post over 30k characters...
Continued... | If you're willing to fork out some money, [Telerik](http://demos.telerik.com/aspnet-ajax/panelbar/examples/overview/defaultcs.aspx) has a nice `PanelBar` control that looks just like Outlook. I believe the samples that ship with it are identical to the Outlook-like demo application on their site, so that would probably... |
3,503,054 | I'm implementing a messaging system in my program. It functions just like e-mail except that it is entirely contained within the system.
I was wondering if anyone has seen an e-mail control template that I could modify. It would have stuff like an inbox, message viewing and message sending parts.
I would just rewire ... | 2010/08/17 | [
"https://Stackoverflow.com/questions/3503054",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/102526/"
] | I ended up creating my own user control. If anyone is interested message and I'll post the details.
Edit:
Ok I didn't realize I wrote so much. Make sure you credit Biff\_MaGriff if you use this. :D
Tech is .net 3.5 with SubSonic 3.0
Should look like this in the end.
Hmm, can't post over 30k characters...
Continued... | By Steve Danner:
>
> Telerik has a nice PanelBar control that looks just like Outlook. I believe the samples that ship with it are identical to the Outlook-like demo application on their site, so that would probably be a very quick and easy way to get started.
>
>
>
FYI, The panelbar control is just a UI, it does... |
35,540 | Tried searching for a similar question, but didn't find anything...
I was wondering if there are ways to increase my usefulness to my company, in my role as a UX designer. My skillsets primarily reside in UI design, and some front-end development work.
At the beginning, there was alot of UI design work to keep me bu... | 2013/02/27 | [
"https://ux.stackexchange.com/questions/35540",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/12472/"
] | User experience design is a comprehensive role and it is not limited to UI or interaction design alone. If you are looking to expand on your skill-set under UX umbrella and contribute to your organization more, you might want to look into following aspects to take its User Experience a level up further. Consider follow... | Apart from improving the products at your company, you should look at building complimentary skills such as analytics, information architecture, and marketing with the goal of growing users.
These and other skills are converging at a point which people call growth hacking. See more at <https://www.google.com/search?q=... |
35,540 | Tried searching for a similar question, but didn't find anything...
I was wondering if there are ways to increase my usefulness to my company, in my role as a UX designer. My skillsets primarily reside in UI design, and some front-end development work.
At the beginning, there was alot of UI design work to keep me bu... | 2013/02/27 | [
"https://ux.stackexchange.com/questions/35540",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/12472/"
] | Apart from improving the products at your company, you should look at building complimentary skills such as analytics, information architecture, and marketing with the goal of growing users.
These and other skills are converging at a point which people call growth hacking. See more at <https://www.google.com/search?q=... | Simply call all the customers and various kind of users and try to get some information about how your society can improve their experience with your product. You've got some work for many months.
If your product don't have any users, you've got a serious problem. |
35,540 | Tried searching for a similar question, but didn't find anything...
I was wondering if there are ways to increase my usefulness to my company, in my role as a UX designer. My skillsets primarily reside in UI design, and some front-end development work.
At the beginning, there was alot of UI design work to keep me bu... | 2013/02/27 | [
"https://ux.stackexchange.com/questions/35540",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/12472/"
] | Couple additional ideas
1. Start a UX brown bag activity. Find a topic that is interesting from UX standpoint (good/bad products, interesting UX/HCI article or research), send invite with reading material to discuss with people who might be interested. Have a informal presentation and discussion about what your learne... | Simply call all the customers and various kind of users and try to get some information about how your society can improve their experience with your product. You've got some work for many months.
If your product don't have any users, you've got a serious problem. |
35,540 | Tried searching for a similar question, but didn't find anything...
I was wondering if there are ways to increase my usefulness to my company, in my role as a UX designer. My skillsets primarily reside in UI design, and some front-end development work.
At the beginning, there was alot of UI design work to keep me bu... | 2013/02/27 | [
"https://ux.stackexchange.com/questions/35540",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/12472/"
] | There's a million things that you could to do to grow your skills and make yourself a better UX designer. Here are some ideas off the top of my head:
* Talk to your manager about how you can grow your skills to help the team out.
* Conduct a baseline usability study on the most recent version of the product that you d... | Do you know how successful you or your company's products are, that is do you know how happy your customers/users are and if they are able to accomplish what that want and if they have any issues that you can address?
I bet you could use more information on this subject, and you can work to get that information throug... |
35,540 | Tried searching for a similar question, but didn't find anything...
I was wondering if there are ways to increase my usefulness to my company, in my role as a UX designer. My skillsets primarily reside in UI design, and some front-end development work.
At the beginning, there was alot of UI design work to keep me bu... | 2013/02/27 | [
"https://ux.stackexchange.com/questions/35540",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/12472/"
] | There's a million things that you could to do to grow your skills and make yourself a better UX designer. Here are some ideas off the top of my head:
* Talk to your manager about how you can grow your skills to help the team out.
* Conduct a baseline usability study on the most recent version of the product that you d... | I think any part of the organization that comes into contact with end users or clients could do with some UX knowledge or skills. UX designers are there to put themselves in the shoes of someone from outside the company, and can provide a lot of useful input for not just the product development team, but the business, ... |
35,540 | Tried searching for a similar question, but didn't find anything...
I was wondering if there are ways to increase my usefulness to my company, in my role as a UX designer. My skillsets primarily reside in UI design, and some front-end development work.
At the beginning, there was alot of UI design work to keep me bu... | 2013/02/27 | [
"https://ux.stackexchange.com/questions/35540",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/12472/"
] | There's a million things that you could to do to grow your skills and make yourself a better UX designer. Here are some ideas off the top of my head:
* Talk to your manager about how you can grow your skills to help the team out.
* Conduct a baseline usability study on the most recent version of the product that you d... | Simply call all the customers and various kind of users and try to get some information about how your society can improve their experience with your product. You've got some work for many months.
If your product don't have any users, you've got a serious problem. |
35,540 | Tried searching for a similar question, but didn't find anything...
I was wondering if there are ways to increase my usefulness to my company, in my role as a UX designer. My skillsets primarily reside in UI design, and some front-end development work.
At the beginning, there was alot of UI design work to keep me bu... | 2013/02/27 | [
"https://ux.stackexchange.com/questions/35540",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/12472/"
] | Apart from improving the products at your company, you should look at building complimentary skills such as analytics, information architecture, and marketing with the goal of growing users.
These and other skills are converging at a point which people call growth hacking. See more at <https://www.google.com/search?q=... | I think any part of the organization that comes into contact with end users or clients could do with some UX knowledge or skills. UX designers are there to put themselves in the shoes of someone from outside the company, and can provide a lot of useful input for not just the product development team, but the business, ... |
35,540 | Tried searching for a similar question, but didn't find anything...
I was wondering if there are ways to increase my usefulness to my company, in my role as a UX designer. My skillsets primarily reside in UI design, and some front-end development work.
At the beginning, there was alot of UI design work to keep me bu... | 2013/02/27 | [
"https://ux.stackexchange.com/questions/35540",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/12472/"
] | There's a million things that you could to do to grow your skills and make yourself a better UX designer. Here are some ideas off the top of my head:
* Talk to your manager about how you can grow your skills to help the team out.
* Conduct a baseline usability study on the most recent version of the product that you d... | Apart from improving the products at your company, you should look at building complimentary skills such as analytics, information architecture, and marketing with the goal of growing users.
These and other skills are converging at a point which people call growth hacking. See more at <https://www.google.com/search?q=... |
35,540 | Tried searching for a similar question, but didn't find anything...
I was wondering if there are ways to increase my usefulness to my company, in my role as a UX designer. My skillsets primarily reside in UI design, and some front-end development work.
At the beginning, there was alot of UI design work to keep me bu... | 2013/02/27 | [
"https://ux.stackexchange.com/questions/35540",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/12472/"
] | Couple additional ideas
1. Start a UX brown bag activity. Find a topic that is interesting from UX standpoint (good/bad products, interesting UX/HCI article or research), send invite with reading material to discuss with people who might be interested. Have a informal presentation and discussion about what your learne... | I think any part of the organization that comes into contact with end users or clients could do with some UX knowledge or skills. UX designers are there to put themselves in the shoes of someone from outside the company, and can provide a lot of useful input for not just the product development team, but the business, ... |
35,540 | Tried searching for a similar question, but didn't find anything...
I was wondering if there are ways to increase my usefulness to my company, in my role as a UX designer. My skillsets primarily reside in UI design, and some front-end development work.
At the beginning, there was alot of UI design work to keep me bu... | 2013/02/27 | [
"https://ux.stackexchange.com/questions/35540",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/12472/"
] | User experience design is a comprehensive role and it is not limited to UI or interaction design alone. If you are looking to expand on your skill-set under UX umbrella and contribute to your organization more, you might want to look into following aspects to take its User Experience a level up further. Consider follow... | Simply call all the customers and various kind of users and try to get some information about how your society can improve their experience with your product. You've got some work for many months.
If your product don't have any users, you've got a serious problem. |
68,867,527 | I'm studying the KNN algorithm to classify images using some material from a 2017 Stanford course. We're given a dataset consisting of many images, later those sets are represented as 2D numpy arrays, and we're supposed to write functions that calculate distances between those images. More specifically, given a 2D arra... | 2021/08/20 | [
"https://Stackoverflow.com/questions/68867527",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10060701/"
] | You should pass the instance that you wish to update. Furthermore you should *not* return the outcome of the `.save()` method, but the data of the serializer, so:
```
def partial_update(self, request, pk=None):
instance = self.get_object()
serializer = UpdateDescriptionSerializer(
instance,
dat... | You should use 2 different serializers, of which 1 of them is dedicated to update your object e.g. `PhotoSerializer` and `UpdatePhotoSerializer`.
What I would suggest is to override the `get_serializer_class()` method as follows:
```py
def get_serializer_class(self):
if self.request.method == "PATCH": # add PUT t... |
697,715 | I have the following:
```
$ file DailyFollowUp.csv
DailyFollowUp.csv: Little-endian UTF-16 Unicode text, with very long lines, with CRLF, CR line terminators
$ iconv -c -t ascii DailyFollowUp.csv > output.txt
$ file output.txt
output.txt: data
```
I am expecting the output.txt file to give ASCII text as a result. An... | 2014/01/06 | [
"https://superuser.com/questions/697715",
"https://superuser.com",
"https://superuser.com/users/122439/"
] | If you do not specify the input encoding via `-f`, `iconv` uses the current locale as the default. It does not do any auto-detection. | Even I had the same problem. You have to specify the encoding type
<http://lifepluslinux.blogspot.in/2014/09/convert-little-endian-utf-16-to-ascii.html> |
34,851 | I'm on a ferry (in theory) this Friday afternoon from Fukuoka to Busan. [Typhoon Halong](http://www.weather.com/news/weather-hurricanes/super-typhoon-halong-japan-20140803) now appears to be heading towards that very stretch of sea.
Is there any advance notice of cancellations of ferries, or will I have to go to Fukuo... | 2014/08/06 | [
"https://travel.stackexchange.com/questions/34851",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/101/"
] | Screening at the gate is done at a number of other major airports, including Singapore Changi, Kuala Lumpur International, etc. And it has one *massive* advantage from the airport operator's point of view: **you don't need to separate arrivals and departures**.
This means that instead of essentially duplicating all ro... | It has several benefits:
* prevents ancillary staff like catering and shop workers from entering the secure area
* stops large quantities of goods used by catering and shops, etc. from having to be screened (not to mention that catering staff will have knives and so on to do their work).
* allows non-travellers to use... |
26,480,713 | I made a .bat script, but when I run it, it doesn't detect the included file in my php script.
.bat
```
"C:\xampp\php\php.exe" -f "D:/Projects/Web projects/done/sticky/test.php"
```
test.php
```
<?php
include 'db.php';
try {
//stm
$STH = $DBH->prepare( "INSERT INTO users (username... | 2014/10/21 | [
"https://Stackoverflow.com/questions/26480713",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2077972/"
] | Includes in PHP are relative to the current working directory, not the script's location. However, when accessing a PHP file via a webserver the CWD is usually the location of the script.
In your case you either need to change the directory before running the script or change it in your script using `chdir(__DIR__);` | ```
<?php
define('DS', DIRECTORY_SEPARATOR);
define('ROOT', dirname(__FILE__) . DS);
require_once(ROOT . 'db.php');
``` |
22,840,872 | There are more than one TR TD, same class name given in a table used for formatting without ID given.
I would like to seek help for jQuery. How can I retrieve / replace `<td>` content in the span id = payment\_currency\_text, class="formdata element?
1) To set a variable, store as `SGD`, getting from second set of TR... | 2014/04/03 | [
"https://Stackoverflow.com/questions/22840872",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3494123/"
] | to target `td.formdata` inside `span`.Try this:
**To get:**
```
var currency=$('#payment_currency_text .formdata').html();//currency will be SGD here
```
**To set:**
```
$('#payment_currency_text .formdata').html('EUR');
``` | If you just want to change the html inside the td, use like this
```
$(".formdata").html("some text or tags here");
```
If you want to get the text inside those td, use like this
```
$(".formdata").each(function(){
$(this).html();
});
```
**Edit**
```
$("#payment_currency_text").find(".formdata").html()
$("#... |
22,840,872 | There are more than one TR TD, same class name given in a table used for formatting without ID given.
I would like to seek help for jQuery. How can I retrieve / replace `<td>` content in the span id = payment\_currency\_text, class="formdata element?
1) To set a variable, store as `SGD`, getting from second set of TR... | 2014/04/03 | [
"https://Stackoverflow.com/questions/22840872",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3494123/"
] | If you know that its always going to be a specific child you can use the :nth-child() selector.
```
var setter = $("tr:nth-child(2) td:nth-child(2)").text();
$("tr:nth-child(2) td:nth-child(2)").text("EUR");
alert(setter)
```
Here is a fiddle <http://jsfiddle.net/87V9v/> | If you just want to change the html inside the td, use like this
```
$(".formdata").html("some text or tags here");
```
If you want to get the text inside those td, use like this
```
$(".formdata").each(function(){
$(this).html();
});
```
**Edit**
```
$("#payment_currency_text").find(".formdata").html()
$("#... |
22,840,872 | There are more than one TR TD, same class name given in a table used for formatting without ID given.
I would like to seek help for jQuery. How can I retrieve / replace `<td>` content in the span id = payment\_currency\_text, class="formdata element?
1) To set a variable, store as `SGD`, getting from second set of TR... | 2014/04/03 | [
"https://Stackoverflow.com/questions/22840872",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3494123/"
] | to target `td.formdata` inside `span`.Try this:
**To get:**
```
var currency=$('#payment_currency_text .formdata').html();//currency will be SGD here
```
**To set:**
```
$('#payment_currency_text .formdata').html('EUR');
``` | In jQuery you can replace the inner HTML of an element like so
```
$('.class-name').html("Some html in here");
```
However, be careful because this will replace the HTML for all classes of this name. |
22,840,872 | There are more than one TR TD, same class name given in a table used for formatting without ID given.
I would like to seek help for jQuery. How can I retrieve / replace `<td>` content in the span id = payment\_currency\_text, class="formdata element?
1) To set a variable, store as `SGD`, getting from second set of TR... | 2014/04/03 | [
"https://Stackoverflow.com/questions/22840872",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3494123/"
] | If you know that its always going to be a specific child you can use the :nth-child() selector.
```
var setter = $("tr:nth-child(2) td:nth-child(2)").text();
$("tr:nth-child(2) td:nth-child(2)").text("EUR");
alert(setter)
```
Here is a fiddle <http://jsfiddle.net/87V9v/> | In jQuery you can replace the inner HTML of an element like so
```
$('.class-name').html("Some html in here");
```
However, be careful because this will replace the HTML for all classes of this name. |
22,840,872 | There are more than one TR TD, same class name given in a table used for formatting without ID given.
I would like to seek help for jQuery. How can I retrieve / replace `<td>` content in the span id = payment\_currency\_text, class="formdata element?
1) To set a variable, store as `SGD`, getting from second set of TR... | 2014/04/03 | [
"https://Stackoverflow.com/questions/22840872",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3494123/"
] | to target `td.formdata` inside `span`.Try this:
**To get:**
```
var currency=$('#payment_currency_text .formdata').html();//currency will be SGD here
```
**To set:**
```
$('#payment_currency_text .formdata').html('EUR');
``` | You can use `text()` to get the data (plain text) as well as replace existing data with new one. If your replacement is HTML, you can use `html()`
```
var data=$('td.formdata').text();
alert("The value is"+data);
$('td.formdata').text("New Data");
``` |
22,840,872 | There are more than one TR TD, same class name given in a table used for formatting without ID given.
I would like to seek help for jQuery. How can I retrieve / replace `<td>` content in the span id = payment\_currency\_text, class="formdata element?
1) To set a variable, store as `SGD`, getting from second set of TR... | 2014/04/03 | [
"https://Stackoverflow.com/questions/22840872",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3494123/"
] | If you know that its always going to be a specific child you can use the :nth-child() selector.
```
var setter = $("tr:nth-child(2) td:nth-child(2)").text();
$("tr:nth-child(2) td:nth-child(2)").text("EUR");
alert(setter)
```
Here is a fiddle <http://jsfiddle.net/87V9v/> | You can use `text()` to get the data (plain text) as well as replace existing data with new one. If your replacement is HTML, you can use `html()`
```
var data=$('td.formdata').text();
alert("The value is"+data);
$('td.formdata').text("New Data");
``` |
22,840,872 | There are more than one TR TD, same class name given in a table used for formatting without ID given.
I would like to seek help for jQuery. How can I retrieve / replace `<td>` content in the span id = payment\_currency\_text, class="formdata element?
1) To set a variable, store as `SGD`, getting from second set of TR... | 2014/04/03 | [
"https://Stackoverflow.com/questions/22840872",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3494123/"
] | to target `td.formdata` inside `span`.Try this:
**To get:**
```
var currency=$('#payment_currency_text .formdata').html();//currency will be SGD here
```
**To set:**
```
$('#payment_currency_text .formdata').html('EUR');
``` | You can use:
```
$("#payment_currency_text").text("your text");
```
or
```
$("#payment_currency_text").html("your<b>text</b>");
``` |
22,840,872 | There are more than one TR TD, same class name given in a table used for formatting without ID given.
I would like to seek help for jQuery. How can I retrieve / replace `<td>` content in the span id = payment\_currency\_text, class="formdata element?
1) To set a variable, store as `SGD`, getting from second set of TR... | 2014/04/03 | [
"https://Stackoverflow.com/questions/22840872",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3494123/"
] | If you know that its always going to be a specific child you can use the :nth-child() selector.
```
var setter = $("tr:nth-child(2) td:nth-child(2)").text();
$("tr:nth-child(2) td:nth-child(2)").text("EUR");
alert(setter)
```
Here is a fiddle <http://jsfiddle.net/87V9v/> | You can use:
```
$("#payment_currency_text").text("your text");
```
or
```
$("#payment_currency_text").html("your<b>text</b>");
``` |
15,091,199 | I have a concurrent List used in multi-threaded environment. Once the List is built, mostly operation is traversing it. I am wondering which of the following 2 methods are more efficient, or what's cost of creating a new List vs using synchronized? Or maybe there are other better ways?
```
List<Object> list = new Copy... | 2013/02/26 | [
"https://Stackoverflow.com/questions/15091199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1411449/"
] | Here is what I usually use:
```
public static String removeExtraSpaces(String input) {
return input.trim().replaceAll(" +", " ");
}
```
`trim` removes beginning and ending spaces while `replaceAll` replaces any line of spaces by one single space. | ```
public class Trimimg
{
public static void main(String[]args)
{
String str = "AASS MON 01 2013 365.00 HJJ Call";
String newStr = str.replace(" HJJ", "");
System.out.println(newStr);
}
}
``` |
9,622,604 | When I click on this checkbox (inside the Modal form)
```
<input id="selectallcreate" type="checkbox" value="1" name="selectallcreate">
```
It will always return **False** using this code
```
if ($('#selectallcreate').is(':checked') == true){};
```
Also this code will work perfectly on any page that are **NOT** ... | 2012/03/08 | [
"https://Stackoverflow.com/questions/9622604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/490570/"
] | Be sure in your DOM that there's only ONE instance of id `selectallcreate`. You might be surprised to find that you have two. It's happened to me. I'd say, try locating the checkbox by `$('QueryToGetDialogDiv').find("#selectallcreate")`, so you can be sure you're grabbing the correct div. | The code you have shared looks fine. It should work fine as long as there are no other script errors.
[**DEMO here**](http://jsfiddle.net/skram/cGJrr/2/)
Please try the demo and let us know if it is different from your code. |
64,430,706 | I have an AVRO schema with an array field. This array field has items being an object of another AVRO schema. Below is the code I have right now.
```
{
"name": "bars",
"type": ["null", {
"type": "array",
"items": "com.example.Bar"
}],
"default": null
}
```
This code is the field definition for "bars"... | 2020/10/19 | [
"https://Stackoverflow.com/questions/64430706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5420108/"
] | Default values for union fields correspond to the [first schema in the union](https://avro.apache.org/docs/current/spec.html#schema_record). If the default value is an array, then the array schema should be the first schema in the union.
```
"type": [
{
"type": "array",
"items": "com.example.Bar"
},
"nul... | The problem is I was allowing "null" to be the type for the array field. I guess if I want to pre-populate the default fields with values I cannot allow null.
So the following code fixes the problem.
```
{
"name": "bars",
"type": {
"type": "array",
"items": "com.example.Bar"
},
"default": [{"name": "b... |
4,255,865 | How can I make `git push` to push not only to `origin` but also another remote repository?
as `git push` is only an alias for `git push origin`, can I alias git push to push to 2 remote repositories at once (with just that one command)?
I’m not looking for a non-git script here but would like to set this up for my lo... | 2010/11/23 | [
"https://Stackoverflow.com/questions/4255865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/392626/"
] | I don't think you can do it just by setting a flag on git, but you can modify a config file that will allow you to push to multiple remote repositories without manually typing them all in (well only typing them in the first time and not after)
In the `.git/config` file you can add multiple urls to a defined remote:
`... | No manual editing
-----------------
You can add multiple URLs to a remote branch (e.g. `all`) directly from command line by using `git config --add remote.xyz.url` with different URLs:
```bash
git config --add remote.all.url ssh://user@server/repos/g0.git
git config --add remote.all.url ssh://user@server/repos/g1.git... |
4,255,865 | How can I make `git push` to push not only to `origin` but also another remote repository?
as `git push` is only an alias for `git push origin`, can I alias git push to push to 2 remote repositories at once (with just that one command)?
I’m not looking for a non-git script here but would like to set this up for my lo... | 2010/11/23 | [
"https://Stackoverflow.com/questions/4255865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/392626/"
] | I don't think you can do it just by setting a flag on git, but you can modify a config file that will allow you to push to multiple remote repositories without manually typing them all in (well only typing them in the first time and not after)
In the `.git/config` file you can add multiple urls to a defined remote:
`... | You can also get url from configured remotes :
```
for repo in g0 g1 ...
do
git config --add remote.all.url `git config remote.$repo.url`
done
```
where g0, g1, ... are the names of your remotes. |
4,255,865 | How can I make `git push` to push not only to `origin` but also another remote repository?
as `git push` is only an alias for `git push origin`, can I alias git push to push to 2 remote repositories at once (with just that one command)?
I’m not looking for a non-git script here but would like to set this up for my lo... | 2010/11/23 | [
"https://Stackoverflow.com/questions/4255865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/392626/"
] | No manual editing
-----------------
You can add multiple URLs to a remote branch (e.g. `all`) directly from command line by using `git config --add remote.xyz.url` with different URLs:
```bash
git config --add remote.all.url ssh://user@server/repos/g0.git
git config --add remote.all.url ssh://user@server/repos/g1.git... | You can also get url from configured remotes :
```
for repo in g0 g1 ...
do
git config --add remote.all.url `git config remote.$repo.url`
done
```
where g0, g1, ... are the names of your remotes. |
25,621,138 | I have one div where timer is set. On submit of page I want div value to insert into database
I am trying to post it using ajax.Here is my code
In this , instead of name I want to send div value.
I tried to get value using getElementById but not getting how to pass it.
or else there any other way to get div value and... | 2014/09/02 | [
"https://Stackoverflow.com/questions/25621138",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2219767/"
] | Given I don't know much about PSSE, you can try the following:
```
import sys
import io
out, err = io.StringIO(), io.StringIO()
sys.stdout = out
sys.stderr = err
# rest of your code here
# once your code is finished
results = out.getvalue()
errors = err.getvalue()
``` | My favorite solution so far is based on @J.F Sebastian answer [Redirect stdout to a file in Python?](https://stackoverflow.com/questions/4675728/redirect-stdout-to-a-file-in-python/22434262#22434262).
Using the `psspy.report_output()` and related functions at first seemed like the best option, but they are a little p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.