interactive

How to call bash commands from tcl script?

一世执手 提交于 2019-12-05 11:00:57
Bash commands are available from an interactive tclsh session. E.g. in a tclsh session you can have % ls instead of $ exec ls However, you cant have a tcl script which calls bash commands directly (i.e. without exec ). How can I make tclsh to recognize bash commands while interpreting tcl script files, just like it does in an interactive session? I guess there is some tcl package (or something like that), which is being loaded automatically while launching an interactive session to support direct calls of bash commans. How can I load it manually in tcl script files? What's going on here is

Is there an interactive output device to view 3D graphs in R?

混江龙づ霸主 提交于 2019-12-05 06:34:29
I'm currently generating 3D graphs in R using the persp -command. To change the viewpoint one has to set the parameters theta and phi . To evaluate (a good viewpoint on) the graph, one has to try lots of combinations for these parameters. I was wondering if one can define an interactive output device that allows to rotate the graph using the mouse. It would be also nice if this device gives the current values for theta and phi . Is there such a device/package? See the rgl package: http://cran.r-project.org/web/packages/rgl/index.html It won't report the theta and phi values you need, IIRC

Blank line rule at interactive prompt

旧街凉风 提交于 2019-12-05 04:51:29
I was wondering why is there a different rule for blank lines in Python between interactive prompt and when the program is run from shell as an executable. Since blank lines are ignored, I enjoy using them abundantly. However, in the interactive prompt, a blank line is used to terminate a loop. Thus, I keep running into indentation errors when I paste a chunk of code into the interactive prompt as I would have blank lines throughout my loops. Consequently, this makes the interactive debugging/development process somewhat tedious. Putting a # instead of blank line helps, but I like my blank

What is a simple way to wait for and then detect keypresses in Haskell?

风流意气都作罢 提交于 2019-12-05 02:41:42
I'm pretty new to Haskell, so I'm looking for a simple-ish way to detect keypresses, rather than using getLine . If anyone knows any libraries, or some trick to doing this, it would be great! And if there is a better place to ask this, please direct me there, I'd appreciate it. If you don't want blocking you can use hReady to detect whether a key has been pressed yet. This is useful for games where you want the program to run and pick up a key press whenever it has happened without pausing the game. Here's a convenience function I use for this: ifReadyDo :: Handle -> IO a -> IO (Maybe a)

Haskell Input Return Tuple

為{幸葍}努か 提交于 2019-12-05 01:23:23
问题 i wonder can a IO() function return tuple because i would like to get these out of this function as input for another function. investinput :: IO()->([Char], Int) investinput = do putStrLn "Enter Username : " username <- getLine putStrLn "Enter Invest Amount : " tempamount <- getLine let amount = show tempamount return (username, amount) Please help. Thanks. 回答1: IO in Haskell doesn't work like IO in the languages you're used to. All functions in Haskell must be pure: that is, if a function f

Interactively merge files tracked with git and untracked local files

那年仲夏 提交于 2019-12-05 00:20:45
I use a couple of software packages (like gitlab) that you install by cloning from their git repo. They typically come with some config.example (under version control), which you copy to your own config file (not under version control or even ignored in .gitignore ) and adapt to your needs. When the upstream package is updated and for example changes the config file options that will obviously only be reflected in config.example . Is there a chain of git commands that i'm missing that can help me compare the changes of config.example to the new one in upstream/HEAD and maybe even merge them

git rebase -i presents an empty MacVim file

淺唱寂寞╮ 提交于 2019-12-04 23:46:38
I'm trying to rebase a commit. However, any time I run git rebase -i f83eff3ffc8 , for example, a MacVim window opens, that's empty (there is no information in the file). Then once I write and close the file (even though it's empty), I get a Successfully rebased and updated refs/heads/clicktocall-hotfix message. The file name is .git/rebase-merge/git-rebase-todo . I also tried running it with sudo but this didn't make a difference. What could be the problem? I've never successfully completed a rebase. Kevin Burke I was using Macvim and needed to run mvim with the -f option, as documented here:

How to add interactive UILabels on top of a UIImageView?

天涯浪子 提交于 2019-12-04 23:24:13
问题 I need to add few labels on top of an UIImageView . The labels' text can be changed by tapping on them. What is the best way to achieve this? I am using Swift programming language. Looking up some solutions on stackoverflow, I found a couple of walkthroughs that use String.drawInRect method to draw some text in a rectangle which is then placed on the UIImageView . But like this I don't think I will be able to change the text, or even recognize a touch event on them. Please help. UPDATE My

PyCharm remote processes finish when connection breaks

半世苍凉 提交于 2019-12-04 18:18:48
问题 I am running a project using a remote interpreter using an SSH connection (PyCharm professional 2016.3.3). When I have a connection everything works fine, but if my connection gets interrupted (either I accidentally close the laptop lid, enter sleep mode, or the wifi connection breaks momentarily for some unknown reason) then when I reconnect, my console session is terminated with Process finished with exit code -1 . The output from the interactive console reads: ssh://username@remote_server

Define an emacs command that calls another emacs command (preserving interactive stuff)

一世执手 提交于 2019-12-04 15:28:47
How can I define an emacs command X that does something and then calls another emacs command Y and also copying the interactive interface of the command Y too? I want to define an altenative version of query-replace with temporarilly toggled value of case-fold-search: (defun alt-query-replace (a b c d e) (interactive) (let ((case-fold-search (not case-fold-search)) (query-replace a b c d e))) This doesn't work. When I call alt-query-replace, it says "wrong number of arguments". I want the interactive interface of alt-query-replace to be the same as query-replace. Do I need to inspect the