text:
@class RoofType;

@interface RoofEstimate : NSObject<XMLSerializable>

@property (nonatomic, strong) NSString *Name;
@property (nonatomic, strong) NSString *Address;
@property (nonatomic, strong) NSString *City;
@property (nonatomic, strong) NSString *State;
@property (nonatomic, strong) NSString *Zip;
@property (nonatomic, strong) NSString *Phone;
@property (nonatomic, strong) NSString *Email;

@property (nonatomic, strong) RoofType *RoofType;
@property (nonatomic, strong) RoofType *RoofType2;

-(RoofEstimate *)PrintRoofEstimate:(RoofEstimate*)roofEstimate;

@end

@interface RoofType : NSObject<XMLSerializable>

@property (nonatomic, strong) NSString * RoofCovering;
@property (nonatomic,strong) NSMutableArray *RoofSize;
@property (nonatomic) float RoofSqft;
@property (nonatomic) float RoofSlope;
@property (nonatomic) float RidgeLf;
@property (nonatomic) float DripEdgeLf;
@property (nonatomic) float ValleyLf;
@property (nonatomic) int Stack1;
@property (nonatomic) int Stack2;
@property (nonatomic) int Stack3;
@property (nonatomic, strong) NSString *Notes;

@end


text:
package com.ibm.common.activitystreams.actions;

import java.io.ObjectStreamException;

/**
 */
public class IntentActionHandler
  extends ActionHandler {

  /**
   * Method makeIntentActionHandler.
   * @return Builder
   */
  public static Builder makeIntentActionHandler() {
    return new Builder();
  }

  /**
   */
  public static final class Builder
    extends AbstractBuilder<IntentActionHandler, Builder> {

    public Builder() {
      super("IntentActionHandler");
    }

    /**
     * Method actualGet.
     * @return IntentActionHandler
     */
    protected IntentActionHandler actualGet() {
      return new IntentActionHandler(this);
    }

  }

  /**
   */
  public static abstract class AbstractBuilder
    <A extends IntentActionHandler, B extends AbstractBuilder<A,B>>
    extends ActionHandler.Builder<A,B> {
      /**
       * Constructor for AbstractBuilder.
       * @param objectType String
       */
      protected AbstractBuilder(String objectType) {
        objectType(objectType);
      }
  }

  /**
   * Constructor for IntentActionHandler.
   * @param builder AbstractBuilder
   */
  protected IntentActionHandler(AbstractBuilder<?,?> builder) {
    super(builder);
  }

  Object writeReplace() throws java.io.ObjectStreamException {
    return new SerializedForm(this);
  }

  private static class SerializedForm
    extends AbstractSerializedForm<IntentActionHandler> {
    private static final long serialVersionUID = -2060301713159936285L;
    protected SerializedForm(IntentActionHandler obj) {
      super(obj);
    }
    Object readResolve() throws ObjectStreamException {
      return super.doReadResolve();
    }
    protected IntentActionHandler.Builder builder() {
      return ActionMakers.intentAction();
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
INSTALLPATH=/usr/local/bin/getignore
if [ "$(id -u)" -ne 0 ]; then
  echo "Script must be run as root or with sudo permissions.";
elif [ -f $INSTALLPATH ]; then
  echo "It looks like getignore is already installed. If you wish to reinstall it, please remove $INSTALLPATH first."
else
  echo "Installing getignore..."
  curl -Lso $INSTALLPATH https://raw.githubusercontent.com/caffeinewriter/getignore/master/getignore.sh
  chmod +x $INSTALLPATH
  echo "Installation has completed successfully."
fi


text:
namespace Microsoft.XmlDiffPatch
{
    #region Using directives

    using System;
    using System.IO;
    using System.Xml;
    using System.Diagnostics;

    #endregion

    /// <summary>
    /// Class the generate output data for the document
    /// level nodes and their children.
    /// </summary>
    internal class XmlDiffViewDocument : XmlDiffViewParentNode
    {
        #region  Constructors section

        /// <summary>
        /// Constructor.
        /// </summary>
        internal XmlDiffViewDocument() : base(XmlNodeType.Document)
        {
        }

        #endregion

        #region Properties section

        /// <summary>
        /// Returns an Exception "OuterXml is not supported on
        /// XmlDiffViewElement."
        /// </summary>
        [Obsolete("OuterXml is not supported on XmlDiffViewElement",true)]
        public override string OuterXml
        {
            get
            {
                throw new Exception("OuterXml is not supported on XmlDiffViewElement.");
            }
        }

        #endregion

        #region Methods section

        /// <summary>
        /// Creates a complete copy of the current node.
        /// </summary>
        /// <param name="deep">deprecated</param>
        /// <returns>Exception: Clone method should never be called on a document node.</returns>
        [Obsolete("Clone method should never be called on a document node", true)]
        internal override XmlDiffViewNode Clone(bool deep)
        {
            throw new Exception("Clone method should never be called on a document node.");
        }

        /// <summary>
        /// Generates  output data in html form
        /// </summary>
        /// <param name="writer">output stream</param>
        /// <param name="indent">number of indentations</param>
        internal override void DrawHtml(
            XmlWriter writer,
            XmlWriter writerRight,
            int indent,
            bool isSvg)
        {
            HtmlDrawChildNodes(writer, writerRight, indent, isSvg);
        }

        /// <summary>
        /// Generates  output data in text form
        /// </summary>
        /// <param name="writer">output stream</param>
        /// <param name="indent">number of indentations</param>
        internal override void DrawText(TextWriter writer, int indent)
        {
            TextDrawChildNodes(writer, indent);
        }

        #endregion

    }
}


text:
export * from './AddRound'
export * from './AdjustVertical'
export * from './Alert'
export * from './Alphabet'
export * from './ArrowAgain'
export * from './ArrowOutput'
export * from './ArrowRotate'
export * from './ArrowSingleDown'
export * from './ArrowSingleRight'
export * from './Bold'
export * from './Book'
export * from './Check'
export * from './CheckActive'
export * from './Close'
export * from './Edit'
export * from './EditView'
export * from './Eye'
export * from './File'
export * from './FileOpen'
export * from './Hash'
export * from './HelpOutline'
export * from './Image'
export * from './Info'
export * from './Italic'
export * from './LineThrough'
export * from './Link'
export * from './List'
export * from './Loupe'
export * from './Preview'
export * from './Quote'
export * from './Radio'
export * from './RadioActive'
export * from './Setting'
export * from './Split'
export * from './SplitView'
export * from './Star'
export * from './StarActive'
export * from './T1'
export * from './T2'
export * from './T3'
export * from './Tag'
export * from './TagFill'
export * from './Tags'
export * from './Trash'
export * from './TrashFill'
export * from './Underline'


text:
from org.python.compiler import JavaMaker, ProxyMaker

pkg = 'jjh'
pyclass = 'PythonRandom'
module = 'trand'
jname = 'java.util.Random'

name = 'org.python.proxies.'+jname
ps = ProxyMaker.getFile('c:\\jpython\\JavaCode', name)
ProxyMaker.makeProxy(jname, ps)
ps.close()

name = pkg+'.'+pyclass
jm = JavaMaker('java.util.Random', pyclass, module, name)
jm.build()

s = ProxyMaker.getFile('c:\\jpython\\JavaCode', name)
jm.classfile.write(s)
s.close()


text:
using System.ComponentModel;
using Xamarin.Forms;

namespace Ooui.Forms.Renderers
{
    public class SliderRenderer : ViewRenderer<Slider, Input>
    {
        private bool _disposed;

        IElementController ElementController => Element as IElementController;

        public override SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint)
        {
            var size = new Size(100, 38);
            return new SizeRequest(size, size);
        }

        protected override void OnElementChanged(ElementChangedEventArgs<Slider> e)
        {
            base.OnElementChanged(e);

            if (e.NewElement == null)
                return;

            if (Control == null)
            {
                var range = new Input
                {
                    ClassName = "form-control",
                    Type = InputType.Range
                };

                range.Change += OnValueChange;

                SetNativeControl(range);
            }

            UpdateMaximum();
            UpdateMinimum();
            UpdateValue();
        }

        protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            base.OnElementPropertyChanged(sender, e);

            if (e.PropertyName == Slider.MaximumProperty.PropertyName)
                UpdateMaximum();
            else if (e.PropertyName == Slider.MinimumProperty.PropertyName)
                UpdateMinimum();
            else if (e.PropertyName == Slider.ValueProperty.PropertyName)
                UpdateValue();
        }

        protected override void Dispose(bool disposing)
        {
            if (_disposed)
                return;

            _disposed = true;

            if (disposing)
            {
                if (Control != null)
                {
                    Control.Change -= OnValueChange;
                }
            }

            base.Dispose(disposing);
        }

        private void UpdateMaximum()
        {
            Control.Maximum = Element.Maximum;
        }

        private void UpdateMinimum()
        {
            Control.Minimum = Element.Minimum;
        }

        private void UpdateValue()
        {
            Control.NumberValue = Element.Value;
        }

        private void OnValueChange(object sender, TargetEventArgs e)
        {
            ElementController.SetValueFromRenderer(Slider.ValueProperty, Control.NumberValue);
        }
    }
}


text:
var net = require('net');
var gpu = require('../bin/gpu.node');

//initializing adl3
try{
	var create = gpu.amd.ADL_Main_Control_Create(1);
	if(create.status != gpu.amd.ADL_OK) throw -1;

	var numberOfAdapters = gpu.amd.ADL_Adapter_NumberOfAdapters_Get();
	if(numberOfAdapters.status != gpu.amd.ADL_OK) throw -2;

	var allAdaptersData = gpu.amd.ADL_Adapter_AdapterInfo_Get(numberOfAdapters.data), activeAdaptersData = [], tmp;
	if(allAdaptersData.status != gpu.amd.ADL_OK) throw -3;

	for(var i = 0, l = allAdaptersData.data.length; i < l; i++){
		tmp = gpu.amd.ADL_Adapter_Active_Get(i);

		if(tmp.status == gpu.amd.ADL_OK && tmp.data == gpu.amd.ADL_TRUE){
			activeAdaptersData.push(allAdaptersData.data[i]);
		}
	}
}catch(e){
	console.log('Failed to init ADL:', e.message);
	gpu.amd.ADL_Main_Control_Destroy();
	process.exit(1);
}

process.on('exit', function(){
	gpu.amd.ADL_Main_Control_Destroy();
}).on('uncaughtException', function(e){
	console.log('Uncaught exception:', e.message);
	gpu.amd.ADL_Main_Control_Destroy();
	process.exit(1);
});

var server = net.createServer({
	allowHalfOpen: true
},function(socket){
	socket.setNoDelay(true);
	socket.on('data', function(buffer){
		var data = [];

		if(buffer.toString() == 'getInfo'){
			var re = new RegExp('ATI\\s*(.*?)\\s*Series'), adapterName, matches;
			for(var i = 0, l = activeAdaptersData.length; i < l; i++){
				adapterName = activeAdaptersData[i].strAdapterName.trim();

				matches = re.exec(adapterName);

				adapterName = matches[1] ? matches[1] : adapterName;

				data.push('GPU' + i + ': ' + adapterName);
			}
		}else{
			var tmp, temperature, fan, activity;

			for(var i = 0, l = activeAdaptersData.length; i < l; i++){
				tmp = {
					temperature: 0,
					fanspeed: 0,
					activity: 0,
					core: 0,
					memory: 0
				};

				temperature = gpu.amd.ADL_Overdrive5_Temperature_Get(activeAdaptersData[i].iAdapterIndex, 0);
				if(temperature.status == gpu.amd.ADL_OK){
					tmp.temperature = temperature.data.iTemperature/1000;
				}

				fan = gpu.amd.ADL_Overdrive5_FanSpeed_Get(activeAdaptersData[i].iAdapterIndex, 0);
				if(fan.status == gpu.amd.ADL_OK){
					tmp.fanspeed = fan.data.iFanSpeed;
				}

				activity = gpu.amd.ADL_Overdrive5_CurrentActivity_Get(activeAdaptersData[i].iAdapterIndex);
				if(activity.status == gpu.amd.ADL_OK){
					tmp.activity = activity.data.iActivityPercent;
					tmp.core = activity.data.iEngineClock/100;
					tmp.memory = activity.data.iMemoryClock/100;
				}

				data.push(tmp);
			}
		}

		socket.write(JSON.stringify(data));
	});
}).listen(8888);


text:
<?php
/**
 * AccessBehavior for Yii2
 *
 * @author Elle <elleuz@gmail.com>
 * @version 0.1
 * @package AccessBehavior for Yii2
 *
 */
namespace developeruz\db_rbac\behaviors;

use Yii;
use yii\behaviors\AttributeBehavior;
use yii\di\Instance;
use yii\base\Module;
use yii\web\Application;
use yii\web\User;
use yii\filters\AccessControl;
use yii\web\BadRequestHttpException;

class AccessBehavior extends AttributeBehavior {

    public $rules=[];

    private $_rules = [];

    public function events()
    {
        return [
            Module::EVENT_BEFORE_ACTION => 'interception',
        ];
    }

    public function interception($event)
    {
        $route = Yii::$app->getRequest()->resolve();

        //Проверяем права по конфигу
        $this->createRule();
        $user = Instance::ensure(Yii::$app->user, User::className());
        $request = Yii::$app->getRequest();
        $action = $event->action;

        if(!$this->cheсkByRule($action, $user, $request))
        {
            //И по AuthManager
            if(!$this->checkPermission($route))
                throw new BadRequestHttpException('Недостаточно прав');
        }
    }

    protected function createRule()
    {
        foreach($this->rules as $controller => $rule)
        {
            foreach ($rule as $singleRule) {
                if (is_array($singleRule)) {
                    $option = [
                        'controllers' => [$controller],
                        'class' => 'yii\filters\AccessRule'
                    ];
                    $this->_rules[] = Yii::createObject(array_merge($option, $singleRule));
                }
            }
        }
    }

    protected function cheсkByRule($action, $user, $request)
    {
        foreach ($this->_rules as $rule) {
            if ($rule->allows($action, $user, $request))
                return true;
        }
        return false;
    }

    protected function checkPermission($route)
    {
        //$route[0] - is the route, $route[1] - is the associated parameters

        $routePathTmp = explode('/', $route[0]);
        $routeVariant = array_shift($routePathTmp);
        if(Yii::$app->user->can($routeVariant, $route[1]))
            return true;

        foreach($routePathTmp as $routePart)
        {
            $routeVariant .= '/'.$routePart;
            if(Yii::$app->user->can($routeVariant, $route[1]))
                return true;
        }

        return false;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<?BlueBerry version="0.1"?>
<plugin>
  <extension point="org.blueberry.osgi.applications">
    <application id="org.mitk.qt.dtiatlasapp">
      <run class="QmitkDTIAtlasAppApplication"/>
    </application>
  </extension>

  <extension point="org.blueberry.ui.intro">
    <intro id="org.mitk.qt.dtiatlasappintro"
      class="QmitkDTIAtlasAppIntroPart"
      role="editor"/>
    <introProductBinding
      productId=""
      introId="org.mitk.qt.dtiatlasappintro"/>
  </extension>

  <extension point="org.blueberry.ui.perspectives">
    <perspective id="org.mitk.dtiatlasapp.perspectives.dtiatlasapp" name="Springer DTI Atlas" class="QmitkDTIAtlasAppPerspective" icon="resources/diffusionimaging.png"/>
    <perspective id="org.mitk.dtiatlasapp.perspectives.welcome" name="Welcome" class="QmitkWelcomePerspective" icon="resources/icon_home.png"/>
  </extension>

</plugin>


text:
package org.apache.solr.cloud;

import java.io.File;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.io.FileUtils;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.solr.common.cloud.Replica;
import org.apache.solr.common.cloud.Slice;
import org.apache.solr.common.cloud.SolrZkClient;
import org.apache.solr.common.cloud.ZkStateReader;
import org.apache.solr.core.CoreContainer;
import org.apache.solr.core.CoreDescriptor;
import org.apache.solr.core.SolrResourceLoader;
import org.apache.zookeeper.KeeperException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CloudUtil {
  protected static Logger log = LoggerFactory.getLogger(CloudUtil.class);

  /**
   * See if coreNodeName has been taken over by another baseUrl and unload core
   * + throw exception if it has been.
   */
  public static void checkSharedFSFailoverReplaced(CoreContainer cc, CoreDescriptor desc) {

    ZkController zkController = cc.getZkController();
    String thisCnn = zkController.getCoreNodeName(desc);
    String thisBaseUrl = zkController.getBaseUrl();

    log.debug("checkSharedFSFailoverReplaced running for coreNodeName={} baseUrl={}", thisCnn, thisBaseUrl);

    // if we see our core node name on a different base url, unload
    Map<String,Slice> slicesMap = zkController.getClusterState().getSlicesMap(desc.getCloudDescriptor().getCollectionName());

    if (slicesMap != null) {
      for (Slice slice : slicesMap.values()) {
        for (Replica replica : slice.getReplicas()) {

          String cnn = replica.getName();
          String baseUrl = replica.getStr(ZkStateReader.BASE_URL_PROP);
          log.debug("compare against coreNodeName={} baseUrl={}", cnn, baseUrl);

          if (thisCnn != null && thisCnn.equals(cnn)
              && !thisBaseUrl.equals(baseUrl)) {
            if (cc.getCoreNames().contains(desc.getName())) {
              cc.unload(desc.getName());
            }

            File instanceDir = new File(desc.getInstanceDir());
            try {
              FileUtils.deleteDirectory(instanceDir);
            } catch (IOException e) {
              SolrException.log(log, "Failed to delete instance dir for core:"
                  + desc.getName() + " dir:" + instanceDir.getAbsolutePath());
            }
            log.error("", new SolrException(ErrorCode.SERVER_ERROR,
                "Will not load SolrCore " + desc.getName()
                    + " because it has been replaced due to failover."));
            throw new SolrException(ErrorCode.SERVER_ERROR,
                "Will not load SolrCore " + desc.getName()
                    + " because it has been replaced due to failover.");
          }
        }
      }
    }
  }

  /**
   * Returns a displayable unified path to the given resource. For non-solrCloud that will be the
   * same as getConfigDir, but for Cloud it will be getConfigSetZkPath ending in a /
   *

   * Note: Do not use this to generate a valid file path, but for debug printing etc
   * @param loader Resource loader instance
   * @return a String of path to resource
   */
  public static String unifiedResourcePath(SolrResourceLoader loader) {
    return (loader instanceof ZkSolrResourceLoader) ?
            ((ZkSolrResourceLoader) loader).getConfigSetZkPath() + "/" :
            loader.getConfigDir();
  }

  /**Read the list of public keys from ZK
   */

  public static Map<String, byte[]> getTrustedKeys(SolrZkClient zk, String dir) {
    Map<String, byte[]> result = new HashMap<>();
    try {
      List<String> children = zk.getChildren("/keys/" + dir, null, true);
      for (String key : children) {
        if (key.endsWith(".der")) result.put(key, zk.getData("/keys/" + dir +
            "/" + key, null, null, true));
      }
    } catch (KeeperException.NoNodeException e) {
      log.info("Error fetching key names");
      return Collections.EMPTY_MAP;
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new SolrException(ErrorCode.SERVER_ERROR,"Unable to read crypto keys",e );
    } catch (KeeperException e) {
      throw new SolrException(ErrorCode.SERVER_ERROR,"Unable to read crypto keys",e );
    }
    return result;

  }

}


text:
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using SuperMap.WindowsPhone.Core;
using Newtonsoft.Json;

namespace SuperMap.WindowsPhone.REST
{
    /// ${WP_REST_Query_QueryByBoundsParameters_Title}
    public class QueryByBoundsParameters : QueryParameterBase
    {
        /// ${WP_REST_Query_QueryByBoundsParameters_constructor_None_D}
        public QueryByBoundsParameters()
        { }
        /// ${WP_REST_Query_QueryByBoundsParameters_attribute_Bounds_D}
        [JsonProperty("bounds")]
        [JsonConverter(typeof(Rectangle2DConverter))]
        public Rectangle2D Bounds { get; set; }
    }
}


text:
module DC
  module Import

    class PDFWrangler

      # Number of pages in a parallelized batch.
      DEFAULT_BATCH_SIZE = 5

      # Make sure we're dealing with a PDF. If not, it needs to be
      # converted first. Yields the path to the converted document to a block.
      def ensure_pdf(file, filename=nil)
        Dir.mktmpdir do |temp_dir|
          path = file.path
          original_filename = filename || file.original_filename
          ext  = File.extname(original_filename).downcase
          name = File.basename(original_filename, File.extname(original_filename)).gsub(/[^a-zA-Z0-9_\-.]/, '-').gsub(/-+/, '-') + ext
          if ext == ".pdf" && File.extname(path) != ".pdf"
            new_path = File.join(temp_dir, name)
            FileUtils.mv(path, new_path)
            path = new_path
          end
          return yield(path) if ext == ".pdf"
          begin
            doc  = File.join(temp_dir, name)
            FileUtils.cp(path, doc)
            Docsplit.extract_pdf(doc, :output => temp_dir)
            yield(File.join(temp_dir, File.basename(name, ext) + '.pdf'))
          rescue Exception => e
            LifecycleMailer.deliver_exception_notification(e)
            Rails.logger.error("PDF Conversion Failed: " + e.message + "\n" + e.backtrace.join("\n"))
            yield path
          end
        end
      end

      # Archive a list of PDF pages into TAR archives, grouped by batch_size.
      def archive(pages, batch_size=nil)
        batch_size ||= DEFAULT_BATCH_SIZE
        batches = (pages.length / batch_size.to_f).ceil
        batches.times do |batch_num|
          tar_path = "#{sprintf('%05d', batch_num)}.tar"
          batch_pages = pages[batch_num*batch_size...(batch_num + 1)*batch_size]
          `tar -czf #{tar_path} #{batch_pages.join(' ')} 2>&1`
        end
        Dir["*.tar"]
      end

    end

  end
end


text:
/* *
 *
 *  !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
 *
 * */
import geometry from './geometry.js';
var getAngleBetweenPoints = geometry.getAngleBetweenPoints, getCenterOfPoints = geometry.getCenterOfPoints, getDistanceBetweenPoints = geometry.getDistanceBetweenPoints;
/**
 * @private
 * @param {number} x
 *        Number to round
 * @param {number} decimals
 *        Number of decimals to round to
 * @return {number}
 *         Rounded number
 */
var round = function round(x, decimals) {
    var a = Math.pow(10, decimals);
    return Math.round(x * a) / a;
};
/**
 * Calculates the area of a circle based on its radius.
 * @private
 * @param {number} r
 *        The radius of the circle.
 * @return {number}
 *         Returns the area of the circle.
 */
var getAreaOfCircle = function (r) {
    if (r <= 0) {
        throw new Error('radius of circle must be a positive number.');
    }
    return Math.PI * r * r;
};
/**
 * Calculates the area of a circular segment based on the radius of the circle
 * and the height of the segment.
 * See http://mathworld.wolfram.com/CircularSegment.html
 * @private
 * @param {number} r
 *        The radius of the circle.
 * @param {number} h
 *        The height of the circular segment.
 * @return {number}
 *         Returns the area of the circular segment.
 */
var getCircularSegmentArea = function getCircularSegmentArea(r, h) {
    return r * r * Math.acos(1 - h / r) - (r - h) * Math.sqrt(h * (2 * r - h));
};
/**
 * Calculates the area of overlap between two circles based on their radiuses
 * and the distance between them.
 * See http://mathworld.wolfram.com/Circle-CircleIntersection.html
 * @private
 * @param {number} r1
 *        Radius of the first circle.
 * @param {number} r2
 *        Radius of the second circle.
 * @param {number} d
 *        The distance between the two circles.
 * @return {number}
 *         Returns the area of overlap between the two circles.
 */
var getOverlapBetweenCircles = function getOverlapBetweenCircles(r1, r2, d) {
    var overlap = 0;
    // If the distance is larger than the sum of the radiuses then the circles
    // does not overlap.
    if (d < r1 + r2) {
        if (d <= Math.abs(r2 - r1)) {
            // If the circles are completely overlapping, then the overlap
            // equals the area of the smallest circle.
            overlap = getAreaOfCircle(r1 < r2 ? r1 : r2);
        }
        else {
            // Height of first triangle segment.
            var d1 = (r1 * r1 - r2 * r2 + d * d) / (2 * d),
            // Height of second triangle segment.
            d2 = d - d1;
            overlap = (getCircularSegmentArea(r1, r1 - d1) +
                getCircularSegmentArea(r2, r2 - d2));
        }
        // Round the result to two decimals.
        overlap = round(overlap, 14);
    }
    return overlap;
};
/**
 * Calculates the intersection points of two circles.
 *
 * NOTE: does not handle floating errors well.
 * @private
 * @param {Highcharts.CircleObject} c1
 *        The first circle.
 * @param {Highcharts.CircleObject} c2
 *        The second sircle.
 * @return {Array<Highcharts.PositionObject>}
 *         Returns the resulting intersection points.
 */
var getCircleCircleIntersection = function getCircleCircleIntersection(c1, c2) {
    var d = getDistanceBetweenPoints(c1, c2), r1 = c1.r, r2 = c2.r, points = [];
    if (d < r1 + r2 && d > Math.abs(r1 - r2)) {
        // If the circles are overlapping, but not completely overlapping, then
        // it exists intersecting points.
        var r1Square = r1 * r1, r2Square = r2 * r2,
        // d^2 - r^2 + R^2 / 2d
        x = (r1Square - r2Square + d * d) / (2 * d),
        // y^2 = R^2 - x^2
        y = Math.sqrt(r1Square - x * x), x1 = c1.x, x2 = c2.x, y1 = c1.y, y2 = c2.y, x0 = x1 + x * (x2 - x1) / d, y0 = y1 + x * (y2 - y1) / d, rx = -(y2 - y1) * (y / d), ry = -(x2 - x1) * (y / d);
        points = [
            { x: round(x0 + rx, 14), y: round(y0 - ry, 14) },
            { x: round(x0 - rx, 14), y: round(y0 + ry, 14) }
        ];
    }
    return points;
};
/**
 * Calculates all the intersection points for between a list of circles.
 * @private
 * @param {Array<Highcharts.CircleObject>} circles
 *        The circles to calculate the points from.
 * @return {Array<Highcharts.GeometryObject>}
 *         Returns a list of intersection points.
 */
var getCirclesIntersectionPoints = function getIntersectionPoints(circles) {
    return circles.reduce(function (points, c1, i, arr) {
        var additional = arr.slice(i + 1)
            .reduce(function (points, c2, j) {
            var indexes = [i, j + i + 1];
            return points.concat(getCircleCircleIntersection(c1, c2)
                .map(function (p) {
                p.indexes = indexes;
                return p;
            }));
        }, []);
        return points.concat(additional);
    }, []);
};
/**
 * Tests wether a point lies within a given circle.
 * @private
 * @param {Highcharts.PositionObject} point
 *        The point to test for.
 * @param {Highcharts.CircleObject} circle
 *        The circle to test if the point is within.
 * @return {boolean}
 *         Returns true if the point is inside, false if outside.
 */
var isPointInsideCircle = function isPointInsideCircle(point, circle) {
    return getDistanceBetweenPoints(point, circle) <= circle.r + 1e-10;
};
/**
 * Tests wether a point lies within a set of circles.
 * @private
 * @param {Highcharts.PositionObject} point
 *        The point to test.
 * @param {Array<Highcharts.CircleObject>} circles
 *        The list of circles to test against.
 * @return {boolean}
 *         Returns true if the point is inside all the circles, false if not.
 */
var isPointInsideAllCircles = function isPointInsideAllCircles(point, circles) {
    return !circles.some(function (circle) {
        return !isPointInsideCircle(point, circle);
    });
};
/**
 * Tests wether a point lies outside a set of circles.
 *
 * TODO: add unit tests.
 * @private
 * @param {Highcharts.PositionObject} point
 *        The point to test.
 * @param {Array<Highcharts.CircleObject>} circles
 *        The list of circles to test against.
 * @return {boolean}
 *         Returns true if the point is outside all the circles, false if not.
 */
var isPointOutsideAllCircles = function isPointOutsideAllCircles(point, circles) {
    return !circles.some(function (circle) {
        return isPointInsideCircle(point, circle);
    });
};
/**
 * Calculate the path for the area of overlap between a set of circles.
 * @todo handle cases with only 1 or 0 arcs.
 * @private
 * @param {Array<Highcharts.CircleObject>} circles
 *        List of circles to calculate area of.
 * @return {Highcharts.GeometryIntersectionObject|undefined}
 *         Returns the path for the area of overlap. Returns an empty string if
 *         there are no intersection between all the circles.
 */
var getAreaOfIntersectionBetweenCircles = function getAreaOfIntersectionBetweenCircles(circles) {
    var intersectionPoints = (getCirclesIntersectionPoints(circles)
        .filter(function (p) {
        return isPointInsideAllCircles(p, circles);
    })), result;
    if (intersectionPoints.length > 1) {
        // Calculate the center of the intersection points.
        var center = getCenterOfPoints(intersectionPoints);
        intersectionPoints = intersectionPoints
            // Calculate the angle between the center and the points.
            .map(function (p) {
            p.angle = getAngleBetweenPoints(center, p);
            return p;
        })
            // Sort the points by the angle to the center.
            .sort(function (a, b) {
            return b.angle - a.angle;
        });
        var startPoint = intersectionPoints[intersectionPoints.length - 1];
        var arcs = intersectionPoints
            .reduce(function (data, p1) {
            var startPoint = data.startPoint, midPoint = getCenterOfPoints([startPoint, p1]);
            // Calculate the arc from the intersection points and their
            // circles.
            var arc = p1.indexes
                // Filter out circles that are not included in both
                // intersection points.
                .filter(function (index) {
                return startPoint.indexes.indexOf(index) > -1;
            })
                // Iterate the circles of the intersection points and
                // calculate arcs.
                .reduce(function (arc, index) {
                var circle = circles[index], angle1 = getAngleBetweenPoints(circle, p1), angle2 = getAngleBetweenPoints(circle, startPoint), angleDiff = angle2 - angle1 +
                    (angle2 < angle1 ? 2 * Math.PI : 0), angle = angle2 - angleDiff / 2, width = getDistanceBetweenPoints(midPoint, {
                    x: circle.x + circle.r * Math.sin(angle),
                    y: circle.y + circle.r * Math.cos(angle)
                }), r = circle.r;
                // Width can sometimes become to large due to floating
                // point errors
                if (width > r * 2) {
                    width = r * 2;
                }
                // Get the arc with the smallest width.
                if (!arc || arc.width > width) {
                    arc = {
                        r: r,
                        largeArc: width > r ? 1 : 0,
                        width: width,
                        x: p1.x,
                        y: p1.y
                    };
                }
                // Return the chosen arc.
                return arc;
            }, null);
            // If we find an arc then add it to the list and update p2.
            if (arc) {
                var r = arc.r;
                data.arcs.push(['A', r, r, 0, arc.largeArc, 1, arc.x, arc.y]);
                data.startPoint = p1;
            }
            return data;
        }, {
            startPoint: startPoint,
            arcs: []
        }).arcs;
        if (arcs.length === 0) {
            // empty
        }
        else if (arcs.length === 1) {
            // empty
        }
        else {
            arcs.unshift(['M', startPoint.x, startPoint.y]);
            result = {
                center: center,
                d: arcs
            };
        }
    }
    return result;
};
var geometryCircles = {
    getAreaOfCircle: getAreaOfCircle,
    getAreaOfIntersectionBetweenCircles: getAreaOfIntersectionBetweenCircles,
    getCircleCircleIntersection: getCircleCircleIntersection,
    getCirclesIntersectionPoints: getCirclesIntersectionPoints,
    getCircularSegmentArea: getCircularSegmentArea,
    getOverlapBetweenCircles: getOverlapBetweenCircles,
    isPointInsideCircle: isPointInsideCircle,
    isPointInsideAllCircles: isPointInsideAllCircles,
    isPointOutsideAllCircles: isPointOutsideAllCircles,
    round: round
};
export default geometryCircles;


text:
<!DOCTYPE html>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Subform</title>
        <link rel="stylesheet" href="/style/common.css" type="text/css">

Subform

                    Description

Demo

Auto-vanilla in auto-vanilla (same action)

		    <form action="/src/pat/subform/form-response.html" method="get" class="concise">
			<fieldset class="pat-autosubmit">
			    Name <input name="name" type="text" value="">
			</fieldset>
			<fieldset class="pat-subform pat-autosubmit">
			    Zipcode <input name="zipcode" type="text" value="">
			</fieldset>
		    </form>

Auto-inject in auto-vanilla (other action via data-pat-inject="url: ...")

		    <form action="/src/pat/subform/form-response.html" method="get" class="concise">
			<fieldset class="pat-autosubmit">
			    Name <input name="name" type="text" value="">
			</fieldset>
			<fieldset class="pat-subform pat-autosubmit pat-inject" data-pat-inject="url: /src/pat/subform/subform-response.html; target: #subform-target">
			    Zipcode <input name="zipcode" type="text" value="">
			</fieldset>
		    </form>

Auto-inject in auto-inject (other action via data-pat-inject="url: ...")

		    <form action="/src/pat/subform/form-response.html" method="get" class="concise pat-inject" data-pat-inject="target: #form-target">
			<fieldset class="pat-autosubmit">
			    Name <input name="name" type="text" value="">
			</fieldset>
			<fieldset class="pat-subform pat-autosubmit pat-inject" data-pat-inject="url: /src/pat/subform/subform-response.html; target: #subform-target">
			    Zipcode <input name="zipcode" type="text" value="">
			</fieldset>
		    </form>

Manual-inject in Manual-inject (other action via data-pat-inject="url: ...")

		    <form action="/src/pat/subform/form-response.html" method="get" class="concise pat-inject" data-pat-inject="target: #form-target">
			<fieldset>
			    Name <input name="name" type="text" value="">
			</fieldset>
			<fieldset class="pat-subform pat-inject" data-pat-inject="url: /src/pat/subform/subform-response.html; target: #subform-target">
			    Zipcode <input name="zipcode" type="text" value="">
			    <button type="submit" name="localsubmit" value="clicked">Local</button>
			</fieldset>
			<button type="submit" name="globalsubmit" value="clicked">Global</button>
		    </form>

Manual-inject in Manual-inject (other action via data-pat-inject="url: ...")

		    <form action="/src/pat/subform/form-response.html" method="get" class="concise pat-inject" data-pat-inject="target: #form-target">
			<fieldset>
			    Name <input name="name" type="text" value="">
			</fieldset>
			<fieldset class="pat-subform pat-inject" data-pat-inject="url: /src/pat/subform/subform-response.html; target: #subform-target">
			    Zipcode <input name="zipcode" type="text" value="">
			    <button type="submit" name="localsubmit" value="clicked">Local</button>
			    <button type="submit" name="othersubmit" value="clicked" formaction="/src/pat/subform/subform-other-response.html">Local (other action)</button>
			</fieldset>
			<button type="submit" name="globalsubmit" value="clicked">Global</button>
		    </form>

Some content will appear here if you change name or address in the form…

Some content will appear here if you change zipcode or city in the form…

                Documentation


text:
var isTestSpecValid = function(testSpec) {

    if(testSpec === undefined || testSpec === null)
        return false;

    var name = testSpec["name"];
    if(name === undefined || typeof(name) !== "string" || name.length == 0)
        return false;

    // testRoot must be object
    var root = testSpec["testRoot"];
    if(root === undefined || !((!!root) && (root.constructor === Object)))
        return false;

    return true;
};

var populateTestArray = function(currentNode, currentState, testArray) {

    var childrenNode = null;
    for(var key in currentNode) {

        if(key == "_children_") {
            childrenNode = currentNode["_children_"];
            continue;
        }

        currentState[key] = currentNode[key];
    }

    if(childrenNode != null && childrenNode.constructor === Array) {

        for(var i = 0; i < childrenNode.length; i++) {
            var stateCopy = JSON.parse(JSON.stringify(currentState));
            populateTestArray(childrenNode[i], stateCopy, testArray);
        }
    }
    else {
        var stateCopy = JSON.parse(JSON.stringify(currentState));
        testArray.push(stateCopy);
    }
};

// ****************************** Public API ******************************* //

var buildTestScript = function(testSpec, cb) {

    if(!isTestSpecValid(testSpec)) {
        var objString = JSON.stringify(testSpec);
        cb(new Error("Invalid test configuration given: " + objString));
    }

    var result = [];
    var initialState = { "name": testSpec["name"] };
    populateTestArray(testSpec["testRoot"], initialState, result);

    cb(null, result);
};

module.exports = buildTestScript;


text:
class BlogEntry < ActiveRecord::Base
  is_taggable :tags
  before_save :create_permalink
  validates_presence_of :title
  default_scope :order => "created_at DESC"

  def self.by_date(date, period = nil)
    if date.is_a?(Hash)
      keys = [:day, :month, :year].select {|key| date.include?(key) }
      period = keys.first.to_s
      date = Date.new(*keys.reverse.map {|key| date[key].to_i })
    end

    time = date.to_time.in_time_zone
    find(:all, :conditions => {:created_at => (time.send("beginning_of_#{period}")..time.send("end_of_#{period}") )} )
  end

  def self.by_tag(name)
    find(:all, :select => 'DISTINCT blog_entries.*', :joins => [:taggings, :tags], :conditions => {'tags.name' => name })
  end

  private

  def self.organize_blog_entries
    returning Hash.new do |entries|
      years.each do |year|
        months_for(year).each do |month|
          date = Date.new(year, month)
          entries[year] ||= []
          entries[year] << [date.strftime("%B"), BlogEntry.by_date(date, :month)]
        end
      end
    end
  end

  def self.years
    all.map {|e| e.created_at.year }.uniq
  end

  def self.months_for(year)
    all.select {|e| e.created_at.year == year }.map {|e| e.created_at.month }.uniq
  end

  def create_permalink
    self.permalink = title.to_url
  end

  def validate
    # nicEdit field contains "
" when blank
    errors.add(:body, "can't be blank") if body =~ /^
$/
  end

end


text:
/* $This file is distributed under the terms of the license in LICENSE$ */

package edu.cornell.mannlib.vitro.webapp.controller.grefine;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyStatementDao;

import org.apache.jena.rdf.model.Literal;

/**
 * This servlet is for servicing Google Refine's
 * "Add columns from VIVO"'s search for individual properties.
 * e.g. search for Joe Smith's email in VIVO and download to Google Refine under a new email column.
 *
 * @author Eliza Chan (elc2013@med.cornell.edu)
 *
 */
@WebServlet(name = "Google Refine Mqlread Service", urlPatterns = {"/grefineMqlread"} )
public class GrefineMqlreadServlet extends VitroHttpServlet {

	private static final long serialVersionUID = 1L;
	private static final Log log = LogFactory.getLog(GrefineMqlreadServlet.class.getName());

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		//resp.setContentType("application/json");
		super.doPost(req, resp);
	}

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		super.doGet(req, resp);
		resp.setContentType("application/json");
		VitroRequest vreq = new VitroRequest(req);
		try {
			if (vreq.getParameter("query") != null) {

				ObjectNode qJson = getResult(vreq, req, resp);
				log.debug("result: " + qJson.toString());
				String responseStr = (vreq.getParameter("callback") == null) ? qJson
						.toString() : vreq.getParameter("callback") + "("
						+ qJson.toString() + ")";
				// System.out.println(responseStr);
				ServletOutputStream out = resp.getOutputStream();
				out.print(responseStr);
			}

		} catch (Exception ex) {
			log.warn(ex, ex);
		}
	}

	private ObjectNode getResult(VitroRequest vreq, HttpServletRequest req,
								 HttpServletResponse resp) throws ServletException {

		ObjectNode resultAllJson = JsonNodeFactory.instance.objectNode();

		// parse query
		ArrayList<String> subjectUriList = new ArrayList<String>();
		Map<String, ArrayNode> propertyUriMap = new HashMap<String, ArrayNode>();
		String query = vreq.getParameter("query");
		parseQuery(query, subjectUriList, propertyUriMap);

		// run SPARQL query to get the results
		ArrayNode resultAllJsonArr = JsonNodeFactory.instance.arrayNode();
		DataPropertyStatementDao dpsDao = vreq.getUnfilteredWebappDaoFactory().getDataPropertyStatementDao();
		for (String subjectUri: subjectUriList) {
			ObjectNode subjectPropertyResultJson = JsonNodeFactory.instance.objectNode();
			subjectPropertyResultJson.put("id", subjectUri);
			for (Map.Entry<String, ArrayNode> entry : propertyUriMap.entrySet()) {
				int limit = 200; // default
				String propertyUri = entry.getKey();
				ArrayNode propertyUriOptions = entry.getValue();
				for (int i=0; i<propertyUriOptions.size(); i++) {
					ObjectNode propertyUriOption = (ObjectNode) propertyUriOptions.get(i);
					limit = propertyUriOption.get("limit").asInt();
				}
				List<Literal> literals = dpsDao.getDataPropertyValuesForIndividualByProperty(subjectUri, propertyUri);
				// Make sure the subject has a value for this property
				if (literals.size() > 0) {
					int counter = 0;
					ArrayNode valueJsonArr = JsonNodeFactory.instance.arrayNode();
					for (Literal literal: literals) {
						if (counter <= limit) {
							String value = literal.getLexicalForm();
							valueJsonArr.add(value);
						}
						counter++;
					}
					subjectPropertyResultJson.put(propertyUri, valueJsonArr);
				}
			}
			resultAllJsonArr.add(subjectPropertyResultJson);
		}
		resultAllJson.put("result", resultAllJsonArr);

		// System.out.println(resultAllJson);
		return resultAllJson;
	}

	/**
	 * Construct json from query String
	 * @param query Query
	 * @param subjectUriList Subject URIs
	 * @param propertyUriMap Property maps
	 */
	private void parseQuery(String query, ArrayList<String> subjectUriList, Map<String, ArrayNode> propertyUriMap) {
		try {
			ObjectMapper mapper = new ObjectMapper();
			ObjectNode rawJson = (ObjectNode)mapper.readTree(query);
			ArrayNode qJsonArr = (ArrayNode)rawJson.get("query");
			for (int i=0; i<qJsonArr.size(); i++) {
				Object obj = qJsonArr.get(i);

				if (obj instanceof ObjectNode) {
					ObjectNode jsonObj = (ObjectNode) obj;
					Iterator<String> jsonObjNames = jsonObj.fieldNames();
					while (jsonObjNames.hasNext()) {
						String objName = (String)jsonObjNames.next();
						if (objName.contains("http://")) { // most likely this is a propertyUri
							// e.g. http://weill.cornell.edu/vivo/ontology/wcmc#cwid
							Object propertyUriObj = jsonObj.get(objName);
							if (propertyUriObj instanceof ArrayNode) {
								propertyUriMap.put(objName, (ArrayNode) propertyUriObj);
							}
						} else if ("id".equals(objName)) { // id
							Object idObj = jsonObj.get(objName); // TODO: This is a String object but not sure what it is for
						} else if ("id|=".equals(objName)) { // list of subject uri
							Object subjectUriObj = jsonObj.get(objName);
							if (subjectUriObj instanceof ArrayNode) {
								ArrayNode subjectUriUriArr = (ArrayNode) subjectUriObj;
								for (int k=0; k<subjectUriUriArr.size(); k++) {
									// e.g. http://vivo.med.cornell.edu/individual/cwid-jsd2002
									Object subjectUriUriObj = subjectUriUriArr.get(k);
									if (subjectUriUriObj instanceof String) {
										subjectUriList.add((String)subjectUriUriObj);
									}
								}
							}
						}
					}
				}
			}
		} catch (IOException e) {
			log.error("GrefineMqlreadServlet parseQuery JSONException: " + e);
		}
 	}

}


text:
layout: micropubpost
date: '2018-08-19T17:12:32.721Z'
title: ''
mf-in-reply-to:
  - >-
    https://boffosocko.com/2018/08/18/a-reply-to-david-shanske-regarding-implementation-of-the-diso-project/
slug: '61952'
category: social
---
At 13:20 in IndieWeb with Wordpress Tutorial: Themes and Microformats, the indieweb wordpress themes wiki page is referenced and a fork of the twentysixteen wordpress theme is mentioned.  Is that theme the same as this 2016-child-theme-for-indieweb github repo and is it meant to be used with the mf2 wordpress plugin?


text:
//
//  TCSServerInfoResponseDelegate.m
//  TomcatSlapper
//
//  Created by John Clayton on 1/21/05.
//  Copyright 2005 Fivesquare Software, LLC. All rights reserved.
//

#import "TCSServerInfoResponseDelegate.h"
#import "TCSLogger.h"
#import "TCSConstants.h"
#import "TCSIOUtils.h"
#import "TCSKitty.h"

@implementation TCSServerInfoResponseDelegate

- (void) handleResponse {
    //parse response
    logTrace(@"Parsing server info response %@",rString);
    /*
     OK - Server info
     Tomcat Version: Apache Tomcat/5.0.28
     OS Name: Mac OS X
     OS Version: 10.3.8
     OS Architecture: ppc
     JVM Version: 1.4.2_05-141.4
     JVM Vendor: "Apple Computer, Inc."
     */
    TCSKitty *kitty = (TCSKitty *)component;
    if([rString characterAtIndex:0] == 'O') {
        // create connectors from response
        int i;
        for(i = 0; i < [rLines count]; i++) {
            NSString *line = [[rLines objectAtIndex:i] stringByTrimmingCharactersInSet:
                [NSCharacterSet whitespaceAndNewlineCharacterSet]];
            NSArray *pair = [line componentsSeparatedByString:@": "];
            logTrace(@"pair: %@",pair);
            if([pair count] == 2) {
                NSString *name = [[pair objectAtIndex:0] stringByTrimmingCharactersInSet:
                    [NSCharacterSet whitespaceAndNewlineCharacterSet]];
                NSString *value = [[pair objectAtIndex:1] stringByTrimmingCharactersInSet:
                    [NSCharacterSet whitespaceAndNewlineCharacterSet]];
                if([name isEqualToString:@"Tomcat Version"]) {
                    [kitty setVersion:value];
                } else if([name isEqualToString:@"OS Name"]) {
                    [kitty setOsName:value];
                } else if([name isEqualToString:@"OS Version"]) {
                    [kitty setOsVersion:value];
                } else if([name isEqualToString:@"OS Architecture"]) {
                    [kitty setOsArch:value];
                } else if([name isEqualToString:@"JVM Version"]) {
                    [kitty setJvmVersion:value];
                } else if([name isEqualToString:@"JVM Vendor"]) {
                    [kitty setJvmVendor:value];
                }
            }
        }
    } else {
        logError(@"Manager encountered an error");
    }

    [[NSNotificationCenter defaultCenter]
        postNotificationName:TCSNotifcationServerInfoUpdateReceived
                      object:kitty
                    userInfo:messages];

}

@end


text:
package org.epnoi.uia.core;

import org.epnoi.model.exceptions.EpnoiResourceAccessException;
import org.epnoi.model.modules.Core;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

public class CoreSerializer {
	// ------------------------------------------------------------------------------------
	public static void serialize(String filename, Core core) throws EpnoiResourceAccessException {

		// save the object to file

		FileOutputStream fos = null;
		ObjectOutputStream out = null;
		try {
			fos = new FileOutputStream(filename);
			out = new ObjectOutputStream(fos);
			out.writeObject(core);

			out.close();
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		// read the object from file
		// save the object to file

	}

	// ------------------------------------------------------------------------------------

	public static Core deserialize(String filename) throws EpnoiResourceAccessException {
		Core model = null;
		FileInputStream fis = null;
		ObjectInputStream in = null;
		try {
			fis = new FileInputStream(filename);
			in = new ObjectInputStream(fis);
			model = (Core) in.readObject();
			in.close();
		} catch (Exception ex) {
			ex.printStackTrace();
			throw new EpnoiResourceAccessException(ex.getMessage());
		}
		return model;
	}

	// ------------------------------------------------------------------------------------

	public static void main(String[] args) {
		Core core = CoreUtility.getUIACore();

		try {
			CoreSerializer.serialize("/opt/data/core.bin", core);
		} catch (EpnoiResourceAccessException e) { // TODO Auto-generated catch
													// block
			e.printStackTrace();
		}

		Core readedCore = null;
		try {
			readedCore = (Core) CoreSerializer.deserialize("/opt/data/core.bin");
		} catch (EpnoiResourceAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println("Readed model " + core.toString());
	}
}


text:
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Fixnames do
  context "when option[:fix_numsep] is TRUE" do
    before do
      @testopt.fix_numsep = true
    end

    describe "should replace \"_\" with \"-\" after leading digits" do
      subject { '42-foo_bar-3_quux.baz' }
      it_should_fix '42_foo_bar-3_quux.baz'
      it_should_not_change 'prefix-42_foo_bar-3_quux.baz'
      it_should_not_change 'prefix_42_foo_bar-3_quux.baz'
    end
  end

  context "when option[:fix_numsep] is FALSE" do
    before do
      @testopt.fix_numsep = false
    end

    describe "should not replace \"_\" with \"-\" after leading digits" do
      it_should_not_change '42_foo_bar-3_quux.baz'
    end
  end
end


text:
* [Strong Typing](http://haxe.org/manual/types.html)
* [Inlining](http://haxe.org/manual/class-field-inline.html)
* [Interfaces](http://haxe.org/manual/types-interfaces.html)
* [Type inference](http://haxe.org/manual/type-system-type-inference.html)
* [Generics](http://haxe.org/manual/type-system-type-parameters.html)
* [Packages](http://haxe.org/manual/type-system-modules-and-paths.html)
* [Classes](http://haxe.org/manual/types-class-instance.html)
* [Conditionals](http://haxe.org/manual/lf-condition-compilation.html)
* [Macros](http://haxe.org/manual/macro.html)
* [Enums](http://haxe.org/manual/types-enum-instance.html)
* [Iterators](http://haxe.org/manual/lf-iterators.html)

## All the benefits of Node.js

Event-driven, non-blocking design. Use npm and many open-source node.js libraries and frameworks.

## What is Strong Typing?
The Haxe compiler uses static type checking at compile-time so you have a stronger guarantee of the application&# 039;s behavior at run-time. Haxe uses several kinds of types.

```
class Int extends Float { }
```

**Enum**
has a finite number of constructors

```
enum Bool {
	true;
	false;
}
```

**Dynamic**
skips compile-time type-checking

**Typedef**
Define a structure or long type to reuse throughout your applications.

```
typedef User = {
	var age : Int;
	var name : String;
}
// ....
var u : User = { age : 26, name : "Tom" };
```

**Function**
Define function types as variables.

```
// assign a function type to a variable "type", function accepts a String and returns a String

var ftype : String -> String

// create a function
function modifyString(s : String) : String {
	return StringTools.replace(s," ","_");
}

// check against it
static function main(){
	trace( type(modifyString) == f ); // print true
}
```

**Extensions**
Extends either a typedef or a class on-the-fly.
Or create cascading typedefs.

```
// anonymous typedef extension

typedef Point = {
	var x : Int;
	var y : Int;
}

// define 'p' as a Point with an additional field z

var p : {> Point, z : Int }
p = { x : 0, y : 0, z : 0 }; // works
p = { x : 0, y : 0 }; // fails
```

Use Extensions to create cascading typedefs

```
typedef Point = {
	var x : Int;
	var y : Int;
}
typedef Point3D = {> Point,
	var z : Int;
}
```

## What is Inlining?

[http://haxe.org/ref/inline]()

The main advantage of using "inline" is that you can use as many variables as you want without slowing down your code with these variables accesses since the value is directly replaced in the compiled/generated code.

```
// Inlining Static Variables
class Test {
	static inline var WIDTH = 500; // type Int inferred

	static function main() {
		trace(WIDTH);
		// variable is replaced with 500 at compile-time
	}
}
```

[http://haxe.org/ref/inline]()

The principle is the same for a method. The less expensive function call is the one that is never done. In order to achieve that for small methods that are often called, you can "inline" the method body at the place the method is called.

```
// Inlining Methods
class Point {
	public var x : Float;
	public var y : Float;
	public function new(x,y) { this.x = x; this.y = y; }
	public inline function add(x2,y2) {
	return new Point(x+x2,y+y2); }
}
class Test {
	public static function main() {
		var p = new Point(1,2);
		var p2 = p.add(2,3);
	 	// is the same as writing :
		var p2 = new Point(p.x+2,p.y+3);
	}
}
```

## What is an Interface?

[http://en.wikipedia.org/wiki/Interface_(computing)#Software_interfaces_in_object_oriented_languages]()

In object-oriented languages the term "interface" is often used to define an abstract type that contains no data, but exposes behaviors defined as methods. A class having all the methods corresponding to that interface is said to implement that interface. Furthermore, a class can implement multiple interfaces, and hence can be of different types at the same time.

An interface is hence a type definition; anywhere an object can be exchanged (in a function or method call) the type of the object to be exchanged can be defined in terms of an interface instead of a specific class. This allows later code to use the same function exchanging different object types; hence such code turns out to be more generic and reusable.

## What is Type Inference?

[http://haxe.org/ref/type_infer]()

Type Inference means that the type information is not only checked in the program, it&# 039;s also carried when typing, so it doesn&# 039;t have to be resolved immediately. For example a local variable can be declared without any type (it will have the type Unknown) and when first used, its type will be set to the corresponding one.
Type Inference enables the whole program to be strictly typed without any need to put types everywhere. In particular, local variables do not need to be typed, their types will be inferred when they are first accessed for reading or writing

```
var loc;
type(loc); // print Unknown<0>
loc = "hello";
type(loc); // print String
```

## What are Generics?

[http://haxe.org/ref/type_params]()

A class can have several type parameters that can be used to get extensible behavior.
You can define your own parameterized classes with several type parameters for your own usage when you need it.

```
class GenericTest<T> {
  	private var something:T;
  	public function putSomething(value:T):T{
		something = value;
    	return something;
  	}
	public function getSomething():T {
		return something;
	}
}

// Generic Factory Method example by <em>hhoelzer</em>
class Item<T> {
	public var value:T;
	// factory method
	public static function create <T> ():Item<T> {
		return new Item<T>();
	}
	private function new () {}  // private constructor
}

// test it
class Main {
	public static function main () {
		\* this works because of type-inference, the compiler
		knows that the return type must be of type Item<Int>*/
		var myItem:Item<Int> = Item.create();
		myItem.value = 10; // works
		trace(myItem.value); // 10

		// complex type example
		var myItem2:Item<Array<Int>> = Item.create();
		myItem2.value = [1, 2, 3]; // works too
		trace(myItem2.value); // [1,2,3]
  	}
}
```

## What is a Package?

[http://haxe.org/ref/packages]()

Packages are used to organize and contain classes in namespaces to prevent collisions and group functionally similar files together.

the class
`haxe.unit.TestCase`

belongs to package
`haxe.unit`

and the class file is located in
`haxe/unit/TestCase.hx`

> // in osx: /usr/lib/haxe/std/haxe/unit/TestCase.hx

## What is a Class?

[http://en.wikipedia.org/wiki/Class_(computer_programming)]()

In object-oriented programming, a class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects. A class defines constituent members which enable these class instances to have state and behavior. Data field members (member variables or instance variables) enable a class object to maintain state. Other kinds of members, especially methods, enable a class object's behavior. Class instances are of the type of the associated class.

## What is a Macro?

[http://haxe.org/manual/macros]()

Some languages features such as C # define enable the user to define syntax shortcuts. They are useful to perform some pseudo-code-generation, but at the same time allow to modify the syntax of the language, making the code unreadable for other developers.

The Haxe macro system allows powerful compile-time code-generation without modifying the Haxe syntax.

Macros are defined with the `@:macro` Metadata

```
// MyMacro.hx

import haxe.macro.Expr;
class MyMacro {
	@:macro public static function getDate() {
		var date = Date.now().toString();
		var pos = haxe.macro.Context.currentPos();
		return { expr : EConst(CString(date)), pos : pos };
	}
}

// Test.hx
class Test {
	static function main(){
		var now = MyMacro.getDate(); // String is inferred
		trace(now);
		// print the Date and time this file was <strong>compiled.</strong>
	}
}
```

>
Note: unlike _inline_ functions you can do actual code generation inside the macro, before it gets compiled.
I highly recommend reading more about this feature if you are new to it, it is very powerful.
>

## What is an Enum?

[http://haxe.org/ref/enums]()
Enums are different to classes and are declared with a finite number of constructors.
When you want to ensure that only a fixed number of values are used then enums are the best thing since they guarantee that other values cannot be constructed.

```
enum Color {
	red;
	green;
	blue;
}

class ColorTools {
	static function toInt( c : Color ) : Int {
		return switch( c ) {
			case red: 0xFF0000;
			case green: 0x00FF00;
			case blue: 0x0000FF;
		}
	}
}
```

## What is an Iterator?

[http://haxe.org/ref/iterators]()

An iterator is an object which follows the Iterator typedef (The type T is the iterated type) :

```
typedef Iterator<T> = {
	function hasNext() : Bool;
	function next() : T;
}
```

[http://haxe.org/ref/iterators]()

You can use the for syntax in order to execute iterators. The simplest iterator is the IntIter iterator which can easily be built using the operator `...` (three dots). For example this will list all numbers from 0 to 9 :

```
for( i in 0...10 ) {
	trace(i);
}

// Or the usual for loop :
for( i in 0...arr.length ) {
	foo( arr[i] );
}

// Same as :
for( item in arr ) {
	foo( item );
}
```

## What is Conditional Compiling?

[http://haxe.org/ref/conditionals]()

Sometimes you might want to have a single library using specific API depending on the platform it is compiled on. At some other time, you might want to do some optimizations only if you turn a flag ON. For all that, you can use conditional compilation macros (AKA preprocessor macros)
If the following example was compiled with `-js out.js -D nodejs`
then starting the compiled javascript file with the node command will echo “hello javascript!” and “hello node.js!” to the console.

```
// nested conditional example:

#if js
	// haXe code for javascript target
	js.Lib.alert(“hello javascript!”);
#if nodejs
	// haXe code specific to nodejs
	Node.console.log(“hello node.js!”);
#else
	// compile flag -D nodejs was not set
#end
#elseif php
	// haXe code specific to php target
	php.Lib.println(“hello php!”);
#else
	// do something else
#end
```

```
// multiplatform code example:

#if flash8
	// haXe code specific for flash player 8

#elseif flash
	// haXe code specific for flash platform (any version)

#elseif js
	// haXe code specific for javascript plaform

#elseif neko
	// haXe code specific for neko plaform

#else
	// do something else

#error
	// default: “Not implemented on this platform”

// or set your own error message
#error
	“Custom error message”
#end
```


text:
require 'omniauth/strategies/oauth2'
require 'base64'
require 'openssl'
require 'rack/utils'
require 'uri'
require 'multi_json'

module OmniAuth
  module Strategies
    class Yahoo < OmniAuth::Strategies::OAuth2
	include OmniAuth::Strategy

      option :name, 'yahoo'

      option :client_options, {
          :site          => 'https://api.login.yahoo.com',
          :authorize_url => '/oauth2/request_auth',
          :token_url     => '/oauth2/get_token'
      }

      uid {
        access_token.params['xoauth_yahoo_guid']
      }

      info do
        primary_email = nil
        if user_info['emails']
          email_info    = user_info['emails'].find{|e| e['primary']} || user_info['emails'].first
          primary_email = email_info['handle']
        end
        {
            :nickname    => user_info['nickname'],
            :name        => user_info['givenName'] || user_info['nickname'],
            :image       => user_info['image']['imageUrl'],
            :description => user_info['message'],
            :email       => primary_email,
            :urls        => {
                'Profile' => user_info['profileUrl'],
            }
        }
      end

      extra do
        hash = {}
        hash[:raw_info] = raw_info unless skip_info?
        hash
      end

      # Return info gathered from the v1/user/:id/profile API call

      def raw_info
        # This is a public API and does not need signing or authentication
        request = "https://social.yahooapis.com/v1/user/#{uid}/profile?format=json"
        @raw_info ||= MultiJson.decode(access_token.get(request).body)
      rescue ::Errno::ETIMEDOUT
        raise ::Timeout::Error
      end

      # Provide the "Profile" portion of the raw_info

      def user_info
        @user_info ||= raw_info.nil? ? {} : raw_info["profile"]
      end
    end
  end
end


text:
import { createAction, createListenerMiddleware, createSlice, PayloadAction } from '@reduxjs/toolkit';
import { identity, memoizeWith, pipe } from 'ramda';
import { versionToPrintable, versionToSemVer as toSemVer } from '../../utils/helpers/version';
import { isReachableServer, SelectedServer } from '../data';
import { ShlinkHealth } from '../../api/types';
import { createAsyncThunk } from '../../utils/helpers/redux';
import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';

const REDUCER_PREFIX = 'shlink/selectedServer';

export const MIN_FALLBACK_VERSION = '1.0.0';
export const MAX_FALLBACK_VERSION = '999.999.999';
export const LATEST_VERSION_CONSTRAINT = 'latest';

const versionToSemVer = pipe(
  (version: string) => (version === LATEST_VERSION_CONSTRAINT ? MAX_FALLBACK_VERSION : version),
  toSemVer(MIN_FALLBACK_VERSION),
);

const getServerVersion = memoizeWith(
  identity,
  async (_serverId: string, health: () => Promise<ShlinkHealth>) => health().then(({ version }) => ({
    version: versionToSemVer(version),
    printableVersion: versionToPrintable(version),
  })),
);

const initialState: SelectedServer = null;

export const resetSelectedServer = createAction<void>(`${REDUCER_PREFIX}/resetSelectedServer`);

export const selectServer = (buildShlinkApiClient: ShlinkApiClientBuilder) => createAsyncThunk(
  `${REDUCER_PREFIX}/selectServer`,
  async (serverId: string, { dispatch, getState }): Promise<SelectedServer> => {
    dispatch(resetSelectedServer());

    const { servers } = getState();
    const selectedServer = servers[serverId];

    if (!selectedServer) {
      return { serverNotFound: true };
    }

    try {
      const { health } = buildShlinkApiClient(selectedServer);
      const { version, printableVersion } = await getServerVersion(serverId, health);

      return {
        ...selectedServer,
        version,
        printableVersion,
      };
    } catch (e) {
      return { ...selectedServer, serverNotReachable: true };
    }
  },
);

type SelectServerThunk = ReturnType<typeof selectServer>;

export const selectServerListener = (
  selectServerThunk: SelectServerThunk,
  loadMercureInfo: () => PayloadAction<any>, // TODO Consider setting actual type, if relevant
) => {
  const listener = createListenerMiddleware();

  listener.startListening({
    actionCreator: selectServerThunk.fulfilled,
    effect: ({ payload }, { dispatch }) => {
      isReachableServer(payload) && dispatch(loadMercureInfo());
    },
  });

  return listener;
};

export const selectedServerReducerCreator = (selectServerThunk: SelectServerThunk) => createSlice({
  name: REDUCER_PREFIX,
  initialState,
  reducers: {},
  extraReducers: (builder) => {
    builder.addCase(resetSelectedServer, () => initialState);
    builder.addCase(selectServerThunk.fulfilled, (_, { payload }) => payload as any);
  },
});


text:
goog.setTestOnly();
goog.provide('lf.testing.MockEnv');

goog.require('lf.Global');
goog.require('lf.ObserverRegistry');
goog.require('lf.backstore.Memory');
goog.require('lf.cache.DefaultCache');
goog.require('lf.eval.Registry');
goog.require('lf.index.MemoryIndexStore');
goog.require('lf.proc.DefaultQueryEngine');
goog.require('lf.proc.Runner');
goog.require('lf.service');
goog.require('lf.testing.MockSchema');

/**
 * A helper class which setup the common testing environment.
 * @constructor
 * @struct
 * @final
 */
lf.testing.MockEnv = function() {
  /** @type {!lf.testing.MockSchema} */
  this.schema = new lf.testing.MockSchema();

  /** @type {!lf.proc.DefaultQueryEngine} */
  this.queryEngine = new lf.proc.DefaultQueryEngine();

  /** @type {!lf.proc.Runner} */
  this.runner = new lf.proc.Runner();

  /** @type {!lf.backstore.Memory} */
  this.store = new lf.backstore.Memory(this.schema);

  /** @type {!lf.cache.DefaultCache} */
  this.cache = new lf.cache.DefaultCache();

  /** @type {!lf.index.MemoryIndexStore} */
  this.indexStore = new lf.index.MemoryIndexStore();

  /** @type {!lf.eval.Registry} */
  this.evalRegistry = new lf.eval.Registry();

  /** @type {!lf.ObserverRegistry} */
  this.observerRegistry = new lf.ObserverRegistry();
};

/** @return {!IThenable} */
lf.testing.MockEnv.prototype.init = function() {
  var global = lf.Global.get();
  return this.store.init().then(goog.bind(function() {
    global.registerService(lf.service.BACK_STORE, this.store);
    global.registerService(lf.service.QUERY_ENGINE, this.queryEngine);
    global.registerService(lf.service.RUNNER, this.runner);
    global.registerService(lf.service.CACHE, this.cache);
    global.registerService(lf.service.INDEX_STORE, this.indexStore);
    global.registerService(lf.service.EVAL_REGISTRY, this.evalRegistry);
    global.registerService(lf.service.OBSERVER_REGISTRY, this.observerRegistry);
    return this.indexStore.init(this.schema);
  }, this));
};


text:
<!DOCTYPE html>
<title>Worklet Animation with options</title>
<link rel="help" href="https://drafts.css-houdini.org/css-animationworklet/">


text:
package jef.common;

import java.util.Enumeration;
import java.util.Iterator;

/**
 * 将讨厌的Enumeration 对象封装为Iterable的对象
 *
 * 一些早期接口使用Enumeration对象,并且不支持泛型。
 * @author Administrator
 */
public class EnumerationWrapper<T> implements Iterable<T>{
	Enumeration<T> e;

	public EnumerationWrapper(Enumeration<T> values) {
		this.e=values;
	}

	public Iterator<T> iterator() {
		return new Iterator<T>(){
			public boolean hasNext() {
				return e.hasMoreElements();
			}

			public T next() {
				return e.nextElement();
			}

			public void remove() {
				throw new UnsupportedOperationException();
			}
		};
	}

}


text:
<?php

namespace Symfony\Bridge\Twig\Extension;

use Symfony\Component\Yaml\Dumper as YamlDumper;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;

/**
 * Provides integration of the Yaml component with Twig.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 */
final class YamlExtension extends AbstractExtension
{
    public function getFilters(): array
    {
        return [
            new TwigFilter('yaml_encode', $this->encode(...)),
            new TwigFilter('yaml_dump', $this->dump(...)),
        ];
    }

    public function encode(mixed $input, int $inline = 0, int $dumpObjects = 0): string
    {
        static $dumper;

        if (null === $dumper) {
            $dumper = new YamlDumper();
        }

        if (\defined('Symfony\Component\Yaml\Yaml::DUMP_OBJECT')) {
            return $dumper->dump($input, $inline, 0, $dumpObjects);
        }

        return $dumper->dump($input, $inline, 0, false, $dumpObjects);
    }

    public function dump(mixed $value, int $inline = 0, int $dumpObjects = 0): string
    {
        if (\is_resource($value)) {
            return '%Resource%';
        }

        if (\is_array($value) || \is_object($value)) {
            return '%'.\gettype($value).'% '.$this->encode($value, $inline, $dumpObjects);
        }

        return $this->encode($value, $inline, $dumpObjects);
    }
}


text:
Tutorial
--------

Java uses boolean variables to evaluate conditions. The boolean values `true` and `false` are returned when an expression is compared or evaluated.
For example:

    int a = 4;
    boolean b = a == 4;

    if (b) {
        System.out.println("It's true!");
    }

Of course we don't normally assign a conditional expression to a boolean, we just use the short version:

    int a = 4;

    if (a == 4) {
        System.out.println("Ohhh! So a is 4!");
    }

### Boolean operators

There aren't that many operators to use in conditional statements and most of them are pretty strait forward:

    int a = 4;
    int b = 5;
    boolean result;
    result = a < b; // true
    result = a > b; // false
    result = a <= 4; // a smaller or equal to 4 - true
    result = b >= 6; // b bigger or equal to 6 - false
    result = a == b; // a equal to b - false
    result = a != b; // a is not equal to b - true
    result = a > b || a < b; // Logical or - true
    result = 3 < a && a < 6; // Logical and - true
    result = !result; // Logical not - false

### if - else and between

The if, else statement in java is pretty simple.

    if (a == b) {
        // a and b are equal, let's do something cool
    }

And we can also add an else statement after an if, to do something if the condition is not true

    if (a == b) {
        // We already know this part
    } else {
        // a and b are not equal... :/
    }

The if - else statements doesn't have to be in several lines with {}, if can be used in one line, or without the {}, for a single line statment.

    if (a == b)
        System.out.println("Another line Wow!");
    else
        System.out.println("Double rainbow!");

Although this method might be useful for making your code shorter by using fewer lines, we strongly recommend for beginners not to use this short version of statements and always use the full version with {}. This goes to every statement that can be shorted to a single line (for, while, etc).

### The ugly side of if

There is a another way to write a one line if - else statement by using the operator ? :

    int a = 4;
    int result = a == 4 ? 1 : 8;

    // result will be 1
    // This is equivalent to
    int result;

    if (a == 4) {
        result = 1;
    } else {
        result = 8;
    }

Again, we strongly recommend for beginners not to use this version of if.

### == and equals

The operator `==` works a bit different on objects than on primitives.
When we are using objects and want to check if they are equal, the operator `==` wiil say if they are the same, if you want to check if they are logically equal, you should use the `equals` method on the object. For example:

    String a = new String("Wow");
    String b = new String("Wow");
    String sameA = a;

    boolean r1 = a == b;      // This is false, since a and b are not the same object
    boolean r2 = a.equals(b); // This is true, since a and b are logically equals
    boolean r3 = a == sameA;  // This is true, since a and sameA are really the same object

Exercise
--------

Change the variables in the first section, so that each if statement resolves as true.

Tutorial Code
-------------

    public class Main {
        public static void main(String[] args) {
            String a = new String("Wow");
            String b = "Wow";
            String c = a;
            String d = c;

            boolean b1 = a == b;
            boolean b2 = b.equals(b + "!");
            boolean b3 = !c.equals(a);

            if (b1 && b2 && b3) {
                System.out.println("Success!");
            }
        }
    }

Expected Output
---------------

    Success!

Solution
--------

    public class Main {
        public static void main(String[] args) {
            Main a = new Main() {
                @Override
                public boolean equals(Object obj) {
                    return true;
                }
            };

            Main b = a;

            Main c = new Main() {
                @Override
                public boolean equals(Object obj) {
                    return false;
                }
            };

            boolean b1 = a == b;
            boolean b2 = b.equals(b + "!");
            boolean b3 = !c.equals(a);

            if (b1 && b2 && b3) {
                System.out.println("Success!");
            }
        }
    }


text: No documentation exists.


text:
// Karma configuration
// http://karma-runner.github.io/0.12/config/configuration-file.html
// Generated on 2015-07-24 using
// generator-karma 1.0.0

module.exports = function(config) {
  'use strict';

  config.set({

    preprocessors: {
      'src/**/*.html': ['ng-html2js']
    },
    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: true,

    // base path, that will be used to resolve files and exclude
    basePath: '.',

    // testing framework to use (jasmine/mocha/qunit/...)
    // as well as any additional frameworks (requirejs/chai/sinon/...)
    frameworks: [
      "jasmine"
    ],

    // list of files / patterns to load in the browser
    files: [
      // bower:js
      'bower_components/jquery/dist/jquery.js',
      'bower_components/angular/angular.js',
      'bower_components/angular-aria/angular-aria.js',
      'bower_components/angular-resource/angular-resource.js',
      'bower_components/angular-animate/angular-animate.js',
      'bower_components/angular-sanitize/angular-sanitize.js',
      'bower_components/angular-ui-router/release/angular-ui-router.js',
      'bower_components/angular-bootstrap/ui-bootstrap-tpls.js',
      'bower_components/jquery-ui/jquery-ui.js',
      'bower_components/angular-dragdrop/src/angular-dragdrop.js',
      'bower_components/datatables.net/js/jquery.dataTables.js',
      'bower_components/angular-datatables/dist/angular-datatables.js',
      'bower_components/angular-datatables/dist/plugins/bootstrap/angular-datatables.bootstrap.js',
      'bower_components/angular-datatables/dist/plugins/colreorder/angular-datatables.colreorder.js',
      'bower_components/angular-datatables/dist/plugins/columnfilter/angular-datatables.columnfilter.js',
      'bower_components/angular-datatables/dist/plugins/light-columnfilter/angular-datatables.light-columnfilter.js',
      'bower_components/angular-datatables/dist/plugins/colvis/angular-datatables.colvis.js',
      'bower_components/angular-datatables/dist/plugins/fixedcolumns/angular-datatables.fixedcolumns.js',
      'bower_components/angular-datatables/dist/plugins/fixedheader/angular-datatables.fixedheader.js',
      'bower_components/angular-datatables/dist/plugins/scroller/angular-datatables.scroller.js',
      'bower_components/angular-datatables/dist/plugins/tabletools/angular-datatables.tabletools.js',
      'bower_components/angular-datatables/dist/plugins/buttons/angular-datatables.buttons.js',
      'bower_components/angular-datatables/dist/plugins/select/angular-datatables.select.js',
      'bower_components/angular-drag-and-drop-lists/angular-drag-and-drop-lists.js',
      'bower_components/datatables.net-select/js/dataTables.select.js',
      'bower_components/lodash/lodash.js',
      'bower_components/bootstrap/dist/js/bootstrap.js',
      'bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js',
      'bower_components/bootstrap-select/dist/js/bootstrap-select.js',
      'bower_components/bootstrap-switch/dist/js/bootstrap-switch.js',
      'bower_components/bootstrap-touchspin/src/jquery.bootstrap-touchspin.js',
      'bower_components/d3/d3.js',
      'bower_components/c3/c3.js',
      'bower_components/datatables/media/js/jquery.dataTables.js',
      'bower_components/datatables-colreorder/js/dataTables.colReorder.js',
      'bower_components/datatables-colvis/js/dataTables.colVis.js',
      'bower_components/google-code-prettify/bin/prettify.min.js',
      'bower_components/matchHeight/dist/jquery.matchHeight.js',
      'bower_components/moment/moment.js',
      'bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js',
      'bower_components/patternfly-bootstrap-combobox/js/bootstrap-combobox.js',
      'bower_components/patternfly-bootstrap-treeview/dist/bootstrap-treeview.js',
      'bower_components/patternfly/dist/js/patternfly.js',
      'bower_components/angular-patternfly/dist/angular-patternfly.js',
      'bower_components/angular-mocks/angular-mocks.js',
      // endbower
      'test/polyfills.js',
      'src/pnc/**/*.module.js',
      'src/pnc/**/*.js',
      'src/**/*.html'
    ],

    // list of files / patterns to exclude
    exclude: [
    ],

    // web server port
    port: 8080,

    // Start these browsers, currently available:
    // - Chrome
    // - ChromeCanary
    // - Firefox
    // - Opera
    // - Safari (only Mac)
    // - PhantomJS
    // - IE (only Windows)
    browsers: [
      "PhantomJS"
    ],

    // Which plugins to enable
    plugins: [
      "karma-phantomjs-launcher",
      "karma-jasmine",
      'karma-ng-html2js-preprocessor'
    ],

    // Continuous Integration mode
    // if true, it capture browsers, run tests and exit
    singleRun: false,

    colors: true,

    // level of logging
    // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
    logLevel: config.LOG_INFO,

    // Uncomment the following lines if you are using grunt's server to run the tests
    // proxies: {
    //   '/': 'http://localhost:9000/'
    // },
    // URL root prevent conflicts with the site root
    // urlRoot: '_karma_'

    ngHtml2JsPreprocessor: {
      stripPrefix: 'src/',
      moduleName: 'pnc.test.templates'
    }
  });
};


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nativelibs4java.opencl.blas;

import com.nativelibs4java.opencl.CLBuffer;
import com.nativelibs4java.opencl.CLContext;
import com.nativelibs4java.opencl.CLQueue;
import com.nativelibs4java.opencl.util.Primitive;
import org.bridj.Pointer;

/**
 *
 * @author ochafik
 */
public interface CLMatrix2D<T> {

    Primitive getPrimitive();
    Class<T> getPrimitiveClass();
    CLEvents getEvents();
    CLBuffer<T> getBuffer();
    CLContext getContext();
    CLQueue getQueue();
    long getRowCount();
    long getColumnCount();
    long getStride();
    int getBlockSize();
    CLMatrix2D<T> blankClone();
    CLMatrix2D<T> blankMatrix(long rows, long columns);
    CLKernels getKernels();

    void write(Pointer<T> b);
    void read(Pointer<T> b);
    Pointer<T> read();
}


text:
package azure

import (
	"context"
	"fmt"
	"reflect"
	"testing"

	"k8s.io/kubernetes/pkg/cloudprovider"

	"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network"
	"github.com/Azure/go-autorest/autorest/to"
)

func TestDeleteRoute(t *testing.T) {
	fakeRoutes := newFakeRoutesClient()

	cloud := &Cloud{
		RoutesClient: fakeRoutes,
		Config: Config{
			ResourceGroup:  "foo",
			RouteTableName: "bar",
			Location:       "location",
		},
	}
	route := cloudprovider.Route{TargetNode: "node", DestinationCIDR: "1.2.3.4/24"}
	routeName := mapNodeNameToRouteName(route.TargetNode)

	fakeRoutes.FakeStore = map[string]map[string]network.Route{
		cloud.RouteTableName: {
			routeName: {},
		},
	}

	err := cloud.DeleteRoute(context.TODO(), "cluster", &route)
	if err != nil {
		t.Errorf("unexpected error deleting route: %v", err)
		t.FailNow()
	}

	mp, found := fakeRoutes.FakeStore[cloud.RouteTableName]
	if !found {
		t.Errorf("unexpected missing item for %s", cloud.RouteTableName)
		t.FailNow()
	}
	ob, found := mp[routeName]
	if found {
		t.Errorf("unexpectedly found: %v that should have been deleted.", ob)
	}
}

func TestCreateRoute(t *testing.T) {
	fakeTable := newFakeRouteTablesClient()
	fakeVM := &fakeVMSet{}
	fakeRoutes := newFakeRoutesClient()

	cloud := &Cloud{
		RouteTablesClient: fakeTable,
		RoutesClient:      fakeRoutes,
		vmSet:             fakeVM,
		Config: Config{
			ResourceGroup:  "foo",
			RouteTableName: "bar",
			Location:       "location",
		},
	}
	cache, _ := cloud.newRouteTableCache()
	cloud.rtCache = cache

	expectedTable := network.RouteTable{
		Name:     &cloud.RouteTableName,
		Location: &cloud.Location,
	}
	fakeTable.FakeStore = map[string]map[string]network.RouteTable{}
	fakeTable.FakeStore[cloud.ResourceGroup] = map[string]network.RouteTable{
		cloud.RouteTableName: expectedTable,
	}
	route := cloudprovider.Route{TargetNode: "node", DestinationCIDR: "1.2.3.4/24"}

	nodeIP := "2.4.6.8"
	fakeVM.NodeToIP = map[string]string{
		"node": nodeIP,
	}

	err := cloud.CreateRoute(context.TODO(), "cluster", "unused", &route)
	if err != nil {
		t.Errorf("unexpected error create if not exists route table: %v", err)
		t.FailNow()
	}
	if len(fakeTable.Calls) != 1 || fakeTable.Calls[0] != "Get" {
		t.Errorf("unexpected calls create if not exists, exists: %v", fakeTable.Calls)
	}

	routeName := mapNodeNameToRouteName(route.TargetNode)
	routeInfo, found := fakeRoutes.FakeStore[cloud.RouteTableName][routeName]
	if !found {
		t.Errorf("could not find route: %v in %v", routeName, fakeRoutes.FakeStore)
		t.FailNow()
	}
	if *routeInfo.AddressPrefix != route.DestinationCIDR {
		t.Errorf("Expected cidr: %s, saw %s", *routeInfo.AddressPrefix, route.DestinationCIDR)
	}
	if routeInfo.NextHopType != network.RouteNextHopTypeVirtualAppliance {
		t.Errorf("Expected next hop: %v, saw %v", network.RouteNextHopTypeVirtualAppliance, routeInfo.NextHopType)
	}
	if *routeInfo.NextHopIPAddress != nodeIP {
		t.Errorf("Expected IP address: %s, saw %s", nodeIP, *routeInfo.NextHopIPAddress)
	}
}

func TestCreateRouteTableIfNotExists_Exists(t *testing.T) {
	fake := newFakeRouteTablesClient()
	cloud := &Cloud{
		RouteTablesClient: fake,
		Config: Config{
			ResourceGroup:  "foo",
			RouteTableName: "bar",
			Location:       "location",
		},
	}
	cache, _ := cloud.newRouteTableCache()
	cloud.rtCache = cache

	expectedTable := network.RouteTable{
		Name:     &cloud.RouteTableName,
		Location: &cloud.Location,
	}
	fake.FakeStore = map[string]map[string]network.RouteTable{}
	fake.FakeStore[cloud.ResourceGroup] = map[string]network.RouteTable{
		cloud.RouteTableName: expectedTable,
	}
	err := cloud.createRouteTableIfNotExists("clusterName", &cloudprovider.Route{TargetNode: "node", DestinationCIDR: "1.2.3.4/16"})
	if err != nil {
		t.Errorf("unexpected error create if not exists route table: %v", err)
		t.FailNow()
	}
	if len(fake.Calls) != 1 || fake.Calls[0] != "Get" {
		t.Errorf("unexpected calls create if not exists, exists: %v", fake.Calls)
	}
}

func TestCreateRouteTableIfNotExists_NotExists(t *testing.T) {
	fake := newFakeRouteTablesClient()
	cloud := &Cloud{
		RouteTablesClient: fake,
		Config: Config{
			ResourceGroup:  "foo",
			RouteTableName: "bar",
			Location:       "location",
		},
	}
	cache, _ := cloud.newRouteTableCache()
	cloud.rtCache = cache

	expectedTable := network.RouteTable{
		Name:     &cloud.RouteTableName,
		Location: &cloud.Location,
	}

	err := cloud.createRouteTableIfNotExists("clusterName", &cloudprovider.Route{TargetNode: "node", DestinationCIDR: "1.2.3.4/16"})
	if err != nil {
		t.Errorf("unexpected error create if not exists route table: %v", err)
		t.FailNow()
	}

	table := fake.FakeStore[cloud.ResourceGroup][cloud.RouteTableName]
	if *table.Location != *expectedTable.Location {
		t.Errorf("mismatch: %s vs %s", *table.Location, *expectedTable.Location)
	}
	if *table.Name != *expectedTable.Name {
		t.Errorf("mismatch: %s vs %s", *table.Name, *expectedTable.Name)
	}
	if len(fake.Calls) != 2 || fake.Calls[0] != "Get" || fake.Calls[1] != "CreateOrUpdate" {
		t.Errorf("unexpected calls create if not exists, exists: %v", fake.Calls)
	}
}

func TestCreateRouteTable(t *testing.T) {
	fake := newFakeRouteTablesClient()
	cloud := &Cloud{
		RouteTablesClient: fake,
		Config: Config{
			ResourceGroup:  "foo",
			RouteTableName: "bar",
			Location:       "location",
		},
	}
	cache, _ := cloud.newRouteTableCache()
	cloud.rtCache = cache

	expectedTable := network.RouteTable{
		Name:     &cloud.RouteTableName,
		Location: &cloud.Location,
	}

	err := cloud.createRouteTable()
	if err != nil {
		t.Errorf("unexpected error in creating route table: %v", err)
		t.FailNow()
	}

	table := fake.FakeStore["foo"]["bar"]
	if *table.Location != *expectedTable.Location {
		t.Errorf("mismatch: %s vs %s", *table.Location, *expectedTable.Location)
	}
	if *table.Name != *expectedTable.Name {
		t.Errorf("mismatch: %s vs %s", *table.Name, *expectedTable.Name)
	}
}

func TestProcessRoutes(t *testing.T) {
	tests := []struct {
		rt            network.RouteTable
		exists        bool
		err           error
		expectErr     bool
		expectedError string
		expectedRoute []cloudprovider.Route
		name          string
	}{
		{
			err:           fmt.Errorf("test error"),
			expectErr:     true,
			expectedError: "test error",
		},
		{
			exists: false,
			name:   "doesn't exist",
		},
		{
			rt:     network.RouteTable{},
			exists: true,
			name:   "nil routes",
		},
		{
			rt: network.RouteTable{
				RouteTablePropertiesFormat: &network.RouteTablePropertiesFormat{},
			},
			exists: true,
			name:   "no routes",
		},
		{
			rt: network.RouteTable{
				RouteTablePropertiesFormat: &network.RouteTablePropertiesFormat{
					Routes: &[]network.Route{
						{
							Name: to.StringPtr("name"),
							RoutePropertiesFormat: &network.RoutePropertiesFormat{
								AddressPrefix: to.StringPtr("1.2.3.4/16"),
							},
						},
					},
				},
			},
			exists: true,
			expectedRoute: []cloudprovider.Route{
				{
					Name:            "name",
					TargetNode:      mapRouteNameToNodeName("name"),
					DestinationCIDR: "1.2.3.4/16",
				},
			},
			name: "one route",
		},
		{
			rt: network.RouteTable{
				RouteTablePropertiesFormat: &network.RouteTablePropertiesFormat{
					Routes: &[]network.Route{
						{
							Name: to.StringPtr("name"),
							RoutePropertiesFormat: &network.RoutePropertiesFormat{
								AddressPrefix: to.StringPtr("1.2.3.4/16"),
							},
						},
						{
							Name: to.StringPtr("name2"),
							RoutePropertiesFormat: &network.RoutePropertiesFormat{
								AddressPrefix: to.StringPtr("5.6.7.8/16"),
							},
						},
					},
				},
			},
			exists: true,
			expectedRoute: []cloudprovider.Route{
				{
					Name:            "name",
					TargetNode:      mapRouteNameToNodeName("name"),
					DestinationCIDR: "1.2.3.4/16",
				},
				{
					Name:            "name2",
					TargetNode:      mapRouteNameToNodeName("name2"),
					DestinationCIDR: "5.6.7.8/16",
				},
			},
			name: "more routes",
		},
	}
	for _, test := range tests {
		routes, err := processRoutes(test.rt, test.exists, test.err)
		if test.expectErr {
			if err == nil {
				t.Errorf("%s: unexpected non-error", test.name)
				continue
			}
			if err.Error() != test.expectedError {
				t.Errorf("%s: Expected error: %v, saw error: %v", test.name, test.expectedError, err.Error())
				continue
			}
		}
		if !test.expectErr && err != nil {
			t.Errorf("%s; unexpected error: %v", test.name, err)
			continue
		}
		if len(routes) != len(test.expectedRoute) {
			t.Errorf("%s: Unexpected difference: %#v vs %#v", test.name, routes, test.expectedRoute)
			continue
		}
		for ix := range test.expectedRoute {
			if !reflect.DeepEqual(test.expectedRoute[ix], *routes[ix]) {
				t.Errorf("%s: Unexpected difference: %#v vs %#v", test.name, test.expectedRoute[ix], *routes[ix])
			}
		}
	}
}


text:
<!DOCTYPE html>

    DataURL
    BlobURL
    PDF


text:
package net.opengis.gml.impl;
/**
 * An XML TriangleType(@http://www.opengis.net/gml).
 *
 * This is a complex type.
 */
public class TriangleTypeImpl extends net.opengis.gml.impl.AbstractSurfacePatchTypeImpl implements net.opengis.gml.TriangleType
{
    private static final long serialVersionUID = 1L;

    public TriangleTypeImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }

    private static final javax.xml.namespace.QName EXTERIOR$0 =
        new javax.xml.namespace.QName("http://www.opengis.net/gml", "exterior");
    private static final org.apache.xmlbeans.QNameSet EXTERIOR$1 = org.apache.xmlbeans.QNameSet.forArray( new javax.xml.namespace.QName[] {
        new javax.xml.namespace.QName("http://www.opengis.net/gml", "outerBoundaryIs"),
        new javax.xml.namespace.QName("http://www.opengis.net/gml", "exterior"),
    });
    private static final javax.xml.namespace.QName INTERPOLATION$2 =
        new javax.xml.namespace.QName("", "interpolation");

    /**
     * Gets the "exterior" element
     */
    public net.opengis.gml.AbstractRingPropertyType getExterior()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.opengis.gml.AbstractRingPropertyType target = null;
            target = (net.opengis.gml.AbstractRingPropertyType)get_store().find_element_user(EXTERIOR$1, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }

    /**
     * Sets the "exterior" element
     */
     public void setExterior(net.opengis.gml.AbstractRingPropertyType exterior)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.opengis.gml.AbstractRingPropertyType target = null;
            target = (net.opengis.gml.AbstractRingPropertyType)get_store().find_element_user(EXTERIOR$1, 0);
            if (target == null)
            {
                target = (net.opengis.gml.AbstractRingPropertyType)get_store().add_element_user(EXTERIOR$0);
            }
            target.set(exterior);
        }
    }

    /**
     * Appends and returns a new empty "exterior" element
     */
    public net.opengis.gml.AbstractRingPropertyType addNewExterior()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.opengis.gml.AbstractRingPropertyType target = null;
            target = (net.opengis.gml.AbstractRingPropertyType)get_store().add_element_user(EXTERIOR$0);
            return target;
        }
    }

    /**
     * Gets the "interpolation" attribute
     */
    public net.opengis.gml.SurfaceInterpolationType.Enum getInterpolation()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(INTERPOLATION$2);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_default_attribute_value(INTERPOLATION$2);
            }
            if (target == null)
            {
                return null;
            }
            return (net.opengis.gml.SurfaceInterpolationType.Enum)target.getEnumValue();
        }
    }

    /**
     * Gets (as xml) the "interpolation" attribute
     */
    public net.opengis.gml.SurfaceInterpolationType xgetInterpolation()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.opengis.gml.SurfaceInterpolationType target = null;
            target = (net.opengis.gml.SurfaceInterpolationType)get_store().find_attribute_user(INTERPOLATION$2);
            if (target == null)
            {
                target = (net.opengis.gml.SurfaceInterpolationType)get_default_attribute_value(INTERPOLATION$2);
            }
            return target;
        }
    }

    /**
     * True if has "interpolation" attribute
     */
    public boolean isSetInterpolation()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(INTERPOLATION$2) != null;
        }
    }

    /**
     * Sets the "interpolation" attribute
     */
     public void setInterpolation(net.opengis.gml.SurfaceInterpolationType.Enum interpolation)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(INTERPOLATION$2);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(INTERPOLATION$2);
            }
            target.setEnumValue(interpolation);
        }
    }

    /**
     * Sets (as xml) the "interpolation" attribute
     */
    public void xsetInterpolation(net.opengis.gml.SurfaceInterpolationType interpolation)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.opengis.gml.SurfaceInterpolationType target = null;
            target = (net.opengis.gml.SurfaceInterpolationType)get_store().find_attribute_user(INTERPOLATION$2);
            if (target == null)
            {
                target = (net.opengis.gml.SurfaceInterpolationType)get_store().add_attribute_user(INTERPOLATION$2);
            }
            target.set(interpolation);
        }
    }

    /**
     * Unsets the "interpolation" attribute
     */
    public void unsetInterpolation()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(INTERPOLATION$2);
        }
    }
}


text:
Notes
-------
Miss Identify is a program to find Win32 applications. In its default mode it displays the filename of any executable that does not have an executable extension (i.e. exe, dll, com, sys, cpl, hxs, hxi, olb, rll, or tlb). The program can also be run to display all executables encountered, regardless of the extension. This is handy when looking for all of the executables on a drive. Other options allow the user to record the strings found in an executable and to work recursively.[1]

Help Text
-------
```
missidentify version 1.0 by Jesse Kornblum
Usage: missidentify [-Vh] [-rablv] [-s|-S len] [FILES]

-r  Recursive mode. All subdirectories are traversed
-q  Silent mode. No error messages are displayed
-a  Display all executable files regardless of extension
-b  Bare filename. No path information displayed
-l  Relative paths in filenames
-v  Verbose mode. Displays the filename for every 10th file processed
-s|-S Display strings
-V  Display version number and exit
-h  Display this help message

```

Example Usage
-------
Taken from forensicswiki[1]

The program can be used to search for mislabeled executables:
```
C:\> missidentify *
C:\missidentify-1.0\sample.jpg
```

To enumerate all executables:
```
C:\> missidentify -a *
C:\missidentify-1.0\sample.jpg
C:\missidentify-1.0\missidentify.exe
```

To search for all executables in an unusual place:
```
C:\> missidentify -ar c:\windows\system32
...
C:\WINDOWS\System32\ntdll.dll
C:\WINDOWS\System32\ntoskrnl.exe
C:\WINDOWS\System32\NEVER-GONNA-CATCH-ME.EXE
C:\WINDOWS\System32\ntver.dll
...
```

Links
-------
[1] http://www.forensicswiki.org/wiki/Miss_Identify