小编Wil*_*hes的帖子

Guile和Emacs?

我正在学习Emacs Lisp,我遇到了这个十年前的帖子,说在某些时候Guile(Scheme)将取代Emacs Lisp,或者Emacs将被Guile重写.

https://web.archive.org/web/20081201143448/http://sanpietro.red-bean.com/guile/guile/old/3114.html

我想知道这是否还有可能,并且开发人员是否应该尝试用这个来编写Elisp?最初的目标是让Guile向后兼容Elisp,但似乎开发Scheme是更好的选择.

emacs elisp guile

20
推荐指数
3
解决办法
5234
查看次数

如何将文字粘贴到页面底部?

我想在页面底部添加一行"All Rights Reserved ...".我尝试使用绝对定位,但当窗口调整到较小的高度时,这不能按预期工作.

我怎样才能实现这个简单的目标?

html css

20
推荐指数
4
解决办法
12万
查看次数

如何向Iterator添加新方法?

我想.unique()在迭代器上定义一个方法,使我能够迭代而不重复.

use std::collections::HashSet;

struct UniqueState<'a> {
    seen: HashSet<String>,
    underlying: &'a mut Iterator<Item = String>,
}

trait Unique {
    fn unique(&mut self) -> UniqueState;
}

impl Unique for Iterator<Item = String> {
    fn unique(&mut self) -> UniqueState {
        UniqueState {
            seen: HashSet::new(),
            underlying: self,
        }
    }
}

impl<'a> Iterator for UniqueState<'a> {
    type Item = String;
    fn next(&mut self) -> Option<String> {
        while let Some(x) = self.underlying.next() {
            if !self.seen.contains(&x) {
                self.seen.insert(x.clone());
                return Some(x);
            }
        }
        None
    }
} …
Run Code Online (Sandbox Code Playgroud)

iterator rust

20
推荐指数
1
解决办法
2267
查看次数

Oracle Not Equals Operator

有两个不等于运算符 - !=<>.

他们之间有什么区别?我听说!=比其他字符串更有效率.任何人都可以对此声明作出定性评论.

sql oracle

19
推荐指数
2
解决办法
10万
查看次数

在centos上安装scipy模块

我正在使用centos,我将python2.7交替安装到默认的python中.我可以用pip安装我想要的所有模块,但是我无法安装scipy.当我在做的时候

sudo /usr/local/bin/pip2.7 install scipy
Run Code Online (Sandbox Code Playgroud)

它正在下载它,但后来我有这个错误消息:

blas_mkl_info:

  libraries mkl,vml,guide not found in ['/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib']

  NOT AVAILABLE



openblas_info:

  libraries  not found in ['/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib']

  NOT AVAILABLE



atlas_blas_threads_info:

Setting PTATLAS=ATLAS

  libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/lib64', '/usr/local/lib', '/usr/lib64/atlas', '/usr/lib64/sse2', '/usr/lib64', '/usr/lib']

  NOT AVAILABLE



atlas_blas_info:

  libraries f77blas,cblas,atlas not found in ['/usr/local/lib64', '/usr/local/lib', '/usr/lib64/atlas', '/usr/lib64/sse2', '/usr/lib64', '/usr/lib']

  NOT AVAILABLE



/usr/local/lib/python2.7/site-packages/numpy/distutils/system_info.py:1521: UserWarning:

    Atlas (http://math-atlas.sourceforge.net/) libraries not found.

    Directories to search for the libraries can be specified in the

    numpy/distutils/site.cfg file (section …
Run Code Online (Sandbox Code Playgroud)

python install centos scipy

19
推荐指数
1
解决办法
1万
查看次数

Python,override__getstate __()和__setstate __()

我有这些课程:

class Family(object):
    __slot__ = ['father', 'var1']
    def __init__(self, father, var1 = 1):
        self.father, self.var1 = father var1

class Father(object):
    __slots__ = ['var2']
    def __init__(self, var2 = ''):
        self.var2 = var2

father = Father()
family = Family(father = father)
Run Code Online (Sandbox Code Playgroud)

我想腌制"家庭"对象.所以我需要覆盖__getstate____setstate__ "家庭"和"父亲"类.

你能告诉我一个有效的方法吗?(我使用的原因__slots__是因为我有很多对象而且我正在努力节省内存)

python

18
推荐指数
1
解决办法
6598
查看次数

如何删除除jq之外的所有键?

给定一个对象列表,我不想要许多键:

[{
    "name": "Alice",
    "group": "Admins",
    "created": "2014"
}, {
    "name": "Bob",
    "group": "Users",
    "created": "2014"
}]
Run Code Online (Sandbox Code Playgroud)

如何过滤这些对象以仅包含我想要的键?

[{
    "name": "Alice"
}, {
    "name": "Bob"
}]
Run Code Online (Sandbox Code Playgroud)

我已经尝试jq '.[].name'但是提取值,而不是保留对象.

json filtering key jq

18
推荐指数
4
解决办法
8574
查看次数

ImportError:无法导入名称cbook

>>> import matplotlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/__init__.py", line 123, in <module>
    from . import cbook
ImportError: cannot import name cbook
Run Code Online (Sandbox Code Playgroud)

我找不到解决方案,有人可以帮忙吗?

python matplotlib

16
推荐指数
2
解决办法
3万
查看次数

为什么我不能在函数中使用`import*`?

这按预期工作

def outer_func():
    from time import *

    print time()

outer_func()
Run Code Online (Sandbox Code Playgroud)

我可以在上下文中定义嵌套函数,并从其他嵌套函数中调用它们:

def outer_func():
    def time():
        return '123456'

    def inner_func():
        print time()

    inner_func()

outer_func()
Run Code Online (Sandbox Code Playgroud)

我甚至可以导入个别功能:

def outer_func():
    from time import time

    def inner_func():
        print time()

    inner_func()

outer_func()
Run Code Online (Sandbox Code Playgroud)

但是,这会引发SyntaxError: import * is not allowed in function 'outer_func' because it contains a nested function with free variables:

def outer_func():
    from time import *

    def inner_func():
        print time()

    inner_func()

outer_func()
Run Code Online (Sandbox Code Playgroud)

我知道这不是最佳做法,但为什么不起作用?

python python-2.x

15
推荐指数
1
解决办法
7905
查看次数

如何自动(重新)编译ELPA包?

我现在正通过MELPA和Marmalade尽可能多地安装,我使用git管理我的〜/ .emacs.d.但是,我有git ignore*.elc文件.

这意味着当我在一个系统上安装一个软件包然后开始使用另一个系统时,git pull只给我*.el文件.使用这些文件通常比使用*.elc慢.

我尝试将以下内容添加到〜/ .emacs.d/init.el中:

;; load the packages we've installed. Note that package-install
;; byte-compiles the packages, but .elc is ignored by git so we force recompilation here
(byte-recompile-directory (expand-file-name "~/.emacs.d/elpa") 0)
(package-initialize)
Run Code Online (Sandbox Code Playgroud)

不幸的是,这不等于package.el完成的编译.例如,如果我安装emacs-eclim,package.el不会编译emacs-eclim/company-emacs-eclim.el,我收到以下错误:

Leaving directory `/home/wilfred/.emacs.d/elpa'

Compiling file /home/wilfred/.emacs.d/elpa/emacs-eclim-20130310.1237/company-emacs-eclim.el at Mon Mar 11 15:40:01 2013
Entering directory `/home/wilfred/.emacs.d/elpa/emacs-eclim-20130310.1237/'
company-emacs-eclim.el:35:1:Error: Cannot open load file: eclim
Warning: reference to free variable `multiple-cursors-mode'
Warning: reference to free variable `mc--read-char'
Warning: assignment to free variable `mc--read-char'
Warning: reference …
Run Code Online (Sandbox Code Playgroud)

emacs elisp compilation elpa

14
推荐指数
3
解决办法
5296
查看次数

标签 统计

python ×4

elisp ×2

emacs ×2

centos ×1

compilation ×1

css ×1

elpa ×1

filtering ×1

guile ×1

html ×1

install ×1

iterator ×1

jq ×1

json ×1

key ×1

matplotlib ×1

oracle ×1

python-2.x ×1

rust ×1

scipy ×1

sql ×1