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 ruby1.9 | |
| require 'mathn' | |
| A = Matrix[[4,2], | |
| [3,5]] | |
| b = Vector[1, | |
| 2] | |
| def jacobi(matrix,vector) |
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
| wfarr@turing:~/Code/wfarr.github.com/_posts[master*]$ tail -n50 lisp-and-emacs.textile | grep "There" | |
| There are other complicated softwares that are widely adopted, but Emacs doesn't have the good public face they do. |
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
| --[[ | |
| VPLanguage = lua | |
| VPScriptMenuTitle = GitHub Commit | |
| VPEndConfig | |
| ]] | |
| -- we assume git is located in PATH | |
| posix.chdir(document:fileName()) | |
| -- add new files |
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
| test_matr.LUdecomp | |
| Order: | |
| puts "#{cvs[j][j]} #{cvs[k][k]} #{cvs[j][k]}" | |
| Matrix[*l_new].pretty_print | |
| Matrix[*cvs.transpose].pretty_print | |
| u_new.pretty_print | |
| test_matr.LUdecomp | |
| 3 1 1 |
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
| \documentclass[11pt,letterpaper]{article} | |
| \usepackage{ifpdf} | |
| \usepackage{mla} | |
| \begin{document} | |
| \begin{mla}{Will}{Farrington}{Some Prof}{Some Class}{\today}{Some Title} | |
| Foo. | |
| Bar. |
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 ruby1.9 | |
| require 'mathn' | |
| A = Matrix[[4,1], | |
| [2,3]] | |
| b = Vector[6, | |
| 8] | |
| def jacobi(matrix,vector) |
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 gauss_seidel(matrix,vector) | |
| a11 = matrix[0,0] | |
| a12 = matrix[0,1] | |
| a21 = matrix[1,0] | |
| a22 = matrix[1,1] | |
| b1 = vector[0] | |
| b2 = vector[1] | |
| x_1 = ->(x){ b1.fdiv(a11) - (a12.fdiv(a11) * x) } | |
| x_2 = ->(x){ b2.fdiv(a22) - (a21.fdiv(a22) * x) } |
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
| ;; works | |
| (yql filter sampleQuery (yql desc flickr.places)) | |
| ;; "select * from flickr.places where query=\"north beach\"" | |
| ;; fails | |
| (yql | |
| filter item | |
| (yql select title,pubDate rss (format "url='http://twitter.com/statuses/user_timeline/%s.rss'" "wfarr")) | |
| ) | |
| ;; error: |
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
| ;; Works for (yql-filter 'sampleQuery (yql desc flickr.places)) | |
| (defmacro yql-filter (symbol list) | |
| "Filters any JSON returned from a `yql-send-request' call for the value(s) | |
| associated to `symbol', where the JSON is `list'." | |
| `(let ((result (yql-search-for-symbol ,symbol ,list))) | |
| (if (or (typep result 'list) | |
| (typep result 'string) | |
| (typep result 'number)) | |
| result |
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
| (defmacro yql (query &rest args) | |
| "Constructs a function call based on `query', which should be one of | |
| `show', `desc', `select', or `filter'." | |
| (unless (member query '(show desc select filter)) | |
| (error "`query' must be one of `show', `desc', `select', or `filter'!")) | |
| (cond ((eq query 'show) | |
| (quote (yql-show))) | |
| (args | |
| (let ((query-args | |
| (mapcar (lambda (x) |