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 sys | |
import threading | |
def buildG(filename): | |
g, g_rev = [], [] | |
with open(filename) as f: | |
for line in f: | |
u, v = map(int, line.split()) | |
m = max(u, v) |
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 Solution: | |
def isPalindrome(self, head): | |
rhead = None | |
slow = fast = head | |
while fast and fast.next: | |
fast = fast.next.next | |
slow.next, slow, rhead = rhead, slow.next, slow | |
if fast: | |
slow = slow.next | |
while rhead and rhead.val == slow.val: |
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
keys = [ | |
'status', | |
'temperature', | |
'power_up', | |
'glist', | |
'uncorrected_read', | |
'uncorrected_write', | |
] | |
mappings = {key: deepcopy(mapping) for key in keys} |
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
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Select the second/third candidate using left/right shift key.(only in Chinese-Simplified-*)</name> | |
<identifier>private.select_candidate_using_shift_key</identifier> | |
<inputsource_only>CHINESE_SIMPLIFIED</inputsource_only> | |
<autogen>__KeyOverlaidModifier__ KeyCode::SHIFT_L, KeyCode::SHIFT_L, KeyCode::KEY_2</autogen> | |
<autogen>__KeyOverlaidModifier__ KeyCode::SHIFT_R, KeyCode::SHIFT_R, KeyCode::KEY_3</autogen> | |
</item> | |
</root> |
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
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Change Input Source to Chinese Simplified when press right option key.</name> | |
<identifier>private.change_input_source_with_right_option</identifier> | |
<autogen>--KeyToKey-- KeyCode::OPTION_R, KeyCode::VK_CHANGE_INPUTSOURCE_CHINESE_SIMPLIFIED</autogen> | |
</item> | |
</root> |
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
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Change Input Source when press right option key.</name> | |
<appendix>Option_R to Command+Space</appendix> | |
<identifier>private.change_input_source_with_right_option</identifier> | |
<autogen>--KeyToKey-- KeyCode::OPTION_R, KeyCode::SPACE, ModifierFlag::OPTION_L | ModifierFlag::COMMAND_L</autogen> | |
</item> | |
</root> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0"> | |
<channel> | |
<title>和邪社</title> | |
<atom:link href="http://www.hexieshe.com/feed/" rel="self" type="application/rss+xml"/> | |
<link>http://www.hexieshe.com</link> | |
<description>文不在长.内涵则明 图不在色.意淫则灵</description> | |
<lastBuildDate>Wed, 25 Jun 2014 09:11:21 +0000</lastBuildDate> | |
<language>zh-CN</language> | |
<sy:updatePeriod>hourly</sy:updatePeriod> |