Skip to content

Instantly share code, notes, and snippets.

SELECT phrase_descriptor_id ,related_word
FROM Context2_words_related_to_categories
INNER JOIN Phrase_descriptors
ON Phrase_descriptors.phrase LIKE CONCAT('%' , Context2_words_related_to_categories.related_word)
WHERE category_id = "4bf58dd8d48988d116941735"
var perimeter : Double {
get {
return 3.0 * self.sideLength;
}
set {
self.sideLength = newValue / 4.0;
}
}
//“Rewrite the closure to return zero for all odd numbers.”
//Excerpt From: Apple Inc. “The Swift Programming Language.” iBooks. https://itun.es/pl/jEUH0.l
var numbers : UInt[] = [20, 19, 10, 13, 432, 432432, 80];
// Could this be more efficient:
let mapped : Array<UInt> = numbers.map({
(number : UInt) -> UInt in
let interestingNumbers = [
"Prime" : "different type",
"Fibbonacii": [1,1,4343],
"fortunate" : [2,4,5,7]
]; // Does it crash the playground of Xcode-6 beta
let interestingNumbers = [
"Prime" : "different type",
"Fibbonacii": [1,1,4343],
"fortunate" : [2,4,5,7]
]; // Does it crash the playground of Xcode-6 beta
2014-06-08 10:29:28.548 Twigit[610:613] Cannot find executable for CFBundle 0x10a954950 </Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/System/Library/AccessibilityBundles/CertUIFramework.axbundle> (not loaded)
2014-06-08 10:29:28.555 Twigit[610:613] Cannot find executable for CFBundle 0x10a82c410 </Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/System/Library/AccessibilityBundles/StoreKitFramework.axbundle> (not loaded)
2014-06-08 10:29:28.558 Twigit[610:613] Cannot find executable for CFBundle 0x10a9639a0 </Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/System/Library/AccessibilityBundles/GeoServices.axbundle> (not loaded)
return; // Semicolon inserted, believing the statement has finished. Returns undefined
{ // Considered to be an anonymous block, doing nothing
javascript : "fantastic"
};// Semicolon interpreted as an empty dummy line and moved down
NSString *querySQL = [NSString stringWithFormat:@"SELECT word.text_id , word.sentence_id, word.id, USERWORDS.ID , word.word, word.meaning, USERWORDS.EASINESS_FACTOR, USERWORDS.NEXT_REPETITION_DATE, USERWORDS.REPETITION_COUNT, USERWORDS.LAST_INTERVAL_IN_DAYS FROM USERWORDS INNER JOIN word ON USERWORDS.WORD_ID = word.id WHERE USERWORDS.NEXT_REPETITION_DATE < %lu", (long)[[NSDate alloc] init].timeIntervalSince1970 ];
self.dataModel = [[TwigitDataModel alloc] init];
UINavigationController *navControllerFromIB = (UINavigationController *) self.window.rootViewController;
TwigitMainMenuViewController *mainMenuController = (TwigitMainMenuViewController *) navControllerFromIB.topViewController;
mainMenuController.dataModel = self.dataModel;
NSArray *punctuationMarks = [NSArray arrayWithObjects:@".",@",",@"\"",@";",@":",@"!", @"“", @"”", @"?", @"!" , nil];
NSMutableString *mutableWordString = [wordDescriptor.wordString mutableCopy];
for(NSString *punctuationMark in punctuationMarks) {
NSUInteger offset = 0;
while (true) {
NSRange rangeOfThatPunctuationMark = [mutableWordString rangeOfString:punctuationMark options:NSCaseInsensitiveSearch range:NSMakeRange(offset, mutableWordString.length - offset)];