This file contains hidden or 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
| #!/usr/bin/env python | |
| import urllib | |
| import urllib2 | |
| import sys | |
| if len(sys.argv) > 1: | |
| lang = sys.argv[1] | |
| else: |
This file contains hidden or 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 webview.init_funcs.mailto_hook (view, w) | |
| view:add_signal("navigation-request", function (v, uri) | |
| if string.match(string.lower(uri), "^mailto:") then | |
| luakit.spawn(string.format("%s %q", "urxvtc -title mutt -e mutt", uri)) | |
| return false | |
| end | |
| end) | |
| end |
This file contains hidden or 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
| module Main where | |
| import Control.Comonad.Cofree | |
| import Control.Lens | |
| import Numeric.AD | |
| import Numeric.AD.Types | |
| import Text.Printf (printf) | |
This file contains hidden or 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
| def crank(V, L1, R1x, L2, R2x, dt, n, crumbs=[], callback=None): | |
| V = V.copy() | |
| dt *= 0.5 | |
| L1e = flatten_tensor(L1) | |
| L1i = L1e.copy() | |
| R1 = np.array(R1x).T | |
| L2e = flatten_tensor(L2) | |
| L2i = L2e.copy() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| fun! pymode#Toggle(toggle, msg) "{{{ | |
| let {a:toggle} = {a:toggle} ? 0 : 1 | |
| if {a:toggle} | |
| echomsg a:msg." enabled" | |
| else | |
| echomsg a:msg." disabled" | |
| endif | |
| endfunction "}}} |
This file contains hidden or 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
| ''' | |
| Set ANSI Terminal Color and Attributes. | |
| ''' | |
| from sys import stdout | |
| esc = '%s['%chr(27) | |
| reset = '%s0m'%esc | |
| format = '1;%dm' | |
| fgoffset, bgoffset = 30, 40 | |
| for k, v in dict( |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <math.h> | |
| #include <assert.h> | |
| int main(int argc, char* argv[]) { | |
| int idim = 3; | |
| int jdim = 4; |
This file contains hidden or 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
| # cython: infer_types=True | |
| # Use the C math library to avoid Python overhead. | |
| from libc cimport math | |
| # For boundscheck below. | |
| import cython | |
| # We're lazy so we'll let Numpy handle our array memory management. | |
| import numpy as np | |
| # You would normally also import the Numpy pxd to get faster access to the Numpy | |
| # API, but it requires some fancier compilation options so I'll leave it out for |
This file contains hidden or 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
| # coding: utf8 | |
| # distutils: language = c++ | |
| # distutils: sources = b.cpp | |
| # Using C calling convention works with "cdef extern ..." directly; no | |
| # hpp header. | |
| # Without it we need to use the cdef extern from "b.hpp": ... declaration. | |
| # Implicitly forces C calling convenction? | |
| cdef extern void c() |