Nan-Wei Gong

18 papers A* 6A 1C 1Misc 1Journal 2Unranked 7
YearRankTypeTitle / Venue / Authors
2016 A* conf
CHI
Laura Devendorf, Joanne Lo, Noura Howell, Doris Jung Lin Lee, Nan-Wei Gong, Mustafa Emre Karagozler, Shiho Fukuhara, Ivan Poupyrev, Eric Paulos, Kimiko Ryokai
2016 A conf
Conference on Designing Interactive Systems
Noura Howell, Laura Devendorf, Rundong Kevin Tian, Tomás Vega Galvez, Nan-Wei Gong, Ivan Poupyrev, Eric Paulos, Kimiko Ryokai
2016 A* conf
CHI
Ivan Poupyrev, Nan-Wei Gong, Shiho Fukuhara, Mustafa Emre Karagozler, Carsten Schwesig, Karen E. Robinson
2015 conf
CHI Extended Abstracts
Amit Zoran, Nan-Wei Gong, Roy Shilkrot, Shuo Yan, Pattie Maes
2015 conf
CHI Extended Abstracts
Amit Zoran, Nan-Wei Gong, Roy Shilkrot, Shuo Yan, Pattie Maes
2014 J jnl
IEEE Pervasive Comput.
Yoshihiro Kawahara, Steve Hodges, Nan-Wei Gong, Simon Olberding, Jürgen Steimle
2014 A* conf
CHI
Nan-Wei Gong, Jürgen Steimle, Simon Olberding, Steve Hodges, Nicholas Edward Gillian, Yoshihiro Kawahara, Joseph A. Paradiso
2013 A* conf
UIST
Simon Olberding, Nan-Wei Gong, John Tiab, Joseph A. Paradiso, Jürgen Steimle
2013 conf
CHI Extended Abstracts
Nan-Wei Gong, Nan Zhao, Joseph A. Paradiso
2013 conf
UIST (Adjunct Volume)
Nan-Wei Gong, Amit Zoran, Joseph A. Paradiso
2013 A* conf
UIST
Andrea Colaço, Ahmed Kirmani, Hye Soo Yang, Nan-Wei Gong, Chris Schmandt, Vivek K. Goyal
2012 conf
NIME
Nan-Wei Gong, Nan Zhao, Joseph A. Paradiso
2011 Misc conf
UbiComp
Nan-Wei Gong, Steve Hodges, Joseph A. Paradiso
2010 conf
AmI
Nan-Wei Gong, Mathew Laibowitz, Joseph A. Paradiso
2010 A* conf
ACM Multimedia
Mathew Laibowitz, Nan-Wei Gong, Joseph A. Paradiso
2009 J jnl
IEEE Pervasive Comput.
Joshua Lifton, Mathew Laibowitz, Drew Harry, Nan-Wei Gong, Manas Mittal, Joseph A. Paradiso
2009 conf
NIME
Nan-Wei Gong, Mathew Laibowitz, Joseph A. Paradiso
2009 C conf
BSN
Mathew Laibowitz, Nan-Wei Gong, Joseph A. Paradiso
redb/utils/push_to_elastic.py
← Index redb/utils/push_to_elastic.py python
import json
import os
#from redb.settings import elasticsearch as es
from elasticsearch import Elasticsearch
from dataclasses import asdict
from dotenv import load_dotenv

class Utils():
    """
    Utility class for pushing

    """
    @staticmethod
    def push_to_elastic(sample_dict):
        """
        Pushes the sample_dict to elastic search
        """
        load_dotenv()
        ELASTIC_ENDPOINT = os.getenv("ELASTIC_HOST")
        ELASTIC_ENFORCE_SSL = os.getenv("ELASTIC_ENFORCE_SSL", False) == "True"
        ELASTIC_USER = os.getenv("ELASTIC_USER")
        ELASTIC_PASSWORD = os.getenv("ELASTIC_PASSWORD")
        ELASTIC_BINARIES_COLLECTION = os.getenv(
            "ELASTIC_BINARIES_COLLECTION", "redb_test"
        )
        es = Elasticsearch(
            ELASTIC_ENDPOINT,
            verify_certs=ELASTIC_ENFORCE_SSL,
            basic_auth=(ELASTIC_USER, ELASTIC_PASSWORD),
            maxsize=20,
            retry_on_timeout=True,
            timeout=30,
        )

        try:
            dict_dump = json.dumps(sample_dict)
        except Exception as e:
            print(f"Error: {e}")
            return False
        elastic = es.index(index=ELASTIC_BINARIES_COLLECTION, body=dict_dump)
        return True
    
    def push_to_index(sample_dict, index_name):
        """
        Pushes the sample_dict to elastic search
        """
        load_dotenv()
        ELASTIC_ENDPOINT = os.getenv("ELASTIC_HOST")
        ELASTIC_ENFORCE_SSL = os.getenv("ELASTIC_ENFORCE_SSL", False) == "True"
        ELASTIC_USER = os.getenv("ELASTIC_USER")
        ELASTIC_PASSWORD = os.getenv("ELASTIC_PASSWORD")
        ELASTIC_BINARIES_COLLECTION = index_name
        
        es = Elasticsearch(
            ELASTIC_ENDPOINT,
            verify_certs=ELASTIC_ENFORCE_SSL,
            basic_auth=(ELASTIC_USER, ELASTIC_PASSWORD),
            maxsize=20,
            retry_on_timeout=True,
            timeout=30,
        )

        try:
            dict_dump = json.dumps(sample_dict)
        except Exception as e:
            print(f"Error: {e}")
            return False
        elastic = es.index(index=ELASTIC_BINARIES_COLLECTION, body=dict_dump)
        return True