ps

How `[System.Console]::OutputEncoding/InputEncoding` with Python?

匿名 (未验证) 提交于 2019-12-03 01:49:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Under Powershell v5, Windows 8.1, Python 3. Why these fails and how to fix? [system.console]::InputEncoding = [System.Text.Encoding]::UTF8; [system.console]::OutputEncoding = [System.Text.Encoding]::UTF8; chcp; "import sys print(sys.stdout.encoding) print(sys.stdin.encoding) sys.stdout.write(sys.stdin.readline()) " | sc test.py -Encoding utf8; [char]0x0422+[char]0x0415+[char]0x0421+[char]0x0422+"`n" | py -3 test.py prints: 回答1: You are piping data into Python; at that point Python's stdin is no longer attached to a TTY (your console) and won

Access namespaced javascript object by string name without using eval

匿名 (未验证) 提交于 2019-12-03 01:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I ran into a situation where I need access to a javascript object from the server. The server returns the string name of the function or object and based on other metadata I will evaluate the object differently. Originally I was evaluating ( eval([string]) ) and everything was fine. Recently I was updating the function to not use eval for security peace of mind, and I ran into an issue with namespaced objects/functions. Specifically I tried to replace an eval([name]) with a window[name] to access the object via the square bracket syntax from

ps -aux|grep mysql时候报错:Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ

戏子无情 提交于 2019-12-03 01:41:23
ps -aux|grep mysql 时候报错:Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ 解决办法,去掉-aux前面的“-”就好了。 ps aux |grep mysql aux各选项的意思是: a-显示所有用户的进程 u-显示进程的用户和拥有者 x-显示不依附于终端的进程 来源: https://www.cnblogs.com/yyl6/p/11353181.html

Remove all stopped containers: “docker rm” requires at least 1 argument

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm reading a book on docker. It is a couple of years old. I'll cite: If you want to get rid of all your stopped containers, you can use the output of docker ps -aq -f status=exited , which gets the IDs of all stopped containers. For example: $ docker rm -v $(docker ps -aq -f status=exited) When I run this, I get: michael@michael-desktop:~$ sudo docker rm -v $(docker ps -aq -f status=exited) Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.30

Vertex Shader Creating

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am learning D3D and currently i am at shaders. I wrote the code and built it - succeed but when debug i get this error: ERROR Here is the line where debugger breake: dev->CreateVertexShader(VS->GetBufferPointer(), VS->GetBufferSize(), NULL, &pVS); And here is the whole function: void InitPipeline() { // load and compile the two shaders ID3D10Blob *VS, *PS; D3DX11CompileFromFile("Shaders.shader", 0, 0, "VShader", "vs_4_0", 0, 0, 0, &VS, 0, 0); D3DX11CompileFromFile("Shaders.shader", 0, 0, "PShader", "ps_4_0", 0, 0, 0, &PS, 0, 0); //

Pin program to taskbar using PS in Windows 10

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to pin a program to the taskbar in Windows 10 (RTM) using this code: $shell = new-object -com "Shell.Application" $folder = $shell.Namespace((Join-Path $env:SystemRoot System32\WindowsPowerShell\v1.0)) $item = $folder.Parsename('powershell_ise.exe') $item.invokeverb('taskbarpin'); This worked on Windows 8.1, but no longer works on Windows 10. If I execute $item.Verbs() , I get these: Application Parent Name ----------- ------ ---- &Open Run as &administrator &Pin to Start Restore previous &versions Cu&t &Copy Create &shortcut

Error opening TIFF in python unknown pseudo-tag

匿名 (未验证) 提交于 2019-12-03 01:22:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to open a .TIFF image in python. My code is import numpy as np import matplotlib.pyplot as plt from PIL import Image photos = Image.open("haz(1,8grados).tif") photos.show() and I am getting the error TIFFSetField: tempfile.tif: Unknown pseudo-tag 65538. Can anyone help with this? I am running python 3 in Mac OS High Sierra. 回答1: This is a confirmed bug in PIL / Pillow . It is otherwise an innocent warning, and nothing you need to do differently. You can't silence the warning, however, it is emitted from the TIFF decoding library

Transpose an 8x8 float using AVX/AVX2

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Transposing a 8x8 matrix can be achieved by making four 4x4 matrices, and transposing each of them. This is not want I'm going for. In another question, one answer gave a solution that would only require 24 instructions for an 8x8 matrix. However, this does not apply to floats. Since the AVX2 contains registers of 256 bits, each register would fit eight 32 bits integers (floats). But the question is: How to transpose an 8x8 float matrix, using AVX/AVX2, with the smallest instructions possible? 回答1: I already answered this question Fast

ConnectionString property not printing connection string

匿名 (未验证) 提交于 2019-12-03 01:13:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to get the connection string of a database datasource with the following script: $Analysis_Server = New-Object Microsoft.AnalysisServices.Server $Analysis_Server.connect("$server") $database = $Analysis_Server.Databases[7] $c = $database.DataSources[0].ConnectionString $c nothing is outputting. I have tried debugging like so: $Analysis_Server.Databases this prints out all databases on the server if i index it $Analysis_Server.Databases[] , it prints whatever database is indexed (so in my case, 7, prints database8) clearly the

What does TTY mean in the unix ps command?

最后都变了- 提交于 2019-12-03 01:10:40
When I run PS one of the columns output is TTY. What does this mean? In particular, how does as value of "??" compare with "ttys000"? I ask because I have a Java program execute sort via ProcessBuilder, and when this program is run via my IDE (IntelliJ) the process takes 5x less than when run as an executable jar outside the IDE. In each case I run ps when the sort is running and the only difference is the IDE creats a process with a TTY of ?? whereas the jar creates a process with TTY of ttys000. A TTY is a computer terminal. In the context of ps , it is the terminal that executed a