text:
<?php
/**
 * Entity
 * @author Maykonn Welington Candido<maykonn@outlook.com>
 */

namespace RapidAuthorization;

use Doctrine\DBAL\Connection;
use \PDO;
use \ArrayObject;

class Entity implements EntityInterface
{
    protected $queryBuilder;

    public static function instance(ClientPreferences $preferences, Connection $dbConn)
    {
        $calledClass = get_called_class();

        return self::$instance = new $calledClass($preferences, $dbConn);
    }

    /**
     * @var ClientPreferences
     */
    protected $preferences;

    /**
     * @var ArrayObject
     */
    protected $preferencesList;

    /**
     * @var $this
     */
    protected static $instance;

    /**
     * @var Connection
     */
    protected $db;

    public $id = 0;
    public $name = '';
    public $business_name = '';
    public $description = null;

    protected function __construct(ClientPreferences $preferences, Connection $dbConn)
    {
        $this->preferences = $preferences;
        $this->preferencesList = $this->preferences->getPreferencesList();
        $this->db = $dbConn;
        $this->queryBuilder = $dbConn->createQueryBuilder();
    }

    public static function getInstance()
    {
        return self::$instance;
    }

    public function create($businessName, $name = null, $description = null)
    {
        $this->name = $name;
        $this->business_name = $businessName;
        $this->description = $description;

        return $this->save();
    }

    /**
     * Set '' to $description to set NULL on database
     */
    public function update($id, $businessName, $name = null, $description = null)
    {
        if ($this->populateById($id)) {
            $this->id = $id;
            $this->business_name = $businessName;

            if ($name !== null) {
                $this->name = $name;
            }

            if ($description !== null) {
                $this->description = $description;
            }

            return $this->save();
        }

        return 0;
    }

    /**
     * Populate object with values from record on database
     */
    private function populateById($roleId)
    {
        $task = $this->findById($roleId);

        if ($task) {
            $this->id = (int) $task['id'];
            $this->name = $task['name'];
            $this->business_name = $task['business_name'];
            $this->description = $task['description'];

            return true;
        }

        return false;
    }

    protected function saveFromSQL($sql)
    {
        $stmt = $this->db->prepare($sql);
        $stmt->bindParam(':id', $this->id, PDO::PARAM_INT);
        $stmt->bindParam(':businessName', $this->business_name, PDO::PARAM_STR);

        $name = ($this->name ? $this->name : null);
        $stmt->bindParam(':name', $name);

        $description = ($this->description ? $this->description : null);
        $stmt->bindParam(':description', $description);

        $stmt->execute();

        if ( ! $this->id) {
            $this->id = (int) $this->db->lastInsertId();
        }

        return $this->id = (int) $this->id;
    }

}

redpajama_set_name: RedPajamaGithub


text:
package org.deeplearning4j.spark.iterator;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.spark.broadcast.Broadcast;
import org.datavec.spark.util.DefaultHadoopConfig;
import org.datavec.spark.util.SerializableHadoopConfig;
import org.deeplearning4j.core.loader.MultiDataSetLoader;
import org.deeplearning4j.spark.data.loader.RemoteFileSource;
import org.nd4j.linalg.dataset.api.MultiDataSet;
import org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor;
import org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator;

import java.io.IOException;
import java.io.OutputStream;
import java.net.URI;
import java.util.Collection;
import java.util.Iterator;

public class PathSparkMultiDataSetIterator implements MultiDataSetIterator {

    public static final int BUFFER_SIZE = 4194304; //4 MB

    private final Collection<String> dataSetStreams;
    private MultiDataSetPreProcessor preprocessor;
    private Iterator<String> iter;
    private FileSystem fileSystem;
    private final MultiDataSetLoader loader;
    private final Broadcast<SerializableHadoopConfig> hadoopConfig;

    public PathSparkMultiDataSetIterator(Iterator<String> iter, MultiDataSetLoader loader, Broadcast<SerializableHadoopConfig> hadoopConfig) {
        this.dataSetStreams = null;
        this.iter = iter;
        this.loader = loader;
        this.hadoopConfig = hadoopConfig;
    }

    public PathSparkMultiDataSetIterator(Collection<String> dataSetStreams, MultiDataSetLoader loader, Broadcast<SerializableHadoopConfig> hadoopConfig) {
        this.dataSetStreams = dataSetStreams;
        iter = dataSetStreams.iterator();
        this.loader = loader;
        this.hadoopConfig = hadoopConfig;
    }

    @Override
    public MultiDataSet next(int num) {
        return next();
    }

    @Override
    public boolean resetSupported() {
        return dataSetStreams != null;
    }

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

    @Override
    public void reset() {
        if (dataSetStreams == null)
            throw new IllegalStateException("Cannot reset iterator constructed with an iterator");
        iter = dataSetStreams.iterator();
    }

    @Override
    public void setPreProcessor(MultiDataSetPreProcessor preProcessor) {
        this.preprocessor = preProcessor;
    }

    @Override
    public MultiDataSetPreProcessor getPreProcessor() {
        return preprocessor;
    }

    @Override
    public boolean hasNext() {
        return iter.hasNext();
    }

    @Override
    public MultiDataSet next() {
        MultiDataSet ds = load(iter.next());

        if (preprocessor != null)
            preprocessor.preProcess(ds);
        return ds;
    }

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

    private synchronized MultiDataSet load(String path) {
        if (fileSystem == null) {
            try {
                Configuration c = hadoopConfig == null ? DefaultHadoopConfig.get() : hadoopConfig.getValue().getConfiguration();
                fileSystem = FileSystem.get(new URI(path), c);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }

        try{
            return loader.load(new RemoteFileSource(path, fileSystem, BUFFER_SIZE));
        } catch (IOException e) {
            throw new RuntimeException("Error loading MultiDataSet at path " + path + " - DataSet may be corrupt or invalid." +
                    " Spark MultiDataSets can be validated using org.deeplearning4j.spark.util.data.SparkDataValidation", e);
        }
    }
}


text:
#pragma once
#include "indexer/cell_id.hpp"
#include "indexer/data_header.hpp"
#include "indexer/displacement_manager.hpp"
#include "indexer/feature.hpp"
#include "indexer/feature_covering.hpp"
#include "indexer/feature_visibility.hpp"
#include "indexer/interval_index_builder.hpp"

#include "defines.hpp"

#include "coding/dd_vector.hpp"
#include "coding/file_sort.hpp"
#include "coding/var_serial_vector.hpp"
#include "coding/writer.hpp"

#include "base/base.hpp"
#include "base/logging.hpp"
#include "base/macros.hpp"
#include "base/scope_guard.hpp"

#include "std/string.hpp"
#include "std/type_traits.hpp"
#include "std/utility.hpp"
#include "std/vector.hpp"

namespace covering
{
template <class TDisplacementManager>
class FeatureCoverer
{
public:
  FeatureCoverer(feature::DataHeader const & header, TDisplacementManager & manager,
                 vector<uint32_t> & featuresInBucket, vector<uint32_t> & cellsInBucket)
    : m_header(header)
    , m_scalesIdx(0)
    , m_bucketsCount(header.GetLastScale() + 1)
    , m_displacement(manager)
    , m_codingDepth(covering::GetCodingDepth(header.GetLastScale()))
    , m_featuresInBucket(featuresInBucket)
    , m_cellsInBucket(cellsInBucket)
  {
    m_featuresInBucket.resize(m_bucketsCount);
    m_cellsInBucket.resize(m_bucketsCount);
  }

  template <class TFeature>
  void operator() (TFeature const & ft, uint32_t index) const
  {
    m_scalesIdx = 0;
    uint32_t const minScaleClassif = min(scales::GetUpperScale(),
                                         feature::GetMinDrawableScaleClassifOnly(ft));
    // The classificator won't allow this feature to be drawable for smaller
    // scales so the first buckets can be safely skipped.
    // todo(@pimenov) Parallelizing this loop may be helpful.
    for (uint32_t bucket = minScaleClassif; bucket < m_bucketsCount; ++bucket)
    {
      // There is a one-to-one correspondence between buckets and scales.
      // This is not immediately obvious and in fact there was an idea to map
      // a bucket to a contiguous range of scales.
      // todo(@pimenov): We probably should remove scale_index.hpp altogether.
      if (!FeatureShouldBeIndexed(ft, static_cast<int>(bucket), bucket == minScaleClassif /* needReset */))
      {
        continue;
      }

      vector<int64_t> const cells = covering::CoverFeature(ft, m_codingDepth, 250);
      m_displacement.Add(cells, bucket, ft, index);

      m_featuresInBucket[bucket] += 1;
      m_cellsInBucket[bucket] += cells.size();

      break;
    }
  }

private:
  // Every feature should be indexed at most once, namely for the smallest possible scale where
  //   -- its geometry is non-empty;
  //   -- it is visible;
  //   -- it is allowed by the classificator.
  // If the feature is invisible at all scales, do not index it.
  template <class TFeature>
  bool FeatureShouldBeIndexed(TFeature const & ft, int scale, bool needReset) const
  {
    while (m_scalesIdx < m_header.GetScalesCount() && m_header.GetScale(m_scalesIdx) < scale)
    {
      ++m_scalesIdx;
      needReset = true;
    }

    if (needReset)
      ft.ResetGeometry();

    // This function invokes geometry reading for the needed scale.
    if (ft.IsEmptyGeometry(scale))
      return false;

    // This function assumes that geometry rect for the needed scale is already initialized.
    // Note: it works with FeatureBase so in fact it does not use the information about
    // the feature's geometry except for the type and the LimitRect.
    return feature::IsDrawableForIndexGeometryOnly(ft, scale);
  }

  // We do not need to parse a feature's geometry for every bucket.
  // The scales at which geometry changes are encoded in the mwm header.
  // We cannot know them beforehand because they are different for
  // the common case of a country file and the special case of the world file.
  // m_scaleIdx is a position in the scales array that should be reset for every feature
  // and then only move forward. Its purpose is to detect the moments when we
  // need to reread the feature's geometry.
  feature::DataHeader const & m_header;
  mutable size_t m_scalesIdx;

  uint32_t m_bucketsCount;
  TDisplacementManager & m_displacement;
  int m_codingDepth;
  vector<uint32_t> & m_featuresInBucket;
  vector<uint32_t> & m_cellsInBucket;
};

template <class SinkT>
class CellFeaturePairSinkAdapter
{
public:
  explicit CellFeaturePairSinkAdapter(SinkT & sink) : m_Sink(sink) {}

  void operator() (int64_t cellId, uint64_t value) const
  {
    // uint64_t -> uint32_t : assume that feature dat file not more than 4Gb
    CellFeaturePair cellFeaturePair(cellId, static_cast<uint32_t>(value));
    m_Sink.Write(&cellFeaturePair, sizeof(cellFeaturePair));
  }

private:
  SinkT & m_Sink;
};

template <class TFeaturesVector, class TWriter>
void IndexScales(feature::DataHeader const & header, TFeaturesVector const & features,
                 TWriter & writer, string const & tmpFilePrefix)
{
  // TODO: Make scale bucketing dynamic.

  uint32_t const bucketsCount = header.GetLastScale() + 1;

  string const cellsToFeatureAllBucketsFile =
      tmpFilePrefix + CELL2FEATURE_SORTED_EXT + ".allbuckets";
  MY_SCOPE_GUARD(cellsToFeatureAllBucketsFileGuard,
                 bind(&FileWriter::DeleteFileX, cellsToFeatureAllBucketsFile));
  {
    FileWriter cellsToFeaturesAllBucketsWriter(cellsToFeatureAllBucketsFile);

    using TSorter = FileSorter<CellFeatureBucketTuple, WriterFunctor<FileWriter>>;
    using TDisplacementManager = DisplacementManager<TSorter>;
    WriterFunctor<FileWriter> out(cellsToFeaturesAllBucketsWriter);
    TSorter sorter(1024 * 1024 /* bufferBytes */, tmpFilePrefix + CELL2FEATURE_TMP_EXT, out);
    // Heuristically rearrange and filter single-point features to simplify
    // the runtime decision of whether we should draw a feature
    // or sacrifice it for the sake of more important ones.
    TDisplacementManager manager(sorter);
    vector<uint32_t> featuresInBucket(bucketsCount);
    vector<uint32_t> cellsInBucket(bucketsCount);
    features.ForEach(
        FeatureCoverer<TDisplacementManager>(header, manager, featuresInBucket, cellsInBucket));
    manager.Displace();
    sorter.SortAndFinish();

    for (uint32_t bucket = 0; bucket < bucketsCount; ++bucket)
    {
      uint32_t const numCells = cellsInBucket[bucket];
      uint32_t const numFeatures = featuresInBucket[bucket];
      double const cellsPerFeature =
          numFeatures == 0 ? 0.0 : static_cast<double>(numCells) / static_cast<double>(numFeatures);
      LOG(LINFO, ("Scale index for bucket", bucket, ": Features:", numFeatures, "cells:", numCells,
                  "cells per feature:", cellsPerFeature));
    }
  }

  FileReader reader(cellsToFeatureAllBucketsFile);
  DDVector<CellFeatureBucketTuple, FileReader, uint64_t> cellsToFeaturesAllBuckets(reader);

  VarSerialVectorWriter<TWriter> recordWriter(writer, bucketsCount);
  auto it = cellsToFeaturesAllBuckets.begin();

  for (uint32_t bucket = 0; bucket < bucketsCount; ++bucket)
  {
    string const cellsToFeatureFile = tmpFilePrefix + CELL2FEATURE_SORTED_EXT;
    MY_SCOPE_GUARD(cellsToFeatureFileGuard, bind(&FileWriter::DeleteFileX, cellsToFeatureFile));
    {
      FileWriter cellsToFeaturesWriter(cellsToFeatureFile);
      WriterFunctor<FileWriter> out(cellsToFeaturesWriter);
      while (it < cellsToFeaturesAllBuckets.end() && it->GetBucket() == bucket)
      {
        out(it->GetCellFeaturePair());
        ++it;
      }
    }

    {
      FileReader reader(cellsToFeatureFile);
      DDVector<CellFeaturePair, FileReader, uint64_t> cellsToFeatures(reader);
      SubWriter<TWriter> subWriter(writer);
      LOG(LINFO, ("Building interval index for bucket:", bucket));
      BuildIntervalIndex(cellsToFeatures.begin(), cellsToFeatures.end(), subWriter,
                         RectId::DEPTH_LEVELS * 2 + 1);
    }
    recordWriter.FinishRecord();
  }

  // todo(@pimenov). There was an old todo here that said there were
  // features (coastlines) that have been indexed despite being invisible at the last scale.
  // This should be impossible but it is better to recheck it.

  LOG(LINFO, ("All scale indexes done."));
}

}  // namespace covering


text:
<?xml version="1.0" encoding="UTF-8"?>
<form name="frmWeapons" align="client">
	<template name="ListaFlexivel">
		<flowPart minWidth="300" maxWidth="600" height="25" minScaledWidth="280" name="$(rclName)Part" adjustHeightToLine="false" margins="{left=5}">
			<script>
				<![CDATA[
					rawset(self.$(rclName)Part, "_recalcHeight",
						function ()
							self.$(rclName)Part.height = self.$(rclName).height + 25;
						end);
				]]>
			</script>

			<layout align="top" height="25">
				<button text="+" align="left" width="30" onClick="self.$(rclName):append();"/>
				<label text="$(nome)" align="left" width="225" margins="{left=5}"/>
			</layout>

			<recordList name="$(rclName)" field="$(rclField)" templateForm="frmWeaponPart" align="top" layout="vertical" autoHeight="true" hitTest="false" onResize="self.$(rclName)Part._recalcHeight();" minQt="1">
				<event name="onCompare">
			        return ((tonumber(nodeA.nivelWeapon) or 0) - (tonumber(nodeB.nivelWeapon) or 0));
			    </event>
			</recordList>
		</flowPart>
	</template>

	<scrollBox align="client">
		<flowLayout align="top" autoHeight="true" maxColumns="4" horzAlign="center" orientation="vertical" avoidScale="true">
			<ListaFlexivel nome="Proa" rclName="campoProa" rclField="campoProa"/>
			<ListaFlexivel nome="Popa" rclName="campoPopa" rclField="campoPopa"/>
			<ListaFlexivel nome="Bombordo" rclName="campoBombordo" rclField="campoBombordo"/>
			<ListaFlexivel nome="Estibordo" rclName="campoEstibordo" rclField="campoEstibordo"/>
			<ListaFlexivel nome="Torreta" rclName="campoTorreta" rclField="campoTorreta"/>
			<ListaFlexivel nome="Antipessoal" rclName="campoAntipessoal" rclField="campoAntipessoal"/>
		</flowLayout>
	</scrollBox>
</form>


text:
namespace base {
namespace mac {
class ScopedObjCClassSwizzler;
}
}

namespace ui {
namespace test {

// Overrides system setting for scrollbar style with NSScrollerOverlay if we
// want the scrollbar to overlay. Otherwise, override with
// NSScrollerStyleLegacy which means "always show scrollbars".
class ScopedPreferredScrollerStyle {
 public:
  explicit ScopedPreferredScrollerStyle(bool overlay);

  ScopedPreferredScrollerStyle(const ScopedPreferredScrollerStyle&) = delete;
  ScopedPreferredScrollerStyle& operator=(const ScopedPreferredScrollerStyle&) =
      delete;

  ~ScopedPreferredScrollerStyle();

 private:
  std::unique_ptr<base::mac::ScopedObjCClassSwizzler> swizzler_;

  // True if the scrollbar style should overlay.
  bool overlay_;
};

}  // namespace test
}  // namespace ui

#endif  // UI_BASE_TEST_SCOPED_PREFERRED_SCROLLER_STYLE_MAC_H_


text:
@implementation BUKCollectionViewCellFactory

#pragma mark - Class Methods

+ (instancetype)factoryWithCellClass:(Class)cellClass configurator:(BUKCollectionViewCellConfigurationHandler)configurator {
    return [[self alloc] initWithCellClass:cellClass configurator:configurator];
}

#pragma mark - Initializer

- (instancetype)initWithCellClass:(Class)cellClass configurator:(BUKCollectionViewCellConfigurationHandler)configurator {
    NSParameterAssert([cellClass isSubclassOfClass:[UICollectionViewCell class]]);

    if ((self = [super init])) {
        _cellClass = cellClass;
        _reuseIdentifier = NSStringFromClass(cellClass);
        _cellConfigurator = [configurator copy];
    }

    return self;
}

#pragma mark - BUKCollectionViewCellFactoryProtocol

- (Class)cellClassForItem:(BUKCollectionViewItem *)item atIndexPath:(NSIndexPath *)indexPath {
    return self.cellClass;
}

- (NSString *)reuseIdentifierForItem:(BUKCollectionViewItem *)item atIndexPath:(NSIndexPath *)indexPath {
    return self.reuseIdentifier;
}

- (void)configureCell:(__kindof UICollectionViewCell *)cell withItem:(BUKCollectionViewItem *)item inCollectionView:(UICollectionView *)collectionView atIndexPath:(NSIndexPath *)indexPath {
    if (self.cellConfigurator) {
        self.cellConfigurator(cell, item, collectionView, indexPath);
    }
}

@end


text:
/*
 * Created by Vojta3310
 * If you want to use mi code, keep here this header, pleas!
 * Thanks Vojta3310.
 */
package Moduls.MyPlayerMusic.songAdder;

import Moduls.MyPlayerMusic.Player.GUI.zoomButton;
import VControl.Settings.AppSettings;
import VControl.UI.components.MyScrollbarUI;
import VControl.utiliti;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.sound.sampled.UnsupportedAudioFileException;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.SwingConstants;

/**
 *
 * @author vojta3310
 */
public class WaveEdit extends JPanel {

  private MusicAnalizer ma;
  private final JTextField start;
  private final JTextField end;
  private Long Lstart;
  private Long Lend;
  private final JPanel wave;

  public WaveEdit(MusicAnalizer m) throws IOException {
    ma = m;
    start = new JTextField();//new JSpinner(new SpinnerNumberModel(0L,Long.MIN_VALUE,Long.MAX_VALUE,1L));
    end = new JTextField();//new JSpinner(new SpinnerNumberModel(0L,Long.MIN_VALUE,Long.MAX_VALUE,1L));
    zoomButton zoomIN = new zoomButton("zoomin");
    zoomButton zoomOUT = new zoomButton("zoomout");

    Font f = new Font(AppSettings.getString("Font_Name"), 1, AppSettings.getInt("Font_Size") - 3);
    this.setBackground(AppSettings.getColour("BG_Color"));
    this.setEnd(ma.getLenght());
    start.setText("0");
    end.setBorder(javax.swing.BorderFactory.createEmptyBorder());
    start.setBorder(javax.swing.BorderFactory.createEmptyBorder());
    end.setForeground(AppSettings.getColour("FG_Color"));
    start.setForeground(AppSettings.getColour("FG_Color"));
    end.setBackground(AppSettings.getColour("BG_Color"));
    start.setBackground(AppSettings.getColour("BG_Color"));
    end.setFont(f);
    start.setFont(f);
    end.setEditable(false);
    start.setEditable(false);
    end.setHorizontalAlignment(SwingConstants.RIGHT);

    wave = new JPanel() {
      @Override
      protected void paintComponent(Graphics g) {
        g.setColor(Color.GRAY);
        g.fillRect(0, 0, getWidth(), getHeight());

        g.setColor(Color.BLACK);
        g.fillRect(toPixels(Lstart), 0, toPixels(Lend) - toPixels(Lstart), getHeight());

        g.setColor(Color.DARK_GRAY);
        int v = (int) (getHeight() * 0.6 * ma.getAverangeVolume() + getHeight() / 2);
        int v2 = getHeight() - v;
        g.drawLine(0, v, getWidth(), v);
        g.drawLine(0, v2, getWidth(), v2);

        g.setColor(Color.BLUE);
        ma.Paint((Graphics2D) g);

        g.setColor(Color.GREEN);
        g.fillRect(toPixels(Lstart), 0, 1, getHeight());
        g.setColor(Color.RED);
        g.fillRect(toPixels(Lend), 0, 1, getHeight());
      }
    };
    wave.addMouseListener(new MouseListener() {

      @Override
      public void mouseClicked(MouseEvent me) {
        if (me.getButton() == 1) {
          if (toLen(me.getX()) < Lend) {
            setStart(toLen(me.getX()));
          }
        } else if (me.getButton() == 3) {
          if (toLen(me.getX()) > Lstart) {
            setEnd(toLen(me.getX()));
          }
        }
        wave.repaint();
        wave.revalidate();
      }

      @Override
      public void mousePressed(MouseEvent me) {

      }

      @Override
      public void mouseReleased(MouseEvent me) {

      }

      @Override
      public void mouseEntered(MouseEvent me) {

      }

      @Override
      public void mouseExited(MouseEvent me) {

      }
    });

    zoomIN.addActionListener((ActionEvent ae) -> {
      Dimension a = new Dimension(wave.getSize().width * 2, wave.getSize().height);
      wave.setPreferredSize(a);
      ma.setSize(a);
      try {
        ma.createWaveForm();
      } catch (IOException | UnsupportedAudioFileException ex) {
        Logger.getLogger(WaveEdit.class.getName()).log(Level.SEVERE, null, ex);
      }
      wave.repaint();
      wave.revalidate();
    });

    zoomOUT.addActionListener((ActionEvent ae) -> {
      Dimension a = new Dimension(wave.getSize().width / 2, wave.getSize().height);
      wave.setPreferredSize(a);
      ma.setSize(a);
      try {
        ma.createWaveForm();
      } catch (IOException | UnsupportedAudioFileException ex) {
        Logger.getLogger(WaveEdit.class.getName()).log(Level.SEVERE, null, ex);
      }
      wave.repaint();
      wave.revalidate();
    });

    ma.setSize(wave.getSize());

    JScrollPane jScrollPane1 = new JScrollPane(wave);
    jScrollPane1.setBorder(javax.swing.BorderFactory.createLineBorder(AppSettings.getColour("FG_Color"), 2));
    jScrollPane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    jScrollPane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);

    JScrollBar sb = jScrollPane1.getHorizontalScrollBar();
    sb.setPreferredSize(new Dimension(Integer.MAX_VALUE, AppSettings.getInt("Border_Size")));
    sb.setUI(new MyScrollbarUI());

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setAutoCreateGaps(true);
    layout.setAutoCreateContainerGaps(true);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
          .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)
          .addGroup(layout.createSequentialGroup()
            .addComponent(start, 80, 80, 80)
            .addComponent(zoomIN)
            .addComponent(zoomOUT)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(end, 80, 80, 80)))
      )
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(start, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(zoomIN)
          .addComponent(zoomOUT)
          .addComponent(end, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
        .addComponent(jScrollPane1, 10, javax.swing.GroupLayout.DEFAULT_SIZE, Integer.MAX_VALUE)
      )
    );

    wave.repaint();
    wave.revalidate();
    ma.setSize(wave.getSize());
  }

  private int toPixels(long len) {
    return (int) ((((float) len / (float) ma.getLenght())) * wave.getWidth());
  }

  private long toLen(int pixels) {
    return (long) (((float) pixels / (float) wave.getWidth()) * ma.getLenght());
  }

  public MusicAnalizer getMa() {
    return ma;
  }

  public void setMa(MusicAnalizer m) {
    try {
      this.ma = m;
      ma.setSize(wave.getSize());
      ma.createWaveForm();
      this.setEnd(ma.getLenght());
      wave.repaint();
      wave.revalidate();
    } catch (IOException | UnsupportedAudioFileException ex) {
      Logger.getLogger(WaveEdit.class.getName()).log(Level.SEVERE, null, ex);
    }
  }

  public long getStart() {
    return Lstart;
  }

  public void setStart(long start) {
    Lstart = start;
    this.start.setText(utiliti.MilToTime(start));
  }

  public long getEnd() {
    return Lend;
  }

  public final void setEnd(Long end) {
    Lend = end;
    this.end.setText(utiliti.MilToTime(end));
  }
}


text:
<?xml version='1.0' encoding='utf-8'?>
<index xmlns="http://jessevdk.github.com/cldoc/1.0">
  <category name="Tutorials" ref="Tutorials#Tutorials">
    <category name="File Manipulation" ref="Tutorials::File Manipulation#Tutorials::File Manipulation" />
    <category name="Serialization" ref="Tutorials::Serialization#Tutorials::Serialization">
      <category name="Quick Reference" ref="Tutorials::Serialization::Quick Reference#Tutorials::Serialization::Quick Reference">
        <brief>First read the entire tutorial</brief>
      </category>
      <category name="Getting started" ref="Tutorials::Serialization::Getting started#Tutorials::Serialization::Getting started">
        <brief>How the info is stored and basics about process</brief>
      </category>
      <category name="Show me the code!" ref="Tutorials::Serialization::Show me the code!#Tutorials::Serialization::Show me the code!">
        <brief>Simple serialization, vector-like</brief>
      </category>
      <category name="Using multiple parameters" ref="Tutorials::Serialization::Using multiple parameters#Tutorials::Serialization::Using multiple parameters">
        <brief>Using multiple parameters. Vector-like</brief>
      </category>
      <category name="Hash aproximation" ref="Tutorials::Serialization::Hash aproximation#Tutorials::Serialization::Hash aproximation">
        <brief>Unordered name dependent serialization</brief>
      </category>
      <category name="File management" ref="Tutorials::Serialization::File management#Tutorials::Serialization::File management">
        <brief>Reusing files for multiple purposes</brief>
      </category>
      <category name="Using complex parameters, Vector-like" ref="Tutorials::Serialization::Using complex parameters, Vector-like#Tutorials::Serialization::Using complex parameters, Vector-like">
        <brief>Serializaing n dimensional vectors</brief>
      </category>
      <category name="Using complex parameters, Hash-like" ref="Tutorials::Serialization::Using complex parameters, Hash-like#Tutorials::Serialization::Using complex parameters, Hash-like">
        <brief>Serializaing n dimensional vectors</brief>
      </category>
      <category name="Using serializable classes as parameters" ref="Tutorials::Serialization::Using serializable classes as parameters#Tutorials::Serialization::Using serializable classes as parameters">
        <brief>Also mixing hash-like and vector-like serialization</brief>
      </category>
      <category name="Inheriting serializable ability" ref="Tutorials::Serialization::Inheriting serializable ability#Tutorials::Serialization::Inheriting serializable ability">
        <brief>No multiple inheritance supported yet</brief>
      </category>
      <category name="Serializing pointers of basic types" ref="Tutorials::Serialization::Serializing pointers of basic types#Tutorials::Serialization::Serializing pointers of basic types">
        <brief>Non serializable class pointer case</brief>
      </category>
      <category name="Serializing pointers of serializable classes" ref="Tutorials::Serialization::Serializing pointers of serializable classes#Tutorials::Serialization::Serializing pointers of serializable classes">
        <brief>The polymorphic problem</brief>
      </category>
    </category>
  </category>
  <namespace name="json" ref="json#json">
    <class name="AbstractObject" ref="json::AbstractObject#json::AbstractObject">
      <brief> Represents a node in the tree structure</brief>
    </class>
    <struct name="JsonLog" ref="json::JsonLog#json::JsonLog">
      <brief> Contains information about errors</brief>
    </struct>
    <class name="JsonTree" ref="json::JsonTree#json::JsonTree">
      <brief> Contains a json hirarchy and allows its manipulation</brief>
    </class>
    <class name="ObjectContainer" ref="json::ObjectContainer#json::ObjectContainer">
      <brief> Base class for Vectors & Hashes</brief>
    </class>
    <class name="ObjectFinal" ref="json::ObjectFinal#json::ObjectFinal">
      <brief> Base class for final nodes</brief>
    </class>
    <class name="ObjectFinalBool" ref="json::ObjectFinalBool#json::ObjectFinalBool">
      <brief> Represents an integer</brief>
    </class>
    <class name="ObjectFinalNumber" ref="json::ObjectFinalNumber#json::ObjectFinalNumber">
      <brief> Represents a number</brief>
    </class>
    <class name="ObjectFinalString" ref="json::ObjectFinalString#json::ObjectFinalString">
      <brief> Represents a string</brief>
    </class>
    <class name="ObjectMap" ref="json::ObjectMap#json::ObjectMap">
      <brief> Representation of {}</brief>
    </class>
    <class name="ObjectVector" ref="json::ObjectVector#json::ObjectVector">
      <brief> Representation of []</brief>
    </class>
    <class name="Parser" ref="json::Parser#json::Parser">
      <brief> Translates between <ref ref="json::JsonTree#json::JsonTree">json::JsonTree</ref> and json files / strings</brief>
    </class>
    <class name="Serializable" ref="json::Serializable#json::Serializable">
      <brief> Base class for serializable custom classes</brief>
      <struct name="__end_dummy__" ref="json::Serializable::__end_dummy__#json::Serializable::__end_dummy__" />
      <struct name="InheritanceIndex" ref="json::Serializable::InheritanceIndex#json::Serializable::InheritanceIndex">
        <brief>Used to manage the parameters order in serialization inheritance</brief>
      </struct>
    </class>
  </namespace>
  <report name="Documentation generator" ref="report" />
</index>


text:
declare namespace javax {
  namespace swing {
    namespace plaf {
      namespace metal {

        class MetalComboBoxIcon implements javax.swing.Icon, java.io.Serializable {
          public constructor()
          public paintIcon(arg0: java.awt.Component, arg1: java.awt.Graphics, arg2: number | java.lang.Integer, arg3: number | java.lang.Integer): void
          public getIconWidth(): number
          public getIconHeight(): number
        }

      }
    }
  }
}


text:
@implementation UIView (SFStyleKit)

-(void)sk_configureWithElementName:(NSString *)elementName{
    NSDictionary *properties = [[SFStyle sharedInstance] dictionaryForElementName:elementName];
    for (NSString *keyPath in [properties allKeys]){
        [self setValue:properties[keyPath] forKeyPath:keyPath];
    }

}

-(void)setConfigureWithElementName:(NSString *)elementName{
    [self sk_configureWithElementName:elementName];
}

@end


text:
package learn;

import java.util.*;
import java.io.*;

public abstract class Variable implements Serializable {
  /**
	 *
	 */
	private static final long serialVersionUID = -7716689448713286491L;
protected String name;
  protected String value;
  protected int column;

  // used by categorical only
  protected Vector<String> labels;

  /**
   * Creates a Variable.
   */
  public Variable() {
    name = null;
    value = null;
    labels = null;
  }

  /**
   * Creates a Variable with the given name.
   *
   * @param name the String that contains the name of the variable
   */
  public Variable(String name) {
    this.name = name;
    value = null;
    labels = null;
  }

  /**
   * Retrieves the name of the variable.
   *
   * @return the name of the variable
   */
  public String getName() {
    return name;
  }

  /**
   * Sets the value of the variable.
   *
   * @param val the String value of the variable
   */
  public void setValue(String val) {
    value = val;
  }

  /**
   * Retrieves the value of the variable.
   *
   * @return the value of the variable
   */
  public String getValue() {
    return value;
  }

  /**
   * Sets the labels using the given label string.
   *
   * @param labels the String that contains the labels for a categorical variable
   *
   * @param Labels the String
   */
  public void setLabels(String Labels) {
    labels = new Vector<String>();
    StringTokenizer tok = new StringTokenizer(Labels, " ");

    while (tok.hasMoreTokens()) {
      labels.addElement(new String(tok.nextToken()));
    }
  }

  /**
   * Retrieves the label with the specified index.
   *
   * @param index the integer index of the desired label
   *
   * @return the label at the given index
   */
  public String getLabel(int index) {
    return (String) labels.elementAt(index);
  }

  /**
   * Retrieves all the labels from a categorical variable.
   *
   * @return a string that contains all the labels, separated by spaces
   */
  public String getLabels() {
    String labelList = new String();
    Enumeration<String> enumeration = labels.elements();

    while (enumeration.hasMoreElements()) {
      labelList += enumeration.nextElement() + " ";
    }
    return labelList;
  }

  /**
   * Retrieves the index for the given label.
   *
   * @param label the String for which the index is retrieved
   *
   * @return the index of the given label, -1 if label was not found
   */
  public int getIndex(String label) {
    int i = 0, index = -1;
    Enumeration<String> enumeration = labels.elements();

    while (enumeration.hasMoreElements()) {
      if (label.equals(enumeration.nextElement())) {
        index = i;
        break;
      }
      i++;
    }
    return index;
  }

  /**
   * Determines if the variable is categorical.
   *
   * return true if the variable is categorical. Otherwise, returns
   *        false
   *
   * @return the boolean
   */
  public boolean isCategorical() {
    return (labels != null);
  }

  /**
   * Sets the column.
   *
   * @param col the integer value of the column
   */
  public void setColumn(int col) {
    column = col;
  }

  /**
   * Computes the minimum and maximum values for this variable based on the given
   * string, but can also be used to compute other statistics as well.
   *
   * @param inValue the String on which the statistics are based
   */
  public abstract void computeStatistics(String inValue);

  /**
   * Converts the given symbol for use in the network.
   *
   * @param inValue   the String to be converted
   * @param outArray  the double array of  converted values
   * @param inx       the integer index that indicates where the converted output
   *                  is to be stored in the array
   *
   * @return the index of the next element in the array
   */
  public abstract int normalize(String inValue, double[] outArray, int inx);

  /**
   * Retrieves the normalized size of this variable.
   *
   * @return the normalized size
   */
  public int getNormalizedSize() {
    return 1;
  }

  /*
   * Retrieves the activation value in a format that can be displayed.
   *
   * @param act the double array of activation values
   * @param index the index of the activation to be displayed
   *
   * @return the value in a format that can be displayed
   */

  /**
   * Method getDecodedValue
   *
   * @param act the double[]
   * @param index the int
   *
   * @return the String
   *
   */
  public String getDecodedValue(double[] act, int index) {
    return String.valueOf(act[index]);
  }
}


text:
#include "tensorflow/core/profiler/lib/scoped_annotation.h"

#include <string>

#include "absl/strings/str_cat.h"
#include "tensorflow/core/platform/test.h"
#include "tensorflow/core/platform/test_benchmark.h"
#include "tensorflow/core/profiler/internal/cpu/annotation_stack.h"

namespace tensorflow {
namespace profiler {
namespace {

TEST(ScopedAnnotation, Simple) {
  {
    ScopedAnnotation trace("blah");
    EXPECT_EQ(AnnotationStack::Get(), "");  // not enabled
  }

  {
    AnnotationStack::Enable(true);
    ScopedAnnotation trace("blah");
    EXPECT_EQ(AnnotationStack::Get(), "blah");  // enabled
    AnnotationStack::Enable(false);
  }
  {
    AnnotationStack::Enable(true);
    ScopedAnnotation outer("foo");
    ScopedAnnotation inner("bar");
    EXPECT_EQ(AnnotationStack::Get(), "foo::bar");  // enabled
    AnnotationStack::Enable(false);
  }

  EXPECT_EQ(AnnotationStack::Get(), "");  // not enabled
}

std::string GenerateRandomString(int length) {
  return std::string(length, 'a');
}

void BM_ScopedAnnotationDisabled(::testing::benchmark::State& state) {
  const int annotation_size = state.range(0);

  std::string annotation = GenerateRandomString(annotation_size);
  for (auto s : state) {
    ScopedAnnotation trace(annotation);
  }
}

BENCHMARK(BM_ScopedAnnotationDisabled)->Arg(8)->Arg(32)->Arg(128);

void BM_ScopedAnnotationEnabled(::testing::benchmark::State& state) {
  const int annotation_size = state.range(0);

  std::string annotation = GenerateRandomString(annotation_size);
  AnnotationStack::Enable(true);
  for (auto s : state) {
    ScopedAnnotation trace(annotation);
  }
  AnnotationStack::Enable(false);
}

BENCHMARK(BM_ScopedAnnotationEnabled)->Arg(8)->Arg(32)->Arg(128);

void BM_ScopedAnnotationEnabled_Nested(::testing::benchmark::State& state) {
  const int annotation_size = state.range(0);

  std::string annotation = GenerateRandomString(annotation_size);
  AnnotationStack::Enable(true);
  for (auto s : state) {
    ScopedAnnotation trace(annotation);
    { ScopedAnnotation trace(annotation); }
  }
  AnnotationStack::Enable(false);
}

BENCHMARK(BM_ScopedAnnotationEnabled_Nested)->Arg(8)->Arg(32)->Arg(128);

void BM_ScopedAnnotationEnabled_Adhoc(::testing::benchmark::State& state) {
  AnnotationStack::Enable(true);
  int i = 0;
  for (auto s : state) {
    // generate the annotation on the fly.
    ScopedAnnotation trace(absl::StrCat(i, "-", i * i));
    ++i;
  }
  AnnotationStack::Enable(false);
}

BENCHMARK(BM_ScopedAnnotationEnabled_Adhoc);

void BM_ScopedAnnotationDisabled_Lambda(::testing::benchmark::State& state) {
  int i = 0;
  for (auto s : state) {
    ScopedAnnotation trace([&]() { return absl::StrCat(i, "-", i * i); });
    ++i;
  }
}

BENCHMARK(BM_ScopedAnnotationDisabled_Lambda);

void BM_ScopedAnnotationEnabled_Adhoc_Lambda(
    ::testing::benchmark::State& state) {
  AnnotationStack::Enable(true);
  int i = 0;
  for (auto s : state) {
    ScopedAnnotation trace([&]() { return absl::StrCat(i, "-", i * i); });
    ++i;
  }
  AnnotationStack::Enable(false);
}

BENCHMARK(BM_ScopedAnnotationEnabled_Adhoc_Lambda);

}  // namespace
}  // namespace profiler
}  // namespace tensorflow


text:
import logging
from pyvisdk.exceptions import InvalidArgumentError

########################################
# Automatically generated, do not edit.
########################################

log = logging.getLogger(__name__)

def HostNatServiceNameServiceSpec(vim, *args, **kwargs):
    '''This data object type specifies the information for the name servers.'''

    obj = vim.client.factory.create('ns0:HostNatServiceNameServiceSpec')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 7:
        raise IndexError('Expected at least 8 arguments got: %d' % len(args))

    required = [ 'dnsAutoDetect', 'dnsPolicy', 'dnsRetries', 'dnsTimeout', 'nbdsTimeout',
        'nbnsRetries', 'nbnsTimeout' ]
    optional = [ 'dnsNameServer', 'dynamicProperty', 'dynamicType' ]

    for name, arg in zip(required+optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError("Invalid argument: %s.  Expected one of %s" % (name, ", ".join(required + optional)))

    return obj


text:
package org.apache.beam.sdk.io.snowflake.test.unit.credentials;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import org.apache.beam.sdk.io.snowflake.credentials.KeyPairSnowflakeCredentials;
import org.apache.beam.sdk.io.snowflake.test.TestUtils;
import org.junit.Test;

public class KeyPairSnowflakeCredentialsTest {
  @Test
  public void testFilePathConstructor() {
    KeyPairSnowflakeCredentials credentials =
        new KeyPairSnowflakeCredentials(
            "username",
            TestUtils.getPrivateKeyPath(getClass()),
            TestUtils.getPrivateKeyPassphrase());
    assertEquals("username", credentials.getUsername());
    assertNotNull(credentials.getPrivateKey());
  }
}


text:
package org.xito.appmanager.store;

import javax.swing.Action;

import org.xito.launcher.LauncherAction;

public class ApplicationNode extends AppStoreNode {

   public static final String TYPE = "app";

   private LauncherAction action;

   public ApplicationNode(LauncherAction action) {
      this.action = action;
   }

   public ApplicationNode(LauncherAction action, boolean dirty) {
      this.action = action;
      setDirty(dirty);
   }

   public String getType() {
      return TYPE;
   }

   public LauncherAction getAction() {
      return action;
   }

   public String getUniqueID() {
      return action.getLaunchDesc().getUniqueID();
   }

   public String getName() {
      return (String)action.toString();
   }
}


text:
function addWidgetsfrmProfile() {
    var lblInfo = new kony.ui.Label({
        "id": "lblInfo",
        "isVisible": true,
        "skin": "sknLblKonyThemeNormal",
        "text": "Please provide the following profile information."
    }, {
        "containerWeight": 100,
        "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT,
        "hExpand": true,
        "margin": [2, 5, 1, 2],
        "marginInPixel": false,
        "padding": [1, 1, 1, 1],
        "paddingInPixel": false,
        "vExpand": false,
        "widgetAlignment": constants.WIDGET_ALIGN_CENTER
    }, {
        "textCopyable": false,
        "wrapping": constants.WIDGET_TEXT_WORD_WRAP
    });
    var hbox21405434215911 = new kony.ui.Box({
        "focusSkin": "hbxWhite",
        "id": "hbox21405434215911",
        "isVisible": true,
        "orientation": constants.BOX_LAYOUT_HORIZONTAL,
        "position": constants.BOX_POSITION_AS_NORMAL,
        "skin": "hbxWhite"
    }, {
        "containerWeight": 100,
        "layoutAlignment": constants.BOX_LAYOUT_ALIGN_FROM_LEFT,
        "layoutType": constants.CONTAINER_LAYOUT_BOX,
        "margin": [0, 0, 0, 0],
        "marginInPixel": false,
        "padding": [0, 0, 0, 0],
        "paddingInPixel": false,
        "percent": true,
        "vExpand": false,
        "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT
    }, {});
    var vbox21405434215912 = new kony.ui.Box({
        "id": "vbox21405434215912",
        "isVisible": true,
        "orientation": constants.BOX_LAYOUT_VERTICAL,
        "position": constants.BOX_POSITION_AS_NORMAL
    }, {
        "containerWeight": 100,
        "layoutType": constants.CONTAINER_LAYOUT_BOX,
        "margin": [2, 0, 0, 0],
        "marginInPixel": false,
        "padding": [0, 0, 0, 0],
        "paddingInPixel": false,
        "vExpand": false,
        "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT
    }, {});
    var txtBoxFname = new kony.ui.TextBox2({
        "autoCapitalize": constants.TEXTBOX_AUTO_CAPITALIZE_NONE,
        "focusSkin": "sknTbxKonyThemeLogin",
        "id": "txtBoxFname",
        "isVisible": true,
        "keyBoardStyle": constants.TEXTBOX_KEY_BOARD_STYLE_DEFAULT,
        "placeholder": "First Name",
        "secureTextEntry": false,
        "skin": "sknTbxKonyThemeLogin",
        "text": "Dharmendra",
        "textInputMode": constants.TEXTBOX_INPUT_MODE_ANY
    }, {
        "containerHeightMode": constants.TEXTBOX_DEFAULT_PLATFORM_HEIGHT,
        "containerHeightReference": constants.CONTAINER_HEIGHT_BY_FORM_REFERENCE,
        "containerWeight": 100,
        "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT,
        "hExpand": true,
        "margin": [0, 0, 0, 0],
        "marginInPixel": false,
        "padding": [1, 1, 1, 1],
        "paddingInPixel": false,
        "widgetAlignment": constants.WIDGET_ALIGN_CENTER
    }, {
        "autoCorrect": false,
        "closeButtonText": "Done",
        "keyboardActionLabel": constants.TEXTBOX_KEYBOARD_LABEL_DONE,
        "pasteboardType": constants.TEXTBOX_PASTE_BOARD_TYPE_SYSTEM_LEVEL,
        "placeholderSkin": "sknTbxKonyThemeLogin",
        "showClearButton": true,
        "showCloseButton": true,
        "showProgressIndicator": true,
        "viewType": constants.TEXTBOX_VIEW_TYPE_DEFAULT
    });
    var line1 = new kony.ui.Line({
        "id": "line1",
        "isVisible": true,
        "skin": "lineNormal"
    }, {
        "margin": [1, 1, 0, 1],
        "marginInPixel": true,
        "thickness": 1
    }, {});
    var txtBoxLname = new kony.ui.TextBox2({
        "autoCapitalize": constants.TEXTBOX_AUTO_CAPITALIZE_NONE,
        "focusSkin": "sknTbxKonyThemeLogin",
        "id": "txtBoxLname",
        "isVisible": true,
        "keyBoardStyle": constants.TEXTBOX_KEY_BOARD_STYLE_DEFAULT,
        "placeholder": "Last Name",
        "secureTextEntry": false,
        "skin": "sknTbxKonyThemeLogin",
        "text": "Kumar",
        "textInputMode": constants.TEXTBOX_INPUT_MODE_ANY
    }, {
        "containerHeightMode": constants.TEXTBOX_DEFAULT_PLATFORM_HEIGHT,
        "containerHeightReference": constants.CONTAINER_HEIGHT_BY_FORM_REFERENCE,
        "containerWeight": 100,
        "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT,
        "hExpand": true,
        "margin": [0, 0, 0, 0],
        "marginInPixel": false,
        "padding": [1, 1, 1, 1],
        "paddingInPixel": false,
        "widgetAlignment": constants.WIDGET_ALIGN_CENTER
    }, {
        "autoCorrect": false,
        "closeButtonText": "Done",
        "keyboardActionLabel": constants.TEXTBOX_KEYBOARD_LABEL_DONE,
        "pasteboardType": constants.TEXTBOX_PASTE_BOARD_TYPE_SYSTEM_LEVEL,
        "placeholderSkin": "sknTbxKonyThemeLogin",
        "showClearButton": true,
        "showCloseButton": true,
        "showProgressIndicator": true,
        "viewType": constants.TEXTBOX_VIEW_TYPE_DEFAULT
    });
    var line21405434215916 = new kony.ui.Line({
        "id": "line21405434215916",
        "isVisible": true,
        "skin": "lineNormal"
    }, {
        "margin": [1, 1, 0, 1],
        "marginInPixel": true,
        "thickness": 1
    }, {});
    var txtBoxEmail = new kony.ui.TextBox2({
        "autoCapitalize": constants.TEXTBOX_AUTO_CAPITALIZE_NONE,
        "focusSkin": "sknTbxKonyThemeLogin",
        "id": "txtBoxEmail",
        "isVisible": true,
        "keyBoardStyle": constants.TEXTBOX_KEY_BOARD_STYLE_DEFAULT,
        "placeholder": "E-mail Address",
        "secureTextEntry": false,
        "skin": "sknTbxKonyThemeLogin",
        "text": "dharmendra.kumar@Kony.com",
        "textInputMode": constants.TEXTBOX_INPUT_MODE_ANY
    }, {
        "containerHeightMode": constants.TEXTBOX_DEFAULT_PLATFORM_HEIGHT,
        "containerHeightReference": constants.CONTAINER_HEIGHT_BY_FORM_REFERENCE,
        "containerWeight": 100,
        "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT,
        "hExpand": true,
        "margin": [0, 0, 0, 0],
        "marginInPixel": false,
        "padding": [1, 1, 1, 1],
        "paddingInPixel": false,
        "widgetAlignment": constants.WIDGET_ALIGN_CENTER
    }, {
        "autoCorrect": false,
        "closeButtonText": "Done",
        "keyboardActionLabel": constants.TEXTBOX_KEYBOARD_LABEL_DONE,
        "pasteboardType": constants.TEXTBOX_PASTE_BOARD_TYPE_SYSTEM_LEVEL,
        "placeholderSkin": "sknTbxKonyThemeLogin",
        "showClearButton": true,
        "showCloseButton": true,
        "showProgressIndicator": true,
        "viewType": constants.TEXTBOX_VIEW_TYPE_DEFAULT
    });
    var line3 = new kony.ui.Line({
        "id": "line3",
        "isVisible": false,
        "skin": "lineNormal"
    }, {
        "margin": [1, 1, 0, 1],
        "marginInPixel": true,
        "thickness": 1
    }, {});
    var txtBoxCountry = new kony.ui.TextBox2({
        "autoCapitalize": constants.TEXTBOX_AUTO_CAPITALIZE_NONE,
        "focusSkin": "sknTbxKonyThemeLogin",
        "id": "txtBoxCountry",
        "isVisible": false,
        "keyBoardStyle": constants.TEXTBOX_KEY_BOARD_STYLE_DEFAULT,
        "placeholder": "Country",
        "secureTextEntry": false,
        "skin": "sknTbxKonyThemeLogin",
        "text": "India",
        "textInputMode": constants.TEXTBOX_INPUT_MODE_ANY
    }, {
        "containerHeightMode": constants.TEXTBOX_DEFAULT_PLATFORM_HEIGHT,
        "containerHeightReference": constants.CONTAINER_HEIGHT_BY_FORM_REFERENCE,
        "containerWeight": 100,
        "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT,
        "hExpand": true,
        "margin": [0, 0, 0, 0],
        "marginInPixel": false,
        "padding": [1, 1, 1, 1],
        "paddingInPixel": false,
        "widgetAlignment": constants.WIDGET_ALIGN_CENTER
    }, {
        "autoCorrect": false,
        "closeButtonText": "Done",
        "keyboardActionLabel": constants.TEXTBOX_KEYBOARD_LABEL_DONE,
        "pasteboardType": constants.TEXTBOX_PASTE_BOARD_TYPE_SYSTEM_LEVEL,
        "placeholderSkin": "sknTbxKonyThemeLogin",
        "showClearButton": true,
        "showCloseButton": true,
        "showProgressIndicator": true,
        "viewType": constants.TEXTBOX_VIEW_TYPE_DEFAULT
    });
    var line186678808140 = new kony.ui.Line({
        "id": "line186678808140",
        "isVisible": false,
        "skin": "lineNormal"
    }, {
        "margin": [1, 1, 0, 1],
        "marginInPixel": true,
        "thickness": 1
    }, {});
    var txtBoxState = new kony.ui.TextBox2({
        "autoCapitalize": constants.TEXTBOX_AUTO_CAPITALIZE_NONE,
        "focusSkin": "sknTbxKonyThemeLogin",
        "id": "txtBoxState",
        "isVisible": false,
        "keyBoardStyle": constants.TEXTBOX_KEY_BOARD_STYLE_DEFAULT,
        "placeholder": "State",
        "secureTextEntry": false,
        "skin": "sknTbxKonyThemeLogin",
        "text": "Andhra Pradesh",
        "textInputMode": constants.TEXTBOX_INPUT_MODE_ANY
    }, {
        "containerHeightMode": constants.TEXTBOX_DEFAULT_PLATFORM_HEIGHT,
        "containerHeightReference": constants.CONTAINER_HEIGHT_BY_FORM_REFERENCE,
        "containerWeight": 100,
        "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT,
        "hExpand": true,
        "margin": [0, 0, 0, 0],
        "marginInPixel": false,
        "padding": [1, 1, 1, 1],
        "paddingInPixel": false,
        "widgetAlignment": constants.WIDGET_ALIGN_CENTER
    }, {
        "autoCorrect": false,
        "closeButtonText": "Done",
        "keyboardActionLabel": constants.TEXTBOX_KEYBOARD_LABEL_DONE,
        "pasteboardType": constants.TEXTBOX_PASTE_BOARD_TYPE_SYSTEM_LEVEL,
        "placeholderSkin": "sknTbxKonyThemeLogin",
        "showClearButton": true,
        "showCloseButton": true,
        "showProgressIndicator": true,
        "viewType": constants.TEXTBOX_VIEW_TYPE_DEFAULT
    });
    var line18667880811326 = new kony.ui.Line({
        "id": "line18667880811326",
        "isVisible": true,
        "skin": "lineNormal"
    }, {
        "margin": [0, 0, 0, 0],
        "marginInPixel": false,
        "thickness": 1
    }, {});
    var listbox5316540885527 = new kony.ui.ListBox({
        "focusSkin": "sknListboxKonyThemeNormal",
        "id": "listbox5316540885527",
        "isVisible": true,
        "onSelection": p2kwiet428023489545_listbox5316540885527_onSelection_seq0,
        "skin": "sknListboxKonyThemeNormal"
    }, {
        "containerWeight": 100,
        "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT,
        "hExpand": true,
        "margin": [1, 1, 1, 1],
        "marginInPixel": true,
        "padding": [0, 1, 0, 1],
        "paddingInPixel": false,
        "vExpand": false,
        "widgetAlignment": constants.WIDGET_ALIGN_CENTER
    }, {
        "dropDownImage": "d_arrow_grey.png",
        "groupCells": false,
        "placeholder": "Select Country",
        "viewType": constants.LISTBOX_VIEW_TYPE_LISTVIEW
    });
    var lineState = new kony.ui.Line({
        "id": "lineState",
        "isVisible": false,
        "skin": "lineNormal"
    }, {
        "margin": [0, 0, 0, 0],
        "marginInPixel": false,
        "thickness": 1
    }, {});
    var lstboxStates = new kony.ui.ListBox({
        "focusSkin": "sknListboxKonyThemeNormal",
        "id": "lstboxStates",
        "isVisible": false,
        "onSelection": p2kwiet428023489545_lstboxStates_onSelection_seq0,
        "skin": "sknListboxKonyThemeNormal"
    }, {
        "containerWeight": 100,
        "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT,
        "hExpand": true,
        "margin": [1, 1, 1, 1],
        "marginInPixel": true,
        "padding": [0, 1, 0, 1],
        "paddingInPixel": false,
        "vExpand": false,
        "widgetAlignment": constants.WIDGET_ALIGN_CENTER
    }, {
        "dropDownImage": "d_arrow_grey.png",
        "groupCells": false,
        "placeholder": "Select State",
        "viewType": constants.LISTBOX_VIEW_TYPE_LISTVIEW
    });
    var line5316540882080 = new kony.ui.Line({
        "id": "line5316540882080",
        "isVisible": true,
        "skin": "lineNormal"
    }, {
        "margin": [1, 1, 0, 1],
        "marginInPixel": true,
        "thickness": 1
    }, {});
    var txtBoxMob = new kony.ui.TextBox2({
        "autoCapitalize": constants.TEXTBOX_AUTO_CAPITALIZE_NONE,
        "focusSkin": "sknTbxKonyThemeLogin",
        "id": "txtBoxMob",
        "isVisible": true,
        "keyBoardStyle": constants.TEXTBOX_KEY_BOARD_STYLE_DEFAULT,
        "placeholder": "Mobile Number",
        "secureTextEntry": false,
        "skin": "sknTbxKonyThemeLogin",
        "text": "+918008419258",
        "textInputMode": constants.TEXTBOX_INPUT_MODE_ANY
    }, {
        "containerHeightMode": constants.TEXTBOX_DEFAULT_PLATFORM_HEIGHT,
        "containerHeightReference": constants.CONTAINER_HEIGHT_BY_FORM_REFERENCE,
        "containerWeight": 100,
        "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT,
        "hExpand": true,
        "margin": [0, 0, 0, 0],
        "marginInPixel": false,
        "padding": [1, 1, 1, 1],
        "paddingInPixel": false,
        "widgetAlignment": constants.WIDGET_ALIGN_CENTER
    }, {
        "autoCorrect": false,
        "closeButtonText": "Done",
        "keyboardActionLabel": constants.TEXTBOX_KEYBOARD_LABEL_DONE,
        "pasteboardType": constants.TEXTBOX_PASTE_BOARD_TYPE_SYSTEM_LEVEL,
        "placeholderSkin": "sknTbxKonyThemeLogin",
        "showClearButton": true,
        "showCloseButton": true,
        "showProgressIndicator": true,
        "viewType": constants.TEXTBOX_VIEW_TYPE_DEFAULT
    });
    vbox21405434215912.add(txtBoxFname, line1, txtBoxLname, line21405434215916, txtBoxEmail, line3, txtBoxCountry, line186678808140, txtBoxState, line18667880811326, listbox5316540885527, lineState, lstboxStates, line5316540882080, txtBoxMob);
    hbox21405434215911.add(vbox21405434215912);
    var hbox21405434215921 = new kony.ui.Box({
        "focusSkin": "sknHbxKonyThemeTransparent",
        "id": "hbox21405434215921",
        "isVisible": true,
        "orientation": constants.BOX_LAYOUT_HORIZONTAL,
        "position": constants.BOX_POSITION_AS_FOOTER,
        "skin": "sknHbxKonyThemeTransparent"
    }, {
        "containerWeight": 100,
        "layoutAlignment": constants.BOX_LAYOUT_ALIGN_FROM_LEFT,
        "layoutType": constants.CONTAINER_LAYOUT_BOX,
        "margin": [0, 0, 0, 0],
        "marginInPixel": false,
        "padding": [0, 0, 0, 0],
        "paddingInPixel": false,
        "percent": true,
        "vExpand": false,
        "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT
    }, {});
    var btnSubmitProfile = new kony.ui.Button({
        "focusSkin": "sknBtnKonyThemeNormal",
        "id": "btnSubmitProfile",
        "isVisible": true,
        "onClick": p2kwiet428023489545_btnSubmitProfile_onClick_seq0,
        "skin": "sknBtnKonyThemeNormal",
        "text": "DONE"
    }, {
        "containerWeight": 100,
        "contentAlignment": constants.CONTENT_ALIGN_CENTER,
        "displayText": true,
        "hExpand": true,
        "margin": [0, 0, 0, 0],
        "marginInPixel": false,
        "padding": [0, 3, 0, 3],
        "paddingInPixel": false,
        "vExpand": false,
        "widgetAlignment": constants.WIDGET_ALIGN_CENTER
    }, {
        "glowEffect": false,
        "showProgressIndicator": true
    });
    hbox21405434215921.add(btnSubmitProfile);
    frmProfile.add(lblInfo, hbox21405434215911, hbox21405434215921);
};

function frmProfileGlobals() {
    frmProfile = new kony.ui.Form2({
        "addWidgets": addWidgetsfrmProfile,
        "bounces": true,
        "enabledForIdleTimeout": false,
        "id": "frmProfile",
        "init": p2kwiet428023489545_frmProfile_init_seq0,
        "needAppMenu": true,
        "preShow": p2kwiet428023489545_frmProfile_preshow_seq0,
        "skin": "sknKonyThemeForm",
        "title": "My Profile"
    }, {
        "displayOrientation": constants.FORM_DISPLAY_ORIENTATION_PORTRAIT,
        "layoutType": constants.CONTAINER_LAYOUT_BOX,
        "padding": [0, 0, 0, 0],
        "paddingInPixel": false
    }, {
        "bounces": true,
        "configureExtendBottom": false,
        "configureExtendTop": false,
        "configureStatusBarStyle": false,
        "extendBottom": false,
        "extendTop": false,
        "footerOverlap": false,
        "formTransparencyDuringPostShow": 100,
        "headerOverlap": false,
        "inputAccessoryViewType": constants.FORM_INPUTACCESSORYVIEW_DEFAULT,
        "inTransitionConfig": {
            "transitionDirection": "none",
            "transitionEffect": "none"
        },
        "needsIndicatorDuringPostShow": true,
        "outTransitionConfig": {
            "transitionDirection": "none",
            "transitionEffect": "none"
        },
        "retainScrollPosition": false,
        "statusBarStyle": constants.STATUS_BAR_STYLE_DEFAULT,
        "titleBar": true,
        "titleBarConfig": {
            "renderTitleText": true,
            "prevFormTitle": false,
            "titleBarLeftSideView": "none",
            "titleBarRightSideView": "none"
        },
        "titleBarSkin": "sknTitleKonyTheme"
    });
};


text:
<?php

namespace PHPExiftool\Driver\Tag\IFD0;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class ModifyDate extends AbstractTag
{

    protected $Id = 306;

    protected $Name = 'ModifyDate';

    protected $FullName = 'Exif::Main';

    protected $GroupName = 'IFD0';

    protected $g0 = 'EXIF';

    protected $g1 = 'IFD0';

    protected $g2 = 'Image';

    protected $Type = 'string';

    protected $Writable = true;

    protected $Description = 'Modify Date';

    protected $local_g2 = 'Time';

}


text:
namespace net {
namespace internal {

namespace {

// Watches a single registry key for changes.
class RegistryWatcher : public base::win::ObjectWatcher::Delegate,
                        public base::NonThreadSafe {
 public:
  typedef base::Callback<void(bool succeeded)> CallbackType;
  RegistryWatcher() {}

  bool Watch(const wchar_t* key, const CallbackType& callback) {
    DCHECK(CalledOnValidThread());
    DCHECK(!callback.is_null());
    DCHECK(callback_.is_null());
    callback_ = callback;
    if (key_.Open(HKEY_LOCAL_MACHINE, key, KEY_NOTIFY) != ERROR_SUCCESS)
      return false;
    if (key_.StartWatching() != ERROR_SUCCESS)
      return false;
    if (!watcher_.StartWatching(key_.watch_event(), this))
      return false;
    return true;
  }

  virtual void OnObjectSignaled(HANDLE object) OVERRIDE {
    DCHECK(CalledOnValidThread());
    bool succeeded = (key_.StartWatching() == ERROR_SUCCESS) &&
                      watcher_.StartWatching(key_.watch_event(), this);
    if (!succeeded && key_.Valid()) {
      watcher_.StopWatching();
      key_.StopWatching();
      key_.Close();
    }
    if (!callback_.is_null())
      callback_.Run(succeeded);
  }

 private:
  CallbackType callback_;
  base::win::RegKey key_;
  base::win::ObjectWatcher watcher_;

  DISALLOW_COPY_AND_ASSIGN(RegistryWatcher);
};

}  // namespace

// Watches registry for changes. Setting up watches requires IO loop.
class DnsConfigWatcher::Core {
 public:
  Core() {}
  ~Core() {}

  bool Watch() {
    RegistryWatcher::CallbackType callback =
        base::Bind(&Core::OnRegistryChanged, base::Unretained(this));

    bool success = true;

    // The Tcpip key must be present.
    if (!tcpip_watcher_.Watch(kTcpipPath, callback)) {
      LOG(ERROR) << "DNS registry watch failed to start.";
      success = false;
    }

    // Watch for IPv6 nameservers.
    tcpip6_watcher_.Watch(kTcpip6Path, callback);

    // DNS suffix search list and devolution can be configured via group
    // policy which sets this registry key. If the key is missing, the policy
    // does not apply, and the DNS client uses Tcpip and Dnscache settings.
    // If a policy is installed, DnsConfigService will need to be restarted.
    // BUG=99509

    dnscache_watcher_.Watch(kDnscachePath, callback);
    policy_watcher_.Watch(kPolicyPath, callback);

    if (!hosts_watcher_.Watch(GetHostsPath(),
                              base::Bind(&Core::OnHostsChanged,
                                         base::Unretained(this)))) {
      LOG(ERROR) << "DNS hosts watch failed to start.";
      success = false;
    }
    return success;
  }

 private:
  void OnRegistryChanged(bool succeeded) {
    if (succeeded) {
      NetworkChangeNotifier::NotifyObserversOfDNSChange(
          NetworkChangeNotifier::CHANGE_DNS_SETTINGS);
    } else {
      LOG(ERROR) << "DNS config watch failed.";
      NetworkChangeNotifier::NotifyObserversOfDNSChange(
          NetworkChangeNotifier::CHANGE_DNS_WATCH_FAILED);
    }
  }

  void OnHostsChanged(const FilePath& path, bool error) {
    if (!error) {
      NetworkChangeNotifier::NotifyObserversOfDNSChange(
          NetworkChangeNotifier::CHANGE_DNS_HOSTS);
    } else {
      LOG(ERROR) << "DNS hosts watch failed.";
      NetworkChangeNotifier::NotifyObserversOfDNSChange(
          NetworkChangeNotifier::CHANGE_DNS_WATCH_FAILED);
    }
  }

  RegistryWatcher tcpip_watcher_;
  RegistryWatcher tcpip6_watcher_;
  RegistryWatcher dnscache_watcher_;
  RegistryWatcher policy_watcher_;
  base::files::FilePathWatcher hosts_watcher_;

  DISALLOW_COPY_AND_ASSIGN(Core);
};

DnsConfigWatcher::DnsConfigWatcher() {}

DnsConfigWatcher::~DnsConfigWatcher() {}

void DnsConfigWatcher::Init() {
  core_.reset(new Core());
  if (core_->Watch()) {
    NetworkChangeNotifier::NotifyObserversOfDNSChange(
        NetworkChangeNotifier::CHANGE_DNS_WATCH_STARTED);
  }
  // TODO(szym): re-start watcher if that makes sense. http://crbug.com/116139
}

void DnsConfigWatcher::CleanUp() {
  core_.reset();
}

}  // namespace internal
}  // namespace net


text:
#include "util/hash.h"
#include "util/int64.h"
#include "kernel/environment.h"

namespace lean {
struct fingerprint_ext : public environment_extension {
    uint64 m_fingerprint;
    fingerprint_ext():m_fingerprint(0) {}
};

struct fingerprint_ext_reg {
    unsigned m_ext_id;
    fingerprint_ext_reg() { m_ext_id = environment::register_extension(std::make_shared<fingerprint_ext>()); }
};

static fingerprint_ext_reg * g_ext = nullptr;
static fingerprint_ext const & get_extension(environment const & env) {
    return static_cast<fingerprint_ext const &>(env.get_extension(g_ext->m_ext_id));
}
static environment update(environment const & env, fingerprint_ext const & ext) {
    return env.update(g_ext->m_ext_id, std::make_shared<fingerprint_ext>(ext));
}

environment update_fingerprint(environment const & env, unsigned h) {
    fingerprint_ext ext = get_extension(env);
    ext.m_fingerprint = hash(ext.m_fingerprint, static_cast<uint64>(h));
    return update(env, ext);
}

uint64 get_fingerprint(environment const & env) {
    return get_extension(env).m_fingerprint;
}

void initialize_fingerprint() {
    g_ext     = new fingerprint_ext_reg();
}

void finalize_fingerprint() {
    delete g_ext;
}
}


text:
use pdq;

# ****************************************
#  Parameters from workload measurements *
# ****************************************
$maxBatJobs     = 10;
$maxIntJobs     = 25;
$intThink       = 30;
$batThink       = 0.0;
$cpuBatBusy     = 600.0;
$dskBatBusy     = 54.0;
$cpuIntBusy     = 47.6;
$dskIntBusy     = 428.4;
$batchCompletes = 600;
$interCompletes = 476;
$cpuSpeedup     = 5; # CPU upgrade in relative units

$totCpuBusy = $cpuBatBusy + $cpuIntBusy;
$totDskBusy = $dskBatBusy + $dskIntBusy;
$totalCompletes = $batchCompletes + $interCompletes;
$maxAggJobs = $maxBatJobs + $maxIntJobs;
$aggThink = ($interCompletes / $totalCompletes) * $intThink;
$aggCpuDemand = $totCpuBusy / $totalCompletes;
$aggDskDemand = $totDskBusy / $totalCompletes;

# ************************************************************
#  Create and analyze models based on the aggregate workload *
# ************************************************************
pdq::Init("Aggregate BASELINE");

pdq::CreateNode("cpu", $pdq::CEN, $pdq::FCFS);
pdq::CreateNode("dsk", $pdq::CEN, $pdq::FCFS);
pdq::CreateClosed("aggwork", $pdq::TERM, $maxAggJobs, $aggThink);

pdq::SetDemand("cpu", "aggwork", $aggCpuDemand);
pdq::SetDemand("dsk", "aggwork", $aggDskDemand);

pdq::Solve($pdq::EXACT);
pdq::Report();

pdq::Init("Aggregate UPGRADE");
pdq::CreateClosed("aggwork", $pdq::TERM, $maxAggJobs, $aggThink);

pdq::CreateNode("cpu", $pdq::CEN, $pdq::FCFS);
pdq::CreateNode("dsk", $pdq::CEN, $pdq::FCFS);
pdq::SetDemand("cpu", "aggwork", $aggCpuDemand / $cpuSpeedup);
pdq::SetDemand("dsk", "aggwork", $aggDskDemand); # Added missing disk

pdq::Solve($pdq::EXACT);
pdq::Report();

# ******************************************************
#  Now analyze models based on the component workloads *
# ******************************************************
pdq::Init("Component BASELINE");
pdq::CreateClosed("batch", $pdq::BATCH, $maxBatJobs, $batThink);

pdq::CreateNode("cpu", $pdq::CEN, $pdq::FCFS);
pdq::CreateNode("dsk", $pdq::CEN, $pdq::FCFS);
pdq::SetDemand("cpu", "batch", $cpuBatBusy / $batchCompletes);
pdq::SetDemand("dsk", "batch", $dskBatBusy / $batchCompletes);

pdq::CreateClosed("online", $pdq::TERM, $maxIntJobs, $intThink);
pdq::SetDemand("cpu", "online", $cpuIntBusy / $interCompletes);
pdq::SetDemand("dsk", "online", $dskIntBusy / $interCompletes);

pdq::Solve($pdq::EXACT);
pdq::Report();

pdq::Init("Component UPGRADE");

pdq::CreateNode("cpu", $pdq::CEN, $pdq::FCFS);
pdq::CreateNode("dsk", $pdq::CEN, $pdq::FCFS);

pdq::CreateClosed("batch", $pdq::BATCH, $maxBatJobs, $batThink);
pdq::SetDemand("cpu", "batch",
    ($cpuBatBusy / $batchCompletes) / $cpuSpeedup);
pdq::SetDemand("dsk", "batch", $dskBatBusy / $batchCompletes);

pdq::CreateClosed("online", $pdq::TERM, $maxIntJobs, $intThink);
pdq::SetDemand("cpu", "online",
    ($cpuIntBusy / $interCompletes) / $cpuSpeedup);
pdq::SetDemand("dsk", "online", $dskIntBusy / $interCompletes);

pdq::Solve($pdq::EXACT);
pdq::Report();


text:
using System.Collections.Generic;
using AutoMapper;
using AutoMapper.Mappers;
using StructureMap.Configuration.DSL;
using StructureMap.Graph;
using StructureMap.Web;

namespace Iris.Web.DependencyResolution.Registeries
{
    public class AutomapperRegistry : Registry
    {
        public AutomapperRegistry()
        {

            For<ConfigurationStore>().Singleton().Use<ConfigurationStore>()
               .Ctor<IEnumerable<IObjectMapper>>().Is(MapperRegistry.Mappers);

            For<IConfigurationProvider>().Use(ctx => ctx.GetInstance<ConfigurationStore>());

            For<IConfiguration>().Use(ctx => ctx.GetInstance<ConfigurationStore>());

            For<ITypeMapFactory>().Use<TypeMapFactory>();

            For<IMappingEngine>().Use(() => Mapper.Engine);
            //.SelectConstructor(() => Mapper.Engine);

            this.Scan(scanner =>
            {
                scanner.AssembliesFromApplicationBaseDirectory();

                scanner.ConnectImplementationsToTypesClosing(typeof(ITypeConverter<,>))
                       .OnAddedPluginTypes(t => t.HybridHttpOrThreadLocalScoped());

                scanner.ConnectImplementationsToTypesClosing(typeof(ValueResolver<,>))
                    .OnAddedPluginTypes(t => t.HybridHttpOrThreadLocalScoped());

            });
        }
    }
}


text:
<?php

namespace Application\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration,
    Doctrine\DBAL\Schema\Schema;

/**
 * Auto-generated Migration: Please modify to your need!
 */
class Version20121004151224 extends AbstractMigration
{
    public function up(Schema $schema)
    {
        // this up() migration is autogenerated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql");

        $this->addSql("CREATE TABLE oauth_access_token (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, PRIMARY KEY(id))");
        $this->addSql("CREATE INDEX IDX_F7FA86A419EB6921 ON oauth_access_token (client_id)");
        $this->addSql("CREATE INDEX IDX_F7FA86A4A76ED395 ON oauth_access_token (user_id)");
        $this->addSql("CREATE TABLE oauth_auth_code (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, PRIMARY KEY(id))");
        $this->addSql("CREATE INDEX IDX_4D12F0E019EB6921 ON oauth_auth_code (client_id)");
        $this->addSql("CREATE INDEX IDX_4D12F0E0A76ED395 ON oauth_auth_code (user_id)");
        $this->addSql("CREATE TABLE oauth_client (id INT NOT NULL, PRIMARY KEY(id))");
        $this->addSql("CREATE TABLE oauth_refresh_token (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, PRIMARY KEY(id))");
        $this->addSql("CREATE INDEX IDX_55DCF75519EB6921 ON oauth_refresh_token (client_id)");
        $this->addSql("CREATE INDEX IDX_55DCF755A76ED395 ON oauth_refresh_token (user_id)");
        $this->addSql("ALTER TABLE oauth_access_token ADD CONSTRAINT FK_F7FA86A419EB6921 FOREIGN KEY (client_id) REFERENCES oauth_client (id) NOT DEFERRABLE INITIALLY IMMEDIATE");
        $this->addSql("ALTER TABLE oauth_access_token ADD CONSTRAINT FK_F7FA86A4A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user_user (id) NOT DEFERRABLE INITIALLY IMMEDIATE");
        $this->addSql("ALTER TABLE oauth_auth_code ADD CONSTRAINT FK_4D12F0E019EB6921 FOREIGN KEY (client_id) REFERENCES oauth_client (id) NOT DEFERRABLE INITIALLY IMMEDIATE");
        $this->addSql("ALTER TABLE oauth_auth_code ADD CONSTRAINT FK_4D12F0E0A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user_user (id) NOT DEFERRABLE INITIALLY IMMEDIATE");
        $this->addSql("ALTER TABLE oauth_refresh_token ADD CONSTRAINT FK_55DCF75519EB6921 FOREIGN KEY (client_id) REFERENCES oauth_client (id) NOT DEFERRABLE INITIALLY IMMEDIATE");
        $this->addSql("ALTER TABLE oauth_refresh_token ADD CONSTRAINT FK_55DCF755A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user_user (id) NOT DEFERRABLE INITIALLY IMMEDIATE");
    }

    public function down(Schema $schema)
    {
        // this down() migration is autogenerated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql");

        $this->addSql("ALTER TABLE oauth_access_token DROP CONSTRAINT FK_F7FA86A419EB6921");
        $this->addSql("ALTER TABLE oauth_auth_code DROP CONSTRAINT FK_4D12F0E019EB6921");
        $this->addSql("ALTER TABLE oauth_refresh_token DROP CONSTRAINT FK_55DCF75519EB6921");
        $this->addSql("DROP SEQUENCE oauth_access_token_id_seq");
        $this->addSql("DROP SEQUENCE oauth_auth_code_id_seq");
        $this->addSql("DROP SEQUENCE oauth_client_id_seq");
        $this->addSql("DROP SEQUENCE oauth_refresh_token_id_seq");
        $this->addSql("CREATE TABLE armd_event_category (id INT NOT NULL, title VARCHAR(255) NOT NULL, slug VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))");
        $this->addSql("DROP TABLE oauth_access_token");
        $this->addSql("DROP TABLE oauth_auth_code");
        $this->addSql("DROP TABLE oauth_client");
        $this->addSql("DROP TABLE oauth_refresh_token");
    }
}


text:
package net.unikernel.bummel.logic_elements;

import net.unikernel.bummel.logic_elements.Analyzer.Analyzer;
import org.junit.After;
import org.junit.Before;
import java.util.TreeMap;
import java.util.Map;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author uko
 */
public class AnalyzerTest
{
	public AnalyzerTest()
	{
	}
	@BeforeClass
	public static void setUpClass() throws Exception
	{
	}
	@AfterClass
	public static void tearDownClass() throws Exception
	{
	}

	Analyzer instance;
	@Before
	public void setUp()
	{
		instance = new Analyzer();
	}
	@After
	public void tearDown()
	{
		instance = null;
	}
	/**
	 * Test of process method, of class Analyzer.
	 */
	@Test
	public void testProcess0()
	{
		System.out.println("an_process0");
		Map<String, Double> valuesOnPorts = new TreeMap<>();
		valuesOnPorts.put("input", 0.);
		Map<String, Double> expResult= new TreeMap<>();
		expResult.put("input", 0.);
		Map result = instance.process(valuesOnPorts);
		assertEquals(expResult, result);
		assertEquals(0, instance.getState());
	}

	@Test
	public void testProcess1()
	{
		System.out.println("an_process1");
		Map<String, Double> valuesOnPorts = new TreeMap<>();
		valuesOnPorts.put("input", 1.);
		Map<String, Double> expResult= new TreeMap<>();
		expResult.put("input", 0.);
		Map result = instance.process(valuesOnPorts);
		assertEquals(expResult, result);
		assertEquals(1, instance.getState());
	}
}


text:
This repository includes some java snippets I liked to play with

+ **jni (Java Native Interface)**

  Use a very simple C++ library function in Java to print a message.
  I tried this on a mac.

  Compile Printer.java using the following command:
  ``javac Printer.java``

  Create the header file to get the signature for you native library
  method you want to call with the following command

  ``javah Printer``

  Use ``/usr/libexec/java_home`` to figure out what your environment variable
  JAVA_HOME should look like.

  Then compile the C++ program lib.cpp like that:

  ``g++ -Wall -shared -fPIC -I$JAVA_HOME/include/
      -I$JAVA_HOME/include/darwin -o libmylib.dylib lib.cpp``

  Execute your java program using
  ``java -Djava.library.path="." Printer``


text:
module Ising
export neighbours, ising!, hamiltonian, Metadata

using  MPI
include("./metamodel.jl")
using .Metamodel: Metadata, writedata!

pprint(x) = show(IOContext(STDOUT, limit=false), "text/plain", x)
function pprintln(x)
    pprint(x)
    println("")
end

function mprint(x)
    for i in 1:size(x, 1)
        for j in 1:size(x, 2)
            if x[i, j] == 1
                print("██")
            else
                print("▒▒")
            end
        end
        print("\n")
    end
end

function neighbours(i, j, A)
    N = size(A, 1)
    function period(x)
        # First ensure that the number is not negative
        # then wrap it around, and add 1 since Julia
        # arrays start at 1
        a = (x + N+1) % (N+1)
        if a == 0
            1
        else
            a
        end
    end
    [A[period(i-1), j], A[i, period(j-1)], A[i, period(j+1)], A[period(i+1), j]]
end

function hamiltonian(A, J)
    n, m = size(A)
    E = 0
    for i ∈ 1:n, j ∈ 1:m
        E -= A[i, j]*sum(neighbours(i, j, A))
    end
    return J*E
end

function hamiltonian(A, J, h)
    hamiltonian(A, J) - h*sum(A)
end

function constructlattice(model)
    # Use Int8 to use as little memory as possible
    if model.initialorientation == :random
        # Construct the lattice with randomly oriented spins.
        rand(model.rng, convert(Vector{Int8}, [-1, 1]),
             (model.latticesize, model.latticesize))
    elseif model.initialorientation == :up
        ones(Int8, (model.latticesize, model.latticesize))
    elseif model.initialorientation == :down
        -ones(Int8, (model.latticesize, model.latticesize))
    else
        throw(ArgumentError("Initial orientation $(model.initialorientation) is not valid."))
    end
end

function initializesystem(model::Metadata)
    N = model.latticesize
    M = model.MCiterations
    J = model.J
    h = model.h
    temperature = model.temperature
    saveperiod = model.saveperiod
    β = 1.0/(1*temperature)

    Λ = constructlattice(model)

    # Since the state space and hence energy space is discrete,
    # the probabilities can be precalculated
    # This is the entire state space to ΔE
    ΔEstates = [-4J, -2J, 0, 2J, 4J]
    # And the probability for each ΔE
    ratio = Dict(i => exp(-β*i) for i in ΔEstates)

    # Matrices to store data for analysis
    if model.version == :parallel
        evolution = zeros(Int8, (M, N, N))
        energies = zeros(Float64, (M-1)*N^2+1)
        magneticmoment = zeros(Float64, (M-1)*N^2+1)
    elseif model.version == :serial
        evolution = zeros(Int8, (N, N))
        energy = 0.0
        magneticmoment = 0.0
    else
        throw(ArgumentError("Unknown model: $(model.version)"))
    end
    (lattice, ratios, evolution, energies, magneticmoment)
end

function ising!(model::Metadata, version::Symbol)
    if version == :parallel
        isingparallel!(model)
    elseif version == :serial
        isingserial!(model)
    else
        throw(ArgumentError("$version is not supported"))
    end
end

function isingserial!(model::Metadata)
    N = model.latticesize
    M = model.MCiterations
    Λ, ratio, evolution, energies, magneticmoment = initializesystem(model)

    # Initial values
    evolution[1, :, :] = Λ
    energies[1] = hamiltonian(Λ, J)
    magneticmoment[1] = sum(Λ)

    # Metropolis Algorithm
    @time for m in 2:M
        counter = 1
        for index in eachindex(Λ)
            n = (N*N)*(m-2) + counter + 1
            i, j = rand(model.rng, 1:N, (1, 2))
            ΔE = J*Λ[i, j]*sum(neighbours(i, j, Λ))
            if ΔE < 0 || rand(model.rng) <= ratio[ΔE]
                Λ[i, j] = -Λ[i, j]
                energies[n] = energies[n-1] + ΔE
                magneticmoment[n] = magneticmoment[n-1] + 2*Λ[i, j]
            else
                energies[n] = energies[n-1]
                magneticmoment[n] = magneticmoment[n-1]
            end
            counter = counter + 1
        end
        evolution[m, :, :] = Λ
    end
    writedata!(model, evolution, energies, magneticmoment)
end

function isingparallel!(model::Metadata)
    N = model.latticesize
    M = model.MCiterations
    Λ, ratio, evolution, energies, magneticmoment = initializesystem(model)

    # Initial values
    energies = hamiltonian(Λ, J)
    magneticmoment = sum(Λ)

    # Metropolis Algorithm
    @time for m in 2:M
        for index in eachindex(Λ)
            i, j = rand(model.rng, 1:N, (1, 2))
            ΔE = J*Λ[i, j]*sum(neighbours(i, j, Λ))
            if ΔE < 0 || rand(model.rng) <= ratio[ΔE]
                Λ[i, j] = -Λ[i, j]
                energy += ΔE
                magneticmoment += 2*Λ[i, j]
            end
        end
    end
    println("Energy $energy")
    println("Magnetic moment $magneticmoment")
    mprint(Λ)
    # writedata!(model, Λ, energy, magneticmoment)
end

end


text:
package yuku.alkitab.base.ac;

import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.os.Bundle;
import com.afollestad.materialdialogs.MaterialDialog;
import yuku.alkitab.base.App;
import yuku.alkitab.base.ac.base.BaseActivity;
import yuku.alkitab.debug.R;

/**
 * Use this class to show an alert dialog if you don't have an existing activity to
 * show the dialog on.
 *
 * This starts a transparent activity and then shows an alert dialog on top
 * of the transparent activity.
 */
public class AlertDialogActivity extends BaseActivity {

	/** Inputs */
	private static final String EXTRA_TITLE = "title";
	private static final String EXTRA_MESSAGE = "message";
	private static final String EXTRA_NEGATIVE = "negative";
	private static final String EXTRA_POSITIVE = "positive";
	private static final String EXTRA_INPUT_TYPE = "input_type";
	private static final String EXTRA_INPUT_HINT = "input_hint";
	private static final String EXTRA_LAUNCH = "launch";

	/** Output */
	public static final String EXTRA_INPUT = "input";

	public static Intent createOkIntent(final CharSequence title, final CharSequence message) {
		return new Intent(App.context, AlertDialogActivity.class)
			.putExtra(EXTRA_TITLE, title)
			.putExtra(EXTRA_MESSAGE, message);
	}

	public static Intent createAskIntent(final CharSequence title, final CharSequence message, final CharSequence negativeButtonText, final CharSequence positiveButtonText, final Intent launchWhenPositive) {
		return new Intent(App.context, AlertDialogActivity.class)
			.putExtra(EXTRA_TITLE, title)
			.putExtra(EXTRA_MESSAGE, message)
			.putExtra(EXTRA_NEGATIVE, negativeButtonText)
			.putExtra(EXTRA_POSITIVE, positiveButtonText)
			.putExtra(EXTRA_LAUNCH, launchWhenPositive);
	}

	public static Intent createInputIntent(final CharSequence title, final CharSequence message, final CharSequence negativeButtonText, final CharSequence positiveButtonText, final int inputType, final CharSequence inputHint) {
		return new Intent(App.context, AlertDialogActivity.class)
			.putExtra(EXTRA_TITLE, title)
			.putExtra(EXTRA_MESSAGE, message)
			.putExtra(EXTRA_NEGATIVE, negativeButtonText)
			.putExtra(EXTRA_POSITIVE, positiveButtonText)
			.putExtra(EXTRA_INPUT_TYPE, inputType)
			.putExtra(EXTRA_INPUT_HINT, inputHint);
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		final Intent intent = getIntent();
		final CharSequence title = intent.getCharSequenceExtra(EXTRA_TITLE);
		final CharSequence message = intent.getCharSequenceExtra(EXTRA_MESSAGE);
		final CharSequence negative = intent.getCharSequenceExtra(EXTRA_NEGATIVE);
		final CharSequence positive = intent.getExtras().getCharSequence(EXTRA_POSITIVE, getText(android.R.string.ok));
		final int inputType = intent.getIntExtra(EXTRA_INPUT_TYPE, 0);
		final CharSequence inputHint = intent.getCharSequenceExtra(EXTRA_INPUT_HINT);
		final Intent launch = intent.getParcelableExtra(EXTRA_LAUNCH);

		final MaterialDialog.Builder builder = new MaterialDialog.Builder(this);

		if (title != null) {
			builder.title(title);
		}

		if (message != null) {
			builder.content(message);
		}

		if (inputHint != null) {
			if (inputType != 0) {
				builder.inputType(inputType);
			}

			builder.input(inputHint, null, false, (dialog, input) -> {
				final Intent returnIntent = new Intent();
				returnIntent.putExtra(EXTRA_INPUT, input.toString());
				setResult(RESULT_OK, returnIntent);
				finish();
			});
		}

		builder.positiveText(positive);

		builder.onPositive((dialog, which) -> {
			if (inputHint == null) {
				final Intent returnIntent = new Intent();
				setResult(RESULT_OK, returnIntent);
				if (launch != null) {
					try {
						startActivity(launch);
					} catch (ActivityNotFoundException e) {
						new MaterialDialog.Builder(AlertDialogActivity.this)
							.content("Actvity was not found for intent: " + launch.toString())
							.positiveText(R.string.ok)
							.show();
					}
				}
				finish();
			}
		});

		builder.onNegative((dialog, which) -> finish());

		if (negative != null) {
			builder.negativeText(negative);
		}

		builder.dismissListener(dialog -> finish());

		builder.show();
	}
}


text:
package com.google.i18n.phonenumbers.metadata.init;

import com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata;
import com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadataCollection;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * Exposes single method for parsing {@link InputStream} content into {@link Collection} of {@link
 * PhoneMetadata}
 */
public final class MetadataParser {

  private static final Logger logger = Logger.getLogger(MetadataParser.class.getName());

  /**
   * Creates new instance in lenient mode, see {@link MetadataParser#parse(InputStream)} for more
   * info.
   */
  public static MetadataParser newLenientParser() {
    return new MetadataParser(false);
  }

  /**
   * Creates new instance in strict mode, see {@link MetadataParser#parse(InputStream)} for more
   * info
   */
  public static MetadataParser newStrictParser() {
    return new MetadataParser(true);
  }

  private final boolean strictMode;

  private MetadataParser(boolean strictMode) {
    this.strictMode = strictMode;
  }

  /**
   * Parses given {@link InputStream} into a {@link Collection} of {@link PhoneMetadata}.
   *
   * @throws IllegalArgumentException if {@code source} is {@code null} and strict mode is on
   * @return parsed {@link PhoneMetadata}, or empty {@link Collection} if {@code source} is {@code
   *     null} and lenient mode is on
   */
  public Collection<PhoneMetadata> parse(InputStream source) {
    if (source == null) {
      return handleNullSource();
    }
    ObjectInputStream ois = null;
    try {
      ois = new ObjectInputStream(source);
      PhoneMetadataCollection phoneMetadataCollection = new PhoneMetadataCollection();
      phoneMetadataCollection.readExternal(ois);
      List<PhoneMetadata> phoneMetadata = phoneMetadataCollection.getMetadataList();
      // Sanity check; this should not happen if provided InputStream is valid
      if (phoneMetadata.isEmpty()) {
        throw new IllegalStateException("Empty metadata");
      }
      return phoneMetadataCollection.getMetadataList();
    } catch (IOException e) {
      throw new IllegalStateException("Unable to parse metadata file", e);
    } finally {
      if (ois != null) {
        // This will close all underlying streams as well, including source.
        close(ois);
      } else {
        close(source);
      }
    }
  }

  private List<PhoneMetadata> handleNullSource() {
    if (strictMode) {
      throw new IllegalArgumentException("Source cannot be null");
    }
    return Collections.emptyList();
  }

  private void close(InputStream inputStream) {
    try {
      inputStream.close();
    } catch (IOException e) {
      logger.log(Level.WARNING, "Error closing input stream (ignored)", e);
    }
  }
}


text:
{{- $name := .Get 0 -}}
{{- $metadata := index site.Data.builtin_metadata $name }}

{{- $version := index (split $.Page.File.Path "/") 1 -}}
{{- if (eq $version "latest") -}}
{{- $version = index site.Data.releases 1 -}}
{{- end -}}

    {{- if eq $metadata.introduced $version }}
        New
    {{- end }}
    {{- if and (ne $metadata.introduced "v0.17.0") (ne $metadata.introduced "edge") }}

        {{ $metadata.introduced }}

    {{- else if eq $metadata.introduced "edge" }}
    {{ $metadata.introduced }}
    {{- end }}
    {{- if index $metadata "wasm" -}}
        Wasm
    {{- else -}}
        SDK-dependent
    {{- end -}}


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <title>Articles « kaidez</title>
  <meta name="description" content="Extensive writings from kaidez on a particular topic." />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

  <link rel="stylesheet" href="/css/styles.css" media="all" />

  <link rel="canonical" href="http://kaidez.com/articles/index.html" />
  <link rel="publisher" href="https://plus.google.com/u/0/+KaiGittens/posts"/>
  <link rel="author" href="https://plus.google.com/u/0/+KaiGittens/posts"/>
  <link rel="alternate" type="application/rss+xml" href="http://kaidez.com/feed.xml" title="kaidez.com News Feed">

    <meta content="kaidez" property="og:site_name">

  <meta content="Articles" property="og:title">

  <meta content="article" property="og:type">

  <meta content="Extensive writings from kaidez on a particular topic." property="og:description">

  <meta content="http://kaidez.com/articles/index.html" property="og:url">

  <meta content="http://kaidez.com/img/homePageDefault.jpg" property="og:image">

  <meta name="twitter:card" content="summary">
  <meta name="twitter:site" content="@kaidez">
  <meta name="twitter:title" content="Articles">
  <meta name="twitter:description" content="Extensive writings from kaidez on a particular topic.">
  <meta name="twitter:creator" content="@kaidez">

  <meta name="twitter:image:src" content="http://kaidez.com/img/homePageDefault.jpg">

  <meta name="twitter:domain" content="kaidez">

kaidez

closing tags...wrapping functions

Main Menu

          Skip to content

Here is a description of the links in the main menu

BLOG

ARTICLES

AJAX TUTORIAL

KAIDEZ ON LYNDA

      <form action="http://google.com/search" method="get">
        <fieldset role="search">
          <input type="hidden" name="q" value="site:kaidez.com"/>
          <input class="search" type="text" name="q" results="0" placeholder="Search"/>
        </fieldset>
      </form>

      Home » Articles

Category: Articles

  	"Articles" are extensive writings on a particular web development topic. Shorter writings appear on the kaidez blog.

AJAX Tutorial for Beginners

Learn how to write AJAX using both pure JavaScript as well as jQuery. Includes many code examples that can be downloaded.

kaidez courses on lynda.com

kaidez has recorded Ember.js and Backbone.js courses for lynda.com, a leading online learning company.

Other site information

ABOUT ME

              I'm a web developer for Everyday Health and have written code for Revlon, the United Nations and Trump Magazine. I try to over communicate in my tutorials so beginners can better understand the topics being discussed.

ADVERTISMENT

NAVIGATION

HOME

TUTORIALS

CODE TIPS

REVIEWS

PERSONAL

ARTICLES

CONNECT WITH ME

                 twitter

                 google+

                 github

                  youtube

                  rss

CONTACT

Your message has been sent successfully.

            <form id="contact" name="contactForm" method="post">

              *all fields are required

              <fieldset id="aside-contact-fieldset" class="aside-contact-fieldset-styles">

                  YOUR NAME
                  <input name="name" type="text" id="formNameField" class="contact-form-field" aria-required="true" required>

                  YOUR EMAIL
                  <input name="email" type="email" id="formEmailField" class="contact-form-field" aria-required="true" required>

                  YOUR MESSAGE
                  <textarea tabindex="-8" rows="10" name="text" id="formMessageField" class="contact-form-field" aria-required="true" required></textarea>

                  <button class="ladda-button" data-style="expand-right">Submit</button>

              </fieldset>

            </form>

POWERED BY:

Jekyll

Media Temple

MaxCDN

          Copyright © 2008-2015 Kai Gittens

            Affiliate Disclaimer | Colophon | Site Map

        BACK TO TOP


text:
<?php

namespace SleepingOwl\Admin\Form\Buttons;

/**
 * Class Restore.
 */
class Restore extends FormButton
{
    protected $show = true;
    protected $name = 'restore';
    protected $iconClass = 'fas fa-reply';

    public function __construct()
    {
        $this->setText(trans('sleeping_owl::lang.button.restore'));
    }

    /**
     * Init Restore Button.
     */
    public function initialize()
    {
        parent::initialize();

        $this->setHtmlAttributes($this->getHtmlAttributes() + [
            'type' => 'submit',
            'name' => 'next_action',
            'class' => 'btn btn-warning',
            'data-url' => $this->getModelConfiguration()->getRestoreUrl($this->getModel()->getKey()),
            'data-redirect' => $this->getModelConfiguration()->getEditUrl($this->getModel()->getKey()),
        ]);
    }

    /**
     * @return bool
     */
    public function canShow()
    {
        if (is_null($this->getModel()->getKey()) || ! $this->show) {
            return false;
        }

        $this->show = $this->isTrashed() &&
            $this->getModelConfiguration()->isRestorable($this->getModel());
    }
}


text:
struct Config {
  int w, h;
  unsigned flags;
  const char *png_out;
  const char *csv_out;
  const char *img_list_in;
  char repl;
};

static const char CONFIG_DEFAULT_PNG_OUT[] = "out.png";
static const char CONFIG_DEFAULT_CSV_OUT[] = "out.csv";

#define CONFIG_DEFAULT_IMG_LIST_IN ((char*)0)

enum {
  CONFIG_VERBOSE_FLAG = 1 << 0,
};

enum {
  CONFIG_DEFAULT_REPL = '_',
  CONFIG_DEFAULT_WIDTH = INT_MAX,
  CONFIG_DEFAULT_HEIGHT = INT_MAX,
  CONFIG_DEFAULT_FLAGS = 0,
  CONFIG_DEFAULT_PNG_OUT_LENGTH = sizeof CONFIG_DEFAULT_PNG_OUT - 1,
  CONFIG_DEFAULT_CSV_OUT_LENGTH = sizeof CONFIG_DEFAULT_CSV_OUT - 1
};

#define CONFIG_DEFAULT_INIT_CODE { CONFIG_DEFAULT_WIDTH, \
  CONFIG_DEFAULT_HEIGHT, CONFIG_DEFAULT_FLAGS, CONFIG_DEFAULT_PNG_OUT, \
  CONFIG_DEFAULT_CSV_OUT, CONFIG_DEFAULT_IMG_LIST_IN, CONFIG_DEFAULT_REPL}

#define CONFIG_IS_VERBOSE(cfg) (((cfg).flags & CONFIG_VERBOSE_FLAG) != 0)

#endif


text:
package org.apache.camel.component.fhir.dataformat.spring;

import ca.uhn.fhir.parser.DataFormatException;
import org.apache.camel.CamelExecutionException;
import org.apache.camel.Exchange;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
import org.hl7.fhir.r4.model.Patient;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

public class FhirXmlDataformatErrorHandlerSpringTest extends CamelSpringTestSupport {

    private static final String INPUT = "<Patient><active value=\"true\"/><active value=\"false\"/></Patient>";

    private MockEndpoint mockEndpoint;

    @Override
    @BeforeEach
    public void setUp() throws Exception {
        super.setUp();
        mockEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
    }

    @Test
    public void unmarshalParserErrorHandler() {
        try {
            template.sendBody("direct:unmarshalErrorHandlerStrict", INPUT);
            fail("Expected a DataFormatException");
        } catch (CamelExecutionException e) {
            assertTrue(e.getCause() instanceof DataFormatException);
        }
    }

    @Test
    public void unmarshalLenientErrorHandler() throws Exception {
        mockEndpoint.expectedMessageCount(1);

        template.sendBody("direct:unmarshalErrorHandlerLenient", INPUT);

        mockEndpoint.assertIsSatisfied();

        Exchange exchange = mockEndpoint.getExchanges().get(0);
        Patient patient = (Patient) exchange.getIn().getBody();
        assertTrue(patient.getActive());
    }

    @Override
    protected AbstractApplicationContext createApplicationContext() {
        return new ClassPathXmlApplicationContext(
                "org/apache/camel/dataformat/fhir/xml/FhirXmlDataFormatErrorHandlerSpringTest.xml");
    }
}


text:
#ifndef FLAC__EXPORT_H
#define FLAC__EXPORT_H

/** \file include/FLAC/export.h
 *
 *  \brief
 *  This module contains #defines and symbols for exporting function
 *  calls, and providing version information and compiled-in features.
 *
 *  See the \link flac_export export \endlink module.
 */

/** \defgroup flac_export FLAC/export.h: export symbols
 *  \ingroup flac
 *
 *  \brief
 *  This module contains #defines and symbols for exporting function
 *  calls, and providing version information and compiled-in features.
 *
 *  If you are compiling with MSVC and will link to the static library
 *  (libFLAC.lib) you should define FLAC__NO_DLL in your project to
 *  make sure the symbols are exported properly.
 *
 * \{
 */
#define FLAC__NO_DLL		// build static library

#if defined(FLAC__NO_DLL) || !defined(_MSC_VER)
#define FLAC_API

#else

#ifdef FLAC_API_EXPORTS
#define	FLAC_API	_declspec(dllexport)
#else
#define FLAC_API	_declspec(dllimport)

#endif
#endif

/** These #defines will mirror the libtool-based library version number, see
 * http://www.gnu.org/software/libtool/manual.html#Libtool-versioning
 */
#define FLAC_API_VERSION_CURRENT 10
#define FLAC_API_VERSION_REVISION 0 /**< see above */
#define FLAC_API_VERSION_AGE 2 /**< see above */

#ifdef __cplusplus
extern "C" {
#endif

/** \c 1 if the library has been compiled with support for Ogg FLAC, else \c 0. */
extern FLAC_API int FLAC_API_SUPPORTS_OGG_FLAC;

#ifdef __cplusplus
}
#endif

/* \} */

#endif


text:
export default [
  'right', 'left', 'top', 'bottom'
];


text:
var Datastore = require('nedb'),
    dbName = 'server/data.db',
    db;

if (!db) {
    db = new Datastore({
        filename: dbName,
        autoload: true
    });
    console.log('Banco ' + dbName + ' pronto para uso');
}

module.exports = db;