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
// BridgeHeader.h | |
#import <unicode/uchar.h> | |
// UnicodeBlock.swift | |
import Foundation | |
class UnicodeBlock { | |
class var blocks: UnicodeBlock[] { |
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
enum ShiftKeyType { | |
case None | |
case Once | |
case Always | |
} | |
enum PunctuationSwitcherType { | |
case More | |
case Numeric | |
} |
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
func bytes<T: IntegerType>(i: T) -> [UInt8] { | |
let p = UnsafeMutablePointer<T>.alloc(1) | |
p.memory = i | |
let b = unsafeBitCast(p, UnsafePointer<UInt8>.self) | |
let bytes = reduce(0..<sizeof(T), []) { $0 + [b[$1]] } | |
p.destroy() | |
return bytes | |
} |
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
- (NSString *)convertISBN10To13:(NSString *)isbn10 | |
{ | |
NSString *prefix = [NSString stringWithFormat:@"978%@", [isbn10 substringToIndex:9]]; | |
NSInteger sum = 0; | |
for (int i=0; i<12; i++){ | |
char c = [prefix characterAtIndex:i]; | |
int n = c - '0'; | |
int w = (i % 2) ? 3 : 1; | |
sum += w * n; | |
} |
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
iOS 4.2 devices can print wirelessly only to printers that support AirPrint and are running the latest available firmware. Some currently available printers that support AirPrint are: | |
- HP Photosmart Premium Fax e-All-in-One Printer - C410 | |
- HP Photosmart Premium e-All-in-One Printer series - C310 | |
- HP Photosmart Plus e-All-in-One Printer series - B210 | |
- HP ENVY 100 e-All-in-One Printer Series - D410 | |
- HP Photosmart eStation Printer series - C510 |
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
=NEW FEATURES= | |
- Ready for multitasking and Retina Display | |
- Print page (iOS 4.2 required) | |
- Image Gallery for current page | |
- Share text, image or URL to Delicious, Facebook, Google Reader, Instapaper, Pinboard, Read It Later, Tumblr and/or Twitter | |
- Add code snippet font size adjustment in Reading Options | |
=ENHANCEMENTS= | |
- New image viewer, similar to Photo.app's flavor | |
- Improved 'Find in Page', similar to desktop browser |
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
#define CHAR_MAX 32 | |
NSString* toChineseNumer(NSUInteger num){ | |
static NSString *cnums = @"〇一二三四五六七八九"; | |
unichar ch[32]; | |
int i = 0; | |
do ch[i++] = [cnums characterAtIndex:num%10]; | |
while ((num /= 10) > 0); |
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
#define DEFAULTS(type, key) ([[NSUserDefaults standardUserDefaults] type##ForKey:key]) | |
#define SET_DEFAULTS(Type, key, val) do {\ | |
[[NSUserDefaults standardUserDefaults] set##Type:val forKey:key];\ | |
[[NSUserDefaults standardUserDefaults] synchronize];\ | |
} while (0) |
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
typedef struct FontHeader { | |
int32_t fVersion; | |
uint16_t fNumTables; | |
uint16_t fSearchRange; | |
uint16_t fEntrySelector; | |
uint16_t fRangeShift; | |
}FontHeader; | |
typedef struct TableEntry { | |
uint32_t fTag; |
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
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user |
OlderNewer