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
| puts 'VTable format' | |
| class Array | |
| def print_vtable(cols) | |
| rows = (self.length.to_f / cols).ceil | |
| self.map { |index| | |
| x = index % cols | |
| y = index / cols | |
| x * rows + y |
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 compose(g, f) { | |
| // Return our composure. | |
| return function composedFuction() { | |
| var args = Array.prototype.slice.call(arguments); | |
| return f.call(null, g.apply(null, args)); | |
| }; | |
| } |
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 curry(f, arg) { | |
| // Return a new curried function. Mmmm, spicy. | |
| return function curriedFunction() { | |
| // Take the other arguments and join them with our | |
| // curried arg. | |
| var args = Array.prototype.slice.call(arguments); | |
| args.unshift(arg); | |
| // Apply the function. | |
| return f.apply(null, args); | |
| }; |
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
| var inputData = []; | |
| var input = 'hi ther'; | |
| // Here we will store 8 7bit characters in 7 8bit slots... | |
| inputData[0] = input.charCodeAt(0) & ((1 << 7) - 1); | |
| inputData[0] = inputData[0] << 1 | input.charCodeAt(1) >> 6; | |
| inputData[1] = input.charCodeAt(1) & ((1 << 6) - 1); | |
| inputData[1] = inputData[1] << 2 | input.charCodeAt(2) >> 5; |
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
| [~/Code/js/node (master)] ➔ make | |
| Waf: Entering directory `/Users/schellscivally/Code/js/node/build' | |
| DEST_OS: darwin | |
| DEST_CPU: ia32 | |
| Parallel Jobs: 2 | |
| Product type: program | |
| [33/33] cxx_link: build/default/src/node_main_5.o build/default/src/node_5.o build/default/src/node_buffer_5.o build/default/src/node_javascript_5.o build/default/src/node_extensions_5.o build/default/src/node_http_parser_5.o build/default/src/node_constants_5.o build/default/src/node_events_5.o build/default/src/node_file_5.o build/default/src/node_script_5.o build/default/src/node_os_5.o build/default/src/node_dtrace_5.o build/default/src/node_string_5.o build/default/src/timer_wrap_5.o build/default/src/tcp_wrap_5.o build/default/src/cares_wrap_5.o build/default/src/node_cares_5.o build/default/src/node_net_5.o build/default/src/node_signal_watcher_5.o build/default/src/node_stat_watcher_5.o build/default/src/node_io_watcher_5.o build/default/src/node_stdio_5.o build/default/src/node_child_process_5.o build/default/src/node_timer_5.o build |
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 PrivateThing() { | |
| var privateVar1 = 0; | |
| var privateVar2 = 0; | |
| function privateFunction() { | |
| alert('i am in a closure private var one ='+privateVar1.toString()); | |
| privateVar1++; | |
| } | |
| function privateFunctionTwo() { | |
| alert('nothing outside the object created by this function can reach me. private var two ='+privateVar2.toString()); |
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
| svn status | grep ! | cut -c 9- | xargs svn rm |
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
| //The following code is by Randolph Franklin, it returns 1 for interior points and 0 for exterior points. | |
| int pnpoly(int npol, float *xp, float *yp, float x, float y) | |
| { | |
| int i, j, c = 0; | |
| for (i = 0, j = npol-1; i < npol; j = i++) { | |
| if ((((yp[i] <= y) && (y < yp[j])) || | |
| ((yp[j] <= y) && (y < yp[i]))) && | |
| (x < (xp[j] - xp[i]) * (y - yp[i]) / (yp[j] - yp[i]) + xp[i])) | |
| c = !c; |
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
| #!BPY | |
| """ | |
| Name: 'isom object' | |
| Blender: 250 | |
| Group: 'Export' | |
| Tooltip: 'Exports currently selected object as js file for use with WebGL' | |
| Author: Schell Scivally (efnx.com) | |
| """ |
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
| (defun filter (a b) | |
| "Filters out all items in a from b" | |
| (if (= 0 (length a)) b | |
| (filter (remove (first a) a) (remove (first a) b)))) |