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
* *features* | |
(:SB-BSD-SOCKETS-ADDRINFO :ASDF :SB-THREAD :ANSI-CL :COMMON-LISP :SBCL :SB-DOC | |
:SB-TEST :SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE :SB-EVAL :SB-SOURCE-LOCATIONS | |
:IEEE-FLOATING-POINT :X86-64 :UNIX :ELF :LINUX :LARGEFILE :GENCGC | |
:STACK-GROWS-DOWNWARD-NOT-UPWARD :C-STACK-IS-CONTROL-STACK :LINKAGE-TABLE | |
:COMPARE-AND-SWAP-VOPS :UNWIND-TO-FRAME-AND-CALL-VOP :RAW-INSTANCE-INIT-VOPS | |
:STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-VECTORS | |
:STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-FIXED-OBJECTS :ALIEN-CALLBACKS | |
:CYCLE-COUNTER :COMPLEX-FLOAT-VOPS :FLOAT-EQL-VOPS :INLINE-CONSTANTS |
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
* (+ 2 2) | |
4 | |
* *features* | |
(:SB-BSD-SOCKETS-ADDRINFO :ASDF :SB-THREAD :ANSI-CL :COMMON-LISP :SBCL :SB-DOC | |
:SB-TEST :SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE :SB-EVAL :SB-SOURCE-LOCATIONS | |
:IEEE-FLOATING-POINT :X86-64 :UNIX :ELF :LINUX :LARGEFILE :GENCGC | |
:STACK-GROWS-DOWNWARD-NOT-UPWARD :C-STACK-IS-CONTROL-STACK :LINKAGE-TABLE | |
:COMPARE-AND-SWAP-VOPS :UNWIND-TO-FRAME-AND-CALL-VOP :RAW-INSTANCE-INIT-VOPS |
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
(lambda (features) | |
(pushnew :sb-thread features)) |
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
(defvar *bdb-connection* (elephant:open-store (list :BDB "/home/smanek/lisp-db-bench/bdb"))) | |
(defun get-next-guid () | |
(let ((n (1+ (or (ele:get-from-root "*next-guid*") | |
0)))) | |
(ele:add-to-root "*next-guid*" n))) | |
(ele:defpclass ele-class () | |
((score :accessor get-score | |
:initarg :score |
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
(in-package :webapp) | |
(clsql-sys:enable-sql-reader-syntax) | |
(setf clsql-sys:*db-auto-sync* t) | |
(clsql:def-view-class sql-data () | |
((guid :db-kind :key | |
:db-constraints :not-null | |
:type integer | |
:initform (get-next-guid) ;;only for portability |
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
(clsql:select [guid] :from [sql-data] | |
:order-by '(([score] :desc)) | |
:limit count) |
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
(ele:with-transaction () | |
(mapcar #'(lambda (oid) | |
(ele::controller-recreate-instance ele:*store-controller* oid)) | |
(ele:with-btree-cursor (curs (ele:find-inverted-index class slot)) | |
(loop with i = 0 | |
for (m k v) = (multiple-value-list (ele:cursor-last curs)) | |
then (multiple-value-list (ele:cursor-prev curs)) | |
while (and m (if count | |
(<= (incf i) count) | |
t)) |
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
import java.util.Calendar; | |
public class DistanceObjects { | |
private static final Float PI = new Float(Math.PI); | |
private static final int RADIUS = 6371; | |
public static Float degreeToRadian(Float degree) { | |
return degree * (PI/180f); | |
} | |
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
import math | |
import time | |
radius = 6371 | |
def distance(latA, lngA, latB, lngB): | |
latAr = math.radians(latA) | |
lngAr = math.radians(lngA) | |
latBr = math.radians(latB) | |
lngBr = math.radians(lngB) |
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
(defvar *earth-radius* 6371) | |
(defun degree-to-radian (deg) | |
(* deg (/ pi 180))) | |
(defun distance (lata lnga latb lngb) | |
(let* ((lata-r (degree-to-radian lata)) | |
(lnga-r (degree-to-radian lnga)) | |
(latb-r (degree-to-radian latb)) | |
(lngb-r (degree-to-radian lngb)) |
OlderNewer