Skip to content

Instantly share code, notes, and snippets.

View jquave's full-sized avatar
✔️
jquave

Jameson Quave jquave

✔️
jquave
View GitHub Profile
require 'rubygems'
require 'ruby_fann/neural_network'
# Create Training data with 2 each of inputs(array of 3) & desired outputs(array of 1).
#
inputs = []
(1..100000).each do |i|
inputs << [(Random.rand(100)/100.0).round(1), (Random.rand(100)/100.0).round(1), (Random.rand(100)/100.0).round(1)]
NSMutableArray *abEmailAddresses = [NSMutableArray array];
NSMutableArray *abPhoneNumbers = [NSMutableArray array];
ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef people = ABAddressBookCopyArrayOfAllPeople(addressBook);
for (CFIndex i = 0; i < CFArrayGetCount(people); ++i) {
ABRecordRef aRecord = CFArrayGetValueAtIndex(people, i);
// phone numbers
ABMutableMultiValueRef phones = ABRecordCopyValue(aRecord, kABPersonPhoneProperty);
using UnityEngine;
using System.Collections;
public class Player : MonoBehaviour {
int hp = 10;
public Camera mainCam;
-- Big Legs
health = 10
attackSpeed = 1
aggroRange = 20
attackDamage = 5
movement = flying
partType = leg
model = "parts/legs/bigLegs.mdl"
-- Big Legs
health = 10
attackSpeed = 1
aggroRange = 20
attackDamage = 5
movement = flying
partType = leg
model = "parts/legs/bigLegs.mdl"
{
"code": 0,
"response": {
"NetworkRequests": [
{
"Network": {
"_id": "517046e52bb163132b000000",
"created": {
"sec": 1366312677,
"usec": 567000
NSLog(@"yes, we truly created a user in userCon called %@", userCon.user.firstname);
[usersConSet addObject:userCon];
for(UserCon *uc in usersConSet) {
NSLog(@"added object.. heres all: user from con: %@", uc.user.fullName);
}
}
}
NSLog(@"user cons set from dict...");
- (void)saveUserConsDetails:(NSArray*)userCons {
NSManagedObjectContext *moc = self.managedObjectContext;
NSMutableSet *usersConSet = [[NSMutableSet alloc] init];
if ([NSNull null] != (id)userCons && 0 < [userCons count]) {
UserCon *userCon = nil;
NSString *userConId = nil;
for (NSDictionary* userConData in userCons) {
userConId = [userConData valueForKeyPath:@"UserCon._id"];
NSLog(@"saveUserConsDetails: %@ with id %@", [userConData valueForKeyPath:@"User.firstname"], userConId);
{
Network = {
"_id" = 517046e52bb163132b000000;
created = {
sec = 1366312677;
usec = 567000;
};
modified = {
sec = 1366312677;
usec = 566000;
4a978a7c1737047f06386c0a396b983a