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
@class LFReachability; | |
typedef enum { | |
LFReachabilityNetworkNone = 0, | |
LFReachabilityNetworkWifi = 1, | |
LFReachabilityNetworkWWAN = 2 | |
} LFReachabilityNetworkType; | |
@protocol LFReachabilityDelegate <NSObject> |
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
# 快快樂樂用 PyObjC 建立 DO | |
import objc | |
from Cocoa import * | |
self.service = NSConnection.rootProxyForConnectionWithRegisteredName_host_("SERVICE_NAME", None) | |
protocol = objc.protocolNamed("PROTOCOL") | |
elf.service.setProtocolForProxy_(protocol) |
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
NSArray *a = [[NSFontManager sharedFontManager] availableFonts]; | |
NSMutableArray *tradChineseFontNames = [NSMutableArray array]; | |
NSStringEncoding tradChinese = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingMacChineseTrad); | |
for (NSString *name in a) { | |
NSFont *font = [NSFont fontWithName:name size:12.0]; | |
NSStringEncoding e = [font mostCompatibleStringEncoding]; | |
if (e == tradChinese) { | |
// CFStringRef s = CFStringGetNameOfEncoding(CFStringConvertNSStringEncodingToEncoding(e)); | |
// NSLog(@"name:%@ display name:%@ encoding: %@", name, [font displayName], (NSString *)s); | |
[tradChineseFontNames addObject:name]; |
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
- (NSMethodSignature*)methodSignatureForSelector:(SEL)aSelector | |
{ | |
const char *selname = sel_getName(aSelector); | |
NSLog(@"trying to call %s", selname); | |
return [super methodSignatureForSelector:aSelector]; | |
} | |
- (BOOL)respondsToSelector:(SEL)aSelector | |
{ | |
NSLog(@"trying to determine %s", sel_getName(aSelector)); |
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
aw goulou lommi matebkish, yal menfi | |
告訴我母親別哭,喔!逃亡 | |
waldek rabbi maykhalihsh, yal menfi | |
真主不會拋棄妳的孩子,喔!逃亡 | |
aw goulou lommi matebkish, yal menfi | |
告訴我母親別哭,喔!逃亡 | |
waldek rabbi maykhalihsh, yal menfi | |
真主不會拋棄妳的孩子,喔!逃亡 | |
aw ya dakhal fi set biban, yal menfi |
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
قولو لأمي ما تبكيش... يا منفى | |
aw goulou lommi matebkish, yal menfi | |
告訴我母親別哭,喔!逃亡 | |
ولدك ربي ما يخليش... يا منفى | |
waldek rabbi maykhalihsh, yal menfi | |
真主不會拋棄妳的孩子,喔!逃亡 | |
قولو لأمي ما تبكيش... يا منفى | |
aw goulou lommi matebkish, yal menfi | |
告訴我母親別哭,喔!逃亡 | |
ولدك ربي ما يخليش... يا منفى |
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
// 每次都忘記要這樣開頭… | |
UIGraphicsBeginImageContext(CGSizeMake(320.0, 320.0)); | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
defaultCoverImage = [UIGraphicsGetImageFromCurrentImageContext() retain]; | |
UIGraphicsEndImageContext(); |
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
// PTYTextView 27858 | |
if([self hasMarkedText]) { | |
int len=[markedText length]; | |
if (len>WIDTH-x1) len=WIDTH-x1; | |
NSRect inputFrame = NSMakeRect(floor(x1 * charWidth + MARGIN), (yStart + [dataSource numberOfLines] - HEIGHT) * lineHeight + (lineHeight - cursorHeight), ceil((WIDTH-x1)*cursorWidth),cursorHeight); | |
[markedText drawInRect:inputFrame]; | |
NSAttributedString *attributedStringBeforeCursor = [markedText attributedSubstringFromRange:NSMakeRange(0, IM_INPUT_SELRANGE.location) ]; | |
NSRect spaceFrame = [attributedStringBeforeCursor boundingRectWithSize:inputFrame.size options:0]; | |
NSRect cursorFrame = NSMakeRect(inputFrame.origin.x + spaceFrame.size.width, inputFrame.origin.y, 2.0, inputFrame.size.height); |
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
NSStringEncoding big5 = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingBig5_HKSCS_1999); | |
NSString *string = [[NSString alloc] initWithData:data encoding:big5]; | |
NSData *UTF8Data = [string dataUsingEncoding:NSUTF8StringEncoding]; | |
[string release]; |
OlderNewer