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
(declaim (optimize (speed 3) (debug 0) (space 0) (safety 0))) | |
(defun build-btree (item depth) | |
(declare (fixnum item depth)) | |
(if (zerop depth) (list item) | |
(let ((item2 (+ item item)) | |
(depth-1 (1- depth))) | |
(declare (fixnum item2 depth-1)) | |
(cons item | |
(cons (build-btree (the fixnum (1- item2)) depth-1) |
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
## Copyright 2010 Yoav Goldberg | |
## | |
## This file is part of easyfirst | |
## | |
## easyfirst is free software: you can redistribute it and/or modify | |
## it under the terms of the GNU General Public License as published by | |
## the Free Software Foundation, either version 3 of the License, or | |
## (at your option) any later version. | |
## | |
## easyfirst is distributed in the hope that it will be useful, |
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
## Copyright 2010 Yoav Goldberg | |
## | |
## This file is part of easyfirst | |
## | |
## easyfirst is free software: you can redistribute it and/or modify | |
## it under the terms of the GNU General Public License as published by | |
## the Free Software Foundation, either version 3 of the License, or | |
## (at your option) any later version. | |
## | |
## easyfirst is distributed in the hope that it will be useful, |
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
# this is an Ipython session (http://ipython.org/) | |
%run code/hw2.py | |
# generating the scatter plot for generateDataset(50,sin,0.03): | |
from numpy import sin; import pylab | |
data = generateDataset(50,sin,0.03) | |
scatter(data[0],data[1], marker='+', facecolor='g') | |
grid() |
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
def generateDataset(N, f, sigma): | |
""" | |
The function generateDataset(N, f, sigma) should return a tuple | |
with the 2 vectors x and t. for example: | |
ti = y(xi) + Normal(mu, sigma) | |
# where the xi values are equi-distant on the [0,1] segment (that | |
is, x1 = 0, x2=1/N-1, x3=2/N-1..., xN = 1.0) | |
mu = 0.0 | |
sigma = 0.03 |
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
from cPickle import dump | |
import justext | |
import nltk | |
import requests | |
from google import search | |
def main(): | |
pages_used = 0 | |
for url in search('aeron chair', stop=30): | |
text = "" |
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
In toplevel form: | |
url/url.el:166:1:Error: No setf-method known for url-use-cookies | |
make[2]: *** [url/url.elc] Error 1 | |
make[2]: Leaving directory `/home/lxmonk/git/emacs/lisp' | |
make[1]: *** [compile-main] Error 2 | |
make[1]: Leaving directory `/home/lxmonk/git/emacs/lisp' | |
make: *** [lisp] Error 2 |
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
> (define last-pair | |
(lambda (x) | |
(if (null? (cdr x)) x | |
(last-pair (cdr x))))) | |
> (last-pair '(a b c d e)) | |
(e) | |
> (define foo | |
(lambda () |
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
Debugger entered--Lisp error: (error "Python: Emacs: \"(error \\\"Key sequence C-x p k starts with non-prefix key C-x p\\\")\" | |
") | |
signal(error ("Python: Emacs: \"(error \\\"Key sequence C-x p k starts with non-prefix key C-x p\\\")\"\n")) | |
pymacs-report-error("Python: %s" "Emacs: \"(error \\\"Key sequence C-x p k starts with non-prefix key C-x p\\\")\"\n") | |
(if success (pymacs-report-error "Python: %s" value) (pymacs-report-error "%s" value)) | |
(cond ((eq action (quote eval)) (if success (setq action "return" inserter (\` (pymacs-print-for-eval (quote (\, value))))) (setq action "raise" inserter (\` (let ((pymacs-forget-mutability t)) (pymacs-print-for-eval (\, value))))))) ((eq action (quote expand)) (if success (setq action "return" inserter (\` (let ((pymacs-forget-mutability t)) (pymacs-print-for-eval (\, value))))) (setq action "raise" inserter (\` (let ((pymacs-forget-mutability t)) (pymacs-print-for-eval (\, value))))))) ((eq action (quote return)) (if success (setq done t) (pymacs-report-error "%s |
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
V/WifiStateTracker( 2138): New network state is CONNECTED | |
D/WifiStateTracker( 2138): DHCP renewal started | |
I/ActivityThread( 2827): Pub call_log: com.android.providers.contacts.CallLogProvider | |
I/ActivityManager( 2138): No longer want com.cyanogenmod.cmparts (pid 2671): hidden #16 | |
D/dalvikvm( 2827): GC_CONCURRENT freed 161K, 48% free 2965K/5639K, external 0K/0K, paused 6ms+2ms | |
D/GTalkService( 2271): [GTalkConnection.25] EVENT_REQUEST_ROSTER: not connected | |
D/szipinf ( 2827): Initializing inflate state | |
D/szipinf ( 2827): Initializing inflate state | |
D/szipinf ( 2827): Initializing inflate state | |
D/szipinf ( 2827): Initializing inflate state |
NewerOlder