seq

Compare strings inside in the two different directories using array

别来无恙 提交于 2019-12-25 02:53:21
问题 I don't get the scenario of this given code. All I wanted is to compare the files that is given below. But, in this script nothings happen. I assume that this given code can executed wherever like in /root and it will run. Please check this out. #!/bin/bash for file in /var/files/sub/old/* do # Strip path from file name file="${file##*/}" # Strip everything after the first hyphen prefix="${file%%-*}-" # Strip everything before the second-to-last dot suffix="$(echo $file | awk -F. '{ print "."

WGET ignoring --content-disposition?

試著忘記壹切 提交于 2019-12-24 15:28:47
问题 I am trying to run a command to download 3000 files in parallel. I am using Cygwin + Windows. Downloading a single file via WGET in terminal : wget --no-check-certificate --content-disposition --load-cookies cookies.txt \ -p https://username:password@website.webpage.com/folder/document/download/1?type=file allows me to download the file with ID 1 singularly, in the correct format (as long as --content-disposition is in the command). I iterate over this REST API call to download the entire

R seq function produces wrong results [closed]

徘徊边缘 提交于 2019-12-23 20:40:49
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . It seems that one of my machines produces wrong results for seq function while another machine or the online r-fiddle (http://www.r-fiddle.org) interpreter give expected results. On the machine in question following happens: seq(from = 1, to = 1.1, by = 0.01) [1] 1.0 1.0 1.0 1.0 1.0 1.0 1.1 1.1 1.1 1.1 1.1

Only first logging shows unless forcefully disposing

◇◆丶佛笑我妖孽 提交于 2019-12-23 18:22:38
问题 I'm using vs 2017, writing a netcoreapp2.0 library, and testing it with a UnitTest project (XUnit and NUnit give same results). I've noticed that unless I'm forcefully Disposing of my Serilog logger, only the first line will end up in Seq . Here are my 2 classes. The library one: public class Class1 { public static Logger _log; public Class1(Logger log) { _log = log; _log.Verbose("Class 1 constructor fineshed"); } public void LogMessage(string s) { _log.Debug("Got message: {Message}", s); } }

Why does function containing Console.ReadLine() not complete?

跟風遠走 提交于 2019-12-23 10:25:51
问题 I am using Visual Studio 2012, and the function that calls Console.ReadLine() will not execute let inSeq = readlines () in this simple program open System open System.Collections.Generic open System.Text open System.IO #nowarn "40" let rec readlines () = seq { let line = Console.ReadLine() if not (line.Equals("")) then yield line yield! readlines () } [<EntryPoint>] let main argv = let inSeq = readlines () 0 I've been experimenting and researching this, and cannot see what is probably a very

How in OS/X to get 'seq' command-line functionality?

前提是你 提交于 2019-12-22 10:57:29
问题 I'm still on Snow Leopard (I know...) so forgive if this is fixed in one of the later versions of OS/X, but I want to do standard "seq" aka: for i in `seq 1 100` ; do cat /whatever > $i.txt ; done I thought installing GNU tools would do it, but apparently not. 回答1: On my mac both of these work (OS X 10.8.5) Andreas-Wederbrands-MacBook-Pro:~ raven$ for i in {1..10}; do echo $i; done 1 2 3 4 5 6 7 8 9 10 Andreas-Wederbrands-MacBook-Pro:~ raven$ for i in `seq 1 10`; do echo $i; done 1 2 3 4 5 6

seq uses comma as decimal separator

空扰寡人 提交于 2019-12-21 09:16:11
问题 I have noticed a strange seq behavior on one of my computers (Ubuntu LTS 14.04): instead of using points as decimal separator it is using commas: seq 0. 0.1 0.2 0,0 0,1 0,2 The same version of seq (8.21) on my other PC gives the normal points (also same Ubuntu version). The strangest thing is that I am observing the same ill behavior on a remote machine when I ssh into it from the first machine. Even a bash script submitted from the conflictive machine to a job scheduler (slurm) on the remote

How do I generate a list with a specified increment step?

北城余情 提交于 2019-12-20 15:45:15
问题 How do I generate a vector with a specified increment step (e.g. 2)? For example, how do I produce the following 0 2 4 6 8 10 回答1: Executing seq(1, 10, 1) does what 1:10 does. You can change the last parameter of seq , i.e. by , to be the step of whatever size you like. > #a vector of even numbers > seq(0, 10, by=2) # Explicitly specifying "by" only to increase readability > [1] 0 2 4 6 8 10 回答2: You can use scalar multiplication to modify each element in your vector. > r <- 0:10 > r <- r * 2

Why Seq.tail is not an option

99封情书 提交于 2019-12-20 02:31:19
问题 My question is when entering Seq. why is there no Seq.tail function? In this code that does not convert a sequence to a list, there is no Seq.tail function available in the recursive function. Is it because Seq.initInfinte was used to to create the sequence, or is there another reason? open System let readList() = Seq.initInfinite (fun _ -> Console.ReadLine()) |> Seq.takeWhile (fun s -> (s <> "")) |> Seq.map (fun x -> Int32.Parse(x)) let rec listLen list1 acc = if Seq.isEmpty list1 then acc

Mysterious behaviour of seq and == operator. A precision issue?

早过忘川 提交于 2019-12-20 01:37:31
问题 I've come across a somehow weird (or just not expected?) behaviour of the function seq . When creating a simple sequence some values cannot be matched correctly with the == operator. See this minimal example: my.seq <- seq(0, 0.4, len = 5) table(my.seq) # ok! returns 0 0.1 0.2 0.3 0.4 # 1 1 1 1 1 which(my.seq == 0.2) # ok! returns 3 which(my.seq == 0.3) # !!! returns integer(0) When creating my sequence manually, it seems to work, though: my.seq2 <- c(0.00, 0.10, 0.20, 0.30, 0.40) which(my