首页 \ 问答 \ Perforce更改默认编辑器(Perforce changing the default editor)

Perforce更改默认编辑器(Perforce changing the default editor)

我使用perforce进行修订控制,当我点击'p4 change'时,它总是打开emacs上的列表,我们都知道删除文本的痛苦。 我如何将其更改为gedit或vim或其他任何东西? 我的默认文本编辑器是gedit。


I use perforce for my revision control, when I hit 'p4 change' it always opens up the list on emacs, and we all know the pain of deleting text in it. How do i change it to gedit or vim or anything else? My default text editor is gedit.


原文:https://stackoverflow.com/questions/10110052
更新时间:2023-08-16 19:08

最满意答案

在谈论并发时,总是要区分线程任务 非常重要

  • 任务只是一件应该完成的工作 - 通常表示为Runnable (或者在任务产生结果的情况下为Callable )。

  • 线程是一种使任务能够并行执行的机制。

ExecutorExecutorService是能够执行任务的工具 。 根据实现的不同,这个执行器可能能够并行执行多个任务 - 通常通过在内部使用线程

因此,如果您使用的是ExecutorExecutorService ,那么您将交付任务 ,因此可以执行Runnable ,并让执行程序为您管理其线程

注意:由于java.lang.Thread实现了Runnable ,因此可以实例化一个Thread并将其传递给execute(...) 这是一件非常糟糕的事情,因为执行程序只会像调用任务一样调用线程的run()方法,而不会启动线程。 它不被认为是以这种方式使用 - 如果你看到这个地方:这是错的!


When talking about concurrency, it is very important to always distinguish between threads and tasks.

  • A task is just a piece of work that should be done - often represented as Runnable (or Callable in case a task produces a result).

  • A thread is a mechanism that enables tasks to be executed in parallel.

An Executor or ExecutorService is a facility that is able to execute tasks. Depending on the implementation, this executor may be able to execute multiple tasks in parallel - usually by using threads internally.

So if you are using an Executor or ExecutorService, you hand over tasks, hence Runnables for execution and let the executor manage its threads for you.

Note: As java.lang.Thread implements Runnable, it is possible to instantiate a Thread and pass it to execute(...). That's a very bad thing as the executor will just invoke the run() method of the thread as if it were a task, and does not start the thread. It is not thought to be used this way - if you see this somewhere: It's wrong!

相关问答

更多
  • 我会这样做: function test(testcase) { ask(function(workers) { ask(function(salary) { console.log(salary); // Do whatever you want with the data // Then: ask(test); }); }); } ask(test); 标准输入没有同步IO API。 但是,您 ...
  • 您无法阻止客户端表单篡改您的表单数据。 您可以添加从您提供的所有已知值中获取的哈希值,并将它们存储在隐藏字段中。 或加密价值类似于贝宝按钮剂量。 这两种方法仍然需要服务器端验证。 You wont be-able to stop the client form tampering with your form data. You could add a hash taken from all the known values you provide and store store them in a hid ...
  • 在它的参数中没有任何带有CustomObject方法。 Runnable是一个界面。 您实际上将CustomObject的队列作为Runnable队列传递。 您只需确保您的CustomObject实现Runnable接口。 No there aren't any method with your CustomObject in it's parameter. Runnable is an interface. You will actually pass a queue of your CustomObje ...
  • 我刚刚调整了你的小提琴 。 当我第一次添加console.msg来获取函数isValid(entry,a,b)处理的值时,我注意到entry.value是未定义的,但是entry与当前输入匹配。 调整为 function isValid(entry, a, b) { if (isNaN(entry) || (entry==null) || (entry=="") || (entry < a) || (entry.value > b)) {... } } 似 ...
  • 来自文档 : 我如何一次获得一个按键? 对于Unix变体:有几种解决方案。 使用curses执行此操作非常简单,但curses是一个相当大的学习模块。 这是一个没有curses的解决方案: import termios, fcntl, sys, os fd = sys.stdin.fileno() oldterm = termios.tcgetattr(fd) newattr = termios.tcgetattr(fd) newattr[3] = newattr[3] & ~termios.ICANON ...
  • 删除这个: onMouseDown="return false;" delete this: onMouseDown="return false;"
  • Boost.Thread(内部利用Boost.Bind作为绑定参数)仅支持一些固定数量的参数( doc ): 带参数的线程构造函数 template thread(F f,A1 a1,A2 a2,...); 前提条件: F和每个An必须是可复制的或可移动的。 功效: 好像是thread(boost::bind(f,a1,a2,...)) 。 因此, f和每个an被复制到内部存储器中以供新线程访问。 后置条件: *this是指新创建的执行线程。 ...
  • 是的,但这取决于您启动Executor以及您使用的技术: 在ServletContextListener中 :在contextInitialized()启动Executor并在contextDestroyed()中将其关闭。 在servlet中,在init()启动Executor ,用destroy()其关闭 在EJB / Spring bean中:从@PostConstruct注释的方法开始,在@PreDestroy关闭。 Yes, but it depends on where you start yo ...
  • 在谈论并发时,总是要区分线程和任务 非常重要 。 任务只是一件应该完成的工作 - 通常表示为Runnable (或者在任务产生结果的情况下为Callable )。 线程是一种使任务能够并行执行的机制。 Executor或ExecutorService是能够执行任务的工具 。 根据实现的不同,这个执行器可能能够并行执行多个任务 - 通常通过在内部使用线程 。 因此,如果您使用的是Executor或ExecutorService ,那么您将交付任务 ,因此可以执行Runnable ,并让执行程序为您管理其线程 ...
  • 我猜你是通过不调用Application.DoEvents()来阻止Windows消息。 将它插入while块之间,我猜它会有所帮助。 I guess you are blocking windows messages by not calling Application.DoEvents(). Insert it between the while block and I guess it'll help.

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)