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 Foundation | |
import SwiftUI | |
import Combine | |
struct API { | |
//private let url = URL(string: "https://hacker-news.firebaseio.com/v0/newstories.json")! | |
private let url = URL(string: "https://hacker-news.firebaseio.com/wrongendpoint")! | |
enum Error: LocalizedError, Identifiable { | |
var id: String { localizedDescription } | |
case addressUnreachable(URL) |
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
<div class="ankiCard"> | |
<div id="front-text" style="padding:15px; text-align:left;">{{Front}}</div> | |
<div id="hide" style="display:none;"> | |
<div id="choices">{{choices}}</div> | |
</div> | |
<div id="selections" style="text-align:left; margin-left:10px;"> | |
</div> | |
</div> | |
<script> |
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 networkx as nx | |
import graph_tool as gt | |
def get_prop_type(value, key=None): | |
""" | |
Performs typing and value conversion for the graph_tool PropertyMap class. | |
If a key is provided, it also ensures the key is in a format that can be |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 gdata.docs.data | |
import gdata.docs.client | |
import gdata.docs.service | |
import gdata.spreadsheet.service | |
""" | |
SpreadSheetは | |
GoogleDocsからドキュメントをローカルにエクスポートするクラス | |
アカウント情報とdocumentのid, そしてexportしたいファイルの名前が必要 |
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 java.text.Normalizer | |
import scala.collection.mutable.ArrayBuffer | |
import org.chasen.mecab.{MeCab, Tagger, Node} | |
/* | |
scalac mymecab.scala | |
scala MyMeCabTest | |
ArrayBuffer(サイト, リンクフリー, リンクフリー) |
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 java.io.{InputStreamReader, FileInputStream, BufferedReader} | |
import java.nio.charset.{Charset, CharsetDecoder, CodingErrorAction} | |
/* | |
通常 Source.fromFile("sample.txt")では | |
java.nio.charset.MalformedInputException: Input length = 1 | |
エラーが出る場合使う. | |
*/ | |
object IgnoreDecodeTest{ |
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
JAVA_BASE=/System/Library/Frameworks/JavaVM.framework/Versions/1.6 | |
JAVA_HOME=$(JAVA_BASE)/Home | |
TARGET=MeCab | |
JAVAC=$(JAVA_HOME)/bin/javac -encoding utf-8 | |
JAVA=$(JAVA_HOME)/bin/java -Dfile.encoding=utf-8 | |
JAR=$(JAVA_HOME)/bin/jar | |
CXX=g++ | |
INCLUDE=/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers | |
PACKAGE=org/chasen/mecab |
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 os | |
import time | |
from multiprocessing import Process | |
import pymongo | |
def print_tweet(collection): | |
db = pymongo.Connection().twitter | |
pid = os.getpid() |
NewerOlder