text:
/*-------------------------------------
Author: Spectral Insights Cloud Team
Date Created: 2/2/17 10:47
Last Modified: 7/2/17 10:05
Comments: file for scrollbar CSS.
------------------------------------*/
::-webkit-scrollbar {
  width: 10px;
  height:10px;
}
::-webkit-scrollbar-button:start:decrement,
::-webkit-scrollbar-button:end:increment {
  height: 15px;
  width: 15px;
  display: none;
  background-color: #FFFFAA;
  background-repeat: no-repeat;
}
::-webkit-scrollbar-track-piece{
	background:rgba(255,255,255,0.5);
	-webkit-border-radius:7px;
	-moz-border-radius:7px;
	border-radius:7px;
	-webkit-transition: all 0.2s ease;
	-moz-transition: all 0.2s ease;
	-o-transition: all 0.2s ease;
	transition: all 0.2s ease;
}
::-webkit-scrollbar-thumb:vertical{
  background-color:#666666;
  border:0;
  -webkit-border-radius:7px;
  -moz-border-radius:7px;
  border-radius:7px;
  -webkit-transition:all 0.2s ease;
	-moz-transition:all 0.2s ease;
	-o-transition:all 0.2s ease;
	transition: all 0.2s ease;
}
::-webkit-scrollbar-thumb:vertical:hover{
	background-color:#444444;
}
::-webkit-scrollbar-thumb:horizontal{
  background-color:#666666;
  border:0;
  -webkit-border-radius:7px;
  -moz-border-radius:7px;
  border-radius:7px;
  -webkit-transition:all 0.2s ease;
	-moz-transition:all 0.2s ease;
	-o-transition:all 0.2s ease;
	transition: all 0.2s ease;
 }
 ::-webkit-scrollbar-thumb:horizontal:hover{
	background-color:#444444;
 }

redpajama_set_name: RedPajamaGithub


text:
jQuery Upload File plugin provides Multiple file Uploads with progress bar.Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.

---

#Demo
http://hayageek.com/docs/jquery-upload-file.php

---

#Supported Browsers
IE 8.0,IE 9.0,IE 10.0,Firefox,Safari,Opera,Chrome

Drag drop is supported in IE10,Firefox,Safari,Opera,Chrome

##API

###uploadFile( options )
 Creates Ajax form and uploads the files to server.

 ````javascript
var uploadObj = $("#uploadDivId").uploadFile(options);
````

###startUpload()
 uploads all the selected files. This function is used when autoSubmit option is set to false.
````javascript
uploadObj.startUpload();

````

###stopUpload()
Aborts all the uploads
````javascript
uploadObj.stopUpload();
````
###cancelAll()
Cancel all the selected files ( when autoSubmit:false)
````javascript
uploadObj.cancelAll();
````

#getResponses()
Responses from the server are collected  and returned.
````javascript
uploadObj.getResponses()
````

---

##Options

###url
Server URL which handles File uploads

###method
Upload Form method type  POST or GET. Default is POST

###enctype
Upload Form enctype. Default is multipart/form-data.

###formData
An object that should be send with file upload.
````javascript
formData: { key1: 'value1', key2: 'value2' }
````

###dynamicFormData
To provide form data dynamically
````javascript
dynamicFormData: function()
{
    //var data ="XYZ=1&ABCD=2";
    var data ={"XYZ":1,"ABCD":2};
	return data;
}
````

###maxFileSize
Allowed Maximum file Size in bytes.

###maxFileCount
Allowed Maximum number of files to be uploaded

###returnType
Expected data type of the response. One of: null, 'xml', 'script', or 'json'. The dataType option provides a means for specifying how the server response should be handled. This maps directly to jQuery's dataType method. The following values are supported:

* 'xml': server response is treated as XML and the 'success' callback method, if specified, will be passed the responseXML value
* 'json': server response will be evaluted and passed to the 'success' callback, if specified
* 'script': server response is evaluated in the global context

###allowedTypes
List of comma separated file extensions: Default is "*". Example: "jpg,png,gif"

###acceptFiles
accept MIME type for file browse dialog. Default is "*". Example: "image/*"
check this for full list : http://stackoverflow.com/questions/11832930/html-input-file-accept-attribute-file-type-csv

###fileName
Name of the file input field. Default is file

###multiple
If it is set to true, multiple file selection is allowed. Default isfalse

###dragDrop
Drag drop is enabled if it is set to <cod>true

###autoSubmit
If it is set to true, files are uploaded automatically. Otherwise you need to call .startUpload function. Default istrue

###showCancel
If it is set to false, Cancel button is hidden when autoSubmit is false. Default istrue

###showAbort
If it is set to false, Abort button is hidden when the upload is in progress. Default istrue

###showDone
If it is set to false, Done button is hidden when the upload is completed. Default istrue

###showDelete
If it is set to true, Delete button is shown when the upload is completed. Default isfalse,You need to
implement deleteCallback() function.

###showDownload
If it is set to true, Download button is shown when the upload is completed. Default isfalse,You need to
implement downloadCallback() function.

###showStatusAfterSuccess
If it is set to false, status box will be hidden after the upload is done. Default istrue

###showError
If it is set to false, Errors are not shown to user. Default istrue

###showFileCounter
If it is set to true, File counter is shown with name. Default istrue
File Counter style can be changed using fileCounterStyle. Default is ).

###showProgress
If it is set to true, Progress precent is shown to user. Default isfalse

###showPreview
If it is set to true, preview is shown to images. Default isfalse

###previewHeight
is used to set preview height. Default is : "auto"

###previewWidth
is used to set preview width. Default :"100%"

###showQueueDiv
Using this you can place the progressbar wherever you want.
````javascript
showQueueDiv: "output"
````
progress bar is added to a div with id output

###statusBarWidth
Using this you can set status bar width

###dragdropWidth
Using this you can set drag and drop div width

###update
update plugin options runtime.
````javascript
uploadObj.update({autoSubmit:true,maxFileCount:3,showDownload:false});
````

###onLoad
callback back to be invoked when the plugin is initialized. This can be used to show existing files..
````javascript
    onLoad:function(obj)
    {
    	$.ajax({
	    	cache: false,
		    url: "load.php",
	    	dataType: "json",
		    success: function(data)
		    {
			    for(var i=0;i<data.length;i++)
    	    	{
        			obj.createProgress(data[i]);
        		}
	        }
		});
   },

````

###onSelect
callback back to be invoked when the file selected.
````javascript
onSelect:function(files)
{
	files[0].name;
	files[0].size;
	return true; //to allow file submission.
}
````
###onSubmit
callback back to be invoked before the file upload.
````javascript
onSubmit:function(files)
{
	//files : List of files to be uploaded
	//return flase;   to stop upload
}
````

###onSuccess
callback to be invoked when the upload is successful.
````javascript
onSuccess:function(files,data,xhr,pd)
{
	//files: list of files
	//data: response from server
	//xhr : jquer xhr object
}
````
###afterUploadAll
callback to be invoked when all the files are uploaded.
````javascript
afterUploadAll:function(obj)
{
	//You can get data of the plugin using obj
}
````

###onError
callback  to be invoked when the upload is failed.
````javascript
onError: function(files,status,errMsg,pd)
{
	//files: list of files
	//status: error status
	//errMsg: error message
}
````
###onCancel
callback  to be invoked when user cancel the file ( when autosubmit:false)
````javascript
onCancel: function(files,pd)
{
	//files: list of files
	//pd:  progress div
}
````
###deleteCallback
callback  to be invoked when the user clicks on Delete button.
````javascript
deleteCallback: function(data,pd)
{
	for(var i=0;i<data.length;i++)
	{
	 	$.post("delete.php",{op:"delete",name:data[i]},
	    function(resp, textStatus, jqXHR)
	    {
			//Show Message
			alert("File Deleted");
	    });
	 }
	pd.statusbar.hide(); //You choice to hide/not.

}
````

###downloadCallback
callback  to be invoked when the user clicks on Download button.
````javascript
downloadCallback:function(files,pd)
{
	location.href="download.php?filename="+files[0];
}
````

---
#Custom Errors
you can send custom errors from server. like "File exists".
for custom errors,expected json object from server is:
````javascript

{"jquery-upload-file-error":"File already exists"}

````


text:
/*
 * Central Authentication Service (CAS) support library
 */
var CASClient = require('cas.js');

var log = require('./log');

var cas = {}

cas.create = function (options) {
  cas.client = new CASClient(options);
  return cas.client;
};

cas.validate = function (ticket, cb) {
  if (!cas.client) {
    return log.error('CAS client not created: try calling create()');
  }
  return cas.client.validate(ticket, cb);
};

module.exports = cas;


text:
package com.datawizards.dqm.configuration.loader

import com.datawizards.dqm.configuration.DataQualityMonitoringConfiguration

class StaticConfigurationLoader(rules: DataQualityMonitoringConfiguration) extends ConfigurationLoader {
  override def loadConfiguration(): DataQualityMonitoringConfiguration = rules
}


text:
using System;
using System.Threading;

// This test makes sure that CompareExchange<T> works
// where T is string
public class InterlockedCompareExchange1
{
    private const int c_NUM_LOOPS = 100;
    private const int c_MIN_STRING_LEN = 64;
    private const int c_MAX_STRING_LEN = 1024;

    public static int Main()
    {
        InterlockedCompareExchange1 test = new InterlockedCompareExchange1();

        TestLibrary.TestFramework.BeginTestCase("InterlockedCompareExchange1");

        if (test.RunTests())
        {
            TestLibrary.TestFramework.EndTestCase();
            TestLibrary.TestFramework.LogInformation("PASS");
            return 100;
        }
        else
        {
            TestLibrary.TestFramework.EndTestCase();
            TestLibrary.TestFramework.LogInformation("FAIL");
            return 0;
        }
    }

    public bool RunTests()
    {
        bool retVal = true;

        TestLibrary.TestFramework.LogInformation("[Positive]");
        retVal = PosTest1<string>() && retVal;
        retVal = PosTest2<string>() && retVal;

        return retVal;
    }

    // CompareExchange of equal strings as T
    public bool PosTest1<T>() where T : class
    {
        bool retVal = true;
        T   location;
        T   value;
        T   comparand;
        T   oldLocation;

        TestLibrary.TestFramework.BeginScenario("PosTest1: T Interlocked.CompareExchange(T&,T,T) (T=" + typeof(T) + ") where comparand is equal");

        try
        {
            for (int i=0; i<c_NUM_LOOPS; i++)
            {
                value       = (T)(object)TestLibrary.Generator.GetString(false, c_MIN_STRING_LEN, c_MAX_STRING_LEN);
                location    = (T)(object)TestLibrary.Generator.GetString(-55, false, c_MIN_STRING_LEN, c_MAX_STRING_LEN);
                comparand   = location;

                // location=comparand, so location should be replaced by value and
                // oldLocation should equal comparand
                oldLocation = Interlocked.CompareExchange<T>(ref location, value, comparand);

                if (!location.Equals(value))
                {
                    TestLibrary.TestFramework.LogError("001", "Interlocked.CompareExchange() did not do the exchange correctly: Expected(" + value + ") Actual(" + location + ")");
                    retVal = false;
                }

                if (!oldLocation.Equals(comparand))
                {
                    TestLibrary.TestFramework.LogError("002", "Interlocked.CompareExchange() did not return the expected value: Expected(" + comparand + ") Actual(" + oldLocation + ")");
                    retVal = false;
                }
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("003", "Unexpected exception: " + e);
            retVal = false;
        }

        return retVal;
    }

    // CompareExchange of unequal strings as T
    public bool PosTest2<T>() where T : class
    {
        bool retVal = true;
        T   location;
        T   value;
        T   comparand;
        T   oldLocation;

        TestLibrary.TestFramework.BeginScenario("PosTest2: T Interlocked.CompareExchange(T&,T,T) (T=" + typeof(T) + ") where comparand are not equal");

        try
        {
            for (int i=0; i<c_NUM_LOOPS; i++)
            {
                value       = (T)(object)TestLibrary.Generator.GetString(-55, false, c_MIN_STRING_LEN, c_MAX_STRING_LEN);
                location    = (T)(object)TestLibrary.Generator.GetString(-55, false, c_MIN_STRING_LEN, c_MAX_STRING_LEN);
                comparand   = value;
                while(comparand.Equals(location))
                {
                    comparand = (T)(object)TestLibrary.Generator.GetString(-55, false, c_MIN_STRING_LEN, c_MAX_STRING_LEN);
                }

                // location!=comparand, so no swap should take place.
                // location should not be replaced by value
                // oldLocation should not equal comparand
                oldLocation = Interlocked.CompareExchange<T>(ref location, value, comparand);

                if (location.Equals(value))
                {
                    TestLibrary.TestFramework.LogError("004", "Interlocked.CompareExchange() did not do the exchange correctly: Expected(" + value + ") Actual(" + location + ")");
                    retVal = false;
                }

                if (oldLocation.Equals(comparand))
                {
                    TestLibrary.TestFramework.LogError("005", "Interlocked.CompareExchange() did not return the expected value: Expected(" + comparand + ") Actual(" + oldLocation + ")");
                    retVal = false;
                }
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("006", "Unexpected exception: " + e);
            retVal = false;
        }

        return retVal;
    }

}


text:
(function () {
        // Detects devices
        if (isMobile.apple.device || isMobile.android.device || isMobile.seven_inch || isMobile.windows.device || isMobile.amazon.device) {
                console.log('Client is mobile. Not loading particles.');
        }else{
                console.log('Client is desktop. Loading particles.');
                document.writeln("<script type='text/javascript' src='https://hyperdefined.wtf/assets/js/particles.js'></script>");
                document.writeln("<script type='text/javascript' src='https://hyperdefined.wtf/assets/js/app.js'></script>");
                }
        })();


text:
FormliciousUtils = {

  _count: 0,

  getCount: function() {
    return this._count++;
  },

  formatFilename: function(filename, containerWidth) {
    var width = containerWidth / 10;
    if (filename.length <= width) {
      return filename;
    }

    filename = filename.substring(0, width);
    return filename + '...';
  },

  getApi: function() {
    var tmpl = Template.instance();
    var view = tmpl.view;
    var api;
    while (!api && view) {
      if (view.name === 'Template.formlicious') {
        api = view.formlicious._api;
      } else {
        view = view.parentView;
      }
    }
    if (!api) {
      debugger;
    }
    return api;
  }

};

DropzoneUtils = {
  uploadFiles: function(files) {
    var self = this;
    var minSteps = 6;
    var maxSteps = 60;
    var timeBetweenSteps = 100;
    var bytesPerStep = 100000;
    var totalSteps;

    for (var i = 0; i < files.length; i++) {

      var file = files[i];
      totalSteps = Math.round(Math.min(maxSteps, Math.max(minSteps, file.size / bytesPerStep)));

      for (var step = 0; step < totalSteps; step++) {
        var duration = timeBetweenSteps * (step + 1);
        setTimeout(function (file, totalSteps, step) {
          return function () {
            file.upload = {
              progress: 100 * (step + 1) / totalSteps,
              total: file.size,
              bytesSent: (step + 1) * file.size / totalSteps
            };

            self.emit('uploadprogress', file, file.upload.progress, file.upload.bytesSent);
            if (file.upload.progress == 100) {
              file.status = Dropzone.SUCCESS;
              self.emit("success", file, 'success', null);
              self.emit("complete", file);
              self.processQueue();
            }
          };
        }(file, totalSteps, step), duration);
      }
    }
  }
};


text:
package au.com.codeka.warworlds.game.starfield;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;

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

import au.com.codeka.common.Pair;
import au.com.codeka.warworlds.eventbus.EventHandler;
import au.com.codeka.warworlds.game.UniverseElementSurfaceView;
import au.com.codeka.warworlds.model.Sector;
import au.com.codeka.warworlds.model.SectorManager;

/**
 * This is the base class for StarfieldSurfaceView and TacticalMapView, it contains the common code
 * for scrolling through sectors of stars, etc.
 */
public class SectorView extends UniverseElementSurfaceView {
  protected boolean scrollToCentre = false;

  protected int sectorRadius = 1;
  protected long sectorX;
  protected long sectorY;
  protected float offsetX;
  protected float offsetY;

  public SectorView(Context context, AttributeSet attrs) {
    super(context, attrs);
    if (this.isInEditMode()) {
      return;
    }

    sectorX = sectorY = 0;
    offsetX = offsetY = 0;
  }

  @Override
  protected void onAttachedToWindow() {
    super.onAttachedToWindow();
    SectorManager.eventBus.register(eventHandler);
  }

  @Override
  protected void onDetachedFromWindow() {
    super.onDetachedFromWindow();
    SectorManager.eventBus.unregister(eventHandler);
  }

  private final Object eventHandler = new Object() {
    @EventHandler
    public void onSectorUpdated(Sector sector) {
      redraw();
    }

    @EventHandler
    public void onSectorListUpdated(SectorManager.SectorListChangedEvent event) {
      redraw();
    }
  };

  /**
   * Scroll to the given sector (x,y) and offset into the sector.
   */
  public void scrollTo(long sectorX, long sectorY, float offsetX, float offsetY) {
    scrollTo(sectorX, sectorY, offsetX, offsetY, false);
  }

  /**
   * Scroll to the given sector (x,y) and offset into the sector.
   */
  public void scrollTo(long sectorX, long sectorY, float offsetX, float offsetY, boolean centre) {
    this.sectorX = sectorX;
    this.sectorY = sectorY;
    this.offsetX = -offsetX;
    this.offsetY = -offsetY;

    if (centre) {
      scrollToCentre = true;
    }

    List<Pair<Long, Long>> missingSectors = new ArrayList<>();

    for (sectorY = this.sectorY - sectorRadius; sectorY <= this.sectorY + sectorRadius; sectorY++) {
      for (sectorX = this.sectorX - sectorRadius; sectorX <= this.sectorX + sectorRadius; sectorX++) {
        Pair<Long, Long> key = new Pair<>(sectorX, sectorY);
        Sector s = SectorManager.i.getSector(sectorX, sectorY);
        if (s == null) {
          missingSectors.add(key);
        }
      }
    }

    if (!missingSectors.isEmpty()) {
      SectorManager.i.refreshSectors(missingSectors, false);
    }

    redraw();
  }

  /**
   * Scrolls the view by a relative amount.
   *
   * @param distanceX Number of pixels in the X direction to scroll.
   * @param distanceY Number of pixels in the Y direction to scroll.
   */
  public void scroll(float distanceX, float distanceY) {
    offsetX += distanceX;
    offsetY += distanceY;

    boolean needUpdate = false;
    while (offsetX < -(Sector.SECTOR_SIZE / 2)) {
      offsetX += Sector.SECTOR_SIZE;
      sectorX++;
      needUpdate = true;
    }
    while (offsetX > (Sector.SECTOR_SIZE / 2)) {
      offsetX -= Sector.SECTOR_SIZE;
      sectorX--;
      needUpdate = true;
    }
    while (offsetY < -(Sector.SECTOR_SIZE / 2)) {
      offsetY += Sector.SECTOR_SIZE;
      sectorY++;
      needUpdate = true;
    }
    while (offsetY > (Sector.SECTOR_SIZE / 2)) {
      offsetY -= Sector.SECTOR_SIZE;
      sectorY--;
      needUpdate = true;
    }

    if (needUpdate) {
      scrollTo(sectorX, sectorY, -offsetX, -offsetY);
    }
  }

  @Override
  public void onDraw(Canvas canvas) {
    if (isInEditMode()) {
      return;
    }
    super.onDraw(canvas);

    if (scrollToCentre) {
      scroll(getWidth() / 2.0f / getPixelScale(), getHeight() / 2.0f / getPixelScale());
      scrollToCentre = false;
    }
  }
}


text:
<?php

declare(strict_types=1);

/*
 * This file is part of the RollerworksDatagrid package.
 *
 * (c) Sebastiaan Stok <s.stok@rollerscapes.net>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Rollerworks\Component\Datagrid\Tests\Fixtures;

class EventManagerMock
{
    protected $listeners;

    public function __construct($listeners)
    {
        $this->listeners = $listeners;
    }

    public function getListeners()
    {
        return [$this->listeners];
    }
}


text:
package com.aspose.pdf.examples.AsposePdfExamples.TaggedPDFs;

import com.aspose.pdf.Document;
import com.aspose.pdf.examples.AsposePdfExamples.Utilities.Utils;
import com.aspose.pdf.tagged.ITaggedContent;
import com.aspose.pdf.tagged.logicalstructure.elements.bls.ParagraphElement;
import com.aspose.pdf.tagged.logicalstructure.elements.grouping.SectElement;
import com.aspose.pdf.tagged.logicalstructure.elements.ils.SpanElement;

public class CustomTagName {
    public static void main(String[] args) {
        // ExStart:CustomTagName
        // The path to the documents directory.
        String path = Utils.getDataDir() + "TaggedPDFs\\";
        // Create Pdf Document
        Document document = new Document();

        // Get Content for work with TaggedPdf
        ITaggedContent taggedContent = document.getTaggedContent();

        // Set Title and Language for Documnet
        taggedContent.setTitle("Tagged Pdf Document");
        taggedContent.setLanguage("en-US");

        // Create Logical Structure Elements
        SectElement sect = taggedContent.createSectElement();
        taggedContent.getRootElement().appendChild(sect);

        ParagraphElement p1 = taggedContent.createParagraphElement();
        ParagraphElement p2 = taggedContent.createParagraphElement();
        ParagraphElement p3 = taggedContent.createParagraphElement();
        ParagraphElement p4 = taggedContent.createParagraphElement();

        p1.setText("P1. ");
        p2.setText("P2. ");
        p3.setText("P3. ");
        p4.setText("P4. ");

        p1.setTag("P1");
        p2.setTag("Para");
        p3.setTag("Para");
        p4.setTag("Paragraph");

        sect.appendChild(p1);
        sect.appendChild(p2);
        sect.appendChild(p3);
        sect.appendChild(p4);

        SpanElement span1 = taggedContent.createSpanElement();
        SpanElement span2 = taggedContent.createSpanElement();
        SpanElement span3 = taggedContent.createSpanElement();
        SpanElement span4 = taggedContent.createSpanElement();

        span1.setText("Span 1.");
        span2.setText("Span 2.");
        span3.setText("Span 3.");
        span4.setText("Span 4.");

        span1.setTag("SPAN");
        span2.setTag("Sp");
        span3.setTag("Sp");
        span4.setTag("TheSpan");

        p1.appendChild(span1);
        p2.appendChild(span2);
        p3.appendChild(span3);
        p4.appendChild(span4);

        // Save Tagged Pdf Document
        document.save(path + "CustomTag.pdf");
        // ExEnd:CustomTagName
    }
}


text:
<resources>
    <string name="app_name">Functions</string>
    <string name="action_settings">Settings</string>
    <string name="title_activity_splash">SplashActivity</string>
    <string name="app_title">Functions</string>
    <string name="main_activite_title">DEFINE THE DATA</string>
    <string name="main_activite_operation">OPERATION</string>
    <string name="main_activite_1_operation">SECOND</string>
    <string name="title_activity_graph">Functions</string>
    <string name="title_activity_main2">Main2Activity</string>
    <string name="First_operation_activity_main">First Operation</string>
    <string name="Second_operation_activity_main">Second Operation</string>
    <string name="Rule_title">RULE</string>
    <string name="First_Rule">X >= </string>
    <string name="First_Rule_hint">Enter a number</string>
    <string name="Second_Rule">X >= </string>
    <string name="Second_Rule_hint">Enter a number</string>
    <string name="third_equation">Third Equation</string>
    <string name="third_Rule">X >= </string>
    <string name="third_Rule_hint">Enter a number</string>
    <string name="Limit">Limit</string>
    <string name="equation_1">Equation 1</string>
    <string name="equation_2">Equation 2</string>
    <string name="equation_3">Equation 3</string>
    <string name="title_activity_navigation">Menu</string>

    <string name="navigation_drawer_open">Open navigation drawer</string>
    <string name="navigation_drawer_close">Close navigation drawer</string>
    <string name="card_title">Opciones de operaciones</string>
    <string name="card_title_card_eqn">Graficar Ecuaciones</string>

    <string name="card_title_card_tri">Trigonometria</string>
    <string name="card_title_card_tri_title">Elija que desea operar</string>
    <string name="card_title_card_tri_triang">Encontrar la hipotenusa de un triaungulo</string>
    <string name="card_title_card_tri_triang_cat">Encontrar un cateto de un triaungulo</string>
    <string name="card_title_card_tri_btn">Encontrar</string>

    <string name="card_title_card_hip_title">Encontrar Hipotenusa</string>
    <string name="card_title_card_hip_cat1">Cateto</string>
    <string name="card_title_card_hip_hip">"?"</string>
    <string name="title_activity_hip">Hipotenusa</string>
    <string name="title_activity_cat">Cateto</string>

    <string name="card_title_card_cat_title">Encontrar Cateto</string>
    <string name="card_title_card_cat_hip">Hipotenusa</string>
    <string name="card_title_card_trig">Senos, Cosenos, Tangente</string>
    <string name="title_activity_sen_cos_tan">SenCosTanActivity</string>
    <string name="title_activity_ley_sen_cos_tan">Ley de Senos, Cosenos y Tangente</string>
    <string name="angle">Angulo</string>
    <string name="cat">Lado</string>
    <string name="resp">Respuesta</string>
    <string name="title_activity_trigonometry2">Opciones</string>
</resources>


text:
<?php namespace SOSTheBlack\Moip\Commands;

use Moip;
use Illuminate\Console\Command;

class MoipBilletCommand extends Command {

	/**
	 * The console command name.
	 *
	 * @var string
	 */
	protected $name = 'moip:billet';

	/**
	 * The console command description.
	 *
	 * @var string
	 */
	protected $description = 'Banking billet settings.';

	/**
	 * Create a new command instance.
	 */
	public function __construct()
	{
		parent::__construct();
	}

	/**
	 * Execute the console command.
	 *
	 * @return mixed
	 */
	public function fire()
	{
		$moip = Moip::first();
		if ($this->confirm('Boleto bancario ativado? [yes|no]')) {
			$expiration 	= $this->ask('Dia do vencimento apos emissao do boleto (in days):');
			$working_days	= $this->confirm('Dias corridos? [yes corridos|no úteis]');
			$this->comment('Mensagem no boleto');
			$first_line		= $this->ask("Primeira linha:");
			$second_line	= $this->ask("Segunda linha:");
			$last_line		= $this->ask("Terceira linha:");
			$url_logo		= $this->ask("URL do logo:");
			$moip->billet = true;
			$moip->expiration 	= $expiration;
			$moip->workingDays 	= $working_days;
			$moip->firstLine 	= $first_line;
			$moip->secondLine 	= $second_line;
			$moip->lastLine 	= $last_line;
			$moip->uriLogo 		= $url_logo;
		} else {
			$moip->billet = false;
		}
		$moip->save();
	}
}


text:
package br.faetec.backingbeans;

import java.io.Serializable;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;

/**
 *Calcula  progresso da medida em andamento, usa a variavel global "total" e disponibiliza o resultado
  par atualização do form.
@author Antonio Cassiano
 **/
public class ProgressAction implements Serializable {

    private Integer progress;

    public Integer getProgress() {
        int base = 30;
        int totalFinal = RequisicaoAction.total;

        if (totalFinal==0)
        {
            totalFinal=1;
        }

        if (progress == null) {
            progress = 0;
        } else {

            progress = progress + (base / totalFinal);

            if (progress > 100) {
                progress = 100;
            }
        }
        return progress;
    }

    public void setProgress(Integer progress) {
        this.progress = progress;
    }

    public void onComplete() {
        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Medida Efetuada.", "Medida Efetuada."));
    }

    public void onCancel() {
            FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, "Medida Iniciada.", "Medida Iniciada."));

    }

}


text:
namespace app {
namespace Uno {
namespace UX {

::uDelegateType* ValueChangedHandler__char__typeof();

}}}

#endif


text:
require 'spec_helper'

describe LabelsFinder do
  describe '#execute' do
    let(:group_1) { create(:group) }
    let(:group_2) { create(:group) }
    let(:group_3) { create(:group) }

    let(:project_1) { create(:empty_project, namespace: group_1) }
    let(:project_2) { create(:empty_project, namespace: group_2) }
    let(:project_3) { create(:empty_project) }
    let(:project_4) { create(:empty_project, :public) }
    let(:project_5) { create(:empty_project, namespace: group_1) }

    let!(:project_label_1) { create(:label, project: project_1, title: 'Label 1') }
    let!(:project_label_2) { create(:label, project: project_2, title: 'Label 2') }
    let!(:project_label_4) { create(:label, project: project_4, title: 'Label 4') }
    let!(:project_label_5) { create(:label, project: project_5, title: 'Label 5') }

    let!(:group_label_1) { create(:group_label, group: group_1, title: 'Label 1') }
    let!(:group_label_2) { create(:group_label, group: group_1, title: 'Group Label 2') }
    let!(:group_label_3) { create(:group_label, group: group_2, title: 'Group Label 3') }

    let(:user) { create(:user) }

    before do
      create(:label, project: project_3, title: 'Label 3')
      create(:group_label, group: group_3, title: 'Group Label 4')

      project_1.team << [user, :developer]
    end

    context 'with no filter' do
      it 'returns labels from projects the user have access' do
        group_2.add_developer(user)

        finder = described_class.new(user)

        expect(finder.execute).to eq [group_label_2, group_label_3, project_label_1, group_label_1, project_label_2, project_label_4]
      end

      it 'returns labels available if nil title is supplied' do
        group_2.add_developer(user)
        # params[:title] will return `nil` regardless whether it is specified
        finder = described_class.new(user, title: nil)

        expect(finder.execute).to eq [group_label_2, group_label_3, project_label_1, group_label_1, project_label_2, project_label_4]
      end
    end

    context 'filtering by group_id' do
      it 'returns labels available for any project within the group' do
        group_1.add_developer(user)

        finder = described_class.new(user, group_id: group_1.id)

        expect(finder.execute).to eq [group_label_2, project_label_1, group_label_1, project_label_5]
      end
    end

    context 'filtering by project_id' do
      it 'returns labels available for the project' do
        finder = described_class.new(user, project_id: project_1.id)

        expect(finder.execute).to eq [group_label_2, project_label_1, group_label_1]
      end
    end

    context 'filtering by title' do
      it 'returns label with that title' do
        finder = described_class.new(user, title: 'Group Label 2')

        expect(finder.execute).to eq [group_label_2]
      end

      it 'returns label with title alias' do
        finder = described_class.new(user, name: 'Group Label 2')

        expect(finder.execute).to eq [group_label_2]
      end

      it 'returns no labels if empty title is supplied' do
        finder = described_class.new(user, title: [])

        expect(finder.execute).to be_empty
      end

      it 'returns no labels if blank title is supplied' do
        finder = described_class.new(user, title: '')

        expect(finder.execute).to be_empty
      end

      it 'returns no labels if empty name is supplied' do
        finder = described_class.new(user, name: [])

        expect(finder.execute).to be_empty
      end
    end
  end
end


text:
package com.vijaya.caster.web.validators;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;

import com.vijaya.caster.domain.Profile;

@Component
public class PasswordValidator implements Validator {

	private static final Logger logger = LoggerFactory.getLogger(PasswordValidator.class);

	@Override
	public boolean supports(Class<?> registrationDto) {
		return Profile.class.isAssignableFrom(registrationDto);
	}

	@Override
	public void validate(Object target, Errors errors) {

		Profile p = null;
		if (target instanceof Profile) {
			p = (Profile) target;
		}

		logger.info("Inside password validator - Password={}, ConfPassword={}", p.getPassword(), p.getConfPassword());

		if (p.getPassword() != null && p.getConfPassword() != null && p.getPassword().isEmpty() && p.getConfPassword().isEmpty()) {
			if (! p.getPassword().equals(p.getConfPassword())) {
				logger.info("Validation failed. Passwords do not match");
				errors.rejectValue("password","password", "Passwords do not match");
				errors.rejectValue("confPassword","confPassword", "Passwords do not match");
			}
		} else {
			logger.info("Validation failed. Passwords do not match. Values not provided.");
			errors.rejectValue("password","password", "Passwords do not match");
			errors.rejectValue("confPassword","confPassword", "Passwords do not match");
		}

	}

}


text:
<?xml version="1.0" encoding="UTF-8"?><concept xmlns="http://www.w3.org/2004/02/skos/core#">
      <prefLabel>HEALTH PLAN</prefLabel>
      <definition>An entity that assumes the risk of paying for medical treatments, i.e. uninsured
         patient, self-insured employer, payer, or HMO.</definition>
   </concept>


text:
package com.mesosphere.sdk.offer.evaluate.placement;

import com.mesosphere.sdk.testutils.OfferTestUtils;
import com.mesosphere.sdk.testutils.PodTestUtils;
import com.mesosphere.sdk.testutils.TestConstants;
import org.apache.mesos.Protos;
import org.junit.Assert;
import org.junit.Test;

import java.util.*;

/**
 * This class tests the {@link AbstractRoundRobinRule} class.
 */
public class AbstractRoundRobinRuleTest {

    @Test
    public void offerContainsNoValue() {
        TestRoundRobinRule rule = new TestRoundRobinRule(
                AnyMatcher.create(),
                1,
                null,
                null);

        Assert.assertFalse(
                rule.filter(
                        OfferTestUtils.getEmptyOfferBuilder().build(),
                        PodTestUtils.getPodInstance(0),
                        Collections.emptyList())
                        .isPassing());
    }

    @Test
    public void noTasksMatch() {
        TestRoundRobinRule rule = new TestRoundRobinRule(
                ExactMatcher.create("banana"),
                1,
                "key0",
                null);

        Assert.assertTrue(
                rule.filter(
                        OfferTestUtils.getEmptyOfferBuilder().build(),
                        PodTestUtils.getPodInstance(0),
                        Arrays.asList(TestConstants.TASK_INFO))
                        .isPassing());
    }

    @Test
    public void allTasksMatch() {
        TestRoundRobinRule rule = new TestRoundRobinRule(
                AnyMatcher.create(),
                1,
                "key0",
                null);

        Assert.assertTrue(
                rule.filter(
                        OfferTestUtils.getEmptyOfferBuilder().build(),
                        PodTestUtils.getPodInstance(0),
                        Arrays.asList(TestConstants.TASK_INFO))
                        .isPassing());
    }

    /**
     * The minimum footprint is 2 agents.  1 Task has already been launched with key0.  The offer has key0, so the offer
     * should be rejected
     */
    @Test
    public void rejectDueToInsufficientSpread() {
        TestRoundRobinRule rule = new TestRoundRobinRule(
                AnyMatcher.create(),
                2,
                "key0",
                Arrays.asList("key0"));

        Assert.assertFalse(
                rule.filter(
                        OfferTestUtils.getEmptyOfferBuilder().build(),
                        PodTestUtils.getPodInstance(0),
                        getDummyTasks(1))
                        .isPassing());
    }

    /**
     * The minimum footprint is 2 agents.  1 Task has already been launched with key0.  The offer has key1, so the offer
     * should be accepted
     */
    @Test
    public void acceptSufficientSpread() {
        TestRoundRobinRule rule = new TestRoundRobinRule(
                AnyMatcher.create(),
                2,
                "key1",
                Arrays.asList("key0"));

        Assert.assertTrue(
                rule.filter(
                        OfferTestUtils.getEmptyOfferBuilder().build(),
                        PodTestUtils.getPodInstance(0),
                        getDummyTasks(1))
                        .isPassing());
    }

    /**
     * The minimum footprint is 2 agents.  2 Tasks have been launched with key0 and key1, respectively.
     * The offer has key0, so the offer should be accepted
     */
    @Test
    public void acceptSecondLayerOfRoundRobining() {
        TestRoundRobinRule rule = new TestRoundRobinRule(
                AnyMatcher.create(),
                2,
                "key0",
                Arrays.asList("key0", "key1"));

        Assert.assertTrue(
                rule.filter(
                        OfferTestUtils.getEmptyOfferBuilder().build(),
                        PodTestUtils.getPodInstance(0),
                        getDummyTasks(2))
                        .isPassing());
    }

    /**
     * The minimum footprint is 2 agents.  3 Tasks have been launched with key0, key1 and key0, respectively.
     * The offer has key0, so the offer should be rejected.
     */
    @Test
    public void rejectFullKey() {
        TestRoundRobinRule rule = new TestRoundRobinRule(
                AnyMatcher.create(),
                2,
                "key0",
                Arrays.asList("key0", "key1", "key0"));

        Assert.assertFalse(
                rule.filter(
                        OfferTestUtils.getEmptyOfferBuilder().build(),
                        PodTestUtils.getPodInstance(0),
                        getDummyTasks(3))
                        .isPassing());
    }

    private List<Protos.TaskInfo> getDummyTasks(int count) {
        List<Protos.TaskInfo> tasks = new ArrayList<>();
        for (int i = 0; i < count; i++) {
            tasks.add(TestConstants.TASK_INFO);
        }

        return tasks;
    }

    private static class TestRoundRobinRule extends AbstractRoundRobinRule {
        private final String offerKey;
        private final List<String> taskKeys;
        private int index = 0;

        public TestRoundRobinRule(
                StringMatcher taskFilter,
                Integer distinctValueCount,
                String offerKey,
                List<String> taskKeys) {
            super(taskFilter, Optional.ofNullable(distinctValueCount));
            this.offerKey = offerKey;
            this.taskKeys = taskKeys;
        }

        @Override
        protected String getKey(Protos.Offer offer) {
            return offerKey;
        }

        @Override
        protected String getKey(Protos.TaskInfo task) {
            if (taskKeys != null) {
                return taskKeys.get(index++);
            } else {
                return null;
            }
        }

        @Override
        public Collection<PlacementField> getPlacementFields() {
            return Collections.emptyList();
        }
    }
}


text:
{-# LANGUAGE ScopedTypeVariables #-}

module Test.SmartCheck.Reduce
  (smartRun
  ) where

import Test.SmartCheck.Args
import Test.SmartCheck.Types
import Test.SmartCheck.SmartGen
import Test.SmartCheck.DataToTree
import Test.SmartCheck.Render

import qualified Test.QuickCheck as Q

import Data.Typeable
import Data.Tree
import Data.Maybe

import Control.Monad (liftM)

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

-- Smarter than shrinks.  Does substitution.  m is a value that failed QC that's
-- been shrunk.  We substitute successive children with strictly smaller (and
-- increasingly larger) randomly-generated values until we find a failure, and
-- return that result.  (We call smartShrink recursively.)
smartRun :: SubTypes a => ScArgs -> a -> (a -> Q.Property) -> IO a
smartRun args res prop = do
  putStrLn ""
  smartPrtLn "Smart Shrinking ..."
  new <- smartShrink args res prop
  smartPrtLn "Smart-shrunk value:"
  print new
  return new

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

-- | Breadth-first traversal of d, trying to shrink it with *strictly* smaller
-- children.  We replace d whenever a successful shrink is found and try again.
smartShrink :: forall a. SubTypes a => ScArgs -> a -> (a -> Q.Property) -> IO a
smartShrink args d prop =
  liftM fst $ iter' d (mkForest d) (Idx 0 0)
  where
  mkForest x = mkSubstForest x True
  notProp = Q.expectFailure . prop

  iter' x forest_ idx' =
    iter x test next notProp (scMaxDepth args) forest_ idx'
      (errorMsg "next-idxs")

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

  -- next tells the iter what to do after running a test.
  next :: a -> Maybe a -> Forest Bool -> Idx -> [Idx] -> IO (a, [Idx])
  next x res forest idx _ =
    case res of
      -- Found an ex that fails prop.  We'll now test the ex, and start trying
      -- to reduce from the top!
      Just y  -> iter' y (mkForest y) (Idx 0 0)
      -- Either couldn't satisfy the precondition or nothing satisfied the
      -- property.  Either way, we can't shrink it.
      Nothing -> iter' x forest idx { column = column idx + 1 }

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

  -- Our test function.  First, we'll see if we can just return the hole at idx,
  -- assuming it's (1) well-typed and (2), fails the test.  Otherwise, we'll
  -- test x by replacing values at idx against (Q.expectFailure . prop).  Make
  -- sure that values generated are strictly smaller than the value at
  -- idx.
  test :: a -> Idx -> IO (Maybe a)
  test x idx = do
    let vm = getAtIdx x idx (scMaxDepth args)
    case vm of
      Nothing -> errorMsg "smartShrink0"
      Just v  -> do
        hole <- testHole v
        if isJust hole then return hole
          else do (_, r) <- iterateArb x v idx (scMaxReduce args)
                              -- Maximum size of values to generate; the minimum
                              -- of the value at the current index and the
                              -- maxSize parameter.
                              (min (subValSize x idx) (scMaxSize args))
                              notProp
                  return $ resultToMaybe r

    where
    testHole :: SubT -> IO (Maybe a)
    testHole SubT { unSubT = v } =
      maybe (return Nothing) extractAndTest (cast v :: Maybe a)
      where
      extractAndTest :: a -> IO (Maybe a)
      extractAndTest y = do
        res <- resultify notProp y
        return $ resultToMaybe res

resultToMaybe :: Result a -> Maybe a
resultToMaybe res =
  case res of
    BaseType      -> Nothing
    FailedPreCond -> Nothing
    FailedProp    -> Nothing
    Result n      -> Just n

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

-- | Get the maximum depth of d's subforest at idx.  Intuitively, it's the
-- maximum number of constructors you have *below* the constructor at idx.  So
-- for a unary constructor C, the value [C, C, C]
--
-- (:) C
--   (:) C
--     (:) C []
--
-- At (Idx 0 0) in v, we're at C, so subValSize v (Idx 0 0) == 0.
-- At (Idx 0 1) in v, we're at (C : C : []), so subValSize v (Idx 0 1) == 2, since
-- we have the constructors :, C (or :, []) in the longest path underneath.
-- Base-types have subValSize 0.  So subValSize [1,2,3] idx == 0 for any idx.
-- Note that if we have subValSize d idx == 0, then it is impossible to construct a
-- *structurally* smaller value at hole idx.
subValSize :: SubTypes a => a -> Idx -> Int
subValSize d idx = maybe 0 depth forestIdx
  where
  forestIdx :: Maybe [Tree Bool]
  forestIdx = fmap subForest $ getIdxForest (mkSubstForest d True) idx

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


text:
permalink: /phd/prospective_students
title: "Advice for Prospective PhD Students"
categories: PhD
tags: [advice, studentships, PhD students, job applications, supervision]
toc: true
toc_label: "Table of Contents"
toc_icon: "book-reader"
toc_sticky: true
---

A short post with advice for if you're thinking about applying for a PhD in the group, or with Leighton as a supervisor.

## Should I get in touch first?

Please do! We're all friendly, and love to talk about our work - both ongoing and planned. You won't be wasting anyone's time - in fact, you might be saving it! Please contact Leighton by any of the methods in the sidebar (email is preferred for the first contact).

## Compatibility

It goes quickly while you're doing it, but a PhD is a long process and it's important to keep good relations during that time. The PhD application process and interview is a chance for you to establish whether you will get on with me, the other supervisor(s) and the group(s). A PhD can be a major chunk of your life, and it's important for you (and everyone else!) that it's something you enjoy. The selection process is as much for the candidate to select your PhD environment as it is for supervisors to select their students.

Some people just find it hard to work together, and that's OK - it's not a reflection on ability or anything else. If you have doubts at this stage, it's better to air them or maybe act on them, than spend four years regretting the choice. If you want to come in to visit before making a decision, that's great - we'll be happy to host you (though we can't pay for travel or accommodation). A visit may give you a much better idea of what environment to expect than an interview alone would.

## Commitment and Resilience

Doing a PhD takes a lot of time and energy, and - ideally - self-management. Enthusiasm can carry you through, but on its own that may not be enough. There will inevitably be disappointments and problems (it *is* research, after all - if we knew the answers we wouldn't be doing it, and sometimes we even ask the wrong questions!). Hardly anyone starts their PhD process knowing that they will be able to cope, but almost everyone does. You will develop resilience, even if you don't think you have it, right now.

## The Changing Supervisor-Student Relationship

The relationship between a PhD student and their supervisor should change over the course of the process. Initially, the supervisor(s) will have greater knowledge of the subject area, and academic writing, than the student. By the end of the PhD you will be working quite independently, and you will know more about the topic than your supervisor(s).

The nature of supervision changes over the course of the PhD also. Initially, your work might be quite directed: your supervisor(s) might be describing what you should read, do, and holding frequent (maybe weekly) meetings with you to ensure you start off well and go in a productive initial direction. As the PhD progresses, you will gain greater independence, deciding your own direction more, and meetings - and direct guidance - will be less frequent. By the end of the PhD, the supervisor(s)' role is likely to be principally guidance on thesis writing - by that stage, you will be mostly working independently.

### Further Reading

- [Kearns & Gardiner "The care and maintenance of your adviser" (2011) *Nature* doi:10.1038/nj7331-570a](https://www.nature.com/naturejobs/science/articles/10.1038/nj7331-570a)


text:
// ======================================================================== //
// Copyright 2009-2016 Intel Corporation                                    //
//                                                                          //
// 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.                                           //
// ======================================================================== //

#pragma once

#include "bezier1v.h"
#include "bezier_intersector.h"
#include "bezier_geometry_intersector.h"
#include "intersector_epilog.h"

namespace embree
{
  namespace isa
  {
    /*! Intersector for a single ray with a bezier curve. */
    struct Bezier1vIntersector1
    {
      typedef Bezier1v Primitive;
      typedef Bezier1vIntersector1 Precalculations;

      __forceinline Bezier1vIntersector1() {}

      __forceinline Bezier1vIntersector1(const Ray& ray, const void* ptr)
        : intersectorHair(ray,ptr), intersectorCurve(ray,ptr) {}

      static __forceinline void intersect(const Precalculations& pre, Ray& ray, const RTCIntersectContext* context, const Primitive& prim, Scene* scene, const unsigned* geomID_to_instID)
      {
        STAT3(normal.trav_prims,1,1,1);
        const BezierCurves* geom = (BezierCurves*)scene->get(prim.geomID());
        if (likely(geom->subtype == BezierCurves::HAIR))
          pre.intersectorHair.intersect(ray,prim.p0,prim.p1,prim.p2,prim.p3,geom->tessellationRate,Intersect1EpilogMU<VSIZEX,true>(ray,context,prim.geomID(),prim.primID(),scene,geomID_to_instID));
        else
          pre.intersectorCurve.intersect(ray,prim.p0,prim.p1,prim.p2,prim.p3,Intersect1Epilog1<true>(ray,context,prim.geomID(),prim.primID(),scene,geomID_to_instID));
      }

      static __forceinline bool occluded(const Precalculations& pre, Ray& ray, const RTCIntersectContext* context, const Primitive& prim, Scene* scene, const unsigned* geomID_to_instID)
      {
        STAT3(shadow.trav_prims,1,1,1);
        const BezierCurves* geom = (BezierCurves*)scene->get(prim.geomID());
        if (likely(geom->subtype == BezierCurves::HAIR))
          return pre.intersectorHair.intersect(ray,prim.p0,prim.p1,prim.p2,prim.p3,geom->tessellationRate,Occluded1EpilogMU<VSIZEX,true>(ray,context,prim.geomID(),prim.primID(),scene,geomID_to_instID));
        else
          return pre.intersectorCurve.intersect(ray,prim.p0,prim.p1,prim.p2,prim.p3,Occluded1Epilog1<true>(ray,context,prim.geomID(),prim.primID(),scene,geomID_to_instID));
      }

      /*! Intersect an array of rays with an array of M primitives. */
      static __forceinline size_t intersect(Precalculations* pre, size_t valid, Ray** rays, const RTCIntersectContext* context,  size_t ty, const Primitive* prim, size_t num, Scene* scene, const unsigned* geomID_to_instID)
      {
        size_t valid_isec = 0;
        do {
          const size_t i = __bscf(valid);
          const float old_far = rays[i]->tfar;
          for (size_t n=0; n<num; n++)
            intersect(pre[i],*rays[i],context,prim[n],scene,geomID_to_instID);
          valid_isec |= (rays[i]->tfar < old_far) ? ((size_t)1 << i) : 0;
        } while(unlikely(valid));
        return valid_isec;
      }

    public:
      Bezier1Intersector1 intersectorHair;
      BezierGeometry1Intersector1 intersectorCurve;
    };

    /*! Intersector for a single ray from a ray packet with a bezier curve. */
    template<int K>
      struct Bezier1vIntersectorK
    {
      typedef Bezier1v Primitive;
      typedef Bezier1vIntersectorK Precalculations;

      __forceinline Bezier1vIntersectorK(const vbool<K>& valid, const RayK<K>& ray)
        : intersectorHair(valid,ray), intersectorCurve(valid,ray) {}

      __forceinline Bezier1vIntersectorK (const RayK<K>& ray, size_t k)
        : intersectorHair(ray,k), intersectorCurve(ray,k) {}

      static __forceinline void intersect(Precalculations& pre, RayK<K>& ray, const size_t k, const RTCIntersectContext* context, const Primitive& prim, Scene* scene)
      {
        STAT3(normal.trav_prims,1,1,1);
        const BezierCurves* geom = (BezierCurves*)scene->get(prim.geomID());
        if (likely(geom->subtype == BezierCurves::HAIR))
          pre.intersectorHair.intersect(ray,k,prim.p0,prim.p1,prim.p2,prim.p3,geom->tessellationRate,Intersect1KEpilogMU<VSIZEX,K,true>(ray,k,context,prim.geomID(),prim.primID(),scene));
        else
          pre.intersectorCurve.intersect(ray,k,prim.p0,prim.p1,prim.p2,prim.p3,Intersect1KEpilog1<K,true>(ray,k,context,prim.geomID(),prim.primID(),scene));
      }

      static __forceinline void intersect(const vbool<K>& valid_i, Precalculations& pre, RayK<K>& ray, const RTCIntersectContext* context, const Primitive& prim, Scene* scene)
      {
        int mask = movemask(valid_i);
        while (mask) intersect(pre,ray,context,__bscf(mask),prim,scene);
      }

      static __forceinline bool occluded(Precalculations& pre, RayK<K>& ray, const size_t k, const RTCIntersectContext* context, const Primitive& prim, Scene* scene)
      {
        STAT3(shadow.trav_prims,1,1,1);
        const BezierCurves* geom = (BezierCurves*)scene->get(prim.geomID());
         if (likely(geom->subtype == BezierCurves::HAIR))
           return pre.intersectorHair.intersect(ray,k,prim.p0,prim.p1,prim.p2,prim.p3,geom->tessellationRate,Occluded1KEpilogMU<VSIZEX,K,true>(ray,k,context,prim.geomID(),prim.primID(),scene));
         else
           return pre.intersectorCurve.intersect(ray,k,prim.p0,prim.p1,prim.p2,prim.p3,Occluded1KEpilog1<K,true>(ray,k,context,prim.geomID(),prim.primID(),scene));
      }

      static __forceinline vbool<K> occluded(const vbool<K>& valid_i, Precalculations& pre, RayK<K>& ray, const RTCIntersectContext* context, const Primitive& prim, Scene* scene)
      {
        vbool<K> valid_o = false;
        int mask = movemask(valid_i);
        while (mask) {
          size_t k = __bscf(mask);
          if (occluded(pre,ray,k,context,prim,scene))
            set(valid_o, k);
        }
        return valid_o;
      }

    public:
      Bezier1IntersectorK<K> intersectorHair;
      BezierGeometry1IntersectorK<K> intersectorCurve;
    };
  }
}


text:
self.addEventListener('fetch', (event) => {
  event.respondWith(new Response(
    '<title>Generated</title>',
    {headers:[['content-type', 'text/html']]}));
});


text:
'use strict';

angular.module('carbonUiApp')
  .controller('LoginCtrl', function ($scope, userSvc, $state) {
    $scope.login = function () {
    	userSvc.login($scope.username, $scope.password).then(function (success) {
    		if(success) {
    			$state.go('home');
    		} else {
    			// do error handling here
    		}
    	});
    };
  });


text:
package com.marklogic.client.type;

//IMPORTANT: Do not edit. This file is generated.

/**
 * An instance of a literal value passed as an argument to a bind() call
 * to assign to a placeholder parameter for a row pipeline.
 */
public interface PlanParamBindingVal extends PlanParamBindingSeqVal { }


text:
package sri.universal.navigation

import scala.scalajs.js

package object reducer {

  type ReducerFunc = js.Function1[NavigationState,NavigationState]

  def defaultReducerFunc(defaultValue : NavigationState): ReducerFunc = {
    (state: NavigationState) => if(state != null) state else defaultValue
  }
}


text:
package org.conqat.engine.dotnet.resource.parser;

import java.io.File;
import java.util.List;

import org.conqat.engine.dotnet.resource.ProjectContentExtractorBase;
import org.conqat.engine.resource.test.ResourceProcessorTestCaseBase;
import org.conqat.engine.resource.text.ITextElement;
import org.conqat.engine.resource.text.ITextResource;
import org.conqat.engine.resource.util.ResourceTraversalUtils;

/**
 * Test case for {@link ProjectContentExtractorBase}
 *
 * @author $Author: heinemann $
 * @version $Rev: 45825 $
 * @ConQAT.Rating GREEN Hash: 099C9B0B1D0FE21C90546B130EA392DA
 */
public class ESolutionFormatVersionTest extends ResourceProcessorTestCaseBase {

	/** Test for determining the format. */
	public void testDetermineFormat() throws Exception {
		assertProjectVersions(new String[] { "**/*.csproj" },
				new String[] { "**/*_*" }, ESolutionFormatVersion.VERSION_8);

		assertProjectVersions(new String[] { "**/*_VS200*.csproj" },
				new String[0], ESolutionFormatVersion.VERSION_9);
	}

	/** Assert that all project files adhere to a specified version */
	private void assertProjectVersions(String[] includePatterns,
			String[] excludePatterns, ESolutionFormatVersion expectedVersion)
			throws Exception {
		List<ITextElement> projectElements = getProjectElements(
				includePatterns, excludePatterns);
		for (ITextElement projectElement : projectElements) {
			ESolutionFormatVersion actualVersion = ESolutionFormatVersion
					.determineProjectFormat(projectElement);
			assertEquals(
					"Unexpected version in :" + projectElement.getLocation(),
					expectedVersion, actualVersion);
		}
	}

	/** Get list of project elements */
	private List<ITextElement> getProjectElements(String[] includePatterns,
			String[] excludePatterns) throws Exception {
		File root = useTestFile("../org.conqat.engine.dotnet.scope/NUnit_Folder");
		root = root.getCanonicalFile();
		ITextResource scope = createTextScope(root, includePatterns,
				excludePatterns);
		List<ITextElement> projectElements = ResourceTraversalUtils
				.listTextElements(scope);
		assertTrue(projectElements.size() > 0);
		return projectElements;
	}

}


text:
<?php
/**
 * App Configuration Class
 *
 * @author Gerry Demaret <gerry@tigron.be>
 * @author Christophe Gosiau <christophe@tigron.be>
 * @author David Vandemaele <david@tigron.be>
 */
class Config_Api extends Config {

	/**
	 * Config array
	 *
	 * @var array
	 * @access private
	 */
	protected $config_data = [

		/**
		 * Hostnames
		 */
		'hostnames' => ['*'],

		/**
		 * Default language. If no language is requested
		 */
		'default_language' => 'en',

		/**
		 * Routes
		 */
		'routes' => [
			'web_module_xmlrpc' => [
				'RPC2',
			],
			'web_module_logtail' => [
				'logtail/$name/$output',
			],
		],
	];
}


text:
namespace neu {
	namespace layer {
		any_layer deserialize(YAML::Node const& node,
			boost::compute::command_queue& queue);
	}
}// namespace neu

#endif //NEU_LAYER_DESERIALIZE_FWD_HPP


text:
<?php

namespace Spatie\String\Test\Functions;

use PHPUnit\Framework\TestCase;

class TrimTest extends TestCase
{
    /** @test */
    public function it_trims_default_characters()
    {
        $this->assertEquals('foo', (string) string('  foo ')->trim());
    }

    /** @test */
    public function it_trims_custom_characters()
    {
        $this->assertEquals('foo', (string) string('/foo')->trim('/'));
    }

    /** @test */
    public function it_is_chainable()
    {
        $this->assertInstanceOf(\Spatie\String\Str::class, string(' foo ')->trim());
    }
}


text:
'use strict';
App.directive("ngFile", function ($parse, util) {
    return {
        scope: {
            ngFile: '='
        },
        link: function (scope, element, attrs) {
            var model = $parse(attrs.ngFile);
            var modelSetter = model.assign;
            element.bind("change", function (changeEvent) {
                var reader = new FileReader();
                reader.onload = function (loadEvent) {
                    scope.$apply(function () {
                        var file = changeEvent.target.files[0];
                        scope.ngFile = {
                            filename: file.name,
                            size: file.size,
                            contentType: file.type,
                            base64: loadEvent.target.result
                        }
                    });
                };
                reader.readAsDataURL(changeEvent.target.files[0]);
            });
        }
    };
});


text:
<?php

namespace Symfony\Component\Validator\Constraints;

use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;

/**
 * Validator for Callback constraint
 *
 * @author Bernhard Schussek <bernhard.schussek@symfony.com>
 *
 * @api
 */
class CallbackValidator extends ConstraintValidator
{
    /**
     * Checks if the passed value is valid.
     *
     * @param mixed      $object     The value that should be validated
     * @param Constraint $constraint The constraint for the validation
     *
     * @return Boolean Whether or not the value is valid
     *
     * @api
     */
    public function isValid($object, Constraint $constraint)
    {
        if (null === $object) {
            return true;
        }

        // has to be an array so that we can differentiate between callables
        // and method names
        if (!is_array($constraint->methods)) {
            throw new UnexpectedTypeException($constraint->methods, 'array');
        }

        $methods = $constraint->methods;
        $success = true;

        foreach ($methods as $method) {
            if (is_array($method) || $method instanceof \Closure) {
                if (!is_callable($method)) {
                    throw new ConstraintDefinitionException(sprintf('"%s::%s" targeted by Callback constraint is not a valid callable', $method[0], $method[1]));
                }

                $success = call_user_func($method, $object, $this->context) && $success;
            } else {
                if (!method_exists($object, $method)) {
                    throw new ConstraintDefinitionException(sprintf('Method "%s" targeted by Callback constraint does not exist', $method));
                }

                $success = $object->$method($this->context) && $success;
            }
        }

        return $success;
    }
}