text:
namespace rooibos
{
  class InstCodegenVisitor : public llvm::InstVisitor<InstCodegenVisitor>
  {
  public:
    InstCodegenVisitor(CodegenContext & ctx,
        std::vector<VariableDeclaratorAST::ptr> & vars,
        const std::map<llvm::BasicBlock *, int> & bbIndices,
        std::vector<StatementAST::ptr> & stmts,
        const std::vector<StatementAST::ptr> & epilogue)
    : _ctx(ctx)
    , _vars(vars)
    , _bbIndices(bbIndices)
    , _stmts(stmts)
    , _epilogue(epilogue)
    {}

    // Terminator instructions
    void visitBranchInst(llvm::BranchInst &);
    void visitReturnInst(llvm::ReturnInst &);

    // Binary instructions
    void visitBinaryOperator(llvm::BinaryOperator &);

    // Memory instructions
    void visitAllocaInst(llvm::AllocaInst &);
    void visitLoadInst(llvm::LoadInst &);
    void visitStoreInst(llvm::StoreInst &);
    void visitGetElementPtrInst(llvm::GetElementPtrInst &);

    // Other instructions
    void visitICmpInst(llvm::ICmpInst &);
    void visitSelectInst(llvm::SelectInst &);
    void visitCallInst(llvm::CallInst &);
    void visitInstruction(llvm::Instruction &); // fallback

  private:
    CodegenContext & _ctx;
    std::vector<VariableDeclaratorAST::ptr> & _vars;
    const std::map<llvm::BasicBlock *, int> & _bbIndices;
    std::vector<StatementAST::ptr> & _stmts;
    const std::vector<StatementAST::ptr> & _epilogue;

    void _emit(llvm::Instruction &, ExpressionAST::ptr);
    ExpressionAST::ptr
    _assign(llvm::Instruction &, ExpressionAST::ptr);
  };
}

#endif


text:
class CreateCategories < ActiveRecord::Migration
  def change
    create_table :categories do |t|
      t.string :name
      t.integer :item_id

      t.timestamps
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
@implementation MainUtils

+(BOOL)isPad{
    return ([UIDevice currentDevice].userInterfaceIdiom==UIUserInterfaceIdiomPad);
}

+(BOOL)isIphone5{
    if([self isPad])return NO;
    return ( [UIScreen mainScreen].bounds.size.width>=1000.0f || [UIScreen mainScreen].bounds.size.width>1000.0f);
}

@end


text:
package org.springframework.cloud.zookeeper.discovery;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cloud.zookeeper.ConditionalOnZookeeperEnabled;

/**
 * Wrapper annotation to enable Zookeeper Discovery.
 *
 * @author Marcin Grzejszczak
 * @since 1.1.0
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.TYPE, ElementType.METHOD })
@ConditionalOnZookeeperEnabled
@ConditionalOnProperty(value = ConditionalOnZookeeperDiscoveryEnabled.PROPERTY, matchIfMissing = true)
public @interface ConditionalOnZookeeperDiscoveryEnabled {
	/**
	 * Property name.
	 */
	String PROPERTY = "spring.cloud.zookeeper.discovery.enabled";
}


text:
@interface CharacterTableViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIView *containerView;
@property (weak, nonatomic) IBOutlet UIImageView *thumbNilImage;
@property (weak, nonatomic) IBOutlet UILabel *titleTxtLabel;
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *imageProgress;

@end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace SalesforceSharp.Serialization
{
    /// <summary>
    /// Only pulling properties that doesn't ignore with salesforce attribute.
    /// </summary>
    public class SalesforceContractResolver : DefaultContractResolver
    {
        private bool updateResolver;

        /// <summary>
        /// This Resolver will extract the correct salesforce FieldName/ApiName
        /// </summary>
        /// <param name="updateResolver"></param>
        public SalesforceContractResolver(bool updateResolver)
        {
            this.updateResolver = updateResolver;
        }

        /// <summary>
        /// Create a list of JsonProperties of the members in the type.
        /// </summary>
        /// <param name="type"></param>
        /// <param name="memberSerialization"></param>
        /// <returns></returns>
        protected override IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)
        {
            var properties = base.CreateProperties(type, memberSerialization);

            return properties.Where(x=> x != null).ToList();
        }

        /// <summary>
        /// Creates a <see cref="T:Newtonsoft.Json.Serialization.JsonProperty"/> for the given <see cref="T:System.Reflection.MemberInfo"/>.
        /// </summary>
        /// <param name="memberSerialization">The member's parent <see cref="T:Newtonsoft.Json.MemberSerialization"/>.</param><param name="member">The member to create a <see cref="T:Newtonsoft.Json.Serialization.JsonProperty"/> for.</param>
        /// <returns>
        /// A created <see cref="T:Newtonsoft.Json.Serialization.JsonProperty"/> for the given <see cref="T:System.Reflection.MemberInfo"/>.
        /// </returns>
        protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
        {
            var jsonProp = base.CreateProperty(member, memberSerialization);

            var sfAttrs = member.GetCustomAttributes(typeof(SalesforceAttribute), true);

            // if there are no attr then no need to process any further
            if (!sfAttrs.Any()) return jsonProp;

            var sfAttr = sfAttrs.FirstOrDefault() as SalesforceAttribute;
            // if there are no attr then no need to process any further
            if (sfAttr == null)
            {
                return jsonProp;
            }

            // if ignore then we should skip it and return null
            if (sfAttr.Ignore || (updateResolver && sfAttr.IgnoreUpdate))
            {
                return null;
            }

            // if no fieldname then we use the default
            if (string.IsNullOrEmpty(sfAttr.FieldName))
            {
                return jsonProp;
            }

            jsonProp.PropertyName = sfAttr.FieldName;

            return jsonProp;
        }
    }
}


text:
package org.nutz.weixin.spi;

import org.nutz.weixin.at.WxJsapiTicket;

public interface WxJsapiTicketStore {

	WxJsapiTicket get();

	void save(String ticket, int expires, long lastCacheTimeMillis);

}


text:
@interface LGRViewController ()
@property (nonatomic, strong) NSString *page;
@property (nonatomic, strong) NSDictionary *args;
@property (nonatomic, strong) NSDictionary *options;

@property (nonatomic, strong) NSMutableDictionary *buttons;
@end

@implementation LGRViewController

+ (NSString*)nativePage
{
	return nil;
}

- (id)initWithPage:(NSString*)page title:(NSString*)title args:(NSDictionary*)args options:(NSDictionary*)options
{
	return [self initWithPage:page title:title args:args options:options nibName:nil bundle:nil];
}

- (id)initWithPage:(NSString*)page title:(NSString*)title args:(NSDictionary*)args options:(NSDictionary*)options nibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
	self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
	if (self) {
		self.page = page;
		self.args = args;
		self.title = title;
		self.options = options;

		self.buttons = [NSMutableDictionary dictionaryWithCapacity:2];
		[self addButtons];
	}
	return self;
}

- (void)addButtons
{
	if ([self.options objectForKey:@"left"]) {
		NSDictionary *left = [self.options objectForKey:@"left"];
		UIBarButtonItem *leftButton = [self buttonFromDictionary:left];
		self.navigationItem.leftBarButtonItem = leftButton;
		self.buttons[[NSValue valueWithNonretainedObject:leftButton]] = left;
	}

	if ([self.options objectForKey:@"right"]) {
		NSDictionary *right = [self.options objectForKey:@"right"];
		UIBarButtonItem *rightButton =  [self buttonFromDictionary:right];
		self.navigationItem.rightBarButtonItem = rightButton;
		self.buttons[[NSValue valueWithNonretainedObject:rightButton]] = right;
	}
}

- (UIBarButtonItem*)buttonFromDictionary:(NSDictionary*)buttonInfo
{
	NSAssert([buttonInfo isKindOfClass:[NSDictionary class]], @"options should look as follows {'right':{'button':'done'}}");
	NSString* buttonType = [buttonInfo objectForKey:@"button"];
	UIBarButtonSystemItem buttonSystemItem = UIBarButtonSystemItemDone;

	if ([buttonType isEqualToString:@"done"]) {
		buttonSystemItem = UIBarButtonSystemItemDone;
	} else if ([buttonType isEqualToString:@"cancel"]) {
		buttonSystemItem = UIBarButtonSystemItemCancel;
	} else if ([buttonType isEqualToString:@"save"]) {
		buttonSystemItem = UIBarButtonSystemItemSave;
	} else if ([buttonType isEqualToString:@"search"]) {
		buttonSystemItem = UIBarButtonSystemItemSearch;
	}

	return [[UIBarButtonItem alloc] initWithBarButtonSystemItem:buttonSystemItem target:self action:@selector(buttonAction:)];
}

- (void)buttonAction:(id)sender
{
	NSDictionary *button = self.buttons[[NSValue valueWithNonretainedObject:sender]];
	[self buttonTapped:button];
}

- (void)buttonTapped:(NSDictionary*)button
{
	// Base method that is overwritten in LGRHTMLViewController
}

- (void)viewWillAppear:(BOOL)animated
{
	[super viewWillAppear:animated];
	[self pageWillAppear];

	LGRAppDelegate *appDelegate = (LGRAppDelegate*)[[UIApplication sharedApplication] delegate];
	NSAssert([appDelegate isKindOfClass:LGRAppDelegate.class], @"Your app delegate needs to inherit from LGRAppDelegate");
	appDelegate.topPage = self;
}

#pragma mark - API

- (void)openPage:(NSString*)page title:(NSString*)title args:(NSDictionary*)args options:(NSDictionary*)options success:(void (^)())success fail:(void (^)())fail
{
	// Internal error, we couldn't find the navigation controller or we aren't at the top of the navigation stack
	if (!self.navigationController || self.navigationController.topViewController != self) {
		fail();
		return;
	}

	UIViewController *new = [LGRPageFactory controllerForPage:page title:title args:args options:options parent:self];

	// Couldn't create a new view controller
	if (!new) {
		fail();
		return;
	}

	[self.navigationController pushViewController:new animated:YES];
	success();
}

- (void)updateParent:(NSString*)destination args:(NSDictionary*)args success:(void (^)())success fail:(void (^)())fail
{
	if ([destination isKindOfClass:NSString.class]) {
		LGRViewController *page = self.ligerParent;

		while (page) {
			if ([page.page isEqualToString:destination]) {
				[page childUpdates:args];
				success();
				return;
			}
			page = page.ligerParent;
		}
	} else {
		[self.ligerParent childUpdates:args];
		success();
		return;
	}

	fail();
}

- (void)closePage:(NSString*)rewindTo success:(void (^)())success fail:(void (^)())fail
{
	if (!self.navigationController) {
		fail();
		return;
	}

	if (rewindTo) {
		LGRViewController *page = self.ligerParent;

		while (page) {
			if ([page.page isEqualToString:rewindTo]) {
				[self.navigationController popToViewController:page animated:YES];
				success();
				return;
			}
			page = page.ligerParent;
		}
	} else {
		[self.navigationController popViewControllerAnimated:YES];
		success();
		return;
	}

	fail();
}

- (void)openDialog:(NSString *)page title:(NSString*)title args:(NSDictionary*)args options:(NSDictionary*)options success:(void (^)())success fail:(void (^)())fail
{
	UIViewController *new = [LGRPageFactory controllerForDialogPage:page title:title args:args options:options parent:self];

	// Couldn't create a new view controller, possibly a broken plugin
	if (!new) {
		fail();
		return;
	}

	[self presentViewController:new animated:YES completion:^{
		success();
	}];
}

- (void)closeDialog:(NSDictionary*)args success:(void (^)())success fail:(void (^)())fail
{
	// Internal error, we couldn't find the navigation controller
	if (!self.presentingViewController) {
		fail();
		return;
	}

	[self.presentingViewController dismissViewControllerAnimated:YES completion:^{
		// TODO is there a cleaner and more generic way to do this?
		if ([args[@"resetApp"] boolValue]) {
			UIApplication* app = [UIApplication sharedApplication];
			UIViewController *root = [app.windows[0] rootViewController];
			LGRDrawerViewController *menu = (LGRDrawerViewController*)root;
			[menu resetApp];
		} else {
			NSAssert(self.ligerParent, @"Internal close dialog error");
			[self.ligerParent dialogClosed:args];
		}
		success();
	}];
}

#pragma mark - Callbacks

- (void)dialogClosed:(NSDictionary*)args
{
}

- (void)childUpdates:(NSDictionary*)args
{
	self.args = args;
}

- (void)refreshPage:(BOOL)wasInitiatedByUser
{

}

- (void)pageWillAppear
{

}

- (void)pushNotificationTokenUpdated:(NSString*)token error:(NSError*)error
{

}

- (void)notificationArrived:(NSDictionary*)userInfo background:(BOOL)background
{

}

- (void)handleAppOpenURL:(NSURL*)url
{

}

@end


text:
/**
 * Albores, Allyssa
 * Bedio, Aiden Justin
 * Malaki, Earl Timothy
 * Paler, Timothy River
 *

 * BSCS - II | UP - Cebu
 * CMSC22 - OOP
 * Final Project
 *

 * Done:
 * - Key Listener for monster selection indicator
 * - monster selection
 * - Image or Sprite handler for background
 * - Music
 * - Animation handler for monster preview. both P1 and P2
 * - music selection
 * - game button
 *

 * To Do:
 * - Import mirrored spritesheet for mosnter and human, then modify code (.update() )
 * - Put wallpaper file
 * - Put monster selection icon files
 * - put spritesheet for monster preview
 * - finalize positioning of buttons after putting in final graphics
 * - put final choices of music (atleast 3)
 * - put final song art per music
 * - game button icon
 * - Monster Objects - backend logic for game proper    // update, nov 6. added monster implementation at monster selection
 *

 * game.Note:
 * - Monster selection icons should be of same dimensions for correct positioning
 * - Monster preview sprites should be of same dimensions for correct positioning
 */

package game;

import game.monsters.*;
import org.newdawn.slick.*;
import org.newdawn.slick.font.effects.ColorEffect;
import org.newdawn.slick.openal.Audio;
import org.newdawn.slick.openal.AudioLoader;
import org.newdawn.slick.state.BasicGameState;
import org.newdawn.slick.state.StateBasedGame;
import org.newdawn.slick.state.transition.FadeInTransition;
import org.newdawn.slick.state.transition.FadeOutTransition;
import org.newdawn.slick.util.ResourceLoader;

import java.io.File;
import java.io.IOException;

// Pick player, monster, music
public class CharacterSelectionState extends BasicGameState implements KeyListener {

    private int displayWidth = BeatBitBeatMain.getDisplayWidth();
    private int displayHeight = BeatBitBeatMain.getDisplayHeight();

    private Monster monsterP1;
    private Monster monsterP2;

    private Image[] imageBackground;
    private Animation animationHumanIndicator;        // frame to emphasize hovered human selection
    private Image[] imagesSongArt;
    private Image imageBtnGame;
    private Image imageBtnPickSong;

    private Image[] imagesHumans1x1;

    // coordinate set for of human 1x1 pics in selection screen
    private Coordinate[] coordsImagesHuman;

    private Animation[] animateMonstersP1;
    private Animation[] animateHumansP1;
    private Animation[] animateMonstersP2;
    private Animation[] animateHumansP2;

    private static Animation animateP1Monster;
    private static Animation animateP2Monster;
    private static Animation animateP1Human;
    private static Animation animateP2Human;

    // Coordinates for monster preview animations

    // coord for the monster preview animation
    private Coordinate coordP1Monster = new Coordinate((float) (displayWidth * 0.03), (float) (displayHeight * 0.20));
    private Coordinate coordP2Monster = new Coordinate((float) (displayWidth - 600), (float) (displayHeight * 0.20));

    // coord for the human preview animation
    private Coordinate coordP1Human = new Coordinate((float) (displayWidth * 0.05), 360f);
    private Coordinate coordP2Human = new Coordinate((float) (displayWidth - 250), 360f);

    private Coordinate coordHumanIndicator;
    private Coordinate coordImageSongArt;
    private Coordinate coordBtnGame;

    private int indexXHumanIndicator = 1;
    private int indexYHumanIndicator = 0;
    private Audio soundPressArrows;
    private Audio soundPressEnter;
    private Music[] musicSongChoices;
    private File[] fileSongBeatMaps;

    private int caseMonsterAnimation = 2;       // index holder for monster preview animation
    private int indexImageSongArt;          // index holder for song art

    // Flags
    private static boolean pressedEnter = false;
    private static boolean monsterPicking = true;
    private static boolean songPicking = false;
    private static boolean p1Picking = true;
    private static boolean p2Picking = false;

    private boolean pressedEscape = false;

    private UnicodeFont fontHeader;
    private String textPlayer1 = "PLAYER 1";
    private String textPlayer2 = "PLAYER 2";
    private String textPickASong = "PICK A SONG";
    private String textGame = "GAME";

    public int getID() {
        return BeatBitBeatMain.getCharacterSelection();
    }

    public void init(GameContainer gc, StateBasedGame sbg) throws SlickException {

        initializeFonts();
        initializeImagesAndAnimations();
        initializeAudioAndMusic();

        coordsImagesHuman = new Coordinate[]{
                new Coordinate(406, 108),
                new Coordinate(566, 108),
                new Coordinate(726, 108),
                new Coordinate(406, 266),
                new Coordinate(566, 266),
                new Coordinate(726, 266)
        };
        coordHumanIndicator = coordsImagesHuman[1];
        coordBtnGame = new Coordinate((displayWidth / 2) - (imageBtnGame.getWidth() / 2), displayHeight - 200);

        coordImageSongArt = new Coordinate((391), 440);
    }

    int delta;  // for printing. temporary
    float xMouse;
    float yMouse;

    public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException {

        this.delta = delta;  // for printing. temporary
        Input input = gc.getInput();
        xMouse = input.getMouseX();
        yMouse = input.getMouseY();

        // cancel/redo selection
        // reset selections
        // go back to main menu
        if (pressedEscape) {
            backToMainMenu(sbg);
        }

        updateCoordHumanIndicator();

        if (monsterPicking) {
            pickMonster();
        } else if (songPicking) {
            pickSong();
        } else {    // if done picking monsters and song
            if (pressedEnter) {     // game button pressed
                proceedToGameProper(sbg);
            }

        }

    }

    public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException {

        if (p1Picking) {
            imageBackground[0].draw();
        } else {
            imageBackground[1].draw();
        }

        if (monsterPicking) {
            renderMonsterPicking();
        } else if (songPicking) {
            renderSongPicking();
        } else {   // character and music picking is done
            renderDonePickingBoth();
        }

//        g.drawString("DELTA = " + delta, 10, 30);
//        g.drawString("X = " + xMouse + " Y = " + yMouse, 10, 50);
    }

    @Override
    public void keyPressed(int key, char pressedKey) {
        BeatBitBeatMain.playKeySFX(key);

        if (monsterPicking) {
            if (key == Input.KEY_UP) {
                if (indexYHumanIndicator != 0) {
                    indexYHumanIndicator--;
                }
            } else if (key == Input.KEY_DOWN) {
                if (indexYHumanIndicator != 1) {
                    indexYHumanIndicator++;
                }
            } else if (key == Input.KEY_LEFT) {
                if (indexXHumanIndicator != 0) {
                    indexXHumanIndicator--;
                }
            } else if (key == Input.KEY_RIGHT) {
                if (indexXHumanIndicator != 2) {
                    indexXHumanIndicator++;
                }
            } else if (key == Input.KEY_ENTER) {

                // disable bottom left(monster 4) and bottom right monsters(monster 6)
                // for coming soon characters
                if (!((indexXHumanIndicator == 0 && indexYHumanIndicator == 1) ||  // monster bottom left
                        (indexXHumanIndicator == 2 && indexYHumanIndicator == 1)))   // monster bottom right
//                        (indexXHumanIndicator == 2 && indexYHumanIndicator == 0) || //  monster upper right
//                        (indexXHumanIndicator == 1 && indexYHumanIndicator == 1)))  // monster lower center
                {
                    pressedEnter = true;
                }
            }
        } else if (songPicking) {
            if (key == Input.KEY_LEFT) {
                if (indexImageSongArt != 0) {
                    indexImageSongArt--;
                }
            } else if (key == Input.KEY_RIGHT) {
                if (indexImageSongArt != imagesSongArt.length - 1) {
                    indexImageSongArt++;
                }
            } else if (key == Input.KEY_ENTER) {
                pressedEnter = true;
            }

        } else {
            if (key == Input.KEY_ENTER) {
                pressedEnter = true;
            }
        }

        if (key == Input.KEY_ESCAPE) {
            pressedEscape = true;
        }

    }

    @Override
    public void keyReleased(int key, char pressedKey) {

    }

    public static void resetCharSelStateFlags() {
        pressedEnter = false;
        monsterPicking = true;
        songPicking = false;
        p1Picking = true;
        p2Picking = false;
    }

    private void initializeFonts() throws SlickException {
        fontHeader = new UnicodeFont("Assets/Fonts/Disposable Droid/DisposableDroidBB.ttf", 50, false, false);
        fontHeader.getEffects().add(new ColorEffect(java.awt.Color.white));
        fontHeader.addAsciiGlyphs();
        fontHeader.loadGlyphs();
    }

    private void initializeImagesAndAnimations() throws SlickException {
        imageBackground = new Image[] {
                new Image("Assets/Graphics/Character Selection/Character Selection BG P1.png"),
                new Image("Assets/Graphics/Character Selection/Character Selection BG P2.png"),
        };

        // TODO Replace correct file names, Width & Height, adjust duration
        animateMonstersP1 = new Animation[]{
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Blueffy/Blueffy - Idle P1.png", 600, 300, 0), Monster1.getFrameDurationMonsterIdle()),
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Ghost/Ghost - Idle P1.png", 600, 300, 0), Monster2.getFrameDurationMonsterIdle()),
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Flame/Flame - Idle P1.png", 600, 300, 0), Monster3.getFrameDurationMonsterIdle()),
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Monster 6/Monster 6 - Idle P1.png", 600, 300, 0), 250),        // coming soon
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Root/Root - Idle P1.png", 600, 300, 0), 250),
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Monster 6/Monster 6 - Idle P1.png", 600, 300, 0), 250)         // coming soon
        };

        animateMonstersP2 = new Animation[]{
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Blueffy/Blueffy - Idle P2.png", 600, 300, 0), Monster1.getFrameDurationMonsterIdle()),
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Ghost/Ghost - Idle P2.png", 600, 300, 0), Monster2.getFrameDurationMonsterIdle()),
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Flame/Flame - Idle P2.png", 600, 300, 0), Monster3.getFrameDurationMonsterIdle()),
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Monster 6/Monster 6 - Idle P2.png", 600, 300, 0), 250),        // coming soon
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Root/Root - Idle P2.png", 600, 300, 0), 250),
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Monster 6/Monster 6 - Idle P2.png", 600, 300, 0), 250)         // coming soon
        };

        // TODO Randomize players 1, 2, 3, 5 for  player 6
        animateHumansP1 = new Animation[]{
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Blueffy/Blueffy - Human P1.png", 150, 150, 0), Monster1.getFrameDurationHumanIdle()),
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Ghost/Ghost - Human P1.png", 150, 150, 0), Monster2.getFrameDurationHumanIdle()),
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Flame/Flame - Human P1.png", 150, 150, 0), Monster3.getFrameDurationHumanIdle()),
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Monster 4/Monster 4 - Human P1.png", 150, 150, 0), 300),       // coming soon
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Root/Root - Human P1.png", 150, 150, 0), 300),
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Monster 6/Monster 6 - Human P1.png", 150, 150, 0), 300)        // coming soon
        };

        animateHumansP2 = new Animation[]{
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Blueffy/Blueffy - Human P2.png", 150, 150, 0), Monster1.getFrameDurationHumanIdle()),
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Ghost/Ghost - Human P2.png", 150, 150, 0), Monster2.getFrameDurationHumanIdle()),
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Flame/Flame - Human P2.png", 150, 150, 0), Monster3.getFrameDurationHumanIdle()    ),
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Monster 4/Monster 4 - Human P2.png", 150, 150, 0), 300),       // coming soon
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Root/Root - Human P2.png", 150, 150, 0), 300),
                new Animation(new SpriteSheet("Assets/Graphics/Monster and Human Sprites/Monster 6/Monster 6 - Human P2.png", 150, 150, 0), 300)        // coming soon
        };

        // TODO Replace with correct files and names
        imagesHumans1x1 = new Image[]{
                new Image("Assets/Graphics/Character Selection/Human Pic 1x1/Human Pic 1.png"),
                new Image("Assets/Graphics/Character Selection/Human Pic 1x1/Human Pic 2.png"),
                new Image("Assets/Graphics/Character Selection/Human Pic 1x1/Human Pic 3.png"),
                new Image("Assets/Graphics/Character Selection/Human Pic 1x1/Human Pic 4.png"),
                new Image("Assets/Graphics/Character Selection/Human Pic 1x1/Human Pic 5.png"),
                new Image("Assets/Graphics/Character Selection/Human Pic 1x1/Human Pic 6.png")
        };

        // TODO Replace with correct files and names
        animationHumanIndicator = new Animation(new SpriteSheet("Assets/Graphics/Character Selection/Indicator.png", 150, 150, 0), 100);

        imageBtnGame = new Image("Assets/Graphics/Character Selection/Play Button.png");
        imageBtnPickSong = new Image("Assets/Graphics/Character Selection/Choose Song Button.png");

        // TODO Replace with correct music files and names
        // Image array to hold song arts. Order must be in sync with Audio array
        indexImageSongArt = 0;
        imagesSongArt = new Image[]{
                new Image("Songs/Rage Against The Machine/Killing In The Name/Song Art.png"),
                new Image("Songs/Metallica/Master Of Puppets/Song Art.png"),

                new Image("Songs/Sandwich/Sugod/Song Art.png"),
                new Image("Songs/Nirvana/Smells Like Teen Spirit/Song Art.png"),
                new Image("Songs/Animals As Leaders/The Brain Dance/Song Art.png"),
                new Image("Songs/Motorhead/Enter Sandman/Song Art.png"),
        };
    }

    private void initializeAudioAndMusic() throws SlickException {
        try {
            // TODO Replace with correct files
            soundPressArrows = AudioLoader.getAudio("OGG", ResourceLoader.getResourceAsStream("Assets/Sound Effects/pressArrowMainMenu.ogg"));
            soundPressEnter = AudioLoader.getAudio("OGG", ResourceLoader.getResourceAsStream("Assets/Sound Effects/pressEnterMainMenu.ogg"));

            // TODO Replace with correct files and names
            // Audio array to songs. Order must be in sync with song art Image array
            musicSongChoices = new Music[]{
                    new Music("Songs/Rage Against The Machine/Killing In The Name/Song.ogg"),
                    new Music("Songs/Metallica/Master Of Puppets/Song.ogg"),

                    new Music("Songs/Sandwich/Sugod/Song.ogg"),
                    new Music("Songs/Nirvana/Smells Like Teen Spirit/Song.ogg"),
                    new Music("Songs/Animals As Leaders/The Brain Dance/Song.ogg"),
                    new Music("Songs/Motorhead/Enter Sandman/Song.ogg"),
            };

            fileSongBeatMaps = new File[]{
                    new File("Songs/Rage Against The Machine/Killing In The Name/Beat Map.txt"),
                    new File("Songs/Metallica/Master Of Puppets/Beat Map.txt"),

                    new File("Songs/Sandwich/Sugod/Beat Map.txt"),
                    new File("Songs/Nirvana/Smells Like Teen Spirit/Beat Map.txt"),
                    new File("Songs/Animals As Leaders/The Brain Dance/Beat Map.txt"),
                    new File("Songs/Motorhead/Enter Sandman/Beat Map.txt"),
            };

        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private void backToMainMenu(StateBasedGame sbg) {
        pressedEscape = false;

        caseMonsterAnimation = 2;
        pressedEnter = false;
        monsterPicking = true;
        songPicking = false;
        p1Picking = true;
        p2Picking = false;

        for (Music music : musicSongChoices) {
            if (music.playing()) {
                music.stop();
            }
        }

        MainMenuState.resumeMusic();
        sbg.enterState(BeatBitBeatMain.getMainMenu(), new FadeOutTransition(), new FadeInTransition());
    }

    private void updateCoordHumanIndicator() {
        if (indexXHumanIndicator == 0 && indexYHumanIndicator == 0) {
            coordHumanIndicator = coordsImagesHuman[0];
        } else if (indexXHumanIndicator == 1 && indexYHumanIndicator == 0) {
            coordHumanIndicator = coordsImagesHuman[1];
        } else if (indexXHumanIndicator == 2 && indexYHumanIndicator == 0) {
            coordHumanIndicator = coordsImagesHuman[2];
        } else if (indexXHumanIndicator == 0 && indexYHumanIndicator == 1) {
            coordHumanIndicator = coordsImagesHuman[3];
        } else if (indexXHumanIndicator == 1 && indexYHumanIndicator == 1) {
            coordHumanIndicator = coordsImagesHuman[4];
        } else if (indexXHumanIndicator == 2 && indexYHumanIndicator == 1) {
            coordHumanIndicator = coordsImagesHuman[5];
        }
    }

    private void pickMonster() throws SlickException {
        for (int i = 0; i < coordsImagesHuman.length; i++) {
            if (coordHumanIndicator.equalTo(coordsImagesHuman[i])) {
                caseMonsterAnimation = i + 1;       // index for casemonster starts at 1
            }
        }

        if (p1Picking) {    // if player 1's turn to pick
            if (pressedEnter) {
                animateP1Monster = animateMonstersP1[caseMonsterAnimation - 1];
                animateP1Human = animateHumansP1[caseMonsterAnimation - 1];

                monsterP1 = instantiateMonster(1);

                pressedEnter = false;
                p1Picking = false;
                p2Picking = true;       // p2's turn to pick
            }
        } else if (p2Picking) {    // if player 2's turn to pick

            if (pressedEnter) {

                animateP2Monster = animateMonstersP2[caseMonsterAnimation - 1];
                animateP2Human = animateHumansP2[caseMonsterAnimation - 1];

                monsterP2 = instantiateMonster(2);

                pressedEnter = false;
                monsterPicking = false;
                p1Picking = false;
                p2Picking = false;
                songPicking = true;     // pick a song
            }

        }   // EO (p2Picking)
    }

    private Monster instantiateMonster(int playerNumber) throws SlickException {
        Monster monster = null;
        if (caseMonsterAnimation == 1) {
            try {
                monster = new Monster1(playerNumber);
            } catch (IOException e) {
                e.printStackTrace();
            }
        } else if (caseMonsterAnimation == 2) {
            monster = new Monster2(playerNumber);
        } else if (caseMonsterAnimation == 3) {
            monster = new Monster3(playerNumber);
        } else if (caseMonsterAnimation == 4) {
            monster = new Monster4(playerNumber);
        } else if (caseMonsterAnimation == 5) {
            monster = new Monster5(playerNumber);
        } else if (caseMonsterAnimation == 6) {
            monster = new Monster6(playerNumber);
        }
        return monster;
    }

    private void pickSong() {
        // Play Audio according to selection scanning
        for (int i = 0; i < musicSongChoices.length; i++) {
            if (!musicSongChoices[indexImageSongArt].playing()) {
                musicSongChoices[indexImageSongArt].play();
            }
        }

        if (pressedEnter) {     // song selected
            pressedEnter = false;
            songPicking = false;
            for (int i = 0; i < musicSongChoices.length; i++) {
                if (musicSongChoices[i].playing()) {
                    GameProperState.setGameMusic(musicSongChoices[i]);      // save selected song for GameProperState usage
                    GameProperState.setBeatMap(fileSongBeatMaps[i]);
                }
            }
        }
    }

    private void proceedToGameProper(StateBasedGame sbg) {
        // stop playing preview of songs
        for (int i = 0; i < musicSongChoices.length; i++) {
            musicSongChoices[i].stop();
        }

                GameProperState.setMonsterP1(monsterP1);
                GameProperState.setMonsterP2(monsterP2);
                // TODO low prio. 3..2..1.. Countdown at GameProperState before music starts
                sbg.enterState(BeatBitBeatMain.getVersusPreview(), new FadeOutTransition(), new FadeInTransition());

            }

    private void renderMonsterPicking() {
        // render human selection icons
        for (int i = 0; i < imagesHumans1x1.length; i++) {
            imagesHumans1x1[i].draw(coordsImagesHuman[i].getX(), coordsImagesHuman[i].getY());
        }

        animationHumanIndicator.draw(coordHumanIndicator.getX(), coordHumanIndicator.getY());
        imagesSongArt[indexImageSongArt].draw(coordImageSongArt.getX(), coordImageSongArt.getY(), Color.darkGray);
        imageBtnGame.draw(((displayWidth / 2) - (imageBtnGame.getWidth() / 2)), (displayHeight - imageBtnGame.getHeight() - 50), Color.darkGray);

        if (p1Picking) {
            fontHeader.drawString((displayWidth / 2) - (textPlayer1.length() * 20) / 2, 50, textPlayer1);

            animateMonstersP1[caseMonsterAnimation - 1].draw(coordP1Monster.getX(), coordP1Monster.getY());
            animateHumansP1[caseMonsterAnimation - 1].draw(coordP1Human.getX(), coordP1Human.getY());

        } else if (p2Picking) {
            fontHeader.drawString((displayWidth / 2) - (textPlayer2.length() * 20) / 2, 50, textPlayer2);

            animateMonstersP2[caseMonsterAnimation - 1].draw(coordP2Monster.getX(), coordP2Monster.getY());
            animateHumansP2[caseMonsterAnimation - 1].draw(coordP2Human.getX(), coordP2Human.getY());

            animateP1Monster.draw(coordP1Monster.getX(), coordP1Monster.getY());        // draw preview P1's selected monster
            animateP1Human.draw(coordP1Human.getX(), coordP1Human.getY());

        }
    }

    private void renderSongPicking() {
        fontHeader.drawString((displayWidth / 2) - (textPickASong.length() * 20) / 2, 50, textPickASong);

        // render human selection icons
        for (int i = 0; i < imagesHumans1x1.length; i++) {
            imagesHumans1x1[i].draw(coordsImagesHuman[i].getX(), coordsImagesHuman[i].getY(), Color.darkGray);
        }

        animateP1Monster.draw(coordP1Monster.getX(), coordP1Monster.getY());
        animateP1Human.draw(coordP1Human.getX(), coordP1Human.getY());

        animateP2Monster.draw(coordP2Monster.getX(), coordP2Monster.getY());
        animateP2Human.draw(coordP2Human.getX(), coordP2Human.getY());

        // draw song art of the song being hovered at
        imagesSongArt[indexImageSongArt].draw(coordImageSongArt.getX(), coordImageSongArt.getY());
//            imageBtnPickSong.draw( ((displayWidth / 2) - (imageBtnPickSong.getWidth() / 2)), (displayHeight - imageBtnPickSong.getHeight() - 50));
        imageBtnGame.draw(((displayWidth / 2) - (imageBtnGame.getWidth() / 2)), (displayHeight - imageBtnGame.getHeight() - 50), Color.darkGray);
    }

    private void renderDonePickingBoth() {
        fontHeader.drawString((displayWidth / 2) - (textGame.length() * 20) / 2, 50, textGame);

        // render human selection icons
        for (int i = 0; i < imagesHumans1x1.length; i++) {
            imagesHumans1x1[i].draw(coordsImagesHuman[i].getX(), coordsImagesHuman[i].getY(), Color.darkGray);
        }

        animateP1Monster.draw(coordP1Monster.getX(), coordP1Monster.getY());
        animateP1Human.draw(coordP1Human.getX(), coordP1Human.getY());
        animateP2Monster.draw(coordP2Monster.getX(), coordP2Monster.getY());
        animateP2Human.draw(coordP2Human.getX(), coordP2Human.getY());

        imagesSongArt[indexImageSongArt].draw(coordImageSongArt.getX(), coordImageSongArt.getY());
        imageBtnGame.draw(((displayWidth / 2) - (imageBtnGame.getWidth() / 2)), (displayHeight - imageBtnGame.getHeight() - 50));
    }

}


text:
\hypertarget{btcpmux_8h}{}\section{src/transports/tcpmux/btcpmux.h File Reference}
\label{btcpmux_8h}\index{src/transports/tcpmux/btcpmux.\+h@{src/transports/tcpmux/btcpmux.\+h}}
{\ttfamily \#include \char`\"{}../../transport.\+h\char`\"{}}\\*
Include dependency graph for btcpmux.\+h\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{btcpmux_8h__incl}
\end{center}
\end{figure}
This graph shows which files directly or indirectly include this file\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=322pt]{btcpmux_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item
int \hyperlink{btcpmux_8h_a755c97b32308dd6a6b1619788bb96f42}{nn\+\_\+btcpmux\+\_\+create} (void $\ast$hint, struct \hyperlink{structnn__epbase}{nn\+\_\+epbase} $\ast$$\ast$epbase)
\end{DoxyCompactItemize}

\subsection{Function Documentation}
\index{btcpmux.\+h@{btcpmux.\+h}!nn\+\_\+btcpmux\+\_\+create@{nn\+\_\+btcpmux\+\_\+create}}
\index{nn\+\_\+btcpmux\+\_\+create@{nn\+\_\+btcpmux\+\_\+create}!btcpmux.\+h@{btcpmux.\+h}}
\subsubsection[{nn\+\_\+btcpmux\+\_\+create(void $\ast$hint, struct nn\+\_\+epbase $\ast$$\ast$epbase)}]{\setlength{\rightskip}{0pt plus 5cm}int nn\+\_\+btcpmux\+\_\+create (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{hint, }
\item[{struct {\bf nn\+\_\+epbase} $\ast$$\ast$}]{epbase}
\end{DoxyParamCaption}
)}\hypertarget{btcpmux_8h_a755c97b32308dd6a6b1619788bb96f42}{}\label{btcpmux_8h_a755c97b32308dd6a6b1619788bb96f42}


text:
const message = (bodyText, titleText) => {
  const display = document.querySelector('#message');
  const title = document.querySelector('#message h3.title');
  const body = document.querySelector('#message p.body');
  const closeButton = document.querySelector('#close');

  title.innerHTML = titleText;
  body.innerHTML = bodyText;
  display.setAttribute('class', 'show');

  closeButton.addEventListener('click', function close() {
    title.innerHTML = '';
    body.innerHTML = '';
    display.removeAttribute('class');
    closeButton.removeEventListener('click', close);
  });
};

module.exports = {
  message,
};


text:
module PaginatingFind
  module Helpers
    DEFAULT_OPTIONS = { :name => :page, :window_size => 2,
      :always_show_anchors => true, :link_to_current_page => false,
      :params => {} }

    def paginating_links(paginator, options = {}, html_options = {})
      name = options[:name] || DEFAULT_OPTIONS[:name]
      params = (options[:params] || DEFAULT_OPTIONS[:params]).clone

      paginating_links_each(paginator, options) do |n|
        params[name] = n
        link_to(n, params, html_options)
      end
    end

    def paginating_links_each(paginator, options = {})
      options = DEFAULT_OPTIONS.merge(options)

      window = ((paginator.page - options[:window_size] + 1)..(paginator.page + options[:window_size] - 1)).select {|w| w >= paginator.first_page && w <= paginator.last_page }

      html = ''

      if options[:always_show_anchors] && !window.include?(paginator.first_page)
        html << yield(paginator.first_page)
        html << ' ... ' unless window.first - 1 == paginator.first_page
        html << ' '
      end

      window.each do |p|
        if paginator.page == p && !options[:link_to_current_page]
          html << p.to_s
        else
          html << yield(p)
        end
        html << ' '
      end

      if options[:always_show_anchors] && !window.include?(paginator.last_page)
        html << ' ... ' unless window.last + 1 == paginator.last_page
        html << yield(paginator.last_page)
      end

      html
    end
  end
end


text:
/*
 *  Demonstrate double-to-integer casting issues present on some (broken)
 *  exotic ARM platforms.  This is not a Duktape bug as such, because the
 *  underlying cause is broken double casts.  For example:
 *
 *    double d = (double) 0xdeadbeefUL;
 *    unsigned int i = (unsigned int) d;
 *
 *  Instead of the above 'i' being 0xdeadbeefUL, 'i' becomes 0x7fffffffUL
 *  on this particular platform.  This also shows up in the test below.
 *
 *  This testcase demonstrates the issue if present, so that it's possible
 *  to see if it has been fixed.
 *
 *  https://github.com/svaarala/duktape/issues/336
 */

/*@include util-buffer.js@*/

/*---
{
    "custom": true
}
---*/

/*===
|414243deadbeef48|
|4142437fedcba948|
===*/

function test() {
    var b;

    // Here 0xdeadbeef incorrectly casts to 0x7fffffff on the exotic target.
    b = new Buffer('ABCDEFGH');
    b.writeUInt32BE(0xdeadbeef, 3);
    print(Duktape.enc('jx', createPlainBuffer(b)));

    // But 0x7fedcba9 works correctly.
    b = new Buffer('ABCDEFGH');
    b.writeUInt32BE(0x7fedcba9, 3);
    print(Duktape.enc('jx', createPlainBuffer(b)));
}

try {
    test();
} catch (e) {
    print(e.stack || e);
}


text:
<?php

// Exit if accessed directly
if( !defined( 'ABSPATH' ) ) {
	exit;
}

?>
<form method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">
	<input type="text" class="field" name="s" id="s" placeholder="<?php esc_attr_e( 'search here …', 'responsive' ); ?>"/>
	<input type="submit" class="submit" name="submit" id="searchsubmit" value="<?php esc_attr_e( 'Go', 'responsive' ); ?>"/>
</form>


text:
package main

import (
	"flag"
	"fmt"
	"github.com/alouca/gosnmp"
	mp "github.com/mackerelio/go-mackerel-plugin"
	"log"
	"os"
	"strconv"
	"strings"
)

type SNMPMetrics struct {
	OID     string
	Metrics mp.Metrics
}

type SNMPPlugin struct {
	GraphName        string
	GraphUnit        string
	Host             string
	Community        string
	Tempfile         string
	SNMPMetricsSlice []SNMPMetrics
}

func (m SNMPPlugin) FetchMetrics() (map[string]float64, error) {
	stat := make(map[string]float64)

	s, err := gosnmp.NewGoSNMP(m.Host, m.Community, gosnmp.Version2c, 30)
	if err != nil {
		return nil, err
	}

	for _, sm := range m.SNMPMetricsSlice {
		resp, err := s.Get(sm.OID)
		if err != nil {
			log.Println("SNMP get failed: ", err)
			continue
		}

		ret, err := strconv.ParseFloat(fmt.Sprint(resp.Variables[0].Value), 64)
		if err != nil {
			log.Println(err)
			continue
		}

		stat[sm.Metrics.Name] = ret
	}

	return stat, err
}

func (m SNMPPlugin) GraphDefinition() map[string](mp.Graphs) {
	metrics := []mp.Metrics{}
	for _, sm := range m.SNMPMetricsSlice {
		metrics = append(metrics, sm.Metrics)
	}

	return map[string](mp.Graphs){
		m.GraphName: mp.Graphs{
			Label:   m.GraphName,
			Unit:    m.GraphUnit,
			Metrics: metrics,
		},
	}
}

func main() {
	optGraphName := flag.String("name", "snmp", "Graph name")
	optGraphUnit := flag.String("unit", "float", "Graph unit")

	optHost := flag.String("host", "localhost", "Hostname")
	optCommunity := flag.String("community", "public", "SNMP V2c Community")

	optTempfile := flag.String("tempfile", "", "Temp file name")
	flag.Parse()

	var snmp SNMPPlugin
	snmp.Host = *optHost
	snmp.Community = *optCommunity
	snmp.GraphName = *optGraphName
	snmp.GraphUnit = *optGraphUnit

	sms := []SNMPMetrics{}
	for _, arg := range flag.Args() {
		vals := strings.Split(arg, ":")
		if len(vals) < 2 {
			continue
		}

		mpm := mp.Metrics{Name: vals[1], Label: vals[1]}
		if len(vals) >= 3 {
			mpm.Diff, _ = strconv.ParseBool(vals[2])
		}
		if len(vals) >= 4 {
			mpm.Stacked, _ = strconv.ParseBool(vals[3])
		}

		sms = append(sms, SNMPMetrics{OID: vals[0], Metrics: mpm})
	}
	snmp.SNMPMetricsSlice = sms

	helper := mp.NewMackerelPlugin(snmp)

	if *optTempfile != "" {
		helper.Tempfile = *optTempfile
	} else {
		helper.Tempfile = fmt.Sprintf("/tmp/mackerel-plugin-snmp-%s-%s", *optHost, *optGraphName)
	}

	if os.Getenv("MACKEREL_AGENT_PLUGIN_META") != "" {
		helper.OutputDefinitions()
	} else {
		helper.OutputValues()
	}
}


text:
A fast gitignore matching library for Go.

This library use simple tree index for matching, so keep fast if gitignore file has many pattern.

## Usage

```go
gitignore, _ := gitignore.NewGitIgnore("/path/to/gitignore")

path := "/path/to/file"
isDir := false
gitignore.Match(path, isDir)
```

### Specify base directory

go-gitignore treat `path` as a base directory.
If you want to specify other base (e.g. current directory and Global gitignore), you can like the following.

```go
gitignore, _ := gitignore.NewGitIgnore("/home/you/.gitignore", ".")
```

### From io.Reader

go-gitignore can initialize from io.Reader.

```go
gitignore, _ := gitignore.NewGitIgnoreFromReader(base, reader)
```

## Simple tree index

go-gitignore parse gitignore file, and generate a simple tree index for matching like the following.

```
.
├── accept
│   ├── absolute
│   │   └── depth
│   │       ├── initial
│   │       └── other
│   └── relative
│       └── depth
│           ├── initial
│           └── other
└── ignore
    ├── absolute
    │   └── depth
    │       ├── initial
    │       └── other
    └── relative
        └── depth
            ├── initial
            └── other
```

## Features

- Support absolute path (/path/to/ignore)
- Support relative path (path/to/ignore)
- Support accept pattern (!path/to/accept)
- Support directory pattern (path/to/directory/)
- Support glob pattern (path/to/\*.txt)

*note: glob pattern*

go-gitignore use [filepath.Match](https://golang.org/pkg/path/filepath/#Match) for matching meta char pattern, so not support recursive pattern (path/`**`/file).

## Installation

```sh
$ go get github.com/monochromegane/go-gitignore
```

## Contribution

1. Fork it
2. Create a feature branch
3. Commit your changes
4. Rebase your local changes against the master branch
5. Run test suite with the `go test ./...` command and confirm that it passes
6. Run `gofmt -s`
7. Create new Pull Request

## License

[MIT](https://github.com/monochromegane/go-gitignore/blob/master/LICENSE)

## Author

[monochromegane](https://github.com/monochromegane)


text:
(function(window) {

    'use strict';

    /**
     * Extend Object helper function.
     */
    function extend(a, b) {
        for (var key in b) {
            if (b.hasOwnProperty(key)) {
                a[key] = b[key];
            }
        }
        return a;
    }

    /**
     * Each helper function.
     */
    function each(collection, callback) {
        for (var i = 0; i < collection.length; i++) {
            var item = collection[i];
            callback(item);
        }
    }

    /**
     * Menu Constructor.
     */
    function Menu(options) {
        this.options = extend({}, this.options);
        extend(this.options, options);
        this._init();
    }

    /**
     * Menu Options.
     */
    Menu.prototype.options = {
        wrapper: '#o-wrapper', // The content wrapper
        type: 'slide-left', // The menu type
        menuOpenerClass: '.starter-kit-button', // The menu opener class names (i.e. the buttons)
        maskId: '#starter-kit-mask' // The ID of the mask
    };

    /**
     * Initialise Menu.
     */
    Menu.prototype._init = function() {
        this.body = document.body;
        this.wrapper = document.querySelector(this.options.wrapper);
        this.mask = document.querySelector(this.options.maskId);
        this.menu = document.querySelector('#starter-kit-menu--' + this.options.type);
        // this.closeBtn = this.menu.querySelector('.starter-kit-menu__close');
        this.menuOpeners = document.querySelectorAll(this.options.menuOpenerClass);
        this._initEvents();
    };

    /**
     * Initialise Menu Events.
     */
    Menu.prototype._initEvents = function() {
        // Event for clicks on the close button inside the menu.
        // this.closeBtn.addEventListener('click', function(e) {
        //     e.preventDefault();
        //     this.close();
        // }.bind(this));

        // Event for clicks on the mask.
        this.mask.addEventListener('click', function(e) {
            e.preventDefault();
            this.close();
        }.bind(this));
    };

    /**
     * Open Menu.
     */
    Menu.prototype.open = function() {
        this.body.classList.add('has-active-menu');
        this.wrapper.classList.add('has-' + this.options.type);
        this.menu.classList.add('is-active');
        this.mask.classList.add('is-active');
        this.disableMenuOpeners();
    };

    /**
     * Close Menu.
     */
    Menu.prototype.close = function() {
        this.body.classList.remove('has-active-menu');
        this.wrapper.classList.remove('has-' + this.options.type);
        this.menu.classList.remove('is-active');
        this.mask.classList.remove('is-active');
        this.enableMenuOpeners();
    };

    /**
     * Disable Menu Openers.
     */
    Menu.prototype.disableMenuOpeners = function() {
        each(this.menuOpeners, function(item) {
            item.disabled = true;
        });
    };

    /**
     * Enable Menu Openers.
     */
    Menu.prototype.enableMenuOpeners = function() {
        each(this.menuOpeners, function(item) {
            item.disabled = false;
        });
    };

    /**
     * Add to global namespace.
     */
    window.Menu = Menu;

})(window);


text:
<?php namespace Backend\FormWidgets;

use Event;
use Request;
use Backend\Classes\FormWidgetBase;

/**
 * Rich Editor
 * Renders a rich content editor field.
 *
 * @package october\backend
 * @author Alexey Bobkov, Samuel Georges
 */
class RichEditor extends FormWidgetBase
{
    //
    // Configurable properties
    //

    /**
     * @var boolean Determines whether content has HEAD and HTML tags.
     */
    public $fullPage = false;

    //
    // Object properties
    //

    /**
     * {@inheritDoc}
     */
    protected $defaultAlias = 'richeditor';

    /**
     * {@inheritDoc}
     */
    public function init()
    {
        $this->fillFromConfig([
            'fullPage',
        ]);
    }

    /**
     * {@inheritDoc}
     */
    public function render()
    {
        $this->prepareVars();
        return $this->makePartial('richeditor');
    }

    /**
     * Prepares the list data
     */
    public function prepareVars()
    {
        $this->vars['fullPage'] = $this->fullPage;
        $this->vars['stretch'] = $this->formField->stretch;
        $this->vars['size'] = $this->formField->size;
        $this->vars['name'] = $this->formField->getName();
        $this->vars['value'] = $this->getLoadValue();
    }

    /**
     * Returns a single collection of available page links.
     * This implementation has room to place links under
     * different groups based on the link type.
     * @return array
     */
    public function onGetPageLinks()
    {
        $links = [];
        $types = $this->getPageLinkTypes();

        $links[] = ['name' => 'Select a page...', 'url' => false];

        $iterator = function($links, $level = 0) use (&$iterator) {
            $result = [];
            foreach ($links as $linkUrl => $link) {

                /*
                 * Remove scheme and host from URL
                 */
                $baseUrl = Request::getSchemeAndHttpHost();
                if (strpos($linkUrl, $baseUrl) === 0) {
                    $linkUrl = substr($linkUrl, strlen($baseUrl));
                }

                $linkName = str_repeat(' ', $level * 4);
                $linkName .= is_array($link) ? array_get($link, 'title', '') : $link;
                $result[] = ['name' => $linkName, 'url' => $linkUrl];

                if (is_array($link)) {
                    $result = array_merge(
                        $result,
                        $iterator(array_get($link, 'links', []), $level + 1)
                    );
                }
            }

            return $result;
        };

        foreach ($types as $typeCode => $typeName) {
            $links = array_merge($links, $iterator($this->getPageLinks($typeCode)));
        }

        return ['links' => $links];
    }

    /**
     * {@inheritDoc}
     */
    protected function loadAssets()
    {
        $this->addCss('css/richeditor.css', 'core');
        $this->addJs('js/build-min.js', 'core');
    }

    /**
     * Returns a list of registered page link types.
     * This is reserved functionality for separating the links by type.
     * @return array Returns an array of registered page link types
     */
    protected function getPageLinkTypes()
    {
        $result = [];

        $apiResult = Event::fire('backend.richeditor.listTypes');
        if (is_array($apiResult)) {
            foreach ($apiResult as $typeList) {
                if (!is_array($typeList)) {
                    continue;
                }

                foreach ($typeList as $typeCode => $typeName) {
                    $result[$typeCode] = $typeName;
                }
            }
        }

        return $result;
    }

    protected function getPageLinks($type)
    {
        $result = [];
        $apiResult = Event::fire('backend.richeditor.getTypeInfo', [$type]);
        if (is_array($apiResult)) {
            foreach ($apiResult as $typeInfo) {
                if (!is_array($typeInfo)) {
                    continue;
                }

                foreach ($typeInfo as $name => $value) {
                    $result[$name] = $value;
                }
            }
        }

        return $result;
    }
}


text:
package com.maxvi.max.liveweather.fragments;

import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.preference.EditTextPreference;
import android.support.v7.preference.ListPreference;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceFragmentCompat;
import android.support.v7.preference.PreferenceScreen;

import com.maxvi.max.liveweather.R;

public class SettingsFragment extends PreferenceFragmentCompat
        implements SharedPreferences.OnSharedPreferenceChangeListener {

    @Override
    public void onCreatePreferences(final Bundle savedInstanceState, final String rootKey) {
        addPreferencesFromResource(R.xml.prefs_settings);
        final PreferenceScreen preferenceScreen = getPreferenceScreen();
        Preference preference = preferenceScreen.findPreference(getString(R.string.pref_key_location));
        EditTextPreference editTextPreference = (EditTextPreference) preference;
        editTextPreference.setSummary(editTextPreference.getText());

    }
    //TODO implement preferenceChangeListener

    @Override
    public void onStop() {
        super.onStop();
        getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
    }

    @Override
    public void onStart() {
        super.onStart();
        getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
    }

    @Override
    public void onSharedPreferenceChanged(final SharedPreferences sharedPreferences, final String key) {
        final Preference preference = findPreference(key);
        if (preference instanceof EditTextPreference) {
            final EditTextPreference editTextPreference = (EditTextPreference) preference;
            editTextPreference.setSummary(editTextPreference.getText());
        }
        if (preference instanceof ListPreference) {

        }
    }
}


text:
//#define USE_SharpZipLib
#if !UNITY_WEBPLAYER
#define USE_FileIO
#endif
/* * * * *
 * A simple JSON Parser / builder
 * ------------------------------
 *
 * It mainly has been written as a simple JSON parser. It can build a JSON string
 * from the node-tree, or generate a node tree from any valid JSON string.
 *
 * If you want to use compression when saving to file / stream / B64 you have to include
 * SharpZipLib ( http://www.icsharpcode.net/opensource/sharpziplib/ ) in your project and
 * define "USE_SharpZipLib" at the top of the file
 *
 * Written by Bunny83
 * 2012-06-09
 *
 * Modified by oPless, 2014-09-21 to round-trip properly
 *
 * Features / attributes:
 * - provides strongly typed node classes and lists / dictionaries
 * - provides easy access to class members / array items / data values
 * - the parser ignores data types. Each value is a string.
 * - only double quotes (") are used for quoting strings.
 * - values and names are not restricted to quoted strings. They simply add up and are trimmed.
 * - There are only 3 types: arrays(JSONArray), objects(JSONClass) and values(JSONData)
 * - provides "casting" properties to easily convert to / from those types:
 *   int / float / double / bool
 * - provides a common interface for each node so no explicit casting is required.
 * - the parser try to avoid errors, but if malformed JSON is parsed the result is undefined
 *
 *
 * 2012-12-17 Update:
 * - Added internal JSONLazyCreator class which simplifies the construction of a JSON tree
 *   Now you can simple reference any item that doesn't exist yet and it will return a JSONLazyCreator
 *   The class determines the required type by it's further use, creates the type and removes itself.
 * - Added binary serialization / deserialization.
 * - Added support for BZip2 zipped binary format. Requires the SharpZipLib ( http://www.icsharpcode.net/opensource/sharpziplib/ )
 *   The usage of the SharpZipLib library can be disabled by removing or commenting out the USE_SharpZipLib define at the top
 * - The serializer uses different types when it comes to store the values. Since my data values
 *   are all of type string, the serializer will "try" which format fits best. The order is: int, float, double, bool, string.
 *   It's not the most efficient way but for a moderate amount of data it should work on all platforms.
 *
 * * * * */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace SimpleJSON
{
    public enum JSONBinaryTag
    {
        Array = 1,
        Class = 2,
        Value = 3,
        IntValue = 4,
        DoubleValue = 5,
        BoolValue = 6,
        FloatValue = 7,
    }

    public abstract class JSONNode
    {
        #region common interface

        public virtual void Add (string aKey, JSONNode aItem)
        {
        }

        public virtual JSONNode this [int aIndex]   { get { return null; } set { } }

        public virtual JSONNode this [string aKey]  { get { return null; } set { } }

        public virtual string Value                { get { return ""; } set { } }

        public virtual int Count                   { get { return 0; } }

        public virtual void Add (JSONNode aItem)
        {
            Add ("", aItem);
        }

        public virtual JSONNode Remove (string aKey)
        {
            return null;
        }

        public virtual JSONNode Remove (int aIndex)
        {
            return null;
        }

        public virtual JSONNode Remove (JSONNode aNode)
        {
            return aNode;
        }

        public virtual IEnumerable<JSONNode> Children
        {
            get {
                yield break;
            }
        }

        public IEnumerable<JSONNode> DeepChildren
        {
            get {
                foreach (var C in Children)
                    foreach (var D in C.DeepChildren)
                        yield return D;
            }
        }

        public override string ToString ()
        {
            return "JSONNode";
        }

        public virtual string ToString (string aPrefix)
        {
            return "JSONNode";
        }

        public abstract string ToJSON (int prefix);

        #endregion common interface

        #region typecasting properties

        public virtual JSONBinaryTag Tag { get; set; }

        public virtual int AsInt
        {
            get {
                int v = 0;
                if (int.TryParse (Value, out v))
                    return v;
                return 0;
            }
            set {
                Value = value.ToString ();
                Tag = JSONBinaryTag.IntValue;
            }
        }

        public virtual float AsFloat
        {
            get {
                float v = 0.0f;
                if (float.TryParse (Value, out v))
                    return v;
                return 0.0f;
            }
            set {
                Value = value.ToString ();
                Tag = JSONBinaryTag.FloatValue;
            }
        }

        public virtual double AsDouble
        {
            get {
                double v = 0.0;
                if (double.TryParse (Value, out v))
                    return v;
                return 0.0;
            }
            set {
                Value = value.ToString ();
                Tag = JSONBinaryTag.DoubleValue;

            }
        }

        public virtual bool AsBool
        {
            get {
                bool v = false;
                if (bool.TryParse (Value, out v))
                    return v;
                return !string.IsNullOrEmpty (Value);
            }
            set {
                Value = (value) ? "true" : "false";
                Tag = JSONBinaryTag.BoolValue;

            }
        }

        public virtual JSONArray AsArray
        {
            get {
                return this as JSONArray;
            }
        }

        public virtual JSONClass AsObject
        {
            get {
                return this as JSONClass;
            }
        }

        #endregion typecasting properties

        #region operators

        public static implicit operator JSONNode (string s)
        {
            return new JSONData (s);
        }

        public static implicit operator string (JSONNode d)
        {
            return (d == null) ? null : d.Value;
        }

        public static bool operator == (JSONNode a, object b)
        {
            if (b == null && a is JSONLazyCreator)
                return true;
            return System.Object.ReferenceEquals (a, b);
        }

        public static bool operator != (JSONNode a, object b)
        {
            return !(a == b);
        }

        public override bool Equals (object obj)
        {
            return System.Object.ReferenceEquals (this, obj);
        }

        public override int GetHashCode ()
        {
            return base.GetHashCode ();
        }

        #endregion operators

        internal static string Escape (string aText)
        {
            string result = "";
            foreach (char c in aText) {
                switch (c) {
                    case '\\':
                        result += "\\\\";
                        break;
                    case '\"':
                        result += "\\\"";
                        break;
                    case '\n':
                        result += "\\n";
                        break;
                    case '\r':
                        result += "\\r";
                        break;
                    case '\t':
                        result += "\\t";
                        break;
                    case '\b':
                        result += "\\b";
                        break;
                    case '\f':
                        result += "\\f";
                        break;
                    default   :
                        result += c;
                        break;
                }
            }
            return result;
        }

        static JSONData Numberize (string token)
        {
            bool flag = false;
            int integer = 0;
            double real = 0;

            if (int.TryParse (token, out integer)) {
                return new JSONData (integer);
            }

            if (double.TryParse (token, out real)) {
                return new JSONData (real);
            }

            if (bool.TryParse (token, out flag)) {
                return new JSONData (flag);
            }

            throw new NotImplementedException (token);
        }

        static void AddElement (JSONNode ctx, string token, string tokenName, bool tokenIsString)
        {
            if (tokenIsString) {
                if (ctx is JSONArray)
                    ctx.Add (token);
                else
                    ctx.Add (tokenName, token); // assume dictionary/object
            } else {
                JSONData number = Numberize (token);
                if (ctx is JSONArray)
                    ctx.Add (number);
                else
                    ctx.Add (tokenName, number);

            }
        }

        public static JSONNode Parse (string aJSON)
        {
            Stack<JSONNode> stack = new Stack<JSONNode> ();
            JSONNode ctx = null;
            int i = 0;
            string Token = "";
            string TokenName = "";
            bool QuoteMode = false;
            bool TokenIsString = false;
            while (i < aJSON.Length) {
                switch (aJSON [i]) {
                    case '{':
                        if (QuoteMode) {
                            Token += aJSON [i];
                            break;
                        }
                        stack.Push (new JSONClass ());
                        if (ctx != null) {
                            TokenName = TokenName.Trim ();
                            if (ctx is JSONArray)
                                ctx.Add (stack.Peek ());
                            else if (TokenName != "")
                                ctx.Add (TokenName, stack.Peek ());
                        }
                        TokenName = "";
                        Token = "";
                        ctx = stack.Peek ();
                        break;

                    case '[':
                        if (QuoteMode) {
                            Token += aJSON [i];
                            break;
                        }

                        stack.Push (new JSONArray ());
                        if (ctx != null) {
                            TokenName = TokenName.Trim ();

                            if (ctx is JSONArray)
                                ctx.Add (stack.Peek ());
                            else if (TokenName != "")
                                ctx.Add (TokenName, stack.Peek ());
                        }
                        TokenName = "";
                        Token = "";
                        ctx = stack.Peek ();
                        break;

                    case '}':
                    case ']':
                        if (QuoteMode) {
                            Token += aJSON [i];
                            break;
                        }
                        if (stack.Count == 0)
                            throw new Exception ("JSON Parse: Too many closing brackets");

                        stack.Pop ();
                        if (Token != "") {
                            TokenName = TokenName.Trim ();
                            /*
                            if (ctx is JSONArray)
                                ctx.Add (Token);
                            else if (TokenName != "")
                                ctx.Add (TokenName, Token);
                                */
                            AddElement (ctx, Token, TokenName, TokenIsString);
                            TokenIsString = false;
                        }
                        TokenName = "";
                        Token = "";
                        if (stack.Count > 0)
                            ctx = stack.Peek ();
                        break;

                    case ':':
                        if (QuoteMode) {
                            Token += aJSON [i];
                            break;
                        }
                        TokenName = Token;
                        Token = "";
                        TokenIsString = false;
                        break;

                    case '"':
                        QuoteMode ^= true;
                        TokenIsString = QuoteMode == true ? true : TokenIsString;
                        break;

                    case ',':
                        if (QuoteMode) {
                            Token += aJSON [i];
                            break;
                        }
                        if (Token != "") {
                            /*
                            if (ctx is JSONArray) {
                                ctx.Add (Token);
                            } else if (TokenName != "") {
                                ctx.Add (TokenName, Token);
                            }
                            */
                            AddElement (ctx, Token, TokenName, TokenIsString);
                            TokenIsString = false;

                        }
                        TokenName = "";
                        Token = "";
                        TokenIsString = false;
                        break;

                    case '\r':
                    case '\n':
                        break;

                    case ' ':
                    case '\t':
                        if (QuoteMode)
                            Token += aJSON [i];
                        break;

                    case '\\':
                        ++i;
                        if (QuoteMode) {
                            char C = aJSON [i];
                            switch (C) {
                                case 't':
                                    Token += '\t';
                                    break;
                                case 'r':
                                    Token += '\r';
                                    break;
                                case 'n':
                                    Token += '\n';
                                    break;
                                case 'b':
                                    Token += '\b';
                                    break;
                                case 'f':
                                    Token += '\f';
                                    break;
                                case 'u':
                                    {
                                        string s = aJSON.Substring (i + 1, 4);
                                        Token += (char)int.Parse (
                                            s,
                                            System.Globalization.NumberStyles.AllowHexSpecifier);
                                        i += 4;
                                        break;
                                    }
                                default  :
                                    Token += C;
                                    break;
                            }
                        }
                        break;

                    default:
                        Token += aJSON [i];
                        break;
                }
                ++i;
            }
            if (QuoteMode) {
                throw new Exception ("JSON Parse: Quotation marks seems to be messed up.");
            }
            return ctx;
        }

        public virtual void Serialize (System.IO.BinaryWriter aWriter)
        {
        }

        public void SaveToStream (System.IO.Stream aData)
        {
            var W = new System.IO.BinaryWriter (aData);
            Serialize (W);
        }

        #if USE_SharpZipLib
        public void SaveToCompressedStream(System.IO.Stream aData)
        {
        using (var gzipOut = new ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream(aData))
        {
        gzipOut.IsStreamOwner = false;
        SaveToStream(gzipOut);
        gzipOut.Close();
        }
        }

        public void SaveToCompressedFile(string aFileName)
        {

        #if USE_FileIO
        System.IO.Directory.CreateDirectory((new System.IO.FileInfo(aFileName)).Directory.FullName);
        using(var F = System.IO.File.OpenWrite(aFileName))
        {
        SaveToCompressedStream(F);
        }

        #else
        throw new Exception("Can't use File IO stuff in webplayer");
        #endif
        }
        public string SaveToCompressedBase64()
        {
        using (var stream = new System.IO.MemoryStream())
        {
        SaveToCompressedStream(stream);
        stream.Position = 0;
        return System.Convert.ToBase64String(stream.ToArray());
        }
        }

        #else
        public void SaveToCompressedStream (System.IO.Stream aData)
        {
            throw new Exception ("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
        }

        public void SaveToCompressedFile (string aFileName)
        {
            throw new Exception ("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
        }

        public string SaveToCompressedBase64 ()
        {
            throw new Exception ("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
        }
        #endif

        public void SaveToFile (string aFileName)
        {
            #if USE_FileIO
            System.IO.Directory.CreateDirectory ((new System.IO.FileInfo (aFileName)).Directory.FullName);
            using (var F = System.IO.File.OpenWrite (aFileName)) {
                SaveToStream (F);
            }
            #else
            throw new Exception ("Can't use File IO stuff in webplayer");
            #endif
        }

        public string SaveToBase64 ()
        {
            using (var stream = new System.IO.MemoryStream ()) {
                SaveToStream (stream);
                stream.Position = 0;
                return System.Convert.ToBase64String (stream.ToArray ());
            }
        }

        public static JSONNode Deserialize (System.IO.BinaryReader aReader)
        {
            JSONBinaryTag type = (JSONBinaryTag)aReader.ReadByte ();
            switch (type) {
                case JSONBinaryTag.Array:
                    {
                        int count = aReader.ReadInt32 ();
                        JSONArray tmp = new JSONArray ();
                        for (int i = 0; i < count; i++)
                            tmp.Add (Deserialize (aReader));
                        return tmp;
                    }
                case JSONBinaryTag.Class:
                    {
                        int count = aReader.ReadInt32 ();
                        JSONClass tmp = new JSONClass ();
                        for (int i = 0; i < count; i++) {
                            string key = aReader.ReadString ();
                            var val = Deserialize (aReader);
                            tmp.Add (key, val);
                        }
                        return tmp;
                    }
                case JSONBinaryTag.Value:
                    {
                        return new JSONData (aReader.ReadString ());
                    }
                case JSONBinaryTag.IntValue:
                    {
                        return new JSONData (aReader.ReadInt32 ());
                    }
                case JSONBinaryTag.DoubleValue:
                    {
                        return new JSONData (aReader.ReadDouble ());
                    }
                case JSONBinaryTag.BoolValue:
                    {
                        return new JSONData (aReader.ReadBoolean ());
                    }
                case JSONBinaryTag.FloatValue:
                    {
                        return new JSONData (aReader.ReadSingle ());
                    }

                default:
                    {
                        throw new Exception ("Error deserializing JSON. Unknown tag: " + type);
                    }
            }
        }

        #if USE_SharpZipLib
        public static JSONNode LoadFromCompressedStream(System.IO.Stream aData)
        {
        var zin = new ICSharpCode.SharpZipLib.BZip2.BZip2InputStream(aData);
        return LoadFromStream(zin);
        }
        public static JSONNode LoadFromCompressedFile(string aFileName)
        {
        #if USE_FileIO
        using(var F = System.IO.File.OpenRead(aFileName))
        {
        return LoadFromCompressedStream(F);
        }
        #else
        throw new Exception("Can't use File IO stuff in webplayer");
        #endif
        }
        public static JSONNode LoadFromCompressedBase64(string aBase64)
        {
        var tmp = System.Convert.FromBase64String(aBase64);
        var stream = new System.IO.MemoryStream(tmp);
        stream.Position = 0;
        return LoadFromCompressedStream(stream);
        }
        #else
        public static JSONNode LoadFromCompressedFile (string aFileName)
        {
            throw new Exception ("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
        }

        public static JSONNode LoadFromCompressedStream (System.IO.Stream aData)
        {
            throw new Exception ("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
        }

        public static JSONNode LoadFromCompressedBase64 (string aBase64)
        {
            throw new Exception ("Can't use compressed functions. You need include the SharpZipLib and uncomment the define at the top of SimpleJSON");
        }
        #endif

        public static JSONNode LoadFromStream (System.IO.Stream aData)
        {
            using (var R = new System.IO.BinaryReader (aData)) {
                return Deserialize (R);
            }
        }

        public static JSONNode LoadFromFile (string aFileName)
        {
            #if USE_FileIO
            using (var F = System.IO.File.OpenRead (aFileName)) {
                return LoadFromStream (F);
            }
            #else
            throw new Exception ("Can't use File IO stuff in webplayer");
            #endif
        }

        public static JSONNode LoadFromBase64 (string aBase64)
        {
            var tmp = System.Convert.FromBase64String (aBase64);
            var stream = new System.IO.MemoryStream (tmp);
            stream.Position = 0;
            return LoadFromStream (stream);
        }
    }
    // End of JSONNode

    public class JSONArray : JSONNode, IEnumerable
    {
        private List<JSONNode> m_List = new List<JSONNode> ();

        public override JSONNode this [int aIndex]
        {
            get {
                if (aIndex < 0 || aIndex >= m_List.Count)
                    return new JSONLazyCreator (this);
                return m_List [aIndex];
            }
            set {
                if (aIndex < 0 || aIndex >= m_List.Count)
                    m_List.Add (value);
                else
                    m_List [aIndex] = value;
            }
        }

        public override JSONNode this [string aKey]
        {
            get{ return new JSONLazyCreator (this); }
            set{ m_List.Add (value); }
        }

        public override int Count
        {
            get { return m_List.Count; }
        }

        public override void Add (string aKey, JSONNode aItem)
        {
            m_List.Add (aItem);
        }

        public override JSONNode Remove (int aIndex)
        {
            if (aIndex < 0 || aIndex >= m_List.Count)
                return null;
            JSONNode tmp = m_List [aIndex];
            m_List.RemoveAt (aIndex);
            return tmp;
        }

        public override JSONNode Remove (JSONNode aNode)
        {
            m_List.Remove (aNode);
            return aNode;
        }

        public override IEnumerable<JSONNode> Children
        {
            get {
                foreach (JSONNode N in m_List)
                    yield return N;
            }
        }

        public IEnumerator GetEnumerator ()
        {
            foreach (JSONNode N in m_List)
                yield return N;
        }

        public override string ToString ()
        {
            string result = "[ ";
            foreach (JSONNode N in m_List) {
                if (result.Length > 2)
                    result += ", ";
                result += N.ToString ();
            }
            result += " ]";
            return result;
        }

        public override string ToString (string aPrefix)
        {
            string result = "[ ";
            foreach (JSONNode N in m_List) {
                if (result.Length > 3)
                    result += ", ";
                result += "\n" + aPrefix + "   ";
                result += N.ToString (aPrefix + "   ");
            }
            result += "\n" + aPrefix + "]";
            return result;
        }

        public override string ToJSON (int prefix)
        {
            string s = new string (' ', (prefix + 1) * 2);
            string ret = "[ ";
            foreach (JSONNode n in m_List) {
                if (ret.Length > 3)
                    ret += ", ";
                ret += "\n" + s;
                ret += n.ToJSON (prefix + 1);

            }
            ret += "\n" + s + "]";
            return ret;
        }

        public override void Serialize (System.IO.BinaryWriter aWriter)
        {
            aWriter.Write ((byte)JSONBinaryTag.Array);
            aWriter.Write (m_List.Count);
            for (int i = 0; i < m_List.Count; i++) {
                m_List [i].Serialize (aWriter);
            }
        }
    }
    // End of JSONArray

    public class JSONClass : JSONNode, IEnumerable
    {
        private Dictionary<string,JSONNode> m_Dict = new Dictionary<string,JSONNode> ();

        public override JSONNode this [string aKey]
        {
            get {
                if (m_Dict.ContainsKey (aKey))
                    return m_Dict [aKey];
                else
                    return new JSONLazyCreator (this, aKey);
            }
            set {
                if (m_Dict.ContainsKey (aKey))
                    m_Dict [aKey] = value;
                else
                    m_Dict.Add (aKey, value);
            }
        }

        public override JSONNode this [int aIndex]
        {
            get {
                if (aIndex < 0 || aIndex >= m_Dict.Count)
                    return null;
                return m_Dict.ElementAt (aIndex).Value;
            }
            set {
                if (aIndex < 0 || aIndex >= m_Dict.Count)
                    return;
                string key = m_Dict.ElementAt (aIndex).Key;
                m_Dict [key] = value;
            }
        }

        public override int Count
        {
            get { return m_Dict.Count; }
        }

        public override void Add (string aKey, JSONNode aItem)
        {
            if (!string.IsNullOrEmpty (aKey)) {
                if (m_Dict.ContainsKey (aKey))
                    m_Dict [aKey] = aItem;
                else
                    m_Dict.Add (aKey, aItem);
            } else
                m_Dict.Add (Guid.NewGuid ().ToString (), aItem);
        }

        public override JSONNode Remove (string aKey)
        {
            if (!m_Dict.ContainsKey (aKey))
                return null;
            JSONNode tmp = m_Dict [aKey];
            m_Dict.Remove (aKey);
            return tmp;
        }

        public override JSONNode Remove (int aIndex)
        {
            if (aIndex < 0 || aIndex >= m_Dict.Count)
                return null;
            var item = m_Dict.ElementAt (aIndex);
            m_Dict.Remove (item.Key);
            return item.Value;
        }

        public override JSONNode Remove (JSONNode aNode)
        {
            try {
                var item = m_Dict.Where (k => k.Value == aNode).First ();
                m_Dict.Remove (item.Key);
                return aNode;
            } catch {
                return null;
            }
        }

        public override IEnumerable<JSONNode> Children
        {
            get {
                foreach (KeyValuePair<string,JSONNode> N in m_Dict)
                    yield return N.Value;
            }
        }

        public IEnumerator GetEnumerator ()
        {
            foreach (KeyValuePair<string, JSONNode> N in m_Dict)
                yield return N;
        }

        public override string ToString ()
        {
            string result = "{";
            foreach (KeyValuePair<string, JSONNode> N in m_Dict) {
                if (result.Length > 2)
                    result += ", ";
                result += "\"" + Escape (N.Key) + "\":" + N.Value.ToString ();
            }
            result += "}";
            return result;
        }

        public override string ToString (string aPrefix)
        {
            string result = "{ ";
            foreach (KeyValuePair<string, JSONNode> N in m_Dict) {
                if (result.Length > 3)
                    result += ", ";
                result += "\n" + aPrefix + "   ";
                result += "\"" + Escape (N.Key) + "\" : " + N.Value.ToString (aPrefix + "   ");
            }
            result += "\n" + aPrefix + "}";
            return result;
        }

        public override string ToJSON (int prefix)
        {
            string s = new string (' ', (prefix + 1) * 2);
            string ret = "{ ";
            foreach (KeyValuePair<string,JSONNode> n in m_Dict) {
                if (ret.Length > 3)
                    ret += ", ";
                ret += "\n" + s;
                ret += string.Format ("\"{0}\": {1}", n.Key, n.Value.ToJSON (prefix + 1));
            }
            ret += "\n" + s + "}";
            return ret;
        }

        public override void Serialize (System.IO.BinaryWriter aWriter)
        {
            aWriter.Write ((byte)JSONBinaryTag.Class);
            aWriter.Write (m_Dict.Count);
            foreach (string K in m_Dict.Keys) {
                aWriter.Write (K);
                m_Dict [K].Serialize (aWriter);
            }
        }
    }
    // End of JSONClass

    public class JSONData : JSONNode
    {
        private string m_Data;

        public override string Value
        {
            get { return m_Data; }
            set {
                m_Data = value;
                Tag = JSONBinaryTag.Value;
            }
        }

        public JSONData (string aData)
        {
            m_Data = aData;
            Tag = JSONBinaryTag.Value;
        }

        public JSONData (float aData)
        {
            AsFloat = aData;
        }

        public JSONData (double aData)
        {
            AsDouble = aData;
        }

        public JSONData (bool aData)
        {
            AsBool = aData;
        }

        public JSONData (int aData)
        {
            AsInt = aData;
        }

        public override string ToString ()
        {
            return "\"" + Escape (m_Data) + "\"";
        }

        public override string ToString (string aPrefix)
        {
            return "\"" + Escape (m_Data) + "\"";
        }

        public override string ToJSON (int prefix)
        {
            switch (Tag) {
                case JSONBinaryTag.DoubleValue:
                case JSONBinaryTag.FloatValue:
                case JSONBinaryTag.IntValue:
                    return m_Data;
                case JSONBinaryTag.Value:
                    return string.Format ("\"{0}\"", Escape (m_Data));
                default:
                    throw new NotSupportedException ("This shouldn't be here: " + Tag.ToString ());
            }
        }

        public override void Serialize (System.IO.BinaryWriter aWriter)
        {
            var tmp = new JSONData ("");

            tmp.AsInt = AsInt;
            if (tmp.m_Data == this.m_Data) {
                aWriter.Write ((byte)JSONBinaryTag.IntValue);
                aWriter.Write (AsInt);
                return;
            }
            tmp.AsFloat = AsFloat;
            if (tmp.m_Data == this.m_Data) {
                aWriter.Write ((byte)JSONBinaryTag.FloatValue);
                aWriter.Write (AsFloat);
                return;
            }
            tmp.AsDouble = AsDouble;
            if (tmp.m_Data == this.m_Data) {
                aWriter.Write ((byte)JSONBinaryTag.DoubleValue);
                aWriter.Write (AsDouble);
                return;
            }

            tmp.AsBool = AsBool;
            if (tmp.m_Data == this.m_Data) {
                aWriter.Write ((byte)JSONBinaryTag.BoolValue);
                aWriter.Write (AsBool);
                return;
            }
            aWriter.Write ((byte)JSONBinaryTag.Value);
            aWriter.Write (m_Data);
        }
    }
    // End of JSONData

    internal class JSONLazyCreator : JSONNode
    {
        private JSONNode m_Node = null;
        private string m_Key = null;

        public JSONLazyCreator (JSONNode aNode)
        {
            m_Node = aNode;
            m_Key = null;
        }

        public JSONLazyCreator (JSONNode aNode, string aKey)
        {
            m_Node = aNode;
            m_Key = aKey;
        }

        private void Set (JSONNode aVal)
        {
            if (m_Key == null) {
                m_Node.Add (aVal);
            } else {
                m_Node.Add (m_Key, aVal);
            }
            m_Node = null; // Be GC friendly.
        }

        public override JSONNode this [int aIndex]
        {
            get {
                return new JSONLazyCreator (this);
            }
            set {
                var tmp = new JSONArray ();
                tmp.Add (value);
                Set (tmp);
            }
        }

        public override JSONNode this [string aKey]
        {
            get {
                return new JSONLazyCreator (this, aKey);
            }
            set {
                var tmp = new JSONClass ();
                tmp.Add (aKey, value);
                Set (tmp);
            }
        }

        public override void Add (JSONNode aItem)
        {
            var tmp = new JSONArray ();
            tmp.Add (aItem);
            Set (tmp);
        }

        public override void Add (string aKey, JSONNode aItem)
        {
            var tmp = new JSONClass ();
            tmp.Add (aKey, aItem);
            Set (tmp);
        }

        public static bool operator == (JSONLazyCreator a, object b)
        {
            if (b == null)
                return true;
            return System.Object.ReferenceEquals (a, b);
        }

        public static bool operator != (JSONLazyCreator a, object b)
        {
            return !(a == b);
        }

        public override bool Equals (object obj)
        {
            if (obj == null)
                return true;
            return System.Object.ReferenceEquals (this, obj);
        }

        public override int GetHashCode ()
        {
            return base.GetHashCode ();
        }

        public override string ToString ()
        {
            return "";
        }

        public override string ToString (string aPrefix)
        {
            return "";
        }

        public override string ToJSON (int prefix)
        {
            return "";
        }

        public override int AsInt
        {
            get {
                JSONData tmp = new JSONData (0);
                Set (tmp);
                return 0;
            }
            set {
                JSONData tmp = new JSONData (value);
                Set (tmp);
            }
        }

        public override float AsFloat
        {
            get {
                JSONData tmp = new JSONData (0.0f);
                Set (tmp);
                return 0.0f;
            }
            set {
                JSONData tmp = new JSONData (value);
                Set (tmp);
            }
        }

        public override double AsDouble
        {
            get {
                JSONData tmp = new JSONData (0.0);
                Set (tmp);
                return 0.0;
            }
            set {
                JSONData tmp = new JSONData (value);
                Set (tmp);
            }
        }

        public override bool AsBool
        {
            get {
                JSONData tmp = new JSONData (false);
                Set (tmp);
                return false;
            }
            set {
                JSONData tmp = new JSONData (value);
                Set (tmp);
            }
        }

        public override JSONArray AsArray
        {
            get {
                JSONArray tmp = new JSONArray ();
                Set (tmp);
                return tmp;
            }
        }

        public override JSONClass AsObject
        {
            get {
                JSONClass tmp = new JSONClass ();
                Set (tmp);
                return tmp;
            }
        }
    }
    // End of JSONLazyCreator

    public static class JSON
    {
        public static JSONNode Parse (string aJSON)
        {
            return JSONNode.Parse (aJSON);
        }
    }
}


text:
function foo(f){
  f.caller;
}
function bar(f) {
  new foo(f);
}
bar(function() {});
%OptimizeFunctionOnNextCall(bar);
bar(function() {});


text:
<?php

namespace Google\Service\ContainerAnalysis;

class GrafeasV1SlsaProvenanceZeroTwoSlsaBuilder extends \Google\Model
{
  /**
   * @var string
   */
  public $id;

  /**
   * @param string
   */
  public function setId($id)
  {
    $this->id = $id;
  }
  /**
   * @return string
   */
  public function getId()
  {
    return $this->id;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GrafeasV1SlsaProvenanceZeroTwoSlsaBuilder::class, 'Google_Service_ContainerAnalysis_GrafeasV1SlsaProvenanceZeroTwoSlsaBuilder');