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
| >>> from django.utils import translation | |
| >>> ja = translation._trans.translation('ja') | |
| >>> print ja.ugettext('Yes') | |
| はい |
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
| from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey | |
| from sqlalchemy.orm import sessionmaker | |
| Session = sessionmaker() | |
| session = Session() | |
| metadata = MetaData() | |
| table1 = Table('table1', metadata, | |
| Column('id', Integer, primary_key=True), | |
| Column('name', String), |
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
| C:\Users\tokibito>tracert cloud-images.ubuntu.com | |
| cloud-images.ubuntu.com [91.189.88.141] へのルートをトレースしています | |
| 経由するホップ数は最大 30 です: | |
| 1 <1 ms <1 ms <1 ms 192.168.100.1 | |
| 2 2 ms 3 ms 2 ms nas82b.p-tokyo.nttpc.ne.jp [210.153.249.79] | |
| 3 2 ms 2 ms 2 ms 210.153.249.121 | |
| 4 3 ms 3 ms 3 ms 210.153.249.161 | |
| 5 3 ms 2 ms 2 ms 210.165.252.245 |
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
| unit Unit1; | |
| interface | |
| uses | |
| System.SysUtils, System.Types, System.UITypes, System.Rtti, System.Classes, | |
| System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, | |
| FMX.StdCtrls, Macapi.CocoaTypes, Macapi.Foundation, Macapi.AppKit, | |
| Macapi.ObjectiveC, FMX.Platform.Mac; |
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
| sqlite> select k,v from test; | |
| a|10 | |
| a|20 | |
| b|5 | |
| b|15 | |
| sqlite> select k,group_concat(v) from test group by(k); | |
| a|10,20 | |
| b|5,15 |
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 MyClass(object): | |
| ... def __init__(self, x, y): | |
| ... self.x = x | |
| ... self.y = y | |
| ... self.foo = {'foo': {'bar': 'hoge'}} | |
| ... self.ref = self | |
| ... | |
| >>> obj = MyClass(10, 20) | |
| >>> vars(obj) | |
| {'y': 20, 'x': 10, 'foo': {'foo': {'bar': 'hoge'}}, 'ref': <__main__.MyClass object at 0x025E46D0>} |
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
| DATA = [ | |
| {'number': 2, 'name': 'b'}, | |
| {'number': 1, 'name': 'a'}, | |
| {'number': 4, 'name': 'd'}, | |
| ] | |
| def make_table(lst, key_func=lambda v: v): | |
| table = {} | |
| for value in lst: |
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
| DATA = [ | |
| {'number': 2, 'name': 'b'}, | |
| {'number': 1, 'name': 'a'}, | |
| {'number': 4, 'name': 'd'}, | |
| ] | |
| class Picker(object): | |
| def __init__(self, lst, key_func=lambda v: v): | |
| self.lst = lst |
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 json | |
| DATA = """ | |
| { | |
| "attr1": "foo", | |
| "attr2": "bar", | |
| "_class": "Foo", | |
| "attr3": { | |
| "attr3_1": "spam", |
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
| "set guifont=MS_ゴシック:h10 | |
| set guifont=VL_ゴシック:h10 | |
| set lines=40 | |
| set columns=140 | |
| set guioptions-=T | |
| set guioptions-=m |