Vim用户熟悉使用进入和查看当前目录列表
:o .
Run Code Online (Sandbox Code Playgroud)
在这个目录视图中,我们可以提供其他命令,如d和vim将响应"请给出目录名:".这当然允许我们在为vim提供目录名后在当前目录中创建一个新目录.
同样,我们可以通过第一运动我们的光标向下到强调,我们要删除,然后键入特定的目录列表中删除一个空目录d.
问题是,vim不允许我们删除非空目录.
是否有任何方法可以坚持我们删除非空目录?
读
man locale
Run Code Online (Sandbox Code Playgroud)
我认为该语言环境显示有关"当前语言环境"的信息或所有可用语言环境的列表.
另外,跑步
$ locale
Run Code Online (Sandbox Code Playgroud)
给...
LANG=
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=
Run Code Online (Sandbox Code Playgroud)
然而,无论是男性还是实际操作它都无法揭示这些环境变量的作用.我想具体问一下这些环境变量需要用于什么?(比如在这个具有这些环境变量的unix/linux操作系统上运行的软件的上下文中)
问题:在具有这些区域设置的操作系统上运行的软件环境中,这意味着什么?
使用fullCalendar,我允许用户在大日历(#cal_big)中选择月中视图,并在日视图中选择相应的小日历,并显示小时数(#cal_small).
每当用户在#cal_small中选择一个事件(一小时或一小时)时,我将显示一个确认/取消模式.确认/取消模式允许用户确认预订或取消预订(在语义上意味着用户并不真的想要预订该时段).

如果用户确认预订,我会向服务器发出ajax呼叫并注册预订.一旦ajax调用成功返回,我只需隐藏当前模态并显示"您的预订成功!" 新模式中的消息.这部分完美无瑕.
如果用户取消预订,则确认/取消模式被隐藏,我尝试以编程方式取消选择当前选择,这就是问题开始的地方.取消选择不起作用,似乎fullCalendar会记住所有这些未经确认的选择,当用户最终确认他的选择时,一大堆先前未经证实的选择都会在多个ajax调用中重复发送到服务器.

为什么会如此?如何阻止fullCalendar记住未经证实的选择?
这是代码: -
$(document).ready(function() {
var todayDate = new Date();
var myDate = todayDate.setDate(todayDate.getDate() - 1);
var csrfmiddlewaretoken = '{{ csrf_token }}';
var condo_slug = '{{ condo.slug }}';
var facility = $("#id_facility");
var cal_small_options = {
titleFormat: {
day: 'dddd'
},
header: {
left: '',
center:'title',
right:'',
},
height: 520,
defaultView: 'agendaDay',
editable: true,
minTime: '10:00',
maxTime: '23:00',
slotMinutes: 60,
selectable: true,
select: function(startDate, endDate, allDay, jsEvent, view) {
console.log("selection triggered", jsEvent.handleObj.guid)
checkAvailability(csrfmiddlewaretoken, condo_slug, facility, …Run Code Online (Sandbox Code Playgroud) 所以我试图通过python结构脚本自动化建立一个arch linux实例,如下所示:
from fabric.api import run, sudo
def server_setup_communityrepo():
run('echo \'echo "[archlinuxfr]" >> /etc/pacman.conf\' | sudo -s')
run('echo \'echo "Server = http://repo.archlinux.fr/$arch" >> /etc/pacman.conf\' | sudo -s')
run('echo \'echo " " >> /etc/pacman.conf\' | sudo -s')
sudo('pacman -Syy yaourt --noconfirm')
Run Code Online (Sandbox Code Playgroud)
run()由于$中的$符号,第二次调用时会出现此问题$arch.此结构函数在第2行中失败,因为$后跟一个字符串被fabric识别为配置变量.但我实际上希望将$ arch理解为文字中的字面值
echo 'echo "Server = http://repo.archlinux.fr/$arch" >> /etc/pacman.conf' 在bash shell中调用.
如何从这个结构怪癖中"逃脱",并将$ arch指定为要写入我的pacman.conf文件的文字?
我试图将bash环境变量传回我的Fabric函数,如下所示: -
from fabric.api import env
def env_localhost():
"All the environment variables relating to your localhost"
project_home = local('echo $PROJECT_HOME')
print 111, project_home
Run Code Online (Sandbox Code Playgroud)
但它似乎无法检索stdout结果并将其分配给我的python project_home变量.这样做的正确方法是什么?
在我的项目中使用virtualenv和django,我试图找到一种更有效的方式来浏览Django源代码。
正如这里所建议的- 帮助开发人员更快地阅读类层次结构的工具 -我通过以下方式使用ctags进行了设置
sudo port -v install ctags
Run Code Online (Sandbox Code Playgroud)
并taglist通过https://github.com/vim-scripts/taglist.vim安装了vim插件
不幸的是,ctags当我尝试通过“跳转”查看类时,似乎无法找到我的django的类Ctrl+]。
有什么建议可以让我ctags阅读位于virtualenv中的python源代码吗?
更新
通过进一步的实验,我意识到这ctags是一种“索引”程序,它通过给定的目录/文件/文件进行解析,并捕获找到的所有关键字(类名,方法名,函数名等)并将其写入文件。该文件可以更新,并且vim插件taglist从中读取内容,以了解在对Ctrlt类/方法/函数名进行操作时将我发送到哪里。
因此,我想出了一个临时的手动解决方案,可以在vim中执行,如下所示:
:set tags=~/mytags
:! ctags -R -o ~/mytags ~/.virtualenvs/myprojectname
Run Code Online (Sandbox Code Playgroud)
第一个命令告诉我的vim / taglist我的“索引”结果存储在哪里。
第二条命令~/mytags通过递归搜索(-R)将索引结果写入文件。~/.virtualenvs/myprojectname
这是可行的,但是如果我碰巧在另一个virtualenv环境中,这是维护标签和标签更改的非常手动的方法。
有人知道管理该ctags过程的自动化方法吗?
pip install numpy 在我自己的Mac OSX机器上的python virtualenv和运行Arch Linux的另一台机器上运行完美.
不幸的是,同一个命令无法在运行Gentoo的同事的机器上运行.
这是显示错误日志的pip.log: -
building data_files sources
build_src: building npy-pkg config files
running build_py
copying numpy/version.py -> build/lib.linux-x86_64-2.7/numpy
copying build/src.linux-x86_64-2.7/numpy/__config__.py -> build/lib.linux-x86_64-2.7/numpy
copying build/src.linux-x86_64-2.7/numpy/distutils/__config__.py -> build/lib.linux-x86_64-2.7/numpy/distutils
running build_clib
customize UnixCCompiler
customize UnixCCompiler using build_clib
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize GnuFCompiler
customize IntelFCompiler
customize LaheyFCompiler
customize PGroupFCompiler
customize AbsoftFCompiler
customize NAGFCompiler
customize VastFCompiler
customize CompaqFCompiler
customize IntelItaniumFCompiler
customize IntelEM64TFCompiler
customize Gnu95FCompiler
customize Gnu95FCompiler
customize Gnu95FCompiler using build_ext
building 'numpy.linalg.lapack_lite' extension
compiling …Run Code Online (Sandbox Code Playgroud) 这是我为从mongodb检索文档而编写的处理程序.
如果找到文档,我们将相应地加载和呈现模板.如果失败,它将重定向到404.
func EventNextHandler(w http.ResponseWriter, r *http.Request) {
search := bson.M{"data.start_time": bson.M{"$gte": time.Now()}}
sort := "data.start_time"
var result *Event
err := db.Find(&Event{}, search).Sort(sort).One(&result)
if err != nil && err != mgo.ErrNotFound {
panic(err)
}
if err == mgo.ErrNotFound {
fmt.Println("No such object in db. Redirect")
http.Redirect(w, r, "/404/", http.StatusFound)
return
}
// TODO:
// This is the absolute path parsing of template files so tests will pass
// Code can be better organized
var eventnext = template.Must(template.ParseFiles(
path.Join(conf.Config.ProjectRoot, "templates/_base.html"),
path.Join(conf.Config.ProjectRoot, …Run Code Online (Sandbox Code Playgroud) 我的模型中有一些字段,我特别想要从我的模型中排除ModelView.
参考https://flask-admin.readthedocs.org/en/latest/api/mod_model/,我尝试使用form_exclude_columns例如排除这些特定字段,例如
class UserView(ModelView):
form_exclude_columns = ('created', 'modified')
Run Code Online (Sandbox Code Playgroud)
但这似乎不起作用.
如何在my create和editModelView页面中轻松排除这两个字段?
我正在使用这个zurb-foundation下拉按钮 - http://foundation.zurb.com/sites/docs/v/5.5.3/components/dropdown_buttons.html
但是,当用户在下拉按钮本身外部单击或用户单击下拉列表中的项目时,我还需要关闭下拉列表,因此我需要一种方法以编程方式关闭打开的下拉列表事件.
我需要以编程方式关闭打开的下拉列表来进行什么javascript调用?
python ×3
bash ×2
fabric ×2
vim ×2
virtualenv ×2
ctags ×1
flask ×1
flask-admin ×1
fullcalendar ×1
gentoo ×1
go ×1
javascript ×1
jquery ×1
linux ×1
locale ×1
macos ×1
mgo ×1
numpy ×1
taglist ×1
unit-testing ×1