loops

Start-Process with Process Priority in Loop doesn't recognize variable

烈酒焚心 提交于 2020-06-01 05:06:45
问题 I'm using FFmpeg with PowerShell. I have a loop that goes through a folder of mpg files and grabs the names to a variable $inputName . FFmpeg then converts each one to an mp4 . Works Batch Processing $files = Get-ChildItem "C:\Path\" -Filter *.mpg; foreach ($f in $files) { $inputName = $f.Name; #name + extension $outputName = (Get-Item $inputName).Basename; #name only ffmpeg -y -i "C:\Users\Matt\Videos\$inputName" -c:v libx264 -crf 25 "C:\Users\Matt\Videos\$outputName.mp4" } Not Working Batch

Start-Process with Process Priority in Loop doesn't recognize variable

佐手、 提交于 2020-06-01 05:06:21
问题 I'm using FFmpeg with PowerShell. I have a loop that goes through a folder of mpg files and grabs the names to a variable $inputName . FFmpeg then converts each one to an mp4 . Works Batch Processing $files = Get-ChildItem "C:\Path\" -Filter *.mpg; foreach ($f in $files) { $inputName = $f.Name; #name + extension $outputName = (Get-Item $inputName).Basename; #name only ffmpeg -y -i "C:\Users\Matt\Videos\$inputName" -c:v libx264 -crf 25 "C:\Users\Matt\Videos\$outputName.mp4" } Not Working Batch

pySpark iterating repetitive variables

孤者浪人 提交于 2020-06-01 04:02:13
问题 I have a code that currently works, however I'm looking to make it more efficient and avoid hard coding: 1) avoid hard coding: for NotDefined_filterDomainLookup will like to reference the default_reference df for the corresponding Code and Name when Id = 4. Instead of hard coding the Code and Name value. 2) I repeat the same code and process for Id/Code/Name. Is there a way to loop all of that instead of coding each scenario? How can I iterate over the current logic? Question 1 list of

How to display real dates in a loop in r

ぐ巨炮叔叔 提交于 2020-05-30 08:42:07
问题 When I iterate over dates in a loop, R prints out the numeric coding of the dates. For example: dates <- as.Date(c("1939-06-10", "1932-02-22", "1980-03-13", "1987-03-17", "1988-04-14", "1979-08-28", "1992-07-16", "1989-12-11"), tryFormats = c("%Y-%m-%d")) for(d in dates){ print(d) } The output is as follows: [1] -11163 [1] -13828 [1] 3724 [1] 6284 [1] 6678 [1] 3526 [1] 8232 [1] 7284 How do I get R to print out the actual dates? So the output reads: [1] "1939-06-10" [1] "1932-02-22" [1] "1980

Combining the output of multiple loops in Ansible

↘锁芯ラ 提交于 2020-05-29 12:24:05
问题 I am working with Ansible and in my playbook I am running the following task, in which I have multiple loops so as to retrieve different tags from a specific xml: - name: Retrieve multiple xml tags valuei xml: xmlstring: "{{ item.string }}" xpath: "{{ item.path }}" content: text loop: - { path: "/rpc-reply/vlan-instance-information/vlan-instance-group/vlan-member/vlan-tag", string: "{{topology.xml}}" } - { path: "/rpc-reply/vlan-instance-information/vlan-instance-group/vlan-member/vlan-member

Loop to dynamically fill dataframe R

时光总嘲笑我的痴心妄想 提交于 2020-05-29 09:18:36
问题 I am running a for loop to fill dynamically a dataframe (I know a baby seal dies somewhere because I am using a for loop) I have something like this in mind (the 5 is a placeholder for a function that returns a scalar): results<-data.frame(matrix(NA, nrow = length(seq(1:10)), ncol = length(seq(1:10)))) rows<-data.frame(matrix(NA, nrow = 1, ncol = 1)) for (j in seq(1:10)){ rows<-data.frame() for (i in seq(1:10)){ rows<-cbind(rows,5) } results<-cbind(results,rows) } I get the following error

Python - Read comma separated values from a text file, then output result to text file [closed]

为君一笑 提交于 2020-05-25 08:28:20
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Basically I need to create a program that will add numbers read from a text file separated by commas. ie in file.txt 1,2,3 4,5,6 7,8,9 So far I have the simple code x = 1 y = 2 z = 3 sum=x+y+z print(sum) I'm not sure how I would assign each number in the text file to x,y,z. What I

Python - Read comma separated values from a text file, then output result to text file [closed]

拈花ヽ惹草 提交于 2020-05-25 08:28:11
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Basically I need to create a program that will add numbers read from a text file separated by commas. ie in file.txt 1,2,3 4,5,6 7,8,9 So far I have the simple code x = 1 y = 2 z = 3 sum=x+y+z print(sum) I'm not sure how I would assign each number in the text file to x,y,z. What I

How to make this script loop every hour

守給你的承諾、 提交于 2020-05-24 06:03:27
问题 I'm creating a bot that posts every 60 minutes covid numbers, I have it finished but idk how to make it repeat. Any idea? It's a little project that I have in mind and it's the last thing I have to do. (if you answer the code from the publication with inside the solution it would be very cool) import sys CONSUMER_KEY = 'XXXX' CONSUMER_SECRET = 'XXXX' ACCESS_TOKEN = 'XXXX' ACCESS_TOKEN_SECRET = 'XXXX' import tweepy import requests from lxml import html def create_tweet(): response = requests

How can you make the previous line disappear in python?

泪湿孤枕 提交于 2020-05-24 03:41:06
问题 I'm making a constellation that starts from (0,0). The previous line has to disappear after a two second delay and when the left is clicked within the two second delay, white circles should appear. I don't know why my timer isn't working and I'm not sure how to make the line disappear. Also the circles don't appear. This is my code from pygame import * import random init() size = width, height = 700, 700 screen = display.set_mode(size) button = 0 BLACK = (0, 0, 0) GREEN = (0, 255, 0) RED =