output

Redirecting command output in docker

孤者浪人 提交于 2019-11-26 18:12:16
问题 I want to do some simple logging for my server which is a small Flask app running in a Docker container. Here is the Dockerfile # Dockerfile FROM dreen/flask MAINTAINER dreen WORKDIR /srv # Get source RUN mkdir -p /srv COPY perfektimprezy.tar.gz /srv/perfektimprezy.tar.gz RUN tar x -f perfektimprezy.tar.gz RUN rm perfektimprezy.tar.gz # Run server EXPOSE 80 CMD ["python", "index.py", "1>server.log", "2>server.log"] As you can see on the last line I redirect stderr and stdout to a file. Now I

Output formatting: too much whitespace in gfortran

坚强是说给别人听的谎言 提交于 2019-11-26 18:01:37
Using gfortran 4.6. This code: PROGRAM f1 IMPLICIT NONE INTEGER :: i=1, j=3 WRITE(*,*) "integer i is ", i, ", and j is ", j, "." END PROGRAM f1 produces this console output, which has way too much whitespace: integer i is 1 , and j is 3 . Is there some setting I can set so that there is no space before the first token ("integer"), and so the whitespace between tokens is just one space? I know one fix is WRITE(*,'(A,I1,A,I1,A)') "integer i is ", i, ", and j is ", j, "." but this seems very cumbersome to have to do every time I have a print statement - would rather it be somewhat more like C++

How to create multiple output paths in Webpack config

旧城冷巷雨未停 提交于 2019-11-26 15:37:46
Does anyone know how to create multiple output paths in a webpack.config.js file? I'm using bootstrap-sass which comes with a few different font files, etc. For webpack to process these i've included file-loader which is working correctly, however the files it outputs are being saved to the output path i specified for the rest of my files: output: { path: __dirname + "/js", filename: "scripts.min.js" } I'd like to achieve something where I can maybe look at the extension types for whatever webpack is outputting and for things ending in .woff .eot, etc, have them diverted to a different output

How to clear previously echoed items in PHP

让人想犯罪 __ 提交于 2019-11-26 15:37:26
问题 In php, is there any way to clear/remove all previously echoed or printed items? For example: <?php echo 'a'; print 'b'; // some statement that removes all printed/echoed items echo 'c'; // the final output should be equal to 'c', not 'abc' ?> My script uses the include function. The included files are not supposed to echo anything. Just in case someone (ex = hacker) tries, I need a way to remove. 回答1: <?php ob_start(); echo 'a'; print 'b'; // some statement that removes all printed/echoed

How to specify download location in Html using JavaScript

蹲街弑〆低调 提交于 2019-11-26 14:54:25
问题 is it possible to specify the download location for a file from a Html page using JavaScript? the function I am currently using to down my file is provided below. function saveTextAsFile() { var textToWrite = document.getElementById("inputTextToSave").value; var textFileAsBlob = new Blob([textToWrite], {type:'xlsx'}); var fileNameToSaveAs = "NAME.csv"; var downloadLink = document.createElement("a"); downloadLink.download = fileNameToSaveAs; window.URL = window.URL || window.webkitURL;

Visual Studio 2012 C++ Standard Output

耗尽温柔 提交于 2019-11-26 14:46:53
问题 Where does fprintf(stdout/stderr) print to in Visual Studio when compiling Win32 app? I keep hearing it goes to the output but I can't see it!. Whats the standard way of printing to the output log without having a console window in c++? 回答1: If your program is linked with /SUBSYSTEM:WINDOWS you will not see the console output unless you allocate a console. Here is code for the allocate console option.With this method you should not need to mess with linker settings or create a WinMain. static

U-SQL Output in Azure Data Lake

守給你的承諾、 提交于 2019-11-26 14:25:26
问题 Would it be possible to automatically split a table into several files based on column values if I don't know how many different key values the table contains? Is it possible to put the key value into the filename? 回答1: This is our top ask (and has been previously asked on stackoverflow too :). We are currently working on it and hopefully have it available by summer. Until then you have to write a script generator. I tend to use U-SQL to generate the script but you could do it with Powershell

How to read a CSV file from a URL with Python?

梦想与她 提交于 2019-11-26 12:55:44
问题 when I do curl to a API call link http://example.com/passkey=wedsmdjsjmdd curl \'http://example.com/passkey=wedsmdjsjmdd\' I get the employee output data on a csv file format, like: \"Steve\",\"421\",\"0\",\"421\",\"2\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"421\",\"0\",\"421\",\"2\" how can parse through this using python. I tried: import csv cr = csv.reader(open(\'http://example.com/passkey=wedsmdjsjmdd\',\"rb\")) for row in cr: print row but it didn\'t work and I got an error http:/

How to pipe stdout while keeping it on screen ? (and not to a output file)

冷暖自知 提交于 2019-11-26 12:49:29
问题 I would like to pipe standard output of a program while keeping it on screen. With a simple example ( echo use here is just for illustration purpose) : $ echo \'ee\' | foo ee <- the output I would like to see I know tee could copy stdout to file but that\'s not what I want. $ echo \'ee\' | tee output.txt | foo I tried $ echo \'ee\' | tee /dev/stdout | foo but it does not work since tee output to /dev/stdout is piped to foo 回答1: Here is a solution that works at on any Unix / Linux

Output formatting: too much whitespace in gfortran

心已入冬 提交于 2019-11-26 12:15:37
问题 Using gfortran 4.6. This code: PROGRAM f1 IMPLICIT NONE INTEGER :: i=1, j=3 WRITE(*,*) \"integer i is \", i, \", and j is \", j, \".\" END PROGRAM f1 produces this console output, which has way too much whitespace: integer i is 1 , and j is 3 . Is there some setting I can set so that there is no space before the first token (\"integer\"), and so the whitespace between tokens is just one space? I know one fix is WRITE(*,\'(A,I1,A,I1,A)\') \"integer i is \", i, \", and j is \", j, \".\" but