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
| DROP KEYSPACE mykeyspace ; | |
| CREATE KEYSPACE mykeyspace WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor' : 3} AND durable_writes = true; | |
| USE mykeyspace; | |
| CREATE TABLE heartrate_v10 ( | |
| pet_chip_id uuid, | |
| owner uuid, | |
| time timestamp, | |
| heart_rate int, |
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
| CREATE KEYSPACE mykeyspace WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '3'} AND durable_writes = true; | |
| USE mykeyspace; | |
| CREATE TABLE guards (firstname text, lastname text, state boolean, room_temp int, PRIMARY KEY ((firstname, lastname))); | |
| INSERT INTO guards (firstname, lastname, state, room_temp) VALUES ('tzach', 'livyatan', false, 25); | |
| INSERT INTO guards (firstname, lastname, state, room_temp) VALUES ('tzach', 'livyatan', false, 24); | |
| INSERT INTO guards (firstname, lastname, state, room_temp) VALUES ('guy', 'Guy Shtub', false, 25); | |
| INSERT INTO guards (firstname, lastname, state, room_temp) VALUES ('laura', 'novich', false, 23); | |
| INSERT INTO guards (firstname, lastname, state, room_temp) VALUES ('avishai', 'Ish Shalom', true, 24); | |
| INSERT INTO guards (firstname, lastname, state, room_temp) VALUES ('ivan', 'Prisyazhnyy', true, 25); |
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
| (custom-set-faces | |
| ;; custom-set-faces was added by Custom. | |
| ;; If you edit it by hand, you could mess it up, so be careful. | |
| ;; Your init file should contain only one such instance. | |
| ;; If there is more than one, they won't work right. | |
| ) | |
| (let ((default-directory "~/emacs/")) | |
| (normal-top-level-add-subdirs-to-load-path)) | |
| (require 'better-defaults) |
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
| #!/bin/bash | |
| git fetch upstream | |
| git checkout master | |
| git merge upstream/master |
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
| docker run --name some-scylla-night -d scylladb/scylla-nightly --experimental 1 | |
| docker exec -it some-scylla-night cqlsh | |
| cqlsh> | |
| CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true; | |
| CREATE TABLE ks.t (pk int, ck int, v int, PRIMARY KEY (pk, ck, v)) WITH cdc = {'enabled':true}; | |
| INSERT INTO ks.t (pk,ck,v) VALUES (1,2,3); | |
| INSERT INTO ks.t (pk,ck,v) VALUES (1,2,4); |
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
| # Installing Guile on Fedoa 30 from source file does not work as documented | |
| # here are the extra steps I did | |
| # Download tar from https://ftp.gnu.org/gnu/guile/ | |
| tar -xvf guile-3.0.0.tar.gz | |
| # install missing libs | |
| sudo dnf install libffi-devel | |
| sudo dnf install gc-devel |
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
| CREATE KEYSPACE mykeyspace WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true; | |
| USE mykeyspace; | |
| CREATE TABLE tbl ( | |
| k int, | |
| v int, | |
| x int, | |
| PRIMARY KEY (k,v) | |
| ); | |
| INSERT INTO tbl (k,v,x) VALUES (1,2,0); | |
| INSERT INTO tbl (k,v,x) VALUES (1,2,3) IF NOT EXISTS; |
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
| CREATE KEYSPACE mykeyspace WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true; | |
| USE mykeyspace; | |
| CREATE TABLE tbl ( | |
| k int, | |
| v int, | |
| x int, | |
| PRIMARY KEY (k,v) | |
| ); | |
| INSERT INTO tbl (k,v,x) VALUES (1,2,0); | |
| INSERT INTO tbl (k,v,x) VALUES (1,2,3) IF NOT EXISTS; |
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
| (defn round100 [n] (-> n (* 100) (Math/floor) (/ 100))) | |
| (defn calcInterest [& {:keys [initialAmount interestRate years roundInterestYearly]}] | |
| (nth (iterate | |
| (fn calcInterestOneYear [amount] | |
| (cond-> (* interestRate amount) | |
| roundInterestYearly round100)) | |
| initialAmount) years)) |
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
| (ns cassandra-project.core | |
| (:require [qbits.alia :as alia])) | |
| (def cluster (alia/cluster {:contact-points ["172.17.0.2"]})) | |
| (def session (alia/connect cluster)) | |
| (alia/execute session "USE mykeyspace;") | |
| (dotimes [n 2000000] | |
| (alia/execute session (str "UPDATE mykeyspace.gr SET link = link + {" n " : 'ABC'} WHERE id=1 AND r=1;"))) |