๐
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/python3 | |
# -*-coding:utf-8-*- | |
__author__ = "Bannings" | |
def _sum(n: int) -> int: | |
dp = [[[]]] + [[] for _ in range(n)] | |
max_num = int(n**0.5) | |
for i in range(1, max_num + 1): | |
num = i * i |
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
Log file created at: 2019/01/03 11:20:25 | |
Running on machine: Aos-MacBook-Pro.local | |
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg | |
E0103 11:20:25.944139 225560000 deployment_tasks.cc:62] Error reading file information: boost::filesystem::canonical: No such file or directory: "/Users/zhangao/Library/Rime/stroke.reverse.bin" | |
E0103 11:20:25.947233 72896512 deployment_tasks.cc:488] boost::filesystem::canonical: No such file or directory: "/Users/zhangao/Library/Rime/stroke.reverse.bin" | |
E0103 11:20:25.947309 72896512 deployment_tasks.cc:488] boost::filesystem::canonical: No such file or directory: "/Users/zhangao/Library/Rime/luna_pinyin_simp.prism.bin" | |
E0103 11:20:25.947396 72896512 deployment_tasks.cc:488] boost::filesystem::canonical: No such file or directory: "/Users/zhangao/Library/Rime/luna_pinyin_tw.prism.bin" | |
E0103 11:20:25.947487 72896512 deployment_tasks.cc:488] boost::filesystem::canonical: No such file or directory: "/Users/zhangao/Library/Rime/stroke.table.bin" | |
E0103 11:20:25.9475 |
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: ZhangAo <[email protected]> | |
Content-Type: multipart/alternative; | |
boundary="Apple-Mail=_0740E365-7FA2-4005-A0DA-DE178055FB8E" | |
X-Smtp-Server: EC4D00F5-2036-4D28-B425-CB620B245D5E | |
Subject: Test Mac Mail | |
Message-Id: <[email protected]> | |
X-Universally-Unique-Identifier: 4058EBD9-61D0-4E68-82FE-CBDE9E6E3D4F | |
Date: Tue, 23 Aug 2016 15:34:52 +0800 | |
To: ZhangAo <[email protected]> | |
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) |
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
Date: Tue, 23 Aug 2016 14:54:27 +0800 | |
From: =?utf-8?Q?=E5=BC=A0=E5=A5=A5?= <[email protected]> | |
To: =?utf-8?Q?=E5=BC=A0=E5=A5=A5?= <[email protected]> | |
Message-ID: <[email protected]> | |
Subject: Test | |
X-Mailer: Shaozi iOS 1.0.5 | |
MIME-Version: 1.0 | |
Content-Type: multipart/alternative; boundary="57bbf323_327b23c6_13023" | |
--57bbf323_327b23c6_13023 |
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
// swift | |
var image = xxx | |
var rect = NSRect(x: 0, y: 0, width: image.size.width, height: image.size.height) | |
let cgImage = image.CGImageForProposedRect(&rect, context: nil, hints: nil)!.takeUnretainedValue() | |
let bitmapRep = NSBitmapImageRep(CGImage: cgImage) | |
if let imageData = bitmapRep.representationUsingType(NSBitmapImageFileType.NSPNGFileType, properties: [:]) { | |
let len = imageData.length | |
var bytes = [UInt8](count: len, repeatedValue: 0) |
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
// Objective-C | |
UIImage *image = [UIImage imageNamed:<#(NSString *)#>]; | |
NSData *imageData = UIImagePNGRepresentation(image); | |
NSInteger len = imageData.length; | |
Byte *bytes = (Byte *)[imageData bytes]; | |
NSMutableString *result = [NSMutableString stringWithCapacity:len * 5]; | |
[result appendString:@"{"]; | |
for (NSUInteger i = 0; i < len; i++) { | |
if (i) { | |
[result appendString:@","]; |