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
#!/usr/bin/python | |
import Image | |
import base64, zlib | |
# Jay Parlar convinced me to turn this data structure | |
# from a dictionary into an object. | |
class PackedImage(object): | |
def __init__(self, mode, size, data): | |
self.mode = mode |
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
abstract class FooBar {} | |
// 1. What is this? | |
// 2. How would you use this abstract class? | |
// 3. How can you inherit from it? | |
// 4. How can you get the actual instance, when the app is running? | |
// 5. Do you know other ways of sharing code? | |
class STMResult {} |
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 'package:intl/intl.dart'; | |
class GroupedData<T> { | |
const GroupedData( | |
{required this.startDate, this.endDate, required this.data}); | |
final DateTime startDate; | |
final DateTime? endDate; | |
final List<T> data; | |
} |
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 main() { | |
var myDouble = double.parse('123.45'); | |
assert(myDouble is double); | |
print(myDouble); | |
} | |
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 ViewController () | |
@property (nonatomic,strong) TestController *controller; | |
@end | |
@implementation ViewController | |
- (void)viewDidLoad { | |
[super viewDidLoad]; |
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
override func reverseTransformedValue(value: AnyObject!) -> AnyObject { | |
let data = value as! NSData | |
var components:[CGFloat] = [CGFloat](count: 4, repeatedValue:0) | |
var length=sizeofValue(components) | |
data.getBytes(&components, length: length) | |
let color = UIColor(red: components[0], | |
green: components[1], | |
blue: components[2], | |
alpha: components[3]) | |
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
let calendar = NSCalendar.currentCalendar() | |
let components = calendar.components(NSCalendarUnit.CalendarUnitDay , fromDate:NSDate(timeIntervalSince1970: 0) , toDate:timeToShow , options:0 ) | |
Cannot invoke 'components' with an argument list of type '(NSCalendarUnit, fromDate: NSDate, toDate: NSDate, options: Int)' |
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)drawRect:(CGRect)rect | |
{ | |
contextRef = UIGraphicsGetCurrentContext(); | |
[self parseFile]; | |
} | |
-(void)parseFile{ | |
//if certain condition draw e.g. circle at x/y |