text:
define(function (require) {

    'use strict';

    var news = require('lib/news_special/bootstrap');
    var eventStrs = require('model/eventStrs');
    var popVioData = require('model/populationViolenceData');
    var featureDetection = require('model/featureDetection');

    var PopVioGraphMediator = function () {

        /********************************************************
            * VARIABLES
        ********************************************************/
        this.graphEl = news.$('.popVioGraphWithKeyRel');

        /********************************************************
            * INIT STUFF
        ********************************************************/
        this.init();
    };

    PopVioGraphMediator.prototype = {

        init: function () {

            var barsHolderEl = this.graphEl.find('.popVioGraphBars'), svgHolderEl = barsHolderEl.find('.popVioSvgLines');

            var a, pointsLength = popVioData.length, barWidth = 100/pointsLength, barMarginOffset = barWidth*0.5, graphLine, graphLineStr;

            var iCanHazSvg = featureDetection.iCanHazSvg;

            if (iCanHazSvg) {
                /***************************
                    * if we have svg support then we can draw a nice line (svg path) to represent the dom violence rates. Init the path object here
                ***************************/
                graphLine = document.createElementNS('http://www.w3.org/2000/svg',"path"), graphLineStr = 'M' + (barMarginOffset * 2) + ',' + (100 - popVioData[0].violenceRatePercent) + ' ';
            }

            for (a = 0; a < pointsLength; a++) {

                /***************************
                    * add the graph bars based on the model model/populationViolenceData
                ***************************/
                var graphBarEl = news.$('

');
                var barBg = news.$('

');
                graphBarEl.append(barBg);
                graphBarEl.css({
                    width: barWidth + '%',
                    height: popVioData[a].populationPercent + '%',
                    'margin-left': -barMarginOffset + '%',
                    left: barMarginOffset + (a * barWidth) + '%'
                });

                /***************************
                    * add the years key to the bottom of the graph (even years)
                ***************************/
                var isEven = (a % 2 == 0);
                if (isEven) {
                    var barYearEL = news.$('' + popVioData[a].year + '');
                    barYearEL.css({
                        position: 'absolute',
                        bottom: '-25px',
                        left:'50%',
                        'margin-left': '-30px',
                        'text-align': 'center',
                        width: '60px'
                    });
                    if (a && a < (pointsLength - 1)) {
                        barYearEL.addClass('popVioGraphYearKey');
                    }
                    barBg.append(barYearEL);
                }

                barsHolderEl.append(graphBarEl);

                if (iCanHazSvg) {
                    /***************************
                        * add the points along the line (svg path)
                    ***************************/
                    if (a > 0) {
                        graphLineStr += (' L' + ((barMarginOffset + (a * barWidth)) * 2) + ',' + (100 - popVioData[a].violenceRatePercent) + ' ');
                    }
                }
                else {
                    /***************************
                        * ie fallback point
                    ***************************/
                    var fallbackPoint = news.$('

');
                    fallbackPoint.css({
                        bottom: popVioData[a].violenceRatePercent + '%',
                        left: (barMarginOffset + (a * barWidth)) + '%',
                    });
                    barsHolderEl.append(fallbackPoint);
                }

            }

            if (iCanHazSvg) {
                /***************************
                    * append the line (svg path) to the svg element
                ***************************/
                graphLine.setAttribute('d', graphLineStr);
                graphLine.setAttribute('class', 'popVioSvgline');
                svgHolderEl.append(graphLine);
            }

        }

    };

    return PopVioGraphMediator;

});


text:
export MotorA="/sys/class/tacho-motor/motor0"
export MotorB="/sys/class/tacho-motor/motor1"
echo reset > $MotorA/command
echo reset > $MotorB/command
echo coast > $MotorA/stop_command
echo coast > $MotorB/stop_command
echo 1000 > $MotorA/time_sp
echo 1000 > $MotorB/time_sp

redpajama_set_name: RedPajamaGithub


text:
INFO & SUPPORT

                                            SHIPPING & RETURNS

                                                <a href="<?=base_url();?>info/shipping_info">

Shipping

                                                <a href="<?=base_url();?>info/returns">

Returns

                                            HELP & SUPPORT

                                                <a href="<?=base_url();?>info/paymentmethods">

Payment

                                                <a href="<?=base_url();?>info/contactus">

Contact Us

                                                POLICIES

                                                    <a href="<?=base_url();?>info/policy">

Privacy Policy

                                                    <a href="<?=base_url();?>info/sitemap">

Site Map

FOLLOW US

SIGN UP FOR THE NEWSLETTER

                            <input type="text" class="sign-up"/>

                                                CONNECT WITH DIESEL

                                                From promotions to the latest releases, see everything you do with Diesel.

                                                            	Facebook

                                                            	Twitter

                                                            	Google

                                                            	Instagram

                                                            	Youtube

                                                            	Pinterest

                                                            	Social Icon

                                                            	Tumbler

SIGN UP FOR THE NEWSLETTER

                            <input readonly type="text" class="sign-up"/>

                                                SIGN UP FOR THE NEWSLETTER

                                                Sign up to receive must-have style news, updates and promotions before anyone else.

                                                <form id="frmDCode" action="" method="post" name="frmDCode" class="d-code">

                                                            <input id="dCodeEmail" required name="email" placeholder="ENTER EMAIL ADDRESS" type="email"/>

                                                        <input id="submit" type="submit" value="sign up" class="btn-d-code" alt="Subscribe" />

                                                        <a href="<?=base_url();?>info/advantages" class="more">

                                                        LEARN MORE ABOUT NEWSLETTER

                                                </form>

Mandana Holdings Pty Ltd, 30 Tullamarine Park Road, Tullamarine VIC Australia 3043.

                                                Mandana Holdings Pty Ltd, 30 Tullamarine Park Road, Tullamarine VIC Australia 3043.

<?php if($view_file_name == 'cart_view') { ?>

<?php } ?>

<?php if($view_file_name == 'register_view') { ?>

<?php } elseif($view_file_name == 'cart_view') { ?>

<?php } else { ?>

<?php } ?>

<?php if($view_file_name != 'cart_view') { ?>

<?php } ?>


text:
package nl.nn.adapterframework.extensions.ifsa.jms;

import java.util.Map;

import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Queue;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueReceiver;
import javax.jms.QueueSession;
import javax.naming.NamingException;

import nl.nn.adapterframework.extensions.ifsa.IfsaException;
import nl.nn.adapterframework.jms.MessagingSource;
import nl.nn.adapterframework.util.AppConstants;
import nl.nn.adapterframework.util.ClassUtils;

import com.ing.ifsa.IFSAContext;
import com.ing.ifsa.IFSAQueue;
import com.ing.ifsa.IFSAQueueConnectionFactory;

/**
 * {@link MessagingSource} for IFSA connections.
 *
 * IFSA related IBIS objects can obtain an connection from this class. The physical connection is shared
 * between all IBIS objects that have the same ApplicationID.
 *
 * @author Gerrit van Brakel
 */
public class IfsaMessagingSource extends MessagingSource {

	private static final String CLEANUP_ON_CLOSE_KEY="ifsa.cleanUpOnClose";
	private static Boolean cleanUpOnClose=null;

	private boolean preJms22Api;
	private boolean xaEnabled;

	public IfsaMessagingSource(String applicationId, IFSAContext context, IFSAQueueConnectionFactory connectionFactory, Map messagingSourceMap, boolean preJms22Api, boolean xaEnabled) {
		super(applicationId,context,connectionFactory,messagingSourceMap,null,false,true);
		this.preJms22Api=preJms22Api;
		this.xaEnabled=xaEnabled;
		log.debug("created new IfsaMessagingSource for ["+applicationId+"] context ["+context+"] connectionfactory ["+connectionFactory+"]");
	}

	public boolean hasDynamicReplyQueue() throws IfsaException {
		try {
			if (preJms22Api) {
				return !((IFSAQueueConnectionFactory) getConnectionFactory()).IsClientTransactional();
			} else {
				return ((IFSAContext) getContext()).hasDynamicReplyQueue();
			}
		} catch (NamingException e) {
			throw new IfsaException("could not find IfsaContext",e);
		}
	}

	public boolean canUseIfsaModeSessions() throws IfsaException {
		return hasDynamicReplyQueue() && !useSingleDynamicReplyQueue();
	}

	/**
	 * Retrieves the reply queue for a client connection. If the
	 * client is transactional the replyqueue is retrieved from IFSA,
	 * otherwise a temporary (dynamic) queue is created.
	 */
	public Queue getClientReplyQueue(QueueSession session) throws IfsaException {
		Queue replyQueue = null;

		try {
			/*
			 * if we don't know if we're using a dynamic reply queue, we can
			 * check this using the function IsClientTransactional
			 * Yes -> we're using a static reply queue
			 * No -> dynamic reply queue
			 */
			if (hasDynamicReplyQueue()) { // Temporary Dynamic
				replyQueue =  getDynamicReplyQueue(session);
				log.debug("got dynamic reply queue [" +replyQueue.getQueueName()+"]");
			} else { // Static
				replyQueue = (Queue) ((IFSAContext)getContext()).lookupReply(getId());
				log.debug("got static reply queue [" +replyQueue.getQueueName()+"]");
			}
			return replyQueue;
		} catch (Exception e) {
			throw new IfsaException(e);
		}
	}

	protected void releaseClientReplyQueue(Queue replyQueue) throws IfsaException {
		if (hasDynamicReplyQueue()) { // Temporary Dynamic
			releaseDynamicReplyQueue(replyQueue);
		}
	}

	/**
	 * Gets the queueReceiver, by utilizing the getInputQueue() method.

	 * For serverside getQueueReceiver() the creating of the QueueReceiver is done
	 * without the selector information, as this is not allowed
	 * by IFSA.

	 * For a clientconnection, the receiver is done with the getClientReplyQueue
	 */
	public QueueReceiver getReplyReceiver(QueueSession session, Message sentMessage)
		throws IfsaException {

		QueueReceiver queueReceiver;

		String correlationId;
		Queue replyQueue;
		try {
			correlationId = sentMessage.getJMSMessageID(); // IFSA uses the messageId as correlationId
			replyQueue=(Queue)sentMessage.getJMSReplyTo();
		} catch (JMSException e) {
			throw new IfsaException(e);
		}

		try {
			if (hasDynamicReplyQueue() && !useSingleDynamicReplyQueue()) {
				queueReceiver = session.createReceiver(replyQueue);
				log.debug("created receiver on individual dynamic reply queue" );
			} else {
				String selector="JMSCorrelationID='" + correlationId + "'";
				queueReceiver = session.createReceiver(replyQueue, selector);
				log.debug("created receiver on static or shared-dynamic reply queue - selector ["+selector+"]");
			}
		} catch (JMSException e) {
			throw new IfsaException(e);
		}
		return queueReceiver;
	}

	public void closeReplyReceiver(QueueReceiver receiver) throws IfsaException {
		try {
			if (receiver!=null) {
				Queue replyQueue = receiver.getQueue();
				receiver.close();
				releaseClientReplyQueue(replyQueue);
			}
		} catch (JMSException e) {
			throw new IfsaException(e);
		}
	}

  	public IFSAQueue lookupService(String serviceId) throws IfsaException {
		try {
			return (IFSAQueue) ((IFSAContext)getContext()).lookupService(serviceId);
		} catch (NamingException e) {
			throw new IfsaException("cannot lookup queue for service ["+serviceId+"]",e);
		}
  	}

	public IFSAQueue lookupProviderInput() throws IfsaException {
		try {
			return (IFSAQueue) ((IFSAContext)getContext()).lookupProviderInput();
		} catch (NamingException e) {
			throw new IfsaException("cannot lookup provider queue",e);
		}
	}

	protected String replaceLast(String string, char from, char to) {
		int lastTo=string.lastIndexOf(to);
		int lastFrom=string.lastIndexOf(from);

		if (lastFrom>0 && lastTo<lastFrom) {
			String result = string.substring(0,lastFrom)+to+string.substring(lastFrom+1);
			log.info("replacing for Ifsa-compatibility ["+string+"] by ["+result+"]");
			return result;
		}
		return string;
	}

	public String polishServiceId(String serviceId) {
		if (preJms22Api) {
			return replaceLast(serviceId, '/',':');
		} else {
			return replaceLast(serviceId, ':','/');
		}
	}

	public synchronized boolean cleanUpOnClose() {
		if (cleanUpOnClose==null) {
			boolean cleanup=AppConstants.getInstance().getBoolean(CLEANUP_ON_CLOSE_KEY, true);
			cleanUpOnClose = new Boolean(cleanup);
		}
		return cleanUpOnClose.booleanValue();
	}

	protected ConnectionFactory getConnectionFactoryDelegate() throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException {
		return (QueueConnectionFactory)ClassUtils.getDeclaredFieldValue(getConnectionFactory(),"qcf");
	}

	public boolean xaCapabilityCanBeDetermined() {
		return !preJms22Api;
	}

	public boolean isXaEnabled() {
		return xaEnabled;
	}

	public boolean isXaEnabledForSure() {
		return xaCapabilityCanBeDetermined() && isXaEnabled();
	}

	public boolean isNotXaEnabledForSure() {
		return xaCapabilityCanBeDetermined() && !isXaEnabled();
	}

}


text:
package com.classic.simple.fragment;

import com.classic.android.base.BaseFragment;
import com.classic.android.utils.ToastUtil;
import com.classic.simple.R;

public class TextFragment extends BaseFragment {

    @Override public int getLayoutResId() {
        return R.layout.fragment_text;
    }

    @Override public void onFragmentShow() {
        super.onFragmentShow();
        ToastUtil.showToast(mAppContext, "TextFragment --> onFragmentShow()");
    }

    @Override public void onFragmentHide() {
        super.onFragmentHide();
        ToastUtil.showToast(mAppContext, "TextFragment --> onFragmentHide()");
    }
}


text:
namespace SexyFishHorse.WauwBot.View
{
    partial class WauwBot
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.messageTextBox = new System.Windows.Forms.TextBox();
            this.sendButton = new System.Windows.Forms.Button();
            this.chatListBox = new SexyFishHorse.WauwBot.View.UiElements.MessageListBox.MessageListBox();
            this.SuspendLayout();
            //
            // messageTextBox
            //
            this.messageTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.messageTextBox.Location = new System.Drawing.Point(12, 417);
            this.messageTextBox.Name = "messageTextBox";
            this.messageTextBox.Size = new System.Drawing.Size(609, 20);
            this.messageTextBox.TabIndex = 1;
            //
            // sendButton
            //
            this.sendButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.sendButton.Location = new System.Drawing.Point(627, 416);
            this.sendButton.Name = "sendButton";
            this.sendButton.Size = new System.Drawing.Size(75, 21);
            this.sendButton.TabIndex = 2;
            this.sendButton.Text = "Send";
            this.sendButton.UseVisualStyleBackColor = true;
            this.sendButton.Click += new System.EventHandler(this.SendButtonClick);
            //
            // chatListBox
            //
            this.chatListBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.chatListBox.AutoScroll = true;
            this.chatListBox.AutoScrollMinSize = new System.Drawing.Size(660, 0);
            this.chatListBox.BackColor = System.Drawing.Color.White;
            this.chatListBox.Location = new System.Drawing.Point(12, 12);
            this.chatListBox.Name = "chatListBox";
            this.chatListBox.SelectedIndex = -1;
            this.chatListBox.SelectedItem = null;
            this.chatListBox.Size = new System.Drawing.Size(690, 399);
            this.chatListBox.TabIndex = 4;
            //
            // WauwBot
            //
            this.AcceptButton = this.sendButton;
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(714, 449);
            this.Controls.Add(this.chatListBox);
            this.Controls.Add(this.sendButton);
            this.Controls.Add(this.messageTextBox);
            this.Name = "WauwBot";
            this.Text = "WauwBot";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.TextBox messageTextBox;
        private System.Windows.Forms.Button sendButton;
        private UiElements.MessageListBox.MessageListBox chatListBox;
    }
}


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace IRunner
{
    public partial class FrmRunCmd : Form
    {
        private TextBoxRemind remind = null;
        public delegate void RunCmdTextDelegate(string cmdText);
        public event RunCmdTextDelegate RunCmdTextEvent;

        void InitTextBoxRemind()
        {
            remind.InitAutoCompleteCustomSource(txtRunCmd);
        }

        public FrmRunCmd()
        {
            InitializeComponent();
        }

        private void btnRunCmd_Click(object sender, EventArgs e)
        {
            if (remind != null)
            {
                remind.Remind(txtRunCmd.Text.Trim());
                InitTextBoxRemind();
                if (RunCmdTextEvent != null)
                {
                    RunCmdTextEvent(txtRunCmd.Text.Trim());
                }
                this.Close();
            }
        }

        private void FrmRunCmd_Load(object sender, EventArgs e)
        {
            remind = new TextBoxRemind();
            InitTextBoxRemind();
        }

        private void FrmRunCmd_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            IRunnerMain mainForm = this.Owner as IRunnerMain;
            if (mainForm != null)
            {
                mainForm.Activate();
                e.Cancel = true;
            }
        }

        private void btnCloseRun_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void FrmRunCmd_Activated(object sender, EventArgs e)
        {
            int x;
            int y;
            IRunnerMain parForm = (IRunnerMain)this.Owner;
            x = parForm.Left + 20;
            y = parForm.Top + parForm.Height - this.Height - 35;
            this.Location = new Point(x, y);

            txtRunCmd.Focus();
            txtRunCmd.SelectAll();

        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
		http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">
<!-- auto-config="true" disable-url-rewriting="true"-->
	<http auto-config="true" use-expressions="true">

	   	<intercept-url pattern="/" access="permitAll" />
	    <intercept-url pattern="/welcome" access="permitAll" />
		<intercept-url pattern="/login" access="permitAll" />
		<intercept-url pattern="/logout" access="permitAll" />
		<intercept-url pattern="/signup/**" access="permitAll" />
		<intercept-url pattern="/webjars/**" access="permitAll" />
		<intercept-url pattern="/resources/**" access="permitAll" />
		<intercept-url pattern="/consultants" access="hasRole('ROLE_ADMIN')" />
		<intercept-url pattern="/**" access="hasAnyRole('ROLE_USER,ROLE_ADMIN')" />

		<form-login login-page="/login" default-target-url="/welcome" username-parameter="username" password-parameter="password" authentication-failure-url="/login?login_error" />
		<logout logout-url="/logout"/>

			 <custom-filter position="CONCURRENT_SESSION_FILTER" ref="concurrencyFilter" />
		<!--  <custom-filter position ="FORM_LOGIN_FILTER" ref="myAuthFilter" />  -->

  <session-management session-authentication-strategy-ref="sas"/>
	</http>

	<!-- http://docs.spring.io/spring-security/site/docs/3.1.x/reference/session-mgmt.html#list-authenticated-principals -->
 <beans:bean id="concurrencyFilter" class="org.springframework.security.web.session.ConcurrentSessionFilter">
 <beans:constructor-arg name="sessionRegistry" ref="sessionRegistry" />
   <beans:constructor-arg name="expiredUrl" value="/login?login_error"/>

</beans:bean>

<!--   <beans:bean id="myAuthFilter"
      class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter">
    <beans:property name="sessionAuthenticationStrategy" ref="sas" />
    <beans:property name="authenticationManager" ref="authenticationManager" />
  </beans:bean> -->

<beans:bean id="sas" class= "org.springframework.security.web.authentication.session.ConcurrentSessionControlStrategy">
  <beans:constructor-arg name="sessionRegistry" ref="sessionRegistry" />
  <beans:property name="maximumSessions" value="1" />
</beans:bean>

<beans:bean id="sessionRegistry"
    class="org.springframework.security.core.session.SessionRegistryImpl" />

	<beans:bean id="encoder" class="org.springframework.security.crypto.password.StandardPasswordEncoder" />

	<authentication-manager alias="authenticationManager">
<!-- <authentication-provider user-service-ref="userDetailsService"> -->
		<authentication-provider>
			<password-encoder ref="encoder" />
			<user-service>
				<user name="admin" password="19b6fefd41f0040be31931fff3d648b2b0c3baef0e423bce0790ba750c55e1e3db83887934269303" authorities="ROLE_USER" />
				<user name="utm01" password="6e9e6fb19c80c720cc742039cb6ac686a6532f41e377e28d40679a459d33767e838311e47d61a402" authorities="ROLE_USER" />
			</user-service>
		</authentication-provider>
	</authentication-manager>

<!-- <beans:bean id="userDetailsService" class="com.jitworks.shareinfo.dao.jpa.UserAuthDAOImpl" /> -->

</beans:beans>


text:
package org.datavaultplatform.common.bagish;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class Checksummer {

    /**
     * Compute a hash value for file contents
     * @param file The file we want to hash
     * @param alg The algorithm we wnat to use
     * @return The hash value as a string
     * @throws FileNotFoundException if the file isn't found!
     * @throws IOException if we run into any IO issues
     */
    public String computeFileHash(File file, SupportedAlgorithm alg) throws Exception {
        String hash = null;
        FileInputStream fis = new FileInputStream(file);

        switch (alg) {
            case MD5:
                hash = org.apache.commons.codec.digest.DigestUtils.md5Hex(fis);
                break;
            case SHA1:
                hash = org.apache.commons.codec.digest.DigestUtils.shaHex(fis);
                break;
            case SHA256:
                hash = org.apache.commons.codec.digest.DigestUtils.sha256Hex(fis);
                break;
            case SHA512:
                hash = org.apache.commons.codec.digest.DigestUtils.sha512Hex(fis);
                break;
            default:
                throw new Exception("Unsupported checksum algorithm");
        }

        fis.close();
        return hash;
    }
}


text:
namespace Ui {
class CPConfig;
}

class CPConfig : public ConfigBase
{
    Q_OBJECT

public:
    explicit CPConfig(QWidget *parent = nullptr);
    ~CPConfig() override;
    void setConfig(Vipster::IO::BaseConfig *c) override;

private slots:
    void on_fmtSel_currentIndexChanged(int index);

private:
    Ui::CPConfig *ui;
    Vipster::IO::CPConfig *curConfig{nullptr};
};

#endif // CPCONFIG_H


text:
const test = require('tape')
    , path = require('path')
    , fs   = require('fs')

test('test port-libuv is being used', function (t) {
  var version = fs.readFileSync(path.join(__dirname, '../deps/leveldb/leveldb.gyp'), 'utf8')
                  .match(/'ldbversion': '([^']+)'/)[1]
    , porth

  t.ok(version, 'matched current leveldb version')

  porth = fs.readFileSync(path.join(__dirname, '../deps/leveldb/leveldb-' + version + '/port/port.h'), 'utf8')

  t.ok(/"port_uv\.h"/.test(porth), 'port.h includes reference to port_uv.h')

  t.end()
})


text:
package com.google.template.soy.basicfunctions;

import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.template.soy.data.SoyValue;
import com.google.template.soy.data.restricted.IntegerData;
import com.google.template.soy.exprtree.Operator;
import com.google.template.soy.jssrc.restricted.JsExpr;
import com.google.template.soy.jssrc.restricted.SoyJsCodeUtils;
import com.google.template.soy.jssrc.restricted.SoyJsSrcFunction;
import com.google.template.soy.phpsrc.restricted.PhpExpr;
import com.google.template.soy.phpsrc.restricted.SoyPhpSrcFunction;
import com.google.template.soy.pysrc.restricted.PyExpr;
import com.google.template.soy.pysrc.restricted.SoyPySrcFunction;
import com.google.template.soy.shared.restricted.SoyJavaFunction;

import java.util.List;
import java.util.Set;

import javax.inject.Inject;
import javax.inject.Singleton;

/**
 * Soy function that generates a random integer in the range [0, n-1].
 *
 */
@Singleton
class RandomIntFunction implements SoyJavaFunction, SoyJsSrcFunction, SoyPySrcFunction, SoyPhpSrcFunction {

  @Inject
  RandomIntFunction() {}

  @Override public String getName() {
    return "randomInt";
  }

  @Override public Set<Integer> getValidArgsSizes() {
    return ImmutableSet.of(1);
  }

  @Override public SoyValue computeForJava(List<SoyValue> args) {
    SoyValue arg = args.get(0);

    return IntegerData.forValue((long) Math.floor(Math.random() * arg.longValue()));
  }

  @Override public JsExpr computeForJsSrc(List<JsExpr> args) {
    JsExpr arg = args.get(0);

    JsExpr random = new JsExpr("Math.random()", Integer.MAX_VALUE);
    JsExpr randomTimesArg =
        SoyJsCodeUtils.genJsExprUsingSoySyntax(Operator.TIMES, Lists.newArrayList(random, arg));
    return new JsExpr("Math.floor(" + randomTimesArg.getText() + ")", Integer.MAX_VALUE);
  }

  @Override public PyExpr computeForPySrc(List<PyExpr> args) {
    PyExpr arg = args.get(0);
    // Subtract 1 from the argument as the python randint function is inclusive on both sides.
    return new PyExpr("random.randint(0, " + arg.getText() + " - 1)", Integer.MAX_VALUE);
  }

  @Override public PhpExpr computeForPhpSrc(List<PhpExpr> args) {
    PhpExpr arg = args.get(0);
    // Subtract 1 from the argument as the PHP mt_rand function is inclusive on both sides.
    return new PhpExpr("mt_rand(0, " + arg.getText() + " - 1)", Integer.MAX_VALUE);
  }
}


text:
require 'spec_helper'

describe Attache::Tus::Upload do
  let(:app) { ->(env) { [200, env, "app"] } }
  let(:middleware) { Attache::Tus::Upload.new(app) }
  let(:params) { Hash(file: filename) }
  let(:filename) { "Exãmple %#{rand} %20.gif" }
  let(:file) { StringIO.new(IO.binread("spec/fixtures/landscape.jpg"), 'rb') }
  let(:filesize) { File.size "spec/fixtures/landscape.jpg" }
  let(:hostname) { "example.com" }
  let(:create_path) { '/tus/files?' + params.collect {|k,v| "#{CGI.escape k.to_s}=#{CGI.escape v.to_s}"}.join('&') }
  let(:resume_path) { @location }

  before do
    allow(Attache).to receive(:localdir).and_return(Dir.tmpdir) # forced, for safety
    allow_any_instance_of(Attache::VHost).to receive(:secret_key).and_return(nil)
    allow_any_instance_of(Attache::VHost).to receive(:storage).and_return(nil)
    allow_any_instance_of(Attache::VHost).to receive(:bucket).and_return(nil)
  end

  after do
    FileUtils.rm_rf(Attache.localdir)
  end

  it "should passthrough irrelevant request" do
    code, headers, body = middleware.call Rack::MockRequest.env_for('http://' + hostname, "HTTP_HOST" => hostname)
    expect(code).to eq 200
  end

  def make_request_to(request_uri, headers)
    middleware.call Rack::MockRequest.env_for('http://' + hostname + request_uri, Hash("HTTP_HOST" => hostname, 'HTTP_UPLOAD_METADATA' => "key #{Base64.encode64('value')},filename #{Base64.encode64(filename)}").merge(headers))
  end

  context "tus creation" do
    it "must reject missing HTTP_ENTITY_LENGTH" do
      code, headers, body = make_request_to(create_path, method: 'POST', input: file)
      expect(code).to eq(400)
    end

    it "must reject invalid HTTP_ENTITY_LENGTH" do
      code, headers, body = make_request_to(create_path, method: 'POST', input: file, 'HTTP_ENTITY_LENGTH' => [-1, 'abc'].sample)
      expect(code).to eq(400)
    end

    it "must respond successfully with HTTP 201 + Location header" do
      code, headers, body = make_request_to(create_path, method: 'POST', input: file, 'HTTP_ENTITY_LENGTH' => filesize)
      expect(code).to eq(201)
      expect(headers['Location']).to be_present
    end
  end

  context "with uploaded file" do
    let(:relpath)  { CGI.unescape @location.match(/relpath=([^&]+)/)[1] }
    let(:cachekey) { File.join(hostname, relpath) }
    let(:current_offset) { 3 + rand(10) }

    before do
      code, headers, body = make_request_to(create_path, method: 'POST', input: file, 'HTTP_ENTITY_LENGTH' => filesize)
      expect(code).to eq(201)
      @location = URI.parse(headers['Location']).request_uri
      open(middleware.path_of(cachekey), "a") {|f| f.write('a' * current_offset) }
    end

    context "tus patch" do
      it "must reject invalid HTTP_OFFSET" do
        code, headers, body = make_request_to(resume_path, method: 'PATCH', input: file)
        expect(code).to eq(400)
      end

      it "must reject invalid HTTP_CONTENT_LENGTH" do
        code, headers, body = make_request_to(resume_path, method: 'PATCH', input: file, "HTTP_OFFSET" => 0)
        expect(code).to eq(400)
      end

      it "must reject invalid Content-Type: application/offset+octet-stream" do
        code, headers, body = make_request_to(resume_path, method: 'PATCH', input: file, "HTTP_OFFSET" => 0, "HTTP_CONTENT_LENGTH" => filesize, "CONTENT_TYPE" => ["application/octet-stream", nil].sample)
        expect(code).to eq(400)
      end

      it "must reject invalid Tus-Resumable version" do
        code, headers, body = make_request_to(resume_path, method: 'PATCH', input: file, "HTTP_OFFSET" => 0, "HTTP_CONTENT_LENGTH" => filesize, "CONTENT_TYPE" => "application/offset+octet-stream", "HTTP_TUS_RESUMABLE" => ["0.9.9", "2.0.0"].sample)
        expect(code).to eq(400)
      end

      it "must respond successfully with HTTP 200" do
        code, headers, body = make_request_to(resume_path, method: 'PATCH', input: file, "HTTP_OFFSET" => 0, "HTTP_CONTENT_LENGTH" => filesize, "CONTENT_TYPE" => "application/offset+octet-stream", "HTTP_TUS_RESUMABLE" => "1.0.0")
        expect(headers['X-Exception']).to be_nil
        expect(code).to eq(200)
      end

      it "must accept `offset` smaller or equal to current offset" do
        code, headers, body = make_request_to(resume_path, method: 'PATCH', input: file, "HTTP_OFFSET" => current_offset - [0, 1].sample, "HTTP_CONTENT_LENGTH" => filesize, "CONTENT_TYPE" => "application/offset+octet-stream", "HTTP_TUS_RESUMABLE" => "1.0.0")
        expect(headers['X-Exception']).to be_nil
        expect(code).to eq(200)
      end

      it "must reject `offset` larger than current offset" do
        code, headers, body = make_request_to(resume_path, method: 'PATCH', input: file, "HTTP_OFFSET" => current_offset + 1, "HTTP_CONTENT_LENGTH" => filesize, "CONTENT_TYPE" => "application/offset+octet-stream", "HTTP_TUS_RESUMABLE" => "1.0.0")
        expect(code).to eq(400)
      end

      it "new current offset must be Offset + Content-Length" do
        expect {
          make_request_to(resume_path, method: 'PATCH', input: file, "HTTP_OFFSET" => current_offset, "HTTP_CONTENT_LENGTH" => filesize, "CONTENT_TYPE" => "application/offset+octet-stream", "HTTP_TUS_RESUMABLE" => "1.0.0")
        }.to change {
          middleware.send(:current_offset, cachekey, relpath, config = {})
        }.by(filesize)
      end
    end

    context "tus head" do
      it "must respond successfully with HTTP 200 + Offset header" do
        code, headers, body = make_request_to(resume_path, method: 'HEAD')
        expect(code).to eq(200)
        expect(headers).to eq({
          "Access-Control-Allow-Origin"   => "*",
          "Access-Control-Allow-Methods"  => "POST, PUT, PATCH",
          "Access-Control-Allow-Headers"  => "Content-Type, Tus-Resumable, Upload-Length, Entity-Length, Upload-Metadata, Metadata, Upload-Offset, Offset",
          "Content-Type"                  => "text/json",
          "Access-Control-Expose-Headers" => "Location, Upload-Offset, Offset",
          "Offset"                        => current_offset.to_s,
          "Upload-Offset"                 => current_offset.to_s,
        })
      end
    end

    context "tus get" do
      it "must redirec to attache download url for original geometry" do
        code, headers, body = make_request_to(resume_path, method: 'GET')
        expect(code).to eq(302)
        expect(File.basename headers['Location']).to eq(CGI.escape(Attache::Upload.sanitize filename))
      end
    end
  end
end


text:
require 'spec_helper'

describe Mygasfeed do
  describe '.update_price' do
    subject { described_class.update_price(price, fuel_type, station_id) }

    context "when valid params are given" do
      let(:price)  { 4.15 }
      let(:fuel_type) { "diesel" }
      let(:station_id)  { 110244 }

      context 'when request succeeds' do
        it "should be a Mygasfeed:Station object" do
          expect(subject).to be_a(Mygasfeed::Station)
        end
      end
    end

  end
end


text:
package test.uxplore;

import static org.junit.Assert.*;

import java.io.IOException;
import java.util.ArrayList;
import org.junit.*;

import com.uxplore.FSItem;
import com.uxplore.managers.OperationManager;
import com.uxplore.managers.ViewManager;

import javafx.embed.swing.JFXPanel;
import javafx.scene.layout.TilePane;
import uxplore.ExplorerController;

public class ViewManagerTest {
	@BeforeClass
	public static void initToolkit() {
		new JFXPanel();
	}

	@Test
	public void updateViewTest() throws IOException {
		ViewManager vm = new ViewManager();
		OperationManager opm = new OperationManager();
		ArrayList<FSItem> items = opm.getRoots();
		TilePane container = new TilePane();
		vm.updateView(items, container, ExplorerController.handler);
		assertEquals("the container must have 1 item", opm.getRoots().size(), container.getChildren().size());
	}
}


text:
package org.knowm.xchange.paribu.dto.marketdata;

import com.fasterxml.jackson.annotation.JsonProperty;

/** Created by semihunaldi on 27/11/2017 */
public final class ParibuTicker {

  private final BTC_TL btcTL;

  public ParibuTicker(@JsonProperty("BTC_TL") BTC_TL btcTL) {
    this.btcTL = btcTL;
  }

  public BTC_TL getBtcTL() {
    return btcTL;
  }

  @Override
  public String toString() {
    return btcTL.toString();
  }
}


text:
% ---------------------------------------------------------------------- %
% OCR: Main File
% Author: Atul Dhingra
% dhingra[dot]atul92[at]gmail.com
% ---------------------------------------------------------------------- %
clear all;
close all;
clc;
load Feature_Test;
load Feature_Validation
load labels;
perceptron()


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_checked="true" android:drawable="@mipmap/bottom_home_icon_on"/>
    <item android:state_checked="false" android:drawable="@mipmap/bottom_home_icon"/>
</selector>


text:
<!doctype html>
<html>
<head>
<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
<script>
function appendIframe()
{
    var frame = document.createElement("iframe");
    frame.src = "../resources/test-page-trigger-animation.html";
    document.body.appendChild(frame);
}

function test()
{
    InspectorTest.eventHandler["Animation.animationPlayerCreated"] = onCreated;
    InspectorTest.sendCommand("Animation.enable", {});
    InspectorTest.evaluateInPage("appendIframe()", frameAttached);
    var numberAnimationsCaptured = 0;
    var lastStartTime = undefined;

    function frameAttached()
    {
        InspectorTest.log("Frame appended");
    }

    function onCreated(data)
    {
        var player = data.params.player;

        if (!lastStartTime || player.startTime > lastStartTime)
            InspectorTest.log("Animation created: start time is valid");
        lastStartTime = player.startTime;
        numberAnimationsCaptured++;

        if (numberAnimationsCaptured < 10)
            InspectorTest.evaluateInPage("appendIframe()", frameAttached);
        else
            InspectorTest.completeTest();
    }
}
</script>
</head>
<body onload="runTest()">
</body>
</html>


text:
using System;
using Twilio.TwiML;
using Twilio.TwiML.Voice;

class Example
{
    static void Main()
    {
        var response = new VoiceResponse();
        var dial = new Dial();
        dial.Number("415-123-4567", sendDigits: "wwww1928");
        response.Append(dial);

        Console.WriteLine(response.ToString());
    }
}


text:
.valo .x-pathrenderer .v-tree-node-focused:after {
    opacity: 1;
    border: none;
    background-color: #e8e8e8;
    border-radius: 0;
}

.x-pathrenderer .v-tree-node img.v-icon {
    height: 21px;
    vertical-align: text-bottom;
}


text:
package org.apache.apex.malhar.contrib.kinesis;

import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;

import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
import com.amazonaws.services.kinesis.AmazonKinesisClient;
import com.amazonaws.services.kinesis.model.PutRecordRequest;
import com.amazonaws.services.kinesis.model.PutRecordsRequest;
import com.amazonaws.services.kinesis.model.PutRecordsRequestEntry;

/**
 * A kinesis producer for testing
 */
public class KinesisTestProducer implements Runnable
{
  protected String streamName;
  protected transient AmazonKinesisClient client = null;

  private int sendCount = 20;
  private int batchSize = 92;
  List<PutRecordsRequestEntry> putRecordsRequestEntryList = new ArrayList<PutRecordsRequestEntry>();
  private boolean hasPartition = false;
  private List<String> records;

  public void setRecords(List<String> records)
  {
    this.records = records;
  }

  private void createClient()
  {
    AWSCredentialsProvider credentials = new DefaultAWSCredentialsProviderChain();
    client = new AmazonKinesisClient(credentials);
  }

  public KinesisTestProducer(String topic)
  {
    this(topic, false);
  }

  public KinesisTestProducer(String topic, boolean hasPartition)
  {
    this.streamName = topic;
    this.hasPartition = hasPartition;
    createClient();
  }

  private void generateRecords()
  {
    // Create dummy message
    int recordNo = 1;
    while (recordNo <= sendCount) {
      String dataStr = "Record_" + recordNo;
      PutRecordsRequestEntry putRecordsEntry = new PutRecordsRequestEntry();
      putRecordsEntry.setData(ByteBuffer.wrap(dataStr.getBytes()));
      putRecordsEntry.setPartitionKey(dataStr);
      putRecordsRequestEntryList.add(putRecordsEntry);
      if ( (putRecordsRequestEntryList.size() == batchSize) || (recordNo == sendCount )) {
        PutRecordsRequest putRecordsRequest = new PutRecordsRequest();
        putRecordsRequest.setStreamName(streamName);
        putRecordsRequest.setRecords(putRecordsRequestEntryList);
        client.putRecords(putRecordsRequest);
        putRecordsRequestEntryList.clear();
      }
      recordNo++;
    }
  }

  @Override
  public void run()
  {
    if (records == null) {
      generateRecords();
    } else {
      for (String msg : records) {
        PutRecordRequest putRecordRequest = new PutRecordRequest();
        putRecordRequest.setStreamName(streamName);
        putRecordRequest.setData(ByteBuffer.wrap(msg.getBytes()));
        putRecordRequest.setPartitionKey(msg);
        client.putRecord(putRecordRequest);
      }
    }
  }

  public int getBatchSize()
  {
    return batchSize;
  }

  public void setBatchSize(int batchSize)
  {
    this.batchSize = batchSize;
  }

  public int getSendCount()
  {
    return sendCount;
  }

  public void setSendCount(int sendCount)
  {
    this.sendCount = sendCount;
  }
} // End of KinesisTestProducer


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
    <title>Account Setup</title>
    <link rel="stylesheet" href="css/style.css">
    <link rel="shortcut icon" type="img/png" href="favicon.png">

1Create your account

2Add more information

3Generate keys

Success!

          <svg xmlns="http://www.w3.org/2000/svg" width="72px" height="72px">
            <g fill="none" stroke="#43C47A" stroke-width="2">
              <circle cx="36" cy="36" r="35" style="stroke-dasharray:240px, 240px; stroke-dashoffset: 480px;"></circle>
              <path d="M17.417,37.778l9.93,9.909l25.444-25.393" style="stroke-dasharray:50px, 50px; stroke-dashoffset: 0px;"></path>
            </g>
          </svg>

        <form class="pure-form">

Welcome to !

Let's get you set up with an account.

          Using Chrome? Click here

              If you're using Chrome, you must first enable Key Generation for this page.

Click on the green padlock to the left of the left of the Address Bar.

Click on "Key Generation", and change the value from "Blocked by default" to "Always allow on this site".

You're all set!  Go ahead and sign up for Solid.

          <input type="text" class="account" name="username" value="" placeholder="Pick a user name" oninput="validateAccount()" autofocus>

            .

            Only letters, numbers, hyphens (-) and underscores (_) are accepted.

            <input type="email" class="address" name="email" placeholder="Email (optional)">

                Your email address will be used only for account recovery. Without it, you won't be able to recover your account .

        </form>

        <form>

Username reserved...

          <input type="file" id="inputFileToLoad" class="hidden" onchange="loadImageFileAsURL()">

          Remove picture
          <input type="text" class="fullname" name="name" value="" placeholder="Type your full name (optional)">
        </form>

        <form id="spkacform" class="spkacform" method="POST" target="spkacframe">
          <input id="spkacWebID" name="spkac" class="hidden"></input>

          <input type="text" class="webid hidden" name="webid">
          <input type="text" class="certname hidden" name="name" value="" placeholder="Your name">

You're almost there!

In this final step, strong cryptographic keys will be generated and installed in the browser. Using them avoids having to remember passwords, thus offerring increased security.

        </form>

        Create account
        Check availability
        Update profile (or skip)
        Generate keys and finish
        Go back to the app
        Take me to my account


text:
package apiconfig

import (
	"fmt"

	"k8s.io/api/core/v1"
	rbac "k8s.io/api/rbac/v1beta1"
	apierrors "k8s.io/apimachinery/pkg/api/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	clientset "k8s.io/client-go/kubernetes"
	kubeadmconstants "k8s.io/kubernetes/cmd/kubeadm/app/constants"
	rbachelper "k8s.io/kubernetes/pkg/apis/rbac/v1beta1"
	bootstrapapi "k8s.io/kubernetes/pkg/bootstrap/api"
	"k8s.io/kubernetes/pkg/util/version"
)

const (
	// KubeProxyClusterRoleName sets the name for the kube-proxy ClusterRole
	KubeProxyClusterRoleName = "system:node-proxier"
	// NodeBootstrapperClusterRoleName sets the name for the TLS Node Bootstrapper ClusterRole
	NodeBootstrapperClusterRoleName = "system:node-bootstrapper"
	// BootstrapSignerClusterRoleName sets the name for the ClusterRole that allows access to ConfigMaps in the kube-public ns
	BootstrapSignerClusterRoleName = "system:bootstrap-signer-clusterinfo"

	clusterRoleKind          = "ClusterRole"
	roleKind                 = "Role"
	serviceAccountKind       = "ServiceAccount"
	rbacAPIGroup             = "rbac.authorization.k8s.io"
	anonymousUser            = "system:anonymous"
	nodeAutoApproveBootstrap = "kubeadm:node-autoapprove-bootstrap"
)

// TODO: Are there any unit tests that could be made for this file other than duplicating all values and logic in a separate file?

// CreateServiceAccounts creates the necessary serviceaccounts that kubeadm uses/might use, if they don't already exist.
func CreateServiceAccounts(clientset clientset.Interface) error {
	serviceAccounts := []v1.ServiceAccount{
		{
			ObjectMeta: metav1.ObjectMeta{
				Name:      kubeadmconstants.KubeDNSServiceAccountName,
				Namespace: metav1.NamespaceSystem,
			},
		},
		{
			ObjectMeta: metav1.ObjectMeta{
				Name:      kubeadmconstants.KubeProxyServiceAccountName,
				Namespace: metav1.NamespaceSystem,
			},
		},
	}

	for _, sa := range serviceAccounts {
		if _, err := clientset.CoreV1().ServiceAccounts(metav1.NamespaceSystem).Create(&sa); err != nil {
			if !apierrors.IsAlreadyExists(err) {
				return err
			}
		}
	}
	return nil
}

// CreateRBACRules creates the essential RBAC rules for a minimally set-up cluster
func CreateRBACRules(clientset *clientset.Clientset, k8sVersion *version.Version) error {
	if err := createRoles(clientset); err != nil {
		return err
	}
	if err := createRoleBindings(clientset); err != nil {
		return err
	}
	if err := createClusterRoles(clientset); err != nil {
		return err
	}
	if err := createClusterRoleBindings(clientset); err != nil {
		return err
	}
	if err := deletePermissiveNodesBindingWhenUsingNodeAuthorization(clientset, k8sVersion); err != nil {
		return fmt.Errorf("failed to remove the permissive 'system:nodes' Group Subject in the 'system:node' ClusterRoleBinding: %v", err)
	}

	fmt.Println("[apiconfig] Created RBAC rules")
	return nil
}

func createRoles(clientset *clientset.Clientset) error {
	roles := []rbac.Role{
		{
			ObjectMeta: metav1.ObjectMeta{
				Name:      BootstrapSignerClusterRoleName,
				Namespace: metav1.NamespacePublic,
			},
			Rules: []rbac.PolicyRule{
				rbachelper.NewRule("get").Groups("").Resources("configmaps").Names("cluster-info").RuleOrDie(),
			},
		},
	}
	for _, role := range roles {
		if _, err := clientset.RbacV1beta1().Roles(role.ObjectMeta.Namespace).Create(&role); err != nil {
			if !apierrors.IsAlreadyExists(err) {
				return fmt.Errorf("unable to create RBAC role: %v", err)
			}

			if _, err := clientset.RbacV1beta1().Roles(role.ObjectMeta.Namespace).Update(&role); err != nil {
				return fmt.Errorf("unable to update RBAC role: %v", err)
			}
		}
	}
	return nil
}

func createRoleBindings(clientset *clientset.Clientset) error {
	roleBindings := []rbac.RoleBinding{
		{
			ObjectMeta: metav1.ObjectMeta{
				Name:      "kubeadm:bootstrap-signer-clusterinfo",
				Namespace: metav1.NamespacePublic,
			},
			RoleRef: rbac.RoleRef{
				APIGroup: rbacAPIGroup,
				Kind:     roleKind,
				Name:     BootstrapSignerClusterRoleName,
			},
			Subjects: []rbac.Subject{
				{
					Kind: "User",
					Name: anonymousUser,
				},
			},
		},
	}

	for _, roleBinding := range roleBindings {
		if _, err := clientset.RbacV1beta1().RoleBindings(roleBinding.ObjectMeta.Namespace).Create(&roleBinding); err != nil {
			if !apierrors.IsAlreadyExists(err) {
				return fmt.Errorf("unable to create RBAC rolebinding: %v", err)
			}

			if _, err := clientset.RbacV1beta1().RoleBindings(roleBinding.ObjectMeta.Namespace).Update(&roleBinding); err != nil {
				return fmt.Errorf("unable to update RBAC rolebinding: %v", err)
			}
		}
	}
	return nil
}

func createClusterRoles(clientset *clientset.Clientset) error {
	clusterRoles := []rbac.ClusterRole{
		{
			ObjectMeta: metav1.ObjectMeta{
				Name: nodeAutoApproveBootstrap,
			},
			Rules: []rbac.PolicyRule{
				rbachelper.NewRule("create").Groups("certificates.k8s.io").Resources("certificatesigningrequests/nodeclient").RuleOrDie(),
			},
		},
	}

	for _, roleBinding := range clusterRoles {
		if _, err := clientset.RbacV1beta1().ClusterRoles().Create(&roleBinding); err != nil {
			if !apierrors.IsAlreadyExists(err) {
				return fmt.Errorf("unable to create RBAC clusterrole: %v", err)
			}

			if _, err := clientset.RbacV1beta1().ClusterRoles().Update(&roleBinding); err != nil {
				return fmt.Errorf("unable to update RBAC clusterrole: %v", err)
			}
		}
	}
	return nil
}

func createClusterRoleBindings(clientset *clientset.Clientset) error {
	clusterRoleBindings := []rbac.ClusterRoleBinding{
		{
			ObjectMeta: metav1.ObjectMeta{
				Name: "kubeadm:kubelet-bootstrap",
			},
			RoleRef: rbac.RoleRef{
				APIGroup: rbacAPIGroup,
				Kind:     clusterRoleKind,
				Name:     NodeBootstrapperClusterRoleName,
			},
			Subjects: []rbac.Subject{
				{
					Kind: "Group",
					Name: bootstrapapi.BootstrapGroup,
				},
			},
		},
		{
			ObjectMeta: metav1.ObjectMeta{
				Name: nodeAutoApproveBootstrap,
			},
			RoleRef: rbac.RoleRef{
				APIGroup: rbacAPIGroup,
				Kind:     clusterRoleKind,
				Name:     nodeAutoApproveBootstrap,
			},
			Subjects: []rbac.Subject{
				{
					Kind: "Group",
					Name: bootstrapapi.BootstrapGroup,
				},
			},
		},
		{
			ObjectMeta: metav1.ObjectMeta{
				Name: "kubeadm:node-proxier",
			},
			RoleRef: rbac.RoleRef{
				APIGroup: rbacAPIGroup,
				Kind:     clusterRoleKind,
				Name:     KubeProxyClusterRoleName,
			},
			Subjects: []rbac.Subject{
				{
					Kind:      serviceAccountKind,
					Name:      kubeadmconstants.KubeProxyServiceAccountName,
					Namespace: metav1.NamespaceSystem,
				},
			},
		},
	}

	for _, clusterRoleBinding := range clusterRoleBindings {
		if _, err := clientset.RbacV1beta1().ClusterRoleBindings().Create(&clusterRoleBinding); err != nil {
			if !apierrors.IsAlreadyExists(err) {
				return fmt.Errorf("unable to create RBAC clusterrolebinding: %v", err)
			}

			if _, err := clientset.RbacV1beta1().ClusterRoleBindings().Update(&clusterRoleBinding); err != nil {
				return fmt.Errorf("unable to update RBAC clusterrolebinding: %v", err)
			}
		}
	}
	return nil
}

func deletePermissiveNodesBindingWhenUsingNodeAuthorization(clientset *clientset.Clientset, k8sVersion *version.Version) error {

	nodesRoleBinding, err := clientset.RbacV1beta1().ClusterRoleBindings().Get(kubeadmconstants.NodesClusterRoleBinding, metav1.GetOptions{})
	if err != nil {
		if apierrors.IsNotFound(err) {
			// Nothing to do; the RoleBinding doesn't exist
			return nil
		}
		return err
	}

	newSubjects := []rbac.Subject{}
	for _, subject := range nodesRoleBinding.Subjects {
		// Skip the subject that binds to the system:nodes group
		if subject.Name == kubeadmconstants.NodesGroup && subject.Kind == "Group" {
			continue
		}
		newSubjects = append(newSubjects, subject)
	}

	nodesRoleBinding.Subjects = newSubjects

	if _, err := clientset.RbacV1beta1().ClusterRoleBindings().Update(nodesRoleBinding); err != nil {
		return err
	}

	return nil
}


text:
If you often create new web projects, you know how long it can be to start from scratch.
You just need to kick start your project ? This repo has been made for you !

## Stack :
- [Webpack](https://webpack.github.io/docs/)
- [Angularjs](https://angularjs.org/)
- [angularBootstrapMaterial](http://fezvrasta.github.io/bootstrap-material-design/)
- [Sass](http://sass-lang.com/)
- [Protractor](http://www.protractortest.org/#/)
- [Karma](http://karma-runner.github.io/)
- [Jasmine](http://jasmine.github.io/2.5/introduction.html)
- [Isparta](https://github.com/deepsweet/isparta-loader)
- [Xo](https://github.com/sindresorhus/xo)
- [Eslint](http://eslint.org/)

## Workflow Features
- **Webpack** fully automated workflow
- **Development** and **production** environment targets
- **Unit** test samples
- **E2E** test samples
- **Coverage** to know if your code is tested enough
- **Sass** linting, sourcemaps minify and concat
- **Livereload** and - **Hot Reloading** to work without pressing F5 every second and to refresh only the stylesheet modified

## Main librairies into the project :
- Bootstrap
- Angular
- Angular-mocks
- Angular-translate
- Angular-sanitize
- Angular-bootstrap-material
- Angular-bootstrap-material-icons
- Angular-animate
- Angular-ui-router

# webTemplate-webpack
A simple AngularJS 1.5 boilerplate using ES6 and components, and webpack

## Install & run
```
$ yarn install
----------- OR ------------
$ npm install --no-optional

$ npm run dev

See the browser on : `http://localhost:3001`
Or if you prefer to have the App Ready / Compiling status bar at the top
See the browser on : `http://localhost:3001/webpack-dev-server/`

NB: If you want a website in https:
1- change the webpack.dev.config.js file and edit 'https: false' to 'https: true'
2- See the browser on : `https://localhost:3001`
```

## Global Dependencies
| Dependency | Version | Install                               |
| ---------- | ------- | ------------------------------------- |
| NodeJS     | 6.x.x   | [http://node.org](http://nodejs.org/) |
| Npm        | 3.x.x   | [http://node.org](http://nodejs.org/) |
| Webpack    | 1.x.x   | `npm install webpack -g`              |
| Yarn       | 0.x.x   | `npm install yarn -g`                 |

## Usage
### Tasks
- `$ npm run start`: Like npm run dev
- `$ npm run dev`: Create distribution package for the development environment and start web-server and live-reload
- `$ npm run prod`: Create distribution package for the production environment
- `$ npm run test`: Execute unit tests with Karma and execute e2e tests with Protractor
- `$ npm run unit`: Execute unit tests with Karma
- `$ npm run unit:watch`: Execute and refresh automatically the unit tests with Karma if you changed a test
- `$ npm run e2e`: Execute e2e tests with Protractor
- `$ npm run e2e:watch`: Execute e2e tests with Protractor with auto-watch
- `$ npm run xo`: Lint Javascript code

### Environments
#### Development:
- `$ npm run dev`

#### Production:
- `$ npm run prod`

#### Test:
- `$ npm run test`
- `$ npm run unit`
- `$ npm run unit:watch`
- `$ npm run e2e`
- `$ npm run e2e:watch`

#### Documentation:
- `$ npm run doc`
See the browser on : `http://localhost:8181`

In order to contribute, please run `npm test` and check you don't have any JSHint error by running `npm run xo`

Cheers !


text:
var HTown = HTown || {};

HTown.Building = function(state, x, y, data) {
  Phaser.Sprite.call(this, state.game, x, y, data.asset);

  this.game = state.game;
  this.state = state;

  //init stats
  this.food = data.food;
  this.jobs = data.jobs;
  this.housing = data.housing;

  this.anchor.setTo(0.5);

  //init physics
  this.game.physics.arcade.enable(this);
};

HTown.Building.prototype = Object.create(Phaser.Sprite.prototype);
HTown.Building.prototype.constructor = HTown.Building;


text:
@protocol ARViewDelegate

- (UIView *)viewForCoordinate:(ARCoordinate *)coordinate;

@end

@interface ARViewController : UIViewController <UIAccelerometerDelegate, CLLocationManagerDelegate> {
	CLLocationManager *locationManager;
	UIAccelerometer *accelerometerManager;

	ARCoordinate *centerCoordinate;

	UIImagePickerController *cameraController;

	NSObject<ARViewDelegate> *__unsafe_unretained delegate;
	NSObject<CLLocationManagerDelegate> *__unsafe_unretained locationDelegate;
	NSObject<UIAccelerometerDelegate> *__unsafe_unretained accelerometerDelegate;

	BOOL scaleViewsBasedOnDistance;
	double maximumScaleDistance;
	double minimumScaleFactor;

	//defaults to 20hz;
	double updateFrequency;

	BOOL rotateViewsBasedOnPerspective;
	double maximumRotationAngle;

@private
	BOOL ar_debugMode;

	NSTimer *_updateTimer;

	UIView *ar_overlayView;

	UILabel *ar_debugView;

	NSMutableArray *ar_coordinates;
	NSMutableArray *ar_coordinateViews;
}

@property (readonly) NSArray *coordinates;

@property BOOL debugMode;

@property BOOL scaleViewsBasedOnDistance;
@property double maximumScaleDistance;
@property double minimumScaleFactor;

@property BOOL rotateViewsBasedOnPerspective;
@property double maximumRotationAngle;

@property double updateFrequency;

//adding coordinates to the underlying data model.
- (void)addCoordinate:(ARCoordinate *)coordinate;
- (void)addCoordinate:(ARCoordinate *)coordinate animated:(BOOL)animated;

- (void)addCoordinates:(NSArray *)newCoordinates;

//removing coordinates
- (void)removeCoordinate:(ARCoordinate *)coordinate;
- (void)removeCoordinate:(ARCoordinate *)coordinate animated:(BOOL)animated;

- (void)removeCoordinates:(NSArray *)coordinates;

- (id)initWithLocationManager:(CLLocationManager *)manager;

- (void)startListening;
- (void)updateLocations:(NSTimer *)timer;

- (CGPoint)pointInView:(UIView *)realityView forCoordinate:(ARCoordinate *)coordinate;

- (BOOL)viewportContainsCoordinate:(ARCoordinate *)coordinate;

@property (nonatomic) UIImagePickerController *cameraController;

@property (nonatomic, unsafe_unretained) NSObject<ARViewDelegate> *delegate;
@property (nonatomic, unsafe_unretained) NSObject<CLLocationManagerDelegate> *locationDelegate;
@property (nonatomic, unsafe_unretained) NSObject<UIAccelerometerDelegate> *accelerometerDelegate;

@property  ARCoordinate *centerCoordinate;

@property (nonatomic) UIAccelerometer *accelerometerManager;
@property (nonatomic) CLLocationManager *locationManager;

@end


text:
package com.speed.rfidaccessreader.models;

public class Card {

	private int id;
	private String cardid;
	private String userid;

	public Card(int i, String cardid, String userid){
		this.id=i;
		this.cardid=cardid;
		this.userid=userid;
	}
	public Card(){

	}
	protected int getId() {
		return id;
	}
	protected void setId(int id) {
		this.id = id;
	}
	protected String getCardid() {
		return cardid;
	}
	protected void setCardid(String cardid) {
		this.cardid = cardid;
	}
	protected String getUserid() {
		return userid;
	}
	protected void setUserid(String userid) {
		this.userid = userid;
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2021 Red Hat, Inc. and/or its affiliates.
  ~
  ~ 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.
  -->

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.kie</groupId>
    <artifactId>kie-maven-plugin-test-kjar-parent</artifactId>
    <version>@org.kie.version@</version>
    <relativePath>../kie-maven-plugin-test-kjar-setup/kie-maven-plugin-test-kjar-parent/pom.xml</relativePath>
  </parent>

  <artifactId>kie-maven-plugin-test-kjar-7-exec-model</artifactId>

  <packaging>kjar</packaging>

  <dependencies>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-dmn-core</artifactId>
      <version>${org.kie.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-model-compiler</artifactId>
      <version>${org.kie.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-maven-plugin-test-kjar-common</artifactId>
      <version>@org.kie.version@</version>
    </dependency>
  </dependencies>

</project>