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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# http://blog.ithomer.net | |
import time | |
import redis | |
import threading | |
class Listener(threading.Thread): | |
def __init__(self, r, channels): |
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
############################## | |
##Exercise: ModulesAndFunctions-6 | |
defmodule Chop do | |
def guess(actual, lo..hi) when (lo <= hi) and (actual in lo..hi) do | |
current = guessing(lo, hi) | |
IO.puts "Is it #{current}" | |
guess(current, actual, lo..hi) | |
end | |
defp guess(value, actual, _) when value == actual, do: IO.puts value |
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
# -*- coding: utf-8 -*- | |
import math | |
def ClearScreen () : | |
# DESCRIPTION: | |
# Prints a whole bunch of space to screen | |
print("\n"*200) | |
def ColouredString (message,colour) : |
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
#!/usr/bin/env python3 | |
import subprocess, sys, multiprocessing, json, os, shlex, re | |
from datetime import timedelta | |
error_messages = { | |
"param_len": """Not enough parameters | |
Format: %s [input_file] (optional)[parameters] [movie_title] | |
""" | |
} |
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
CREATE TEXT SEARCH DICTIONARY public.vietnamese ( | |
TEMPLATE = pg_catalog.simple, | |
STOPWORDS = vietnamese | |
); | |
CREATE TEXT SEARCH CONFIGURATION public.vietnamese ( | |
COPY = pg_catalog.english | |
); | |
ALTER TEXT SEARCH CONFIGURATION public.vietnamese |