interactive

How do Ruby and Python implement their interactive consoles?

只谈情不闲聊 提交于 2019-12-09 16:39:42
问题 When implementing the interpreter for my programming language I first thought of a simple console window which allows the user to enter some code which is then executed as a standalone program as a shell. But there are severe problems: If every line of code the user enters is handled as a standalone program, it has to go through the tokenizer and parser and is then just executed by the interpreter - what about functions then? How can the Python/Ruby interactive consoles (IDLE, irb) "share"

Regex to validate SMTP Responses

佐手、 提交于 2019-12-08 17:01:23
I'm writing a regular expression that can interactively validate SMTP responses codes, once the SMTP dialog is completed it should pass the following regex (some parentheses added for better readability): ^(220)(250){3,}(354)(250)(221)$ Or with( out ) authentication: ^(220)(250)((334){2}(235))?(250){2,}(354)(250)(221)$ I'm trying to do rewrite the above regexes so that I can interactively check if the dialog is going as expected, otherwise politely send a QUIT command and close the connection saving bandwidth and time, but I'm having a hard time writing an optimal regex. So far I've managed to

Getting output from os.system (no subprocess)

与世无争的帅哥 提交于 2019-12-08 13:42:07
问题 I am trying to capture and/or remove the output of a command launched by a os.system() call. The script will run under Linux and Windows. I cannot use the subprocess module because the said command is interactive (i.e. : the user can type instructions to trigger various actions). So please do not mention this thread as a duplicate of the common questions asked for instance in : Python: How to get stdout after running os.system? How to store the return value of os.system that it has printed to

Smart Card Removal policy is not enforced when performing SSO using Custom Credential Provider

泄露秘密 提交于 2019-12-08 09:12:01
问题 I have created a EFI Pre-Boot Application were in I enter the user credentials which are passed to windows to logon (Single Sign On) using my credential provider. I have a Group policy "Interactive logon: Smart card removal behavior" set to "Lock Workstation: The workstation is locked when the smart card is removed, allowing users to leave the area, take their smart card with them, and still maintain a protected session." So if I reboot the machine and use login using my credential provider,

Using bokeh to plot interactive pie chart in Jupyter/Python

巧了我就是萌 提交于 2019-12-08 06:44:39
问题 I am new to Bokeh and I would really appreciate some help in figuring out how to use Bokeh to plot a simple interactive pie chart in Jupyer/Python. I am planning to use 'CustomJS with a Python function' in Bokeh as explained at the bottom of the page here. The pie chart consists of two entries with a slider that can change the shape of one pie 'v2' inside the circle shape of (v1+v2). I have tried to follow the example in bokeh website that shows the interactivity with a sine plot, but I just

git bash shell on Windows “Your edited hunk does not apply”

六月ゝ 毕业季﹏ 提交于 2019-12-08 04:13:45
问题 I have a very frustrating error when trying to manually edit hunks while using the command: git add -p I have already looked through many of the existing questions on this site, including this one, and this one. I am at the point where I try to manually edit a hunk, make no changes to the file opened by git for manual editing, and still getting the error "Your edited hunk does not apply". I thought this might have to do with CRLF vs. LF EOL characters. I am editing in Notepad++, and I can see

How can I make a in interactive list in Python's Tkinter complete with buttons that can edit those listings?

荒凉一梦 提交于 2019-12-08 03:22:24
问题 Basically I want there to be a list, which displays files I have stored in a certain folder, and beside the list there are buttons which open up separate windows which can edit or add a new item to that list. I want addchar to open up an new window with spaces for different fields, then when you press a "create" button in that window it closes, creates a file on the info you just entered (that's why i've imported os) as well as creating a new item on the main interface's listbox as the name

ruby ssh: interactive command “su”: How further after successfull logged in?

半城伤御伤魂 提交于 2019-12-07 19:57:42
问题 I want work on a remote machine within a SSH session: login on the remote server su make my work With my script a can do step 1 and 2 works. While executing the su command, I can send the password, and got the answer I'm expecting ( on_data: data = gis@v04ree:~> got gis@v04ree:~> But then, what should I do? I'm sitting on my channel, nothing happens. How can I make the channel understand that the command has finished and that I want to make my wor on the remote machine? require 'net/ssh'

Sliding through images with Bokeh Slider

扶醉桌前 提交于 2019-12-07 19:34:37
问题 I am trying to convey a large amount of scientific data seamlessly with the help of sliders. I am beginning with Bokeh and have close to no knowledge in javascript. I tried to setup a first approach to be able to slide through two images, but I cannot get the image to refresh. Suppose I have 1.png and 2.png in my folder. from bokeh.io import vform from bokeh.models import CustomJS, ColumnDataSource, Slider from bokeh.plotting import Figure, output_file, show output_file('image.html') source =

How to embed an interactive shiny plot in a pdf / presentation? (via knitR maybe)

安稳与你 提交于 2019-12-07 16:16:54
问题 As the topic implies I am looking for a way to combine interactive shiny plots with knitr´s way of producing presentations/pdfs. The following intuitive approach should make my idea comprehensible. --- title: "Test" runtime: shiny output: pdf_document --- ```{r} library(shiny) library(knitr) library(rmarkdown) sliderInput("bins", "Choose Standard Deviation:", min = 0, max = 2, value = 1, step = 0.1) sliderInput("length", "Choose Length of Process:", min = 100, max = 10000, value = 1000, step