Why Should I Care (For Developers)
"나에게 Docker의 매력은 간단히 격리된 환경을 만들 수 있다는 것과, 그러한 환경을 재사용할 수 있다는 점이다."런타임 환경을 한 번 만들어 패키지로 만들면, 이 패키지를 다른 어떤 머신에서도 다시 사용할 수 있다. 또한 여기서 실행되는 모든 것은 마치 가상머신과 같이 호스트로부터 격리되어있다. 무엇보다도 이런 모든 일들이 빠르고 간단히 가능하다.
--- networkx-1.5/networkx/drawing/nx_pylab.py 2011-06-04 09:45:38.000000000 +0900 | |
+++ nx_pylab.py 2011-10-01 01:48:06.000000000 +0900 | |
@@ -21,7 +21,8 @@ | |
# All rights reserved. | |
# BSD license. | |
-__all__ = ['draw', | |
+__all__ = ['set_fontproperties', | |
+ 'draw', | |
'draw_networkx', |
<h1>Page 1</h1> | |
<a href="/myview/?page={{previous_page_number}}">Previous page</a> | |
<a href="/myview/?page={{next_page_number}}">Next page</a> | |
{% for object in results %} | |
{{object}} {#whatever you're displaying #} | |
{% endfor %} |
Why Should I Care (For Developers)
"나에게 Docker의 매력은 간단히 격리된 환경을 만들 수 있다는 것과, 그러한 환경을 재사용할 수 있다는 점이다."런타임 환경을 한 번 만들어 패키지로 만들면, 이 패키지를 다른 어떤 머신에서도 다시 사용할 수 있다. 또한 여기서 실행되는 모든 것은 마치 가상머신과 같이 호스트로부터 격리되어있다. 무엇보다도 이런 모든 일들이 빠르고 간단히 가능하다.
from cloudsearch import connect_cloudsearch, get_document_service | |
endpoint = 'paste your doc service endpoint here' | |
service = get_document_service(endpoint=endpoint) # Get a new instance of cloudsearch.DocumentServiceConnection | |
# Presumably get some users from your db of choice. | |
users = [ | |
{ | |
'id': 1, |
var xLBD = {}; | |
xLBD.c = function (){ | |
xLBD.f = unescape(document.querySelector("[flashvars]").getAttribute("flashvars")).substring(7); | |
xLBD.f = JSON.parse(xLBD.f.substring(0, xLBD.f.lastIndexOf("}") + 1)).video_data[0].hd_src; | |
xLBD.a = "<div style='position:absolute;top:100px;height:300px;left:15%;background:#fff;border:10px solid #000;font-size:5em;padding:100px;'>Click <a download='lookback.mp4' href='"+xLBD.f+"'>here<\/a> to download your lookBack video.</div>"; | |
document.body.innerHTML += xLBD.a; | |
} | |
if(document.readyState == "complete") | |
xLBD.c(); | |
else window.onload = xLBD.c; |
When going to /search/artist/<query_string> using the documents below you get: | |
/search/artist/m - this returns both Macklemore and Against Me! | |
/search/artist/a - this returns both Against Me! and AWOLNATION | |
/search/artist/ma - this returns only Macklemore | |
/search/artist/aw - this returns only AWOLNATION | |
/search/artist/me - this returns only Against Me! | |
Adding 'AWOLNATION' to models.Artist produces: |
import nltk | |
text = """The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital | |
computer or the gears of a cycle transmission as he does at the top of a mountain | |
or in the petals of a flower. To think otherwise is to demean the Buddha...which is | |
to demean oneself.""" | |
# Used when tokenizing words | |
sentence_re = r'''(?x) # set flag to allow verbose regexps | |
([A-Z])(\.[A-Z])+\.? # abbreviations, e.g. U.S.A. |
# coding=UTF-8 | |
from __future__ import division | |
import re | |
# This is a naive text summarization algorithm | |
# Created by Shlomi Babluki | |
# April, 2013 | |
class SummaryTool(object): |
kubernetes(이하 k8) 는 무겁고 느리다. docker-swarm(이하 DS) 은 docker 최신버전에 기본으로 탑재되어 나온다. 또한 helm
이나 별도의 관리 cli(kubeadm, kubectl)
를 설치할 필요가 없다.
k8 은 세팅도 어렵다: 세팅하기가 워낙 까다로워 실제로 운영하기 적절한 경우는 devops 팀을 가진 최소 20명 이상의 대규모 사이즈 팀이다. 한 명이 작업하는 것이 아주 불가능한 것은 아니지만, 긴급수정시에는 많이 위험해질 수 있다. 총원이 10명이 되지 않는 우리팀 같은 경우는 한 사람이 급하게 기능수정을 해야될 일이 많다.
#!/usr/bin/env python | |
import os | |
import time | |
import json | |
import base64 | |
import requests | |
import argparse | |
from base64 import urlsafe_b64decode, b64decode | |
from Crypto.Hash import SHA256, SHA512 |