ChangeLog を書く際によく使われる英語をまとめました。
ほとんど引用です。
| int get_zero(); | |
| int get_one() { | |
| return get_zero() + 1; | |
| } |
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'rmagick' | |
| include Math | |
| class KDTreeNode | |
| attr_accessor :data, :left_child, :right_child |
| # | |
| # Uncrustify Configuration File | |
| # File Created With UncrustifyX 0.2 (140) | |
| # | |
| # Alignment | |
| # --------- | |
| ## Alignment |
| ;; This function is quoted from this page. Thanks to Tomohiro Matsuyama. | |
| ;; http://dev.ariel-networks.com/Members/matsuyama/pretty-lambda-in-emacs/ | |
| (defun set-pretty-patterns (patterns) | |
| (loop for (glyph . pairs) in patterns do | |
| (loop for (regexp . major-modes) in pairs do | |
| (loop for major-mode in major-modes do | |
| (let ((major-mode (intern (concat (symbol-name major-mode) "-mode"))) | |
| (n (if (string-match "\\\\([^?]" regexp) 1 0))) | |
| (font-lock-add-keywords major-mode | |
| `((,regexp (0 (prog1 () |
| Here is what you need to do to register your app for a custom URL scheme (for the example we will use a "myapp" scheme). | |
| 1) In your Info.plist, add a new entry for CFBundleURLTypes: <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLName</key> <string>MyApp's URL</string> <key>CFBundleURLSchemes</key> <array> <string>myapp</string> </array> </dict> </array> | |
| 2) Somewhere in your application's startup code (e.g. init), add this code: - (void)registerMyApp { [[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(getUrl:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL]; } | |
| - (void)getUrl:(NSAppleEventDescriptor )event withReplyEvent:(NSAppleEventDescriptor )replyEvent { NSString url = [[event paramDescriptorForKeyword:keyDirectObject] stringValue]; // Now you can parse the URL and perform whatever action is needed } | |
| Related Tidbits: |
| NSMutableArray *dataSource; | |
| NSMutableIndexSet *selectedIndexSet; | |
| /* | |
| dataSource,selectedIndexSetに突っ込む処理 | |
| */ | |
| // dataSourceからselectedIndexSetにマッチするものだけを取り出す。 | |
| NSMutableArray *resultArray = [NSMutableArray array]; | |
| [self.selectedIndexSet enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) { | |
| [resultArray addObject:[self.dataSource objectAtIndex:idx]]; | |
| }]; |
| #ifndef MAP_HPP | |
| #define MAP_HPP | |
| //#include <cstdint> | |
| #include <stdint.h> | |
| #include <cstddef> | |
| #include <map> | |
| #include <functional> | |
| #include <boost/functional/hash.hpp> | |
| #include <memory> | |
| #include <utility> |
| - (CGImageRef)createMaskFromAlphaChannel:(UIImage *)image | |
| { | |
| size_t width = image.size.width; | |
| size_t height = image.size.height; | |
| NSMutableData *data = [NSMutableData dataWithLength:width*height]; | |
| CGContextRef context = CGBitmapContextCreate( | |
| [data mutableBytes], width, height, 8, width, NULL, kCGImageAlphaOnly); |