text:
@implementation MirrorResult

-(instancetype)init{
    self = [super init];
    if (self) {
        _succeed = YES;
    }
    return self;
}

-(void)setErrrorCode:(NSString *)errrorCode{
    _errrorCode = errrorCode;
    _succeed = NO;
}

-(void)setErrorMsg:(NSString *)errorMsg{
    _errorMsg = errorMsg;
    _succeed = NO;
}

-(NSDictionary *)toDic{
    NSMutableDictionary *dic = [[NSMutableDictionary alloc] initWithCapacity:3];
    [dic setValue:@(_succeed) forKey:@"succeed"];
    if (_errrorCode) {
        [dic setValue:_errrorCode forKey:@"errorCode"];
    }
    if (_errorMsg) {
        [dic setValue:_errorMsg forKey:@"errorMsg"];
    }
    return dic;
}

@end


text:
using namespace node;
using namespace v8;

#define REQ_FUN_ARG(I, VAR)                             \
if (args.Length() <= (I) || !args[I]->IsFunction())     \
return ThrowException(Exception::TypeError(             \
String::New("Argument " #I " must be a function")));    \
Local<Function> VAR = Local<Function>::Cast(args[I]);

OesnKernel::OesnKernel(OesnDispatcher *d, OesnThreadDispatcher *td, OesnStore *store) {
    impl_ =  OEK_default_factory_new(d->getImpl(), td->getImpl(), store->getImpl());
};
OesnKernel::~OesnKernel() {
    //JsonKernel_free(&impl_);
};

void OesnKernel::Init(Handle<Object> target) {

    // Prepare constructor template
    Local<FunctionTemplate> tpl = FunctionTemplate::New(New);
    tpl->SetClassName(String::NewSymbol("OesnKernel"));
    tpl->InstanceTemplate()->SetInternalFieldCount(1);

    Persistent<Function> constructor = Persistent<Function>::New(tpl->GetFunction());
    target->Set(String::NewSymbol("OesnKernel"), constructor);
}

OEK OesnKernel::getImpl() {
    return impl_;
}

Handle<Value> OesnKernel::New(const Arguments& args) {
    HandleScope scope;

    if (args.Length() != 3) {
        ThrowException(Exception::TypeError(String::New("Wrong number of arguments")));
        return scope.Close(Undefined());
    }

    OesnDispatcher* d = ObjectWrap::Unwrap<OesnDispatcher>(args[0]->ToObject());
    OesnThreadDispatcher* td = ObjectWrap::Unwrap<OesnThreadDispatcher>(args[1]->ToObject());
    OesnStore* store = ObjectWrap::Unwrap<OesnStore>(args[2]->ToObject());

    OesnKernel* obj = new OesnKernel(d, td, store);
    obj->Wrap(args.This());

    return args.This();
}

redpajama_set_name: RedPajamaGithub


text:
require 'autotest'

class Autotest::Merb < Autotest

  # +model_tests_dir+::      the directory to find model-centric tests
  # +controller_tests_dir+:: the directory to find controller-centric tests
  # +view_tests_dir+::       the directory to find view-centric tests
  # +fixtures_dir+::         the directory to find fixtures in
  attr_accessor :model_tests_dir, :controller_tests_dir, :view_tests_dir, :fixtures_dir

  def initialize # :nodoc:
    super

    initialize_test_layout

    # Ignore any happenings in these directories
    add_exception %r%^\./(?:doc|log|public|tmp)%

    # Ignore any mappings that Autotest may have already set up
    clear_mappings

    # Any changes to a file in the root of the 'lib' directory will run any
    # model test with a corresponding name.
    add_mapping %r%^lib\/.*\.rb% do |filename, _|
      files_matching Regexp.new(["^#{model_test_for(filename)}$"])
    end

    # Any changes to a fixture will run corresponding view, controller and
    # model tests
    add_mapping %r%^#{fixtures_dir}/(.*)s.yml% do |_, m|
      [
        model_test_for(m[1]),
        controller_test_for(m[1]),
        view_test_for(m[1])
      ]
    end

    # Any change to a test or test will cause it to be run
    add_mapping %r%^test/(unit|models|integration|controllers|views|functional)/.*rb$% do |filename, _|
      filename
    end

    # Any change to a model will cause it's corresponding test to be run
    add_mapping %r%^app/models/(.*)\.rb$% do |_, m|
      model_test_for(m[1])
    end

    # Any change to the global helper will result in all view and controller
    # tests being run
    add_mapping %r%^app/helpers/global_helpers.rb% do
      files_matching %r%^test/(views|functional|controllers)/.*_test\.rb$%
    end

    # Any change to a helper will run it's corresponding view and controller
    # tests, unless the helper is the global helper. Changes to the global
    # helper run all view and controller tests.
    add_mapping %r%^app/helpers/(.*)_helper(s)?.rb% do |_, m|
      if m[1] == "global" then
        files_matching %r%^test/(views|functional|controllers)/.*_test\.rb$%
      else
        [
          view_test_for(m[1]),
          controller_test_for(m[1])
        ]
      end
    end

    # Changes to views result in their corresponding view and controller test
    # being run
    add_mapping %r%^app/views/(.*)/% do |_, m|
      [
        view_test_for(m[1]),
        controller_test_for(m[1])
      ]
    end

    # Changes to a controller result in its corresponding test being run. If
    # the controller is the exception or application controller, all
    # controller tests are run.
    add_mapping %r%^app/controllers/(.*)\.rb$% do |_, m|
      if ["application", "exception"].include?(m[1])
        files_matching %r%^test/(controllers|views|functional)/.*_test\.rb$%
      else
        controller_test_for(m[1])
      end
    end

    # If a change is made to the router, run all controller and view tests
    add_mapping %r%^config/router.rb$% do # FIX
      files_matching %r%^test/(controllers|views|functional)/.*_test\.rb$%
    end

    # If any of the major files governing the environment are altered, run
    # everything
    add_mapping %r%^test/test_helper.rb|config/(init|rack|environments/test.rb|database.yml)% do # FIX
      files_matching %r%^test/(unit|models|controllers|views|functional)/.*_test\.rb$%
    end
  end

private

  # Determines the paths we can expect tests or specs to reside, as well as
  # corresponding fixtures.
  def initialize_test_layout
    self.model_tests_dir      = "test/unit"
    self.controller_tests_dir = "test/functional"
    self.view_tests_dir       = "test/views"
    self.fixtures_dir         = "test/fixtures"
  end

  # Given a filename and the test type, this method will return the
  # corresponding test's or spec's name.
  #
  # ==== Arguments
  # +filename+<String>:: the file name of the model, view, or controller
  # +kind_of_test+<Symbol>:: the type of test we that we should run
  #
  # ==== Returns
  # String:: the name of the corresponding test or spec
  #
  # ==== Example
  #
  #   > test_for("user", :model)
  #   => "user_test.rb"
  #   > test_for("login", :controller)
  #   => "login_controller_test.rb"
  #   > test_for("form", :view)
  #   => "form_view_spec.rb" # If you're running a RSpec-like suite
  def test_for(filename, kind_of_test) # :nodoc:
    name  = [filename]
    name << kind_of_test.to_s if kind_of_test == :view
    name << "test"
    return name.join("_") + ".rb"
  end

  def model_test_for(filename)
    [model_tests_dir, test_for(filename, :model)].join("/")
  end

  def controller_test_for(filename)
    [controller_tests_dir, test_for(filename, :controller)].join("/")
  end

  def view_test_for(filename)
    [view_tests_dir, test_for(filename, :view)].join("/")
  end

end


text:
var express = require('express');
var Converter=require("csvtojson").core.Converter;
var fs=require("fs");
var router = express.Router();
var nodemailer = require('nodemailer');
var hbs = require('nodemailer-express-handlebars');
var options = {
     viewEngine: {
         extname: '.handlebars',
         layoutsDir: 'views/',
         defaultLayout : 'layouts/main',
         partialsDir : 'views/partials/'
     },
     viewPath: 'views/',
     extName: '.handlebars'
 };
var transporter = nodemailer.createTransport({
    service: 'gmail',
    auth: {
        user: 'your-email@your-email.com',
        pass: 'you-pass'
    }
});

/* GET home page. */
router.get('/', function(req, res, next) {
	//Converter Class
	var Converter=require("csvtojson").core.Converter;
	var fs=require("fs");

	var csvFileName="public/upload/objectivos.csv";
	var fileStream=fs.createReadStream(csvFileName);
	//new converter instance
	var csvConverter=new Converter({constructResult:true, delimiter: ';'});

	//end_parsed will be emitted once parsing finished
	csvConverter.on("end_parsed",function(jsonObj){
        var data = {
            "records": jsonObj
        }
		res.render('index', {data: data});
	});

	//read from file
	fileStream.pipe(csvConverter);
});

router.post('/kpi.json', function(req, res, next) {
    var data = req.body;
    transporter.use('compile', hbs(options));
    transporter.sendMail({
        from: 'igo.lapa@gatewit.com',
        to: 'igo.lapa@gatewit.com',
        subject: 'hello',
        template: 'table',
        context: {
            records: data
        }
    }, function(err, response) {
        console.log(err);
        transporter.close();
    });
    transporter.close();
    res.status(200);
    res.send(data);
});

module.exports = router;


text:
<?php

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

if ( ! class_exists( 'Kirki_Controls_Switch_Control' ) ) {

	/**
	 * Switch control (modified checkbox).
	 */
	class Kirki_Controls_Switch_Control extends Kirki_Controls_Checkbox_Control {

		/**
		 * The control type.
		 *
		 * @access public
		 * @var string
		 */
		public $type = 'kirki-switch';

		/**
		 * Refresh the parameters passed to the JavaScript via JSON.
		 *
		 * @access public
		 */
		public function to_json() {
			parent::to_json();
			$i18n = Kirki_l10n::get_strings();
			$this->json['choices'] = ( empty( $this->choices ) || ! is_array( $this->choices ) ) ? array() : $this->choices;
			$this->json['choices']['on']    = ( isset( $this->choices['on'] ) ) ? $this->choices['on'] : $i18n['on'];
			$this->json['choices']['off']   = ( isset( $this->choices['off'] ) ) ? $this->choices['off'] : $i18n['off'];
			$this->json['choices']['round'] = ( isset( $this->choices['round'] ) ) ? $this->choices['round'] : false;
		}

		/**
		 * Enqueue control related scripts/styles.
		 *
		 * @access public
		 */
		public function enqueue() {
			wp_enqueue_script( 'kirki-switch' );
		}

		/**
		 * An Underscore (JS) template for this control's content (but not its container).
		 *
		 * Class variables for this control class are available in the `data` JS object;
		 * export custom variables by overriding {@see Kirki_Customize_Control::to_json()}.
		 *
		 * @see WP_Customize_Control::print_template()
		 *
		 * @access protected
		 */
		protected function content_template() {
			?>
			<# if ( data.tooltip ) { #>

			<# } #>

			<div class="switch<# if ( data.choices['round'] ) { #> round<# } #>">

					{{{ data.label }}}

				<# if ( data.description ) { #>
					{{{ data.description }}}
				<# } #>
				<input name="switch_{{ data.id }}" id="switch_{{ data.id }}" type="checkbox" value="{{ data.value }}" {{{ data.link }}}<# if ( '1' == data.value ) { #> checked<# } #> />

					{{ data.choices['on'] }}
					{{ data.choices['off'] }}

			<?php
		}
	}
}


text:
package org.usfirst.frc2832.Robot2017.commands;

import org.usfirst.frc2832.Robot2017.Robot;
import org.usfirst.frc2832.Robot2017.RobotMap;

import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.command.Command;

/**
 *
 */
public class MotorPositionCheck extends Command {
	public double startTime;
    public MotorPositionCheck() {
        // Use requires() here to declare subsystem dependencies
        // eg. requires(chassis);
    	requires(Robot.driveTrain);
    }

    // Called just before this Command runs the first time
    protected void initialize() {
    	startTime = Timer.getFPGATimestamp();
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
    	double runTime = Timer.getFPGATimestamp() - startTime;

    	if(runTime < 2) {
    		RobotMap.driveTrainLeftFront.set(0.5);
    		RobotMap.driveTrainRightFront.set(0.0);
    		RobotMap.driveTrainLeftRear.set(0.0);
    		RobotMap.driveTrainRightRear.set(0.0);
    	} else if(runTime < 4) {
    		RobotMap.driveTrainLeftFront.set(0.0);
    		RobotMap.driveTrainRightFront.set(0.5);
    		RobotMap.driveTrainLeftRear.set(0.0);
    		RobotMap.driveTrainRightRear.set(0.0);
    	} else if(runTime < 6) {
    		RobotMap.driveTrainLeftFront.set(0.0);
    		RobotMap.driveTrainRightFront.set(0.0);
    		RobotMap.driveTrainLeftRear.set(0.5);
    		RobotMap.driveTrainRightRear.set(0.0);
    	} else if(runTime < 8) {
    		RobotMap.driveTrainLeftFront.set(0.0);
    		RobotMap.driveTrainRightFront.set(0.0);
    		RobotMap.driveTrainLeftRear.set(0.0);
    		RobotMap.driveTrainRightRear.set(0.5);
    	} else {
    		RobotMap.driveTrainLeftFront.set(0.0);
    		RobotMap.driveTrainRightFront.set(0.0);
    		RobotMap.driveTrainLeftRear.set(0.0);
    		RobotMap.driveTrainRightRear.set(0.0);
    	}

    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
    	double runTime = Timer.getFPGATimestamp() - startTime;
    	if(runTime < 8) {
    		return false;
    	}
    	else {
    		return true;
    	}
    }

    // Called once after isFinished returns true
    protected void end() {
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- begin_generated_IBM_copyright_prolog                                       -->
<!--                                                                            -->
<!-- This is an automatically generated copyright prolog.                       -->
<!-- After initializing,  DO NOT MODIFY OR MOVE                                 -->
<!--****************************************************************************-->
<!-- Copyright (C) 2016 International Business Machines Corporation             -->
<!-- All Rights Reserved                                                        -->
<!--****************************************************************************-->
<!-- end_generated_IBM_copyright_prolog                                         -->
<operatorModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.ibm.com/xmlns/prod/streams/spl/operator" xmlns:cmn="http://www.ibm.com/xmlns/prod/streams/spl/common" xsi:schemaLocation="http://www.ibm.com/xmlns/prod/streams/spl/operator operatorModel.xsd">
  <cppOperatorModel>
    <context>
      <description></description>
      <customOutputFunctions>
        <customOutputFunction>
          <name>physionet_functions</name>
          <function>
            <description></description>
            <prototype><any T> list<T> getSignals()</prototype>
          </function>
          <function>
          	<description></description>
          	<prototype><any T> list<T> getDescriptions()</prototype>
          </function>
          <function>
          	<description></description>
          	<prototype>< any T> T getFrequency()</prototype>
          </function>
          <function>
          	<description></description>
          	<prototype>list<rstring> getUOMs()</prototype>
          </function>
          <function>
            <description></description>
            <prototype><any T> T getTimestamp()</prototype>
          </function>
          <function>
            <description></description>
            <prototype><any T> T AsIs()</prototype>
          </function>
        </customOutputFunction>
      </customOutputFunctions>
      <libraryDependencies>
        <library>
          <cmn:description></cmn:description>
          <cmn:managedLibrary>
            <cmn:lib>wfdb</cmn:lib>
            <!--  <cmn:libPath>@WFDB_LIB_PATH@</cmn:libPath>
            <cmn:includePath>@WFDB_INCLUDE_PATH@</cmn:includePath> -->
            <cmn:libPath>../..//impl/opt/lib/</cmn:libPath>
            <cmn:includePath>../../impl/opt/include/wfdb/</cmn:includePath>
          </cmn:managedLibrary>
        </library>
      </libraryDependencies>
      <providesSingleThreadedContext>Never</providesSingleThreadedContext>
      <allowCustomLogic>true</allowCustomLogic>
    </context>
    <parameters>
      <description></description>
      <allowAny>false</allowAny>
      <parameter>
        <name>recordName</name>
        <description></description>
        <optional>true</optional>
        <rewriteAllowed>true</rewriteAllowed>
        <expressionMode>Expression</expressionMode>
        <type>rstring</type>
        <cardinality>-1</cardinality>
      </parameter>
      <parameter>
        <name>iterations</name>
        <description></description>
        <optional>true</optional>
        <rewriteAllowed>true</rewriteAllowed>
        <expressionMode>Constant</expressionMode>
        <type>int64</type>
        <cardinality>-1</cardinality>
      </parameter>
      <parameter>
        <name>normalize</name>
        <description></description>
        <optional>true</optional>
        <rewriteAllowed>true</rewriteAllowed>
        <expressionMode>Constant</expressionMode>
        <type>boolean</type>
        <cardinality>-1</cardinality>
      </parameter>
    </parameters>
    <inputPorts>
      <inputPortOpenSet>
        <tupleMutationAllowed>true</tupleMutationAllowed>
        <windowingMode>OptionallyWindowed</windowingMode>
        <windowPunctuationInputMode>WindowBound</windowPunctuationInputMode>
      </inputPortOpenSet>
    </inputPorts>
    <outputPorts>
      <outputPortOpenSet>
        <description></description>
        <expressionMode>Expression</expressionMode>
        <autoAssignment>false</autoAssignment>
        <completeAssignment>false</completeAssignment>
        <rewriteAllowed>true</rewriteAllowed>
        <outputFunctions>
          <default>AsIs</default>
          <type>physionet_functions</type>
        </outputFunctions>
        <windowPunctuationOutputMode>Generating</windowPunctuationOutputMode>
        <windowPunctuationInputPort>-1</windowPunctuationInputPort>
        <tupleMutationAllowed>true</tupleMutationAllowed>
        <allowNestedCustomOutputFunctions>false</allowNestedCustomOutputFunctions>
      </outputPortOpenSet>
    </outputPorts>
  </cppOperatorModel>
</operatorModel>


text:
package org.wisdom.monitor.extensions.jcr.script.model;

import javax.jcr.RepositoryException;
import javax.jcr.observation.Event;
import java.util.Map;

/**
 * Created by KEVIN on 26/01/2016.
 */
public class JcrEvent implements Event {

    int type;
    String path;
    String userID;
    String identifier;
    Map info;
    String userData;
    long date;

    @Override
    public int getType() {
        return type;
    }

    @Override
    public String getPath() {
        return path;
    }

    @Override
    public String getUserID() {
        return userID;
    }

    @Override
    public String getIdentifier() throws RepositoryException {
        return identifier;
    }

    @Override
    public Map getInfo() throws RepositoryException {
        return info;
    }

    @Override
    public String getUserData() throws RepositoryException {
        return userData;
    }

    @Override
    public long getDate() throws RepositoryException {
        return date;
    }

    public void setType(int type) {
        this.type = type;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public void setUserID(String userID) {
        this.userID = userID;
    }

    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }

    public void setInfo(Map info) {
        this.info = info;
    }

    public void setUserData(String userData) {
        this.userData = userData;
    }

    public void setDate(long date) {
        this.date = date;
    }
}


text:
#include <modules/python3/pythonincluder.h>

#include <modules/python3/pyinviwoobserver.h>
#include <modules/python3/pyinviwo.h>

namespace inviwo {

PyInviwoObserver::PyInviwoObserver() { PyInviwo::getPtr()->addObserver(this); }

PyInviwoObserver::~PyInviwoObserver() { PyInviwo::getPtr()->removeObserver(this); }

}  // namespace


text:
#ifndef BUSPACKET_H
#define BUSPACKET_H
//BusPacket.h
//
//Header file for bus packet object
//

#include "SystemConfiguration.h"

namespace DRAMSim
{
enum BusPacketType
{
	READ,
	READ_P,
	WRITE,
	WRITE_P,
	ACTIVATE,
	PRECHARGE,
	REFRESH,
	DATA
};

class BusPacket
{
	BusPacket();
	ostream &dramsim_log;
public:
	//Fields
	BusPacketType busPacketType;
	unsigned column;
	unsigned row;
	unsigned bank;
	unsigned rank;
	uint64_t physicalAddress;
	uint64_t tag;
	void *data;

	//Functions
	BusPacket(BusPacketType packtype, uint64_t physicalAddr, uint64_t tag, unsigned col, unsigned rw, unsigned r, unsigned b, void *dat, ostream &dramsim_log_);

	void print();
	void print(uint64_t currentClockCycle, bool dataStart);
	void printData() const;

};
}

#endif


text:
var fs = require('fs');
var path = require('path');
var forge = require('node-forge');
var asn1 = forge.asn1;
var prime256v1_privkey_validator = require('./prime256v1_privkey_validator.js');
var prime256v1_pubkey_validator = require('./prime256v1_pubkey_validator.js');

// Create a new keypair
// Load keypair from file
// Load keypair from stdin
module.exports = (function(){
  var braveEC = {};

  braveEC.loadPemPrivFromFile = function(filename, callback){
    filename = path.normalize(process.cwd()+'/'+filename);
    fs.readFile(filename, 'utf8', function(err, pem){
      if(err){ return callback(err) };
      braveEC._pemPrivToOutput(pem, function(err, output){
        if(err){ return callback(err) };
        callback(null, output);
      });
    });
  };

  braveEC.loadPemPubFromFile = function(filename, callback){
    filename = path.normalize(process.cwd()+'/'+filename);
    fs.readFile(filename, 'utf8', function(err, pem){
      if(err){
        return callback(err)
      };
      braveEC._pemPubToOutput(pem, function(err, output){
        if(err){ return callback(err) };
        callback(null, output);
      });
    });
  };

  braveEC.newKeypair = function(callback){
    require('child_process').exec('openssl ecparam -name prime256v1 -genkey',
    function (error, stdout, stderr) {
      if(error){
        console.log(stderr);
        return callback(error)
      };
      var ecFound = /-----BEGIN EC/.exec(stdout);
      if(!ecFound){ callback(new Error('Doesn\'t look like a key')); };
      var pem = stdout;
      braveEC._pemPrivToOutput(pem, function(err, output){
        if(err){ return callback(err) };
        callback(null, output);
      });
    });
  };

  braveEC.genKeypair = braveEC.newKeypair;

  braveEC._pemPrivToOutput = function(pemPriv, callback){
    // Note: The pem fields store a PEM armored, base64 encoded, DER data
    // structure that contains the public and/or private keys.
    //
    // The hex fields are NOT DER data, they are the actual values of the public
    // and private keys, suitable for interfacing with
    // https://pypi.python.org/pypi/ecdsa
    var output = {
      priv: {
        pem: "",
        hex: "",
      },
      pub: {
        pem: "",
        hex: "",
      },
    };
    output.priv.pem = pemPriv;
    // PEM encode the pubkey for this keypair:
    // Todo - Don't regen public key every time?
    braveEC._genPubKey(pemPriv, function(err, pemPub){
      if(err){ return callback(err) };
      output.pub.pem = pemPub;
      try {
        // Validate and parse the DER structure encoded in the PEM data
        // This is necessary to get the key values out to hex encode them
        var keyBuffers = braveEC.ASNFromDERPriv(pemPriv);
        output.pub.hex = keyBuffers.pubKey.toString('hex');
        console.log('Generated pubkey of hex length '+output.pub.hex.length);
        output.priv.hex = keyBuffers.privKey.toString('hex');
        console.log('Generated privkey of hex length '+output.priv.hex.length);
      } catch(e){
        return callback(e);
      }
      return callback(null, output);
    });
  };

  braveEC._pemPubToOutput = function(pemPub, callback){
    var output = {
      pub: {
        pem: "",
        hex: "",
      },
    };
    var isPemPub = !!pemPub.match(/-----BEGIN PUBLIC KEY-----/);
    if(!isPemPub){ return callback('bad PEM pubkey') };
    output.pub.pem = pemPub;
    try {
      // Validate and parse the DER structure encoded in the PEM data
      // This is necessary to get the key values out to hex encode them
      var keyBuffer = braveEC.ASNFromDERPub(pemPub);
      output.pub.hex = keyBuffer.pubKey.toString('hex');
    } catch(e){
      return callback(e);
    }
    return callback(null, output);
  };

  // Expected input is a DER-encoded EC key, either in a Node Buffer, hex
  // encoded utf8 string, or PEM-armored utf8 string.
  // Run it through forge to validate structure, throw or return ASN object
  braveEC.ASNFromDERPriv = function(input){
    // see ./prime256v1_privkey_validator.js
    var binBuffer = braveEC._normalizeInput(input);
    var forgeBuffer = forge.util.createBuffer(binBuffer.toString('binary'));
    var forgeASN = asn1.fromDer(forgeBuffer);

    // Validate the DER structure
    var capture = {};  var errors = [];
    if( !asn1.validate(forgeASN, prime256v1_privkey_validator, capture, errors) ){
      console.log(asn1.prettyPrint(forgeASN));
      console.log(capture);  console.log(errors);
      throw 'This buffer is not a DER encoded ecKeypair.';
    } else {
      // We have named some capture values for fields of interest:
      var privKeyRaw = capture.privKey;
      var privKeyForgeBuffer = forge.util.createBuffer(privKeyRaw, 'raw');
      var privKeyBin = privKeyForgeBuffer.getBytes();

      var pubKeyRaw = capture.pubKey;
      var pubKeyForgeBuffer = forge.util.createBuffer(pubKeyRaw, 'raw');
      var pubKeyBin = pubKeyForgeBuffer.getBytes();

      return {
        pubKey: new Buffer(pubKeyBin, 'binary'),
        privKey: new Buffer(privKeyBin, 'binary')
      };
      // return [forgeASN, capture]; // forgeASN contains the entire DER
    };
  };

  braveEC.ASNFromDERPub = function(input){
    // see ./prime256v1_pubkey_validator.js
    var binBuffer = braveEC._normalizeInput(input); // strips PEM etc
    var forgeBuffer = forge.util.createBuffer(binBuffer.toString('binary'));
    var forgeASN = asn1.fromDer(forgeBuffer);

    // Validate the DER structure
    var capture = {};  var errors = [];
    if( !asn1.validate(forgeASN, prime256v1_pubkey_validator, capture, errors) ){
      console.log(asn1.prettyPrint(forgeASN));
      console.log(capture);  console.log(errors);
      throw 'This buffer is not a DER encoded ecKeypair.';
    } else {
      // We have named some capture values for fields of interest:
      var pubKeyRaw = capture.pubKey;
      var pubKeyForgeBuffer = forge.util.createBuffer(pubKeyRaw, 'raw');
      var pubKeyBin = pubKeyForgeBuffer.getBytes();

      return {
        pubKey: new Buffer(pubKeyBin, 'binary'),
      };
      // return [forgeASN, capture]; // forgeASN contains the entire DER
    };
  };

  // Take PEM armored private EC key and generate PEM pubkey
  braveEC._genPubKey = function(input, callback){
    var openssl = require('child_process')
    .spawn('openssl' ,['ec','-pubout', '-conv_form', 'compressed']);

    openssl.stdin.write(input, 'utf8', function(err){
      if(err){return callback(err)};
      openssl.stdin.end();
    });

    var pubKey = "";
    openssl.stdout.setEncoding('utf8');
    openssl.stdout.on('data', function(data){
      pubKey += data;
    });

    openssl.stdout.on('end', function(){
      var ecFound = /-----BEGIN PUBLIC KEY-----/.exec(pubKey);
      if(!ecFound){ callback(new Error('Output doesn\'t look like a EC public key')); };
      return callback(null, pubKey);
    });

    openssl.on('error', function(err){
      return callback(err);
    });
  };

  braveEC._stripPemArmor = function(input){
    var rxPemParam =
      /-----BEGIN EC PARAMETERS-----([^-]*)-----END EC PARAMETERS-----/
      .exec(input);
    var rxPemPriv =
      /-----BEGIN EC PRIVATE KEY-----([^-]*)-----END EC PRIVATE KEY-----/
      .exec(input);
    var rxPemPub =
      /-----BEGIN PUBLIC KEY-----([^-]*)-----END PUBLIC KEY-----/
      .exec(input);
    if(!!rxPemPriv){
      var dirtyBase64 = rxPemPriv[1];
    } else if(!!rxPemPub){
      var dirtyBase64 = rxPemPub[1];
    } else {
      throw('_stripPemArmor called without an EC PUBLIC/PRIVATE KEY');
    };
    var base64 = dirtyBase64.replace(/[ \r\n\t]/g,'');
    return base64;
  };

  // normalize Buffer and hex/PEM string to binary buffer for node-forge
  braveEC._normalizeInput = function(input){
    var encoded = null;
    if(input instanceof Buffer){
      // DER encoded prime256v1 keypair?
      encoded = new Buffer(input.length);
      input.copy(encoded);
    } else if(typeof input === "string"){
      var isHex = !!(/^[0-9a-f]*$/.exec(input));
      var isPem = !!(/-----BEGIN/).exec(input);
      if(isPem){
        var stripped = braveEC._stripPemArmor(input);
        encoded = new Buffer(stripped, 'base64');
      } else if(isHex){
        encoded = new Buffer(input, 'hex');
      } else {
        throw('validating unrecognized string');
      };
    } else {
      throw('validating non Buffer or String');
    };
    var output = new Buffer(encoded.length, 'binary');
    encoded.copy(output);
    return output;
  };

  // Experimental:
  braveEC.loadPemPrivFromStdin = function(callback){
    process.stdout.write('\nPaste your PEM-encoded prime256v1 key, then EOF (^D on Unix, ^Z Enter on Windows):');
    process.stdin.resume();
    process.stdin.setEncoding('utf8');
    var pem = "";
    process.stdin.on('data', function(data){
      pem += data;
    });
    process.stdin.on('close', function(){
      //process.stdout.write('\nThanks. Validating key...');
      console.log('\nThanks. Validating key...');
      braveEC._pemPrivToOutput(pem, function(err, output){
        if(err){
          return callback(err);
        //process.stdout.write('\nKey did not pass validation. Double check it is contains a PEM-encoded, ASCII armored private key for EC prime256v1');
        };
        console.log('\nYour private key was valid. Here\'s your hex-encoded private key:');
        console.log(output.priv.hex)
        console.log('\nHere\'s your hex-encoded public key:');
        console.log(output.pub.hex)
        callback(null, output);
      });
    });
  };

  braveEC.cfg = function(cfg){
    braveEC._config = cfg;
  };

  braveEC.sign = function(date, uri, body, callback){
    if(!braveEC._config.clientPriv){
      return callback('Set the client private key with .cfg before signing');
    };
    var keyName = path.normalize(braveEC._config.clientPriv);
    console.log(keyName);
    var payload = [date, uri, body].join('\n');
    var sig = "";
    var openssl = require('child_process').spawn('openssl'
    ,['dgst', '-sign', keyName, '-sha256']);
    openssl.stdout.setEncoding('hex');
    openssl.stdout.on('data', function(data){ sig += data });
    openssl.on('close', function(){ callback(null, sig) });
    openssl.on('error', function(err){ callback(err) });
    openssl.stdin.write(payload);
    openssl.stdin.end();
  };

  return braveEC;
})();


text:
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<link rel="help" "https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/imports/index.html#imported-document" />

<link id="cors-same" rel="import" href="http://localhost:8000/security/resources/cors-redir.php?url=http://127.0.0.1:8000/htmlimports/resources/hello.html">
</head>

<script>
function assert_loaded(id)
{
    var target = document.getElementById(id);
    assert_true(target.import instanceof Document)
    assert_true(0 <= target.import.querySelector("h1").innerHTML.indexOf("Hello"));
}

function assert_not_loaded(id)
{
    var target = document.getElementById(id);
    assert_equals(target.import, null);
}

// Redirect passes CORS check, but the redirect is to another origin (hence a unique origin must be used.) This does not pass the final access control check.
test(function() { assert_not_loaded("cors-same"); }, "Accessing to a same origin import including CORS domain redirect");
</script>
</body>
</html>


text:
Bei der Benutzung von <select> Elementen sollte die option ng-options genutzt werden. Werden die Options
im Quelltext angegeben, werden diese ggf bei modellängerungen nicht mit gesetzt.

```
this.options = {
    key1: "Value1",
    key2: "Value2"
}
this.selectedKey = "key2";

<select style="margin-right: 10px;" ng-options="key as value for (key, value) in demoCtrl.options" ng-model="demoCtrl.selectedKey">
</select>

```


text:
package parquet.column.values.bitpacking;

/**
 * Packs and unpacks into bytes
 *
 * packing unpacking treats:
 *  - n values at a time (with n % 8 == 0)
 *  - bitWidth * (n/8) bytes at a time.
 *
 * @author Julien Le Dem
 *
 */
public abstract class BytePacker {

  private final int bitWidth;

  BytePacker(int bitWidth) {
    this.bitWidth = bitWidth;
  }

  /**
   * @return the width in bits used for encoding, also how many bytes are packed/unpacked at a time by pack8Values/unpack8Values
   */
  public final int getBitWidth() {
    return bitWidth;
  }

  /**
   * pack 8 values from input at inPos into bitWidth bytes in output at outPos.
   * nextPosition: inPos += 8; outPos += getBitWidth()
   * @param input the input values
   * @param inPos where to read from in input
   * @param output the output bytes
   * @param outPos where to write to in output
   */
  public abstract void pack8Values(final int[] input, final int inPos, final byte[] output, final int outPos);

  /**
   * pack 32 values from input at inPos into bitWidth * 4 bytes in output at outPos.
   * nextPosition: inPos += 32; outPos += getBitWidth() * 4
   * @param input the input values
   * @param inPos where to read from in input
   * @param output the output bytes
   * @param outPos where to write to in output
   */
  public abstract void pack32Values(int[] input, int inPos, byte[] output, int outPos);

  /**
   * unpack bitWidth bytes from input at inPos into 8 values in output at outPos.
   * nextPosition: inPos += getBitWidth(); outPos += 8
   * @param input the input bytes
   * @param inPos where to read from in input
   * @param output the output values
   * @param outPos where to write to in output
   */
  public abstract void unpack8Values(final byte[] input, final int inPos, final int[] output, final int outPos);

  /**
   * unpack bitWidth * 4 bytes from input at inPos into 32 values in output at outPos.
   * nextPosition: inPos += getBitWidth() * 4; outPos += 32
   * @param input the input bytes
   * @param inPos where to read from in input
   * @param output the output values
   * @param outPos where to write to in output
   */
  public abstract void unpack32Values(byte[] input, int inPos, int[] output, int outPos);

}


text:
Managed Extensibility Framework (MEF) integration for [Autofac](https://autofac.org).

[![Build status](https://ci.appveyor.com/api/projects/status/404h0j4gj3qyn09a?svg=true)](https://ci.appveyor.com/project/Autofac/autofac-bwvcu)

Please file issues and pull requests for this package [in this repository](https://github.com/autofac/Autofac.Mef/issues) rather than in the Autofac core repo.

- [Documentation](https://autofac.readthedocs.io/en/latest/integration/mef.html)
- [NuGet](https://www.nuget.org/packages/Autofac.Mef)
- [Contributing](https://autofac.readthedocs.io/en/latest/contributors.html)
- [Open in Visual Studio Code](https://open.vscode.dev/autofac/Autofac.Mef)

## Quick Start

The Autofac/MEF integration allows MEF catalogs to be registered with the `ContainerBuilder` using the `RegisterComposablePartCatalog()` extension method. If you register a component using MEF and want to provide Autofac components into that MEF component, use the `Exported()` extension.

```c#
var builder = new ContainerBuilder();
var catalog = new DirectoryCatalog(@"C:\MyExtensions");
builder.RegisterComposablePartCatalog(catalog);
builder.RegisterType<Component>()
       .Exported(x => x.As<IService>().WithMetadata("SomeData", 42));
```

Check out the [Autofac MEF integration documentation](https://autofac.readthedocs.io/en/latest/integration/mef.html) for more information.

## Get Help

**Need help with Autofac?** We have [a documentation site](https://autofac.readthedocs.io/) as well as [API documentation](https://autofac.org/apidoc/). We're ready to answer your questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/autofac) or check out the [discussion forum](https://groups.google.com/forum/#forum/autofac).


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

<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You 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="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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.apache.jackrabbit</groupId>
        <artifactId>oak-parent</artifactId>
        <version>1.45-SNAPSHOT</version>
        <relativePath>../oak-parent/pom.xml</relativePath>
    </parent>

    <artifactId>oak-auth-external</artifactId>
    <name>Oak External Authentication Support</name>
    <packaging>bundle</packaging>

    <properties>
        <!-- enable execution of jacoco and set minimal line coverage -->
        <skip.coverage>false</skip.coverage>
        <minimum.line.coverage>0.99</minimum.line.coverage>
        <minimum.branch.coverage>1.0</minimum.branch.coverage>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                  <instructions>
                    <Import-Package>
                      <!-- OAK-7182 -->${guava.osgi.import},
                      *
                    </Import-Package>
                  </instructions>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <systemPropertyVariables>
                        <java.util.logging.config.file>
                            src/test/resources/logging.properties
                        </java.util.logging.config.file>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- Optional OSGi dependencies, used only when running within OSGi -->
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.compendium</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.jaas</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.scr.annotations</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.annotation</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Jackrabbit dependencies -->
        <dependency>
            <groupId>org.apache.jackrabbit</groupId>
            <artifactId>jackrabbit-jcr-commons</artifactId>
            <version>${jackrabbit.version}</version>
        </dependency>

        <!-- Dependencies to other Oak components -->
        <dependency>
            <groupId>org.apache.jackrabbit</groupId>
            <artifactId>oak-jackrabbit-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.jackrabbit</groupId>
            <artifactId>oak-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.jackrabbit</groupId>
            <artifactId>oak-store-spi</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.jackrabbit</groupId>
            <artifactId>oak-commons</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.jackrabbit</groupId>
            <artifactId>oak-query-spi</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.jackrabbit</groupId>
            <artifactId>oak-security-spi</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.jackrabbit</groupId>
            <artifactId>oak-core</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- General utility libraries -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <!-- Nullability annotations -->
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
        </dependency>

        <!-- Test Dependencies -->
        <dependency>
            <groupId>org.apache.jackrabbit</groupId>
            <artifactId>oak-core</artifactId>
            <version>${project.version}</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.jackrabbit</groupId>
            <artifactId>oak-jcr</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>


text:
namespace Rush
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Net.Http;
    using System.Threading;
    using System.Threading.Tasks;
    using Newtonsoft.Json;

    public static class RushClient
    {
        private const string storeBaseUrl = "http://localhost:38110/rush/store/";

        public static void Initialize(string applicationId, string applicationKey)
        {

        }

        public static Task SaveAsync(this RushObject obj)
        {
            return SaveAsync(obj, CancellationToken.None);
        }

        public static async Task SaveAsync(this RushObject obj, CancellationToken cancellationToken)
        {
            var json = JsonConvert.SerializeObject(obj.AsDictionary());
            var content = new StringContent(json);

            var client = new HttpClient();
            var result = await client.PostAsync(storeBaseUrl + obj.ClassName, content, cancellationToken);
            if (result.StatusCode == HttpStatusCode.OK)
            {
                var saved = await result.Content.ReadAsStringAsync();
            }
            else
            {

            }
        }
    }
}


text:
package net.orfjackal.retrolambda.util;

import static org.objectweb.asm.Opcodes.*;

public class Flags {

    public static boolean hasFlag(int subject, int flag) {
        return (subject & flag) == flag;
    }

    // classes

    public static boolean isInterface(int access) {
        return hasFlag(access, ACC_INTERFACE);
    }

    // initialization

    public static boolean isConstructor(String name) {
        return name.equals("<init>");
    }

    public static boolean isStaticInitializer(String name, String desc, int access) {
        return name.equals("<clinit>") &&
                desc.equals("()V") &&
                hasFlag(access, ACC_STATIC);
    }

    // concrete vs abstract

    public static boolean isConcreteMethod(int access) {
        return !isAbstractMethod(access);
    }

    public static boolean isAbstractMethod(int access) {
        return hasFlag(access, ACC_ABSTRACT);
    }

    // instance vs static

    public static boolean isInstanceMethod(int access) {
        return !isStaticMethod(access);
    }

    public static boolean isStaticMethod(int access) {
        return hasFlag(access, ACC_STATIC);
    }

    // visibility

    public static boolean isPublicMethod(int access) {
        return hasFlag(access, ACC_PUBLIC);
    }

    public static boolean isPrivateMethod(int access) {
        return hasFlag(access, ACC_PRIVATE);
    }
}


text:
define(["activerecord"], function (ActiveRecord) {
  "use strict";

  var Car = ActiveRecord.register("Car");

  Car.extend({
    validations : {
      brand : ['required', "integer", 'number'],
      cost : [{
        test : "more",
        params : [10000]
      }]
    },
    messages : {
      required : function (property) {
        return "Required message from model '"+property+"'";
      }
    }
  });

  return Car;
});


text:
/**
 * Provides the ConfigReader class in the GQE namespace which is responsible
 * for providing the reading of configuration files.
 *
 * @file include/GQE/Core/classes/ConfigReader.hpp
 * @author Ryan Lindeman
 * @date 20110101 - Initial Release
 * @date 20110108 - Added GetFloat and ParseFloat
 * @date 20110118 - Fixed compiler problems.
 * @date 20110127 - Moved to GQE Core library and include directory
 * @date 20110127 - Use new OS independent Uint/Int types
 * @date 20110131 - Added class and method argument documentation
 * @date 20110218 - Added boolean result to Read method for success
 * @date 20110218 - Change to system include style
 * @date 20110627 - Removed extra ; from namespace
 * @date 20110810 - Added copy constructor and assignment operator
 * @date 20110820 - Moved private Parse methods to StringUtil.hpp/cpp
 * @date 20110820 - Changed Read to LoadFromFile to match SFML style
 * @date 20110820 - Removed GetColor, use GetString and ParseColor instead
 */
#ifndef   CORE_CONFIG_READER_HPP_INCLUDED
#define   CORE_CONFIG_READER_HPP_INCLUDED

#include <map>
#include <string>
#include <GQE/Core/Core_types.hpp>

namespace GQE
{
  /// Provides basic configuration file reading
  class GQE_API ConfigReader
  {
    public:
      /**
       * ConfigReader constructor
       */
      ConfigReader();

      /**
       * ConfigReader copy constructor will duplicate the configuration
       * information that has been read from theCopy.
       * @param[in] theCopy to duplicate
       */
      ConfigReader(const ConfigReader& theCopy);

      /**
       * ConfigReader deconstructor
       */
      virtual ~ConfigReader();

      /**
       * IsSectionEmpty determines if theSection provided exists and has 1 or
       * more name, value pairs to retrieve.
       * @param[in] theSection to check
       * @return true if theSection provided exists
       */
      bool IsSectionEmpty(const std::string theSection) const;

      /**
       * GetBool will return the boolean value for theSection and theName
       * specified or theDefault(false) if the section or name does not
       * exist.  The value must be one of the following to return either
       * true or false (0,1,on,off,true,false).
       * @param[in] theSection to use for finding the value to return
       * @param[in] theName to use for finding the value to return
       * @param[in] theDefault to use if the value is not found (optional)
       * @return the value found or theDefault if not found or correct
       */
      bool GetBool(const std::string theSection, const std::string theName,
          const bool theDefault = false) const;

      /**
       * GetFloat will return a floating point number for theSection and
       * theName specified or theDefault(0.f) if theSection or theName does not
       * exist.
       * @param[in] theSection to use for finding theName
       * @param[in] theName to use for finding the value to return
       * @param[in] theDefault to use if the value is not found (optional)
       * @return the value found or theDefault if not found or correct
       */
      float GetFloat(const std::string theSection, const std::string theName,
          const float theDefault = 0.f) const;

      /**
       * GetString will return the string value for theSection and theName
       * specified or theDefault("") if the section or name does not exist.
       * @param[in] theSection to use for finding theName
       * @param[in] theName to use for finding the value to return
       * @param[in] theDefault to use if the value is not found (optional)
       * @return the value found or theDefault if not found
       */
      std::string GetString(const std::string theSection,
          const std::string theName, const std::string theDefault = "") const;

      /**
       * GetUint32 will return an unsigned 32 bit number for theSection and
       * theName specified or theDefault(0) if theSection or theName does not
       * exist.
       * @param[in] theSection to use for finding theName
       * @param[in] theName to use for finding the value to return
       * @param[in] theDefault to use if the value is not found (optional)
       * @return the value found or theDefault if not found
       */
      Uint32 GetUint32(const std::string theSection, const std::string theName,
          const Uint32 theDefault = 0) const;

      /**
       * LoadFromFile will open and read the configuration file specified into
       * internal maps that can be later retrieved using the Get* options above.
       * @param[in] theFilename to use as the configuration file to read
       * @result true if theFilename was found and opened successfully
       */
      bool LoadFromFile(const std::string theFilename);

      /**
       * Assignment operator will duplicate the information found in theRight
       * into this ConfigReader class.
       * @param[in] theRight hand side of = operator to duplicate from
       * @return the new left hand side copy
       */
      ConfigReader& operator=(const ConfigReader& theRight);

    private:
      // Constants
      ///////////////////////////////////////////////////////////////////////////
      static const unsigned short MAX_CHARS = 100;

      // Variables
      ///////////////////////////////////////////////////////////////////////////
      /// Map to store all the sections and their corresponding name=value pairs
      std::map<const std::string, typeNameValue*> mSections;

      /**
       * ParseLine will parse the line provided by the Read method above.
       * @param theLine to be parsed.
       * @param theCount is the line number currently being processed
       * @param theSection to be used if name, value pair is parsed
       * @return string representing the new section name if section name was parsed
       */
      std::string ParseLine(const char* theLine, const unsigned long theCount,
          const std::string theSection);

      /**
       * StoreNameValue will store theName and theValue pair into theSection.
       * If theSection name value map doesn't yet exist, then it will be created.
       * @param theSection is used to find the name, value pair map
       * @param theName to be stored as the key for theValue below
       * @param theValue to be stored in the current section name
       */
      void StoreNameValue(const std::string theSection,
          const std::string theName, const std::string theValue);

  }; // class ConfigReader
} // namespace GQE

#endif // CORE_CONFIG_READER_HPP_INCLUDED

/**
 * @class GQE::ConfigReader
 * @ingroup Core
 * The ConfigReader class is used to read from configuration files those
 * settings needed for the program.  For now these files are basic .INI
 * type files.
 *
 * Copyright (c) 2010-2011 Ryan Lindeman
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */


text:
<?php

namespace Phalcon\Tests\unit\Phalcon\Text;

use \PhalconTest\Text as PhTText;

class TextIncrementTest extends Helper\TextBase
{
    /**
     * Tests the increment function
     *
     * @author Nikolaos Dimopoulos <nikos@phalconphp.com>
     * @since  2014-09-29
     */
    public function testTextIncrementSimpleString()
    {
        $this->specify(
            "increment does not increment a simple string",
            function () {

                $source   = 'file';
                $expected = 'file_1';
                $actual   = PhTText::increment($source);
                expect($actual)->equals($expected);
            }
        );
    }

    /**
     * Tests the increment function with an already incremented string
     *
     * @author Nikolaos Dimopoulos <nikos@phalconphp.com>
     * @since  2014-09-29
     */
    public function testTextIncrementAlreadyIncremented()
    {
        $this->specify(
            "increment does not increment an incremented string",
            function () {

                $source   = 'file_1';
                $expected = 'file_2';
                $actual   = PhTText::increment($source);
                expect($actual)->equals($expected);
            }
        );
    }

    /**
     * Tests the increment function for an already incremented string twice
     *
     * @author Nikolaos Dimopoulos <nikos@phalconphp.com>
     * @since  2014-09-29
     */
    public function testTextIncrementAlreadyIncrementedTwice()
    {
        $this->specify(
            "increment does not increment a second incremented string",
            function () {

                $source   = 'file_2';
                $expected = 'file_3';
                $actual   = PhTText::increment($source);
                expect($actual)->equals($expected);
            }
        );
    }

    /**
     * Tests the increment function for a string with underscore
     *
     * @author Nikolaos Dimopoulos <nikos@phalconphp.com>
     * @since  2014-09-29
     */
    public function testTextIncrementStringWithUnderscore()
    {
        $this->specify(
            "increment does not increment a string with an underscore",
            function () {

                $source   = 'file_';
                $expected = 'file_1';
                $actual   = PhTText::increment($source);
                expect($actual)->equals($expected);
            }
        );
    }

    /**
     * Tests the increment function for a string with a space at the end
     *
     * @author Nikolaos Dimopoulos <nikos@phalconphp.com>
     * @since  2014-09-29
     */
    public function testTextIncrementStringWithSpace()
    {
        $this->specify(
            "increment does not increment a string with a space at the end",
            function () {

                $source   = 'file ';
                $expected = 'file _1';
                $actual   = PhTText::increment($source);
                expect($actual)->equals($expected);
            }
        );
    }

    /**
     * Tests the increment function with a different separator
     *
     * @author Nikolaos Dimopoulos <nikos@phalconphp.com>
     * @since  2014-09-29
     */
    public function testTextIncrementStringWithDifferentSeparator()
    {
        $this->specify(
            "increment does not increment a string with a different separator",
            function () {

                $source   = 'file';
                $expected = 'file-1';
                $actual   = PhTText::increment($source, '-');
                expect($actual)->equals($expected);
            }
        );
    }
}


text:
A simple Ethereum Wallet based on CHARG ERC20 Token. Send a Receive ETH and CHARG with ease and security. Ethereum wallets are decrypted and raw transactions are signed locally. Raw Transactions are sent directly to EtherScan.io. This application is not an official release from CHARG, just a opensource wallet for CHARG Token holders. Wallet Private Keys are kept on your local machine, everytime you want to use this wallet you must re-use the Keystore JSON or Private Key for your wallet.
This wallet is locked to the Иeureal Token contract address: `0x9cA99D3455f12Be8e580Dc8C1498fC7194fa6ddb`

## CHARG Wallet Features
- Use Keystore JSON wallet
- Use Private Key wallet
- Send and Receive Ethereum (ETH)
- Send a Receive CHARG tokens. ([0x9cA99D3455f12Be8e580Dc8C1498fC7194fa6ddb](https://etherscan.io/address/0x9cA99D3455f12Be8e580Dc8C1498fC7194fa6ddb))
- Set custom Gas Price for transactions
- Portfolio value for Иeureal and Ethereum in USD
- Copy address to clipboard when clicked
- Transaction ID with etherscan URL once transaction is submitted
- Check for Updates button (in About - bottom right)
- Raw Transactions send to EtherScan

Wallet Security

None of your wallet information is sent to any server. This wallet uses [ether-js](https://docs.ethers.io/ethers.js/index.html) javascript library to decrypt wallets locally. Each time you open the wallet, you will need to reinput the Keystore JSON file with password or use the wallet's Private Key. To keep your wallet secure, I highly recommend using the Keystore JSON at all times. To remove confusion, this wallet will not allow you to create a new wallet. If you don't have a Ethereum or Иeureal wallet yet, make one with a secure password at [myetherwallet.com](https://www.myetherwallet.com/). This wallet will not save or move your wallets. Be sure to back up the Keystore JSON file!

Transactions

This CHARG Wallet will allow you to set a custom Gas Price if you need to change the price. By default it is set to *21* gwei. Minimum is 5 gwei. The gas limit on a normal Ether transaction is *12000*. The gas limit on sending Иeureal Tokens is *65000*.

Source Code Auditing

Feel free to look at what this application is doing. Иeureal Wallet was built in electron, jquery, bootstrap, and uses ether.js for decrypting wallets. Below you'll find the main functionality of the application.

### Audit Lines
- [CHARGToken Contract](https://github.com/ChargCoin/charg-wallet-winmaclinux/blob/master/js/main.js#L22)
- [Send Ethereum Transaction](https://github.com/ChargCoin/charg-wallet-winmaclinux/blob/master/js/main.js#L319)
- [Send CHARG Transaction](https://github.com/ChargCoin/charg-wallet-winmaclinux/blob/master/js/main.js#L367)
- [Decrypting Keystore JSON](https://github.com/ChargCoin/charg-wallet-winmaclinux/blob/master/js/main.js#L276)
- [Using Private Key](https://github.com/ChargCoin/charg-wallet-winmaclinux/blob/master/js/main.js#L163)

### Build
You can compile this electron application on your own.
- `git clone https://github.com/ChargCoin/charg-wallet-winmaclinux`
- `cd charg-wallet`
- `npm install`
- `npm start`

# License
This wallet is for the CHARG community to make life easier for us ERC20 token holders. If you have any fixes or updates, please submit a PR. That'd be awesome! This wallet was NOT created by CHARG, so take this as unofficial but useable. Source code is MIT, make your CHARG ERC20 Token experience decentralized!

### Donate :beer::bug:
ETH/CHARG: `0x85E07E97f19DD7b1460d6448E571796f594408AE`


text:
from django.conf import settings
from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('logger', '0016_remove_conflicting_view_permissions'),
    ]

    operations = []

    # This AlterUniqueTogether step can fail with
    #   ValueError: Found wrong number (0) of constraints for logger_xform(user_id, sms_id_string) # noqa
    # when the database specifies the constraint in the opposite order,
    # i.e. (sms_id_string, user_id). Let's try ignoring the
    # `unique_together` change and simply depend upon the database
    # automatically removing the constraint when the `sms_id_string` column
    # is dropped. See also https://code.djangoproject.com/ticket/23906.
    #
    # But, if database is SQLite, the `unique_together` constraint removal must
    # be enforced.
    if not settings.USE_POSTGRESQL:
        operations.append(
            migrations.AlterUniqueTogether(
                name='xform',
                unique_together={('user', 'id_string')},
            )
        )

    operations.append(
        migrations.RemoveField(
            model_name='xform',
            name='allows_sms',
        )
    )
    operations.append(
        migrations.RemoveField(
            model_name='xform',
            name='sms_id_string',
        )
    )


text:
<?php

namespace Hybrid;

use Fuel\Core\Markdown;

/**
 * Hybrid
 *
 * A set of class that extends the functionality of FuelPHP without
 * affecting the standard workflow when the application doesn't actually
 * utilize Hybrid feature.
 *
 * @package     Fuel
 * @subpackage  Hybrid
 * @category    Parser_Markdown
 * @author      Mior Muhammad Zaki <crynobone@gmail.com>
 */

class Parser_Markdown extends Parser_Driver
{
	/**
	 * Parse markdown formatted text to HTML
	 *
	 * @access  public
	 * @param   string   $text
	 * @return  string
	 */
	public function parse($text = '')
	{
		if (empty($text) or ! strval($text))
		{
			$text = '';
		}

		return Markdown::parse($text);
	}

}


text:
<!DOCTYPE html>
<meta charset="UTF-8">
<title>Transitioning visibility</title>

After a short delay, the text below should become hidden.

FAIL - the script did not execute.

Filler text filler text filler text.


text:
The *auth0-rules-testharness* library provides an easy way to deploy, execute, and test the output of Auth0 Rules using a real
webtask sandbox environment. It is very simple to use, and requires under 5 minutes to get started testing your Auth0 Rules!

This README offers full instructions. However, for an easy to understand seed project that helps users get started immediately, please see [auth0-rules-testharness-sample](https://github.com/tawawa/auth0-rules-testharness-sample).

See here for further documentation on [Auth0 Rules](https://auth0.com/docs/rules).

Depending on your needs there are several pragmatic ways to test Rules without resorting to actually deploying and executing
them in a webtask sandbox environment. One solution is to use the [webtask runtime](https://github.com/auth0/webtask-runtime).
Doing this offers a series of components that replicate the behaviour of the runtime component of https://webtask.io.

However, sometimes you just want to execute your Rule against the same sandbox environment it will be deployed to at Runtime in
Auth0, and test everything works as expected. You may also wish to write your Rules using a test driven development approach, and gain real feedback as you code - this is where this npm module can help.  It actually takes your Rule script, and any `user`, `context` and `callback` you give it, then spins up a webtask, executes your Rule passing the results to the provided callback, and finally tears the environment down again.

### Notes

It is worth noting that under the covers, the script this npm module generates for deployment to a webtask environment depends upon [auth0-authz-rules-api](https://github.com/auth0/auth0-authz-rules-api). If you wish to study and understand the generated script code that wraps the Rule being tested, then this is the place to look ;)

For a similar NPM module to deploy, execute, and test the output of [Auth0 Custom DB](https://auth0.com/docs/connections/database/mysql) Scripts using a real webtask sandbox environment, please see [auth0-custom-db-testharness](https://www.npmjs.com/package/auth0-custom-db-testharness).

## Prerequisites

Assumes you have an Auth0 Tenant webtask container to run your Rules against.

#### Create a free Auth0 Account

1. Go to [Auth0](https://auth0.com/signup) and click Sign Up.
2. Use Google, GitHub or Microsoft Account to login.

#### What is Auth0?

See bottom of this README for further info...

## How to use it?

Just install it as an npm dependency and reference in your testsuite.

```bash
$ npm install auth0-rules-testharness
```

Below is a complete testsuite illustrating how you might go about using this library.
Please note, the `user` and `context` can be as lightweight or as realistic as you wish according to your test needs.

You can get your webtask token from [your auth0 dashboard](https://manage.auth0.com/#/account/webtasks)

It is referenced in Step 2.

```
'use strict';

var expect = require('chai').expect;
var runInSandbox = require("auth0-rules-testharness");

var user = {
  "email": "richard.seldon@auth0.com",
  "email_verified": true,
  "name": "Richard Seldon"
};

var context = {
  "clientID": "wWXS5rz3asdfdfkzbCXho3zNPNv77c",
  "clientName": "My Auth0 Client",
  "connection": "MY-DB"
};

var configuration = {
  NAME: 'world'
};

var params = {
  timeout: 5,
  ca: '',
  tenant: 'my-super-tenant',
  url: 'https://sandbox.it.auth0.com',
  token: '<webtask-token>'
};

describe('auth0-rules-testharness', function () {

  var ruleScript = `function (user, context, callback) {
  console.log('hello,', configuration.NAME);
  user.foo = "bar";
  callback(null, user, context);
}`;

  it('should console log "hello, world" - available in output array', function (done) {

    var callback = function (err, result, output, stats) {
      // console.log('output: ', output);
      expect(output[0]).to.equal('hello, world');
      done();
    };

    var args = [user, context, callback];
    runInSandbox(ruleScript, args, configuration, params);
  });

  it('should append attribute "foo" to user with value "bar" - available in result object', function (done) {

    var callback = function (err, result, output, stats) {
      // console.log('result: ', result);
      expect(result.foo).to.equal('bar');
      done();
    };

    var args = [user, context, callback];
    runInSandbox(ruleScript, args, configuration, params);
  });

});
```

Above, hopefully everything is reasonably self-documenting if you are already familiar with Auth0 Rules. The signature of a rule is as follows:

```
function (user, context, callback) {
  // TODO: implement your rule
  callback(null, user, context);
}
```

As you can see, we need to provide a `user`, `context` and `callback`.

This library allows the end-user to offer any `user` or `context` objec they want, and expects any Tests you want to run on the results to be in the `callback` function.

The `configuration` object can contain any special configuration constants you may have. For example, testing your rule when it expects an API endpoint etc.

The `params` object takes a set of expected attribute values

```
var params = {
  timeout: 5,
  ca: '',
  tenant: 'my-super-tenant',
  url: 'https://sandbox.it.auth0.com',
  token: '<webtask-token>'
};
```

*Params Attributes Description*

* `timeout`: refers the timeout in seconds for the webtask to execute.
* `ca`: you can just leave as empty string.
* `tenant`: your tenant name in Auth0
* `url`: sandbox container url - 'https://sandbox.it.auth0.com' for public cloud
* `token`: the webtask token. You can get your webtask token from [your auth0 dashboard](https://manage.auth0.com/#/account/webtasks).

That is it! You should be up and running in under 5 minutes with an easy way to execute and test your Rules against a webtask sandbox environment.

## Special Warning

It is possible that if one Rule fails due to malformed Script content, it could bring down the Webtask Container for a short period of time, affecting any other webtasks deployed in the same container. For this reason, usage of this library against a PRODUCTION webtask environment is strongly discouraged.

Please note this is not a limitation of this library, but rather do with the behaviour of webtasks themselves - this is identical behaviour to writing a malformed Rule in the Auth0 Dashboard and executing it with an authentication request. Please see here for more information on [webtasks](https://webtask.io/), the underlying technology that Auth0 Rules are based upon.

## What is Auth0?

Auth0 helps you to:

* Add authentication with [multiple authentication sources](https://docs.auth0.com/identityproviders), either social like **Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce, among others**, or enterprise identity systems like **Windows Azure AD, Google Apps, Active Directory, ADFS or any SAML Identity Provider**.
* Add authentication through more traditional **[username/password databases](https://docs.auth0.com/mysql-connection-tutorial)**.
* Add support for **[linking different user accounts](https://docs.auth0.com/link-accounts)** with the same user.
* Support for generating signed [Json Web Tokens](https://docs.auth0.com/jwt) to call your APIs and **flow the user identity** securely.
* Analytics of how, when and where users are logging in.
* Pull data from other sources and add it to the user profile, through [JavaScript rules](https://docs.auth0.com/rules).

## Create a free Auth0 Account

1. Go to [Auth0](https://auth0.com/signup) and click Sign Up.
2. Use Google, GitHub or Microsoft Account to login.

## Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues.

## Author

[Auth0](auth0.com)

## License

This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.


text:
---
layout: default
title: CAS - User Interface Customization
---

# CSS

The default styles are all contained in a single file located in `src/main/resources/static/css/cas.css`. This location is set in `cas-theme-default.properties`.
If you would like to create your own `css/custom.css file`, for example, you will need to update `standard.custom.css.file` key in that file.

```bash
standard.custom.css.file=/css/cas.css
cas.javascript.file=/js/cas.js
```

## Responsive Design

CSS media queries bring responsive design features to CAS which would allow adopter to focus on one theme for all appropriate devices and platforms. These queries are defined in the same `cas.css` file.

# Javascript

If you need to add some JavaScript, feel free to append `src/main/resources/static/js/cas.js`.

You can also create your own `custom.js` file, for example, and call it from within `bottom.html` like so:

```html
<script type="text/javascript" src="/js/custom.js"></script>
```

If you are developing themes per service, each theme also has the ability to specify a custom `cas.js` file under the `cas.javascript.file` setting.

The following Javascript libraries are utilized by CAS automatically:

* JQuery
* JQuery UI
* JQuery Cookie
* Bootstrap

## Asynchronous Script Loading
CAS will attempt load the aforementioned script libraries asynchronously so as to not block the page rendering functionality.
The loading of script files is handled by the [`head.js` library](http://headjs.com) and is the responsibility of `cas.js` file.

The only script that is loaded synchronously is the `head.js` library itself.

Because scripts, and specially JQuery are loaded asynchronously, any custom Javascript that is placed inside the page
that relies on these libraries may not immediately function on page load. CAS provides a callback function that allows
adopters to be notified when script loading has completed and this would be a safe time to execute/load other Javascript-related
functions that depend on JQuery inside the actual page.

```javascript
function jqueryReady() {
    //Custom Javascript tasks can be carried out now via JQuery...
}
```

## Checking CAPSLOCK
CAS will display a brief warning when the CAPSLOCK key is turned on during the typing of the credential password. This check is enforced by the `cas.js` file.

## Browser Cookie Support
For CAS to honor a single sign-on session, the browser MUST support and accept cookies. CAS will notify the
user if the browser has turned off its support for cookies. This behavior is controlled via the `cas.js` file.

## Preserving Anchor Fragments
Anchors/fragments may be lost across redirects as the server-side handler of the form post ignores the client-side anchor, unless appended to the form POST url.
This is needed if you want a CAS-authenticated application to be able to use anchors/fragments when bookmarking.

### Changes to `cas.js`
```javascript
/**
 * Prepares the login form for submission by appending any URI
 * fragment (hash) to the form action in order to propagate it
 * through the re-direct (i.e. store it client side).
 * @param form The login form object.
 * @returns true to allow the form to be submitted.
 */
function prepareSubmit(form) {
    // Extract the fragment from the browser's current location.
    var hash = decodeURIComponent(self.document.location.hash);

    // The fragment value may not contain a leading # symbol
    if (hash && hash.indexOf("#") === -1) {
        hash = "#" + hash;
    }

    // Append the fragment to the current action so that it persists to the redirected URL.
    form.action = form.action + hash;
    return true;
}
```

### Changes to Login Form

```html
<form method="post" id="fm1" th:object="${credential}">
        onsubmit="return prepareSubmit(this);">
```


text:
var ptype = "relative";

var margin = {top: 30, right: 10, bottom: 10, left: 10},
    width = 960 - margin.left - margin.right,
    height = 500 - margin.top - margin.bottom;

var x = d3.scale.ordinal().rangePoints([0, width], 1),
    y = {},
    dragging = {};

var line = d3.svg.line(),
    axis = d3.svg.axis().orient("left"),
    background,
    foreground;

var svg = d3.select("body").append("svg")
    .attr("width", width + margin.left + margin.right)
    .attr("height", height + margin.top + margin.bottom)
    .append("g")
    .attr("transform", "translate(" + margin.left + "," + margin.top + ")");

d3.csv("dra_value_1997_2004.csv", function(error, data) {

  // Extract the list of dimensions and create a scale for each.
  x.domain(dimensions = d3.keys(data[0]).filter(function(d) {
    return d != "pitcher" && d != "year" && d != "npa" && (y[d] = d3.scale.linear()
        .domain(ptype=="absolute" ? [-0.08, 0.05] : [-0.035, 0.035])
//d3.extent(data, function(p) { return +p[d]; }))
        .range([height, 0]));
  }));

  // Add grey background lines for context.
  background = svg.append("g")
      .attr("class", "background")
    .selectAll("path")
      .data(data)
    .enter().append("path")
      .attr("d", path);

  // Add blue foreground lines for focus.
  foreground = svg.append("g")
      .attr("class", "foreground")
    .selectAll("path")
      .data(data)
    .enter().append("path")
      .attr("d", path);

  // Add a group element for each dimension.
  var g = svg.selectAll(".dimension")
      .data(dimensions)
    .enter().append("g")
      .attr("class", "dimension")
      .attr("transform", function(d) { return "translate(" + x(d) + ")"; })
      .call(d3.behavior.drag()
        .origin(function(d) { return {x: x(d)}; })
        .on("dragstart", function(d) {
          dragging[d] = x(d);
          background.attr("visibility", "hidden");
        })
        .on("drag", function(d) {
          dragging[d] = Math.min(width, Math.max(0, d3.event.x));
          foreground.attr("d", path);
          dimensions.sort(function(a, b) { return position(a) - position(b); });
          x.domain(dimensions);
          g.attr("transform", function(d) { return "translate(" + position(d) + ")"; })
        })
        .on("dragend", function(d) {
          delete dragging[d];
          transition(d3.select(this)).attr("transform", "translate(" + x(d) + ")");
          transition(foreground).attr("d", path);
          background
              .attr("d", path)
            .transition()
              .delay(500)
              .duration(0)
              .attr("visibility", null);
        }));

  // Add an axis and title.
  g.append("g")
      .attr("class", "axis")
      .each(function(d) { d3.select(this).call(axis.scale(y[d])); })
    .append("text")
      .style("text-anchor", "middle")
      .attr("y", -9)
      .text(function(d) { return d.replace('icpt_dra_', ''); });

  // Add and store a brush for each axis.
  g.append("g")
      .attr("class", "brush")
      .each(function(d) {
        d3.select(this).call(y[d].brush = d3.svg.brush().y(y[d]).on("brushstart", brushstart).on("brush", brush));
      })
    .selectAll("rect")
      .attr("x", -8)
      .attr("width", 16);
});

function position(d) {
  var v = dragging[d];
  return v == null ? x(d) : v;
}

function transition(g) {
  return g.transition().duration(500);
}

// Returns the path for a given data point.
function path(d) {
  return line(dimensions.map(function(p)
			     { return [position(p),
				       y[p](ptype=="absolute" ? d[p] : d[p]-d['icpt_dra_0'])]; }));
}

function brushstart() {
  d3.event.sourceEvent.stopPropagation();
}

// Handles a brush event, toggling the display of foreground lines.
function brush() {
var actives = dimensions.filter(function(p) { return !y[p].brush.empty(); }),
      extents = actives.map(function(p) { return y[p].brush.extent(); });
foreground.style("display", function(d) {
return actives.every(function(p, i) {
      return ptype=="absolute" ?
	extents[i][0] <= d[p] && d[p] <= extents[i][1] :
	extents[i][0] <= d[p]-d['icpt_dra_0'] && d[p]-d['icpt_dra_0'] <= extents[i][1];

    }) ? null : "none";
  });
}


text:
[Source code of released version](https://github.com/meteor/meteor/tree/master/packages/meteor-base) | [Source code of development version](https://github.com/meteor/meteor/tree/devel/packages/meteor-base)
***

A default set of packages that almost every app will have. You should only remove this package if you really, really know what you are doing.

It comes with the following packages:

1. [`meteor`](https://atmospherejs.com/meteor/meteor) - Super basic stuff about the programming environment, and a handler for the `css` file type.
2. [`webapp`](https://atmospherejs.com/meteor/webapp) - The actual web server that handles connections, serves files, etc.
3. [`underscore`](https://atmospherejs.com/meteor/underscore) - A library with lots of useful utilities that most of Meteor is built on.
4. [`hot-code-push`](https://atmospherejs.com/meteor/hot-code-push) - Refresh the client automatically when the server has new code.
5. [`ddp`](https://atmospherejs.com/meteor/ddp) - A protocol for communicating between the client and server. This is what enables `Meteor.methods`, `Meteor.publish`, `Meteor.subscribe`, etc.


text:
                Example of form validation and data binding.

            <form novalidate class="container css-form">

                    Name:   <input class="form-control" type="text" ng-model="user.name" required/>

                    E-mail:   <input class="form-control" type="email" ng-model="user.email"
                                                    required/>

                    Gender:   <input type="radio" ng-model="user.gender" value="male"/> Male
                    <input type="radio" ng-model="user.gender" value="female"/> Female

                    Reset

                    Save

            </form>

form = {{user | json}}

master = {{master | json}}


text:
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using GF.FeatureWise.Services.Models;
using GF.FeatureWise.Services.Repositories;

namespace GF.FeatureWise.Services.Controllers
{
    public class UserEventsController : ApiController
    {
        private readonly IUserEventRepository repository;

        public UserEventsController() : this(new UserEventRepository(new ApiDataContext()))
        {
        }

        public UserEventsController(IUserEventRepository repository)
        {
            this.repository = repository;
        }

        public IEnumerable<UserEvent> GetAllUserEvents()
        {
            return repository.GetAll();
        }

        public UserEvent GetUserEvent(Guid id)
        {
            return repository.Get(id);
        }

        public HttpResponseMessage PostUserEvent(UserEvent userEvent)
        {
            var result = repository.Add(userEvent);
            var response = Request.CreateResponse(HttpStatusCode.Created, result);
            var uri = Url.Link("DefaultApi", new {controller = "UserEvents", id = result.Id});
            if (!String.IsNullOrEmpty(uri))
            {
                response.Headers.Location = new Uri(uri);
            }
            return response;
        }
    }
}