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
| func argmin(_ xs: [Double]) -> Int { | |
| var argmin = 0 | |
| var min = xs[0] | |
| for (i, x) in xs[1..<xs.count].enumerated() { | |
| if (min > x) { | |
| argmin = i + 1 | |
| min = x | |
| } | |
| } |
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
| LDFLAGS=-lobjc -fobjc-arc -framework Foundation | |
| CFLAGS=-O0 -g | |
| all: test_objc_ivar_accessor | |
| clang -O0 $(LDFLAGS) -S -o test_objc_ivar_accessor.s test_objc_ivar_accessor.m | |
| clean: | |
| rm -rf *.s *.o test_objc_ivar_accessor *.dSYN | |
| .o: .m |
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
| #!/usr/bin/env python | |
| from __future__ import print_function | |
| import httplib2 | |
| import os | |
| from apiclient import discovery | |
| from oauth2client import client | |
| from oauth2client import tools | |
| from oauth2client.file import Storage |
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 | |
| import twitter | |
| import argparse | |
| class TwitterCrawler: | |
| def __init__(self): | |
| self.api = twitter.Api( | |
| # credential and token | |
| "", | |
| "", |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import sys | |
| import subprocess | |
| reload(sys) | |
| sys.setdefaultencoding("utf-16") | |
| HAS_COLORAMA = 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
| .encoding = "UTF-8" | |
| config.version = "8" | |
| virtualHW.version = "10" | |
| memsize = "1024" | |
| ethernet0.present = "TRUE" | |
| ethernet0.connectionType = "nat" | |
| ethernet0.virtualDev = "e1000" | |
| ethernet0.wakeOnPcktRcv = "FALSE" | |
| ethernet0.addressType = "generated" | |
| ethernet0.linkStatePropagation.enable = "FALSE" |
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
| .encoding = "UTF-8" | |
| config.version = "8" | |
| virtualHW.version = "10" | |
| scsi0.present = "TRUE" | |
| scsi0.virtualDev = "pvscsi" | |
| memsize = "2048" | |
| ethernet0.present = "TRUE" | |
| ethernet0.connectionType = "nat" | |
| ethernet0.virtualDev = "vmxnet3" | |
| ethernet0.addressType = "generated" |
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
| #!/usr/bin/vmware | |
| .encoding = "UTF-8" | |
| config.version = "8" | |
| virtualHW.version = "10" | |
| scsi0.present = "TRUE" | |
| scsi0.virtualDev = "pvscsi" | |
| memsize = "1024" | |
| ethernet0.present = "TRUE" | |
| ethernet0.connectionType = "nat" | |
| ethernet0.virtualDev = "vmxnet3" |
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 list_recursively(id, dir="", maxResults=100): | |
| children = [] | |
| query_result = drive_service.files().list( | |
| q='"%s" in parents' % id, | |
| maxResults=maxResults | |
| ).execute() | |
| while True: | |
| children += query_result['items'] | |
| if not 'nextPageToken' in query_result: | |
| break |
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
| remote: Counting objects: 1, done. | |
| remote: Total 1 (delta 0), reused 1 (delta 0) | |
| Unpacking objects: 100% (1/1), done. | |
| fatal: final sha1 did not match | |
| fatal: unpack-objects failed |