text:
/* Program to play with linked lists */

#include <iostream>

using namespace std;

int main()
{
  class IntNode{
  public:
    int info;
    IntNode *next;

    IntNode(int el, IntNode *ptr=0){
      info = el;
      next = ptr;
    }
  };

  IntNode *p = new IntNode(10);

  cout << (*p).info << endl; // This is the method of the class to which p points
  cout << p -> next << endl;

  return 0;
}

redpajama_set_name: RedPajamaGithub


text:
/* global google */
var PathViewBase = require('../base/path-view-base');
var PointView = require('./point-view');
var GMapsPathAdapter = require('./gmaps-path-adapter');
var GMapsCoordinates = require('./gmaps-coordinates');

var PolygonView = PathViewBase.extend({
  PointViewClass: PointView,

  _createGeometry: function () {
    var paths = GMapsCoordinates.convertToGMapsCoordinates(this.model.getCoordinates());
    var polygon = new google.maps.Polygon({
      paths: paths,
      strokeColor: this.model.get('lineColor'),
      strokeWeight: this.model.get('lineWeight'),
      strokeOpacity: this.model.get('lineOpacity')
    });

    return new GMapsPathAdapter(polygon);
  }
});

module.exports = PolygonView;


text:
while getopts ":s:e:" opt; do
  case $opt in
    s) SEASON_START="$OPTARG"
    ;;
    e) SEASON_END="$OPTARG"
    ;;
    \?) echo "Invalid option -$OPTARG" >&2
    ;;
  esac
done

BASEDIR=$(dirname $0)
DB_NAME=$(date | md5)

if [ -z "$SEASON_START" ]; then
  exit "You must pass the season start year with the '-s' argument"
fi

if [ -z "$SEASON_END" ]; then
  exit "You must pass the season end year with the '-e' argument"
fi

# cd to the script location
cd $BASEDIR

# Acquire
/usr/bin/python acquisition/salaries.py $SEASON_END
/usr/bin/python acquisition/statistics.py $SEASON_START $SEASON_END

# Create the DB
mysql -u root -proot -e "CREATE DATABASE tmp_$DB_NAME"

# Import the DB scheme / data
mysql -u root -proot --local-infile tmp_$DB_NAME < import.sql

# Export
/usr/bin/php export.php $SEASON_START $SEASON_END tmp_$DB_NAME

# Clean up
rm salaries.txt
rm statistics.txt
mysql -u root -proot -e "DROP DATABASE tmp_$DB_NAME"


text:
module Vectorise.Utils (
  module Vectorise.Utils.Base,
  module Vectorise.Utils.Closure,
  module Vectorise.Utils.Hoisting,
  module Vectorise.Utils.PADict,
  module Vectorise.Utils.Poly,

  -- * Annotated Exprs
  collectAnnTypeArgs,
  collectAnnDictArgs,
  collectAnnTypeBinders,
  collectAnnValBinders,
  isAnnTypeArg,

  -- * PD Functions
  replicatePD, emptyPD, packByTagPD,
  combinePD, liftPD,

  -- * Scalars
  isScalar, zipScalars, scalarClosure,

  -- * Naming
  newLocalVar
) where

import Vectorise.Utils.Base
import Vectorise.Utils.Closure
import Vectorise.Utils.Hoisting
import Vectorise.Utils.PADict
import Vectorise.Utils.Poly
import Vectorise.Monad
import Vectorise.Builtins
import CoreSyn
import CoreUtils
import Id
import Type
import Control.Monad

-- Annotated Exprs ------------------------------------------------------------

collectAnnTypeArgs :: AnnExpr b ann -> (AnnExpr b ann, [Type])
collectAnnTypeArgs expr = go expr []
  where
    go (_, AnnApp f (_, AnnType ty)) tys = go f (ty : tys)
    go e                             tys = (e, tys)

collectAnnDictArgs :: AnnExpr Var ann -> (AnnExpr Var ann, [AnnExpr Var ann])
collectAnnDictArgs expr = go expr []
  where
    go e@(_, AnnApp f arg) dicts
      | isPredTy . exprType . deAnnotate $ arg = go f (arg : dicts)
      | otherwise                              = (e, dicts)
    go e                        dicts          = (e, dicts)

collectAnnTypeBinders :: AnnExpr Var ann -> ([Var], AnnExpr Var ann)
collectAnnTypeBinders expr = go [] expr
  where
    go bs (_, AnnLam b e) | isTyVar b = go (b : bs) e
    go bs e                           = (reverse bs, e)

-- |Collect all consecutive value binders that are not dictionaries.
--
collectAnnValBinders :: AnnExpr Var ann -> ([Var], AnnExpr Var ann)
collectAnnValBinders expr = go [] expr
  where
    go bs (_, AnnLam b e) | isId b
                          && (not . isPredTy . idType $ b) = go (b : bs) e
    go bs e                                                = (reverse bs, e)

isAnnTypeArg :: AnnExpr b ann -> Bool
isAnnTypeArg (_, AnnType _) = True
isAnnTypeArg _              = False

-- PD "Parallel Data" Functions -----------------------------------------------
--
--   Given some data that has a PA dictionary, we can convert it to its
--   representation type, perform some operation on the data, then convert it back.
--
--   In the DPH backend, the types of these functions are defined
--   in dph-common/D.A.P.Lifted/PArray.hs
--

-- |An empty array of the given type.
--
emptyPD :: Type -> VM CoreExpr
emptyPD = paMethod emptyPDVar emptyPD_PrimVar

-- |Produce an array containing copies of a given element.
--
replicatePD :: CoreExpr     -- ^ Number of copies in the resulting array.
            -> CoreExpr     -- ^ Value to replicate.
            -> VM CoreExpr
replicatePD len x
  = liftM (`mkApps` [len,x])
        $ paMethod replicatePDVar replicatePD_PrimVar (exprType x)

-- |Select some elements from an array that correspond to a particular tag value and pack them into a new
-- array.
--
-- > packByTagPD Int# [:23, 42, 95, 50, 27, 49:]  3 [:1, 2, 1, 2, 3, 2:] 2
-- >   ==> [:42, 50, 49:]
--
packByTagPD :: Type       -- ^ Element type.
            -> CoreExpr   -- ^ Source array.
            -> CoreExpr   -- ^ Length of resulting array.
            -> CoreExpr   -- ^ Tag values of elements in source array.
            -> CoreExpr   -- ^ The tag value for the elements to select.
            -> VM CoreExpr
packByTagPD ty xs len tags t
  = liftM (`mkApps` [xs, len, tags, t])
          (paMethod packByTagPDVar packByTagPD_PrimVar ty)

-- |Combine some arrays based on a selector.  The selector says which source array to choose for each
-- element of the resulting array.
--
combinePD :: Type         -- ^ Element type
          -> CoreExpr     -- ^ Length of resulting array
          -> CoreExpr     -- ^ Selector.
          -> [CoreExpr]   -- ^ Arrays to combine.
          -> VM CoreExpr
combinePD ty len sel xs
  = liftM (`mkApps` (len : sel : xs))
          (paMethod (combinePDVar n) (combinePD_PrimVar n) ty)
  where
    n = length xs

-- |Like `replicatePD` but use the lifting context in the vectoriser state.
--
liftPD :: CoreExpr -> VM CoreExpr
liftPD x
  = do
      lc <- builtin liftingContext
      replicatePD (Var lc) x

-- Scalars --------------------------------------------------------------------

isScalar :: Type -> VM Bool
isScalar ty
  = do
    { scalar <- builtin scalarClass
    ; existsInst scalar [ty]
    }

zipScalars :: [Type] -> Type -> VM CoreExpr
zipScalars arg_tys res_ty
  = do
    { scalar <- builtin scalarClass
    ; (dfuns, _) <- mapAndUnzipM (\ty -> lookupInst scalar [ty]) ty_args
    ; zipf <- builtin (scalarZip $ length arg_tys)
    ; return $ Var zipf `mkTyApps` ty_args `mkApps` map Var dfuns
    }
    where
      ty_args = arg_tys ++ [res_ty]

scalarClosure :: [Type] -> Type -> CoreExpr -> CoreExpr -> VM CoreExpr
scalarClosure arg_tys res_ty scalar_fun array_fun
  = do
    { ctr <- builtin (closureCtrFun $ length arg_tys)
    ; pas <- mapM paDictOfType (init arg_tys)
    ; return $ Var ctr `mkTyApps` (arg_tys ++ [res_ty])
                       `mkApps`   (pas ++ [scalar_fun, array_fun])
    }


text:
#ifndef CEF_INCLUDE_BASE_CEF_BASICTYPES_H_
#define CEF_INCLUDE_BASE_CEF_BASICTYPES_H_
#pragma once

#if defined(BUILDING_CEF_SHARED)
// When building CEF include the Chromium header directly.
#include "base/basictypes.h"
#else  // !BUILDING_CEF_SHARED
// The following is substantially similar to the Chromium implementation.
// If the Chromium implementation diverges the below implementation should be
// updated to match.

#include <limits.h>         // For UINT_MAX
#include <stddef.h>         // For size_t

#include "include/base/cef_build.h"

// The NSPR system headers define 64-bit as |long| when possible, except on
// Mac OS X.  In order to not have typedef mismatches, we do the same on LP64.
//
// On Mac OS X, |long long| is used for 64-bit types for compatibility with
// <inttypes.h> format macros even in the LP64 model.
#if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD)
typedef long                int64;  // NOLINT(runtime/int)
typedef unsigned long       uint64;  // NOLINT(runtime/int)
#else
typedef long long           int64;  // NOLINT(runtime/int)
typedef unsigned long long  uint64;  // NOLINT(runtime/int)
#endif

// TODO: Remove these type guards.  These are to avoid conflicts with
// obsolete/protypes.h in the Gecko SDK.
#ifndef _INT32
#define _INT32
typedef int                 int32;
#endif

// TODO: Remove these type guards.  These are to avoid conflicts with
// obsolete/protypes.h in the Gecko SDK.
#ifndef _UINT32
#define _UINT32
typedef unsigned int       uint32;
#endif

// UTF-16 character type
#ifndef char16
#if defined(WIN32)
typedef wchar_t             char16;
#else
typedef unsigned short      char16;
#endif
#endif

#endif  // !BUILDING_CEF_SHARED

#endif  // CEF_INCLUDE_BASE_CEF_BASICTYPES_H_


text:
//
//  AppDelegate.m
//  KA-Lite
//
//  Created by cyril on 1/20/15.
//  Copyright (c) 2015 FLE. All rights reserved.
//

//
// Notes: Possible issues with OSX 10.10 or higher:
// * http://www.dowdandassociates.com/blog/content/howto-set-an-environment-variable-in-mac-os-x-slash-etc-slash-launchd-dot-conf/
//

#import "AppDelegate.h"

@import Foundation;

@implementation AppDelegate

@synthesize startKalite, stopKalite, openInBrowserMenu, kaliteVersion, customKaliteData, loadOnLogin, startOnLoad, autoStartOnLoad, kaliteDataHelp, popover, popoverMsg, version, isLoaded;

// REF: http://objcolumnist.com/2009/08/09/reopening-an-applications-main-window-by-clicking-the-dock-icon/
- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag {
    if(flag == NO) {
        [self showPreferences];
    }
    return YES;
}

// TODO(amodia): Show menu bar on dock icon.
//- (NSMenu *)applicationDockMenu:(NSApplication *)sender {
//    return self.statusMenu;
//}

- (void)applicationWillFinishLaunching:(NSNotification *)aNotification {
    // TODO(cpauya): Get version from the project's .plist file or from `kalite --version`.
    self.version = @"0.16";
    self.isLoaded = NO;
    self.autoStartOnLoad = YES;
    self.status = statusCouldNotDetermineStatus;
    self.lastStatus = statusCouldNotDetermineStatus;
    self.quitReason = quitByUnknown;
}

//<##>applicationDidFinishLaunching
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {

    // Set the delegate to self to make sure notifications work properly.
    [[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:self];

    // MUST: Let's check the setup if everything is good!
    if ([self checkSetup:YES] == NO) {
        // The application must terminate if setup is not good.
        void *sel = @selector(closeSplash);
        alert(@"The KA Lite installation is not complete, please re-install KA Lite. \n\nRefer to the Console app for details.");
        [[NSApplication sharedApplication] terminate:nil];
        return;
    }

    // Setup is good, let's continue.

    // Make sure to register default values for the user preferences.
    [self registerDefaultPreferences];

    self.statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
    [self.statusItem setImage:[NSImage imageNamed:@"favicon"]];
    [self.statusItem setMenu:self.statusMenu];
    [self.statusItem setHighlightMode:YES];
    [self.statusItem setToolTip:@"Click to show the KA Lite menu items."];

    [self.kaliteDataHelp setToolTip:@"This will set the KALITE_HOME environment variable to the selected KA Lite data location. \n \nClick the 'Apply' button to save your changes and click the 'Start KA Lite' button to use your new data location. \n \nNOTE: To use your existing KA Lite data, manually copy it to the selected KA Lite data location."];
    [self.kaliteUninstallHelp setToolTip:@"This will uninstall the KA Lite application. \n \nCheck the `Delete KA Lite data folder` option if you want to delete your KA Lite data. \n \nNOTE: This will require admin privileges."];

//    @try {
//        [self runKalite:@"--version"];
//        [self getKaliteStatus];
//    }
//    @catch (NSException *ex) {
//        NSLog(@"KA Lite had an Error: %@", ex);
//    }

    void *sel = @selector(closeSplash);
    [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:sel userInfo:nil repeats:NO];
    [self startKaliteTimer];

    // TODO(cpauya): Auto-start KA Lite on application load.
    if (self.autoStartOnLoad) {
        [self startFunction];
    } else {
        // Get the status to determine the menu bar icon to display but don't show any notifications.
        // The `isLoaded` property will be set to YES the initial status check.
        showNotification(@"KA Lite is now loaded, click on the Start KA Lite menu to get started.", @"");
        [self getKaliteStatus];
    }

}

- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
    // Confirm quit action from user.
    // TODO(cpauya): Don't ask if OS asked to quit the app.
    if ([self checkSetup:NO] == YES) {
        NSString *msg = @"This will stop and quit KA Lite, are you sure?";
        switch ([self quitReason]) {
            case quitByUser:
                break;
            default:
                if (! confirm(msg)) {
                    return NSTerminateCancel;
                }
                break;
        }
        [self stopFunction:true];
    }
    return NSTerminateNow;
}

- (void)applicationWillTerminate:(NSNotification *)aNotification {
    NSString *msg = @"KA Lite is now stopped and quit.";
    if ([self checkSetup:NO] == NO) {
        switch ([self quitReason]) {
            case quitByUninstall:
                msg = @"KA Lite was quit to complete the uninstall process.";
                break;
            default:
                msg = @"KA Lite was quit because the required setup is incomplete.";
                break;
        }
    }
    showNotification(msg, @"");
}

// REF: http://stackoverflow.com/a/11815544/845481 - Send notification to Mountain lion notification center
- (BOOL)userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentNotification:(NSUserNotification *)notification{
    return YES;
}

/********************
  Useful Methods
********************/

BOOL checkEnvVars() {
    NSString *kalitePython = getEnvVar(@"KALITE_PYTHON");
    if (!pathExists(kalitePython)) {
        return NO;
    }
    // If KALITE_HOME is nil or an empty string, that's fine.  Else check if value is a valid path.
    NSString *kaliteHome = getEnvVar(@"KALITE_HOME");
    if (kaliteHome && !pathExists(kaliteHome)) {
        return NO;
    }
    return YES;
}

- (IBAction)clearLogs:(id)sender {
    self.taskLogs.string = @"";
}

- (void) displayLogs:(NSString *)outStr {
    dispatch_sync(dispatch_get_main_queue(), ^{
        // REF: http://stackoverflow.com/questions/10772033/get-current-date-time-with-nsdate-date
        //Get the current date time
        NSDateFormatter *dateFormatter=[[NSDateFormatter alloc] init];
        [dateFormatter setDateFormat:@"yyyy-MM-dd hh:mm:ss"];
        NSString *dateStr = [dateFormatter stringFromDate:[NSDate date]];

        NSString *str = [self.taskLogs.string stringByAppendingString:[NSString stringWithFormat:@"\n%@ %@", dateStr, outStr]];
        self.taskLogs.string = str;
        // Scroll to end of outputText field
        NSRange range;
        range = NSMakeRange([self.taskLogs.string length], 0);
        [self.taskLogs scrollRangeToVisible:range];
    });
}

- (void) runTask:(NSString *)command {
    NSString *kalitePath;
    NSString *statusStr;
    NSString *versionStr;
    NSMutableDictionary *kaliteHomeEnv;

    statusStr = @"status";
    versionStr = @"--version";

    // Set loading indicator icon.
    if (command != statusStr) {
        [self.statusItem setImage:[NSImage imageNamed:@"loading"]];
    }

    self.processCounter += 1;

    kalitePath = getKaliteExecutable();

    kaliteHomeEnv = [[NSMutableDictionary alloc] init];

    NSString *kaliteHomePath = getKaliteDataPath();

    // Set KALITE_HOME environment
    [kaliteHomeEnv addEntriesFromDictionary:[[NSProcessInfo processInfo] environment]];
    [kaliteHomeEnv setObject:kaliteHomePath forKey:@"KALITE_HOME"];

    //REF: http://stackoverflow.com/questions/386783/nstask-not-picking-up-path-from-the-users-environment
    NSTask* task = [[NSTask alloc] init];
    NSString *kaliteCommand = [NSString stringWithFormat:@"kalite %@",command];
    NSArray *array = [NSArray arrayWithObjects:@"-l",
                      @"-c",
                      kaliteCommand,
                      nil];

    NSDictionary *defaultEnvironment = [[NSProcessInfo processInfo] environment];
    NSMutableDictionary *environment = [[NSMutableDictionary alloc] initWithDictionary:defaultEnvironment];
    [environment setObject:kaliteHomePath forKey:@"KALITE_HOME"];
    [task setEnvironment:environment];

    [task setLaunchPath: @"/bin/bash"];
    [task setArguments: array];

    // REF: http://stackoverflow.com/questions/9965360/async-execution-of-shell-command-not-working-properly
    // REF: http://www.raywenderlich.com/36537/nstask-tutorial

    NSPipe *pipeOutput = [NSPipe pipe];
    task.standardOutput = pipeOutput;
    task.standardError = pipeOutput;

    [[task.standardOutput fileHandleForReading] setReadabilityHandler:^(NSFileHandle *file) {
        NSData *data = [file availableData]; // this will read to EOF, so call only once
        NSString *outStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
        if (self.status != self.lastStatus) {
            NSLog(@"%@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
            [self displayLogs:outStr];
        }

        // Set the current kalite version
        if (command == versionStr){
            self.kaliteVersion.stringValue = outStr;
        }
    }];

    [task launch];

}

NSString *getResourcePath(NSString *pathToAppend) {
    NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:pathToAppend];
    path = [path stringByStandardizingPath];
    return path;
}

NSString *getDatabasePath() {
    NSString *database;
    NSString* envKaliteHomeStr = getEnvVar(@"KALITE_HOME");
    if (pathExists(envKaliteHomeStr)) {
        database = [NSString stringWithFormat:@"%@%@", envKaliteHomeStr, @"/database/data.sqlite"];
        database = [database stringByStandardizingPath];
        return database;
    }
    database = @"~/.kalite/database/data.sqlite";
    database = [database stringByStandardizingPath];
    return database;
}

BOOL pathExists(NSString *path) {
    // REF: http://www.exampledb.com/objective-c-check-if-file-exists.htm
    // REF: http://www.digitaledgesw.com/node/31
    BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:path];
    return exists;
}

NSString *thisOrOther(NSString *this, NSString *other) {
    // Accepts two arguments and returns the first if it has a value, else the other.
    if (this.length > 0) {
        return this;
    }
    return other;
}

BOOL kaliteExists() {
    NSString *kalitePath = getKaliteExecutable();
    return pathExists(kalitePath);
}

// REF: http://objc.toodarkpark.net/Foundation/Classes/NSTask.html
-(id)init{
    self = [super init];
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(checkRunTask:)
                                                 name:NSTaskDidTerminateNotification
                                               object:nil];
    return self;
}

- (enum kaliteStatus)checkRunTask:(NSNotification *)aNotification{
    NSArray *taskArguments;
    NSArray *statusArguments;
    enum kaliteStatus oldStatus = self.status;

    int status = [[aNotification object] terminationStatus];

    taskArguments = [[aNotification object] arguments];
    statusArguments = [[NSArray alloc]initWithObjects:@"-l", @"-c", @"kalite status", nil];
    NSSet *taskArgsSet = [NSSet setWithArray:taskArguments];
    NSSet *statusArgsSet = [NSSet setWithArray:statusArguments];

    if (self.processCounter >= 1) {
        self.processCounter -= 1;
    }
    if (self.processCounter != 0) {
        return self.status;
    }

    if (checkKaliteExecutable()) {
        if ([taskArgsSet isEqualToSet:statusArgsSet]) {
            // MUST: The result is on the 9th bit of the returned value.  Not sure why this
            // is but maybe because of the returned values from the `system()` call.  For now
            // we shift 8 bits to the right until we figure this one out.  TODO(cpauya): fix later
            if (status >= 255) {
                status = status >> 8;
            }
            [self setNewStatus:status];
            if (oldStatus != status) {
                [self showStatus:self.status];
            }
            return self.status;
        } else {
            // If command is not "status", run `kalite status` to get status of ka-lite.
            // We need this check because this may be called inside the KA-Lite timer.
            NSLog(@"Fetching `kalite status`...");
            [self getKaliteStatus];
            return self.status;
        }
    } else {
        [self setNewStatus:statusCouldNotDetermineStatus];
        [self showStatus:self.status];
        showNotification(@"The `kalite` executable does not exist!", @"");
    }
    return self.status;
}

- (enum kaliteStatus)runKalite:(NSString *)command {
    @try {
        // MUST: This will make sure the process to run has access to the environment variable
        // because the .app may be loaded the first time.
        if (checkKaliteExecutable()) {
            [self runTask:command];
        }
    }
    @catch (NSException *ex) {
        [self setNewStatus:statusCouldNotDetermineStatus];
        NSLog(@"Error running `kalite` %@", ex);
    }
    return self.status;
}

void alert(NSString *message) {
    NSAlert *alert = [[NSAlert alloc] init];
    [alert setMessageText:message];
    [alert setAlertStyle:NSWarningAlertStyle];
    [alert runModal];
}

BOOL confirm(NSString *message) {
    NSAlert *confirm = [[NSAlert alloc] init];
    [confirm addButtonWithTitle:@"OK"];
    [confirm addButtonWithTitle:@"Cancel"];
    [confirm setMessageText:message];
    if ([confirm runModal] == NSAlertFirstButtonReturn) {
        return TRUE;
    }
    return FALSE;
}

void showNotification(NSString *subtitle, NSString *info) {
    // REF: http://stackoverflow.com/questions/12267357/nsusernotification-with-custom-soundname?rq=1
    // TODO(cpauya): These must be ticked by user on preferences if they want notifications, sounds, or not.
    NSUserNotification* notification = [[NSUserNotification alloc] init];
    notification.title = @"KA Lite";
    notification.subtitle = subtitle;
    notification.informativeText = info;
    notification.soundName = @"Basso.aiff";

    NSUserNotificationCenter *nc = [NSUserNotificationCenter defaultUserNotificationCenter];
    [nc deliverNotification:notification];
    // The notification may be optional (based on user's OS X preferences) but we must show it on the logs.
    NSLog(subtitle);
    if (info) {
        NSLog(info);
    }
}

- (void)toggleKaliteDataPath:(BOOL)toggleValue {
    if (toggleValue == YES) {
        self.customKaliteData.enabled = YES;
        [self.customKaliteData setToolTip:@"Select KA Lite data path."];
    } else {
        self.customKaliteData.enabled = NO;
        [self.customKaliteData setToolTip:@"KA Lite is still running. Stop KA Lite to select data path."];
    }
}

// REF: http://stackoverflow.com/a/26423271/845481
// Check IF one String contains the same characters as another string
- (BOOL)string:(NSString *)string containsAllCharactersInString:(NSString *)charString {
    NSUInteger stringLen = [string length];
    NSUInteger charStringLen = [charString length];
    for (NSUInteger i = 0; i < charStringLen; i++) {
        unichar c = [charString characterAtIndex:i];
        BOOL found = NO;
        for (NSUInteger j = 0; j < stringLen && !found; j++)
            found = [string characterAtIndex:j] == c;
        if (!found)
            return NO;
    }
    return YES;
}

NSString *getKaliteExecutable() {
    return @"/usr/local/bin/kalite";
}

NSString *getKaliteDataPath() {
    /*
    This function returns these possible locations for the KA Lite data path:
        1. Custom KA Lite data set by the user at the preferences dialog.
        2. Path based on the KALITE_HOME environment variable.
        3. The default location of the KA Lite data folder at ~/.kalite/.
        4. nil - The above locations do not exist.
    */
    NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
    NSString *customKaliteData = [prefs stringForKey:@"customKaliteData"];

    if (pathExists(customKaliteData)) {
        NSString *standardizedPath = [customKaliteData stringByStandardizingPath];
        return standardizedPath;
    } else {
        NSString* envKaliteHomeStr = getEnvVar(@"KALITE_HOME");
        if (pathExists(envKaliteHomeStr)) {
            return envKaliteHomeStr;
        } else {
            NSString *defaultKalitePath = [NSString stringWithFormat:@"%@/.kalite", NSHomeDirectory()];
            if (pathExists(defaultKalitePath)) {
                return defaultKalitePath;
            }
        }
    }
    // Return this if we cannot find a data folder path anywhere.
    return nil;
}

BOOL checkKaliteExecutable() {
    NSString *kalitePath = getKaliteExecutable();
    return pathExists(kalitePath);
}

NSString *getEnvVar(NSString *var) {
    // Get environment variables as per var argument.
    NSString *path = [[[NSProcessInfo processInfo]environment]objectForKey:var];
    return path;
}

/********************
 END Useful Methods
 ********************/

/*
 This will keep track of the last status so that we don't fill the Logs when we check for status every interval.
 So instead of showing "running" status logs every minute, we just show the log when a status change is detected
 based on the timer interval.
 */
- (void)setNewStatus:(enum kaliteStatus)newStatus {
    self.lastStatus = self.status;
    self.status = newStatus;
}

- (void)showStatus:(enum kaliteStatus)status {
    // Enable/disable menu items based on status.
    BOOL canStart = pathExists(getKaliteExecutable()) > 0 ? YES : NO;
    switch (status) {
        case statusFailedToStart:
            [self.startKalite setEnabled:canStart];
            [self.stopKalite setEnabled:NO];
            self.startButton.enabled = canStart;
            self.stopButton.enabled = NO;
            self.openBrowserButton.enabled = NO;
            [self.openInBrowserMenu setEnabled:NO];
            [self.statusItem setImage:[NSImage imageNamed:@"exclaim"]];
            [self.statusItem setToolTip:@"KA Lite failed to start."];
            // Disable custom kalite data path when kalite is still running.
            [self toggleKaliteDataPath:NO];
            break;
        case statusStartingUp:
            [self.startKalite setEnabled:NO];
            [self.stopKalite setEnabled:NO];
            [self.openInBrowserMenu setEnabled:NO];
            self.startButton.enabled = NO;
            self.stopButton.enabled = NO;
            self.openBrowserButton.enabled = NO;
            [self.statusItem setToolTip:@"KA Lite is starting..."];
            [self.statusItem setImage:[NSImage imageNamed:@"loading"]];
            // Disable custom kalite data path when kalite is still running.
            [self toggleKaliteDataPath:NO];
            break;
        case statusOkRunning:
            [self.startKalite setEnabled:NO];
            [self.stopKalite setEnabled:YES];
            [self.openInBrowserMenu setEnabled:YES];
            self.startButton.enabled = NO;
            self.stopButton.enabled = YES;
            self.openBrowserButton.enabled = YES;
            [self.statusItem setImage:[NSImage imageNamed:@"stop"]];
            [self.statusItem setToolTip:@"KA Lite is running."];
            showNotification(@"Running, you can now click on 'Open in Browser' menu.", @"");
            // Disable custom kalite data path when kalite is still running.
            [self toggleKaliteDataPath:NO];
            break;
        case statusStopped:
            [self.startKalite setEnabled:canStart];
            [self.stopKalite setEnabled:NO];
            [self.openInBrowserMenu setEnabled:NO];
            self.startButton.enabled = canStart;
            self.stopButton.enabled = NO;
            self.openBrowserButton.enabled = NO;
            [self.statusItem setImage:[NSImage imageNamed:@"favicon"]];
            [self.statusItem setToolTip:@"KA Lite is stopped."];

            // We don't want to show "Stopped" right after we have loaded the application and checked the status.
            if (self.isLoaded) {
                showNotification(@"Stopped", @"");
            }

            // Enable setting the custom kalite data path.
            [self toggleKaliteDataPath:YES];

            break;
        default:
            [self.startKalite setEnabled:canStart];
            [self.stopKalite setEnabled:NO];
            [self.openInBrowserMenu setEnabled:NO];
            self.startButton.enabled = canStart;
            self.stopButton.enabled = NO;
            self.openBrowserButton.enabled = NO;
            if (kaliteExists()) {
                [self.statusItem setImage:[NSImage imageNamed:@"favicon"]];
            } else {
                [self.statusItem setImage:[NSImage imageNamed:@"exclaim"]];
            }
            break;
    }
    self.isLoaded = YES;
}

- (void)startFunction {
    if (self.processCounter != 0) {
        alert(@"KA Lite is still processing, please wait until it is finished.");
        return;
    }
    showNotification(@"Starting...", @"");
    [self setNewStatus:statusStartingUp];
    [self runKalite:@"start"];
}

- (void)stopFunction:(BOOL)isQuit {
    if (self.processCounter != 0) {
        alert(@"KA Lite is still processing, please wait until it is finished.");
        return;
    }
    NSString *msg = @"Stopping";
    if (isQuit) {
        msg = @"Stopping and quitting the application...";
    }
    showNotification(msg, @"");
    [self runKalite:@"stop"];
}

- (void)openFunction {
    // REF: http://stackoverflow.com/a/7129543/845481
    NSURL *url = [NSURL URLWithString:@"http://127.0.0.1:8008/"];
    if( ![[NSWorkspace sharedWorkspace] openURL:url] ) {
        NSString *msg = [NSString stringWithFormat:@" Failed to open url: %@",[url description]];
        showNotification(msg, @"");
    }
}

- (IBAction)start:(id)sender {
    [self startFunction];
}

- (IBAction)startButton:(id)sender {
    [self startFunction];
}

- (IBAction)stop:(id)sender {
    [self stopFunction:false];
}

- (IBAction)stopButton:(id)sender {
    [self stopFunction:false];
}

- (IBAction)customKaliteData:(id)sender {
    self.savePrefs.enabled = TRUE;
}

- (IBAction)loadOnLogin:(id)sender {
    self.savePrefs.enabled = TRUE;
}

- (IBAction)open:(id)sender {
    [self openFunction];
}

- (IBAction)openButton:(id)sender {
    [self openFunction];
}

- (IBAction)closeSplash:(id)sender {
    [self closeSplash];
}

- (IBAction)showPreferences:(id)sender {
    [self showPreferences];

}

- (IBAction)hidePreferences:(id)sender {
    [window orderOut:[window identifier]];
}

- (IBAction)savePreferences:(id)sender {
    [self savePreferences];
}

- (IBAction)discardPreferences:(id)sender {
    [self discardPreferences];
}

- (IBAction)kaliteUninstall:(id)sender {

    // Get the KA Lite application directory path.
    NSString *appPath = [[NSBundle mainBundle] bundlePath];
    // REF: http://stackoverflow.com/questions/7469425/how-to-parse-nsstring-by-removing-2-folders-in-path-in-objective-c
    NSString *kaliteAppDir = [appPath stringByDeletingLastPathComponent];
    // REF: http://stackoverflow.com/questions/1489522/stringbyappendingpathcomponent-hows-it-work
    NSString *kaliteUninstallPath = [[kaliteAppDir stringByAppendingPathComponent:@"/KA-Lite_Uninstall.tool"] stringByStandardizingPath];

    if (pathExists(kaliteUninstallPath)) {
        if (confirm(@"Are you sure that you want to uninstall the KA Lite application?")) {
            NSString *kaliteUninstallArg;
            if ([self.deleteKaliteData state]==NSOnState) {
                // Delete the KA Lite data.
                kaliteUninstallArg = @"yes yes";
            } else {
                kaliteUninstallArg = @"yes no";
            }
            const char *runCommand = [[NSString stringWithFormat: @"%@ %@", kaliteUninstallPath, kaliteUninstallArg] UTF8String];
            int runCommandStatus = system(runCommand);
            if (runCommandStatus == 0) {
                self.quitReason = quitByUninstall;
                // Terminate application.
                [[NSApplication sharedApplication] terminate:nil];
            } else {
                alert(@"The KA Lite uninstall did not succeed. You can see the logs at the Console application.");
            }
        }

    } else {
        NSString *msg = [NSString stringWithFormat:@"The KA Lite uninstall script is not found at '%@'. You need to reinstall the KA Lite application.", kaliteUninstallPath];
        alert(msg);
    }
}

- (IBAction)uninstallHelp:(id)sender {
    NSString* msg = @"This will uninstall the KA Lite application. \n \nCheck the `Delete KA Lite data folder` option if you want to delete your KA Lite data. \n \nNOTE: This will require admin privileges.";
    [self showPopOver:sender withMsg:msg];
}

- (IBAction)kaliteDataHelp:(id)sender {
    NSString* msg = @"This will set the KALITE_HOME environment variable to the selected KA Lite data location. \n \nClick the 'Apply' button to save your changes and click the 'Start KA Lite' button to use your new data location. \n \nNOTE: To use your existing KA Lite data, manually copy it to the selected KA Lite data location.\n \nFor more information, please refer to the README document.";
    [self showPopOver:sender withMsg:msg];
}

- (void)closeSplash {
    [splash orderOut:self];
}

- (void)showPreferences {
    [splash orderOut:self];
    [self loadPreferences];
    [window makeKeyAndOrderFront:self];
    [NSApp activateIgnoringOtherApps:YES];
    // REF: http://stackoverflow.com/questions/6994541/cocoa-showing-a-window-on-top-without-giving-it-focus
    [window setLevel:NSFloatingWindowLevel];
    self.savePrefs.enabled = FALSE;
}

/*
 Checks if environment for running KA Lite is good:
 1. `kalite` executable exists
 2. environment variables: KALITE_PYTHON, KALITE_HOME
 3. Custom KA Lite data path.
*/
- (BOOL)checkSetup:(BOOL)showIt {
    NSString *title = @"The KA Lite installation is incomplete.";
    NSString *msg = @"";
    BOOL isOk = YES;

    // Check the kalite executable.
    if (! checkKaliteExecutable()) {
        msg = [NSString stringWithFormat:@"%@\n* The KA Lite executable cannot be found.", msg];
        isOk = NO;
    }

    // Check the environment variables.
    if (! checkEnvVars()) {
        msg = [NSString stringWithFormat:@"%@\n* One of the KALITE_PYTHON or KALITE_HOME environment variables is invalid.", msg];
        isOk = NO;
    }

    // Check the custom KA Lite data path.
    NSString *dataPath = getKaliteDataPath();
    if (dataPath == nil) {
        msg = [NSString stringWithFormat:@"%@\n* The custom KA Lite data path is invalid, please check the KALITE_HOME environment variable value.", msg];
        isOk = NO;
    }

    if (showIt == YES && isOk == NO) {
        msg = [NSString stringWithFormat:@"%@  Please try to re-install KA Lite to attempt to fix the issue/s.%@", title, msg];
        showNotification(title, msg);
    }
    return isOk;
}

// Checks for default preferences, sets them accordingly, and saves the .plist.
// Returns YES if defaults preferences were set, otherwise NO.
- (BOOL)registerDefaultPreferences {

    NSString *dataPath = getKaliteDataPath();
    if (dataPath == nil) {
        NSLog(@"The default KA Lite data path is nil, please check the KALITE_HOME environment variable value or re-install KA Lite.");
        return NO;
    }
    NSDictionary *dict = @{
                           @"version": self.version,
                           @"autoLoadOnLogin": @YES,
                           @"autoStartOnLoad": @YES,
                           @"customKaliteData": dataPath
                           };

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

    // MUST: Check a key in the default preferences and override with the default values if non-extant.
    NSNumber *version = [defaults objectForKey:@"version"];
    if (version == nil) {
        [defaults registerDefaults:dict];
        [defaults setValuesForKeysWithDictionary:dict];
        BOOL result = [defaults synchronize];

        // TODO(cpauya): Let's perform the actions based on the values of the preferences.
        // 1. autoLoadOnLogin
        // 2. autoStartOnLoad
        [self setEnvVarsAndPlist];
        return YES;
    }
    self.kaliteVersion.stringValue = version;
    return NO;
}

- (void)loadPreferences {

    // MUST: Check for default preferences first before actually loading the stored preferences.
    // It's possible that the .plist was deleted while the .app is loaded, so this makes sure
    // we still load the default preferences just in case.
    [self registerDefaultPreferences];

    NSString *kaliteDataPath = getKaliteDataPath();
    if (!kaliteDataPath) {
        showNotification(@"KA Lite data folder is not found. Click the `Start KA Lite` button to auto-create the KA Lite data folder.", @"");
    }
    NSString *standardizedPath = [kaliteDataPath stringByStandardizingPath];
    self.customKaliteData.stringValue = standardizedPath;

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    NSNumber *state = [defaults objectForKey:@"autoLoadOnLogin"];
    if (state == nil || [state boolValue]){
        self.loadOnLogin.state = YES;
    } else {
        self.loadOnLogin.state = NO;
    }
}

- (void)savePreferences {
    /*
     1. Save the preferences: REF: http://stackoverflow.com/questions/10148788/xcode-cocoa-app-preferences
     2. Run `kalite manage setup` if no database was found.
     */

    // Stop KA Lite
    [self stopFunction:false];

    // Save the preferences.
    // REF: http:iosdevelopertips.com/core-services/encode-decode-using-base64.html
    NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];

    // Set autoLoadOnLogin value, defaults to YES.
    NSInteger state = [self.loadOnLogin state];
    if (state == NSOffState) {
        [prefs setObject:[NSNumber numberWithBool:NO] forKey:@"autoLoadOnLogin"];
    } else {
        [prefs setObject:[NSNumber numberWithBool:YES] forKey:@"autoLoadOnLogin"];
    }

    NSString *customKaliteData = [[self.customKaliteData URL] path];
    if (pathExists(customKaliteData)) {
        [prefs setObject:customKaliteData forKey:@"customKaliteData"];
    }

    // REF: https:github.com/iwasrobbed/Objective-C-CheatSheet#storing-values
    // Handle the NO Boolean return if unsuccessful.
    BOOL result = [prefs synchronize];
    if (! result) {
        showNotification(@"Sorry but your preferences cannot be saved, please check the Console logs.", @"");
    }

    [self setEnvVarsAndPlist];

    // Close the preferences dialog after a successful save.
    [window orderOut:[window identifier]];
}

- (void)showPopOver:(id)sender withMsg:(NSString*) msg {
    [popoverMsg setStringValue:msg];

    // Show the popover first, then set it's size so it is rendered correctly.
    [popover showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMaxXEdge];

    // REF: http://stackoverflow.com/a/16239550/845481
    // Getting NSTextView to perfectly fit its contents
    NSString *text = popoverMsg.stringValue;
    NSSize newSize = NSMakeSize(popoverMsg.bounds.size.width, 0);
    NSStringDrawingOptions options = NSStringDrawingUsesLineFragmentOrigin;
    NSRect bounds = [text boundingRectWithSize:newSize options:options attributes:nil];
    // TODO(cpauya): Using this code on a popover with shorter height yields an extra space at the
    // bottom.  Find a way to remove that without affecting the other popover with longer height.
    NSRect rect = NSMakeRect(0, 0, newSize.width, bounds.size.height + 50);
    popoverMsg.frame = rect;
    popover.contentSize = rect.size;
}

- (BOOL)setEnvVarsAndPlist {
    /*
    This function sets the KALITE_HOME environment variable based on the custom KA Lite data path and
    then it sets the .plist file contents so the env var is used when computer is rebooted.
    */

    // REF: http://stackoverflow.com/questions/99395/how-to-check-if-a-folder-exists-in-cocoa-objective-c

    // This is needed to display the proper menu bar icon when applying the preferences.
    [self setNewStatus:statusCouldNotDetermineStatus];

    // MUST: Check if ~/Library/LaunchAgents/ path exists and create it if it doesn't.
    // We do this because some fresh install of Mac OS X does not have this folder.
    NSString *libraryLaunchAgentsPath = [NSString stringWithFormat:@"%@%@", NSHomeDirectory(), @"/Library/LaunchAgents/"];
    if (!pathExists(libraryLaunchAgentsPath)) {
        // REF: http://stackoverflow.com/questions/99395/how-to-check-if-a-folder-exists-in-cocoa-objective-c
        // Create ~/Library/LaunchAgents/ path.
        NSError * error = nil;
        BOOL success = [[NSFileManager defaultManager] createDirectoryAtPath: libraryLaunchAgentsPath
                                                 withIntermediateDirectories:YES
                                                                  attributes:nil
                                                                       error:&error];
        if (!success) {
            NSLog(@"Failed to create %@ directory", libraryLaunchAgentsPath);
            return FALSE;
        }
    }

    // Set the KALITE_HOME environment variable using the system() function
    // so that it will be updated if already set and used by the app.
    NSString *kaliteDataPath = getKaliteDataPath();
    showNotification([NSString stringWithFormat:@"Setting KALITE_HOME environment variable to %@...", kaliteDataPath], @"");
    if (!kaliteDataPath) {
        showNotification(@"KA Lite data folder is not found. Click the `Start KA Lite` button to auto-create the KA Lite data folder.", @"");
        return FALSE;
    }
    NSString *command = [NSString stringWithFormat:@"launchctl setenv KALITE_HOME \"%@\"", kaliteDataPath];
    const char *cmd = [command UTF8String];
    int i = system(cmd);
    if (i != 0) {
        showNotification(@"Failed to set KALITE_HOME env.", @"");
        return FALSE;
    }

    // Use a different .plist name because the LaunchDaemon does not load plists with duplicate names.
    // We already have /Library/LaunchAgents/org.learningequality.kalite.plist for setting the KALITE_PYTHON env var,
    // so we name this into: ~/Library/LaunchAgents/org.learningequality.kalite.user.plist.
    NSString *plist = @"org.learningequality.kalite.user.plist";
    NSString *target = [NSString stringWithFormat:@"%@%@", libraryLaunchAgentsPath, plist];
    NSMutableDictionary *plistDict = [[NSMutableDictionary alloc] init];
    [plistDict setObject:plist forKey:@"Label"];

    // If autoLoadOnLogin value is TRUE, append the command to "open the Kalite.app" to the plist.
    NSString *kaliteHomeStr = [NSString stringWithFormat:@"%@",
                               [NSString stringWithFormat:@"launchctl setenv KALITE_HOME \"%@\"", kaliteDataPath]
                               ];
    NSString *launchStr = [NSString stringWithFormat:@"%@", kaliteHomeStr];
    // Check for a not-NO here because the preference also be nil if not yet set, to which we treat it as YES since
    // we want it to default to YES.
    NSNumber *state = [[NSUserDefaults standardUserDefaults] objectForKey:@"autoLoadOnLogin"];
    if ([state boolValue] != NO){
        NSString *kaliteAppPath = [NSString stringWithFormat:@"open %@", [[NSBundle mainBundle] bundlePath]];
        launchStr = [NSString stringWithFormat:@"%@ ; %@", kaliteHomeStr, kaliteAppPath];
    }

    // More contents for the .plist command.
    NSArray *arr = @[@"sh", @"-c", launchStr];
    [plistDict setObject:arr forKey:@"ProgramArguments"];
    [plistDict setObject:[NSNumber numberWithBool:TRUE] forKey:@"RunAtLoad"];
    [plistDict setObject:self.version forKey:@"version"];

    // Write the formed content to set the KALITE_HOME env var to the .plist.
    NSLog([NSString stringWithFormat:@"Writing the .plist for the KALITE_HOME environment variable... %@", plistDict]);
    BOOL ret = [plistDict writeToFile:target atomically:YES];
    if (ret == NO) {
        NSLog([NSString stringWithFormat:@"Failed to save .plist file!  Result: %hhd", ret]);
        return FALSE;
    }
    NSLog([NSString stringWithFormat:@"Saved .plist file to %@", target]);

    NSString *msg = [NSString stringWithFormat:@"Successfully set KALITE_HOME env to %@.", kaliteDataPath];
    showNotification(msg, @"");
    return TRUE;
}

- (void)discardPreferences {
    // TODO(cpauya): Discard changes and load the saved preferences.
    [window orderOut:[window identifier]];
}

- (void)startKaliteTimer {
    // TODO(cpauya): Use initWithFireDate of NSTimer instance.
    // TODO(amodia): Check if kalite environment variables change.
    [NSTimer scheduledTimerWithTimeInterval:5.0
                                     target:self
                                   selector:@selector(getKaliteStatus)
                                   userInfo:nil
                                    repeats:YES];
}

- (enum kaliteStatus)getKaliteStatus {
    return [self runKalite:@"status"];
}

@end


text:
adds a custom command_info field to each command with a provided raw data for an automatic help command.
![](https://cdn.discordapp.com/attachments/676795541056651304/676985383715602432/unknown.png)
![](https://cdn.discordapp.com/attachments/676795541056651304/676985446236160000/unknown.png)
![](https://cdn.discordapp.com/attachments/676795541056651304/676984788845854720/unknown.png)


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Sinensia, Shanghai 4(10): 319 (1934)

#### Original name
Doassansia horiana Henn., 1905

### Remarks
null


text:
title: '$findterm/5'
predicates:
- {sig: '$findterm/5', desc: 'locates the given term on the heap'}
---

## FORMS
```
' $findterm '(Functor, Arity, HeapPos, Term, NewHeapPos)
```
## DESCRIPTION

The term whose `Functor` and `Arity` are given is searched for on the heap starting from the given heap position `HeapPos`. If the term is located, the fourth argument, `Term`, is unified with the term found in the heap, and the fifth argument, `NewHeapPos`, is unified with a pointer to the next heap location after the term found. Heap positions are offsets with respect to the heap base. If the term cannot be found, this predicate fails.

## EXAMPLES
```
?- X = f(a,b), '$findterm'(f, 2, 0, T, NHP).

X = f(a,b)

T = f(a,b)

NHP = 3

yes.
```


text:
function handles = setupPanelFigures(handles)
%SETUPPANELSFIGURES   Populate the figures panel on CHEBGUI

% Background colour for text fields. Ensure that we're using the same one as
% found on the button panel.
textBackgroundColour = get(handles.panel_buttons, 'BackgroundColor');
% Specify the font size of panels and text with non-monospaced font.
textFontsize = 12;
% Specify the left margin of the sub-panels.
panelLeftMargin = 0.01;
% Specify the width of the sub-panels (such as inputs for differential equation
% and boundary conditions).
panelWidth = .975;

%% Creates panels for the figures and the axes
handles.panel_figSol = uipanel('Parent', handles.panel_figures, ...
    'Title', 'Solution', 'Titleposition', 'centertop',...
    'BackgroundColor', textBackgroundColour, ...
    'Position', [panelLeftMargin .565 panelWidth .425], ...
    'FontSize', textFontsize, ...
    'BorderType', 'none');

handles.fig_sol = axes( 'Parent', handles.panel_figSol, ...
    'Units', 'normalized', ...
    'HandleVisibility','callback', ...
    'Position',[0.13 0.115 0.8 0.8]);

handles.panel_figNorm = uipanel('Parent', handles.panel_figures, ...
    'Title', ' ', 'Titleposition', 'centertop',...
    'BackgroundColor', textBackgroundColour, ...
    'Position', [panelLeftMargin .05 panelWidth .45], ...
    'FontSize', textFontsize, ...
    'BorderType', 'none');

handles.fig_norm = axes( 'Parent', handles.panel_figNorm, ...
    'Units', 'normalized', ...
    'HandleVisibility','callback', ...
    'Position',[0.13 0.1 0.8 0.8]);
colormap(handles.fig_norm, 'default');
end


text:
package com.itranswarp.recurring.subscription.ext.rest;

import com.itranswarp.recurring.db.PagedResults;
import com.itranswarp.recurring.subscription.dto.SubscriptionDataDto;
import com.itranswarp.recurring.subscription.ext.model.Amendment;
import com.itranswarp.recurring.subscription.ext.service.SubscriptionExtService;
import com.itranswarp.recurring.subscription.model.Subscription;
import com.itranswarp.recurring.subscription.service.SubscriptionService;
import com.itranswarp.recurring.subscription.vo.SubscriptionVo;
import org.springframework.web.bind.annotation.*;

import javax.inject.Inject;

/**
 * Created by changsure on 15/8/23.
 */

@RestController
public class SubscriptionExtController {

    @Inject
    SubscriptionExtService subscriptionExtService;

    @Inject
    SubscriptionService subscriptionService;

    @RequestMapping(value = "/api/subscription/subscribe/{processorType}", method = RequestMethod.POST)
    public SubscriptionVo subscribe(@PathVariable(value = "processorType") String processorType, @RequestBody String data) {
        Subscription subscription = subscriptionExtService.subscribe(processorType, data);
        SubscriptionDataDto subscriptionData = subscriptionService.readSubscriptionData(subscription.getSubscriptionDataId());

        return new SubscriptionVo().build(subscription,subscriptionData);
    }

    @RequestMapping(value = "/api/subscription/amend/{processorType}/{amendType}/{subscriptionId}", method = RequestMethod.POST)
    public Amendment amend(@PathVariable(value = "processorType") String processorType,@PathVariable(value = "amendType") String amendType, @PathVariable(value = "subscriptionId") String subscriptionId, @RequestBody String amendData) {
        Amendment amendment = subscriptionExtService.amend(processorType,amendType,subscriptionId,amendData);
        return amendment;
    }

    @RequestMapping(value = "/api/subscription/amendments", method = RequestMethod.GET)
    public PagedResults<Amendment> readAmendments(@PathVariable(value = "subscriptionId") String subscriptionId, @RequestBody SubscriptionVo subscriptionVo) {
        PagedResults<Amendment> results = subscriptionExtService.readAmendments(subscriptionId);
        return results;
    }

    @RequestMapping(value = "/api/subscription/amendment/{amendmentId}", method = RequestMethod.GET)
    public Amendment readAmendment(@PathVariable(value = "amendmentId") String amendmentId) {
        Amendment amendment = subscriptionExtService.readAmendment(amendmentId);
        return amendment;
    }

}


text:
<?php
namespace InventoryTest\Item;

use Inventory\Domain\Association\BaseAssociation;
use Procure\Domain\Exception\InvalidArgumentException;
use PHPUnit_Framework_TestCase;

class AssociationSnapshotAssemblerTest extends PHPUnit_Framework_TestCase
{

    public function setUp()
    {}

    public function testOther()
    {
        try {

            // $result = AssociationSnapshotAssembler::findMissingPropsInBaseObject();
            BaseAssociation::createSnapshotProps();
        } catch (InvalidArgumentException $e) {
            echo $e->getMessage();
        }
    }
}


text:
Demo Plugin for Adhearsion
==========================


text:
package org.netpreserve.jwarc.apitests;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.WritableByteChannel;
import java.nio.charset.StandardCharsets;
import java.util.Optional;
import java.util.zip.GZIPInputStream;

import org.junit.Test;
import org.netpreserve.jwarc.HttpResponse;
import org.netpreserve.jwarc.MediaType;
import org.netpreserve.jwarc.WarcCompression;
import org.netpreserve.jwarc.WarcReader;
import org.netpreserve.jwarc.WarcRecord;
import org.netpreserve.jwarc.WarcResponse;
import org.netpreserve.jwarc.WarcWriter;

public class WarcWriterTest {

    @Test
    public void gzippedWarc() throws IOException, URISyntaxException {
        // write gzipped WARC file to memory
        String body = "Test";
        byte[] bodyBytes = body.getBytes(StandardCharsets.US_ASCII);
        HttpResponse response = new HttpResponse.Builder(200, "OK").addHeader("Server", "test")
                .body(MediaType.HTML, bodyBytes).build();
        WarcResponse record = new WarcResponse.Builder(URI.create("https://example.org/")).body(response).build();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        WritableByteChannel output = Channels.newChannel(baos);
        WarcWriter writer = new WarcWriter(output, WarcCompression.GZIP);
        writer.write(record);
        writer.close();
        byte[] warcBytes = baos.toByteArray();

        // did we get a gzipped WARC?
        assertEquals(warcBytes[0], (byte) 0x1f);
        assertEquals(warcBytes[1], (byte) 0x8b);

        // uncompress and check whether body is contained
        ByteArrayInputStream bais = new ByteArrayInputStream(warcBytes);
        GZIPInputStream gzin = new GZIPInputStream(bais);
        byte[] warcb = new byte[8192];
        int n = gzin.read(warcb);
        String warc = new String(warcb, 0, n, StandardCharsets.US_ASCII);
        assertTrue(warc.contains(body));

        // read gzipped WARC using WarcReader
        bais.reset();
        WarcReader reader = new WarcReader(bais);
        Optional<WarcRecord> res = reader.next();
        reader.close();
        assertTrue(res.isPresent());
        WarcRecord rec = res.get();
        assertTrue(rec instanceof WarcResponse);
        WarcResponse resp = (WarcResponse) rec;
        ByteBuffer buf = ByteBuffer.allocate(64);
        n = resp.http().body().read(buf);
        buf.flip();
        byte[] b = new byte[n];
        buf.get(b);
        assertEquals(body, new String(b, StandardCharsets.US_ASCII));
        assertTrue(resp.http().headers().map().containsKey("Server"));
        assertEquals("test", resp.http().headers().map().get("Server").get(0));
    }

}


text:
[![Build Status](https://travis-ci.org/Akshaybj0221/ENPM808X_Midterm.svg?branch=master)](https://travis-ci.org/Akshaybj0221/ENPM808X_Midterm)
[![Coverage Status](https://coveralls.io/repos/github/Akshaybj0221/ENPM808X_Midterm/badge.svg)](https://coveralls.io/github/Akshaybj0221/ENPM808X_Midterm)
---

##Google Spreadsheets Links Below:

The link to the defect log, time log, product backlog, Iteration backlog, release backlog table are as follows:

Product Backlog: https://docs.google.com/spreadsheets/d/1ARE-m1TVrMjwP5QnjJDIy7vjO3YFEOjuipjcBgkJD4w/edit?usp=sharing

Iteration Backlog: https://docs.google.com/spreadsheets/d/1hsRM5sYC3laXD_c4UtU0Pys1ZRHazFw-7FRlQcmtSgg/edit?usp=sharing

Release Backlog Table: https://docs.google.com/spreadsheets/d/1CuWvDiuVYU89Ndl6akPYEkMMkhjtW8jLH_CkdJijKRQ/edit?usp=sharing

Time Log: https://docs.google.com/spreadsheets/d/1ZnZWze3-v8BWkhG6UbG-DKi6_Gh3Hk_-zbDt4oEi1Eo/edit?usp=sharing

Defect Log: https://docs.google.com/spreadsheets/d/1d6eSZiVCmlSMt_dPw7nbapbw6CTz7TilsnyG3huVssA/edit?usp=sharing

## Overview

C++ based Motion Tracking vision system software:

This project is a vision system developed for the robot to track any moving object which is in the scope of robots camera periphery. There are so many applications to this project such as for intelligent planning of robot trajectory, survellience system, object tracking, movement tracking systems etc.

## Purpose
The purpose of this project is to impart the robot the capability to get some information about the motion of any object. This module can be further integrated with the robots motion planning module to help the robot plan its movement intelligently, relying less on other sensors and more on the vision system analogous to humans.

This type of module can also be integrated in many different security systems such as in surveillance cameras which are used to make sure whether an item is in its position or not (like a briefcase or a projectile).

## Main Features
The main features of the software are as follows:

- Real time motion detection.
- Real time motion tracking that can detect and track moving object
continuously.
- Marking and tagging of the moving object within the video feed.
- A standalone module which can be interfaced with different modules of the robot for further applications.
- Use of OpenCV and not ROS which makes software's integrated effective.

## Results

The software is very effective and fast in tracking any tagging motion simultaneously.
Its funtionality has been tested on multiple test videos and software has a success rate of 98%.

The working output of the software can be seen in the output folder of the repository or the link below:
https://github.com/Akshaybj0221/ENPM808X_Midterm.git

## License

MIT License

Copyright (c) [2017] [Akshay Bajaj]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## Dependencies
This software needs external dependencies such as OpenCV. In order to add those dependencies, follow following instructions:

- Open the project in Eclipse.
- We have to tell OpenCV where the OpenCV headers and libraries are. For this, do the following:
- Go to Project–>Properties
- In C/C++ Build, click on Settings. At the right, choose the Tool Settings Tab. Here we will enter the headers and libraries info:
- In GCC C++ Compiler, go to Includes. In Include paths(-l) you should include the path of the folder where opencv was installed. In our example, this is /usr/local/include/opencv.
- Now go to GCC C++ Linker,there you have to fill two spaces:
- First in Library search path (-L) you have to write the path to where the opencv libraries reside, in my case the path is: /usr/local/lib
- Then in Libraries(-l) add the OpenCV libraries that you may need. Usually just the 3 first on the list below are enough (for simple applications)
- Now you are done. Click OK
- Your project should be ready to be built. For this, go to Project->Build all
- If you check in your folder, there should be an executable there.
- Put the video file in the same directory as source file and Run.

For more queries check this link: https://docs.opencv.org/2.4/doc/tutorials/introduction/linux_eclipse/linux_eclipse.html#using-opencv-with-eclipse-plugin-cdt

## How to build

- clone the project from the given github repository "https://github.com/Akshaybj0221/ENPM808X_Midterm.git".
- go in the project directory
- open terminal
- write cmake .
- write make

## How to run demo
- Run shell-app OR Run main.cpp from the app folder using the cpp executable command.

## How to run tests
- Run test.cpp in the ubuntu terminal from the test folder.
- The readme shows the test rate using travis.

## How to generate doxygen documentation
- Open terminal
- Install doxygen wizard in ubuntu using .
- Write doxywizard
- GUI will open, add the directory where you want the files to be generated and the project source directory.
- Press run wizard and the files will be generated.

<<<<<<< HEAD
- The doxygen files can be found in the folder "docs".

## Standard install via command-line
```
git clone --recursive https://github.com/dpiet/cpp-boilerplate
cd <path to repository>
mkdir build
cd build
cmake ..
make
Run tests: ./test/cpp-test
Run program: ./app/shell-app
```

## Building for code coverage (for assignments beginning in Week 4)
```
sudo apt-get install lcov
cmake -D COVERAGE=ON -D CMAKE_BUILD_TYPE=Debug ../
make
make code_coverage
```
This generates a index.html page in the build/coverage sub-directory that can be viewed locally in a web browser.

## Working with Eclipse IDE ##

## Installation

In your Eclipse workspace directory (or create a new one), checkout the repo (and submodules)
```
mkdir -p ~/workspace
cd ~/workspace
git clone --recursive https://github.com/dpiet/cpp-boilerplate
```

In your work directory, use cmake to create an Eclipse project for an [out-of-source build] of cpp-boilerplate

```
cd ~/workspace
mkdir -p boilerplate-eclipse
cd boilerplate-eclipse
cmake -G "Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug -D CMAKE_ECLIPSE_VERSION=4.7.0 -D CMAKE_CXX_COMPILER_ARG1=-std=c++14 ../cpp-boilerplate/
```

## Import

Open Eclipse, go to File -> Import -> General -> Existing Projects into Workspace ->
Select "boilerplate-eclipse" directory created previously as root directory -> Finish

# Edit

Source files may be edited under the "[Source Directory]" label in the Project Explorer.

## Build

To build the project, in Eclipse, unfold boilerplate-eclipse project in Project Explorer,
unfold Build Targets, double click on "all" to build all projects.

## Run

1. In Eclipse, right click on the boilerplate-eclipse in Project Explorer,
select Run As -> Local C/C++ Application

2. Choose the binaries to run (e.g. shell-app, cpp-test for unit testing)

## Debug

1. Set breakpoint in source file (i.e. double click in the left margin on the line you want
the program to break).

2. In Eclipse, right click on the boilerplate-eclipse in Project Explorer, select Debug As ->
Local C/C++ Application, choose the binaries to run (e.g. shell-app).

3. If prompt to "Confirm Perspective Switch", select yes.

4. Program will break at the breakpoint you set.

5. Press Step Into (F5), Step Over (F6), Step Return (F7) to step/debug your program.

6. Right click on the variable in editor to add watch expression to watch the variable in
debugger window.

7. Press Terminate icon to terminate debugging and press C/C++ icon to switch back to C/C++
perspetive view (or Windows->Perspective->Open Perspective->C/C++).

## Plugins

- CppChEclipse

    To install and run cppcheck in Eclipse

    1. In Eclipse, go to Window -> Preferences -> C/C++ -> cppcheclipse.
    Set cppcheck binary path to "/usr/bin/cppcheck".

    2. To run CPPCheck on a project, right click on the project name in the Project Explorer
    and choose cppcheck -> Run cppcheck.

- Google C++ Sytle

    To include and use Google C++ Style formatter in Eclipse

    1. In Eclipse, go to Window -> Preferences -> C/C++ -> Code Style -> Formatter.
    Import [eclipse-cpp-google-style][reference-id-for-eclipse-cpp-google-style] and apply.

    2. To use Google C++ style formatter, right click on the source code or folder in
    Project Explorer and choose Source -> Format

[reference-id-for-eclipse-cpp-google-style]: https://raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-cpp-google-style.xml

- Git

    It is possible to manage version control through Eclipse and the git plugin, but it typically requires creating another project. If you're interested in this, try it out yourself and contact me on Canvas.
# C++ Boilerplate
[![Build Status](https://travis-ci.org/Akshaybj0221/ENPM808X_Midterm.svg?branch=master)](https://travis-ci.org/Akshaybj0221/ENPM808X_Midterm)
[![Coverage Status](https://coveralls.io/repos/github/Akshaybj0221/ENPM808X_Midterm/badge.svg)](https://coveralls.io/github/Akshaybj0221/ENPM808X_Midterm)
---

##Google Spreadsheets Links Below:

The link to the defect log, time log, product backlog, Iteration backlog, release backlog table are as follows:

Product Backlog: https://docs.google.com/spreadsheets/d/1ARE-m1TVrMjwP5QnjJDIy7vjO3YFEOjuipjcBgkJD4w/edit?usp=sharing

Iteration Backlog: https://docs.google.com/spreadsheets/d/1hsRM5sYC3laXD_c4UtU0Pys1ZRHazFw-7FRlQcmtSgg/edit?usp=sharing

Release Backlog Table: https://docs.google.com/spreadsheets/d/1CuWvDiuVYU89Ndl6akPYEkMMkhjtW8jLH_CkdJijKRQ/edit?usp=sharing

Time Log: https://docs.google.com/spreadsheets/d/1ZnZWze3-v8BWkhG6UbG-DKi6_Gh3Hk_-zbDt4oEi1Eo/edit?usp=sharing

Defect Log: https://docs.google.com/spreadsheets/d/1d6eSZiVCmlSMt_dPw7nbapbw6CTz7TilsnyG3huVssA/edit?usp=sharing

## Overview

C++ based Motion Tracking vision system software:

This project is a vision system developed for the robot to track any moving object which is in the scope of robots camera periphery. There are so many applications to this project such as for intelligent planning of robot trajectory, survellience system, object tracking, movement tracking systems etc.

## Purpose
The purpose of this project is to impart the robot the capability to get some information about the motion of any object. This module can be further integrated with the robots motion planning module to help the robot plan its movement intelligently, relying less on other sensors and more on the vision system analogous to humans.

This type of module can also be integrated in many different security systems such as in surveillance cameras which are used to make sure whether an item is in its position or not (like a briefcase or a projectile).

## Main Features
The main features of the software are as follows:

- Real time motion detection.
- Real time motion tracking that can detect and track moving object
continuously.
- Marking and tagging of the moving object within the video feed.
- A standalone module which can be interfaced with different modules of the robot for further applications.
- Use of OpenCV and not ROS which makes software's integrated effective.

## Results

The software is very effective and fast in tracking any tagging motion simultaneously.
Its funtionality has been tested on multiple test videos and software has a success rate of 98%.

The working output of the software can be seen in the output folder of the repository or the link below:
https://github.com/Akshaybj0221/ENPM808X_Midterm.git

## License

MIT License

Copyright (c) [2017] [Akshay Bajaj]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## Dependencies
This software needs external dependencies such as OpenCV. In order to add those dependencies, follow following instructions:

- Open the project in Eclipse.
- We have to tell OpenCV where the OpenCV headers and libraries are. For this, do the following:
- Go to Project–>Properties
- In C/C++ Build, click on Settings. At the right, choose the Tool Settings Tab. Here we will enter the headers and libraries info:
- In GCC C++ Compiler, go to Includes. In Include paths(-l) you should include the path of the folder where opencv was installed. In our example, this is /usr/local/include/opencv.
- Now go to GCC C++ Linker,there you have to fill two spaces:
- First in Library search path (-L) you have to write the path to where the opencv libraries reside, in my case the path is: /usr/local/lib
- Then in Libraries(-l) add the OpenCV libraries that you may need. Usually just the 3 first on the list below are enough (for simple applications)
- Now you are done. Click OK
- Your project should be ready to be built. For this, go to Project->Build all
- If you check in your folder, there should be an executable there.
- Put the video file in the same directory as source file and Run.

For more queries check this link: https://docs.opencv.org/2.4/doc/tutorials/introduction/linux_eclipse/linux_eclipse.html#using-opencv-with-eclipse-plugin-cdt

## How to build

- clone the project from the given github repository "https://github.com/Akshaybj0221/ENPM808X_Midterm.git".
- go in the project directory
- open terminal
- write cmake .
- write make

## How to run demo
- Run shell-app OR Run main.cpp from the app folder using the cpp executable command.

## How to run tests
- Run test.cpp in the ubuntu terminal from the test folder.
- The readme shows the test rate using travis.

## How to generate doxygen documentation
- Open terminal
- Install doxygen wizard in ubuntu using .
- Write doxywizard
- GUI will open, add the directory where you want the files to be generated and the project source directory.
- Press run wizard and the files will be generated.

- The doxygen files can be found in the folder "docs".

## Standard install via command-line
```
git clone --recursive https://github.com/dpiet/cpp-boilerplate
cd <path to repository>
mkdir build
cd build
cmake ..
make
Run tests: ./test/cpp-test
Run program: ./app/shell-app
```

## Building for code coverage (for assignments beginning in Week 4)
```
sudo apt-get install lcov
cmake -D COVERAGE=ON -D CMAKE_BUILD_TYPE=Debug ../
make
make code_coverage
```
This generates a index.html page in the build/coverage sub-directory that can be viewed locally in a web browser.

## Working with Eclipse IDE ##

## Installation

In your Eclipse workspace directory (or create a new one), checkout the repo (and submodules)
```
mkdir -p ~/workspace
cd ~/workspace
git clone --recursive https://github.com/dpiet/cpp-boilerplate
```

In your work directory, use cmake to create an Eclipse project for an [out-of-source build] of cpp-boilerplate

```
cd ~/workspace
mkdir -p boilerplate-eclipse
cd boilerplate-eclipse
cmake -G "Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug -D CMAKE_ECLIPSE_VERSION=4.7.0 -D CMAKE_CXX_COMPILER_ARG1=-std=c++14 ../cpp-boilerplate/
```

## Import

Open Eclipse, go to File -> Import -> General -> Existing Projects into Workspace ->
Select "boilerplate-eclipse" directory created previously as root directory -> Finish

# Edit

Source files may be edited under the "[Source Directory]" label in the Project Explorer.

## Build

To build the project, in Eclipse, unfold boilerplate-eclipse project in Project Explorer,
unfold Build Targets, double click on "all" to build all projects.

## Run

1. In Eclipse, right click on the boilerplate-eclipse in Project Explorer,
select Run As -> Local C/C++ Application

2. Choose the binaries to run (e.g. shell-app, cpp-test for unit testing)

## Debug

1. Set breakpoint in source file (i.e. double click in the left margin on the line you want
the program to break).

2. In Eclipse, right click on the boilerplate-eclipse in Project Explorer, select Debug As ->
Local C/C++ Application, choose the binaries to run (e.g. shell-app).

3. If prompt to "Confirm Perspective Switch", select yes.

4. Program will break at the breakpoint you set.

5. Press Step Into (F5), Step Over (F6), Step Return (F7) to step/debug your program.

6. Right click on the variable in editor to add watch expression to watch the variable in
debugger window.

7. Press Terminate icon to terminate debugging and press C/C++ icon to switch back to C/C++
perspetive view (or Windows->Perspective->Open Perspective->C/C++).

## Plugins

- CppChEclipse

    To install and run cppcheck in Eclipse

    1. In Eclipse, go to Window -> Preferences -> C/C++ -> cppcheclipse.
    Set cppcheck binary path to "/usr/bin/cppcheck".

    2. To run CPPCheck on a project, right click on the project name in the Project Explorer
    and choose cppcheck -> Run cppcheck.

- Google C++ Sytle

    To include and use Google C++ Style formatter in Eclipse

    1. In Eclipse, go to Window -> Preferences -> C/C++ -> Code Style -> Formatter.
    Import [eclipse-cpp-google-style][reference-id-for-eclipse-cpp-google-style] and apply.

    2. To use Google C++ style formatter, right click on the source code or folder in
    Project Explorer and choose Source -> Format

[reference-id-for-eclipse-cpp-google-style]: https://raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-cpp-google-style.xml

- Git

    It is possible to manage version control through Eclipse and the git plugin, but it typically requires creating another project. If you're interested in this, try it out yourself and contact me on Canvas.

=======
The doxygen files can be found in the folder "docs".

## NOTE:
If you are unable to run the software on Ubuntu, then go use Visual studio in Windows platform.
- Go to the folder "opencv32" in the repository
- Click open project
- Run the opencv32.sln in the opencv32 folder inside visual studio.
- Run main.cpp
  OR
  Open the /opencv32/opencv32 folder in the repository as a C++ Project in Visual studio and run main.cpp.
>>>>>>> origin