text:
<include file="Public/header" />

		<if condition="$item['item_type'] eq 2">

基本资料

2项目详情

		<else/>

基本资料

2股权设置

3项目详情

		</if>

发起项目

			* 项目类别

				<select name="item_type" class="input input-auto box-shadow-none radius-none">
					<option value="1" <if condition="$item['item_type'] eq 1">selected</if>>股权项目</option>
					<option value="2" <if condition="$item['item_type'] eq 2">selected</if>>产品项目</option>
				</select>

			* 行业类别

				<select name="cid[]" class="input input-auto box-shadow-none radius-none"  id="first" onchange="loadRegion('first',2,'second','__MODULE__/Item/get_category');">
					<option value="" >选择栏目</option>
					<volist name="cate" id="vo">
						<option value="{$vo.id}" <if condition="$vo['id'] eq $nowcate[0]['id']">selected</if>  >{$vo.name}</option>
					</volist>
				</select>
				<select name="cid[]" class="input input-auto box-shadow-none radius-none" id="second"  onchange="loadRegion('second',3,'third','__MODULE__/Item/get_category');">
					<if condition="$nowcate[1]['id']">
						<option value="{$nowcate[1]['id']}">{$nowcate[1]['name']}</option>
						<else />
						<option value="0">无</option>
					</if>
				</select>

			* 所在地区

				<select name="province" class="input input-auto box-shadow-none radius-none"  id="province" onchange="loadRegion('province',2,'city','__MODULE__/Item/get_region');">
					<option value="" >选择省份</option>
					<volist name="province" id="vo">
						<option value="{$vo.id}" <if condition="$vo['id'] eq $item['province']">selected</if>  >{$vo.name}</option>
					</volist>
				</select>
				<select name="city" class="input input-auto box-shadow-none radius-none" id="city"  onchange="loadRegion('city',3,'third','__MODULE__/Item/get_region');">
					<if condition="$item['city']">
							<volist name="nowcity" id="vo">
								<option value="{$vo['id']}" <if condition="$vo['id'] eq $item['city']">selected</if>>{$vo['name']}</option>
							</volist>
						<else />
						<option value="0">选择城市</option>
					</if>
				</select>

			* 标签

						<volist name="tags" id="vo">
							<label class="button radius-none margin-small <if condition="in_array($vo['id'],$tagsid)">active</if>" onclick="choosetags(this)">
								<input name="tags[]" value="{$vo.id}" <if condition="in_array($vo['id'],$tagsid)">checked="checked"</if> type="checkbox" /> {$vo.name}

						</volist>

			* 项目名称

				<input type="text" name="name" value="{$item.name}" class="input box-shadow-none radius-none" />

			* 项目权重

				<select name="weight" class="input input-auto box-shadow-none radius-none">
					<option value="1" <if condition="$item['weight'] eq 1">selected</if>>1</option>
					<option value="2" <if condition="$item['weight'] eq 2">selected</if>>2</option>
					<option value="3" <if condition="$item['weight'] eq 3">selected</if>>3</option>
					<option value="4" <if condition="$item['weight'] eq 4">selected</if>>4</option>
					<option value="5" <if condition="$item['weight'] eq 5">selected</if>>5</option>
				</select>

			* 用户UIN

				<input type="text" name="uin" value="{$item.uin}" class="input input-auto box-shadow-none radius-none" />
				<button class="button bg-sub radius-none" type="button" onclick="getuser()">获取用户列表</button>

帮用户发布项目请填写用户的UIN,平台方自己发布可以普通用户的方式注册一个账号获得UIN

			* 项目简介

				<textarea name="desc"  class="input box-shadow-none radius-none" >{$item.desc}</textarea>

			*  筹资金额

				<input type="text" name="raising_money" value="{$item.raising_money}" placeholder="如:100000" class="text-small input input-auto box-shadow-none radius-none" size="20" /> 元

			*  佣金比例

				<input type="text" name="brokerage" value="{$item.brokerage}" placeholder="如:5" class="text-small input input-auto box-shadow-none radius-none" size="20" /> %

 佣金比例为0的话,按系统的佣金比例0.1来算,不是0的话按这里的佣金比例来算

			*  筹资开始时间

				<input type="text" name="start_time" placeholder="请选择" value="<if condition="$item['start_time']">{:date('Y-m-d H:i:s',$item['start_time'])}</if>"  onclick="laydate({istime: true, min: laydate.now(), format: 'YYYY-MM-DD hh:mm:ss'})" class="text-small input input-auto box-shadow-none radius-none" size="20" />

			*  筹资结束时间

				<input type="text" name="end_time" placeholder="请选择" value="<if condition="$item['end_time']">{:date('Y-m-d H:i:s',$item['end_time'])}</if>"  onclick="laydate({istime: true, min: laydate.now(), format: 'YYYY-MM-DD hh:mm:ss'})" class="text-small input input-auto box-shadow-none radius-none" size="20" />

			下一步


text:
@class NSString;

@interface WCSnsDelayShowInfo : MMObject <PBCoding>
{
    _Bool needDelayInViewLifeCycle;
    unsigned int respTimeStamp;
    unsigned int delayInterval;
    unsigned int showTimeStamp;
    NSString *layerId;
    NSString *expId;
}

+ (void)initialize;
@property(nonatomic) _Bool needDelayInViewLifeCycle; // @synthesize needDelayInViewLifeCycle;
@property(nonatomic) unsigned int showTimeStamp; // @synthesize showTimeStamp;
@property(nonatomic) unsigned int delayInterval; // @synthesize delayInterval;
@property(nonatomic) unsigned int respTimeStamp; // @synthesize respTimeStamp;
@property(retain, nonatomic) NSString *expId; // @synthesize expId;
@property(retain, nonatomic) NSString *layerId; // @synthesize layerId;
- (void).cxx_destruct;
- (_Bool)parseDelayShowInfo:(id)arg1;
- (id)init;
- (const map_0e718273 *)getValueTagIndexMap;
- (id)getValueTypeTable;

// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;

@end

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Admingenerator\GeneratorBundle\Twig\Extension;

use Symfony\Component\Form\Extension\Core\DataTransformer\MoneyToLocalizedStringTransformer;

/**
 * @author Piotr Gołębiewski <loostro@gmail.com>
 */
class LocalizedMoneyExtension extends \Twig_Extension
{
    public function getFunctions()
    {
        return array(
            'localized_money' => new \Twig_SimpleFunction('localized_money', array($this, 'getLocalizedMoney')),
            'currency_sign'   => new \Twig_SimpleFunction('currency_sign', array($this, 'getCurrencySign')),
        );
    }

    /**
     * @param float $value Money amount.
     *
     * @param string $currency This can be any 3 letter ISO 4217 code. You
     * can also set this to false to hide the currency symbol.
     *
     * @param integer $precision For some reason, if you need some precision
     * other than 2 decimal places, you can modify this value. You probably
     * won't need to do this unless, for example, you want to round to the
     * nearest dollar (set the precision to 0).
     *
     * @param string $grouping This value is used internally as the
     * NumberFormatter::GROUPING_USED value when using PHP's NumberFormatter
     * class. Its documentation is non-existent, but it appears that if you set
     * this to true, numbers will be grouped with a comma or period (depending
     * on your locale): 12345.123 would display as 12,345.123.
     *
     * @param integer $divisor If, for some reason, you need to divide your
     * starting value by a number before rendering it to the user, you can use
     * the divisor option.
     *
     * @return string Localized money
     */
    public function getLocalizedMoney($value, $currency = 'EUR', $precision = 2, $grouping = true, $divisor = 1)
    {
        $locale = \Locale::getDefault();

        $format = new \NumberFormatter($locale, \NumberFormatter::CURRENCY);
        $pattern = $format->formatCurrency('123', $currency);

        $dt = new MoneyToLocalizedStringTransformer($precision, $grouping, null, $divisor);
        $transformed_value = $dt->transform($value);

        preg_match('/^([^\s\xc2\xa0]*)[\s\xc2\xa0]*123(?:[,.]0+)?[\s\xc2\xa0]*([^\s\xc2\xa0]*)$/u', $pattern, $matches);

        if (!empty($matches[1])) {
            $localized_money = $matches[1].' '.$transformed_value;
        } elseif (!empty($matches[2])) {
            $localized_money = $transformed_value.' '.$matches[2];
        } else {
            $localized_money = $transformed_value;
        }

        return $localized_money;
    }

    /**
     * @param string $currency This can be any 3 letter ISO 4217 code. You
     * can also set this to false to return the general currency symbol.
     *
     * @return string Currency sign
     */
    public function getCurrencySign($currency = false)
    {
        $locale = \Locale::getDefault();

        $format = new \NumberFormatter($locale, \NumberFormatter::CURRENCY);
        $pattern = $format->formatCurrency('123', $currency);

        preg_match('/^([^\s\xc2\xa0]*)[\s\xc2\xa0]*123(?:[,.]0+)?[\s\xc2\xa0]*([^\s\xc2\xa0]*)$/u', $pattern, $matches);

        if (!empty($matches[1])) {
            $currency_sign = $matches[1];
        } elseif (!empty($matches[2])) {
            $currency_sign = $matches[2];
        } else {
            $currency_sign = '¤';
        }

        return $currency_sign;
    }

    /**
     * Returns the name of the extension.
     *
     * @return string The extension name
     */
    public function getName()
    {
        return 'localized_money';
    }
}


text:
require 'csv'

class PetitionsController < ApplicationController
  before_action :redirect_to_valid_state, only: [:index]
  before_action :do_not_cache, except: [:index, :show]
  before_action :set_cors_headers, only: [:index, :show, :count], if: :json_request?

  before_action :redirect_to_home_page_if_dissolved, only: [:new, :check, :check_results, :create]
  before_action :redirect_to_home_page_unless_opened, only: [:index, :new, :check, :check_results, :create]
  before_action :redirect_to_archived_petition_if_archived, only: [:show]

  before_action :retrieve_petitions, only: [:index]
  before_action :retrieve_petition, only: [:show, :count, :gathering_support, :moderation_info]
  before_action :build_petition_creator, only: [:check, :check_results, :new, :create]

  before_action :redirect_to_stopped_page, if: :stopped?, only: [:moderation_info, :show]
  before_action :redirect_to_gathering_support_url, if: :collecting_sponsors?, only: [:moderation_info, :show]
  before_action :redirect_to_moderation_info_url, if: :in_moderation?, only: [:gathering_support, :show]
  before_action :redirect_to_petition_url, if: :moderated?, only: [:gathering_support, :moderation_info]

  after_action :set_content_disposition, if: :csv_request?, only: [:index]

  def index
    respond_to do |format|
      format.html
      format.json
      format.csv
    end
  end

  def show
    respond_to do |format|
      format.html
      format.json
    end
  end

  def count
    respond_to do |format|
      format.json
    end
  end

  def check
    respond_to do |format|
      format.html
    end
  end

  def check_results
    respond_to do |format|
      format.html
    end
  end

  def new
    respond_to do |format|
      format.html
    end
  end

  def create
    if @new_petition.save
      redirect_to thank_you_petition_url(@new_petition)
    else
      respond_to do |format|
        format.html { render :new }
      end
    end
  end

  def gathering_support
    respond_to do |format|
      format.html
    end
  end

  def moderation_info
    respond_to do |format|
      format.html
    end
  end

  def thank_you
    respond_to do |format|
      format.html
    end
  end

  protected

  def petition_id
    params[:id].to_i
  end

  def redirect_to_home_page_if_dissolved
    redirect_to home_url if Parliament.dissolved?
  end

  def redirect_to_home_page_unless_opened
    redirect_to home_url unless Parliament.opened?
  end

  def request_format
    request.format.json? ? :json : nil
  end

  def redirect_to_archived_petition_if_archived
    if petition = Archived::Petition.find_by(id: petition_id)
      redirect_to archived_petition_url(petition_id, format: request_format) if petition.parliament.archived?
    end
  end

  def retrieve_petitions
    @petitions = Petition.visible.search(params)
  end

  def retrieve_petition
    @petition = Petition.show.find(petition_id)
  end

  def build_petition_creator
    @new_petition = PetitionCreator.new(params, request)
  end

  def redirect_to_valid_state
    if state_present? && !valid_state?
      redirect_to petitions_url(search_params(state: :all))
    end
  end

  def state_present?
    params[:state].present?
  end

  def valid_state?
    public_petition_facets.include?(params[:state].to_sym)
  end

  def search_params(overrides = {})
    params.permit(:page, :q, :state).merge(overrides)
  end

  def collecting_sponsors?
    @petition.collecting_sponsors?
  end

  def redirect_to_gathering_support_url
    redirect_to gathering_support_petition_url(@petition)
  end

  def in_moderation?
    @petition.in_moderation?
  end

  def redirect_to_moderation_info_url
    redirect_to moderation_info_petition_url(@petition)
  end

  def moderated?
    @petition.moderated?
  end

  def stopped?
    @petition.stopped?
  end

  def redirect_to_stopped_page
    redirect_to home_url
  end

  def redirect_to_petition_url
    redirect_to petition_url(@petition)
  end

  def csv_filename
    "#{@petitions.scope}-petitions.csv"
  end

  def set_content_disposition
    response.headers['Content-Disposition'] = "attachment; filename=#{csv_filename}"
  end
end


text:
int i;          // expected-note 3 {{previous declaration is here}}

void foo() {
  int pass1;
  int i;        // expected-warning {{declaration shadows a variable in the global scope}} \
                // expected-note {{previous declaration is here}}
  {
    int pass2;
    int i;      // expected-warning {{declaration shadows a local variable}} \
                // expected-note {{previous declaration is here}}
    {
      int pass3;
      int i;    // expected-warning {{declaration shadows a local variable}}
    }
  }

  int sin; // okay; 'sin' has not been declared, even though it's a builtin.
}

// <rdar://problem/7677531>
void (^test1)(int) = ^(int i) { // expected-warning {{declaration shadows a variable in the global scope}} \
                                 // expected-note{{previous declaration is here}}
  {
    int i; // expected-warning {{declaration shadows a local variable}} \
           // expected-note{{previous declaration is here}}

    (^(int i) { return i; })(i); //expected-warning {{declaration shadows a local variable}}
  }
};

struct test2 {
  int i;
};

void test3(void) {
  struct test4 {
    int i;
  };
}

void test4(int i) { // expected-warning {{declaration shadows a variable in the global scope}}
}

// Don't warn about shadowing for function declarations.
void test5(int i);
void test6(void (*f)(int i)) {}
void test7(void *context, void (*callback)(void *context)) {}

extern int bob; // expected-note {{previous declaration is here}}

// rdar://8883302
void rdar8883302() {
  extern int bob; // don't warn for shadowing.
}

void test8() {
  int bob; // expected-warning {{declaration shadows a variable in the global scope}}
}


text:
/*
 Problem 5. Appearance count
 Write a function that counts how many times given number appears in given array.
 Write a test function to check if the function is working correctly.
*/

var numArray = [6, 7, 14, 5, 6, 10, 2, 6, 5];

function countOccurrences(value) {
    var count = 0;
    for (var i in numArray) {
        if (numArray[i] === value) count += 1;
    }
    return count;
}

console.log(countOccurrences(6));


text:
require 'bootstrap-sass/engine'

module SpreeFrontendBootstrap
  class Engine < Rails::Engine
    require 'spree/core'
    isolate_namespace Spree
    engine_name 'spree_frontend_bootstrap'

    config.autoload_paths += %W(#{config.root}/lib)

    def self.activate
      Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
        Rails.configuration.cache_classes ? require(c) : load(c)
      end
    end

    config.to_prepare &method(:activate).to_proc
  end
end


text:
#ifndef _S390_CACHEFLUSH_H
#define _S390_CACHEFLUSH_H

/* Keep includes the same across arches.  */
#include <linux/mm.h>

/* Caches aren't brain-dead on the s390. */
#define flush_cache_all()			do { } while (0)
#define flush_cache_mm(mm)			do { } while (0)
#define flush_cache_dup_mm(mm)			do { } while (0)
#define flush_cache_range(vma, start, end)	do { } while (0)
#define flush_cache_page(vma, vmaddr, pfn)	do { } while (0)
#define flush_dcache_page(page)			do { } while (0)
#define flush_dcache_mmap_lock(mapping)		do { } while (0)
#define flush_dcache_mmap_unlock(mapping)	do { } while (0)
#define flush_icache_range(start, end)		do { } while (0)
#define flush_icache_page(vma,pg)		do { } while (0)
#define flush_icache_user_range(vma,pg,adr,len)	do { } while (0)
#define flush_cache_vmap(start, end)		do { } while (0)
#define flush_cache_vunmap(start, end)		do { } while (0)

#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
	memcpy(dst, src, len)
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
	memcpy(dst, src, len)

#ifdef CONFIG_DEBUG_PAGEALLOC
void kernel_map_pages(struct page *page, int numpages, int enable);
#endif

#endif /* _S390_CACHEFLUSH_H */


text:
package com.bishal.android.taskmanager;

import java.io.IOException;
import java.util.List;

import android.content.Intent;
import android.location.Address;
import android.location.Geocoder;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.google.android.maps.GeoPoint;

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.MyLocationOverlay;
import com.google.android.maps.Overlay;
import com.bishal.android.taskmanager.views.AddressOverlay;

public class AddLocationMapActivity extends MapActivity {

	public static final String ADDRESS_RESULT = "address";

	private Button mapLocationButton;
	private Button useLocationButton;
	private EditText addressText;
	private MapView mapView;
	private Address address;
	private MyLocationOverlay myLocationOverlay;

	public /*static*/ GeoPoint gp;

	@Override
	protected void onCreate(Bundle bundle) {
		super.onCreate(bundle);
		setContentView(R.layout.add_location);
		setUpViews();
	}

	@Override
	protected void onResume() {
		super.onResume();
		myLocationOverlay.enableMyLocation();
	}

	@Override
	protected void onPause() {
		super.onPause();
		myLocationOverlay.disableMyLocation();
	}

	protected void mapCurrentAddress() {
		String addressString = addressText.getText().toString();
		Geocoder g = new Geocoder(this);
		List<Address> addresses;
		try {
			addresses = g.getFromLocationName(addressString, 1);
			if (addresses.size() > 0) {
				address = addresses.get(0);
				List<Overlay> mapOverlays = mapView.getOverlays();
				AddressOverlay addressOverlay = new AddressOverlay(address);
				mapOverlays.add(myLocationOverlay);
				mapOverlays.add(addressOverlay);
				mapView.invalidate();
				final MapController mapController = mapView.getController();
				gp=addressOverlay.getGeopoint();
				mapController.animateTo(gp, new Runnable() {
					public void run() {
						mapController.setZoom(12);
					}
				});
				useLocationButton.setEnabled(true);
			} else {
				// show the user a note that we failed to get an address
			}
		} catch (IOException e) {
			// show the user a note that we failed to get an address
			e.printStackTrace();
		}
	}

	private void setUpViews() {
		addressText = (EditText)findViewById(R.id.task_address);
		mapLocationButton = (Button)findViewById(R.id.map_location_button);
		useLocationButton = (Button)findViewById(R.id.use_this_location_button);
		useLocationButton.setEnabled(false);
		mapView = (MapView)findViewById(R.id.map);
		mapView.setBuiltInZoomControls(true);
		myLocationOverlay = new MyLocationOverlay(this, mapView);
		mapView.getOverlays().add(myLocationOverlay);
		mapView.invalidate();

		useLocationButton.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				if (null != address) {
					Intent intent = new Intent();
					intent.putExtra(ADDRESS_RESULT, address);
					setResult(RESULT_OK, intent);
				}

				finish();
			}
		});
		mapLocationButton.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				mapCurrentAddress();
			}
		});
	}

	@Override
	protected boolean isLocationDisplayed() {
		return true;
	}

	@Override
	protected boolean isRouteDisplayed() {
		return false;
	}

}


text:
BOOST_AUTO_TEST_SUITE(TestFindSingleItem)

BOOST_AUTO_TEST_CASE(vector_empty)
{
    FindSingleItem::Solution solution;
    BOOST_CHECK(-1 == solution.singleNumberHash(std::vector<int>()));
    BOOST_CHECK(0 == solution.singleNumberMath(std::vector<int>()));
    BOOST_CHECK(0 == solution.singleNumberBitManipulation(std::vector<int>()));
}

BOOST_AUTO_TEST_CASE(one_elem)
{
    FindSingleItem::Solution solution;
    BOOST_CHECK(1 == solution.singleNumberHash({1}));
    BOOST_CHECK(1 == solution.singleNumberMath({1}));
    BOOST_CHECK(1 == solution.singleNumberBitManipulation({1}));
}

BOOST_AUTO_TEST_CASE(two_elements)
{
    FindSingleItem::Solution solution;
    BOOST_CHECK(-1 == solution.singleNumberHash({1, 1}));
    BOOST_CHECK(0 == solution.singleNumberMath({1, 1}));
    BOOST_CHECK(0 == solution.singleNumberBitManipulation({1, 1}));
}

BOOST_AUTO_TEST_CASE(several_elements)
{
    FindSingleItem::Solution solution;
    BOOST_CHECK(3 == solution.singleNumberHash({1, 2, 2, 3, 1, 4, 4}));
    BOOST_CHECK(3 == solution.singleNumberMath({1, 2, 2, 3, 1, 4, 4}));
    BOOST_CHECK(3 == solution.singleNumberBitManipulation({1, 2, 2, 3, 1, 4, 4}));
}

BOOST_AUTO_TEST_SUITE_END()


text:
export const deleteProps = {
  method: 'delete',
  headers: { 'content-type': 'Application/Json' },
  credentials: 'include'
};

export default {
  deleteProps
};

export const yamlAlertProps = `name: alert_name
metric: metric_name
dataset: dataset_name
pipelineType: Composite
dimensionExploration:
  dimensions:
    - continent
    - browserName
  minContribution: 0.05
filters:
  continent:
     - Europe
     - Asia
  os_name:
     - android
  browserName:
     - chrome
     - safari

anomalyDetection:
- detection:
    - type: BASELINE
      change: 0.5
  filter:
    - type: BUSINESS_RULE_FILTER
      siteWideImpactThreshold: 0.2

- detection:
    - type: THRESHOLD
  filter:
    - type: THRESHOLD_RULE_FILTER`;


text:
This page was generated with Wiki Builder. Do not change the format!

## Abyssal Lamp
### Info
* **enemyId:** R1S2RaidMoon0LanternDisplayName
* **enemyName:** ###R1S2RaidMoon0LanternDisplayName###
* **raceName:** Hive
* **activityType:** Raid
* **activity:** RaidMoon0
* **destination:** Moon
* **location:** TheStills

### Overrides
key | value
--- | -----
enemyName | Abyssal Lamp

### Stats
statType | statId
-------- | ------
assistsAgainst | assistsAgainstR1S2RaidMoon0LanternDisplayName
precisionKillsOf | precisionKillOfR1S2RaidMoon0LanternDisplayName
deathsFrom | deathsFromR1S2RaidMoon0LanternDisplayName
killsOf | killsOfR1S2RaidMoon0LanternDisplayName


text:
all:
	if [ ! -d "out" ]; then mkdir out; fi
	if [ ! -d "out/libxos" ]; then mkdir out/libxos; fi
	if [ ! -d "out/circus" ]; then mkdir out/circus; fi
	dd if=/dev/zero bs=512 count=71568 of=disk.hdd
	fasm kernel/boot/mbr.asm out/mbr.bin
	fasm kernel/boot/boot_hdd.asm out/boot_hdd.bin
	fasm kernel/kernel.asm out/kernel32.sys
	fasm tmp/rootnew.asm out/rootnew.bin
	fasm tmp/drivers.asm out/drivers.bin
	fasm tmp/netio.asm out/netio.bin
	fasm tmp/fsusage.asm out/fsusage.bin
	fasm calc/calc.asm out/calc.exe
	fasm shell/shell.asm out/shell.exe
	fasm 2048/2048.asm out/2048.exe
	fasm monitor/monitor.asm out/monitor.exe
	fasm rtl8139/rtl8139.asm out/rtl8139.sys
	fasm fasm/source/xos/fasm.asm out/fasm.exe
	fasm i8254x/i8254x.asm out/i8254x.sys

	fasm libxos/src/interface.asm out/libxos/interface.o
	gcc -c -Ilibxos/include -m32 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone libxos/src/init.c -o out/libxos/init.o
	gcc -c -Ilibxos/include -m32 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone libxos/src/window.c -o out/libxos/window.o
	gcc -c -Ilibxos/include -m32 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone libxos/src/event.c -o out/libxos/event.o
	gcc -c -Ilibxos/include -m32 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone libxos/src/string.c -o out/libxos/string.o
	gcc -c -Ilibxos/include -m32 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone libxos/src/label.c -o out/libxos/label.o
	gcc -c -Ilibxos/include -m32 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone libxos/src/button.c -o out/libxos/button.o
	gcc -c -Ilibxos/include -m32 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone libxos/src/vscroll.c -o out/libxos/vscroll.o
	gcc -c -Ilibxos/include -m32 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone libxos/src/canvas.c -o out/libxos/canvas.o

	gcc -c -Ilibxos/include -m32 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone helloc/helloc.c -o out/helloc.o
	gcc -m32 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone -T libxos/link.ld out/libxos/*.o out/helloc.o -o out/helloc.exe

	gcc -c -Ilibxos/include -m32 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone circus/main.c -o out/circus/main.o
	gcc -c -Ilibxos/include -m32 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone circus/load.c -o out/circus/load.o
	gcc -c -Ilibxos/include -m32 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone circus/parse.c -o out/circus/parse.o
	gcc -c -Ilibxos/include -m32 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone circus/render.c -o out/circus/render.o
	gcc -c -Ilibxos/include -m32 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone circus/link.c -o out/circus/link.o
	gcc -c -Ilibxos/include -m32 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone circus/http_chunk.c -o out/circus/http_chunk.o
	gcc -m32 -nostdlib -nostartfiles -nodefaultlibs -fomit-frame-pointer -mno-red-zone -T libxos/link.ld out/libxos/*.o out/circus/*.o -o out/circus.exe

	dd if=out/mbr.bin conv=notrunc bs=512 count=1 of=disk.hdd
	dd if=out/boot_hdd.bin conv=notrunc bs=512 seek=63 of=disk.hdd
	dd if=out/rootnew.bin conv=notrunc bs=512 seek=64 of=disk.hdd
	dd if=out/fsusage.bin conv=notrunc bs=512 seek=52563 of=disk.hdd
	dd if=out/drivers.bin conv=notrunc bs=512 seek=1300 of=disk.hdd
	dd if=out/netio.bin conv=notrunc bs=512 seek=1301 of=disk.hdd
	dd if=out/kernel32.sys conv=notrunc bs=512 seek=200 of=disk.hdd
	dd if=out/calc.exe conv=notrunc bs=512 seek=1062 of=disk.hdd
	dd if=out/shell.exe conv=notrunc bs=512 seek=1000 of=disk.hdd
	dd if=wp/wp5.bmp conv=notrunc bs=512 seek=8000 of=disk.hdd
	dd if=shell/shell.cfg conv=notrunc bs=512 seek=1020 of=disk.hdd
	dd if=out/2048.exe conv=notrunc bs=512 seek=1200 of=disk.hdd
	dd if=out/monitor.exe conv=notrunc bs=512 seek=1221 of=disk.hdd
	dd if=out/rtl8139.sys conv=notrunc bs=512 seek=1302 of=disk.hdd
	dd if=out/fasm.exe conv=notrunc bs=512 seek=1400 of=disk.hdd
	dd if=out/i8254x.sys conv=notrunc bs=512 seek=1311 of=disk.hdd
	dd if=out/helloc.exe conv=notrunc bs=512 seek=1801 of=disk.hdd
	dd if=kernel/fonts/alotware.bin conv=notrunc bs=512 seek=1830 of=disk.hdd
	dd if=out/circus.exe conv=notrunc bs=512 seek=1840 of=disk.hdd
	dd if=circus/test.html conv=notrunc bs=512 seek=2000 of=disk.hdd
	dd if=circus/test2.html conv=notrunc bs=512 seek=2004 of=disk.hdd

run:
	qemu-system-i386 -drive file=disk.hdd,format=raw -m 128 -vga std -serial stdio -usbdevice mouse -net nic,model=e1000 -net user -net dump,file=qemudump.pcap

runsata:
	qemu-system-i386 -m 128 -vga std -serial stdio -device ahci,id=ahci -drive if=none,file=disk.hdd,id=xosdrive,format=raw -device ide-drive,drive=xosdrive,bus=ahci.0 -usbdevice mouse -net nic,model=e1000 -net user -net dump,file=qemudump.pcap

runusb:
	qemu-system-i386 -m 128 -vga std -serial stdio -usbdevice disk:disk.hdd -usbdevice mouse -net nic,model=e1000 -net user -net dump,file=qemudump.pcap

runohci:
	qemu-system-i386 -m 128 -vga std -serial stdio -hda disk.hdd -device pci-ohci,id=usbohci -device usb-mouse,bus=usbohci.0 -device usb-kbd,bus=usbohci.0 -net nic,model=e1000 -net user -net dump,file=qemudump.pcap

runehci:
	qemu-system-i386 -m 128 -vga std -serial stdio -hda disk.hdd -device usb-ehci,id=usbehci -device usb-mouse,bus=usbehci.0 -device usb-kbd,bus=usbehci.0 -net nic,model=e1000 -net user -net dump,file=qemudump.pcap

clean:
	if [ -d "out/libxos" ]; then rm out/libxos/*; rmdir out/libxos; fi
	if [ -d "out/circus" ]; then rm out/circus/*; rmdir out/circus; fi
	if [ -d "out" ]; then rm out/*; rmdir out; fi


text:
\documentclass[a4paper, 11pt]{article}
\usepackage [utf8] {inputenc}
% Russian and english word-wrap
\usepackage[english,russian]{babel}
% Start new lines with a shift from the left
\usepackage{indentfirst}
% Choosing of internal TEX-encoding
\usepackage[T2A]{fontenc}

\usepackage{cmap}
\usepackage{xcolor}
\usepackage{longtable}

\usepackage{hyperref}
\definecolor{LINKCOLOUR}{rgb}{0.1,0.0,0.9}
\hypersetup{colorlinks,breaklinks,urlcolor=LINKCOLOUR,linkcolor=LINKCOLOUR}

\usepackage{geometry} % Page margins
\geometry{left=2.5cm}
\geometry{right=2cm}
\geometry{top=2cm}
\geometry{bottom=2cm}

\usepackage{titlesec} % Used to customize the \section command
\titleformat{\section}{\Large\raggedright}{\color{green}}{0em}{}[\titlerule] % Text formatting of sections
\titlespacing{\section}{2pt}{3pt}{3pt} % Spacing around sections

\pagestyle{empty}

\begin{document}

{\LARGE\textbf{Sergey Nikitin}}

\begin{flushright}
    {\itshape
        Russian Federation, Moscow, Polarnaya st., 12, apt. 25                                  \\
        +7-968-708-71-71                                                                        \\
        \href{mailto:snikitin@outlook.com}{snikitin@outlook.com}                                \\
        \href{https://github.com/SergNikitin}{github.com/SergNikitin}                           \\
        \href{http://ru.linkedin.com/in/nikitinsergey}{ru.linkedin.com/in/nikitinsergey}        \\
        \href{http://stackoverflow.com/users/3375765/sergey-nikitin}{stackoverflow.com profile} \\
    }
\end{flushright}

\section{Skills}
\begin{tabular}{ll}
    Programming languages    & C++ (C++14), C (C99), Lua (5.1, 5.2)            \\
    Development for OS       & Mainly Windows, some Linux experience           \\
    Programming software     & VS2015, GNU-Make, CMake, Doxygen, LaTeX, Matlab \\
    VCS                      & Git, Subversion                                 \\
    3D-modelling             & Autodesk Inventor
\end{tabular}

\section{Experience}
\begin{longtable}{p{25mm}|p{110mm}}
    November 2014 -     & \textbf{BitBox Ltd.}                                                        \\
    Current             & C/C++ game developer - \href{http://lifeisfeudal.com/mmo}{Life Is Feudal}   \\
                        &
    \begin{itemize}
        \item   Developed from scratch module for dynamic geometry generation
                of in-game tunnels/mines (based on
                \href{https://ru.wikipedia.org/wiki/Marching_cubes}{marching cubes}
                algorithm) - a good algorithmical and architectural task
        \item   Redone system for multi-threaded loading/unloading of game
                objects (based on the distance from the player to the object)
        \item   Integrated Unicode support (based on the \href{http://site.icu-project.org/}{ICU}
                library) into the game engine (including support in internal
                string-related classes and functions) and added localization
                support
        \item   Implemented a variety of gameplay mechanics
        \item   Constantly transition the code base from obsolete C++ techniques
                to more convenient and safe ones (move-semantics, strict resource
                ownership with smart-pointers etc.)
        \item   A lot of reviewing of code of other team members
    \end{itemize}                                                                   \\

    \pagebreak[4]
    April 2013 -        & \textbf{\href{http://www.3detection.ru/}{3Detection Lab.}}\\
    November 2014       & Junior C/C++ developer                                    \\
                        &
    \begin{itemize}
        \item   Participated in development of automatic control systems for
                household telepresence robots of R.BOT Synergy family - an
                interesting opportunity to use all of the fundamental knowledge
                gained during the years in the university
        \item   Developed a set of tools for testing and calibration of
                R.BOT Synergy robots - interacted a lot with
                software users, gained some experience in user interface creation
        \item   Participated in development of a tool for x86 platform (Windows,
                Linux), written in C++, Lua 5.1 that is responsible for debugging
                and control of custom microprocessor systems
        \item   Evolved software for corporate ACS systems
    \end{itemize}                                                                   \\

    \pagebreak[3]
    July 2011 - & \textbf{\href{http://www.3detection.ru/}{3Detection Lab.}}        \\
    April 2013  & Technician                                                        \\
                &
    \begin{itemize}
        \item   Production of household robots
        \item   Testing, diagnostics and repairs of household robots
    \end{itemize}                                                                   \\
\end{longtable}

\section{Education}
\begin{tabular}{p{25mm}|p{110mm}}
2008 - 2014         & Bauman Moscow State Technical University»         \\
                    & «Mechanical Engineering» Department               \\
                    & «Robotics and Mechatronics» Specialty            \\
                    & URL: \href{http://www.bmstu.ru/en/}{bmstu.ru/en}  \\
                    & Degree: Specialist                                \\
                    & Average grade: 4,95/5                             \\
                    & Diploma with honors
\end{tabular}

\section{Scientific and fundamental knowledge}
\begin{itemize}
    \item Automated control systems
    \item Microprocessors
    \item Linear algebra, discrete mathematics
    \item Theoretical mechanics
\end{itemize}

\section{Language skills}
\begin{itemize}
    \item   Russian    - native language
    \item   English    - full professional proficiency, constantly practicing by
            reading books, watching movies, playing games in English
\end{itemize}

\section{Professional interests}
\begin{itemize}
    \item   Game development
    \item   Creation of modules/frameworks/tools that help me and others
            to write simpler, more expressive and safer code
    \item   Planning of software interfaces and software architecture
    \item   Pushing the boundaries of my knowledge through programming books
            and lectures (\href{http://cppcon.org/}{CppCon} etc.). Last finished book - «Modern
            Effective C++» by Scott Meyers. Currently reading «C++ Concurrency in
            Action» by Anthony Williams.
    \item   Rust programming language
    \item   3D-modelling
\end{itemize}

\section{Other interests}
\begin{itemize}
    \item   Reading -
            \href{https://www.goodreads.com/user/show/29629010-sergey-nikitin}{goodreads.com profile}
    \item   Rock band live shows - U2, Depeche Mode, Coldplay, Rammstein
    \item   Sports: rock climbing, swimming
\end{itemize}

\end{document}


text:
ZF2 Doctrine Skeleton
=======================

Introduction
------------
This is a simple, skeleton application using the ZF2 MVC layer and module
systems. This application is meant to be used as a starting place for those
looking to get their feet wet with ZF2. The Doctrine ORM Module has been added
and can easily be configured to use a SQLite database. Your project is set up
in just a few minutes!

Installation
------------

### Installation using Composer

The easiest way to create a new ZF2 project is to use [Composer](https://getcomposer.org/). If you don't have it already installed, then please install as per the [documentation](https://getcomposer.org/doc/00-intro.md).

Create your new ZF2 project:

    composer create-project -n -sdev driehle/zf2-doctrine-skeleton path/to/install

### Installation using a tarball with a local Composer

If you don't have composer installed globally then another way to create a new ZF2 project is to download the tarball and install it:

1. Download the [tarball](https://github.com/driehle/zf2-doctrine-skeleton/tarball/master), extract it and then install the dependencies with a locally installed Composer:

        cd my/project/dir
        curl -#L https://github.com/driehle/zf2-doctrine-skeleton/tarball/master | tar xz --strip-components=1

2. Use the composer.phar contained in the project to install the dependencies:

        php composer.phar self-update
        php composer.phar install

If you don't have access to curl, then install Composer into your project as per the [documentation](https://getcomposer.org/doc/00-intro.md).

Configuration
-------------

Before you start, you need to tell Doctrine which database to use. You can simply do so by
copying the file `config/autoload/doctrine.local.php.dist` to `config/autoload/doctrine.local.php`.
Open that file, you will see sample configurations for both MySQL and SQLite. Simply enable
one of them by commenting out the other one and you're ready to start.

Web server setup
----------------

### PHP CLI server

The simplest way to get started if you are using PHP 5.4 or above is to start the internal PHP cli-server in the root
directory:

    php -S 127.0.0.1:8080 -t public/ public/index.php

This will start the cli-server on port 8080, and bind it the loop-back address, so the server will be available
only from your machine. Simply point your browser to [http://localhost:8080](http://localhost:8080).

**Note:** The built-in CLI server is *for development only*.

### Vagrant server

This project supports a basic [Vagrant](http://docs.vagrantup.com/v2/getting-started/index.html) configuration with an inline shell provisioner to run the Skeleton Application in a [VirtualBox](https://www.virtualbox.org/wiki/Downloads).

1. Run vagrant up command

    vagrant up

2. Visit [http://localhost:8085](http://localhost:8085) in your browser

Look in [Vagrantfile](Vagrantfile) for configuration details.


text:
/* include your css here */

#title {
  display: block;
  text-align: center;
  margin: auto;
  font-family: "Merriweather", sans-serif;
  font-size: 25px;
}

#names {
  display: block;
  text-align: center;
  margin: auto;
  font-family: "Merriweather", sans-serif;
  font-size: 18px;
  font-weight: bold;
}

.content {
  display: block;
  text-align: left;
  margin: auto;
  font-family: "Merriweather", sans-serif;
  font-size: 15px;
}

#reflection h1 {
  display: block;
  text-align: center;
  margin: auto;
  font-family: "Merriweather", sans-serif;
  font-size: 18px;
}


text:
package test.dataprovider;

import java.util.Iterator;

import org.testng.Assert;

public class IterableTest {
  private boolean m_ok1 = false;
  private boolean m_ok2 = false;

  public static final String FN2 = "Anne Marie";
  public static final Integer LN2 = new Integer(37);
  public static final String FN1 = "Cedric";
  public static final Integer LN1 = new Integer(36);

  public static final Object[][] DATA =new Object[][] {
    new Object[] { FN1, LN1 },
    new Object[] { FN2, LN2 },
  };

  /**
   * @testng.data-provider name="test1"
   */
  public Iterator createData() {
    return new MyIterator(DATA);
  }

  /**
   * @testng.test dataProvider="test1"
   */
  public void verifyNames(String firstName, Integer age) {
    if (firstName.equals(FN1) && age.equals(LN1)) {
      m_ok1 = true;
      Assert.assertEquals(MyIterator.getCount(), 1);
    }
    if (firstName.equals(FN2) && age.equals(LN2)) {
      m_ok2 = true;
      Assert.assertEquals(MyIterator.getCount(), 2);
    }
  }

  /**
   * @testng.test dependsOnMethods = "verifyNames"
   */
  public void verifyCount() {
    Assert.assertTrue(m_ok1 && m_ok2);
  }

  private static void ppp(String s) {
    System.out.println("[IterableTest] " + s);
  }
}


text:
<?php

namespace Application\Migrations;

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

class Version20160511161342 extends AbstractMigration
{
    public function up(Schema $schema): void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');

        $this->addSql('CREATE TABLE event_logs (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(255) NOT NULL, action VARCHAR(255) NOT NULL, logged_at DATETIME NOT NULL, object_id VARCHAR(255) NOT NULL, object_class VARCHAR(255) NOT NULL, data LONGTEXT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
        $this->addSql('DROP TABLE ext_log_entries');

        $this->addSql('ALTER TABLE rota_reference_labs DROP FOREIGN KEY rota_reference_labs_ibfk_1');
        $this->addSql('ALTER TABLE rota_reference_labs ADD CONSTRAINT FK_BC5C4EE1CABE0DA FOREIGN KEY (caseFile_id) REFERENCES rotavirus_cases (id) ON DELETE CASCADE');
        $this->addSql('ALTER TABLE rota_national_labs DROP FOREIGN KEY rota_national_labs_ibfk_1');
        $this->addSql('ALTER TABLE rota_national_labs ADD CONSTRAINT FK_B30B5E78CABE0DA FOREIGN KEY (caseFile_id) REFERENCES rotavirus_cases (id) ON DELETE CASCADE');
        $this->addSql('ALTER TABLE rotavirus_site_labs DROP FOREIGN KEY rotavirus_site_labs_ibfk_1');
        $this->addSql('ALTER TABLE rotavirus_site_labs ADD CONSTRAINT FK_5215E955CABE0DA FOREIGN KEY (caseFile_id) REFERENCES rotavirus_cases (id) ON DELETE CASCADE');
        $this->addSql('ALTER TABLE ibd_reference_labs DROP FOREIGN KEY ibd_reference_labs_ibfk_1');
        $this->addSql('ALTER TABLE ibd_reference_labs ADD CONSTRAINT FK_C975A0E2CABE0DA FOREIGN KEY (caseFile_id) REFERENCES ibd_cases (id) ON DELETE CASCADE');
        $this->addSql('ALTER TABLE ibd_national_labs DROP FOREIGN KEY ibd_national_labs_ibfk_1');
        $this->addSql('ALTER TABLE ibd_national_labs ADD CONSTRAINT FK_F046C1BACABE0DA FOREIGN KEY (caseFile_id) REFERENCES ibd_cases (id) ON DELETE CASCADE');
        $this->addSql('ALTER TABLE ibd_site_labs DROP FOREIGN KEY ibd_site_labs_ibfk_1');
        $this->addSql('ALTER TABLE ibd_site_labs ADD CONSTRAINT FK_B09CEA98CABE0DA FOREIGN KEY (caseFile_id) REFERENCES ibd_cases (id) ON DELETE CASCADE');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');

        $this->addSql('CREATE TABLE ext_log_entries (id INT AUTO_INCREMENT NOT NULL, action VARCHAR(8) NOT NULL COLLATE utf8_unicode_ci, logged_at DATETIME NOT NULL, object_id VARCHAR(64) DEFAULT NULL COLLATE utf8_unicode_ci, object_class VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, version INT NOT NULL, data LONGTEXT DEFAULT NULL COLLATE utf8_unicode_ci COMMENT \'(DC2Type:array)\', username VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, INDEX log_class_lookup_idx (object_class), INDEX log_date_lookup_idx (logged_at), INDEX log_user_lookup_idx (username), INDEX log_version_lookup_idx (object_id, object_class, version), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
        $this->addSql('DROP TABLE event_logs');

        $this->addSql('ALTER TABLE rota_reference_labs DROP FOREIGN KEY rota_reference_labs_ibfk_1');
        $this->addSql('ALTER TABLE rota_reference_labs ADD CONSTRAINT FK_BC5C4EE1CABE0DA FOREIGN KEY (caseFile_id) REFERENCES rotavirus_cases (id)');
        $this->addSql('ALTER TABLE rota_national_labs DROP FOREIGN KEY rota_national_labs_ibfk_1');
        $this->addSql('ALTER TABLE rota_national_labs ADD CONSTRAINT FK_B30B5E78CABE0DA FOREIGN KEY (caseFile_id) REFERENCES rotavirus_cases (id)');
        $this->addSql('ALTER TABLE rotavirus_site_labs DROP FOREIGN KEY rotavirus_site_labs_ibfk_1');
        $this->addSql('ALTER TABLE rotavirus_site_labs ADD CONSTRAINT FK_5215E955CABE0DA FOREIGN KEY (caseFile_id) REFERENCES rotavirus_cases (id)');
        $this->addSql('ALTER TABLE ibd_reference_labs DROP FOREIGN KEY ibd_reference_labs_ibfk_1');
        $this->addSql('ALTER TABLE ibd_reference_labs ADD CONSTRAINT FK_C975A0E2CABE0DA FOREIGN KEY (caseFile_id) REFERENCES ibd_cases (id)');
        $this->addSql('ALTER TABLE ibd_national_labs DROP FOREIGN KEY ibd_national_labs_ibfk_1');
        $this->addSql('ALTER TABLE ibd_national_labs ADD CONSTRAINT FK_F046C1BACABE0DA FOREIGN KEY (caseFile_id) REFERENCES ibd_cases (id)');
        $this->addSql('ALTER TABLE ibd_site_labs DROP FOREIGN KEY ibd_site_labs_ibfk_1');
        $this->addSql('ALTER TABLE ibd_site_labs ADD CONSTRAINT FK_B09CEA98CABE0DA FOREIGN KEY (caseFile_id) REFERENCES ibd_cases (id)');
    }
}


text:
//Copyright 2012 Google Inc. All Rights Reserved.
//
//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.

package com.google.api.ads.adwords.awreporting.server.appengine.rest.cron;

import com.google.api.ads.adwords.awreporting.model.util.DateUtil;
import com.google.api.ads.adwords.awreporting.processors.ReportProcessor;
import com.google.api.ads.adwords.awreporting.server.appengine.RestServer;
import com.google.api.ads.adwords.awreporting.server.appengine.model.UserToken;
import com.google.api.ads.adwords.awreporting.server.appengine.processors.RefreshAccountsTask;
import com.google.api.ads.adwords.awreporting.server.appengine.processors.ReportProcessorAppEngine;
import com.google.api.ads.adwords.awreporting.server.rest.AbstractBaseResource;
import com.google.api.ads.adwords.lib.jaxb.v201502.ReportDefinitionDateRangeType;
import com.google.common.collect.Sets;

import org.restlet.representation.Representation;

import java.util.List;
import java.util.Properties;
import java.util.Set;

/**
 * Rest entry point to launch Generate Reports with the Cron Job
 *
 * @author jtoledo@google.com (Julian Toledo)
 */
public class GenerateReportsCronRest extends AbstractBaseResource {

  public Representation getHandler() {
    String result = null;

    try {

      LOGGER.info(" Generate Report Cron Task");
      System.out.println(" Generate Report Cron Task");

      Properties properties = RestServer.getProperties();
      ReportProcessorAppEngine reportProcessorAppEngine = createReportProcessor();

      // Get all User Token, they may be duplicates and we will only run the first one found.
      List<UserToken> userTokens = RestServer.getPersister().get(UserToken.class);
      Set<Long> topAccountIds = Sets.newHashSet();
      for (UserToken token : userTokens) {

        Long tokenTopAccountId = token.getTopAccountId();

        if (topAccountIds.add(tokenTopAccountId)) {

          LOGGER.info(" Refresh Accounts for MCC for " + tokenTopAccountId);
          RefreshAccountsTask.createRefreshAccountsTask(String.valueOf(tokenTopAccountId));

          LOGGER.info(" Generate Report Task for MCC for " + tokenTopAccountId);
          System.out.println(" Generate Report Task for MCC for " + tokenTopAccountId);

          // Get the dates for first day and last day of the previous month
          String dateStart = DateUtil.formatYearMonthDayNoDash(DateUtil.firstDayPreviousMonth());
          String dateEnd = DateUtil.formatYearMonthDayNoDash(DateUtil.lastDayPreviousMonth());

          reportProcessorAppEngine.generateReportsForMCC(String.valueOf(tokenTopAccountId),
              ReportDefinitionDateRangeType.CUSTOM_DATE, dateStart, dateEnd, null, properties, null, null);
        }
        result = "OK";
      }
    } catch (Exception exception) {
      return handleException(exception);
    }
    addReadOnlyHeaders();
    return createJsonResult(result);
  }

  /**
   * Creates the {@link ReportProcessor} autowiring all the dependencies.
   *
   * @return the {@code ReportProcessor} with all the dependencies properly injected.
   */
  private static ReportProcessorAppEngine createReportProcessor() {
    ReportProcessorAppEngine reportProcessorAppEngine =
        RestServer.getApplicationContext().getBean(ReportProcessorAppEngine.class);
    return reportProcessorAppEngine;
  }
}


text:
package net.sf.jsqlparser.expression.operators.relational;

public interface SupportsOldOracleJoinSyntax {

	int NO_ORACLE_JOIN = 0;
	int ORACLE_JOIN_RIGHT = 1;
	int ORACLE_JOIN_LEFT = 2;

	int getOldOracleJoinSyntax();

	void setOldOracleJoinSyntax(int oldOracleJoinSyntax);

	int NO_ORACLE_PRIOR = 0;
	int ORACLE_PRIOR_START = 1;
	int ORACLE_PRIOR_END = 2;

	int getOraclePriorPosition();

	void setOraclePriorPosition(int priorPosition);
}


text:
To start the build run the following command

```
npm run build:prod
```

After the process is done you should have a directory called ```./dist/prod```.
In this directory you will find all you need to serve the application on a web server.

## Other commands

In the scripts section of package.json file there should be a total of four scripts for the **prod** build

"build:prod": "npm run clean:prod && npm run bundle:prod",
    "clean:prod": "rimraf dist/prod",
    "bundle:prod": "webpack --env=prod --colors --progress --display-used-exports",
    "serve:prod": "lite-server -c config/server.prod.js",

### The cleaning process
This command will remove all content of the ```./dist/prod``` directory
```
npm run clean:prod
```

### The bundle process
This command will remove run the ```./config/webpack.prod.js``` and copy all the content to the ```./dist/prod``` directory.
```
npm run clean:prod
```

### The building process.
The build:prod is a combination of the clean- and bundle- process
```
npm run build:prod
```

It will first run the ```clean:prod``` command, then the ```bundle:prod``` command.

### Finally, we have the Serve process
This comman will serve your application on http://localhost:4030 using the lite-server project from npm

```
npm run serve:prod
```

## Minification

## Tree Shaking

## Compression

## Copying files and assets

## Testing the deployment

## What about AOT?


text:
module Google
  module Cloud
    module BeyondCorp
      module ClientGateways
        module V1
          # Message describing ClientGateway object.
          # @!attribute [rw] name
          #   @return [::String]
          #     Required. name of resource. The name is ignored during creation.
          # @!attribute [r] create_time
          #   @return [::Google::Protobuf::Timestamp]
          #     Output only. [Output only] Create time stamp.
          # @!attribute [r] update_time
          #   @return [::Google::Protobuf::Timestamp]
          #     Output only. [Output only] Update time stamp.
          # @!attribute [r] state
          #   @return [::Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGateway::State]
          #     Output only. The operational state of the gateway.
          # @!attribute [r] id
          #   @return [::String]
          #     Output only. A unique identifier for the instance generated by the system.
          # @!attribute [r] client_connector_service
          #   @return [::String]
          #     Output only. The client connector service name that the client gateway is
          #     associated to. Client Connector Services, named as follows:
          #       `projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}`.
          class ClientGateway
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods

            # Represents the different states of a gateway.
            module State
              # Default value. This value is unused.
              STATE_UNSPECIFIED = 0

              # Gateway is being created.
              CREATING = 1

              # Gateway is being updated.
              UPDATING = 2

              # Gateway is being deleted.
              DELETING = 3

              # Gateway is running.
              RUNNING = 4

              # Gateway is down and may be restored in the future.
              # This happens when CCFE sends ProjectState = OFF.
              DOWN = 5

              # ClientGateway encountered an error and is in indeterministic state.
              ERROR = 6
            end
          end

          # Message for requesting list of ClientGateways.
          # @!attribute [rw] parent
          #   @return [::String]
          #     Required. Parent value for ListClientGatewaysRequest.
          # @!attribute [rw] page_size
          #   @return [::Integer]
          #     Optional. Requested page size. Server may return fewer items than
          #     requested. If unspecified, server will pick an appropriate default.
          # @!attribute [rw] page_token
          #   @return [::String]
          #     Optional. A token identifying a page of results the server should return.
          # @!attribute [rw] filter
          #   @return [::String]
          #     Optional. Filtering results.
          # @!attribute [rw] order_by
          #   @return [::String]
          #     Optional. Hint for how to order the results.
          class ListClientGatewaysRequest
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Message for response to listing ClientGateways.
          # @!attribute [rw] client_gateways
          #   @return [::Array<::Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGateway>]
          #     The list of ClientGateway.
          # @!attribute [rw] next_page_token
          #   @return [::String]
          #     A token identifying a page of results the server should return.
          # @!attribute [rw] unreachable
          #   @return [::Array<::String>]
          #     Locations that could not be reached.
          class ListClientGatewaysResponse
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Message for getting a ClientGateway.
          # @!attribute [rw] name
          #   @return [::String]
          #     Required. Name of the resource
          class GetClientGatewayRequest
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Message for creating a ClientGateway.
          # @!attribute [rw] parent
          #   @return [::String]
          #     Required. Value for parent.
          # @!attribute [rw] client_gateway_id
          #   @return [::String]
          #     Optional. User-settable client gateway resource ID.
          #      * Must start with a letter.
          #      * Must contain between 4-63 characters from `/[a-z][0-9]-/`.
          #      * Must end with a number or a letter.
          # @!attribute [rw] client_gateway
          #   @return [::Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGateway]
          #     Required. The resource being created.
          # @!attribute [rw] request_id
          #   @return [::String]
          #     Optional. An optional request ID to identify requests. Specify a unique
          #     request ID so that if you must retry your request, the server will know to
          #     ignore the request if it has already been completed. The server will
          #     guarantee that for at least 60 minutes since the first request.
          #
          #     For example, consider a situation where you make an initial request and t
          #     he request times out. If you make the request again with the same request
          #     ID, the server can check if original operation with the same request ID
          #     was received, and if so, will ignore the second request. This prevents
          #     clients from accidentally creating duplicate commitments.
          #
          #     The request ID must be a valid UUID with the exception that zero UUID is
          #     not supported (00000000-0000-0000-0000-000000000000).
          # @!attribute [rw] validate_only
          #   @return [::Boolean]
          #     Optional. If set, validates request by executing a dry-run which would not
          #     alter the resource in any way.
          class CreateClientGatewayRequest
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Message for deleting a ClientGateway
          # @!attribute [rw] name
          #   @return [::String]
          #     Required. Name of the resource
          # @!attribute [rw] request_id
          #   @return [::String]
          #     Optional. An optional request ID to identify requests. Specify a unique
          #     request ID so that if you must retry your request, the server will know to
          #     ignore the request if it has already been completed. The server will
          #     guarantee that for at least 60 minutes after the first request.
          #
          #     For example, consider a situation where you make an initial request and t
          #     he request times out. If you make the request again with the same request
          #     ID, the server can check if original operation with the same request ID
          #     was received, and if so, will ignore the second request. This prevents
          #     clients from accidentally creating duplicate commitments.
          #
          #     The request ID must be a valid UUID with the exception that zero UUID is
          #     not supported (00000000-0000-0000-0000-000000000000).
          # @!attribute [rw] validate_only
          #   @return [::Boolean]
          #     Optional. If set, validates request by executing a dry-run which would not
          #     alter the resource in any way.
          class DeleteClientGatewayRequest
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Represents the metadata of the long-running operation.
          # @!attribute [r] create_time
          #   @return [::Google::Protobuf::Timestamp]
          #     Output only. The time the operation was created.
          # @!attribute [r] end_time
          #   @return [::Google::Protobuf::Timestamp]
          #     Output only. The time the operation finished running.
          # @!attribute [r] target
          #   @return [::String]
          #     Output only. Server-defined resource path for the target of the operation.
          # @!attribute [r] verb
          #   @return [::String]
          #     Output only. Name of the verb executed by the operation.
          # @!attribute [r] status_message
          #   @return [::String]
          #     Output only. Human-readable status of the operation, if any.
          # @!attribute [r] requested_cancellation
          #   @return [::Boolean]
          #     Output only. Identifies whether the user has requested cancellation
          #     of the operation. Operations that have been cancelled successfully
          #     have [Operation.error][] value with a
          #     {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to
          #     `Code.CANCELLED`.
          # @!attribute [r] api_version
          #   @return [::String]
          #     Output only. API version used to start the operation.
          class ClientGatewayOperationMetadata
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end
      end
    end
  end
end


text:
package org.wso2.carbon.registry.common.beans.utils;

import org.wso2.carbon.registry.core.exceptions.RegistryException;

import java.util.Calendar;

/**
 * Represents comments and its metadata. Note that only the Comment.text field needs to be filled
 * when adding new comments. All other attributes are ignored and they are filled with appropriate
 * values for the current context. Therefore, when constructing an instance of this class outside
 * the Registry impl, it is recommended to use new Comment("my comment text") constructor.
 */
public class Comment {

    //TODO: There are so many duplicate methods in this class. Deprecate everything unwanted.

    /**
     * Path of the comment. Each comment has a path in the form /projects/esb/config.xml;comments:12
     *
     */
    private String commentPath;

    /**
     * Comment text. This may contain any string including HTML segments.
     */
    private String text;

    /**
     * Username of the user who added this comment.
     */
    private String user;

    /**
     * Date and time at which this comment is added.
     */
    private Calendar time;

    /**
     * Path of the resource on which this comment is made.
     */
    private String resourcePath;

    public Comment() {
    }

    public Comment(String commentText) {
        this.text = commentText;
        time = Calendar.getInstance();
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    /**
     * Get the comment time.
     * @return the time the comment was made.
     * @deprecated please use getCreatedTime() instead
     */
    public Calendar getTime() {
        return time;
    }

    public void setTime(Calendar time) {
        this.time = time;
    }

    public String getResourcePath() {
        return resourcePath;
    }

    public void setResourcePath(String resourcePath) {
        this.resourcePath = resourcePath;
    }

    public String getContent() throws RegistryException {
        return getText();
    }

    public void setContent(Object content) throws RegistryException {
        setText((String)content);
    }

    public String getDescription() {
        return getText();
    }

    public void setDescription(String description) {
        setText(description);
    }

    public String getCommentPath() {
        return commentPath;
    }

    public void setCommentPath(String commentPath) {
        this.commentPath = commentPath;
    }

    public String getMediaType() {
        return "application/atom+xml";
    }

    @Deprecated
    @SuppressWarnings("unused")
    public void setMediaType(String mediaType) {
    }

    public String getAuthorUserName() {
        return user;
    }

    public void setAuthorUserName(String user) {
        this.user = user;
    }

    public Calendar getLastModified() {
        return time;
    }

    public void setLastModified(Calendar time) {
        this.time = time;
    }

    public Calendar getCreatedTime() {
        return time;
    }

    public void setCreatedTime(Calendar time) {
        this.time = time;
    }
}


text:
package model.battle

/**
  * Created by salim on 12/09/2016.
  */
object BattleRoundResult extends Enumeration {
  val Won, Lost, Fled = Value
}


text:
let editor = require('./editor/EditorController');

if (!window.burntIcing) {
	console.error('Icing requires window.burntIcing property to be set up in JavaScript');
}
else if (window.burntIcing.delayed === false || typeof window.burntIcing.delayed === 'undefined') {
	editor.goOnDocumentLoad();
}
else {
	window.burntIcing.setInitialDocumentJSON = function(documentJSON) {
		if (!documentJSON) {
			documentJSON = {
				"sections": {
					"main": null
				}
			};
		}
		// REMOVEME: FIXME: For deprecated documents with one section.
		else if (!documentJSON["sections"]) {
			window.burntIcing.setInitialContentJSON(documentJSON);
			return;
		}

		let initialDocumentState = window.burntIcing.settingsJSON.initialDocumentState;

		if (!initialDocumentState.contentJSONByDocumentID) {
			initialDocumentState.contentJSONByDocumentID = {};
		}

		initialDocumentState.contentJSONByDocumentID[initialDocumentState.documentID] = documentJSON;

		editor.goOnDocumentLoad();
	};

	// DEPRECATED
	window.burntIcing.setInitialContentJSON = function(contentJSON) {
		let initialDocumentState = window.burntIcing.settingsJSON.initialDocumentState;

		if (!initialDocumentState.contentJSONByDocumentID) {
			initialDocumentState.contentJSONByDocumentID = {};
		}
		if (!initialDocumentState.contentJSONByDocumentID[initialDocumentState.documentID]) {
			initialDocumentState.contentJSONByDocumentID[initialDocumentState.documentID] = {}
		}

		initialDocumentState.contentJSONByDocumentID[initialDocumentState.documentID][initialDocumentState.documentSectionID] = contentJSON;

		editor.goOnDocumentLoad();
	};
}


text:
var gulp = require('gulp');

/**
 * Starts the development server.
 */
gulp.task('serve', ['watch']);


text:
'use strict';

exports.init = function(req, res){
  res.render('index');
};

exports.about = function(req, res){
  res.render('about');
};

exports.newpage = function(req, res){
  res.render('newpage');
};

exports.person = function(req, res){
  res.render('person');
};


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    <solid android:color="#4DD0E1" />

    <corners
        android:bottomLeftRadius="8dp"
        android:bottomRightRadius="8dp"
        android:topLeftRadius="8dp"
        android:topRightRadius="8dp" />

</shape>


text:
<?php
namespace wmlib\controller;

use Psr\Http\Message\StreamableInterface;
use Psr\Http\Message\ResponseInterface;

/**
 * velocity response object
 *
 * @see velocity_request
 * @package velocity
 */
class Response implements ResponseInterface
{
    const SESSION_NAMESPACE_MESSAGES = 'messages';

    const CONTENT_TYPE_HTML = 'text/html';
    const CONTENT_APPLICATION_JSON = 'application/json';

    const EVENT_FLUSH = 'flush';

    const STATUS_OK = 200;
    const STATUS_FOUND = 302;
    const STATUS_NOT_MODIFIED = 304;

    const STATUS_BAD_REQUEST = 400;
    const STATUS_UNAUTHORIZED = 401;
    const STATUS_FORBIDDEN = 403;
    const STATUS_NOT_FOUND = 404;
    const STATUS_SERVER_ERROR = 500;

    const HEADER_CONTENT_ENCODING = 'Content-Encoding';
    const HEADER_CONTENT_TYPE = 'Content-Type';
    const HEADER_CONTENT_LENGTH = 'Content-Length';
    const HEADER_CONTENT_LANGUAGE = 'Content-Language';
    const HEADER_LOCATION = 'Location';
    const HEADER_ETAG = 'ETag';
    const HEADER_EXPIRES = 'Expires';
    const HEADER_LAST_MOFIFIED = 'Last-Modified';
    const HEADER_CACHE_CONTROL = 'Cache-Control';
    const HEADER_PRAGMA = 'Pragma';

    /**
     * @var int
     */
    private $_status;

    /**
     * @var string
     */
    private $_statusMessage;

    private static $_StatusMessages = array(
        self::STATUS_OK => 'OK',
        self::STATUS_FOUND => 'Found',
        self::STATUS_NOT_MODIFIED => 'Not Modified',
        self::STATUS_BAD_REQUEST => 'Bad request',
        self::STATUS_UNAUTHORIZED => 'Unauthorized',
        self::STATUS_FORBIDDEN => 'Forbidden',
        self::STATUS_NOT_FOUND => 'Not Found',
        self::STATUS_SERVER_ERROR => 'Server Error'
    );

    /**
     * Context request
     *
     * @var Request
     */
    private $_request;

    private $_version;

    /**
     *
     * @var string[]
     */
    private $_headers = array();

    /**
     * @var StreamableInterface
     */
    private $_stream;

    private $_cookies = array();

    private $_sessions = array();

    private $_jss = array(), $_css = array();

    /**
     * @var Session
     */
    private $_session;

    function __construct(Request $request)
    {
        $this->_request = $request;

        // import errors and notices from request session
        //$this->_sessions = null;//$request->getSessions();

        //if (!isset($this->sessions['velocity.errors'])) $this->sessions['velocity.errors'] = $request->getSession('velocity.errors');
        //if (!isset($this->sessions['velocity.notices'])) $this->sessions['velocity.notices'] = $request->getSession('velocity.notices');

        $this->_status = self::STATUS_OK;
        $this->_statusMessage = self::$_StatusMessages[$this->_status];

        $this->_headers = array(self::HEADER_CONTENT_TYPE => [sprintf('%s; charset=utf-8', self::CONTENT_TYPE_HTML)]);

    }

    /**
     * @return Session|null
     */
    public function getSession()
    {
        if ($this->_session === null) {
            $this->_session = $this->_request->getSession();
        }

        return $this->_session;
    }

    /**
     * @return array
     */
    public function getCookies()
    {
        return $this->_cookies;
    }

    /**
     * @param array $cookies
     */
    public function setCookies(array $cookies)
    {
        $this->_cookies = $cookies;
    }

    /**
     * @param array $sessions
     */
    public function setSessions($sessions)
    {
        $this->_sessions = $sessions;
    }

    public function addCss($css)
    {
        $this->_css[] = $css;

        return $this;
    }

    public function addJs($js)
    {
        $this->_jss[] = $js;

        return $this;
    }

    /**
     * Set response cookie
     *
     * @param string $name
     * @param mixed $value
     * @param int $expire
     * @param string $path
     * @return Response
     */
    public function setCookie($name, $value, $expire = null, $path = '/')
    {
        $this->_cookies[$name] = array($value, $expire, $path);

        return $this;
    }

    /**
     * Add error message to response
     *
     * @deprecated
     * @param string $error_message
     * @return Response Fluent API support
     */
    public function addError($error_message)
    {
        $this->_sessions['velocity.errors'][] = $error_message;

        return $this;
    }

    public function fetchErrors()
    {
        $errors = (isset($this->_sessions['velocity.errors'])) ? $this->_sessions['velocity.errors'] : $this->_request->getSession('velocity.errors',
            array());

        $this->_sessions['velocity.errors'] = array();

        return $errors;
    }

    public function fetchNotices()
    {
        $notices = (isset($this->_sessions['velocity.notices'])) ? $this->_sessions['velocity.notices'] : $this->_request->getSession('velocity.notices',
            array());

        $this->_sessions['velocity.notices'] = array();

        return $notices;
    }

    /**
     * Add notice message to response
     *
     * @param string $notice_message
     * @return Response Fluent API support
     */
    public function addNotice($notice_message)
    {
        $session = $this->getSession();
        $notices = $session->get(self::SESSION_NAMESPACE_MESSAGES, 'notices', []);
        $notices[] = $notice_message;
        $session->set(self::SESSION_NAMESPACE_MESSAGES, 'notices', $notices);

        return $this;
    }

    /**
     * Gets the response Status-Code.
     *
     * The Status-Code is a 3-digit integer result code of the server's attempt
     * to understand and satisfy the request.
     *
     * @return integer Status code.
     */
    public function getStatusCode()
    {
        return (int)$this->_status;
    }

    /**
     * Gets the response Reason-Phrase, a short textual description of the Status-Code.
     *
     * Because a Reason-Phrase is not a required element in a response
     * Status-Line, the Reason-Phrase value MAY be null. Implementations MAY
     * choose to return the default RFC 7231 recommended reason phrase (or those
     * listed in the IANA HTTP Status Code Registry) for the response's
     * Status-Code.
     *
     * @link http://tools.ietf.org/html/rfc7231#section-6
     * @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
     * @return string|null Reason phrase, or null if unknown.
     */
    public function getReasonPhrase()
    {
        $code = (string)$this->getStatusCode();

        if (isset(self::$_StatusMessages[$code])) {
            return self::$_StatusMessages[$code];
        } else {
            return null;
        }
    }

    public function isSuccess()
    {
        return (($status = $this->getStatusCode()) >= 200 && $status < 300);
    }

    /**
     * Check if response is HTML
     *
     * @return boolean
     */
    public function isHtml()
    {
        $content_type = $this->getContentType();

        return (stripos($content_type, self::CONTENT_TYPE_HTML) !== false);
    }

    public function isRedirect()
    {
        return (($status = $this->getStatusCode()) >= 300 && $status < 400);
    }

    public function isError()
    {
        return (!$this->isSuccess() && !$this->isRedirect());
    }

    /**
     * @return string[]
     */
    public function getHeaders()
    {
        return $this->_headers;
    }

    /**
     * @return Request
     */
    public function getRequest()
    {
        return $this->_request;
    }

    /**
     * Alias to get content-type header
     *
     * @return string Content type
     */
    public function getContentType()
    {
        return $this->getHeader(Response::HEADER_CONTENT_TYPE);
    }

    /**
     * Get response header
     *
     * @param string $name header name
     *
     * @return string $value header value, null if not found
     */
    public function getHeader($name)
    {
        return implode(', ', $this->getHeaderLines($name));
    }

    /**
     * Check response header
     *
     * @param string $name header name
     *
     * @return boolean
     */
    public function hasHeader($name)
    {
        return isset($this->_headers[$name]);
    }

    /**
     * Return response in raw
     *
     * @return string
     */
    function __toString()
    {
        $has_content_length = false;

        $response = sprintf("HTTP/%01.1F %s %s", $this->getProtocolVersion(), $this->getStatusCode(),
                $this->getReasonPhrase()) . "\r\n";
        foreach ($this->_headers as $name => $value) {
            $response .= sprintf("%s: %s", $name, $value) . "\r\n";

            if (!$has_content_length && (strtolower($name) === strtolower(self::HEADER_CONTENT_LENGTH))) {
                $has_content_length = true;
            }
        }
        if (!$has_content_length && $this->_stream) {
            $response .= sprintf("%s: %s", self::HEADER_CONTENT_LENGTH, $this->_stream->getSize()) . "\r\n";
        }
        $response .= "\r\n" . ($this->_stream ? $this->_stream->getContents() : null);

        return $response;

    }

    /**
     * Gets the HTTP protocol version as a string.
     *
     * The string MUST contain only the HTTP version number (e.g., "1.1", "1.0").
     *
     * @return string HTTP protocol version.
     */
    public function getProtocolVersion()
    {
        return $this->_version ?: $this->_request->getProtocolVersion();
    }

    /**
     * Gets the body of the message.
     *
     * @return StreamableInterface|null Returns the body, or null if not set.
     */
    public function getBody()
    {
        return $this->_stream;
    }

    /**
     * Create a new instance with the specified status code, and optionally
     * reason phrase, for the response.
     *
     * If no Reason-Phrase is specified, implementations MAY choose to default
     * to the RFC 7231 or IANA recommended reason phrase for the response's
     * Status-Code.
     *
     * This method MUST be implemented in such a way as to retain the
     * immutability of the message, and MUST return a new instance that has the
     * updated status and reason phrase.
     *
     * @link http://tools.ietf.org/html/rfc7231#section-6
     * @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
     * @param integer $code The 3-digit integer result code to set.
     * @param null|string $reasonPhrase The reason phrase to use with the
     *     provided status code; if none is provided, implementations MAY
     *     use the defaults as suggested in the HTTP specification.
     * @return self
     * @throws \InvalidArgumentException For invalid status code arguments.
     */
    public function withStatus($code, $reasonPhrase = null)
    {
        $response = clone $this;
        $response->_status = $code;
        if (!$reasonPhrase) {
            $reasonPhrase = isset(self::$_StatusMessages[$code]) ? self::$_StatusMessages[$code] : '';
        }
        $response->_statusMessage = $reasonPhrase;

        return $response;
    }

    /**
     * Create a new instance with the specified HTTP protocol version.
     *
     * The version string MUST contain only the HTTP version number (e.g.,
     * "1.1", "1.0").
     *
     * This method MUST be implemented in such a way as to retain the
     * immutability of the message, and MUST return a new instance that has the
     * new protocol version.
     *
     * @param string $version HTTP protocol version
     * @return self
     */
    public function withProtocolVersion($version)
    {
        $response = clone $this;
        $response->_version = $version;

        return $response;
    }

    /**
     * Retrieves a header by the given case-insensitive name as an array of strings.
     *
     * @param string $header Case-insensitive header name.
     * @return string[]
     */
    public function getHeaderLines($header)
    {
        $lines = [];
        foreach ($this->_headers as $name => $headers) {
            if (strtolower($name) == strtolower($header)) {
                $lines = $headers;
            }
        }
        return $lines;
    }

    /**
     * Create a new instance with the provided header, replacing any existing
     * values of any headers with the same case-insensitive name.
     *
     * The header name is case-insensitive. The header values MUST be a string
     * or an array of strings.
     *
     * This method MUST be implemented in such a way as to retain the
     * immutability of the message, and MUST return a new instance that has the
     * new and/or updated header and value.
     *
     * @param string $header Header name
     * @param string|string[] $value Header value(s).
     * @return self
     * @throws \InvalidArgumentException for invalid header names or values.
     */
    public function withHeader($header, $value)
    {
        $response = clone $this;

        $keep_headers = [];
        $found = false;
        foreach ($response->_headers as $name => $headers) {
            if (strtolower($name) !== strtolower($header)) {
                $keep_headers[$name] = $headers;
            } else {
                $keep_headers[$name] = is_array($value) ? $value : [(string)$value];
                $found = true;
            }
        }
        if (!$found) {
            $keep_headers[$header] = is_array($value) ? $value : [(string)$value];
        }
        $response->_headers = $keep_headers;

        return $response;
    }

    /**
     * Creates a new instance, with the specified header appended with the
     * given value.
     *
     * Existing values for the specified header will be maintained. The new
     * value(s) will be appended to the existing list. If the header did not
     * exist previously, it will be added.
     *
     * This method MUST be implemented in such a way as to retain the
     * immutability of the message, and MUST return a new instance that has the
     * new header and/or value.
     *
     * @param string $header Header name to add
     * @param string|string[] $value Header value(s).
     * @return self
     * @throws \InvalidArgumentException for invalid header names or values.
     */
    public function withAddedHeader($header, $value)
    {
        $response = clone $this;

        $keep_headers = [];
        foreach ($response->_headers as $name => $headers) {
            if (strtolower($name) !== strtolower($header)) {
                $keep_headers[$name] = $headers;
            } else {
                $keep_headers[$name] = array_merge($headers, is_array($value) ? $value : [(string)$value]);
            }
        }
        $response->_headers = $keep_headers;

        return $response;
    }

    /**
     * Creates a new instance, without the specified header.
     *
     * Header resolution MUST be done without case-sensitivity.
     *
     * This method MUST be implemented in such a way as to retain the
     * immutability of the message, and MUST return a new instance that removes
     * the named header.
     *
     * @param string $header HTTP header to remove
     * @return self
     */
    public function withoutHeader($header)
    {
        $response = clone $this;

        $keep_headers = [];
        foreach ($response->_headers as $name => $headers) {
            if (strtolower($name) !== strtolower($header)) {
                $keep_headers[$name] = $headers;
            }
        }
        $response->_headers = $keep_headers;

        return $response;
    }

    /**
     * Create a new instance, with the specified message body.
     *
     * The body MUST be a StreamableInterface object.
     *
     * This method MUST be implemented in such a way as to retain the
     * immutability of the message, and MUST return a new instance that has the
     * new body stream.
     *
     * @param StreamableInterface $body Body.
     * @return self
     * @throws \InvalidArgumentException When the body is not valid.
     */
    public function withBody(StreamableInterface $body)
    {
        $response = clone $this;
        $response->_stream = $body;

        return $response;
    }

    /**
     * Create a new instance, without the specified message body.
     *
     * This method MUST be implemented in such a way as to retain the
     * immutability of the message, and MUST return a new instance that has the
     * new body stream.
     *
     * @return self
     */
    public function withoutBody()
    {
        $response = clone $this;
        $response->_stream = null;

        return $response;
    }
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="css/litestrap.min.css" />
  <title>Notes.js</title>

    This page is a client-side JavaScript application.
    You need to enable your JavaScript in order to view the content.

  <link rel="stylesheet" href="vendor/highlight.tomorrow.min.css" />


text:
class Goal < ActiveRecord::Base
  belongs_to :client
  has_many   :donations
  has_and_belongs_to_many :needs

  def to_s
    title
  end
end


text:
import scala.collection.mutable.Map

class ChecksumAccumulator {
  private var sum = 0
  def add(b: Byte) {sum += b}
  def checksum(): Int = ~(sum & 0xFF) + 1
}

object ChecksumAccumulator {
  private val cache = Map[String, Int]()
  def calculate(s: String): Int = {
    if (cache.contains(s))
      cache(s)
    else {
      val acc = new ChecksumAccumulator
      for (c <- s) acc.add(c.toByte)
      val cs = acc.checksum()
      cache += (s -> cs)
      cs
    }
  }
}


text:
var createTimeline = require('keytime')
var indexOf = require('indexof-property')('name')

function fit(timeline, timelineScheme) {
	timelineScheme.forEach(function(scheme) {
		var prop = timeline.property(scheme.name)
		if (!prop) {
			timeline.addProperty(scheme)
		}
	})

}

//transforms raw JSON to a list of timelines
module.exports = function(data, scheme) {
	scheme = scheme||[]

	//from the JSON data we need to build keytime objects
	data.forEach(function(a) {
		var timeline = createTimeline(a.timeline)
		a.timeline = timeline

		var idx = indexOf(scheme, a.name)
		if (idx !== -1) {
			fit(a.timeline, scheme[idx].timeline)
		}
	})

	//now add any remainders
	scheme.forEach(function(a) {
		var idx = indexOf(data, a.name)
		if (idx === -1) {
			var t = createTimeline(a.timeline)
			data.push({ name: a.name, timeline: t })
		}
	})
}