Skip to content

Instantly share code, notes, and snippets.

View namongk's full-sized avatar

Tom namongk

View GitHub Profile
@namongk
namongk / better-nodejs-require-paths.md
Created February 27, 2019 09:57 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@namongk
namongk / inspections.txt
Created November 17, 2017 01:35 — forked from pylover/inspections.txt
PyCharm inspections
# Extracted using: $ unzip -p lib/pycharm.jar com/jetbrains/python/PyBundle.properties | grep -B1 INSP.NAME | grep '^#' | sed 's|Inspection||g' | sed -e 's|#\s\{,1\}|# noinspection |'
# noinspection PyPep8
# noinspection PyPep8Naming
# noinspection PyTypeChecker
# noinspection PyAbstractClass
# noinspection PyArgumentEqualDefault
# noinspection PyArgumentList
# noinspection PyAssignmentToLoopOrWithParameter
# noinspection PyAttributeOutsideInit
@namongk
namongk / ex.rst
Last active October 17, 2017 20:18
rST 샘플
@namongk
namongk / fabfile.py
Created September 10, 2017 18:43 — forked from fiee/fabfile.py
fabric fabfile.py for deployment of django apps on Debian servers
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
fabfile for Django
------------------
see http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/
modified for fabric 0.9/1.0 by Hraban (fiëé visuëlle)
several additions, corrections and customizations, too
@namongk
namongk / ntp.conf
Created June 6, 2017 15:33 — forked from phillipuniverse/ntp.conf
Set up NTP with Ansible, dedicating one as a timelord
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
driftfile /var/lib/ntp/ntp.drift
# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
@namongk
namongk / uninstall.sh
Created March 2, 2017 06:16
Uninstall docker toolbox
#!/bin/bash
# Uninstall Script
if [ "${USER}" != "root" ]; then
echo "$0 must be run as root!"
exit 2
fi
while true; do

최근 인공지능을 활용한 챗봇에 대한 관심이 높아지고 있습니다. 챗봇 설계에 관한 좋은 글이 있어 번역을 해보았습니다. 이 글은 IBM DeveloperWorks에 기재된 Michael Yuan의 글을 번역한 것으로 의역이 있습니다. - 김정주(haje01@gmail.com)


대화형 챗봇 설계의 과제

사용자는 챗봇이 매우 간단하고 최소한의 요구만 하기에 좋아합니다. 그것은 대화식 문자 메시지처럼 간단해질 수 있습니다. 또한, 사용자는 자신이 선호하는 메시지 앱에 계속 머물기를 선호합니다. 앱, 웹 URL, 메뉴, 버튼, 광고, 크롬 및 기타 요소를 탐색하지 않고 바로 목표를 달성하고자 합니다. 그러나 이 단순성은 큰 설계 과제도 제시합니다. 챗봇은 사용자의 말을 정확하게 이해하고 적절히 행동해야 합니다. 이것은 오늘날 최고의 자연어 AI (인공 지능)에게도 매우 어려운 과제입니다.

현재 상태의 AI에서는, 대화식 문자 메시지 또는 대화식(Conversational) UI, 즉 CUI는 (안타깝게도) 거의 항상 잘 설계된 그래픽 UI(GUI)보다 열등합니다. GUI와 비교하여 CUI는 초기 단계에 있습니다. 커뮤니티로서 우리는 여전히 CUI의 디자인 패턴과 우수 사례를 모색하고 있습니다. 이 튜토리얼에서는 챗봇이 왜 실패하고 성공할 수 있는지 설명합니다.

@namongk
namongk / migrate-redis.py
Created January 1, 2017 08:24 — forked from thomasst/migrate-redis.py
Migrate Redis data on Amazon ElastiCache
"""
Copies all keys from the source Redis host to the destination Redis host.
Useful to migrate Redis instances where commands like SLAVEOF and MIGRATE are
restricted (e.g. on Amazon ElastiCache).
The script scans through the keyspace of the given database number and uses
a pipeline of DUMP and RESTORE commands to migrate the keys.
Requires Redis 2.8.0 or higher.
from flask import Flask, request, session, g, redirect, url_for
from flask import abort, render_template, flash
app = Flask(__name__)
app.config.from_object(__name__)
hosts = {
'b': "https://code.google.com/p/android/issues/"
's': "https://android.googlesource.com/",
'r': "https://android-review.googlesource.com/",
import unittest
import functools
def check(sub, sup):
try:
if len(sub) == 1 and sup.index(sub[0]) >= 0:
return True
return check(sub[1:], sup[sup.index(sub[0]) + 1:])
except:
return False