Instantly share code, notes, and snippets.

View DaemonThread.java
import java.util.Random;
// Java program to demonstrate the usage of
// setDaemon() and isDaemon() method.
public class DaemonThread extends Thread
{
public DaemonThread(String name){
super(name);
}
View concorde.h
/* INCLUDE/config.h. Generated automatically by configure. */
/****************************************************************************/
/* */
/* This file is part of CONCORDE */
/* */
/* (c) Copyright 1995--1999 by David Applegate, Robert Bixby, */
/* Vasek Chvatal, and William Cook */
/* */
/* Permission is granted for academic research use. For other uses, */
/* contact the authors for licensing options. */
View shuffle.php
<?php
$ans1 = json_decode("{ \"id\": 503732, \"question_id\": 129290, \"title\": \"Hemen hemen her gün yorgunum\", \"link\": null, \"background\": \"\", \"vote_count\": 757, \"created_at\": \"2018-01-30 15:06:05\", \"updated_at\": \"2018-01-30 15:45:24\", \"triggers_lead\": 0, \"cm_question_id\": 129294, \"triggers_display\": 0, \"has_right_answer\": 0, \"is_right_answer\": 0, \"voted\": 0 }");
$ans2 = json_decode("{ \"id\": 503733, \"question_id\": 129290, \"title\": \"Haftada en az 3-4 gün yorgunum\", \"link\": null, \"background\": \"\", \"vote_count\": 262, \"created_at\": \"2018-01-30 15:06:05\", \"updated_at\": \"2018-01-30 15:45:24\", \"triggers_lead\": 0, \"cm_question_id\": 129294, \"triggers_display\": 0, \"has_right_answer\": 0, \"is_right_answer\": 0, \"voted\": 0 }");
$ans3 = json_decode("{ \"id\": 503734, \"question_id\": 129290, \"title\": \"Haftada 1-2 gün yorgunum\", \"link\": null, \"background\": \"\", \"vote_count\": 199, \"created_at\": \"2018-01-30 15:06:05\", \"updated_at\": \"2018-01-
View concurrent_w_shared_vars.py
from joblib import Parallel, delayed
from joblib import __version__ as joblibv
import time
joblibv = joblibv.split('.')
assert int(joblibv[1]) >= 11
# http://joblib.readthedocs.io/en/latest/parallel.html#shared-memory-semantics
View crawler.py
import os
from os.path import basename
for root, dirs, files in os.walk('.\\Submissions'):
for f in files:
name = "%s%s" % (basename(root), f)
src = "%s\\%s" % (root, f)
dst = ".\\Submissions\\%s" % name
os.rename(src, dst)
os.rmdir(root)