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
using System; | |
using NUnit.Framework; | |
namespace RomanTest | |
{ | |
public class RomanArabic | |
{ | |
public RomanArabic() { } | |
[TestCase("M", 1000)] |
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
#import <Foundation/Foundation.h> | |
@interface Utlity : NSObject | |
+ (NSString *)formatDaySuffixForDate:(NSDate *)date; | |
+ (NSString *)formatDayWithSuffixForDate:(NSDate *)date withWeekday:(BOOL)showWeekday; | |
@end | |
@implementation Utlity |
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
# Change the ownership and permissions of "//usr//local" back to your user account! | |
sudo chown -R $(whoami):admin /usr/local |
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 BezierCurveMove(screenSize: CGSize, node: SKSpriteNode) { | |
let size = node.size | |
var cgpath = CGPathCreateMutable() | |
//random values | |
let xStart = Utility.randInRange(Int(size.width)...Int(screenSize.width-size.width)) | |
let xEnd = Utility.randInRange(Int(size.width)...Int(screenSize.width-size.width)) | |
//ControlPoint1 | |
let cp1X = Utility.randInRange(Int(size.width)...Int(screenSize.width-size.width)) |
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 *string = @"中华人民共和国万岁 万岁 万万岁"; | |
NSCountedSet *countedSet = [NSCountedSet new]; | |
[string enumerateSubstringsInRange:NSMakeRange(0, [string length]) | |
options:NSStringEnumerationByComposedCharacterSequences | NSStringEnumerationLocalized | |
usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop){ | |
_sumText++; | |
[countedSet addObject:substring]; | |
}]; |
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
+ (instancetype)sharedInstance | |
{ | |
static MyClass *sharedInstance = nil; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
sharedInstance = [[MyClass alloc] init]; | |
}); | |
return sharedInstance; | |
} |
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*)timeString | |
{ | |
NSDateFormatter *formatter; | |
NSString *dateString; | |
formatter = [[[NSDateFormatter alloc] init] autorelease]; | |
[formatter setDateFormat:@"dd-MM-yyyy HH:mm:ss"]; | |
dateString = [formatter stringFromDate:[NSDate date]]; | |
return dateString; |
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
#import <Foundation/Foundation.h> | |
int main(int argc, const char * argv[]) | |
{ | |
@autoreleasepool { | |
// insert code here... | |
NSLog(@"Hello, World!"); | |
NewerOlder