prompt

Can I change the prompt in MATLAB?

巧了我就是萌 提交于 2019-12-01 03:19:26
I never work with the GUI and am always inside a terminal (also full screen, so no title bar) set with the -nodesktop -nodisplay option. I also have different servers that I connect to, to run matlab and each of those have different restrictions on hogging computational resources. Since it's hard to remember which server I'm in,especially if I have multiple sessions open, I was wondering if I could change the prompt to display the server name. Try as I might, I couldn't find a resource that explains how to go about it (I'm beginning to think Mathworks doesn't support it). I know, a workaround

How to insert an environment variable inside the bash prompt

人走茶凉 提交于 2019-12-01 02:13:26
I can set an environment variable inside the bash prompt like this: export PS1="[\u@\H/$FOO \W]\$ " The prompt does not change when I change the environment variable: $FOO because the $FOO variable is not interpreted. I can work around it by doing the following, exporting PS1 again. But I would like to be able to do it on one line: [user@server ]$ echo $FOO foo [user@server ]$ export PS1="[$FOO]$ " [foo]$ export FOO=bla [bla]$ Can this be done in one line? you need to add backslash to get it evaluated not in the time of FOO assigment but during evaluating the PS1, so do: export PS1="[\$FOO]$ "

How to insert an environment variable inside the bash prompt

橙三吉。 提交于 2019-11-30 21:35:19
问题 I can set an environment variable inside the bash prompt like this: export PS1="[\u@\H/$FOO \W]\$ " The prompt does not change when I change the environment variable: $FOO because the $FOO variable is not interpreted. I can work around it by doing the following, exporting PS1 again. But I would like to be able to do it on one line: [user@server ]$ echo $FOO foo [user@server ]$ export PS1="[$FOO]$ " [foo]$ export FOO=bla [bla]$ Can this be done in one line? 回答1: you need to add backslash to

UINavigationItem Prompt Issue

情到浓时终转凉″ 提交于 2019-11-30 20:14:51
I'm having a problem with the prompt on a UINavigationItem that I just can't resolve... I have a master and a detail view controller. When I push from the master to the detail a prompt is shown on the detail view controller: However, when I pop back to the master view controller, the view isn't resized and the window shows through (the window has been coloured red): This only happens on iOS7, on iOS6 the view resizes as expected. I've tried a few things such as setting the prompt to nil in viewWillDisappear or viewDidDisappear but nothing seems to fix it. If I set the navigation bar in the

JavaScript Prompt Box Cancel Button?

自作多情 提交于 2019-11-30 19:53:48
I have a JavaScript function as follows: function popup(username) { var req = createAjaxObject(); var message = prompt("Message:",""); if(message != ""){ req.onreadystatechange = function() { if (req.readyState == 4) { alert(req.responseText); } } req.open('POST','getmessage.php',true); req.setRequestHeader("Content-type","application/x-www-form-urlencoded"); req.send("username=" + username +"&message="+message); } else { alert("Please enter a message"); } } When the Cancel button is hit, the form is still processed through getmessage.php . Any way to have the Cancel button do nothing? EDIT:

SSMS开发利器Sql Prompt

别说谁变了你拦得住时间么 提交于 2019-11-30 18:11:00
一、前言 一个Sql Server 开发智能提示插件,方便查询表结果,避免了开发人员一个个敲查询语句、执行语句等,一起来看看吧。 SQL Prompt 9.5 支持SSMS18 下载地址: 链接: https://pan.baidu.com/s/19Xjs-SRkWJDXdPj09VuRaw 提取码:iwok 二、使用 1、刷新缓存 打开Sql Server,该插件会自动运行,将数据库中的视图、表、存储过程都缓存起来,所以在第一次打开查询分析器的时候,插件会有一个加载缓存的过程。如果数据库中的对象有变化,需要手动刷新一下缓存,可以按Ctrl + Shift + D,或者在主菜单中找到SQL Prompt→ Refresh Suggestions。 2、智能提示 (1) 在查询分析器中写DML语句时,当鼠标移动到数据库对象时,插件会自动给出提示,点击提示标签,会显示数据库对象创建的脚本; (2) 当数据表的名字太长记不清也没关系,只需要记住几个关键字母就可以了,智能插件也可以自动提示,给你很多选择。 (3) 在输入关键字时,即使你输入的是小写,它会自动帮你转换成大写 3、支持导航 在查询分析器页面选中要查看的数据库对象,比如存储过程,按下’F12’就可以跳转到存储过程进行查看,而不用再去左侧一个个的寻找。 4、自动插入 (1) 当输入完“select * from table”时

Constantly updated clock in zsh prompt?

半腔热情 提交于 2019-11-30 11:09:49
问题 I know that I can exec a date command in my zsh prompt. However, it shows the old time; to see the current time, I have to hit <return> and get a new prompt with the current time. Is there a way to configure the zsh prompt to constantly update itself every second? 回答1: This would be .... unpleasant in a standard zsh prompt (or bash, or other shells). I suggest you'd be better off using Gnu Screen. Screen can have a status line which can show the time. Here's an example screenrc scroll down to

Where exactly Git Bash for Windows' prompt is defined?

时光怂恿深爱的人放手 提交于 2019-11-30 11:07:35
Both my office and home computers have Git Bash for Windows from the very same source (Git for Windows, that came with TortoiseGit), but Git Bash's prompt differs on both machines: on office computer I have /c/path (branch) all green (this is, how I would like it to have), on home computer I have only path (no branch) and all white. Up until now I was told, that this is PS1 variable, kept in ~/.bashrc file. However, on both machines, this files is missing (executing notepad ~/.bashrc opens up empty Notepad). I'm lost here. If ~/.bashrc doesn't exists, then from where Git Bash "knows", that it

Close Prompt alert box automatically with 10Seconds in XUL JavaScript

Deadly 提交于 2019-11-30 09:41:39
问题 This is my prompt alert box function in XUL: function promptBoxes() { var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); var check = {value: false}; // default the checkbox to false var flags = prompts.BUTTON_POS_0 * prompts.BUTTON_TITLE_Ok+ prompts.BUTTON_POS_1 * prompts.BUTTON_TITLE_IS_STRING; var button = prompts.confirmEx(null, "Title of this Dialog", "What do you want to do?", flags, "", "Cancel", "", null,

What is the difference between PS1 and PROMPT_COMMAND

扶醉桌前 提交于 2019-11-30 06:10:12
问题 While taking a look at this awesome thread I noticed that some examples use PS1="Blah Blah Blah" and some use PROMPT_COMMAND="Blah Blah Blah" (and some use both) when setting the prompt in a bash shell. What is the difference between the two? An SO search and even a bit of broader google searching aren't getting me results, so even a link to the right place to look for the answer would be appreciated. 回答1: From the GNU Bash doc page: http://www.gnu.org/software/bash/manual/bashref.html PROMPT