text:
<?php

namespace Bkwld\Decoy\Models;

use Croppa;
use Bkwld\Decoy\Markup\ImageElement;
use Symfony\Component\HttpFoundation\File\UploadedFile;

/**
 * Polymorphic one to many class that stores images for any model.
 */
class Image extends Base
{

    /**
     * JSON serialization
     *
     * @var array
     */
    protected $visible = [
        'xs', 'xs2x',
        's', 's2x',
        'm', 'm2x',
        'l', 'l2x',
        'xl', 'xl2x',
        'bkgd_pos',
        'title',
    ];

    /**
     * @var array
     */
    protected $appends = [
        'xs', 'xs2x',
        's', 's2x',
        'm', 'm2x',
        'l', 'l2x',
        'xl', 'xl2x',
        'bkgd_pos',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'file_size'   => 'integer',
        'width'       => 'integer',
        'height'      => 'integer',
        'crop_box'    => 'object',
        'focal_point' => 'object',
    ];

    /**
     * Validation rules
     *
     * @return array
     */
    public static $rules = [
        'file' => 'image',
    ];

    /**
     * Uploadable attributes
     *
     * @var array
     */
    protected $upload_attributes = ['file'];

    /**
     * Target aspect ratios for the different break points
     *
     * @var array
     */
    protected $sizes = [
        'xs' => [480, 768],    // Phone portrait
        's'  => [768, 1024],   // Tablet portrait
        'm'  => [1024, 768],   // Tablet landscape
        'l'  => [1366, 768],   // Laptop
        'xl' => [1920, 1080],  // Desktop
    ];

    /**
     * Laptop width is the default size that is used to produce scale percentages
     *
     * @var number
     */
    protected $bench = 1366;

    /**
     * Stores config from chained transformations while a url or tag is generated
     *
     * @var array
     */
    private $config = [];

    /**
     * Register events
     *
     * @return void
     */
    protected static function boot()
    {
        parent::boot();

        // Convert input strings to objects for casted attributes
        static::saving(function (Image $image) {
            $image->convertCastedJson();
        });

        // Need to process file meta before Upchuck converts the UploadFile object
        // to a URL string.  If the image file attribute has been set to empty,
        // stop the save and immediately delete.
        static::saving(function (Image $image) {
            if ($image->deletedBecauseEmpty()) {
                return false;
            }
            $image->populateFileMeta();
        });

        // If the image is deleted, delete Croppa crops
        static::updating(function (Image $image) {
            if ($image->isDirty('file')) {
                $image->deleteCrops();
            }
        });
        static::deleted(function (Image $image) {
            $image->deleteCrops();
        });
    }

    /**
     * Polymorphic relationship
     */
    public function imageable()
    {
        return $this->morphTo();
    }

    /**
     * Convert strings that may have been `fill()`ed but need to be objects to
     * work with Laravel casting
     *
     * @return void
     */
    public function convertCastedJson()
    {
        foreach ($this->casts as $attribute => $cast) {
            if ($cast != 'object') {
                continue;
            }
            if (($val = $this->getAttributeValue($attribute))
                && is_string($val)) {
                $this->setAttribute($attribute, json_decode($val));
            }
        }
    }

    /**
     * If the file attribtue is empty, this Image has been marked for deletion.
     * Return true to signal the image was deleted
     *
     * @return bool
     */
    public function deletedBecauseEmpty()
    {
        if ($file = $this->getAttributeValue('file')) {
            return false;
        }

        if ($this->exists) {
            $this->delete();
        }

        return true;
    }

    /**
     * Store file meta info in the database if a new File object is present
     *
     * @return void
     */
    public function populateFileMeta()
    {
        $file = $this->getAttributeValue('file');
        if (!is_a($file, UploadedFile::class)) {
            return;
        }
        $size = getimagesize($file->getPathname());
        $this->fill([
            'file_type' => $this->guessFileType($file),
            'file_size' => $file->getSize(),
            'width'     => $size[0],
            'height'    => $size[1],
        ]);
    }

    /**
     * Delete the crops that Croppa has made for the image
     *
     * @return void
     */
    public function deleteCrops()
    {
        // Get at the file path using "original" so this function can be called as
        // part of an "updating" callback
        $file = $this->getOriginal('file');

        // Tell Croppa to delete the crops.  The actual file will be deleted by
        // Upchuck automatically.
        Croppa::reset($file);
    }

    /**
     * Get file type
     *
     * @param UploadedFile
     * @return string
     */
    protected function guessFileType(UploadedFile $file)
    {
        $type = $file->guessClientExtension();
        switch ($type) {
            case 'jpeg': return 'jpg';
            default: return $type;
        }
    }

    /**
     * Set the crop dimenions
     *
     * @param  integer $width
     * @param  integer $height
     * @param  array   $options Croppa options array
     * @return $this
     */
    public function crop($width = null, $height = null, $options = null)
    {
        $this->config = [
            'width'   => $width,
            'height'  => $height,
            'options' => $options,
        ];

        return $this;
    }

    /**
     * Get the config, merging defaults in so that all keys in the array are
     * present.  This also applies the crop choices from the DB.
     *
     * @return array
     */
    public function getConfig()
    {
        // Create default keys for the config
        $config = array_merge([
            'width'   => null,
            'height'  => null,
            'options' => null,
        ], $this->config);

        // Add crops
        if ($crop = $this->getAttributeValue('crop_box')) {
            if (!is_array($config['options'])) {
                $config['options'] = [];
            }
            $config['options']['trim_perc'] = [
                round($crop->x1, 4),
                round($crop->y1, 4),
                round($crop->x2, 4),
                round($crop->y2, 4),
            ];
        }

        // Return config
        return $config;
    }

    /**
     * Output the image URL with any queued Croppa transformations.  Note, it's
     * possible that "file" is empty, in which case this returns an empty string.
     * This clears the stored config on every call.
     *
     * @return string
     */
    public function getUrlAttribute()
    {
        // Figure out the URL
        $url = $this->getLAttribute(); // The benchmark

        // Clear the instance config so that subsequent calls don't inherit anything
        $this->config = [];

        // Return the url
        return $url;
    }

    /**
     * Output image for background style
     *
     * @return string
     */
    public function getBkgdAttribute()
    {
        return sprintf('background-image: url(\'%s\');', $this->getUrlAttribute())
            .$this->getBackgroundPositionAttribute();
    }

    /**
     * Output an image tag.  The ?: was necessary because HtmlObject sets NULL
     * values to "true" in the rendered attribute.
     *
     * @return Element
     */
    public function getTagAttribute()
    {
        return ImageElement::img()
            ->isSelfClosing()
            ->src($this->getUrlAttribute() ?: false)
            ->alt($this->getAttribute('title') ?: false);
    }

    /**
     * Output a div tag.
     * @link https://www.w3.org/TR/wai-aria/roles#img
     *
     * @return Element
     */
    public function getDivAttribute()
    {
        return ImageElement::div()
            ->style($this->getBkgdAttribute())
            ->role('img')
            ->ariaLabel($this->getAltAttribute());
    }

    /**
     * Convert the focal_point attribute to a CSS background-position.
     *
     * @return string
     */
    public function getBackgroundPositionAttribute()
    {
        if (!$value = $this->getBkgdPosAttribute()) {
            return;
        }

        return sprintf('background-position: %s;', $value);
    }

    /**
     * Convert the focal point to the VALUE portion of the CSS
     * background-position.  This is also used in the serialization conversion
     * and is named to be friendly to that format.
     *
     * @return string
     */
    public function getBkgdPosAttribute()
    {
        if (!$point = $this->getAttributeValue('focal_point')) {
            return;
        }

        return sprintf('%s%% %s%%', $point->x*100, $point->y*100);
    }

    /**
     * Convenience accessor for the title attribute
     *
     * @return string
     */
    public function getAltAttribute()
    {
        return $this->getAttributeValue('title');
    }

    /**
     * Accessors for different sizes.  They are calculated has percentages of
     * 1366, which we take to be the 1x "desktop" resolution.  1366 is currently
     * the most popular desktop resolution.
     *
     * @return string
     */
    public function getXsAttribute()
    {
        return $this->urlify('xs');
    }

    /**
     * @return string
     */
    public function getXs2xAttribute()
    {
        return $this->urlify('xs', 2);
    }

    /**
     * @return string
     */
    public function getSAttribute()
    {
        return $this->urlify('s');
    }

    /**
     * @return string
     */
    public function getS2xAttribute()
    {
        return $this->urlify('s', 2);
    }

    /**
     * @return string
     */
    public function getMAttribute()
    {
        return $this->urlify('m');
    }

    /**
     * @return string
     */
    public function getM2xAttribute()
    {
        return $this->urlify('m', 2);
    }

    /**
     * @return string
     */
    public function getLAttribute()
    {
        return $this->urlify('l');
    }

    /**
     * @return string
     */
    public function getL2xAttribute()
    {
        return $this->urlify('l', 2);
    }

    /**
     * @return string
     */
    public function getXlAttribute()
    {
        return $this->urlify('xl');
    }

    /**
     * @return string
     */
    public function getXl2xAttribute()
    {
        return $this->urlify('xl', 2);
    }

    /**
     * Make paths full URLs so these can be used directly in APIs or for Open
     * Graph tags, for example.
     *
     * @param  string $size
     * @param  number $scale
     * @return string url
     */
    public function urlify($size, $multiplier = 1)
    {
        // Get fluent config
        $config = $this->getConfig();

        // Setup vars
        $size = $this->sizes[$size];
        $scale = $size[0] / $this->bench;
        $width = $height = null;

        // Figure out percentage sizes.  First one of the dimensnios is tested
        // to see if it looks a percentage.  If so, make it a percentage of one of
        // the hard coded sizes.  Otherwise, scale the dimension by comaring the
        // size to a the benchmark (laptop).
        if ($perc = $this->perc($config['width'])) {
            $width = $perc * $size[0] * $multiplier;
        } elseif ($config['width']) {
            $width = $config['width'] * $scale * $multiplier;
        }
        if ($perc = $this->perc($config['height'])) {
            $height = $perc * $size[1] * $multiplier;
        } elseif ($config['height']) {
            $height = $config['height'] * $scale * $multiplier;
        }

        // Produce the Croppa URL
        $path = Croppa::url($this->getAttributeValue('file'),
            $width,
            $height,
            $config['options']
        );
        if ($path) {
            return asset($path);
        }
    }

    /**
     * Get a percent number from a string
     *
     * @param string|number val
     * @return float
     */
    protected function perc($val)
    {
        if (preg_match('#([\d\.]+)%$#', $val, $matches)) {
            return floatval($matches[1])/100;
        }
    }
}


text:
'use strict';

angular.module('slenderpmApp.login.controller')

//Controller that encapsulates LoginModule
  .controller('LoginCtrl', ['$rootScope', '$scope', '$cookies', '$location', 'LoginService', function ($rootScope, $scope, $cookies, $location, LoginService) {

    LoginService.IsAuthenticated();

    $scope.register = function(){
      LoginService.Register();
    };

    $scope.loginLoading = false;
    $scope.authenticate = function () {
        $scope.loginLoading = true;
        LoginService.Authenticate($scope.username, $scope.password, $scope.RESTURI).then(function (result) {
            $scope.loginLoading = false;

            try {
                $scope.result = angular.fromJson(result);

                if ($scope.result !== undefined) {
                    $scope.message = $scope.result.message;
                    if ($scope.result.success) {
                        $location.path('Tasks');
                        $cookies.session = $scope.result.sessionId;
                        setTimeout(function () { $rootScope.$broadcast('load-Tasks'); }, 100);
                        $scope.result = undefined;
                    }
                }
            }
            catch (err) {
                $scope.message = 'Whoops, look\'s like the server didn\'t like the request. Please try again later';
            }
        });
    };

 	$scope.validate = function (_var) {

 	    if (_var === undefined) {
 	        return true;
 	    } else {

 	        if (_var.length === 0) {
 	            return false;
 	        } else {
 	            return true;
 	        }
 	    }
 	};

  }]);

redpajama_set_name: RedPajamaGithub


text:
// Author: jmarantz@google.com (Joshua Marantz)

#include "pagespeed/kernel/base/null_statistics.h"

#include "pagespeed/kernel/base/null_mutex.h"
#include "pagespeed/kernel/base/statistics.h"

namespace net_instaweb {

NullStatistics::NullStatistics() {
}

NullStatistics::~NullStatistics() {
}

CountHistogram* NullStatistics::NewHistogram(StringPiece /*name*/) {
  return new CountHistogram(new NullMutex);
}

}  // namespace net_instaweb


text:
function rewritedat(datfile, inffile, hdrfile, I)

% rewritedat(datfile, inffile, hdrfile, I)
% Rewrite training files with a subset of the examples.
% Used to shrink the cache.

fhdr = fopen(hdrfile, 'rb');
header = fread(fhdr, 3, 'int32');
labelsize = header(2);
fclose(fhdr);

oldfile = [datfile '_tmp'];
%movefile(datfile,oldfile);
copyfile(datfile, oldfile);
fin = fopen(oldfile, 'rb');
fout = fopen(datfile, 'wb');

% sort indexes so we never have to seek before the current position
I = sort(I);

pos = 1;
for i = 1:length(I)
  cnt = I(i)-pos;
  while cnt > 0
    % + 2 to include the num non-zero blocks and example length
    info = fread(fin, labelsize+2, 'int32');
    dim = info(end);
    fseek(fin, dim*4, 0);
    cnt = cnt - 1;
  end
  y = fread(fin, labelsize+2, 'int32');
  dim = y(end);
  x = fread(fin, dim, 'single');
  fwrite(fout, y, 'int32');
  fwrite(fout, x, 'single');
  pos = I(i)+1;
end

fclose(fin);
fclose(fout);

% remove the old cache file
delete(oldfile);

% keep the info file in sync with the data file
oldfile = [inffile '_tmp'];
system(['copy ' inffile ' ' oldfile]);
[labels, scores, unique] = readinfo(inffile);
labels = labels(I);
scores = scores(I);
unique = unique(I);
fid = fopen(inffile, 'w');
for i = 1:length(I)
  fprintf(fid, '%d\t%f\t%d\n', labels(i), scores(i), unique(i));
end
fclose(fid);


text:
package com.opengamma.analytics.financial.model.finitedifference.applications;

import java.io.PrintStream;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang.Validate;

import com.opengamma.analytics.financial.model.finitedifference.PDEFullResults1D;
import com.opengamma.analytics.financial.model.finitedifference.PDETerminalResults1D;
import com.opengamma.analytics.financial.model.interestrate.curve.ForwardCurve;
import com.opengamma.analytics.financial.model.interestrate.curve.YieldAndDiscountCurve;
import com.opengamma.analytics.financial.model.volatility.BlackFormulaRepository;
import com.opengamma.analytics.math.interpolation.DoubleQuadraticInterpolator1D;
import com.opengamma.analytics.math.interpolation.GridInterpolator2D;
import com.opengamma.analytics.math.interpolation.data.Interpolator1DDataBundle;
import com.opengamma.analytics.math.surface.Surface;
import com.opengamma.util.ArgumentChecker;
import com.opengamma.util.tuple.DoublesPair;

/**
 *
 */
public class PDEUtilityTools {
  private static final DoubleQuadraticInterpolator1D INTERPOLATOR_1D = new DoubleQuadraticInterpolator1D();
  private static final GridInterpolator2D GRID_INTERPOLATOR2D = new GridInterpolator2D(INTERPOLATOR_1D, INTERPOLATOR_1D);

  public static Map<Double, Interpolator1DDataBundle> getInterpolatorDataBundle(final PDEFullResults1D res) {
    final int tNodes = res.getNumberTimeNodes();
    final int xNodes = res.getNumberSpaceNodes();

    final int n = xNodes * tNodes;
    final Map<DoublesPair, Double> out = new HashMap<>(n);

    for (int i = 0; i < tNodes; i++) {
      final double t = res.getTimeValue(i);

      for (int j = 0; j < xNodes; j++) {
        final double k = res.getSpaceValue(j);
        final DoublesPair tk = DoublesPair.of(t, k);
        out.put(tk, res.getFunctionValue(j, i));
      }
    }

    final Map<Double, Interpolator1DDataBundle> dataBundle = GRID_INTERPOLATOR2D.getDataBundle(out);
    return dataBundle;
  }

  /**
   * Take the terminal result for a forward PDE (i.e. forward option prices) and returns a map between strikes and implied volatilities
   * @param forwardCurve The forward curve
   * @param expiry The expiry of this option strip
   * @param prices The results from the PDE solver
   * @param minK The minimum strike to return
   * @param maxK The maximum strike to return
   * @param isCall true for call
   * @return A map between strikes and implied volatilities
   */
  public static Map<Double, Double> priceToImpliedVol(final ForwardCurve forwardCurve, final double expiry, final PDETerminalResults1D prices, final double minK, final double maxK,
      final boolean isCall) {
    final int n = prices.getNumberSpaceNodes();
    final Map<Double, Double> out = new HashMap<>(n);
    for (int j = 0; j < n; j++) {
      final double k = prices.getSpaceValue(j);
      if (k >= minK && k <= maxK) {
        final double price = prices.getFunctionValue(j);
        try {
          final double impVol = BlackFormulaRepository.impliedVolatility(price, 1.0, k, expiry, isCall);
          if (Math.abs(impVol) > 1e-15) {
            out.put(k, impVol);
          }
        } catch (final Exception e) {
        }
      }
    }
    return out;
  }

  /**
   * Takes the results from a forward PDE solve - grid of option prices by maturity and strike and returns a map between a DoublesPair (i.e. maturity and strike) and
   * the Black implied volatility
   * @param forwardCurve The forward
   * @param prices The forward (i.e. not discounted) option prices
   * @param minT Data before this time is ignored (not included in map)
   * @param maxT Data after this time is ignored (not included in map)
   * @param minK Strikes less than this are ignored (not included in map)
   * @param maxK Strikes greater than this are ignored (not included in map)
   * @param isCall true if call
   * @return The price to implied volatility map
   */
  public static Map<DoublesPair, Double> priceToImpliedVol(final ForwardCurve forwardCurve, final PDEFullResults1D prices, final double minT, final double maxT, final double minK, final double maxK,
      final boolean isCall) {
    final int xNodes = prices.getNumberSpaceNodes();
    final int tNodes = prices.getNumberTimeNodes();
    final int n = xNodes * tNodes;
    final Map<DoublesPair, Double> out = new HashMap<>(n);

    for (int i = 0; i < tNodes; i++) {
      final double t = prices.getTimeValue(i);
      final double forward = forwardCurve.getForward(t);
      if (t >= minT && t <= maxT) {
        for (int j = 0; j < xNodes; j++) {
          final double k = prices.getSpaceValue(j);
          if (k >= minK && k <= maxK) {
            final double price = prices.getFunctionValue(j, i);

            try {
              final double impVol = BlackFormulaRepository.impliedVolatility(price, forward, k, t, isCall);
              if (Math.abs(impVol) > 1e-15) {
                final DoublesPair pair = DoublesPair.of(prices.getTimeValue(i), prices.getSpaceValue(j));
                out.put(pair, impVol);
              }
            } catch (final Exception e) {
            }
          }
        }
      }
    }
    return out;
  }

  public static Map<DoublesPair, Double> modifiedPriceToImpliedVol(final PDEFullResults1D prices, final double minT, final double maxT,
      final double minM, final double maxM, final boolean isCall) {
    final int xNodes = prices.getNumberSpaceNodes();
    final int tNodes = prices.getNumberTimeNodes();
    final int n = xNodes * tNodes;
    final Map<DoublesPair, Double> out = new HashMap<>(n);

    for (int i = 0; i < tNodes; i++) {
      final double t = prices.getTimeValue(i);
      if (t >= minT && t <= maxT) {
        for (int j = 0; j < xNodes; j++) {
          final double m = prices.getSpaceValue(j);
          if (m >= minM && m <= maxM) {
            final double price = prices.getFunctionValue(j, i);

            try {
              final double impVol = BlackFormulaRepository.impliedVolatility(price, 1.0, m, t, isCall);
              if (Math.abs(impVol) > 1e-15) {
                final DoublesPair pair = DoublesPair.of(prices.getTimeValue(i), prices.getSpaceValue(j));
                out.put(pair, impVol);
              }
            } catch (final Exception e) {
            }
          }
        }
      }
    }

    return out;
  }

  /**
   * Takes the results from a forward PDE solve - grid of option prices by maturity and strike and returns a map between a DoublesPair (i.e. maturity and strike) and
   * the Black implied volatility
   * @param forwardCurve The forward
   * @param discountCurve The discount curve
   * @param prices The option prices
   * @param minT Data before this time is ignored (not included in map)
   * @param maxT Data after this time is ignored (not included in map)
   * @param minK Strikes less than this are ignored (not included in map)
   * @param maxK Strikes greater than this are ignored (not included in map)
   * @return The price to implied volatility map
   */
  public static Map<DoublesPair, Double> priceToImpliedVol(final ForwardCurve forwardCurve,
      final YieldAndDiscountCurve discountCurve, final PDEFullResults1D prices, final double minT, final double maxT, final double minK, final double maxK) {
    final int xNodes = prices.getNumberSpaceNodes();
    final int tNodes = prices.getNumberTimeNodes();
    final int n = xNodes * tNodes;
    final Map<DoublesPair, Double> out = new HashMap<>(n);

    for (int i = 0; i < tNodes; i++) {
      final double t = prices.getTimeValue(i);
      final double forward = forwardCurve.getForward(t);
      final double df = discountCurve.getDiscountFactor(t);
      if (t >= minT && t <= maxT) {
        for (int j = 0; j < xNodes; j++) {
          final double k = prices.getSpaceValue(j);
          if (k >= minK && k <= maxK) {
            final double forwardPrice = prices.getFunctionValue(j, i) / df;
            try {
              final double impVol = BlackFormulaRepository.impliedVolatility(forwardPrice, forward, k, t, true);
              if (Math.abs(impVol) > 1e-15) {
                final DoublesPair pair = DoublesPair.of(prices.getTimeValue(i), prices.getSpaceValue(j));
                out.put(pair, impVol);
              }
            } catch (final Exception e) {
            }
          }
        }
      }
    }
    return out;
  }

  public static void printSurface(final String name, final PDEFullResults1D res) {
    final PrintStream out = System.out;
    printSurface(name, res, out);
  }

  public static void printSurface(final String name, final PDEFullResults1D res, final PrintStream out) {
    final int tNodes = res.getNumberTimeNodes();
    final int xNodes = res.getNumberSpaceNodes();

    out.println(name);
    for (int i = 0; i < xNodes; i++) {
      final double k = res.getSpaceValue(i);
      out.print("\t" + k);
    }
    out.print("\n");

    for (int j = 0; j < tNodes; j++) {
      final double t = res.getTimeValue(j);
      out.print(t);
      for (int i = 0; i < xNodes; i++) {
        out.print("\t" + res.getFunctionValue(i, j));
      }
      out.print("\n");
    }
    out.print("\n");
  }

  public static void printSurface(final String name, final Surface<Double, Double, Double> surface, final double xMin, final double xMax, final double yMin, final double yMax) {
    printSurface(name, surface, xMin, xMax, yMin, yMax, 100, 100);
  }

  public static void printSurface(final String name, final Surface<Double, Double, Double> surface, final double xMin, final double xMax, final double yMin, final double yMax, final int xSteps,
      final int ySteps) {

    Validate.isTrue(xMax > xMin, "need xMax > xMin");
    Validate.isTrue(yMax > yMin, "need yMax > yMin");
    Validate.isTrue(xSteps > 0, "need xSteps > 0");
    Validate.isTrue(ySteps > 0, "need ySteps > 0");

    final StringBuffer result = new StringBuffer(name);
    result.append("\n");
    for (int i = 0; i <= ySteps; i++) {
      final double y = yMin + ((yMax - yMin) * i) / ySteps;
      result.append("\t");
      result.append(y);
    }
    result.append("\n");

    for (int j = 0; j <= xSteps; j++) {
      final double t = xMin + ((xMax - xMin) * j) / xSteps;
      result.append(t);
      for (int i = 0; i <= ySteps; i++) {
        final double k = yMin + ((yMax - yMin) * i) / ySteps;
        result.append("\t");
        result.append(surface.getZValue(t, k));
      }
      result.append("\n");
    }
    result.append("\n");
    System.out.println(result);
  }

  /**
   * This form takes vectors of x (typically expiry) and y (typically strike)
   *
   * @param name The name
   * @param surface The surface
   * @param x The x values
   * @param y The y values
   */

  /**
   * Prints out the values of the function f(x,y) where x takes the values x_1 to x_N and y takes the values y_1 to y_M, along with the x and y values, with x as the top row and
   * y as the left column. This format can be used by the Excel 3D surface plotter.
   * @param name Optional name for the output
   * @param data The data
   * @param x x-values
   * @param y y-values
   * @param out output
   */
  public static void printSurface(final String name, final double[][] data, final double[] x, final double[] y, final PrintStream out) {
    ArgumentChecker.notNull(data, "null data");
    ArgumentChecker.notNull(x, "null x");
    ArgumentChecker.notNull(y, "null y");
    ArgumentChecker.notNull(out, "null printStream");
    final int n = data.length;
    final int m = data[0].length;
    ArgumentChecker.isTrue(n == y.length, "Size of data is {} {}, but length of y is {}", n, m, y.length);
    ArgumentChecker.isTrue(m == x.length, "Size of data is {} {}, but length of x is {}", n, m, x.length);

    out.println(name);
    for (int j = 0; j < m; j++) {
      out.print("\t" + x[j]);
    }
    out.print("\n");
    for (int i = 0; i < n; i++) {
      out.print(y[i]);
      for (int j = 0; j < m; j++) {
        out.print("\t" + data[i][j]);
      }
      out.print("\n");
    }
    out.print("\n");
  }

  /**
   * This form takes vectors of x (typically expiry) and y (typically strike)
   * @param name The name of the surface
   * @param surface The surface
   * @param x Sample x values
   * @param y Sample y values
   */
  public static void printSurface(final String name, final Surface<Double, Double, Double> surface, final double[] x, final double[] y) {
    Validate.isTrue(x.length > 0, "The x-array was empty");
    Validate.isTrue(y.length > 0, "The y-array was empty");

    final StringBuffer result = new StringBuffer(name);
    result.append("\n");
    for (final double element : y) {
      result.append("\t");
      result.append(element);
    }
    result.append("\n");
    for (final double t : x) {
      result.append(t);
      for (final double k : y) {
        result.append("\t");
        result.append(surface.getZValue(t, k));
      }
      result.append("\n");
    }
    result.append("\n");
    System.out.println(result);
  }

  public static void printSurfaceInterpolate(final String name, final PDEFullResults1D res) {

    final Map<Double, Interpolator1DDataBundle> dataBundle = getInterpolatorDataBundle(res);
    final double tMin = res.getTimeValue(0);
    final double tMax = res.getTimeValue(res.getNumberTimeNodes() - 1);
    final double kMin = res.getSpaceValue(0);
    final double kMax = res.getSpaceValue(res.getNumberSpaceNodes() - 1);
    printSurface(name, dataBundle, tMin, tMax, kMin, kMax, 100, 100);
  }

  public static void printSurface(final String name, final Map<Double, Interpolator1DDataBundle> dataBundle, final double tMin, final double tMax, final double kMin, final double kMax,
      final int xSteps, final int ySteps) {

    System.out.println(name);
    for (int i = 0; i <= ySteps; i++) {
      final double k = kMin + ((kMax - kMin) * i) / ySteps;
      System.out.print("\t" + k);
    }
    System.out.print("\n");

    for (int j = 0; j <= xSteps; j++) {
      final double t = tMin + ((tMax - tMin) * j) / xSteps;
      System.out.print(t);
      for (int i = 0; i <= ySteps; i++) {
        final double k = kMin + ((kMax - kMin) * i) / ySteps;
        final DoublesPair tk = DoublesPair.of(t, k);

        System.out.print("\t" + GRID_INTERPOLATOR2D.interpolate(dataBundle, tk));
      }
      System.out.print("\n");
    }
  }

}


text:
var fieldTests = require('./commonFieldTestUtils.js');

module.exports = {
	before: fieldTests.before,
	after: fieldTests.after,
	'Textarea field should show correctly in the initial modal': function (browser) {
		browser.app.openFieldList('Textarea');
		browser.listPage.createFirstItem();
		browser.app.waitForInitialFormScreen();

		browser.initialFormPage.assertUI({
			listName: 'Textarea',
			fields: ['name', 'fieldA']
		});
	},
	'restoring test state': function(browser) {
		browser.initialFormPage.cancel();
		browser.app.waitForListScreen();
	},
	'Textarea field can be filled via the initial modal': function(browser) {
		browser.app.openFieldList('Textarea');
		browser.listPage.createFirstItem();
		browser.app.waitForInitialFormScreen();
		browser.initialFormPage.fillInputs({
			listName: 'Textarea',
			fields: {
				'name': {value: 'Textarea Field Test 1'},
				'fieldA': {value: 'Some test text for field A'},
			}
		});
		browser.initialFormPage.assertInputs({
			listName: 'Textarea',
			fields: {
				'name': {value: 'Textarea Field Test 1'},
				'fieldA': {value: 'Some test text for field A'},
			}
		});
		browser.initialFormPage.save();
		browser.app.waitForItemScreen();

		browser.itemPage.assertInputs({
			listName: 'Textarea',
			fields: {
				'name': {value: 'Textarea Field Test 1'},
				'fieldA': {value: 'Some test text for field A'},
			}
		})
	},
	'Textarea field should show correctly in the edit form': function(browser) {
		browser.itemPage.assertUI({
			listName: 'Textarea',
			fields: ['fieldA', 'fieldB']
		});
	},
	'Textarea field can be filled via the edit form': function(browser) {
		browser.itemPage.fillInputs({
			listName: 'Textarea',
			fields: {
				'fieldB': {value: 'Some test text for field B'}
			}
		});
		browser.itemPage.save();
		browser.app.waitForItemScreen();
		browser.itemPage.assertFlashMessage('Your changes have been saved successfully');
		browser.itemPage.assertInputs({
			listName: 'Textarea',
			fields: {
				'name': {value: 'Textarea Field Test 1'},
				'fieldA': {value: 'Some test text for field A'},
				'fieldB': {value: 'Some test text for field B'}
			}
		})
	},
};


text:
#ifndef HTMLAllCollection_h
#define HTMLAllCollection_h

#include "CachedHTMLCollection.h"

namespace WebCore {

class HTMLAllCollection final : public CachedHTMLCollection<HTMLAllCollection, CollectionTypeTraits<DocAll>::traversalType> {
public:
    static Ref<HTMLAllCollection> create(Document&, CollectionType);

    Element* namedItemWithIndex(const AtomicString& name, unsigned index) const;

    // For CachedHTMLCollection.
    bool elementMatches(Element&) const { return true; }

private:
    HTMLAllCollection(Document&, CollectionType);
};

} // namespace WebCore

SPECIALIZE_TYPE_TRAITS_HTMLCOLLECTION(HTMLAllCollection, DocAll)

#endif // HTMLAllCollection_h


text:
<form action="{% url 'frontend:create_stream' %}" method="POST">
    {% csrf_token %}
    {{ form.as_p }}
    <input type="Submit" value="Submit"/>
</form>


text:
namespace llvm {
template<typename T> class SmallVectorImpl;

/// hexdigit - Return the hexadecimal character for the
/// given number \p X (which should be less than 16).
static inline char hexdigit(unsigned X, bool LowerCase = false) {
  const char HexChar = LowerCase ? 'a' : 'A';
  return X < 10 ? '0' + X : HexChar + X - 10;
}

/// Construct a string ref from a boolean.
static inline StringRef toStringRef(bool B) {
  return StringRef(B ? "true" : "false");
}

/// Interpret the given character \p C as a hexadecimal digit and return its
/// value.
///
/// If \p C is not a valid hex digit, -1U is returned.
static inline unsigned hexDigitValue(char C) {
  if (C >= '0' && C <= '9') return C-'0';
  if (C >= 'a' && C <= 'f') return C-'a'+10U;
  if (C >= 'A' && C <= 'F') return C-'A'+10U;
  return -1U;
}

/// utohex_buffer - Emit the specified number into the buffer specified by
/// BufferEnd, returning a pointer to the start of the string.  This can be used
/// like this: (note that the buffer must be large enough to handle any number):
///    char Buffer[40];
///    printf("0x%s", utohex_buffer(X, Buffer+40));
///
/// This should only be used with unsigned types.
///
template<typename IntTy>
static inline char *utohex_buffer(IntTy X, char *BufferEnd) {
  char *BufPtr = BufferEnd;
  *--BufPtr = 0;      // Null terminate buffer.
  if (X == 0) {
    *--BufPtr = '0';  // Handle special case.
    return BufPtr;
  }

  while (X) {
    unsigned char Mod = static_cast<unsigned char>(X) & 15;
    *--BufPtr = hexdigit(Mod);
    X >>= 4;
  }
  return BufPtr;
}

static inline std::string utohexstr(uint64_t X) {
  char Buffer[17];
  return utohex_buffer(X, Buffer+17);
}

static inline std::string utostr_32(uint32_t X, bool isNeg = false) {
  char Buffer[11];
  char *BufPtr = Buffer+11;

  if (X == 0) *--BufPtr = '0';  // Handle special case...

  while (X) {
    *--BufPtr = '0' + char(X % 10);
    X /= 10;
  }

  if (isNeg) *--BufPtr = '-';   // Add negative sign...

  return std::string(BufPtr, Buffer+11);
}

static inline std::string utostr(uint64_t X, bool isNeg = false) {
  char Buffer[21];
  char *BufPtr = Buffer+21;

  if (X == 0) *--BufPtr = '0';  // Handle special case...

  while (X) {
    *--BufPtr = '0' + char(X % 10);
    X /= 10;
  }

  if (isNeg) *--BufPtr = '-';   // Add negative sign...
  return std::string(BufPtr, Buffer+21);
}

static inline std::string itostr(int64_t X) {
  if (X < 0)
    return utostr(static_cast<uint64_t>(-X), true);
  else
    return utostr(static_cast<uint64_t>(X));
}

/// StrInStrNoCase - Portable version of strcasestr.  Locates the first
/// occurrence of string 's1' in string 's2', ignoring case.  Returns
/// the offset of s2 in s1 or npos if s2 cannot be found.
StringRef::size_type StrInStrNoCase(StringRef s1, StringRef s2);

/// getToken - This function extracts one token from source, ignoring any
/// leading characters that appear in the Delimiters string, and ending the
/// token at any of the characters that appear in the Delimiters string.  If
/// there are no tokens in the source string, an empty string is returned.
/// The function returns a pair containing the extracted token and the
/// remaining tail string.
std::pair<StringRef, StringRef> getToken(StringRef Source,
                                         StringRef Delimiters = " \t\n\v\f\r");

/// SplitString - Split up the specified string according to the specified
/// delimiters, appending the result fragments to the output list.
void SplitString(StringRef Source,
                 SmallVectorImpl<StringRef> &OutFragments,
                 StringRef Delimiters = " \t\n\v\f\r");

/// HashString - Hash function for strings.
///
/// This is the Bernstein hash function.
//
// FIXME: Investigate whether a modified bernstein hash function performs
// better: http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx
//   X*33+c -> X*33^c
static inline unsigned HashString(StringRef Str, unsigned Result = 0) {
  for (unsigned i = 0, e = Str.size(); i != e; ++i)
    Result = Result * 33 + (unsigned char)Str[i];
  return Result;
}

/// Returns the English suffix for an ordinal integer (-st, -nd, -rd, -th).
static inline StringRef getOrdinalSuffix(unsigned Val) {
  // It is critically important that we do this perfectly for
  // user-written sequences with over 100 elements.
  switch (Val % 100) {
  case 11:
  case 12:
  case 13:
    return "th";
  default:
    switch (Val % 10) {
      case 1: return "st";
      case 2: return "nd";
      case 3: return "rd";
      default: return "th";
    }
  }
}

template <typename IteratorT>
inline std::string join_impl(IteratorT Begin, IteratorT End,
                             StringRef Separator, std::input_iterator_tag) {
  std::string S;
  if (Begin == End)
    return S;

  S += (*Begin);
  while (++Begin != End) {
    S += Separator;
    S += (*Begin);
  }
  return S;
}

template <typename IteratorT>
inline std::string join_impl(IteratorT Begin, IteratorT End,
                             StringRef Separator, std::forward_iterator_tag) {
  std::string S;
  if (Begin == End)
    return S;

  size_t Len = (std::distance(Begin, End) - 1) * Separator.size();
  for (IteratorT I = Begin; I != End; ++I)
    Len += (*Begin).size();
  S.reserve(Len);
  S += (*Begin);
  while (++Begin != End) {
    S += Separator;
    S += (*Begin);
  }
  return S;
}

/// Joins the strings in the range [Begin, End), adding Separator between
/// the elements.
template <typename IteratorT>
inline std::string join(IteratorT Begin, IteratorT End, StringRef Separator) {
  typedef typename std::iterator_traits<IteratorT>::iterator_category tag;
  return join_impl(Begin, End, Separator, tag());
}

} // End llvm namespace

#endif


text:
import { GraphQLError } from 'graphql/error';

export class ValidationError extends GraphQLError {
  constructor(ruleName, message, nodes) {
    super(message, nodes);

    this.ruleName = ruleName;
  }
}


text:
package poller

import (
	"time"
)

const PollerTypeNOOP = "noop"

func init() {
	AddPollerType(PollerTypeNOOP, nil, nil, noopPoll)
}

func noopPoll(ctx interface{}, url string, host string, pollID uint64) ([]byte, time.Time, time.Duration, error) {
	return nil, time.Now(), 0, nil
}


text:
@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    _textLabel.text = @"Some nice text!";
	_textLabel.fontSize = 25;
    _textLabel.fillColor = [UIColor blackColor];
    _textLabel.outlineColor = [UIColor redColor];
}

@end


text:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmSetting
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmSetting))
        Me.btnPlayer = New System.Windows.Forms.Button()
        Me.btnPlayer2 = New System.Windows.Forms.Button()
        Me.btnPlayer3 = New System.Windows.Forms.Button()
        Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog()
        Me.PictureBox1 = New System.Windows.Forms.PictureBox()
        Me.PictureBox2 = New System.Windows.Forms.PictureBox()
        Me.PictureBox3 = New System.Windows.Forms.PictureBox()
        Me.btnMain = New System.Windows.Forms.Button()
        Me.btn2p = New System.Windows.Forms.Button()
        Me.btn3p = New System.Windows.Forms.Button()
        CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'btnPlayer
        '
        Me.btnPlayer.Location = New System.Drawing.Point(312, 52)
        Me.btnPlayer.Name = "btnPlayer"
        Me.btnPlayer.Size = New System.Drawing.Size(152, 23)
        Me.btnPlayer.TabIndex = 0
        Me.btnPlayer.Text = "Choose Icon For Player 1"
        Me.btnPlayer.UseVisualStyleBackColor = True
        '
        'btnPlayer2
        '
        Me.btnPlayer2.Location = New System.Drawing.Point(312, 155)
        Me.btnPlayer2.Name = "btnPlayer2"
        Me.btnPlayer2.Size = New System.Drawing.Size(152, 23)
        Me.btnPlayer2.TabIndex = 1
        Me.btnPlayer2.Text = "Choose Icon For Player 2"
        Me.btnPlayer2.UseVisualStyleBackColor = True
        '
        'btnPlayer3
        '
        Me.btnPlayer3.Location = New System.Drawing.Point(312, 258)
        Me.btnPlayer3.Name = "btnPlayer3"
        Me.btnPlayer3.Size = New System.Drawing.Size(152, 23)
        Me.btnPlayer3.TabIndex = 2
        Me.btnPlayer3.Text = "Choose Icon For Player 3"
        Me.btnPlayer3.UseVisualStyleBackColor = True
        '
        'OpenFileDialog1
        '
        Me.OpenFileDialog1.FileName = "OpenFileDialog1"
        '
        'PictureBox1
        '
        Me.PictureBox1.Location = New System.Drawing.Point(371, 12)
        Me.PictureBox1.Name = "PictureBox1"
        Me.PictureBox1.Size = New System.Drawing.Size(34, 34)
        Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.PictureBox1.TabIndex = 3
        Me.PictureBox1.TabStop = False
        '
        'PictureBox2
        '
        Me.PictureBox2.Location = New System.Drawing.Point(371, 115)
        Me.PictureBox2.Name = "PictureBox2"
        Me.PictureBox2.Size = New System.Drawing.Size(34, 34)
        Me.PictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.PictureBox2.TabIndex = 4
        Me.PictureBox2.TabStop = False
        '
        'PictureBox3
        '
        Me.PictureBox3.Location = New System.Drawing.Point(371, 218)
        Me.PictureBox3.Name = "PictureBox3"
        Me.PictureBox3.Size = New System.Drawing.Size(34, 34)
        Me.PictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.PictureBox3.TabIndex = 5
        Me.PictureBox3.TabStop = False
        '
        'btnMain
        '
        Me.btnMain.Location = New System.Drawing.Point(58, 231)
        Me.btnMain.Name = "btnMain"
        Me.btnMain.Size = New System.Drawing.Size(135, 50)
        Me.btnMain.TabIndex = 6
        Me.btnMain.Text = "Back To Main"
        Me.btnMain.UseVisualStyleBackColor = True
        '
        'btn2p
        '
        Me.btn2p.Location = New System.Drawing.Point(73, 58)
        Me.btn2p.Name = "btn2p"
        Me.btn2p.Size = New System.Drawing.Size(105, 39)
        Me.btn2p.TabIndex = 7
        Me.btn2p.Text = "2 Players"
        Me.btn2p.UseVisualStyleBackColor = True
        '
        'btn3p
        '
        Me.btn3p.Location = New System.Drawing.Point(73, 121)
        Me.btn3p.Name = "btn3p"
        Me.btn3p.Size = New System.Drawing.Size(105, 39)
        Me.btn3p.TabIndex = 8
        Me.btn3p.Text = "3 Players"
        Me.btn3p.UseVisualStyleBackColor = True
        '
        'frmSetting
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Image)
        Me.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
        Me.ClientSize = New System.Drawing.Size(502, 329)
        Me.Controls.Add(Me.btn3p)
        Me.Controls.Add(Me.btn2p)
        Me.Controls.Add(Me.btnMain)
        Me.Controls.Add(Me.PictureBox3)
        Me.Controls.Add(Me.PictureBox2)
        Me.Controls.Add(Me.PictureBox1)
        Me.Controls.Add(Me.btnPlayer3)
        Me.Controls.Add(Me.btnPlayer2)
        Me.Controls.Add(Me.btnPlayer)
        Me.Name = "frmSetting"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Setting"
        CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub
    Friend WithEvents btnPlayer As System.Windows.Forms.Button
    Friend WithEvents btnPlayer2 As System.Windows.Forms.Button
    Friend WithEvents btnPlayer3 As System.Windows.Forms.Button
    Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog
    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
    Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox
    Friend WithEvents PictureBox3 As System.Windows.Forms.PictureBox
    Friend WithEvents btnMain As System.Windows.Forms.Button
    Friend WithEvents btn2p As System.Windows.Forms.Button
    Friend WithEvents btn3p As System.Windows.Forms.Button
End Class


text:
namespace GitVersion.Configuration;

public interface IConfigurationFileLocator
{
    string FilePath { get; }
    bool HasConfigFileAt(string workingDirectory);
    string? GetConfigFilePath(string workingDirectory);
    void Verify(GitVersionOptions gitVersionOptions, IGitRepositoryInfo repositoryInfo);
    void Verify(string workingDirectory, string projectRootDirectory);
    string? SelectConfigFilePath(GitVersionOptions gitVersionOptions, IGitRepositoryInfo repositoryInfo);
    GitVersionConfiguration ReadConfig(string workingDirectory);
}


text:
#include <thread>     // std::thread functions

#ifdef _MSC_VER
#include <intrin.h>   // __cpuidex intrinsic function available on microsoft compilers
#endif

// Define interface to CPUID instruction.
// input:  leaf = eax, subleaf = ecx
// output: output[0] = eax, output[1] = ebx, output[2] = ecx, output[3] = edx
static inline void cpuid(int output[4], int leaf, int subleaf = 0) {
#if defined(__GNUC__) || defined(__clang__)      // use inline assembly, Gnu/AT&T syntax
    int a, b, c, d;
    __asm("cpuid" : "=a"(a), "=b"(b), "=c"(c), "=d"(d) : "a"(leaf), "c"(subleaf) : );
    output[0] = a;
    output[1] = b;
    output[2] = c;
    output[3] = d;

#elif defined (_MSC_VER)                         // Microsoft compiler, intrin.h included
    __cpuidex(output, leaf, subleaf);            // intrinsic function for CPUID

#else                                            // unknown platform. try inline assembly with masm/intel syntax
    __asm {
        mov eax, leaf
        mov ecx, subleaf
        cpuid;
        mov esi, output
        mov[esi], eax
        mov[esi + 4], ebx
        mov[esi + 8], ecx
        mov[esi + 12], edx
    }
#endif
}

// Function prototype:
int physicalProcessors(int * logical_processors = 0);

// Find the number of physical and logical processors supported by CPU
// Parameter:
// logical_processors: an optional pointer to an integer that will receive the number of logical processors.
// Return value: number of physical processors
int physicalProcessors(int * logical_processors) {
    int vendor = 0;                              // CPU vendor: 1 = Intel, 2 = AMD, 3 = VIA, 0 = other
    int logicalProc = 1;                         // number of logical processor cores
    int physicalProc = 1;                        // number of physical processor cores
    int procPerCore = 1;                         // logical cores per physical core
    bool hyperthreadingSupported = false;        // CPU supports hyperthreading / simultaneous multithreading
    int systemProcessors = std::thread::hardware_concurrency(); // number of processors reported by operating system

    int abcd[4] = { 0,0,0,0 };                   // CPUID output
    cpuid(abcd, 0);                              // CPUID function 0

    int maxLeaf = abcd[0];                       // maximum eax input for CPUID
    if (abcd[2] == 0x6C65746E) {                 // last 4 chars of "GenuineIntel"
        vendor = 1;
    }
    else if (abcd[2] == 0x444D4163) {            // last 4 chars of "AuthenticAMD"
        vendor = 2;
    }
    else if (abcd[2] == 0x736C7561) {            // last 4 chars of "CentaurHauls"
        vendor = 3;
    }

    if (maxLeaf >= 1) {
        cpuid(abcd, 1);
        if (abcd[3] & (1 << 28)) {               // hyperthreading supported
            hyperthreadingSupported = true;
        }
    }

    if (vendor == 1) {
        //////////////////
        //    Intel     //
        //////////////////

        int hyper = 0;                           // hyperthreading status: 0 = unknown, 1 = disabled, 2 = enabled
        if (maxLeaf >= 0xB) {                    // leaf 0xB or 0x1F: Extended Topology Enumeration
            int num = 0xB;
            // if (maxLeaf >= 0x1F) num = 0x1F;

            for (int c = 0; c < 5; c++) {
                cpuid(abcd, num, c);             // enumeration level c
                int type = (abcd[2] >> 8) & 0xFF;// enumeration type at level c
                if (type == 1) {                 // SMT level
                    procPerCore = abcd[1] & 0xFFFF;
                }
                else if (type >= 2) {            // core level
                    logicalProc = abcd[1] & 0xFFFF;
                }
                else if (type == 0) break;
                // There are more types/levels to consider if we use num = 0x1F. We may need
                // to fix this in the future if CPUs with more complex configurations appear
            }
            physicalProc = logicalProc / procPerCore;

            // The number of performance monitor registers depends on hyperthreading status
            // on Intel CPUs with performance monitoring version 3 or 4
            cpuid(abcd, 0xA, 0);                 // performance monitor counters information
            int perfVersion = abcd[0] & 0xFF;    // performance monitoring version
            int perfNum = (abcd[0] >> 8) & 0xFF; // number of performance monitoring registers
            if (perfVersion == 3 || perfVersion == 4) {
                if (perfNum == 4) {
                    hyper = 2;                   // 4 performance registers when hyperthreading enabled
                }
                else if (perfNum == 8) {         // 8 performance registers when hyperthreading disabled
                    hyper = 1;
                    procPerCore = 1;
                    logicalProc = physicalProc;  // reduce the number of logical processors when hyperthreading is disabled
                }
                // hyper remains 0 in all other cases, indicating unknown status
            }
        }
        else if (maxLeaf >= 4) {                 // CPUID function 4: cache parameters and cores
            cpuid(abcd, 4);
            logicalProc = (abcd[0] >> 26) + 1;
            if (hyperthreadingSupported) {
                // number of logical processors per core is not known. Assume 2 if hyperthreading supported
                procPerCore = 2;
            }
            physicalProc = logicalProc / procPerCore;
        }
        else {
            // no information. Assume 1 processor
        }
        if (systemProcessors > logicalProc) {
            // Multiple CPU chips. Assume that chips are identical with respect to hypethreading
            physicalProc = systemProcessors * physicalProc / logicalProc;
            logicalProc = systemProcessors;
        }
        else if (logicalProc > systemProcessors && systemProcessors > 0 && hyper == 0) {
            // Hyperthreading is disabled
            logicalProc = systemProcessors;
            physicalProc = systemProcessors;
        }
    }
    else if (vendor == 2) {

        //////////////////
        //    AMD       //
        //////////////////

        cpuid(abcd, 0x80000000);                 // AMD specific CPUID functions
        int maxLeaf8 = abcd[0] & 0xFFFF;         // maximum eax 0x8000.... input for CPUID

        if (maxLeaf8 >= 8) {
            cpuid(abcd, 0x80000008);
            logicalProc = (abcd[2] & 0xFF) + 1;

            if (maxLeaf8 >= 0x1E) {
                cpuid(abcd, 0x8000001E);
                procPerCore = ((abcd[1] >> 8) & 0x03) + 1;
                // procPerCore = 2 if simultaneous multithreading is enabled, 1 if disabled
            }
            else {
                if (hyperthreadingSupported) {
                    procPerCore = 2;
                }
                else {
                    procPerCore = 1;
                }
            }
            physicalProc = logicalProc / procPerCore;
        }
        else if (hyperthreadingSupported) {
            // number of logical processors per core is not known. Assume 2 if SMT supported
            logicalProc = 2;
            physicalProc = 1;
        }
        if (systemProcessors > logicalProc) {
            // Multiple CPU chips. Assume that chips are identical with respect to SMT
            physicalProc = systemProcessors * physicalProc / logicalProc;
            logicalProc = systemProcessors;
        }
    }
    else {

        //////////////////////////////
        //    VIA or unknown CPU    //
        //////////////////////////////

        // The behavior of VIA processors is undocumented! It is not known how to detect threads on a VIA processor
        physicalProc = logicalProc = systemProcessors;
        if (hyperthreadingSupported && physicalProc > 1) {
            physicalProc /= 2;
        }
    }
    if (logical_processors) {
        // return logical_processors if pointer is not null
        *logical_processors = logicalProc;
    }
    return physicalProc;
}

/* Uncomment this for testing:

#include <stdio.h>

int main() {

    int logicalProc = 0;
    int physicalProc = physicalProcessors(&logicalProc);

    printf("\nlogical processors: %i",  logicalProc);
    printf("\nphysical processors: %i", physicalProc);
    printf("\nlogical processors per core: %i", logicalProc / physicalProc);
    int sysproc = std::thread::hardware_concurrency();
    printf("\nsystem processors: %i", sysproc);

    return 0;
}
*/


text:
<?php
if (isset($_SERVER['PHP_AUTH_USER']) &&
	isset($_SERVER['PHP_AUTH_PW']))
{
	echo "Welcome User: " . $_SERVER['PHP_AUTH_USER'] .
		" Password: "    . $_SERVER['PHP_AUTH_PW'];
}
else
{//this is a test
	header('WWW-Authenticate: Basic realm="Restricted Section"');
	header('HTTP/1.0 401 Unauthorized');
	die("Please enter your username and password");
}
?>


text:
if [ ! -d fuel ]; then
  echo "This is not project root dir."
  exit 1
fi
cd fuel/app/tmp/bootstrap/
grunt dist
cp dist/css/bootstrap.min.css ../../../../public/assets/css/bootstrap.uzura.min.css


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd">

    <bean id="core.web.controller.RoleManagementAction" class="com.netsteadfast.greenstep.action.RoleManagementAction" scope="prototype" />
    <bean id="core.web.controller.RoleManagementGridQueryAction" class="com.netsteadfast.greenstep.action.RoleManagementGridQueryAction" scope="prototype" />
    <bean id="core.web.controller.RoleSaveOrUpdateAction" class="com.netsteadfast.greenstep.action.RoleSaveOrUpdateAction" scope="prototype" />
    <bean id="core.web.controller.RolePermittedManagementAction" class="com.netsteadfast.greenstep.action.RolePermittedManagementAction" scope="prototype" />
    <bean id="core.web.controller.RolePermittedSaveOrUpdateAction" class="com.netsteadfast.greenstep.action.RolePermittedSaveOrUpdateAction" scope="prototype" />
    <bean id="core.web.controller.RolePermittedManagementGridQueryAction" class="com.netsteadfast.greenstep.action.RolePermittedManagementGridQueryAction" scope="prototype" />

</beans>


text:
package com.example.annation.presenter;

import android.util.Log;

import com.example.annation.adapter.HomeAdapter;
import com.example.annation.http.BaseNetWork;
import com.example.annation.http.HttpResponse;
import com.example.annation.status.StatusEntity;
import com.example.annation.uri.Contants;
import com.example.annation.uri.ParameterKeySet;
import com.example.annation.utils.PreferenceUtils;
import com.example.annation.view.HomeView;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.sina.weibo.sdk.net.WeiboParameters;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by 若兰 on 2016/1/13.
 * 一个懂得了编程乐趣的小白,希望自己
 * 能够在这个道路上走的很远,也希望自己学习到的
 * 知识可以帮助更多的人,分享就是学习的一种乐趣
 * QQ:1069584784
 * csdn:http://blog.csdn.net/wuyinlei
 */

public class HomePresenterImp implements HomePresenter {

    private String url = Contants.API.HOME_TIME_LINE;

    private int page = 1;

    private WeiboParameters mParameters;
    private PreferenceUtils mPreferenceUtils;

    private List<StatusEntity> mEntities;

    private HomeView homeView;

    public List<StatusEntity> getmEntities() {
        return mEntities;
    }

    public void setmEntities(List<StatusEntity> mEntities) {
        this.mEntities = mEntities;
    }

    private HomeAdapter mHomeAdapter;

    /**
     * 构造函数,在这里实例化我们需要用到的各种工具
     *
     * @param homeView
     */
    public HomePresenterImp(HomeView homeView) {
        this.homeView = homeView;
        mEntities = new ArrayList<>();
        mPreferenceUtils = PreferenceUtils.getInstance(homeView.getActivity());
        //mHomeAdapter = new HomeAdapter(mEntities, homeView.getActivity());
        mParameters = new WeiboParameters(Contants.APP_KEY);
    }

    @Override
    public void loadData(boolean showLoading) {
        page = 1;
        loadData(false,showLoading);
    }

    @Override
    public void loadMore(boolean showLoading) {
        page++;
        loadData(true,showLoading);

    }

    @Override
    public void requestHomeTimeLine() {
        url = Contants.API.HOME_TIME_LINE;
        loadData(true);
    }

    @Override
    public void requestUserTimeLine() {
        url = Contants.API.USER_TIME_LINE;
        loadData(true);
    }

   /* @Override
    public HomeAdapter getHomeAdapter() {
        return mHomeAdapter;
    }*/

    /**
     * 加载数据
     * <p/>
     * 不管是上拉加载更多、下拉刷新、或者是其他方式导致了数据更新,都会调用这个方法的
     */
    private void loadData(final boolean loadMore,boolean showLoading) {
        new BaseNetWork(homeView, url) {
            @Override
            public WeiboParameters onPrepares() {
                mParameters.put(ParameterKeySet.AUTH_ACCESS_TOKEN, mPreferenceUtils.getToken().getToken());
                mParameters.put(ParameterKeySet.PAGE, page);
                //每次加载5条数据
                mParameters.put(ParameterKeySet.COUNT, 5);
                return mParameters;
            }

            @Override
            public void onFinish(HttpResponse response, boolean success) {

                if (success) {
                    //用来存放json数据的
                    List<StatusEntity> list = new ArrayList<StatusEntity>();
                    Type type = new TypeToken<List<StatusEntity>>() {
                    }.getType();

                    //解析json数据
                    list = new Gson().fromJson(response.response, type);
                   /* if (null != list && list.size() > 0) {
                        mEntities.clear();
                        mEntities.addAll(list);
                    }*/
                    if (!loadMore) {
                        mEntities.clear();
                    }
                    mEntities.addAll(list);
                    //mHomeAdapter.notifyDataSetChanged();
                    homeView.onSuccess(mEntities);
                    // Log.d("HomeFragment", "list.size():" + list.size());
                } else {
                     Log.d("HomeFragment", "error");
                }
            }
        }.get();
    }

}


text:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>value_stack::push_chars</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.JSON">
<link rel="up" href="../boost__json__value_stack.html" title="value_stack">
<link rel="prev" href="push_object.html" title="value_stack::push_object">
<link rel="next" href="push_key.html" title="value_stack::push_key">

Home
Libraries
People
FAQ
More

value_stack::push_chars

          Push part of a key or string onto the stack.

          Synopsis

void
push_chars(
    string_view s);

          Description

          This function pushes the characters in s
          onto the stack, appending to any existing characters or creating new characters
          as needed. Once a string part is placed onto the stack, the only valid
          stack operations are:

              push_chars to append additional
              characters to the key or string being built,

              push_key or push_string to finish building
              the key or string and place the value onto the stack.

          Exception
          Safety

          Basic guarantee. Calls to memory_resource::allocate
          may throw.

          Parameters

<colgroup>
<col>
<col>
</colgroup>

                    Name

                    Description

                    s

                    The characters to append. This may be empty.

Copyright © 2019, 2020 Vinnie Falco
Copyright © 2020 Krystian Stasiowski

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
from datetime import datetime
from collections import OrderedDict

from django.conf import settings
from django.http import Http404
from django.utils import timezone as tz
from django.contrib.auth.models import User

from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework import permissions

from .simpleviews import SimpleView, SimpleGetMixin
from utils import solr
from . import serializers
from . import filters
from .uris import APIUris

import logging

# set up logger, for debugging
logger = logging.getLogger('sierra.custom')

@api_view(('GET',))
def api_root(request):
    utc_offset = tz.get_default_timezone().utcoffset(datetime.now())
    utc_offset = utc_offset.total_seconds() / (60*60)
    links = {
        'self': {
            'href': APIUris.get_uri('api-root', req=request,
                                    absolute=True)
        },
        'apiusers': {
            'href': APIUris.get_uri('apiusers-list', req=request,
                                    absolute=True)
        },
        'bibs': {
            'href': APIUris.get_uri('bibs-list', req=request,
                                    absolute=True)
        },
        'marc': {
            'href': APIUris.get_uri('marc-list', req=request,
                                    absolute=True)
        },
        'items': {
            'href': APIUris.get_uri('items-list', req=request,
                                    absolute=True)
        },
        'eresources': {
            'href': APIUris.get_uri('eresources-list', req=request,
                                    absolute=True)
        },
        'locations': {
            'href': APIUris.get_uri('locations-list', req=request,
                                    absolute=True)
        },
        'itemtypes': {
            'href': APIUris.get_uri('itemtypes-list', req=request,
                                    absolute=True)
        },
        'itemstatuses': {
            'href': APIUris.get_uri('itemstatuses-list', req=request,
                                    absolute=True)
        },
        'callnumbermatches': {
            'href': APIUris.get_uri('callnumbermatches-list', req=request,
                                    absolute=True)
        },
        'firstitemperlocation': {
            'href': APIUris.get_uri('firstitemperlocation-list', req=request,
                                    absolute=True)
        },
    }
    ret_val = OrderedDict()
    ret_val['catalogApi'] = OrderedDict()
    ret_val['catalogApi']['version'] = '1'
    ret_val['catalogApi']['_links'] = OrderedDict(sorted(links.items()))
    ret_val['serverTime'] = {
        'currentTime': tz.now(),
        'timezone': tz.get_default_timezone_name(),
        'utcOffset': utc_offset
    }

    return Response(ret_val)

class APIUserList(SimpleGetMixin, SimpleView):
    """
    Paginated list of API Users permissions. Requires authorization to
    view.
    """
    queryset = User.objects.exclude(apiuser__exact=None)
    serializer_class = serializers.APIUserSerializer
    resource_name = 'apiusers'
    permission_classes = (permissions.IsAuthenticated,)

class APIUserDetail(SimpleGetMixin, SimpleView):
    """
    View one API User. Requires authorization to view.
    """
    queryset = User.objects.exclude(apiuser__exact=None)
    serializer_class = serializers.APIUserSerializer
    resource_name = 'apiusers'
    multi = False
    permission_classes = (permissions.IsAuthenticated,)

    def get_object(self):
        queryset = self.get_queryset()
        try:
            obj = queryset.filter(username=self.kwargs['id'])[0]
        except IndexError:
            raise Http404
        else:
            return obj

class ItemList(SimpleGetMixin, SimpleView):
    """
    Paginated list of items. Use the 'limit' and 'offset' query
    parameters for paging.
    """
    queryset = solr.Queryset().filter(type='Item')
    serializer_class = serializers.ItemSerializer
    ordering = ['call_number', 'barcode', 'id', 'record_number',
                'parent_bib_id', 'parent_bib_record_number', 'volume',
                'copy_number', 'checkout_date']
    filter_fields = ['record_number', 'call_number', 'volume', 'volume_sort',
        'copy_number', 'barcode', 'long_messages', 'internal_notes',
        'public_notes', 'local_code1', 'number_of_renewals', 'item_type_code',
        'price', 'internal_use_count', 'iuse3_count', 'total_checkout_count',
        'total_renewal_count', 'year_to_date_checkout_count',
        'last_year_to_date_checkout_count', 'location_code', 'status_code',
        'due_date', 'checkout_date', 'last_checkin_date', 'overdue_date',
        'recall_date', 'record_creation_date', 'record_last_updated_date',
        'record_revision_number', 'suppressed', 'parent_bib_record_number',
        'parent_bib_title', 'parent_bib_main_author',
        'parent_bib_publication_year', 'call_number_type']
    resource_name = 'items'

class ItemDetail(SimpleGetMixin, SimpleView):
    """
    Retrieve one item.
    """
    queryset = solr.Queryset().filter(type='Item')
    serializer_class = serializers.ItemSerializer
    resource_name = 'items'
    multi = False

    def get_object(self):
        queryset = self.get_queryset()
        try:
            obj = queryset.filter(id=self.kwargs['id'])[0]
        except IndexError:
            raise Http404
        else:
            return obj

class BibList(SimpleGetMixin, SimpleView):
    """
    Paginated list of bibs. Use the 'limit' and 'offset' query
    parameters for paging.
    """
    queryset = solr.Queryset(using=
                 settings.REST_VIEWS_HAYSTACK_CONNECTIONS['Bibs'])
    serializer_class = serializers.BibSerializer
    ordering = ['call_number', 'id', 'record_number', 'material_type',
                'timestamp', 'main_call_number_sort']
    filter_fields = ['record_number', 'call_number', 'id', 'suppressed',
                     'material_type', 'issn_numbers', 'timestamp',
                     'full_title', 'main_title', 'subtitle',
                     'statement_of_responsibility', 'uniform_title',
                     'alternate_titles', 'related_titles', 'series', 'creator',
                     'contributors', 'series_creators', 'people',
                     'corporations', 'meetings', 'imprints',
                     'publication_country', 'publication_places', 'publishers',
                     'publication_dates', 'full_subjects', 'general_terms',
                     'topic_terms', 'genre_terms', 'era_terms', 'form_terms',
                     'other_terms', 'physical_characteristics', 'toc_notes',
                     'context_notes', 'summary_notes', 'main_call_number',
                     'loc_call_numbers', 'dewey_call_numbers',
                     'other_call_numbers', 'sudoc_numbers', 'isbn_numbers',
                     'lccn_numbers', 'oclc_numbers']
    resource_name = 'bibs'

class BibDetail(SimpleGetMixin, SimpleView):
    """
    Retrieve one bib.
    """
    queryset = solr.Queryset(using=
                 settings.REST_VIEWS_HAYSTACK_CONNECTIONS['Bibs'])
    serializer_class = serializers.BibSerializer
    resource_name = 'bibs'
    multi = False

    def get_object(self):
        queryset = self.get_queryset()
        try:
            obj = queryset.filter(id=self.kwargs['id'])[0]
        except IndexError:
            raise Http404
        else:
            return obj

class MarcList(SimpleGetMixin, SimpleView):
    """
    Paginated list of MARC records. Use the 'limit' and 'offset' query
    parameters for paging.
    """
    queryset = solr.Queryset(using=
                 settings.REST_VIEWS_HAYSTACK_CONNECTIONS['Marc'])
    serializer_class = serializers.MarcSerializer
    resource_name = 'marc'
    filter_fields = ['record_number', '/^(mf_)?\\d{3}$/',
        '/^(sf_)?\\d{3}[a-z0-9]$/']
    filter_class = filters.MarcFilter

class MarcDetail(SimpleGetMixin, SimpleView):
    """
    Retrieve one MARC record.
    """
    queryset = solr.Queryset(using=
                 settings.REST_VIEWS_HAYSTACK_CONNECTIONS['Marc'])
    serializer_class = serializers.MarcSerializer
    resource_name = 'marc'
    multi = False

    def get_object(self):
        queryset = self.get_queryset()
        try:
            obj = queryset.filter(id=self.kwargs['id'])[0]
        except IndexError:
            raise Http404
        else:
            return obj

class EResourceList(SimpleGetMixin, SimpleView):
    """
    Paginated list of eresources. Use the 'limit' and 'offset' query
    parameters for paging.
    """
    queryset = solr.Queryset().filter(type='eResource')
    serializer_class = serializers.EResourceSerializer
    ordering = ['record_number', 'parent_bib_record_number', 'eresource_type',
                'publisher', 'title', 'alert']
    filter_fields = ['record_number', 'parent_bib_record_number',
                     'eresource_type', 'publisher', 'title',
                     'alternate_titles', 'subjects', 'summary',
                     'internal_notes', 'public_notes', 'alert', 'holdings',
                     'suppressed']
    resource_name = 'eresources'

class EResourceDetail(SimpleGetMixin, SimpleView):
    """
    Retrieve one eresource.
    """
    queryset = solr.Queryset().filter(type='eResource')
    serializer_class = serializers.EResourceSerializer
    resource_name = 'eresources'
    multi = False

    def get_object(self):
        queryset = self.get_queryset()
        try:
            obj = queryset.filter(id=self.kwargs['id'])[0]
        except IndexError:
            raise Http404
        else:
            return obj

class LocationList(SimpleGetMixin, SimpleView):
    """
    Paginated list of bibs. Use the 'limit' and 'offset' query
    parameters for paging.
    """
    queryset = solr.Queryset().filter(type='Location')
    serializer_class = serializers.LocationSerializer
    resource_name = 'locations'
    ordering = ['code', 'label']
    filter_fields = ['code', 'label']

class LocationDetail(SimpleGetMixin, SimpleView):
    """
    Retrieve one Location.
    """
    queryset = solr.Queryset().filter(type='Location')
    serializer_class = serializers.LocationSerializer
    resource_name = 'locations'
    multi = False

    def get_object(self):
        queryset = self.get_queryset()
        try:
            obj = queryset.filter(code=self.kwargs['code'])[0]
        except IndexError:
            raise Http404
        else:
            return obj

class ItemTypesList(SimpleGetMixin, SimpleView):
    """
    Paginated list of bibs. Use the 'limit' and 'offset' query
    parameters for paging.
    """
    queryset = solr.Queryset().filter(type='Itype')
    serializer_class = serializers.ItemTypeSerializer
    resource_name = 'itemtypes'
    ordering = ['code', 'label']
    filter_fields = ['code', 'label']

class ItemTypesDetail(SimpleGetMixin, SimpleView):
    """
    Retrieve one Location.
    """
    queryset = solr.Queryset().filter(type='Itype')
    serializer_class = serializers.ItemTypeSerializer
    resource_name = 'itemtypes'
    multi = False

    def get_object(self):
        queryset = self.get_queryset()
        try:
            obj = queryset.filter(code=self.kwargs['code'])[0]
        except IndexError:
            raise Http404
        else:
            return obj

class ItemStatusesList(SimpleGetMixin, SimpleView):
    """
    Paginated list of bibs. Use the 'limit' and 'offset' query
    parameters for paging.
    """
    queryset = solr.Queryset().filter(type='ItemStatus')
    serializer_class = serializers.ItemStatusSerializer
    resource_name = 'itemstatuses'
    ordering = ['code', 'label']
    filter_fields = ['code', 'label']

class ItemStatusesDetail(SimpleGetMixin, SimpleView):
    """
    Retrieve one Item Status.
    """
    queryset = solr.Queryset().filter(type='ItemStatus')
    serializer_class = serializers.ItemStatusSerializer
    resource_name = 'itemstatuses'
    multi = False

    def get_object(self):
        queryset = self.get_queryset()
        try:
            obj = queryset.filter(code=self.kwargs['code'])[0]
        except IndexError:
            raise Http404
        else:
            return obj

class CallnumbermatchesList(SimpleGetMixin, SimpleView):
    """
    Returns the first X matching call numbers, where X is the supplied
    limit. Pagination (offset) is not supported.
    You can filter using the
    following fields: callNumber, locationCode, and callNumberType.
    """
    queryset = solr.Queryset().filter(type='Item').only(
                'call_number').order_by('call_number_sort')
    serializer_class = serializers.ItemSerializer
    resource_name = 'callnumber_matches'
    filter_fields = ['call_number', 'location_code', 'call_number_type']

    def get_page_data(self, queryset, request):
        # for paging, we only use the 'limit'
        limit_p = settings.REST_FRAMEWORK.get('PAGINATE_BY_PARAM', 'limit')
        max_limit = settings.REST_FRAMEWORK.get('MAX_PAGINATE_BY', 500)
        default_limit = settings.REST_FRAMEWORK.get('PAGINATE_BY', 10)
        limit = int(request.query_params.get(limit_p, default_limit))
        limit = max_limit if limit > max_limit else limit
        data, i, count = [], 0, queryset.count()
        while len(data) < limit and i < count:
            call_number = queryset[i].get('call_number', None)
            if call_number is not None and call_number not in data:
                data.append(call_number)
            i += 1

        return data

class FirstItemPerLocationList(SimpleGetMixin, SimpleView):
    """
    Returns the first item (by call number) for each location within a
    filtered result set.
    """
    facet_field = 'location_code'
    queryset = solr.Queryset().filter(type='Item').search('*:*',
        params={'facet': 'true', 'facet.field': facet_field,
                'facet.sort': 'index', 'facet.mincount': 1})
    serializer_class = serializers.ItemSerializer
    resource_name = 'firstitemperlocation'
    filter_fields = ['call_number', 'call_number_type', 'barcode']

    def get_page_data(self, queryset, request):
        ff = self.facet_field
        facets = queryset.full_response.facets['facet_fields'][ff]
        fields = ['id', 'parent_bib_title', 'parent_bib_record_number',
                  'call_number', 'barcode', 'record_number', 'call_number_type']
        total_count = len(facets) / 2
        items = []

        for key in facets[0:len(facets):2]:
            facet_qs = solr.Queryset()
            facet_qs._search_params['fq'] = queryset._search_params['fq']
            facet_qs = facet_qs.filter(**{ff: key})
            facet_qs = facet_qs.order_by('call_number_sort').only(*fields)
            item_uri = APIUris.get_uri('items-detail', id=facet_qs[0]['id'],
                                       req=request, absolute=True)
            items.append({
                '_links': { 'self': { 'href': item_uri } },
                'id': facet_qs[0].get('id', None),
                'parentBibRecordNumber':
                    facet_qs[0].get('parent_bib_record_number', None),
                'parentBibTitle': facet_qs[0].get('parent_bib_title', None),
                'recordNumber':
                    facet_qs[0].get('record_number', None),
                'callNumber': facet_qs[0].get('call_number', None),
                'callNumberType': facet_qs[0].get('call_number_type', None),
                'barcode': facet_qs[0].get('barcode', None),
                'locationCode': key,
            })

        data = OrderedDict()
        data['totalCount'] = total_count
        data['_links'] = {'self': request.build_absolute_uri()}
        data['_embedded'] = {'items': items}

        return data


text:
title: {{ title }}
subtitle:
catalog: true
header-img:
tags:
---


text:
import Ember from "ember";

export default Ember.Controller.extend({

  init: function() {
    // Tests carry state if this is not defined in init
    this.set("formFields", Ember.A([
    {_id: "name",        regex: /^[A-Za-z]+$/},
    {_id: "description", regex: /^[A-Za-z]+$/},
    {_id: "zipCode",     regex: /^\d+$/},
    {_id: "cool",        regex: /true/},
    {_id: "love",        regex: /Lots|Some/, choices: Ember.A(["----", "Lots", "Some", "None"])},
    {_id: "placeholder", regex: /none/,      choices: Ember.A(["I don't love them", ])}]));
  },

  actions: {
    formValid: function() {
      if (this.get("formValidator").isValid(this.get("formFields"))) {
        console.log("The form IS valid");
      } else {
        console.log("The form is NOT valid");
      }
    },

    markInvalid: function() {
      this.get("formValidator").markInvalid(this.get("formFields"));
    },

    formData: function() {
      console.log(this.get("formValidator").formData(this.get("formFields")));
    }
  }
});


text:
<!--
 - Copyright (C) 2006, 2007  Internet Systems Consortium, Inc. ("ISC")
 -
 - Permission to use, copy, modify, and/or distribute this software for any
 - purpose with or without fee is hereby granted, provided that the above
 - copyright notice and this permission notice appear in all copies.
 -
 - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
 - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 - AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
 - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 - PERFORMANCE OF THIS SOFTWARE.
-->

<!-- Id: isc-footer.html,v 1.5 2007/06/19 23:47:13 tbox Exp  -->

<!-- $Id -->

    <hr size="1">
    <address style="align: right;">
      <small>
	Generated on $datetime by Doxygen $doxygenversion for $projectname $projectnumber
      </small>
    </address>
  </body>
</html>


text:
layout: posts_by_category
categories: socialmedia
title: socialmedia
permalink: /category/socialmedia
---


text:
#ifndef _POLL_H_
#define _POLL_H_

#include <sys/cdefs.h>
#include <linux/poll.h>
#include <signal.h> /* For sigset_t. */
#include <time.h> /* For timespec. */

__BEGIN_DECLS

typedef unsigned int nfds_t;

int poll(struct pollfd*, nfds_t, int);
int ppoll(struct pollfd*, nfds_t, const struct timespec*, const sigset_t*);

int __poll_chk(struct pollfd*, nfds_t, int, size_t);
int __poll_real(struct pollfd*, nfds_t, int) __RENAME(poll);
__errordecl(__poll_too_small_error, "poll: pollfd array smaller than fd count");

int __ppoll_chk(struct pollfd*, nfds_t, const struct timespec*, const sigset_t*, size_t);
int __ppoll_real(struct pollfd*, nfds_t, const struct timespec*, const sigset_t*) __RENAME(ppoll);
__errordecl(__ppoll_too_small_error, "ppoll: pollfd array smaller than fd count");

#if defined(__BIONIC_FORTIFY)

__BIONIC_FORTIFY_INLINE
int poll(struct pollfd* fds, nfds_t fd_count, int timeout) {
#if defined(__clang__)
  return __poll_chk(fds, fd_count, timeout, __bos(fds));
#else
  if (__bos(fds) != __BIONIC_FORTIFY_UNKNOWN_SIZE) {
    if (!__builtin_constant_p(fd_count)) {
      return __poll_chk(fds, fd_count, timeout, __bos(fds));
    } else if (__bos(fds) / sizeof(*fds) < fd_count) {
      __poll_too_small_error();
    }
  }
  return __poll_real(fds, fd_count, timeout);
#endif
}

__BIONIC_FORTIFY_INLINE
int ppoll(struct pollfd* fds, nfds_t fd_count, const struct timespec* timeout, const sigset_t* mask) {
#if defined(__clang__)
  return __ppoll_chk(fds, fd_count, timeout, mask, __bos(fds));
#else
  if (__bos(fds) != __BIONIC_FORTIFY_UNKNOWN_SIZE) {
    if (!__builtin_constant_p(fd_count)) {
      return __ppoll_chk(fds, fd_count, timeout, mask, __bos(fds));
    } else if (__bos(fds) / sizeof(*fds) < fd_count) {
      __ppoll_too_small_error();
    }
  }
  return __ppoll_real(fds, fd_count, timeout, mask);
#endif
}

#endif

__END_DECLS

#endif /* _POLL_H_ */


text:
'''
Definitions of classes for the Host operating server, ...
'''

__author__="Pablo Montes"

class Units():
    memory_1000 = 1
    memory_1024 = 2
    memory_full = 3
    bw = 4
    freq = 5
    no_units = 6
    name = 7
    boolean = 8

class definitionsClass():
    user = 'n2'
    password = 'n2'
    extrict_hugepages_allocation = True
    processor_possible_features = ['64b','iommu','lps','tlbps','hwsv','dioc','ht']
    processor_possible_manufacturers = ['Intel','AMD']
    processor_possible_families = ['Xeon']
    processor_possible_versions = ['Intel(R) Xeon(R) CPU E5-4620 0 @ 2.20GHz', 'Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz','Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz']
    memory_possible_types = ['DDR2','DDR3']
    memory_possible_form_factors = ['DIMM']
    hypervisor_possible_types = ['QEMU']
    hypervisor_possible_domain_types = ['kvm'] #['qemu', 'kvm']
    os_possible_id = ['Red Hat Enterprise Linux Server release 6.4 (Santiago)',
                      'Red Hat Enterprise Linux Server release 6.5 (Santiago)',
                      'Red Hat Enterprise Linux Server release 6.6 (Santiago)',
                      'CentOS release 6.5 (Final)',
                      'CentOS release 6.6 (Final)',
                      'Red Hat Enterprise Linux Server release 7.0 (Maipo)',
                      'Red Hat Enterprise Linux Server release 7.1 (Maipo)',
                    ]
    os_possible_types = ['GNU/Linux']
    os_possible_architectures = ['x86_64']
    hypervisor_possible_composed_versions = ['QEMU-kvm']
    units = dict()
    units[Units.bw] = ['Gbps', 'Mbps', 'kbps', 'bps']
    units[Units.freq] = ['GHz', 'MHz', 'KHz', 'Hz']
    units[Units.memory_1000] = ['GB', 'MB', 'KB', 'B']
    units[Units.memory_1024] = ['GiB', 'MiB', 'KiB', 'B']
    units[Units.memory_full] = ['GB', 'MB', 'KB', 'GiB', 'MiB', 'KiB', 'B']
    valid_hugepage_sz = [1073741824, 2097152] #In bytes
    valid_VNFC_iface_types = ['mgmt','data']

    def __init__(self):
        return


text:
package br.com.tjgwp.business.entity.text;

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

import org.apache.commons.lang3.StringUtils;

import br.com.tjgwp.business.entity.Image;
import br.com.tjgwp.business.entity.SuperEntity;
import br.com.tjgwp.business.entity.user.UserEntity;
import br.com.tjgwp.business.service.image.ImageService;
import br.com.tjgwp.business.utils.URLMaker;

import com.google.appengine.api.blobstore.BlobKey;
import com.googlecode.objectify.Ref;
import com.googlecode.objectify.annotation.Index;
import com.googlecode.objectify.annotation.Load;
import com.googlecode.objectify.annotation.Subclass;

@Subclass(index = true)
public class Book extends SuperEntity {

	private String title;
	@Index
	private String titleDowncase;
	private String synopsis;
	private List<Ref<Chapter>> chapters;
	private boolean isSingleChapter;
	private List<Ref<KeyWord>> keysWord;
	private Long publishDate;
	@Load
	private Ref<Image> cape;
	private Ref<UserEntity> owner;

	protected Book() {
		super();
	}

	public Book(UserEntity userEntity) {
		this.owner = userEntity.getRef();
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
		setTitleDowncase(StringUtils.isNotEmpty(title) ? title.toLowerCase() : title);
	}

	public String getTitleDowncase() {
		return titleDowncase;
	}

	public void setTitleDowncase(String titleDowncase) {
		this.titleDowncase = titleDowncase;
	}

	public String getSynopsis() {
		return synopsis;
	}

	public void setSynopsis(String synopsis) {
		this.synopsis = synopsis;
	}

	public List<Ref<Chapter>> getChapters() {
		if (chapters == null)
			chapters = new ArrayList<Ref<Chapter>>();

		return chapters;
	}

	public void setChapters(List<Ref<Chapter>> chapters) {
		this.chapters = chapters;
	}

	public boolean isSingleChapter() {
		return isSingleChapter;
	}

	public void setSingleChapter(boolean isSingleChapter) {
		this.isSingleChapter = isSingleChapter;
	}

	public List<Ref<KeyWord>> getKeysWord() {
		if (keysWord == null)
			keysWord = new ArrayList<Ref<KeyWord>>();

		return keysWord;
	}

	public void setKeysWord(List<Ref<KeyWord>> keysWord) {
		this.keysWord = keysWord;
	}

	public Ref<Image> getCapeRef() {
		return cape;
	}

	public Image getCape() {
		return cape == null ? new Image() : cape.get();
	}

	public void updateCape(BlobKey cape) {
		if (this.cape == null)
			this.cape = new ImageService().newImageRef(this);

		this.cape.get().updateBlob(cape);
	}

	public Long getPublishDate() {
		return publishDate;
	}

	public void setPublishDate(Long publishDate) {
		this.publishDate = publishDate;
	}

	public int publishedChaptersCount() {
		int publishedChapters = 0;

		for (Ref<Chapter> refChapter : getChapters()) {
			Chapter chapter = refChapter.get();
			if (chapter.getPublishDate() != null)
				publishedChapters++;
		}

		return publishedChapters;
	}

	public Ref<UserEntity> getOwner() {
		return owner;
	}

	public void setOwner(Ref<UserEntity> owner) {
		this.owner = owner;
	}

	@SuppressWarnings("unchecked")
	public Ref<Book> getRef() {
		return Ref.create(this);
	}

	public void createUrl() {
		setUrl(URLMaker.urlForBook(this));
	}
}


text:
package net.herit.iot.onem2m.incse.manager;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import net.herit.iot.message.onem2m.OneM2mRequest;
import net.herit.iot.message.onem2m.OneM2mResponse;
import net.herit.iot.message.onem2m.OneM2mRequest.OPERATION;
import net.herit.iot.message.onem2m.OneM2mRequest.RESOURCE_TYPE;
import net.herit.iot.message.onem2m.OneM2mResponse.RESPONSE_STATUS;
import net.herit.iot.onem2m.core.convertor.XMLConvertor;
import net.herit.iot.onem2m.core.util.LogManager;
import net.herit.iot.onem2m.core.util.OneM2MException;
import net.herit.iot.onem2m.incse.context.OneM2mContext;
import net.herit.iot.onem2m.incse.controller.ForwardingController;
import net.herit.iot.onem2m.incse.manager.dao.ResourceDAO;
import net.herit.iot.onem2m.resource.Resource;

public class ResourceManager {

	private Logger log = LoggerFactory.getLogger(Resource.class);

	private static final String TAG = ResourceManager.class.getName();

	private OneM2mContext context;

	private ResourceDAO dao = null;

	private ForwardingController forward;

	public ResourceManager(OneM2mContext context) {
		this.context = context;
		this.dao = new ResourceDAO(context);
	}

//	private OneM2mResponse createResponse(OneM2mRequest reqMessage, RESPONSE_STATUS status) {
//		OneM2mResponse resMessage = new OneM2mResponse(status);
//		resMessage.setRequestId(reqMessage.getRequestId());
//		resMessage.setFrom(reqMessage.getFrom());
//		resMessage.setEventCategory(reqMessage.getEventCategory());
//		//..?
//
//		return resMessage;
//	}

	public OneM2mResponse processEx(OneM2mRequest reqMessage, boolean useVirtualManager) throws OneM2MException {

		OneM2mResponse resMessage = null;

		reqMessage.validate();

		if (useVirtualManager) {
			VirtualManagerInterface vManager = VirtualManager.getInstance().getManager(reqMessage.getTo());
			if (vManager != null) {
				resMessage = vManager.process(reqMessage, context);
				if (resMessage != null)	return resMessage;

				if (vManager.getProcessResult() == VirtualManager.PROCESS_RESULT.COMPLETED) {
					return null;
				}
			}
			//if (vManager != null &&
			//	vManager.process(reqMessage, context) == VirtualManager.PROCESS_RESULT.COMPLETED) {
			//		return null;
			//}
		}

		ManagerInterface manager = ManagerFactory.create(reqMessage, context);

		OneM2mRequest.OPERATION op = reqMessage.getOperationEnum();

		switch (op) {
		case CREATE:
			resMessage = manager.create(reqMessage);
			break;
		case RETRIEVE:
			resMessage = manager.retrieve(reqMessage);
			break;
		case UPDATE:
			resMessage = manager.update(reqMessage);
			break;
		case DELETE:
			resMessage = manager.delete(reqMessage);
			break;
		case DISCOVERY:
			resMessage = manager.discovery(reqMessage);
			break;
		case NOTIFY:
			resMessage = manager.notify(reqMessage);
			//new OneM2mResponse(RESPONSE_STATUS.NOT_IMPLEMENTED, reqMessage);
			break;
		default:
			resMessage = new OneM2mResponse(RESPONSE_STATUS.NOT_IMPLEMENTED, reqMessage);
		}

		if (resMessage == null) {
			resMessage = new OneM2mResponse(RESPONSE_STATUS.INTERNAL_SERVER_ERROR, reqMessage);
		}
		if(reqMessage.getContentType() != null) {
			resMessage.setContentType(reqMessage.getContentType());
		}
		log.debug("process", resMessage.toString());

		return resMessage;

	}

	public void process(OneM2mRequest reqMessage) {

		OneM2mResponse resMessage = null;

		try {

			resMessage = processEx(reqMessage, true);

			if (resMessage != null)	{
				log.debug("ResourceManager.process", resMessage.toString());

				context.getNseManager().sendResponseMessage(resMessage);
			}

		} catch (OneM2MException e) {
			log.error("Handled exception", e);

			reqMessage.setContent(e.getMessage().getBytes());

			resMessage = new OneM2mResponse(e.getResponseStatusCode(), reqMessage);
			if(e.getMessage() != null) {
				resMessage.setContent(e.getMessage().getBytes());
			}
			context.getNseManager().sendResponseMessage(resMessage);
		} catch (Exception e) {

			log.debug("Handled exception", e);

			resMessage = new OneM2mResponse(RESPONSE_STATUS.INTERNAL_SERVER_ERROR, reqMessage);
			if(e.getMessage() != null)
				resMessage.setContent(e.getMessage().getBytes());

			context.getNseManager().sendResponseMessage(resMessage);
		}

		/*
		MongoCollection<Document> collection = context.getDatabaseManager().getCollection("test");
		Document doc = new Document("name", "iitp")
        .append("type", "database")
        .append("count", 1)
        .append("info", new Document("x", 203).append("y", 102));

		collection.insertOne(doc);

		System.out.println("collection count: " + collection.count());
		Document doc2 = collection.find().first();
		System.out.println(doc2);

		context.getNseManager().sendResponseMessage(createResponse(reqMessage, RESPONSE_STATUS.ACCEPTED));
		*/

	}
//	static protected boolean checkIfParentAllowed(Resource parent, String allowed) {
//		return allowed.indexOf(RESOURCE_TYPE.get(parent.getResourceType()).Name()) >= 0;
//	}
	//void checkAccessControlPolicy(reqMessage.getFrom(), OPERATION.CREATE, getAccessControlPolicies(parent)) {
	// create:1, retrieve:2, update:4, delete:8, discovery:16, n:32
//	protected boolean checkAccessControlPolicy(String from, OPERATION op, List<AccessControlPolicy> acps) {
//
//		if (acps == null || acps.size() == 0) {
//			return true;
//		}
//
//		Iterator<AccessControlPolicy> it = acps.iterator();
//
//		while (it.hasNext()) {
//			AccessControlPolicy acp = it.next();
//			Iterator<AccessControlRule> acrIt = acp.getPrivileges().getAccessControlRule().iterator();
//			while (acrIt.hasNext()) {
//				boolean oriOk = false;
//				boolean oprOk = false;
//				AccessControlRule acr = acrIt.next();
//
//				int opr = acr.getAccessControlOperations();
//				switch (op) {
//				case CREATE:
//					oprOk = ((opr & 1) == 1);
//					break;
//				case RETRIEVE:
//					oprOk = ((opr & 2) == 2);
//					break;
//				case UPDATE:
//					oprOk = ((opr & 4) == 4);
//					break;
//				case DELETE:
//					oprOk = ((opr & 8) == 8);
//					break;
//				case DISCOVERY:
//					oprOk = ((opr & 16) == 16);
//					break;
//				case NOTIFY:
//					oprOk = ((opr & 32) == 32);
//					break;
//				}
//
//				Iterator<String> idIt = acr.getAccessControlOriginators().iterator();
//				while (idIt.hasNext()) {
//					if (from.equalsIgnoreCase(idIt.next())) {
//						oriOk = true;
//						break;
//					}
//				}
//
//				if (oriOk && oprOk) {
//					return true;
//				}
//			}
//		}
//
//		return false;
//
//	}

//	protected boolean checkIfCreatePossible(OneM2mRequest reqMessage, Resource parent, String allowedParent) throws OneM2MException {
//
//		if (parent == null) {
//			throw new OneM2MException(RESPONSE_STATUS.NOT_FOUND, "Not found");
//		}
//		if (!checkIfParentAllowed(parent, allowedParent)) {
//			throw new OneM2MException(RESPONSE_STATUS.BAD_REQUEST, "Now allowed parent:"+RESOURCE_TYPE.get(parent.getResourceType()).Name());
//		}
//		if (!checkAccessControlPolicy(reqMessage.getFrom(), OPERATION.CREATE, extractAccessControlPolicies(parent))) {
//			throw new OneM2MException(RESPONSE_STATUS.ACCESS_DENIED, "Access denied");
//		}
//		return true;
//
//	}
//
//	protected List<AccessControlPolicy> extractAccessControlPolicies(Resource res) throws OneM2MException {
//		List<String> acpIds = null;
//		if (res instanceof RegularResource) {
//			RegularResource res2 = (RegularResource)res;
//			acpIds = res2.getAccessControlPolicyIDs();
//		} else if (res instanceof AnnouncedResource) {
//			AnnouncedResource res2 = (AnnouncedResource)res;
//			acpIds = res2.getAccessControlPolicyIDs();
//		} else if (res instanceof CSEBase) {
//			CSEBase res2 = (CSEBase)res;
//			acpIds = res2.getAccessControlPolicyIDs();
//		}
//
//		ArrayList<AccessControlPolicy> acps = new ArrayList<AccessControlPolicy>();
//		if (acpIds != null) {
//			Iterator<String> it = acpIds.iterator();
//			while (it.hasNext()) {
//				AccessControlPolicyDAO dao = new AccessControlPolicyDAO(this.context);
//				AccessControlPolicy acp = (AccessControlPolicy) dao.retrieveByResId(it.next(), null);
//				if (acp != null) {
//					acps.add(acp);
//				}
//			}
//		}
//		return acps;
//	}

//	public String createResourceName(RESOURCE_TYPE type, String parentId) {
//
//		// DAO로 이동 예정 TBD: 이름을 이용해서 num추출 로직 추가해야 함
//		DatabaseManager dbMngr = this.context.getDatabaseManager();
//		MongoCollection<Document> entityCol = dbMngr.getCollection("resEntity");
//
//		BasicDBObject query = new BasicDBObject("parentID", parentId)
//			.append("resourceType", type.Value());
//
//		long cnt = entityCol.count(query);
//		return type+"_"+Long.toString(cnt);
//
//	}

	// added in 2016-10-21
	public ResourceDAO getDAO() {
		return this.dao;
	}

	public Resource getContentResource(OneM2mRequest req, Class<?> cls, XMLConvertor<?> cvt) throws OneM2MException {

		Resource res;
		try {
			String xml = new String(req.getContent(), "UTF-8");
			res = (Resource)cvt.unmarshal(xml);
			log.debug("resourceName: {}", res.getResourceName());
			//System.out.println("resourceName: " + res.getResourceName());
			return res;
		} catch (Exception e) {
			log.debug("Handled exception", e);

			throw new OneM2MException(OneM2mResponse.RESPONSE_STATUS.INVALID_ARGUMENTS, "Invalid format");
		}

	}

	protected RESOURCE_TYPE getResourceTypeWithTo(String to) throws OneM2MException {
		int resType = dao.getResourceType(to);
		return RESOURCE_TYPE.get(resType);
	}

}


text:
{% include 'ghost/general_meta.html' %}

{% include 'ghost/nav_bar.html' %}

      <form id="options-form" class="form-horizontal" action="/ghost/saveoptions/" method="post" accept-charset="utf-8">
        {% csrf_token %}
        {% for option in options %}

          {{option.text}}

            <input type="text" class="form-control" id="opt-{{forloop.counter}}" name="{{option.name}}" value="{{option.value}}" placeholder="Value" required>

        {% endfor %}

            <button type="submit" class="btn btn-primary btn-block">保存</button>

      </form>

{% include 'blog/footer.html' %}
{% include 'ghost/foot.html' %}


text:
subdomain: extended-validation
layout: page
favicon: green
background: green
---

    {{ page.subdomain }}.
{{ site.domain }}

  {% if site.prod %}
    This site uses an EV (Extended Validation) digital certificate.
  {% else %}
    This site’s EV (Extended Validation) digital certificate is
treated like a DV cert because it is not issued by a trusted CA.
  {% endif %}