我想让我的.bashrc检测运行emacsclient是否可以代替运行emacs.基本上:
if emacs_server_is_running; then
EDITOR=emacsclient
VISUAL=emacsclient
else
EDITOR=emacs
VISUAL=emacs
fi
Run Code Online (Sandbox Code Playgroud)
我将在emacs_server_is_running实现这一目标的功能中加入什么?
我想在Java中实现一个基于注释的初始化机制.具体来说,我有一个我定义的注释:
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Initialization {
/**
* If the eager initialization flag is set to <code>true</code> then the
* initialized class will be initialized the first time it is created.
* Otherwise, it will be initialized the first time it is used.
*
* @return <code>true</code> if the initialization method should be called
* eagerly
*/
boolean eager() default false;
}
Run Code Online (Sandbox Code Playgroud)
另外,我有一个界面:
public interface SomeKindOfBasicInterface {}
Run Code Online (Sandbox Code Playgroud)
我想SomeKindOfBasicInterface在我的类路径上找到类的每个实现,它@Initialization在方法上有注释.我正在看Spring的MetaDataReader工具,这看起来是推迟加载其他SomeKindOfBasicInterface实现的最佳方式,而我正在这样做......但我不知道如何像我所描述的那样进行搜索.有小费吗?
我已经定义了一个.dir-locals.el文件,其中包含以下内容:
((python-mode . ((cr/virtualenv-name . "saas"))))
Run Code Online (Sandbox Code Playgroud)
在我的.emacs中,我有以下函数来检索此值并提供virtualenv路径:
(defun cr/virtualenv ()
(cond (cr/virtualenv-name (format "%s/%s" virtualenv-base cr/virtualenv-name))
((getenv "EMACS_VIRTUAL_ENV") (getenv "EMACS_VIRTUAL_ENV"))
(t "~/.emacs.d/python")))
Run Code Online (Sandbox Code Playgroud)
最后,在我的python-mode-hook列表中,我有这个钩子函数:
(add-hook 'python-mode-hook 'cr/python-mode-shell-setup)
(defun cr/python-mode-shell-setup ()
(message "virtualenv-name is %s" cr/virtualenv-name)
(let ((python-base (cr/virtualenv)))
(cond ((and (fboundp 'ipython-shell-hook) (file-executable-p (concat python-base "/bin/ipython")))
(setq python-python-command (concat python-base "/bin/ipython"))
(setq py-python-command (concat python-base "/bin/ipython"))
(setq py-python-command-args '( "-colors" "NoColor")))
(t
(setq python-python-command (concat python-base "/bin/python"))
(setq py-python-command (concat python-base "/bin/python"))
(setq py-python-command-args nil)))))
Run Code Online (Sandbox Code Playgroud)
当我打开一个新的python文件时,记录的消息cr/python-mode-shell-setup表明它cr/virtualenv-name是nil …
我想编写一个简单的详细格式化程序,byte[]以a String(String.<init>([B)用于执行脏工作)的形式显示数据.
但是,我不确定如何[B在创建格式化程序时找到要使用的类名.这甚至可能吗?或者,是否有另一种方法可以在调试器中将字节数组视为字符串?
我正在使用ExecutorService启动任务,调度需要按任务特定条件分组的任务:
Task[type=a]
Task[type=b]
Task[type=a]
...
Run Code Online (Sandbox Code Playgroud)
我想定期输出每个任务所用的平均时间长度(按分组type)以及统计信息,如平均值/中位数和标准差.
当然,这需要非常快,理想情况下不应该在报告统计信息时导致各个线程同步.这样做有什么好的架构?
它在锡上说的内容:我想使用@property/ @synthesize语法在Objective-C 2.0类上定义属性,但我想对属性中允许的值范围进行限制.例如:
@interface MyClass : NSObject {
int myValue;
}
@property (nonatomic) int myValue;
Run Code Online (Sandbox Code Playgroud)
执行:
@implementation MyClass
@synthesize myValue(test='value >= 0');
Run Code Online (Sandbox Code Playgroud)
请注意,此处的语法只是一个示例.是这样,还是可能的东西?或者,什么是合成setter的文字等价物,以便我可以确保在我的手动设置器中使用与合成设置器中使用的相同的对象保留规则.
什么是正确的方式(或者我会以一种好的方式解决)来布置一个中等复杂度的命令行python应用程序?我用paster创建了一个python项目框架,它给了我一些文件开头:
myproj/__init__.py
MyProj.egg-info/
dependency_links.txt
entry_points.txt
PKG-INFO
SOURCES.txt
top_level.txt
zip-safe
setup.cfg
setup.py
Run Code Online (Sandbox Code Playgroud)
我想知道,主要是我的程序入口点应该去哪里,以及如何在路径上安装它?setuptools是否为我创建了它?我试图在HHGTP中找到它,但也许我只是错过了它.
这有点难以解释,所以请耐心等待.
我正在运行emacs 23.0.60.2(来自CVS)以获得truetype支持.(如果有人想知道我为什么跑出了前沿).我在使用此版本的文档中导航时遇到了一些奇怪的问题,我想要停止.
当窗口足够窄以至于长行包裹时,过去在文本中向下导航一行会将光标移动到文件中与行相同偏移的下一个文字行.但是,现在,光标移动到窗口中的下一个逻辑行 - 这是当前行的延续 - 与窗口边缘相同的相对偏移.基本上,在它像emacs之前,现在它像记事本一样.我不想要记事本般的行为.
有谁知道如何关闭它?如果您知道如何在.emacs中关闭它,以便让我的.emacs继续使用emacs 21-22,那么奖励积分:)
谢谢!
我们有一个Subversion存储库,其中包含一个目录:
虽然我知道高版本号不是问题,但是我想将这个单个目录从我的主存储库中拉出来,然后再将其作为第二个,最理想的新目录.
最好的流程是什么?如果它有所不同,SVN存储库托管在(...检查...)FreeBSD机器上.
值得注意的是,虽然我需要在新存储库中保留版本历史记录,但是没有必要删除旧版本中的内容; 它可以坐在那里,尽我所能.
我想自动构建一个flex库项目而不是当前进程,这涉及我们的一个开发人员在他的机器上编译它然后我们检查生成的.swc文件.这很糟糕.
我是从Java开发人员的角度来看这个,所以我很难掌握Flex Builder 3应用程序中提供的编译工具,但这就是我已经拥有的:
<mxmlc/>和执行<compc/>任务.我想要的是一个ant脚本,它将完成以下步骤:
到目前为止我有这个:
<target name="compile-component" depends="init">
<compc output="${DEPLOY_DIR}/${SWC_NAME}.swc">
<source-path path-element="${FLEX_HOME}/frameworks"/>
<source-path path-element="${SRC_DIR}"/>
</compc>
</target>
Run Code Online (Sandbox Code Playgroud)
但是,它不包括任何内容:
[compc] Loading configuration file /Applications/Adobe Flex Builder 3/sdks/3.2.0/frameworks/flex-config.xml
[compc] Adobe Compc (Flex Component Compiler)
[compc] Version 3.2.0 build 3958
[compc] Copyright (c) 2004-2007 Adobe Systems, Inc. All rights reserved.
[compc]
[compc] Error: nothing was specified to be included in the library
[compc]
[compc] Use 'compc -help' for information about using the command line.
Run Code Online (Sandbox Code Playgroud)
看起来我需要枚举我想要包含在库中的每个类,这是......荒谬的.肯定有更好的办法.我该怎么做呢?
java ×3
dot-emacs ×2
emacs ×2
python ×2
adobe ×1
annotations ×1
ant ×1
apache-flex ×1
bash ×1
cocoa ×1
concurrency ×1
debugging ×1
distribute ×1
eclipse ×1
emacs23 ×1
flex3 ×1
flexbuilder ×1
macos ×1
monitoring ×1
objective-c ×1
packaging ×1
python-mode ×1
setuptools ×1
shell ×1
spring ×1
statistics ×1
svn ×1