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 | |
# 反转一个单链表。示例: | |
# 输入: 1 --> 2 --> 3 --> 4 --> 5 --> None | |
# 输出: 5 --> 4 --> 3 --> 2 --> 1 --> None | |
from typing import Any, List, Optional | |
ListNode = Optional["Node"] |
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
def isAuthenticated(User u) { | |
try { | |
return u.impersonate().isAuthenticated() | |
} | |
// Users pulled from SCM history e.a. are not GUI users | |
catch (org.acegisecurity.userdetails.UsernameNotFoundException xc) { | |
return false | |
} | |
} |