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
class DynamicArrayQueue { | |
constructor() { | |
this._arr = []; | |
} | |
enqueue(item) { | |
this._arr.push(item); | |
} | |
dequeue() { |
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
interface Queue extends Iterable<any>{ | |
enqueue(item: any): void; | |
dequeue(): any; | |
clear(): void; | |
size(): number; | |
peekFirst(): any; | |
peekLast(): any; | |
copyTo(arr: any[], startIndex?: number): void | |
drainingIterator(): Iterator<any>; | |
toJSON(): any[]; |
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
interface Queue { | |
enqueue(item: any): void; | |
dequeue(): any; | |
} |
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
// note: -D_7ZIP_ST is required when compiling on non-Windows platforms | |
// g++ -o lzma_sample -std=c++14 -D_7ZIP_ST lzma_sample.cpp LzmaDec.c LzmaEnc.c LzFind.c | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <memory> | |
#include "LzmaEnc.h" | |
#include "LzmaDec.h" |
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 sys | |
from itertools import zip_longest | |
from traceback import print_exc | |
def grouper(iterable, n, fillvalue=None): | |
"""Collect data into fixed-length chunks or blocks""" | |
# grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx" | |
args = [iter(iterable)] * n | |
return zip_longest(*args, fillvalue=fillvalue) |
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 * as request from "superagent"; | |
export class TokenExtractMiddleware { | |
constructor() { | |
} | |
extract = (req, res, next) => { | |
const url = `${process.env.AUTH_SERVICE}/auth/authenticate`; |
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
class hn_wrapper(object): | |
def __init__(self, it): | |
self.it = iter(it) | |
self._hasnext = None | |
def __iter__(self): return self | |
def next(self): | |
if self._hasnext: | |
result = self._thenext | |
else: | |
result = next(self.it) |
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
https://8gwifi.org/RSAFunctionality?keysize=512 | |
-----BEGIN PUBLIC KEY----- | |
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKanYhwoySc0JjNjqT21f+4hXP+e1g1h | |
dz9wNj0XHii1luZtn8ydFRpzMF5CgECYO4jHMbuB2ZnPXU6Ar7t57HMCAwEAAQ== | |
-----END PUBLIC KEY----- | |
-----BEGIN RSA PRIVATE KEY----- | |
MIIBOQIBAAJBAKanYhwoySc0JjNjqT21f+4hXP+e1g1hdz9wNj0XHii1luZtn8yd | |
FRpzMF5CgECYO4jHMbuB2ZnPXU6Ar7t57HMCAwEAAQJACcZfls89nTMN2o3J63it |
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
OOXXO X O | |
XOOXXOOXO | |
XX XXOOOO | |
XO O OXX | |
XXXOO O | |
OXXXOXOOX | |
XXOOXOXOX | |
O O XOXXO | |
OO XXX | |
X OXO XXO |
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 org.aftermath; | |
import java.util.List; | |
public interface MovieRecommender { | |
List<String> recommend(); | |
} |