Skip to content

Instantly share code, notes, and snippets.

UIBezierPath *path =[UIBezierPath bezierPath];
CGPoint center = CGPointMake(rect.size.width / 2.0, rect.size.height / 2.0);
CGFloat radius = sqrt(pow(center.x, 2) + pow(center.y, 2));
CGFloat angle = M_PI / self.count;
[self.color set];
[path moveToPoint:center];
for (NSUInteger i = 0; i < self.count; i++) {
[path addArcWithCenter:center radius:radius startAngle:2*i*angle endAngle:(2*i+1)*angle clockwise:YES];
[path addLineToPoint:center];
[path closePath];
#!/usr/bin/python
#-*-coding:utf-8-*-
#problem 61
from itertools import permutations
F = (lambda x: x*(x+1)/2, lambda x: x**2, lambda x: x*(3*x-1)/2, lambda x: x*(2*x-1), lambda x: x*(5*x-3)/2, lambda x: x*(3*x-2))
_numbers = dict(zip(range(6), [set() for n in range(6)]))
n = 1