scph5500.bin 26-Aug-2018 20:47 512.0K
scph5501.bin 26-Aug-2018 20:47 512.0K
scph5502.bin 26-Aug-2018 20:47 512.0K
-(void)addContact{ | |
ABRecordRef person; | |
ABMultiValueRef social = ABMultiValueCreateMutable(kABMultiDictionaryPropertyType); | |
ABMultiValueAddValueAndLabel(social, [NSDictionary dictionaryWithObjectsAndKeys: | |
(NSString *)kABPersonSocialProfileServiceTwitter, kABPersonSocialProfileServiceKey, | |
@"justinbieber", kABPersonSocialProfileUsernameKey, | |
nil], kABPersonSocialProfileServiceTwitter, NULL); | |
ABRecordSetValue(person, kABPersonSocialProfileProperty, social, NULL); | |
CFRelease(social); |
@interface MTLibraryCollectionViewFlowLayout : UICollectionViewFlowLayout | |
@end |
float padding = 10.0; | |
NSMutableParagraphStyle *editorParagraphStyle = [NSMutableParagraphStyle new]; | |
[editorParagraphStyle setHeadIndent:padding]; | |
[editorParagraphStyle setFirstLineHeadIndent:padding]; | |
[editorParagraphStyle setTailIndent:-padding]; | |
NSDictionary *textAttributes = @{ | |
NSFontAttributeName: [UIFont fontWithName:@"Helvetica" size:14], | |
NSParagraphStyleAttributeName: editorParagraphStyle |
/* Useful celery config. | |
app = Celery('tasks', | |
broker='redis://localhost:6379', | |
backend='redis://localhost:6379') | |
app.conf.update( | |
CELERY_TASK_RESULT_EXPIRES=3600, | |
CELERY_QUEUES=( | |
Queue('default', routing_key='tasks.#'), |
from twisted.internet import defer, reactor | |
from jasmin.vendor.smpp.pdu.operations import DeliverSM | |
from jasmin.queues.configs import AmqpConfig | |
from jasmin.queues.factory import AmqpFactory | |
from jasmin.routing.jasminApi import SmppServerSystemIdConnector | |
from jasmin.routing.content import RoutedDeliverSmContent | |
from jasmin.queues.test.test_amqp import waitFor | |
@defer.inlineCallbacks | |
def connect_and_publish(pdu, dc): |
// iOS 9 allows you to animate between visual effects, which gives you the | |
// ability to manipulate the blur radius. this can be useful for animating | |
// a backdrop for a custom modal, and with a few tricks, can even be set | |
// indirectly, allowing you to "scrub" between them back and forth with | |
// a gesture, just like when you pull down Spotlight. | |
// these are the two effects you want to transition between | |
UIVisualEffect *startEffect = nil; // "nil" means no blur/tint/vibrancy (plain, fully-transparent view) | |
UIVisualEffect *endEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; |
"hello".substringToIndex(1) // "h" | |
// s.substringToIndex(1) // String may not be indexed with 'Int', it has variable size elements | |
s.substringToIndex(s.startIndex.advancedBy(1)) // "h" | |
s.substringFromIndex(s.startIndex.advancedBy(1)) // "ello" | |
s.substringFromIndex(s.endIndex.advancedBy(-1)) // "o" | |
s.substringToIndex(s.endIndex.advancedBy(-1)) // "hell" |
/* | |
The "hello world" of neural networks: a simple 3-layer feed-forward | |
network that implements an XOR logic gate. | |
The first layer is the input layer. It has two neurons a and b, which | |
are the two inputs to the XOR gate. | |
The middle layer is the hidden layer. This has two neurons h1, h2 that | |
will learn what it means to be an XOR gate. | |
scph5500.bin 26-Aug-2018 20:47 512.0K
scph5501.bin 26-Aug-2018 20:47 512.0K
scph5502.bin 26-Aug-2018 20:47 512.0K