- This is a HEALIS gist for feedback on the web site healis.eu
- You can use Markup for on your comments
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
# (C) By Josiah Carlson | |
# https://github.com/josiahcarlson/rom/issues/116 | |
# | |
def create_or_update(cls, data, **by): | |
entity = cls.get_by(**by) | |
if not entity: | |
entity = cls(**data) | |
else: | |
for k,v in data.items(): | |
setattr(entity, k, v) |
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
''' | |
redis_search.py | |
Written by Josiah Carlson July 3, 2010 | |
Released into the public domain. | |
This module implements a simple TF/IDF indexing and search algorithm using | |
Redis as a datastore server. The particular algorithm implemented uses the |
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
# Massive insertion of 1 million sorted float values using RediSearch module | |
# (C) By Athanassios I. Hatzis | |
# 14 Sept 2018 | |
# Written to explain issue: https://github.com/RedisLabsModules/RediSearch/issues/493 | |
# | |
from redisearch import Client, NumericField, NumericFilter, Query | |
from redis import Redis | |
import numpy as np | |
import time |
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
# Massive insertion of 1 million float values using Josiah Carlson ROM | |
# (C) By Athanassios I. Hatzis | |
# 14 Sept 2018 | |
# Written to explain issue: https://github.com/RedisLabsModules/RediSearch/issues/493 | |
# | |
from redis import Redis | |
import numpy as np | |
import time | |
import sys |
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
# Sorted float secondary index: An in-memory data structures comparison of Python, NumPy and Redis data structures | |
# (C) By Athanassios I. Hatzis | |
# 18th of September 2018 | |
# Written to explain issue: https://github.com/RedisLabsModules/RediSearch/issues/493 | |
# | |
# OS Environment: Linux Ubuntu x64 | |
# Processor: Intel(R) Core(TM) i3 CPU 540 @ 3.07GHz | |
# Memory 16 GB | |
from bisect import bisect_left, bisect_right |
Original source at https://github.com/Infinidat/infi.clickhouse_orm
Jupyter Notebook: https://gist.github.com/healiseu/c1c51fc823f4a2cd6cb765b8a1157def
import psutil, time, datetime
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
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Demo of Infinidat ORM Python Client for Clickhouse\n", | |
"### Original source at https://github.com/Infinidat/infi.clickhouse_orm\n", | |
"#### Modified and extended by Athanassios I. Hatzis \n", | |
"#### (c) 28th of September 2018" |
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
# Massive insertion of 1 million duplets of integer, float values using redis-py | |
# (C) By Athanassios I. Hatzis | |
# 30 Sept 2018 | |
# Written to explain issue: https://github.com/andymccurdy/redis-py/issues/850 | |
# | |
# OS Environment: Linux Ubuntu x64 | |
# Processor: Intel(R) Core(TM) i3 CPU 540 @ 3.07GHz | |
# Memory 16 GB | |
# Redis Redis 64 bit, v4.0.8, running in standalone mode | |
# |
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 15 columns, instead of 5 in line 7.
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
prtID supID catChk catDate catPrice catTotal prtColor prtName prtUnit prtWeight supAddress supCity supCountry supName supStatus | |
993 1081 FALSE 2014-03-03 15.3 200 Red Acme Widget Washer kg 142.88 1 Grub St., Potemkin Village, IL 61801 ILLINOIS USA Acme Widget Suppliers 10 | |
994 1081 FALSE 2014-03-03 20.5 100 Silver Acme Widget Washer kg 142.88 1 Grub St., Potemkin Village, IL 61801 ILLINOIS USA Acme Widget Suppliers 10 | |
995 1081 FALSE \N 20.5 \N \N I Brake for Crop Circles Sticker \N \N 1 Grub St., Potemkin Village, IL 61801 ILLINOIS USA Acme Widget Suppliers 10 | |
999 1081 FALSE \N 75.2 \N Green 7 Segment Display gr 2.1 1 Grub St., Potemkin Village, IL 61801 ILLINOIS USA Acme Widget Suppliers 10 | |
996 1081 FALSE \N 124.23 \N Cyan Anti-Gravity Turbine Generator \N \N 1 Grub St., Potemkin Village, IL 61801 ILLINOIS USA Acme Widget Suppliers 10 | |
997 1081 FALSE \N 124.23 \N Magenta Anti-Gravity Turbine Generator \N \N 1 Grub St., Potemkin Village, IL 61801 ILLINOIS USA Acme Widget Suppliers 10 | |
998 1081 TRUE 2014-09-10 11 |
OlderNewer