以下代码在我的内部.vimrc并通常恢复我用vim打开的文件的最后一个光标位置:
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
Run Code Online (Sandbox Code Playgroud)
我真的很喜欢这个功能,并希望保持打开状态,除了一个文件:当使用git提交时,vim会被激活,我可以用它来编辑提交消息.但是,在vim启动之前存在提交消息文件(并且已预先填充),因此vim将其视为现有文件并恢复最后一个光标位置(通常不是我想要开始键入的位置).
那么有可能修改上面的脚本来排除COMMIT_EDITMSG文件吗?
可能重复:
逻辑运算符的书面版本.
我注意到,c + +定义关键字and,or,not,xor,and_eq,or_eq,not_eq和xor_eq作为替代&&,||,!,^,&=,|=,!=和|=.他们很少使用!怎么了?它们不便携吗?
我找不到一个允许以比通常看到的更好的方式格式化日志输出语句的库.我记得的一个功能是它可以"偏移"日志消息,具体取决于日志语句发生位置的"嵌套".
也就是说,而不是这个:
DEBUG | DefaultBeanDefinitionDocumentReader.java| 86 | Loading bean definitions
DEBUG | AbstractAutowireCapableBeanFactory.java| 411 | Finished creating instance of bean 'MS-SQL'
DEBUG | DefaultSingletonBeanRegistry.java| 213 | Creating shared instance of singleton bean 'MySQL'
DEBUG | AutowireCapableBeanFactory.java| 383 | Creating instance of bean 'MySQL'
DEBUG | AutowireCapableBeanFactory.java| 459 | Eagerly caching bean 'MySQL' to allow for resolving potential circular references
DEBUG | AutowireCapableBeanFactory.java| 789 | Another debug message
Run Code Online (Sandbox Code Playgroud)
它会显示如下:
DEBUG | DefaultBeanDefinitionDocumentReader.java| 86 | Loading bean definitions
DEBUG | AbstractAutowireCapableBeanFactory.java | …Run Code Online (Sandbox Code Playgroud) 我的Zend表单中有两个字段,我想应用验证规则,确保用户输入这两个字段中的任何一个.
$companyname = new Zend_Form_Element_Text('companyname');
$companyname->setLabel('Company Name');
$companyname->setDecorators($decors);
$this->addElement($companyname);
$companyother = new Zend_Form_Element_Text('companyother');
$companyother->setLabel('Company Other');
$companyother->setDecorators($decors);
$this->addElement($companyother);
Run Code Online (Sandbox Code Playgroud)
如何添加一个可以查看这两个字段的验证器?
在您看来(虽然我会高度赞赏相关问题的文章/书籍),应该是程序员对该领域的知识水平?
(这个相关的问题没有完全回答我的问题/提到我可以使用的东西)
我使用m2eclipse作为eclipse的maven 2插件.我对maven来说是全新的,所以我的错误可能很简单,尽管搜索并没有为我提供任何解决方案.我可以从命令行运行maven并成功构建.但是,如果我作为现有的maven项目导入,或者使用mvn eclipse:eclipse然后导入,我将获得在我的POM文件中找不到的工件,导致根本没有加载maven依赖项.
奇怪的是,我有两个项目,两个孩子都是父母pom打包项目.一个孩子加载我所有的maven依赖项,而另一个孩子找不到任何,并说我的pom文件丢失了工件.同样,我可以从命令行安装和打包它们.
我甚至尝试将我的项目加载到netbeans中,它完美无缺,但是我需要使用eclipse.
有想法该怎么解决这个吗?
目录结构,pom文件布局:
--main
--pom.xml (is a pom package that is the parent to two other projects)
--ProjectA
--pom.xml
--ProjectB
--pom.xml
Run Code Online (Sandbox Code Playgroud)
Main是ProjectA和ProjectB的父项目.ProjectB将ProjectA作为依赖项.显然m2eclipse对这种依赖感到不满意.一旦我从ProjectB的pom文件中删除ProjectA的依赖项,所有maven依赖项都会被eclipse找到.
- com.company.myproj:app:6.6.0:jar Missing: ---------- 1) com.company.myproj:main:pom:${myproj.version} ---------- 1 required artifact is missing. for artifact: com.company.myproj:main:pom:$
{myproj.version} from the specified remote repositories: apache-incubating (http://people.apache.org/repo/m2-incubating-repository/, releases=true, snapshots=true), central (http://
repo1.maven.org/maven2, releases=true, snapshots=false)
Run Code Online (Sandbox Code Playgroud)
但是,我仍然需要ProjectB对ProjectA具有该依赖性.错误消息似乎是m2eclipse在远程仓库中寻找ProjectA.项目A应该只在.m2目录中,但我不知道如何告诉m2eclipse看那里.
我认为这可能只是m2eclipse特定的问题,因为从命令行使用mvn工作得很好,就像我之前说的那样,netbeans加载项目和依赖项就好了.
我可以轻松地提升Ruby中的类层次结构:
String.ancestors # [String, Enumerable, Comparable, Object, Kernel]
Enumerable.ancestors # [Enumerable]
Comparable.ancestors # [Comparable]
Object.ancestors # [Object, Kernel]
Kernel.ancestors # [Kernel]
Run Code Online (Sandbox Code Playgroud)
有没有办法下降层次结构?我想这样做
Animal.descendants # [Dog, Cat, Human, ...]
Dog.descendants # [Labrador, GreatDane, Airedale, ...]
Enumerable.descendants # [String, Array, ...]
Run Code Online (Sandbox Code Playgroud)
但似乎没有一种descendants方法.
(出现这个问题是因为我想找到Rails应用程序中的所有模型,这些模型来自基类并列出它们;我有一个控制器可以使用任何这样的模型,我希望能够添加新模型无需修改控制器.)
如何安装leiningen插件?
例如,leiningen-run?
我看到这个名为"clojars.org"的东西,以及如何"推"到它,但我没有看到任何关于"拉"的东西.
有没有人有一个快速的片段或方向我将如何检查一个给定的类是否支持>,=和<运算符?
给定一个传入的对象,我正在寻找实现以下逻辑的代码:
If GetType(someObj).SupportsScalarComparisons() Then ...
Run Code Online (Sandbox Code Playgroud)
我不知道这是反映的情况,还是?提前致谢.
我想通过urbanairship api从我的服务器端(c#)发送通知
在c#中有什么例子怎么做?
谢谢