command-line

Running JavaScript from the windows command prompt

做~自己de王妃 提交于 2020-05-26 19:17:00
问题 I wrote the following JavaScipt code which converts a binary number into a decimal number: (function bin_dec(num) { var x = num; var result = 0; for (var i = 0; i < x.length; i++) { result += eval(x[x.length - i] * 2^i); } return result; })() I want to be able to run this code from the command-line. The filename is converter.js and I am running the command prompt window in the same directory as the file. I am trying to run this code using 01001100 as the function argument. Here are my

Capture microphone input with ffmpeg on Mac and streaming

房东的猫 提交于 2020-05-26 04:52:41
问题 I am trying to capture the microphone input on my MacBook (default mic) and streaming this via rtp:// but I'm unable to find anything on how to do this. I tried using VLC but no luck either. I want to do this command line. With the below command the streaming works but I don't know how to adjust this command to specify it needs to use the microphone as input. Anyone can help me? ./ffmpeg -re -f lavfi -i aevalsrc="sin(400*2*PI*t)" -ar 8000 -f mulaw -f rtp rtp://127.0.0.1:1234 回答1: Here how to

Locally installed gulp not running in command line?

橙三吉。 提交于 2020-05-24 21:12:05
问题 I am new to nodejs and gulp stuff. I working on a nodejs project in which I have to run jslint on all the files. I am using gulp for this purpose. My problem is that In order to run gulp on cli I don't want to install gulp globally and also does not want to update my path variable, So I have installed gulp and other node modules in my project locally using the package.json file cd myproject npm install Since I don't want to install gulp globally and want to run the local gulp I have added

Locally installed gulp not running in command line?

↘锁芯ラ 提交于 2020-05-24 21:11:12
问题 I am new to nodejs and gulp stuff. I working on a nodejs project in which I have to run jslint on all the files. I am using gulp for this purpose. My problem is that In order to run gulp on cli I don't want to install gulp globally and also does not want to update my path variable, So I have installed gulp and other node modules in my project locally using the package.json file cd myproject npm install Since I don't want to install gulp globally and want to run the local gulp I have added

How to fix RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters 1, True not updating every time

萝らか妹 提交于 2020-05-24 03:56:06
问题 I have had a look at this StackOverflow article and the same thing applies to me. Why is it that RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters 1, True does not work everytime? Is there some other way to make it work rather than repeating that until it works or is there some way to code it so that it works? .cmd , .bat and .ps1 is fine) Or is the best/only way to run it alot of times so that it works Right now my solution is to just run that multiple time until it works. Is there any

Visual studio code cmd error: Cannot be loaded because running scripts is disabled on this system

元气小坏坏 提交于 2020-05-22 11:26:06
问题 Inside of visual studio code, I'm trying to execute a script.bat from the command line, but I'm getting the following error: File C:\Theses_Repo\train-cnn\environment\Scripts\activate.ps1 cannot be loaded because running scripts is disabled on this system. After reading this I tried to run the visual studio code in administrator mode, thinking that the problem was a matter of privileges. But the error is throwing anyway. 回答1: I found out here that you can add to your visual studio code

How to convert multiple python files to EXE?

一世执手 提交于 2020-05-15 07:17:22
问题 I am trying to convert my python application to an exe. I have seen things like py2exe and cx freeze, but they only compile one single py file. Can anyone help me? Thank you 回答1: For example in PyInstaller, you can specify additional folders which should be involved in your executable file. 回答2: I currently use pyinstaller for building projects into single-executable files. These projects all contain multiple python (and some non-python) files that are all "built into" the exes. That being

Generating an RSA key pair in powershell

房东的猫 提交于 2020-05-15 05:01:49
问题 I want to generate an RSA public private key pair in powershell without using external software and I want to test it. It should be able to encrypt/decrypt data on any online public/private key verification service. Purpose- Strictly Educational. I'm very well aware that you shouldn't export your private key online for security purposes. So far I've tried ssh-keygen and $RSA = New-Object System.Security.Cryptography.RSACryptoServiceProvider(2048) [System.Convert]::ToBase64String($rsa

How to change directory with BAT file?

大憨熊 提交于 2020-05-14 03:41:08
问题 I would expect the below code to open up in the C:\Users\zjafri\Desktop\Arthur\Runner2 directory when running this bat file, but instead it opens up to my desktop directory. Does somebody have an idea why? %windir%\system32\cmd.exe "/K" C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3 CD C:\Users\zjafri\Desktop\Arthur\Runner2 The console output is: C:\Users\zjafri\Desktop>C:\windows\system32\cmd.exe "/K" C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData

How to change directory with BAT file?

烂漫一生 提交于 2020-05-14 03:37:30
问题 I would expect the below code to open up in the C:\Users\zjafri\Desktop\Arthur\Runner2 directory when running this bat file, but instead it opens up to my desktop directory. Does somebody have an idea why? %windir%\system32\cmd.exe "/K" C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3 CD C:\Users\zjafri\Desktop\Arthur\Runner2 The console output is: C:\Users\zjafri\Desktop>C:\windows\system32\cmd.exe "/K" C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData