Skip to content

Instantly share code, notes, and snippets.

Parse.Cloud.define("PersonalActivity", function(request, response)
{
var queryUserActivity = new Parse.Query("Activity");
queryUserActivity.include("fromUser");
queryUserActivity.equalTo("objectId", request.params.objectId);
var userActivityArray = [];
queryUserActivity.find(
{
success: function(fromUserActivities)
{
//Begin .h file
//
// TKCache.h
// TokenApp
//
// Created by BASEL FARAG on 12/18/14.
// Copyright (c) 2014 ABaselNotBasilProduction. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
* Takes an array of people to be arranged for Secret Santa and returns a dictionary where each person is a key and
* the corresponding value for each person is the other person to whom they will give.
*
* @param inputArray Array of people playing Secret Santa
*
* @return The dictionary from giver (key) to recipient (value)
*/
-(int)compareArrays
{
for (i = 1; i < 100; i++)
{
// for (youArrayVariable in makeAnArray){
if (![myArray[i] = makeAnArray[i]]){
return myArray[i]; // yourArrayVariable
}
// }
}
-(int) compareArraysFaster
{
NSMutableArray *myArray = [myArray array];
for (element in makeAnArray)
{
myArray[element] = 1;
}
//indexes in myArray match up with element in makeAnArray
//We specified at the top is that the numbers are unique.
for (i = 1; i <= makeAnArray.length(); i++)
int sizeOnebag, sizeAnotherbag, newBagsize;
sizeOnebag = oneBag.getCurrentSize();
sizeAnotherbag = anotherBag.getCurrentSize();
newBagsize = sizeAnotherbag + sizeOnebag;
ArrayBag<string> finalBag;
//Lucas Larson
//7/19/15
//problem 1
//assignment #2
#ifndef _ARRAY_BAG
#define _ARRAY_BAG
#include "BagInterface.h"
#include <vector>
#include <cstddef>
int arraySize;
for (int i = arraySize - 1; i >= 0; i--) {
cout << arraySize[i];
}
@Jxrgxn
Jxrgxn / gist:2af1f26f89ff0dc84bcd
Created August 6, 2015 23:01
Token Cache system
//
// TKCache.h
// TokenApp
//
// Created by BASEL FARAG on 12/18/14.
// Copyright (c) 2014 ABaselNotBasilProduction. All rights reserved.
//
//The purpose of this Support file is to provide custom caching behavior that can be used to quickly display up to date information about media. When the current user likes or comment on a given media we manually update the local cache as soon as the request is sent. This allows us to propogate the model change throughout the app without need to wait for the initial save request to finish and then refreshing the content.
//So for example we can manually manage the like and comment information of images so that the UI stays responsive and accurate when the user likes and comments on photos.
@Jxrgxn
Jxrgxn / CameraEnginer
Created August 7, 2015 19:22
Personal project.
#import "CameraEngine.h"
#import "VideoEncoder.h"
#import "AssetsLibrary/ALAssetsLibrary.h"
static CameraEngine *_engine;
@interface CameraEngine () <AVCaptureVideoDataOutputSampleBufferDelegate, AVCaptureAudioDataOutputSampleBufferDelegate>
{
AVCaptureSession *_session;
AVCaptureVideoPreviewLayer *_previewLayer;