text:
//
//  JHNavigationController.m
//  SildeLikeQQ
//
//  Created by piglikeyoung on 15/8/19.
//  Copyright (c) 2015年 piglikeyoung. All rights reserved.
//

#import "JHNavigationController.h"

@interface JHNavigationController ()

@end

@implementation JHNavigationController

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

/**
 *  当导航控制器的view创建完毕就调用
 */
- (void)viewDidLoad
{
    [super viewDidLoad];

    // 清空弹出手势的代理,就可以恢复弹出手势
    self.interactivePopGestureRecognizer.delegate = nil;
}

/**
 *  当第一次使用这个类的时候调用1次
 */
+ (void)initialize
{
    //设置UIBarButtonItem的主题
    [self setupBarButtonItemTheme];

    //设置UINavigationBar的主题
    [self setupNavigationBarTheme];

}

/**
 *设置UINavigationBar的主题
 */
+ (void)setupNavigationBarTheme
{

    //通过设置appearance对象,能够修改整个项目中所有UINavigationBar的样式
    UINavigationBar *appearance=[UINavigationBar appearance];

    //设置导航栏的背景色
    [appearance setBackgroundImage:[UIImage imageNamed:@"NavBar64"] forBarMetrics:UIBarMetricsDefault];

    //设置文字属性
    NSMutableDictionary *textAttrs=[NSMutableDictionary dictionary];
    //设置字体颜色
    textAttrs[UITextAttributeTextColor]=[UIColor whiteColor];
    //设置字体
    textAttrs[UITextAttributeFont]=JHNavigationTitleFont;
    //设置字体的偏移量(0)
    //说明:UIOffsetZero是结构体,只有包装成NSValue对象才能放进字典中
    textAttrs[UITextAttributeTextShadowOffset]=[NSValue valueWithUIOffset:UIOffsetZero];
    [appearance setTitleTextAttributes:textAttrs];
}

/**
 *设置UIBarButtonItem的主题
 */
+ (void)setupBarButtonItemTheme
{
    //通过设置appearance对象,能够修改整个项目中所有UIBarButtonItem的样式
    UIBarButtonItem *appearance=[UIBarButtonItem appearance];

    //设置文字的属性
    //1.设置普通状态下文字的属性
    NSMutableDictionary *textAttrs=[NSMutableDictionary dictionary];
    //设置字体
    textAttrs[UITextAttributeFont]=[UIFont systemFontOfSize:15];
    //这是偏移量为0
    textAttrs[UITextAttributeTextShadowOffset]=[NSValue valueWithUIOffset:UIOffsetZero];
    //设置颜色为白色
    textAttrs[UITextAttributeTextColor] = [UIColor whiteColor];
    [appearance setTitleTextAttributes:textAttrs forState:UIControlStateNormal];

    //2.设置高亮状态下文字的属性
    //使用1中的textAttrs进行通用设置
    NSMutableDictionary *highTextAttrs = [NSMutableDictionary dictionaryWithDictionary:textAttrs];
    highTextAttrs[UITextAttributeTextColor] = [UIColor whiteColor];
    [appearance setTitleTextAttributes:highTextAttrs forState:UIControlStateHighlighted];

    //3.设置不可用状态下文字的属性
    //使用1中的textAttrs进行通用设置
    NSMutableDictionary *disabletextAttrs=[NSMutableDictionary dictionaryWithDictionary:textAttrs];
    //设置颜色为灰色
    disabletextAttrs[UITextAttributeTextColor]=[UIColor lightGrayColor];
    [appearance setTitleTextAttributes:disabletextAttrs forState:UIControlStateDisabled];

    //4.设置小图标颜色
    [appearance setTintColor:[UIColor whiteColor]];

    //设置背景
    //技巧提示:为了让某个按钮的背景消失,可以设置一张完全透明的背景图片
    [appearance setBackgroundImage:[UIImage imageNamed:@"navigationbar_button_background"]forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
}

/**
 *  能拦截所有push进来的子控制器
 */
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    // 只有第一次push的控制器显示bottomBar,别的都隐藏
    if (self.viewControllers.count > 0) {
        viewController.hidesBottomBarWhenPushed = YES;

        // 导航栏的左上角和右上角按钮
        viewController.navigationItem.leftBarButtonItem=[UIBarButtonItem itemWithImageName:@"navigationbar_back" highImageName:@"navigationbar_back_highlighted" target:self action:@selector(back)];

    }

    [super pushViewController:viewController animated:animated];
}

- (void)back{

    [self popViewControllerAnimated:YES];
}

- (void)more{

    [self popToRootViewControllerAnimated:YES];
}

@end


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Overview List</title>
<meta name="date" content="2015-03-16">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

All Classes

Packages

com.github.farhan3.jclickerquiz.client

com.github.farhan3.jclickerquiz.common

com.github.farhan3.jclickerquiz.model

com.github.farhan3.jclickerquiz.server

redpajama_set_name: RedPajamaGithub


text:
package edu.uci.ics.jung.io.graphml;

import java.util.ArrayList;
import java.util.List;

/**
 * Maintains all the metadata read in from a single GraphML XML document.
 */
public class GraphMLDocument {

    final private KeyMap keyMap = new KeyMap();
    final private List<GraphMetadata> graphMetadata = new ArrayList<GraphMetadata>();

    public KeyMap getKeyMap() {
        return keyMap;
    }

    public List<GraphMetadata> getGraphMetadata() {
        return graphMetadata;
    }

    public void clear() {
        graphMetadata.clear();
        keyMap.clear();
    }
}


text:
package org.apache.storm.ui;

import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableMap;

import org.apache.storm.Config;
import org.apache.storm.generated.ExecutorInfo;
import org.apache.storm.logging.filters.AccessLoggingFilter;
import org.apache.storm.security.auth.AuthUtils;
import org.apache.storm.security.auth.IHttpCredentialsPlugin;
import org.apache.storm.utils.Utils;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.DispatcherType;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.nio.SelectChannelConnector;
import org.eclipse.jetty.server.ssl.SslSocketConnector;
import org.eclipse.jetty.servlet.FilterHolder;
import org.eclipse.jetty.servlet.FilterMapping;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.servlets.CrossOriginFilter;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.json.simple.JSONValue;

import javax.servlet.Servlet;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.URLEncoder;
import java.util.*;
import java.util.Map.Entry;

public class UIHelpers {

    private static final Object[][] PRETTY_SEC_DIVIDERS = {
            new Object[]{"s", 60},
            new Object[]{"m", 60},
            new Object[]{"h", 24},
            new Object[]{"d", null}};

    private static final Object[][] PRETTY_MS_DIVIDERS = {
            new Object[]{"ms", 1000},
            new Object[]{"s", 60},
            new Object[]{"m", 60},
            new Object[]{"h", 24},
            new Object[]{"d", null}};

    public static String prettyUptimeStr(String val, Object[][] dividers) {
        int uptime = Integer.parseInt(val);
        LinkedList<String> tmp = new LinkedList<>();
        for (Object[] divider : dividers) {
            if (uptime > 0) {
                String state = (String) divider[0];
                Integer div = (Integer) divider[1];
                if (div != null) {
                    tmp.addFirst(uptime % div + state);
                    uptime = uptime / div;
                } else {
                    tmp.addFirst(uptime + state);
                }
            }
        }
        return Joiner.on(" ").join(tmp);
    }

    public static String prettyUptimeSec(String sec) {
        return prettyUptimeStr(sec, PRETTY_SEC_DIVIDERS);
    }

    public static String prettyUptimeSec(int secs) {
        return prettyUptimeStr(String.valueOf(secs), PRETTY_SEC_DIVIDERS);
    }

    public static String prettyUptimeMs(String ms) {
        return prettyUptimeStr(ms, PRETTY_MS_DIVIDERS);
    }

    public static String prettyUptimeMs(int ms) {
        return prettyUptimeStr(String.valueOf(ms), PRETTY_MS_DIVIDERS);
    }

    public static String urlFormat(String fmt, Object... args) {
        String[] argsEncoded = new String[args.length];
        for (int i = 0; i < args.length; i++) {
            argsEncoded[i] = URLEncoder.encode(String.valueOf(args[i]));
        }
        return String.format(fmt, argsEncoded);
    }

    public static String prettyExecutorInfo(ExecutorInfo e) {
        return "[" + e.get_task_start() + "-" + e.get_task_end() + "]";
    }

    public static Map unauthorizedUserJson(String user) {
        return ImmutableMap.of(
                "error", "No Authorization",
                "errorMessage", String.format("User %s is not authorized.", user));
    }

    private static SslSocketConnector mkSslConnector(Integer port, String ksPath, String ksPassword, String ksType,
                                                     String keyPassword, String tsPath, String tsPassword, String tsType,
                                                     Boolean needClientAuth, Boolean wantClientAuth) {
        SslContextFactory factory = new SslContextFactory();
        factory.setExcludeCipherSuites("SSL_RSA_WITH_RC4_128_MD5", "SSL_RSA_WITH_RC4_128_SHA");
        factory.setExcludeProtocols("SSLv3");
        factory.setAllowRenegotiate(false);
        factory.setKeyStorePath(ksPath);
        factory.setKeyStoreType(ksType);
        factory.setKeyStorePassword(ksPassword);
        factory.setKeyManagerPassword(keyPassword);

        if (tsPath != null && tsPassword != null && tsType != null) {
            factory.setTrustStore(tsPath);
            factory.setTrustStoreType(tsType);
            factory.setTrustStorePassword(tsPassword);
        }

        if (needClientAuth != null && needClientAuth) {
            factory.setNeedClientAuth(true);
        } else if (wantClientAuth != null && wantClientAuth) {
            factory.setWantClientAuth(true);
        }

        SslSocketConnector sslConnector = new SslSocketConnector(factory);
        sslConnector.setPort(port);
        return sslConnector;
    }

    public static void configSsl(Server server, Integer port, String ksPath, String ksPassword, String ksType,
                                 String keyPassword, String tsPath, String tsPassword, String tsType, Boolean needClientAuth, Boolean wantClientAuth) {
        if (port > 0) {
            server.addConnector(mkSslConnector(port, ksPath, ksPassword, ksType, keyPassword,
                    tsPath, tsPassword, tsType, needClientAuth, wantClientAuth));
        }
    }

    public static FilterHolder corsFilterHandle() {
        FilterHolder filterHolder = new FilterHolder(new CrossOriginFilter());
        filterHolder.setInitParameter(CrossOriginFilter.ALLOWED_ORIGINS_PARAM, "*");
        filterHolder.setInitParameter(CrossOriginFilter.ALLOWED_ORIGINS_PARAM, "GET, POST, PUT");
        filterHolder.setInitParameter(CrossOriginFilter.ALLOWED_ORIGINS_PARAM, "X-Requested-With, X-Requested-By, Access-Control-Allow-Origin, Content-Type, Content-Length, Accept, Origin");
        filterHolder.setInitParameter(CrossOriginFilter.ACCESS_CONTROL_ALLOW_ORIGIN_HEADER, "*");
        return filterHolder;
    }

    public static FilterHolder mkAccessLoggingFilterHandle() {
        return new FilterHolder(new AccessLoggingFilter());
    }

    public static void configFilter(Server server, Servlet servlet, List<FilterConfiguration> filtersConfs) {
        configFilter(server, servlet, filtersConfs, null);
    }

    public static void configFilter(Server server, Servlet servlet, List<FilterConfiguration> filtersConfs, Map<String, String> params) {
        if (filtersConfs != null) {
            ServletHolder servletHolder = new ServletHolder(servlet);
            servletHolder.setInitOrder(0);
            if (params != null) {
                servletHolder.setInitParameters(params);
            }
            ServletContextHandler context = new ServletContextHandler(server, "/");
            context.addServlet(servletHolder, "/");
            configFilters(context, filtersConfs);
            server.setHandler(context);
        }
    }

    public static void configFilters(ServletContextHandler context, List<FilterConfiguration> filtersConfs) {
        context.addFilter(corsFilterHandle(), "/*", EnumSet.allOf(DispatcherType.class));
        for (FilterConfiguration filterConf : filtersConfs) {
            String filterName = filterConf.getFilterName();
            String filterClass = filterConf.getFilterClass();
            Map filterParams = filterConf.getFilterParams();
            if (filterClass != null) {
                FilterHolder filterHolder = new FilterHolder();
                filterHolder.setClassName(filterClass);
                if (filterName != null) {
                    filterHolder.setName(filterName);
                } else {
                    filterHolder.setName(filterClass);
                }
                if (filterParams != null) {
                    filterHolder.setInitParameters(filterParams);
                } else {
                    filterHolder.setInitParameters(new HashMap<String, String>());
                }
                context.addFilter(filterHolder, "/*", FilterMapping.ALL);
            }
        }
        context.addFilter(mkAccessLoggingFilterHandle(), "/*", EnumSet.allOf(DispatcherType.class));
    }

    private static Server removeNonSslConnector(Server server) {
        for (Connector c : server.getConnectors()) {
            if (c != null && !(c instanceof SslSocketConnector)) {
                server.removeConnector(c);
            }
        }
        return server;
    }

    /**
     * Construct a Jetty Server instance.
     */
    public static Server jettyCreateServer(Integer port, String host, Integer httpsPort) {
        SelectChannelConnector connector = new SelectChannelConnector();
        connector.setPort(Utils.getInt(port, 80));
        connector.setHost(host);
        connector.setMaxIdleTime(200000);

        Server server = new Server();
        server.addConnector(connector);
        server.setSendDateHeader(true);

        if (httpsPort != null && httpsPort > 0) {
            removeNonSslConnector(server);
        }
        return server;
    }

    /**
     * Modified version of run-jetty
     * Assumes configurator sets handler.
     */
    public static void stormRunJetty(Integer port, String host, Integer httpsPort, IConfigurator configurator) throws Exception {
        Server s = jettyCreateServer(port, host, httpsPort);
        if (configurator != null) {
            configurator.execute(s);
        }
        s.start();
    }

    public static void stormRunJetty(Integer port, IConfigurator configurator) throws Exception {
        stormRunJetty(port, null, null, configurator);
    }

    public static String wrapJsonInCallback(String callback, String response) {
        return callback + "(" + response + ");";
    }

    public static Map getJsonResponseHeaders(String callback, Map headers) {
        Map<String, String> headersResult = new HashMap<>();
        headersResult.put("Cache-Control", "no-cache, no-store");
        headersResult.put("Access-Control-Allow-Origin", "*");
        headersResult.put("Access-Control-Allow-Headers", "Content-Type, Access-Control-Allow-Headers, Access-Controler-Allow-Origin, X-Requested-By, X-Csrf-Token, Authorization, X-Requested-With");
        if (callback != null) {
            headersResult.put("Content-Type", "application/javascript;charset=utf-8");
        } else {
            headersResult.put("Content-Type", "application/json;charset=utf-8");
        }
        if (headers != null) {
            headersResult.putAll(headers);
        }
        return headersResult;
    }

    public static String getJsonResponseBody(Object data, String callback, boolean needSerialize) {
        String serializedData = needSerialize ? JSONValue.toJSONString(data) : (String) data;
        return callback != null ? wrapJsonInCallback(callback, serializedData) : serializedData;
    }

    public static Map exceptionToJson(Exception ex) {
        StringWriter sw = new StringWriter();
        ex.printStackTrace(new PrintWriter(sw));
        return ImmutableMap.of("error", "Internal Server Error", "errorMessage", sw.toString());
    }
}


text:
This is a simple parser for CREMUL payment transaction files written in Ruby. It parses
the CREMUL file and creates a Ruby object structure corresponding to the elements in the file.

The parser is currently not a complete parser for all kinds of CREMUl files, but is
being developed further as needed in an ongoing project for a Norwegian customer.

## References

Here are som useful references regarding the CREMUL file format:

1. [CREMUL documentation from bsk.no](http://bsk.no/hovedmeny/gjeldende-standarder.aspx)
2. [CREMUL documentation from truugo.com](http://www.truugo.com/edifact/d12b/cremul/)

## Installation

Add this line to your application's Gemfile:

    gem 'cremul-parser'

And then execute:

    $ bundle install

Or install it yourself as:

    $ gem install cremul-parser

## Usage

```
require 'cremul_parser'

f = File.open(<CREMUL-file>)
parser = CremulParser.new
parser.parse(f)
f.close
```

or if the file is not utf-8 encoded

```
f = File.open(<CREMUL-file>)
parser = CremulParser.new
parser.parse(f, <encoding>) # for instance 'ISO-8859-1'
f.close
```

A file may contain one or more Cremul messages. A Cremul message consists of 'message segments'.
Each segment starts with a Cremul keyword. A group of segments make up a logical element of the
Cremul message. The overall logical structure of a Cremul file is as follows:

```
 [ Cremul file ] 1 --- * [ Cremul message ] 1 --- * [ Line ] 1 --- * [ Payment TX ]
```

See the `parser_test.rb` file for more details.

## Copyright

Copyright (c) 2014 Per Spilling (per@kodemaker.no). See LICENSE.txt for details.


text:
<?php

/**
 * Source report for PHP_CodeSniffer.
 *
 * PHP version 5
 *
 * @category  PHP
 * @package   PHP_CodeSniffer
 * @author    Gabriele Santini <gsantini@sqli.com>
 * @author    Greg Sherwood <gsherwood@squiz.net>
 * @copyright 2009 SQLI <www.sqli.com>
 * @copyright 2006-2011 Squiz Pty Ltd (ABN 77 084 670 600)
 * @license   http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
 * @version   Release: 1.3.3
 * @link      http://pear.php.net/package/PHP_CodeSniffer
 */
class PHP_CodeSniffer_Reports_Source implements PHP_CodeSniffer_Report
{

    /**
     * Prints the source of all errors and warnings.
     *
     * @param array   $report      Prepared report.
     * @param boolean $showSources Show sources?
     * @param int     $width       Maximum allowed lne width.
     * @param boolean $toScreen    Is the report being printed to screen?
     *
     * @return string
     */
    public function generate(
        $report,
        $showSources=false,
        $width=80,
        $toScreen=true
    ) {
        $sources = array();
        $width   = max($width, 70);

        $errorsShown = 0;

        foreach ($report['files'] as $filename => $file) {
            foreach ($file['messages'] as $line => $lineErrors) {
                foreach ($lineErrors as $column => $colErrors) {
                    foreach ($colErrors as $error) {
                        $errorsShown++;

                        $source = $error['source'];
                        if (isset($sources[$source]) === false) {
                            $sources[$source] = 1;
                        } else {
                            $sources[$source]++;
                        }
                    }
                }
            }
        }

        if ($errorsShown === 0) {
            // Nothing to show.
            return 0;
        }

        asort($sources);
        $sources = array_reverse($sources);

        echo PHP_EOL.'PHP CODE SNIFFER VIOLATION SOURCE SUMMARY'.PHP_EOL;
        echo str_repeat('-', $width).PHP_EOL;
        if ($showSources === true) {
            echo 'SOURCE'.str_repeat(' ', ($width - 11)).'COUNT'.PHP_EOL;
            echo str_repeat('-', $width).PHP_EOL;
        } else {
            echo 'STANDARD  CATEGORY            SNIFF'.str_repeat(' ', ($width - 40)).'COUNT'.PHP_EOL;
            echo str_repeat('-', $width).PHP_EOL;
        }

        foreach ($sources as $source => $count) {
            if ($showSources === true) {
                echo $source.str_repeat(' ', ($width - 5 - strlen($source)));
            } else {
                $parts = explode('.', $source);

                if (strlen($parts[0]) > 8) {
                    $parts[0] = substr($parts[0], 0, ((strlen($parts[0]) - 8) * -1));
                }

                echo $parts[0].str_repeat(' ', (10 - strlen($parts[0])));

                $category = $this->makeFriendlyName($parts[1]);
                if (strlen($category) > 18) {
                    $category = substr($category, 0, ((strlen($category) - 18) * -1));
                }

                echo $category.str_repeat(' ', (20 - strlen($category)));

                $sniff = $this->makeFriendlyName($parts[2]);
                if (isset($parts[3]) === true) {
                    $name    = $this->makeFriendlyName($parts[3]);
                    $name[0] = strtolower($name[0]);
                    $sniff  .= ' '.$name;
                }

                if (strlen($sniff) > ($width - 37)) {
                    $sniff = substr($sniff, 0, ($width - 37 - strlen($sniff)));
                }

                echo $sniff.str_repeat(' ', ($width - 35 - strlen($sniff)));
            }//end if

            echo $count.PHP_EOL;
        }//end foreach

        echo str_repeat('-', $width).PHP_EOL;
        echo 'A TOTAL OF '.$errorsShown.' SNIFF VIOLATION(S) ';
        echo 'WERE FOUND IN '.count($sources).' SOURCE(S)'.PHP_EOL;
        echo str_repeat('-', $width).PHP_EOL.PHP_EOL;

        if ($toScreen === true
            && PHP_CODESNIFFER_INTERACTIVE === false
            && class_exists('PHP_Timer', false) === true
        ) {
            echo PHP_Timer::resourceUsage().PHP_EOL.PHP_EOL;
        }

        return $errorsShown;

    }//end generate()

    /**
     * Converts a camel caps name into a readable string.
     *
     * @param string $name The camel caps name to convert.
     *
     * @return string
     */
    public function makeFriendlyName($name)
    {
        $friendlyName = '';
        $length       = strlen($name);

        $lastWasUpper   = false;
        $lastWasNumeric = false;
        for ($i = 0; $i < $length; $i++) {
            if (is_numeric($name[$i]) === true) {
                if ($lastWasNumeric === false) {
                    $friendlyName .= ' ';
                }

                $lastWasUpper   = false;
                $lastWasNumeric = true;
            } else {
                $lastWasNumeric = false;

                $char = strtolower($name[$i]);
                if ($char === $name[$i]) {
                    // Lowercase.
                    $lastWasUpper = false;
                } else {
                    // Uppercase.
                    if ($lastWasUpper === false) {
                        $friendlyName .= ' ';
                        $next = $name[($i + 1)];
                        if (strtolower($next) === $next) {
                            // Next char is lowercase so it is a word boundary.
                            $name[$i] = strtolower($name[$i]);
                        }
                    }

                    $lastWasUpper = true;
                }
            }//end if

            $friendlyName .= $name[$i];
        }//end for

        $friendlyName    = trim($friendlyName);
        $friendlyName[0] = strtoupper($friendlyName[0]);

        return $friendlyName;

    }//end makeFriendlyName()

}//end class

?>


text:
package org.zezutom.schematic.model.json;

import org.zezutom.schematic.service.generator.json.ObjectGenerator;

import java.util.Collections;
import java.util.Map;

public class ObjectNodeTest extends NodeTestCase<Map<String, Object>, ObjectGenerator, ObjectNode> {

    @Override
    ObjectNode newInstance(String name, ObjectGenerator generator) {
        return new ObjectNode(name, generator);
    }

    @Override
    Class<ObjectGenerator> getGeneratorClass() {
        return ObjectGenerator.class;
    }

    @Override
    Map<String, Object> getTestValue() {
        return Collections.singletonMap("test", 123);
    }
}


text:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.github.brunodles.simplepreferences.lib">

</manifest>


text:
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example');

var BasicGame = function(game) {};

BasicGame.Boot = function (game) {
    // nothing here
};

BasicGame.Boot.prototype =
{
    preload: function() {
        game.load.baseURL = 'http://examples.phaser.io/assets/';
        game.load.crossOrigin = 'anonymous';

        game.load.image('phaser', 'sprites/phaser-dude.png');
    },
    create: function()
    {
        var sprite1 = game.add.sprite(20, 100, 'phaser');
        sprite1.inputEnabled = true;
        var sprite2 = game.add.sprite(100, 100, 'phaser');
        sprite2.inputEnabled = true;
        sprite1.name = 'sprite 1';
        sprite2.name = 'sprite 2';
        sprite1.selected = false;
        sprite2.selected = false;
        sprite1.justSelected = false;
        sprite2.justSelected = false;
        sprite1.dragging = false;
        sprite2.dragging = false;
        game.currentSelection = null;
        sprite1.events.onInputDown.add(onMouseDown, sprite1);
        sprite2.events.onInputDown.add(onMouseDown, sprite2);
        sprite1.events.onInputUp.add(onMouseUp, sprite1);
        sprite2.events.onInputUp.add(onMouseUp, sprite2);
        game.input.addMoveCallback(onMouseMove, sprite1);
        game.input.addMoveCallback(onMouseMove, sprite2);
        sprite1.update = function() {
            if (this.selected) {
                this.tint = 0x8080FF;
            } else {
                this.tint = 0xFFFFFF;
            }
        }

        sprite2.update = function() {
            if (this.selected) {
                this.tint = 0xFF8000;
            } else {
                this.tint = 0xFFFFFF;
            }
        }
    },
    update: function()
    {

    },
    render: function()
    {
        game.debug.text('selected: sprite1 ' + game.world.children[0].selected, 2, 14, "#00ff00");
        game.debug.text('selected: sprite2 ' + game.world.children[1].selected, 2, 30, "#00ff00");
        game.debug.text(Phaser.VERSION, game.world.width - 100, 14, "#ffff00");
        //game.debug.pointer(game.input.activePointer);
    }
};

onMouseDown = function(object, pointer) {

    console.log('mouseDown ' + this.name);
    if (this.game.currentSelection && this.game.currentSelection != this) {
        this.game.currentSelection.selected = false;
    }
    this.selected = true;
    this.game.currentSelection = this;
    this.justSelected = true;
    this.dragging = true;
}

onMouseUp = function(object, pointer) {

    console.log('mouseUp ' + this.name);
  //  if (this.selected && !this.dragging && !this.justSelected) {
       this.selected = false;
       this.game.currentSelection = null;
   // }
    if (pointer.leftButton.isUp) {
        this.dragging = false;
        this.justSelected = false;
    }

}
onMouseMove = function(pointer) {

    if (this.selected && pointer.leftButton.isDown && this.dragging) {
        console.log('clicking and dragging while ' + this.name + ' is selected');
        this.x = pointer.x;
        this.y = pointer.y;
    }
}

game.state.add('Boot', BasicGame.Boot);
game.state.start('Boot');


text:
<!DOCTYPE html>

{% include head.html %}

This is Movinun blog - collection of Tips and Tricks and Information

What is GOTS (global organic textile standard?)

mar. 20th, 2016

                    As you may know, we have decided to work with textiles that are certified with Global organic textile standard (GOTS). What the hell is that? ;)

                    We consider it to be a good thing, as GOTS (http://www.global-standard.org/) is a standard that guarentees that textiles all across the supply chain (from planting to manufacturing) follow environmentally and socially responsible practices. Those are ensured by certification of the entire supply chain. Each producer in the supply chain is audited at least every three years (most of them annually), occasionally a suprise audit is done. Each of the supplier needs to comply with different criteria of environment protection (such as soil, chemicals, waste, water, energy ...) and social protection (such as employment, work conditions, human development, human rights, sustainability, compliance with legislation ...).

                    The GOTS was developed through collaboration of different standard setters. It ensures that product is made of at least 70 % organic fibres (label-grade 2) or at least 95 % organic fibres (label-grade 1). We are using label-grade 1 textiles for production of our apparel, as we want to provide customers clothes that are ethically acceptable both from environmental as well as social aspect and we aim to obtain GOTS certificate as soon as possible. To help you become even better (looking). ;)

                    You can watch this video for more information.

                    Comments are (for now) welcome on our Facebook page, we'll be happy to hear any suggestions.

                    Back

  {% include footer.html %}


text:
require "support/shared/integration/integration_helper"
require "chef/knife/list"
require "chef/knife/delete"
require "chef/knife/show"
require "chef/knife/raw"
require "chef/knife/cookbook_upload"

describe "ChefFSDataStore tests", :workstation do
  include IntegrationSupport
  include KnifeSupport

  let(:cookbook_x_100_metadata_rb) { cb_metadata("x", "1.0.0") }
  let(:cookbook_z_100_metadata_rb) { cb_metadata("z", "1.0.0") }

  describe "with repo mode 'hosted_everything' (default)" do
    before do
      Chef::Config.chef_zero.osc_compat = false
    end

    when_the_repository "has one of each thing" do
      before do
        file "clients/x.json", {}
        file "cookbook_artifacts/x-111/metadata.rb", cookbook_x_100_metadata_rb
        file "cookbooks/x/metadata.rb", cookbook_x_100_metadata_rb
        file "data_bags/x/y.json", {}
        file "environments/x.json", {}
        file "nodes/x.json", {}
        file "roles/x.json", {}
        # file "users/x.json", {}
        file "containers/x.json", {}
        file "groups/x.json", {}
        file "containers/x.json", {}
        file "groups/x.json", {}
        file "policies/x-111.json", {}
        file "policy_groups/x.json", {}
      end

      context "GET /TYPE" do
        it "knife list -z -R returns everything" do
          knife("list -z -Rfp /").should_succeed <<~EOM
            /acls/
            /acls/clients/
            /acls/clients/x.json
            /acls/containers/
            /acls/containers/x.json
            /acls/cookbook_artifacts/
            /acls/cookbook_artifacts/x.json
            /acls/cookbooks/
            /acls/cookbooks/x.json
            /acls/data_bags/
            /acls/data_bags/x.json
            /acls/environments/
            /acls/environments/x.json
            /acls/groups/
            /acls/groups/x.json
            /acls/nodes/
            /acls/nodes/x.json
            /acls/organization.json
            /acls/policies/
            /acls/policies/x.json
            /acls/policy_groups/
            /acls/policy_groups/x.json
            /acls/roles/
            /acls/roles/x.json
            /clients/
            /clients/x.json
            /containers/
            /containers/x.json
            /cookbook_artifacts/
            /cookbook_artifacts/x-111/
            /cookbook_artifacts/x-111/metadata.rb
            /cookbooks/
            /cookbooks/x/
            /cookbooks/x/metadata.rb
            /data_bags/
            /data_bags/x/
            /data_bags/x/y.json
            /environments/
            /environments/x.json
            /groups/
            /groups/x.json
            /invitations.json
            /members.json
            /nodes/
            /nodes/x.json
            /org.json
            /policies/
            /policies/x-111.json
            /policy_groups/
            /policy_groups/x.json
            /roles/
            /roles/x.json
          EOM
        end
      end

      context "DELETE /TYPE/NAME" do
        it "knife delete -z /clients/x.json works" do
          knife("delete -z /clients/x.json").should_succeed "Deleted /clients/x.json\n"
          knife("list -z -Rfp /clients").should_succeed ""
        end

        it "knife delete -z -r /cookbooks/x works" do
          knife("delete -z -r /cookbooks/x").should_succeed "Deleted /cookbooks/x\n"
          knife("list -z -Rfp /cookbooks").should_succeed ""
        end

        it "knife delete -z -r /data_bags/x works" do
          knife("delete -z -r /data_bags/x").should_succeed "Deleted /data_bags/x\n"
          knife("list -z -Rfp /data_bags").should_succeed ""
        end

        it "knife delete -z /data_bags/x/y.json works" do
          knife("delete -z /data_bags/x/y.json").should_succeed "Deleted /data_bags/x/y.json\n"
          knife("list -z -Rfp /data_bags").should_succeed "/data_bags/x/\n"
        end

        it "knife delete -z /environments/x.json works" do
          knife("delete -z /environments/x.json").should_succeed "Deleted /environments/x.json\n"
          knife("list -z -Rfp /environments").should_succeed ""
        end

        it "knife delete -z /nodes/x.json works" do
          knife("delete -z /nodes/x.json").should_succeed "Deleted /nodes/x.json\n"
          knife("list -z -Rfp /nodes").should_succeed ""
        end

        it "knife delete -z /roles/x.json works" do
          knife("delete -z /roles/x.json").should_succeed "Deleted /roles/x.json\n"
          knife("list -z -Rfp /roles").should_succeed ""
        end

      end

      context "GET /TYPE/NAME" do
        it "knife show -z /clients/x.json works" do
          knife("show -z /clients/x.json").should_succeed( /"x"/ )
        end

        it "knife show -z /cookbooks/x/metadata.rb works" do
          knife("show -z /cookbooks/x/metadata.rb").should_succeed "/cookbooks/x/metadata.rb:\n#{cookbook_x_100_metadata_rb}\n"
        end

        it "knife show -z /data_bags/x/y.json works" do
          knife("show -z /data_bags/x/y.json").should_succeed( /"y"/ )
        end

        it "knife show -z /environments/x.json works" do
          knife("show -z /environments/x.json").should_succeed( /"x"/ )
        end

        it "knife show -z /nodes/x.json works" do
          knife("show -z /nodes/x.json").should_succeed( /"x"/ )
        end

        it "knife show -z /roles/x.json works" do
          knife("show -z /roles/x.json").should_succeed( /"x"/ )
        end

      end

      context "PUT /TYPE/NAME" do
        before do
          file "empty.json", {}
          file "dummynode.json", { "name" => "x", "chef_environment" => "rspec" , "json_class" => "Chef::Node", "normal" => { "foo" => "bar" } }
          file "rolestuff.json", '{"description":"hi there","name":"x"}'
          file "cookbooks_to_upload/x/metadata.rb", cookbook_x_100_metadata_rb
        end

        it "knife raw -z -i empty.json -m PUT /clients/x" do
          knife("raw -z -i #{path_to('empty.json')} -m PUT /clients/x").should_succeed( /"x"/ )
          knife("list --local /clients").should_succeed "/clients/x.json\n"
        end

        it "knife cookbook upload works" do
          knife("cookbook upload -z --cookbook-path #{path_to('cookbooks_to_upload')} x").should_succeed stderr: <<~EOM
            Uploading x              [1.0.0]
            Uploaded 1 cookbook.
          EOM
          knife("list --local -Rfp /cookbooks").should_succeed "/cookbooks/x/\n/cookbooks/x/metadata.rb\n"
        end

        it "knife raw -z -i empty.json -m PUT /data/x/y" do
          knife("raw -z -i #{path_to('empty.json')} -m PUT /data/x/y").should_succeed( /"y"/ )
          knife("list --local -Rfp /data_bags").should_succeed "/data_bags/x/\n/data_bags/x/y.json\n"
        end

        it "knife raw -z -i empty.json -m PUT /environments/x" do
          knife("raw -z -i #{path_to('empty.json')} -m PUT /environments/x").should_succeed( /"x"/ )
          knife("list --local /environments").should_succeed "/environments/x.json\n"
        end

        it "knife raw -z -i dummynode.json -m PUT /nodes/x" do
          knife("raw -z -i #{path_to('dummynode.json')} -m PUT /nodes/x").should_succeed( /"x"/ )
          knife("list --local /nodes").should_succeed "/nodes/x.json\n"
          knife("show -z /nodes/x.json --verbose").should_succeed(/"bar"/)
        end

        it "knife raw -z -i empty.json -m PUT /roles/x" do
          knife("raw -z -i #{path_to('empty.json')} -m PUT /roles/x").should_succeed( /"x"/ )
          knife("list --local /roles").should_succeed "/roles/x.json\n"
        end

        it "After knife raw -z -i rolestuff.json -m PUT /roles/x, the output is pretty" do
          knife("raw -z -i #{path_to('rolestuff.json')} -m PUT /roles/x").should_succeed( /"x"/ )
          expect(IO.read(path_to("roles/x.json"))).to eq <<~EOM.strip
            {
              "name": "x",
              "description": "hi there"
            }
          EOM
        end
      end
    end

    when_the_repository "is empty" do
      context "POST /TYPE/NAME" do
        before do
          file "empty.json", { "name" => "z" }
          file "dummynode.json", { "name" => "z", "chef_environment" => "rspec" , "json_class" => "Chef::Node", "normal" => { "foo" => "bar" } }
          file "empty_x.json", { "name" => "x" }
          file "empty_id.json", { "id" => "z" }
          file "rolestuff.json", '{"description":"hi there","name":"x"}'
          file "cookbooks_to_upload/z/metadata.rb", cookbook_z_100_metadata_rb
        end

        it "knife raw -z -i empty.json -m POST /clients" do
          knife("raw -z -i #{path_to('empty.json')} -m POST /clients").should_succeed( /uri/ )
          knife("list --local /clients").should_succeed "/clients/z.json\n"
        end

        it "knife cookbook upload works" do
          knife("cookbook upload -z --cookbook-path #{path_to('cookbooks_to_upload')} z").should_succeed stderr: <<~EOM
            Uploading z            [1.0.0]
            Uploaded 1 cookbook.
          EOM
          knife("list --local -Rfp /cookbooks").should_succeed "/cookbooks/z/\n/cookbooks/z/metadata.rb\n"
        end

        it "knife raw -z -i empty.json -m POST /data" do
          knife("raw -z -i #{path_to('empty.json')} -m POST /data").should_succeed( /uri/ )
          knife("list --local -Rfp /data_bags").should_succeed "/data_bags/z/\n"
        end

        it "knife raw -z -i empty.json -m POST /data/x" do
          knife("raw -z -i #{path_to('empty_x.json')} -m POST /data").should_succeed( /uri/ )
          knife("raw -z -i #{path_to('empty_id.json')} -m POST /data/x").should_succeed( /"z"/ )
          knife("list --local -Rfp /data_bags").should_succeed "/data_bags/x/\n/data_bags/x/z.json\n"
        end

        it "knife raw -z -i empty.json -m POST /environments" do
          knife("raw -z -i #{path_to('empty.json')} -m POST /environments").should_succeed( /uri/ )
          knife("list --local /environments").should_succeed "/environments/z.json\n"
        end

        it "knife raw -z -i dummynode.json -m POST /nodes" do
          knife("raw -z -i #{path_to('dummynode.json')} -m POST /nodes").should_succeed( /uri/ )
          knife("list --local /nodes").should_succeed "/nodes/z.json\n"
          knife("show -z /nodes/z.json").should_succeed(/"bar"/)
        end

        it "knife raw -z -i empty.json -m POST /roles" do
          knife("raw -z -i #{path_to('empty.json')} -m POST /roles").should_succeed( /uri/ )
          knife("list --local /roles").should_succeed "/roles/z.json\n"
        end

        it "After knife raw -z -i rolestuff.json -m POST /roles, the output is pretty" do
          knife("raw -z -i #{path_to('rolestuff.json')} -m POST /roles").should_succeed( /uri/ )
          expect(IO.read(path_to("roles/x.json"))).to eq <<~EOM.strip
            {
              "name": "x",
              "description": "hi there"
            }
          EOM
        end
      end

      it "knife list -z -R returns nothing" do
        knife("list -z -Rfp /").should_succeed <<~EOM
          /acls/
          /acls/clients/
          /acls/containers/
          /acls/cookbook_artifacts/
          /acls/cookbooks/
          /acls/data_bags/
          /acls/environments/
          /acls/groups/
          /acls/nodes/
          /acls/organization.json
          /acls/policies/
          /acls/policy_groups/
          /acls/roles/
          /clients/
          /containers/
          /cookbook_artifacts/
          /cookbooks/
          /data_bags/
          /environments/
          /groups/
          /invitations.json
          /members.json
          /nodes/
          /org.json
          /policies/
          /policy_groups/
          /roles/
        EOM
      end

      context "DELETE /TYPE/NAME" do
        it "knife delete -z /clients/x.json fails with an error" do
          knife("delete -z /clients/x.json").should_fail "ERROR: /clients/x.json: No such file or directory\n"
        end

        it "knife delete -z -r /cookbooks/x fails with an error" do
          knife("delete -z -r /cookbooks/x").should_fail "ERROR: /cookbooks/x: No such file or directory\n"
        end

        it "knife delete -z -r /data_bags/x fails with an error" do
          knife("delete -z -r /data_bags/x").should_fail "ERROR: /data_bags/x: No such file or directory\n"
        end

        it "knife delete -z /data_bags/x/y.json fails with an error" do
          knife("delete -z /data_bags/x/y.json").should_fail "ERROR: /data_bags/x/y.json: No such file or directory\n"
        end

        it "knife delete -z /environments/x.json fails with an error" do
          knife("delete -z /environments/x.json").should_fail "ERROR: /environments/x.json: No such file or directory\n"
        end

        it "knife delete -z /nodes/x.json fails with an error" do
          knife("delete -z /nodes/x.json").should_fail "ERROR: /nodes/x.json: No such file or directory\n"
        end

        it "knife delete -z /roles/x.json fails with an error" do
          knife("delete -z /roles/x.json").should_fail "ERROR: /roles/x.json: No such file or directory\n"
        end

      end

      context "GET /TYPE/NAME" do
        it "knife show -z /clients/x.json fails with an error" do
          knife("show -z /clients/x.json").should_fail "ERROR: /clients/x.json: No such file or directory\n"
        end

        it "knife show -z /cookbooks/x/metadata.rb fails with an error" do
          knife("show -z /cookbooks/x/metadata.rb").should_fail "ERROR: /cookbooks/x/metadata.rb: No such file or directory\n"
        end

        it "knife show -z /data_bags/x/y.json fails with an error" do
          knife("show -z /data_bags/x/y.json").should_fail "ERROR: /data_bags/x/y.json: No such file or directory\n"
        end

        it "knife show -z /environments/x.json fails with an error" do
          knife("show -z /environments/x.json").should_fail "ERROR: /environments/x.json: No such file or directory\n"
        end

        it "knife show -z /nodes/x.json fails with an error" do
          knife("show -z /nodes/x.json").should_fail "ERROR: /nodes/x.json: No such file or directory\n"
        end

        it "knife show -z /roles/x.json fails with an error" do
          knife("show -z /roles/x.json").should_fail "ERROR: /roles/x.json: No such file or directory\n"
        end

      end

      context "PUT /TYPE/NAME" do
        before do
          file "empty.json", {}
        end

        it "knife raw -z -i empty.json -m PUT /clients/x fails with 404" do
          knife("raw -z -i #{path_to('empty.json')} -m PUT /clients/x").should_fail( /404/ )
        end

        it "knife raw -z -i empty.json -m PUT /data/x/y fails with 404" do
          knife("raw -z -i #{path_to('empty.json')} -m PUT /data/x/y").should_fail( /404/ )
        end

        it "knife raw -z -i empty.json -m PUT /environments/x fails with 404" do
          knife("raw -z -i #{path_to('empty.json')} -m PUT /environments/x").should_fail( /404/ )
        end

        it "knife raw -z -i empty.json -m PUT /nodes/x fails with 404" do
          knife("raw -z -i #{path_to('empty.json')} -m PUT /nodes/x").should_fail( /404/ )
        end

        it "knife raw -z -i empty.json -m PUT /roles/x fails with 404" do
          knife("raw -z -i #{path_to('empty.json')} -m PUT /roles/x").should_fail( /404/ )
        end

      end
    end
  end

  # We have to configure Zero for Chef 11 mode in order to test users because:
  # 1. local mode overrides your `chef_server_url` to something like "http://localhost:PORT"
  # 2. single org mode maps requests like "https://localhost:PORT/users" so
  #   they're functionally equivalent to "https://localhost:PORT/organizations/DEFAULT/users"
  # 3. Users are global objects in Chef 12, and should be accessed at URLs like
  #   "https://localhost:PORT/users" (there is an org-specific users endpoint,
  #   but it's for listing users in an org, not for managing users).
  # 4. Therefore you can't hit the _real_ users endpoint in local mode when
  #   configured for Chef Server 12 mode.
  #
  # Because of this, we have to configure Zero for Chef 11 OSC mode in order to
  # test the users part of the data store with local mode.
  describe "with repo mode 'everything'" do
    before do
      Chef::Config.repo_mode = "everything"
      Chef::Config.chef_zero.osc_compat = true
    end

    when_the_repository "has one of each thing" do
      before do
        file "clients/x.json", {}
        file "cookbooks/x/metadata.rb", cookbook_x_100_metadata_rb
        file "data_bags/x/y.json", {}
        file "environments/x.json", {}
        file "nodes/x.json", {}
        file "roles/x.json", {}
        file "users/x.json", {}
      end

      context "GET /TYPE" do
        it "knife list -z -R returns everything" do
          knife("list -z -Rfp /").should_succeed <<~EOM
            /clients/
            /clients/x.json
            /cookbooks/
            /cookbooks/x/
            /cookbooks/x/metadata.rb
            /data_bags/
            /data_bags/x/
            /data_bags/x/y.json
            /environments/
            /environments/x.json
            /nodes/
            /nodes/x.json
            /roles/
            /roles/x.json
            /users/
            /users/x.json
          EOM
        end
      end

      context "DELETE /TYPE/NAME" do
        it "knife delete -z /users/x.json works" do
          knife("delete -z /users/x.json").should_succeed "Deleted /users/x.json\n"
          knife("list -z -Rfp /users").should_succeed ""
        end
      end

      context "GET /TYPE/NAME" do
        it "knife show -z /users/x.json works" do
          knife("show -z /users/x.json").should_succeed( /"x"/ )
        end
      end

      context "PUT /TYPE/NAME" do
        before do
          file "empty.json", {}
          file "dummynode.json", { "name" => "x", "chef_environment" => "rspec" , "json_class" => "Chef::Node", "normal" => { "foo" => "bar" } }
          file "rolestuff.json", '{"description":"hi there","name":"x"}'
          file "cookbooks_to_upload/x/metadata.rb", cookbook_x_100_metadata_rb
        end

        it "knife raw -z -i empty.json -m PUT /users/x" do
          knife("raw -z -i #{path_to('empty.json')} -m PUT /users/x").should_succeed( /"x"/ )
          knife("list --local /users").should_succeed "/users/x.json\n"
        end

        it "After knife raw -z -i rolestuff.json -m PUT /roles/x, the output is pretty" do
          knife("raw -z -i #{path_to('rolestuff.json')} -m PUT /roles/x").should_succeed( /"x"/ )
          expect(IO.read(path_to("roles/x.json"))).to eq <<~EOM.strip
            {
              "name": "x",
              "description": "hi there"
            }
          EOM
        end
      end
    end

    when_the_repository "is empty" do
      context "POST /TYPE/NAME" do
        before do
          file "empty.json", { "name" => "z" }
          file "dummynode.json", { "name" => "z", "chef_environment" => "rspec" , "json_class" => "Chef::Node", "normal" => { "foo" => "bar" } }
          file "empty_x.json", { "name" => "x" }
          file "empty_id.json", { "id" => "z" }
          file "rolestuff.json", '{"description":"hi there","name":"x"}'
          file "cookbooks_to_upload/z/metadata.rb", cookbook_z_100_metadata_rb
        end

        it "knife raw -z -i empty.json -m POST /users" do
          knife("raw -z -i #{path_to('empty.json')} -m POST /users").should_succeed( /uri/ )
          knife("list --local /users").should_succeed "/users/z.json\n"
        end
      end

      it "knife list -z -R returns nothing" do
        knife("list -z -Rfp /").should_succeed <<~EOM
          /clients/
          /cookbooks/
          /data_bags/
          /environments/
          /nodes/
          /roles/
          /users/
        EOM
      end

      context "DELETE /TYPE/NAME" do
        it "knife delete -z /users/x.json fails with an error" do
          knife("delete -z /users/x.json").should_fail "ERROR: /users/x.json: No such file or directory\n"
        end
      end

      context "GET /TYPE/NAME" do
        it "knife show -z /users/x.json fails with an error" do
          knife("show -z /users/x.json").should_fail "ERROR: /users/x.json: No such file or directory\n"
        end
      end

      context "PUT /TYPE/NAME" do
        before do
          file "empty.json", {}
        end

        it "knife raw -z -i empty.json -m PUT /users/x fails with 404" do
          knife("raw -z -i #{path_to('empty.json')} -m PUT /users/x").should_fail( /404/ )
        end
      end
    end
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
    JBoss, Home of Professional Open Source
    Copyright 2012, Red Hat, Inc. and/or its affiliates, and individual
    contributors by the @authors tag. See the copyright.txt in the
    distribution for a full listing of individual contributors.

    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.
 -->
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
   http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
    <portlet>
        <description>Portlet demonstrating the navigation part of the Portal API</description>
        <portlet-name>QuickstartNavigationPortlet</portlet-name>
        <display-name>Navigation API Portlet</display-name>
        <portlet-class>org.jboss.quickstarts.portal.navigation.NavigationPortlet</portlet-class>

        <supports>
            <mime-type>text/html</mime-type>
            <portlet-mode>view</portlet-mode>
        </supports>
        <supported-locale>en</supported-locale>
        <resource-bundle>locale.portlet.quickstart.navigation</resource-bundle>
        <portlet-info>
            <title>Navigation API Portlet</title>
            <short-title>Navigation API Portlet</short-title>
            <keywords>Quickstarts</keywords>
        </portlet-info>
    </portlet>
</portlet-app>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Class org.jboss.netty.handler.execution.MemoryAwareThreadPoolExecutor (Netty API Reference (3.10.1.Final))</title>
<meta name="date" content="2015-03-23">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.jboss.netty.handler.execution.MemoryAwareThreadPoolExecutor

Packages that use MemoryAwareThreadPoolExecutor

Package
Description

org.jboss.netty.handler.execution

Executor-based implementation of various
 thread models that separate business logic from I/O threads

Uses of MemoryAwareThreadPoolExecutor in org.jboss.netty.handler.execution

Subclasses of MemoryAwareThreadPoolExecutor in org.jboss.netty.handler.execution

Modifier and Type
Class and Description

class
OrderedDownstreamThreadPoolExecutor

Executor which should be used for downstream ChannelEvent's.

class
OrderedMemoryAwareThreadPoolExecutor

A MemoryAwareThreadPoolExecutor which makes sure the events from the
 same Channel are executed sequentially.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2008-2015 The Netty Project. All Rights Reserved.


text:
require "#{File.join(File.dirname(__FILE__),'..','spec_helper.rb')}"

describe 'sysctl' do

  let(:title) { 'sysctl' }
  let(:node) { 'rspec.example42.com' }
  let(:facts) { { :ipaddress => '10.42.42.42' } }

  describe 'Test minimal installation' do
    it { should contain_package('sysctl').with_ensure('present') }
    it { should contain_file('sysctl.conf').with_ensure('present') }
  end

  describe 'Test installation of a specific version' do
    let(:params) { {:version => '1.0.42' } }
    it { should contain_package('sysctl').with_ensure('1.0.42') }
  end

  describe 'Test decommissioning - absent' do
    let(:params) { {:absent => true } }
    it 'should remove Package[sysctl]' do should contain_package('sysctl').with_ensure('absent') end
    it 'should remove sysctl configuration file' do should contain_file('sysctl.conf').with_ensure('absent') end
  end

  describe 'Test noops mode' do
    let(:params) { {:noops => true} }
    it { should contain_package('sysctl').with_noop('true') }
    it { should contain_file('sysctl.conf').with_noop('true') }
  end

  describe 'Test customizations - template' do
    let(:params) { {:template => "sysctl/spec.erb" , :options => { 'opt_a' => 'value_a' } } }
    it 'should generate a valid template' do
      content = catalogue.resource('file', 'sysctl.conf').send(:parameters)[:content]
      content.should match "fqdn: rspec.example42.com"
    end
    it 'should generate a template that uses custom options' do
      content = catalogue.resource('file', 'sysctl.conf').send(:parameters)[:content]
      content.should match "value_a"
    end
  end

  describe 'Test customizations - source' do
    let(:params) { {:source => "puppet:///modules/sysctl/spec"} }
    it { should contain_file('sysctl.conf').with_source('puppet:///modules/sysctl/spec') }
  end

  describe 'Test customizations - source_dir' do
    let(:params) { {:source_dir => "puppet:///modules/sysctl/dir/spec" , :source_dir_purge => true } }
    it { should contain_file('sysctl.dir').with_source('puppet:///modules/sysctl/dir/spec') }
    it { should contain_file('sysctl.dir').with_purge('true') }
    it { should contain_file('sysctl.dir').with_force('true') }
  end

  describe 'Test customizations - custom class' do
    let(:params) { {:my_class => "sysctl::spec" } }
    it { should contain_file('sysctl.conf').with_content(/rspec.example42.com/) }
  end

end


text:
order: 2
title: 自定义建议
---

## zh-CN

自定义建议

注意,自定义建议时,onSearchChange 必须不能为空。

## en-US

Customize suggestions.

````jsx
import { Mention } from 'antd';
const Nav = Mention.Nav;

const webFrameworks = [
  { name: 'React', type: 'JavaScript' },
  { name: 'Angular', type: 'JavaScript' },
  { name: 'Laravel', type: 'PHP', disabled: true },
  { name: 'Flask', type: 'Python' },
  { name: 'Django', type: 'Python' },
];

const CustomNavMention = React.createClass({
  getInitialState() {
    return {
      suggestions: [],
    };
  },
  onSearchChange(value) {
    const searchValue = value.toLowerCase();
    const filtered = webFrameworks.filter(item =>
      item.name.toLowerCase().indexOf(searchValue) !== -1
    );
    const suggestions = filtered.map(suggestion =>
      <Nav value={suggestion.name} >
        <span>{suggestion.name} - {suggestion.type} </span>
      </Nav>);
    this.setState({ suggestions });
  },
  render() {
    const { suggestions } = this.state;
    return (
      <Mention
        style={{ width: 500, height: 100 }}
        suggestions={suggestions}
        onSearchChange={this.onSearchChange}
      />
    );
  },
});

ReactDOM.render(
  <CustomNavMention />,
  mountNode
);
````


text:
Ansible playbook for Defect Dojo
===================================
This Ansible Playbook is designed to setup Development and Production Defect Dojo environments on Linux. It can install and configure following applications that are commonly used in production Django deployments:

- Nginx (Web Server)
- Gunicorn (App Server)
- PostgreSQL ( Database )
- MySQL ( Database )
- Supervisor ( Process Control )
- Virtualenv (Isolation for python environments)
- Letsencrypt (CA)

## TL;DR - Quick Setup

A quick way to get started is with Vagrant.

### Requirements

Install the following software

- [Ansible >= 2.2 ](http://docs.ansible.com/intro_installation.html)
- [Vagrant > 2.0 ](http://www.vagrantup.com/downloads.html)
- [VirtualBox](https://www.virtualbox.org/wiki/Downloads) or [Docker](https://www.docker.com/get-docker)

### Dev Setup

1. Open up terminal or command prompt and type the following commands.

	```bash
	git clone https://github.com/OWASP/django-DefectDojo.git
	cd django-DefectDojo/ansible
	vagrant up

	sudo echo "192.168.33.18 defect.dojo" > /etc/hosts # you might have to edit this line manually on windows
	```

	Wait a few minutes for the magic to happen. Yup, exactly, you just provisioned a completely new server and deployed an entire Django stack with SSL in 5 minutes with _two words(vagrant up)_ :).

2. visit ``` https://defect.dojo``` to login using credentials.

### Production Setup

1. Open up terminal or command prompt and type the following commands.

	```bash
	git clone https://github.com/OWASP/django-DefectDojo.git
	cd django-DefectDojo/ansible
	```
2. Edit `production.yml` and `production` inventory file to suit your needs (change passwords, private key path, database type etc.,). Use `grep 'var_name' -r .` to find out where a particular variable is set.

3. Run the following command

	```bash
	ansible-playbook -i production production.yml
	```

2. visit ``` https://prod-hostname``` to login using the credentials set in production.yml.

## Configurations Details

All settings(db, nginx, ssl etc.,) are stored in ```vars/all.yml``` for ease however to enable deployment across dev and production environments you should override `vars/development.yml or vars/production.yml` instead of using `vars/all.yml`. If you wish to change some defaults specific to a role, they are available under `roles/role_name/defaults/main.yml`.

Since we are running a security tool, we should have TLS(https), so `certbot` role is also included for automatically generating and renewing trusted SSL certificates with [Let's Encrypt](https://letsencrypt.org/).

**Tested with OS:** Ubuntu 16.04 LTS (64-bit PC), Ubuntu 14.04 LTS (64-bit PC)

**Tested with Cloud Providers:** [Amazon](https://aws.amazon.com), [Rackspace](http://www.rackspace.com/)

### Configuring your application

The main settings to change are in the [vars/base.yml](vars/base.yml) file, where you can configure the location of your Git project, the project name, and the application name which will be used throughout the Ansible configuration.

Some of the defauls are:

__Project name__: defect-dojo

__Installation directory__: /opt/dojo

__Repo code directory__: /opt/dojo/defect-dojo

__Gunicorn start script (environment variables)__: /opt/dojo/bin/gunicorn_start

If you wish to override some defaults, you can change them in all.yml or `vars/development.yml or vars/production.yml` based on what you are using.

The django app installation happens under the role `web `at ```roles/web/tasks/setup_django_app.yml```

Also, if your app needs additional system packages installed, you can add them in `roles/web/tasks/install_additional_packages.yml`.

### Vagrant commands for managing Development Environment

**SSH to the box**

```
vagrant ssh
```

**Re-provision the box to apply the changes you made to the Ansible configuration**

```
vagrant provision
```

**Reboot the box**

```
vagrant reload
```

**Shutdown the box**

```
vagrant halt
```

## Running the Ansible Playbook to provision servers

Create an inventory file for the environment, for example:

```
# development

[webservers]
webserver1.example.com
webserver2.example.com

[dbservers]
dbserver1.example.com
```

Next, create a playbook for the server type. See [webservers.yml](webservers.yml) for an example.

Run the playbook:

```
ansible-playbook -i development webservers.yml
```

You can also provision an entire site by combining multiple playbooks.  For example, I created a playbook called `site.yml` that includes both the `webservers.yml` and `dbservers.yml` playbook.

A few notes here:

- The `dbservers.yml` playbook will only provision servers in the `[dbservers]` section of the inventory file.
- The `webservers.yml` playbook will only provision servers in the `[webservers]` section of the inventory file.

You can then provision the entire site with this command:

```
ansible-playbook -i development site.yml
```

If you're testing with vagrant, you can use this command from directory where `Vagrantfile` is present:

```
ansible-playbook -i vagrant_ansible_inventory --private-key=./.vagrant/machines/defect.dojo/virtualbox/private_key -vv site.yml

```

If you're deploying to amazon EC2 or Digital Ocean's Droplet make sure your inventory knows where your private key by using inventory file as shown below.

```
# Production

[webservers]
webserver1.example.com ansible_ssh_host=webserver1.example.com ansible_ssh_port=22 ansible_ssh_user='ubuntu' ansible_ssh_private_key_file='~/amazon-ec2.pem'

[dbservers]
dbserver1.example.com
```

## Using Ansible for Django Deployments

When doing deployments, you can simply use the `--tags` option to only run those tasks with these tags.

For example, you can add the tag `deploy` to certain tasks that you want to execute as part of your deployment process and then run this command:

```
ansible-playbook -i stage webservers.yml --tags="deploy"
```

This repo already has `deploy` tags specified for tasks that are likely needed to run during deployment in most Django environments.

## Advanced Options

### Changing the Ubuntu release

The [Vagrantfile](Vagrantfile) uses the Ubuntu 16.04 LTS Vagrant box for a 64-bit PC that is published by Canonical in HashiCorp Atlas. To use Ubuntu 14.04 LTS instead, change the `config.vm.box` setting to `ubuntu/trusty64`. To use the Vagrant box for a 32-bit PC, change this setting to `ubuntu/xenial32` or `ubuntu/trusty32`.

### Automatically generating and renewing Let's Encrypt SSL certificates with the certbot client

A `certbot` role has been added to automatically install the `certbot` client and generate a Let's Encrypt SSL certificate.

**Requirements:**

- A DNS "A" or "CNAME" record must exist for the host to issue the certificate to.
- The `--standalone` option is being used, so port 80 or 443 must not be in use (the playbook will automatically check if Nginx is installed and will stop and start the service automatically).

In `roles/nginx/defaults/main.yml`, you're going to want to override the `nginx_use_letsencrypt` variable and set it to yes/true to reference the Let's Encrypt certificate and key in the Nginx template.

In `roles/certbot/defaults/main.yml`, you may want to override the `certbot_admin_email` variable.

A cron job to automatically renew the certificate will run daily.  Note that if a certificate is due for renewal (expiring in less than 30 days), Nginx will be stopped before the certificate can be renewed and then started again once renewal is finished.  Otherwise, nothing will happen so it's safe to leave it running daily.

## TODO
- [ ] Support Redhat/CentOS
- [ ] Add Celery Support

## Useful Links

- [Ansible - Best Practices](http://docs.ansible.com/playbooks_best_practices.html)
- [Setting up Django with Nginx, Gunicorn, virtualenv, supervisor and PostgreSQL](http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/)
- [How to deploy encrypted copies of your SSL keys and other files with Ansible and OpenSSL](http://www.calazan.com/how-to-deploy-encrypted-copies-of-your-ssl-keys-and-other-files-with-ansible-and-openssl/)

## Credits
This playbook heavily relies on [Jonathan's playbook](https://github.com/jcalazan/ansible-django-stack)


text:
FROM debian:unstable
MAINTAINER web@ponkotuy.com

# apt-get
RUN apt-get update && apt-get install -y curl swftools software-properties-common && apt-get clean

# Install Oracle Java
RUN \
  echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list && \
  echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list && \
  apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 && \
  apt-get update
RUN \
  echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
  apt-get install -y oracle-java8-installer &&\
  apt-get clean

# install sbt
RUN mkdir ~/bin && \
  curl -s https://raw.githubusercontent.com/paulp/sbt-extras/master/sbt > ~/bin/sbt \
  && chmod 0755 ~/bin/sbt
VOLUME ["/root/.ivy2", "/root/.sbt"]

# Copy File
RUN mkdir ~/myfleet
ADD project ~/myfleet/project/
ADD server ~/myfleet/server/
ADD library ~/myfleet/library/
ADD client ~/myfleet/client/

# RUN
EXPOSE 9000
WORKDIR ~/myfleet
CMD \
  ~/bin/sbt -v stage && \
  bash -c 'server/target/universal/stage/bin/myfleetgirlsserver -Ddb.default.url="jdbc:mysql://${DB_PORT_3306_TCP_ADDR}:${DB_PORT_3306_TCP_PORT}/myfleet" -Ddb.default.user="root" -Ddb.default.password=""'


text:
/**
 * node database for javascript
 *
 * @author Huiyugeng
 */

function execute(node, query) {
	var command = null;

	if (node == null || ((node instanceof Array) == false && (node instanceof Object) == false)) {
		return null;
	}

	if (query.indexOf(":") > -1 ) {
		command = query.substring(0, query.indexOf(":")).trim();
		query = query.substring(query.indexOf(":") + 1, query.length).trim();
	}

	var queryItems = query.split("!!");

	if (queryItems != null) {
		var path = null;
		var value = null;
		if (queryItems.length > 0) {
			path = queryItems[0].trim();
		}
		if (queryItems.length > 1) {
			value = queryItems[1].trim();
		}

		function __execute(node, command, path, value) {
			var result = null;
			if (command != null) {
				command = command.toLowerCase()
				if (command == "exist") {
					result = select(node, path, true);
					if (result != null && result instanceof Array && result.length > 0) {
						result = true;
					} else {
						result = false;
					}
				} else if (command == "select") {
					result = select(node, path, true);
				} else if (command == "one") {
					result = select(node, path, true);
					if (result != null && result instanceof Array && result.length > 0) {
						result = result[0];
					}
				} else if (command == "delete") {
					result = remove(node, path, value);
				} else if (command == "update") {
					result = update(node, path, value);
				} else if (command == "insert") {
					result = insert(node, path, value);
				}
			}

			return result;
		}

		if (node instanceof Array) {
			var result = new Array();
			for (var item in ndb) {
				if (item instanceof Object) {
					result.push(__execute(node, command, path, value));
				}
			}
			return result;
		} else if (node instanceof Object) {
			return __execute(node, command, path, value);
		}
	}

	return null;
}

/* select node */
var selectResult = null;
selectAction = function (node) {
	selectResult.push(node);
};

function select(ndb, query) {
	this.selectResult = new Array();
	locate(ndb, query, false, selectAction);
	return selectResult;
}

/* update node */
var updateData = null;
updateAction = function (node) {
	if (updateData != null && typeof(updateData) == "object") {
		for (var key in updateData) {
			var value = updateData[key];
			node[key] = value;
		}
	}
};
function update(ndb, query, updateValue) {
	this.updateData = this.parseValue(updateValue);
	locate(ndb, query, false, updateAction);
	return ndb;
}

/* insert node */
var insertData = null;
insertAction = function (node) {
	if (insertData != null && typeof(insertData) == "object") {
		for (var key in insertData) {
			var value = insertData[key];
			node[key] = value;
		}
	}
};
function insert(ndb, query, insertValue) {
	this.insertData = this.parseValue(insertValue);
	locate(ndb, query, true, insertAction);
	return ndb;
}

/* delete node */
var removeColumns = null;
removeAction = function (node) {
	if (removeColumns == "block") {
		for (var key in node) {
			delete node[key];
		}
	} else if (typeof(removeColumns) == "object" && removeColumns.length > 0) {
		for (var i = 0 ; i < removeColumns.length ; i++) {
			var column = removeColumns[i];
			if (column != undefined) {
				delete node[column.trim()];
			}
		}
	}
};
function remove(ndb, query, column) {
	if (column != null && column.startsWith("[") && column.endsWith("]")) {
		this.removeColumns = column.substring(1, column.length - 1).split(",");
	} else {
		this.removeColumns = "block";
	}
	locate(ndb, query, false, removeAction);
	return ndb;
}

function locate(ndb, query, isCreate, action) {
	if(query == null || query == ""){
		return;
	}

	var queryKey = query; //当前项
	var subQuery = query; //子查询

	if(ndb instanceof Array){

		for(var i = 0 ; i < ndb.length ; i++){
			var ndbItem = ndb[i];
			locate(ndbItem, subQuery, isCreate, action);
		}

	} else if(ndb instanceof Object) {

		if (query.indexOf("->") > -1) {
			queryKey = query.substring(0, query.indexOf("->")).trim();
			subQuery = query.substring(query.indexOf("->") + 2, query.length).trim();
		}

		if (isCreate && ndb[queryKey] == null) {
			ndb[queryKey] = {};
		}
		if( subQuery != queryKey || queryKey.startsWith(":")){
			if(queryKey.startsWith(":")){ //根据路径进行查询
				var exp  = queryKey.substring(1, queryKey.length);

				for (var key in ndb) {
					var check = checkValue(key, exp);
					if (check == true) {
						if (subQuery.startsWith(":")){
							locate(ndb, key, isCreate, action);
						} else {
							locate(ndb[key], subQuery, isCreate, action);
						}

					}
				}
			} else {
				locate(ndb[queryKey], subQuery, isCreate, action);
			}
		}else{
			if(subQuery.indexOf(":") > -1){ //根据值进行查询
				var matchItems = subQuery.split("&&");

				var matchResult = true;
				for (var i = 0 ; i < matchItems.length ; i++) {
					var matchItem = matchItems[i];
					var items = matchItem.split(":");
					if(items.length == 2){
						var key = items[0].trim();
						var exp = items[1].trim();

						var value = ndb[key];

						var check = checkValue(value, exp);
						if (check == false) {
							matchResult = false;
						}
					}
				}

				if (matchResult) {
					action(ndb);
				}
			} else {
				var result = ndb[queryKey];
				//创建模式
				if (isCreate) {
					if (result instanceof Array) {
						var list = result;

						var item = {};
						action(item);
						list.push(item);
					} else if (result instanceof Object) {
						var item = result;
						if (countObject(item) == 0) {
							action(item);
						} else {
							var newItem = {};
							action(newItem);

							var list = new Array();
							list.push(item);
							list.push(newItem);

							ndb[queryKey] = list;
						}

					}
				} else {
					if (result instanceof Array) {
						var list = result;
						for (var i = 0 ; i < list.length ; i++){
							var item = list[i];
							action(item);
						}
					}else{
						action(result);
					}
				}
			}
		}
	}
}

function checkValue(value, exp) {

	if (value == null || exp == null) {
		return false;
	}

	if (exp.length > 2 && exp.startsWith("/") && exp.endsWith("/")) {
		var regex = exp.substring(1, exp.length - 1);
		var re = new RegExp(regex);
		if (re.test(value)) {
			return true;
		}
	} else if (exp.length > 3 && exp.startsWith("[") && exp.endsWith("]") && exp.indexOf(",") > 0) {
		var region = exp.substring(1, exp.length - 1).split(",");
		if (region.length == 2) {
			var _min = parseInt(region[0]);
			var _max = parseInt(region[1]);
			var _value = parseInt(value);
			if (_min != NaN && _max != NaN && _value >= _min && _value <= _max) {
				return true;
			}
		}
	} else if (exp.startsWith("^")) {
		if (value.startsWith(exp.substring(1, exp.length))) {
			return true;
		}
	} else if (exp.endsWith("$")) {
		if (value.endsWith(exp.substring(0, exp.length-1))) {
			return true;
		}
	} else {
		if (exp == value) {
			return true;
		}
	}

	return false;
}

function countObject(obj) {
	var count = 0;
	if (obj != null && obj instanceof Object && (obj instanceof Array) == false) {
		for (var key in obj) {
			if(obj.hasOwnProperty(key))	{
				count++;
			}
		}
	}
	return count;
}

function parseValue(value) {
	var data = new Object();
	if (value != undefined && value != "") {
		var values = value.split(",");
		for (var i = 0 ; i < values.length ; i++) {
			var tempValue = values[i];
			var valuePair = tempValue.split("=");
			if (valuePair != null && valuePair.length == 2) {
				data[valuePair[0].trim()] = valuePair[1].trim();
			}
		}
	}
	return data;
}

function read(ndb) {

}

String.prototype.trim = function() {
	return this.replace(/^\s+/g,"").replace(/\s+$/g,"");
}

String.prototype.startsWith = function(str) {
	if (str == undefined) {
		return false;
	}
	var len = str.length;
	if (len > this.length) {
		return false;
	}
	var subString = this.substring(0, len);
	return (subString == str);
};

String.prototype.endsWith = function(str) {
	if (str == undefined) {
		return false;
	}
	var len = str.length;
	if (len > this.length) {
		return false;
	}
	var subString = this.substring(this.length - len, this.length);
	return (subString == str);
};


text:
TARGET := fib

include $(HCLIB_ROOT)/include/hclib.mak

$(TARGET): $(TARGET).c
	$(CC) $^ -o$@ -std=gnu11 $(PROJECT_CFLAGS) $(PROJECT_LDFLAGS) $(PROJECT_LDLIBS)

WORKLOAD_ARGS ?= 5

NPROC ?= 4

.PHONY: run
run: $(TARGET)
	$(SETUP_ENV) HCLIB_WORKERS=$(NPROC) ./$(TARGET) $(WORKLOAD_ARGS)

.PHONY: hoard
hoard: SETUP_ENV=LD_PRELOAD="/opt/local/Hoard/lib/libhoard.so"
hoard: run

.PHONY: tbbmalloc
tbbmalloc: SETUP_ENV=LD_PRELOAD="/usr/lib/libtbbmalloc_proxy.so"
tbbmalloc: run

.PHONY: tcmalloc
tcmalloc: SETUP_ENV=LD_PRELOAD="/usr/lib/libtcmalloc.so.4"
tcmalloc: run

.PHONY: jemalloc
jemalloc: SETUP_ENV=LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libjemalloc.so"
jemalloc: run

clean:
	rm -f $(TARGET)


text:
<!DOCTYPE html>

		<meta charset="utf-8" />
		<base href="../../" />

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

		[page:Geometry] →

[name]

[name] can be used to generate a convex hull for a given array of 3D points.
			The average time complexity for this task is considered to be O(nlog(n)).

Example

[example:webgl_geometry_convex geometry / convex ]

		var geometry = new THREE.ConvexGeometry( points );
		var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
		var mesh = new THREE.Mesh( geometry, material );
		scene.add( mesh );

Constructor

[name]( [param:Array points] )

		points — Array of [page:Vector3 Vector3s] that the resulting convex hull will contain.

Source

		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/geometries/ConvexGeometry.js examples/js/geometries/ConvexGeometry.js]


text:
import importlib

m1 = importlib.import_module('example.submodule')
print(m1)

m2 = importlib.reload(m1)
print(m1 is m2)


text:
package net.baviereteam.minecraft.mapwriterserver.repository;

import net.baviereteam.minecraft.mapwriterserver.domain.Marker;

import org.springframework.data.repository.CrudRepository;

public interface MarkerRepository extends CrudRepository<Marker, Long> {

}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

/**
 * Package containing the service clients for CustomerInsightsManagementClient. The Azure Customer Insights management
 * API provides a RESTful set of web services that interact with Azure Customer Insights service to manage your
 * resources. The API has entities that capture the relationship between an end user and the Azure Customer Insights
 * service.
 */
package com.azure.resourcemanager.customerinsights.fluent;


text:
package arq.examples;

import java.util.ArrayList ;
import java.util.HashMap ;
import java.util.List ;
import java.util.Map ;

import org.apache.jena.query.* ;
import org.apache.jena.rdf.model.ModelFactory ;

public class ExampleDBpedia3
{
    static public void main(String... argv) {
        String serviceURI  = "http://dbpedia-live.openlinksw.com/sparql" ;
        String queryString =
            "SELECT * WHERE { " +
            "    SERVICE <" + serviceURI + "> { " +
            "        SELECT DISTINCT ?company where {?company a <http://dbpedia.org/ontology/Company>} LIMIT 20" +
            "    }" +
            "}" ;

        Query query = QueryFactory.create(queryString) ;
        try(QueryExecution qexec = QueryExecutionFactory.create(query, ModelFactory.createDefaultModel())) {
            Map<String, Map<String,List<String>>> serviceParams = new HashMap<String, Map<String,List<String>>>() ;
            Map<String,List<String>> params = new HashMap<String,List<String>>() ;
            List<String> values = new ArrayList<String>() ;
            values.add("2000") ;
            params.put("timeout", values) ;
            serviceParams.put(serviceURI, params) ;
            qexec.getContext().set(ARQ.serviceParams, serviceParams) ;
            ResultSet rs = qexec.execSelect() ;
            ResultSetFormatter.out(System.out, rs, query) ;
        }
    }

}


text:
namespace GroupDocs.Editor.WebForms.Products.Common.Entity.Web
{
    /// <summary>
    /// Uploaded document entity
    /// </summary>
    public class UploadedDocumentEntity
    {
        public string guid { get; set; }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Fl. carniol. (Wien), Edn 2 21 (1826)

#### Original name
Cladonia pityrea var. pityrea

### Remarks
null


text:
package org.wso2.developerstudio.eclipse.gmf.esb.provider;

import java.util.Collection;
import java.util.List;

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.ResourceLocator;

import org.eclipse.emf.ecore.EStructuralFeature;

import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

import org.wso2.developerstudio.eclipse.gmf.esb.EsbFactory;
import org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage;
import org.wso2.developerstudio.eclipse.gmf.esb.SqlParameterDataType;
import org.wso2.developerstudio.eclipse.gmf.esb.SqlParameterDefinition;

/**
 * This is the item provider adapter for a {@link org.wso2.developerstudio.eclipse.gmf.esb.SqlParameterDefinition} object.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public class SqlParameterDefinitionItemProvider
	extends ItemProviderAdapter
	implements
		IEditingDomainItemProvider,
		IStructuredItemContentProvider,
		ITreeItemContentProvider,
		IItemLabelProvider,
		IItemPropertySource {
	/**
	 * This constructs an instance from a factory and a notifier.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SqlParameterDefinitionItemProvider(AdapterFactory adapterFactory) {
		super(adapterFactory);
	}

	/**
	 * This returns the property descriptors for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */

	@Override
	public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
		if (itemPropertyDescriptors == null) {
			super.getPropertyDescriptors(object);

			addDataTypePropertyDescriptor(object);
			addValueTypePropertyDescriptor(object);
			addValueLiteralPropertyDescriptor(object);
		}
		return itemPropertyDescriptors;
	}

	/**
	 * This adds a property descriptor for the Data Type feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addDataTypePropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_SqlParameterDefinition_dataType_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_SqlParameterDefinition_dataType_feature", "_UI_SqlParameterDefinition_type"),
				 EsbPackage.Literals.SQL_PARAMETER_DEFINITION__DATA_TYPE,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Value Type feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addValueTypePropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_SqlParameterDefinition_valueType_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_SqlParameterDefinition_valueType_feature", "_UI_SqlParameterDefinition_type"),
				 EsbPackage.Literals.SQL_PARAMETER_DEFINITION__VALUE_TYPE,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Value Literal feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addValueLiteralPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_SqlParameterDefinition_valueLiteral_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_SqlParameterDefinition_valueLiteral_feature", "_UI_SqlParameterDefinition_type"),
				 EsbPackage.Literals.SQL_PARAMETER_DEFINITION__VALUE_LITERAL,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
	 * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
	 * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */

	@Override
	public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
		if (childrenFeatures == null) {
			super.getChildrenFeatures(object);
			childrenFeatures.add(EsbPackage.Literals.SQL_PARAMETER_DEFINITION__VALUE_EXPRESSION);
		}
		return childrenFeatures;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */

	@Override
	protected EStructuralFeature getChildFeature(Object object, Object child) {
		// Check the type of the specified child object and return the proper feature to use for
		// adding (see {@link AddCommand}) it as a child.

		return super.getChildFeature(object, child);
	}

	/**
	 * This returns SqlParameterDefinition.gif.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */

	@Override
	public Object getImage(Object object) {
		return overlayImage(object, getResourceLocator().getImage("full/obj16/SqlParameterDefinition"));
	}

	/**
	 * This returns the label text for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */

	@Override
	public String getText(Object object) {
		SqlParameterDataType labelValue = ((SqlParameterDefinition)object).getDataType();
		String label = labelValue == null ? null : labelValue.toString();
		return label == null || label.length() == 0 ?
			getString("_UI_SqlParameterDefinition_type") :
			getString("_UI_SqlParameterDefinition_type") + " " + label;
	}

	/**
	 * This handles model notifications by calling {@link #updateChildren} to update any cached
	 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */

	@Override
	public void notifyChanged(Notification notification) {
		updateChildren(notification);

		switch (notification.getFeatureID(SqlParameterDefinition.class)) {
			case EsbPackage.SQL_PARAMETER_DEFINITION__DATA_TYPE:
			case EsbPackage.SQL_PARAMETER_DEFINITION__VALUE_TYPE:
			case EsbPackage.SQL_PARAMETER_DEFINITION__VALUE_LITERAL:
				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
				return;
			case EsbPackage.SQL_PARAMETER_DEFINITION__VALUE_EXPRESSION:
				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
				return;
		}
		super.notifyChanged(notification);
	}

	/**
	 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
	 * that can be created under this object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */

	@Override
	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
		super.collectNewChildDescriptors(newChildDescriptors, object);

		newChildDescriptors.add
			(createChildParameter
				(EsbPackage.Literals.SQL_PARAMETER_DEFINITION__VALUE_EXPRESSION,
				 EsbFactory.eINSTANCE.createNamespacedProperty()));
	}

	/**
	 * Return the resource locator for this item provider's resources.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */

	@Override
	public ResourceLocator getResourceLocator() {
		return EsbEditPlugin.INSTANCE;
	}

}


text:
Settings Module
#################

The Settings module contains several sections that allow the user to change
certain settings within the app. These settings are configured in the file
*Settings.plist* in *Supporting Files*.

Currently the configurable settings are

* *Font* - the default font to use throughout the application.
* *FontSize* - the default font size to use throughout the application.
* *PrimaryModules* - the order and visibility of primary modules on the home
  screen.
* *SecondaryModules* - the order and visibility of secondary modules on the
  home screen.

Additionally, two settings are not configurable but will appear depending on
context:

* *Login* - if the user is logged in, there will be an option to log out.
* *Servers* - if the app is built in debug mode, there will be a section to
  select which server the application is communicating with.


text:
#import "HUBContentOperation.h"
#import "HUBHeaderMacros.h"

@protocol HUBContentOperationContext;

NS_ASSUME_NONNULL_BEGIN

/**
 *  A concrete content operation type that is executed using a block
 *
 *  You can use this type to implement lightweight content operations, that don't have the need
 *  to be asynchronous or support rescheduling. You simply give a block when initializing an
 *  instance of this class, and that block becomes the body of the content operation.
 *
 *  For more flexibility, implement your own content operation using `HUBContentOperation`.
 */
@interface HUBBlockContentOperation : NSObject <HUBContentOperation>

/**
 *  Initialize an instance of this class
 *
 *  @param block The block to use for the operation. The block will be copied by the operation and
 *         invoked each time the operation is performed. The contextual object passed to the block
 *         will contain all execution parameters that are passed to any `HUBContentOperation`.
 */
- (instancetype)initWithBlock:(void(^)(id<HUBContentOperationContext>))block NS_SWIFT_NAME(init(closure:)) HUB_DESIGNATED_INITIALIZER;

@end

NS_ASSUME_NONNULL_END