text:
* HLS: Fix handling of HTTP redirects.
* Audio: Minor adjustment to improve A/V sync.
* OGG: Support FLAC in OGG.
* TTML: Support regions.
* WAV/PCM: Support 8, 24 and 32-bit WAV and PCM audio.
* Misc bug fixes and performance optimizations.

### r1.5.7 ###

* OGG: Support added for OGG.
* FLAC: Support for FLAC extraction and playback (via an extension).
* HLS: Multiple audio track support (via Renditions).
* FMP4: Support multiple tracks in fragmented MP4 (not applicable to
  DASH/SmoothStreaming).
* WAV: Support for 16-bit WAV files.
* MKV: Support non-square pixel formats.
* Misc bug fixes.

### r1.5.6 ###

* MP3: Fix mono streams playing at 2x speed on some MediaTek based devices
  (#801).
* MP3: Fix playback of some streams when stream length is unknown.
* ID3: Support multiple frames of the same type in a single tag.
* EIA608: Correctly handle repeated control characters, fixing an issue in which
  captions would immediately disappear.
* AVC3: Fix decoder failures on some MediaTek devices in the case where the
  first buffer fed to the decoder does not start with SPS/PPS NAL units.
* Misc bug fixes.

### r1.5.5 ###

* DASH: Enable MP4 embedded WebVTT playback (#1185)
* HLS: Fix handling of extended ID3 tags in MPEG-TS (#1181)
* MP3: Fix incorrect position calculation in VBRI header (#1197)
* Fix issue seeking backward using SingleSampleSource (#1193)

### r1.5.4 ###

* HLS: Support for variant selection and WebVtt subtitles.
* MP4: Support for embedded WebVtt.
* Improved device compatibility.
* Fix for resource leak (Issue #1066).
* Misc bug fixes + minor features.

### r1.5.3 ###

* Support for FLV (without seeking).
* MP4: Fix for playback of media containing basic edit lists.
* QuickTime: Fix parsing of QuickTime style audio sample entry.
* HLS: Add H262 support for devices that have an H262 decoder.
* Allow AudioTrack PlaybackParams (e.g. speed/pitch) on API level 23+.
* Correctly detect 4K displays on API level 23+.
* Misc bug fixes.

### r1.5.2 ###

* MPEG-TS/HLS: Fix frame drops playing H265 video.
* SmoothStreaming: Fix parsing of ProtectionHeader.

### r1.5.1 ###

* Enable smooth frame release by default.
* Added OkHttpDataSource extension.
* AndroidTV: Correctly detect 4K display size on Bravia devices.
* FMP4: Handle non-sample data in mdat boxes.
* TTML: Fix parsing of some colors on Jellybean.
* SmoothStreaming: Ignore tfdt boxes.
* Misc bug fixes.

### r1.5.0 ###

* Multi-track support.
* DASH: Limited support for multi-period manifests.
* HLS: Smoother format adaptation.
* HLS: Support for MP3 media segments.
* TTML: Support for most embedded TTML styling.
* WebVTT: Enhanced positioning support.
* Initial playback tests.
* Misc bug fixes.

### r1.4.2 ###

* Implemented automatic format detection for regular container formats.
* Added UdpDataSource for connecting to multicast streams.
* Improved robustness for MP4 playbacks.
* Misc bug fixes.

### r1.4.1 ###

* HLS: Fix premature playback failures that could occur in some cases.

### r1.4.0 ###

* Support for extracting Matroska streams (implemented by WebmExtractor).
* Support for tx3g captions in MP4 streams.
* Support for H.265 in MPEG-TS streams on supported devices.
* HLS: Added support for MPEG audio (e.g. MP3) in TS media segments.
* HLS: Improved robustness against missing chunks and variants.
* MP4: Added support for embedded MPEG audio (e.g. MP3).
* TTML: Improved handling of whitespace.
* DASH: Support Mpd.Location element.
* Add option to TsExtractor to allow non-IDR keyframes.
* Added MulticastDataSource for connecting to multicast streams.
* (WorkInProgress) - First steps to supporting seeking in DASH DVR window.
* (WorkInProgress) - First steps to supporting styled + positioned subtitles.
* Misc bug fixes.

### r1.3.3 ###

* HLS: Fix failure when playing HLS AAC streams.
* Misc bug fixes.

### r1.3.2 ###

* DataSource improvements: `DefaultUriDataSource` now handles http://, https://,
  file://, asset:// and content:// URIs automatically. It also handles
  file:///android_asset/* URIs, and file paths like /path/to/media.mp4 where the
  scheme is omitted.
* HLS: Fix for some ID3 events being dropped.
* HLS: Correctly handle 0x0 and floating point RESOLUTION tags.
* Mp3Extractor: robustness improvements.

### r1.3.1 ###

* No notes provided.


text:
class Coccinellida < Cask
  version '0.6.1'
  sha256 'bd590bf54667b85b4c14dae95d727bfa44cc893a75f231490b48a4a65049d8df'

  url 'https://downloads.sourceforge.net/project/coccinellida/Coccinellida-0.6.1.zip'
  appcast 'http://coccinellida.sourceforge.net/sparkle.xml'
  homepage 'http://coccinellida.sourceforge.net/'

  link 'Coccinellida.app'
end

redpajama_set_name: RedPajamaGithub


text:
using Microsoft.Xna.Framework.Graphics;

namespace Nez
{
	public class ScanlinesEffect : Effect
	{
		[Range(0.001f, 1f, 0.001f)]
		public float Attenuation
		{
			get => _attenuation;
			set
			{
				if (_attenuation != value)
				{
					_attenuation = value;
					_attenuationParam.SetValue(_attenuation);
				}
			}
		}

		[Range(10, 1000, 1)]
		public float LinesFactor
		{
			get => _linesFactor;
			set
			{
				if (_linesFactor != value)
				{
					_linesFactor = value;
					_linesFactorParam.SetValue(_linesFactor);
				}
			}
		}

		float _attenuation = 0.04f;
		float _linesFactor = 800f;

		EffectParameter _attenuationParam;
		EffectParameter _linesFactorParam;

		public ScanlinesEffect() : base(Core.GraphicsDevice, EffectResource.ScanlinesBytes)
		{
			_attenuationParam = Parameters["_attenuation"];
			_linesFactorParam = Parameters["_linesFactor"];

			_attenuationParam.SetValue(_attenuation);
			_linesFactorParam.SetValue(_linesFactor);
		}
	}
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Observ. mycol. (Lipsiae) 1: 43 (1796)

#### Original name
Peziza cerina f. cerina

### Remarks
null


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Usnea 1: 20, 33 (1936)

#### Original name
null

### Remarks
null


text:
import { CommandLine } from '..';

const splitIntoArgsAndSearchData: {
	title: string;
	line: string;
	index?: number;
	args: string[];
	search: string;
	singleQuoted: boolean;
	doubleQuoted: boolean;
}[] = [
	{
		title: 'an empty string',
		line: '',
		args: [],
		search: '',
		singleQuoted: false,
		doubleQuoted: false,
	},
	{
		title: 'a normal line with index at the end',
		line: 'foo bar',
		args: ['foo'],
		search: 'bar',
		singleQuoted: false,
		doubleQuoted: false,
	},
	{
		title: 'a normal line with index in the middle ending in a char',
		line: 'foo bar',
		index: 3,
		args: [],
		search: 'foo',
		singleQuoted: false,
		doubleQuoted: false,
	},
	{
		title: 'a normal line with index in the middle ending in a space',
		line: 'foo bar',
		index: 4,
		args: ['foo'],
		search: '',
		singleQuoted: false,
		doubleQuoted: false,
	},
];

describe(`${CommandLine.name}#split returns the expected result`, () => {
	splitIntoArgsAndSearchData.forEach(
		({ title, line, index, args, search, singleQuoted, doubleQuoted }) => {
			it(title, () => {
				const commandLine = new CommandLine(line, index);
				expect(commandLine.splitIntoArgsAndSearch()).toEqual({
					args,
					search,
					singleQuoted,
					doubleQuoted,
				});
			});
		},
	);
});


text:
def extractWuxiaFantasies(item):
	"""
	Parser for 'Wuxia Fantasies'
	"""
	vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
	if not (chp or vol) or 'preview' in item['title'].lower():
		return None
	if 'WATTT' in item['tags']:
		return buildReleaseMessageWithType(item, 'WATTT', vol, chp, frag=frag, postfix=postfix)
	return False


text:
from redbot.message import headers
from redbot.syntax import rfc7231

class content_language(headers.HttpHeader):
    canonical_name = "Content-Language"
    description = """\
The `Content-Language` header describes the natural language(s) of the intended audience. Note that
this might not convey all of the languages used within the content."""
    reference = f"{rfc7231.SPEC_URL}#header.content_language"
    syntax = rfc7231.Content_Language
    list_header = False
    deprecated = False
    valid_in_requests = True
    valid_in_responses = True

class ContentLanguageTest(headers.HeaderTest):
    name = "Content-Language"
    inputs = [b"en-US"]
    expected_out = "en-US"


text:
module Booty
  class HtmlResponse
    attr_reader :template, :model, :status

    def initialize(template: '', model: nil, status: 200)
      @template = template
      @model = model
      @status = status
    end

    def run(view_engine)
      html = render_html_using(view_engine)
      [@status, {"Content-Type" => "text/html"}, [html]]
    end

    private

    def render_html_using(view_engine)
      return view_engine.render(:template => @template, :model => @model) if @model
      view_engine.render(:template => @template)
    end
  end
end


text:
define(['Angular', 'bbtkApp'],function(angular) {
    'use strict';
    angular.module('bbToolkit.directives').directive('onEnterKeyup', ['$parse',
        '$log',
        function($parse,$log) {
        return function(scope, elm, attrs) {

            var expression = attrs.onEnterKeyup;
            var fn = $parse(expression);
            $log.info(expression);
            elm.bind("keyup", function(event) {
                if (event.keyCode === 13 ){
                    scope.$apply(function() {
                        fn(scope, {$event:event});
                    });
                }
            });
        };
    }]);
});


text:
/**
 @module ember
 @submodule ember-glimmer
*/

/**
  A Glimmer2 AST transformation that replaces all instances of

  ```handlebars
 <button {{action 'foo'}}>
 <button onblur={{action 'foo'}}>
 <button onblur={{action (action 'foo') 'bar'}}>
  ```

  with

  ```handlebars
 <button {{action this 'foo'}}>
 <button onblur={{action this 'foo'}}>
 <button onblur={{action this (action this 'foo') 'bar'}}>
  ```

  @private
  @class TransformActionSyntax
*/

export default function TransformActionSyntax() {
  // set later within Glimmer2 to the syntax package
  this.syntax = null;
}

/**
  @private
  @method transform
  @param {AST} ast The AST to be transformed.
*/
TransformActionSyntax.prototype.transform = function TransformActionSyntax_transform(ast) {
  let { traverse, builders: b } = this.syntax;

  traverse(ast, {
    ElementModifierStatement(node) {
      if (isAction(node)) {
        insertThisAsFirstParam(node, b);
      }
    },
    MustacheStatement(node) {
      if (isAction(node)) {
        insertThisAsFirstParam(node, b);
      }
    },
    SubExpression(node) {
      if (isAction(node)) {
        insertThisAsFirstParam(node, b);
      }
    }
  });

  return ast;
};

function isAction(node) {
  return node.path.original === 'action';
}

function insertThisAsFirstParam(node, builders) {
  node.params.unshift(builders.path(''));
}


text:
package com.dsinpractice.samples.hadoop.mapred.logparsing;

import com.dsinpractice.samples.hadoop.domain.HttpRequest;
import com.dsinpractice.samples.hadoop.domain.LogEntry;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class LogParsingMapper extends Mapper<Object, Text, HttpRequest, LogEntry> {
    @Override
    protected void map(Object key, Text value, Context context) throws IOException, InterruptedException {
        String logLine = value.toString();
        String[] fields = logLine.split(" ");
        String httpMethod = fields[6];
        String url = fields[7];
        HttpRequest httpRequest = new HttpRequest(httpMethod, url);
        String date = fields[0].substring(1);
        String time = fields[1];
        context.write(httpRequest, new LogEntry(date, time, httpRequest));
    }
}


text:
.class public interface abstract Ljava/util/Iterator;
.super Ljava/lang/Object;
.source "Iterator.java"

# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<E:",
        "Ljava/lang/Object;",
        ">",
        "Ljava/lang/Object;"
    }
.end annotation

# virtual methods
.method public abstract hasNext()Z
.end method

.method public abstract next()Ljava/lang/Object;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()TE;"
        }
    .end annotation
.end method

.method public abstract remove()V
.end method


text:
package com.musicocracy.fpgk.mvp.presenter;

import com.musicocracy.fpgk.domain.dal.SongFilter;
import com.musicocracy.fpgk.mvp.model.BlacklistModel;
import com.musicocracy.fpgk.mvp.view.BlacklistView;

import java.util.List;

public class BlacklistPresenter implements Presenter<BlacklistView> {
    private final BlacklistModel model;
    private BlacklistView view;

    public BlacklistPresenter(BlacklistModel model) {
        this.model = model;
    }

    @Override
    public void setView(BlacklistView view) {
        this.view = view;
    }

    public List<SongFilter> getAllBlacklistedSongFilters() {
        return model.getAllBlacklistedSongFilters();
    }

    public List<String> getAllBlacklistedSongIds() {
        return model.getAllBlacklistedSongIds();
    }

}


text:
package com.zandero.utils;

import org.junit.jupiter.api.*;

import java.time.*;
import java.util.*;

import static com.zandero.utils.junit.AssertFinalClass.*;
import static org.junit.jupiter.api.Assertions.*;

/**
 *
 */
class SetUtilsTest {

    @Test
    void isWellDefinedTest() {

        isWellDefined(SetUtils.class);
    }

    @Test
    void splitSet() {

        Set<String> storage = new HashSet<>();
        storage.add("m2_1");
        storage.add("m1_2");
        storage.add("m1_3");

        List<Set<String>> list = SetUtils.split(storage, 1);
        assertEquals(3, list.size());

        List<String> keys = new ArrayList<>();
        for (Set<String> mapItem : list) {
            assertEquals(1, mapItem.size());

            keys.addAll(mapItem);
        }

        assertEquals(3, keys.size());
        assertTrue(keys.contains("m2_1"));
        assertTrue(keys.contains("m1_2"));
        assertTrue(keys.contains("m1_3"));
    }

    @Test
    void splitHugeSet() {

        System.out.println("Preparing data ... ");

        Set<String> storage = new HashSet<>();
        for (int i = 0; i < 5_140_000; i++) {
            storage.add("" + i);
        }

        Instant start = Instant.now();

        System.out.println("Starting split ... ");

        // split into 100k chunks
        List<Set<String>> list = SetUtils.split(storage, 500_000);

        Duration duration = Duration.between(start, Instant.now());

        System.out.println("Duration of split: " + duration.toMillis() + "ms");

        assertEquals(11, list.size());

        for (int i = 0; i < list.size(); i++) {
            if (i < list.size() - 1) {
                assertEquals(500_000, list.get(i).size());
            } else { // last chunk should have only 40_000 enties
                assertEquals(140_000, list.get(i).size());
            }
        }
    }

    @Test
    void arrayToSet() {

        Set<String> stringSet = SetUtils.from("a", "b", "c");
        assertEquals(3, stringSet.size());
        assertTrue(stringSet.contains("a"));
        assertTrue(stringSet.contains("b"));
        assertTrue(stringSet.contains("c"));

        Set<Integer> integerSet = SetUtils.from(1, 1, 2);
        assertEquals(2, integerSet.size());
        assertTrue(integerSet.contains(1));
        assertTrue(integerSet.contains(2));
    }
}


text:
package org.apache.drill.exec.physical.impl.filter;

import javax.inject.Named;

import org.apache.drill.exec.exception.SchemaChangeException;
import org.apache.drill.exec.exception.OutOfMemoryException;
import org.apache.drill.exec.ops.FragmentContext;
import org.apache.drill.exec.record.BatchSchema.SelectionVectorMode;
import org.apache.drill.exec.record.RecordBatch;
import org.apache.drill.exec.record.TransferPair;
import org.apache.drill.exec.record.selection.SelectionVector2;

public abstract class FilterTemplate2 implements Filterer{
  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FilterTemplate2.class);

  private SelectionVector2 outgoingSelectionVector;
  private SelectionVector2 incomingSelectionVector;
  private SelectionVectorMode svMode;
  private TransferPair[] transfers;

  @Override
  public void setup(FragmentContext context, RecordBatch incoming, RecordBatch outgoing, TransferPair[] transfers) throws SchemaChangeException{
    this.transfers = transfers;
    this.outgoingSelectionVector = outgoing.getSelectionVector2();
    this.svMode = incoming.getSchema().getSelectionVectorMode();

    switch(svMode){
    case NONE:
      break;
    case TWO_BYTE:
      this.incomingSelectionVector = incoming.getSelectionVector2();
      break;
    default:
      // SV4 is handled in FilterTemplate4
      throw new UnsupportedOperationException();
    }
    doSetup(context, incoming, outgoing);
  }

  private void doTransfers(){
    for(TransferPair t : transfers){
      t.transfer();
    }
  }

  public void filterBatch(int recordCount){
    if (recordCount == 0) {
      return;
    }
    if (! outgoingSelectionVector.allocateNewSafe(recordCount)) {
      throw new OutOfMemoryException("Unable to allocate filter batch");
    }
    switch(svMode){
    case NONE:
      filterBatchNoSV(recordCount);
      break;
    case TWO_BYTE:
      filterBatchSV2(recordCount);
      break;
    default:
      throw new UnsupportedOperationException();
    }
    doTransfers();
  }

  private void filterBatchSV2(int recordCount){
    int svIndex = 0;
    final int count = recordCount;
    for(int i = 0; i < count; i++){
      char index = incomingSelectionVector.getIndex(i);
      if(doEval(index, 0)){
        outgoingSelectionVector.setIndex(svIndex, index);
        svIndex++;
      }
    }
    outgoingSelectionVector.setRecordCount(svIndex);
  }

  private void filterBatchNoSV(int recordCount){
    int svIndex = 0;
    for(int i = 0; i < recordCount; i++){
      if(doEval(i, 0)){
        outgoingSelectionVector.setIndex(svIndex, (char)i);
        svIndex++;
      }
    }
    outgoingSelectionVector.setRecordCount(svIndex);
  }

  public abstract void doSetup(@Named("context") FragmentContext context, @Named("incoming") RecordBatch incoming, @Named("outgoing") RecordBatch outgoing);
  public abstract boolean doEval(@Named("inIndex") int inIndex, @Named("outIndex") int outIndex);

}


text:
// This file implements the ranges concept similar to the one available in
// C++20.

#ifndef TFRT_SUPPORT_RANGES_H_
#define TFRT_SUPPORT_RANGES_H_

#include <cassert>
#include <cstddef>
#include <iterator>

#include "llvm/ADT/STLExtras.h"

namespace tfrt {
namespace views {

// A simple implementation for std::views::counted in C++ 20.
//
// Usage example:
//
// int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
// for(int i : views::Counted(a, 3))
//   std::cout << i << ' ';
//
// const auto il = {1, 2, 3, 4, 5};
// for (int i : views::Counted(il.begin() + 1, 3))
//   std::cout << i << ' ';
template <typename IteratorT>
class CountedView {
 public:
  using value_type = typename std::iterator_traits<IteratorT>::value_type;

  CountedView(IteratorT it, size_t count) : it_{it}, count_{count} {}

  IteratorT begin() const { return it_; }
  IteratorT end() const { return it_ + count_; }
  size_t size() const { return count_; }

  decltype(auto) operator[](size_t index) const {
    assert(index < count_);
    return *(it_ + index);
  }

 private:
  IteratorT it_;
  size_t count_;
};

template <typename IteratorT>
CountedView<IteratorT> Counted(IteratorT it, size_t count) {
  return CountedView<IteratorT>(it, count);
}

}  // namespace views

// Base class to implement range that is based on indexing into a BaseT.
// See `llvm::detail::indexed_accessor_range_base` for details.
template <typename DerivedT, typename BaseT, typename T,
          typename PointerT = T *, typename ReferenceT = T &>
using IndexedAccessorRangeBase =
    llvm::detail::indexed_accessor_range_base<DerivedT, BaseT, T, PointerT,
                                              ReferenceT>;

}  // namespace tfrt

#endif  // TFRT_SUPPORT_RANGES_H_


text:
package com.mapswithme.maps.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.annotation.StyleRes;
import android.support.v4.app.DialogFragment;

import com.mapswithme.maps.R;
import com.mapswithme.util.ThemeUtils;

public class BaseMwmDialogFragment extends DialogFragment
{
  protected final @StyleRes int getFullscreenTheme()
  {
    return (ThemeUtils.isNightTheme() ? R.style.MwmTheme_DialogFragment_Fullscreen_Night
                                      : R.style.MwmTheme_DialogFragment_Fullscreen);
  }

  protected int getStyle()
  {
    return STYLE_NORMAL;
  }

  protected @StyleRes int getCustomTheme()
  {
    return 0;
  }

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

    int style = getStyle();
    int theme = getCustomTheme();
    if (style != STYLE_NORMAL || theme != 0)
      //noinspection WrongConstant
      setStyle(style, theme);
  }

  @Override
  public void onResume()
  {
    super.onResume();
    org.alohalytics.Statistics.logEvent("$onResume", getClass().getSimpleName()
        + ":" + com.mapswithme.util.UiUtils.deviceOrientationAsString(getActivity()));
  }

  @Override
  public void onPause()
  {
    super.onPause();
    org.alohalytics.Statistics.logEvent("$onPause", getClass().getSimpleName());
  }
}


text:
controller = {
    def: 'list',
    actions: {
        list: function() {
        	var win = Ti.UI.createWindow({ });
        	win.AirView(AirModel('fruitList'));
            return win;
        },
        other:function(param){
        	param = param||'default string';
        	return AirView({param:param});
        }
    }
};


text:
/* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */
#pragma once
#include <vector>
#include <map>
#include <sstream>
#include <string>
#include "ifcpp/model/GlobalDefines.h"
#include "ifcpp/model/BasicTypes.h"
#include "ifcpp/model/BuildingObject.h"
#include "IfcClassificationReferenceSelect.h"
#include "IfcClassificationSelect.h"
#include "IfcExternalInformation.h"
namespace IFC4X3
{
	class IFCQUERY_EXPORT IfcLabel;
	class IFCQUERY_EXPORT IfcDate;
	class IFCQUERY_EXPORT IfcText;
	class IFCQUERY_EXPORT IfcURIReference;
	class IFCQUERY_EXPORT IfcIdentifier;
	class IFCQUERY_EXPORT IfcRelAssociatesClassification;
	class IFCQUERY_EXPORT IfcClassificationReference;
	//ENTITY
	class IFCQUERY_EXPORT IfcClassification : virtual public IfcClassificationReferenceSelect, virtual public IfcClassificationSelect, public IfcExternalInformation
	{
	public:
		IfcClassification() = default;
		IfcClassification( int id );
		virtual shared_ptr<BuildingObject> getDeepCopy( BuildingCopyOptions& options );
		virtual void getStepLine( std::stringstream& stream ) const;
		virtual void getStepParameter( std::stringstream& stream, bool is_select_type = false ) const;
		virtual void readStepArguments( const std::vector<std::string>& args, const std::map<int,shared_ptr<BuildingEntity> >& map, std::stringstream& errorStream );
		virtual void setInverseCounterparts( shared_ptr<BuildingEntity> ptr_self );
		virtual uint8_t getNumAttributes() const { return 7; }
		virtual void getAttributes( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const;
		virtual void getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const;
		virtual void unlinkFromInverseCounterparts();
		virtual uint32_t classID() const { return 747523909; }

		// IfcExternalInformation -----------------------------------------------------------

		// IfcClassification -----------------------------------------------------------
		// attributes:
		shared_ptr<IfcLabel>									m_Source;					//optional
		shared_ptr<IfcLabel>									m_Edition;					//optional
		shared_ptr<IfcDate>										m_EditionDate;				//optional
		shared_ptr<IfcLabel>									m_Name;
		shared_ptr<IfcText>										m_Description;				//optional
		shared_ptr<IfcURIReference>								m_Specification;			//optional
		std::vector<shared_ptr<IfcIdentifier> >					m_ReferenceTokens;			//optional
		// inverse attributes:
		std::vector<weak_ptr<IfcRelAssociatesClassification> >	m_ClassificationForObjects_inverse;
		std::vector<weak_ptr<IfcClassificationReference> >		m_HasReferences_inverse;
	};
}


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <title>Mazel - Multiprapose Html template</title>
    <meta name="description" content="" />
    <meta name="keywords" content="" />
    <meta name="author" content="nileforest">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

    <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
    <link rel="icon" type="image/png" href="img/favicon.png">
    <link rel="apple-touch-icon" href="img/favicon.png">

    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <link href="css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="css/font-awesome.css" rel="stylesheet" type="text/css" />
    <link href="css/ionicons.css" rel="stylesheet" type="text/css" />
    <link href="css/plugin/sidebar-menu.css" rel="stylesheet" type="text/css" />
    <link href="css/plugin/animate.css" rel="stylesheet" type="text/css" />
    <link href="css/jquery-ui.css" rel="stylesheet" type="text/css" />

Main Demo Page

Home Default

Portfolio

Login & Signup

FAQ

About

Service

Blog

404 Error

Shopping Cart

Contact Us

                            Home

                            About

                            Service

                            Work

                            Client

                            Contact

Hello, I am John Doe

Designer from Berlin, Germany

View Portfolio

About Story

                More About

Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur?

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quas.

                        Resume

2013-2014

Work In Company

Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus.

2012-2013

Work In Company

Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus.

2011-2012

Work In Company

Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus.

2010-2011

Work In Company

Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus.

Web design

55%

development

80%

Photography

40%

branding

70%

Web Design

Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem.

Development

Donec sodales sagittis magna. hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus, augue velit cursus nunc.

Branding

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque.

Our Work

All

Branding

Design

Photo

coffee

Consequat massa quis

Branding, Design, Coffee

Vivamus elementum semper

Photo

Quisque rutrum

Branding, Design, Coffee

Tellus eget condimentum

Design

Nullam quis ant

Branding, Design

Sed fringilla mauris

Photo

0

awards

0

Clients

0

Team

0

Project

" I got a dummy for Christmas and started teaching myself. I got books and records and sat in front of the practising. I did my first show in the third grade and just kept going. "

Jeff Dunham ( Appel Studio )

" It's true, you can never eat a pet you name. And anyway, I did my first show in the third grade it would be like a ventriloquist eating his dummy. "

Alexander Theroux ( USA )

" We're not leaving here without Buster, man. Leave no crash-test dummy behind! "

Adam Savage ( Artist )

Get Connect With Us

Twitter

Facebook

Google plus

Linkedin

Get In Touch

                        <form class="contact-form" id="contact" role="form">

                                Your message has been sent successfully.

                                There was a problem validating the form please check!

                                <input class="input-sm form-full" id="form-name" type="text" name="form-name" placeholder="Your Name" required>

                                <input class="input-sm form-full" id="form-email" type="email" name="form-email" placeholder="Email" required>

                                <input class="input-sm form-full" id="form-subject" type="text" name="form-subject" placeholder="Subject">

                                <textarea class="form-full" id="form-message" rows="7" name="form-message" placeholder="Your Message" required></textarea>

                            <button class="btn btn-md btn-black form-full" type="submit" id="form-submit" name="submit">Send Message</button>
                        </form>

Address

                                502, DieSachbearbeiter, Schönhauser Allee, 167c10435 Berlin,Germany.

Call Us

                                +40 (0) 012 345 6789

Email

                                yourname@domain.com

                        © 2015 Mazel Template. All Rights Reserved.

                        Template  by nileforest


text:
$:.unshift 'lib', '../lib'
require 'rlyeh'

class BasicServer < Rlyeh::Base
  use Rlyeh::DeepOnes::Logger
  use Rlyeh::DeepOnes::Auth::Basic, 'dankogai', 'kogaidan'
  use Rlyeh::DeepOnes::CTCP::Parser
  use Rlyeh::DeepOnes::Channels

  set :server_name, 'basic-server'
  set :server_version, '1.0.0'
  #set :store, :memory

  on :privmsg do |env|
    puts "RECV: #{env.message}"
  end
end

Rlyeh.emerge BasicServer, :host => '0.0.0.0'


text:
Edit Refinancement

        <form class="form-horizontal" data-ng-submit="update()" novalidate>
            <fieldset>

                      BU

                            <input type="text" data-ng-model="refinancement.bu" id="bu" class="form-control" placeholder="bu" required >
                            <input type="radio" ng-model="refinancement.bu" value= "EVL" />Evoliance
                            <input type="radio" ng-model="refinancement.bu" value= "UBS" />Ubique systemes
                            <input type="radio" ng-model="refinancement.bu" value= "HBO" />Hub One

                       Nom

                            <input type="text" data-ng-model="refinancement.name" id="name" class="form-control" placeholder="Nom">

                    Type d'actif finance

                        <input type="text" data-ng-model="refinancement.typeactif" id="typeactif" class="form-control" placeholder="typeactif" required>
                        <input type="radio" ng-model="refinancement.typeactif" value="technologique" />technologique (info/reseau/telephonie)
                        <input type="radio" ng-model="refinancement.typeactif" value="industrie" />industriel
                        <input type="radio" ng-model="refinancement.typeactif" value="medical" />medical
                        <input type="radio" ng-model="refinancement.typeactif" value="immateriel" />Immateriel

                    drfnum

                        <input type="number" data-ng-model="refinancement.drfnum" id="drfnum" class="form-control" placeholder="Numero drf" required>

                    ctrtnum

                        <input type="number" data-ng-model="refinancement.ctrtnum" id="ctrtnum" class="form-control" placeholder="Numero contrat" required>

                    <select ng-model="refinancement.ctrtnum" ng-options="refinancement.ctrtnum as contrat.ctrtnum for contrat in Contrats | orderBy:'ctrtdsignature'">
                    <option value="">Sélectionnez un contrat</option>
                   </select>

                    econum

                        <input type="number" data-ng-model="refinancement.econum" id="econum" class="form-control" placeholder="Numero fieco" required>

                    <select ng-model="refinancement.econum" ng-options="refinancement.econum as contrat.econum for contrat in Contrats | orderBy:'ctrtdsignature'">
                    <option value="">Sélectionnez une fieco</option>
                    </select>

                   locataire

                        <input type="text" data-ng-model="refinancement.locataire" id="name" class="form-control" placeholder="locataire" required>

                    refinanceur

                        <input type="text" data-ng-model="refinancement.refinanceur" id="name" class="form-control" placeholder="refinanceur" required>
                        <input type="radio" ng-model="refinancement.refinanceur" value="Siemens" />Siemens
                        <input type="radio" ng-model="refinancement.refinanceur" value="GE Cap" />GE cap
                        <input type="radio" ng-model="refinancement.refinanceur" value="Leascom" />Leascom
                        <input type="radio" ng-model="refinancement.refinanceur" value="LorEquip" />LorEquip

                    consultant

                        <input type="text" data-ng-model="refinancement.consultant" id="name" class="form-control" placeholder="consultant" required >
                        <input type="radio" ng-model="refinancement.consultant" value= "pake" />Pake
                        <input type="radio" ng-model="refinancement.consultant" value= "mali" />Mali
                        <input type="radio" ng-model="refinancement.consultant" value= "chde" />Chde

                    partenaire

                        <input type="text" data-ng-model="refinancement.partenaire" id="partenaire" class="form-control" placeholder="partenaire" required>

                    duree

                        <input type="number" data-ng-model="refinancement.duree" id="duree" class="form-control" placeholder="duree" required>
                        <input type="radio" ng-model="refinancement.duree" value= 24 />24
                        <input type="radio" ng-model="refinancement.duree" value= 30 />30
                        <input type="radio" ng-model="refinancement.duree" value= 36 />36
                        <input type="radio" ng-model="refinancement.duree" value= 42 />42
                        <input type="radio" ng-model="refinancement.duree" value= 48 />48
                        <input type="radio" ng-model="refinancement.duree" value= 60 />60
                        <input type="radio" ng-model="refinancement.duree" value= 72 />72

                    periodicite

                        <input type="text" data-ng-model="refinancement.periodicite" id="periodicite" class="form-control" placeholder="periodicite" required>
                        <input type="radio" ng-model="refinancement.periodicite" value= "mens" />Mensuel
                        <input type="radio" ng-model="refinancement.periodicite" value= "tri" />Trimestriel

                    nbperiode

                        <input type="number" data-ng-model="refinancement.nbperiode" id="nbperiode" class="form-control" placeholder="nbperiode" required>

                    loyer

                        <input type="number" data-ng-model="refinancement.loyer" id="loyer" class="form-control" placeholder="loyer" required>

                     mntafindrf

                        <input type="number" data-ng-model="refinancement.drfmntafin" id="mntafin" class="form-control" placeholder="montant a financer" required>

                     drfmtcession

                        <input type="number" data-ng-model="refinancement.drfmtcession" id="drfmtcession" class="form-control" placeholder="mt cession refi" required>

                     coefrefi

                        <input type="number" data-ng-model="refinancement.drfcoef" id="drfcoef" class="form-control" placeholder="coeficient refi" required>

                     drfaccord

                        <input type="text" data-ng-model="refinancement.drfaccord" id="drfaccord" class="form-control" placeholder="accord refi" >

                        <input type="radio" ng-model="refinancement.drfaccord" value= "non envoyée" />non envoyée
                        <input type="radio" ng-model="refinancement.drfaccord" value= "envoyée" />envoyée
                        <input type="radio" ng-model="refinancement.drfaccord" value= "demande pieces" />demande de pieces
                        <input type="radio" ng-model="refinancement.drfaccord" value= "attente" />completée refi
                        <input type="radio" ng-model="refinancement.drfaccord" value= "accord" />accord complet
                        <input type="radio" ng-model="refinancement.drfaccord" value= "attente" />accord partiel
                        <input type="radio" ng-model="refinancement.drfaccord" value= "accord partiel" />accord garanties
                        <input type="radio" ng-model="refinancement.drfaccord" value= "refus RSK" />refus risque
                        <input type="radio" ng-model="refinancement.drfaccord" value= "refus EC" />refus encours
                        <input type="radio" ng-model="refinancement.drfaccord" value= "refus" />refus

                     datedemandedrf

                        <input type="date" data-ng-model="refinancement.drfdatedemande" id="drfdatedemande" class="form-control" placeholder="date demande refi" >

                     dateaccorddrf

                        <input type="date" data-ng-model="refinancement.drfdateaccord" id="drfdateaccord" class="form-control" placeholder="date accord refi" >

                    <input type="submit" value="Update" class="btn btn-default">

            </fieldset>
        </form>


text:
package com.myopicmobile.textwarrior.common;

import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
import java.util.Vector;
import java.util.Iterator;
import java.util.Collections;

//TODO Have all methods work with charOffsets and move all gap handling to logicalToRealIndex()
public class TextBuffer implements java.lang.CharSequence {

	@Override
	public int length() {
		// TODO: Implement this method
		return getTextLength();
	}

	// gap size must be > 0 to insert into full buffers successfully
	protected final static int MIN_GAP_SIZE = 50;
	protected char[] _contents;
	protected int _gapStartIndex;
	/** One past end of gap */
	protected int _gapEndIndex;
	protected int _lineCount;
	/** The number of times memory is allocated for the buffer */
	private int _allocMultiplier;
	private TextBufferCache _cache;
	private UndoStack _undoStack;

	/** Continuous seq of chars that have the same format (color, font, etc.) */
	protected List<Pair<ColorScheme.Colorable>> _spans;
	public char[] toCharArray() {
		return toString().toCharArray();
	}

	public TextBuffer() {
		_contents = new char[MIN_GAP_SIZE + 1]; // extra char for EOF
		_contents[MIN_GAP_SIZE] = Language.EOF;
		_allocMultiplier = 1;
		_gapStartIndex = 0;
		_gapEndIndex = MIN_GAP_SIZE;
		_lineCount = 1;
		_cache = new TextBufferCache();
		_undoStack = new UndoStack(this);
	}

	/**
	 * Calculate the implementation size of the char array needed to store
	 * textSize number of characters.
	 * The implementation size may be greater than textSize because of buffer
	 * space, cached characters and so on.
	 *
	 * @param textSize
	 * @return The size, measured in number of chars, required by the
	 * 		implementation to store textSize characters, or -1 if the request
	 * 		cannot be satisfied
	 */
	public static int memoryNeeded(int textSize) {
		long bufferSize = textSize + MIN_GAP_SIZE + 1; // extra char for EOF
		if (bufferSize < Integer.MAX_VALUE) {
			return (int) bufferSize;
		}
		return -1;
	}

	synchronized public void setBuffer(char[] newBuffer, int textSize, int lineCount) {
		_contents = newBuffer;
		initGap(textSize);
		_lineCount = lineCount;
		_allocMultiplier = 1;
	}

	synchronized public void setBuffer(char[] newBuffer) {
		int lineCount=1;
		int len=newBuffer.length;
		for (int i=0;i < len;i++) {
			if (newBuffer[i] == '\n')
				lineCount++;
		}
		setBuffer(newBuffer, len, lineCount);
	}

	/**
	 * Returns a string of text corresponding to the line with index lineNumber.
	 *
	 * @param lineNumber The index of the line of interest
	 * @return The text on lineNumber, or an empty string if the line does not exist
	 */
	synchronized public String getLine(int lineNumber) {
		int startIndex = getLineOffset(lineNumber);

		if (startIndex < 0) {
			return new String();
		}
		int lineSize = getLineSize(lineNumber);

		return subSequence(startIndex, lineSize).toString();
	}

	/**
	 * Get the offset of the first character of the line with index lineNumber.
	 * The offset is counted from the beginning of the text.
	 *
	 * @param lineNumber The index of the line of interest
	 * @return The character offset of lineNumber, or -1 if the line does not exist
	 */
	synchronized public int getLineOffset(int lineNumber) {
		if (lineNumber < 0) {
			return -1;
		}

		// start search from nearest known lineIndex~charOffset pair
		Pair<Integer> cachedEntry = _cache.getNearestLine(lineNumber);
		int cachedLine = cachedEntry.getFirst();
		int cachedOffset = cachedEntry.getSecond();

		int offset;
		if (lineNumber > cachedLine) {
			offset = findCharOffset(lineNumber, cachedLine, cachedOffset);
		} else if (lineNumber < cachedLine) {
			offset = findCharOffsetBackward(lineNumber, cachedLine, cachedOffset);
		} else {
			offset = cachedOffset;
		}

		if (offset >= 0) {
			// seek successful
			_cache.updateEntry(lineNumber, offset);
		}

		return offset;
	}

	/*
	 * Precondition: startOffset is the offset of startLine
	 */
	private int findCharOffset(int targetLine, int startLine, int startOffset) {
		int workingLine = startLine;
		int offset = logicalToRealIndex(startOffset);

		TextWarriorException.assertVerbose(isValid(startOffset),
										   "findCharOffsetBackward: Invalid startingOffset given");

		while ((workingLine < targetLine) && (offset < _contents.length)) {
			if (_contents[offset] == Language.NEWLINE) {
				++workingLine;
			}
			++offset;

			// skip the gap
			if (offset == _gapStartIndex) {
				offset = _gapEndIndex;
			}
		}

		if (workingLine != targetLine) {
			return -1;
		}
		return realToLogicalIndex(offset);
	}

	/*
	 * Precondition: startOffset is the offset of startLine
	 */
	private int findCharOffsetBackward(int targetLine, int startLine, int startOffset) {
		if (targetLine == 0) {
			return 0;
		}

		TextWarriorException.assertVerbose(isValid(startOffset),
										   "findCharOffsetBackward: Invalid startOffset given");

		int workingLine = startLine;
		int offset = logicalToRealIndex(startOffset);
		while (workingLine > (targetLine - 1) && offset >= 0) {
			// skip behind the gap
			if (offset == _gapEndIndex) {
				offset = _gapStartIndex;
			}
			--offset;

			if (_contents[offset] == Language.NEWLINE) {
				--workingLine;
			}

		}

		int charOffset;
		if (offset >= 0) {
			// now at the '\n' of the line before targetLine
			charOffset = realToLogicalIndex(offset);
			++charOffset;
		} else {
			TextWarriorException.assertVerbose(false,
											   "findCharOffsetBackward: Invalid cache entry or line arguments");
			charOffset = -1;
		}

		return charOffset;
	}

	/**
	 * Get the line number that charOffset is on
	 *
	 * @return The line number that charOffset is on, or -1 if charOffset is invalid
	 */
	synchronized public int findLineNumber(int charOffset) {
		if (!isValid(charOffset)) {
			return -1;
		}

		Pair<Integer> cachedEntry = _cache.getNearestCharOffset(charOffset);
		int line = cachedEntry.getFirst();
		int offset = logicalToRealIndex(cachedEntry.getSecond());
		int targetOffset = logicalToRealIndex(charOffset);
		int lastKnownLine = -1;
		int lastKnownCharOffset = -1;

		if (targetOffset > offset) {
			// search forward
			while ((offset < targetOffset) && (offset < _contents.length)) {
				if (_contents[offset] == Language.NEWLINE) {
					++line;
					lastKnownLine = line;
					lastKnownCharOffset = realToLogicalIndex(offset) + 1;
				}

				++offset;
				// skip the gap
				if (offset == _gapStartIndex) {
					offset = _gapEndIndex;
				}
			}
		} else if (targetOffset < offset) {
			// search backward
			while ((offset > targetOffset) && (offset > 0)) {
				// skip behind the gap
				if (offset == _gapEndIndex) {
					offset = _gapStartIndex;
				}
				--offset;

				if (_contents[offset] == Language.NEWLINE) {
					lastKnownLine = line;
					lastKnownCharOffset = realToLogicalIndex(offset) + 1;
					--line;
				}
			}
		}

		if (offset == targetOffset) {
			if (lastKnownLine != -1) {
				// cache the lookup entry
				_cache.updateEntry(lastKnownLine, lastKnownCharOffset);
			}
			return line;
		} else {
			return -1;
		}
	}

	/**
	 * Finds the number of char on the specified line.
	 * All valid lines contain at least one char, which may be a non-printable
	 * one like \n, \t or EOF.
	 *
	 * @return The number of chars in lineNumber, or 0 if the line does not exist.
	 */
	synchronized public int getLineSize(int lineNumber) {
		int lineLength = 0;
		int pos = getLineOffset(lineNumber);

		if (pos != -1) {
			pos = logicalToRealIndex(pos);
			//TODO consider adding check for (pos < _contents.length) in case EOF is not properly set
			while (_contents[pos] != Language.NEWLINE &&
				   _contents[pos] != Language.EOF) {
				++lineLength;
				++pos;

				// skip the gap
				if (pos == _gapStartIndex) {
					pos = _gapEndIndex;
				}
			}
			++lineLength; // account for the line terminator char
		}

		return lineLength;
	}

	/**
	 * Gets the char at charOffset
	 * Does not do bounds-checking.
	 *
	 * @return The char at charOffset. If charOffset is invalid, the result
	 * 		is undefined.
	 */
	synchronized public char charAt(int charOffset) {
		return _contents[logicalToRealIndex(charOffset)];
	}

	/**
	 * Gets up to maxChars number of chars starting at charOffset
	 *
	 * @return The chars starting from charOffset, up to a maximum of maxChars.
	 * 		An empty array is returned if charOffset is invalid or maxChars is
	 *		non-positive.
	 */
	synchronized public CharSequence subSequence(int charOffset, int maxChars) {
		if (!isValid(charOffset) || maxChars <= 0) {
			return new String();
		}
		int totalChars = maxChars;
		if ((charOffset + totalChars) > getTextLength()) {
			totalChars = getTextLength() - charOffset;
		}
		int realIndex = logicalToRealIndex(charOffset);
		char[] chars = new char[totalChars];

		for (int i = 0; i < totalChars; ++i) {
			chars[i] = _contents[realIndex];
			++realIndex;
			// skip the gap
			if (realIndex == _gapStartIndex) {
				realIndex = _gapEndIndex;
			}
		}

		return new String(chars);
	}

	/**
	 * Gets charCount number of consecutive characters starting from _gapStartIndex.
	 *
	 * Only UndoStack should use this method. No error checking is done.
	 */
	char[] gapSubSequence(int charCount) {
		char[] chars = new char[charCount];

		for (int i = 0; i < charCount; ++i) {
			chars[i] = _contents[_gapStartIndex + i];
		}

		return chars;
	}

	/**
	 * Insert all characters in c into position charOffset.
	 *
	 * No error checking is done
	 */
	public synchronized void insert(char[] c, int charOffset, long timestamp,
									boolean undoable) {
		if (undoable) {
			_undoStack.captureInsert(charOffset, c.length, timestamp);
		}

		int insertIndex = logicalToRealIndex(charOffset);

		// shift gap to insertion point
		if (insertIndex != _gapEndIndex) {
			if (isBeforeGap(insertIndex)) {
				shiftGapLeft(insertIndex);
			} else {
				shiftGapRight(insertIndex);
			}
		}

		if (c.length >= gapSize()) {
			growBufferBy(c.length - gapSize());
		}

		for (int i = 0; i < c.length; ++i) {
			if (c[i] == Language.NEWLINE) {
				++_lineCount;
			}
			_contents[_gapStartIndex] = c[i];
			++_gapStartIndex;
		}

		_cache.invalidateCache(charOffset);
	}

	/**
	 * Deletes up to totalChars number of char starting from position
	 * charOffset, inclusive.
	 *
	 * No error checking is done
	 */
	public synchronized void delete(int charOffset, int totalChars, long timestamp,
									boolean undoable) {
		if (undoable) {
			_undoStack.captureDelete(charOffset, totalChars, timestamp);
		}

		int newGapStart = charOffset + totalChars;

		// shift gap to deletion point
		if (newGapStart != _gapStartIndex) {
			if (isBeforeGap(newGapStart)) {
				shiftGapLeft(newGapStart);
			} else {
				shiftGapRight(newGapStart + gapSize());
			}
		}

		// increase gap size
		for (int i = 0; i < totalChars; ++i) {
			--_gapStartIndex;
			if (_contents[_gapStartIndex] == Language.NEWLINE) {
				--_lineCount;
			}
		}

		_cache.invalidateCache(charOffset);
	}

	/**
	 * Moves _gapStartIndex by displacement units. Note that displacement can be
	 * negative and will move _gapStartIndex to the left.
	 *
	 * Only UndoStack should use this method to carry out a simple undo/redo
	 * of insertions/deletions. No error checking is done.
	 */
	synchronized void shiftGapStart(int displacement) {
		if (displacement >= 0) {
			_lineCount += countNewlines(_gapStartIndex, displacement);
		} else {
			_lineCount -= countNewlines(_gapStartIndex + displacement, -displacement);
		}

		_gapStartIndex += displacement;
		_cache.invalidateCache(realToLogicalIndex(_gapStartIndex - 1) + 1);
	}

	//does NOT skip the gap when examining consecutive positions
	private int countNewlines(int start, int totalChars) {
		int newlines = 0;
		for (int i = start; i < (start + totalChars); ++i) {
			if (_contents[i] == Language.NEWLINE) {
				++newlines;
			}
		}

		return newlines;
	}

	/**
	 * Adjusts gap so that _gapStartIndex is at newGapStart
	 */
	final protected void shiftGapLeft(int newGapStart) {
		while (_gapStartIndex > newGapStart) {
			--_gapEndIndex;
			--_gapStartIndex;
			_contents[_gapEndIndex] = _contents[_gapStartIndex];
		}
	}

	/**
	 * Adjusts gap so that _gapEndIndex is at newGapEnd
	 */
	final protected void shiftGapRight(int newGapEnd) {
		while (_gapEndIndex < newGapEnd) {
			_contents[_gapStartIndex] = _contents[_gapEndIndex];
			++_gapStartIndex;
			++_gapEndIndex;
		}
	}

	/**
	 * Create a gap at the start of _contents[] and tack a EOF at the end.
	 * Precondition: real contents are from _contents[0] to _contents[contentsLength-1]
	 */
	protected void initGap(int contentsLength) {
		int toPosition = _contents.length - 1;
		_contents[toPosition--] = Language.EOF; // mark end of file
		int fromPosition = contentsLength - 1;
		while (fromPosition >= 0) {
			_contents[toPosition--] = _contents[fromPosition--];
		}
		_gapStartIndex = 0;
		_gapEndIndex = toPosition + 1; // went one-past in the while loop
	}

	/**
	 * Copies _contents into a buffer that is larger by
	 * 		minIncrement + INITIAL_GAP_SIZE * _allocCount bytes.
	 *
	 * _allocMultiplier doubles on every call to this method, to avoid the
	 * overhead of repeated allocations.
	 */
	protected void growBufferBy(int minIncrement) {
		//TODO handle new size > MAX_INT or allocation failure
		int increasedSize = minIncrement + MIN_GAP_SIZE * _allocMultiplier;
		char[] temp = new char[_contents.length + increasedSize];
		int i = 0;
		while (i < _gapStartIndex) {
			temp[i] = _contents[i];
			++i;
		}

		i = _gapEndIndex;
		while (i < _contents.length) {
			temp[i + increasedSize] = _contents[i];
			++i;
		}

		_gapEndIndex += increasedSize;
		_contents = temp;
		_allocMultiplier <<= 1;
	}

	/**
	 * Returns the total number of characters in the text, including the
	 * EOF sentinel char
	 */
	final synchronized public int getTextLength() {
		return _contents.length - gapSize();
	}

	synchronized public int getLineCount() {
		return _lineCount;
	}

	final synchronized public boolean isValid(int charOffset) {
		return (charOffset >= 0 && charOffset < getTextLength());
	}

	final protected int gapSize() {
		return _gapEndIndex - _gapStartIndex;
	}

	final protected int logicalToRealIndex(int i) {
		if (isBeforeGap(i)) {
			return i;
		} else {
			return i + gapSize();
		}
	}

	final protected int realToLogicalIndex(int i) {
		if (isBeforeGap(i)) {
			return i;
		} else {
			return i - gapSize();
		}
	}

	final protected boolean isBeforeGap(int i) {
		return i < _gapStartIndex;
	}

	public void clearSpans() {
		_spans = new Vector<>();
	    _spans.add(new Pair<ColorScheme.Colorable>(0, ColorScheme.Colorable.NAME));
	}

	public List<Pair<ColorScheme.Colorable>> getSpans() {
		return _spans;
	}

	/**
	 * Sets the spans to use in the document.
	 * Spans are continuous sequences of characters that have the same format
	 * like color, font, etc.
	 *
	 * @param spans A collection of Pairs, where Pair.first is the start
	 * 		position of the token, and Pair.second is the type of the token.
	 */
	public void setSpans(List<Pair<ColorScheme.Colorable>> spans) {
		_spans = spans;
	}

	/**
	 * Returns true if in batch edit mode
	 */
	public boolean isBatchEdit() {
		return _undoStack.isBatchEdit();
	}

	/**
	 * Signals the beginning of a series of insert/delete operations that can be
	 * undone/redone as a single unit
	 */
	public void beginBatchEdit() {
		_undoStack.beginBatchEdit();
	}

	/**
	 * Signals the end of a series of insert/delete operations that can be
	 * undone/redone as a single unit
	 */
	public void endBatchEdit() {
		_undoStack.endBatchEdit();
	}

	public boolean canUndo() {
		return _undoStack.canUndo();
	}

	public boolean canRedo() {
		return _undoStack.canRedo();
	}

	public int undo() {
		return _undoStack.undo();
	}

	public int redo() {
		return _undoStack.redo();
	}

	@Override
	public String toString() {
		int len=getTextLength();
		StringBuffer buf=new StringBuffer();
		for (int i=0;i < len;i++) {
			char c=charAt(i);
			if (c == Language.EOF)
				break;
			buf.append(c);
		}
		return new String(buf);
	}

}


text:
* blueimp [https://github.com/blueimp/Gallery/](https://github.com/blueimp/Gallery/)
* modernizr [http://modernizr.com/](http://modernizr.com/), used and tested:2.6.2
* jquery [https://jquery.com](https://jquery.com), used and tested:1.11.0


text:
export default {
  name: 'freelog-tags',
  data() {
    return {
      tags: [],
      inputVisible: false,
      inputValue: ''
    }
  },
  props: {
    value: {
      type: Array,
      default() {
        return []
      }
    },
    actionText: {
      type: String,
      default() {
        return 'New Tag'
      }
    },
    isCanCURD: {
      type: Boolean,
      default: true
    },
  },
  watch: {
    value(val) {
      this.setCurrentValue(val)
    }
  },
  mounted() {
    this.setCurrentValue(this.value)
  },
  methods: {
    setCurrentValue(value) {
      this.tags = value
    },
    handleClose(tag) {
      this.tags.splice(this.tags.indexOf(tag), 1)
      this.$emit('input', this.tags)
    },
    showInput() {
      this.inputVisible = true
      this.$nextTick(() => {
        this.$refs.saveTagInput.$refs.input.focus()
      })
    },
    handleInputConfirm() {
      const inputValue = this.inputValue
      if (inputValue) {
        this.tags.push(inputValue)
        this.$emit('input', this.tags)
      }
      this.inputVisible = false
      this.inputValue = ''
    }
  }
}


text:
import React, { Component, PropTypes } from 'react';
import { browserHistory } from 'react-router';

class Menu extends Component {
  constructor() {
    super();
    this.onClickLink = this.onClickLink.bind(this);
  }
  onClickLink(path) {
    const { onSetMenuState } = this.props;
    browserHistory.push(path);
    onSetMenuState(false);
  }
  render() {
    const { onSetMenuState, isMenuActive } = this.props;
    return (
      <section className={`menu ${isMenuActive ? 'is-active' : ''}`}>

 this.onClickLink('/')} >

             onSetMenuState(false)} />

 this.onClickLink('/biografia')}>Biografía

 this.onClickLink('/prensa/columnas')}>Prensa

 this.onClickLink('/actividad-legislativa/leyes-promovidas')}>Actividad legislativa

 this.onClickLink('/contacto')}>Contacto

Sitio oficial de Jose Name Senador @2017

Todos los derechos reservados

 onSetMenuState(false)} />

    );
  }
}

Menu.propTypes = {
  onSetMenuState: PropTypes.func,
  isMenuActive: PropTypes.bool,
};

export default Menu;


text:
import { JbTooltip } from "./tooltip";
import { Component } from "@jable/browser-component";

@Component({
    selector: '[jb-tooltip]'
})
export class JbTooltipComponent extends JbTooltip {
    constructor(el: HTMLElement) {
        super(el);
    }
}


text:
package ravtrix.backpackerbuddy.interfacescom;

/**
 * Created by Ravinder on 9/11/16.
 */
public interface FragActivityUpdateProfilePic {
    void onUpdateProfilePic();
}


text:
import React, { useRef, useState } from 'react';
import { Alignment, Direction } from '../Popover/types';
import Overlay from './Overlay';

interface Props {
  id: string;
  alignment: Alignment;
  direction: Direction;
  overlay: React.ReactNode;
  children: React.ReactChild;
  contentClassName?: string;
  wrapperClassName?: string;
  triggerClassName?: string;
  noArrow?: boolean;
}

const Tooltip: React.FunctionComponent<Props> = ({
  id,
  alignment,
  direction,
  wrapperClassName,
  overlay,
  children,
  noArrow = false
}) => {
  const [isOpen, setIsOpen] = useState(false);
  const triggerRef = useRef(null);

  function show() {
    setIsOpen(true);
  }

  function hide() {
    setIsOpen(false);
  }

  return (
    <span onMouseEnter={show} onMouseLeave={hide}>
      <span
        className={wrapperClassName}
        aria-describedby={isOpen ? id : undefined}
        ref={triggerRef}
      >
        {children}
      </span>

      <Overlay
        id={id}
        isOpen={isOpen}
        triggerEl={triggerRef.current}
        alignment={alignment}
        direction={direction}
        noArrow={noArrow}
      >
        {overlay}
      </Overlay>
    </span>
  );
};

export default Tooltip;


text:
CVM-ServerMngr
==============

Server management application, used as project for the Linux course


text:
package org.apache.commons.imaging.formats.psd;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.nio.charset.StandardCharsets;

import org.junit.jupiter.api.Test;

public class ImageResourceBlockTest{

    @Test
    public void testCreatesImageResourceBlockAndCallsGetName() {
        final byte[] byteArray = new byte[3];
        final ImageResourceBlock imageResourceBlock = new ImageResourceBlock(0, byteArray, byteArray);

        assertEquals( new String(byteArray, StandardCharsets.ISO_8859_1), imageResourceBlock.getName());
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/message_container"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingTop="5dp"
    android:paddingBottom="5dp">

    <FrameLayout
        android:id="@+id/left_arrow"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_marginStart="2dp"
        android:layout_marginLeft="2dp"
        android:background="@drawable/ic_chat_message_arrow"
        android:rotation="180" />

    <LinearLayout
        android:id="@+id/message"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="26dp"
        android:layout_marginRight="26dp"
        android:background="@drawable/ic_chat_message_background"
        android:orientation="vertical"
        android:padding="10dp">

        <TextView
            android:id="@+id/message_text"
            style="@style/TextAppearance.AppCompat.Medium"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textIsSelectable="true"
            android:textStyle="bold"
            tools:text="Hey this is a message, look!" />

        <TextView
            android:id="@+id/name_text"
            style="@style/TextAppearance.AppCompat.Small"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textIsSelectable="true"
            tools:text="Some User" />

    </LinearLayout>

    <FrameLayout
        android:id="@+id/right_arrow"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_alignEnd="@+id/message"
        android:layout_marginEnd="25dp"
        android:layout_alignRight="@+id/message"
        android:layout_marginRight="25dp"
        android:layout_alignParentTop="true"
        android:background="@drawable/ic_chat_message_arrow"
        android:rotation="180" />

</RelativeLayout>


text:
using System.Collections.Generic;
using DiscUtils.Streams;
using Xunit;

namespace LibraryTests.Streams
{
    public class BuiltStreamTest
    {
        [Fact]
        public void BuildStreamLengthIsRespected()
        {
            int length = 1024;
            var extent = new BuilderSparseStreamExtent(0, new ZeroStream(2 * length));
            using (var stream = new BuiltStream(length, new List<BuilderExtent> { extent }))
            {
                Assert.Equal(0, stream.Position);
                Assert.Equal(length, stream.Length);
                var content = new byte[2 * length];
                var read = stream.Read(content, 0, content.Length);
                Assert.Equal(length, read);
                Assert.Equal(stream.Length, stream.Position);
            }
        }
    }
}


text:
    <<

    <

    >

    >>

    X


text:
/**
 * Autogenerated by Thrift Compiler (0.9.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using Thrift;
using Thrift.Collections;
using System.Runtime.Serialization;
using Thrift.Protocol;
using Thrift.Transport;

namespace Apache.Cassandra
{

  /// <summary>
  /// RPC timeout was exceeded.  either a node failed mid-operation, or load was too high, or the requested op was too large.
  /// </summary>
  #if !SILVERLIGHT
  [Serializable]
  #endif
  public partial class TimedOutException : Exception, TBase
  {
    private int _acknowledged_by;
    private bool _acknowledged_by_batchlog;

    /// <summary>
    /// if a write operation was acknowledged by some replicas but not by enough to
    /// satisfy the required ConsistencyLevel, the number of successful
    /// replies will be given here. In case of atomic_batch_mutate method this field
    /// will be set to -1 if the batch was written to the batchlog and to 0 if it wasn't.
    /// </summary>
    public int Acknowledged_by
    {
      get
      {
        return _acknowledged_by;
      }
      set
      {
        __isset.acknowledged_by = true;
        this._acknowledged_by = value;
      }
    }

    /// <summary>
    /// in case of atomic_batch_mutate method this field tells if the batch was written to the batchlog.
    /// </summary>
    public bool Acknowledged_by_batchlog
    {
      get
      {
        return _acknowledged_by_batchlog;
      }
      set
      {
        __isset.acknowledged_by_batchlog = true;
        this._acknowledged_by_batchlog = value;
      }
    }

    public Isset __isset;
    #if !SILVERLIGHT
    [Serializable]
    #endif
    public struct Isset {
      public bool acknowledged_by;
      public bool acknowledged_by_batchlog;
    }

    public TimedOutException() {
    }

    public void Read (TProtocol iprot)
    {
      TField field;
      iprot.ReadStructBegin();
      while (true)
      {
        field = iprot.ReadFieldBegin();
        if (field.Type == TType.Stop) {
          break;
        }
        switch (field.ID)
        {
          case 1:
            if (field.Type == TType.I32) {
              Acknowledged_by = iprot.ReadI32();
            } else {
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          case 2:
            if (field.Type == TType.Bool) {
              Acknowledged_by_batchlog = iprot.ReadBool();
            } else {
              TProtocolUtil.Skip(iprot, field.Type);
            }
            break;
          default:
            TProtocolUtil.Skip(iprot, field.Type);
            break;
        }
        iprot.ReadFieldEnd();
      }
      iprot.ReadStructEnd();
    }

    public void Write(TProtocol oprot) {
      TStruct struc = new TStruct("TimedOutException");
      oprot.WriteStructBegin(struc);
      TField field = new TField();
      if (__isset.acknowledged_by) {
        field.Name = "acknowledged_by";
        field.Type = TType.I32;
        field.ID = 1;
        oprot.WriteFieldBegin(field);
        oprot.WriteI32(Acknowledged_by);
        oprot.WriteFieldEnd();
      }
      if (__isset.acknowledged_by_batchlog) {
        field.Name = "acknowledged_by_batchlog";
        field.Type = TType.Bool;
        field.ID = 2;
        oprot.WriteFieldBegin(field);
        oprot.WriteBool(Acknowledged_by_batchlog);
        oprot.WriteFieldEnd();
      }
      oprot.WriteFieldStop();
      oprot.WriteStructEnd();
    }

    public override string ToString() {
      StringBuilder sb = new StringBuilder("TimedOutException(");
      sb.Append("Acknowledged_by: ");
      sb.Append(Acknowledged_by);
      sb.Append(",Acknowledged_by_batchlog: ");
      sb.Append(Acknowledged_by_batchlog);
      sb.Append(")");
      return sb.ToString();
    }

  }

}


text:
.. _nuptranslationmap:

nuptranslationmap
===========================================

.. class:: nuptranslationmap.NUPTranslationMap(bambou.nurest_object.NUMetaRESTObject,):

1:1 mappings of private IPs in provider domain to the provider  alias (public) IPs in customer domain and N:1 mappings of a collection of provider private IPs to a provider alias IP into the customer domain.

Attributes
----------

- ``spat_source_list``: The list of provider source IPs to be SPAT'd.

- ``mapping_type`` (**Mandatory**): 1:1 NATmapping, or *:1 PAT mappings

- ``last_updated_by``: ID of the user who last updated the object.

- ``entity_scope``: Specify if scope of entity is Data center or Enterprise level

- ``provider_alias_ip`` (**Mandatory**): Provider public IP in Customer Domain

- ``provider_ip`` (**Mandatory**): Provider private IP in Provider Domain.

- ``associated_domain_id``: associated domain for this

- ``external_id``: External object ID. Used for integration with third party systems

Children
--------

================================================================================================================================================               ==========================================================================================
**class**                                                                                **fetcher**

:ref:`numetadata.NUMetadata<numetadata>`                                                                                ``metadatas``
:ref:`nuglobalmetadata.NUGlobalMetadata<nuglobalmetadata>`                                                                                ``global_metadatas``
================================================================================================================================================               ==========================================================================================

Parents
--------

- :ref:`nupsnatpool.NUPSNATPool<nupsnatpool>`


text:
#include "SkRegionPriv.h"
#include "SkBlitter.h"
#include "SkScan.h"
#include "SkTDArray.h"
#include "SkPath.h"

class SkRgnBuilder : public SkBlitter {
public:
    virtual ~SkRgnBuilder();

    // returns true if it could allocate the working storage needed
    bool init(int maxHeight, int maxTransitions);

    void done() {
        if (fCurrScanline != NULL) {
            fCurrScanline->fXCount = (SkRegion::RunType)((int)(fCurrXPtr - fCurrScanline->firstX()));
            if (!this->collapsWithPrev()) { // flush the last line
                fCurrScanline = fCurrScanline->nextScanline();
            }
        }
    }

    int     computeRunCount() const;
    void    copyToRect(SkIRect*) const;
    void    copyToRgn(SkRegion::RunType runs[]) const;

    virtual void blitH(int x, int y, int width);

#ifdef SK_DEBUG
    void dump() const {
        SkDebugf("SkRgnBuilder: Top = %d\n", fTop);
        const Scanline* line = (Scanline*)fStorage;
        while (line < fCurrScanline) {
            SkDebugf("SkRgnBuilder::Scanline: LastY=%d, fXCount=%d", line->fLastY, line->fXCount);
            for (int i = 0; i < line->fXCount; i++) {
                SkDebugf(" %d", line->firstX()[i]);
            }
            SkDebugf("\n");

            line = line->nextScanline();
        }
    }
#endif
private:
    /*
     *  Scanline mimics a row in the region, nearly. A row in a region is:
     *      [Bottom IntervalCount [L R]... Sentinel]
     *  while a Scanline is
     *      [LastY XCount [L R]... uninitialized]
     *  The two are the same length (which is good), but we have to transmute
     *  the scanline a little when we convert it to a region-row.
     *
     *  Potentially we could recode this to exactly match the row format, in
     *  which case copyToRgn() could be a single memcpy. Not sure that is worth
     *  the effort.
     */
    struct Scanline {
        SkRegion::RunType fLastY;
        SkRegion::RunType fXCount;

        SkRegion::RunType* firstX() const { return (SkRegion::RunType*)(this + 1); }
        Scanline* nextScanline() const {
            // add final +1 for the x-sentinel
            return (Scanline*)((SkRegion::RunType*)(this + 1) + fXCount + 1);
        }
    };
    SkRegion::RunType*  fStorage;
    Scanline*           fCurrScanline;
    Scanline*           fPrevScanline;
    //  points at next avialable x[] in fCurrScanline
    SkRegion::RunType*  fCurrXPtr;
    SkRegion::RunType   fTop;           // first Y value

    int fStorageCount;

    bool collapsWithPrev() {
        if (fPrevScanline != NULL &&
            fPrevScanline->fLastY + 1 == fCurrScanline->fLastY &&
            fPrevScanline->fXCount == fCurrScanline->fXCount &&
            !memcmp(fPrevScanline->firstX(),
                    fCurrScanline->firstX(),
                    fCurrScanline->fXCount * sizeof(SkRegion::RunType)))
        {
            // update the height of fPrevScanline
            fPrevScanline->fLastY = fCurrScanline->fLastY;
            return true;
        }
        return false;
    }
};

SkRgnBuilder::~SkRgnBuilder() {
    sk_free(fStorage);
}

bool SkRgnBuilder::init(int maxHeight, int maxTransitions) {
    if ((maxHeight | maxTransitions) < 0) {
        return false;
    }

    Sk64 count, size;

    // compute the count with +1 and +3 slop for the working buffer
    count.setMul(maxHeight + 1, 3 + maxTransitions);
    if (!count.is32() || count.isNeg()) {
        return false;
    }
    fStorageCount = count.get32();

    size.setMul(fStorageCount, sizeof(SkRegion::RunType));
    if (!size.is32() || size.isNeg()) {
        return false;
    }

    fStorage = (SkRegion::RunType*)sk_malloc_flags(size.get32(), 0);
    if (NULL == fStorage) {
        return false;
    }

    fCurrScanline = NULL;    // signal empty collection
    fPrevScanline = NULL;    // signal first scanline
    return true;
}

void SkRgnBuilder::blitH(int x, int y, int width) {
    if (fCurrScanline == NULL) {  // first time
        fTop = (SkRegion::RunType)(y);
        fCurrScanline = (Scanline*)fStorage;
        fCurrScanline->fLastY = (SkRegion::RunType)(y);
        fCurrXPtr = fCurrScanline->firstX();
    } else {
        SkASSERT(y >= fCurrScanline->fLastY);

        if (y > fCurrScanline->fLastY) {
            // if we get here, we're done with fCurrScanline
            fCurrScanline->fXCount = (SkRegion::RunType)((int)(fCurrXPtr - fCurrScanline->firstX()));

            int prevLastY = fCurrScanline->fLastY;
            if (!this->collapsWithPrev()) {
                fPrevScanline = fCurrScanline;
                fCurrScanline = fCurrScanline->nextScanline();

            }
            if (y - 1 > prevLastY) {  // insert empty run
                fCurrScanline->fLastY = (SkRegion::RunType)(y - 1);
                fCurrScanline->fXCount = 0;
                fCurrScanline = fCurrScanline->nextScanline();
            }
            // setup for the new curr line
            fCurrScanline->fLastY = (SkRegion::RunType)(y);
            fCurrXPtr = fCurrScanline->firstX();
        }
    }
    //  check if we should extend the current run, or add a new one
    if (fCurrXPtr > fCurrScanline->firstX() && fCurrXPtr[-1] == x) {
        fCurrXPtr[-1] = (SkRegion::RunType)(x + width);
    } else {
        fCurrXPtr[0] = (SkRegion::RunType)(x);
        fCurrXPtr[1] = (SkRegion::RunType)(x + width);
        fCurrXPtr += 2;
    }
    SkASSERT(fCurrXPtr - fStorage < fStorageCount);
}

int SkRgnBuilder::computeRunCount() const {
    if (fCurrScanline == NULL) {
        return 0;
    }

    const SkRegion::RunType*  line = fStorage;
    const SkRegion::RunType*  stop = (const SkRegion::RunType*)fCurrScanline;

    return 2 + (int)(stop - line);
}

void SkRgnBuilder::copyToRect(SkIRect* r) const {
    SkASSERT(fCurrScanline != NULL);
    // A rect's scanline is [bottom intervals left right sentinel] == 5
    SkASSERT((const SkRegion::RunType*)fCurrScanline - fStorage == 5);

    const Scanline* line = (const Scanline*)fStorage;
    SkASSERT(line->fXCount == 2);

    r->set(line->firstX()[0], fTop, line->firstX()[1], line->fLastY + 1);
}

void SkRgnBuilder::copyToRgn(SkRegion::RunType runs[]) const {
    SkASSERT(fCurrScanline != NULL);
    SkASSERT((const SkRegion::RunType*)fCurrScanline - fStorage > 4);

    const Scanline* line = (const Scanline*)fStorage;
    const Scanline* stop = fCurrScanline;

    *runs++ = fTop;
    do {
        *runs++ = (SkRegion::RunType)(line->fLastY + 1);
        int count = line->fXCount;
        *runs++ = count >> 1;   // intervalCount
        if (count) {
            memcpy(runs, line->firstX(), count * sizeof(SkRegion::RunType));
            runs += count;
        }
        *runs++ = SkRegion::kRunTypeSentinel;
        line = line->nextScanline();
    } while (line < stop);
    SkASSERT(line == stop);
    *runs = SkRegion::kRunTypeSentinel;
}

static unsigned verb_to_initial_last_index(unsigned verb) {
    static const uint8_t gPathVerbToInitialLastIndex[] = {
        0,  //  kMove_Verb
        1,  //  kLine_Verb
        2,  //  kQuad_Verb
        2,  //  kConic_Verb
        3,  //  kCubic_Verb
        0,  //  kClose_Verb
        0   //  kDone_Verb
    };
    SkASSERT((unsigned)verb < SK_ARRAY_COUNT(gPathVerbToInitialLastIndex));
    return gPathVerbToInitialLastIndex[verb];
}

static unsigned verb_to_max_edges(unsigned verb) {
    static const uint8_t gPathVerbToMaxEdges[] = {
        0,  //  kMove_Verb
        1,  //  kLine_Verb
        2,  //  kQuad_VerbB
        2,  //  kConic_VerbB
        3,  //  kCubic_Verb
        0,  //  kClose_Verb
        0   //  kDone_Verb
    };
    SkASSERT((unsigned)verb < SK_ARRAY_COUNT(gPathVerbToMaxEdges));
    return gPathVerbToMaxEdges[verb];
}

static int count_path_runtype_values(const SkPath& path, int* itop, int* ibot) {
    SkPath::Iter    iter(path, true);
    SkPoint         pts[4];
    SkPath::Verb    verb;

    int maxEdges = 0;
    SkScalar    top = SkIntToScalar(SK_MaxS16);
    SkScalar    bot = SkIntToScalar(SK_MinS16);

    while ((verb = iter.next(pts, false)) != SkPath::kDone_Verb) {
        maxEdges += verb_to_max_edges(verb);

        int lastIndex = verb_to_initial_last_index(verb);
        if (lastIndex > 0) {
            for (int i = 1; i <= lastIndex; i++) {
                if (top > pts[i].fY) {
                    top = pts[i].fY;
                } else if (bot < pts[i].fY) {
                    bot = pts[i].fY;
                }
            }
        } else if (SkPath::kMove_Verb == verb) {
            if (top > pts[0].fY) {
                top = pts[0].fY;
            } else if (bot < pts[0].fY) {
                bot = pts[0].fY;
            }
        }
    }
    SkASSERT(top <= bot);

    *itop = SkScalarRound(top);
    *ibot = SkScalarRound(bot);
    return maxEdges;
}

bool SkRegion::setPath(const SkPath& path, const SkRegion& clip) {
    SkDEBUGCODE(this->validate();)

    if (clip.isEmpty()) {
        return this->setEmpty();
    }

    if (path.isEmpty()) {
        if (path.isInverseFillType()) {
            return this->set(clip);
        } else {
            return this->setEmpty();
        }
    }

    //  compute worst-case rgn-size for the path
    int pathTop, pathBot;
    int pathTransitions = count_path_runtype_values(path, &pathTop, &pathBot);
    int clipTop, clipBot;
    int clipTransitions;

    clipTransitions = clip.count_runtype_values(&clipTop, &clipBot);

    int top = SkMax32(pathTop, clipTop);
    int bot = SkMin32(pathBot, clipBot);

    if (top >= bot)
        return this->setEmpty();

    SkRgnBuilder builder;

    if (!builder.init(bot - top, SkMax32(pathTransitions, clipTransitions))) {
        // can't allocate working space, so return false
        return this->setEmpty();
    }

    SkScan::FillPath(path, clip, &builder);
    builder.done();

    int count = builder.computeRunCount();
    if (count == 0) {
        return this->setEmpty();
    } else if (count == kRectRegionRuns) {
        builder.copyToRect(&fBounds);
        this->setRect(fBounds);
    } else {
        SkRegion tmp;

        tmp.fRunHead = RunHead::Alloc(count);
        builder.copyToRgn(tmp.fRunHead->writable_runs());
        tmp.fRunHead->computeRunBounds(&tmp.fBounds);
        this->swap(tmp);
    }
    SkDEBUGCODE(this->validate();)
    return true;
}

/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////

struct Edge {
    enum {
        kY0Link = 0x01,
        kY1Link = 0x02,

        kCompleteLink = (kY0Link | kY1Link)
    };

    SkRegion::RunType fX;
    SkRegion::RunType fY0, fY1;
    uint8_t fFlags;
    Edge*   fNext;

    void set(int x, int y0, int y1) {
        SkASSERT(y0 != y1);

        fX = (SkRegion::RunType)(x);
        fY0 = (SkRegion::RunType)(y0);
        fY1 = (SkRegion::RunType)(y1);
        fFlags = 0;
        SkDEBUGCODE(fNext = NULL;)
    }

    int top() const {
        return SkFastMin32(fY0, fY1);
    }
};

static void find_link(Edge* base, Edge* stop) {
    SkASSERT(base < stop);

    if (base->fFlags == Edge::kCompleteLink) {
        SkASSERT(base->fNext);
        return;
    }

    SkASSERT(base + 1 < stop);

    int y0 = base->fY0;
    int y1 = base->fY1;

    Edge* e = base;
    if ((base->fFlags & Edge::kY0Link) == 0) {
        for (;;) {
            e += 1;
            if ((e->fFlags & Edge::kY1Link) == 0 && y0 == e->fY1) {
                SkASSERT(NULL == e->fNext);
                e->fNext = base;
                e->fFlags = SkToU8(e->fFlags | Edge::kY1Link);
                break;
            }
        }
    }

    e = base;
    if ((base->fFlags & Edge::kY1Link) == 0) {
        for (;;) {
            e += 1;
            if ((e->fFlags & Edge::kY0Link) == 0 && y1 == e->fY0) {
                SkASSERT(NULL == base->fNext);
                base->fNext = e;
                e->fFlags = SkToU8(e->fFlags | Edge::kY0Link);
                break;
            }
        }
    }

    base->fFlags = Edge::kCompleteLink;
}

static int extract_path(Edge* edge, Edge* stop, SkPath* path) {
    while (0 == edge->fFlags) {
        edge++; // skip over "used" edges
    }

    SkASSERT(edge < stop);

    Edge* base = edge;
    Edge* prev = edge;
    edge = edge->fNext;
    SkASSERT(edge != base);

    int count = 1;
    path->moveTo(SkIntToScalar(prev->fX), SkIntToScalar(prev->fY0));
    prev->fFlags = 0;
    do {
        if (prev->fX != edge->fX || prev->fY1 != edge->fY0) { // skip collinear
            path->lineTo(SkIntToScalar(prev->fX), SkIntToScalar(prev->fY1));    // V
            path->lineTo(SkIntToScalar(edge->fX), SkIntToScalar(edge->fY0));    // H
        }
        prev = edge;
        edge = edge->fNext;
        count += 1;
        prev->fFlags = 0;
    } while (edge != base);
    path->lineTo(SkIntToScalar(prev->fX), SkIntToScalar(prev->fY1));    // V
    path->close();
    return count;
}

#include "SkTSearch.h"

static int EdgeProc(const Edge* a, const Edge* b) {
    return (a->fX == b->fX) ? a->top() - b->top() : a->fX - b->fX;
}

bool SkRegion::getBoundaryPath(SkPath* path) const {
    // path could safely be NULL if we're empty, but the caller shouldn't
    // *know* that
    SkASSERT(path);

    if (this->isEmpty()) {
        return false;
    }

    const SkIRect& bounds = this->getBounds();

    if (this->isRect()) {
        SkRect  r;
        r.set(bounds);      // this converts the ints to scalars
        path->addRect(r);
        return true;
    }

    SkRegion::Iterator  iter(*this);
    SkTDArray<Edge>     edges;

    for (const SkIRect& r = iter.rect(); !iter.done(); iter.next()) {
        Edge* edge = edges.append(2);
        edge[0].set(r.fLeft, r.fBottom, r.fTop);
        edge[1].set(r.fRight, r.fTop, r.fBottom);
    }
    qsort(edges.begin(), edges.count(), sizeof(Edge), SkCastForQSort(EdgeProc));

    int count = edges.count();
    Edge* start = edges.begin();
    Edge* stop = start + count;
    Edge* e;

    for (e = start; e != stop; e++) {
        find_link(e, stop);
    }

#ifdef SK_DEBUG
    for (e = start; e != stop; e++) {
        SkASSERT(e->fNext != NULL);
        SkASSERT(e->fFlags == Edge::kCompleteLink);
    }
#endif

    path->incReserve(count << 1);
    do {
        SkASSERT(count > 1);
        count -= extract_path(start, stop, path);
    } while (count > 0);

    return true;
}


text:
//
//  HBKitDataModel.m
//  Pods
//
//  Created by HUANGBO on 16/11/30.
//
//

#import "HBKitDataModel.h"
#import "CELL_STRUCT.h"
#import "CELL_STRUCT_Common.h"

//@implementation NSObject(hbkit)
//-(NSString *)key_indexpath:(int)section row:(int)row{
//    return  [NSString stringWithFormat:@"section%u_%u",(int)section,(int)row];
//}
//@end

@implementation HBKitDataModel

-(NSMutableDictionary *)dataDictionary{
    if (!_dataDictionary) {
        _dataDictionary = [NSMutableDictionary new];
    }
    return _dataDictionary;
}
-(NSMutableDictionary *)viewConfigDictionary{
    if (!_viewConfigDictionary) {
        _viewConfigDictionary = [NSMutableDictionary new];
    }
    return _viewConfigDictionary;
}

/**
 *  从PLIST 文件中加载配置信息
 *
 *  @param plistname plist文件的名字
 */
-(void)loadplistConfig:(NSString *)plistname
       configViewblock:(void(^)( NSMutableDictionary * dataDictionary))configViewblock{

    [self loadplistConfig:plistname filepath:nil configViewblock:configViewblock];
}

/**
 * 从绝对路径中加载文件,filepath如果不填默认从系统文件中读取
 */
-(void)loadplistConfig:(NSString *)plistname
              filepath:(NSString *)filepath
       configViewblock:(void(^)( NSMutableDictionary * viewconfigDictionary))configViewblock
{
    NSMutableDictionary * dataDictionary = [self loadplistConfigToDictionary:plistname filepath:filepath];
    if (configViewblock) {
        configViewblock(self.viewConfigDictionary);
    }
    self.dataDictionary = dataDictionary;
}

/**
 *  从PLIST 文件中加载配置信息放到一个字典中而不是直接对datadictionary赋值
 *
 *  @param plistname plist文件的名字
 */

-(NSMutableDictionary *)loadplistConfigToDictionary:(NSString *)plistname{
    return [self loadplistConfigToDictionary:plistname filepath:nil];
}

-(BOOL)containkeys:(NSString *)key{

    NSArray * array = @[@"title",@"backgroundcolor",@"backgroundimage"];
    __block  BOOL valiate = NO;
    [array enumerateObjectsUsingBlock:^(NSString * obj, NSUInteger idx, BOOL * _Nonnull stop) {
        if ([key isEqualToString:obj]) {
            valiate = YES;
            *stop = YES;
        }
    }];
    return valiate;
}
/**
 * 从绝对路径中加载文件,filepath如果不填默认从系统文件中读取
 */
-(NSMutableDictionary *)loadplistConfigToDictionary:(NSString *)plistname filepath:(NSString *)filepath
{
    NSMutableDictionary * dataDictionary = [NSMutableDictionary new];
    if (!filepath) {
        filepath = [[NSBundle mainBundle] pathForResource:plistname ofType:@"plist"];
    }

    NSFileManager *fileManager = [NSFileManager defaultManager];
    //访问【filepath】目录下的问题件,该目录下支持手动增加、修改、删除文件及目录
    if([fileManager fileExistsAtPath:filepath]) //如果存在
    {
        NSDictionary * dic = [NSDictionary dictionaryWithContentsOfFile:filepath];
        for (NSString * key in dic.allKeys) {
            NSDictionary * adic = dic[key];
            if ([key containsString:@"section"] && adic) {
                CELL_STRUCT * cellstruct = [[CELL_STRUCT alloc] initWithPlistDictionary:adic];
                if (cellstruct) {
                    [dataDictionary setObject:cellstruct forKey:key];
                }
            }
            else if([self containkeys:key]){
                NSObject * value = dic[key];
                [self.viewConfigDictionary setObject:value forKey:key];
            }
        }
    }
    else{
        NSLog(@"文件不存在 path:%@",filepath);
    }
    return dataDictionary;
}

#pragma mark - load with json

/**
 *  从json文件中配置信息
 *
 *  @param jsonfilepath  json文件存放的路径名
 */

-(void)loadjsonfileConfig:(NSString *)jsonfilename  configViewblock:(void(^)( CELL_STRUCT_ARRAY * vclist))configViewblock{
    [self loadjsonfileConfig:jsonfilename filepath:nil configViewblock:configViewblock];
}

-(void)loadjsonfileConfig:(NSString *)jsonfilename
                 filepath:(NSString *)filepath
          configViewblock:(void(^)( CELL_STRUCT_ARRAY * vclist))configViewblock
{
    if (!filepath) {
        filepath = [[NSBundle mainBundle] pathForResource:jsonfilename ofType:@"json"];
    }
    NSError * error;
    NSString * jsonstring = [NSString stringWithContentsOfFile:filepath encoding:NSUTF8StringEncoding error:&error];
    if(error) { // If error object was instantiated, handle it.
        NSLog(@"ERROR while loading from file: %@", error);
        // …
    }
    else{
        CELL_STRUCT_ARRAY * vclist = [[CELL_STRUCT_ARRAY alloc] hb_initWithJSONData:[jsonstring dataUsingEncoding:NSUTF8StringEncoding]];
        NSString * title = vclist.title;
        if (configViewblock) {
            configViewblock(vclist);
        }

        [vclist.array enumerateObjectsUsingBlock:^(CELL_STRUCT * obj, NSUInteger idx, BOOL * _Nonnull stop) {

            obj.dictionarystring  = [self URLDecoding:obj.dictionarystring];
            obj.dictionary = [NSMutableDictionary dictionaryWithDictionary: [self dictionaryWithJsonString:obj.dictionarystring]];
            if (obj && [obj.key_indexpath containsString:@"section"] ) {
                [self.dataDictionary setObject:obj forKey:obj.key_indexpath];
            }
        }];
    }

    //    NSDictionary * dic = [NSDictionary dictionaryWithContentsOfFile:filepath];
    //    [self loadplistviewConfig:dic];

}

/*!
 * @brief 把格式化的JSON格式的字符串转换成字典
 * @param jsonString JSON格式的字符串
 * @return 返回字典
 */
- (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString {
    if (jsonString == nil) {
        return nil;
    }

    NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
    NSError *err;
    NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData
                                                        options:NSJSONReadingMutableContainers
                                                          error:&err];
    if(err) {
        NSLog(@"json解析失败:%@",err);
        return nil;
    }
    return dic;
}

- (NSString *)URLDecoding:(NSString *)sourcestring
{
    if (!sourcestring) {
        return nil;
    }
    NSMutableString * string = [NSMutableString stringWithString:sourcestring];
    [string replaceOccurrencesOfString:@"+"
                            withString:@" "
                               options:NSLiteralSearch
                                 range:NSMakeRange(0, [string length])];
    return [string stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
}

@end


text:
@*
 * Copyright 2022 HM Revenue & Customs
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *@

@import config.FrontendAppConfig
@import play.api.data.Form
@import play.api.i18n.Messages
@import play.api.mvc.Request
@import views.html.components._
@import views.html.layouts.layout

@this(
        layout: layout,
        h1: h1,
        p: p,
        button: button,
        formWithCSRF: FormWithCSRF,
        inputCurrency: inputCurrency,
        errorSummary: errorSummary
)

@(estimateTotalSalesForm: Form[BigDecimal])(implicit request: Request[_], messages: Messages, appConfig: FrontendAppConfig)

@layout(pageTitle = Some(title(estimateTotalSalesForm, messages("pages.frs.estimateTotalSales.heading")))) {

    @errorSummary(estimateTotalSalesForm.errors)

    @h1("pages.frs.estimateTotalSales.heading")

    @p{ @messages("pages.frs.estimateTotalSales.info") }

    @formWithCSRF(action = controllers.flatratescheme.routes.EstimateTotalSalesController.submitEstimateTotalSales) {
        @inputCurrency(
            form = estimateTotalSalesForm,
            id = "totalSalesEstimate",
            name = "totalSalesEstimate",
            classes = Some("govuk-input--width-10"),
            isPageHeading = false,
            label = Some(messages("pages.frs.estimateTotalSales.heading")),
            labelClasses = Some("govuk-visually-hidden"),
            hint = Some(Html(messages("pages.frs.estimateTotalSales.hint")))
        )

        @button("app.common.continue")
    }
}


text:
@implementation HudDemoViewController

#pragma mark -
#pragma mark Constants

#pragma mark -
#pragma mark Lifecycle methods

- (void)viewDidLoad {
	UIView *content = [[self.view subviews] objectAtIndex:0];
	((UIScrollView *)self.view).contentSize = content.bounds.size;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
    // Release anything that's not essential, such as cached data
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
}

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
	UIView *content = [[self.view subviews] objectAtIndex:0];
	((UIScrollView *)self.view).contentSize = content.bounds.size;
}

- (void)dealloc {
    [super dealloc];
}

#pragma mark -
#pragma mark IBActions

- (IBAction)showSimple:(id)sender {
    // The hud will dispable all input on the view (use the higest view possible in the view hierarchy)
    HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
    [self.navigationController.view addSubview:HUD];

    // Regiser for HUD callbacks so we can remove it from the window at the right time
    HUD.delegate = self;

    // Show the HUD while the provided method executes in a new thread
    [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
}

- (IBAction)showWithLabel:(id)sender {

    HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
	[self.navigationController.view addSubview:HUD];

    HUD.delegate = self;
    HUD.labelText = @"正在加载数据...";

    [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
}

- (IBAction)showWithDetailsLabel:(id)sender {

    HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
    [self.navigationController.view addSubview:HUD];

    HUD.delegate = self;
    HUD.labelText = @"Loading";
    HUD.detailsLabelText = @"updating data";
	HUD.square = YES;

    [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
}

- (IBAction)showWithLabelDeterminate:(id)sender {

    HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
	[self.navigationController.view addSubview:HUD];

    // Set determinate mode
    HUD.mode = MBProgressHUDModeDeterminate;

	HUD.delegate = self;
    HUD.labelText = @"Loading";
	HUD.detailsLabelText = @"0";
	// myProgressTask uses the HUD instance to update progress
    [HUD showWhileExecuting:@selector(myProgressTask) onTarget:self withObject:nil animated:YES];
}

- (IBAction)showWithCustomView:(id)sender {

    HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
	[self.navigationController.view addSubview:HUD];

	// The sample image is based on the work by http://www.pixelpressicons.com, http://creativecommons.org/licenses/by/2.5/ca/
	// Make the customViews 37 by 37 pixels for best results (those are the bounds of the build-in progress indicators)
	HUD.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"37x-Checkmark.png"]] autorelease];

    // Set custom view mode
    HUD.mode = MBProgressHUDModeCustomView;

    HUD.delegate = self;
    HUD.labelText = @"Completed";

    [HUD show:YES];
	[HUD hide:YES afterDelay:3];
}

- (IBAction)showWithLabelMixed:(id)sender {

    HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
	[self.navigationController.view addSubview:HUD];

    HUD.delegate = self;
    HUD.labelText = @"Connecting";
	HUD.minSize = CGSizeMake(135.f, 135.f);

    [HUD showWhileExecuting:@selector(myMixedTask) onTarget:self withObject:nil animated:YES];
}

- (IBAction)showUsingBlocks:(id)sender {
#ifdef __BLOCKS__
	// No need to retain (just a local variable)
	MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
	hud.labelText = @"Loading";

	dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
		// Do a taks in the background
		[self myTask];
		// Hide the HUD in the main tread
		dispatch_async(dispatch_get_main_queue(), ^{
			[MBProgressHUD hideHUDForView:self.navigationController.view animated:YES];
		});
	});
#endif
}

- (IBAction)showOnWindow:(id)sender {
	// The hud will dispable all input on the window
    HUD = [[MBProgressHUD alloc] initWithView:self.view.window];
    [self.view.window addSubview:HUD];

    HUD.delegate = self;
    HUD.labelText = @"Loading";

    [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
}

- (IBAction)showURL:(id)sender {
	NSURL *URL = [NSURL URLWithString:@"https://github.com/matej/MBProgressHUD/zipball/master"];
	NSURLRequest *request = [NSURLRequest requestWithURL:URL];

	NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
	[connection start];
	[connection release];

	HUD = [[MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES] retain];
}

- (IBAction)showWithGradient:(id)sender {

    HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
	[self.navigationController.view addSubview:HUD];

	HUD.dimBackground = YES;

	// Regiser for HUD callbacks so we can remove it from the window at the right time
    HUD.delegate = self;

    // Show the HUD while the provided method executes in a new thread
    [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
}

#pragma mark -
#pragma mark Execution code

- (void)myTask {
    // Do something usefull in here instead of sleeping ...
    sleep(3);
	HUD.detailsLabelText = @"change";
	sleep(3);
}

- (void)myProgressTask {
    // This just increases the progress indicator in a loop
    float progress = 0.0f;
    while (progress < 1.0f) {
        progress += 0.01f;
        HUD.progress = progress;
		HUD.detailsLabelText = [@"" stringByAppendingFormat:@"%f",progress];
        usleep(50000);
    }
}

- (void)myMixedTask {
    // Indeterminate mode
    sleep(2);
    // Switch to determinate mode
    HUD.mode = MBProgressHUDModeDeterminate;
    HUD.labelText = @"Progress";
    float progress = 0.0f;
    while (progress < 1.0f)
    {
        progress += 0.01f;
        HUD.progress = progress;
        usleep(50000);
    }
    // Back to indeterminate mode
    HUD.mode = MBProgressHUDModeIndeterminate;
    HUD.labelText = @"Cleaning up";
    sleep(2);
	// The sample image is based on the work by www.pixelpressicons.com, http://creativecommons.org/licenses/by/2.5/ca/
	// Make the customViews 37 by 37 pixels for best results (those are the bounds of the build-in progress indicators)
	HUD.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"37x-Checkmark.png"]] autorelease];
	HUD.mode = MBProgressHUDModeCustomView;
	HUD.labelText = @"Completed";
	sleep(2);
}

#pragma mark -
#pragma mark NSURLConnectionDelegete

- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
	expectedLength = [response expectedContentLength];
	currentLength = 0;
	HUD.mode = MBProgressHUDModeDeterminate;
}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
	currentLength += [data length];
	HUD.progress = currentLength / (float)expectedLength;
}

- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
	HUD.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"37x-Checkmark.png"]] autorelease];
    HUD.mode = MBProgressHUDModeCustomView;
	[HUD hide:YES afterDelay:2];
}

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
	[HUD hide:YES];
}

#pragma mark -
#pragma mark MBProgressHUDDelegate methods

- (void)hudWasHidden:(MBProgressHUD *)hud {
    // Remove HUD from screen when the HUD was hidded
    [HUD removeFromSuperview];
    [HUD release];
	HUD = nil;
}

@end


text:
Jsm is a tool for simple code management, unlike npm or bower, it's designed to be very lightweight. see [doc](/doc/en), [文档](/doc/cn) and [API](/doc/api).

The source code is on github: [jsm-client](https://github.com/winterland1989/jsm-client.git), [server](https://github.com/winterland1989/jsmServer.git), got a minute?:

```bash
# install jsm using npm
npm install -g https://github.com/winterland1989/jsm-client.git

# edit some script, require snippet you wanna use
# for example: _ = require('./jsm/base/lodash3')
vim index.js

# use jsm download snippet for index.js file, and start a testing server.
jsm install index.js
jsm server index.js

```