我刚开始使用org-mode,到目前为止发现它非常有用.我有一个非常大的集合的技术文件目录树,我想通过组织模式通过他们去,并对其进行索引.我想要的是有一种方法来浏览它们并查看未注释的那些,并逐一注释它们.我想通过首先编写一个像[[xxx.pdf] [尚未完成]]这样的链接文件来做这件事,然后呈现未完成的文件,浏览它们并决定注释的内容.另外我想添加标签.我真正喜欢的是能够动态制作新标签.有没有人在org-mode中做过这样的事情?
胜利者
我刚开始学习Haskell.我决定为自己设定一个实现我的旧算法的目标http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.79.7006&rep=rep1&type=pdf
首先,我编写了以下代码
phi [] = [1..]
phi (p:pl) = (phi pl) `minus` (map (p*) $ phi pl)
primes x
| x < 2 = []
| otherwise = smallprimes ++ (takeWhile (<=x) $tail $ phi $ reverse smallprimes)
where smallprimes = primes $ sqrt x
minus (x:xs) (y:ys) = case (compare x y) of
LT -> x : minus xs (y:ys)
EQ -> minus xs ys
GT -> minus (x:xs) ys
minus xs _ = xs
Run Code Online (Sandbox Code Playgroud)
这个函数按预期运行,除了素数列表是浮点数!有点想法告诉我,因为sqrt的签名是
sqrt :: …Run Code Online (Sandbox Code Playgroud) 我在模板化类的成员函数中遇到了以下问题:
#include <map>
using std::map;
template <typename A,typename B>
class C {
public:
B f(const A&,const B&) const;
private:
map<A,B> D;
};
template <typename A,typename B>
B C<A,B>::f(const A&a,const B&b) const {
map<A,B>::const_iterator x = D.find(a);
if(x == D.end())
return b;
else
return x->second;
}
Run Code Online (Sandbox Code Playgroud)
当我有g ++编译时,我收到以下错误:
Bug.C: In member function 'B C<A,B>::f(const A&, const B&) const':
Bug.C:12: error:expected ';' before 'x'
Bug.C:13: error: 'x' was not declared in this scope
Run Code Online (Sandbox Code Playgroud)
但是,当我创建类和函数的非模板化版本时,A和B都是int,它编译没有问题.这个错误有点神秘,因为我无法想象为什么它想要一个';' 在'x'之前.