Skip to content

Instantly share code, notes, and snippets.

/usr/local/Library/brew.rb: loading /usr/local/Library/Taps/homebrew-science/r.rb
/usr/local/Library/brew.rb: loading /usr/local/Library/Formula/readline.rb
/usr/local/Library/brew.rb: loading /usr/local/Library/Formula/libtiff.rb
/usr/local/Library/brew.rb: loading /usr/local/Library/Formula/jpeg.rb
/usr/local/Library/Taps/homebrew-science/r.rb: loading /usr/local/Library/Formula/readline.rb
/usr/local/Library/Taps/homebrew-science/r.rb: loading /usr/local/Library/Formula/libtiff.rb
/usr/local/Library/Taps/homebrew-science/r.rb: loading /usr/local/Library/Formula/jpeg.rb
/usr/local/Library/Taps/homebrew-science/r.rb: loading /usr/local/Library/Formula/gfortran.rb
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
@cwchentw
cwchentw / perl-mode
Last active January 3, 2016 20:39
perl-mode for auto-complete
# Perl keywords
-A
$END
length
setpgrp
-B
endgrent
link
setpriority
-b
@cwchentw
cwchentw / openblas_log.txt
Last active August 29, 2015 14:02
log about compiling openblas on OS X Mavricks 10.9.3
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Downloading https://github.com/xianyi/OpenBLAS/archive/v0.2.9.rc2.tar.gz
Already downloaded: /Library/Caches/Homebrew/openblas-0.2.9-rc2.tar.gz
==> make FC=/usr/local/bin/gfortran libs netlib shared
_main in libgfortranbegin.a(fmain.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [libopenblas_sandybridgep-r0.2.9.rc2.dylib] Error 1
make: *** [shared] Error 2
@cwchentw
cwchentw / test.js
Created May 9, 2015 08:09
mocha didn't work when using with fs.writeFile or fs.readFile
var fs = require('fs'),
os = require('os');
var assert = require('assert'),
expect = require('expect.js'),
should = require('should');
describe('Test on I/O', function() {
it('write test', function() {
fs.writeFile('./text.txt', "Hello Node.js" + os.EOL, function(err) {
Sat Sep 19 06:23:48 +0800 2015
./configure
--disable-dependency-tracking
--disable-silent-rules
--prefix=/home/u00ycl03/.linuxbrew/Cellar/gdbm/1.11
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
@cwchentw
cwchentw / stackDemo.c
Last active April 29, 2018 09:33
Stack Manipulations without Function
/*
Stack Manipulations without Function
Author: Michael Chen, 2018.
License: MIT.
*/
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@cwchentw
cwchentw / vector.lua
Last active February 9, 2019 07:20
Math Vector in Pure Lua (Apache 2.0)
local Vector = {}
package.loaded['Vector'] = Vector
Vector.__index = Vector
Vector.__eq = function (a, b)
if type(a) ~= type(b) then
return false
end
@cwchentw
cwchentw / matrix.lua
Last active February 9, 2019 07:19
Math Matrix in Pure Lua (Apache 2.0)
local Matrix = {}
package.loaded["Matrix"] = Matrix
Matrix.__index = Matrix
Matrix.__eq = function (a, b)
assert(a:col() == b:col())
assert(a:row() == b:row())
for i = 1, a:col() do
@cwchentw
cwchentw / array_list.lua
Last active April 16, 2024 01:49
Array-based List in Pure Lua (Apache 2.0)
local List = {}
package.loaded["List"] = List
List.__index = List
function List:new()
self = {}
self._arr = {}
setmetatable(self, List)
return self
@cwchentw
cwchentw / linked_list.lua
Last active February 9, 2019 07:18
Linked List in Pure Lua (Apache 2.0)
local Node = {}
Node.__index = Node
function Node:new(data)
self = {}
self._data = data
self.prev = nil
self.next = nil
setmetatable(self, Node)