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
package programs; | |
public class Fibonacci { | |
public static int fibrecursive(int n) { | |
if(n<=1){ | |
return n; | |
} | |
return fibrecursive(n-1)+fibrecursive(n-2); | |
} |
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
package linkedlist; | |
import java.util.HashSet; | |
import java.util.Iterator; | |
class Node { | |
int data; | |
Node next; | |
Node(int data){ | |
this.data = data; | |
this.next = null; |
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
class Search { | |
public static boolean binsearch(int [] a, int value){ | |
int low =0; | |
int high = arr.length - 1; | |
int mid = 0; | |
while(low <= high) { // binsearch(a, 1, 4, 4) | |
mid = (low+high) / 2; // 4 | |
if(a[mid] > value) { | |
high = mid - 1; |
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
// | |
// main.m | |
// chrono | |
// | |
// Created by Darshan Katrumane on 2/2/15. | |
// Copyright (c) 2015 Darshan Katrumane. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
int main(int argc, const char * argv[]) { |
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
- (void)printSubViews:(UIView *)view withTag:(NSInteger)tag | |
{ | |
if (view == nil) { | |
return; | |
} | |
if ( [view tag] == tag) { | |
NSLog(@"%@", view); | |
return; | |
} | |
for (UIView *subview in [view subviews]) |
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
// | |
// CircularLinkedList.h | |
// learnObjectiveC | |
// | |
// Created by kmd on 2/28/15. | |
// Copyright (c) 2015 Happy Days. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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
// interface | |
@interface MaxSubArray : NSObject | |
@end | |
// extension | |
@interface MaxSubArray() | |
@end |
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
@implementation RRUser | |
@synthesize email, name, facebookId, userId, sessionToken, imageUrl; | |
-(void) parseResponse:(NSDictionary*) data { | |
// this is a better way to test, if the class responds to a selector | |
// then go ahead and read from it | |
if([[data objectForKey:@"email"] respondsToSelector:@selector(length)]) { | |
self.email = [data objectForKey:@"email"]; | |
} | |
if([[data objectForKey:@"name"] respondsToSelector:@selector(length)]) { | |
self.name = [data objectForKey:@"name"]; |
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
{ | |
id: "54c58d22e", | |
dateCreated: "2015-01-26T00:41:06.687Z", | |
email: "poon@gmail.com", | |
facebookId: "490325", | |
imageUrl: "https://graph.facebook.com/1015/picture?width=50&height=50", | |
iosDeviceToken: "75b61936b004381d9aab643c5", | |
lastUpdated: "2015-03-08T21:07:00.421Z", | |
name: null, | |
sessionToken: "dba99343-368e-47a8-9198" |
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 color of the navigation bar | |
[[UINavigationBar appearanceWhenContainedIn:[UINavigationController class], nil] setBarTintColor:[RRHelper appBlue]]; | |
// change the tint color of the navigation bar | |
[[UINavigationBar appearanceWhenContainedIn:[UINavigationController class], nil] setTintColor:[UIColor whiteColor]]; | |
// change the title text attributes | |
[[UINavigationBar appearanceWhenContainedIn:[UINavigationController class], nil] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor whiteColor], NSForegroundColorAttributeName, [UIFont fontWithName:kFontRegular size:18.0], NSFontAttributeName, @0.5, NSKernAttributeName, nil]]; | |
// change the bar button item properties |
OlderNewer