| Author: | draftcode |
|---|---|
| Date: | 2011-11-11T13:18:07+09:00 |
| ID: | 289a0136-0c1c-11e1-a06b-040ccee352e6 |
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 | |
| class Application(object): | |
| def __init__(self, lhs, rhs): | |
| self.lhs = lhs | |
| self.rhs = rhs | |
| def __repr__(self): | |
| if isinstance(self.rhs, Variable): | |
| return str(self.lhs) + str(self.rhs) |
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; | |
| typedef unsigned long long ull; | |
| ull pow(ull p, ull n) { | |
| ull w = 1; | |
| for (ull i = 1ULL << (sizeof(ull)*8-1); i != 0; i >>= 1) { | |
| if ((n & i) == 0) { | |
| w *= w; |
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 Property(object): | |
| def __init__(self): | |
| self.name = None | |
| def setup_name(self, obj, cls): | |
| for k, v in cls.__dict__.iteritems(): | |
| if v is self: | |
| self.name = k | |
| obj.__dict__[k] = None |
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 -*- | |
| from __future__ import unicode_literals | |
| import threading | |
| class Segment(object): | |
| version_count = 0 | |
| def __init__(self, parent): | |
| """ | |
| Args: |
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 public hello | |
| .super java/lang/Object | |
| .method public static main([Ljava/lang/String;)V | |
| .limit stack 2 | |
| getstatic java/lang/System/out Ljava/io/PrintStream; | |
| ldc "Hello, World" | |
| invokevirtual java/io/PrintStream/println(Ljava/lang/String;)V | |
| return | |
| .end method |
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 public A | |
| .super java/lang/Object | |
| .method static method()F | |
| fconst_1 | |
| freturn | |
| .end method | |
| .method static method()I | |
| iconst_1 |
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 <string> | |
| using namespace std; | |
| int main(void) { | |
| string s("abc\0abc"); | |
| cout << s.length() << endl; // 3 | |
| cout << distance(s.begin(), s.end()) << endl; // 3 | |
| string t("abcdabc"); |
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 <Foundation/Foundation.h> | |
| @class A; | |
| @protocol P | |
| - (A*)f; | |
| @end | |
| @interface A : NSObject <P> | |
| - (A*)f; |
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 <Foundation/Foundation.h> | |
| @interface ClassA : NSObject | |
| @end | |
| @implementation ClassA | |
| @end | |
| @interface ClassB : NSObject | |
| @end |