text:
<tool id="secimtools_principal_component_analysis" name="Principal Component Analysis (PCA)" version="@WRAPPER_VERSION@">
    <description>for visual summaries of the components.</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="exit_code"><![CDATA[
principal_component_analysis.py
--input $input
--design $design
--ID $uniqID
--load_out $loadings
--score_out $scores
--summary_out $summary
--figure $figures

#if $group
    --group $group
#end if
    ]]></command>
    <inputs>
        <param name="input" type="data" format="tabular" label="Wide Dataset" help="Input your tab-separated wide format dataset. If file is not tab separated see TIP below."/>
        <param name="design" type="data" format="tabular" label="Design File" help="Input your design file (tab-separated). Note you need a 'sampleID' column. If not tab separated see TIP below."/>
        <param name="uniqID" type="text" size="30" value="" label="Unique Feature ID" help="Name of the column in your wide dataset that has unique identifiers."/>
        <param name="group" type="text" size="30" label="Group/Treatment [Optional]" help="Name of the column in your design file that contains group classifications."/>
    </inputs>
    <outputs>
        <data format="tabular" name="loadings" label="${tool.name} on ${on_string}: loadings"/>
        <data format="tabular" name="scores" label="${tool.name} on ${on_string}: scores"/>
        <data format="tabular" name="summary" label="${tool.name} on ${on_string}: summary"/>
        <data format="pdf" name="figures" label="${tool.name} on ${on_string}: scatter plots"/>
    </outputs>
    <tests>
        <test>
            <param name="input"  value="ST000006_data.tsv"/>
            <param name="design" value="ST000006_design.tsv"/>
            <param name="uniqID" value="Retention_Index" />
            <param name="group"  value="White_wine_type_and_source" />
            <output name="loadings" file="ST000006_principal_component_analysis_load_out.tsv" />
            <output name="scores"   file="ST000006_principal_component_analysis_score_out.tsv" />
            <output name="summary"  file="ST000006_principal_component_analysis_summary_out.tsv" />
            <output name="figures"  file="ST000006_principal_component_analysis_figure.pdf" compare="sim_size" delta="10000" />
        </test>
    </tests>
    <help><![CDATA[

@TIP_AND_WARNING@

**Tool Description**

The tool performs principal component analysis (PCA) of the data.
Visual summaries are provided in the from of 2D and 3D scatter plots for the first three principal components.
Samples in the scatter plots are colored based on the group classification.

--------------------------------------------------------------------------------

**Note**

- This tool currently treats all variables as continuous numeric variables. Running the tool on categorical variables might result in incorrect results.
- Rows containing non-numeric (or missing) data in any of the chosen columns will be skipped from the analysis.

--------------------------------------------------------------------------------

**Input**

    - Two input datasets are required.

@WIDE@

**NOTE:** The sample IDs must match the sample IDs in the Design File (below).
Extra columns will automatically be ignored.

@METADATA@

@UNIQID@

@GROUP_OPTIONAL@

--------------------------------------------------------------------------------

**Output**

Four different outputs are produced by the Principal Component Analysis tool:

(1) a TSV file containing eigenvectors/variable loadings
(2) a TSV file containing scores of input data on principal components
(3) a TSV file with the summary for each component
(4) and a PDF file of scatter plots of the first three principal components

There are a total of four scatterplots: three pairwise plots for the first three components and a single 3D plot of the first three components.

    ]]></help>
    <expand macro="citations"/>
</tool>


text:
// /*
//   SharpNative - C# to D Transpiler
//   (C) 2014 Irio Systems
// */

#region Imports

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using CSharpExtensions = Microsoft.CodeAnalysis.CSharpExtensions;

#endregion

namespace SharpNative.Compiler
{
    internal static class WriteInitializer
    {
        public static void Go(OutputWriter writer, InitializerExpressionSyntax initializer)
        {
            writer.WriteIndent();
            var isCollectionInit = false;
            if (CSharpExtensions.CSharpKind(initializer) == SyntaxKind.CollectionInitializerExpression ||
                CSharpExtensions.CSharpKind(initializer) == SyntaxKind.ArrayInitializerExpression)
            {
                var tx = TypeProcessor.GetTypeInfo(initializer);

                var t = tx.Type;
                if (t == null)
                    t = tx.ConvertedType;
                if (t != null) // Initializer within initializer
                {
                    var elementType = t.As<IArrayTypeSymbol>().ElementType;
                    var ptr = !elementType.IsValueType; // ? "" : "";
                    var type = TypeProcessor.ConvertType(elementType);
                    var typeString = "Array_T!(" + type + ")";

                    if (elementType.TypeKind == TypeKind.TypeParameter)
                        writer.Write(" __TypeNew!(" + typeString + ")(");
                    else
                        writer.Write("new " + typeString + "(");
                }
                var variableDeclarationSyntax = initializer.Parent.Parent.Parent as VariableDeclarationSyntax;
                if (variableDeclarationSyntax != null)
                {
                    var atype = variableDeclarationSyntax.Type;
                    initializer.WriteArrayInitializer(writer, atype);
                }
                else
                    initializer.WriteArrayInitializer(writer,t);
                if (t != null)
                    writer.Write(")");
            }
            else
            {
                //            writer.Write("goto ");
                //            foreach (var expressionSyntax in method.Expressions)
                //            {
                //                Core.Write(writer, expressionSyntax);
                //            }

                bool first = true;
                foreach (var expression in initializer.Expressions)
                {
                    if (first)
                        first = false;
                    else
                        writer.Write(", ");

                    Core.Write(writer, expression);
                }
            }

            //            writer.Write(";");
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
layout: post
title: "Build Systems"
excerpt: "In this article, I talk about the different build systems I tried and the setup I eventually settled on."
category: articles
tags: [mosquitos, operating system]
comments: true
image:
  feature: sierras-7.jpg
---

Overview

*  Auto generated table of contents
{:toc}

For simple projects, it's easy enough to type `gcc -o kernel kernel.c` at the command line, but when you're compiling dozens of files with gobs of compiler and linker options, it helps to have some automation. Probably the most widely used tool for automating C project builds is [Make](http://www.gnu.org/software/make/). I used `Make` for a while, but I've since switched to [tup](http://gittup.org/tup/), and have been much happier.

Life With Make
--------------

I started out building my project using `Make`, and stuck with it for about 4 months. When my project was simple (i.e., just the bootloader), `Make` worked great. I downloaded a short Makefile from [this guy's](http://www.rodsbooks.com/efi-programming/index.html) excellent UEFI tutorial (this tutorial essentially single-handedly resulted in me compiling my first UEFI application) that specified the compiler and linker flags, and ran a few commands on the source files. Everything was peachy.

Fast-forward a few weeks -- I'd written a bootloader and was starting on the kernel. The kernel is really a separate project from the bootloader -- it needed different compiler/linker flags, required different linked in libraries and included headers, and ends up as a separate binary. However, I wanted the two projects to be in the same Git repository, and I wanted a single invocation of `make` from the project root to build both projects. After some Googling, I patched together a set of recursive Makefiles that fulfilled my needs, and things were good again. Then I noticed that when I made a change to a `.h` file, it wasn't recompiling the source files that depended on that header. This resulted in a lot of `make clean && make`, which felt like overkill. More Googling. More tweaking of Makefiles. Fixed this as well. Perfect. For the moment.

The final straw for me was when I was working on including the ACPICA library (an external library, written by Intel, used to interpret the ACPI tables. There will be at least one article on the mess that is ACPI later.) I put the code for this library in a subdirectory in my project, and attempted to compile it in with the rest of my code. Because it needed different compiler flags than the rest of my kernel (it wouldn't compile with `-Werror`, for example) I had a Makefile specifically to build ACPICA. I struggled, however to get the dependencies all correct -- I would frequently have to `make clean && make` to make a change to the ACPICA code visible to the rest of the project. While I have no doubts that all of my issues were caused by my own ignorance and that I could have solved my problems with a bit more Googling, I decided that it was time for a change.

Life After Make
---------------

After struggling with a few other systems (that appeared to offer few benefits over `make`), I stumbled upon [tup](http://gittup.org/tup/). For me `tup` has a few distinct advantages:

- It works recursively by default. When you run `tup` from any directory in your project, it automatically scans every subdirectory in the project and executes in every directory with a `Tupfile`. This means you have to have one `Tupfile` per code directory, but I've found that this is hardly difficult, and it gives you the ability to easily change the compilation options for every submodule in your project.
- `tup` keeps track of all the files opened by every command executed in your `Tupfile` to automatically determine dependencies. For example, a line like `hello.c |> gcc -o %o %f |> hello` means take the file `hello.c`, and invoke the command `gcc -o hello hello.c` to produce the file `hello`. If `hello.c` includes `hello.h`, `gcc` will open `hello.h` during compilation, `tup` will "see" this, and it will implicitly determine that `hello.c` depends on `hello.h`. If you subsequently make a change to `hello.h`, `tup` will automatically recompile all files that depend on it.
- `tup` builds up a full graph of all file dependencies and uses this graph to determine which files to recompile during a build. From my experience, `tup` has done a very good job of only recompiling the necessary files when I make a change.

Overall, I have been very happy with `tup`. It only took me an hour or so to set up, seems to understand my project dependencies perfectly with minimal configuration, and adds very little overhead to each build. When I was using `Make`, I was doing clean builds almost every time (which took somewhere around 25s). Now, with `tup`, I never do clean builds, and the builds are usually essentially instantaneous. While I admit that my issues with `Make` were almost certainly my fault, `tup` has been incredibly simple to use and produced the final product I was looking for. It was definitely worth making the switch and I plan to use it for all my future projects.

My Tupfiles
-----------

I won't try to explain the entire syntax of `tup`. The [examples](gittup.org/tup/examples.html) and [manual](gittup.org/tup/manual.html) do a pretty good job (and the syntax should look kind of familiar for those of you who have used `Make`). Take this time to go read over the examples quickly and familiarize yourself with `tup` -- it doesn't take very long. I will, however, provide the `Tupfiles` I use to build the MosquitOS kernel and bootloader (with some explanation).

### Root Tuprules.tup

This file sets defines some common variables and macros for the whole project.

{% gist kmmoore/cc0b1d828c80ab716cf0 Tuprules.tup%23Root.mk %}

### Root Tupfile

{% gist kmmoore/cc0b1d828c80ab716cf0 Tupfile%23Root.mk %}

### EFI Application Tuprules.tup

{% gist kmmoore/cc0b1d828c80ab716cf0 Tuprules.tup%23EFI.mk %}

### EFI Application Tupfile

{% gist kmmoore/cc0b1d828c80ab716cf0 Tupfile%23EFI.mk %}

### Submodule Tupfile

This is a `Tupfile` that I place in any subdirectory that contains code I want to compile into the main project. If you want, you can add/override any of the CFLAGS at the top of the file and it will just apply to the files in that directory. Or you can create another `Tuprules.tup` file in that subdirectory and it will apply to all files in that subdirectory and any nested subdirectories.

{% gist kmmoore/cc0b1d828c80ab716cf0 Tupfile%23Submodule.mk %}

Empty Project
-------------

[Here]({{ site.baseurl }}/assets/downloads/empty-uefi-project.zip) are those files packaged into the appropriate file structure. If you `cd` into the root directory and run `tup`, nothing should happen, but lots of cool things are poised to happen just as soon as we add some source code.

To The Code!
------------

Next up, we will write our first UEFI application and run it on an operating-system-less virtual machine. [Onward!]({% post_url 2014-10-09-writing-a-uefi-application %})


text:
@interface NTESRegisterViewController ()

@end

@implementation NTESRegisterViewController

NTES_USE_CLEAR_BAR
- (void)viewDidLoad {
    [super viewDidLoad];
    [self resetTextField:self.accountTextfield];
    [self resetTextField:self.nicknameTextfield];
    [self resetTextField:self.passwordTextfield];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil];
}

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

- (void)dealloc{
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (void)setupNav
{
    [self useClearNavigationBar];
    UIButton *registerBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [registerBtn setTitle:@"完成" forState:UIControlStateNormal];
    registerBtn.titleLabel.font = [UIFont systemFontOfSize:15.f];
    [registerBtn setTitleColor:UIColorFromRGB(0x2294ff) forState:UIControlStateNormal];

    [registerBtn setBackgroundImage:[UIImage imageNamed:@"login_btn_done_normal"] forState:UIControlStateNormal];
    [registerBtn setBackgroundImage:[UIImage imageNamed:@"login_btn_done_pressed"] forState:UIControlStateHighlighted];
    [registerBtn addTarget:self
                    action:@selector(onRegister:)
          forControlEvents:UIControlEventTouchUpInside];

    [registerBtn sizeToFit];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:registerBtn];
    self.navigationItem.rightBarButtonItem.enabled = NO;

    UIImage *image = [UIImage imageNamed:@"icon_back_normal.png"];
    [self.navigationController.navigationBar setBackIndicatorImage:image];
    [self.navigationController.navigationBar setBackIndicatorTransitionMaskImage:image];
    UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
    [self.navigationController.navigationBar setTintColor:UIColorFromRGB(0xffffff)];
    self.navigationItem.backBarButtonItem = backItem;
    _containView.backgroundColor = [UIColor clearColor];
}

- (IBAction)onChanged:(id)sender
{
    BOOL enabled = [[_accountTextfield text] length] &&
    [[_nicknameTextfield text] length] &&
    [[_passwordTextfield text] length];
    [self.navigationItem.rightBarButtonItem setEnabled:enabled];
}

- (void)onRegister:(id)sender
{
    NTESRegisterData *data = [[NTESRegisterData alloc] init];
    data.account = [_accountTextfield text];
    data.nickname= [_nicknameTextfield text];
    data.token = [[_passwordTextfield text] tokenByPassword];
    if (![self check]) {
        return;
    }
    [SVProgressHUD show];
    __weak typeof(self) weakSelf = self;

    [[NTESDemoService sharedService] registerUser:data
                                       completion:^(NSError *error, NSString *errorMsg) {
                                           [SVProgressHUD dismiss];
                                           if (error == nil) {
                                               [weakSelf.navigationController.view makeToast:@"注册成功"
                                                                                duration:2
                                                                                position:CSToastPositionCenter];
                                               if ([weakSelf.delegate respondsToSelector:@selector(registDidComplete:password:)]) {
                                                   [weakSelf.delegate registDidComplete:data.account password:[_passwordTextfield text]];
                                               }
                                               [weakSelf.navigationController popViewControllerAnimated:YES];
                                           }
                                           else
                                           {
                                               if ([weakSelf.delegate respondsToSelector:@selector(registDidComplete:password:)]) {
                                                   [weakSelf.delegate registDidComplete:nil password:nil];
                                               }

                                               NSString *toast = [NSString stringWithFormat:@"注册失败"];
                                               if ([errorMsg isKindOfClass:[NSString class]] &&errorMsg.length) {
                                                   toast = [toast stringByAppendingFormat:@": %@",errorMsg];
                                               }
                                               [weakSelf.view makeToast:toast
                                                               duration:2
                                                               position:CSToastPositionCenter];

                                           }

                                       }];
}

- (IBAction)exist:(id)sender{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)keyboardWillChangeFrame:(NSNotification *)notification{
    NSDictionary* userInfo = [notification userInfo];
    NSTimeInterval animationDuration;
    UIViewAnimationCurve animationCurve;
    CGRect keyboardFrame;
    [[userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] getValue:&animationCurve];
    [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] getValue:&animationDuration];
    [[userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] getValue:&keyboardFrame];
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:animationDuration];
    [UIView setAnimationCurve:animationCurve];
    CGFloat bottomSpacing = -5.f;
    UIView *inputView = self.passwordTextfield.superview;
    if (inputView.bottom + bottomSpacing > CGRectGetMinY(keyboardFrame)) {
        CGFloat delta;
        if (UIScreenHeight >= 568) {
            delta = self.existedButton.bottom + bottomSpacing - CGRectGetMinY(keyboardFrame);
            self.existedButton.bottom -= delta;
        }else{
            delta = inputView.bottom + bottomSpacing - CGRectGetMinY(keyboardFrame);
        }
        inputView.bottom -= delta;
    }
    if (self.logo.bottom > self.navigationController.navigationBar.bottom) {
        self.logo.bottom = self.navigationController.navigationBar.bottom;
        self.logo.alpha  = 0;
        self.navigationItem.title = @"注册";
    }
    [UIView commitAnimations];

}

#pragma mark - UITextFieldDelegate
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
    if ([string isEqualToString:@"\n"]) {
        [self onRegister:nil];
        return NO;
    }
    return YES;
}

#pragma mark - Private
- (void)resetTextField:(UITextField *)textField{
    textField.tintColor = [UIColor whiteColor];
    [textField setValue:UIColorFromRGBA(0xffffff, .6f) forKeyPath:@"_placeholderLabel.textColor"];
    textField.tintColor = [UIColor whiteColor];
    UIButton *clearButton = [textField valueForKey:@"_clearButton"];
    [clearButton setImage:[UIImage imageNamed:@"login_icon_clear"] forState:UIControlStateNormal];
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [super touchesBegan:touches withEvent:event];
    [_accountTextfield resignFirstResponder];
    [_nicknameTextfield resignFirstResponder];
    [_passwordTextfield resignFirstResponder];
}

- (BOOL)check{
    if (!self.checkAccount) {
        [self.view makeToast:@"账号长度有误"
                    duration:2
                    position:CSToastPositionCenter];

        return NO;
    }
    if (!self.checkPassword) {
        [self.view makeToast:@"密码长度有误"
                    duration:2
                    position:CSToastPositionCenter];

        return NO;
    }
    if (!self.checkNickname) {
        [self.view makeToast:@"昵称长度有误"
                    duration:2
                    position:CSToastPositionCenter];

        return NO;
    }
    return YES;
}

- (BOOL)checkAccount{
    NSString *account = [_accountTextfield text];
    return account.length > 0 && account.length <= 20;
}

- (BOOL)checkPassword{
    NSString *checkPassword = [_passwordTextfield text];
    return checkPassword.length >= 6 && checkPassword.length <= 20;
}

- (BOOL)checkNickname{
    NSString *nickname= [_nicknameTextfield text];
    return nickname.length > 0 && nickname.length <= 10;
}

- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait;
}

@end


text:
package com.github.chrisruffalo.cfb.wallpapers.config;

import com.beust.jcommander.Parameter;

import java.util.HashSet;
import java.util.Set;

/**
 *

 *
 */
public class GeneratorOptions {

    @Parameter(names = {"--output", "-o"}, description = "The path to the output folder where wallpapers should be saved.")
    private String outputPath = "wallpaper";

    @Parameter(names = {"--school", "-s"}, description = "A school id to be included in the output. By default all schools are executed.")
    private Set<String> schools = new HashSet<>(0);

    @Parameter(names = {"--conference", "-c"}, description = "A conference id to be included in the output. Will output all schools in that conference (unless schools are specified otherwise).")
    private Set<String> conferences = new HashSet<>(0);

    @Parameter(names = {"--division", "-d"}, description = "A division id to be included in the output. Will output all conferences and schools in that division (unless schools/conferences are specified).")
    private Set<String> divisions = new HashSet<>(0);

    @Parameter(names = {"--clean"}, description = "Deletes the contents of the output directory before starting to generate new wallpapers.")
    private boolean clean = false;

    @Parameter(names = {"--help", "-h", "-?"}, description = "Display the help message")
    private boolean help;

    @Parameter(names = {"--no-images"}, description = "Don't generate images. Useful for testing.")
    private boolean noImages = false;

    @Parameter(names = {"--web", "-w"}, description = "Generate web content (html, links, etc) to go with the generated wallpaper. Default: false")
    private boolean generateWeb = false;

    @Parameter(names = {"--list", "-l"}, description = "List the structure of sorted, conferences, and schools.")
    private boolean list;

    @Parameter(names = {"--no-threads", "-N"}, description = "Only generate with a single thread.")
    private boolean singleThreaded = false;

    @Parameter(names = {"--tasks", "-t"}, description = "The number of simultanous tasks to run when single threading (--no-threads) is off. Default is available cores minus one.")
    private int tasks = Runtime.getRuntime().availableProcessors() - 1;

    @Parameter(names = {"--optimize", "-O"}, description = "Set this option to optimize PNG sizes when the generation is complete.")
    private boolean optimizePng;

    public String getOutputPath() {
        return outputPath;
    }

    public void setOutputPath(String outputPath) {
        this.outputPath = outputPath;
    }

    public Set<String> getSchools() {
        return schools;
    }

    public void setSchools(Set<String> schools) {
        this.schools = schools;
    }

    public Set<String> getDivisions() {
        return divisions;
    }

    public void setDivisions(Set<String> divisions) {
        this.divisions = divisions;
    }

    public Set<String> getConferences() {
        return conferences;
    }

    public void setConferences(Set<String> conferences) {
        this.conferences = conferences;
    }

    public boolean isClean() {
        return clean;
    }

    public void setClean(boolean clean) {
        this.clean = clean;
    }

    public boolean isHelp() {
        return help;
    }

    public void setHelp(boolean help) {
        this.help = help;
    }

    public boolean isGenerateWeb() {
        return generateWeb;
    }

    public void setGenerateWeb(boolean generateWeb) {
        this.generateWeb = generateWeb;
    }

    public boolean isList() {
        return list;
    }

    public void setList(boolean list) {
        this.list = list;
    }

    public boolean isNoImages() {
        return noImages;
    }

    public void setNoImages(boolean noImages) {
        this.noImages = noImages;
    }

    public boolean isSingleThreaded() {
        return singleThreaded;
    }

    public void setSingleThreaded(boolean singleThreaded) {
        this.singleThreaded = singleThreaded;
    }

    public int getTasks() {
        return tasks;
    }

    public void setTasks(int tasks) {
        this.tasks = tasks;
    }

    public boolean isOptimizePng() {
        return optimizePng;
    }

    public void setOptimizePng(boolean optimizePng) {
        this.optimizePng = optimizePng;
    }
}


text:
package org.spoofax.interpreter.library.ssl;

import org.spoofax.interpreter.core.IContext;
import org.spoofax.interpreter.stratego.Strategy;
import org.spoofax.interpreter.terms.IStrategoTerm;

public class SSL_immutable_set_strict_subset extends SSL_immutable_set_strict_subset_eq {

    protected SSL_immutable_set_strict_subset() {
        super("SSL_immutable_set_strict_subset", 0, 1);
    }

    @Override public boolean call(IContext env, Strategy[] sargs, IStrategoTerm[] targs) {
        return strictSubset(env, targs, Object::equals);
    }
}


text:
//
//  BebopDrone.h
//  SDKSample
//

#import <Foundation/Foundation.h>
#import <libARController/ARController.h>
#import <libARDiscovery/ARDISCOVERY_BonjourDiscovery.h>

@class BebopDrone;

@protocol BebopDroneDelegate <NSObject>
@required
/**
 * Called when the connection to the drone did change
 * Called on the main thread
 * @param bebopDrone the drone concerned
 * @param state the state of the connection
 */
- (void)bebopDrone:(BebopDrone*)bebopDrone connectionDidChange:(eARCONTROLLER_DEVICE_STATE)state;

/**
 * Called when the battery charge did change
 * Called on the main thread
 * @param bebopDrone the drone concerned
 * @param batteryPercent the battery remaining (in percent)
 */
- (void)bebopDrone:(BebopDrone*)bebopDrone batteryDidChange:(int)batteryPercentage;

/**
 * Called when the piloting state did change
 * Called on the main thread
 * @param bebopDrone the drone concerned
 * @param batteryPercent the piloting state of the drone
 */
- (void)bebopDrone:(BebopDrone*)bebopDrone flyingStateDidChange:(eARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE)state;

/**
 * Called when the video decoder should be configured
 * Called on separate thread
 * @param bebopDrone the drone concerned
 * @param codec the codec information about the stream
 * @return true if configuration went well, false otherwise
 */
- (BOOL)bebopDrone:(BebopDrone*)bebopDrone configureDecoder:(ARCONTROLLER_Stream_Codec_t)codec;

/**
 * Called when a frame has been received
 * Called on separate thread
 * @param bebopDrone the drone concerned
 * @param frame the frame received
 */
- (BOOL)bebopDrone:(BebopDrone*)bebopDrone didReceiveFrame:(ARCONTROLLER_Frame_t*)frame;

/**
 * Called before medias will be downloaded
 * Called on the main thread
 * @param bebopDrone the drone concerned
 * @param nbMedias the number of medias that will be downloaded
 */
- (void)bebopDrone:(BebopDrone*)bebopDrone didFoundMatchingMedias:(NSUInteger)nbMedias;

/**
 * Called each time the progress of a download changes
 * Called on the main thread
 * @param bebopDrone the drone concerned
 * @param mediaName the name of the media
 * @param progress the progress of its download (from 0 to 100)
 */
- (void)bebopDrone:(BebopDrone*)bebopDrone media:(NSString*)mediaName downloadDidProgress:(int)progress;

/**
 * Called when a media download has ended
 * Called on the main thread
 * @param bebopDrone the drone concerned
 * @param mediaName the name of the media
 */
- (void)bebopDrone:(BebopDrone*)bebopDrone mediaDownloadDidFinish:(NSString*)mediaName;

@end

@interface BebopDrone : NSObject

@property (nonatomic, weak) id<BebopDroneDelegate>delegate;

- (id)initWithService:(ARService*)service;
- (void)connect;
- (void)disconnect;
- (eARCONTROLLER_DEVICE_STATE)connectionState;
- (eARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE)flyingState;

- (void)emergency;
- (void)takeOff;
- (void)land;
- (void)takePicture;
- (void)setPitch:(uint8_t)pitch;
- (void)setRoll:(uint8_t)roll;
- (void)setYaw:(uint8_t)yaw;
- (void)setGaz:(uint8_t)gaz;
- (void)setFlag:(uint8_t)flag;
- (void)downloadMedias;
- (void)cancelDownloadMedias;
@end


text:
/*
 * Do not modify this file. This file is generated from the ec2-2015-04-15.normal.json service model.
 */
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;

using Amazon.Runtime;
using Amazon.Runtime.Internal;

namespace Amazon.EC2.Model
{
    ///
    /// Container for the parameters to the CreateVpnConnection operation.
    /// Creates a VPN connection between an existing virtual private gateway and a VPN customer
    /// gateway. The only supported connection type is ipsec.1.
    ///
    ///
    /// <para>
    /// The response includes information that you need to give to your network administrator
    /// to configure your customer gateway.
    /// </para>
    ///  <important>
    /// <para>
    /// We strongly recommend that you use HTTPS when calling this operation because the response
    /// contains sensitive cryptographic information for configuring your customer gateway.
    /// </para>
    ///  </important>
    /// <para>
    /// If you decide to shut down your VPN connection for any reason and later create a new
    /// VPN connection, you must reconfigure your customer gateway with the new information
    /// returned from this call.
    /// </para>
    ///
    /// <para>
    /// For more information about VPN connections, see Adding
    /// a Hardware Virtual Private Gateway to Your VPC in the Amazon Virtual Private
    /// Cloud User Guide.
    /// </para>
    ///
    public partial class CreateVpnConnectionRequest : AmazonEC2Request
    {
        private string _customerGatewayId;
        private VpnConnectionOptionsSpecification _options;
        private string _type;
        private string _vpnGatewayId;

        ///
        /// Empty constructor used to set  properties independently even when a simple constructor is available
        ///
        public CreateVpnConnectionRequest() { }

        ///
        /// Instantiates CreateVpnConnectionRequest with the parameterized properties
        ///
        /// <param name="type">The type of VPN connection (ipsec.1).</param>
        /// <param name="customerGatewayId">The ID of the customer gateway.</param>
        /// <param name="vpnGatewayId">The ID of the virtual private gateway.</param>
        public CreateVpnConnectionRequest(string type, string customerGatewayId, string vpnGatewayId)
        {
            _type = type;
            _customerGatewayId = customerGatewayId;
            _vpnGatewayId = vpnGatewayId;
        }

        ///
        /// Gets and sets the property CustomerGatewayId.
        /// <para>
        /// The ID of the customer gateway.
        /// </para>
        ///
        public string CustomerGatewayId
        {
            get { return this._customerGatewayId; }
            set { this._customerGatewayId = value; }
        }

        // Check to see if CustomerGatewayId property is set
        internal bool IsSetCustomerGatewayId()
        {
            return this._customerGatewayId != null;
        }

        ///
        /// Gets and sets the property Options.
        /// <para>
        /// Indicates whether the VPN connection requires static routes. If you are creating a
        /// VPN connection for a device that does not support BGP, you must specify true.
        /// </para>
        ///
        /// <para>
        /// Default: false
        /// </para>
        ///
        public VpnConnectionOptionsSpecification Options
        {
            get { return this._options; }
            set { this._options = value; }
        }

        // Check to see if Options property is set
        internal bool IsSetOptions()
        {
            return this._options != null;
        }

        ///
        /// Gets and sets the property Type.
        /// <para>
        /// The type of VPN connection (ipsec.1).
        /// </para>
        ///
        public string Type
        {
            get { return this._type; }
            set { this._type = value; }
        }

        // Check to see if Type property is set
        internal bool IsSetType()
        {
            return this._type != null;
        }

        ///
        /// Gets and sets the property VpnGatewayId.
        /// <para>
        /// The ID of the virtual private gateway.
        /// </para>
        ///
        public string VpnGatewayId
        {
            get { return this._vpnGatewayId; }
            set { this._vpnGatewayId = value; }
        }

        // Check to see if VpnGatewayId property is set
        internal bool IsSetVpnGatewayId()
        {
            return this._vpnGatewayId != null;
        }

    }
}


text:
/*
 * 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.
 */
package com.facebook.presto.sql.planner;

import com.facebook.presto.sql.analyzer.Analysis;
import com.facebook.presto.sql.planner.plan.Assignments;
import com.facebook.presto.sql.planner.plan.PlanNode;
import com.facebook.presto.sql.planner.plan.ProjectNode;
import com.facebook.presto.sql.tree.Expression;
import com.google.common.collect.ImmutableMap;

import java.util.List;
import java.util.Map;

import static java.util.Objects.requireNonNull;

class PlanBuilder
{
    private final TranslationMap translations;
    private final List<Expression> parameters;
    private final PlanNode root;

    public PlanBuilder(TranslationMap translations, PlanNode root, List<Expression> parameters)
    {
        requireNonNull(translations, "translations is null");
        requireNonNull(root, "root is null");
        requireNonNull(parameters, "parameterRewriter is null");

        this.translations = translations;
        this.root = root;
        this.parameters = parameters;
    }

    public TranslationMap copyTranslations()
    {
        TranslationMap translations = new TranslationMap(getRelationPlan(), getAnalysis(), getTranslations().getLambdaDeclarationToSymbolMap());
        translations.copyMappingsFrom(getTranslations());
        return translations;
    }

    private Analysis getAnalysis()
    {
        return translations.getAnalysis();
    }

    public PlanBuilder withNewRoot(PlanNode root)
    {
        return new PlanBuilder(translations, root, parameters);
    }

    public RelationPlan getRelationPlan()
    {
        return translations.getRelationPlan();
    }

    public PlanNode getRoot()
    {
        return root;
    }

    public boolean canTranslate(Expression expression)
    {
        return translations.containsSymbol(expression);
    }

    public Symbol translate(Expression expression)
    {
        return translations.get(expression);
    }

    public Expression rewrite(Expression expression)
    {
        return translations.rewrite(expression);
    }

    public TranslationMap getTranslations()
    {
        return translations;
    }

    public PlanBuilder appendProjections(Iterable<Expression> expressions, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator)
    {
        TranslationMap translations = copyTranslations();

        Assignments.Builder projections = Assignments.builder();

        // add an identity projection for underlying plan
        for (Symbol symbol : getRoot().getOutputSymbols()) {
            projections.put(symbol, symbol.toSymbolReference());
        }

        ImmutableMap.Builder<Symbol, Expression> newTranslations = ImmutableMap.builder();
        for (Expression expression : expressions) {
            Symbol symbol = symbolAllocator.newSymbol(expression, getAnalysis().getTypeWithCoercions(expression));
            projections.put(symbol, translations.rewrite(expression));
            newTranslations.put(symbol, expression);
        }
        // Now append the new translations into the TranslationMap
        for (Map.Entry<Symbol, Expression> entry : newTranslations.build().entrySet()) {
            translations.put(entry.getValue(), entry.getKey());
        }

        return new PlanBuilder(translations, new ProjectNode(idAllocator.getNextId(), getRoot(), projections.build()), parameters);
    }
}


text:
class CreateTeams < ActiveRecord::Migration
  def change
    create_table :teams do |t|
      t.timestamps null: false

      t.text :path, array: true, default: []
      t.integer :team_number
      t.integer :hunt_id
    end
  end
end


text:
A Webpack plugin to optimize \ minimize CSS assets.

## What does the plugin do?

It will search for CSS assets during the Webpack build and will optimize \ minimize the CSS (by default it uses [cssnano](http://github.com/ben-eb/cssnano) but a custom css processor can be specified).

### Solves [extract-text-webpack-plugin](http://github.com/webpack/extract-text-webpack-plugin) CSS duplication problem:

Since [extract-text-webpack-plugin](http://github.com/webpack/extract-text-webpack-plugin) only bundles (merges) text chunks, if its used to bundle CSS, the bundle might have duplicate entries (chunks can be duplicate free but when merged, duplicate CSS can be created).

## Configuration:

The plugin can receive the following options (all of them are optional):
* assetNameRegExp: A regular expression that indicates the names of the assets that should be optimized \ minimized, defaults to `/\.css$/g`
* cssProcessor: The css processor used to optimize \ minimize the CSS, defaults to [cssnano](http://github.com/ben-eb/cssnano). This should be a function that follows cssnano.process interface (receives a css and options parameters and returns a Promise).
* cssProcessorOptions: The options passed to the cssProcessor, defaults to `{}`
* canPrint: A boolean indicating if the plugin can print messages to the console, defaults to `true`

## Example:

``` javascript
var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
module.exports = {
	module: {
		loaders: [
			{ test: /\.css$/, loader: ExtractTextPlugin.extract("style-loader", "css-loader") }
		]
	},
	plugins: [
		new ExtractTextPlugin("styles.css"),
    new OptimizeCssAssetsPlugin({
      assetNameRegExp: /\.optimize\.css$/g,
      cssProcessor: require('cssnano'),
      cssProcessorOptions: { discardComments: {removeAll: true } },
      canPrint: true
    })
	]
}
```

## License

MIT (http://www.opensource.org/licenses/mit-license.php)


text:
package com.bjorktech.cayman.idea.designpattern.create.abstractfactory;

import lombok.Data;

import java.math.BigDecimal;

/**
 * User: sheshan
 * Date: 04/07/2018
 * content:
 */
@Data
public abstract class Watch {
    protected String specification;
    protected BigDecimal price;
}


text:
module CommonMarker
  VERSION = '0.17.7.1'.freeze
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;

namespace CyberBullyProcessor
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            if (Environment.UserInteractive)
            {
                CyberBullyProcessor service1 = new CyberBullyProcessor();
                service1.TestStartupAndStop(args);
            }
            else
            {
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[]
                {
                    new CyberBullyProcessor()
                };
                ServiceBase.Run(ServicesToRun);
            }
        }
    }
}


text:
package org.apache.nifi.web.api.entity;

import java.util.Set;

import javax.xml.bind.annotation.XmlRootElement;

/**
 * A serialized representation of this class can be placed in the entity body of a response to the API. This particular entity holds a reference to a list of controller services referencing
 * components.
 */
@XmlRootElement(name = "controllerServiceReferencingComponentsEntity")
public class ControllerServiceReferencingComponentsEntity extends Entity {

    private Set<ControllerServiceReferencingComponentEntity> controllerServiceReferencingComponents;

    /**
     * @return set of controller service referencing components that are being serialized
     */
    public Set<ControllerServiceReferencingComponentEntity> getControllerServiceReferencingComponents() {
        return controllerServiceReferencingComponents;
    }

    public void setControllerServiceReferencingComponents(Set<ControllerServiceReferencingComponentEntity> controllerServiceReferencingComponents) {
        this.controllerServiceReferencingComponents = controllerServiceReferencingComponents;
    }

}


text:
import classNames from "classnames";
import React from "react";
import PropTypes from "prop-types";
import {
  ajax,
  AutoIncreasingCounter,
  isFileTypeAccepted,
  RequestOption,
  sizeToByte
} from "@clair/helpers";
import { Button } from "@components/Button";
import { IconUpload } from "@components/Icon";
import {
  State,
  UploadFile,
  UploadProps,
  UploadState
} from "@components/Upload/lib/type";

const autoIncrCounter = new AutoIncreasingCounter();
const TOTAL_PERCENT = 100;

export default class UploadCore extends React.Component<
  UploadProps,
  UploadState
> {
  public static displayName: "UploadCore";
  public static propTypes = {
    children: PropTypes.node,
    disabled: PropTypes.bool,
    name: PropTypes.string,
    accept: PropTypes.string,
    action: PropTypes.string,
    method: PropTypes.string,
    data: PropTypes.object,
    headers: PropTypes.object,
    withCredentials: PropTypes.bool,
    directory: PropTypes.bool,
    droppable: PropTypes.bool,
    multiple: PropTypes.bool,
    maxCount: PropTypes.number,
    maxSize: PropTypes.string,
    autoUpload: PropTypes.bool,
    onReady: PropTypes.func,
    onAfterRemove: PropTypes.func,
    onHttpRequest: PropTypes.func,
    onBeforeUpload: PropTypes.func,
    onSuccess: PropTypes.func,
    onProgress: PropTypes.func,
    onError: PropTypes.func,
    onOverCount: PropTypes.func,
    onOverSize: PropTypes.func,
    onChange: PropTypes.func,
    onComplete: PropTypes.func
  };

  public static defaultProps = {
    disabled: false,
    name: "",
    accept: "",
    action: "",
    method: "post",
    data: {},
    headers: {},
    withCredentials: false,
    directory: false,
    droppable: false,
    multiple: false,
    maxCount: Infinity,
    maxSize: "1024 MB",
    autoUpload: true
  };

  public constructor(props: UploadProps) {
    super(props);

    this.state = {
      dragover: false,
      uploading: false
    };
  }

  public submit = () => {
    this.upload();
  };

  public remove = (fileIds: Array<number>) => {
    if (!Array.isArray(fileIds)) {
      throw new TypeError("fileIds is not an array type");
    }

    const allFiles = this.allFiles.filter(allFile => {
      return !fileIds.includes(allFile.fileId as number);
    });

    this.allFiles = allFiles;

    if (this.props.onAfterRemove) {
      this.props.onAfterRemove({
        detail: {
          allFiles: [...allFiles]
        }
      });
    }
  };

  private allFiles: Array<UploadFile> = [];
  private completeFiles: Array<UploadFile> = [];
  private fileInput: HTMLInputElement | null = null;

  private onClick = () => {
    if (this.props.disabled || this.state.uploading) return;
    const { fileInput: el } = this;
    if (!el) return;
    el.value = "";
    el.click();
  };

  private onChange = (event: React.ChangeEvent<HTMLInputElement>) => {
    const files: File[] = Array.from(event.target.files as FileList);

    if (!files.length) return;

    const { onOverSize, onOverCount } = this.props;
    const rawFiles: Array<UploadFile> = files.map(file => ({ rawFile: file }));
    const maxSize = sizeToByte(this.props.maxSize as string);

    const overMaxSizeFiles = rawFiles.filter(
      ({ rawFile: { size } }) => size > maxSize
    );
    const isOverMaxSize = overMaxSizeFiles.length > 0;

    if (isOverMaxSize && onOverSize) {
      onOverSize({
        detail: {
          overMaxSizeFiles: [...overMaxSizeFiles],
          allFiles: [...this.allFiles]
        }
      });
    }

    const allFiles = this.allFiles.concat(rawFiles);
    const isOverMaxCount = allFiles.length > (this.props.maxCount as number);
    if (isOverMaxCount && onOverCount) {
      onOverCount({
        detail: {
          changeFiles: [...rawFiles],
          allFiles: [...allFiles]
        }
      });
    }
    if (isOverMaxSize || isOverMaxCount) return;

    this.onInit(rawFiles);

    if (this.props.onReady) {
      const readyFiles = this.filterFilesByState(State.READY);
      this.props.onReady({
        detail: {
          readyFiles: [...readyFiles],
          allFiles: [...allFiles]
        }
      });
    }

    this.props.autoUpload && this.upload();
  };

  private onInit = (files: Array<UploadFile>) => {
    const rawFiles = files.map(file => {
      return {
        ...file,
        fileId: autoIncrCounter.next(),
        percent: 0,
        fileState: State.READY
      };
    });
    this.allFiles = this.allFiles.concat(rawFiles);
  };

  private upload = async () => {
    const {
      props: { onBeforeUpload },
      allFiles
    } = this;

    let readyFiles = this.filterFilesByState(State.READY);
    if (readyFiles.length === 0) return;

    if (onBeforeUpload instanceof Function) {
      let rawFiles: Array<File> = [];
      try {
        rawFiles = await onBeforeUpload({
          detail: { readyFiles: [...readyFiles], allFiles: [...allFiles] }
        });
      } catch {
        this.removeReadyFileFromAllFiles();
        return;
      }

      if (Array.isArray(rawFiles)) {
        this.removeReadyFileFromAllFiles();

        rawFiles.forEach(rawFile => {
          if (!(rawFile instanceof File)) {
            throw TypeError("rawFile is not an File type");
          }
        });

        const files = rawFiles.map(rawFile => ({ rawFile }));

        // 将files文件当作新文件来处理
        this.onInit(files);
        readyFiles = files;
      }
    }

    this.setState({ uploading: true });

    readyFiles.forEach(this.post);
  };

  private post = (file: UploadFile) => {
    const {
      props: {
        data,
        action,
        name: filename,
        headers,
        withCredentials,
        method,
        onChange,
        onComplete,
        onProgress,
        onSuccess,
        onError,
        onHttpRequest
      },
      completeFiles,
      allFiles
    } = this;

    const triggerChange: typeof onChange = params => onChange?.(params);

    const triggerComplete = () => {
      const isComplete = this.filterFilesByState(State.UPLOADING).length === 0;

      completeFiles.push(file);
      this.setState({ uploading: false });

      if (isComplete && onComplete) {
        onComplete({
          detail: {
            completeFiles,
            allFiles: [...allFiles]
          }
        });
        this.completeFiles = [];
      }
    };

    const defaultOptions = {
      headers,
      withCredentials,
      action,
      data,
      file: file.rawFile,
      filename: filename as string
    };

    const options: RequestOption = {
      ...defaultOptions,
      method: method as string,
      onProgress: (event: ProgressEvent) => {
        if (event.total > 0) {
          file.percent = (event.loaded / event.total) * TOTAL_PERCENT;
        }
        this.changeFileState(file, State.UPLOADING);
        const detail = { file: { ...file }, allFiles: [...allFiles] };
        if (onProgress) {
          onProgress({ detail, nativeEvent: event });
        }
        triggerChange({
          detail: { ...detail, type: State.UPLOADING },
          nativeEvent: event
        });
      },
      onSuccess: (response: object) => {
        this.changeFileState(file, State.SUCCESS);
        const detail = { file: { ...file }, allFiles: [...allFiles], response };
        if (onSuccess) {
          onSuccess({ detail });
        }
        triggerChange({ detail: { ...detail, type: State.SUCCESS } });
        triggerComplete();
      },
      onError: (err: Error | ProgressEvent<EventTarget>) => {
        this.changeFileState(file, State.FAIL);
        const detail = {
          file: { ...file },
          allFiles: [...allFiles],
          error: err
        };
        if (onError) {
          onError({ detail });
        }
        triggerChange({ detail: { ...detail, type: State.FAIL } });
        triggerComplete();
      }
    };

    const useCustomAjax = onHttpRequest instanceof Function;
    if (!useCustomAjax) return ajax(options);

    if (onHttpRequest) {
      onHttpRequest(defaultOptions)
        .then(options.onSuccess)
        .catch(options.onError);
    }
  };

  private changeFileState = (file: UploadFile, state: State) => {
    return (file.fileState = state);
  };

  private filterFilesByState(state: string) {
    return this.allFiles.filter(file => file.fileState === state);
  }

  private removeReadyFileFromAllFiles = () => {
    this.allFiles = this.allFiles.filter(
      file => file.fileState !== State.READY
    );
  };

  private onDragEnter = (event: React.DragEvent<HTMLDivElement>) => {
    event.preventDefault();
    if (this.props.disabled || this.state.uploading) return;
    this.setState({ dragover: true });
  };

  private onDrop = (event: React.DragEvent<HTMLDivElement>) => {
    event.preventDefault();
    this.setState({ dragover: false });
    const { accept, disabled } = this.props;

    if (disabled || this.state.uploading) return;

    let files = Array.from(event.dataTransfer.files);

    if (accept) {
      const acceptedTypeList = accept.split(",").map(type => type.trim());
      const isFileTypeAcceptedFilter = isFileTypeAccepted(acceptedTypeList);
      files = files.filter(isFileTypeAcceptedFilter);
    }

    const e = ({
      target: {
        files
      }
    } as unknown) as React.ChangeEvent<HTMLInputElement>;
    this.onChange(e);
  };

  private onDragLeave = (event: React.DragEvent<HTMLDivElement>) => {
    event.preventDefault();
    if (this.props.disabled || this.state.uploading) return;
    this.setState({ dragover: false });
  };

  private onKeyDown = (event: React.KeyboardEvent) => {
    if (event.key === "Enter") {
      this.onClick();
    }
  };

  public render() {
    const {
      name,
      multiple,
      accept,
      children,
      directory,
      disabled
    } = this.props;

    const defaultDropNode = (

        <IconUpload className="c-upload__drop-icon" />

点击或将文件拖拽到这里上传

          支持扩展名:{accept || "*"}

    );

    const defaultNode = (
      <Button type="primary" disabled={disabled} loading={this.state.uploading}>
        上传
      </Button>
    );

    return (

        {this.props.droppable ? (

            {children || defaultDropNode}

        ) : (

{children || defaultNode}

        )}
        <input
          ref={node => {
            this.fileInput = node;
          }}
          name={name}
          type="file"
          onChange={this.onChange}
          className="c-upload--hidden"
          multiple={multiple}
          accept={accept}
          // @ts-ignore
          webkitdirectory={directory ? "webkitdirectory" : null}
        />

    );
  }
}


text:
package org.dcm4che.client;

import java.io.IOException;
import java.io.OutputStream;

import javax.imageio.stream.ImageOutputStream;
import javax.imageio.stream.ImageOutputStreamImpl;

/**
 * @author jforaci
 */
public class DataSourceImageOutputStream
	extends ImageOutputStreamImpl
	implements ImageOutputStream
{
    OutputStream out;

	public DataSourceImageOutputStream(Object output)
    {
		super();
        if (!(output instanceof OutputStream))
            throw new UnsupportedOperationException(
                "Only java.io.OutputStream is supported");
        out = (OutputStream)output;
	}

	public void write(int b) throws IOException
    {
        out.write(b);
	}

	public void write(byte[] b, int off, int len) throws IOException
    {
        out.write(b, off, len);
	}

	public int read() throws IOException
    {
		throw new UnsupportedOperationException(
            "reading from an outputstream is not supported");
	}

	public int read(byte[] b, int off, int len) throws IOException
    {
        throw new UnsupportedOperationException(
            "reading from an outputstream is not supported");
	}
}


text:
def cost(matrix1, matrix2):
    return matrix1[0]*matrix1[1]*matrix2[1]

def single_to_double(elements):
    return [(elements[i], elements[i+1]) for i in range(len(elements)-1)]

def minimum_cost(i, j, matrix_array, cache=None):
    if not cache:
        cache={}
    if not (i,j) in cache:
        if i==j:
            result=0
        elif j==i+1:
            result=cost(matrix_array[i], matrix_array[j])
        else:
            result=min(minimum_cost(i, k, matrix_array, cache) + minimum_cost(k+1, j, matrix_array, cache) + matrix_array[i][0]*matrix_array[k][1]*matrix_array[j][1] for k in range(i, j))
        cache[(i,j)]=result
    return cache[(i,j)]

def minimum_multiplication(i, j, matrix_array, cache=None):
    if not cache:
        cache={}
    if not (i,j) in cache:
        if i==j:
            result=(0, [])
        elif j==i+1:
            result=(cost(matrix_array[i], matrix_array[j]) ,[i])
        else:
            result=None
            for k in range(i, j):
                left_cost,left_path=minimum_multiplication(i, k, matrix_array, cache)
                right_cost, right_path=minimum_multiplication(k+1, j, matrix_array, cache)
                extra_residue=matrix_array[i][0]*matrix_array[k][1]*matrix_array[j][1]
                current=(left_cost+right_cost+extra_residue, left_path+right_path+[i])
                if not result:
                    result=current
                else:
                    if current<result:
                        result=current
        cache[(i,j)]=result
    return cache[(i,j)]


text:
'use strict';

// Player list controller
module.exports = /*@ngInject*/ function($scope, PlayerService) {
  $scope.players = [];

  var promise = PlayerService.getList();
  promise.then(function(data) {
    $scope.players = data;
  });

};


text:
package fr.univnantes.termsuite.model;

import java.util.Locale;
import java.util.NoSuchElementException;

import fr.univnantes.termsuite.framework.LanguageException;

public enum Lang {
	FR("french", Locale.FRENCH),
	IT("italian", Locale.ITALIAN),
	EN("english", Locale.ENGLISH),
	ES("spanish", Locale.FRENCH),
	DE("german", Locale.GERMAN),
	ZH("chinese", Locale.SIMPLIFIED_CHINESE),
	LV("latvian", Locale.ENGLISH),
	RU("russian", Locale.ENGLISH),
	DA("danish", Locale.GERMAN),
	UNKOWN("unknown", Locale.ENGLISH)
	;

	private final String longLang;
	private final Locale locale;

    private Lang(String longLang, Locale locale) {
        this.longLang = longLang;
        this.locale = locale;
    }

    public String getName() {
		return longLang;
	}

    public String getNameUC() {
		return getName().substring(0,1).toUpperCase() + getName().substring(1);
	}

    @Override
    public String toString() {
    	return getCode();
    }

	public String getCode() {
		return name().toLowerCase();
	}

	public static void checkLang(String lang) {
		if(!isLanguageSupported(lang))
			throw new LanguageException(lang);
	}

	public static boolean isLanguageSupported(String lang) {
		for(Lang l:Lang.values()) {
			if(l.getCode().equals(lang))
				return true;
		}
		return false;
	}

	public static Lang forName(String lang) {
		for(Lang l:Lang.values()) {
			if(l.getCode().equals(lang))
				return l;
		}
		throw new LanguageException(lang);
	}

	public Locale getLocale() {
		return locale;
	}

	public static Lang fromCode(String code) {
		for(Lang l:values())
			if(l.getCode().equals(code))
				return l;
		throw new NoSuchElementException(code);
	}
}


text:
import { Fragment, useState } from "react";
import { UnityTest } from "./unity-test";

function App() {
  const [isMounted, setIsMounted] = useState(false);
  const [repaintCounter, setRepaintCounter] = useState(0);

  function handleClickToggleMount() {
    setIsMounted(!isMounted);
  }

  return (
    <Fragment>

React Unity WebGL Test

      <button onClick={handleClickToggleMount}>
        {isMounted ? "Unmount" : "Mount"} Unity App
      </button>
      <button onClick={() => setRepaintCounter((i) => i + 1)}>
        Force Repaint App ({repaintCounter})
      </button>
      {isMounted && <UnityTest />}
    </Fragment>
  );
}

export { App };


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<meta http-equiv="content-type" content="text/html;charset=UTF-8" />

<title>  Small Business Update - The Web Standards Project</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="The Web Standards Project is a grassroots coalition fighting for standards which ensure simple, affordable access to web technologies for all." />
<meta name="MSSmartTagsPreventParsing" content="true" />

<link rel="stylesheet" type="text/css" media="screen, projection" href="/wp/wp-content/themes/web-standards-project/styles.css" />
<link rel="stylesheet" type="text/css" media="print" href="/wp/wp-content/themes/web-standards-project/print.css" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="/feed/index.html" />
<link rel="alternate" type="text/xml" title="RSS .92" href="/feed/rss/index.html" />
<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="/feed/atom/index.html" />
<link rel="pingback" href="/wp/xmlrpc.php" />
<link rel="Shortcut Icon" type="image/ico" href="/files/theme/wasp.ico" />
<link rel="home" title="Web Standards Project Home" href="/index.html" />
	<link rel='archives' title='March 2013' href='/2013/03/index.html' />
	<link rel='archives' title='February 2012' href='/2012/02/index.html' />
	<link rel='archives' title='December 2011' href='/2011/12/index.html' />
	<link rel='archives' title='November 2011' href='/2011/11/index.html' />
	<link rel='archives' title='March 2011' href='/2011/03/index.html' />
	<link rel='archives' title='February 2011' href='/2011/02/index.html' />
	<link rel='archives' title='January 2011' href='/2011/01/index.html' />
	<link rel='archives' title='August 2010' href='../../index.html' />
	<link rel='archives' title='June 2010' href='../../../06/index.html' />
	<link rel='archives' title='March 2010' href='../../../03/index.html' />
	<link rel='archives' title='February 2010' href='../../../02/index.html' />
	<link rel='archives' title='January 2010' href='../../../01/index.html' />
	<link rel='archives' title='November 2009' href='/2009/11/index.html' />
	<link rel='archives' title='June 2009' href='/2009/06/index.html' />
	<link rel='archives' title='May 2009' href='/2009/05/index.html' />
	<link rel='archives' title='April 2009' href='/2009/04/index.html' />
	<link rel='archives' title='March 2009' href='/2009/03/index.html' />
	<link rel='archives' title='February 2009' href='/2009/02/index.html' />
	<link rel='archives' title='January 2009' href='/2009/01/index.html' />
	<link rel='archives' title='December 2008' href='/2008/12/index.html' />
	<link rel='archives' title='November 2008' href='/2008/11/index.html' />
	<link rel='archives' title='October 2008' href='/2008/10/index.html' />
	<link rel='archives' title='September 2008' href='/2008/09/index.html' />
	<link rel='archives' title='August 2008' href='/2008/08/index.html' />
	<link rel='archives' title='July 2008' href='/2008/07/index.html' />
	<link rel='archives' title='June 2008' href='/2008/06/index.html' />
	<link rel='archives' title='May 2008' href='/2008/05/index.html' />
	<link rel='archives' title='April 2008' href='/2008/04/index.html' />
	<link rel='archives' title='March 2008' href='/2008/03/index.html' />
	<link rel='archives' title='February 2008' href='/2008/02/index.html' />
	<link rel='archives' title='January 2008' href='/2008/01/index.html' />
	<link rel='archives' title='December 2007' href='/2007/12/index.html' />
	<link rel='archives' title='November 2007' href='/2007/11/index.html' />
	<link rel='archives' title='October 2007' href='/2007/10/index.html' />
	<link rel='archives' title='September 2007' href='/2007/09/index.html' />
	<link rel='archives' title='August 2007' href='/2007/08/index.html' />
	<link rel='archives' title='June 2007' href='/2007/06/index.html' />
	<link rel='archives' title='May 2007' href='/2007/05/index.html' />
	<link rel='archives' title='April 2007' href='/2007/04/index.html' />
	<link rel='archives' title='March 2007' href='/2007/03/index.html' />
	<link rel='archives' title='February 2007' href='/2007/02/index.html' />
	<link rel='archives' title='January 2007' href='/2007/01/index.html' />
	<link rel='archives' title='December 2006' href='/2006/12/index.html' />
	<link rel='archives' title='November 2006' href='/2006/11/index.html' />
	<link rel='archives' title='October 2006' href='/2006/10/index.html' />
	<link rel='archives' title='September 2006' href='/2006/09/index.html' />
	<link rel='archives' title='August 2006' href='/2006/08/index.html' />
	<link rel='archives' title='July 2006' href='/2006/07/index.html' />
	<link rel='archives' title='June 2006' href='/2006/06/index.html' />
	<link rel='archives' title='May 2006' href='/2006/05/index.html' />
	<link rel='archives' title='April 2006' href='/2006/04/index.html' />
	<link rel='archives' title='March 2006' href='/2006/03/index.html' />
	<link rel='archives' title='February 2006' href='/2006/02/index.html' />
	<link rel='archives' title='January 2006' href='/2006/01/index.html' />
	<link rel='archives' title='December 2005' href='/2005/12/index.html' />
	<link rel='archives' title='November 2005' href='/2005/11/index.html' />
	<link rel='archives' title='October 2005' href='/2005/10/index.html' />
	<link rel='archives' title='September 2005' href='/2005/09/index.html' />
	<link rel='archives' title='August 2005' href='/2005/08/index.html' />
	<link rel='archives' title='July 2005' href='/2005/07/index.html' />
	<link rel='archives' title='June 2005' href='/2005/06/index.html' />
	<link rel='archives' title='May 2005' href='/2005/05/index.html' />
	<link rel='archives' title='April 2005' href='/2005/04/index.html' />
	<link rel='archives' title='March 2005' href='/2005/03/index.html' />
	<link rel='archives' title='February 2005' href='/2005/02/index.html' />
	<link rel='archives' title='January 2005' href='/2005/01/index.html' />
	<link rel='archives' title='December 2004' href='/2004/12/index.html' />
	<link rel='archives' title='November 2004' href='/2004/11/index.html' />
	<link rel='archives' title='October 2004' href='/2004/10/index.html' />
	<link rel='archives' title='September 2004' href='/2004/09/index.html' />
	<link rel='archives' title='August 2004' href='/2004/08/index.html' />
	<link rel='archives' title='July 2004' href='/2004/07/index.html' />
	<link rel='archives' title='June 2004' href='/2004/06/index.html' />
	<link rel='archives' title='May 2004' href='/2004/05/index.html' />
	<link rel='archives' title='April 2004' href='/2004/04/index.html' />
	<link rel='archives' title='March 2004' href='/2004/03/index.html' />
	<link rel='archives' title='February 2004' href='/2004/02/index.html' />
	<link rel='archives' title='January 2004' href='/2004/01/index.html' />
	<link rel='archives' title='December 2003' href='/2003/12/index.html' />
	<link rel='archives' title='November 2003' href='/2003/11/index.html' />
	<link rel='archives' title='October 2003' href='/2003/10/index.html' />
	<link rel='archives' title='September 2003' href='/2003/09/index.html' />
	<link rel='archives' title='August 2003' href='/2003/08/index.html' />
	<link rel='archives' title='July 2003' href='/2003/07/index.html' />
	<link rel='archives' title='June 2003' href='/2003/06/index.html' />
	<link rel='archives' title='May 2003' href='/2003/05/index.html' />
	<link rel='archives' title='April 2003' href='/2003/04/index.html' />
	<link rel='archives' title='March 2003' href='/2003/03/index.html' />
	<link rel='archives' title='February 2003' href='/2003/02/index.html' />
	<link rel='archives' title='January 2003' href='/2003/01/index.html' />
	<link rel='archives' title='December 2002' href='/2002/12/index.html' />
	<link rel='archives' title='November 2002' href='/2002/11/index.html' />
	<link rel='archives' title='October 2002' href='/2002/10/index.html' />
	<link rel='archives' title='September 2002' href='/2002/09/index.html' />
	<link rel='archives' title='August 2002' href='/2002/08/index.html' />
	<link rel='archives' title='July 2002' href='/2002/07/index.html' />
	<link rel='archives' title='June 2002' href='/2002/06/index.html' />
	<link rel='archives' title='April 2002' href='/2002/04/index.html' />
	<link rel='archives' title='March 2002' href='/2002/03/index.html' />
	<link rel='archives' title='December 2001' href='/2001/12/index.html' />
	<link rel='archives' title='September 2001' href='/2001/09/index.html' />
	<link rel='archives' title='November 2000' href='/2000/11/index.html' />
	<link rel='archives' title='July 2000' href='/2000/07/index.html' />
	<link rel='archives' title='April 2000' href='/2000/04/index.html' />
	<link rel='archives' title='March 1999' href='/1999/03/index.html' />
	<link rel='archives' title='October 1998' href='/1998/10/index.html' />
	<link rel='archives' title='August 1998' href='/1998/08/index.html' />
<link rel="alternate" type="application/rss+xml" title="The Web Standards Project » Small Business Update Comments Feed" href="feed/index.html" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="/wp/xmlrpc0db0.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="/wp/wp-includes/wlwmanifest.xml" />
<link rel='prev' title='IE9 looks really promising' href='../../../06/28/ie9-looks-reall-promising/index.html' />
<link rel='next' title='HTML5 logo: be proud, but don’t muddy the waters!' href='/2011/01/18/regarding-the-html5-logo/index.html' />
<meta name="generator" content="WordPress 3.3.1" />
<link rel='canonical' href='index.html' />
<link rel='shortlink' href='../../../../indexdf2c.html?p=1961' />

Working together for standards  The Web Standards Project

		Skip to content

				<form id="fm-search" method="get" action="http://www.webstandards.org/index.php">
			<fieldset>
				<legend>Search</legend>
				Search WaSP
				<input id="s" name="s" class="search" value="" />
				<input type="submit" class="submit" name="submit" value="Go!" />
			</fieldset>
		</form>

Home

About

Learn

Action

Buzz

Press

Small Business Update

By Aaron Gustafson | August 5th, 2010 | Filed in Education, Outreach, Small Business Outreach

A while back I announced WaSP’s new small business outreach effort and, thanks to your help, we’ve been making great progress.

				Skip to comment form

Back in February, I announced that one of WaSP’s new efforts was going to be in the direction of outreach to small businesses. Since that time, things have looked pretty quiet from the outside, but the Small Business Outreach Committee has actually been quite busy gathering materials and putting together our first document which aims to help small business owners evaluate the competencies of those seeking to do web work for them.

Thanks to the efforts of a handful of WaSP members and a cadre of other web professionals, we’re making great progress. We’ve just wrapped up the material organization phase and are beginning to work on drafting the document, which we hope to have out before the end of the year. We’re also in the process of putting together a website to house “living” versions of the materials we produce and assist with the promotion and distribution of this document and any others we generate in the future.

We’ll post further announcements on this project as we get closer to the launch date.

Your Replies

#1 On August 25th, 2010 11:23 am DSL replied:

Can you please tell me the expected lunch date?

#2 On September 8th, 2010 5:49 am CodersX Webdesign replied:

Like to hear, that your projects are getting bigger and better.

I wish you the best for the future and hope that WaSP will still remain as the last castle of web standards in the internet. ;)

			Return to top

Post a Reply

Comments are closed.

Back to Top

All of the entries posted in WaSP Buzz express the opinions of their individual authors. They do not necessarily reflect the plans or positions of the Web Standards Project as a group.

This site is valid XHTML 1.0 Strict, CSS | Get Buzz via RSS or Atom | Colophon | Legal


text:
/*!
 ******************* BEGIN Caffe Copyright Notice and Disclaimer ****************
 *
 * COPYRIGHT
 *
 * All contributions by the University of California:
 * Copyright (c) 2014-2017 The Regents of the University of California (Regents)
 * All rights reserved.
 *
 * All other contributions:
 * Copyright (c) 2014-2017, the respective contributors
 * All rights reserved.
 *
 * Caffe uses a shared copyright model: each contributor holds copyright over
 * their contributions to Caffe. The project versioning records all such
 * contribution and copyright details. If a contributor wants to further mark
 * their specific copyright on a particular contribution, they should indicate
 * their copyright solely in the commit message of the change when it is
 * committed.
 *
 * LICENSE
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * CONTRIBUTION AGREEMENT
 *
 * By contributing to the BVLC/caffe repository through pull-request, comment,
 * or otherwise, the contributor releases their content to the
 * license and copyright terms herein.
 *
 ***************** END Caffe Copyright Notice and Disclaimer ********************
 *
 * Copyright (c) 2017 Microsoft
 * Licensed under The Apache-2.0 License [see LICENSE for details]
 * \file deformable_im2col.h
 * \brief Function definitions of converting an image to
 * column matrix based on kernel, padding, dilation, and offset.
 * These functions are mainly used in deformable convolution operators.
 * \ref: https://arxiv.org/abs/1703.06211
 * \author Yuwen Xiong, Haozhi Qi, Jifeng Dai
 */

#ifndef MXNET_OPERATOR_CONTRIB_NN_DEFORMABLE_IM2COL_H_
#define MXNET_OPERATOR_CONTRIB_NN_DEFORMABLE_IM2COL_H_

#include <mxnet/base.h>
#include <mxnet/operator.h>
#include <cstring>
#include <vector>
#include "../../mxnet_op.h"

namespace mxnet {
namespace op {

/*!\brief
 * cpu function of deformable_im2col algorithm
 * \param s device stream
 * \param data_im pointer of an image (C, H, W, ...) in the image batch
 * \param data_offset pointer of offset (C, H, W, ...) in the offset batch
 * \param im_shape input image shape in dimensions (N, C, H, W,)
 * \param col_shape column buffer shape (#channels, output_im_height, output_im_width, ...)
 * \param kernel_shape kernel filter shape
 * \param pad pad shape
 * \param stride stride shape
 * \param dilation dilation shape
 * \param deformable_group #offset group that deformable convolution use
 * \param data_col column buffer pointer
 */
template <typename DType>
inline void deformable_im2col(mshadow::Stream<cpu>* s,
  const DType* data_im, const DType* data_offset,
  const TShape& im_shape, const TShape& col_shape, const TShape& kernel_shape,
  const TShape& pad, const TShape& stride, const TShape& dilation,
  const uint32_t deformable_group, DType* data_col) {
  if (2 == kernel_shape.ndim()) {
    LOG(FATAL) << "only implemented in GPU";
  } else {
    LOG(FATAL) << "not implemented";
  }
}

/*!\brief
 * cpu function of deformable_col2im algorithm
 * \param s device stream
 * \param data_col start pointer of the column buffer to be filled
 * \param data_offset pointer of offset (C, H, W, ...) in the offset batch
 * \param im_shape input image shape in dimensions (N, C, H, W,)
 * \param col_shape column buffer shape
 * \param kernel_shape kernel filter shape
 * \param pad pad shape
 * \param stride stride shape
 * \param dilation dilation shape
 * \param deformable_group #offset group that deformable convolution use
 * \param grad_im pointer of a image (C, H, W,...) in the image batch
 */
template <typename DType>
inline void deformable_col2im(mshadow::Stream<cpu>* s,
  const DType* data_col, const DType* data_offset,
  const TShape& im_shape, const TShape& col_shape, const TShape& kernel_shape,
  const TShape& pad, const TShape& stride,
  const TShape& dilation, const uint32_t deformable_group,
  DType* grad_im, OpReqType req) {
  index_t num_spatial_axes = kernel_shape.ndim();
  LOG(FATAL) << "only implemented in GPU";
}

/*!\brief
 * cpu function of deformable_col2im_coord algorithm
 * \param s device stream
 * \param data_col start pointer of the column buffer to be filled
 * \param data_im pointer of an image (C, H, W, ...) in the image batch
 * \param data_offset pointer of offset (C, H, W, ...) in the offset batch
 * \param im_shape input image shape in dimensions (N, C, H, W,)
 * \param col_shape column buffer shape
 * \param kernel_shape kernel filter shape
 * \param pad pad shape
 * \param stride stride shape
 * \param dilation dilation shape
 * \param deformable_group #offset group that deformable convolution use
 * \param grad_offset pointer of the offset (C, H, W,...) in the offset batch
 */

template <typename DType>
inline void deformable_col2im_coord(mshadow::Stream<cpu>* s,
  const DType* data_col, const DType* data_im, const DType* data_offset, const TShape& im_shape,
  const TShape& col_shape, const TShape& kernel_shape,
  const TShape& pad, const TShape& stride,
  const TShape& dilation, const uint32_t deformable_group, DType* grad_offset, OpReqType req) {
  LOG(FATAL) << "only implemented in GPU";
}

}  // namespace op
}  // namespace mxnet
#ifdef __CUDACC__
#include "./deformable_im2col.cuh"
#endif
#endif  // MXNET_OPERATOR_CONTRIB_NN_DEFORMABLE_IM2COL_H_


text:
package org.wso2.carbon.metrics.sample.service.internal;

import org.wso2.carbon.metrics.core.MetricManagementService;
import org.wso2.carbon.metrics.core.MetricService;

/**
 * DataHolder to hold OSGi services
 */
public class DataHolder {

    private static final DataHolder instance = new DataHolder();

    private MetricService metricService;

    private MetricManagementService metricManagementService;

    private DataHolder() {
    }

    /**
     * This returns the DataHolder instance.
     *
     * @return The DataHolder instance of this singleton class
     */
    public static DataHolder getInstance() {
        return instance;
    }

    /**
     * Returns the {@link MetricService}, which is set by the service component
     *
     * @return The {@link MetricService} instance
     */
    public MetricService getMetricService() {
        return metricService;
    }

    /**
     * Set the {@link MetricService} when the service component gets a reference to the {@link MetricService} instance.
     *
     * @param metricService The {@link MetricService} reference being passed through the service component
     */
    public void setMetricService(MetricService metricService) {
        this.metricService = metricService;
    }

    /**
     * Returns the {@link MetricManagementService}, which is set by the service component
     *
     * @return The {@link MetricManagementService} instance
     */
    public MetricManagementService getMetricManagementService() {
        return metricManagementService;
    }

    /**
     * Set the {@link MetricManagementService} when the service component gets a reference to the
     * {@link MetricManagementService} instance.
     *
     * @param metricManagementService The {@link MetricManagementService} reference being passed through the service
     *                                component
     */
    public void setMetricManagementService(MetricManagementService metricManagementService) {
        this.metricManagementService = metricManagementService;
    }
}


text:
.navbar {
  position: relative;
}

.brand {
  position: relative;
  left: 10%;
  margin-top: -25px !important;
  display: block;
}

.items {
  position: relative;
  display: block;
}

.h-color {
  background: grey;
  border-radius: 2px;
  text-align: center;
}

.img-pos {
  text-align: center;
}

.dropdown-menu {
    width: 200%;
    vertical-align: middle;
}

.list-var {
    list-style-type: none;
}


text:
<?php

namespace triagens\ArangoDb;

/**
 * Provides management of user-functions
 *
 * AqlUserFunction object

 * An AqlUserFunction is an object that is used to manage AQL User Functions.

 * It registers, unregisters and lists user functions on the server

 *

 * The object encapsulates:

 *

 *

 *
 the name of the function
 *
 the actual javascript function
 *

 *

 * The object requires the connection object and can be initialized
 * with or without initial configuration.

 *

 * Any configuration can be set and retrieved by the object's methods like this:

 *

 *

 * $this->setName('myFunctions:myFunction');

 * $this->setCode('function (){your code};');
 *

 *
 *

 * or like this:

 *

 *

 * $this->name('myFunctions:myFunction');

 * $this->code('function (){your code};');
 *

 *
 * @property string $name - The name of the user function
 * @property string $code - The code of the user function
 * @property mixed  _action
 *
 * @package   triagens\ArangoDb
 * @since     1.3
 */
class AqlUserFunction
{
    /**
     * The connection object
     *
     * @var Connection
     */
    private $_connection = null;

    /**
     * The transaction's attributes.
     *
     * @var array
     */
    protected $attributes = array();

    /**
     * The transaction's action.
     *
     * @var string
     */
    protected $_action = '';

    /**
     * Collections index
     */
    const ENTRY_NAME = 'name';

    /**
     * Action index
     */
    const ENTRY_CODE = 'code';

    /**
     * Initialise the AqlUserFunction object
     *
     * The $attributesArray array can be used to specify the name and code for the user function in form of an array.
     *
     * Example:
     * array(
     *   'name' => 'myFunctions:myFunction',
     *   'code' => 'function (){}'
     * )
     *
     *
     * @param Connection $connection      - the connection to be used
     * @param array      $attributesArray - user function initialization data
     *
     * @return \triagens\ArangoDb\AqlUserFunction
     */
    public function __construct(Connection $connection, array $attributesArray = null)
    {
        $this->_connection = $connection;
        if (is_array($attributesArray)) {
            $this->buildAttributesFromArray($attributesArray);
        }
    }

    /**
     * Registers the user function
     *
     * If no parameters ($name,$code) are passed, it will use the properties of the object.
     *
     * If $name and/or $code are passed, it will override the object's properties with the passed ones
     *
     * @param null $name
     * @param null $code
     *
     * @throws Exception throws exception if registration failed
     *
     * @return mixed true if registration was successful.
     */
    public function register($name = null, $code = null)
    {
        $attributes = $this->attributes;

        if ($name) {
            $attributes['name'] = $name;
        }

        if ($code) {
            $attributes['code'] = $code;
        }

        $response      = $this->_connection->post(
                                           Urls::URL_AQL_USER_FUNCTION,
                                           $this->getConnection()->json_encode_wrapper($attributes)
        );
        $responseArray = $response->getJson();

        return $responseArray;
    }

    /**
     * Unregister the user function
     *
     * If no parameter ($name) is passed, it will use the property of the object.
     *
     * If $name is passed, it will override the object's property with the passed one
     *
     * @param string  $name
     * @param boolean $namespace
     *
     * @throws Exception throw exception if the request fails
     *
     * @return mixed true if successful without a return value or the return value if one was set in the action
     */
    public function unregister($name = null, $namespace = false)
    {
        if (is_null($name)) {
            $name = $this->getName();
        }

        $url = UrlHelper::buildUrl(Urls::URL_AQL_USER_FUNCTION, array($name));

        if ($namespace) {
            $url = UrlHelper::appendParamsUrl($url, array('group' => true));
        }

        $response      = $this->_connection->delete($url);
        $responseArray = $response->getJson();

        return $responseArray;
    }

    /**
     * Get registered user functions
     *
     * The method can optionally be passed a $namespace parameter to narrow the results down to a specific namespace.
     *
     * @param null $namespace
     *
     * @throws Exception throw exception if the request failed
     *
     * @return mixed true if successful without a return value or the return value if one was set in the action
     */
    public function getRegisteredUserFunctions($namespace = null)
    {
        $url = UrlHelper::buildUrl(Urls::URL_AQL_USER_FUNCTION, array());
        if (!is_null($namespace)) {
            $url = UrlHelper::appendParamsUrl($url, array('namespace' => $namespace));
        }
        $response = $this->_connection->get($url);

        $responseArray = $response->getJson();

        return $responseArray;
    }

    /**
     * Return the connection object
     *
     * @return Connection - the connection object
     */
    protected function getConnection()
    {
        return $this->_connection;
    }

    /**
     * Set name of the user function. It must have at least one namespace, but also can have sub-namespaces.
     * correct:
     * 'myNamespace:myFunction'
     * 'myRootNamespace:mySubNamespace:myFunction'
     *
     * wrong:
     * 'myFunction'
     *
     *
     * @param string $value
     */
    public function setName($value)
    {
        $this->set(self::ENTRY_NAME, (string) $value);
    }

    /**
     * Get name value
     *
     * @return string name
     */
    public function getName()
    {
        return $this->get(self::ENTRY_NAME);
    }

    /**
     * Set user function code
     *
     * @param string $value
     */
    public function setCode($value)
    {
        $this->set(self::ENTRY_CODE, (string) $value);
    }

    /**
     * Get user function code
     *
     * @return string name
     */
    public function getCode()
    {
        return $this->get(self::ENTRY_CODE);
    }

    /**
     * Set an attribute
     *
     * @param $key
     * @param $value
     *
     * @throws ClientException
     */
    public function set($key, $value)
    {
        if (!is_string($key)) {
            throw new ClientException('Invalid attribute key');
        }

        $this->attributes[$key] = $value;
    }

    /**
     * Set an attribute, magic method
     *
     * This is a magic method that allows the object to be used without
     * declaring all attributes first.
     *
     * @throws ClientException
     *
     * @param string $key   - attribute name
     * @param mixed  $value - value for attribute
     *
     * @return void
     */
    public function __set($key, $value)
    {
        switch ($key) {
            case self::ENTRY_NAME :
                $this->setName($value);
                break;
            case self::ENTRY_CODE :
                $this->setCode($value);
                break;
            default:
                $this->set($key, $value);
                break;
        }
    }

    /**
     * Get an attribute
     *
     * @param string $key - name of attribute
     *
     * @return mixed - value of attribute, NULL if attribute is not set
     */
    public function get($key)
    {
        if (isset($this->attributes[$key])) {
            return $this->attributes[$key];
        }

        return null;
    }

    /**
     * Get an attribute, magic method
     *
     * This function is mapped to get() internally.
     *
     * @param string $key - name of attribute
     *
     * @return mixed - value of attribute, NULL if attribute is not set
     */
    public function __get($key)
    {
        return $this->get($key);
    }

    /**
     * Returns the action string
     *
     * @return string - the current action string
     */
    public function __toString()
    {
        return $this->_action;
    }

    /**
     * Build the object's attributes from a given array
     *
     * @param $options
     */
    public function buildAttributesFromArray($options)
    {
        if (isset($options[self::ENTRY_NAME])) {
            $this->setName($options[self::ENTRY_NAME]);
        }

        if (isset($options[self::ENTRY_CODE])) {
            $this->setCode($options[self::ENTRY_CODE]);
        }
    }
}


text:
package com.google.api.ads.adwords.jaxws.v201402.video;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for AdsApiError.Reason.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <simpleType name="AdsApiError.Reason">
 *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *     <enumeration value="UNHANDLED_ADS_API_ERROR"/>
 *     <enumeration value="INTERNAL_ERROR"/>
 *     <enumeration value="UNEXPECTED_ERROR"/>
 *     <enumeration value="UNKNOWN"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "AdsApiError.Reason")
@XmlEnum
public enum AdsApiErrorReason {

    /**
     *
     *                 Error from ads api that is not handled/converted to video api error.
     *
     *
     */
    UNHANDLED_ADS_API_ERROR,

    /**
     *
     *                 (Permanent) error caused by the service implementation. Potential bug.
     *
     *
     */
    INTERNAL_ERROR,

    /**
     *
     *                 Error from ads api that is not supposed to be received. Potential bug.
     *
     *
     */
    UNEXPECTED_ERROR,

    /**
     *
     *                 Unspecified.
     *
     *
     */
    UNKNOWN;

    public String value() {
        return name();
    }

    public static AdsApiErrorReason fromValue(String v) {
        return valueOf(v);
    }

}


text:
<?xml version="1.0"?>
<PluginConfig>
	<Version>1.0</Version>

	<Intros>
		is a, is nothing but a, is worse than a, is like a, is akin to a, looks like a, smells like a
	</Intros>
	<Adjectives>
		acidic antique contemptible culturally-unsound despicable evil fermented
		festering foul fulminating humid impure inept inferior industrial
		left-over low-quality malodorous off-color penguin-molesting
		petrified pointy-nosed salty sausage-snorfling tastless tempestuous
		tepid tofu-nibbling unintelligent unoriginal uninspiring weasel-smelling
		wretched spam-sucking egg-sucking decayed halfbaked infected squishy
		porous pickled coughed-up thick vapid hacked-up
		unmuzzled bawdy vain lumpish churlish fobbing rank craven puking
		jarring fly-bitten pox-marked fen-sucked spongy droning gleeking warped
		currish milk-livered surly mammering ill-borne beef-witted tickle-brained
		half-faced headless wayward rump-fed onion-eyed beslubbering villainous
		lewd-minded cockered full-gorged rude-snouted crook-pated pribbling
		dread-bolted fool-born puny fawning sheep-biting dankish goatish
		weather-bitten knotty-pated malt-wormy saucy-spleened motley-mind
		it-fowling vassal-willed loggerheaded clapper-clawed frothy ruttish
		clouted common-kissing pignutted folly-fallen plume-plucked flap-mouthed
		swag-bellied dizzy-eyed gorbellied weedy reeky measled spur-galled mangled
		impertinent bootless toad-spotted hasty-witted yeasty
		imp-bladdereddle-headed boil-brained tottering hedge-born hugger-muggered
		elf-skinned
		used heavy cheap rigid soft collapsed fat slow mean sad small huge stretched mediocre nasty erupting painful severed weathered tortured sliced diced alcoholic aged lazy savage smelly moldy old discarded abandoned disliked disproportioned granulated pureed ruptured wretched drunk hungover lame disemboweled disenchanted fraudulent ripped torn homeless shredded gangly amputated putrid disowned disingenuous soured twisted skewered toasted estranged meaningless soggy obese cancerous infected uncultured freeloading artless errant infectious spleeny venomed beetle-headed clay-brained fat-kidneyed slack-jawed ill-nurtured plague-ridden rough-hewn dimwitted

abysmal
alarming
angry
annoying
anxious
appalling
atrocious
awful
bad
barbed
belligerent
boring
broken
callous
clumsy
coarse
cold
cold-hearted
confused
corrosive
corrupt
crazy
creepy
cruel
dead
decaying
damaged
damaging
dastardly
deplorable
depressed
deprived
deformed
despicable
detrimental
dirty
diseased
disgusting
disheveled
dishonest
dishonorable
dismal
dreadful
dreary
eroding
evil
faulty
feeble
filthy
foul
frightful
gawky
ghastly
gross
grotesque
gruesome
haggard
hard-hearted
harmful
hideous
horrendous
horrible
hostile
icky
ignorant
ill
immature
inane
inelegant
infernal
injurious
insane
insidious
insipid
junky
lousy
lumpy
malicious
mean
menacing
messy
misshapen
moldy
monstrous
nasty
naughty
negative
nonsensical
noxious
objectionable
odious
offensive
old
oppressive
pessimistic
petty
plain
poisonous
poor
prejudice
quirky
repulsive
repugnant
revolting
rotten
rude
sad
savage
shoddy
shocking
sick
sickening
sinister
slimy
smelly
sorry
spiteful
sticky
stinky
stupid
substandard
suspicious
terrible
terrifying
ugly
undermining
unfair
unfavorable
unhappy
unhealthy
unjust
unlucky
unpleasant
unsatisfactory
unsightly
untoward
unwanted
unwelcome
unwholesome
unwieldy
unwise
vicious
vile
villainous
wicked
woeful
worthless
yucky
grunchy
grimy
crusty
	</Adjectives>
	<Amounts>
		accumulation bucket coagulation enema-bucketful gob half-mouthful
		heap mass mound petrification pile puddle stack thimbleful tongueful
		ooze quart bag plate assload ocean lake river box truckload cheekful buildup sack
		set collection quantity petri-dish egg-sack body bunch
	</Amounts>
	<PluralThings>
		bat|toenails bug|spit cat|hair chicken|piss dog|vomit dung
		fat-woman's|stomach-bile fish|heads guano gunk pond|scum rat|retch
		waffle-house|grits yoo-hoo Windows|install|disks
		dog|balls seagull|puke cat|bladders pus urine|samples
		squirrel|guts snake|assholes snake|bait buzzard|gizzards
		cat-hair-balls rat-farts pods armadillo|snouts entrails
		snake|snot eel|ooze slurpee-backwash toxic|waste Stimpy-drool
		poop carpet|droppings cold|sores anal|warts
		zits pimples giraffe|intestines goat|spleens kitten|livers dead|swines miscreants maggot-pies joltheads horn-beasts hedge-pigs gudgeons foot-lickers flax-wenches canker-blossoms boar-pigs pig-dogs bladders barnacles trainwrecks wet|blankets
		excrement snot earwax intestines diarrhea

		underbelly|tumors
		butt|flaps
		sweaty|crotch|pimples
		beef|blankets
		beefy|pimplets
		egg|farts
		white|curds
		bean|curds
		fat|cubes
		McVomit
		beef|burps
		puke|bubbles
		membranes
		umblicial|cords
		feet|jams
		toe|jams
		armpits
		throat|acid
		belly|buttons
		dog|urine
		dog|grease
		dandruff
		sewage
		bird|eggs
		juicy|tumors
		tumor|blankets
		lint|turds
		hairballs
		boogers
		crusty|turds
		fat|nuggets
		garbage|cans
		rotten|eggs
		raw|sewage
		vomit|breath
		toad|juice
		bug|squirts
		bug|mash
		tumor|juices
		hair|grease
		face|grease
		whiteheads
		blackheads
		bloody|zits
		dry|turds
		dirty|nails
		barf|blankets
		barf|spray
		bile
		boil
		bull|poop
		goose|pimples
		oozing|pimples
		sweaty|pimple|juice
		popped|pimples
		pimple|squirts
		beefy|pimples
		deoderant|sweat
	</PluralThings>
	<SingleThings>
		zit pimple wart growth blood|clot turd wastebasket urinal snake mosquito pig swine bladder flatulence bacteria hemorrhoid fungus germ airhead deadbeat donkey dope dork dweeb flake floosie freak fruitcake gasbag geezer hick honky jerk loudmouth louse nut prat psycho rat redneck scum scumbag sicko smart-ass toff tool twerp twit wanker wimp yob yokel dipstick ding-dong dingleberry dingus doofus half-wit jerk hoser knucklehead lob lug lunkhead monkey pansy patsy porker pud sap scab schmuck tossbag tosspot turkey wack wacko windbag moron imbecile idiot

		apple-john barnacle boar-pig bugbear bum-bailey canker-blossom clack-dish clotpole coxcomb codpiece death-token dewberry flap-dragon flax-wench flirt-gill foot-licker fustilarian giglet gudgeon haggard harpy hedge-pig horn-beast joithead lewdster lout maggot-pie malt-worm mammet measle minnow miscreant moldwarp nut-hook pigeon-egg pignut puttock pumpion ratsbane scut skainsmate strumpet varlot vassal whey-face wagtail
		backwash
	</SingleThings>

	<Access>
		<Default>voice</Default>
	</Access>

	<Help>
		<Brief>
INSULT - Insult a user.
		</Brief>
		<Detail>
			<insult>
INSULT nickname
INSULT nickname adjective
INSULT nickname adjective noun.
-
Generates a random insult and throws it at the target user.  You may specify replacement adjectives and/or a replacement noun if you like.  Specify which is which by adding punctuation to the noun only.
The insult database was borrowed and modified from the Perl Acme-Scurvy-Whoreson-BilgeRat-Backend-insultserver module: http://search.cpan.org/dist/Acme-Scurvy-Whoreson-BilgeRat-Backend-insultserver/
			</insult>
		</Detail>
	</Help>
</PluginConfig>


text:
.PHONY: help clean clean-pyc clean-build list test test-all coverage sdist

help:
	@echo "clean-build - remove build artifacts"
	@echo "clean-pyc - remove Python file artifacts"
	@echo "clean - clean-{build,pyc}"
	@echo "lint - check style with flake8"
	@echo "test - run tests quickly with the default Python"
	@echo "testall - run tests on every Python version with tox"
	@echo "sdist - package"

clean: clean-build clean-pyc

clean-build:
	rm -fr build/
	rm -fr dist/
	rm -fr *.egg-info

clean-pyc:
	find . -type f -name '*.py[co]' -exec rm -rf {} +
	find . -type d -name '__pycache__' -exec rm -rf {} +
	find . -name '*~' -exec rm -f {} +

lint:
	flake8 --ignore E265,E266,E402 --max-line-length=120

test:
	py.test

testall:
	tox

sdist: clean
	python setup.py sdist
	ls -l dist

bdist: clean
	python setup.py bdist_wheel


text:
'use strict';

/**
* Returns the expected graph width.
*
* @private
* @returns {number} graph width
*/
function get() {
	/* eslint-disable no-invalid-this */
	return this._width - this._paddingLeft - this._paddingRight;
}

// EXPORTS //

module.exports = get;


text:
<?php

namespace Adduc\DomainTracker;

class View {

    protected
        $app,
        $file;

    public function __construct($file, App $app = null) {
        $this->app = is_null($app) ? App::getInstance() : $app;

        $this->file = "{$this->app->getAppRoot()}/templates/{$file}.php";

        if(!file_exists($this->file) || !is_readable($this->file)) {
            throw new Exception\ViewDoesNotExist($this->file);
        }
    }

    public function render(array $variables) {
        extract($variables);
        include($this->file);
    }
}