start new:
tmux
start new with session name:
tmux new -s myname
| # Create a new table called `globals | |
| :ets.new(:globals, [:named_table, :public]) | |
| # Put some data in it | |
| :ets.insert(:globals, {:are_we_crunching, true}) | |
| # Get it back | |
| :ets.lookup(:globals, :are_we_crunching) # true |
| #include <cs50.h> | |
| #include <stdio.h> | |
| #include <math.h> | |
| #include <stdbool.h> | |
| int last_digit(long num); | |
| bool ends_with_zero(int num); | |
| bool is_even(int num); | |
| bool luhn_validate(long num); | |
| int first_n_digits(long num, int len, int n); |
| unique_mos_id,first_name,last_name,command_now,complaint_id,month_received,year_received,month_closed,year_closed,command_at_incident,rank_abbrev_incident,rank_abbrev_now,rank_now,rank_incident,mos_ethnicity,mos_gender,mos_age_incident,complainant_ethnicity,complainant_gender,complainant_age_incident,fado_type,allegation,precinct,contact_reason,outcome_description,board_disposition | |
| 10004,Jonathan,Ruiz,078 PCT,42835,7,2019,5,2020,078 PCT,POM,POM,Police Officer,Police Officer,Hispanic,M,32,Black,Female,38,Abuse of Authority,Failure to provide RTKA card,78,Report-domestic dispute,No arrest made or summons issued,Substantiated (Command Lvl Instructions) | |
| 10007,John,Sears,078 PCT,24601,11,2011,8,2012,PBBS,POM,POM,Police Officer,Police Officer,White,M,24,Black,Male,26,Discourtesy,Action,67,Moving violation,Moving violation summons issued,Substantiated (Charges) | |
| 10007,John,Sears,078 PCT,24601,11,2011,8,2012,PBBS,POM,POM,Police Officer,Police Officer,White,M,24,Black,Male,26,Offensive Language,Race,67,Moving violation |
| ;; -*- mode: emacs-lisp -*- | |
| ;; This file is loaded by Spacemacs at startup. | |
| ;; It must be stored in your home directory. | |
| (defun dotspacemacs/layers () | |
| "Configuration Layers declaration. | |
| You should not put any user code in this function besides modifying the variable | |
| values." | |
| (setq-default | |
| ;; Base distribution to use. This is a layer contained in the directory |
| import re | |
| re_string = "(\d+\.\d+|\d+|)(\D*)\s(ohms)" | |
| inputs = [ | |
| "10 ohms", | |
| "100 ohms", | |
| "220 ohms", | |
| "330 ohms", | |
| "470 ohms", |
| class Calculator | |
| ORDERED_OPERATIONS = %W(* / + -) # maintainable, add new operations easily | |
| # no need to new up if you don't want to. | |
| def self.calculate(input) | |
| new.calculate(input) | |
| end | |
| # There is a pathological case where unknown operators are entered. |
| class Calculator | |
| ORDERED_OPERATIONS = %W(* / + -) | |
| def calculate(input) | |
| input = input.split(" ") | |
| while input.length > 1 do | |
| ORDERED_OPERATIONS.each do | op | | |
| i = input.find_index(op) |
| class Calculator | |
| def parse input | |
| input.split(" ") | |
| end | |
| def order_of_operations | |
| ["*", "/", "+", "-"] | |
| end |
| class Calculator | |
| def parse input | |
| input.split(" ") | |
| end | |
| def order_of_operations | |
| ["*", "/", "+", "-"] | |
| end |