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
# Python client generated using [`servant-py`](https://github.com/erewok/servant-py) for [`dex-contracts-api`](https://github.com/geniusyield/dex-contracts-api). | |
from urllib import parse | |
import requests | |
def get_v0_settings(headerapikey): | |
""" | |
GET "v0/settings" |
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
import matplotlib.pyplot as plt | |
def buyback (t, s): | |
b = t / s # backing is treasury value divided by circulating supply | |
nt = t - t / 100 # utilising 1% of treasury for buyback, 'nt' now holds the value of new treasury | |
ns = s - t / (70 * b) # buyback at 70% of backing, 'ns' now holds new circulating supply | |
return nt, ns | |
t = [290000000] # starting assumption: $290M treasury | |
s = [5800] # starting assumption: 5800 circulating wMEMO |
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
#include <iostream> | |
#include <cmath> | |
using namespace std; | |
int main () { | |
double target = 92.51; // update this value to your marks to see possible situations. | |
for (int rm = 0; rm <= 100; rm++) { // number of questions removed can either be 0 or all | |
int availableQuestions = 100 - rm; | |
double perQuestionMark = ((double) 200)/(double (100 - rm)); |
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
/* | |
Program description: Given a positive integer n, gives number of elements of each order present in a symmetric group of order n. | |
This is used to verify the solution of problem: CSE-2013-2(b). | |
*/ | |
#include <iostream> | |
#include <vector> | |
#include <map> |
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
package simpledb.server; | |
import simpledb.remote.*; | |
import java.rmi.registry.*; | |
import java.sql.*; | |
public class Startup { | |
public static void main(String args[]) throws Exception { | |
// configure and initialize the database | |
if (args.length < 3) { |
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
import java.sql.*; | |
import simpledb.remote.SimpleDriver; | |
public class CreateUniversityDB { | |
public static void main(String[] args) { | |
Connection conn = null; | |
try { | |
Driver d = new SimpleDriver(); | |
conn = d.connect("jdbc:simpledb://localhost", null); | |
Statement stmt = conn.createStatement(); |
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
val real_division = 14.0 / 4.0 (* gives 3.5 *) | |
val int_division = 14 div 4 (* gives 3, rounding down *) | |
val int_remainder = 14 mod 4 (* gives 2, since 3*4 = 12 *) | |
(* andalso is same as && in c, orelse is same as || in c, not is the negation) | |
(* Many values can be compared using equality operators: = (==) and <> (!=) *) | |
list is written as "type list" | |
list is homogenous, list can only contain one type of thing. | |
'@' / '^' for list / string resp | |
- (2::4::6::nil) :: (2::3::5::7::nil) :: (2::4::8::16::32::nil) :: nil; | |
val it = [[2,4,6],[2,3,5,7],[2,4,8,16,32]] : int list list |
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
(* SML notes *) | |
when writing in editor, semicolon is not required but when typing in terminal we need | |
semicolon | |
val negative_number = ~15 (* Yeah, unary minus uses the 'tilde' symbol *) | |
(* | |
- Math.e; | |
val it = 2.71828182846 : real | |
- Math.cos (Math.pi/2.0); | |
val it = 0.0 : real | |
- Math.sqrt (49.01); |
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
#include <bits/stdc++.h> | |
using namespace std; | |
typedef long long int ll; | |
typedef pair<int, int> ii; | |
const int inf = 1000000; | |
const double eps = 1e-12; | |
vector<vector<int>> g; | |
int n; | |
vector<int> visited, par, origvis; | |
int bfs(int ini){ |
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
#include<bits/stdc++.h> | |
using namespace std; | |
#define inf 10000000 | |
void solve() { | |
int tc; | |
cin >> tc; | |
while (tc--) { |
NewerOlder