Skip to content

Instantly share code, notes, and snippets.

@Nafanya
Nafanya / apriori.py
Created March 15, 2017 14:18
apriori.py adopted for Python3
import argparse
from itertools import chain, combinations
def joinset(itemset, k):
return set([i.union(j) for i in itemset for j in itemset if len(i.union(j)) == k])
def subsets(itemset):
return chain(*[combinations(itemset, i + 1) for i, a in enumerate(itemset)])
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@Nafanya
Nafanya / index.html
Last active November 14, 2019 15:27
Nested comments bootstrap
<html><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Nested comments</title>
<style>
.post-comments {
padding-bottom: 9px;
margin: 5px 0 5px;
}
package ru.ifmo.ctddev.yaschenko.hello;
import info.kgeorgiy.java.advanced.hello.HelloServer;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import java.util.concurrent.ExecutorService;
package info.kgeorgiy.java.advanced.hello;
import org.junit.Assert;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.SocketAddress;
import java.net.SocketException;
import java.nio.charset.Charset;
/* GANSTA SHIT
/ Controller functions specifics
*/
function Exercise($scope){
$scope.template_type = "text";
$scope.maxTextFieldSize = 0;
/*
/ Specific Exercise Initialization