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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.6.0; | |
interface AggregatorV3Interface { | |
function decimals() | |
external | |
view | |
returns ( | |
uint8 |
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
[ | |
{ | |
"name": "General Todos", | |
"urlName": "general", | |
"todos": [ | |
{ | |
"task": "Learn React", | |
"isCompleted": true | |
}, | |
{ |
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
{ | |
"info": { | |
"_postman_id": "78a06991-03ee-4e6d-a10c-30ca05298a6f", | |
"name": "sana_learn_content_registry", | |
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | |
}, | |
"item": [ | |
{ | |
"name": "Create / Update an Asset", | |
"event": [ |
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
template <typename K> | |
unsigned long hash(K const & key) { | |
// TODO | |
unsigned long l = 0; | |
for ( int i = 0 ; i < key.length; i++ ) | |
l += ( stoi(k.at[i]) * ( i+1) ); | |
return l; | |
} // cat // tac -> collision! |
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
dna = """ACAAGATGCCATTGTCCCCCGGCCTCCTGCTGCTGCTGCTCTCCGGGGCCACGGCCACCGCTGCCCTGCC | |
CCTGGAGGGTGGCCCCACCGGCCGAGACAGCGAGCATATGCAGGAAGCGGCAGGAATAAGGAAAAGCAGC | |
CTCCTGACTTTCCTCGCTTGGTGGTTTGAGTGGACCTCCCAGGCCAGTGCCGGGCCCCTCATAGGAGAGG | |
AAGCTCGGGAGGTGGCCAGGCGGCAGGAAGGCGCACCCCCCCAGCAATCCGCGCGCCGGGACAGAATGCC | |
CTGCAGGAACTTCTTCTGGAAGACCTTCTCCTCCTGCAAATAAAACCTCACCCATGAATGCTCACGCAAG | |
TTTAATTACAGACCTGAAG""".replace("\n", "").replace("\t", "").replace("\r", "").replace(" ", "") | |
#1 using regular expression | |
import re | |
print re.split("TAG|TAA|TGA", dna) |
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
package by.htp.servlet; | |
import java.io.IOException; | |
import javax.servlet.ServletException; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
public class FirstServlet extends HttpServlet { |
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
// bac cab cba | |
bool isAnagram(string str1, string str2) { | |
if (str1.empty() && str2.empty()) return true; | |
if (str1.size() != str2.size()) return false; | |
sort(str1.begin(), str1.end()); | |
sort(str2.begin(), str2.end()); | |
return str1 == str2; | |
} | |
EXPECT_EQ(isAnagram("",""), true) |
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
// Here is the test lives | |
package com.company; | |
import com.google.common.base.Preconditions; | |
import com.google.common.collect.Lists; | |
import java.util.ArrayList; | |
import java.util.function.Consumer; | |
public class Main { |
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
def qsort(xs): | |
if len(xs) < 2: return xs | |
lq = qsort([x for x in xs[1:] if x <= xs[0]]) | |
gt = qsort([x for x in xs[1:] if x > xs[0]]) | |
return lq + xs[0:1] + gt |
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
package main | |
import ( | |
"math/rand" | |
"fmt" | |
"time" | |
) | |
type Pack struct { | |
name string |
NewerOlder