text:
<?php namespace Illuminate\Queue;

use Aws\Sqs\SqsClient;
use Illuminate\Queue\Jobs\SqsJob;

class SqsQueue extends Queue implements QueueInterface {

	/**
	 * The Amazon SQS instance.
	 *
	 * @var \Aws\Sqs\SqsClient
	 */
	protected $sqs;

	/**
	 * The name of the default tube.
	 *
	 * @var string
	 */
	protected $default;

	/**
	 * Create a new Amazon SQS queue instance.
	 *
	 * @param  \Aws\Sqs\SqsClient  $sqs
	 * @param  string  $default
	 * @return void
	 */
	public function __construct(SqsClient $sqs, $default)
	{
		$this->sqs = $sqs;
		$this->default = $default;
	}

	/**
	 * Push a new job onto the queue.
	 *
	 * @param  string  $job
	 * @param  mixed   $data
	 * @param  string  $queue
	 * @return mixed
	 */
	public function push($job, $data = '', $queue = null)
	{
		$payload = $this->createPayload($job, $data);

		$response = $this->sqs->sendMessage(array('QueueUrl' => $this->getQueue($queue), 'MessageBody' => $payload));

		return $response->get('MessageId');
	}

	/**
	 * Push a new job onto the queue after a delay.
	 *
	 * @param  \DateTime|int  $delay
	 * @param  string  $job
	 * @param  mixed  $data
	 * @param  string  $queue
	 * @return mixed
	 */
	public function later($delay, $job, $data = '', $queue = null)
	{
		$payload = $this->createPayload($job, $data);

		$delay = $this->getSeconds($delay);

		return $this->sqs->sendMessage(array(

			'QueueUrl' => $this->getQueue($queue), 'MessageBody' => $payload, 'DelaySeconds' => $delay,

		))->get('MessageId');
	}

	/**
	 * Pop the next job off of the queue.
	 *
	 * @param  string  $queue
	 * @return \Illuminate\Queue\Jobs\Job|null
	 */
	public function pop($queue = null)
	{
		$queue = $this->getQueue($queue);

		$response = $this->sqs->receiveMessage(
			array('QueueUrl' => $queue, 'AttributeNames' => array('ApproximateReceiveCount'))
		);

		if (count($response['Messages']) > 0)
		{
			return new SqsJob($this->container, $this->sqs, $queue, $response['Messages'][0]);
		}
	}

	/**
	 * Get the queue or return the default.
	 *
	 * @param  string|null  $queue
	 * @return string
	 */
	public function getQueue($queue)
	{
		return $queue ?: $this->default;
	}

	/**
	 * Get the underlying SQS instance.
	 *
	 * @return \Aws\Sqs\SqsClient
	 */
	public function getSqs()
	{
		return $this->sqs;
	}

}


text:
<?php

/**
 * Base class implements ways of fetching information about the installed
 * eZ Components when installed as tarball.
 *
 * @package Base
 * @version //autogentag//
 * @mainclass
 */
class ezcBaseMetaDataTarballReader
{
    /**
     * Contains the handler to the XML file containing the release information.
     * @var SimpleXmlElement
     */
    private $xml;

    /**
     * Creates the reader object and opens the release-info file.
     */
    public function __construct()
    {
        $filename = dirname( __FILE__ ) . '/../../../release-info.xml';
        $this->xml = simplexml_load_file( $filename );
    }

    /**
     * Returns the version string for the installed eZ Components bundle.
     *
     * A version string such as "2008.2.2" is returned.
     *
     * @return string
     */
    public function getBundleVersion()
    {
        return (string) $this->xml->version;
    }

    /**
     * Returns a PHP version string that describes the required PHP version for
     * this installed eZ Components bundle.
     *
     * @return string
     */
    public function getRequiredPhpVersion()
    {
        return (string) $this->xml->deps->php;
    }

    /**
     * Returns whether $componentName is installed
     *
     * Returns true for every component that exists (because all of them are
     * then available).
     *
     * @return bool
     */
    public function isComponentInstalled( $componentName )
    {
        $root = $this->xml->deps->packages->package;

        foreach ( $root as $package )
        {
            if ( (string) $package['name'] == $componentName )
            {
                return true;
            }
        }
        return false;
    }

    /**
     * Returns the version string of the available $componentName or false when
     * the component is not installed.
     *
     * @return string
     */
    public function getComponentVersion( $componentName )
    {
        $root = $this->xml->deps->packages->package;

        foreach ( $root as $package )
        {
            if ( (string) $package['name'] == $componentName )
            {
                return (string) $package['version'];
            }
        }
        return false;
    }

    /**
     * Returns a list of components that $componentName depends on.
     *
     * If $componentName is left empty, all installed components are returned.
     *
     * The returned array has as keys the component names, and as values the
     * version of the components. It returns null of the $componentName
     * is not found.
     *
     * @return array(string=>string).
     */
    public function getComponentDependencies( $componentName = null )
    {
        $baseVersion = false;
        $root = $this->xml->deps->packages;
        $found = $componentName === null ? true : false;

        // in case $componentName != null, we loop through all the components
        // in the file, and figure out the new root that we can list dependency
        // packages from.
        foreach ( $root->package as $package )
        {
            if ( (string) $package['name'] == 'Base' )
            {
                $baseVersion = $package['version'];
            }
            if ( !$found && (string) $package['name'] == $componentName )
            {
                $root = $package->deps;
                $found = true;
            }
        }

        if ( !$found )
        {
            return null;
        }

        // We always add the Base dependency even though it's not in the dependency file.
        $deps = array();
        $deps['Base'] = (string) $baseVersion;

        if ( !isset( $root->package ) )
        {
            return $deps;
        }
        foreach ( $root->package as $package )
        {
            $deps[(string) $package['name']] = (string) $package['version'];
        }
        return $deps;
    }
}
?>

redpajama_set_name: RedPajamaGithub


text:
namespace state_chart {

void Runtime::EnqueueExecutionError(const string& error_msg) {
  EnqueueInternalEvent("error.execution",
                       MakeJSONError(absl::StrCat("[datamodel] ", error_msg)));
}

}  // namespace state_chart


text:
title:  "REHEFA ZOMA...."
date:   08/09/2022
---

### Takaro

`Rehefa tapitra ny herinandro andinihana ity toko ity dia inona ny fampiharana manokana maharesy lahatra anao eo amin'ny fiainanao?`

`Inona ny fampiharana tokony hataonao any am-pianarana, ao amin'ny ankohonanao, any amin'ny toeram-piasanao ary any am-piangonana?`

Avereno jerena ilay andininy nianaranao tsianjery.

`Ahoana ny fomba hampiharanao izany eo amin'ny fiainanao mandritra ity herinandro ity?`

"Saintsaino mandritra ny herinandro ny Sabata masin'i Jehovah, satria andro natokana ho amin'ny fanompoana an'Andriamanitra izany. Andro izay tokony hitsaharan'ny tanana amin'ny asa araka izao tontolo izao izany, ary andro izay ifantohana manokana amin'izay ilain'ny fanahy. (...)

Rehefa tsaroana amin'izany fomba izany ny Sabata dia tsy hibahana ny zava-panahy ny lafiny ara-nofo. Tsy hisy avela hatao ny Sabata ny adidy fanao amin'ireo henemana fiasana. Aoka tsy ho lany amin'ny asa ara-nofo mandritra ny herinandro ny herintsika ka rehefa tonga ny andro fitsaharan'ny

Tompo sy famelombelomana, dia ho torovana loatra isika ka tsy hahavita ny asa fanompoana Azy. (...)

Mialoha indrindra ny filentehan'ny masoandro, aoka havela ny asa sy ny taratasy rehetra tsy mifandraika amin'ny fivavahana. Ry ray aman-dreny, hazavao amin'ny zanakao ny asanao sy ny tanjon izany, ary avelao izy ireo hiara-miomana aminao mba hitandrina ny Sabata araka ny baikon'Andriamanitra. (...)

Misy asa iray hafa tokony hifantohana amin'ny andro fiomanana. Tokony haravona ny fifandirana rehetra eo amin'ny mpirahalahy amin'io andro io, na ao amin'ny fianakaviana izany na ao am piangonana. (...)

Rehefa manomboka ny Sabata dia tokony hiambina mafy ny tenantsika isika, hiambina ny asa sy ny teny ataontsika, raha tsy izany isika dia mandroba an'Andriamanitra amin'ny fakana ny fotoana izay Azy. Tsy tokony hataontsika, na asaintsika ataon'ny zanatsika, ny asa fivelomana na koa izay asa tokony ho natao tamin'ny henemana fiasana. Andro fiomanana ny Zoma. Amin'izany no anokanana fotoana anaovana ny fiomanana ho amin'ny Sabata sy hisaintsainana ary hiresahana momba izany. (...) Voadika ny didy fahefatra rehefa miresaka momba ny zavatry ny tany isika na koa miresaka momba ny zava-maivamaivana sy tsy misy dikany. Ny firesahana momba ny zavatra rehetra mety ho tonga ao an-tsaintsika dia filazana ny hevitsika manokana. Ary ny fialana amin'izay tokony ho izy dia mitondra antsika ho amin'ny fanandevozana sy ny fanamelohana."- CG (Washington, DC: Review and Herald, 1954), tt. 527-530.

` `


text:
<?php declare(strict_types = 1);

namespace Dms\Web\Laravel\Scaffold;

use Dms\Web\Laravel\Scaffold\Domain\DomainStructure;

/**
 * @author Elliot Levin <elliotlevin@hotmail.com>
 */
class ScaffoldCmsContext extends ScaffoldContext
{
    /**
     * @var string
     */
    protected $dataSourceNamespace;

    /**
     * @var string
     */
    protected $outputNamespace;

    /**
     * ScaffoldCmsContext constructor.
     *
     * @param string          $rootEntityNamespace
     * @param DomainStructure $domainStructure
     * @param string          $dataSourceNamespace
     * @param string          $outputNamespace
     */
    public function __construct(string $rootEntityNamespace, DomainStructure $domainStructure, string $dataSourceNamespace, string $outputNamespace)
    {
        parent::__construct($rootEntityNamespace, $domainStructure);
        $this->dataSourceNamespace = ltrim($dataSourceNamespace, '\\');
        $this->outputNamespace     = ltrim($outputNamespace, '\\');
    }

    /**
     * @return string
     */
    public function getDataSourceNamespace() : string
    {
        return $this->dataSourceNamespace;
    }

    /**
     * @return string
     */
    public function getOutputNamespace() : string
    {
        return $this->outputNamespace;
    }

    /**
     * @return string
     */
    public function getModuleNamespace() : string
    {
        return $this->outputNamespace . '\\Modules';
    }

    /**
     * @return string
     */
    public function getValueObjectFieldNamespace() : string
    {
        return $this->outputNamespace . '\\Modules\\Fields';
    }
}


text:
package com.amazonaws.eclipse.lambda.serverless.model.transform;

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

import com.amazonaws.eclipse.lambda.serverless.model.Resource;
import com.amazonaws.eclipse.lambda.serverless.model.ResourceType;
import com.amazonaws.eclipse.lambda.serverless.model.TypeProperties;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

public class ServerlessFunction extends Resource {

    private static final String DEFAULT_RUNTIME = "java8";
    private static final Integer DEFAULT_TIMEOUT = 300;
    private static final Integer DEFAULT_MEMORY_SIZE = 512;

    @JsonProperty("Handler")
    private String handler;

    @JsonProperty("Runtime")
    private String runtime;

    @JsonProperty("CodeUri")
    private String codeUri;

    @JsonProperty("Description")
    private String description;

    @JsonProperty("MemorySize")
    private Integer memorySize;

    @JsonProperty("Timeout")
    private Integer timeout;

    @JsonProperty("Role")
    private JsonNode role;

    @JsonProperty("Policies")
    private final List<String> policies = new ArrayList<>();

    @JsonIgnore
    // These are additional properties in the Type, Properties level.
    private final Map<String, Object> additionalTopLevelProperties = new HashMap<>();

    public String getHandler() {
        return handler;
    }

    public void setHandler(String handler) {
        this.handler = handler;
    }

    public String getRuntime() {
        return runtime == null ? DEFAULT_RUNTIME : runtime;
    }

    public void setRuntime(String runtime) {
        this.runtime = runtime;
    }

    public String getCodeUri() {
        return codeUri;
    }

    public void setCodeUri(String codeUri) {
        this.codeUri = codeUri;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getMemorySize() {
        return memorySize == null ? DEFAULT_MEMORY_SIZE : memorySize;
    }

    public void setMemorySize(Integer memorySize) {
        this.memorySize = memorySize;
    }

    public Integer getTimeout() {
        return timeout == null ? DEFAULT_TIMEOUT : timeout;
    }

    public void setTimeout(Integer timeout) {
        this.timeout = timeout;
    }

    public JsonNode getRole() {
        return role;
    }

    public void setRole(JsonNode role) {
        this.role = role;
    }

    /**
     * @return non-null
     */
    public List<String> getPolicies() {
        return policies;
    }

    public void addPolicy(String policy) {
        this.policies.add(policy);
    }

    /**
     * @return non-null
     */
    public Map<String, Object> getAdditionalTopLevelProperties() {
        return additionalTopLevelProperties;
    }

    public void addAdditionalTopLevelProperty(String key, Object value) {
        this.additionalTopLevelProperties.put(key, value);
    }

    @Override
    public TypeProperties toTypeProperties() {
        TypeProperties tp = new TypeProperties();
        tp.setType(ResourceType.AWS_SERVERLESS_FUNCTION.toString());

        ObjectMapper mapper = new ObjectMapper();
        Map<String, Object> properties = mapper.convertValue(this, Map.class);
        for (Entry<String, Object> entry : properties.entrySet()) {
            tp.addProperty(entry.getKey(), entry.getValue());
        }

        Map<String, Object> topLevelProperties = getAdditionalTopLevelProperties();
        for (Entry<String, Object> entry : topLevelProperties.entrySet()) {
            tp.addAdditionalProperty(entry.getKey(), entry.getValue());
        }

        return tp;
    }

    @Override
    public String toString() {
        return "ServerlessFunction [handler=" + handler + ", runtime=" + runtime + ", codeUri=" + codeUri
                + ", description=" + description + ", memorySize=" + memorySize + ", timeout=" + timeout + ", role="
                + role + ", policies=" + policies + ", getAdditionalProperties()=" + getAdditionalProperties() + "]";
    }

}


text:
R-expressions-and-calls
=======================

Slides on R expressions and calls


text:
// MusicXML Class Library
// Copyright (c) by Matthew James Briggs
// Distributed under the MIT License

#include "mxtest/control/CompileControl.h"
#ifdef MX_COMPILE_CORE_TESTS

#include "cpul/cpulTestHarness.h"
#include "mx/core/Elements.h"
#include <sstream>

using namespace mx::core;

TEST( Test01, Extend )
{
	std::string indentString( INDENT );
	Extend object1;
	Extend object2;
	ExtendAttributesPtr attributes1 = std::make_shared<ExtendAttributes>();
	ExtendAttributesPtr attributesNull;
	/* set some attribute1 values here */
    attributes1->hasDefaultX = true;
    attributes1->defaultX = TenthsValue{ 0.1 };

	object2.setAttributes( attributes1 );
	object2.setAttributes( attributesNull ); /* should have no affect */
	std::stringstream default_constructed;
	object1.toStream( default_constructed, 0 );
	std::stringstream object2_stream;
	object2.toStream( object2_stream, 2 );
	std::string expected = R"(<extend/>)";
	std::string actual = default_constructed.str();
	CHECK_EQUAL( expected, actual )
	expected = indentString+indentString+R"(<extend default-x="0.1"/>)";
	actual = object2_stream.str();
	CHECK_EQUAL( expected, actual )
	std::stringstream o1;	std::stringstream o2;	bool isOneLineOnly = false;
	object1.streamContents( o1, 0, isOneLineOnly );
	object2.streamContents( o2, 0, isOneLineOnly );
	CHECK( isOneLineOnly )
	CHECK_EQUAL( o1.str(), o2.str() )
	CHECK( !object1.hasContents() )
	CHECK( !object1.hasAttributes() )
	CHECK( object2.hasAttributes() )
}

#endif


text:
package storm.trident.state;

import java.util.List;

import storm.trident.operation.ReducerAggregator;
import storm.trident.tuple.TridentTuple;
@SuppressWarnings({"unchecked","rawtypes"})
public class ReducerValueUpdater implements ValueUpdater<Object> {
    List<TridentTuple> tuples;
    ReducerAggregator agg;

    public ReducerValueUpdater(ReducerAggregator agg, List<TridentTuple> tuples) {
        this.agg = agg;
        this.tuples = tuples;
    }

    @Override
    public Object update(Object stored) {
        Object ret = (stored == null) ? this.agg.init() : stored;
        for(TridentTuple t: tuples) {
           ret =  this.agg.reduce(ret, t);
        }
        return ret;
    }
}


text:
/* */
module.exports = require('./wrapperValue');


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Shreyas Bhandare</title>

    <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <link href="css/freelancer.min.css" rel="stylesheet">

    <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">

Skip to main content

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation Menu
                </button>
                Shreyas Bhandare

                        Projects

                        Resume

                        About

                        Contact

Hello World!

                        Problem Solver - Developer - Linux Worshiper - Cloud Enthusiast

Projects

                                Malware Analyzer

                                Expense Tracker

                                Cloud for Enterprise Software

                                Web based Stock Forecasting

                                Infrastructure as Code

                                AWS-Wordpress Project

                                Web based Traffic Monitoring

                                K-Means Analysis

                                Bank and Stock Account Management

About

Education

M.S - Rutgers University - GPA-3.75

B.E - V.E.S. Institute of Technology - GPA-3.7

Work Experience

Software Engineer Intern - The Knight Market

Graduate Assistant - Rutgers University

IT Support Specialist - Rutgers Business School

Sr. Engineer - Tata Consulting Engineers ltd

Contact Me

                    <form action="https://formspree.io/bhandare.shreyas@gmail.com" method="POST" novalidate>
                        <input type="text" class="form-control" required data-validation-required-message="Please enter your name." name="_name" placeholder="Enter Name">

                        <input type="email" class="form-control" required data-validation-required-message="Please enter your email." name="_email" placeholder="Enter Email">

                        <input type="tel" class="form-control" required data-validation-required-message="Please enter your phone number." name="_phone" placeholder="Enter Phone">

                        <textarea rows="5" class="form-control" name="_message" placeholder="Message" id="message" required data-validation-required-message="Please enter a message."></textarea>

                        </textarea>

                        <input type="submit" value="Send" class="btn btn-success btn-lg">

                    </form>

Connect With Me!

                                Facebook

                                Twitter

                                Linked In

                                GitHub

                        Copyright © Shreyas Bhandare 2017

Malware Analyzer

Malware Analyzer is a simple Android Application that uses machine learning techniques such as K-Means and Naive Bayes togetherly known as KMNB to statically analyze malicious applications on your phone.

Code:
                                    Malware Analyzer

Topics Related:
                                    Malware Analysis and Reverse Engineering, Machine Learning, Android Development

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Expense Tracker

OCR based Expense Tracker Android Application helps in storing daily expense receipts. OpenCV based image processing will make these receipts more readable for Tess-Two OCR engine. A NLP algorithm, parses recognized text and finds out expenses and stores into database. Polynomial regression will predict your expense for next week based on previous weekly expenses.

Code:
                                    Expense Tracker

Topics Related:
                                    Android Development, Machine Learning

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Cloud for Enterprise Software

Detailed study of Amazon Web Services vs Microsoft Azure for deploying and managing open source enterprise software. The study is focused on a fictional Mid-level company looking to migrate its CRM software to cloud and is trying to compare cloud service providers to fit its needs.

Code:
                                    Cloud For Enterprise

Topics Related:
                                    Cloud, IaaS, AWS, Azure

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Web Based Stock Forecasting

Designed a web based system for showing graphical stock patterns and stock predictions based on Bayesian curve fitting algorithm, Artificial Neural Networks and Support Vector Machine. Data source was Yahoo Finance, back-end data collection scripts were written in Java, Server side scripts were written in PHP and front-end was designed using html, javascript, CSS.

Code:
                                    Cloud For Enterprise

Topics Related:
                                    Software Engineering, Machine Learning

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Infrastructure as Code

Project consisted of creating and maintaining virtual environment for a typical Three-Tier Web application. Database server, Web-servers and loadbalancer were created using provisioning tool - Vagrant and Configured and Automated using Ansible. Simple yml playbooks and shell scripts were written to manage provisioned environment with Ansible. Git was used a version control system.

Code:
                                    IaC

Topics Related:
                                    DevOps, Configuration Management, Scripting, Server Management

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Design of Cloud Environment for WordPress Application

Designed a Highly Available, Fault Tolerant, Scalable Environment for a WordPress Application using Amazon Web Services. Created IAM users and groups for developers and admins, attached access policies to them. Launched an RDS instance and communicated it with the active Webservers(EC2 Instances). Configured a domain name to a custom Loadbalancer and routed Webserver traffic to Loadbalancer using Route 53. Created a Auto-scaling group to fire up multiple instances on EC2 Webserver CPU utilization more than 40%. Also CloudFront distribution with S3 bucket to load cached application from nearest edge location.

Code:
                                    Cloud Environment

Topics Related:
                                    Cloud, Amazon Web Services, Server Management, Load Balancing, Auto Scaling

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Web Based Traffic Monitoring System

Developed an online traffic monitoring system which gives live traffic updates and well as predicted traffic information based on historical traffic data. Created Android application for the same

Code:
                                    Traffic Monitoring System

Topics Related:
                                    Software Engineering, REST APIs, Android Development, Machine Learning

                            <button id="btnSubmit" type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Analysis of K-Means

Analysis of K-Means Clustering algorithm was performed and its performance with K-means++ and K-harmonic means was compared in a standard movie recommendation system.

Code:
                                    K-Means

Topics Related:
                                    Machine Learning, Clustering

                            <button id="btnSubmit" type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Bank and Stock Account Management System

Developed an application for Bank and Stock Account Management System that enables user to create an account, perform banking operations as well as maintaining stock portfolio by buying and selling shares using varying market share values.

Code:
                                    Account Management System

Topics Related:
                                    Data Strcutures and Algorithms, Stock Market,

                            <button id="btnSubmit" type="button" class="btn btn-default" data-dismiss="modal"> Close</button>


text:
import java.util.*;

public class _160IntersectionofTwoLinkedLists {

	static public class ListNode {
		      int val;
		      ListNode next;
		      ListNode(int x) {
		          val = x;
		          next = null;
		      }
		 }

	 public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
	        int len1=get_length(headA);
	        int len2=get_length(headB);
	        while(len1<len2) {headB=headB.next;len2--;}
	        while(len1>len2) {headA=headA.next;len1--;}
	        while(headA!=headB){
	        	headA=headA.next;
	        	headB=headB.next;
	        }
	        return headA;
	    }
	 public int get_length(ListNode head){
		 int len=0;
		 while(head!=null){
			 head=head.next;
			 len++;
		 }
		 return len;
	 }
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		ListNode t1=new ListNode(1);
		ListNode t2=new ListNode(2);
		ListNode t3=new ListNode(3);
		ListNode t4=new ListNode(4);
		ListNode t5=new ListNode(5);
		ListNode t6=new ListNode(6);
		ListNode t7=new ListNode(7);
		ListNode t8=new ListNode(8);
		ListNode t9=new ListNode(9);
		ListNode t10=new ListNode(10);
		t1.next=t3;//t3.next=t4;t4.next=t2;
		t5.next=t2;
		_160IntersectionofTwoLinkedLists A=new _160IntersectionofTwoLinkedLists();

		ListNode result=A.getIntersectionNode(t1, t5);
		if(result!=null)
		System.out.println(result.val);
	}

}

//question:
	//Write a program to find the node at which the intersection of two singly linked lists begins.
	//
	//
	//For example, the following two linked lists:
	//
	//A:          a1 → a2
	//                   ↘
	//                     c1 → c2 → c3
	//                   ↗
	//B:     b1 → b2 → b3
	//begin to intersect at node c1.
	//
	//
	//Notes:
	//
	//If the two linked lists have no intersection at all, return null.
	//The linked lists must retain their original structure after the function returns.
	//You may assume there are no cycles anywhere in the entire linked structure.
	//Your code should preferably run in O(n) time and use only O(1) memory.


text:
This document describes how a developer's workstation can be setup.

### Software Requirements

* Linux or Windows
* Java 7
* Tomcat 6 or 7 or 8
* Maven 3.x

### Getting the code

There are several of ways to get code, e.g. download it as a [zip](https://github.com/petkivim/x-road-test-client/archive/master.zip) file or clone the git repository.

```
git clone https://github.com/petkivim/x-road-test-client.git
```

The code is located in the ```src``` folder.

### Building the code

Test Client uses Maven as the build management tool. In order to build the whole project and generate the war  file (test-client-x.x.x-SNAPSHOT.jar), you must run the maven command below from the ```src``` directory.

```
mvn clean install
```

Running the above maven command generates the war file under the directory presented below:

```
src/target/test-client-x.x.x-SNAPSHOT.jar
```
#### Error on building the code

If running ```mvn clean install``` generates the error presented below, there are two possible solutions.

```
[ERROR] Failed to execute goal on project test-client: Could not resolve dependencies for project com.pkrete.xrd4j.tools:test-client:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at org.niis.xrd4j:common:jar:0.3.0: Failed to read artifact descriptor for org.niis.xrd4j:common:jar:0.3.0: Could not transfer artifact org.niis.xrd4j:common:pom:0.3.0 from/to niis-repo (https://artifactory.niis.org/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
```

##### Solution 1

Skip certificate validation:

```
mvn install -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
```

##### Solution 2

Import NIIS's Maven repository's certificate as a trusted certificate into ```cacerts``` keystore. See full [instructions](Import-a-certificate-as-a-trusted-certificate.md). NIIS's Maven release repository's URL is ```https://artifactory.niis.org/xroad-maven-releases```.

### IDE Setup

The project can be imported into different IDEs, but currently this section covers only Netbeans. However, some modifications are required regardless of the IDE that's being used.

#### Netbeans

Opening the project in Netbeans.

* File -> Open Project -> path of the src folder -> Click Open Project button


text:
import sys
import yaml
import time

from werkzeug.security import generate_password_hash
import rethinkdb as r

from rethinkdb.errors import RqlRuntimeError, RqlDriverError

from runbookdb import RunbookDB

if len(sys.argv) != 2:
    print("Hey, thats not how you launch this...")
    print("%s <config file>") % sys.argv[0]
    sys.exit(1)

# Open Config File and Parse Config Data
configfile = sys.argv[1]

with open(configfile, 'r') as cfh:
    config = yaml.safe_load(cfh)

# Establish Connection
database = config['rethink_db']

db=RunbookDB(configfile)
conn=db.connect()

uid = 'uid_1'

reactiondata = {
    "data": {
        "call_on":  "false" ,
        "extra_headers":  "" ,
        "frequency": 100000 ,
        "http_verb":  "GET" ,
        "name":  "my_reaction" ,
        "payload":  "" ,
        "trigger": 1 ,
        "url": "http://google.com",
        } ,
    "frequency": 100000 ,
    "id":  "rid_1" ,
    "lastrun": 0 ,
    "name":  "my_reaction" ,
    "rtype":  "http" ,
    "trigger": 1 ,
    "uid":  uid
    }

# Add Dummy User
r.db(database).table('reactions').insert([reactiondata]).run(conn)

# Output Data
cursor = r.db(database).table('reactions').run(conn)
for user in cursor:
    print user

# Remove Data
# r.db(database).table('users').delete().run(conn)

# Close Connection
conn.close()

print 'Sample Reaction Added!'


text:
<?php

namespace Touchbase\Data;

defined('TOUCHBASE') or die("Access Denied.");

final class StaticStore
{
	/**
	 *	Static In Memory Store
	 *	@var \Touchbase\Data\StaticStore
	 */
	private static $instance;

	/* Public Methods */

	/**
	 *	Shared
	 *	@return \Touchbase\Data\StaticStore
	 */
	public static function shared(){
		if(!static::$instance){
			static::$instance = new Store();
		}

		return static::$instance;
	}

	/**
	 *	__callStatic
	 *	@param string $name
	 *	@param array $arguments
	 *	@return mixed
	 */
	public static function __callStatic($name, $arguments){
		if(method_exists(static::shared(), $name)){
			return call_user_func_array([static::shared(), $name], $arguments);
		}
	}

	/**
	 * NO-OP
	 */
	final public function __construct(){}
	final protected function __clone(){}
}


text:
import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import deepEqual from 'deep-equal';
import cloneDeep from 'lodash.clonedeep';
import {FormUnit} from './form_unit';
import {find} from '../helpers';
import {Input} from '../inputs';

const isOptional = ({optional}, current) => typeof optional === 'function' ? optional({current}) : optional;
const isPromise = promise => promise && typeof promise.then === 'function';
const newId = () => `pui-form-${Math.round(Math.random() * Number.MAX_SAFE_INTEGER)}`;
const noop = () => undefined;

const newFormState = (fields, ids, cb) => {
  const state = {initial: {}, current: {}, ids, submitting: false, errors: {}};

  for (const name in fields) {
    const props = fields[name];
    if (!props) continue;

    const {initialValue, currentValue} = cb({...props, name});
    state.initial[name] = initialValue;
    state.current[name] = currentValue;
    state.ids[name] = ids[name] || newId();
  }

  return state;
};

const newInitialValue = initialValue =>
  initialValue === null || initialValue === undefined ? '' : initialValue;

export class Form extends React.Component {
  static propTypes = {
    afterSubmit: PropTypes.func,
    fields: PropTypes.object,
    onModified: PropTypes.func,
    onSubmit: PropTypes.func,
    onSubmitError: PropTypes.func,
    resetOnSubmit: PropTypes.bool
  };

  static defaultProps = {
    children: noop,
    fields: {},
    onSubmit: noop,
    onSubmitError: () => ({}),
    afterSubmit: noop
  };

  constructor(props) {
    super(props);
    this.state = newFormState(props.fields, {}, ({initialValue}) => {
      initialValue = newInitialValue(initialValue);
      return {initialValue, currentValue: cloneDeep(initialValue)};
    });
  }

  componentDidMount() {
    require('../../css/forms');
  }

  shouldComponentUpdate({fields}, nextState) {
    const isStateChange = nextState !== this.state;
    const {current, initial} = nextState;
    const {initial: newInitial, ids, current: newCurrent} = newFormState(fields, nextState.ids,
      ({name, initialValue}) => {
        initialValue = newInitialValue(initialValue);
        return {
          initialValue: initialValue,
          currentValue: current.hasOwnProperty(name)
            ? current[name] === this.state.initial[name] ? cloneDeep(initialValue) : current[name]
            : cloneDeep(initialValue)
        };
      });
    nextState.initial = isStateChange ? initial : newInitial;
    nextState.current = newCurrent;
    nextState.ids = ids;
    return true;
  }

  componentWillUnmount() {
    if (this.props.onModified) this.props.onModified(false);
  }

  onChangeCheckbox = (name, cb) => val => {
    const {initial, current} = this.state;
    const value = !this.state.current[name];
    const nextState = {current: {...current, [name]: value}};

    if (typeof val.persist === 'function') val.persist();

    const nextValue = {[name]: value};
    if (cb) this.setValues(nextValue, () => cb(val));
    else this.setValues(nextValue);

    if (this.props.onModified) this.props.onModified(!deepEqual(initial, nextState.current));
  };

  onChange = (name, validator, cb) => val => {
    const {initial} = this.state;
    const value = val.target && 'value' in val.target ? val.target.value : val;
    const nextState = {current: {...this.state.current, [name]: value}};

    const error = validator && validator(value);
    if (!error) {
      nextState.errors = {...this.state.errors};
      delete nextState.errors[name];
    }

    if (typeof val.persist === 'function') val.persist();

    if (cb) this.setState(nextState, () => cb(val));
    else this.setState(nextState);

    if (this.props.onModified) this.props.onModified(!deepEqual(initial, nextState.current));
  };

  onBlur = ({name, validator}) => ({target: {value}}) => {
    const error = validator(value);
    this.setState({errors: {...this.state.errors, [name]: error}});
  };

  canReset = () => !this.state.submitting && !deepEqual(this.state.initial, this.state.current);

  reset = () => {
    const {initial} = this.state;
    if (this.props.onModified) this.props.onModified(false);
    this.setState({current: cloneDeep(initial), errors: {}});
  };

  canSubmit = ({checkRequiredFields} = {}) => {
    const {fields} = this.props;
    const {initial, current, submitting} = this.state;

    const isDiffFromInitial = find(Object.keys(initial), key => !deepEqual(initial[key], current[key]));
    const requiredFields = Object.keys(fields).filter(name => fields[name] && !isOptional(fields[name], current));
    const requiredFieldsHaveValue = requiredFields.every(name => current[name] || current[name] === 0);

    let passesValidators = true;
    for (const name in fields) {
      const props = fields[name];
      if (!props) continue;

      if (props.validator && props.validator(current[name])) {
        passesValidators = false;
        break;
      }
    }

    return !submitting
      && isDiffFromInitial
      && (checkRequiredFields
        ? checkRequiredFields(current)
        : requiredFieldsHaveValue)
      && passesValidators;
  };

  onSubmit = e => {
    e && e.preventDefault();
    const {onSubmit, onSubmitError, afterSubmit, onModified, resetOnSubmit} = this.props;
    const {initial, current} = this.state;
    this.setState({submitting: true});
    const nextState = {submitting: false};

    const onSuccess = response => {
      this.setState({
        ...nextState,
        current: resetOnSubmit ? cloneDeep(initial) : current,
        initial: resetOnSubmit ? initial : cloneDeep(current),
        errors: {}
      });
      const after = () => afterSubmit({state: this.state, response, reset: this.reset});
      const onModifiedPromise = onModified && onModified(false);
      return isPromise(onModifiedPromise) ? onModifiedPromise.then(after) : after();
    };

    const onError = e => {
      this.setState({...nextState, errors: (onSubmitError && onSubmitError(e)) || {}});
    };

    try {
      const afterSubmitPromise = onSubmit({initial, current});
      if (isPromise(afterSubmitPromise)) {
        return afterSubmitPromise.then(onSuccess).catch(onError);
      } else {
        return onSuccess(afterSubmitPromise);
      }
    } catch (e) {
      onError(e);
      throw e;
    }
  };

  setValues = (values, cb) => this.setState({current: {...this.state.current, ...values}}, cb);

  setErrors = (errors, cb) => this.setState({errors: {...this.state.errors, ...errors}}, cb);

  controlField = ({children = <Input type="text"/>, validator, name, ids}) => {
    const {canSubmit, canReset, reset, onSubmit, setErrors, setValues, state, onChange, onBlur, onChangeCheckbox} = this;
    const {submitting} = state;

    const element = typeof children !== 'function'
      ? children
      : children({
        onChange: onChange(name, validator), canSubmit, canReset, reset, onSubmit, submitting, setValues, setErrors, state
      });

    if (!element || React.Children.count(element) !== 1 || !name) return element;

    const props = {name: element.props.name || name};
    props.id = element.props.id || ids[props.name];

    const hasCurrentValue = state.current.hasOwnProperty(name);

    if (element.props.type === 'checkbox') {
      props.checked = !!(hasCurrentValue
        ? (state.current && state.current[name])
        : element.props.checked);
      props.onChange = onChangeCheckbox(name, element.props.onChange);
    } else {
      props.value = hasCurrentValue
        ? (state.current && state.current[name])
        : element.props.value;
      props.onChange = onChange(name, validator, element.props.onChange);
      if (validator) props.onBlur = onBlur({name, validator});
    }

    return React.cloneElement(element, props);
  };

  render() {
    // eslint-disable-next-line no-unused-vars
    const {className, children, fields, onModified, onSubmitError, afterSubmit, resetOnSubmit, ...others} = this.props;
    const {canSubmit, canReset, reset, onSubmit, setValues, setErrors, state, onBlur} = this;
    const {current, submitting, ids} = state;

    const formUnits = {};
    for (const name in fields) {
      const props = fields[name];
      if (!props) continue;

      const error = state.errors[name];
      const children = this.controlField({...props, name, ids});
      const help = error || props.help;
      const labelFor = props.labelFor || children.props.id;
      // eslint-disable-next-line no-unused-vars
      const {className: _, ...rest} = props;

      formUnits[name] = (
        <FormUnit {...{
          ...rest, key: name, optional: isOptional(rest, current), setValues, setErrors, state, name, hasError: !!error,
          help, labelFor, children
        }}/>
      );
    }

    return (
      <form {...{...others, className: classnames('form', className), onSubmit: this.onSubmit}}>
        <fieldset {...{disabled: submitting}}>
          {children({
            fields: formUnits, canSubmit, canReset, reset, onSubmit, setValues, setErrors, state, onBlur, submitting
          })}
        </fieldset>
      </form>
    );
  }
}


text:
package com.davidbracewell.hermes.corpus;

import com.davidbracewell.config.Config;
import com.davidbracewell.function.SerializableFunction;
import com.davidbracewell.hermes.AnnotatableType;
import com.davidbracewell.hermes.Document;
import com.davidbracewell.hermes.DocumentFactory;
import com.davidbracewell.hermes.Hermes;
import com.davidbracewell.io.Resources;
import com.davidbracewell.io.resource.Resource;
import com.davidbracewell.stream.MStream;
import com.davidbracewell.stream.SparkStream;
import com.davidbracewell.stream.SparkStreamingContext;
import com.davidbracewell.stream.StreamingContext;
import lombok.NonNull;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.broadcast.Broadcast;

import java.io.IOException;
import java.io.Serializable;
import java.util.Collection;

/**
 * The type Spark corpus.
 */
public class SparkCorpus implements Corpus, Serializable {
   private static final long serialVersionUID = 1L;
   private final SparkDocumentStream stream;

   /**
    * Instantiates a new Spark corpus.
    *
    * @param corpusLocation  the corpus location
    * @param corpusFormat    the document format
    * @param documentFactory the document factory
    */
   @SuppressWarnings("unchecked")
   public SparkCorpus(@NonNull String corpusLocation, @NonNull CorpusFormat corpusFormat, @NonNull DocumentFactory documentFactory) {
      if (corpusFormat.isOnePerLine() && corpusFormat.extension().toUpperCase().startsWith("JSON")) {
         this.stream = new SparkDocumentStream(StreamingContext.distributed().textFile(corpusLocation));
      } else if (corpusFormat.isOnePerLine()) {
         this.stream = new SparkDocumentStream(StreamingContext.distributed().textFile(corpusLocation).flatMap(
            line -> corpusFormat.create(Resources.fromString(line), documentFactory)
                                .stream()
                                .map(Document::toJson)
                                .javaStream()
                                                                                )
         );
      } else {
         Broadcast<Config> configBroadcast = SparkStreamingContext.INSTANCE.broadcast(Config.getInstance());
         JavaRDD<String> rdd = StreamingContext.distributed().sparkContext()
                                               .wholeTextFiles(corpusLocation)
                                               .values()
                                               .flatMap(str -> {
                                                  Hermes.initializeWorker(configBroadcast.getValue());
                                                  return corpusFormat.create(Resources.fromString(str), documentFactory)
                                                                     .stream()
                                                                     .map(Document::toJson)
                                                                     .iterator();
                                               });
         this.stream = new SparkDocumentStream(new SparkStream<>(rdd));
      }
   }

   @Override
   public void close() throws Exception {
      stream.close();
   }

   @Override
   public CorpusType getCorpusType() {
      return CorpusType.DISTRIBUTED;
   }

   /**
    * Repartition.
    *
    * @param numPartitions the num partitions
    */
   @Override
   public Corpus repartition(int numPartitions) {
      stream.repartition(numPartitions);
      return this;
   }

   /**
    * Instantiates a new Spark corpus.
    *
    * @param documents the documents
    */
   public SparkCorpus(@NonNull Collection<Document> documents) {
      this.stream = new SparkDocumentStream(StreamingContext.distributed().stream(
         documents.stream().map(Document::toJson)
                                                                                ));
   }

   /**
    * Instantiates a new Spark corpus.
    *
    * @param stream the stream
    */
   protected SparkCorpus(SparkDocumentStream stream) {
      this.stream = stream;
   }

   @Override
   public DocumentFactory getDocumentFactory() {
      return DocumentFactory.getInstance();
   }

   @Override
   public MStream<Document> stream() {
      return stream;
   }

   @Override
   public Corpus annotate(@NonNull AnnotatableType... types) {
      return new SparkCorpus(stream.annotate(types));
   }

   @Override
   public Corpus cache() {
      return new SparkCorpus(new SparkDocumentStream(stream.getSource().cache()));
   }

   @Override
   public Corpus sample(int size) {
      return new MStreamCorpus(stream.sample(false, size), getDocumentFactory());
   }

   @Override
   public Corpus write(@NonNull String format, @NonNull Resource resource) throws IOException {
      return write(format, resource.descriptor());
   }

   @Override
   public Corpus write(@NonNull String format, @NonNull String resource) throws IOException {
      CorpusFormat outFormat = CorpusFormats.forName(format);
      if (!outFormat.isOnePerLine()) {
         throw new IllegalArgumentException(format + " must be one per line!");
      }
      if (outFormat.extension().toLowerCase().startsWith("json")) {
         stream.saveAsTextFile(resource);
      } else {
         stream.getSource().map(json -> {
            if (outFormat.name().equals("JSON_OPL")) {
               return json;
            }
            Document document = Document.fromJson(json);
            return outFormat.toString(document);
         }).saveAsTextFile(resource);
      }
      return this;
   }

   @Override
   public boolean isDistributed() {
      return true;
   }

   @Override
   public Corpus map(@NonNull SerializableFunction<Document, Document> function) {
      return new SparkCorpus(new SparkDocumentStream(stream.map(d -> function.apply(d).toJson())));
   }

   @Override
   public StreamingContext getStreamingContext() {
      return stream.getContext();
   }

}//END OF SparkCorpus


text:
<?php

/**
 * Store switcher block
 *
 * @category   Mage
 * @package    Mage_Core
 * @author      Magento Core Team <core@magentocommerce.com>
 */
class Mage_Core_Block_Store_Switcher extends Mage_Core_Block_Template
{
    protected $_groups = array();
    protected $_stores = array();
    protected $_loaded = false;

    public function __construct()
    {
        $this->_loadData();
        $this->setStores(array());
        $this->setLanguages(array());
        return parent::__construct();
    }

    protected function _loadData()
    {
        if ($this->_loaded) {
            return $this;
        }

        $websiteId = Mage::app()->getStore()->getWebsiteId();
        $storeCollection = Mage::getModel('core/store')
            ->getCollection()
            ->addWebsiteFilter($websiteId);
        $groupCollection = Mage::getModel('core/store_group')
            ->getCollection()
            ->addWebsiteFilter($websiteId);
        foreach ($groupCollection as $group) {
            $this->_groups[$group->getId()] = $group;
        }
        foreach ($storeCollection as $store) {
            if (!$store->getIsActive()) {
                continue;
            }
            $store->setLocaleCode(Mage::getStoreConfig('general/locale/code', $store->getId()));
            $this->_stores[$store->getGroupId()][$store->getId()] = $store;
        }

        $this->_loaded = true;

        return $this;
    }

    public function getStoreCount()
    {
        $stores = array();
        $localeCode = Mage::getStoreConfig('general/locale/code');
        foreach ($this->_groups as $group) {
            if (!isset($this->_stores[$group->getId()])) {
                continue;
            }
            $useStore = false;
            foreach ($this->_stores[$group->getId()] as $store) {
                if ($store->getLocaleCode() == $localeCode) {
                    $useStore = true;
                    $stores[] = $store;
                }
            }
            if (!$useStore && isset($this->_stores[$group->getId()][$group->getDefaultStoreId()])) {
                $stores[] = $this->_stores[$group->getId()][$group->getDefaultStoreId()];
            }
        }

        $this->setStores($stores);
        return count($this->getStores());
    }

    public function getLanguageCount()
    {
        $groupId = Mage::app()->getStore()->getGroupId();
        if (!isset($this->_stores[$groupId])) {
            $this->setLanguages(array());
            return 0;
        }
        $this->setLanguages($this->_stores[$groupId]);
        return count($this->getLanguages());
    }

    public function getCurrentStoreId()
    {
        return Mage::app()->getStore()->getId();
    }

    public function getCurrentStoreCode()
    {
        return Mage::app()->getStore()->getCode();
    }
}


text:
describe('Service: inputService', function () {
  'use strict';

  // load the service's module
  beforeEach(module('axis'));

  // instantiate service
  var inputService,
      instanceType;

  beforeEach(inject(function (_inputService_) {
    inputService = _inputService_;
    instanceType = Object.prototype.toString.call(inputService);
  }));

  xit('should do something', function () {
    expect(!!inputService).toBe(true);
  });

});


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

<resources>
    <color name="white">#ffffffff</color>
    <color name="black">#ff000000</color>

    <color name="lighter_gray">#ffe5e5e5</color>
    <color name="light_gray">#ffb0b0b0</color>
    <color name="gray">#ff808080</color>
    <color name="dark_gray">#ff7d7d7d</color>
    <color name="darker_gray">#ff585858</color>

    <color name="green">#ff6cc655</color>
    <color name="red">#ffff0000</color>
    <color name="blue_bright">#ff00ddff</color>

    <color name="normal_text">#ff222222</color>
    <color name="title_text">#ff222222</color>
    <color name="footer_text">@color/gray</color>
    <color name="err_text">@color/red</color>

    <color name="btn_text">@color/white</color>
    <color name="disabled_btn_text">@color/light_gray</color>

    <color name="header_bg">@color/light_gray</color>
    <color name="footer_bg">@color/lighter_gray</color>

    <color name="primary_btn_bg">@color/green</color>
    <color name="btn_bg">@color/dark_gray</color>
    <color name="next_btn_bg">@color/darker_gray</color>
    <color name="confirm_btn_bg">@color/red</color>

    <color name="list_border">#ffdddddd</color>
    <color name="list_bg">@color/white</color>
    <color name="list_highlight">@color/blue_bright</color>
</resources>


text:
bool UnpackIcon(const char* input_path, const char* output_path, bool skip);

#endif  // UNPACKICON_H_


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System.Collections.Generic;
using Microsoft.WindowsAzure.Storage.Table;

namespace Microsoft.Azure.Batch.Blast.Storage
{
    public interface ITableStorageProvider
    {
        void InsertEntity<T>(T entity) where T : TableEntity;

        void InsertEntities<T>(IEnumerable<T> entities) where T : TableEntity;

        void UpdateEntity<T>(T entity) where T : TableEntity;

        void UpsertEntity<T>(T entity) where T : TableEntity;

        void DeleteEntity<T>(T entity) where T : TableEntity;

        T GetEntity<T>(string partitionKey, string rowKey) where T : TableEntity, new();

        IEnumerable<T> ListEntities<T>(string partitionKey = null) where T : TableEntity, new();
    }
}


text:
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateBlogsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('blogs', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title');
            $table->string('slug');
            $table->text('summary');
            $table->text('text');
            $table->string('image');
            $table->dateTime('publication_date');
            $table->tinyInteger('online');
            $table->timestamps();

            $table->unique('slug');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::drop('blogs');
    }
}


text:
(function(win, $)
{
    win.createComponent({
        id: 'current-file-actions',
        init: function()
        {
            var self = this;

            $('#save-current-file').on('click', function()
            {
                self.fire('save-current-file');
            });

            $('#reset-current-file').on('click', function()
            {
                self.fire('reset-current-file');
            });
        }
    });

    win.createEditorComponent({
        id: 'site-pages-list',
        elementSelector: '.site-pages-list',
        fetchURL: '/admin/pages',
        editorWSelector: '#editor-workspace',
        fileNameSelector: '#editor-file-name',
        saveURL: '/admin/save-page/'
    });
})(window, jQuery);


text:
package com.linecorp.armeria.internal.server.annotation;

import static org.assertj.core.api.Assertions.assertThat;

import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;

import org.junit.jupiter.api.Test;

import com.linecorp.armeria.common.HttpRequest;
import com.linecorp.armeria.common.HttpResponse;
import com.linecorp.armeria.common.logging.LogLevel;
import com.linecorp.armeria.internal.server.annotation.DecoratorAnnotationUtil.DecoratorAndOrder;
import com.linecorp.armeria.server.DecoratingHttpServiceFunction;
import com.linecorp.armeria.server.HttpService;
import com.linecorp.armeria.server.ServiceRequestContext;
import com.linecorp.armeria.server.SimpleDecoratingHttpService;
import com.linecorp.armeria.server.annotation.Decorator;
import com.linecorp.armeria.server.annotation.DecoratorFactory;
import com.linecorp.armeria.server.annotation.DecoratorFactoryFunction;
import com.linecorp.armeria.server.annotation.decorator.LoggingDecorator;
import com.linecorp.armeria.server.annotation.decorator.LoggingDecoratorFactoryFunction;
import com.linecorp.armeria.server.annotation.decorator.RateLimitingDecorator;
import com.linecorp.armeria.server.annotation.decorator.RateLimitingDecoratorFactoryFunction;

class DecoratorAnnotationUtilTest {

    @Test
    void ofNoOrdering() throws NoSuchMethodException {
        final List<DecoratorAndOrder> list =
                DecoratorAnnotationUtil.collectDecorators(TestClass.class,
                                                          TestClass.class.getMethod("noOrdering"));
        assertThat(values(list)).containsExactly(Decorator1.class,
                                                 LoggingDecoratorFactoryFunction.class,
                                                 LoggingDecoratorFactoryFunction.class,
                                                 Decorator2.class);
        assertThat(orders(list)).containsExactly(0, 0, 0, 0);

        final LoggingDecorator info = (LoggingDecorator) list.get(1).annotation();
        assertThat(info.requestLogLevel()).isEqualTo(LogLevel.INFO);
        final LoggingDecorator trace = (LoggingDecorator) list.get(2).annotation();
        assertThat(trace.requestLogLevel()).isEqualTo(LogLevel.TRACE);
    }

    @Test
    void ofMethodScopeOrdering() throws NoSuchMethodException {
        final List<DecoratorAndOrder> list =
                DecoratorAnnotationUtil.collectDecorators(TestClass.class,
                                                          TestClass.class.getMethod("methodScopeOrdering"));
        assertThat(values(list)).containsExactly(Decorator1.class,
                                                 LoggingDecoratorFactoryFunction.class,
                                                 RateLimitingDecoratorFactoryFunction.class,
                                                 Decorator1.class,
                                                 LoggingDecoratorFactoryFunction.class,
                                                 Decorator2.class);
        assertThat(orders(list)).containsExactly(0, 0, 0, 1, 2, 3);

        final LoggingDecorator info = (LoggingDecorator) list.get(1).annotation();
        assertThat(info.requestLogLevel()).isEqualTo(LogLevel.INFO);
        final RateLimitingDecorator limit = (RateLimitingDecorator) list.get(2).annotation();
        assertThat(limit.value()).isEqualTo(1);
        final LoggingDecorator trace = (LoggingDecorator) list.get(4).annotation();
        assertThat(trace.requestLogLevel()).isEqualTo(LogLevel.TRACE);
    }

    @Test
    void ofGlobalScopeOrdering() throws NoSuchMethodException {
        final List<DecoratorAndOrder> list =
                DecoratorAnnotationUtil.collectDecorators(TestClass.class,
                                                          TestClass.class.getMethod("globalScopeOrdering"));
        assertThat(values(list)).containsExactly(LoggingDecoratorFactoryFunction.class,
                                                 Decorator1.class,
                                                 LoggingDecoratorFactoryFunction.class,
                                                 Decorator2.class);
        assertThat(orders(list)).containsExactly(-1, 0, 0, 1);

        final LoggingDecorator trace = (LoggingDecorator) list.get(0).annotation();
        assertThat(trace.requestLogLevel()).isEqualTo(LogLevel.TRACE);
        final LoggingDecorator info = (LoggingDecorator) list.get(2).annotation();
        assertThat(info.requestLogLevel()).isEqualTo(LogLevel.INFO);
    }

    @Test
    void ofUserDefinedRepeatableDecorator() throws NoSuchMethodException {
        final List<DecoratorAndOrder> list =
                DecoratorAnnotationUtil.collectDecorators(TestClass.class,
                                                          TestClass.class.getMethod(
                                                                  "userDefinedRepeatableDecorator"));
        assertThat(values(list)).containsExactly(Decorator1.class,
                                                 LoggingDecoratorFactoryFunction.class,
                                                 UserDefinedRepeatableDecoratorFactory.class,
                                                 Decorator2.class,
                                                 UserDefinedRepeatableDecoratorFactory.class);
        assertThat(orders(list)).containsExactly(0, 0, 1, 2, 3);

        final LoggingDecorator info = (LoggingDecorator) list.get(1).annotation();
        assertThat(info.requestLogLevel()).isEqualTo(LogLevel.INFO);
        final UserDefinedRepeatableDecorator udd1 = (UserDefinedRepeatableDecorator) list.get(2).annotation();
        assertThat(udd1.value()).isEqualTo(1);
        final UserDefinedRepeatableDecorator udd2 = (UserDefinedRepeatableDecorator) list.get(4).annotation();
        assertThat(udd2.value()).isEqualTo(2);
    }

    private static List<Class<?>> values(List<DecoratorAndOrder> list) {
        return list.stream()
                   .map(DecoratorAndOrder::annotation)
                   .map(annotation -> {
                       if (annotation instanceof Decorator) {
                           return ((Decorator) annotation).value();
                       }
                       final DecoratorFactory factory =
                               annotation.annotationType().getAnnotation(DecoratorFactory.class);
                       if (factory != null) {
                           return factory.value();
                       }
                       throw new Error("Should not reach here.");
                   })
                   .collect(Collectors.toList());
    }

    private static List<Integer> orders(List<DecoratorAndOrder> list) {
        return list.stream().map(DecoratorAndOrder::order).collect(Collectors.toList());
    }

    static class Decorator1 implements DecoratingHttpServiceFunction {
        @Override
        public HttpResponse serve(HttpService delegate, ServiceRequestContext ctx,
                                  HttpRequest req) throws Exception {
            return delegate.serve(ctx, req);
        }
    }

    static class Decorator2 implements DecoratingHttpServiceFunction {
        @Override
        public HttpResponse serve(HttpService delegate, ServiceRequestContext ctx,
                                  HttpRequest req) throws Exception {
            return delegate.serve(ctx, req);
        }
    }

    @Decorator(Decorator1.class)
    @LoggingDecorator(requestLogLevel = LogLevel.INFO)
    static class TestClass {

        @LoggingDecorator
        @Decorator(Decorator2.class)
        public String noOrdering() {
            return "";
        }

        @RateLimitingDecorator(1)
        @Decorator(value = Decorator1.class, order = 1)
        @LoggingDecorator(order = 2)
        @Decorator(value = Decorator2.class, order = 3)
        public String methodScopeOrdering() {
            return "";
        }

        @Decorator(value = Decorator2.class, order = 1)
        @LoggingDecorator(order = -1)
        public String globalScopeOrdering() {
            return "";
        }

        @UserDefinedRepeatableDecorator(value = 1, order = 1)
        @Decorator(value = Decorator2.class, order = 2)
        @UserDefinedRepeatableDecorator(value = 2, order = 3)
        public String userDefinedRepeatableDecorator() {
            return "";
        }
    }

    @Retention(RetentionPolicy.RUNTIME)
    @Target({ ElementType.TYPE, ElementType.METHOD })
    @interface UserDefinedRepeatableDecorators {
        UserDefinedRepeatableDecorator[] value();
    }

    @DecoratorFactory(UserDefinedRepeatableDecoratorFactory.class)
    @Repeatable(UserDefinedRepeatableDecorators.class)
    @Retention(RetentionPolicy.RUNTIME)
    @Target({ ElementType.TYPE, ElementType.METHOD })
    @interface UserDefinedRepeatableDecorator {

        // To identify the decorator instance.
        int value();

        // For ordering.
        int order() default 0;
    }

    private static class UserDefinedRepeatableDecoratorFactory
            implements DecoratorFactoryFunction<UserDefinedRepeatableDecorator> {
        @Override
        public Function<? super HttpService, ? extends HttpService> newDecorator(
                UserDefinedRepeatableDecorator parameter) {
            return service -> new SimpleDecoratingHttpService(service) {
                @Override
                public HttpResponse serve(ServiceRequestContext ctx, HttpRequest req) throws Exception {
                    return service.serve(ctx, req);
                }
            };
        }
    }
}


text:
from msrest.serialization import Model

class FeatureProperties(Model):
    """Information about feature.

    :param state: The registration state of the feature for the subscription.
    :type state: str
    """

    _attribute_map = {
        'state': {'key': 'state', 'type': 'str'},
    }

    def __init__(self, state=None):
        self.state = state


text:
Ext.define('logbook.controller.utility.EmailTemplateController', {
    extend: 'Ext.app.Controller',
    stores: [
        'EmailTemplateStore'
    ],
    models: [
        'EmailTemplateModel'
    ],
    views: [
        'utility.EmailTemplatePanel',
        'utility.form.EmailTemplateForm'
    ],

    init: function() {
        this.control({
            'emailTemplatePanel button[action=edit]': {
                click: this.edit
            },
            'emailTemplatePanel button[action=save]': {
                click: this.save
            },
            'emailTemplatePanel button[action=cancel]': {
                click: this.cancel
            }
        });
    },

    edit: function() {
        Ext.getCmp('emailTemplateForm').enableDisableForm(true);
        Ext.getCmp('emailTemplatePanel').btnEditOnClick();
    },
    save: function() {
        if (Ext.getCmp('emailTemplateForm').getForm().isValid()) {
            Ext.getCmp('emailTemplateForm').getForm().submit({
                waitMsg : 'Inserting new record ...',
                method  : 'POST',
                url     : '/logbook/ui/json/utility/emailtemplate/save',
                scope   : this,
                success : function(form, action) {
                    this.submitFormResult(form, action);
                },
                failure : function(form, action) {
                    this.submitFormResult(form, action);
                }
            });
        } else {
            Ext.MessageBox.alert('Errors',
                'Kolom bertanda (*) harus diisi !!');
        }
    },
    submitFormResult: function(form, action) {
        if (action.result.success) {
            this.cancel();
            Ext.getCmp('emailTemplateForm').activated_tab_handler();
        } else {
            Ext.Msg.show({
                title:'Error',
                msg: action.result.msg,
                buttons: Ext.Msg.OK,
                icon: Ext.Msg.ERROR
            });
        }
    },
    cancel: function() {
        Ext.getCmp('emailTemplateForm').enableDisableForm(false);
        Ext.getCmp('emailTemplatePanel').btnSaveOnClick();
    }
});


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package modulos.emissor.comunicador.abstractfactory;

/**
 *
 * @author dddf
 */
public class MastercardComunicadorFactory1 implements IComunicadorFactory1 {

    @Override
    public Emissor1 createEmissor() {
        return new Emissor1();
    }

    @Override
    public Receptor1 createReceptor() {
        return new Receptor1();
    }

}


text:
export default function HomeController($scope, Principal, LoginService, $state) {
    "ngInject";
    var vm = this;

    function getAccount() {
        Principal.identity().then(function (account) {
            vm.account = account;
            vm.isAuthenticated = Principal.isAuthenticated;
        });
    }

    function register() {
        $state.go('register');
    }

    vm.account = null;
    vm.isAuthenticated = null;
    vm.login = LoginService.open;
    vm.register = register;
    $scope.$on('authenticationSuccess', function () {
        getAccount();
    });

    getAccount();
};


text:
"""
    DARIAH Contribute - DARIAH-EU Contribute: edit your DARIAH contributions.

    Copyright 2014 Data Archiving and Networked Services

    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.
"""

from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding field 'Country.iso'
        db.add_column(u'dariah_static_data_country', 'iso',
                      self.gf('django.db.models.fields.CharField')(default='', max_length=2),
                      keep_default=False)

    def backwards(self, orm):
        # Deleting field 'Country.iso'
        db.delete_column(u'dariah_static_data_country', 'iso')

    models = {
        u'dariah_static_data.country': {
            'Meta': {'ordering': "['name']", 'object_name': 'Country'},
            'geonameid': ('django.db.models.fields.PositiveIntegerField', [], {}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'iso': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'})
        },
        u'dariah_static_data.tadirahactivity': {
            'Meta': {'object_name': 'TADIRAHActivity'},
            'activity_group_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'activity_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'description': ('django.db.models.fields.TextField', [], {}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'uri': ('django.db.models.fields.URLField', [], {'max_length': '200'})
        },
        u'dariah_static_data.tadirahobject': {
            'Meta': {'object_name': 'TADIRAHObject'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'uri': ('django.db.models.fields.URLField', [], {'max_length': '200'})
        },
        u'dariah_static_data.tadirahtechnique': {
            'Meta': {'object_name': 'TADIRAHTechnique'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'uri': ('django.db.models.fields.URLField', [], {'max_length': '200'})
        },
        u'dariah_static_data.tadirahvcc': {
            'Meta': {'object_name': 'TADIRAHVCC'},
            'description': ('django.db.models.fields.TextField', [], {'max_length': '255'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'uri': ('django.db.models.fields.URLField', [], {'max_length': '200'})
        }
    }

    complete_apps = ['dariah_static_data']


text:
import requests, time
from google import search
from lxml import html

class Pastebinscrape():

    """right now this just google dorks a supplied arg for site:pastebin.com
    need to implement scraping api http://pastebin.com/api_scraping_faq
    that would necessitate a more ongoing program however, not one-off usage of autosint
    scraping url is here http://pastebin.com/api_scraping.php"""
    def run(self, args, lookup, reportDir, apiKeyDir):

        #set a UA
        userAgent = {'User-agent': 'Mozilla/5.0'}

        #defaults and init
        paste_scrape_url = []
        paste_scrape_content = []
        paste_scrape_results =[]
        dorks=args.dorks
        scrape_url = []
        scrape_content = []

        #iterate the lookup list
        for i, l in enumerate(lookup):
            for d in dorks:

                #init textfiles
                scrapedFile=open(reportDir+l+'/'+l+'_pastebin_content.txt','w')
                pasteUrlFile=open(reportDir+l+'/'+l+'_pastebin_urls.txt','w')

                #show user whiat is being searched
                print('[+] Searching Pastebin via Google for public pastes containing {}'.format(l))
                #print('[i] May require a Pastebin Pro account for IP whitelisting')

                #run google query code
                try:
                    #iterate url results from search of dork arg and supplied lookup value against pastebin. return top 20 hits
                    for url in search(str(d) +' '+ str(l) + ' site:pastebin.com', stop=20):
                        #delay 2s to be polite
                        time.sleep(2)
                        #append results together
                        scrape_url.append(url)
                        if args.verbose is True:
                            print('[+] Paste containing "{}" and "{}" found at: {}'.format(d,l,url))
                except Exception as e:
                    print('[-] Error dorking pastebin URLs: {}, skipping...'.format(e))
                    paste_scrape_results.append('Error scraping Pastebin')
                    continue

                #ok, urls matching the dork found. what's in the paste? im certain this could be VASTLY improved
                for u in scrape_url:
                    #http://docs.python-guide.org/en/latest/scenarios/scrape/
                    try:
                        page = requests.get(u, headers=userAgent)
                        pasteUrlFile.writelines(u+'\n')
                        paste_scrape_results.append(u+'\n')
                    except:
                        print ('[-] Error opening ' + u +':')
                        paste_scrape_results.append('Error opening {}'.format(u))
                        continue

                    #build html tree
                    tree = html.fromstring(page.content)

                    #if verbose spit out url, search term and domain searched
                    if args.verbose is True:
                        print ('[+] Looking for instances of {} and {} in {}'.format(d,l,u))
                    #grab raw paste data from the textarea
                    rawPasteData = tree.xpath('//textarea[@class="paste_code"]/text()')

                    #search lines for lookup and keyword
                    for line in rawPasteData:
                        #regex for the lookup value (domain) in that line
                        #if re.search((str(l)), line):
                        if str(l) in line:
                            #if the argument search term is in the line
                            if d in line:
                                #print str(line)
                                scrapedFile.writelines(str(line.encode('utf8')))
                #print paste_scrape_results
                return paste_scrape_results


text:
<?php namespace JetCMS\Models;

use Eloquent;

class Image extends Eloquent {

    public function gallery()
    {
        return $this->belongsTo('App\Gallery');
    }

}


text:
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion

class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='OnDemandReply',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('text', models.TextField()),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='on_demand_replies', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='OnDemandRequest',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated', models.DateTimeField(auto_now=True, db_index=True)),
                ('title', models.TextField(db_index=True)),
                ('description', models.TextField(blank=True)),
                ('keywords_raw', models.TextField(blank=True)),
                ('pricing', models.CharField(choices=[('FREE', 'No reward'), ('FIXED', 'Fixed price'), ('TBD', 'Negotiable')], db_index=True, max_length=8)),
                ('price', models.DecimalField(blank=True, decimal_places=2, default=None, max_digits=8, null=True)),
                ('closed_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='on_demand.OnDemandReply')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='on_demand_requests', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='OnDemandUpvote',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('request', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='upvotes', to='on_demand.OnDemandRequest')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='on_demand_upvotes', to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]


text:
package com.microsoft.azure.cognitiveservices.vision.customvision.training.models;

import java.util.List;
import java.util.UUID;

/**
 * The CreateImagesFromDataOptionalParameter model.
 */
public class CreateImagesFromDataOptionalParameter {
    /**
     * The tags ids with which to tag each image. Limited to 20.
     */
    private List<UUID> tagIds;

    /**
     * Gets or sets the preferred language for the response.
     */
    private String thisclientacceptLanguage;

    /**
     * Get the tagIds value.
     *
     * @return the tagIds value
     */
    public List<UUID> tagIds() {
        return this.tagIds;
    }

    /**
     * Set the tagIds value.
     *
     * @param tagIds the tagIds value to set
     * @return the CreateImagesFromDataOptionalParameter object itself.
     */
    public CreateImagesFromDataOptionalParameter withTagIds(List<UUID> tagIds) {
        this.tagIds = tagIds;
        return this;
    }

    /**
     * Get the thisclientacceptLanguage value.
     *
     * @return the thisclientacceptLanguage value
     */
    public String thisclientacceptLanguage() {
        return this.thisclientacceptLanguage;
    }

    /**
     * Set the thisclientacceptLanguage value.
     *
     * @param thisclientacceptLanguage the thisclientacceptLanguage value to set
     * @return the CreateImagesFromDataOptionalParameter object itself.
     */
    public CreateImagesFromDataOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) {
        this.thisclientacceptLanguage = thisclientacceptLanguage;
        return this;
    }

}


text:
#include <math.h>
#include "shockCapturing.h"

/** \file shockCapturing.c
    \ingroup shockCapturing
    @{
*/
void calculateNumericalDiffusionResGrad(int nElements_global,
                                        int nQuadraturePoints_element,
                                        int nSpace,
                                        double shockCapturingDiffusion,
                                        double* elementDiameter,
                                        double* strong_residual,
                                        double* grad_u,
                                        double* numDiff)
{
  int eN,k,I;
  double h,
    num,
    den,
    n_grad_u[nQuadraturePoints_element],
    n_R_eN,
    maxNumDiff;
  for(eN=0;eN<nElements_global;eN++)
    {
      h = elementDiameter[eN];
      n_R_eN=0.0;
      for (k=0;k<nQuadraturePoints_element;k++)
        {
          n_grad_u[k] = 0.0;
          for (I=0;I<nSpace;I++)
            {
              n_grad_u[k] += grad_u[eN*nQuadraturePoints_element*nSpace+k*nSpace+I]*grad_u[eN*nQuadraturePoints_element*nSpace+k*nSpace+I];
            }
          n_grad_u[k] = sqrt(n_grad_u[k]);
          num = shockCapturingDiffusion*0.5*h*fabs(strong_residual[eN*nQuadraturePoints_element+k]);
          den = n_grad_u[k];
          if (den > num*1.0e-8)
            numDiff[eN*nQuadraturePoints_element+k] = num/den;
          else
            numDiff[eN*nQuadraturePoints_element+k]=0.0;
          n_R_eN=fmax(n_R_eN,fabs(strong_residual[eN*nQuadraturePoints_element+k]));
        }
      maxNumDiff=0.0;
      for (k=0;k<nQuadraturePoints_element;k++)
        {
          num = shockCapturingDiffusion*0.5*h*n_R_eN;
          den = n_grad_u[k];
          if (den > num*1.0e-8)
            numDiff[eN*nQuadraturePoints_element+k] = num/den;
          else
            numDiff[eN*nQuadraturePoints_element+k]=0.0;
          maxNumDiff = fmax(maxNumDiff,numDiff[eN*nQuadraturePoints_element+k]);
        }
      for (k=0;k<nQuadraturePoints_element;k++)
         numDiff[eN*nQuadraturePoints_element+k] = maxNumDiff;
    }
}

void calculateNumericalDiffusionResGradQuad(int nElements_global,
                                            int nQuadraturePoints_element,
                                            int nSpace,
                                            double shockCapturingDiffusion,
                                            double* elementDiameter,
                                            double* strong_residual,
                                            double* grad_u,
                                            double* numDiff)
{
  int eN,k,I;
  double h,
    num,
    den,
    n_grad_u;
  for(eN=0;eN<nElements_global;eN++)
    {
      h = elementDiameter[eN];
      for (k=0;k<nQuadraturePoints_element;k++)
        {
          n_grad_u = 0.0;
          for (I=0;I<nSpace;I++)
            {
              n_grad_u += grad_u[eN*nQuadraturePoints_element*nSpace+k*nSpace+I]*grad_u[eN*nQuadraturePoints_element*nSpace+k*nSpace+I];
            }
          num = shockCapturingDiffusion*0.5*h*fabs(strong_residual[eN*nQuadraturePoints_element+k]);
          den = sqrt(n_grad_u) + 1.0e-8;
          numDiff[eN*nQuadraturePoints_element+k] = num/den;
        }
    }
}

void calculateNumericalDiffusionEikonal(int nElements_global,
					int nQuadraturePoints_element,
					double shockCapturingDiffusion,
					double* elementDiameter,
					double* strong_residual,
					double* numDiff)
{
  int eN,k;
  double h;
  for(eN=0;eN<nElements_global;eN++)
    {
      h = elementDiameter[eN];
      for (k=0;k<nQuadraturePoints_element;k++)
        {
          numDiff[eN*nQuadraturePoints_element+k] = shockCapturingDiffusion*0.5*h*fabs(strong_residual[eN*nQuadraturePoints_element+k]);
	  //printf("%12.5e\n",numDiff[eN*nQuadraturePoints_element+k]);
        }
    }
}

/**
   \brief Calculate the shock capturing diffusion for a Hamilton-Jacobi equation at the quadrature  points
*/
void calculateNumericalDiffusionHJ(int nElements_global,
				   int nQuadraturePoints_element,
				   char shockCapturing,
				   double shockCapturingDiffusion,
				   double* elementDiameter,
				   double* strong_residual,
				   double* mt,
				   double* H,
				   double* numDiff)
{
  int eN,k;
  double h,
    num,
    den,
    n_R_eN;
  //maxNumDiff;
  for(eN=0;eN<nElements_global;eN++)
    {
      h = elementDiameter[eN];
      n_R_eN=0.0;
      for (k=0;k<nQuadraturePoints_element;k++)
        {
          num = shockCapturingDiffusion*0.5*h*fabs(strong_residual[eN*nQuadraturePoints_element+k]);
          den = fabs(H[eN*nQuadraturePoints_element+k]) +
            fabs(mt[eN*nQuadraturePoints_element+k]);
          if (den > num*1.0e-8)
            numDiff[eN*nQuadraturePoints_element+k] = num/den;
          else
            numDiff[eN*nQuadraturePoints_element+k]=0.0;
          n_R_eN=fmax(n_R_eN,fabs(strong_residual[eN*nQuadraturePoints_element+k]));
        }
/*       maxNumDiff=0.0; */
/*       for (k=0;k<nQuadraturePoints_element;k++) */
/*         { */
/*           num = shockCapturingDiffusion*0.5*h*n_R_eN; */
/*           den = fabs(H[eN*nQuadraturePoints_element+k])+ */
/*             fabs(mt[eN*nQuadraturePoints_element+k]); */
/*           if (den > num*1.0e-8) */
/*             numDiff[eN*nQuadraturePoints_element+k] = num/den; */
/*           else */
/*             numDiff[eN*nQuadraturePoints_element+k]=0.0; */
/*           maxNumDiff = fmax(maxNumDiff,numDiff[eN*nQuadraturePoints_element+k]); */
/*         } */
/*       for (k=0;k<nQuadraturePoints_element;k++) */
/*          numDiff[eN*nQuadraturePoints_element+k] = maxNumDiff; */
    }
}

/**
   \brief Calculate the shock capturing diffusion for a Hamilton-Jacobi equation at the quadrature  points
 mwf try this with \f$H(\nabla u)\f$ in denominator
*/
void calculateNumericalDiffusionHJV2(int nElements_global,
				     int nQuadraturePoints_element,
				     char shockCapturing,
				     double shockCapturingDiffusion,
				     double* elementDiameter,
				     double* strong_residual,
				     double* mt,
				     double* H,
				     double* numDiff)
{
  int eN,k;
  double h,num,den=0.0,enorm_h;
  for(eN=0;eN<nElements_global;eN++)
    {
      h = elementDiameter[eN];
      for (k=0;k<nQuadraturePoints_element;k++)
        {
          num = shockCapturingDiffusion*h*fabs(strong_residual[eN*nQuadraturePoints_element+
                                                           k]);
          enorm_h = fabs(H[eN*nQuadraturePoints_element + k]);
          if(shockCapturing == '1')
            {
              den = (fabs(mt[eN*nQuadraturePoints_element+
                             k]) +
                     enorm_h)+num*1.0e-8;
            }
          else if(shockCapturing == '2')
            {
              den = sqrt(mt[eN*nQuadraturePoints_element+
                            k]
                         *
                         mt[eN*nQuadraturePoints_element+
                            k]
                         +
                         enorm_h*enorm_h) + num*1.0e-8;
            }
          numDiff[eN*nQuadraturePoints_element+k] = num/den;
        }
    }
}

void calculateNumericalDiffusion_A_1(int nElements_global,
                                     int nQuadraturePoints_element,
                                     int nSpace,
                                     double shockCapturingFactor,
                                     double* elementDiameter,
                                     double* strong_residual,
                                     double* mt,
                                     double* df,
                                     double* numDiff)
{
  int eN,k,I;
  double h,num,den,enorm_df;
  for(eN=0;eN<nElements_global;eN++)
    {
      h = elementDiameter[eN];
      for (k=0;k<nQuadraturePoints_element;k++)
        {
          num = shockCapturingFactor*h*fabs(strong_residual[eN*nQuadraturePoints_element+
                                                            k]);
          enorm_df = 0.0;
          for(I=0;I<nSpace;I++)
            {
              enorm_df
                +=
                df[eN*nQuadraturePoints_element*nSpace+
                   k*nSpace+
                   I]
                *
                df[eN*nQuadraturePoints_element*nSpace+
                   k*nSpace+
                   I];
            }
          enorm_df = sqrt(enorm_df);
          den = (fabs(mt[eN*nQuadraturePoints_element+
                         k]) +
                 enorm_df);
          numDiff[eN*nQuadraturePoints_element+k] = num/den;
        }
    }
}
/*mwf try Juanes'  formula ...
  D_{sc,g} = C_{sc}h|R|/|u/h| */
void calculateNumericalDiffusionResGradJuanes(int nElements_global,
					      int nQuadraturePoints_element,
					      int nSpace,
					      double shockCapturingDiffusion,
					      double uSC,
					      double* elementDiameter,
					      double* strong_residual,
					      double* grad_u,
					      double* numDiff)
{
  int eN,k;
  double h,
    n_R_eN,
    num,
    den,
    maxNumDiff;
  for(eN=0;eN<nElements_global;eN++)
    {
      h = elementDiameter[eN];
      n_R_eN=0.0;
      for (k=0;k<nQuadraturePoints_element;k++)
	{
          num = shockCapturingDiffusion*0.5*h*fabs(strong_residual[eN*nQuadraturePoints_element+k]);
          den = fabs(uSC)/h;
          if (den > num*1.0e-8)
            numDiff[eN*nQuadraturePoints_element+k] = num/den;
          else
            numDiff[eN*nQuadraturePoints_element+k]=0.0;
          n_R_eN=fmax(n_R_eN,fabs(strong_residual[eN*nQuadraturePoints_element+k]));
        }
      maxNumDiff=0.0;
      for (k=0;k<nQuadraturePoints_element;k++)
        {
          num = shockCapturingDiffusion*0.5*h*n_R_eN;
          den = fabs(uSC)/h;
          if (den > num*1.0e-8)
            numDiff[eN*nQuadraturePoints_element+k] = num/den;
          else
            numDiff[eN*nQuadraturePoints_element+k]=0.0;
          maxNumDiff = fmax(maxNumDiff,numDiff[eN*nQuadraturePoints_element+k]);
        }
      for (k=0;k<nQuadraturePoints_element;k++)
         numDiff[eN*nQuadraturePoints_element+k] = maxNumDiff;
    }
}

/****
     supposed to be nu_i = nu_c h^{2-beta}|R_i|
 ***/

void calculateNumericalDiffusionJaffre(int nElements_global,
				       int nQuadraturePoints_element,
				       int nSpace,
				       double shockCapturingDiffusion,
				       double beta,
				       double* elementDiameter,
				       double* strong_residual,
				       double* grad_u,
				       double* numDiff)
{
  int eN,k,I;
  double h,
    num,
    hfactor,
    n_grad_u[nQuadraturePoints_element],
    n_R_eN,
    maxNumDiff;

  for(eN=0;eN<nElements_global;eN++)
    {
      h = elementDiameter[eN];
      hfactor = pow(h,2.0-beta);
      for (k=0;k<nQuadraturePoints_element;k++)
        {
          num = shockCapturingDiffusion*hfactor*fabs(strong_residual[eN*nQuadraturePoints_element+k]);
	  numDiff[eN*nQuadraturePoints_element+k] = num;
        }

      maxNumDiff=0.0;
      for (k=0;k<nQuadraturePoints_element;k++)
        {
          maxNumDiff = fmax(maxNumDiff,numDiff[eN*nQuadraturePoints_element+k]);
        }
      for (k=0;k<nQuadraturePoints_element;k++)
         numDiff[eN*nQuadraturePoints_element+k] = maxNumDiff;
    }
}

/** @} */


text:
<?php namespace OSjs\Core;

use OSjs\Core\Instance;

/**
 * Storage Class
 *
 * This class is the basis for handling user storage
 *
 * @author Anders Evenrud <andersevenrud@gmail.com>
 * @access protected
 */
abstract class Storage
{
    protected static $INSTANCE;

    /**
     * Create a new instance
     */
    protected function __construct()
    {
    }

    /**
     * Gets user settings
     *
     * @access public
     * @param  \OSjs\Core\Request $request The HTTP request
     * @throws \Exception On failure
     * @return array Settings tree
     */
    public function getSettings(Request $request)
    {
        return [];
    }

    /**
     * Sets user settings
     *
     * @access public
     * @param  \OSjs\Core\Request $request The HTTP request
     * @throws \Exception On failure
     * @return boolean
     */
    public function setSettings(Request $request)
    {
        return true;
    }

    /**
     * Gets module configuration
     *
     * @access public
     * @return object
     */
    final public function getConfig()
    {
        $name = strtolower(str_replace('OSjs\\Modules\\Storage\\', '', get_class($this)));
        return Instance::getConfig()->modules->auth->$name;
    }

    /**
     * Get (or create) a new instance of the Storage
     *
     * @access public
     * @return \OSjs\Core\Storage But with a top-class instance
     */
    public static function getInstance()
    {
        if (!self::$INSTANCE) {
            $name = Instance::GetConfig()->storage;
            $name = 'OSjs\\Modules\\Storage\\' . ucfirst($name);
            self::$INSTANCE = new $name();
        }
        return self::$INSTANCE;
    }
}


text:
package com.wix.mysql.distribution.fileset;

import com.wix.mysql.distribution.Version;
import de.flapdoodle.embed.process.config.store.FileSet;
import de.flapdoodle.embed.process.distribution.Platform;

import java.util.Objects;

import static de.flapdoodle.embed.process.config.store.FileType.Executable;
import static de.flapdoodle.embed.process.config.store.FileType.Library;

public class Win57FileSetEmitter implements FileSetEmitter {
    @Override
    public boolean matches(Platform platform, Version version) {
        return !platform.isUnixLike() &&
                Objects.equals(version.getMajorVersion(), "5.7") &&
                version.getMinorVersion() <= 17;
    }

    @Override
    public FileSet emit() {
        return FileSet.builder()
                .addEntry(Executable, "bin/mysqld.exe")
                .addEntry(Library, "bin/msvcp120.dll")
                .addEntry(Library, "bin/msvcr120.dll")
                .addEntry(Library, "bin/mysql.exe")
                .addEntry(Library, "bin/mysqladmin.exe")
                .addEntry(Library, "share/english/errmsg.sys")
                .addEntry(Library, "share/fill_help_tables.sql")
                .addEntry(Library, "share/mysql_security_commands.sql")
                .addEntry(Library, "share/mysql_sys_schema.sql")
                .addEntry(Library, "share/mysql_system_tables.sql")
                .addEntry(Library, "share/mysql_system_tables_data.sql")
                .build();
    }
}


text:
//
//  MJHCategoriesHeader.h
//  YDHealthy
//
//  Created by chni on 16/8/8.
//  Copyright © 2016年 孟家豪. All rights reserved.
//

#ifndef MJHCategoriesHeader_h
#define MJHCategoriesHeader_h

#import "NSArray+MJHArray.h"
#import "NSData+MJHData.h"
#import "NSDate+MJHDate.h"
#import "NSDictionary+MJHDictionary.h"
#import "NSString+MJHEncryption.h"
#import "NSString+MJHHelper.h"
#import "UIColor+MJHColor.h"
#import "NSString+MJHRestfulRequestUtil.h"
#import "NSString+MJHManipulation.h"

#import "UIButton+MJHButton.h"
#import "SVProgressHUD+MJHSVProgressHUDUtil.h"
#import "MJHAFNetworking.h"

#endif /* MJHCategoriesHeader_h */


text:
SHELL := /bin/bash

all: src/gravi_utils.c

	gcc -std=gnu9x -pedantic -Wall -Wextra src/gravi_utils.c -o gravi_utils

install:
	cp gravi_utils /usr/local/bin

docs:
	doxygen src/gravi_utils.c

uninstall:
	rm /usr/local/bin/gravi_utils