Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp2
{
class Program
{
http://carlosbecker.com/java-best-practices/#/basics/other-language-basics
NSArray * bruteForceProduct(NSArray *array) {
NSMutableArray *outputArray = [NSMutableArray arrayWithCapacity:[array count]];
for (NSInteger i = 0 ; i < [array count]; i++) {
NSInteger currentNumber = 1;
for (NSInteger j = 0 ; j < [array count] ; j++) {
if ( i != j ) {
currentNumber *= [array[j] integerValue];
}
@chrisswong
chrisswong / scrollView
Created July 6, 2015 06:49
WWDC scrollView sessions
2009 - Mastering iPhone Scroll Views
UIScrollView Basics
2010 - Designing Apps with Scroll Views
Photo browsing
Tiling
2011 - Advanced Scroll View Techniques
Infinite scrolling
Stationary header views
@chrisswong
chrisswong / fizzBuzzObjcRecursionIncremental.m
Created February 28, 2015 07:40
Fizz Buzz Test with Objective-c with incremental number recursion
printFizzBuzzWithEndNumber(100);
void printFizzBuzzWithEndNumber(int endNumber) {
if (endNumber > 1)
{
printFizzBuzzWithEndNumber(endNumber-1);
}
// reminder > 0 = true reminder = 0 = false
BOOL isDividedBy3 = !(endNumber % 3);
@chrisswong
chrisswong / fizzBuzzObjcRecursion.m
Created February 26, 2015 14:52
FizzBuzz Test in Obj-C (Recursion)
printFizzBallWithNumber(1 , 100);
void printFizzBallWithNumber(int startNumber, int endNumber) {
if (startNumber <= endNumber) {
int i = startNumber;
//
if ( i % 3 == 0 || i % 5 == 0 ) {
@chrisswong
chrisswong / fizzBuzzObjcForLoop.m
Last active August 29, 2015 14:16
FizzBuzz Test in Obj-C (for loop)
for (int i = 1 ; i <= 100; i++) {
if ( i % 3 == 0 || i % 5 == 0 ) {
if (i % 3 == 0 && i % 5 == 0 ) {
NSLog(@"FizzBuzz");
}
else {
if (i % 3 == 0) {
NSLog(@"Fizz");
@chrisswong
chrisswong / vo
Last active August 29, 2015 14:13
vo test
//
// VoiceOverServiceManager.m
// testSqq
//
// Created by chris on 12/1/15.
// Copyright (c) 2015 Green Tomato. All rights reserved.
//
#import "VoiceOverServiceManager.h"