text:
import java.util.*;
public class ScannerExample {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		String input=scan.next();
		scan.close();
		System.out.println(input);
	}

}


text:
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Nucleo.Web.ValidationControls.Categories
{
	[TestClass]
	public class WarningValidatorCategoryTest
	{
		[TestMethod]
		public void GettingValuesWorksOK()
		{
			var cat = new WarningValidatorCategory();

			Assert.AreEqual("Warning", WarningValidatorCategory.CategoryName);
			Assert.AreEqual("Warning", cat.Name);
			Assert.AreEqual(false, cat.IsFailingCategory);
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
This sample shows how to use the Autosuggest module with a Textbox to navigate the map.

[See it Run](http://crpietschmann.github.io/bingmaps-v8-quickstart-samples/201-module-autosuggest/)

[View Code](index.htm)


text:
package com.bottlerocketstudios.continuitysample.core.ui.dialog;

import android.content.DialogInterface;

public class JustDismissOnClickListener implements DialogInterface.OnClickListener {
    @Override
    public void onClick(DialogInterface dialogInterface, int which) {
        if (dialogInterface != null) dialogInterface.dismiss();
    }
}


text:
Signal.trap("INT") {
  puts "received INT"
  exit
}
Signal.trap("QUIT") {
  puts "received QUIT";
  exit
}
Signal.trap("KILL") {
  puts "received KILL, but I refuse to go!";
}
Signal.trap("USR1") {
  puts "received USR1"
  puts "I think the time is #{Time.now.to_i}"
}
puts Process.pid
sleep


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.orion_platform</groupId>
        <artifactId>orion_scripting</artifactId>
        <version>1.0.0</version>
    </parent>

    <groupId>com.orion_platform</groupId>
    <artifactId>orion_scripting_javascript</artifactId>
    <version>1.0.0</version>
    <name>Orion Scripting JavaScript</name>
</project>


text:
package com.fly.firefly.base;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import java.util.Collections;
import java.util.List;

public class BaseBaseAdapter<T> extends BaseAdapter
{
	private Activity activity;
	private LayoutInflater layoutInflater;
	protected com.fly.firefly.base.AQuery aq;
	protected List<T> listItems = Collections.emptyList();

	public BaseBaseAdapter(Activity activity)
	{
		this.activity = activity;
		layoutInflater = LayoutInflater.from(activity);
		aq = new com.fly.firefly.base.AQuery(activity);
	}

	public Activity getActivity()
	{
		return activity;
	}

	public LayoutInflater getLayoutInflater()
	{
		return layoutInflater;
	}

	public List<T> getListItems()
	{
		return listItems;
	}

	public void setItems(List<T> items)
	{
		this.listItems = (List<T>) items;
		notifyDataSetChanged();
	}

	@Override
	public int getCount()
	{
		if (listItems == null)
		{
			return 0;
		}
		return listItems.size();
	}

	@Override
	public T getItem(int position)
	{
		return listItems.get(position);
	}

	@Override
	public long getItemId(int position)
	{
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent)
	{
		return convertView;
	}

}


text:
<!-- //
/*
 * Author: Vincent K. Sam
 * Created on: January 16, 2016
 */
// -->

require(['withdrawal', 'account'], function (withdrawal, account) {

	module('Withdrawal API - Module');
	test('tests', function() {
		var withdrawals = withdrawal.initWithKey(apikey);
		var accounts = account.initWithKey(apikey);

		var accountID = getFirstAccountId(accounts);
		var withdrawalID = getFirstWithdrawalId(withdrawals, accountID);
		var lastWithdrawID = getLastWithdrawalId(withdrawals, accountID);

		var sampleWithdrawal = "{ \"medium\": \"balance\", \"transaction_date\": \"2016-01-22\", \"status\": \"completed\", \"amount\": 25, \"description\": \"Teller withdrawal\" }";
		var sampleWithdrawUpdate = '{ "medium": "balance", "amount": 52000, "description": "update" }';

		ok(testGetAllByAcctId(withdrawals, accountID), 'Test Get all withdrawals');
		ok(testGetWithdrawalById(withdrawals, withdrawalID), 'Test Get withdrawal by id');
		ok(testCreateWithdrawal(withdrawals, accountID, sampleWithdrawal), 'Test Create a withdrawal');
		ok(testUpdateWithdrawal(withdrawals, withdrawalID, sampleWithdrawUpdate), 'Test Update a specific existing withdrawal');
		ok(testDeleteWithdrawal(withdrawals, lastWithdrawID), 'Test Delete a specific existing withdrawal');

	});
});

function testGetAllByAcctId(withdrawals, accountID) {
	var res = withdrawals.getAllByAccountId(accountID);
	if (res.length > 0) {
		return equals(res[0].payer_id, accountID);
	}
	return false;
}

function testGetWithdrawalById(withdrawals, withdrawalID) {
	var res = withdrawals.getWithdrawalById(withdrawalID);
	return equals(res._id, withdrawalID);
}

function testCreateWithdrawal(withdrawals, accountID, sampleWithdrawal) {
	var respCode = withdrawals.createWithdrawal(accountID, sampleWithdrawal);
	return equals(respCode, 201);
}

function testUpdateWithdrawal(withdrawals, withdrawalID, sampleWithdrawUpdate) {
	var respCode = withdrawals.updateWithdrawalById(withdrawalID, sampleWithdrawUpdate);
	return equals(respCode, 202);
}

function testDeleteWithdrawal(withdrawals, withdrawalID) {
	var respCode = withdrawals.deleteWithdrawals(withdrawalID);
	return equals(respCode, 204);
}

function getFirstWithdrawalId(withdrawals, accountID) {
	return withdrawals.getAllByAccountId(accountID)[0]._id;
}

function getLastWithdrawalId(withdrawals, accountID) {
	return withdrawals.getAllByAccountId(accountID).pop()._id;
}

function getFirstAccountId(accounts) {
	return accounts.getAllAccounts()[0]._id;
}

function equals(val1, val2) {
	return val1 === val2;
}


text:
/*********************************************************************************************************/
/* jQuery UI Slider plugin wrapper */
/*********************************************************************************************************/

angular.module('ui.slider', []).value('uiSliderConfig', {}).directive('uiSlider', ['uiSliderConfig', '$timeout', function (uiSliderConfig, $timeout) {
    uiSliderConfig = uiSliderConfig || {};
    return {
        require: 'ngModel',
        template: '

<input class="slider-input" style="display:none" ng-model="value">
',
        replace: true,
        compile: function () {
            return function (scope, elm, attrs, ngModel) {

                scope.value = ngModel.$viewValue;

                function parseNumber(n, decimals) {
                    return (decimals) ? parseFloat(n) : parseInt(n);
                };

                var options = angular.extend(scope.$eval(attrs.uiSlider) || {}, uiSliderConfig);
                // Object holding range values
                var prevRangeValues = {
                    min: null,
                    max: null
                };

                // convenience properties
                var properties = ['min', 'max', 'step'];
                var useDecimals = (!angular.isUndefined(attrs.useDecimals)) ? true : false;

                var init = function () {
                    // When ngModel is assigned an array of values then range is expected to be true.
                    // Warn user and change range to true else an error occurs when trying to drag handle
                    if (angular.isArray(ngModel.$viewValue) && options.range !== true) {
                        console.warn('Change your range option of ui-slider. When assigning ngModel an array of values then the range option should be set to true.');
                        options.range = true;
                    }

                    // Ensure the convenience properties are passed as options if they're defined
                    // This avoids init ordering issues where the slider's initial state (eg handle
                    // position) is calculated using widget defaults
                    // Note the properties take precedence over any duplicates in options
                    angular.forEach(properties, function (property) {
                        if (angular.isDefined(attrs[property])) {
                            options[property] = parseNumber(attrs[property], useDecimals);
                        }
                    });

                    elm.find(".slider").slider(options);
                    init = angular.noop;
                };

                // Find out if decimals are to be used for slider
                angular.forEach(properties, function (property) {
                    // support {{}} and watch for updates
                    attrs.$observe(property, function (newVal) {
                        if (!!newVal) {
                            init();
                            elm.find(".slider").slider('option', property, parseNumber(newVal, useDecimals));
                        }
                    });
                });
                attrs.$observe('disabled', function (newVal) {
                    init();
                    elm.find(".slider").slider('option', 'disabled', !!newVal);
                });

                // Watch ui-slider (byVal) for changes and update
                scope.$watch(attrs.uiSlider, function (newVal) {
                    init();
                    if (newVal != undefined) {
                        elm.find(".slider").slider('option', newVal);
                        elm.find(".ui-slider-handle").html("" + ui.value + "px")
                    }
                }, true);

                // Late-bind to prevent compiler clobbering
                $timeout(init, 0, true);

                // Update model value from slider
                elm.find(".slider").bind('slidestop', function (event, ui) {
                    ngModel.$setViewValue(ui.values || ui.value);
                    scope.$apply();
                });

                elm.bind('slide', function (event, ui) {
                    event.stopPropagation();
                    elm.find(".slider-input").val(ui.value);
                    elm.find(".ui-slider-handle").html("" + ui.value + "px")
                });

                // Update slider from model value
                ngModel.$render = function () {
                    init();
                    var method = options.range === true ? 'values' : 'value';

                    if (isNaN(ngModel.$viewValue) && !(ngModel.$viewValue instanceof Array))
                        ngModel.$viewValue = 0;

                    if (ngModel.$viewValue == '')
                        ngModel.$viewValue = 0;

                    scope.value = ngModel.$viewValue;

                    // Do some sanity check of range values
                    if (options.range === true) {

                        // Check outer bounds for min and max values
                        if (angular.isDefined(options.min) && options.min > ngModel.$viewValue[0]) {
                            ngModel.$viewValue[0] = options.min;
                        }
                        if (angular.isDefined(options.max) && options.max < ngModel.$viewValue[1]) {
                            ngModel.$viewValue[1] = options.max;
                        }

                        // Check min and max range values
                        if (ngModel.$viewValue[0] >= ngModel.$viewValue[1]) {
                            // Min value should be less to equal to max value
                            if (prevRangeValues.min >= ngModel.$viewValue[1])
                                ngModel.$viewValue[0] = prevRangeValues.min;
                            // Max value should be less to equal to min value
                            if (prevRangeValues.max <= ngModel.$viewValue[0])
                                ngModel.$viewValue[1] = prevRangeValues.max;
                        }

                        // Store values for later user
                        prevRangeValues.min = ngModel.$viewValue[0];
                        prevRangeValues.max = ngModel.$viewValue[1];

                    }
                    elm.find(".slider").slider(method, ngModel.$viewValue);
                    elm.find(".ui-slider-handle").html("" + ngModel.$viewValue + "px")
                };

                scope.$watch("value", function () {
                    ngModel.$setViewValue(scope.value);
                }, true);

                scope.$watch(attrs.ngModel, function () {
                    if (options.range === true) {
                        ngModel.$render();
                    }
                }, true);

                function destroy() {
                    elm.find(".slider").slider('destroy');
                }
                elm.find(".slider").bind('$destroy', destroy);
            };
        }
    };
}]);


text:
<?php

namespace Wambo\Core\Module;

use League\Flysystem\FileNotFoundException;
use Wambo\Core\Storage\StorageInterface;

/**
 * Class ModuleRepository
 * @package Wambo\Core\Module
 */
class ModuleRepository
{

    /**
     * @var StorageInterface
     */
    private $storage;

    /**
     * @var ModuleMapper
     */
    private $mapper;

    /**
     * ModuleRepository constructor.
     *
     * @param StorageInterface $storage
     * @param ModuleMapper $mapper
     */
    public function __construct(StorageInterface $storage, ModuleMapper $mapper)
    {
        $this->storage = $storage;
        $this->mapper = $mapper;
    }

    /**
     * @return array
     */
    public function getAll()
    {
        $modules = array();

        try {
            $modulesData = $this->storage->read();
        } catch (FileNotFoundException $e) {
            return [];
        }

        foreach ($modulesData as $moduleData)
        {
            $modules[] = $this->mapper->getModule($moduleData);
        }
        return $modules;
    }

    /**
     * @param Module $module
     */
    public function add(Module $module)
    {
        if ($this->has($module)) {
            return;
        }

        $allModules = $this->storage->read();
        $moduleData = $this->mapper->getData($module);
        array_push($allModules, $moduleData);

        $this->storage->write($allModules);
    }

    /**
     * @param Module $origModule
     * @return bool
     */
    public function has(Module $origModule) : bool
    {
        $allModules = $this->getAll();
        foreach ($allModules as $module) {
            if ($origModule->equals($module)) {
                return true;
            }
        }
        return false;
    }

}


text:
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'autotest/growl'
require 'rspec'
require 'rspec/autorun'

RSpec.configure do |config|
end

module Autotest::Growl
  def self.growl(title, message, icon, priority=0, stick="")
    icon
  end
end


text:
package com.facebook.buck.android;

import com.facebook.buck.android.apkmodule.APKModule;
import com.facebook.buck.rules.AddToRuleKey;
import com.facebook.buck.rules.AddsToRuleKey;
import com.facebook.buck.rules.SourcePath;
import com.google.common.collect.ImmutableSortedMap;
import java.util.Optional;

public class NativeFilesInfo implements AddsToRuleKey {
  @AddToRuleKey Optional<ImmutableSortedMap<APKModule, SourcePath>> nativeLibsDirs;
  @AddToRuleKey Optional<ImmutableSortedMap<APKModule, SourcePath>> nativeLibsAssetsDirs;

  public NativeFilesInfo(
      Optional<ImmutableSortedMap<APKModule, SourcePath>> nativeLibsDirs,
      Optional<ImmutableSortedMap<APKModule, SourcePath>> nativeLibsAssetsDirs) {
    this.nativeLibsDirs = nativeLibsDirs;
    this.nativeLibsAssetsDirs = nativeLibsAssetsDirs;
  }
}


text:
// The MIT License (MIT)

// Copyright 2015 Siney/Pangweiwei siney@yeah.net
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

using System.Collections.Generic;
using System;
using System.Linq;
using System.Reflection;
#if !SLUA_STANDALONE
using UnityEngine;
#endif
using System.IO;

namespace SLua{

	public class Lua3rdMeta
	#if !SLUA_STANDALONE
		:ScriptableObject
	#endif
	{
		/// <summary>
		///Cache class types here those contain 3rd dll attribute.
		/// </summary>
		public List<string> typesWithAttribtues = new List<string>();

		void OnEnable(){
			#if !SLUA_STANDALONE
			this.hideFlags = HideFlags.NotEditable;
			#endif
		}
		#if UNITY_EDITOR

		public void ReBuildTypes(){
			typesWithAttribtues.Clear();
			Assembly assembly = null;
			foreach(var assem in AppDomain.CurrentDomain.GetAssemblies()){
				if(assem.GetName().Name == "Assembly-CSharp"){
					assembly = assem;
					break;
				}
			}
			if(assembly != null){
				var types = assembly.GetExportedTypes();
				foreach(var type in types){
					var methods = type.GetMethods(BindingFlags.Public|BindingFlags.Static);
					foreach(var method in methods){
						if(method.IsDefined(typeof(Lua3rdDLL.LualibRegAttribute),false)){
							typesWithAttribtues.Add(type.FullName);
							break;
						}
					}
				}
			}
		}

		#endif
		private static Lua3rdMeta _instance=null;
		public static Lua3rdMeta Instance{
			get{
				#if !SLUA_STANDALONE
				if(_instance == null){
					_instance = Resources.Load<Lua3rdMeta>("lua3rdmeta");
				}

				#if UNITY_EDITOR
				if(_instance == null){
					_instance = ScriptableObject.CreateInstance<Lua3rdMeta>();
					string path = "Assets/Slua/Resources";
					if(!Directory.Exists(path)){
						Directory.CreateDirectory(path);
					}
					UnityEditor.AssetDatabase.CreateAsset(_instance,Path.Combine(path,"lua3rdmeta.asset"));
				}

				#endif
				#endif
				return _instance;
			}
		}
	}
}


text:
@interface WWKeyValueRow()
- (void) _layoutIfNeeded;
- (NSString *) _displayedKeyLabel;
- (NSMutableDictionary *)_labelAttributes;
- (void) _populateMenu;
- (BOOL) _menuShouldBeHidden;
- (NSRect) _labelMouseRect;

@property(retain) NSPopUpButton *_keyButton;
@end

#pragma mark -

@implementation WWKeyValueRow
@synthesize _keyButton, delegate, actionMenu;

- (id)initWithName:(NSString *)theName{
    if (self = [super initWithName:theName]){
		splitPosition = WWKeyValueRow_DefaultSplitPosition;

		self._keyButton = [[[NSPopUpButton alloc] initWithFrame:NSZeroRect] autorelease];
		[_keyButton setFont:[parentEditor keyLabelFont]];
		[[_keyButton cell] setControlSize:NSMiniControlSize];
		[_keyButton setTarget:self];
		[_keyButton setAction:@selector(_choseNewKeyType)];
		[_keyButton setBordered:NO];
		[_keyButton setAlignment:NSRightTextAlignment];

		[self setKeyTypeIdentifiers:[NSArray arrayWithObject:@"label"]];

		[self addSubview:_keyButton];

		[[self window] setAcceptsMouseMovedEvents:YES];
		[[self window] setIgnoresMouseEvents:NO];
    }
    return self;
}

- (void)dealloc {
	self._keyButton = nil;
	self.actionMenu = nil;
	self.keyTypeLabels = nil;
	self.keyTypeIdentifiers = nil;
	self.valueRowView = nil;
    [super dealloc];
}

- (NSString *)description{
	return [NSString stringWithFormat:@"<WWKeyValueRow: keyTypes = %@, valueRow = %@>",keyTypeIdentifiers, valueRowView];
}

+ (void) initialize{
	[self exposeBinding:@"keyLabel"];
	[self exposeBinding:@"valueRow"];
}

- (NSMutableDictionary *)_labelAttributes{
	NSMutableDictionary *attrs = [NSMutableDictionary dictionary];

	if(parentEditor){
		[attrs setObject:parentEditor.keyLabelFont forKey:NSFontAttributeName];
		[attrs setObject:parentEditor.keyLabelColor forKey:NSForegroundColorAttributeName];
	}

	return attrs;
}

#pragma mark -

- (WWCardEditorRow *)valueRowView {
    return valueRowView;
}

- (void)setValueRowView:(WWCardEditorRow *)aValueRowView {
    if (valueRowView != aValueRowView) {
		[valueRowView removeFromSuperview];
        [valueRowView release];
        valueRowView = [aValueRowView retain];

		[self addSubview:valueRowView];
		[valueRowView setParentEditor:self.parentEditor];
		[valueRowView setAutoresizingMask:NSViewMaxXMargin | NSViewMaxYMargin | NSViewWidthSizable | NSViewHeightSizable];
		[self setAutoresizesSubviews:YES];
    }

	_needsLayout = YES;
}

- (NSDictionary *)keyTypeLabels {
    return keyTypeLabels;
}

- (void)setKeyTypeLabels:(NSDictionary *)aKeyTypeLabels {
    if (keyTypeLabels != aKeyTypeLabels) {
        [keyTypeLabels release];
        keyTypeLabels = [aKeyTypeLabels retain];

		[self _populateMenu];
    }
}

- (NSString *)activeKeyType {
    return [keyTypeIdentifiers objectAtIndex:[_keyButton indexOfSelectedItem]];
}

- (void)setActiveKeyType:(NSString *)anActiveKeyType {
	if([keyTypeIdentifiers containsObject:anActiveKeyType]){
		[_keyButton selectItemAtIndex:[keyTypeIdentifiers indexOfObject:anActiveKeyType]];
	}
}

- (NSArray *)keyTypeIdentifiers {
    return keyTypeIdentifiers;
}

- (void)setKeyTypeIdentifiers:(NSArray *)aKeyTypeIdentifiers {
    if (keyTypeIdentifiers != aKeyTypeIdentifiers) {
        [keyTypeIdentifiers release];
        keyTypeIdentifiers = [aKeyTypeIdentifiers retain];
		[self _populateMenu];
		_needsLayout = YES;
    }
}

- (CGFloat)splitPosition {
    return splitPosition;
}

- (void)setSplitPosition:(CGFloat)aSplitPosition {
    splitPosition = aSplitPosition;
	_needsLayout = YES;
}

- (void)setParentEditor:(WWCardEditor *)aParentEditor {
    if (parentEditor != aParentEditor) {
        [parentEditor release];
        parentEditor = [aParentEditor retain];
    }

	[_keyButton setFont:parentEditor.keyLabelFont];

	[valueRowView setParentEditor:aParentEditor];
	[valueRowView setParentRow:self];
}

- (void)setEditMode:(BOOL)flag {
	[valueRowView setEditMode:flag];
	_needsLayout = YES;
	[super setEditMode:flag];
}

- (void)setParentRow:(WWCardEditorRow *)aParentRow {
    [valueRowView setParentRow:aParentRow];
	[super setParentRow:aParentRow];
}

#pragma mark -
#pragma mark Helpers

- (void) _populateMenu{
	NSMenu *menu = [[[NSMenu alloc] init] autorelease];

	for(unsigned i = 0; i < [keyTypeIdentifiers count]; i++){
		NSString *identifier = [keyTypeIdentifiers objectAtIndex:i];

		NSMenuItem *item = [[NSMenuItem alloc] init];
		[item setTag:i];

		NSString *title = [keyTypeLabels objectForKey:identifier];
		[item setTitle:title ? title : identifier];
		[item setTarget:self];
		[item setAction:@selector(_menuAction:)];
		[item setEnabled:YES];

		[menu addItem:item];
		[item release];
	}

	[menu setAutoenablesItems:YES];

	[_keyButton setMenu:menu];
}

- (void) _menuAction:(id)sender{
	_needsLayout = YES;

	if(delegate) [delegate keyValueRow:self choseKeyType:[keyTypeIdentifiers objectAtIndex:[sender tag]]];
}

- (BOOL) _menuShouldBeHidden{
	return (!editMode || ([keyTypeIdentifiers count] <= 1));
}

- (NSString *) _displayedKeyLabel{
	NSString *keyType = [self activeKeyType];
	NSString *label = [keyTypeLabels objectForKey:keyType];
	return label ? label : keyType;
}

#pragma mark -
#pragma mark Overrides

- (void) _layoutIfNeeded{
	if(_needsLayout){
		[valueRowView setFrame:NSMakeRect(splitPosition, 0, [self frame].size.width - splitPosition, [valueRowView neededHeight])];

		[_keyButton setFrame:NSMakeRect(0,
									    0,
										splitPosition + 4,
								        [[self _displayedKeyLabel] sizeWithAttributes:[self _labelAttributes]].height)];

		[_keyButton setHidden:[self _menuShouldBeHidden]];

		[self resetCursorRects];
		_needsLayout = NO;
	}
}

- (void) resizeSubviewsWithOldSize:(NSSize)size{
	[valueRowView setFrame:NSMakeRect(splitPosition, 0, [self frame].size.width - splitPosition, [valueRowView neededHeight])];
}

- (NSArray *)principalResponders{
	NSMutableArray *responders = [NSMutableArray array];

	if([keyTypeIdentifiers count] > 1) [responders addObject:_keyButton];
	[responders addObjectsFromArray:[valueRowView principalResponders]];

	return responders;
}

- (NSRectArray) requestedFocusRectArrayAndCount:(NSUInteger *)count{
	if (!valueRowView) return [super requestedFocusRectArrayAndCount:count];

	NSUInteger valueRowRectCount = 0;
	NSRectArray valueRowRects = [valueRowView requestedFocusRectArrayAndCount:&valueRowRectCount];
	for(NSUInteger i = 0; i < valueRowRectCount; i++){
		valueRowRects[i].origin.x += splitPosition;
	}

	*count = valueRowRectCount;
	return valueRowRects;
}

- (CGFloat) neededHeight{
	return MAX([valueRowView neededHeight], [[[_keyButton selectedItem] title] sizeWithAttributes:[self _labelAttributes]].height);
}

- (CGFloat) neededWidth{
	return splitPosition + WWKeyValueRow_HorizontalBuffer + [valueRowView neededWidth];
}

#pragma mark -
#pragma mark Drawing

- (void)drawRect:(NSRect)rect {
	[self _layoutIfNeeded];

	NSMutableDictionary *attrs = [self _labelAttributes];
	NSMutableParagraphStyle *style = [NSMutableParagraphStyle new];
	[style setAlignment:NSRightTextAlignment];
	[attrs setObject:[style autorelease] forKey:NSParagraphStyleAttributeName];

	NSAttributedString *styledLabel =  [[[NSAttributedString alloc] initWithString:[[_keyButton selectedItem] title] attributes:attrs] autorelease];
	NSSize labelRect = [styledLabel size];

	if(hover && !editMode){
		float capRadius = 7;

		[attrs setObject:[NSColor whiteColor] forKey:NSForegroundColorAttributeName];

		// Key side
		NSPoint startPoint = NSMakePoint(splitPosition - labelRect.width - capRadius - 4, labelRect.height / 2 );

		NSBezierPath *highlightPath = [NSBezierPath bezierPath];
		[highlightPath appendBezierPathWithArcWithCenter: startPoint radius: capRadius startAngle: 90.0f endAngle: 270.f clockwise: NO];
		[highlightPath appendBezierPathWithRect:NSMakeRect(splitPosition - labelRect.width - 4 - capRadius, 0, labelRect.width + WWKeyValueRow_HorizontalBuffer, labelRect.height)];

		[[NSColor colorWithCalibratedWhite:0 alpha:1-0.69] set];
		[highlightPath fill];

		// Value side
		highlightPath = [NSBezierPath bezierPath];
		[[NSColor colorWithCalibratedWhite:0 alpha:1-0.89] set];

		CGFloat highlightWidth = [self availableWidth] - [valueRowView availableWidth] + WWKeyValueRow_HorizontalBuffer;

		if([self neededHeight] > (labelRect.height + 3)){
			[highlightPath appendBezierPathWithRoundedRect:NSMakeRect(splitPosition + 1, 0, highlightWidth, [self neededHeight]) xRadius:capRadius yRadius:capRadius];
			[highlightPath appendBezierPathWithRect:NSMakeRect(splitPosition+1,0,capRadius,capRadius)];
		}else{
			[highlightPath appendBezierPathWithRoundedRect:NSMakeRect(splitPosition + 1, 0, highlightWidth, labelRect.height) xRadius:capRadius yRadius:capRadius];
			[highlightPath appendBezierPathWithRect:NSMakeRect(splitPosition+1,0,capRadius,labelRect.height)];
		}

		[highlightPath fill];
	}

	// Draw key label
	if([self _menuShouldBeHidden]){
		[[self _displayedKeyLabel]  drawInRect:NSMakeRect(0, 0, splitPosition - WWKeyValueRow_HorizontalBuffer, labelRect.height)
								withAttributes:attrs];
	}

	[super drawRect:rect];
}

- (BOOL) isFlipped{
	return YES;
}

#pragma mark -
#pragma mark Event Handling

- (void)mouseEntered:(NSEvent *)theEvent{
	hover = YES;
	[self setNeedsDisplay:YES];
}

- (void)mouseExited:(NSEvent *)theEvent{
	hover = NO;
	[self setNeedsDisplay:YES];
}

- (void)mouseMoved:(NSEvent *)theEvent{
	[self setNeedsDisplay:YES];
}

- (void)mouseDown:(NSEvent *)theEvent{
	NSPoint converted = [self convertPoint:[theEvent locationInWindow] fromView:[[self window] contentView]];
	if(actionMenu && NSPointInRect(converted, [self _labelMouseRect])){
		[NSMenu popUpContextMenu:actionMenu withEvent:theEvent forView:self];
	}
}

-(void)resetCursorRects{
    [self discardCursorRects];

    NSRect clippedItemBounds = [self _labelMouseRect];

    if (!NSIsEmptyRect(clippedItemBounds)) {
		[self addCursorRect:clippedItemBounds cursor:[NSCursor arrowCursor]];
		[self addTrackingRect:clippedItemBounds owner:self userData:nil assumeInside:NO];
    }
}

- (NSRect) _labelMouseRect{
	NSSize labelSize = [[self _displayedKeyLabel]sizeWithAttributes:[self _labelAttributes]];
    NSRect clippedItemBounds = NSIntersectionRect([self visibleRect], NSMakeRect(splitPosition - WWKeyValueRow_HorizontalBuffer - labelSize.width,0,labelSize.width, labelSize.height));
	return clippedItemBounds;
}
@end


text:
This project contains [Packer][] templates to help you deploy [hyperion][] on [DigitalOcean][].

## Prerequisites

* A Digital Ocean account

## Configure

The available variables that can be configured are:

* **api_token**: The client TOKEN to use to access your account
* **image**: The name (or slug) of the base image to use
* **region**: The name (or slug) of the region to launch the droplet in
* **size**: The name (or slug) of the droplet size to use

Edit *settings.json* and setup your data.

## Deploy

Build the image

    $ packer build --var-file=settings.json hyperion.json

[Packer]: https://www.packer.io/
[DigitalOcean]: https://www.digitalocean.com/

[hyperion]: http://github.com/portefaix/hyperion


text:
<?xml version="1.0" encoding="UTF-8"?>
<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">

<url>
  <loc>http://nihongo.io/</loc>
  <changefreq>weekly</changefreq>
</url>
<url>
  <loc>http://nihongo.io/info/about</loc>
  <changefreq>weekly</changefreq>
</url>
</urlset>


text:
.class Lcom/android/server/TwilightService$2;
.super Ljava/lang/Object;
.source "TwilightService.java"

# interfaces
.implements Landroid/location/LocationListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/server/TwilightService;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/android/server/TwilightService;

# direct methods
.method constructor <init>(Lcom/android/server/TwilightService;)V
    .locals 0
    .parameter

    .prologue
    .line 544
    iput-object p1, p0, Lcom/android/server/TwilightService$2;->this$0:Lcom/android/server/TwilightService;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public onLocationChanged(Landroid/location/Location;)V
    .locals 0
    .parameter "location"

    .prologue
    .line 546
    return-void
.end method

.method public onProviderDisabled(Ljava/lang/String;)V
    .locals 0
    .parameter "provider"

    .prologue
    .line 549
    return-void
.end method

.method public onProviderEnabled(Ljava/lang/String;)V
    .locals 0
    .parameter "provider"

    .prologue
    .line 552
    return-void
.end method

.method public onStatusChanged(Ljava/lang/String;ILandroid/os/Bundle;)V
    .locals 0
    .parameter "provider"
    .parameter "status"
    .parameter "extras"

    .prologue
    .line 555
    return-void
.end method


text:
package baidu.com.commontools.utils;

import android.content.Context;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.WindowManager;

public class MobileInfo {

    public static DisplayMetrics getScreenMetrics(Context context) {
        WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
        DisplayMetrics dm = new DisplayMetrics();
        wm.getDefaultDisplay().getMetrics(dm);
        return dm;
    }

    public static float dp2px(Context cxt, float dp) {
        return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp,
                cxt.getResources().getDisplayMetrics());
    }

}


text:
package org.apache.camel.component.undertow;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URI;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import io.undertow.Handlers;
import io.undertow.server.HttpHandler;
import io.undertow.server.HttpServerExchange;
import io.undertow.server.handlers.accesslog.AccessLogHandler;
import io.undertow.server.handlers.accesslog.AccessLogReceiver;
import io.undertow.server.handlers.accesslog.JBossLoggingAccessLogReceiver;
import io.undertow.server.handlers.form.EagerFormParsingHandler;
import io.undertow.util.Headers;
import io.undertow.util.HttpString;
import io.undertow.util.Methods;
import io.undertow.util.MimeMappings;
import io.undertow.util.StatusCodes;
import io.undertow.websockets.core.WebSocketChannel;
import io.undertow.websockets.spi.WebSocketHttpExchange;
import org.apache.camel.AsyncCallback;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.NoTypeConversionAvailableException;
import org.apache.camel.Processor;
import org.apache.camel.Suspendable;
import org.apache.camel.TypeConverter;
import org.apache.camel.component.undertow.UndertowConstants.EventType;
import org.apache.camel.component.undertow.handlers.CamelWebSocketHandler;
import org.apache.camel.support.CamelContextHelper;
import org.apache.camel.support.DefaultConsumer;
import org.apache.camel.support.EndpointHelper;
import org.apache.camel.util.CollectionStringBuffer;
import org.apache.camel.util.IOHelper;
import org.apache.camel.util.ObjectHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * The Undertow consumer which is also an Undertow HttpHandler implementation to handle incoming request.
 */
public class UndertowConsumer extends DefaultConsumer implements HttpHandler, Suspendable {

    private static final Logger LOG = LoggerFactory.getLogger(UndertowConsumer.class);
    private CamelWebSocketHandler webSocketHandler;
    private boolean rest;

    public UndertowConsumer(UndertowEndpoint endpoint, Processor processor) {
        super(endpoint, processor);
    }

    public boolean isRest() {
        return rest;
    }

    public void setRest(boolean rest) {
        this.rest = rest;
    }

    @Override
    public UndertowEndpoint getEndpoint() {
        return (UndertowEndpoint) super.getEndpoint();
    }

    public List<String> getAllowedRoles() {
        String allowedRolesString = getEndpoint().getAllowedRoles();
        return allowedRolesString == null ? null : Arrays.asList(allowedRolesString.split("\\s*,\\s*"));
    }

    @Override
    protected void doStart() throws Exception {
        super.doStart();
        final UndertowEndpoint endpoint = getEndpoint();
        if (endpoint.isWebSocket()) {
            /*
             * note that the new CamelWebSocketHandler() we pass to registerEndpoint() does not necessarily have to be
             * the same instance that is returned from there
             */
            this.webSocketHandler = (CamelWebSocketHandler) endpoint.getComponent().registerEndpoint(this, endpoint.getHttpHandlerRegistrationInfo(), endpoint.getSslContext(), new CamelWebSocketHandler());
            this.webSocketHandler.setConsumer(this);
        } else {
            // allow for HTTP 1.1 continue
            HttpHandler httpHandler = new EagerFormParsingHandler().setNext(UndertowConsumer.this);
            if (endpoint.getAccessLog()) {
                AccessLogReceiver accessLogReciever = null;
                if (endpoint.getAccessLogReceiver() != null) {
                    accessLogReciever = endpoint.getAccessLogReceiver();
                } else {
                    accessLogReciever = new JBossLoggingAccessLogReceiver();
                }
                httpHandler = new AccessLogHandler(httpHandler,
                        accessLogReciever,
                        "common",
                        AccessLogHandler.class.getClassLoader());
            }
            if (endpoint.getHandlers() != null) {
                httpHandler = this.wrapHandler(httpHandler, endpoint);
            }
            endpoint.getComponent().registerEndpoint(this, endpoint.getHttpHandlerRegistrationInfo(), endpoint.getSslContext(), Handlers.httpContinueRead(
                    // wrap with EagerFormParsingHandler to enable undertow form parsers
                    httpHandler));
        }
    }

    @Override
    protected void doStop() throws Exception {
        super.doStop();
        if (this.webSocketHandler != null) {
            this.webSocketHandler.setConsumer(null);
        }
        UndertowEndpoint endpoint = getEndpoint();
        endpoint.getComponent().unregisterEndpoint(this, endpoint.getHttpHandlerRegistrationInfo(), endpoint.getSslContext());
    }

    @Override
    public void handleRequest(HttpServerExchange httpExchange) throws Exception {
        HttpString requestMethod = httpExchange.getRequestMethod();

        if (Methods.OPTIONS.equals(requestMethod) && !getEndpoint().isOptionsEnabled()) {
            CollectionStringBuffer csb = new CollectionStringBuffer(",");

            Collection<HttpHandlerRegistrationInfo> handlers = getEndpoint().getComponent().getHandlers();
            for (HttpHandlerRegistrationInfo reg : handlers) {
                URI uri = reg.getUri();
                // what other HTTP methods may exists for the same path
                if (reg.getMethodRestrict() != null && getEndpoint().getHttpURI().equals(uri)) {
                    String restrict = reg.getMethodRestrict();
                    if (restrict.endsWith(",OPTIONS")) {
                        restrict = restrict.substring(0, restrict.length() - 8);
                    }
                    csb.append(restrict);
                }
            }
            String allowedMethods = csb.toString();
            if (ObjectHelper.isEmpty(allowedMethods)) {
                allowedMethods = getEndpoint().getHttpMethodRestrict();
            }
            if (ObjectHelper.isEmpty(allowedMethods)) {
                allowedMethods = "GET,HEAD,POST,PUT,DELETE,TRACE,OPTIONS,CONNECT,PATCH";
            }
            if (!allowedMethods.contains("OPTIONS")) {
                allowedMethods = allowedMethods + ",OPTIONS";
            }
            //return list of allowed methods in response headers
            httpExchange.setStatusCode(StatusCodes.OK);
            httpExchange.getResponseHeaders().put(ExchangeHeaders.CONTENT_LENGTH, 0);
            // do not include content-type as that would indicate to the caller that we can only do text/plain
            httpExchange.getResponseHeaders().put(Headers.ALLOW, allowedMethods);
            httpExchange.endExchange();
            return;
        }

        //perform blocking operation on exchange
        if (httpExchange.isInIoThread()) {
            httpExchange.dispatch(this);
            return;
        }

        if (getEndpoint().getSecurityProvider() != null) {
            //security provider decides, whether endpoint is accessible
            int statusCode = getEndpoint().getSecurityProvider().authenticate(httpExchange, getAllowedRoles());
            if (statusCode != StatusCodes.OK) {
                httpExchange.setStatusCode(statusCode);
                httpExchange.endExchange();
                return;
            }
        }

        //create new Exchange
        //binding is used to extract header and payload(if available)
        Exchange camelExchange = getEndpoint().createExchange(httpExchange);

        //Unit of Work to process the Exchange
        createUoW(camelExchange);
        try {
            getProcessor().process(camelExchange);
            sendResponse(httpExchange, camelExchange);
        } catch (Exception e) {
            getExceptionHandler().handleException(e);
        } finally {
            doneUoW(camelExchange);
        }
    }

    private void sendResponse(HttpServerExchange httpExchange, Exchange camelExchange) throws IOException, NoTypeConversionAvailableException {
        Object body = getResponseBody(httpExchange, camelExchange);

        if (body == null) {
            String message = httpExchange.getStatusCode() == 500 ? "Exception" : "No response available";
            LOG.trace("No payload to send as reply for exchange: {}", camelExchange);
            httpExchange.getResponseHeaders().put(ExchangeHeaders.CONTENT_TYPE, MimeMappings.DEFAULT_MIME_MAPPINGS.get("txt"));
            httpExchange.getResponseSender().send(message);
            return;
        }

        if (getEndpoint().isUseStreaming() && (body instanceof InputStream)) {
            httpExchange.startBlocking();
            try (InputStream input = (InputStream) body;
                 OutputStream output = httpExchange.getOutputStream()) {
                // flush on each write so that it won't cause OutOfMemoryError
                IOHelper.copy(input, output, IOHelper.DEFAULT_BUFFER_SIZE, true);
            }
        } else {
            TypeConverter tc = getEndpoint().getCamelContext().getTypeConverter();
            ByteBuffer bodyAsByteBuffer = tc.mandatoryConvertTo(ByteBuffer.class, body);
            httpExchange.getResponseSender().send(bodyAsByteBuffer);
        }
    }

    /**
     * Create an {@link Exchange} from the associated {@link UndertowEndpoint} and set the {@code in} {@link Message}'s
     * body to the given {@code message} and {@link UndertowConstants#CONNECTION_KEY} header to the given
     * {@code connectionKey}.
     *
     * @param connectionKey an identifier of {@link WebSocketChannel} through which the {@code message} was received
     * @param channel       the {@link WebSocketChannel} through which the {@code message} was received
     * @param message       the message received via the {@link WebSocketChannel}
     */
    public void sendMessage(final String connectionKey, WebSocketChannel channel, final Object message) {

        final Exchange exchange = getEndpoint().createExchange();

        // set header and body
        exchange.getIn().setHeader(UndertowConstants.CONNECTION_KEY, connectionKey);
        if (channel != null) {
            exchange.getIn().setHeader(UndertowConstants.CHANNEL, channel);
        }
        exchange.getIn().setBody(message);

        // send exchange using the async routing engine
        getAsyncProcessor().process(exchange, new AsyncCallback() {
            public void done(boolean doneSync) {
                if (exchange.getException() != null) {
                    getExceptionHandler().handleException("Error processing exchange", exchange,
                            exchange.getException());
                }
            }
        });
    }

    /**
     * Send a notification related a WebSocket peer.
     *
     * @param connectionKey     of WebSocket peer
     * @param transportExchange the exchange for the websocket transport, only available for ON_OPEN events
     * @param channel           the {@link WebSocketChannel} through which the {@code message} was received
     * @param eventType         the type of the event
     */
    public void sendEventNotification(String connectionKey, WebSocketHttpExchange transportExchange, WebSocketChannel channel, EventType eventType) {
        final Exchange exchange = getEndpoint().createExchange();

        final Message in = exchange.getIn();
        in.setHeader(UndertowConstants.CONNECTION_KEY, connectionKey);
        in.setHeader(UndertowConstants.EVENT_TYPE, eventType.getCode());
        in.setHeader(UndertowConstants.EVENT_TYPE_ENUM, eventType);
        if (channel != null) {
            in.setHeader(UndertowConstants.CHANNEL, channel);
        }
        if (transportExchange != null) {
            in.setHeader(UndertowConstants.EXCHANGE, transportExchange);
        }
        // send exchange using the async routing engine
        getAsyncProcessor().process(exchange, new AsyncCallback() {
            public void done(boolean doneSync) {
                if (exchange.getException() != null) {
                    getExceptionHandler().handleException("Error processing exchange", exchange, exchange.getException());
                }
            }
        });
    }

    private Object getResponseBody(HttpServerExchange httpExchange, Exchange camelExchange) throws IOException {
        return getEndpoint().getUndertowHttpBinding().toHttpResponse(httpExchange, camelExchange.getMessage());
    }

    private HttpHandler wrapHandler(HttpHandler handler, UndertowEndpoint endpoint) {
        HttpHandler nextHandler = handler;
        String[] handlders = endpoint.getHandlers().split(",");
        for (String obj : handlders) {
            if (EndpointHelper.isReferenceParameter(obj)) {
                obj = obj.substring(1);
            }
            CamelUndertowHttpHandler h = CamelContextHelper.mandatoryLookup(endpoint.getCamelContext(), obj, CamelUndertowHttpHandler.class);
            h.setNext(nextHandler);
            nextHandler = h;
        }
        return nextHandler;
    }

}


text:
package resource

import (
	"github.com/stellar/go-stellar-base/amount"
	"github.com/stellar/horizon/assets"
	"github.com/stellar/horizon/db2/core"
	"github.com/stellar/horizon/httpx"
	"github.com/stellar/horizon/render/hal"
	"golang.org/x/net/context"
)

func (this *Offer) Populate(ctx context.Context, row core.Offer) {
	this.ID = row.OfferID
	this.PT = row.PagingToken()
	this.Seller = row.SellerID
	this.Amount = amount.String(row.Amount)
	this.PriceR.N = row.Pricen
	this.PriceR.D = row.Priced
	this.Price = row.PriceAsString()
	this.Buying = Asset{
		Type:   assets.MustString(row.BuyingAssetType),
		Code:   row.BuyingAssetCode.String,
		Issuer: row.BuyingIssuer.String,
	}
	this.Selling = Asset{
		Type:   assets.MustString(row.SellingAssetType),
		Code:   row.SellingAssetCode.String,
		Issuer: row.SellingIssuer.String,
	}

	lb := hal.LinkBuilder{httpx.BaseURL(ctx)}
	this.Links.Self = lb.Linkf("/offers/%d", row.OfferID)
	this.Links.OfferMaker = lb.Linkf("/accounts/%s", row.SellerID)
	return
}

func (this Offer) PagingToken() string {
	return this.PT
}


text:
package me.vilsol.nmswrapper.wraps.unparsed;

import me.vilsol.nmswrapper.*;
import me.vilsol.nmswrapper.reflections.*;
import me.vilsol.nmswrapper.wraps.*;

@ReflectiveClass(name = "ExceptionEntityNotFound")
public class NMSExceptionEntityNotFound extends NMSCommandException {

    public NMSExceptionEntityNotFound(Object nmsObject){
        super(nmsObject);
    }

    public NMSExceptionEntityNotFound(String s, Object[] array){
        super("ExceptionEntityNotFound", new Object[]{String.class, Object[].class}, new Object[]{s, array});
    }

}


text:
//---------------------------------------------------------------------------------------
// This file is part of the Lomse library.
// Copyright (c) 2010-present, Lomse Developers
//
// Licensed under the MIT license.
//
// See LICENSE and NOTICE.md files in the root directory of this source tree.
//---------------------------------------------------------------------------------------

//  This file is based on Anti-Grain Geometry version 2.4 examples' code and on
//  Agg2D version 1.0 code.
//
//  Anti-Grain Geometry (AGG) is copyright (C) 2002-2005 Maxim Shemanarev
//  (http://www.antigrain.com). AGG 2.4 is distributed as follows:
//    "Permission to copy, use, modify, sell and distribute this software
//    is granted provided this copyright notice appears in all copies.
//    This software is provided "as is" without express or implied
//    warranty, and with no claim as to its suitability for any purpose."
//
//---------------------------------------------------------------------------------------

#ifndef __LOMSE_SCREEN_DRAWER_H__        //to avoid nested includes
#define __LOMSE_SCREEN_DRAWER_H__

#include "lomse_drawer.h"
#include "lomse_pixel_formats.h"
#include "lomse_agg_types.h"
#include "lomse_path_attributes.h"
#include "lomse_font_storage.h"
#include "lomse_calligrapher.h"

using namespace agg;

namespace lomse
{

//forward declarations
class Renderer;

//---------------------------------------------------------------------------------------
/** %BitmapDrawer: a Drawer that renders on a bitmap using agg
*/
class LOMSE_EXPORT BitmapDrawer : public Drawer
{
private:
    AttrStorage     m_attr_storage;
    PathStorage     m_path;
    Renderer*       m_pRenderer;
//    TextMeter*      m_pTextMeter;
    Calligrapher*   m_pCalligrapher;
    int             m_numPaths;
    RenderingBuffer m_rbuf;
    unsigned char*  m_pBuf;         //the memory for the bitmap. Owned by user app.
    unsigned        m_bufWidth;
    unsigned        m_bufHeight;

public:
    BitmapDrawer(LibraryScope& libraryScope);
    virtual ~BitmapDrawer();

    //===================================================================
    // Implementation of pure virtual methods in Drawer base class
    //===================================================================

    // SVG path commands
    // http://www.w3.org/TR/SVG/paths.html#PathData
    void begin_path() override;                                  //SVG: <path>
    void end_path() override;                                    //SVG: </path>
    void close_path() override;                               //SVG: Z, z
    // not the same but similar to SVG path element
    void add_path(VertexSource& vs, unsigned path_id = 0, bool solid_path = true) override;
    void move_to(double x, double y) override;                   //SVG: M
    void move_to_rel(double x, double y) override;               //SVG: m
    void line_to(double x,  double y) override;                  //SVG: L
    void line_to_rel(double x,  double y) override;              //SVG: l
    void hline_to(double x) override;                            //SVG: H
    void hline_to_rel(double x) override;                        //SVG: h
    void vline_to(double y) override;                            //SVG: V
    void vline_to_rel(double y) override;                        //SVG: v

    void quadratic_bezier(double x1, double y1,                  //SVG: Q  quadratic Bézier, abs (x1 y1 x y)
                          double x, double y) override;

    void quadratic_bezier_rel(double x1, double y1,              //SVG: q  quadratic Bézier, rel (x1 y1 x y)
                              double x, double y) override;

    void quadratic_bezier(double x, double y) override;          //SVG: T  smooth quadratic Bézier, abs (x y)

    void quadratic_bezier_rel(double x, double y) override;      //SVG: t  smooth quadratic Bézier, rel (x y)

    /** Draws a cubic Bézier curve from the current point to (x,y) using (x1,y1) as
        the control point at the beginning of the curve and (x2,y2) as the control
        point at the end of the curve. All points in absolute coordinates.
        It is equivalent to the C svg command.
    */
    void cubic_bezier(double x1, double y1,                      //SVG: C  cubic Bézier, abs (x1 y1 x2 y2 x y)
                      double x2, double y2,
                      double x, double y) override;

    /** Draws a cubic Bézier curve from the current point to (x,y) using (x1,y1) as
        the control point at the beginning of the curve and (x2,y2) as the control
        point at the end of the curve. All points in absolute coordinates.
        It is equivalent to the c svg command.
    */
    void cubic_bezier_rel(double x1, double y1,                  //SVG: c  cubic Bézier, rel (x1 y1 x2 y2 x y)
                          double x2, double y2,
                          double x, double y) override;

    /** Draws a cubic Bézier curve from the current point to (x,y). The first control
        point is assumed to be the reflection of the second control point on the previous
        command relative to the current point. (If there is no previous command or if
        the previous command was not an C, c, S or s, assume the first control point
        is coincident with the current point.) (x2,y2) is the second control point
        (i.e., the control point at the end of the curve).
        All points in absolute coordinates.
        It is equivalent to the S svg command.
    */
    void cubic_bezier(double x2, double y2,                      //SVG: S  smooth cubic Bézier, abs (x2 y2 x y)
                      double x, double y) override;

    /** Draws a cubic Bézier curve from the current point to (x,y). The first control
        point is assumed to be the reflection of the second control point on the previous
        command relative to the current point. (If there is no previous command or if
        the previous command was not an C, c, S or s, assume the first control point
        is coincident with the current point.) (x2,y2) is the second control point
        (i.e., the control point at the end of the curve).
        All points in relative coordinates.
        It is equivalent to the s svg command.
    */
    void cubic_bezier_rel(double x2, double y2,                  //SVG: s  smooth cubic Bézier, rel (x2 y2 x y)
                          double x, double y) override;

    // SVG basic shapes commands
    void rect(UPoint pos, USize size, LUnits radius) override;               //SVG: <rect>                                      //SVG: <rect>
    void circle(LUnits xCenter, LUnits yCenter, LUnits radius) override;     //SVG: <circle>
    //virtual void ellipse() = 0;                                            //SVG: <ellipse>
    void line(LUnits x1, LUnits y1, LUnits x2, LUnits y2,
              LUnits width, ELineEdge nEdge=k_edge_normal) override;         //SVG: <line>
    //virtual void polyline() = 0;                                           //SVG: <polyline>
    void polygon(int n, UPoint points[]) override;                           //SVG: <polygon>
    //SVG line with start/end markers
    void line_with_markers(UPoint start, UPoint end, LUnits width,
                           ELineCap startCap, ELineCap endCap) override;

    // Attribute setting functions.
    void fill(Color color) override;
    void fill_none() override;
    void stroke(Color color) override;
    void stroke_none() override;
    void stroke_width(double w) override;
    void gradient_color(Color c1, Color c2, double start, double stop) override;
    void gradient_color(Color c1, double start, double stop) override;
    void fill_linear_gradient(LUnits x1, LUnits y1, LUnits x2, LUnits y2) override;
    #if (0)
    void even_odd(bool flag) override;
    void fill_opacity(unsigned op) override;
    void stroke_opacity(unsigned op) override;
    void line_join(line_join_e join) override;
    void line_cap(line_cap_e cap) override;
    void miter_limit(double ml) override;
    #endif

    // text rederization
    //-----------------------
    bool select_font(const std::string& language,
                     const std::string& fontFile,
                     const std::string& fontName, double height,
                     bool fBold=false, bool fItalic=false) override;

    int draw_text(double x, double y, const std::string& str) override;
    int draw_text(double x, double y, const wstring& str) override;
    void draw_glyph(double x, double y, unsigned int ch) override;
    void draw_glyph_rotated(double x, double y, unsigned int ch, double rotation) override;

    //copy/blend a bitmap
    //-----------------------
    #if (0)
    void copy_bitmap(RenderingBuffer& bmap, UPoint pos) override;
    void copy_bitmap(RenderingBuffer& bmap,
                     Pixels srcX1, Pixels srcY1, Pixels srcX2, Pixels srcY2,
                     UPoint dest) override;
    #endif
    void draw_bitmap(RenderingBuffer& bmap, bool hasAlpha,
                     Pixels srcX1, Pixels srcY1, Pixels srcX2, Pixels srcY2,
                     LUnits dstX1, LUnits dstY1, LUnits dstX2, LUnits dstY2,
                     EResamplingQuality resamplingMode,
                     double alpha=1.0) override;

    // settings
    //-----------------------
    void set_shift(LUnits x, LUnits y) override;
    void remove_shift() override;
    void render() override;
    void set_affine_transformation(TransAffine& transform) override;

    /** Set the background color and prepare to render a new image.  */
    void reset(Color bgcolor) override;

    // device - model units conversion
    //-------------------------------------
    void device_point_to_model(double* x, double* y) const override;
    void model_point_to_device(double* x, double* y) const override;
    LUnits device_units_to_model(double value) const override;
    double model_to_device_units(LUnits value) const override;

    //info
    //---------------------------------------
    bool is_ready() const override;

    //Viewport info
    //---------------------------------------
    //coordinates in device units (e.g. Pixel)
    void new_viewport_origin(double x, double y) override;
    void new_viewport_size(double x, double y) override;

    //===================================================================
    // Specific methods not in Drawer base class
    //===================================================================

    //Inform about the RenderingBuffer to use and clear it with the desired color.
    void set_rendering_buffer(unsigned char* buf, unsigned width, unsigned height,
                              Color bgcolor=Color(255,255,255));

    //The view area is the region to which drawing is restricted. View area must be
    //given in device coordinates (e.g. Pixel).
    void set_view_area(unsigned width, unsigned height, unsigned xShift, unsigned yShift);

    unsigned char* get_rendering_buffer() { return m_pBuf; };
    unsigned get_rendering_buffer_width() const { return m_bufWidth; };
    unsigned get_rendering_buffer_height() const { return m_bufHeight; };

protected:
    void push_attr();
    void pop_attr();
    PathAttributes& cur_attr();
    void render_existing_paths();
    void delete_paths();

};

}   //namespace lomse

#endif    // __LOMSE_SCREEN_DRAWER_H__


text:
@interface MyClass : NSObject <SomeProtocol>

@property(nonatomic, strong) IBOutlet UILabel *label;

- (void)doSomething;
- (NSString *)somethingWithArg1:(id)arg1 arg2:(int)arg2;

+ (void)classMethod;

@end

@interface MyClass(Category1)

- (void)category1Method;

@end


text:
<?php
    //Require other files.
    require_once 'Settings.php';
    require_once 'AuthorizationHelperForGraph.php';

    class GraphServiceAccessHelper
    {
        // Constructs a Http GET request to a feed passed in as paremeter.
        // Returns the json decoded respone as the objects that were recieved in feed.
        public static function getFeed($feedName){
            // initiaze curl which is used to make the http request.
            $ch = curl_init();
            // Add authorization and other headers. Also set some common settings.
            self::AddRequiredHeadersAndSettings($ch);
            // set url
            $feedURL = "https://graph.windows.net/".Settings::$appTenantDomainName."/".$feedName;
            $feedURL = $feedURL."?".Settings::$apiVersion;
            curl_setopt($ch, CURLOPT_URL, $feedURL);
            //Enable fiddler to capture request
            //curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:8888');

            // $output contains the output string
            $output = curl_exec($ch);
            // close curl resource to free up system resources
            curl_close($ch);
            $jsonOutput = json_decode($output);
            // There is a field for odata metadata that we ignore and just consume the value
            return $jsonOutput->{'value'};
        }

        // Constructs a Http GET request to a linked feed based on the source entry and navigation property name.
        public static function getLinkedFeed($sourceFeedName, $sourceEntryId, $navigationPropertyName){
            //initiaze curl which is used to make the http request
            $ch = curl_init();
            // Add authorization and other headers. Also set some common settings.
            self::AddRequiredHeadersAndSettings($ch);
            // create URL to the linked feed by using the navigation property name and the key value for the source entry.
            $feedURL = "https://graph.windows.net/".Settings::$appTenantDomainName."/".$sourceFeedName .'(\''. $sourceEntryId . '\')' .'/'.$navigationPropertyName;
            $feedURL = $feedURL."?".Settings::$apiVersion;
            curl_setopt($ch, CURLOPT_URL, $feedURL);
            //Enable fiddler to capture request
            //curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:8888');

            // $output contains the output string
            $output = curl_exec($ch);
            // close curl resource to free up system resources
            curl_close($ch);
            $jsonOutput = json_decode($output);
            // There is a field for odata metadata that we ignore and just consume the value
            return $jsonOutput->{'value'};
        }

        // Constructs a Http GET request to a feed passed in as paremeter and uses the field information as the filter clause.
        // Returns the json decoded respone as the objects that were recieved in feed.
        public static function getFeedWithFilterClause($feedName, $fieldName, $fieldValue){
            //initiaze curl which is used to make the http request
            $ch = curl_init();
            // Add authorization and other headers. Also set some common settings.
            self::AddRequiredHeadersAndSettings($ch);
            // set url based on the filter clause. This uses the standard OData syntax to create the filter clause.
            $feedURL = "https://graph.windows.net/".Settings::$appTenantDomainName."/".$feedName .'?$filter='.$fieldName.urlencode(' eq ')
                       .'(\''.urlencode($fieldValue).'\')';
            $feedURL = $feedURL."&api-version=2013-04-05";
            curl_setopt($ch, CURLOPT_URL, $feedURL);
            //Enable fiddler to capture request
            //curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:8888');

            // $output contains the output string
            $output = curl_exec($ch);
            // close curl resource to free up system resources
            curl_close($ch);
            $jsonOutput = json_decode($output);
            // There is a field for odata metadata that we ignore and just consume the value
            return $jsonOutput->{'value'};
        }

        // Constructs a Http GET request to fetch an entry based on the feed name and the key value passed in.
        // Returns the json decoded respone as the objects that were recieved in feed.
        public static function getEntry($feedName, $keyValue){
            // initiaze curl which is used to make the http request
            $ch = curl_init();
            // Add authorization and other headers. Also set some common settings.
            self::AddRequiredHeadersAndSettings($ch);
            // Create url for the entry based on the feedname and the key value
            $feedURL = 'https://graph.windows.net/'.Settings::$appTenantDomainName.'/'.$feedName.'(\''. $keyValue .'\')';
            $feedURL = $feedURL."?".Settings::$apiVersion;
            curl_setopt($ch, CURLOPT_URL, $feedURL);
            //Enable fiddler to capture request
            //curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:8888');

            // $output contains the output string
            $output = curl_exec($ch);
            // close curl resource to free up system resources
            curl_close($ch);
            $jsonOutput = json_decode($output);
            return $jsonOutput;
        }

        // Constructs a HTTP POST request for creating and adding an entry
        // to a feed based on the feed name and data passed in.
        public static function addEntryToFeed($feedName, $entry){
            //initiaze curl which is used to make the http request
            $ch = curl_init();
            // Add authorization and other headers. Also set some common settings.
            self::AddRequiredHeadersAndSettings($ch);
            // set url
            $feedURL = "https://graph.windows.net/".Settings::$appTenantDomainName.'/'.$feedName;
            $feedURL = $feedURL."?".Settings::$apiVersion;
            curl_setopt($ch, CURLOPT_URL, $feedURL);
            // Mark as Post request
            curl_setopt($ch, CURLOPT_POST, 1);
            $data = json_encode($entry);
            // Set the data for the post request
            curl_setopt($ch, CURLOPT_POSTFIELDS,  $data);
            //Enable fiddler to capture request
            //curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:8888');
            // read the output from the post request
            $output = curl_exec($ch);
            // close curl resource to free up system resources
            curl_close($ch);
            // decode the response json decoder
            $createdEntry = json_decode($output);
            return $createdEntry;
        }

        // Constructs a HTTP POST request for creating and adding a link
        // between two existing entries using the source and target URLs and the navigation property name.
        public static function addLinkForEntries($sourceEntryUrl, $targetEntryUrl, $navigationPropertyName){
            //initiaze curl which is used to make the http request
            $ch = curl_init();
            // Add authorization and other headers. Also set some common settings.
            self::AddRequiredHeadersAndSettings($ch);
            // set url
            $feedURL = 'https://graph.windows.net/'.Settings::$appTenantDomainName.'/'.$sourceEntryUrl.'/$links/'.$navigationPropertyName;
            $feedURL = $feedURL."?".Settings::$apiVersion;
            curl_setopt($ch, CURLOPT_URL, $feedURL);
            // Mark as Post request
            curl_setopt($ch, CURLOPT_POST, 1);
            $data = json_encode($targetEntryUrl);
            // Set the data for the post request
            curl_setopt($ch, CURLOPT_POSTFIELDS,  $data);
            //Enable fiddler to capture request
            //curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:8888');

            // read the output from the post request
            $output = curl_exec($ch);
            // close curl resource to free up system resources
            curl_close($ch);
            // decode the response json decoder
            $createdEntry = json_decode($output);
            return $createdEntry;
        }

        // Constructs a HTTP PATCH request for updating an entry.
        public static function updateEntry($feedName, $keyValue, $entry){
            //initiaze curl which is used to make the http request
            $ch = curl_init();
            self::AddRequiredHeadersAndSettings($ch);
            // set url
            $feedURL = "https://graph.windows.net/".Settings::$appTenantDomainName.'/'.$feedName.'(\''. $keyValue .'\')';
            $feedURL = $feedURL."?".Settings::$apiVersion;
            curl_setopt($ch, CURLOPT_URL, $feedURL);

            // Mark as Patch request
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
                        //Enable fiddler to capture request
            //curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:8888');

            $data = json_encode($entry);
            // Set the data for the request
            curl_setopt($ch, CURLOPT_POSTFIELDS,  $data);
            // read the output from the request
            $output = curl_exec($ch);
            // close curl resource to free up system resources
            curl_close($ch);
            // decode the response json decoder
            $udpatedEntry = json_decode($output);
            return $udpatedEntry;
        }

        // Constructs a HTTP DELETE request for deleting an entry.
        public static function deleteEntry($feedName, $keyValue){
            //initiaze curl which is used to make the http request
            $ch = curl_init();
                        self::AddRequiredHeadersAndSettings($ch);
            // set url
            $feedURL = "https://graph.windows.net/".Settings::$appTenantDomainName.'/'.$feedName.'(\''. $keyValue .'\')';
            $feedURL = $feedURL."?".Settings::$apiVersion;
            curl_setopt($ch, CURLOPT_URL, $feedURL);

                        //Enable fiddler to capture request
            //curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:8888');

            // Mark as Post request
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
            // read the output from the post request
            $output = curl_exec($ch);
            // close curl resource to free up system resources
            curl_close($ch);
            // decode the response json decoder
            $deletedEntry = json_decode($output);
            return $deletedEntry;
        }

        // Constructs a Http GET request get changes for the type passed in.
        // Returns the json decoded respone as the objects that were recieved in feed.
        public static function getDeltaLinkFeed($feedURL, $feedName){
            if ($feedName == NULL)
            {
                $feedName = "directoryObjects";
            }

            // initiaze curl which is used to make the http request.
            $ch = curl_init();
            // Add authorization and other headers. Also set some common settings.
            self::AddRequiredHeadersAndSettings($ch);
            // set url
            if ($feedURL == NULL)
            {
                $feedURL = "https://graph.windows.net/".Settings::$appTenantDomainName."/".$feedName;
                $feedURL = $feedURL."?deltaLink=";
            }

            // add api-version always to indicate the target version
            $feedURL = $feedURL."&api-version=2013-04-05";

            curl_setopt($ch, CURLOPT_URL, $feedURL);
            // $output contains the output string
            $output = curl_exec($ch);
            // close curl resource to free up system resources
            curl_close($ch);
            $jsonOutput = json_decode($output);
            // There is a field for odata metadata that we ignore and just consume the value
            return $jsonOutput;
        }

        // Add required headers like authorization header, service version etc.
        public static function AddRequiredHeadersAndSettings($ch)
        {
            //Generate the authentication header
            $authHeader = AuthorizationHelperForAADGraphService::GetAuthenticationHeader(Settings::$appTenantDomainName, Settings::$appPrincipalId, Settings::$password);
            // Add authorization header, request/response format header( for json) and a header to request content for Update and delete operations.
            curl_setopt($ch, CURLOPT_HTTPHEADER, array($authHeader,  'Accept:application/json;odata=minimalmetadata',
                                                        'Content-Type:application/json;odata=minimalmetadata', 'Prefer:return-content'));
            // Set the option to recieve the response back as string.
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            // By default https does not work for CURL.
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        }
    }
?>


text:
* lib_BSP_HY-STM32

HY-STM32 board support library for onboard components: 4 LEDs, 4 buttons and buzzer.

### How do I get set up? ###

If using BUTTON_MODE_EXTI, interrupt handler for EXTI line must be configured in the program.

### Usage example ###
```C
  void EXTI2_IRQHandler(void) {
    if(EXTI_GetITStatus(EXTI_Line2) != RESET) {
      // BUTTON4 is pressed
    }
    EXTI_ClearITPendingBit(EXTI_Line2);
  }
  ...

  uint32_t button_state;

  BSP_Buzzer_Init();
  ...
  BSP_Buzzer_On();
  ...

  BSP_LED_Init(LED1);
  ...
  BSP_LED_On(LED1);
  ...
  BSP_Button_Init(BUTTON3,BUTTON_MODE_GPIO);
  BSP_Button_Init(BUTTON4,BUTTON_MODE_EXTI);
  ...
  button_state=BSP_Button_GetState(BUTTON3);
  ...
```


text:
include(hunter_add_version)
include(hunter_cacheable)
include(hunter_download)
include(hunter_pick_scheme)

hunter_add_version(
    PACKAGE_NAME
    SQLite
    VERSION
    "1.0.0"
    URL
    "https://github.com/hunter-packages/SQLite/archive/v1.0.0.tar.gz"
    SHA1
    5b3a005b2836a97767b7cfeaf23cb15d20a0ce33
)

hunter_pick_scheme(DEFAULT url_sha1_cmake)
hunter_cacheable(SQLite)
hunter_download(PACKAGE_NAME SQLite)


text:
package com.intellij.openapi.roots.ui.configuration;

import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleConfigurationEditor;
import com.intellij.openapi.project.Project;
import com.intellij.ui.navigation.Place;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;

/**
 * @author ksafonov
 */
public class HeaderHidingTabbedModuleEditor extends TabbedModuleEditor {

  public HeaderHidingTabbedModuleEditor(Project project, ModulesProvider modulesProvider, @NotNull Module module) {
    super(project, modulesProvider, module);
  }

  @Override
  protected JComponent createCenterPanel() {
    ModuleConfigurationEditor singleEditor = getSingleEditor();
    if (singleEditor != null) {
      final JComponent component = singleEditor.createComponent();
      singleEditor.reset();
      return component;
    }
    else {
      return super.createCenterPanel();
    }
  }

  @Nullable
  private ModuleConfigurationEditor getSingleEditor() {
    return myEditors.size() == 1 ? myEditors.get(0) : null;
  }

  @Override
  public ModuleConfigurationEditor getSelectedEditor() {
    ModuleConfigurationEditor singleEditor = getSingleEditor();
    return singleEditor != null ? singleEditor : super.getSelectedEditor();
  }

  @Override
  public void selectEditor(String displayName) {
    if (displayName != null) {
      ModuleConfigurationEditor singleEditor = getSingleEditor();
      if (singleEditor != null) {
        // TODO [ksafonov] commented until IDEA-73889 is implemented
        //assert singleEditor.getDisplayName().equals(displayName);
      }
      else {
        super.selectEditor(displayName);
      }
    }
  }

  @Override
  protected void restoreSelectedEditor() {
    ModuleConfigurationEditor singleEditor = getSingleEditor();
    if (singleEditor == null) {
      super.restoreSelectedEditor();
    }
  }

  @Override
  @Nullable
  public ModuleConfigurationEditor getEditor(@NotNull String displayName) {
    ModuleConfigurationEditor singleEditor = getSingleEditor();
    if (singleEditor != null) {
      if (displayName.equals(singleEditor.getDisplayName())) {
        return singleEditor;
      }
      else {
        return null;
      }
    }
    else {
      return super.getEditor(displayName);
    }
  }

  @Override
  protected void disposeCenterPanel() {
    if (getSingleEditor() == null) {
      super.disposeCenterPanel();
    }
  }

  @Override
  public void queryPlace(@NotNull Place place) {
    ModuleConfigurationEditor singleEditor = getSingleEditor();
    if (singleEditor != null) {
      place.putPath(ModuleEditor.SELECTED_EDITOR_NAME, singleEditor.getDisplayName());
    }
    else {
      super.queryPlace(place);
    }
  }
}


text:
<?php
session_start();
if(isset($_SESSION['username'])){
  header('Location: home.php');
}
$next = 'home.php';
if(isset($_GET['next'])) $next=$_GET['next'];
?>
<!DOCTYPE html>

  <title>Visitor Management System</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

Visitor Management System

Login Page

Login

  <form class="form-horizontal" id="login" action="auth.php?next=<?php echo $next; ?>" method="POST">

      Username:

        <input type="text" class="form-control" id="username" name="username" placeholder="Enter username" value="<?php if(isset($_SESSION['errorusr'])) echo $_SESSION['errorusr']; ?>" required>

      Password:

        <input type="password" class="form-control" id="password" name="password" placeholder="Enter password" required>

        <button type="submit" class="btn btn-default">Submit</button>

    <?php if(isset($_GET['next'])) { echo '

  			Please log in to continue.

  	';}?>
	<?php if(isset($_SESSION['errMsg'])) { echo '

			Alert! '.$_SESSION['errMsg'].'

	';session_destroy();}?>
	<?php if(isset($_GET['logout'])) {
	if($_GET['logout']==true){
	echo '

			Success! You have successfully logged out.

	';}}?>
  </form>


text:
package com.edwardvanraak.materialbarcodescanner;

import android.Manifest;
import android.content.pm.PackageManager;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.FrameLayout;

import com.google.android.gms.vision.barcode.Barcode;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

public class MaterialBarcodeScanner {

    /**
     * Request codes
     */
    public static final int RC_HANDLE_CAMERA_PERM = 2;

    /**
     * Scanner modes
     */
    public static final int SCANNER_MODE_FREE = 1;
    public static final int SCANNER_MODE_CENTER = 2;

    protected final MaterialBarcodeScannerBuilder materialBarcodeScannerBuilder;

    private MaterialBarcodeScannerFragment materialBarcodeScannerFragment;

    private FrameLayout mContentView; //Content frame for fragments

    private OnResultListener onResultListener;

    public MaterialBarcodeScanner(@NonNull MaterialBarcodeScannerBuilder materialBarcodeScannerBuilder) {
        this.materialBarcodeScannerBuilder = materialBarcodeScannerBuilder;
    }

    public void setOnResultListener(OnResultListener onResultListener) {
        this.onResultListener = onResultListener;
    }

    @Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
    public void onBarcodeScannerResult(Barcode barcode) {
        onResultListener.onResult(barcode);
        EventBus.getDefault().removeStickyEvent(barcode);
        EventBus.getDefault().unregister(this);
        materialBarcodeScannerBuilder.clean();
    }

    /**
     * Interface definition for a callback to be invoked when a view is clicked.
     */
    public interface OnResultListener {
        void onResult(Barcode barcode);
    }

    /**
     * Start a scan for a barcode
     * <p>
     * This opens a new activity with the parameters provided by the MaterialBarcodeScannerBuilder
     */
    public void startScan() {
        EventBus.getDefault().register(this);
        if (materialBarcodeScannerBuilder.getActivity() == null) {
            throw new RuntimeException("Could not start scan: Activity reference lost (please rebuild the MaterialBarcodeScanner before calling startScan)");
        }
        int mCameraPermission = ActivityCompat.checkSelfPermission(materialBarcodeScannerBuilder.getActivity(), Manifest.permission.CAMERA);
        if (mCameraPermission != PackageManager.PERMISSION_GRANTED) {
            requestCameraPermission();
        }
        else {
            //Open activity
            EventBus.getDefault().postSticky(this);

            // new code - attempting to start a fragment
            FragmentManager fragmentManager = ((AppCompatActivity) materialBarcodeScannerBuilder.getActivity()).getSupportFragmentManager();
            materialBarcodeScannerFragment = MaterialBarcodeScannerFragment.newInstance(null);

            int id = materialBarcodeScannerBuilder.getRootView().getId();

            fragmentManager.beginTransaction()
                .replace(id, materialBarcodeScannerFragment)
                .addToBackStack(MaterialBarcodeScannerFragment.class.getSimpleName())
                .commit();
            // end

            // original code that starts an activity - and it works
            //
            //Intent intent = new Intent(materialBarcodeScannerBuilder.getActivity(), MaterialBarcodeScannerActivity.class);
            //materialBarcodeScannerBuilder.getActivity().startActivity(intent);
        }
    }

    public MaterialBarcodeScannerFragment getMaterialBarcodeScannerFragment() {
        return materialBarcodeScannerFragment;
    }

    protected void requestCameraPermission() {
        final String[] mPermissions = new String[]{Manifest.permission.CAMERA};
        if (!ActivityCompat.shouldShowRequestPermissionRationale(materialBarcodeScannerBuilder.getActivity(), Manifest.permission.CAMERA)) {
            ActivityCompat.requestPermissions(materialBarcodeScannerBuilder.getActivity(), mPermissions, RC_HANDLE_CAMERA_PERM);
            return;
        }
        View.OnClickListener listener = new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                ActivityCompat.requestPermissions(materialBarcodeScannerBuilder.getActivity(), mPermissions, RC_HANDLE_CAMERA_PERM);
            }
        };
        Snackbar.make(materialBarcodeScannerBuilder.getRootView(), R.string.permission_camera_rationale,
            Snackbar.LENGTH_INDEFINITE)
            .setAction(android.R.string.ok, listener)
            .show();
    }

    public MaterialBarcodeScannerBuilder getMaterialBarcodeScannerBuilder() {
        return materialBarcodeScannerBuilder;
    }

}


text:
var utils = require('./utils.js');
var Campaign = require('./campaign.js');

module.exports = function (createsend) {
    return {
        createsend: createsend,

        create: function (clientId, campaign, callback) {
            var createsend = this.createsend;
            createsend.post('campaigns/' + clientId + '.json', null, campaign, function (err, result) {
                if (err) {
                    callback(err);
                    return;
                }

                callback(null, new Campaign(createsend, result));
          });
        },

        createFromTemplate: function (clientId, campaign, callback) {
            var createsend = this.createsend;
            createsend.post('campaigns/' + clientId + '/fromtemplate.json', null, campaign, function (err, result) {
                if (err) {
                    callback(err);
                    return;
                }

                callback(null, new Campaign(createsend, result));
            });
        },

        delete: function (campaignId, callback) {
            var campaign = new Campaign(this.createsend, campaignId);
            campaign.delete(callback);
        },

        getBounces: function (campaignId, filters, callback) {
            var campaign = new Campaign(this.createsend, campaignId);
            campaign.getBounces(filters, callback);
        },

        getClicks: function (campaignId, filters, callback) {
            var campaign = new Campaign(this.createsend, campaignId);
            campaign.getClicks(filters, callback);
        },

        getEmailClientUsage: function (campaignId, callback) {
            var campaign = new Campaign(this.createsend, campaignId);
            campaign.getEmailClientUsage(callback);
        },

        getListsAndSegments: function (campaignId, callback) {
            var campaign = new Campaign(this.createsend, campaignId);
            campaign.getListsAndSegments(callback);
        },

        getOpens: function (campaignId, filters, callback) {
            var campaign = new Campaign(this.createsend, campaignId);
            campaign.getOpens(filters, callback);
        },

        getRecipients: function (campaignId, filters, callback) {
            var campaign = new Campaign(this.createsend, campaignId);
            campaign.getRecipients(filters, callback);
        },

        getSpamComplaints: function (campaignId, filters, callback) {
            var campaign = new Campaign(this.createsend, campaignId);
            campaign.getSpamComplaints(filters, callback);
        },

        getSummary: function (campaignId, callback) {
            var campaign = new Campaign(this.createsend, campaignId);
            campaign.getSummary(callback);
        },

        getUnsubscribes: function (campaignId, filters, callback) {
            var campaign = new Campaign(this.createsend, campaignId);
            campaign.getUnsubscribes(filters, callback);
        },

        sendDraft: function (campaignId, sendDetails, callback) {
            var campaign = new Campaign(this.createsend, campaignId);
            campaign.send(sendDetails, callback);
        },

        sendPreview: function (campaignId, previewDetails, callback) {
            var campaign = new Campaign(this.createsend, campaignId);
            campaign.sendPreview(previewDetails, callback);
        },

        unschedule: function (campaignId, callback) {
            var campaign = new Campaign(this.createsend, campaignId);
            campaign.unschedule(callback);
        }
    };
}


text:
<?php

class Quoterequest extends ActiveRecord\Model {
	static $table_name = 'custom_quotation_requests';

	static $belongs_to = array(
     array('customquote', 'class_name' => 'Customquote', 'foreign_key' => 'custom_quotation_id'),
     array('user')
  );
}


text:
<?php
declare(strict_types=1);

/**
 * WARNING
 * This file has been generated automatically by Xcore Generator.
 * Manual changes to this file will not be maintained.
 */

namespace Xcore\Generator\Tests\Data\AssociationMapping;

use Doctrine\ORM\Mapping as ORM;

/**
 * StudentTrait
 *
 */
trait StudentTrait
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var \Xcore\Generator\Tests\Data\AssociationMapping\Student
     *
     * @ORM\OneToOne(targetEntity="Xcore\Generator\Tests\Data\AssociationMapping\Student")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="mentor_id", referencedColumnName="id", unique=true)
     * })
     */
    private $mentor;

    /**
     * Get id
     *
     * @return int
     */
    public function getId(): int
    {
        return $this->id;
    }

    /**
     * Set mentor
     *
     * @param \Xcore\Generator\Tests\Data\AssociationMapping\Student $mentor
     */
    public function setMentor(\Xcore\Generator\Tests\Data\AssociationMapping\Student  $mentor = null): void
    {
        $this->mentor = $mentor;
    }

    /**
     * Get mentor
     *
     * @return \Xcore\Generator\Tests\Data\AssociationMapping\Student
     */
    public function getMentor(): \Xcore\Generator\Tests\Data\AssociationMapping\Student
    {
        return $this->mentor;
    }
}


text:
package org.apache.commons.math4.linear;

/**
 * Marker class for RealVectors that require sparse backing storage
 * <p>
 *  Caveat: Implementation are allowed to assume that, for any {@code x},
 *  the equality {@code x * 0d == 0d} holds. But it is is not true for
 *  {@code NaN}. Moreover, zero entries will lose their sign.
 *  Some operations (that involve {@code NaN} and/or infinities) may
 *  thus give incorrect results, like multiplications, divisions or
 *  functions mapping.
 * </p>
 * @since 2.0
 */
public abstract class SparseRealVector extends RealVector {}


text:
package com.namelessdev.mpdroid;

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

import org.a0z.mpd.MPD;
import org.a0z.mpd.exception.MPDServerException;

import android.app.ProgressDialog;
import android.app.SearchManager;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;

public class SearchAlbumActivity extends BrowseActivity {
	private List<String> musicList = null;
	String searchKeywords = "";

	public SearchAlbumActivity() {
		super(R.string.addAlbum, R.string.albumAdded, MPD.MPD_SEARCH_ALBUM);
		items = new ArrayList<String>();
		musicList = new ArrayList<String>();
	}

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

		final Intent queryIntent = getIntent();
		final String queryAction = queryIntent.getAction();

		if (Intent.ACTION_SEARCH.equals(queryAction)) {
			searchKeywords = queryIntent.getStringExtra(SearchManager.QUERY);
		} else {
			return; // Bye !
		}
		setContentView(R.layout.artists);
		setTitle(getTitle() + " : " + searchKeywords);
		pd = ProgressDialog.show(SearchAlbumActivity.this, getResources().getString(R.string.loading), getResources().getString(
				R.string.loadingArtists));

		registerForContextMenu(getListView());

		UpdateList();
	}

	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		Intent intent = new Intent(this, SongsActivity.class);
		intent.putExtra("album", items.get(position));
		startActivityForResult(intent, -1);
	}

	@Override
	protected void asyncUpdate() {
		try {
			MPDApplication app = (MPDApplication) getApplication();
			musicList = app.oMPDAsyncHelper.oMPD.listAlbums();
		} catch (MPDServerException e) {
		}

		searchKeywords = searchKeywords.toLowerCase().trim();
		for (String music : musicList) {
			if (music.toLowerCase().contains(searchKeywords))
				items.add(music);
		}
	}
}


text:
typedef enum
{
	ReviewsImportStateEmpty,
	ReviewsImportStateDownloading,
	ReviewsImportStateDownloadFailed,
	ReviewsImportStateParsing,
	ReviewsImportStateParseFailed,
	ReviewsImportStateComplete
} ReviewsImportState;

typedef enum
{
	ReviewsSeekingSortByPopup,
	ReviewsSeekingSummary,
	ReviewsSeekingRating,
	ReviewsSeekingReportConcern,
	ReviewsSeekingBy,
	ReviewsSeekingReview,
	ReviewsSeekingHelpful,
	ReviewsSeekingYes,
	ReviewsSeekingYesNoSeparator,
	ReviewsSeekingNo,
	ReviewsReadingSortByPopup,
	ReviewsReadingSummary,
	ReviewsReadingReportConcern,
	ReviewsReadingBy,
	ReviewsReadingReviewer,
	ReviewsReadingReviewVersionDate,
	ReviewsReadingReview,
	ReviewsReadingHelpful,
	ReviewsReadingYes,
	ReviewsReadingYesNoSeparator,
	ReviewsReadingNo,
	ReviewsParsingComplete
} ReviewsXMLState;

@interface ARAppStoreApplicationReviewsImporter : NSObject <NSXMLParserDelegate>
{
	NSString *appIdentifier;
	NSString *storeIdentifier;

	ReviewsImportState importState;

	// Members used during XML parsing.
	ReviewsXMLState xmlState;
	NSMutableString *currentString;
	NSString *currentReviewSummary;
	double currentReviewRating;
	NSString *currentReviewer;
	NSString *currentReviewVersion;
	NSString *currentReviewDate;
	NSString *currentReviewDetail;
	NSUInteger currentReviewIndex;
	NSMutableArray *reviews;
}

@property (nonatomic, copy) NSString *appIdentifier;
@property (nonatomic, copy) NSString *storeIdentifier;
@property (nonatomic, assign) ReviewsImportState importState;

- (id)initWithAppIdentifier:(NSString *)inAppIdentifier storeIdentifier:(NSString *)inStoreIdentifier;
- (NSURL *)reviewsURL;
- (void)processReviews:(NSData *)data;
- (NSArray *)reviews;

@end


text:
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

// none!

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

function isImplicitGlobal(variable) {
    return variable.defs.every(function(def) {
        return def.type === "ImplicitGlobalVariable";
    });
}

/**
 * Gets the declared variable, defined in `scope`, that `ref` refers to.
 * @param {Scope} scope The scope in which to search.
 * @param {Reference} ref The reference to find in the scope.
 * @returns {Variable} The variable, or null if ref refers to an undeclared variable.
 */
function getDeclaredGlobalVariable(scope, ref) {
    var declaredGlobal = null;
    scope.variables.some(function(variable) {
        if (variable.name === ref.identifier.name) {
            // If it's an implicit global, it must have a `writeable` field (indicating it was declared)
            if (!isImplicitGlobal(variable) || {}.hasOwnProperty.call(variable, "writeable")) {
                declaredGlobal = variable;
                return true;
            }
        }
        return false;
    });
    return declaredGlobal;
}

/**
 * Checks if the given node is the argument of a typeof operator.
 * @param {ASTNode} node The AST node being checked.
 * @returns {boolean} Whether or not the node is the argument of a typeof operator.
 */
function hasTypeOfOperator(node) {
    var parent = node.parent;
    return parent.type === "UnaryExpression" && parent.operator === "typeof";
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

module.exports = function(context) {

    var NOT_DEFINED_MESSAGE = "\"{{name}}\" is not defined.",
        READ_ONLY_MESSAGE = "\"{{name}}\" is read only.";

    return {

        "Program:exit": function(/* node */) {

            var globalScope = context.getScope();

            globalScope.through.forEach(function(ref) {
                var variable = getDeclaredGlobalVariable(globalScope, ref),
                    name = ref.identifier.name;

                if (hasTypeOfOperator(ref.identifier)) {
                    return;
                }

                if (!variable) {
                    context.report(ref.identifier, NOT_DEFINED_MESSAGE, { name: name });
                } else if (ref.isWrite() && variable.writeable === false) {
                    context.report(ref.identifier, READ_ONLY_MESSAGE, { name: name });
                }
            });

        }

    };

};

module.exports.schema = [];


text:
<?php

namespace app\modules\main\controllers;

use yii\web\Controller;
use Yii;

class DefaultController extends Controller
{
    public function actions()
    {
        return [
            'error' => [
                'class' => 'yii\web\ErrorAction',
            ],
        ];
    }

    public function actionIndex()
    {
        if (!Yii::$app->user->isGuest) {
            return $this->redirect('/personal-cabinet');
        }
        return $this->render('index');
    }

    public function actionAbout()
    {
        return $this->render('about');
    }
}