{{ message }}

Instantly share code, notes, and snippets.

🌻
Tending to my plants

# Bee bee-san

🌻
Tending to my plants
Created Mar 29, 2019
factorial.py
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
 n = 6 def recur_factorial(n): if n == 1: return n else: return n * recur_factorial(n-1) print(recur_factorial(n))
Created Mar 29, 2019
View non_recurfib.py
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 f(n): if n == 0 or n == 1: return 1 else: fibo = 1 fibroPrev = 1 for i in range (2, n): temp = fibo fibo = fibo + fiboPrev fiboPrev = temp
Created Mar 29, 2019
View fib_start.py
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 f(n): if n == 0 or n == 1: return 1
Created Mar 29, 2019
View non_recur_fib.py
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
 n = 6 def recur_factorial(n): if n == 1: return n else: return n * recur_factorial(n-1) print(recur_factorial(n))
Created Mar 18, 2019
View dh.java
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
 /* A Lisitsa, 2019, The code below was taken without any changes from https://docs.oracle.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec.html#DH3Ex */ /* * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met:
Created Mar 6, 2019
View assignment1.R
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
 # Brandon Skerritt # b.skerritt@liverpool.ac.uk # reads in and renames the column names table = read.table("sample1_in.txt", stringsAsFactors=FALSE, fill=TRUE) colnames(table) = c("Timestamp", "Type", "Order-Id", "Side", "Price", "Size") # total expense you would incur if you bought targetsize shares (by taking as many asksas necessary, lowest first), and # the total income you would receive if you sold targetsize shares (by hitting as manybids as necessary, highest first) # global variables bidBook and askBook
Created Mar 3, 2019
View assignment.r
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
 table = read.table("sample1_in.txt", stringsAsFactors=FALSE, fill=TRUE) colnames(table) = c("Timestamp", "Type", "Order-Id", "Side", "Price", "Size") # get reduce rows # table[input$Type == "R", ] # get add rows # input[input$Type == "A", ] # cosmetic fix for reduce rows # input[input$Type == 'r', 'Size'] = input[input$Type == 'r', 'Side'] # input[Input\$Type == 'R', 'Side'] = NA pricer <- function(infile, outfile, targetsize){
Created Feb 7, 2019
View blog.js
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

Created Feb 3, 2019
View calculateD.py
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
 >>> list(filter(lambda x: ((x * 5) - 1) % 24 == 0, range(1, 200))) [5, 29, 53, 77, 101, 125, 149, 173, 197]
Created Feb 3, 2019
View compare.py
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
 a = "a9993e364706816aba3e25717850c26c9cd0d89d" b = "cb4cc28df0fdbe0ecf9d9662e294b118092a5735" a = list(a) b = list(b) percent = 0 for counter, value in enumerate(a): if value == b[counter]: