This file contains hidden or 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
| <?php | |
| Class FacebookTokenVerifyExample { | |
| public function verifyToken($token) { | |
| $appId = Configure::read('fb_app_id'); | |
| $appSecret = Configure::read('fb_app_secret'); | |
| FacebookSession::setDefaultApplication($appId, $appSecret); | |
| $facebookSession = FacebookSession::newAppSession(); | |
| $request = new FacebookRequest( |
This file contains hidden or 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 | |
| """ | |
| 日本郵便の郵便番号ファイルに所々ある分割されたレコードを連結する | |
| see: http://www.post.japanpost.jp/zipcode/dl/readme.html | |
| """ | |
| import csv | |
| import json | |
| zipcode = [] |
This file contains hidden or 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 csv | |
| import sys | |
| from urllib.parse import unquote | |
| from urllib.parse import unquote_plus | |
| def decode(filename): | |
| with open(filename, 'r') as f: | |
| reader = csv.reader(f, delimiter='\t') | |
| for row in reader: |
This file contains hidden or 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
| %matplotlib inline | |
| import tensorflow.examples.tutorials.mnist.input_data as input_data | |
| import numpy | |
| import matplotlib.pyplot as pyplot | |
| import matplotlib.cm as cm | |
| from PIL import Image | |
| mnist = input_data.read_data_sets('./MNIST_data', one_hot=True) |
This file contains hidden or 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
| package org.grim3lt.android.kotlinexample22 | |
| import android.os.AsyncTask | |
| import android.support.v4.app.Fragment | |
| import android.os.Bundle | |
| import android.view.LayoutInflater | |
| import android.view.View | |
| import android.view.ViewGroup | |
| import org.jetbrains.anko.* | |
| import org.jetbrains.anko.support.v4.UI |
This file contains hidden or 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 lombok.Data; | |
| import lombok.NoArgsConstructor; | |
| @Data | |
| @NoArgsConstructor | |
| public class DataModel { | |
| private int id; | |
| private String description; | |
| } |
This file contains hidden or 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
| class Application { | |
| fun doExecute(model: DataModel){ | |
| model.id = 1 | |
| model.description = "hoge" | |
| } | |
| } | |
| fun main(args: Array<String>) { | |
| val app = Application() | |
| app.doExecute(DataModel()) |
This file contains hidden or 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
| package org.grim3lt.example.Hogehoge; | |
| import lombok.Cleanup; | |
| import java.io.*; | |
| import java.util.Arrays; | |
| public class Hogehoge { | |
| public static void main(String[] args) { | |
| Hogehoge hogehoge = new Hogehoge(); |
This file contains hidden or 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
| def _header(auth_token): | |
| return { | |
| u'Content-Type': u'application/json', | |
| u'Authorization': u'Bearer %s' % auth_token | |
| } | |
| def _payload(sender, notify, color, message_format, message): | |
| return json.dumps({ | |
| u'from': sender, |
This file contains hidden or 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
| response = requests.post( | |
| u'https://api.hipchat.com/v2/room/%s/notification' % os.environ['ROOM_ID'], | |
| data=_payload( | |
| sender=os.environ['SENDER_NAME'], | |
| notify=True, | |
| color=notify_color, | |
| message_format=u'html', | |
| message=message_body), | |
| headers=_header(os.environ['AUTH_TOKEN'])) |
OlderNewer