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 Base; | |
| class Sub; | |
| shared_ptr<Base> create(Kind k) { | |
| switch (k) { | |
| case kHoge: | |
| return shared_ptr<Base>(new Sub()); | |
| } | |
| return shared_ptr<Base>(); | |
| } | 
  
    
      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
    
  
  
    
  | int main() { | |
| char b = -1; | |
| cout << static_cast<int>(b) << endl; | |
| cout << static_cast<uint32_t>(b) << endl; | |
| cout << static_cast<uint32_t>(static_cast<unsigned char>(b)) << endl; | |
| } | 
  
    
      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
    
  
  
    
  | uint32_t Read32(const char* data) { | |
| return static_cast<unsigned char>(data[0]) | |
| | (static_cast<unsigned char>(data[1]) << 8u) | |
| | (static_cast<unsigned char>(data[2]) << 16u) | |
| | (static_cast<unsigned char>(data[3]) << 24u); | |
| } | 
  
    
      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
    
  
  
    
  | #include <iostream> | |
| #include <sys/types.h> | |
| #include <sys/socket.h> | |
| #include <netinet/in.h> | |
| #include <arpa/inet.h> | |
| #include <netdb.h> | |
| #include <unistd.h> | |
| using namespace std; | 
  
    
      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
    
  
  
    
  | #include <iostream> | |
| #include <utility> | |
| #include <string> | |
| using namespace std; | |
| // {{{ | |
| struct ListTerminator | |
| { | |
| }; | |
| const ListTerminator NIL {}; | 
  
    
      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
    
  
  
    
  | #include <iostream> | |
| using namespace std; | |
| // {{{ | |
| constexpr int get_hash(int hash, const char* p) | |
| { | |
| return *p == '\0' ? hash : get_hash(*p * 137, p + 1); | |
| } | |
| template <typename T, int N> | 
  
    
      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
    
  
  
    
  | template <typename T, typename U, typename ... ApiArgs, typename ... Args> | |
| T ExitOnWrongValue0(const U& expected, const char* api_name, T (api_exp)(ApiArgs...), Args... args) | |
| { | |
| T x = api_exp(args...); | |
| if (x != expected) | |
| { | |
| std::cout << api_name << " Error: " << std::endl; | |
| exit(1); | |
| } | |
| return 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
    
  
  
    
  | OUTPUT_FORMAT("binary") | |
| ENTRY(KernelMain) | |
| HEAP_SIZE = 0; | |
| MMAREA_SIZE = 0; | |
| __ctors = ADDR(.ctors); | |
| __ctors_count = SIZEOF(.ctors) / 4; | |
| SECTIONS | 
  
    
      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 time | |
| def separate_variations2(lst): | |
| n = len(lst) | |
| assert n >= 2 | |
| for bitpattern in xrange(1, 2 ** (n - 1)): | |
| x = list() | 
  
    
      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
    
  
  
    
  | url = 'http://toi.kuronekoyamato.co.jp/cgi-bin/tneko' | |
| data = { | |
| 'number00' : '1', | |
| 'number01' : '000000000000' | |
| } | |
| data_e = urllib.parse.urlencode(data) | |
| req = urllib.request.Request(url, data_e.encode('sjis')) | |
| res = urllib.request.urlopen(req) | |
| soup = BeautifulSoup(res.read()) |