text:
package org.elasticsearch;

import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.SuppressForbidden;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.monitor.jvm.JvmInfo;

import java.io.IOException;
import java.util.Comparator;

public class Version implements Comparable<Version> {
    /*
     * The logic for ID is: XXYYZZAA, where XX is major version, YY is minor version, ZZ is revision, and AA is alpha/beta/rc indicator AA
     * values below 25 are for alpha builder (since 5.0), and above 25 and below 50 are beta builds, and below 99 are RC builds, with 99
     * indicating a release the (internal) format of the id is there so we can easily do after/before checks on the id
     */
    public static final int V_2_0_0_ID = 2000099;
    public static final Version V_2_0_0 = new Version(V_2_0_0_ID, org.apache.lucene.util.Version.LUCENE_5_2_1);
    public static final int V_2_0_1_ID = 2000199;
    public static final Version V_2_0_1 = new Version(V_2_0_1_ID, org.apache.lucene.util.Version.LUCENE_5_2_1);
    public static final int V_2_0_2_ID = 2000299;
    public static final Version V_2_0_2 = new Version(V_2_0_2_ID, org.apache.lucene.util.Version.LUCENE_5_2_1);
    public static final int V_2_1_0_ID = 2010099;
    public static final Version V_2_1_0 = new Version(V_2_1_0_ID, org.apache.lucene.util.Version.LUCENE_5_3_1);
    public static final int V_2_1_1_ID = 2010199;
    public static final Version V_2_1_1 = new Version(V_2_1_1_ID, org.apache.lucene.util.Version.LUCENE_5_3_1);
    public static final int V_2_1_2_ID = 2010299;
    public static final Version V_2_1_2 = new Version(V_2_1_2_ID, org.apache.lucene.util.Version.LUCENE_5_3_1);
    public static final int V_2_2_0_ID = 2020099;
    public static final Version V_2_2_0 = new Version(V_2_2_0_ID, org.apache.lucene.util.Version.LUCENE_5_4_1);
    public static final int V_2_2_1_ID = 2020199;
    public static final Version V_2_2_1 = new Version(V_2_2_1_ID, org.apache.lucene.util.Version.LUCENE_5_4_1);
    public static final int V_2_2_2_ID = 2020299;
    public static final Version V_2_2_2 = new Version(V_2_2_2_ID, org.apache.lucene.util.Version.LUCENE_5_4_1);
    public static final int V_2_3_0_ID = 2030099;
    public static final Version V_2_3_0 = new Version(V_2_3_0_ID, org.apache.lucene.util.Version.LUCENE_5_5_0);
    public static final int V_2_3_1_ID = 2030199;
    public static final Version V_2_3_1 = new Version(V_2_3_1_ID, org.apache.lucene.util.Version.LUCENE_5_5_0);
    public static final int V_2_3_2_ID = 2030299;
    public static final Version V_2_3_2 = new Version(V_2_3_2_ID, org.apache.lucene.util.Version.LUCENE_5_5_0);
    public static final int V_2_3_3_ID = 2030399;
    public static final Version V_2_3_3 = new Version(V_2_3_3_ID, org.apache.lucene.util.Version.LUCENE_5_5_0);
    public static final int V_2_3_4_ID = 2030499;
    public static final Version V_2_3_4 = new Version(V_2_3_4_ID, org.apache.lucene.util.Version.LUCENE_5_5_0);
    public static final int V_2_3_5_ID = 2030599;
    public static final Version V_2_3_5 = new Version(V_2_3_5_ID, org.apache.lucene.util.Version.LUCENE_5_5_0);
    public static final int V_2_4_0_ID = 2040099;
    public static final Version V_2_4_0 = new Version(V_2_4_0_ID, org.apache.lucene.util.Version.LUCENE_5_5_2);
    public static final int V_2_4_1_ID = 2040199;
    public static final Version V_2_4_1 = new Version(V_2_4_1_ID, org.apache.lucene.util.Version.LUCENE_5_5_2);
    public static final int V_2_4_2_ID = 2040299;
    public static final Version V_2_4_2 = new Version(V_2_4_2_ID, org.apache.lucene.util.Version.LUCENE_5_5_2);
    public static final int V_2_4_3_ID = 2040399;
    public static final Version V_2_4_3 = new Version(V_2_4_3_ID, org.apache.lucene.util.Version.LUCENE_5_5_2);
    public static final int V_5_0_0_alpha1_ID = 5000001;
    public static final Version V_5_0_0_alpha1 = new Version(V_5_0_0_alpha1_ID, org.apache.lucene.util.Version.LUCENE_6_0_0);
    public static final int V_5_0_0_alpha2_ID = 5000002;
    public static final Version V_5_0_0_alpha2 = new Version(V_5_0_0_alpha2_ID, org.apache.lucene.util.Version.LUCENE_6_0_0);
    public static final int V_5_0_0_alpha3_ID = 5000003;
    public static final Version V_5_0_0_alpha3 = new Version(V_5_0_0_alpha3_ID, org.apache.lucene.util.Version.LUCENE_6_0_0);
    public static final int V_5_0_0_alpha4_ID = 5000004;
    public static final Version V_5_0_0_alpha4 = new Version(V_5_0_0_alpha4_ID, org.apache.lucene.util.Version.LUCENE_6_1_0);
    public static final int V_5_0_0_alpha5_ID = 5000005;
    public static final Version V_5_0_0_alpha5 = new Version(V_5_0_0_alpha5_ID, org.apache.lucene.util.Version.LUCENE_6_1_0);
    public static final int V_5_0_0_beta1_ID = 5000026;
    public static final Version V_5_0_0_beta1 = new Version(V_5_0_0_beta1_ID, org.apache.lucene.util.Version.LUCENE_6_2_0);
    public static final int V_5_0_0_rc1_ID = 5000051;
    public static final Version V_5_0_0_rc1 = new Version(V_5_0_0_rc1_ID, org.apache.lucene.util.Version.LUCENE_6_2_0);
    public static final int V_5_0_0_ID = 5000099;
    public static final Version V_5_0_0 = new Version(V_5_0_0_ID, org.apache.lucene.util.Version.LUCENE_6_2_0);
    public static final int V_5_0_1_ID = 5000199;
    public static final Version V_5_0_1 = new Version(V_5_0_1_ID, org.apache.lucene.util.Version.LUCENE_6_2_1);
    public static final int V_5_0_2_ID = 5000299;
    public static final Version V_5_0_2 = new Version(V_5_0_2_ID, org.apache.lucene.util.Version.LUCENE_6_2_1);
    public static final int V_5_0_3_ID_UNRELEASED = 5000399;
    public static final Version V_5_0_3_UNRELEASED = new Version(V_5_0_3_ID_UNRELEASED, org.apache.lucene.util.Version.LUCENE_6_3_0);
    // no version constant for 5.1.0 due to inadvertent release
    public static final int V_5_1_1_ID_UNRELEASED = 5010199;
    public static final Version V_5_1_1_UNRELEASED = new Version(V_5_1_1_ID_UNRELEASED, org.apache.lucene.util.Version.LUCENE_6_3_0);
    public static final int V_5_1_2_ID_UNRELEASED = 5010299;
    public static final Version V_5_1_2_UNRELEASED = new Version(V_5_1_2_ID_UNRELEASED, org.apache.lucene.util.Version.LUCENE_6_3_0);
    public static final int V_5_2_0_ID_UNRELEASED = 5020099;
    public static final Version V_5_2_0_UNRELEASED = new Version(V_5_2_0_ID_UNRELEASED, org.apache.lucene.util.Version.LUCENE_6_3_0);
    public static final int V_5_3_0_ID_UNRELEASED = 5030099;
    public static final Version V_5_3_0_UNRELEASED = new Version(V_5_3_0_ID_UNRELEASED, org.apache.lucene.util.Version.LUCENE_6_4_0);
    public static final int V_6_0_0_alpha1_ID_UNRELEASED = 6000001;
    public static final Version V_6_0_0_alpha1_UNRELEASED =
        new Version(V_6_0_0_alpha1_ID_UNRELEASED, org.apache.lucene.util.Version.LUCENE_6_4_0);
    public static final Version CURRENT = V_6_0_0_alpha1_UNRELEASED;

    // unreleased versions must be added to the above list with the suffix _UNRELEASED (with the exception of CURRENT)

    static {
        assert CURRENT.luceneVersion.equals(org.apache.lucene.util.Version.LATEST) : "Version must be upgraded to ["
                + org.apache.lucene.util.Version.LATEST + "] is still set to [" + CURRENT.luceneVersion + "]";
    }

    public static Version readVersion(StreamInput in) throws IOException {
        return fromId(in.readVInt());
    }

    public static Version fromId(int id) {
        switch (id) {
            case V_6_0_0_alpha1_ID_UNRELEASED:
                return V_6_0_0_alpha1_UNRELEASED;
            case V_5_3_0_ID_UNRELEASED:
                return V_5_3_0_UNRELEASED;
            case V_5_2_0_ID_UNRELEASED:
                return V_5_2_0_UNRELEASED;
            case V_5_1_2_ID_UNRELEASED:
                return V_5_1_2_UNRELEASED;
            case V_5_1_1_ID_UNRELEASED:
                return V_5_1_1_UNRELEASED;
            case V_5_0_3_ID_UNRELEASED:
                return V_5_0_3_UNRELEASED;
            case V_5_0_2_ID:
                return V_5_0_2;
            case V_5_0_1_ID:
                return V_5_0_1;
            case V_5_0_0_ID:
                return V_5_0_0;
            case V_5_0_0_rc1_ID:
                return V_5_0_0_rc1;
            case V_5_0_0_beta1_ID:
                return V_5_0_0_beta1;
            case V_5_0_0_alpha5_ID:
                return V_5_0_0_alpha5;
            case V_5_0_0_alpha4_ID:
                return V_5_0_0_alpha4;
            case V_5_0_0_alpha3_ID:
                return V_5_0_0_alpha3;
            case V_5_0_0_alpha2_ID:
                return V_5_0_0_alpha2;
            case V_5_0_0_alpha1_ID:
                return V_5_0_0_alpha1;
            case V_2_4_3_ID:
                return V_2_4_3;
            case V_2_4_2_ID:
                return V_2_4_2;
            case V_2_4_1_ID:
                return V_2_4_1;
            case V_2_4_0_ID:
                return V_2_4_0;
            case V_2_3_5_ID:
                return V_2_3_5;
            case V_2_3_4_ID:
                return V_2_3_4;
            case V_2_3_3_ID:
                return V_2_3_3;
            case V_2_3_2_ID:
                return V_2_3_2;
            case V_2_3_1_ID:
                return V_2_3_1;
            case V_2_3_0_ID:
                return V_2_3_0;
            case V_2_2_2_ID:
                return V_2_2_2;
            case V_2_2_1_ID:
                return V_2_2_1;
            case V_2_2_0_ID:
                return V_2_2_0;
            case V_2_1_2_ID:
                return V_2_1_2;
            case V_2_1_1_ID:
                return V_2_1_1;
            case V_2_1_0_ID:
                return V_2_1_0;
            case V_2_0_2_ID:
                return V_2_0_2;
            case V_2_0_1_ID:
                return V_2_0_1;
            case V_2_0_0_ID:
                return V_2_0_0;
            default:
                return new Version(id, org.apache.lucene.util.Version.LATEST);
        }
    }

    /**
     * Return the {@link Version} of Elasticsearch that has been used to create an index given its settings.
     *
     * @throws IllegalStateException if the given index settings doesn't contain a value for the key
     *         {@value IndexMetaData#SETTING_VERSION_CREATED}
     */
    public static Version indexCreated(Settings indexSettings) {
        final Version indexVersion = indexSettings.getAsVersion(IndexMetaData.SETTING_VERSION_CREATED, null);
        if (indexVersion == null) {
            throw new IllegalStateException(
                    "[" + IndexMetaData.SETTING_VERSION_CREATED + "] is not present in the index settings for index with uuid: ["
                            + indexSettings.get(IndexMetaData.SETTING_INDEX_UUID) + "]");
        }
        return indexVersion;
    }

    public static void writeVersion(Version version, StreamOutput out) throws IOException {
        out.writeVInt(version.id);
    }

    /**
     * Returns the minimum version between the 2.
     */
    public static Version min(Version version1, Version version2) {
        return version1.id < version2.id ? version1 : version2;
    }

    /**
     * Returns the maximum version between the 2
     */
    public static Version max(Version version1, Version version2) { return version1.id > version2.id ? version1 : version2; }

    /**
     * Returns the version given its string representation, current version if the argument is null or empty
     */
    public static Version fromString(String version) {
        if (!Strings.hasLength(version)) {
            return Version.CURRENT;
        }
        final boolean snapshot; // this is some BWC for 2.x and before indices
        if (snapshot = version.endsWith("-SNAPSHOT")) {
            version = version.substring(0, version.length() - 9);
        }
        String[] parts = version.split("\\.|\\-");
        if (parts.length < 3 || parts.length > 4) {
            throw new IllegalArgumentException(
                    "the version needs to contain major, minor, and revision, and optionally the build: " + version);
        }

        try {
            final int rawMajor = Integer.parseInt(parts[0]);
            if (rawMajor >= 5 && snapshot) { // we don't support snapshot as part of the version here anymore
                throw new IllegalArgumentException("illegal version format - snapshots are only supported until version 2.x");
            }
            final int betaOffset = rawMajor < 5 ? 0 : 25;
            //we reverse the version id calculation based on some assumption as we can't reliably reverse the modulo
            final int major = rawMajor * 1000000;
            final int minor = Integer.parseInt(parts[1]) * 10000;
            final int revision = Integer.parseInt(parts[2]) * 100;

            int build = 99;
            if (parts.length == 4) {
                String buildStr = parts[3];
                if (buildStr.startsWith("alpha")) {
                    assert rawMajor >= 5 : "major must be >= 5 but was " + major;
                    build = Integer.parseInt(buildStr.substring(5));
                    assert build < 25 : "expected a beta build but " + build + " >= 25";
                } else if (buildStr.startsWith("Beta") || buildStr.startsWith("beta")) {
                    build = betaOffset + Integer.parseInt(buildStr.substring(4));
                    assert build < 50 : "expected a beta build but " + build + " >= 50";
                } else if (buildStr.startsWith("RC") || buildStr.startsWith("rc")) {
                    build = Integer.parseInt(buildStr.substring(2)) + 50;
                } else {
                    throw new IllegalArgumentException("unable to parse version " + version);
                }
            }

            return fromId(major + minor + revision + build);

        } catch (NumberFormatException e) {
            throw new IllegalArgumentException("unable to parse version " + version, e);
        }
    }

    public final int id;
    public final byte major;
    public final byte minor;
    public final byte revision;
    public final byte build;
    public final org.apache.lucene.util.Version luceneVersion;

    Version(int id, org.apache.lucene.util.Version luceneVersion) {
        this.id = id;
        this.major = (byte) ((id / 1000000) % 100);
        this.minor = (byte) ((id / 10000) % 100);
        this.revision = (byte) ((id / 100) % 100);
        this.build = (byte) (id % 100);
        this.luceneVersion = luceneVersion;
    }

    public boolean after(Version version) {
        return version.id < id;
    }

    public boolean onOrAfter(Version version) {
        return version.id <= id;
    }

    public boolean before(Version version) {
        return version.id > id;
    }

    public boolean onOrBefore(Version version) {
        return version.id >= id;
    }

    @Override
    public int compareTo(Version other) {
        return Integer.compare(this.id, other.id);
    }

    /**
     * Returns the minimum compatible version based on the current
     * version. Ie a node needs to have at least the return version in order
     * to communicate with a node running the current version. The returned version
     * is in most of the cases the smallest major version release unless the current version
     * is a beta or RC release then the version itself is returned.
     */
    public Version minimumCompatibilityVersion() {
        final int bwcMajor;
        final int bwcMinor;
        if (this.onOrAfter(Version.V_6_0_0_alpha1_UNRELEASED)) {
            bwcMajor = major - 1;
            bwcMinor = 0; // TODO we have to move this to the latest released minor of the last major but for now we just keep
        } else {
            bwcMajor = major;
            bwcMinor = 0;
        }
        return Version.min(this, fromId(bwcMajor * 1000000 + bwcMinor * 10000 + 99));
    }

    /**
     * Returns the minimum created index version that this version supports. Indices created with lower versions
     * can't be used with this version.
     */
    public Version minimumIndexCompatibilityVersion() {
        final int bwcMajor;
        if (major == 5) {
            bwcMajor = 2; // we jumped from 2 to 5
        } else {
            bwcMajor = major - 1;
        }
        final int bwcMinor = 0;
        return Version.min(this, fromId(bwcMajor * 1000000 + bwcMinor * 10000 + 99));
    }

    /**
     * Returns true iff both version are compatible. Otherwise false
     */
    public boolean isCompatible(Version version) {
        boolean compatible = onOrAfter(version.minimumCompatibilityVersion())
            && version.onOrAfter(minimumCompatibilityVersion());

        assert compatible == false || Math.max(major, version.major) - Math.min(major, version.major) <= 1;
        return compatible;
    }

    @SuppressForbidden(reason = "System.out.*")
    public static void main(String[] args) {
        System.out.println("Version: " + Version.CURRENT + ", Build: " + Build.CURRENT.shortHash() + "/" + Build.CURRENT.date() + ", JVM: "
                + JvmInfo.jvmInfo().version());
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(major).append('.').append(minor).append('.').append(revision);
        if (isAlpha()) {
            sb.append("-alpha");
            sb.append(build);
        } else if (isBeta()) {
            if (major >= 2) {
                sb.append("-beta");
            } else {
                sb.append(".Beta");
            }
            sb.append(major < 5 ? build : build-25);
        } else if (build < 99) {
            if (major >= 2) {
                sb.append("-rc");
            } else {
                sb.append(".RC");
            }
            sb.append(build - 50);
        }
        return sb.toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        Version version = (Version) o;

        if (id != version.id) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        return id;
    }

    public boolean isBeta() {
        return major < 5 ? build < 50 : build >= 25 && build < 50;
    }

    /**
     * Returns true iff this version is an alpha version
     * Note: This has been introduced in elasticsearch version 5. Previous versions will never
     * have an alpha version.
     */
    public boolean isAlpha() {
        return major < 5 ? false :  build < 25;
    }

    public boolean isRC() {
        return build > 50 && build < 99;
    }

    public boolean isRelease() {
        return build == 99;
    }
}


text:
#ifndef art_Framework_Services_Optional_SimpleInteraction_h
#define art_Framework_Services_Optional_SimpleInteraction_h

// -*- C++ -*-
//
// Package:     Services
// Class  :     Interfaces/
//
/*

 Description: Allows for reconfiguration of modules at
   start of event loop, and reprocessing, rewind, or continuation at the end.

*/
//
// Original Author:  Jim Kowalkowski and Marc Paterno
//         Created:  Wed Sep 27 2010
//

#include "fhiclcpp/ParameterSet.h"
#include "art/Framework/Services/UserInteraction/UserInteraction.h"
#include "art/Framework/Services/Registry/ServiceMacros.h"
#include "art/Framework/Services/Registry/ServiceTable.h"
#include <vector>

namespace ui {

  class SimpleInteraction : public UserInteraction {
  public:

    struct Config {};

    using Parameters = art::ServiceTable<Config>;
    SimpleInteraction(Parameters const &, art::ActivityRegistry &);

    void moduleList(std::vector<ModuleInfo> const &) override;
    void pickModule() override;
    UserInteraction::NextStep nextAction() override;

  private:
    std::vector<ModuleInfo> infos_;
  };
}

DECLARE_ART_SERVICE(ui::SimpleInteraction, LEGACY)
#endif /* art_Framework_Services_Optional_SimpleInteraction_h */

// Local Variables:
// mode: c++
// End:

redpajama_set_name: RedPajamaGithub


text:
package org.jabref.gui.entryeditor;

import java.util.Collection;

import javafx.scene.control.Tooltip;

import org.jabref.gui.IconTheme;
import org.jabref.gui.autocompleter.SuggestionProviders;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.EntryType;

public class OptionalFields2Tab extends FieldsEditorTab {
    public OptionalFields2Tab(BibDatabaseContext databaseContext, SuggestionProviders suggestionProviders) {
        super(true, databaseContext, suggestionProviders);

        setText(Localization.lang("Optional fields 2"));
        setTooltip(new Tooltip(Localization.lang("Show optional fields")));
        setGraphic(IconTheme.JabRefIcon.OPTIONAL.getGraphicNode());
    }

    @Override
    protected Collection<String> determineFieldsToShow(BibEntry entry, EntryType entryType) {
        return entryType.getSecondaryOptionalNotDeprecatedFields();
    }
}


text:
@interface PTBrowserViewController () <UIActionSheetDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate, PTTaleDisplayViewDelegate> {
    MWPhoto *photoToUse;
    NSUInteger currentPhotoIndex;
    BOOL photoShouldContainTale;
}

@end

@implementation PTBrowserViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];
    if (self) {
        // Init
        self.displayActionButton = YES;
        self.displayNavArrows = YES;
        self.zoomPhotosToFill = YES;
        self.enableGrid = YES;
        self.alwaysShowControls = YES;
        self.delegate = self;

        _photos = [NSMutableArray array];
        _thumbs = [NSMutableArray array];

        [self loadTestImages];
        [self loadRealImages];

    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)reveal:(UIImage *)image {
    if (!image) {
        NSLog(@"Image is nil! Cannot reveal!");
        return;
    }
    [self.navigationController setIndeterminate:YES];
    [self.view setUserInteractionEnabled:NO];
    dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
    dispatch_queue_t main_queue = dispatch_get_main_queue();
    dispatch_async(queue, ^{
        NSString *secretMessage = [PTImageEncrypter secretInImage:image];
        dispatch_async(main_queue, ^{
            [self.navigationController finishProgress];
            [self.view setUserInteractionEnabled:YES];
            if (!secretMessage) {
                UIAlertView *imageHasNoSecretAlert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Tale not found", @"Image Has No Tale Alert") message:NSLocalizedString(@"This image does not contain a tale or it is broken.", @"Image Has No Tale Alert") delegate:self cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil];
                [imageHasNoSecretAlert show];
            } else {
                NSLog(@"%@", secretMessage);
                PTTaleDisplayView *view = [PTTaleDisplayView presentInViewController:self];
                NSDictionary *jsonData = [NSJSONSerialization JSONObjectWithData:[secretMessage dataUsingEncoding:NSUTF8StringEncoding] options:0 error:nil];
                view.title.text = jsonData[@"title"];
                view.description.text = jsonData[@"description"];
                if (jsonData[@"venmoAccount"] && [jsonData[@"venmoAccount"] length] > 0) {
                    view.venmoAccount = jsonData[@"venmoAccount"];
                    view.amount = [jsonData[@"amount"] floatValue];
                    view.payButton.hidden = NO;
                } else {
                    view.payButton.hidden = YES;
                }
            }
        });
    });
}

- (void)action {
    UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Actions" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Add from Camera", @"Add from Gallery", @"Add Photo with Tale", @"Refresh", nil];
    actionSheet.tag = 1123;
    actionSheet.delegate = self;
    [actionSheet showFromBarButtonItem:self.navigationItem.rightBarButtonItem animated:YES];
}

- (void)photoOption {
    UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Images" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Delete" otherButtonTitles:@"Reveal Tale", @"Refresh", nil];
    actionSheet.tag = 319;
    actionSheet.delegate = self;
    [actionSheet showFromBarButtonItem:self.navigationItem.rightBarButtonItem animated:YES];
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([segue.identifier isEqualToString:@"addTaleSegue"]) {
        UINavigationController *nav = segue.destinationViewController;
        PTAddTaleViewController *vc = nav.viewControllers[0];
        [vc setPhoto:photoToUse];
    }
}

- (IBAction)unwindToBrowser:(UIStoryboardSegue *)segue {
    [_photos removeAllObjects];
    [_thumbs removeAllObjects];
    [self loadTestImages];
    [self loadRealImages];
    double delayInSeconds = 2.5;
    dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
    dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
        [self reloadData];
        UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(action)];
        self.navigationItem.rightBarButtonItem = anotherButton;
    });
}

#pragma mark - UIActionSheet Delegate
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
    if (actionSheet.tag == 1023) {

    } else if (actionSheet.tag == 1123) {
        switch (buttonIndex) {
            case 1:
                NSLog(@"Gallery");
                photoShouldContainTale = NO;
                [self startMediaBrowserFromViewController:self sourceType:UIImagePickerControllerSourceTypePhotoLibrary usingDelegate:self];
                break;
            case 0:
                NSLog(@"Camera");
                photoShouldContainTale = NO;
                [self startMediaBrowserFromViewController:self sourceType:UIImagePickerControllerSourceTypeCamera usingDelegate:self];
                break;
            case 2:
                photoShouldContainTale = YES;
                [self startMediaBrowserFromViewController:self sourceType:UIImagePickerControllerSourceTypePhotoLibrary usingDelegate:self];
                break;
            case 3:
                [self unwindToBrowser:nil];
                break;
            default:
                break;
        }
    } else if (actionSheet.tag == 319) {
        switch (buttonIndex) {
            case 0: {
                // Delete
                NSLog(@"Delete %@", [_photos[currentPhotoIndex] filePath]);

                NSFileManager *fileManager = [NSFileManager defaultManager];
                NSError *error;
                BOOL success = [fileManager removeItemAtPath:[_photos[currentPhotoIndex] filePath] error:&error];
                if (success) {
                    UIAlertView *removeSuccessFulAlert=[[UIAlertView alloc]initWithTitle:@"Congratulation:" message:@"Successfully removed" delegate:self cancelButtonTitle:@"Close" otherButtonTitles:nil];
                    [removeSuccessFulAlert show];
                } else {
                    NSLog(@"%@", error);
                }
                [self unwindToBrowser:nil];
                break;
            }
            case 1:
                [self reveal:[_photos[currentPhotoIndex] image]];
                break;
            default:
                break;
        }
    }

}

#pragma mark - Image Picker Delegate
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    NSString *mediaType = info[UIImagePickerControllerMediaType];
    UIImage *originalImage, *editedImage, *imageToUse;

    // Handle a still image picked from a photo album
    if (CFStringCompare ((CFStringRef) mediaType, kUTTypeImage, 0)
        == kCFCompareEqualTo) {

        editedImage = (UIImage *) info[UIImagePickerControllerEditedImage];
        originalImage = (UIImage *) info[UIImagePickerControllerOriginalImage];

        if (editedImage) {
            imageToUse = editedImage;
        } else {
            imageToUse = originalImage;
        }
        // Do something with imageToUse
        photoToUse = [[MWPhoto alloc] initWithImage:imageToUse];
    }

    // Handle a movied picked from a photo album
    if (CFStringCompare ((CFStringRef) mediaType, kUTTypeMovie, 0)
        == kCFCompareEqualTo) {

        // NSString *moviePath = [info[UIImagePickerControllerMediaURL] path];

        // Do something with the picked movie available at moviePath
        NSString *cannotUseMovieComment;
        cannotUseMovieComment = @"Cannot Use Movie Alert";
        UIAlertView *cannotUseMovieAlert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Cannot Use Movie", cannotUseMovieComment) message:NSLocalizedString(@"Please choose a still image.", cannotUseMovieComment) delegate:self cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil];
        [picker dismissViewControllerAnimated:YES completion:^{
            [cannotUseMovieAlert show];
        }];
        return;
    }

    [picker dismissViewControllerAnimated:YES completion:^{
        // Proceed to add tale
        if (!photoShouldContainTale) {
            [self performSegueWithIdentifier:@"addTaleSegue" sender:self];
        } else {
            if (![PTImageEncrypter secretInImage:photoToUse.image]) {
                [self.navigationController setIndeterminate:YES];
                dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
                dispatch_queue_t main_queue = dispatch_get_main_queue();
                dispatch_async(queue, ^{
                    NSData *encodedImageData = UIImagePNGRepresentation(photoToUse.image);

                    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
                    NSString *documentsPath = [paths objectAtIndex  :0]; //Get the docs directory
                    NSString *filePath = [documentsPath stringByAppendingPathComponent:[NSString stringWithFormat:@"image_%@.png", [NSString randomString:8]]]; //Add the file name
                    [encodedImageData writeToFile:filePath atomically:YES]; //Write the file

                    dispatch_async(main_queue, ^{
                        [self.navigationController finishProgress];
                        [self.view setUserInteractionEnabled:YES];
                        [self unwindToBrowser:nil];
                    });
                });
            }
        }
    }];

}

- (BOOL) startMediaBrowserFromViewController: (UIViewController*) controller
                                  sourceType:(UIImagePickerControllerSourceType)sourceType
                               usingDelegate: (id <UIImagePickerControllerDelegate,
                                               UINavigationControllerDelegate>) delegate {

    if (([UIImagePickerController isSourceTypeAvailable:
          UIImagePickerControllerSourceTypeSavedPhotosAlbum] == NO)
        || (delegate == nil)
        || (controller == nil))
        return NO;

    UIImagePickerController *mediaUI = [[UIImagePickerController alloc] init];
    mediaUI.sourceType = sourceType;

    // Displays saved pictures and movies, if both are available, from the
    // Camera Roll album.
    mediaUI.mediaTypes =
    [UIImagePickerController availableMediaTypesForSourceType:
     UIImagePickerControllerSourceTypeSavedPhotosAlbum];

    // Hides the controls for moving & scaling pictures, or for
    // trimming movies. To instead show the controls, use YES.
    mediaUI.allowsEditing = NO;

    mediaUI.delegate = delegate;

    [controller presentViewController:mediaUI animated:YES completion:nil];
    return YES;
}

- (void)loadTestImages {
    MWPhoto *photo;
    photo = [MWPhoto photoWithImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"photo5" ofType:@"jpg"]]];
    photo.caption = @"White Tower";
    [_photos addObject:photo];
    photo = [MWPhoto photoWithImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"photo4" ofType:@"jpg"]]];
    photo.caption = @"Campervan";
    [_photos addObject:photo];
    // Thumbs
    photo = [MWPhoto photoWithImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"photo5t" ofType:@"jpg"]]];
    [_thumbs addObject:photo];
    photo = [MWPhoto photoWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"photo4t" ofType:@"jpg"]]];
    [_thumbs addObject:photo];
}

- (void)loadRealImages {
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSError *error;
    NSArray *directoryContents =  [[NSFileManager defaultManager]
                                   contentsOfDirectoryAtPath:documentsDirectory error:&error];
    if (error) {
        NSLog(@"%@", error);
    }
    NSLog(@"%@", directoryContents);
    for (NSString *imageName in directoryContents) {
        NSString *thePath = [documentsDirectory stringByAppendingPathComponent:imageName];
        MWPhoto *photo = [[MWPhoto alloc] initWithImage:[UIImage imageWithContentsOfFile:thePath]];
        [_photos addObject:photo];
        [_thumbs addObject:photo];
    }

}

#pragma mark - MWPhotoBrowser Delegate
- (NSUInteger)numberOfPhotosInPhotoBrowser:(MWPhotoBrowser *)photoBrowser {
    return _photos.count;
}

- (id <MWPhoto>)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index {
    if (index < _photos.count)
        return [_photos objectAtIndex:index];
    return nil;
}

- (id <MWPhoto>)photoBrowser:(MWPhotoBrowser *)photoBrowser thumbPhotoAtIndex:(NSUInteger)index {
    if (index < _thumbs.count)
        return [_thumbs objectAtIndex:index];
    return nil;
}

- (void)photoBrowser:(MWPhotoBrowser *)photoBrowser didDisplayPhotoAtIndex:(NSUInteger)index {
    NSLog(@"Did start viewing photo at index %lu", (unsigned long)index);
    // Change button to image-specific
    UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc] initWithTitle:@"Photo" style:UIBarButtonItemStylePlain target:self action:@selector(photoOption)];
    self.navigationItem.rightBarButtonItem = anotherButton;
    currentPhotoIndex = index;

}

- (void)photoBrowserDidShowGrid:(MWPhotoBrowser *)photoBrowser {
    NSLog(@"Changing button to add");
    UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(action)];
    self.navigationItem.rightBarButtonItem = anotherButton;
}

#pragma mark - Tale Display View Delegate
- (void)taleDisplayViewRequestPaymentWithVenmo:(NSString *)venmo amount:(NSString *)amount note:(NSString *)note {
    PTAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
    VenmoClient *venmoClient = appDelegate.venmoClient;
    VenmoTransaction *venmoTransaction = [[VenmoTransaction alloc] init];
    venmoTransaction.type = VenmoTransactionTypePay;
    venmoTransaction.amount = [NSDecimalNumber decimalNumberWithString:amount];
    venmoTransaction.note = note;
    venmoTransaction.toUserHandle = venmo;
    VenmoViewController *venmoViewController = [venmoClient viewControllerWithTransaction:
                                                venmoTransaction];
    if (venmoViewController) {
        [self presentViewController:venmoViewController animated:YES completion:nil];
    }
}

@end


text:
import math

def middle(shape):
    """ Given the 2D vertices of a shape, return the coordinates of the middle
        of the shape.
    """
    return (sum(p[0] for p in shape) / len(shape),
            sum(p[1] for p in shape) / len(shape))

def hex_corner(center, size, i, pointy=True):
    """ Given a center, and a size, and a number, return the 2D coordinates of
        that vertex of a hexagon.

        Reference: http://www.redblobgames.com/grids/hexagons/
    """
    angle_deg = 60 * i  + (30 * pointy)
    angle_rad = math.pi / 180 * angle_deg
    return (center[0] + size * math.cos(angle_rad),
            center[1] + size * math.sin(angle_rad))


text:
import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import styles from './accordion.module.scss';
import AccordionPanel from './AccordionPanel';

const sections = ({
  onClick, panels, openText, closeText, disableNumberedList
}) => panels.map((panel, i) => (
  <AccordionPanel
    onClick={onClick}
    openText={openText}
    closeText={closeText}
    key={i}
    open={i === 0}
    number={i + 1}
    disableNumberedList={disableNumberedList}
    {...panel}
  />
));

function Accordion(props) {
  const {
    onClick,
    openText,
    closeText,
    panels,
    className,
    disableNumberedList,
  } = props;

  const classes = cx(
    className,
    styles['accordion'],
  );

  if (!panels) return null;

  return (
    <section className={classes}>
      {sections({
        onClick,
        panels,
        openText,
        closeText,
        disableNumberedList
      })}
    </section>
  );
}

Accordion.propTypes = {

  /**
   * This prop will add a new className to any inherent classNames
   * provided in the component's index.js file.
   */
  className: PropTypes.string,

  /**
   * The text used for the link that will collapse an open accordion section
   * Defaults to 'Close'.
   */
  closeText: PropTypes.string,

  /**
   * The text used for the link that will open up the accordion section
   * Defaults to 'View'.
   */
  openText: PropTypes.string,

  /**
   * Panels: An array of objects that will blossom to become
   * our accordion sections. Requires a `title` and `body`.
   */
  panels: PropTypes.arrayOf(
    PropTypes.shape({
      title: PropTypes.string.isRequired,
      body: PropTypes.string.isRequired
    })
  ),

  /**
   * Whether or not to number the accordion items. Defaults to `true`.
   */
  disableNumberedList: PropTypes.bool,

  /**
   * Use this prop to tack on any extra click functionality.
   */
  onClick: PropTypes.func,
};

Accordion.defaultProps = {
  closeText: 'Close',
  disableNumberedList: false,
  openText: 'View'
};

export default Accordion;


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <style name="Theme.Kore.Default.LightBase" parent="Theme.Material3.Light.NoActionBar">
        <!-- Set status bar color only on v23, given that light style was only available from then on -->
        <item name="android:statusBarColor">@android:color/transparent</item>
        <item name="android:windowLightStatusBar">true</item>
    </style>

</resources>


text:
@implementation NSDate (SPLAdditions)

- (NSString *)SPLShortDateTimeValue {
    static NSDateFormatter *formatter;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        formatter = [NSDateFormatter new];
        formatter.timeStyle = NSDateFormatterShortStyle;
        formatter.dateStyle = NSDateFormatterShortStyle;
    });

    return [formatter stringFromDate:self];
}

- (NSString *)SPLTimeSinceValue {
    NSTimeInterval interval = [[NSDate date] timeIntervalSinceDate:self];

    if (interval < 0) {
        return @""; // wat
    }

    if (interval < 120) {
        return @"just now";
    } else if (interval < 60 * 60) {
        return [NSString stringWithFormat:@"%@ minutes", @(SPLFloat_round((CGFloat)interval / 60))];
    } else if (interval < 60 * 60 * 24) {
        return [NSString stringWithFormat:@"%@ hours", @(SPLFloat_round((CGFloat)interval / (60 * 60)))];
    } else {
        NSInteger days = (NSInteger)SPLFloat_floor((CGFloat)interval / (60 * 60 * 24));
        NSInteger hours = (NSInteger)SPLFloat_floor(((CGFloat)interval - (days * 60 * 60 * 24)) / (60 * 60));
        NSMutableString *str = [NSMutableString string];

        if (days > 0) {
            [str appendFormat:@"%@ day%@",
             @(days),
             (days != 1 ? @"s" : @"")];
        }

        if (hours > 0) {
            if (days > 0) {
                [str appendString:@", "];
            }

            [str appendFormat:@"%@ hour%@",
                @(hours),
                (hours != 1 ? @"s" : @"")];
        }

        return str;
    }
}

@end


text:
package nl.soccar.ui.util;

import javafx.scene.image.Image;
import nl.soccar.library.enumeration.CarType;
import nl.soccar.library.enumeration.TeamColour;

/**
 * Utility class that provides methods regarding used images.
 *
 * @author PTS34A
 */
public final class ImageUtilities {

    private ImageUtilities() {
        // Private method to prevent instantiation.
    }

    /**
     * Converts a CarType and TeamColour to an Image.
     *
     * @param carType The CarType of the image. This will be used to determine
     * what file the image should be loaded from.
     * @param teamColour The TeamColour of the image. This will be used to
     * determine what file the image should be loaded from.
     * @return An Image containing the correct imagesource.
     */
    public static Image getCarImage(CarType carType, TeamColour teamColour) {
        StringBuilder builder = new StringBuilder("resources/images/cars/");
        builder.append(carType.name().toLowerCase());
        builder.append("_");
        builder.append(teamColour.name().toLowerCase());
        builder.append("_texture.png");

        return new Image(builder.toString());
    }

}


text:
package com.intel.analytics.bigdl.dllib.nn.tf

import com.intel.analytics.bigdl.dllib.nn.abstractnn.DataFormat
import com.intel.analytics.bigdl.dllib.tensor.Tensor
import com.intel.analytics.bigdl.dllib.utils.T
import com.intel.analytics.bigdl.dllib.utils.serializer.ModuleSerializationTest

import scala.util.Random

class Conv2DTransposeSerialTest extends ModuleSerializationTest {
  override def test(): Unit = {
    val conv2dTranspose = Conv2DTranspose[Float](2, 2, -1, -1, DataFormat.NHWC).
      setName("conv2dTranspose")
    val inputTensor = Tensor[Int](T(1, 4, 3, 3))
    val kernelSize = Tensor[Float](2, 2, 3, 3).apply1(_ => Random.nextFloat())
    val data = Tensor[Float](1, 2, 2, 3)apply1(_ => Random.nextFloat())
    val input = T(inputTensor, kernelSize, data)
    runSerializationTest(conv2dTranspose, input)
  }
}


text:
@interface ABI43_0_0RNGestureHandlerModule : ABI43_0_0RCTEventEmitter <ABI43_0_0RCTBridgeModule>

@end


text:
The [user guide](User-Guide) should get you up and running quickly and
should answer your most common questions.

If you can't find what you are looking for, please contact us [via
email](mailto:daisy-pipeline@mail.daisy.org).

If you are a developer and you are looking for more technical
documentation, check out the
[developer guide](http://daisy.github.io/pipeline/Contribute/Developer-Guide).

<!--
## Getting Started

## FAQ
-->


text:
#include "core/css/CSSPrimitiveValue.h"

#include "core/css/CSSCalculationValue.h"
#include "core/css/CSSHelper.h"
#include "core/css/CSSMarkup.h"
#include "core/css/CSSToLengthConversionData.h"
#include "core/css/CSSValuePool.h"
#include "platform/LayoutUnit.h"
#include "wtf/SizeAssertions.h"
#include "wtf/StdLibExtras.h"

using namespace WTF;

namespace blink {

namespace {

// Max/min values for CSS, needs to slightly smaller/larger than the true
// max/min values to allow for rounding without overflowing.
// Subtract two (rather than one) to allow for values to be converted to float
// and back without exceeding the LayoutUnit::max.
const int maxValueForCssLength = INT_MAX / kFixedPointDenominator - 2;
const int minValueForCssLength = INT_MIN / kFixedPointDenominator + 2;

}  // namespace

struct SameSizeAsCSSPrimitiveValue : CSSValue {
  double num;
};
ASSERT_SIZE(CSSPrimitiveValue, SameSizeAsCSSPrimitiveValue);

float CSSPrimitiveValue::clampToCSSLengthRange(double value) {
  return clampTo<float>(value, minValueForCssLength, maxValueForCssLength);
}

CSSPrimitiveValue::UnitCategory CSSPrimitiveValue::unitTypeToUnitCategory(
    UnitType type) {
  switch (type) {
    case UnitType::Number:
      return CSSPrimitiveValue::UNumber;
    case UnitType::Percentage:
      return CSSPrimitiveValue::UPercent;
    case UnitType::Pixels:
    case UnitType::Centimeters:
    case UnitType::Millimeters:
    case UnitType::Inches:
    case UnitType::Points:
    case UnitType::Picas:
    case UnitType::UserUnits:
      return CSSPrimitiveValue::ULength;
    case UnitType::Milliseconds:
    case UnitType::Seconds:
      return CSSPrimitiveValue::UTime;
    case UnitType::Degrees:
    case UnitType::Radians:
    case UnitType::Gradians:
    case UnitType::Turns:
      return CSSPrimitiveValue::UAngle;
    case UnitType::Hertz:
    case UnitType::Kilohertz:
      return CSSPrimitiveValue::UFrequency;
    case UnitType::DotsPerPixel:
    case UnitType::DotsPerInch:
    case UnitType::DotsPerCentimeter:
      return CSSPrimitiveValue::UResolution;
    default:
      return CSSPrimitiveValue::UOther;
  }
}

CSSPrimitiveValue* CSSPrimitiveValue::create(double value, UnitType type) {
  // TODO(timloh): This looks wrong.
  if (std::isinf(value))
    value = 0;

  if (value < 0 || value > CSSValuePool::maximumCacheableIntegerValue)
    return new CSSPrimitiveValue(value, type);

  int intValue = static_cast<int>(value);
  if (value != intValue)
    return new CSSPrimitiveValue(value, type);

  CSSValuePool& pool = cssValuePool();
  CSSPrimitiveValue* result = nullptr;
  switch (type) {
    case CSSPrimitiveValue::UnitType::Pixels:
      result = pool.pixelCacheValue(intValue);
      if (!result)
        result = pool.setPixelCacheValue(intValue,
                                         new CSSPrimitiveValue(value, type));
      return result;
    case CSSPrimitiveValue::UnitType::Percentage:
      result = pool.percentCacheValue(intValue);
      if (!result)
        result = pool.setPercentCacheValue(intValue,
                                           new CSSPrimitiveValue(value, type));
      return result;
    case CSSPrimitiveValue::UnitType::Number:
    case CSSPrimitiveValue::UnitType::Integer:
      result = pool.numberCacheValue(intValue);
      if (!result)
        result = pool.setNumberCacheValue(
            intValue,
            new CSSPrimitiveValue(value, CSSPrimitiveValue::UnitType::Integer));
      return result;
    default:
      return new CSSPrimitiveValue(value, type);
  }
}

using CSSTextCache =
    PersistentHeapHashMap<WeakMember<const CSSPrimitiveValue>, String>;

static CSSTextCache& cssTextCache() {
  DEFINE_STATIC_LOCAL(CSSTextCache, cache, ());
  return cache;
}

CSSPrimitiveValue::UnitType CSSPrimitiveValue::typeWithCalcResolved() const {
  if (type() != UnitType::Calc)
    return type();

  switch (m_value.calc->category()) {
    case CalcAngle:
      return UnitType::Degrees;
    case CalcFrequency:
      return UnitType::Hertz;
    case CalcNumber:
      return UnitType::Number;
    case CalcPercent:
      return UnitType::Percentage;
    case CalcLength:
      return UnitType::Pixels;
    case CalcPercentNumber:
      return UnitType::CalcPercentageWithNumber;
    case CalcPercentLength:
      return UnitType::CalcPercentageWithLength;
    case CalcLengthNumber:
      return UnitType::CalcLengthWithNumber;
    case CalcPercentLengthNumber:
      return UnitType::CalcPercentageWithLengthAndNumber;
    case CalcTime:
      return UnitType::Milliseconds;
    case CalcOther:
      return UnitType::Unknown;
  }
  return UnitType::Unknown;
}

CSSPrimitiveValue::CSSPrimitiveValue(double num, UnitType type)
    : CSSValue(PrimitiveClass) {
  init(type);
  ASSERT(std::isfinite(num));
  m_value.num = num;
}

CSSPrimitiveValue::CSSPrimitiveValue(const Length& length, float zoom)
    : CSSValue(PrimitiveClass) {
  switch (length.type()) {
    case Percent:
      init(UnitType::Percentage);
      ASSERT(std::isfinite(length.percent()));
      m_value.num = length.percent();
      break;
    case Fixed:
      init(UnitType::Pixels);
      m_value.num = length.value() / zoom;
      break;
    case Calculated: {
      const CalculationValue& calc = length.getCalculationValue();
      if (calc.pixels() && calc.percent()) {
        init(CSSCalcValue::create(CSSCalcValue::createExpressionNode(
                                      calc.pixels() / zoom, calc.percent()),
                                  calc.getValueRange()));
        break;
      }
      if (calc.percent()) {
        init(UnitType::Percentage);
        m_value.num = calc.percent();
      } else {
        init(UnitType::Pixels);
        m_value.num = calc.pixels() / zoom;
      }
      if (m_value.num < 0 && calc.isNonNegative())
        m_value.num = 0;
      break;
    }
    case Auto:
    case MinContent:
    case MaxContent:
    case FillAvailable:
    case FitContent:
    case ExtendToZoom:
    case DeviceWidth:
    case DeviceHeight:
    case MaxSizeNone:
      ASSERT_NOT_REACHED();
      break;
  }
}

void CSSPrimitiveValue::init(UnitType type) {
  m_primitiveUnitType = static_cast<unsigned>(type);
}

void CSSPrimitiveValue::init(CSSCalcValue* c) {
  init(UnitType::Calc);
  m_hasCachedCSSText = false;
  m_value.calc = c;
}

CSSPrimitiveValue::~CSSPrimitiveValue() {}

double CSSPrimitiveValue::computeSeconds() const {
  ASSERT(isTime() ||
         (isCalculated() && cssCalcValue()->category() == CalcTime));
  UnitType currentType =
      isCalculated() ? cssCalcValue()->expressionNode()->typeWithCalcResolved()
                     : type();
  if (currentType == UnitType::Seconds)
    return getDoubleValue();
  if (currentType == UnitType::Milliseconds)
    return getDoubleValue() / 1000;
  ASSERT_NOT_REACHED();
  return 0;
}

double CSSPrimitiveValue::computeDegrees() const {
  ASSERT(isAngle() ||
         (isCalculated() && cssCalcValue()->category() == CalcAngle));
  UnitType currentType =
      isCalculated() ? cssCalcValue()->expressionNode()->typeWithCalcResolved()
                     : type();
  switch (currentType) {
    case UnitType::Degrees:
      return getDoubleValue();
    case UnitType::Radians:
      return rad2deg(getDoubleValue());
    case UnitType::Gradians:
      return grad2deg(getDoubleValue());
    case UnitType::Turns:
      return turn2deg(getDoubleValue());
    default:
      ASSERT_NOT_REACHED();
      return 0;
  }
}

template <>
int CSSPrimitiveValue::computeLength(
    const CSSToLengthConversionData& conversionData) const {
  return roundForImpreciseConversion<int>(computeLengthDouble(conversionData));
}

template <>
unsigned CSSPrimitiveValue::computeLength(
    const CSSToLengthConversionData& conversionData) const {
  return roundForImpreciseConversion<unsigned>(
      computeLengthDouble(conversionData));
}

template <>
Length CSSPrimitiveValue::computeLength(
    const CSSToLengthConversionData& conversionData) const {
  return Length(clampToCSSLengthRange(computeLengthDouble(conversionData)),
                Fixed);
}

template <>
short CSSPrimitiveValue::computeLength(
    const CSSToLengthConversionData& conversionData) const {
  return roundForImpreciseConversion<short>(
      computeLengthDouble(conversionData));
}

template <>
unsigned short CSSPrimitiveValue::computeLength(
    const CSSToLengthConversionData& conversionData) const {
  return roundForImpreciseConversion<unsigned short>(
      computeLengthDouble(conversionData));
}

template <>
float CSSPrimitiveValue::computeLength(
    const CSSToLengthConversionData& conversionData) const {
  return clampTo<float>(computeLengthDouble(conversionData));
}

template <>
double CSSPrimitiveValue::computeLength(
    const CSSToLengthConversionData& conversionData) const {
  return computeLengthDouble(conversionData);
}

double CSSPrimitiveValue::computeLengthDouble(
    const CSSToLengthConversionData& conversionData) const {
  if (type() == UnitType::Calc)
    return m_value.calc->computeLengthPx(conversionData);
  return conversionData.zoomedComputedPixels(getDoubleValue(), type());
}

void CSSPrimitiveValue::accumulateLengthArray(CSSLengthArray& lengthArray,
                                              double multiplier) const {
  ASSERT(lengthArray.values.size() == LengthUnitTypeCount);

  if (type() == UnitType::Calc) {
    cssCalcValue()->accumulateLengthArray(lengthArray, multiplier);
    return;
  }

  LengthUnitType lengthType;
  bool conversionSuccess = unitTypeToLengthUnitType(type(), lengthType);
  DCHECK(conversionSuccess);
  lengthArray.values[lengthType] +=
      m_value.num * conversionToCanonicalUnitsScaleFactor(type()) * multiplier;
  lengthArray.typeFlags.set(lengthType);
}

double CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor(
    UnitType unitType) {
  double factor = 1.0;
  // FIXME: the switch can be replaced by an array of scale factors.
  switch (unitType) {
    // These are "canonical" units in their respective categories.
    case UnitType::Pixels:
    case UnitType::UserUnits:
    case UnitType::Degrees:
    case UnitType::Milliseconds:
    case UnitType::Hertz:
      break;
    case UnitType::Centimeters:
      factor = cssPixelsPerCentimeter;
      break;
    case UnitType::DotsPerCentimeter:
      factor = 1 / cssPixelsPerCentimeter;
      break;
    case UnitType::Millimeters:
      factor = cssPixelsPerMillimeter;
      break;
    case UnitType::Inches:
      factor = cssPixelsPerInch;
      break;
    case UnitType::DotsPerInch:
      factor = 1 / cssPixelsPerInch;
      break;
    case UnitType::Points:
      factor = cssPixelsPerPoint;
      break;
    case UnitType::Picas:
      factor = cssPixelsPerPica;
      break;
    case UnitType::Radians:
      factor = 180 / piDouble;
      break;
    case UnitType::Gradians:
      factor = 0.9;
      break;
    case UnitType::Turns:
      factor = 360;
      break;
    case UnitType::Seconds:
    case UnitType::Kilohertz:
      factor = 1000;
      break;
    default:
      break;
  }

  return factor;
}

Length CSSPrimitiveValue::convertToLength(
    const CSSToLengthConversionData& conversionData) const {
  if (isLength())
    return computeLength<Length>(conversionData);
  if (isPercentage())
    return Length(getDoubleValue(), Percent);
  ASSERT(isCalculated());
  return Length(cssCalcValue()->toCalcValue(conversionData));
}

double CSSPrimitiveValue::getDoubleValue() const {
  return type() != UnitType::Calc ? m_value.num : m_value.calc->doubleValue();
}

CSSPrimitiveValue::UnitType CSSPrimitiveValue::canonicalUnitTypeForCategory(
    UnitCategory category) {
  // The canonical unit type is chosen according to the way
  // CSSPropertyParser::validUnit() chooses the default unit in each category
  // (based on unitflags).
  switch (category) {
    case UNumber:
      return UnitType::Number;
    case ULength:
      return UnitType::Pixels;
    case UPercent:
      return UnitType::Unknown;  // Cannot convert between numbers and percent.
    case UTime:
      return UnitType::Milliseconds;
    case UAngle:
      return UnitType::Degrees;
    case UFrequency:
      return UnitType::Hertz;
    case UResolution:
      return UnitType::DotsPerPixel;
    default:
      return UnitType::Unknown;
  }
}

bool CSSPrimitiveValue::unitTypeToLengthUnitType(UnitType unitType,
                                                 LengthUnitType& lengthType) {
  switch (unitType) {
    case CSSPrimitiveValue::UnitType::Pixels:
    case CSSPrimitiveValue::UnitType::Centimeters:
    case CSSPrimitiveValue::UnitType::Millimeters:
    case CSSPrimitiveValue::UnitType::Inches:
    case CSSPrimitiveValue::UnitType::Points:
    case CSSPrimitiveValue::UnitType::Picas:
    case CSSPrimitiveValue::UnitType::UserUnits:
      lengthType = UnitTypePixels;
      return true;
    case CSSPrimitiveValue::UnitType::Ems:
    case CSSPrimitiveValue::UnitType::QuirkyEms:
      lengthType = UnitTypeFontSize;
      return true;
    case CSSPrimitiveValue::UnitType::Exs:
      lengthType = UnitTypeFontXSize;
      return true;
    case CSSPrimitiveValue::UnitType::Rems:
      lengthType = UnitTypeRootFontSize;
      return true;
    case CSSPrimitiveValue::UnitType::Chs:
      lengthType = UnitTypeZeroCharacterWidth;
      return true;
    case CSSPrimitiveValue::UnitType::Percentage:
      lengthType = UnitTypePercentage;
      return true;
    case CSSPrimitiveValue::UnitType::ViewportWidth:
      lengthType = UnitTypeViewportWidth;
      return true;
    case CSSPrimitiveValue::UnitType::ViewportHeight:
      lengthType = UnitTypeViewportHeight;
      return true;
    case CSSPrimitiveValue::UnitType::ViewportMin:
      lengthType = UnitTypeViewportMin;
      return true;
    case CSSPrimitiveValue::UnitType::ViewportMax:
      lengthType = UnitTypeViewportMax;
      return true;
    default:
      return false;
  }
}

CSSPrimitiveValue::UnitType CSSPrimitiveValue::lengthUnitTypeToUnitType(
    LengthUnitType type) {
  switch (type) {
    case UnitTypePixels:
      return CSSPrimitiveValue::UnitType::Pixels;
    case UnitTypeFontSize:
      return CSSPrimitiveValue::UnitType::Ems;
    case UnitTypeFontXSize:
      return CSSPrimitiveValue::UnitType::Exs;
    case UnitTypeRootFontSize:
      return CSSPrimitiveValue::UnitType::Rems;
    case UnitTypeZeroCharacterWidth:
      return CSSPrimitiveValue::UnitType::Chs;
    case UnitTypePercentage:
      return CSSPrimitiveValue::UnitType::Percentage;
    case UnitTypeViewportWidth:
      return CSSPrimitiveValue::UnitType::ViewportWidth;
    case UnitTypeViewportHeight:
      return CSSPrimitiveValue::UnitType::ViewportHeight;
    case UnitTypeViewportMin:
      return CSSPrimitiveValue::UnitType::ViewportMin;
    case UnitTypeViewportMax:
      return CSSPrimitiveValue::UnitType::ViewportMax;
    case LengthUnitTypeCount:
      break;
  }
  ASSERT_NOT_REACHED();
  return CSSPrimitiveValue::UnitType::Unknown;
}

static String formatNumber(double number, const StringView& suffix) {
#if OS(WIN) && _MSC_VER < 1900
  unsigned oldFormat = _set_output_format(_TWO_DIGIT_EXPONENT);
#endif
  String result = String::format("%.6g", number);
#if OS(WIN) && _MSC_VER < 1900
  _set_output_format(oldFormat);
#endif
  result.append(suffix);
  return result;
}

const char* CSSPrimitiveValue::unitTypeToString(UnitType type) {
  switch (type) {
    case UnitType::Number:
    case UnitType::Integer:
    case UnitType::UserUnits:
      return "";
    case UnitType::Percentage:
      return "%";
    case UnitType::Ems:
    case UnitType::QuirkyEms:
      return "em";
    case UnitType::Exs:
      return "ex";
    case UnitType::Rems:
      return "rem";
    case UnitType::Chs:
      return "ch";
    case UnitType::Pixels:
      return "px";
    case UnitType::Centimeters:
      return "cm";
    case UnitType::DotsPerPixel:
      return "dppx";
    case UnitType::DotsPerInch:
      return "dpi";
    case UnitType::DotsPerCentimeter:
      return "dpcm";
    case UnitType::Millimeters:
      return "mm";
    case UnitType::Inches:
      return "in";
    case UnitType::Points:
      return "pt";
    case UnitType::Picas:
      return "pc";
    case UnitType::Degrees:
      return "deg";
    case UnitType::Radians:
      return "rad";
    case UnitType::Gradians:
      return "grad";
    case UnitType::Milliseconds:
      return "ms";
    case UnitType::Seconds:
      return "s";
    case UnitType::Hertz:
      return "hz";
    case UnitType::Kilohertz:
      return "khz";
    case UnitType::Turns:
      return "turn";
    case UnitType::Fraction:
      return "fr";
    case UnitType::ViewportWidth:
      return "vw";
    case UnitType::ViewportHeight:
      return "vh";
    case UnitType::ViewportMin:
      return "vmin";
    case UnitType::ViewportMax:
      return "vmax";
    case UnitType::Unknown:
    case UnitType::Calc:
    case UnitType::CalcPercentageWithNumber:
    case UnitType::CalcPercentageWithLength:
    case UnitType::CalcLengthWithNumber:
    case UnitType::CalcPercentageWithLengthAndNumber:
      break;
  };
  ASSERT_NOT_REACHED();
  return "";
}

String CSSPrimitiveValue::customCSSText() const {
  if (m_hasCachedCSSText) {
    ASSERT(cssTextCache().contains(this));
    return cssTextCache().get(this);
  }

  String text;
  switch (type()) {
    case UnitType::Unknown:
      // FIXME
      break;
    case UnitType::Integer:
      text = String::format("%d", getIntValue());
      break;
    case UnitType::Number:
    case UnitType::Percentage:
    case UnitType::Ems:
    case UnitType::QuirkyEms:
    case UnitType::Exs:
    case UnitType::Rems:
    case UnitType::Chs:
    case UnitType::Pixels:
    case UnitType::Centimeters:
    case UnitType::DotsPerPixel:
    case UnitType::DotsPerInch:
    case UnitType::DotsPerCentimeter:
    case UnitType::Millimeters:
    case UnitType::Inches:
    case UnitType::Points:
    case UnitType::Picas:
    case UnitType::UserUnits:
    case UnitType::Degrees:
    case UnitType::Radians:
    case UnitType::Gradians:
    case UnitType::Milliseconds:
    case UnitType::Seconds:
    case UnitType::Hertz:
    case UnitType::Kilohertz:
    case UnitType::Turns:
    case UnitType::Fraction:
    case UnitType::ViewportWidth:
    case UnitType::ViewportHeight:
    case UnitType::ViewportMin:
    case UnitType::ViewportMax:
      text = formatNumber(m_value.num, unitTypeToString(type()));
      break;
    case UnitType::Calc:
      text = m_value.calc->customCSSText();
      break;
    case UnitType::CalcPercentageWithNumber:
    case UnitType::CalcPercentageWithLength:
    case UnitType::CalcLengthWithNumber:
    case UnitType::CalcPercentageWithLengthAndNumber:
      ASSERT_NOT_REACHED();
      break;
  }

  ASSERT(!cssTextCache().contains(this));
  cssTextCache().set(this, text);
  m_hasCachedCSSText = true;
  return text;
}

bool CSSPrimitiveValue::equals(const CSSPrimitiveValue& other) const {
  if (type() != other.type())
    return false;

  switch (type()) {
    case UnitType::Unknown:
      return false;
    case UnitType::Number:
    case UnitType::Integer:
    case UnitType::Percentage:
    case UnitType::Ems:
    case UnitType::Exs:
    case UnitType::Rems:
    case UnitType::Pixels:
    case UnitType::Centimeters:
    case UnitType::DotsPerPixel:
    case UnitType::DotsPerInch:
    case UnitType::DotsPerCentimeter:
    case UnitType::Millimeters:
    case UnitType::Inches:
    case UnitType::Points:
    case UnitType::Picas:
    case UnitType::UserUnits:
    case UnitType::Degrees:
    case UnitType::Radians:
    case UnitType::Gradians:
    case UnitType::Milliseconds:
    case UnitType::Seconds:
    case UnitType::Hertz:
    case UnitType::Kilohertz:
    case UnitType::Turns:
    case UnitType::ViewportWidth:
    case UnitType::ViewportHeight:
    case UnitType::ViewportMin:
    case UnitType::ViewportMax:
    case UnitType::Fraction:
      return m_value.num == other.m_value.num;
    case UnitType::Calc:
      return m_value.calc && other.m_value.calc &&
             m_value.calc->equals(*other.m_value.calc);
    case UnitType::Chs:
    case UnitType::CalcPercentageWithNumber:
    case UnitType::CalcPercentageWithLength:
    case UnitType::CalcLengthWithNumber:
    case UnitType::CalcPercentageWithLengthAndNumber:
    case UnitType::QuirkyEms:
      return false;
  }
  return false;
}

DEFINE_TRACE_AFTER_DISPATCH(CSSPrimitiveValue) {
  switch (type()) {
    case UnitType::Calc:
      visitor->trace(m_value.calc);
      break;
    default:
      break;
  }
  CSSValue::traceAfterDispatch(visitor);
}

}  // namespace blink


text:
<?php
session_start();
if(!isset($_SESSION['adminlogin'])) {
	header("location: login.php");
}
?>
<?php require_once('../Connections/connect_supply.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) {
  $insertSQL = sprintf("INSERT INTO categories (cat_soort, cat_beschrijving, cat_tandkies, cat_actief) VALUES (%s, %s, %s, %s)",
                       GetSQLValueString($_POST['cat_soort'], "text"),
                       GetSQLValueString($_POST['cat_beschrijving'], "text"),
                       GetSQLValueString($_POST['cat_tandkies'], "text"),
                       GetSQLValueString(isset($_POST['cat_actief']) ? "true" : "", "defined","1","0"));

  mysql_select_db($database_connect_supply, $connect_supply);
  $Result1 = mysql_query($insertSQL, $connect_supply) or die(mysql_error());

  $insertGoTo = "cat.php";
  header(sprintf("Location: %s", $insertGoTo));
}

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
  $updateSQL = sprintf("UPDATE categories SET cat_soort=%s, cat_beschrijving=%s, cat_tandkies=%s, cat_actief=%s WHERE cat_id=%s",
                       GetSQLValueString($_POST['cat_soort'], "text"),
                       GetSQLValueString($_POST['cat_beschrijving'], "text"),
                       GetSQLValueString($_POST['cat_tandkies'], "text"),
                       GetSQLValueString(isset($_POST['cat_actief']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString($_POST['cat_id'], "int"));

  mysql_select_db($database_connect_supply, $connect_supply);
  $Result1 = mysql_query($updateSQL, $connect_supply) or die(mysql_error());

  $updateGoTo = "cat.php";
  header(sprintf("Location: %s", $updateGoTo));
}

mysql_select_db($database_connect_supply, $connect_supply);
$query_Cat_Query = "SELECT * FROM categories";
$Cat_Query = mysql_query($query_Cat_Query, $connect_supply) or die(mysql_error());
$row_Cat_Query = mysql_fetch_assoc($Cat_Query);
$totalRows_Cat_Query = mysql_num_rows($Cat_Query);

$cat_var_CatData = "0";
if (isset($_GET['recordID'])) {
  $cat_var_CatData = $_GET['recordID'];
}
mysql_select_db($database_connect_supply, $connect_supply);
$query_CatData = sprintf("SELECT * FROM categories WHERE categories.cat_id = %s", GetSQLValueString($cat_var_CatData, "int"));
$CatData = mysql_query($query_CatData, $connect_supply) or die(mysql_error());
$row_CatData = mysql_fetch_assoc($CatData);
$totalRows_CatData = mysql_num_rows($CatData);
?>
<!doctype html>

<meta charset="utf-8">
<title>Supply CVBA || Administratie</title>

<link href="../CSS/twoColFixLtHdr.css" rel="stylesheet" type="text/css">

Admin

Categorieën

Producten

Kleuren

Klanten

Users

Bestellingen

Teksten

Database

Statistieken

	 <?php if(isset($_GET['recordID']) && $_GET['recordID'] != 'new') { ?>

<?php echo $row_CatData['cat_soort'] . " " . $row_CatData['cat_beschrijving'] . " " . $row_CatData['cat_tandkies']; ?>

    <form method="post" name="form1" action="<?php echo $editFormAction; ?>">

          Soort:
          <input type="text" name="cat_soort" value="<?php echo htmlentities($row_CatData['cat_soort'], ENT_COMPAT, 'utf-8'); ?>" size="32">

          Beschrijving:
          <input type="text" name="cat_beschrijving" value="<?php echo htmlentities($row_CatData['cat_beschrijving'], ENT_COMPAT, 'utf-8'); ?>" size="32">

          Tandsoort
          <select name="cat_tandkies">
            <option value="Molaren" <?php if (!(strcmp("Molaren", htmlentities($row_CatData['cat_tandkies'], ENT_COMPAT, 'utf-8')))) {echo "SELECTED";} ?>>Molaren</option>
            <option value="Tanden" <?php if (!(strcmp("Tanden", htmlentities($row_CatData['cat_tandkies'], ENT_COMPAT, 'utf-8')))) {echo "SELECTED";} ?>>Tanden</option>
          </select>

          Actief:
          <input type="checkbox" name="cat_actief" value=""  <?php if (!(strcmp(htmlentities($row_CatData['cat_actief']),1))) {echo "checked=\"checked\"";} ?>>

          <input type="submit" value="Aanpassen" class="submitbutton">

            <a href="cat_delete.php?recordID=<?php echo $row_CatData['cat_id']; ?>">Deze categorie verwijderen?

      <input type="hidden" name="MM_update" value="form1">
      <input type="hidden" name="cat_id" value="<?php echo $row_CatData['cat_id']; ?>">
    </form>

Terug naar de lijst

    <?php }
     else if(isset($_GET['recordID']) && $_GET['recordID'] == 'new') { ?>

Nieuwe categorie toevoegen

    <form method="post" name="form2" action="<?php echo $editFormAction; ?>">

          Soort:
          <select name="cat_soort">
            <option value="CERAM" <?php if (!(strcmp("CERAM", ""))) {echo "SELECTED";} ?>>CERAM</option>
            <option value="ACRYL" <?php if (!(strcmp("ACRYL", ""))) {echo "SELECTED";} ?>>ACRYL</option>
          </select>

          Beschrijving:
          <input type="text" name="cat_beschrijving" value="" size="32">

          Tandsoort:
          <select name="cat_tandkies">
            <option value="Molaren" <?php if (!(strcmp("Molaren", ""))) {echo "SELECTED";} ?>>Molaren</option>
            <option value="Tanden" <?php if (!(strcmp("Tanden", ""))) {echo "SELECTED";} ?>>Tanden</option>
          </select>

          Actief
          <input type="checkbox" name="cat_actief" value="" checked>

          <input type="submit" value="Toevoegen" class="submitbutton">

      <input type="hidden" name="MM_insert" value="form2">
    </form>

Terug naar de lijst

<?php }
	 else { ?>

Categorieën

    	      ID
    	      Naam
    	      Actief

			<?php do { ?>

    	      <a href="cat.php?recordID=<?php echo $row_Cat_Query['cat_id'];?>"><?php echo $row_Cat_Query['cat_id']; ?>
    	      <a href="cat.php?recordID=<?php echo $row_Cat_Query['cat_id'];?>"><?php echo $row_Cat_Query['cat_soort'] . " " . $row_Cat_Query['cat_beschrijving'] . " " . $row_Cat_Query['cat_tandkies']; ?>
             <?php if( $row_Cat_Query['cat_actief'] == 1 ) { ?>
				 <a href="cat.php?recordID=<?php echo $row_Cat_Query['cat_id'];?>">Ja
			 <?php }
			 else { ?>
				 <a href="cat.php?recordID=<?php echo $row_Cat_Query['cat_id'];?>">Nee
			 <?php } ?>

			<?php } while ($row_Cat_Query = mysql_fetch_assoc($Cat_Query)); ?>

    		<form method="get" id="new">
                <input type="hidden" value="new" name="recordID" />
                <input type="submit" class="submitbutton" value="Nieuw" />
            </form>

    <?php } ?>

Copyright © Supply CVBA

    	Matteottistraat 65

		2845 Niel

		België

		Tel.: +32(0)3 888 68 61

		GSM:  +32(0)483 08 33 22

<?php
mysql_free_result($Cat_Query);

mysql_free_result($CatData);
?>


text:
<?php

namespace PHPixie\Tests\Auth;

/**
 * @coversDefaultClass \PHPixie\Auth\Context
 */
class ContextTest extends \PHPixie\Test\Testcase
{
    protected $context;

    public function setUp()
    {
        $this->context = new \PHPixie\Auth\Context();
    }

    /**
     * @covers ::setUser
     * @covers ::user
     * @covers ::unsetUser
     * @covers ::usedProvider
     * @covers ::<protected>
     */
    public function testContext()
    {
        $this->assertNoUser();

        $defaultUser = $this->getUser();
        $pixieUser = $this->getUser();

        $this->context->setUser($defaultUser);
        $this->context->setUser($pixieUser, 'pixie', 'password');

        $this->assertSame($defaultUser, $this->context->user());
        $this->assertSame(null, $this->context->usedProvider());

        $this->assertSame($pixieUser, $this->context->user('pixie'));
        $this->assertSame('password', $this->context->usedProvider('pixie'));

        $this->context->unsetUser();
        $this->assertNoUser();

        $this->context->unsetUser('pixie');
        $this->assertNoUser('pixie');

        $this->assertNoUser('trixie');
        $this->context->unsetUser('trixie');
    }

    protected function assertNoUser($domain = null)
    {
        $params = array();
        if($domain !== null) {
            $params[]= $domain;
        }

        foreach(array('user', 'usedProvider') as $method) {
            $callback = array($this->context, $method);
            $result = call_user_func_array($callback, $params);
            $this->assertSame(null, $result);
        }
    }

    protected function getUser()
    {
        return $this->quickMock('\PHPixie\Auth\Repositories\Repository\User');
    }
}


text:
#pragma once

#include <osquery/core/query.h>
#include <osquery/dispatcher/dispatcher.h>
#include <osquery/extensions/extensions.h>

namespace osquery {

/**
 * An option is a 'basic' flag, the only important information is value.
 */
struct Option {
  /// Current flag value.
  std::string value;
  /// Initial flag value.
  std::string default_value;
  /// String representation of type (unused).
  std::string type;
};

/// This is replicated from the Thrift IDL.
enum class ExtensionCode {
  EXT_SUCCESS = 0,
  EXT_FAILED = 1,
  EXT_FATAL = 2,
};

using OptionList = std::map<std::string, Option>;
using ExtensionRouteTable = std::map<std::string, PluginResponse>;
using ExtensionRegistry = std::map<std::string, ExtensionRouteTable>;

/**
 * @brief The basic API functions that our Thrift server and client implements.
 *
 * We include this abstract to force the server (interface) and clients to
 * include the required APIs.
 *
 * For each interface, a child must implement the actual Thrift endpoints and
 * call the methods included here, which contain the logic. This is a little
 * bit of overhead that was already a sunk cost for osquery-- meaning we
 * were already translating Thrift structures to library structures.
 */
class ExtensionAPI {
 public:
  virtual ~ExtensionAPI() = default;

 public:
  virtual Status ping() = 0;
  virtual Status call(const std::string& registry,
                      const std::string& item,
                      const PluginRequest& request,
                      PluginResponse& response) = 0;
  virtual void shutdown() = 0;
};

class ExtensionManagerAPI {
 public:
  virtual ~ExtensionManagerAPI() = default;

 public:
  virtual ExtensionList extensions() = 0;
  virtual OptionList options() = 0;
  virtual Status registerExtension(const ExtensionInfo& info,
                                   const ExtensionRegistry& registry,
                                   RouteUUID& uuid) = 0;
  virtual Status deregisterExtension(RouteUUID uuid) = 0;
  virtual Status query(const std::string& sql, QueryData& qd) = 0;
  virtual Status getQueryColumns(const std::string& sql, QueryData& qd) = 0;
};

/**
 * @brief The Thrift API server used by an osquery Extension process.
 *
 * An extension will load and start a thread to serve the ExtensionHandler
 * Thrift runloop. This handler is the implementation of the thrift IDL spec.
 * It implements all the Extension API handlers.
 *
 */
class ExtensionInterface : public ExtensionAPI {
 public:
  ExtensionInterface() : ExtensionInterface(0) {}
  explicit ExtensionInterface(RouteUUID uuid) : uuid_(uuid) {}

 public:
  virtual Status ping() override;
  virtual Status call(const std::string& registry,
                      const std::string& item,
                      const PluginRequest& request,
                      PluginResponse& response) override;
  virtual void shutdown() override;

 protected:
  /// Transient UUID assigned to the extension after registering.
  std::atomic<RouteUUID> uuid_;
};

/**
 * @brief The Thrift API server used by an osquery process.
 *
 * An extension will load and start a thread to serve the
 * ExtensionManagerHandler. This listens for extensions and allows them to
 * register their Registry route information. Calls to the registry may then
 * match a route exposed by an extension.
 * This handler is the implementation of the thrift IDL spec.
 * It implements all the ExtensionManager API handlers.
 *
 */
class ExtensionManagerInterface : public ExtensionInterface,
                                  public ExtensionManagerAPI {
 public:
  /// Return a list of Route UUIDs and extension metadata.
  virtual ExtensionList extensions() override;

  /**
   * @brief Return a map of osquery options (Flags, bootstrap CLI flags).
   *
   * osquery options are set via command line flags or overridden by a config
   * options dictionary. There are some CLI-only flags that should never
   * be overridden. If a bootstrap flag is changed there is undefined behavior
   * since bootstrap candidates are settings needed before a configuration
   * plugin is setUp.
   *
   * Extensions may broadcast config or logger plugins that need a snapshot
   * of the current options. The best example is the `config_plugin` bootstrap
   * flag.
   */
  virtual OptionList options() override;

  /**
   * @brief Request a Route UUID and advertise a set of Registry routes.
   *
   * When an Extension starts it must call registerExtension using a well known
   * ExtensionManager UNIX domain socket path. The ExtensionManager will check
   * the broadcasted routes for duplicates as well as enforce SDK version
   * compatibility checks. On success the Extension is returned a Route UUID and
   * begins to serve the ExtensionHandler Thrift API.
   *
   * @return The output Status and optional assigned RouteUUID.
   * @param info The osquery Thrift-internal Extension metadata container.
   * @param registry The Extension's Registry::getBroadcast information.
   */
  virtual Status registerExtension(const ExtensionInfo& info,
                                   const ExtensionRegistry& registry,
                                   RouteUUID& uuid) override;

  /**
   * @brief Request an Extension removal and removal of Registry routes.
   *
   * When an Extension process is graceful killed it should deregister.
   * Other privileged tools may choose to deregister an Extension by
   * the transient Extension's Route UUID, obtained using
   * ExtensionManagerHandler::extensions.
   *
   * @param _return The output Status.
   * @param uuid The assigned Route UUID to deregister.
   */
  virtual Status deregisterExtension(RouteUUID uuid) override;

  /**
   * @brief Execute an SQL statement in osquery core.
   *
   * Extensions do not have access to the internal SQLite implementation.
   * For complex queries (beyond select all from a table) the statement must
   * be passed into SQLite.
   *
   * @param _return The output Status and QueryData (as response).
   * @param sql The sql statement.
   */
  virtual Status query(const std::string& sql, QueryData& qd) override;

  /**
   * @brief Get SQL column information for SQL statements in osquery core.
   *
   * Extensions do not have access to the internal SQLite implementation.
   * For complex queries (beyond metadata for a table) the statement must
   * be passed into SQLite.
   *
   * @param _return The output Status and TableColumns (as response).
   * @param sql The sql statement.
   */
  virtual Status getQueryColumns(const std::string& sql,
                                 QueryData& qd) override;

 private:
  /// Check if an extension exists by the name it registered.
  bool exists(const std::string& name);

  /// Introspect into the registry, checking if any extension routes have been
  /// removed.
  void refresh();

  /// Maintain a map of extension UUID to metadata for tracking deregistration.
  ExtensionList extensions_;

  /// Mutex for extensions accessors.
  Mutex extensions_mutex_;
};

struct ImplExtensionRunner;
struct ImplExtensionClient;

/**
 * This implements a small API around setting up and running Thrift
 * Servers. The implementation details and members are private and stored in
 * the PIMPL structures defined above.
 *
 * An implementation will exist for Apache Thrift and for FBThrift.
 */
class ExtensionRunnerInterface {
 public:
  virtual ~ExtensionRunnerInterface();
  ExtensionRunnerInterface();

  /**
   * Call into the Thrift server's server implementation.
   */
  void serve();

  /// Set up structures.
  void connect();

  /// Create handler/processor.
  void init(RouteUUID uuid, bool manager = false);

  /// Stop server.
  void stopServer();

  /// Stop server manager.
  void stopServerManager();

 protected:
  /// The UNIX domain socket used for requests from the ExtensionManager.
  std::string path_;

  /// True if the extension is an extension manager.
  bool manager_;

  /// Thrift server implementation.
  std::unique_ptr<ImplExtensionRunner> server_;
};

class ExtensionRunnerCore : public InternalRunnable,
                            public ExtensionRunnerInterface {
 public:
  virtual ~ExtensionRunnerCore();
  explicit ExtensionRunnerCore(const std::string& path);

 public:
  /// Given a handler transport and protocol start a thrift threaded server.
  void startServer();

  // The Dispatcher thread service stop point.
  void stop() override;

 protected:
  /// Protect the service start and stop, this mutex protects server creation.
  Mutex service_start_;

  /// Record a dispatcher's request to stop the service.
  bool service_stopping_{false};
};

/**
 * @brief A Dispatcher service thread that starts ExtensionHandler.
 *
 * This runner will start a Thrift Extension server, call serve, and wait
 * until the extension exists or the ExtensionManager (core) terminates or
 * deregisters the extension.
 *
 */
class ExtensionRunner : public ExtensionRunnerCore {
 public:
  ExtensionRunner(const std::string& manager_path, RouteUUID uuid);

 public:
  void start() override;

  /// Access the UUID provided by the ExtensionManager.
  RouteUUID getUUID() const;

 private:
  /// The unique and transient Extension UUID assigned by the ExtensionManager.
  RouteUUID uuid_;
};

/**
 * @brief A Dispatcher service thread that starts ExtensionManagerHandler.
 *
 * This runner will start a Thrift ExtensionManager server, call serve, and wait
 * until for extensions to register, or thrift API calls.
 *
 */
class ExtensionManagerRunner : public ExtensionRunnerCore {
 public:
  virtual ~ExtensionManagerRunner();
  explicit ExtensionManagerRunner(const std::string& manager_path);

 public:
  void start() override;
};

/// Internal accessor for extension clients.
class ExtensionClientCore : private boost::noncopyable {
 public:
  virtual ~ExtensionClientCore();

 public:
  /**
   * @brief Initialize the UNIX socket from a string pathname.
   *
   * A very basic client can just store the string.
   * More complex clients can create the client structure.
   */
  void init(const std::string& path, bool manager = false);

  /// Set the receive and send timeout.
  void setTimeouts(size_t timeout);

  /// Check if the client is an extension manager.
  bool manager();

 protected:
  /// Path to extension server socket.
  std::string path_;

  /// True if the client is an extension manager client.
  bool manager_;

  /// Thrift client implementation.
  std::unique_ptr<ImplExtensionClient> client_;
};

/// Internal accessor for a client to an extension (from an extension manager).
class ExtensionClient : public ExtensionClientCore, public ExtensionAPI {
 public:
  /**
   * @brief Create a client to a client extension.
   *
   * @note The default timeout to wait for buffered (whole-content) responses
   * is 5 minutes.
   * @param path This is the socket path for the client communication.
   * @param timeout [optional] time in milliseconds to wait for input.
   */
  explicit ExtensionClient(const std::string& path, size_t timeout = 5000 * 60);
  ~ExtensionClient();

 protected:
  ExtensionClient() = default;

 public:
  /// Ping a server and have it fill in the extension's UUID as the code.
  Status ping() override;

  /// Call an extension's plugin.
  Status call(const std::string& registry,
              const std::string& item,
              const PluginRequest& request,
              PluginResponse& response) override;

  /// Request that the extension stop.
  void shutdown() override;
};

/// Internal accessor for a client to an extension manager (from an extension).
class ExtensionManagerClient : public ExtensionClient,
                               public ExtensionManagerAPI {
 public:
  /**
   * @brief Create a client to a manager extension.
   *
   * @param path This is the socket path for the manager communication.
   * @param timeout [optional] time in milliseconds to wait for input.
   */
  explicit ExtensionManagerClient(const std::string& path,
                                  size_t timeout = 5000 * 60);
  ~ExtensionManagerClient();

 public:
  /// List all osquery extensions.
  ExtensionList extensions() override;

  /// List all osquery options (gflags).
  OptionList options() override;

  /// Regiester yourself as a new extension.
  Status registerExtension(const ExtensionInfo& info,
                           const ExtensionRegistry& registry,
                           RouteUUID& uuid) override;

  /// Remove an extension.
  Status deregisterExtension(RouteUUID uuid) override;

  /// Issue a query.
  Status query(const std::string& sql, QueryData& qd) override;

  /// Get column information from a query.
  Status getQueryColumns(const std::string& sql, QueryData& qd) override;
};

/// Attempt to remove all stale extension sockets.
void removeStalePaths(const std::string& manager);
} // namespace osquery


text:
<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
            /**
             * external bundles
             */
            new FOS\UserBundle\FOSUserBundle(),
            new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),
            /**
             * my bundles
             */
            new Application\Frontend\FrontendBundle\ApplicationFrontendFrontendBundle(),
            new Application\Backend\BackendBundle\ApplicationBackendBackendBundle(),
            new Application\Backend\UserBundle\ApplicationBackendUserBundle(),
            new Application\Common\CommonBundle\ApplicationCommonCommonBundle(),
        );

        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
        }

        return $bundles;
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
    }
}


text:
package com.pachakutech.undead_digest;

import java.util.Calendar;
import java.util.concurrent.TimeUnit;

import android.app.AlarmManager;
import android.app.IntentService;
import android.app.PendingIntent;
import android.content.Intent;
import android.content.SharedPreferences;

public class SetAlarmFromSaveGame extends IntentService {
    int SECONDS_TO_SCAN = 5;

	public SetAlarmFromSaveGame() {
    	super("SetAlarmFromSaveGame");
    }

    protected void onHandleIntent(Intent throwaway) {
    	setAlarm(loadGame());
    	stopSelf();
    }

    private Intent loadGame() {

		SharedPreferences gamestate = getSharedPreferences(getString(R.string.prefs_name), 0);

		//this will be the intent for rest of the game
		Intent intent = new Intent(this, PylonService.class);

		//Toast.makeText(getBaseContext(), "loadgame", Toast.LENGTH_SHORT).show();

		//define intent extras from saved gamestate

		intent.putExtra("newgame", gamestate.getBoolean("newgame", false));
		intent.putExtra("zombie", gamestate.getBoolean("zombie", false));
		intent.putExtra("pistol", gamestate.getBoolean("pistol", true));
		intent.putExtra("ax", gamestate.getBoolean("ax", false));
		intent.putExtra("messenger_bag", gamestate.getBoolean("messenger_bag", false));
		intent.putExtra("chainsaw", gamestate.getBoolean("chainsaw", false));
		intent.putExtra("crossbow", gamestate.getBoolean("crossbow", false));
		intent.putExtra("molotovs", gamestate.getInt("molotovs", 0));
		intent.putExtra("garlic_cloves", gamestate.getInt("garlic_cloves", 0));
		intent.putExtra("bottles", gamestate.getInt("bottles", 0));
		intent.putExtra("lastkill", gamestate.getString("lastkill", "0000000000000"));
		intent.putExtra("weapon", gamestate.getString("weapon", "pistol"));
		intent.putExtra("hit", false);

        return intent;
	}

    private void setAlarm(Intent intent) {

    	boolean zombie = intent.getBooleanExtra("zombie", true);
		if (!zombie){

    	//get a Calendar object with the current time
		Calendar cal = Calendar.getInstance();

		//wait 15 seconds until first instance
		cal.add(Calendar.SECOND, SECONDS_TO_SCAN);

		//create pending intent
		PendingIntent sender = PendingIntent.getBroadcast(getBaseContext(), 952857, intent, PendingIntent.FLAG_UPDATE_CURRENT);

        //get the alarm manager service
		AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);
//		am.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), TimeUnit.SECONDS.toMillis(15), sender);
		am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender);
		}
		stopSelf();

    }

}


text:
var MultiGestureHMM = function(providedConfig){
  this.config={
    singularModel:ContinousHMM,
    modelInitializer:function(model){
      model.initializeDefaultProbabilities();}
    };

    for (var attrname in providedConfig)  {
      this.config[attrname] = providedConfig[attrname];
    }

    var gesturesModels={};
    var gesturesNames=[];
    var globalCallbacks=[];

    this.reset = function(){
      gesturesNames.forEach(function(gestureName){gesturesModels[gestureName].reset();});
    };

    this.calculatePath=function(observations){
     return gesturesNames.map(function(gestureName){
      return {'name':gestureName,'data':gesturesModels[gestureName].calculatePath(observations)};
    }).reduce(function(reduce,returned){return returned.data[0]>reduce.data[0]?returned:reduce;},{name:undefined,'data':[-1]});
   };

   this.newSymbol=function(symbol){
    gesturesNames.forEach(function(gestureName){gesturesModels[gestureName].newSymbol(symbol);});
  };

  this.onDetect=function(callback,geasture){
    if(geasture){
      gesturesModels[geasture].onDetect(callback);
    }else{
      gesturesNames.forEach(function(gestureName){
        gesturesModels[gestureName].onDetect(function(data){
          callback({'name':gestureName,'data':data});
        });
      });
      globalCallbacks.push(callback);
    }

  };

  this.teach=function(geasture,observations){
    var model=new this.config.singularModel(this.config);
    this.config.modelInitializer(model);
    model.teach(observations);
    gesturesModels[geasture]=model;
    gesturesNames.push(geasture);
    globalCallbacks.forEach(function(callback){
      model.onDetect(function(data){callback({'name':geasture,'data':data});});
    });
  };
};

// Version.
MultiGestureHMM.VERSION = '0.0.5';

// Export to the root, which is probably `window`.
root.MultiGestureHMM = MultiGestureHMM;


text:
package consulo.awt;

import com.intellij.util.ui.JBUI;
import consulo.annotation.ReviewAfterMigrationToJRE;
import consulo.container.StartupError;
import consulo.container.plugin.PluginDescriptor;
import consulo.container.plugin.PluginIds;
import consulo.container.plugin.PluginManager;
import consulo.ui.Component;
import consulo.ui.Window;
import consulo.ui.cursor.Cursor;
import consulo.ui.font.Font;
import consulo.ui.image.Image;
import consulo.ui.image.ImageKey;
import consulo.ui.color.ColorValue;
import consulo.ui.color.RGBColor;
import consulo.ui.Rectangle2D;
import consulo.ui.Size;
import org.jetbrains.annotations.Contract;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.swing.*;
import java.util.Iterator;
import java.util.ServiceLoader;

/**
 * @author VISTALL
 * @since 25-Sep-17
 * <p>
 * This should moved to desktop module, after split desktop and platform code
 */
@SuppressWarnings("deprecation")
public class TargetAWT {
  private static final TargetAWTFacade ourFacade = findImplementation(TargetAWTFacade.class);

  @Nonnull
  @ReviewAfterMigrationToJRE(value = 9, description = "Use consulo.container.plugin.util.PlatformServiceLocator#findImplementation after migration")
  private static <T, S> T findImplementation(@Nonnull Class<T> interfaceClass) {
    for (T facade : ServiceLoader.load(interfaceClass, TargetAWT.class.getClassLoader())) {
      return facade;
    }

    for (PluginDescriptor descriptor : PluginManager.getPlugins()) {
      if (PluginIds.isPlatformImplementationPlugin(descriptor.getPluginId())) {
        ServiceLoader<T> loader = ServiceLoader.load(interfaceClass, descriptor.getPluginClassLoader());

        Iterator<T> iterator = loader.iterator();
        if (iterator.hasNext()) {
          return iterator.next();
        }
      }
    }

    throw new StartupError("Can't find platform implementation: " + interfaceClass);
  }

  @Nonnull
  public static java.awt.Dimension to(@Nonnull Size size) {
    return ourFacade.to(size);
  }

  @Nonnull
  public static java.awt.Color to(@Nonnull RGBColor color) {
    return ourFacade.to(color);
  }

  @Contract("null -> null")
  public static java.awt.Color to(@Nullable ColorValue colorValue) {
    return ourFacade.to(colorValue);
  }

  @Contract("null -> null")
  public static java.awt.Rectangle to(@Nullable Rectangle2D rectangle2D) {
    return ourFacade.to(rectangle2D);
  }

  @Contract("null -> null")
  public static java.awt.Component to(@Nullable Component component) {
    return ourFacade.to(component);
  }

  @Contract("null -> null")
  public static java.awt.Window to(@Nullable Window component) {
    return ourFacade.to(component);
  }

  /**
   * Wrap AWT component to untyped UI component. Calling any methods from it except #from() not supported
   */
  @Nonnull
  public static Component wrap(@Nonnull java.awt.Component component) {
    return ourFacade.wrap(component);
  }

  @Contract("null -> null")
  public static Component from(@Nullable java.awt.Component component) {
    return ourFacade.from(component);
  }

  @Contract("null -> null")
  public static Window from(@Nullable java.awt.Window component) {
    return ourFacade.from(component);
  }

  @Contract("null -> null")
  public static Rectangle2D from(@Nullable java.awt.Rectangle rectangle) {
    return ourFacade.from(rectangle);
  }

  @Contract("null -> null")
  public static ColorValue from(@Nullable java.awt.Color color) {
    return ourFacade.from(color);
  }

  @Contract("null -> null")
  public static java.awt.Cursor to(Cursor cursor) {
    return ourFacade.to(cursor);
  }

  @Contract("null -> null")
  public static Cursor from(java.awt.Cursor cursor) {
    return ourFacade.from(cursor);
  }

  @Contract("null -> null")
  public static Icon to(@Nullable Image image) {
    return ourFacade.to(image);
  }

  @Contract("null -> null")
  public static Image from(@Nullable Icon icon) {
    return ourFacade.from(icon);
  }

  @Nonnull
  public static java.awt.Font to(@Nonnull Font font) {
    return ourFacade.to(font);
  }

  public static java.awt.Image toImage(@Nonnull ImageKey key, JBUI.ScaleContext ctx) {
    return ourFacade.toImage(key, ctx);
  }
}


text:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
  Copyright 2007 the original author or authors.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<lifecycles>
  <lifecycle>
    <id>griffonCopyDependencies</id>
    <phases>
      <phase>
        <id>process-resources</id>
        <executions>
          <execution>
            <goals>
              <goal>org.apache.maven.plugins:maven-dependency-plugin:copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.basedir}/lib</outputDirectory>
              <excludeScope>provided</excludeScope>
              <includeScope>runtime</includeScope>
              <includeTypes>jar</includeTypes>
            </configuration>
          </execution>
        </executions>
      </phase>
    </phases>
  </lifecycle>
  <lifecycle>
    <id>griffonClean</id>
    <phases>
      <phase>
        <id>clean</id>
        <executions>
          <execution>
            <goals>
              <goal>org.apache.maven.plugins:maven-clean-plugin:clean</goal>
            </goals>
            <configuration>
              <filesets>
                <fileset>
                  <directory>lib</directory>
                  <includes>
                    <include>*.jar</include>
                  </includes>
                </fileset>
              </filesets>
            </configuration>
          </execution>
        </executions>
      </phase>
    </phases>
  </lifecycle>
</lifecycles>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Inbox2.Framework;
using Inbox2.Framework.Deployment;

namespace Inbox2.Core.Upgrade
{
    class Upgrade_0_1_0_8 : UpgradeActionBase
    {
        public override Version TargetVersion
        {
            get { return new Version("0.1.0.8"); }
        }

        protected override void UpgradeCore()
        {
            ClientState.Current.DataService.ExecuteNonQuery("alter table ChannelConfigs add column Type text");
        }
    }
}