output

get a list of all 1st level directories impacted by recent commits for a git monorepo

百般思念 提交于 2020-01-13 19:04:46
问题 I am currently playing with monorepos and I am trying to retrieve a list all 1 level subfolders in the repo which are impacted since a given commit. So far I can retrieve all the files impacted using git diff --name-only $COMMIT_ID..head Using git diff --name-only $COMMIT_ID..head | xargs -L1 dirname I manage to get only the folder names. To remove all the duplicates I added sort | uniq to the mix: git diff --name-only $COMMIT_ID..head | xargs -L1 dirname | sort | uniq All I need now is to

get a list of all 1st level directories impacted by recent commits for a git monorepo

戏子无情 提交于 2020-01-13 19:04:07
问题 I am currently playing with monorepos and I am trying to retrieve a list all 1 level subfolders in the repo which are impacted since a given commit. So far I can retrieve all the files impacted using git diff --name-only $COMMIT_ID..head Using git diff --name-only $COMMIT_ID..head | xargs -L1 dirname I manage to get only the folder names. To remove all the duplicates I added sort | uniq to the mix: git diff --name-only $COMMIT_ID..head | xargs -L1 dirname | sort | uniq All I need now is to

Suppress output of stationarity test that is printed to screen

橙三吉。 提交于 2020-01-13 09:59:06
问题 How do I get the stationarity test from the fractal package in R to not print any output to the screen. For example, with the shapiro.wilk test when setting the result as a variable it does not give any output as follows lg.day.ret.vec <- rnorm(100, mean = 5, sd = 3) shap.p <- shapiro.test(lg.day.ret.vec)$p.value This is the case for most tests but when I do it for the stationarity test I get some output in the r console. library(fractal) stat.p <- attr(stationarity(lg.day.ret.vec),"pvals")[1

Prohibit automatic linebreaks in Pycharm Output when using large Matrices

最后都变了- 提交于 2020-01-11 11:17:26
问题 I'm working in PyCharm on Windows. In the project I'm currently working on I have "large" matrices, but when i output them Pycharm automatically adds linebreaks so that one row occupys two lines instead of just one: [[ 3. -1.73205081 0. 0. 0. 0. 0. 0. 0. 0. ] [-1.73205081 1. -1. -2. 0. 0. 0. 0. 0. 0. ] [ 0. -1. 1. 0. -1.41421356 0. 0. 0. 0. 0. ] [ 0. -2. 0. 1. -1.41421356 0. -1.73205081 0. 0. 0. ] [ 0. 0. -1.41421356 -1.41421356 0. -1.41421356 0. -1.41421356 0. 0. ] [ 0. 0. 0. 0. -1.41421356

How to redirect grep output to a variable?

怎甘沉沦 提交于 2020-01-11 09:30:11
问题 I have some pipe. For example, I have this pipe: user@user:~$ cal | head -1 | grep -oP "[A-Za-z]+" For this pipe I get this result: September I want to store this result to a variable. I write the following commands: user@user:~$ cal | head -1 | month=$(grep -oP "[A-Za-z]+") | echo $month And I get the blank string. What is the problem? 回答1: month=$(cal | head -1 | grep -oP "[A-Za-z]+") or month=$(date +%B) 来源: https://stackoverflow.com/questions/25710640/how-to-redirect-grep-output-to-a

New line in PHP output in a text file

让人想犯罪 __ 提交于 2020-01-11 00:48:07
问题 My php form which saves the output in a text file glues the result to one string like: Name1Email1The Message1Name2Email2The Message2Name3Email3The Message3Name4Email4The Message4 But I need spaces and/or newlines. I normaly don't use PHP so I don't get it. I did't find an answer on the web, also read some Q/A here, but this didn't help me. The Form: <form action="mailer.php?savedata=1" method="post"> Your Name: <input type="text" name="name"><br> Your Email: <input type="text" name="email">

Print Integer with 2 decimal places in Java

不打扰是莪最后的温柔 提交于 2020-01-10 01:02:48
问题 in my code i use integers multiplied by 100 as decimals (0.1 is 10 etc). Can you help me to format output to show it as decimal? 回答1: int x = 100; DecimalFormat df = new DecimalFormat("#.00"); // Set your desired format here. System.out.println(df.format(x/100.0)); 回答2: I would say to use 0.00 as format: int myNumber = 10; DecimalFormat format = new DecimalFormat("0.00"); System.out.println(format.format(myNumber)); It will print like: 10.00 The advantage here is: If you do like: double

h:outputText does not break \r\n characters into new lines

偶尔善良 提交于 2020-01-09 01:56:25
问题 I have a String variable which contains carriage returns and new lines \r\n . text = "Text1\r\nText2\r\nText3"; I'm presenting it using <h:outputtext> . <h:outputText value="#{bean.text}" /> But it doesn't recognize the new line characters and shows as below in webbrowser. Text1 Text2 Text3 Why doesn't the <h:outputText> break \n into new lines? What should I do? Do I have to replace \n with <br /> ? 回答1: Linebreaks in HTML are represented by <br /> element, not by the \n character. Even more

bash: displaying filtered & dynamic output of ffmpeg

折月煮酒 提交于 2020-01-06 14:47:08
问题 After this question whose the answer had partially resolved my problem. I would like to have a selected result of ffmpeg. So, with this command: ffmpeg -y -i "${M3U2}" -vcodec copy -acodec copy "${Directory}/${PROG}_${ID}.mkv" 2>&1 | egrep -e '^[[:blank:]]*(Duration|Output|frame)' The result is: Duration: 00:12:28.52, start: 0.100667, bitrate: 0 kb/s Output #0, matroska, to '/home/path/file.mkv': But in the result I am missing this dynamic line: frame= 1834 fps=166 q=-1.0 Lsize= 7120kB time

Why fgets is not inputting first value?

邮差的信 提交于 2020-01-06 13:53:14
问题 I am writing a program to write my html files rapidly. And when I came to write the content of my page I got a problem. #include<stdio.h> int main() { int track; int question_no; printf("\nHow many questions?\t"); scanf("%d",&question_no); char question[question_no][100]; for(track=1;track<=question_no;track++) { printf("\n<div class=\"question\">%d. ",track); printf("\nQuestion number %d.\t",track); fgets(question[track-1],sizeof(question[track-1]),stdin); printf("\n\n\tQ%d. %s </div>",track