This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function foo(genconv, I, J) | |
genconv[sub2ind(size(genconv),I,J)] | |
end | |
function bar(genconv, I, J) | |
diag(sub(genconv, I, J)) | |
end | |
function baz(genconv, I, J) | |
[genconv[i,j] for (i,j) in zip(I, J)] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load dependency packages | |
using GLFW, ModernGL | |
# set up OpenGL context version | |
@osx_only const VERSION_MAJOR = 4 # it seems OSX will stuck on OpenGL 4.1. | |
@osx_only const VERSION_MINOR = 1 | |
# initialize GLFW library, error check is already wrapped. | |
GLFW.Init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Chain | |
value :: Int | |
right :: Chain | |
left :: Chain | |
#Make the last link in the chain point to itself | |
#so as to spare us from the julia workaround for nulls | |
Chain(value::Int) = (chain = new(); chain.value = value; chain.right = chain; chain.left = chain; chain) | |
end | |
NewerOlder