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
""" | |
Example of accessing the notes slides of a presentation. | |
Requires python-pptx 0.5.6 or later. | |
[email protected] | |
""" | |
from pptx.util import lazyproperty, Pt | |
from pptx.parts.slide import BaseSlide, Slide, _SlideShapeTree, _SlidePlaceholders | |
from pptx.shapes.shape import BaseShape |
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
# -*- coding: utf-8 -*- | |
""" | |
given a word and visualize near words | |
original source code is https://github.com/nishio/mycorpus/blob/master/vis.py | |
""" | |
import word2vec_boostpython as w2v | |
from sklearn.decomposition import PCA | |
import matplotlib.pyplot as plt | |
import matplotlib.font_manager |
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
console.log('Loading event'); | |
var Q = require('q'); | |
var aws = require('aws-sdk'); | |
var cloudfront = new aws.CloudFront(); | |
exports.handler = function (event, context) { | |
//_log('Received event: ', event); | |
var bucket = event.Records[0].s3.bucket.name; |
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
# !/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
__author__ = 'Diego Garcia' | |
import tornado.web | |
import tornado.ioloop | |
import oauth2.tokengenerator | |
import oauth2.grant | |
import oauth2.store.redisdb | |
import oauth2.store.mongodb |
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
jibanyan_equation <- function(x,y) { | |
min(max(min(1-(x/108)^2-(y/94)^2,y),min(1-((abs(x)-119)/103)^2-((y-56)/86)^2,1-((abs(x)-15)/77)^2-((y-119)/100)^2),1-((abs(x)-42)/66)^2-(y/55)^2,min(55+y,51-abs(x),-y)),3*abs(y-100)-2*(x-75)) * | |
min(min(max(min(1-(x/106)^2-(y/92)^2,y),min(1-((abs(x)-119)/101)^2-((y-56)/84)^2,((abs(x)-99)/40)^2+((y-54)/86)^2-1,92-abs(x)),1-((abs(x)-42)/64)^2-(y/53)^2),min(((abs(x)-52)/26)^2+((y+28)/26)^2-1,((abs(x)-51)/13)^2+(y/13)^2-1,max(abs(x)-51,y))),abs(x/51+10/51*sin(abs(y/61.2)^(1.2)*pi*(7/2)))^(2/3)+abs(y/61.2)^(2/3)-1) * | |
min(1-(x/32)^2-((y+30)/32)^2,1-((abs(x)+5)/22)^2-((y-18)/22)^2) * | |
min(1-((abs(x)-18)/20)^2-((y+10)/20)^2,((abs(x)-20)/22)^2+((y+7)/20)^2-1) * | |
(1-((abs(x)-51)/11)^2-(y/11)^2) | |
} | |
x <- seq(-150, 150, length=400) | |
z <- outer(x,x, Vectorize(jibanyan_equation)) |
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
--- pit.py.org 2014-05-01 05:22:27.000000000 +0900 | |
+++ pit.py 2014-05-12 12:06:55.989623817 +0900 | |
@@ -33,7 +33,7 @@ | |
if result == c: | |
print 'No Changes' | |
if name in profile: | |
- return profile[nane] | |
+ return profile[name] | |
return | |
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 asyncio | |
import aiohttp | |
import bs4 | |
import tqdm | |
@asyncio.coroutine | |
def get(*args, **kwargs): | |
response = yield from aiohttp.request('GET', *args, **kwargs) | |
return (yield from response.read_and_close(decode=True)) |
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
var attempts = 1; | |
function createWebSocket () { | |
var connection = new WebSocket(); | |
connection.onopen = function () { | |
// reset the tries back to 1 since we have a new connection opened. | |
attempts = 1; | |
// ...Your app's logic... |
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
Sub MakeProgressBar() | |
Const r As String = "00" '色・RGB値のR | |
Const g As String = "99" '色・RGB値のG | |
Const b As String = "00" '色・RGB値のB | |
Const pbH As Long = 10 '高さ | |
Const pbBG As Single = 0.6 '背景の透過性 | |
Dim i As Long | |
Dim s As Shape |
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
# -*- coding: utf-8 -*- | |
import unicodedata | |
for unicode_id in xrange(65536): | |
char = unichr(unicode_id) | |
normalized_char = unicodedata.normalize('NFKC', char) | |
if char != normalized_char: | |
if len(normalized_char) == 1: | |
print u'[%d] %s -> [%d] %s' % (unicode_id, char, ord(normalized_char), normalized_char) | |
else: |
NewerOlder