This file contains hidden or 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
| lines = [line.strip() for line in open('beautiful_stringstxt.txt')] | |
| m = lines[0] | |
| out = '' | |
| for x in xrange(1, int(m)+1): | |
| l = lines[x].lower() | |
| dic = {} | |
| line = '' | |
| for i in l: | |
| if i not in dic: |
This file contains hidden or 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
| - (CGImageRef)createMaskWithImageAlpha:(CGContextRef)originalImageContext | |
| { | |
| UInt8 *data = (UInt8 *)CGBitmapContextGetData(originalImageContext); | |
| float width = CGBitmapContextGetBytesPerRow(originalImageContext) / 4; | |
| float height = CGBitmapContextGetHeight(originalImageContext); | |
| int strideLength = ROUND_UP(width * 1, 4); | |
| unsigned char * alphaData = (unsigned char * )calloc(strideLength * height, 1); | |
| CGContextRef alphaOnlyContext = CGBitmapContextCreate(alphaData, |
This file contains hidden or 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
| /* | |
| * File: main.cpp | |
| * Author: christian | |
| * | |
| * Created on 21 de noviembre de 2011, 14:00 | |
| */ | |
| #include <cstdlib> | |
| #include <math.h> | |
| #include <stdio.h> |
This file contains hidden or 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
| /* | |
| * File: main.cpp | |
| * Author: christian | |
| * | |
| * Created on 9 de junio de 2012, 9:07 | |
| */ | |
| #include <cstdlib> | |
| #include <math.h> | |
| #include <stdio.h> |
This file contains hidden or 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
| static char *getPropertyType(objc_property_t property) { | |
| const char *attributes = property_getAttributes(property); | |
| const char *start; | |
| int len = strlen(attributes); | |
| if (len >= 3 && attributes[0] == 'T' && attributes[1] == '@' && attributes[2] == '"') { | |
| start = attributes + 3; | |
| char *end = strchr(start, '"'); | |
This file contains hidden or 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 java.awt.AWTException; | |
| import java.awt.Robot; | |
| import java.awt.event.KeyEvent; | |
| public class GoogleDoodle { | |
| static { | |
| try { | |
| Robot r = new Robot(); | |
| Thread.sleep(2000); | |
| int b[]={1,5,4,4,1,3,2}; |
This file contains hidden or 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 java.awt.AWTException; | |
| import java.awt.Robot; | |
| import java.awt.event.KeyEvent; | |
| public class GoogleDoodle { | |
| static { | |
| try { | |
| Robot r = new Robot(); | |
| Thread.sleep(2000); | |
| int b[]={1,5,4,4,1,3,2}; |
This file contains hidden or 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
| - (BOOL)emptyTextFields:(id)toCompare, ... | |
| { | |
| va_list args; | |
| va_start(args, toCompare); | |
| id value = nil; | |
| BOOL match = NO; | |
| while ((value = va_arg(args,id))) | |
| if([toCompare isKindOfClass:[NSString class]] && [value isKindOfClass:[UITextField class]]) | |
| if([[(UITextField *)value text] isEqualToString:toCompare]) |
This file contains hidden or 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
| BOOL switchObject(id anObject, ...) | |
| { | |
| va_list args; | |
| va_start(args, anObject); | |
| id value = nil; | |
| BOOL matchFound = NO; | |
| while ( (value = va_arg(args,id)) ) | |
| { |
This file contains hidden or 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
| CGContextRef currentContext = UIGraphicsGetCurrentContext(); | |
| CGGradientRef glossGradient; | |
| CGColorSpaceRef rgbColorspace; | |
| size_t num_locations = 2; | |
| CGFloat locations[2] = { 0.0, 1.0 }; | |
| CGFloat components[8] = { 1.0, 1.0, 1.0, 1, | |
| 0.95, 0.95, 0.95, 1 }; | |
| rgbColorspace = CGColorSpaceCreateDeviceRGB(); |