text:
# Macys Objective-C Style Guide

This was forked from The New York Times Objective-C Style Guide to meet our team coding conventions and style.

## Introduction

Here are some of the documents from Apple that informed the style guide. If something isn't mentioned here, it's probably covered in great detail in one of these:

* [The Objective-C Programming Language](http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html)
* [Cocoa Fundamentals Guide](https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaFundamentals/Introduction/Introduction.html)
* [Coding Guidelines for Cocoa](https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CodingGuidelines/CodingGuidelines.html)
* [iOS App Programming Guide](http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/Introduction/Introduction.html)

## Table of Contents

* [Dot-Notation Syntax](#dot-notation-syntax)
* [Spacing](#spacing)
* [Pragma Mark](#pragma-mark)
* [Conditionals](#conditionals)
  * [Ternary Operator](#ternary-operator)
* [Error handling](#error-handling)
* [Methods](#methods)
* [Variables](#variables)
* [Naming](#naming)
  * [Underscores](#underscores)
* [Enums](#enums)
* [Comments](#comments)
* [Init & Dealloc](#init-and-dealloc)
* [Literals](#literals)
* [CGRect Functions](#cgrect-functions)
* [Constants](#constants)
* [Enumerated Types](#enumerated-types)
* [Models](#models)
* [Private Properties](#private-properties)
* [Image Naming](#image-naming)
* [Booleans](#booleans)
* [Run in background](#run-in-background)
* [Singletons](#singletons)
* [Xcode Project](#xcode-project)

## Dot-Notation Syntax

Dot-notation or bracket notation can be used for accessing and mutating properties.

**For example:**
```objc
view.backgroundColor = [UIColor orangeColor];
label.text = @"hi there";
```

**OR:**
```objc
[view setBackgroundColor:[UIColor orangeColor]];
[label setText:@"hi there"];
```

Using bracket notation carries one advantage with Xcode auto-complete by providing guidance on the parameter type.

## Spacing

* Indent using 4 spaces. Never indent with tabs. Be sure to set this preference in Xcode.
* Method braces and other braces (`if`/`else`/`switch`/`while` etc.) always open on the same line as the statement but close on a new line.

**For example:**
```objc
if (user.isHappy) {
//Do something
}
else {
//Do something else
}
```
* There should be exactly one blank line between methods to aid in visual clarity and organization. Whitespace within methods should separate functionality, but often there should probably be new methods.
* `@synthesize` and `@dynamic` should each be declared on new lines in the implementation.

## Pragma Mark

`#pragma mark` should always be used to group methods into functional or logical sections. Below are the usual `#pragma mark`s.

`#pragma mark - View Lifecycle`
viewDidLoad
viewWillAppear
didReceiveMemoryWarning

`#pragma mark - IB Methods` OR `#pragma mark - IB Actions`
Any method from Interface Builder.

`#pragma mark - Private Methods`
Methods accessible only within the implementation file.

`#pragma mark - Public Methods`
Methods exposed in the interface files.

`#pragma mark - Service Methods`
Methods exposed in the interface files that are meant to provide some sort of a service.

`#pragma mark - Utilities`
Methods that provide utilities such as serialization, calculation, formatting, etc.

`#pragma mark - Handle Notifications`
Methods that handle notifications from NSNotificationCenter.

`#pragma mark - Handle Gestures`
Methods that handle gestures such as tap and swipe.

When using a delegate or datasource, just copy and paste the actual name into the pragma mark. This allows you to `Option + Click` it for the documentation within the pragma mark.

`#pragma mark - UITableViewDelegate`

`#pragma mark - UITableViewDataSource`

`#pragma mark - UIAlertViewDelegate`

`#pragma mark - UIScrollViewDelegate`

`#pragma mark - SomeCustomDelegate`

## Conditionals

Conditional bodies should always use braces even when a conditional body could be written without braces (e.g., it is one line only) to prevent [errors](https://github.com/NYTimes/objective-c-style-guide/issues/26#issuecomment-22074256). These errors include adding a second line and expecting it to be part of the if-statement. Another, [even more dangerous defect](http://programmers.stackexchange.com/a/16530) may happen where the line "inside" the if-statement is commented out, and the next line unwittingly becomes part of the if-statement. In addition, this style is more consistent with all other conditionals, and therefore more easily scannable.

**For example:**
```objc
if (!error) {
    return success;
}
```

**Not:**
```objc
if (!error)
    return success;
```

or

```objc
if (!error) return success;
```

### Ternary Operator

The Ternary operator, ? , should only be used when it increases clarity or code neatness. A single condition is usually all that should be evaluated. Evaluating multiple conditions is usually more understandable as an if statement, or refactored into instance variables.

**For example:**
```objc
result = a > b ? x : y;
```

**Not:**
```objc
result = a > b ? x = c > d ? c : d : y;
```

## Error handling

When methods return an error parameter by reference, switch on the returned value, not the error variable.

**For example:**
```objc
NSError *error;
if (![self trySomethingWithError:&error]) {
    // Handle Error
}
```

**Not:**
```objc
NSError *error;
[self trySomethingWithError:&error];
if (error) {
    // Handle Error
}
```

Some of Apple’s APIs write garbage values to the error parameter (if non-NULL) in successful cases, so switching on the error can cause false negatives (and subsequently crash).

## Methods

In method signatures, there should be a space after the scope (-/+ symbol). There should be a space between the method segments.

**For Example**:
```objc
- (void)setExampleText:(NSString *)text image:(UIImage *)image;
```

For method declaration, do not declare the method on the @interface area of the implementation file because it is no longer necessary. For example:

**For Example**:
```objc
@interface SomeClass ()

@end

@implementation

-(void)doSomething {
	// code here
}

@end
```

**Not:**
```objc
@interface SomeClass ()

-(void)doSomething; // unnecessary

@end

@implementation

-(void)doSomething {
	// code here
}

@end
```

## Variables

Variables should be named as descriptively as possible. Single letter variable names should be avoided except in `for()` loops.

Asterisks indicating pointers belong with the variable, e.g., `NSString *text` not `NSString* text` or `NSString * text`, except in the case of constants.

Property definitions should be used in place of naked instance variables whenever possible. Direct instance variable access should be avoided.

**For example:**

```objc
@interface NYTSection: NSObject

@property (nonatomic) NSString *headline;

@end
```

**Not:**

```objc
@interface NYTSection : NSObject {
    NSString *headline;
}
```

## Naming

Apple naming conventions should be adhered to wherever possible, especially those related to [memory management rules](https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/MemoryMgmt/Articles/MemoryMgmt.html) ([NARC](http://stackoverflow.com/a/2865194/340508)).

Long, descriptive method and variable names are good. In addition, to work better with Xcode autocomplete, the name structure is a combination and order of the object name (eg. button, label) followed by the object description (eg. Done, Cancel, Status).

**For example:**

```objc
UIButton *buttonSettings;
```

**Not**

```objc
UIButton *setBut;
```

**And Not**

```objc
UIButton *settingsButton;
```

A three letter prefix (e.g. `NYT`) should always be used for class names and constants, however may be omitted for Core Data entity names. Constants should be camel-case with all words capitalized and prefixed by the related class name for clarity.

**For example:**

```objc
static const NSTimeInterval NYTArticleViewControllerNavigationFadeAnimationDuration = 0.3;
```

**Not:**

```objc
static const NSTimeInterval fadetime = 1.7;
```

Properties should be camel-case with the leading word being lowercase. **If Xcode can automatically synthesize the variable, then let it.** Otherwise, in order to be consistent, the backing instance variables for these properties should be camel-case with the leading word being lowercase and a leading underscore. This is the same format as Xcode's default synthesis.

**For example:**

```objc
@synthesize descriptiveVariableName = _descriptiveVariableName;
```

**Not:**

```objc
id varnm;
```

### Underscores

When using properties, instance variables should always be accessed and mutated using `self.`. This means that all properties will be visually distinct, as they will all be prefaced with `self.`. Local variables should not contain underscores.

## Enums

For enums, use NS_ENUM macro.

**For example:**

```objc
typedef NS_ENUM(NSInteger, SomeEnum) {
	SomeEnumDefault = 0,
	SomeEnumTypeA = 1,
	SomeEnumTypeB = 2,
};
```

**Not:**

```objc
typedef enum {
	SomeEnumDefault,
	SomeEnumTypeA,
	SomeEnumTypeB
}SomeEnum;
```

## Comments

When they are needed, comments should be used to explain **why** a particular piece of code does something. Any comments that are used must be kept up-to-date or deleted. Long comments should generally be avoided, as code should be as self-documenting as possible with only the need for brief descriptions.

We will be using appledoc for generating documentation, so the following syntax is required for comments included in documentation generation.

**Syntax**

```objc
/**
 Add new message between source to destination timeline as empty name string
 @param sourceId Source timeline entity ID
 @param destId Destination timeline entity ID
 @see someMethodWithString:
 @warning *Warning:* A blue background.
 @bug *Bug:* A yellow background.
 @returns A newly created message instance
 */
```
The foward slash and double asterisks will be picked up by appledoc for documentation generation.

The following comment syntax will not be picked up by appledoc and can still be used for comments that should not be included in documentation generation.
```objc
/* comment */

// comment
```

In header files, the interface, every property, and every method **must** have appledoc compliant comments.

The details of appledoc installation and guidelines can be found on [Confluence](http://confluence/display/PdM/Code+documentation+and+commenting).

## init and dealloc, super

`dealloc` methods should be placed at the top of the implementation, directly after the `@synthesize` and `@dynamic` statements. `init` should be placed directly below the `dealloc` methods of any class.

`init` methods should be structured like this:

```objc
- (instancetype)init {
    self = [super init]; // or call the designated initalizer
    if (self) {
        // Custom initialization
    }

    return self;
}
```

In general, `super` should be the first thing you call in a method.

**For example:**
```objc
- (void)viewDidLoad {
    [super viewDidLoad];

    // then the rest of the code

}
```

**Not:**
```objc
- (void)viewDidLoad {

     // some code here

    [super viewDidLoad];
}
```

However, teardown `super` should be placed at the end of the method. For example:

**For example:**
```objc
- (void)viewWillDisappear {
   // do your stuff here
   // ...

   [super viewWillDisappear];
}
```

For object initialization, avoid using `new` and follow the conventional `alloc` `init`.

**For example:**

```objc
NSMutableArray *array = [[NSMutableArray alloc] init];
```

**Not:**

```objc
NSMutableArray *array = [NSMutableArray new];
```

## Literals

`NSString`, `NSDictionary`, `NSArray`, and `NSNumber` literals should be used whenever creating immutable instances of those objects. Pay special care that `nil` values not be passed into `NSArray` and `NSDictionary` literals, as this will cause a crash.

**For example:**

```objc
NSArray *names = @[@"Brian", @"Matt", @"Chris", @"Alex", @"Steve", @"Paul"];
NSDictionary *productManagers = @{@"iPhone" : @"Kate", @"iPad" : @"Kamal", @"Mobile Web" : @"Bill"};
productManagers[@"iPhone"];
NSNumber *shouldUseLiterals = @YES;
NSNumber *buildingZIPCode = @10018;
```

**Not:**

```objc
NSArray *names = [NSArray arrayWithObjects:@"Brian", @"Matt", @"Chris", @"Alex", @"Steve", @"Paul", nil];
NSDictionary *productManagers = [NSDictionary dictionaryWithObjectsAndKeys: @"Kate", @"iPhone", @"Kamal", @"iPad", @"Bill", @"Mobile Web", nil];
[productManagers objectForKey:@"iPhone"];
NSNumber *shouldUseLiterals = [NSNumber numberWithBool:YES];
NSNumber *buildingZIPCode = [NSNumber numberWithInteger:10018];
```

## CGRect Functions

When accessing the `x`, `y`, `width`, or `height` of a `CGRect`, always use the [`CGGeometry` functions](http://developer.apple.com/library/ios/#documentation/graphicsimaging/reference/CGGeometry/Reference/reference.html) instead of direct struct member access. From Apple's `CGGeometry` reference:

> All functions described in this reference that take CGRect data structures as inputs implicitly standardize those rectangles before calculating their results. For this reason, your applications should avoid directly reading and writing the data stored in the CGRect data structure. Instead, use the functions described here to manipulate rectangles and to retrieve their characteristics.

**For example:**

```objc
CGRect frame = self.view.frame;

CGFloat x = CGRectGetMinX(frame);
CGFloat y = CGRectGetMinY(frame);
CGFloat width = CGRectGetWidth(frame);
CGFloat height = CGRectGetHeight(frame);
```

**Not:**

```objc
CGRect frame = self.view.frame;

CGFloat x = frame.origin.x;
CGFloat y = frame.origin.y;
CGFloat width = frame.size.width;
CGFloat height = frame.size.height;
```

## Constants

Constants are preferred over in-line string literals or numbers, as they allow for easy reproduction of commonly used variables and can be quickly changed without the need for find and replace. Constants should be declared as `static` constants and not `#define`s unless explicitly being used as a macro.

**For example:**

```objc
static NSString * const NYTAboutViewControllerCompanyName = @"The New York Times Company";

static const CGFloat NYTImageThumbnailHeight = 50.0;
```

**Not:**

```objc
#define CompanyName @"The New York Times Company"

#define thumbnailHeight 2
```
However, for singleton + notification pattern, use #define over constants.

## Enumerated Types

When using `enum`s, it is recommended to use the new fixed underlying type specification because it has stronger type checking and code completion. The SDK now includes a macro to facilitate and encourage use of fixed underlying types — `NS_ENUM()`

**Example:**

```objc
typedef NS_ENUM(NSInteger, NYTAdRequestState) {
    NYTAdRequestStateInactive,
    NYTAdRequestStateLoading
};
```

## Models

When creating models, prefix the property name with a common identifier and a prefix that is not common in the iOS frameworks. Below are a few standards for certain properties.

**For example:**

```objc
@interface SomeModel ()

@property (nonatomic) NSURL *someURL;
@property (nonatomic) NSString *someName;
@property (nonatomic) NSTimeInterval *someCreatedDateTime;
@property (nonatomic) NSTimeInterval *someUpdatedDateTime;
@property (nonatomic) BOOL someFlag;

@end
```

## Private Properties

Private properties should be declared in class extensions (anonymous categories) in the implementation file of a class. Named categories (such as `NYTPrivate` or `private`) should never be used unless extending another class.

**For example:**

```objc
@interface NYTAdvertisement ()

@property (nonatomic, strong) GADBannerView *googleAdView;
@property (nonatomic, strong) ADBannerView *iAdView;
@property (nonatomic, strong) UIWebView *adXWebView;

@end
```

## h vs m files

In general, all properties, methods, and imports should be in the m file. Decide carefully which property, method, or import should be in the h file.

Any property or method in the h file should be accompanied by proper comments.

## Image Naming

Image names should be named consistently to preserve organization and developer sanity. They should be named as one camel case string with a description of their purpose, followed by the un-prefixed name of the class or property they are customizing (if there is one), followed by a further description of color and/or placement, and finally their state.

**For example:**

* `RefreshBarButtonItem` / `RefreshBarButtonItem@2x` and `RefreshBarButtonItemSelected` / `RefreshBarButtonItemSelected@2x`
* `ArticleNavigationBarWhite` / `ArticleNavigationBarWhite@2x` and `ArticleNavigationBarBlackSelected` / `ArticleNavigationBarBlackSelected@2x`.

Images that are used for a similar purpose should be grouped in respective groups in an Images folder.

## Booleans

Since `nil` resolves to `NO` it is unnecessary to compare it in conditions. Never compare something directly to `YES`, because `YES` is defined to 1 and a `BOOL` can be up to 8 bits.

This allows for more consistency across files and greater visual clarity.

**For example:**

```objc
if (!someObject) {
}
```

**Not:**

```objc
if (someObject == nil) {
}
```

-----

**For a `BOOL`, here are two examples:**

```objc
if (isAwesome)
if (![someObject boolValue])
```

**Not:**

```objc
if ([someObject boolValue] == NO)
if (isAwesome == YES) // Never do this.
```

-----

By default, the default attribute for properties are `atomic`, `readwrite`. For object, in most cases, it will default to `strong`. For primitives, it is default to `assign`.

**For Example:**
```objc
@property CGFloat hello;
@property NSString *bye;
```
**Same As:**
```objc
@property (atomic, readwrite, assign) CGFloat hello;
@property (atomic, readwrite, strong) NSString *bye;
```

For BOOL property declaration, use this style unless there is special circumstance that requires specific attributes.

**For Example:**

```objc
@property (nonatomic) BOOL editable;
```

**Not:**

```objc
@property (nonatomic, assign) BOOL editable;
```

For `strong` property declaration, use this style.

**For Example:**

```objc
@property (nonatomic) NSString *helloWorld;
```

**Not:**

```objc
@property (nonatomic, strong) NSString *helloWorld;
```

For `weak` property declaration, use this style.

**For Example:**

```objc
@property (nonatomic, weak) UILabel *labelStatus
```

Text and example taken from the [Cocoa Naming Guidelines](https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingIvarsAndTypes.html#//apple_ref/doc/uid/20001284-BAJGIIJE).

## Run in background

When you need to run something in the background, use GCD.

**For Example:**

```objc
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

        // your background stuff here

        dispatch_async(dispatch_get_main_queue(), ^{

			// perform UI updates on main thread

        });
    });
```

In addition, do not create a serial queue when you do not need it, just use the example above.

## Singletons

Singleton objects should use a thread-safe pattern for creating their shared instance.
```objc
+ (instancetype)sharedInstance {
   static id sharedInstance = nil;

   static dispatch_once_t onceToken;
   dispatch_once(&onceToken, ^{
      sharedInstance = [[self alloc] init];
   });

   return sharedInstance;
}
```
This will prevent [possible and sometimes prolific crashes](http://cocoasamurai.blogspot.com/2011/04/singletons-your-doing-them-wrong.html).

## Logging

NSLog is the default console log output function. However, to have this running in production is both unnecessary and can create performance issues.

We have created a logging macro that only generates output when the DEBUG macro exists and also includes the function name and line number.

Avoid using NSLog and use DLog only.

## Xcode project

The physical files should be kept in sync with the Xcode project files in order to avoid file sprawl. Any Xcode groups created should be reflected by folders in the filesystem. Code should be grouped not only by type, but also by feature for greater clarity.

When possible, always turn on "Treat Warnings as Errors" in the target's Build Settings and enable as many [additional warnings](http://boredzo.org/blog/archives/2009-11-07/warnings) as possible. If you need to ignore a specific warning, use [Clang's pragma feature](http://clang.llvm.org/docs/UsersManual.html#controlling-diagnostics-via-pragmas).

# Other Objective-C Style Guides

If ours doesn't fit your tastes, have a look at some other style guides:

* [Google](http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml)
* [GitHub](https://github.com/github/objective-c-conventions)
* [Adium](https://trac.adium.im/wiki/CodingStyle)
* [Sam Soffes](https://gist.github.com/soffes/812796)
* [CocoaDevCentral](http://cocoadevcentral.com/articles/000082.php)
* [Luke Redpath](http://lukeredpath.co.uk/blog/my-objective-c-style-guide.html)
* [Marcus Zarra](http://www.cimgf.com/zds-code-style-guide/)

repository: johnnst/objective-c-style-guide

repo_name: johnnst/objective-c-style-guide


text:
# Doc

If you wish to run QuESTlink in multithreaded or GPU-accelerated modes, or as a server, you will need to download and manually compile it. Below are instructions for getting QuESTlink up and running, when it doesn't quite run out-of-the-box.

  * [Tools](#tools)
  * [Download](#download)
  * [Compile](#compile)
  * [Launch offline](#launch-offline)
  * [Launch as a server](#launch-as-a-server)

______________

## Tools

Don't have a compiler handy? We recommend the [comprehensive guide](https://quest.qtechtheory.org/download/) for the parent QuEST project to obtain the tools needed below.

## Download

The best way to download the QuESTlink source code is through [`git`](https://git-scm.com/) at the command-line.

```bash
git clone --recurse-submodules https://github.com/QTechTheory/QuESTlink.git
cd QuESTlink
```
This will also download the [QuEST](https://github.com/QuEST-Kit/QuEST) submodule source-code.
You are thereafter in the root directory of QuESTlink and ready to compile.

> If you wish to compile a specific *Github branch* like `develop`, simply additionally run
> ```bash
> git checkout develop
> ```
> You can also perform this within the `/QuEST` subdirectory to change the branch of the QuEST submodule and access in-development features.

______________________________

## Compile

Compiling is trivial with [GNUMake](https://www.gnu.org/software/make/) and the provided [makefile](../makefile), and a C++ compiler (which supports `C++11`).

> See [here](WINDOWS.md) for a comprehensive guide to compiling QuESTlink on **Windows**, including how to obtain the necessary compilers.

> Note **Linux** users should first run `sudo apt-get install uuid-dev` before compiling. If this fails (and/or compiling says `cannot find -luuid`, also try to install `uuid`, `uuid-devel` and `libuuid-devel`.

Within the root directory, edit the [makefile](../makefile) and set:

- `OS` to your operating system (`LINUX`, `MACOS` or `WINDOWS`)

- `COMPILER` to your C++11 compiler command.
  > If in doubt, leave this as `g++`
- `COMPILER_TYPE` to the type of your compiler (`GNU`, `INTEL`, `CLANG` or `MSVC`).
  > If in doubt, run `g++ --version` in terminal for a clue. Otherwise, `COMPILER_TYPE` will likely match your `OS`, as: `LINUX` & `GNU`, `MACOS` & `CLANG`, `WINDOWS` & `MSVC`.
- `MULTITHREADED = 1` to compile in multithreaded mode
  > After compiling, and before calling `CreateLocalQuESTEnv[]`, you should set (in terminal)
  > ```bash
  > export OMP_NUM_THREADS=<nthreads>
  > ```
  > replacing `<nthreads>` with the number of CPU cores of your machine, minus a few (sparing them for the Mathematica kernel itself).
  >
  > **Note** `MULTITHREADED` mode requires an [OpenMP](https://scc.ustc.edu.cn/zlsc/sugon/intel/compiler_f/main_for/optaps/common/optaps_par_openmp_multiple_compilers.htm)-compatible compiler. MacOS users should thus avoid `clang`, and download/use a GNU compiler (e.g. [`gcc@8`](https://formulae.brew.sh/formula/gcc@8)).
- `GPUACCELERATED = 1` to use an NVIDIA GPU.
  > This requires an [`nvcc`](https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html) compiler compatible with your chosen `COMPILER`. The `nvcc` compiler command can be changed by overwriting `CUDA_COMPILER` in the makefile.
  > An `nvcc` compiler can be obtained on Linux with `sudo apt install nvidia-cuda-toolkit`
  >
  > **Note** you must also set `GPU_COMPUTE_CAPABILITY` in the makefile to the CC corresponding to your GPU. You can look this up [here](https://developer.nvidia.com/cuda-gpus).

With these settings set, QuESTlink is compiled from terminal, in the root directory [`QuESTlink/`](../), via
```bash
make
```

Compiling will create an executable `quest_link`, and some other build files. These other unneeded files can be removed with
```bash
make tidy
```
leaving only `quest_link`.

Should you wish to remove all compiled files and start again, run

```bash
make clean
```

From within Mathematica, the compiled `quest_link` environment is connected to via
```Mathematica
Import[...]
CreateLocalQuESTEnv["path/to/quest_link"];
```

_______________________________

## Launch offline

QuESTlink can be launched without an internet connection, using a copy of this repository. In Mathematica, simply run

```Mathematica
Import["path/to/QuESTlink/Link/QuESlink.m"];
CreateLocalQuESTEnv["path/to/quest_link"];
```

where `quest_link` has been compiled as above, or previously obtained using
```Mathematica
CreateDownloadedQuESTEnv[];
```

## Launch as a server

To launch `quest_link` as a server, to access remotely from a local kernel, run
```bash
./quest_link -linkcreate -linkprotocol TCPIP -linkname <PORT1>@<IP>,<PORT2>@<IP>
```
substituting `<PORT1>` and `<PORT2>` with two open and available ports, and
`<IP>` with the server IP or domain name.

Then in your local Mathematica kernel, connect to it via
```Mathematica
CreateRemoteQuESTEnv[<IP>, <PORT1>, <PORT2>];
```

license: MIT

repository: QTechTheory/QuESTlink

branch_name: refs/heads/main

extension: md

gha_language: C

gha_license_id: MIT

license_type: permissive

repo_name: QTechTheory/QuESTlink


text:
Contributing to This Documentation
==================================

You can make a contribution via a PR on [GitHub].

This documentation is meant to be explanatory. Please explain how to do things, and break it down into reasonable chunks.
We have a wiki elsewhere that can capture more comprehensive code examples.

Our audience is anyone who wants to understand how to build a mod using Forge.

Please don't try to turn this documentation into a tutorial on Java Development - it is intended for people who understand how a Java class works, and other fundamental structures of Java.

Style Guide
-----------

!!! important
    Please use **two spaces** to indent, not tabs.

Titles should be capitalized in the standard titling format. For example,

* Guide For Contributing to This Documentation
* Building and Testing Your Mod

Essentially, capitalize everything but unimportant words.

Spelling, grammar, and syntax should follow those of American English. Also, prefer using separate words over contractions (e.g. "are not" instead of "aren't").

Please use equals and dash underlines, instead of `#` and `##`. For h3 and lower, `###` etc. is fine. The source of this file contains an example for equals and dash underlining. Equals underlines create h1 text, and dash underlines create h2 text.

When referencing fields and methods outside of code block snippets, they should use a `#` separator (e.g. `ClassName#methodName`). Inner classes should use a `$` separator (e.g. `ClassName$InnerClassName`).

JSON code block snippets should use `js` syntax highlighting.

All links should have their location specified at the bottom of the page. Any internal links should reference the page via their relative path.

Admonitions (represented by `!!! <type>`) must be formatted as [documented][admonition]; otherwise they may end up rendering incorrectly.

[GitHub]: https://github.com/MinecraftForge/Documentation
[admonition]: https://python-markdown.github.io/extensions/admonition/

repository: MinecraftForge/Documentation

gha_language: HTML

repo_name: MinecraftForge/Documentation


text:
# Dummy's Tutorial to Python Multiprocessing
### Lessons learned on parallelizing code in Python

I decided to create this tutorial after realizing that, as a Data Scientist just trying to "make my code run faster", I spent way too much time trying to understand and use apply multi-processing in real world problems with Python. These real world problems have characteristics that, frustratingly enough, go beyond the narrow scope of Stack Overflow answers and toy examples. These characteristics include one or more of the following:

- large amounts of data,
- data structures with large memory overhead,
- non serializable data structures,
- logics that are non-trivial to vectorize,
- and more.

So here is a few lessons I learned in the last couple of years. Hopefully somone out there may benefit from my own struggles and experience.

We will start with an example and improve it step-by-step throughout this tutorial.

## 1. The basic code

This example stores financial transaction data as a graph, creating nodes for the transacting parties and edges for each financial transaction.

```
#Open file, load names to graph nodes
import networkx as nx
import csv

filename='transactions.csv'
TXN_DATA=[]
G=nx.Graph()
num=-1
def load_file(filename):
    with open(filename) as fin:
        reader=csv.reader(fin,delimeter=',',encoding='utf-8')
        for line in reader:
            num+=1
            if num == 0:                                    #skip header
                continue
            TXN_DATA.append(line)                           #save transactions
            G.add_node(num,name=line[0],address=line[1])    #create a new node in graph

def process(nrow,row):

    return (nrow,data)

def collect():
    return

def main():
    for nrow,row in enumerate(TXN_DATA):
        collect(process(nrow,row))

#Run all
load_file(filename)
main()
```

## 2. Adding parallelism

```
from multiprocessing import Pool, cpu_count

if parallel:
    _num_proc=int(round(cpu_count()-1))
    pool = Pool(processes=_num_proc)

def main(pool):
    for nrow,row in enumerate(TXN_DATA):
        if parallel:
            pool.apply_async(process, args=(nrow,row), callback=collect_result)
        else:
            collect_result(process(nrow,row))

if parallel:
    main(pool)
    pool.close()
    pool.join()
else:
    main('')

```

## 3. Adding batching

```
from multiprocessing import Pool, cpu_count

if parallel:
    _num_proc=int(round(cpu_count()-1))
    pool = Pool(processes=_num_proc)

def main(pool):
    for nrow,row in tqdm(enumerate(TXN_DATA)):
        if nrow == 0 or len(row) < 5:
            continue
        if parallel:
            pool.apply_async(process, args=(nrow,row), callback=collect_result)
            if nrow%_batch == 0:
                pool.close()
                pool.join()
                pool = Pool(processes=_num_proc)
        else:
            collect_result(process(nrow,row))

if parallel:
    main(pool)
    pool.close()
    pool.join()
else:
    main('')
```

## 4. Adding serialization

```
import functools
import threading

lock = threading.Lock()

def synchronized(lock):
    def wrapper(f):
        @functools.wraps(f)
        def inner_wrapper(*args, **kw):
            with lock:
                return f(*args, **kw)
        return inner_wrapper
    return wrapper

class Singleton(type):
    _instances = {}
    @synchronized(lock)
    def __call__(cls, *args, **kwargs):
        if cls not in cls._instances:
            cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
        return cls._instances[cls]

class tsG(metaclass=Singleton):
    def __init__(self):
        self.G=nx.Graph()
    def add_node(self,idx,data=''):
        self.G.add_node(idx,data=data)
    def add_edge(self,idx1,idx2):
        self.G.add_edge(idx1,idx2)
    def set_data(self,idx,**data):
        for d in data:
            self.G.node[idx][d[0]]=d[1]
    def nodes(self,data=False):
        return self.G.nodes(data)
```

## 5. Putting it all together

branch_name: refs/heads/master


text:
---
title: Subscriber receives irrelevant events
---

## Symptom

Subscriber receives irrelevant events.

## Cause

To conform to Cloud Event specifications, Eventing modifies the event names to filter out prohibited characters. For details, see [event name cleanup](../../../05-technical-reference/evnt-01-event-names.md#event-name-cleanup).
In some cases, it can lead to a naming collision, which can cause subscribers to receive irrelevant events.

## Remedy

Follow these steps to detect if naming collision is the source of the problem:

1. Get the clean types from the status of the Subscription.

    ```bash
    kubectl -n {NAMESPACE} get subscriptions.eventing.kyma-project.io {NAME} -o jsonpath='{.status.types}'
    ```

2. Search for any other Subscription using the same `CleanType` as in your Subscription.

    ```bash
    kubectl get subscriptions.eventing.kyma-project.io -A | grep {CLEAN_TYPE}
    ```

3. If you find that the `CleanType` collides with some other Subscription, a solution for this is to use a different event type.

repository: kyma-project/kyma

gha_language: Go

repo_name: kyma-project/kyma


text:
# Merely Server

This package contains dependency-free NodeJS script to create and start local server

## Installation

>`npm install merely-server`

## Usage

```sh
> npm install -g merely-server
> cd site/path/
> merely-server [options]
```

Options:

- `--port` set port for server. Default value: 8080. Example: `merely-server --port 3000`
- `--help`, `-h` output usage information

## Highlights

### Script For Local Server

Main module is `index.js`. There are functions to configure, create and start the server.

Noteworthy:

- [void operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void) for [Immediately Invoked Function Expression](https://developer.mozilla.org/en-US/docs/Glossary/IIFE)
- create server and read files with pure nodejs

### Pipe Function

Pipe helper-function (`helpers/pipe.js`) is used to:

- create pure functions
- create code in 'functional styling'

Thanks [Moon](https://medium.com/@moonformeli) for [article](https://medium.com/better-programming/functional-programming-and-the-pipe-function-in-javascript-c92833052057)

### Console Color Change Function

This helper-function (`helpers/getColor.js`) made console messages colorful and informative.

repository: xenikopa/merely-server

repo_name: xenikopa/merely-server


text:
(a) `fval` is converted to `bool`.
(b) `ival` is converted to `float`, then added to `fval`, finally the result is converted to `double`.
(c) `cval` is promoted to `int`, then multiplied by `ival`, then the result is converted to `double`, then added to `dval`.


text:
# PowerShell/Python Interoperation Demo

The `demo_script.ps1` file in this directory walks through a
demonstration of basic interoperation between PowerShell and Python
including how to use JSON to exchange structured objects between
Python and PowerShell.

The other files in this directory are referenced by `demo_script.ps1`.

repository: daxian-dbw/PowerShell

gha_language: C#

repo_name: daxian-dbw/PowerShell


text:
# Modcrafter

Modcrafter is a tool used to create and compile Minecraft Forge mods using a simple GUI.
No Java knowledge or IDE required!

## Download

Download Modcrafter from the attached exe file on the latest [release](https://github.com/Nixinova/Modcrafter/releases).
Alternatively, grab the live version of the exe from path `/bin/dist/Modcrafter.exe` of this repository.

## Usage

1. Copy the exe into the directory you will be using for your mod.
1. Run the exe and use the GUI to configure your mod.
1. When adding textures, make sure to add the relevant files into folder `lib/textures/`.
1. When done configuring, click "Generate" and the mod will start compiling. You will find your outputted mod file in `/lib/jars/`.
1.

## Build from source

Run `python run compile` to compile Modcrafter from this source code. Outputted exe is in `bin/dist/`.

license: ISC

repository: Nixinova/Modcrafter

repo_name: Nixinova/Modcrafter


text:
# jTessBoxEditor

This is a fork of a part of [VietOCR](http://vietocr.sourceforge.net/training.html) project.

jTessBoxEditor is a cross platform tool for editing .box files used for training [Tesseract OCR](https://code.google.com/p/tesseract-ocr/). The original application required too many mouse movements and clicks, so I added hotkeys and better box editor widget.

### Improvements

- Scaling and display of surrounding pixels for scaled box view
- Adjustable box scaling and margins
- Hotkeys for editing box positions and sizes

### Screenshot
![Screenshot](https://raw.githubusercontent.com/A2K/jTessBoxEditor/master/screenshot.png)

### Hotkeys
- **W** - move box up
- **S** - move box down
- **A** - move box left
- **D** - move box right
- **Q** - decrease box width
- **E** - increase box width
- **R** - decrease box height
- **F** - increase box height
- **<** - previous box
- **>** - next box
- **X** - edit character in box

Holding shift when using hotkeys multiplies movement speed by 10.

Pressing Enter or ESC when editing character focuses the box editor.

Box movement controls can be inverted via a checkbox in editor panel.


text:
### Project Overview

 Dream Housing Finance Inc. specializes in home loans across different market segments - rural, urban and semi-urban. Their loan eligibility process is based on customer details provided while filling an online application form. To create a targeted marketing campaign for different segments, a comprehensive analysis of the data collected is presented.

### Approach taken to solve the problem

 The following operations are performed on the dataset.

1. Find categorical & numerical variables in the dataset
2. Deal with missing information - replacement by mean, mode or median
3. Relationship between loan amount of an average person with gender, marital status & employment
4. Find percentage of loan approved based on a person's employment type
5. Find out applicants with long loan amount term to assess the risk
6. Map the Average income of an applicant to the average loan given to a person based on their income

repository: sannidh/ga-dsmp

repo_name: sannidh/ga-dsmp


text:
# TheAntGame
This assignment is a semester long project for Dr. Gordon's CSC 133 class (Object-Oriented Computer Graphics Programming) at Sacramento State University.

NOTE: A3 is still a work in progress.

## Requirements To Run
This project is being completed using CodeNameOne, an open-source cross-platform framework aiming to provide write once, run anywhere code for various mobile and desktop operating systems, along with the Eclipse IDE.

• Install latest version of “Java SE JDK version 8” (release 1.8.0_231): LINK

• Latest version of “Eclipse IDE for Java Developers” (Eclipse IDE 2019-12 R - version 4.14.0) is required : LINK

• Install CN1 plugin (latest version 6.0.0) to Eclipse: In Eclipse select “Help” → “Eclipse Marketplace” → search for “Codename One” and follow the installation process
## How To Run
You will need to create a new codenameone project folder to run each of the assignments.

For example, to run A1:

Open Eclispe, File → New → Project → Codename One Project

Give a project name and uncheck “Java 8 project”. Hit “Next”

Project Name: A1Prj.

Give a main class name, package name, and select a “native” theme, and “Hello World(Bare Bones)” template (for manual GUI building). Hit “Finish”.

Main Class Name: Starter (keep the same for all assignments)

Package: com.mycompany.a1

Copy and paste all Java files provided from respective A folder into the following directory: A1Prj/scr/com.mycompany/a1. Then compile the code.

To run the application, while still on Eclipse IDE, in the A1prj directory, look for a file named Simulator_1Prj.launch. Right click, select "Run as", click Simulator_1Prj

The process is the same to run A2 and A3 projects.

## Introduction for A1
This semester we will study object-oriented graphics programming and design by developing a simple video game we’ll call ThePath. In this game, you (the player) will be controlling an ant walking around a path while trying to avoid collisions with spiders and to keep your ant fed.

The goal of this first assignment is to develop a good initial class hierarchy and control structure by designing the program in UML and then implementing it in Codename One (CN1). This version will use keyboard input commands to control and display the contents of a “game world” containing the set of objects in the game. In future assignments, many of the keyboard commands will be replaced by interactive GUI operations, and we will add graphics, animation, and sound. For now we will simply simulate the game in “text mode” with user input coming from the keyboard and “output” being lines of text on the screen.

### Output for A1

## Introduction for A2
For A2, you are to extend your game from A1 to incorporate several important design patterns, and a Graphical User Interface (GUI). The rest of the game will appear to the user to be similar to the one in A1, and most of the code from A1 will be reused, although it will require some modification and reorganization.

An important goal for this assignment will be to reorganize your code so that it follows the Model-View-Controller (MVC) architecture. If you followed the structure specified in A1, you should already have a “controller”: the Game class containing the play()method. The GameWorld class becomes the “data model”, containing the collection of game objects and other game state information. You are also required to add two classes acting as “views”: a score view which will be graphical, and a map view which for now will retain the text-based form generated by the ‘m’ command in A1 (in A3 we will replace the text-based map with an interactive graphical map).

Single-character commands entered via a text field in A1 will be replaced by GUI components (side menu items, buttons, key bindings, etc.). Each such component will have an associated “command” object, and the command objects will perform the same operations as previously performed by the single-character commands.

The program must use appropriate interfaces and built-in classes for organizing the required design patterns. The following design patterns are to be implemented in this assignment:

• Observer/Observable – to coordinate changes in the model with the various views,

• Iterator – to walk through all the game objects when necessary,

• Command – to encapsulate the various commands the player can invoke,

• Singleton – to insure that only a single instance of Ant can exist.

### Output for A2

## Introduction for A3
The purpose of this assignment is to help you gain experience with interactive graphics and animation techniques such as repainting, timer-driven animation, collision detection, and object selection. Specifically, you are to make the following modifications to your game:

(1) the game world map is to display in the GUI (in addition to the text form on the console)

(2) the movement(animation) of game objects is to be driven by a timer

(3) the game is to support dynamic collision detection and response

(4) the game is to support simple interactive editing of some of the objects in the world

(5) the game is to include sounds appropriate to collisions and other events

### Output for A3


text:
## Nimbus :smiley: :exclamation: fa18-523-65

|          |                                         |
| -------- | --------------------------------------- |
| title    | Nimbus                                  |
| status   | 10                                      |
| section  | IaaS Management from HPC to hypervisors |
| keywords | IaaS Management from HPC to hypervisors |

Cloud computing has 3 models; IaaS, PaaS and SaaS. IaaS model is
chosen when one wants access to technologies and resources like
traditional data centers without needing investment in planning,
actual maintenance and management of them. In IaaS model, vendor
is responsible for providing data storage, servers, processing
power and virtualization while user is responsible for data that
they want to handle, applications that provide interaction with
data and cloud servers etc. This way users can build virtual data
centers. Nimbus is one such private open source could computing IaaS
platform. Nimbus has solutions geared towards needs of services to
scientific community [@fa18-523-65-nimbus-1].

Nimbus has two platforms, Nimbus Platform and Nimbus Infrastructure.
Nimbus Platform provides set of tools that provide IaaS' scalability
and flexibility. Nimbus Infrastructure provides IaaS features that are
useful for scientific community. This allows users to utilize virtual
machines on available resources to design an infrastructure they want
for their purpose. For scientificcommunity, the computations they need
to perform are time consuming and complex and need the job divided on
cloud to get it done within desired time. However, when they don't have
control over architecture of cloud model, their job can get scheduled
and be in line without knowing when the task will be done. Nimbus allows
user to create multiple virtual machines to be deployed throughout
cloud to spread the workload. User can also configure these virtual
machines so that they work in tandem and complete their individual
tasks to get whole task done in most time and resource efficient manner.
This way users have control over how and when their computational tasks
are completed [@fa18-523-65-nimbus-1].

Nimbus provides speed by providing readymade execution templates and
running efficient tasks in C++ [@fa18-523-65-nimbus-2]. One of many
famous use cases for Nimbus is STAR nuclear physics experiment. Nimbus
was used to perform complex and otherwise time-consuming computations
by using virtual machines across cloud [@fa18-523-65-nimbus-3].


text:
# Card Payments

### Sections
[Challenge Overview](/README.md)

[Section 1: Sell concert tickets](/README-pt1-concerttickets.md)

[Section 2: Sell video courses](README-pt2-videopurchase.md)

[Section 3: Lesson signup](README-pt3-lessonsignup.md)

[Section 4: Lesson payment capture](README-pt4-paymentcapture.md)

[Section 5: Lesson account management](README-pt5-accountmanagement.md)

[Section 6: Lesson Reporting](README-pt6-reporting.md)

# Getting started
To goal is to complete the app started in this repo, a website for a music store.  To get started:

* Read this doc to get an overview of how it is set up.
* Complete all three sections. When you've finished, deploy your solution and push it back to this repo.

**Getting Help**

If you need any help please reach out to<EMAIL_ADDRESS>
# Overview

Looking to grow their business a US-based music school wants to expand their online presence to include selling instructional videos, concert tickets and by offering online lessons.

# Using the provided starter code

Within the code directory you'll find the [starter code](code/) for client and server you selected to complete.

The README for each section provides more information about the starter code specific for that section.

We hope the starter code is helpful to you, but feel free to use a different framework if that's easier for you.  Please let us know in the feedback doc why you decided to not use the starter code and how we could make it better.

## Running locally

As a first step in completing we recommend you get your local server up and running:

**1. First checkout the repo and configure the environment variables:**

Inside `./code/server` you will find an example for your **.env** file. Make a copy of `.env.example` at the same level and rename it to `.env`.

For example:

```
cp .env.example .env
```

Replace the placehold variables in the .env file wtih your keys:

```
STRIPE_PUBLISHABLE_KEY=<replace-with-your-publishable-key>
STRIPE_SECRET_KEY=<replace-with-your-secret-key>
STRIPE_WEBHOOK_SECRET=<replace-with-your-webhook-secret>
```

We've also provided a config file, `config.json` which contains some constants used by the video and concert tickets sections of the app.  See the server file for examples of how to load these values.

**For Vanilla stack client**

`STATIC_DIR` tells the server where to the static files are located and does not need to be modified unless you restructure the directories.

**2. Follow the server instructions on how to run:**

Please follow the instructions in the README you'll find in the code/server folder on how to run your server.

With your server running the page should look like this:

**Note**: if you are working with the react client, after you start you server, please follow  the instructions in the README you'll find in the code/client folder on how to start the react client.

![Overview](screenshots/MusicShopOverview.gif)

**3. [Optional] Run a webhook locally:**

We recommend using the Stripe CLI to easily spin up a local webhook.

First [install the CLI](https://stripe.com/docs/stripe-cli) and [link your Stripe account](https://stripe.com/docs/stripe-cli#link-account).

```
stripe listen --forward-to localhost:4242/webhook
```

The CLI will print a webhook secret key to the console. Set `STRIPE_WEBHOOK_SECRET` to this value in your .env file.

You should see events logged in the console where the CLI is running.

## Your Stripe Account

We'll run test mode transaction on your Stripe account to test your solution. If this activity might disrupt your other work you may want to spin up a separate Stripe account just for these sections.  We recommend you keep the account you use up to date with the latest API version.

## Submitting

When you are done there are 3 steps to submitting your solution:

* We advise you to run the test in `./test`.

**Note**: Please make sure all your features run in the lastest version of google chrome.

**Navigation**
[Continue to Section 1: Sell Concert Tickets](/README-pt1-concerttickets.md)

repository: snowcat-web/demo

repo_name: snowcat-web/demo


text:
#atom-build-plask

Uses the atom-build package to run current file in [Plask](http://plask.org)

This package requires atom-build to be installed.

repository: vorg/atom-build-plask

repo_name: vorg/atom-build-plask


text:
# Current Dev

### Breaking changes
- Removed Mean and SD from summary in `bayes_cor.test`
### New functions / parameters
- Extended `standardize` method
- Added `get_R2` method
- Added `interpret_odds` and logistic regression effect size interpretation
- Added `omega_sq` and `interpret_omega_sq`
### Changes
- Enhance print for `analyze.aov`

# [0.2.8](https://github.com/neuropsychology/psycho.R/releases/tag/0.2.8) (2018-06-11)

### Breaking changes
- Renamed `bayesian_cor` to `bayes_cor` for consistency
- Changed parameters name and role in `refdata`
- Changed output of analyze.stanreg
- effsize in analyze.stanreg default to TRUE
- Fixed bug in `dprime`
### New functions / parameters
- Added `interpret_RMSEA`
- Added `analyze.lavaan` and `analyze.aov`
- Added `remove_empty_cols`
- Added `model_to_priors`
- First iteration on custom rule's sets for effects sizes
- Added `analyze.htest` for correlations and t-tests
- Added `interpret_R2`
- Added "bayesian" method for correlation matrix
- Added `reorder_matrix`
- Added `bayes_adj_R2` for loo-adjusted R2 in stanreg models
- Added `get_std_posteriors` for standardized coefs in Bayesian models
- First iteration on `bayesian_cor` for Bayesian correlation tables
- Added standardized coefs computation to analyze.stanreg
- Added `refdata` for reference grid creation
- Added `rope` for region of practical equivalence
- Added `interpret_r` for correlation coefficient interpretation
- Added `bayesian_cor.test`, start to work on implementation of bayesian method for correlation
- Added `find_matching_string` for fuzzy string matching
- Added  `analyze` for psych::fa objects
### Changes
- Improvements on analyze.stanreg

# [0.2.3](https://github.com/neuropsychology/psycho.R/releases/tag/0.2.0) (2018-05-11)

### Breaking changes
- `mellenbergh.test`, `crawford.test` and `crawford.test.freq` now return a psychobject
- `assess` has been refactored to become a wrapper for `crawford.test`
- `crawford.test` now computes the Bayesian version
- `crawford.test` has been renamed to `crawford.test.freq`
### New functions / parameters
- Added `i_am_cheating` parameter to `correlation` to prevent p-hacking
- Added `percentile` and `percentile_to_z` functions
- Added `as.data.frame` method for density objects
- Added Crawford-Garthwaite (2007) Bayesian test for single-case analysis
- Added `rnorm_perfect` function
### Changes
- Improvements on analyze.stanreg
- Fixed `draws` parameter in get_predicted.stanreg
- logo

# [0.2.0](https://github.com/neuropsychology/psycho.R/releases/tag/0.2.0) (2018-05-01)

### Breaking changes
- Set default overlap parameter to TRUE in `analyze.stanreg`
- Remove support of lmerMod objects (linear mixed models must be fitted with lmerTest)
- Refactored get_predicted.stanreg
- Changed organization of `values` in analyzed models
- Added `subset` parameter in `standardize`
- Changed order of parameters in `dprime`
### New functions / parameters
- Added `print` for `n_factors`
- Added `overlap` (experimental) parameter to analyze.stanreg as a different index of effect existence
- Added `overlap` function
- Added `power_analysis` function.
- Added `analyze.lm` for lm objects.
- Added `interpret_bf` for bayes factor interpretation
- Added `probs_to_odds`
- Added confidence intervals (CI) to analyze for lmerTest models
- Refactored `odds_to_probs`
- Added ìs.mixed.stanreg`
- Added `keep_iterations` in `get_predicted.stanreg` (and demonstration of how to plot them in vignettes)
- Added `emotion` dataset
- Added get_contrasts methods for lme4 objects
- Added prior info in `analyze.stanreg`
- Added (exposed) `interpret_d_posterior` for Bayesian size effect interpretation
- Added `find_combinations` function
- Added `find_best_model` function
- Added `is.standardized` function
- Added `get_contrasts.stanreg` and `get_predicted.stanreg` functions
- Added `crawford_dissociation.test` function for single-case tests
- Externalized the "mpe" function
- Added `affective` dataset
### Changes
- Added model selection chapter in Bayesian vignettes
- Refactor the `analyze.stanreg` code
- Improved `standardize` for vectors
- Added random effects summary in `analyze.stanreg`
- Improved `mellenbergh.test`
- Improved `analyze.stanreg`
- Added new vignette for "Bayesian analyses in psychology"
- Improved `crawford.test`

# [0.1.4](https://github.com/neuropsychology/psycho.R/releases/tag/0.1.4) (2018-03-23)

### Breaking changes
### New functions / parameters
- Added R2 for bayesian regressions
- Added `dprime` function for signal detection theory indices computation
- Added `crawford.test` and `mellenbergh.test` function for single-case tests
- Added get_predicted for stanreg models
### Changes

# [0.1.0](https://github.com/neuropsychology/psycho.R/releases/tag/0.1.0) (2018-02-05)

### Breaking changes
- `normalize` has been renamed to `standardize` #30
### New functions / parameters
- Added support to lme4's merMod objects
- Added `print` output to `correlation`
- Added glasso and cor_auto estimation for `correlation` #25 #24
- added `is.psychobject` function.
### Changes
- CRAN release
- Fixed #28
- Nicer print.psychobject output #32
- Replaced NAs by empty strings in `correlation` #23

# [0.0.8](https://github.com/neuropsychology/psycho.R/releases/tag/0.0.8) (2018-01-04)

### Breaking changes
### New functions / parameters
### Major changes
### Minor changes
- Added `CONTRIBUTING.md`
- Changed `format_digit`
- Added `except` parameter to `normalize`

# 0.0.7 (2018-01-10)

### Breaking changes
### New functions / parameters
### Major changes
### Minor changes
- Changed `format_digit`
- Added `except` parameter to `normalize`

# 0.0.6 (2017-12-07)

### Breaking changes
### New functions / parameters
- `hdi`: Compute highest density intervals
- `format_string`: A tidyverse friendly version of `sprintf`
### Major changes
- Changed credible interval computation in analyze.stanreg
### Minor changes
- Use `styler`

# 0.0.4 (2017-11-15)

### Breaking changes
### New functions / parameters
- `correlation`: Plot is now supported by ggcorrplot instead of corrplot. The function behaves consistently (`plot(correlation(df)`)
### Major changes
- `correlation`: Fix p values adjustment
### Minor changes
- `analyze.stanreg`: Removed the mean and sd of the `print()`, added the MPE
- `analyze.stanreg`: Returns features of R2 for stan_lm

# 0.0.3 (2017-11-10)

### Breaking changes
### New functions / parameters
- `n_factors`: How many factors to retain for PCA or factor analysis?
### Major changes
### Minor changes

# 0.0.2 (2017-10-12)

### Breaking changes
### New functions / parameters
- analyze.merModLmerTest
- analyze.glmerMod
### Major changes
### Minor changes
- Improve testing

# [0.0.1](https://github.com/neuropsychology/psycho.R/releases/tag/0.0.1) (2017-10-06)

### Breaking changes
### New functions / parameters
### Major changes
- First CRAN release
### Minor changes


text:
Artificial Intelligence, Pacman Game (Fall 2016)
======================================

## Intro
[The Pacman Projects](http://ai.berkeley.edu/project_overview.html) by the [University of California, Berkeley](http://berkeley.edu/).

![Animated gif pacman game](http://ai.berkeley.edu/images/pacman_game.gif)

> In this project, Pacman agent will find paths through his maze world, both to reach a particular location and to collect food efficiently. Try to build general search algorithms and apply them to Pacman scenarios.

Start a game by the command:
```
$ python pacman.py
```
You can see the list of all options and their default values via:
```
$ python pacman.py -h
```

## HW1 Search
- DFS, BFS, UCS, ASTAR, ASTAR heuristic
```
$ python pacman.py -l bigMaze -z .5 -p SearchAgent -a fn=dfs
$ python pacman.py -l bigMaze -p SearchAgent -a fn=bfs -z .5
$ python pacman.py -l bigMaze -p SearchAgent -a fn=ucs
$ python pacman.py -l bigMaze -z .5 -p SearchAgent -a fn=astar,heuristic=manhattanHeuristic
```
- Corner problem, Corner heuristic
```
$ python pacman.py -l mediumCorners -p SearchAgent -a fn=bfs,prob=CornersProblem
$ python pacman.py -l mediumCorners -p AStarCornersAgent -z 0.5
```
- Eating all the dots
```
$ python pacman.py -l trickySearch -p AStarFoodSearchAgent
```

## Credits
- This is the homework project for the course Artificial Intelligence  (2019 Fall), at Emory University
- Author: Botao Li

repository: TonyStarkLi/AI-PACMAN

repo_name: TonyStarkLi/AI-PACMAN