This file contains hidden or 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 | |
#!/usr/bin/python | |
from collections import namedtuple | |
import psycopg2 | |
#from psycopg2 import sql | |
# note | |
# that we have to import the Psycopg2 extras library ! | |
#import psycopg2.extras | |
from psycopg2 import extras | |
from psycopg2.extras import NamedTupleConnection |
This file contains hidden or 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 ??? | |
//import java.time.LocalDateTime | |
// | |
//import scala.language.implicitConversions | |
import scala.PartialFunction._ | |
// | |
import akka.actor.{ Actor, ActorLogging, ActorRef, Props } |
This file contains hidden or 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.6 | |
# -*- coding: utf-8 -*- | |
import sys | |
from pprint import pprint, pformat | |
import logging | |
from collections import namedtuple | |
import random | |
from random import randint | |
from array import array | |
from enum import Enum#, unique |
This file contains hidden or 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 -*- | |
#utf_8 U8, UTF, utf8 | |
"""read_from_json.py: | |
Example: | |
of Python's | |
web scraping |
This file contains hidden or 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
>>> (l_s := len(l), l_r := list(reversed(l)), [(l_r[0:-l_s + i + 1][::-1], l[0:l_s - i - 1:]) for i in range(0, l_s - 1, 1)]) | |
(5, [5, 4, 3, 2, 1], [([5], [1, 2, 3, 4]), ([4, 5], [1, 2, 3]), ([3, 4, 5], [1, 2]), ([2, 3, 4, 5], [1])]) | |
# iteration using mod of list size | |
>>> [[l[5 - (r_i + i) % 5 - 1] for i in range(0, 5, 1)] for r_i in range(0, 5, 1)] | |
[[5, 4, 3, 2, 1], [4, 3, 2, 1, 5], [3, 2, 1, 5, 4], [2, 1, 5, 4, 3], [1, 5, 4, 3, 2]] | |
# counterclockwise | |
>>> [[l[(r_i + i) % 5] for i in range(0, 5, 1)] for r_i in range(0, 5, 1)] | |
[[1, 2, 3, 4, 5], [2, 3, 4, 5, 1], [3, 4, 5, 1, 2], [4, 5, 1, 2, 3], [5, 1, 2, 3, 4]] | |
# and clockwise |
OlderNewer