小编Emm*_*ith的帖子

WebGL几何着色器等效?

我目前正在研究一种在webgl中产生非真实感渲染的方法.最好看的算法我发现到目前为止的边缘检测与OpenGL的几何着色器来实现,在这里.特别是GL_TRIANGLES_ADJACENCY.

我想知道WebGL中是否有相同的内容,甚至我如何将此代码移植到Javascript上.

javascript geometry opengl-es webgl

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

Vim <CR>映射不起作用?

我刚刚开始使用vim,并且非常有趣地添加了大量有用的插件.问题是,在设置我的所有插件的某个时刻,我没有注意到enter键的映射停止正常工作.在插入模式下,当我按回车键时,如果当前没有自动完成菜单,则不会创建换行符,而是打印:

pumvisible() ? "\" : "\"
Run Code Online (Sandbox Code Playgroud)

这是我的vimrc:

"{{{Auto Commands

" Improve python indentation and higlighting
autocmd FileType python set complete+=k~/.vim/syntax/python.vim isk+=.,(

" Automatically cd into the directory that the file is in
autocmd BufEnter * execute "chdir ".escape(expand("%:p:h"), ' ')

" Remove any trailing whitespace that is in the file
autocmd BufRead,BufWrite * if ! &bin | silent! %s/\s\+$//ge | endif

" Restore cursor position to where it was before
augroup JumpCursorOnEdit
   au!
   autocmd BufReadPost *
            \ if expand("<afile>:p:h") !=? …
Run Code Online (Sandbox Code Playgroud)

mapping vim

7
推荐指数
2
解决办法
8065
查看次数

递归检查git目录更新

我想知道是否有办法确定指定目录下的哪些子文件夹是git项目.之后,检查哪些git项目需要通过'git fetch'或其他方式进行更新.

例如,我在我的主文件夹中有一个名为development的文件夹,它使用git来保存各种项目,其中大约10%.我希望能够运行一个命令,检查开发目录中所有git文件夹的更新,而不是单独检查项目更新.

如果它可以更新非冲突的项目也会很好.

linux git ubuntu

5
推荐指数
1
解决办法
1263
查看次数

从[1 ..]的地图中排除计算结果?

我目前正在研究一个计算友好对的程序(Project Euler Problem 21).我已经找到了解决方案,但是我注意到我的程序中的一个缺陷就是它评估了集合[1 ..]的所有数字,无论我们是否已经找到了这个数字.

即如果当前评估220和284被发现是它的对,但是当地图函数到达284时继续进行它不应该再次评估它.

import Data.List

properDivisors :: (Integral a) => a -> [a]
properDivisors n = [x | x <- [1..n `div` 2],
                        n `mod` x == 0 ]

amicablePairOf :: (Integral a) => a -> Maybe a
amicablePairOf a
    | a == b = Nothing
    | a == dOf b = Just b
    | otherwise = Nothing
        where dOf x = sum (properDivisors x)
              b = dOf a

getAmicablePair :: (Integral a) => a -> …
Run Code Online (Sandbox Code Playgroud)

haskell list infinite fold

3
推荐指数
1
解决办法
166
查看次数

标签 统计

fold ×1

geometry ×1

git ×1

haskell ×1

infinite ×1

javascript ×1

linux ×1

list ×1

mapping ×1

opengl-es ×1

ubuntu ×1

vim ×1

webgl ×1