Instance | Branch |
---|
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
<?xml version="1.0" encoding="utf-8"?> | |
<feed xmlns="http://www.w3.org/2005/Atom"> | |
<title>{{ SITENAME }}</title> | |
<link rel="alternate" type="text/html" href="{{ FEED_DOMAIN }}" /> | |
<link rel="self" type="application/atom+xml" href="{{ FEED_DOMAIN }}/feeds/atom.xml" /> | |
<id>{{ FEED_DOMAIN }}/</id> | |
{% if articles %} | |
{% for article in articles %} | |
{% if loop.first %} | |
<updated>{{ article.date_utc.strftime('%Y-%m-%dT%H:%I:%SZ') }}</updated> |
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
import re | |
nickname = raw_input('Please input your nickname > ') | |
if not re.search(u'^[\u4e00-\u9fa5a-zA-Z0-9]+$', unicode(nickname,'utf8')): | |
print 'Your nickname format is error, please try again !' | |
else: | |
print 'Hello %s'% nickname | |
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
from datetime import datetime, timedelta | |
import networkx as nx | |
from airflow import DAG | |
from airflow.operators import BashOperator, SubDagOperator | |
start_date = datetime(year=2017, month=6, day=13, hour=19, minute=0) | |
schedule_interval = '0 * * * 1-5' | |
default_args = { |
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
import datetime | |
import logging | |
import sys | |
from mongoengine import connect | |
from mongoengine import DateTimeField, Document, EmbeddedDocument, EmbeddedDocumentField, IntField, ListField, StringField | |
from pymongo.errors import OperationFailure | |
# Solution comes from following this: | |
# https://stackoverflow.com/questions/28982285/mongodb-projection-of-nested-arrays |
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
import numpy as np | |
import matplotlib.pyplot as plt | |
import scipy.stats as scs | |
def z_val(sig_level=0.05, two_tailed=True): | |
"""Returns the z value for a given significance level""" | |
z_dist = scs.norm() | |
if two_tailed: | |
sig_level = sig_level/2 | |
area = 1 - sig_level |
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
[remote "origin"] | |
url = [email protected]:Ardagan/beam.git | |
fetch = +refs/heads/*:refs/remotes/origin/* | |
[remote "upstream"] | |
url = [email protected]:apache/beam.git | |
fetch = +refs/heads/master:refs/remotes/upstream/master | |
fetch = +refs/pull/*/head:refs/remotes/upstream/pr/* | |
fetch = +refs/pull/*/merge:refs/remotes/upstream/pull/* | |
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
https://medium.freecodecamp.org/send-emails-using-code-4fcea9df63f | |
# import the smtplib module. It should be included in Python by default | |
import smtplib | |
# set up the SMTP server | |
s = smtplib.SMTP(host='smtp-mail.outlook.com', port=587) | |
s.starttls() | |
s.login('[email protected]', 'password') | |
=== | |
import smtplib |
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
const express = require('express'); | |
const fetch = require('node-fetch'); | |
const redis = require('redis'); | |
const PORT = process.env.PORT || 5000; | |
const REDIS_PORT = process.env.PORT || 6379; | |
const client = redis.createClient(REDIS_PORT); | |
const app = express(); |
OlderNewer