Skip to content

Instantly share code, notes, and snippets.

graph Doskvol {
concentrate=true;
edge[color=forestgreen]
subgraph legend {
color = black;
label = "Legend";
"Tier I"--"Tier II"--"Tier III"--"Tier IV"--"Tier V"
}
declare function assert(value: unknown): asserts value;
interface Rule {
ref: string,
raw: Array<string>,
compiled: string | null,
cyclic: boolean,
}
const orRule: Rule = {
<style>.eventIcon sf, hr, #superfooter, #header, #userneohome, #footer, #habitarium, #ncmall, #ban, #usershop, #usercollections img, #ad-slug-wrapper{display: none;}.contentModuleHeader, .contentModuleHeaderAlt, h1{text-align: center;font: 7pt verdana;letter-spacing: 3px;text-transform: uppercase;color: #FFF;padding: 0px;background: #c2e0f8;line-height: 20pt;}body{background: #EFEFEF;}h1{margin: 0;}#main{width: 1195px;margin-top: -30px;background: 0;border: 0;}#box, .contentModuleTable, #box2{background: #FFF;border: 1px solid #EBEBEB;}#userinfo{width: 400px;}#usercollections{width: 390px;}.medText{padding: 5px;}.contentModuleContent{padding: 10px;}#userinfo, #usercollections{height: 310px !important;}#usertrophies, #usertrophies .medText{width: 800px !important;}#userneopets img:hover{border: 3px solid #ccc;}#scroll > div img, #userneopets img, #userinfo a img{border-radius: 210px!important;}p, td, div, b{color: #bebebe;font: 10pt tahoma;}a{text-decoration: none;color: #565656 !important;}a:hover{text-decora
function DrawingComponent(props: DrawingComponentProps) {
...
const [histories, setHistories] = useState<Array<History>>([]);
...
function clear() {
layerRef.current?.destroyChildren();
layerRef.current?.clear();
import React, { useRef, useState } from 'react';
import { Stage, Layer, Line} from 'react-konva';
import Konva from 'konva';
import '../styles/MyComponent.css';
import {Mode} from './constants'
function DrawingCanvas() {
const stageRef = useRef<Stage>(null);
const stage = stageRef.current || new Stage({width: 600, height: 400});
const [isPaint, setIsPaint] = useState(false);
module Lab5 where
import Control.Monad
import Data.List
-- A.1
hrSolutions :: [((Integer, Integer), (Integer, Integer), Integer)]
hrSolutions = do
i <- [1..]
map3 :: (a->b->c->d) -> [a] -> [b] -> [c] -> [d]
map3 _ [] _ _ = []
map3 _ _ [] _ = []
map3 _ _ _ [] = [] -- Is there a better way to do this? ¯\_(ツ)_/¯
map3 f (x:xs) (y:ys) (z:zs) = f x y z : map2 f xs ys zs
def similarity(self, G=None, H=None, iters=20):
""" Returns the graph similarity based on Neighbor Matching[Ref]
Derived from 'wadsashika'_
:param G: networkx graph of original graph (default: self.G)
:param H: networkx graph of inferred graph (default: self.H)
:param iter: number of iterations (default: 20)
:return: float
"""
while(getline(fbase, line))
{
cudaEventSynchronize(finishedMemcpyEvent);
if (!(fbase >> user >> movie >> day >> rating)){
data_idx++;
continue;
}
// process the line. Store indices instead of values
buffer[data_idx % batchsize] = DataPoint(user - 1, movie - 1, rating);
#include <assert.h>
#include "knapsack.h"
#define maxcount 10
using namespace std;
// ******* DATA STRUCTURES ***********