text:
DashPay is a mobile-friendly point-of-sale app that merchants can use to accept Dash payments.

![alt text](https://github.com//kodaxx/dashpayPOS/raw/master/www/img/dashpayterminal.png "DashPay Terminal Mockup")

# Current Features

* Works on Android, iOS, Windows Phone - Mac, Windows, Linux
* Compatible with Trezor/KeepKey/Ledger Hardware Wallets
* Generate a new account on first run. Customize store name, create backups, etc.
* Enter sale amounts in your local currency (only supports USD at the moment) and have them converted to an amount in Dash using http://coinmarketcap.com exchange rate
* A QR code payment request is generated with your receiving address, sale amount, store name, and 'use InstantSend' for your customers to scan
* Unique addresses are used for every sale that are a part of your HD wallet. One private key
* Get an on-screen notification when the requested amount is received at your address
* Detects partial payments and allows multiple parties to pay the total amount owed

#Planned Features

* NFC touch-to-pay with mobile phones using Dash Wallet
* Multiple currency support (USD, CAD, UAD, etc.)
* Offline payments system using plastic EMV-type cards for customers
* Ability to have payments converted to fiat instantly

# Installation

Pending

# TO-DO before first release

* Major code clean-up/refactoring
* Link to block explorer for manual verification
* Manual price refresh
* All Cordova/PhoneGap builds
* Electron Builds
* Transactions and the exchange rate at the time of sale are recorded and can be viewed later

# TO-DO

* Change from dashjs to bitcore
* Change from localStorage to localForage
* TEST and better error handling

# License

Copyright (C) 2016 kodaxx & nitya

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.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.


text:
@interface EXRemoteNotificationManager : NSObject

+ (instancetype)sharedInstance;

- (void)registerAPNSToken: (NSData *)token;
- (void)handleRemoteNotification: (NSDictionary *)notification fromBackground:(BOOL)isFromBackground;

@end

redpajama_set_name: RedPajamaGithub


text:
{-# LANGUAGE NoImplicitPrelude, MagicHash, TypeOperators,
  DataKinds, TypeFamilies, FlexibleContexts, MultiParamTypeClasses #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  Java.Text
-- Copyright   :  (c) Jyothsna Srinivas 2017
--
-- License     :  BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer  :  jyothsnasrinivas17@gmail.com
-- Stability   :  provisional
-- Portability :  portable
--
-- Bindings for Java Text utilities
--
-----------------------------------------------------------------------------

module Java.Text where

import GHC.Base
import GHC.Int
import Java.Array
import Java.Collections
import Java.Primitive
import Java.Utils
import Java.Wrappers

-- Start java.util.Calendar

data {-# CLASS "java.util.Locale" #-} Locale = Locale (Object# Locale)
  deriving Class

foreign import java unsafe getCountry :: Java Locale String

foreign import java unsafe getDisplayCountry :: Java Locale String

foreign import java unsafe "getDisplayCountry" getDisplayCountry2 :: Locale -> Java Locale String

foreign import java unsafe getDisplayName :: Java Locale String

foreign import java unsafe "getDisplayName" getDisplayName2 :: Locale -> Java Locale String

foreign import java unsafe getDisplayScript :: Java Locale String

foreign import java unsafe "getDisplayScript" getDisplayScript2 :: Locale -> Java Locale String

foreign import java unsafe getDisplayVariant :: Java Locale String

foreign import java unsafe "getDisplayVariant" getDisplayVariant2 :: Locale -> Java Locale String

foreign import java unsafe getExtension :: JChar -> Java Locale String

foreign import java unsafe getExtensionKeys :: Java Locale (Set JCharacter)

foreign import java unsafe getISO3Country :: Java Locale String

foreign import java unsafe getISO3Language :: Java Locale String

foreign import java unsafe getISOCountries :: Java Locale String

foreign import java unsafe getISOLanguages :: Java Locale String

foreign import java unsafe getLanguage :: Java Locale String

foreign import java unsafe getScript :: Java Locale String

foreign import java unsafe getUnicodeLocaleAttributes :: Java Locale (Set JString)

foreign import java unsafe getUnicodeLocaleKeys :: Java Locale (Set JString)

foreign import java unsafe getUnicodeLocaleType :: String -> Java Locale String

foreign import java unsafe getVariant :: Java Locale String

foreign import java unsafe toLanguageTag :: Java Locale String

-- End java.util.Locale


text:
static int freeRam() {
	vm_size_t pageSize;
	host_page_size(mach_host_self(), &pageSize);
	struct vm_statistics vmStats;
	mach_msg_type_number_t infoCount = sizeof(vmStats);
	host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t)&vmStats, &infoCount);
	int availMem = vmStats.free_count + vmStats.inactive_count;
	return (availMem * pageSize) / 1024 / 1024;
}

@implementation QROutputController
@synthesize output = _output;
@synthesize scanner = _scanner;
@synthesize delegate = _delegate;
@synthesize enabled = _enabled;
@synthesize bufferQueue = _bufferQueue;
@synthesize frameContext = _frameContext;
@synthesize enabledBySwitch = _enabledBySwitch;

-(id)init {
    	if ((self = [super init])) {

	self.frameContext = [CIContext contextWithOptions:nil];

 	self.scanner = [[ZBarImageScanner new] autorelease];
	[self.scanner setSymbology:ZBAR_QRCODE config:ZBAR_CFG_POSITION to:1];

	[self.scanner setEnableCache:true];

	[self setEnabledBySwitch:[[NSUserDefaults standardUserDefaults] boolForKey:@"PLQRIsEnabled"]];

	AVCaptureVideoDataOutput *newOutput = [[[AVCaptureVideoDataOutput alloc] init] autorelease];
	[newOutput setAlwaysDiscardsLateVideoFrames:true];

 	self.bufferQueue = dispatch_queue_create("com.evanswick.nativeqr.controller", NULL);
        [newOutput setSampleBufferDelegate:self queue:self.bufferQueue];
        //dispatch_release(self.bufferQueue);

	self.output = newOutput;

     	}
	return self;
}

- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection{
	//[NSThread sleepForTimeInterval:0.2];
	if(!self.enabled || !self.enabledBySwitch){
		 return;
	}
	//return;

	CVImageBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
	CIImage *ciImage = [CIImage imageWithCVPixelBuffer:pixelBuffer];
	CGImageRef videoImage = [self.frameContext createCGImage:ciImage fromRect:CGRectMake(0, 0, CVPixelBufferGetWidth(pixelBuffer), CVPixelBufferGetHeight(pixelBuffer))];
	ZBarImage *zImage = [[ZBarImage alloc] initWithCGImage:videoImage];
	[[self scanner] scanImage:zImage];

 	if ([[self delegate] respondsToSelector:@selector(scannedSymbols:)]) {
        dispatch_sync(dispatch_get_main_queue(), ^{
            [[self delegate] scannedSymbols:self.scanner.results];
        });
	}

	//[ciImage release]; Crashes when switching camera modes.....doesn't appear to cause memory leakage though so I really don't care.
	[zImage release];
	CGImageRelease(videoImage);
	CVPixelBufferUnlockBaseAddress(pixelBuffer, 0);

}

@end


text:
<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: wechat.class.php 35166 2014-12-23 07:12:44Z nemohou $
 */

if (!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

class plugin_wechat {

	function plugin_wechat() {
		include_once template('wechat:module');
	}

	function common() {
		global $_G;
		if(!$_G['wechat']['setting']) {
			$_G['wechat']['setting'] = unserialize($_G['setting']['mobilewechat']);
		}
		if($_G['uid']) {
			if($_G['wechat']['setting']['wechat_qrtype']) {
				$_G['wechatuser'] = C::t('#wechat#common_member_wechatmp')->fetch($_G['uid']);
				if($_G['wechatuser'] && !$_G['wechatuser']['status']) {
					$_G['wechatuser']['isregister'] = 1;
				}
			} else {
				$_G['wechatuser'] = C::t('#wechat#common_member_wechat')->fetch($_G['uid']);
			}
			if($_G['wechatuser'] && $wechatuser['status'] == 1) {
				C::t('#wechat#common_member_wechat')->update($_G['uid'], array('status' => 0));
				require_once libfile('function/member');
				clearcookies();
			}
		}

		if(!$_G['uid'] && !defined('IN_MOBILE') && $_G['wechat']['setting']['wsq_allow']) {
			$_G['setting']['pluginhooks']['global_login_text'] .= wechat_tpl_login_bar();
		}

		$_G['Plang'] = $_G['setting']['wechatviewpluginid'] ? lang('plugin/'.$_G['setting']['wechatviewpluginid']) : array();

		if(!$_G['Plang'] || !$_G['wechatuser']) {
			unset($_G['setting']['plugins']['spacecp']['wechat:spacecp']);
		}
	}

	function deletemember($param) {
		$uids = $param['param'][0];
		$step = $param['step'];
		if ($step == 'check' && $uids && is_array($uids)) {
			foreach($uids as $uid) {
				C::t('#wechat#common_member_wechat')->delete($uid);
			}
		}
	}

	function global_login_extra() {
		global $_G;
		if(!$_G['Plang'] || $_G['inshowmessage'] || !$_G['wechat']['setting']['wsq_allow']) {
			return;
		}
		return wechat_tpl_login_extra_bar();
	}

	function global_usernav_extra1() {
		global $_G;
		if(!$_G['Plang'] || $_G['wechatuser'] || !$_G['wechat']['setting']['wsq_allow'] || !$_G['uid']) {
			return;
		}
		return wechat_tpl_user_bar();
	}

	function global_footer() {
		global $_G;
		if($_G['wechat']['setting']['wechat_float_qrcode'] && $_G['wechat']['setting']['wsq_siteid'] && $_G['wechat']['setting']['wsq_allow']) {
			$modid = $_G['basescript'].'::'.CURMODULE;
			if($modid == 'forum::forumdisplay' && !empty($_GET['fid'])) {
				$idstr = '&fid='.dintval($_GET['fid']);
				return wechat_tpl_float_qrcode($idstr);
			} elseif($modid == 'forum::viewthread' && !empty($_GET['tid'])) {
				$idstr = '&tid='.dintval($_GET['tid']).'&qrsize=2';
				return wechat_tpl_float_qrcode($idstr);
			} elseif($modid == 'forum::index') {
				return wechat_tpl_float_qrcode();
			}
		}
	}

}

class mobileplugin_wechat {

	function common() {
		global $_G;
		if(!$_G['wechat']['setting']) {
			$_G['wechat']['setting'] = unserialize($_G['setting']['mobilewechat']);
		}
		dsetcookie('mobile', '', -1);
		if(!isset($_GET['pluginid'])) {
			$redirect = WeChat::redirect(1);
			if($redirect) {
				dheader('location: '.$redirect);
			}
		}
	}

}

class plugin_wechat_member extends plugin_wechat {

	function logging_method() {
		global $_G;
		if(!$_G['Plang'] || !$_G['wechat']['setting']['wsq_allow']) {
			return;
		}
		return wechat_tpl_login_bar();
	}

	function register_top_output() {
		global $_G;
		if(strexists($_GET['referer'], 'wechat:login') && $_G['wechat']['setting']['wsq_allow']) {
			return wechat_tpl_register();
		}
	}

	function register_logging_method() {
		global $_G;
		if(!$_G['Plang'] || !$_G['wechat']['setting']['wsq_allow']) {
			return;
		}
		return wechat_tpl_login_bar();
	}

}

class mobileplugin_wechat_forum extends mobileplugin_wechat {

	function post_showactivity() {
		if(!showActivity::init()) {
			return false;
		}
		showActivity::post();
	}

	function viewthread_showactivity() {
		showActivity::init();
	}

	function misc_showactivity() {
		showActivity::init();
	}

}

class plugin_wechat_forum extends plugin_wechat {

	function viewthread_showactivity() {
		showActivity::init();
	}

	function viewthread_postheader_output() {
		if(!showActivity::init()) {
			return array();
		}
		if($GLOBALS['activity']['starttimeto']) {
			global $_G;
			$starttimeto = strtotime($GLOBALS['activity']['starttimeto']);
			if($starttimeto < TIMESTAMP && $_G['forum_thread']['displayorder'] > 0) {
				C::t('forum_thread')->update($_G['tid'], array('displayorder' => 0));
			}
		}
		return showActivity::returnvoters(1);
	}

	function viewthread_posttop_output() {
		if(!showActivity::init()) {
			return array();
		}
		return showActivity::returnvoters(2);
	}

	function misc_showactivity() {
		if(!showActivity::init()) {
			return false;
		}
		showActivity::misc();
	}

	function post_showactivity() {
		if(!showActivity::init()) {
			return false;
		}
		showActivity::post();
	}

	function viewthread_share_method_output() {
		global $_G;
		if($_G['wechat']['setting']['wsq_allow']) {
			return wechat_tpl_share(showActivity::init());
		}
	}

	function viewthread_postaction() {
		global $_G;
		if($_G['wechat']['setting']['wsq_allow'] && $_G['adminid'] == 1 && empty($_GET['viewpid'])) {
			return array(wechat_tpl_resourcepush());
		}
	}

}

class WeChat {

	static $QRCODE_EXPIRE = 1800;

	static public function getqrcode() {
		global $_G;
		if(!$_G['wechat']['setting']) {
			$_G['wechat']['setting'] = unserialize($_G['setting']['mobilewechat']);
		}
		require_once DISCUZ_ROOT . './source/plugin/wechat/wechat.lib.class.php';
		$wechat_client = new WeChatClient($_G['wechat']['setting']['wechat_appId'], $_G['wechat']['setting']['wechat_appsecret']);

		$ticket = '';
		if(!$_G['cookie']['wechat_ticket'] || $_G['wechat']['setting']['wechat_mtype'] == 1) {
			$code = 0;
			$i = 0;
			do {
				$code = rand(100000, 999999);
				$codeexists = C::t('#wechat#mobile_wechat_authcode')->fetch_by_code($code);
				$i++;
			} while($codeexists && $i < 10);

			if($_G['wechat']['setting']['wechat_mtype'] == 2) {
				$option = array(
					'scene_id' => $code,
					'expire' => self::$QRCODE_EXPIRE,
					'ticketOnly' => '1'
				);
				$ticket = $wechat_client->getQrcodeTicket($option);
				if(!$ticket) {
					showmessage('wechat:wechat_message_codefull');
				}
				dsetcookie('wechat_ticket', authcode($ticket."\t".$code, 'ENCODE'), self::$QRCODE_EXPIRE);
			}
		} else {
			list($ticket, $code) = explode("\t", authcode($_G['cookie']['wechat_ticket'], 'DECODE'));
		}

		$isqrapi = $ticket ? $ticket : '';
		if($codeexists) {
			showmessage('wechat:wechat_message_codefull');
		}

		$qrcodeurl = !$isqrapi ? $_G['setting']['attachurl'].'common/'.$_G['wechat']['setting']['wechat_qrcode'] : $_G['siteurl'].'plugin.php?id=wechat:qrcode&rand='.random(5);

		$codeenc = urlencode(base64_encode(authcode($code, 'ENCODE', $_G['config']['security']['authkey'])));
		C::t('#wechat#mobile_wechat_authcode')->insert(array('sid' => $_G['cookie']['saltkey'], 'uid' => $_G['uid'], 'code' => $code, 'createtime' => TIMESTAMP), 0, 1);
		if(!discuz_process::islocked('clear_wechat_authcode')) {
			C::t('#wechat#mobile_wechat_authcode')->delete_history();
			discuz_process::unlock('clear_wechat_authcode');
		}
		return array($isqrapi, $qrcodeurl, $codeenc, $code);
	}

	static public function redirect($type) {
		global $_G;
		$hook = unserialize($_G['setting']['wechatredirect']);
		if (!$hook || !in_array($hook['plugin'], $_G['setting']['plugins']['available'])) {
			return;
		}
		if(!preg_match("/^[\w\_]+$/i", $hook['plugin']) || !preg_match('/^[\w\_\.]+\.php$/i', $hook['include'])) {
			return;
		}
		include_once DISCUZ_ROOT . 'source/plugin/' . $hook['plugin'] . '/' . $hook['include'];
		if (!class_exists($hook['class'], false)) {
			return;
		}
		$class = new $hook['class'];
		if (!method_exists($class, $hook['method'])) {
			return;
		}
		$return = $class->$hook['method']($type);
		if($return) {
			return $return;
		}
	}

	static public function register($username, $return = 0, $groupid = 0) {
		global $_G;
		if(!$username) {
			return;
		}
		if(!$_G['wechat']['setting']) {
			$_G['wechat']['setting'] = unserialize($_G['setting']['mobilewechat']);
		}

		loaducenter();
		$groupid = !$groupid ? ($_G['wechat']['setting']['wechat_newusergroupid'] ? $_G['wechat']['setting']['wechat_newusergroupid'] : $_G['setting']['newusergroupid']) : $groupid;

		$password = md5(random(10));
		$email = 'wechat_'.strtolower(random(10)).'@null.null';

		$usernamelen = dstrlen($username);
		if($usernamelen < 3) {
			$username = $username.'_'.random(5);
		}
		if($usernamelen > 15) {
			if(!$return) {
				showmessage('profile_username_toolong');
			} else {
				return;
			}
		}

		$censorexp = '/^('.str_replace(array('\\*', "\r\n", ' '), array('.*', '|', ''), preg_quote(($_G['setting']['censoruser'] = trim($_G['setting']['censoruser'])), '/')).')$/i';

		if($_G['setting']['censoruser'] && @preg_match($censorexp, $username)) {
			if(!$return) {
				showmessage('profile_username_protect');
			} else {
				return;
			}
		}

		if(!$_G['wechat']['setting']['wechat_disableregrule']) {
			loadcache('ipctrl');
			if($_G['cache']['ipctrl']['ipregctrl']) {
				foreach(explode("\n", $_G['cache']['ipctrl']['ipregctrl']) as $ctrlip) {
					if(preg_match("/^(".preg_quote(($ctrlip = trim($ctrlip)), '/').")/", $_G['clientip'])) {
						$ctrlip = $ctrlip.'%';
						$_G['setting']['regctrl'] = $_G['setting']['ipregctrltime'];
						break;
					} else {
						$ctrlip = $_G['clientip'];
					}
				}
			} else {
				$ctrlip = $_G['clientip'];
			}

			if($_G['setting']['regctrl']) {
				if(C::t('common_regip')->count_by_ip_dateline($ctrlip, $_G['timestamp']-$_G['setting']['regctrl']*3600)) {
					if(!$return) {
						showmessage('register_ctrl', NULL, array('regctrl' => $_G['setting']['regctrl']));
					} else {
						return;
					}
				}
			}

			$setregip = null;
			if($_G['setting']['regfloodctrl']) {
				$regip = C::t('common_regip')->fetch_by_ip_dateline($_G['clientip'], $_G['timestamp']-86400);
				if($regip) {
					if($regip['count'] >= $_G['setting']['regfloodctrl']) {
						if(!$return) {
							showmessage('register_flood_ctrl', NULL, array('regfloodctrl' => $_G['setting']['regfloodctrl']));
						} else {
							return;
						}
					} else {
						$setregip = 1;
					}
				} else {
					$setregip = 2;
				}
			}

			if($setregip !== null) {
				if($setregip == 1) {
					C::t('common_regip')->update_count_by_ip($_G['clientip']);
				} else {
					C::t('common_regip')->insert(array('ip' => $_G['clientip'], 'count' => 1, 'dateline' => $_G['timestamp']));
				}
			}
		}

		$uid = uc_user_register(addslashes($username), $password, $email, '', '', $_G['clientip']);
		if($uid <= 0) {
			if(!$return) {
				if($uid == -1) {
					showmessage('profile_username_illegal');
				} elseif($uid == -2) {
					showmessage('profile_username_protect');
				} elseif($uid == -3) {
					showmessage('profile_username_duplicate');
				} elseif($uid == -4) {
					showmessage('profile_email_illegal');
				} elseif($uid == -5) {
					showmessage('profile_email_domain_illegal');
				} elseif($uid == -6) {
					showmessage('profile_email_duplicate');
				} else {
					showmessage('undefined_action');
				}
			} else {
				return;
			}
		}

		$init_arr = array('credits' => explode(',', $_G['setting']['initcredits']));
		C::t('common_member')->insert($uid, $username, $password, $email, $_G['clientip'], $groupid, $init_arr);

		if($_G['setting']['regctrl'] || $_G['setting']['regfloodctrl']) {
			C::t('common_regip')->delete_by_dateline($_G['timestamp']-($_G['setting']['regctrl'] > 72 ? $_G['setting']['regctrl'] : 72)*3600);
			if($_G['setting']['regctrl']) {
				C::t('common_regip')->insert(array('ip' => $_G['clientip'], 'count' => -1, 'dateline' => $_G['timestamp']));
			}
		}

		if($_G['setting']['regverify'] == 2) {
			C::t('common_member_validate')->insert(array(
				'uid' => $uid,
				'submitdate' => $_G['timestamp'],
				'moddate' => 0,
				'admin' => '',
				'submittimes' => 1,
				'status' => 0,
				'message' => '',
				'remark' => '',
			), false, true);
			manage_addnotify('verifyuser');
		}

		setloginstatus(array(
			'uid' => $uid,
			'username' => $username,
			'password' => $password,
			'groupid' => $groupid,
		), 0);

		include_once libfile('function/stat');
		updatestat('register');

		return $uid;
	}

	static public function syncAvatar($uid, $avatar) {

		if(!$uid || !$avatar) {
			return false;
		}

		if(!$content = dfsockopen($avatar)) {
			return false;
		}

		$tmpFile = DISCUZ_ROOT.'./data/avatar/'.TIMESTAMP.random(6);
		file_put_contents($tmpFile, $content);

		if(!is_file($tmpFile)) {
			return false;
		}

		$result = uploadUcAvatar::upload($uid, $tmpFile);
		unlink($tmpFile);

		C::t('common_member')->update($uid, array('avatarstatus'=>'1'));

		return $result;
	}

	static public function getnewname($openid) {
		global $_G;
		if(!$_G['wechat']['setting']) {
			$_G['wechat']['setting'] = unserialize($_G['setting']['mobilewechat']);
		}
		$wechat_client = new WeChatClient($_G['wechat']['setting']['wechat_appId'], $_G['wechat']['setting']['wechat_appsecret']);
		$userinfo = $wechat_client->getUserInfoById($openid);
		if($userinfo) {
			$defaultusername = substr(WeChatEmoji::clear($userinfo['nickname']), 0, 15);
			loaducenter();
			$user = uc_get_user($defaultusername);
			if(!empty($user)) {
				$defaultusername = cutstr($defaultusername, 7, '').'_'.random(5);
			}
		} else {
			$defaultusername = 'wx_'.random(5);
		}
		return $defaultusername;
	}

}

class uploadUcAvatar {

	public static function upload($uid, $localFile) {

		global $_G;
		if(!$uid || !$localFile) {
			return false;
		}

		list($width, $height, $type, $attr) = getimagesize($localFile);
		if(!$width) {
			return false;
		}

		if($width < 10 || $height < 10 || $type == 4) {
			return false;
		}

		$imageType = array(1 => '.gif', 2 => '.jpg', 3 => '.png');
		$fileType = $imgType[$type];
		if(!$fileType) {
			$fileType = '.jpg';
		}
		$avatarPath = $_G['setting']['attachdir'];
		$tmpAvatar = $avatarPath.'./temp/upload'.$uid.$fileType;
		file_exists($tmpAvatar) && @unlink($tmpAvatar);
		file_put_contents($tmpAvatar, file_get_contents($localFile));

		if(!is_file($tmpAvatar)) {
			return false;
		}

		$tmpAvatarBig = './temp/upload'.$uid.'big'.$fileType;
		$tmpAvatarMiddle = './temp/upload'.$uid.'middle'.$fileType;
		$tmpAvatarSmall = './temp/upload'.$uid.'small'.$fileType;

		$image = new image;
		if($image->Thumb($tmpAvatar, $tmpAvatarBig, 200, 250, 1) <= 0) {
			return false;
		}
		if($image->Thumb($tmpAvatar, $tmpAvatarMiddle, 120, 120, 1) <= 0) {
			return false;
		}
		if($image->Thumb($tmpAvatar, $tmpAvatarSmall, 48, 48, 2) <= 0) {
			return false;
		}

		$tmpAvatarBig = $avatarPath.$tmpAvatarBig;
		$tmpAvatarMiddle = $avatarPath.$tmpAvatarMiddle;
		$tmpAvatarSmall = $avatarPath.$tmpAvatarSmall;

		$avatar1 = self::byte2hex(file_get_contents($tmpAvatarBig));
		$avatar2 = self::byte2hex(file_get_contents($tmpAvatarMiddle));
		$avatar3 = self::byte2hex(file_get_contents($tmpAvatarSmall));

		$extra = '&avatar1='.$avatar1.'&avatar2='.$avatar2.'&avatar3='.$avatar3;
		$result = self::uc_api_post_ex('user', 'rectavatar', array('uid' => $uid), $extra);

		@unlink($tmpAvatar);
		@unlink($tmpAvatarBig);
		@unlink($tmpAvatarMiddle);
		@unlink($tmpAvatarSmall);

		return true;
	}

	public static function byte2hex($string) {
		$buffer = '';
		$value = unpack('H*', $string);
		$value = str_split($value[1], 2);
		$b = '';
		foreach($value as $k => $v) {
			$b .= strtoupper($v);
		}

		return $b;
	}

	public static function uc_api_post_ex($module, $action, $arg = array(), $extra = '') {
		$s = $sep = '';
		foreach($arg as $k => $v) {
			$k = urlencode($k);
			if(is_array($v)) {
				$s2 = $sep2 = '';
				foreach($v as $k2 => $v2) {
					$k2 = urlencode($k2);
					$s2 .= "$sep2{$k}[$k2]=".urlencode(uc_stripslashes($v2));
					$sep2 = '&';
				}
				$s .= $sep.$s2;
			} else {
				$s .= "$sep$k=".urlencode(uc_stripslashes($v));
			}
			$sep = '&';
		}
		$postdata = uc_api_requestdata($module, $action, $s, $extra);
		return uc_fopen2(UC_API.'/index.php', 500000, $postdata, '', TRUE, UC_IP, 20);
	}
}

class showActivity {

	public static $init = false;

	function init() {
		global $_G;
		if(!$_G['wechat']['setting']['wsq_allow'] || !in_array($_G['tid'], (array)$_G['wechat']['setting']['showactivity']['tids'])) {
			return false;
		}
		if(!self::$init) {
			$_G['setting']['allowpostcomment'] = array(0 => 1, 1 => 2);
			$_G['setting']['commentnumber'] = 10;
			$_G['setting']['commentpostself'] = 0;
			$_G['setting']['commentfirstpost'] = 0;
			$_G['setting']['fastpost'] = 0;
			$_G['setting']['showimages'] = 1;
			$_G['setting']['imagelistthumb'] = 1;
			$_G['setting']['activitypp'] = 0;
			$_G['setting']['disallowfloat'] .= '|reply';
			$_G['setting']['guesttipsinthread']['flag'] = 0;
			$_G['setting']['nofilteredpost'] = 0;
			$_G['group']['allowgetimage'] = 1;
			if($_G['basescript'].'::'.CURMODULE == 'forum::post' && $_GET['action'] == 'edit') {
				$_G['group']['allowpostactivity'] = true;
				$_G['forum']['allowpostspecial'] = 255;
			}
			$_GET['ordertype'] = empty($_GET['ordertype']) ? 1 : $_GET['ordertype'];
			self::$init = true;
		}
		return true;
	}

	function misc() {
		global $_G;
		if(!$_POST || $_GET['action'] != 'activityapplies' && $_GET['action'] != 'activityapplylist') {
			return;
		}
		if(submitcheck('activitysubmit')) {
			showmessage('wechat:show_please_reply');
		} elseif(submitcheck('activitycancel')) {
			showmessage('wechat:show_no_cancel');
		} elseif(submitcheck('applylistsubmit') && $_GET['operation'] == 'replenish') {
			showmessage('wechat:show_disabled');
		}
	}

	function post() {
		global $_G;
		if($_GET['action'] != 'reply') {
			return;
		}
		if(submitcheck('replysubmit')) {
			$activity = C::t('forum_activity')->fetch($_G['tid']);
			if($activity['starttimefrom'] > TIMESTAMP) {
				showmessage('wechat:show_no_begin', NULL, array());
			}
			if($activity['expiration'] && $activity['expiration'] < TIMESTAMP) {
				showmessage('activity_stop', NULL, array(), array('login' => 1));
			}
			if(empty($_GET['attachnew'])) {
				showmessage('wechat:show_please_upload');
			}
			$data = array('tid' => $_G['tid'], 'username' => $_G['username'], 'uid' => $_G['uid'], 'message' => '', 'verified' => 1, 'dateline' => $_G['timestamp']);
			C::t('forum_activityapply')->insert($data);
			$applynumber = C::t('forum_activityapply')->fetch_count_for_thread($_G['tid']);
			C::t('forum_activity')->update($_G['tid'], array('applynumber' => $applynumber));
		}
	}

	function returnvoters($type) {
		global $_G;
		$return = array();
		if($type == 1) {
			$posts = DB::fetch_all("SELECT * FROM %t WHERE tid=%d", array('forum_debatepost', $_G['tid']), 'pid');
			foreach($GLOBALS['postlist'] as $post) {
				$posts[$post['pid']]['voters'] = intval($posts[$post['pid']]['voters']);
				$return[] = !$post['first'] ? wechatshowactivity_tpl_voters($posts[$post['pid']]) : '';
			}
		} else {
			foreach($GLOBALS['postlist'] as $post) {
				$return[] = !$post['first'] ? wechatshowactivity_tpl_share($post) : '';
			}
		}
		return $return;
	}

}


text:
package org.wildfly.extension.elytron;

import org.jboss.as.controller.SimpleAttributeDefinition;
import org.jboss.as.controller.SimpleAttributeDefinitionBuilder;
import org.jboss.dmr.ModelNode;
import org.jboss.dmr.ModelType;
import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceController.State;

/**
 * Class to contain the attribute definition for the runtime representation of a services state.
 *
 * @author Darran Lofthouse
 */
class ServiceStateDefinition {

    static final SimpleAttributeDefinition STATE = new SimpleAttributeDefinitionBuilder(ElytronDescriptionConstants.STATE, ModelType.STRING)
        .setStorageRuntime()
        .setAllowedValues(allowedValues(State.values()))
        .build();

    /**
     * Populate the supplied response {@link ModelNode} with information about the supplied {@link ServiceController}
     *
     * @param response the response to populate.
     * @param provider the {@link ServiceController} to use when populating the response.
     */
    static void populateResponse(final ModelNode response, final ServiceController<?> serviceController) {
        response.set(serviceController.getState().toString());
    }

    private static String[] allowedValues(Object[] allowedValues) {
        String[] allowedValuesResponse = new String[allowedValues.length];
        for (int i = 0; i < allowedValues.length; i++) {
            allowedValuesResponse[i] = String.valueOf(allowedValues[i]);
        }

        return allowedValuesResponse;
    }
}


text:
/**
 * This script automatically creates initial pages
 */
var jade = require('jade');

var aboutus = jade.compileFile('./templates/views/aboutus.jade');

exports.create = {
	Page: [
		{ 'title': '\xDCber Uns', content: aboutus(), isMemberOnly: false }
	]
};


text:
require File.join(File.dirname(__FILE__), "lib/util.rb")
include Util

disappear_reappear

puts "machine back up"


text:
package org.apache.camel.builder.endpoint.dsl;

import java.util.Map;
import javax.annotation.Generated;
import org.apache.camel.builder.EndpointConsumerBuilder;
import org.apache.camel.builder.EndpointProducerBuilder;
import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;

/**
 * The jdbc component enables you to access databases through JDBC, where SQL
 * queries are sent in the message body.
 *
 * Generated by camel build tools - do NOT edit this file!
 */
@Generated("org.apache.camel.maven.packaging.EndpointDslMojo")
public interface JdbcEndpointBuilderFactory {

    /**
     * Builder for endpoint for the JDBC component.
     */
    public interface JdbcEndpointBuilder extends EndpointProducerBuilder {
        default AdvancedJdbcEndpointBuilder advanced() {
            return (AdvancedJdbcEndpointBuilder) this;
        }
        /**
         * Whether to allow using named parameters in the queries.
         *
         * The option is a: boolean type.
         *
         * Default: true
         * Group: producer
         */
        default JdbcEndpointBuilder allowNamedParameters(
                boolean allowNamedParameters) {
            doSetProperty("allowNamedParameters", allowNamedParameters);
            return this;
        }
        /**
         * Whether to allow using named parameters in the queries.
         *
         * The option will be converted to a boolean type.
         *
         * Default: true
         * Group: producer
         */
        default JdbcEndpointBuilder allowNamedParameters(
                String allowNamedParameters) {
            doSetProperty("allowNamedParameters", allowNamedParameters);
            return this;
        }
        /**
         * Whether the producer should be started lazy (on the first message).
         * By starting lazy you can use this to allow CamelContext and routes to
         * startup in situations where a producer may otherwise fail during
         * starting and cause the route to fail being started. By deferring this
         * startup to be lazy then the startup failure can be handled during
         * routing messages via Camel's routing error handlers. Beware that when
         * the first message is processed then creating and starting the
         * producer may take a little time and prolong the total processing time
         * of the processing.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: producer
         */
        default JdbcEndpointBuilder lazyStartProducer(boolean lazyStartProducer) {
            doSetProperty("lazyStartProducer", lazyStartProducer);
            return this;
        }
        /**
         * Whether the producer should be started lazy (on the first message).
         * By starting lazy you can use this to allow CamelContext and routes to
         * startup in situations where a producer may otherwise fail during
         * starting and cause the route to fail being started. By deferring this
         * startup to be lazy then the startup failure can be handled during
         * routing messages via Camel's routing error handlers. Beware that when
         * the first message is processed then creating and starting the
         * producer may take a little time and prolong the total processing time
         * of the processing.
         *
         * The option will be converted to a boolean type.
         *
         * Default: false
         * Group: producer
         */
        default JdbcEndpointBuilder lazyStartProducer(String lazyStartProducer) {
            doSetProperty("lazyStartProducer", lazyStartProducer);
            return this;
        }
        /**
         * Specify the full package and class name to use as conversion when
         * outputType=SelectOne or SelectList.
         *
         * The option is a: java.lang.String type.
         *
         * Group: producer
         */
        default JdbcEndpointBuilder outputClass(String outputClass) {
            doSetProperty("outputClass", outputClass);
            return this;
        }
        /**
         * Determines the output the producer should use.
         *
         * The option is a:
         * org.apache.camel.component.jdbc.JdbcOutputType type.
         *
         * Default: SelectList
         * Group: producer
         */
        default JdbcEndpointBuilder outputType(JdbcOutputType outputType) {
            doSetProperty("outputType", outputType);
            return this;
        }
        /**
         * Determines the output the producer should use.
         *
         * The option will be converted to a
         * org.apache.camel.component.jdbc.JdbcOutputType type.
         *
         * Default: SelectList
         * Group: producer
         */
        default JdbcEndpointBuilder outputType(String outputType) {
            doSetProperty("outputType", outputType);
            return this;
        }
        /**
         * Optional parameters to the java.sql.Statement. For example to set
         * maxRows, fetchSize etc.
         *
         * The option is a: java.util.Map<java.lang.String,
         * java.lang.Object> type.
         *
         * Group: producer
         */
        default JdbcEndpointBuilder parameters(Map<String, Object> parameters) {
            doSetProperty("parameters", parameters);
            return this;
        }
        /**
         * Optional parameters to the java.sql.Statement. For example to set
         * maxRows, fetchSize etc.
         *
         * The option will be converted to a
         * java.util.Map<java.lang.String, java.lang.Object>
         * type.
         *
         * Group: producer
         */
        default JdbcEndpointBuilder parameters(String parameters) {
            doSetProperty("parameters", parameters);
            return this;
        }
        /**
         * The default maximum number of rows that can be read by a polling
         * query. The default value is 0.
         *
         * The option is a: int type.
         *
         * Group: producer
         */
        default JdbcEndpointBuilder readSize(int readSize) {
            doSetProperty("readSize", readSize);
            return this;
        }
        /**
         * The default maximum number of rows that can be read by a polling
         * query. The default value is 0.
         *
         * The option will be converted to a int type.
         *
         * Group: producer
         */
        default JdbcEndpointBuilder readSize(String readSize) {
            doSetProperty("readSize", readSize);
            return this;
        }
        /**
         * Camel will set the autoCommit on the JDBC connection to be false,
         * commit the change after executed the statement and reset the
         * autoCommit flag of the connection at the end, if the resetAutoCommit
         * is true. If the JDBC connection doesn't support to reset the
         * autoCommit flag, you can set the resetAutoCommit flag to be false,
         * and Camel will not try to reset the autoCommit flag. When used with
         * XA transactions you most likely need to set it to false so that the
         * transaction manager is in charge of committing this tx.
         *
         * The option is a: boolean type.
         *
         * Default: true
         * Group: producer
         */
        default JdbcEndpointBuilder resetAutoCommit(boolean resetAutoCommit) {
            doSetProperty("resetAutoCommit", resetAutoCommit);
            return this;
        }
        /**
         * Camel will set the autoCommit on the JDBC connection to be false,
         * commit the change after executed the statement and reset the
         * autoCommit flag of the connection at the end, if the resetAutoCommit
         * is true. If the JDBC connection doesn't support to reset the
         * autoCommit flag, you can set the resetAutoCommit flag to be false,
         * and Camel will not try to reset the autoCommit flag. When used with
         * XA transactions you most likely need to set it to false so that the
         * transaction manager is in charge of committing this tx.
         *
         * The option will be converted to a boolean type.
         *
         * Default: true
         * Group: producer
         */
        default JdbcEndpointBuilder resetAutoCommit(String resetAutoCommit) {
            doSetProperty("resetAutoCommit", resetAutoCommit);
            return this;
        }
        /**
         * Whether transactions are in use.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: producer
         */
        default JdbcEndpointBuilder transacted(boolean transacted) {
            doSetProperty("transacted", transacted);
            return this;
        }
        /**
         * Whether transactions are in use.
         *
         * The option will be converted to a boolean type.
         *
         * Default: false
         * Group: producer
         */
        default JdbcEndpointBuilder transacted(String transacted) {
            doSetProperty("transacted", transacted);
            return this;
        }
        /**
         * To read BLOB columns as bytes instead of string data. This may be
         * needed for certain databases such as Oracle where you must read BLOB
         * columns as bytes.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: producer
         */
        default JdbcEndpointBuilder useGetBytesForBlob(
                boolean useGetBytesForBlob) {
            doSetProperty("useGetBytesForBlob", useGetBytesForBlob);
            return this;
        }
        /**
         * To read BLOB columns as bytes instead of string data. This may be
         * needed for certain databases such as Oracle where you must read BLOB
         * columns as bytes.
         *
         * The option will be converted to a boolean type.
         *
         * Default: false
         * Group: producer
         */
        default JdbcEndpointBuilder useGetBytesForBlob(String useGetBytesForBlob) {
            doSetProperty("useGetBytesForBlob", useGetBytesForBlob);
            return this;
        }
        /**
         * Set this option to true to use the prepareStatementStrategy with
         * named parameters. This allows to define queries with named
         * placeholders, and use headers with the dynamic values for the query
         * placeholders.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: producer
         */
        default JdbcEndpointBuilder useHeadersAsParameters(
                boolean useHeadersAsParameters) {
            doSetProperty("useHeadersAsParameters", useHeadersAsParameters);
            return this;
        }
        /**
         * Set this option to true to use the prepareStatementStrategy with
         * named parameters. This allows to define queries with named
         * placeholders, and use headers with the dynamic values for the query
         * placeholders.
         *
         * The option will be converted to a boolean type.
         *
         * Default: false
         * Group: producer
         */
        default JdbcEndpointBuilder useHeadersAsParameters(
                String useHeadersAsParameters) {
            doSetProperty("useHeadersAsParameters", useHeadersAsParameters);
            return this;
        }
        /**
         * Sets whether to use JDBC 4 or JDBC 3.0 or older semantic when
         * retrieving column name. JDBC 4.0 uses columnLabel to get the column
         * name where as JDBC 3.0 uses both columnName or columnLabel.
         * Unfortunately JDBC drivers behave differently so you can use this
         * option to work out issues around your JDBC driver if you get problem
         * using this component This option is default true.
         *
         * The option is a: boolean type.
         *
         * Default: true
         * Group: producer
         */
        default JdbcEndpointBuilder useJDBC4ColumnNameAndLabelSemantics(
                boolean useJDBC4ColumnNameAndLabelSemantics) {
            doSetProperty("useJDBC4ColumnNameAndLabelSemantics", useJDBC4ColumnNameAndLabelSemantics);
            return this;
        }
        /**
         * Sets whether to use JDBC 4 or JDBC 3.0 or older semantic when
         * retrieving column name. JDBC 4.0 uses columnLabel to get the column
         * name where as JDBC 3.0 uses both columnName or columnLabel.
         * Unfortunately JDBC drivers behave differently so you can use this
         * option to work out issues around your JDBC driver if you get problem
         * using this component This option is default true.
         *
         * The option will be converted to a boolean type.
         *
         * Default: true
         * Group: producer
         */
        default JdbcEndpointBuilder useJDBC4ColumnNameAndLabelSemantics(
                String useJDBC4ColumnNameAndLabelSemantics) {
            doSetProperty("useJDBC4ColumnNameAndLabelSemantics", useJDBC4ColumnNameAndLabelSemantics);
            return this;
        }
    }

    /**
     * Advanced builder for endpoint for the JDBC component.
     */
    public interface AdvancedJdbcEndpointBuilder
            extends
                EndpointProducerBuilder {
        default JdbcEndpointBuilder basic() {
            return (JdbcEndpointBuilder) this;
        }
        /**
         * Whether the endpoint should use basic property binding (Camel 2.x) or
         * the newer property binding with additional capabilities.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: advanced
         */
        default AdvancedJdbcEndpointBuilder basicPropertyBinding(
                boolean basicPropertyBinding) {
            doSetProperty("basicPropertyBinding", basicPropertyBinding);
            return this;
        }
        /**
         * Whether the endpoint should use basic property binding (Camel 2.x) or
         * the newer property binding with additional capabilities.
         *
         * The option will be converted to a boolean type.
         *
         * Default: false
         * Group: advanced
         */
        default AdvancedJdbcEndpointBuilder basicPropertyBinding(
                String basicPropertyBinding) {
            doSetProperty("basicPropertyBinding", basicPropertyBinding);
            return this;
        }
        /**
         * To use a custom org.apache.camel.component.jdbc.BeanRowMapper when
         * using outputClass. The default implementation will lower case the row
         * names and skip underscores, and dashes. For example CUST_ID is mapped
         * as custId.
         *
         * The option is a:
         * org.apache.camel.component.jdbc.BeanRowMapper type.
         *
         * Group: advanced
         */
        default AdvancedJdbcEndpointBuilder beanRowMapper(Object beanRowMapper) {
            doSetProperty("beanRowMapper", beanRowMapper);
            return this;
        }
        /**
         * To use a custom org.apache.camel.component.jdbc.BeanRowMapper when
         * using outputClass. The default implementation will lower case the row
         * names and skip underscores, and dashes. For example CUST_ID is mapped
         * as custId.
         *
         * The option will be converted to a
         * org.apache.camel.component.jdbc.BeanRowMapper type.
         *
         * Group: advanced
         */
        default AdvancedJdbcEndpointBuilder beanRowMapper(String beanRowMapper) {
            doSetProperty("beanRowMapper", beanRowMapper);
            return this;
        }
        /**
         * Allows the plugin to use a custom
         * org.apache.camel.component.jdbc.JdbcPrepareStatementStrategy to
         * control preparation of the query and prepared statement.
         *
         * The option is a:
         * org.apache.camel.component.jdbc.JdbcPrepareStatementStrategy type.
         *
         * Group: advanced
         */
        default AdvancedJdbcEndpointBuilder prepareStatementStrategy(
                Object prepareStatementStrategy) {
            doSetProperty("prepareStatementStrategy", prepareStatementStrategy);
            return this;
        }
        /**
         * Allows the plugin to use a custom
         * org.apache.camel.component.jdbc.JdbcPrepareStatementStrategy to
         * control preparation of the query and prepared statement.
         *
         * The option will be converted to a
         * org.apache.camel.component.jdbc.JdbcPrepareStatementStrategy type.
         *
         * Group: advanced
         */
        default AdvancedJdbcEndpointBuilder prepareStatementStrategy(
                String prepareStatementStrategy) {
            doSetProperty("prepareStatementStrategy", prepareStatementStrategy);
            return this;
        }
        /**
         * Sets whether synchronous processing should be strictly used, or Camel
         * is allowed to use asynchronous processing (if supported).
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: advanced
         */
        default AdvancedJdbcEndpointBuilder synchronous(boolean synchronous) {
            doSetProperty("synchronous", synchronous);
            return this;
        }
        /**
         * Sets whether synchronous processing should be strictly used, or Camel
         * is allowed to use asynchronous processing (if supported).
         *
         * The option will be converted to a boolean type.
         *
         * Default: false
         * Group: advanced
         */
        default AdvancedJdbcEndpointBuilder synchronous(String synchronous) {
            doSetProperty("synchronous", synchronous);
            return this;
        }
    }

    /**
     * Proxy enum for
     * org.apache.camel.component.jdbc.JdbcOutputType enum.
     */
    enum JdbcOutputType {
        SelectOne,
        SelectList,
        StreamList;
    }

    public interface JdbcBuilders {
        /**
         * JDBC (camel-jdbc)
         * The jdbc component enables you to access databases through JDBC,
         * where SQL queries are sent in the message body.
         *
         * Category: database,sql
         * Since: 1.2
         * Maven coordinates: org.apache.camel:camel-jdbc
         *
         * Syntax: jdbc:dataSourceName
         *
         * Path parameter: dataSourceName (required)
         * Name of DataSource to lookup in the Registry. If the name is
         * dataSource or default, then Camel will attempt to lookup a default
         * DataSource from the registry, meaning if there is a only one instance
         * of DataSource found, then this DataSource will be used.
         */
        default JdbcEndpointBuilder jdbc(String path) {
            return JdbcEndpointBuilderFactory.jdbc(path);
        }
    }
    /**
     * JDBC (camel-jdbc)
     * The jdbc component enables you to access databases through JDBC, where
     * SQL queries are sent in the message body.
     *
     * Category: database,sql
     * Since: 1.2
     * Maven coordinates: org.apache.camel:camel-jdbc
     *
     * Syntax: jdbc:dataSourceName
     *
     * Path parameter: dataSourceName (required)
     * Name of DataSource to lookup in the Registry. If the name is dataSource
     * or default, then Camel will attempt to lookup a default DataSource from
     * the registry, meaning if there is a only one instance of DataSource
     * found, then this DataSource will be used.
     */
    static JdbcEndpointBuilder jdbc(String path) {
        class JdbcEndpointBuilderImpl extends AbstractEndpointBuilder implements JdbcEndpointBuilder, AdvancedJdbcEndpointBuilder {
            public JdbcEndpointBuilderImpl(String path) {
                super("jdbc", path);
            }
        }
        return new JdbcEndpointBuilderImpl(path);
    }
}


text: package webauthncli


text:
mkdir assign
mv *.java assign/
cd assign


text:
[![Build Status](https://travis-ci.org/cryptosense/records.svg)](https://travis-ci.org/cryptosense/records)

Dynamic records
===============

This library enables you to define and manipulate dynamic records in OCaml.

## Example

Let us define a "point" record with three integer fields: x, y and z.

First, declare a new record layout. It uses a phantom type so that `point` has
type `point layout`.

```ocaml
type point
let point : point Record.layout = Record.declare "point"
```

Second, define the fields. They have the type `(int, point) field`.

```ocaml
let x = Record.field point "x" Type.int
let y = Record.field point "y" Type.int
let z = Record.field point "z" Type.int
```

Third, "seal" this record structure. This prevents it from being further modified.
Structures must be sealed before they can be used.

```ocaml
let () = Record.seal point
```

At this point, you have a working record structure. The next step is to create actual
records.  They have the type `point Record.t` and are created using `Record.make`.
Initially their fields have no value.

```ocaml
let _ =
  let p = Record.make point in
  Record.set p x 3;
  Record.set p y 4;
  Record.set p z 5;
  Record.format Format.std_formatter p
```

The last line outputs:

```json
{"x":3,"y":4,"z":5}
```

## Licensing

This library is available under the 2-clause BSD license.
See `COPYING` for more information.


text:
module FitbitAPI
  class Client
    def friends(opts={})
      get("user/#{user_id}/friends.json", opts)
    end

    def friends_leaderboard(opts={})
      get("user/#{user_id}/friends/leaderboard.json", opts)
    end
  end
end


text:
layout: song

title: '"Lonesome Town" by Ricky Nelson'
song_title: Lonesome Town
artist: Ricky Nelson
year: 1958
category: full_song
date_published: 2017-01-07
yt_video_id: QFiatbwLPXg
tags: [Full Song Lesson, 1950s, Classic Rock, Key of C, Movie Songs, E Flat Tuning]
hidden_tags: [Pulp Fiction, Tarantino]
slug: "38"
redirect_from:
  - /songs/ricky-nelson-lonesome-town/
pdf_version: musicnotes
musicnotes_url: https://www.musicnotes.com/sheetmusic/mtd.asp?ppn=MN0235879
pdf_numpages: 4
patreon_lesson_available: true
patreon_lesson_url: https://www.patreon.com/posts/47547391
#pdf_for_sale: https://gum.co/wZWcq
---

## Editor's Notes

This video is an acoustic guitar lesson for the song _Lonesome Town_ by Ricky Nelson. I'll show you how to play it in standard tuning, using a fingerpicking approach. This lesson includes a playthrough, explanation of how to play each chord, overview of the chord progressions needed, fingerpicking basics -- I cover it all! Including the difference between a shuffle vs. straight rhythm. I created this tutorial for Song Notes, which is my personal music lesson web project (video and text-based lessons).

## Free Video Lesson

{% include youtube_embed.html yt_id = page.yt_video_id %}

Timestamps:

- 0:00 Preview
- 2:23 About this lesson
- 3:46 How to play the chords
- 5:42 Fingerpicking basics
- 7:11 Using your thumb on the F
- 9:56 Shuffle rhythm basics

{% include pdf-module.html slug = page.slug pdf_numpages = page.pdf_numpages pdf_version = page.pdf_version has_patreon_url = page.patreon_lesson_url patreon_url = page.patreon_lesson_url free_pdf_available = page.free_pdf_available free_pdf_url = page.free_pdf_url song_name = page.song_title pdf_for_sale = page.pdf_for_sale musicnotes_url = page.musicnotes_url %}

## A Nod to the Original Songwriter
Finally, I should note that this song was written by Baker Knight and not Ricky Nelson. For more info about the song, refer to its page on Wikipedia: http://en.wikipedia.org/wiki/Lonesome_Town

## Jack Rabbit Slims in Pulp Fiction
Just for some cultural and cinematic flavor, here is the famous Jack Rabbit Slims tracking shot from Quentin Tarantino's film Pulp Fiction -- where an in-costume Ricky Nelson is playing live music as the main characters walk through the restaurant. In the film, Lonesome Town is played immediately after this sequence.

And here is the Jack Rabbit Slims dining scene in which Lonesome Town can be heard in the background.

## Other videos

### Ricky Nelson Solo Version
Here is a nice video of Ricky playing this song with just him and his guitar (no backup). You can't quite see the guitar (to help with fingering, strumming pattern, etc) -- but it is helpful nonetheless. Note that he plays this with a guitar tuned down one-half step. Also note that he may steal your girlfriend.

### Recommended Cover Version
To get a good and clear look at someone skillfully playing this on guitar, I recommend this video by Mike Sinatra. Very well-played and well-shot acoustic performance, without any crazy changing cameras. Note, to play along with him you'll need to use a capo on the 3rd fret in standard tuning (which would be a capo 4th fret if tuned down one-half step).


text:
package org.commonjava.indy.content;

import java.util.List;

import org.commonjava.indy.IndyWorkflowException;
import org.commonjava.indy.model.core.ArtifactStore;
import org.commonjava.indy.model.core.Group;
import org.commonjava.maven.galley.event.EventMetadata;
import org.commonjava.maven.galley.model.Transfer;

/**
 * Interface to support dynamic content generation. This was originally intended for generating metadata files when they aren't present on
 * remote repositories. However, it's designed to accommodate all sorts of dynamic content.
 */
public interface ContentGenerator
{

    /**
     * Generate dynamic content in the event it's not found in the ArtifactStore. This is secondary to the main content retrieval logic, as a
     * last effort to avoid returning a missing result.
     */
    Transfer generateFileContent( ArtifactStore store, String path, EventMetadata eventMetadata )
        throws IndyWorkflowException;

    /**
     * Generate resources for any missing files that this generator can create. This is meant to contribute to an existing directory listing, so
     * the existing resources are given in order to allow the generator to determine whether a new resources is warranted.
     */
    List<StoreResource> generateDirectoryContent( ArtifactStore store, String path, List<StoreResource> existing,
                                                  EventMetadata eventMetadata )
        throws IndyWorkflowException;

    /**
     * Generate dynamic content for a group. This is the PRIMARY form of group access, with secondary action being to attempt normal retrieval from
     * one of the member stores.
     */
    Transfer generateGroupFileContent( Group group, List<ArtifactStore> members, String path,
                                       EventMetadata eventMetadata )
        throws IndyWorkflowException;

    /**
     * Generate resources for merged group files that this generator can create.
     */
    List<StoreResource> generateGroupDirectoryContent( Group group, List<ArtifactStore> members, String path,
                                                       EventMetadata eventMetadata )
        throws IndyWorkflowException;

    /**
     * Tidy up any generated content associated with the stored file
     */
    void handleContentStorage( ArtifactStore store, String path, Transfer result, EventMetadata eventMetadata )
        throws IndyWorkflowException;

    /**
     * Tidy up any generated content associated with the deleted file
     */
    void handleContentDeletion( ArtifactStore store, String path, EventMetadata eventMetadata )
        throws IndyWorkflowException;

    /**
     * Checks if this content generator processes the provided path.
     */
    boolean canProcess( String path );

}


text:
import swagger from "./formatters/swagger"
import ast from "./formatters/ast"

export default function transform(blueprint, opts = {}) {
    let result;

    switch (opts.format) {
        case "swagger":
            result = swagger(blueprint);
            break;

        case "ast":
            result = ast(blueprint);
            break;
    }

    return result;
}


text:
package ro.isdc.wro.model.resource;

import static org.apache.commons.lang3.Validate.notNull;

import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * Encapsulates information about a resource. This class is not final because we need to mock it in unit tests.
 *
 * @author Alex Objelean
 * @created Created on Oct 30, 2008
 */
public class Resource {
  /**
   * The type of resource.
   */
  private ResourceType type;
  /**
   * Resource identifier.
   */
  private String uri;
  /**
   * Used to skip minimization during pre processing. Useful when you know that the resource is already minimized and no
   * minimization is needed. Default value is true.
   */
  private boolean minimize = true;

  /**
   * Empty constructor. Used by json deserializer.
   */
  public Resource() {
  }

  /**
   * Constructor.
   *
   * @param uri of the resource.
   * @param type of the resource.
   */
  private Resource(final String uri, final ResourceType type) {
    Validate.notNull(uri, "URI cannot be null!");
    Validate.notNull(type, "ResourceType cannot be null!");
    this.uri = cleanUri(uri);
    this.type = type;
  }

  /**
   * Factory method for Resource creation. A factory method is preferred instead of public constructor, in order to
   * avoid possibilities for clients to extend Resource class.
   *
   * @return an instance of {@link Resource} object.
   */
  public static Resource create(final String uri, final ResourceType type) {
    return new Resource(uri, type);
  }

  /**
   * Creates a resource and set the correct {@link ResourceType} based on uri extension. If resourceType cannot be
   * identified an exception is thrown.
   *
   * @param uri of the resource to create.
   * @return Resource with the provided uri and correct type.
   */
  public static Resource create(final String uri) {
    final String resourceExtension = FilenameUtils.getExtension(uri);
    final ResourceType type = ResourceType.get(resourceExtension);
    return new Resource(uri, type);
  }

  /**
   * Perform a cleaning of the uri by trimming it and removing last '/' character if exists.
   *
   * @param uri to clean.
   * @return cleaned uri.
   */
  private static String cleanUri(final String uri) {
    String result = uri.trim();
    //handle empty uri
    if (!StringUtils.isEmpty(uri)) {
      final int endIndex = result.length() - 1;
      if (result.lastIndexOf('/') == endIndex) {
        result = result.substring(0, endIndex);
      }
    }
    return result;
  }

  /**
   * @param type the type to set
   */
  public void setType(final ResourceType type) {
    notNull(type, "ResourceType cannot be null!");
    this.type = type;
  }

  /**
   * @param uri the uri to set
   */
  public void setUri(final String uri) {
    notNull(uri, "Uri cannot be null!");
    this.uri = cleanUri(uri);
  }

  /**
   * @return the type
   */
  public ResourceType getType() {
    return type;
  }

  /**
   * @return the uri associated with this resource.
   */
  public String getUri() {
    return uri;
  }

  /**
   * @return the minimize
   */
  public boolean isMinimize() {
    return this.minimize;
  }

  /**
   * @param minimize the minimize to set
   */
  public void setMinimize(final boolean minimize) {
    this.minimize = minimize;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public boolean equals(final Object obj) {
    if (obj instanceof Resource) {
      final Resource resource = (Resource)obj;
      return getUri().equals(resource.getUri()) && getType().equals(resource.getType());
    }
    return false;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public int hashCode() {
    int hash = 7;
    //handle null, it can happen when empty constructor is used.
    hash = 31 * hash + (this.type != null ? this.type.hashCode() : 0);
    hash = 31 * hash + (this.uri != null ? this.uri.hashCode() : 0);
    return hash;
  }

  /**
   * @see java.lang.Object#toString()
   */
  @Override
  public String toString() {
    return ToStringBuilder.reflectionToString(this, ToStringStyle.NO_FIELD_NAMES_STYLE);
  }
}


text:
Lesson 3 - Class
=====
# Building & Examples
## LPFinit
```
>> mex LPFinit.cpp LPFclass.cpp
Building with 'Microsoft Windows SDK 7.1 (C++)'.
MEX completed successfully.
>> lpf = LPFinit()

lpf =

    pointer: 1142309120

>>
```

## LPFinput
```
>> mex LPFinput.cpp LPFclass.cpp
Building with 'Microsoft Windows SDK 7.1 (C++)'.
MEX completed successfully.
>> LPFinput(lpf, [1,1,1,1,1,1,1,1,1])

ans =

    0.0025    0.0120    0.0296    0.0535    0.0824    0.1149    0.1501    0.1872    0.2253

>>
```

## LPFdestroy
```
>> mex LPFdestroy.cpp LPFclass.cpp
Building with 'Microsoft Windows SDK 7.1 (C++)'.
MEX completed successfully.
>> LPFdestroy(lpf)
>>
```

# Documentation
`ret = LPFinit();`

ret is set equal to an instance of an LPF class.  Except MEX files can't return a MATLAB class, so I returned a MATLAB struct with a pointer.

`ret = LPFinput(lpf, x);`

takes one input and returns one output that has put the input through a digital low pass filter.

run this many times and the answer will be a low pass filtered version of the inputs.

x is a 1x1 double

lpf is a struct returned by LPFinit().

`ret = LPFinput(lpf, x);`

ret is a matrix the same legth as x with `ret(i) = LPFinput(x(i))` starting from the beginning.

x is a 1xN double

lpf is a struct returned by LPFinit().

`ret = LPFdestroy(lpf);`

frees the memory allocated to lpf by LPFinit().

lpf is a struct returned by LPFinit().

====
[Next](../Lesson%204%20-%20Windows%20API/Windows%20API.md)


text:
SecondOrderButterworthLowpass::SecondOrderButterworthLowpass()
{
	memset(this, 0, sizeof(SecondOrderButterworthLowpass));
}

void SecondOrderButterworthLowpass::LinearInit(double CornerFrequency_Hz, double SampleRate_Hz)
{
	LP =  pow(10.0, (-0.06762 + (1.01679 * log10(CornerFrequency_Hz))));
	Init(SampleRate_Hz);
}

void SecondOrderButterworthLowpass::NonlinearInit(double CornerFrequency_Hz, double SampleRate_Hz)
{
	LP =  pow(10.0, (-0.05252 + (1.01650 * log10(CornerFrequency_Hz))));
	Init(SampleRate_Hz);
}

double SecondOrderButterworthLowpass::Filter(double Sample)
{
	double FilterValue;

    FilterValue = (C * Sample) + (2 * C * OldSample) + (C * OlderSample) -
		(D * OldFilterValue) - (E * OlderFilterValue);
	OlderSample = OldSample;
	OldSample = Sample;
	OlderFilterValue = OldFilterValue;
	OldFilterValue = FilterValue;
	return FilterValue;
}

void SecondOrderButterworthLowpass::Init(double SampleRate_Hz)
{
	double theta, dt, cot_theta, cot_squared_theta;

	dt = 1.0 / SampleRate_Hz;
	theta = PI * LP * dt;
	cot_theta = 1.0 / tan(theta);
	cot_squared_theta = cot_theta * cot_theta;
	C = 1 / (1.0 + (SQRT2 * cot_theta) + cot_squared_theta);
	D = 2 * C * (1.0 - cot_squared_theta);
	E = C * (1.0 - (SQRT2 * cot_theta) + cot_squared_theta);
}


text:
layout: page
title: "JavaScript mktime function"
comments: true
sharing: true
footer: true
alias:
- /functions/view/mktime:474
- /functions/view/mktime
- /functions/view/474
- /functions/mktime:474
- /functions/474
---
<!-- Generated by Rakefile:build -->
A JavaScript equivalent of PHP's mktime

{% codeblock datetime/mktime.js lang:js https://raw.github.com/kvz/phpjs/master/functions/datetime/mktime.js raw on github %}
function mktime() {
  //  discuss at: http://phpjs.org/functions/mktime/
  // original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  // improved by: baris ozdil
  // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  // improved by: FGFEmperor
  // improved by: Brett Zamir (http://brett-zamir.me)
  //    input by: gabriel paderni
  //    input by: Yannoo
  //    input by: jakes
  //    input by: 3D-GRAF
  //    input by: Chris
  // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  // bugfixed by: Marc Palau
  // bugfixed by: Brett Zamir (http://brett-zamir.me)
  //  revised by: Theriault
  //        note: The return values of the following examples are
  //        note: received only if your system's timezone is UTC.
  //   example 1: mktime(14, 10, 2, 2, 1, 2008);
  //   returns 1: 1201875002
  //   example 2: mktime(0, 0, 0, 0, 1, 2008);
  //   returns 2: 1196467200
  //   example 3: make = mktime();
  //   example 3: td = new Date();
  //   example 3: real = Math.floor(td.getTime() / 1000);
  //   example 3: diff = (real - make);
  //   example 3: diff < 5
  //   returns 3: true
  //   example 4: mktime(0, 0, 0, 13, 1, 1997)
  //   returns 4: 883612800
  //   example 5: mktime(0, 0, 0, 1, 1, 1998)
  //   returns 5: 883612800
  //   example 6: mktime(0, 0, 0, 1, 1, 98)
  //   returns 6: 883612800
  //   example 7: mktime(23, 59, 59, 13, 0, 2010)
  //   returns 7: 1293839999
  //   example 8: mktime(0, 0, -1, 1, 1, 1970)
  //   returns 8: -1

  var d = new Date(),
    r = arguments,
    i = 0,
    e = ['Hours', 'Minutes', 'Seconds', 'Month', 'Date', 'FullYear'];

  for (i = 0; i < e.length; i++) {
    if (typeof r[i] === 'undefined') {
      r[i] = d['get' + e[i]]();
      r[i] += (i === 3); // +1 to fix JS months.
    } else {
      r[i] = parseInt(r[i], 10);
      if (isNaN(r[i])) {
        return false;
      }
    }
  }

  // Map years 0-69 to 2000-2069 and years 70-100 to 1970-2000.
  r[5] += (r[5] >= 0 ? (r[5] <= 69 ? 2e3 : (r[5] <= 100 ? 1900 : 0)) : 0);

  // Set year, month (-1 to fix JS months), and date.
  // !This must come before the call to setHours!
  d.setFullYear(r[5], r[3] - 1, r[4]);

  // Set hours, minutes, and seconds.
  d.setHours(r[0], r[1], r[2]);

  // Divide milliseconds by 1000 to return seconds and drop decimal.
  // Add 1 second if negative or it'll be off from PHP by 1 second.
  return (d.getTime() / 1e3 >> 0) - (d.getTime() < 0);
}
{% endcodeblock %}

 - [Raw function on GitHub](https://github.com/kvz/phpjs/blob/master/functions/datetime/mktime.js)

Please note that php.js uses JavaScript objects as substitutes for PHP arrays, they are
the closest match to this hashtable-like data structure.

Please also note that php.js offers community built functions and goes by the
[McDonald's Theory](https://medium.com/what-i-learned-building/9216e1c9da7d). We'll put online
functions that are far from perfect, in the hopes to spark better contributions.
Do you have one? Then please just:

 - [Edit on GitHub](https://github.com/kvz/phpjs/edit/master/functions/datetime/mktime.js)

### Other PHP functions in the datetime extension
{% render_partial _includes/custom/datetime.html %}


text:
  <% if (ob.vendor && ob.vendor.name) { %>

<%= ob.polyT('listingDetail.moreBy', { name: ob.vendor.name }) %>

  <% } %>


text:
JOB_POOLS
---------

Ninja only: List of available pools.

A pool is a named integer property and defines the maximum number
of concurrent jobs which can be started by a rule assigned to the pool.
The :prop_gbl:`JOB_POOLS` property is a semicolon-separated list of
pairs using the syntax NAME=integer (without a space after the equality sign).

For instance:

.. code-block:: cmake

  set_property(GLOBAL PROPERTY JOB_POOLS two_jobs=2 ten_jobs=10)

Defined pools could be used globally by setting
:variable:`CMAKE_JOB_POOL_COMPILE` and :variable:`CMAKE_JOB_POOL_LINK`
or per target by setting the target properties
:prop_tgt:`JOB_POOL_COMPILE` and :prop_tgt:`JOB_POOL_LINK`.
:command:`Custom commands <add_custom_command>` and
:command:`custom targets <add_custom_target>` can specify pools using the
option ``JOB_POOL``.
Using a pool that is not defined by :prop_gbl:`JOB_POOLS` causes
an error by ninja at build time.

If not set, this property uses the value of the :variable:`CMAKE_JOB_POOLS`
variable.

Build targets provided by CMake that are meant for individual interactive
use, such as ``install``, are placed in the ``console`` pool automatically.


text:
var model = require('../util/model.js');

var moduleModule = model.createModel('modules', [
	"name:string:unique",
	"desc:string",
	"createdAt:date",
	"updatedAt:date"
], 'name');

exports.getByName = function(name, cbFn){
	moduleModule.getByKeys(name, cbFn);
};


text: A simple asset manager app


text:
require_relative 'auditable'

module StudioGame

  class Die
    include Auditable

    attr_reader :number

    def initialize
      roll
    end

    def roll
      @number = rand(1..6)
      audit
      return @number
    end

  end
end


text:
require "spec_helper"
require "drydocker/config"
require "shellwords"

# Tests for the main module
module Drydocker
  describe Config do
    context "with basic configuration" do
      let(:config) { Config.new }
      specify { expect(config.name).to eq "silarsis-drydocker-test" }
      specify { expect(config.entrypoint).to be_nil }
      specify { expect(config.image).to eq "silarsis/drydocker" }
      specify { expect(config.command).to eq "rspec spec".shellescape }
    end
    context "with provide value for" do
      context "name" do
        let(:config) { Config.new(name: "args-test") }
        specify { expect(config.name).to eq "args-test" }
      end
      context "command" do
        let(:config) { Config.new(command: "args-test") }
        specify { expect(config.command).to eq "args-test" }
      end
      context "image" do
        let(:config) { Config.new(image: "args-test") }
        specify { expect(config.image).to eq "args-test" }
      end
      context "image (longform)" do
        let(:config) { Config.new(image: "reg.me.com/ns/container:tag") }
        specify { expect(config.image).to eq "reg.me.com/ns/container:tag" }
      end
      context "entrypoint" do
        let(:config) { Config.new(entrypoint: "args-test") }
        specify { expect(config.entrypoint).to eq "args-test" }
      end
      context "path" do
        let(:config) { Config.new(path: "args-test") }
        specify { expect(config.path).to eq "args-test" }
      end
    end
  end
end


text:
'use strict';

// Configuring the Articles module
angular.module('trips').config(function(uiGmapGoogleMapApiProvider) {
				uiGmapGoogleMapApiProvider.configure({
						key: 'AIzaSyDmTgQBcjGfj9ZnlBFTjdFm6fcWREcIPbc',
						v: '3.18',
						libraries: 'weather,geometry,visualization,places'
					});
			}).run(['Menus',
	function(Menus) {
		// Set top bar menu items
		Menus.addMenuItem('topbar', 'Trips', 'trips', 'dropdown', '/trips(/create)?');
		Menus.addSubMenuItem('topbar', 'trips', 'List Trips', 'trips');
		Menus.addSubMenuItem('topbar', 'trips', 'New Trip', 'trips/create');
	}
]);


text:
package org.apache.isis.core.tck.dom.claimapp.claims;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import org.apache.isis.applib.AbstractDomainObject;
import org.apache.isis.applib.annotation.Disabled;
import org.apache.isis.applib.annotation.MemberOrder;
import org.apache.isis.applib.value.Color;
import org.apache.isis.applib.value.Date;

public class Claim extends AbstractDomainObject {

    // {{ Title
    public String title() {
        return getStatus() + " - " + getDate();
    }

    // }}

    // {{ Lifecycle
    public void created() {
        status = "New";
        date = new Date();
    }

    // }}

    // {{ Description
    private String description;

    @MemberOrder(sequence = "1")
    public String getDescription() {
        return description;
    }

    public void setDescription(final String description) {
        this.description = description;
    }

    public String defaultDescription() {
        return "enter a description here";
    }

    // }}

    // {{ Date
    private Date date;

    @MemberOrder(sequence = "2")
    public Date getDate() {
        return date;
    }

    public void setDate(final Date date) {
        this.date = date;
    }

    // }}

    // {{ Status
    private String status;

    @Disabled
    @MemberOrder(sequence = "3")
    public String getStatus() {
        return status;
    }

    public void setStatus(final String status) {
        this.status = status;
    }

    // }}

    // {{ Claimant
    private Claimant claimant;

    @Disabled
    @MemberOrder(sequence = "4")
    public Claimant getClaimant() {
        return claimant;
    }

    public void setClaimant(final Claimant claimant) {
        this.claimant = claimant;
    }

    // }}

    // {{ BigDecimal
    private BigDecimal bigDecimal;

    @MemberOrder(sequence = "9")
    public BigDecimal getBigDecimal() {
        return bigDecimal;
    }

    public void setBigDecimal(final BigDecimal bigDecimal) {
        this.bigDecimal = bigDecimal;
    }

    public void modifyBigDecimal(final BigDecimal bigDecimal) {
        // check for no-op
        if (bigDecimal == null || bigDecimal.equals(getBigDecimal())) {
            return;
        }
        // associate new
        setBigDecimal(bigDecimal);
        // additional business logic
        onModifyBigDecimal(bigDecimal);
    }

    public void clearBigDecimal() {
        // check for no-op
        if (getBigDecimal() == null) {
            return;
        }
        // dissociate existing
        setBigDecimal(null);
        // additional business logic
        onClearBigDecimal();
    }

    protected void onModifyBigDecimal(final BigDecimal bigDecimal) {
    }

    protected void onClearBigDecimal() {
    }

    // }}

    // {{ Color
    private Color color;

    @MemberOrder(sequence = "8")
    public Color getColor() {
        return color;
    }

    public void setColor(final Color color) {
        this.color = color;
    }

    public void modifyColor(final Color color) {
        // check for no-op
        if (color == null || color.equals(getColor())) {
            return;
        }
        // associate new
        setColor(color);
        // additional business logic
        onModifyColor(color);
    }

    public void clearColor() {
        // check for no-op
        if (getColor() == null) {
            return;
        }
        // dissociate existing
        setColor(null);
        // additional business logic
        onClearColor();
    }

    protected void onModifyColor(final Color color) {
    }

    protected void onClearColor() {
    }

    // }}

    // {{ Approver
    private Approver approver;

    @Disabled
    @MemberOrder(sequence = "5")
    public Approver getApprover() {
        return approver;
    }

    public void setApprover(final Approver approver) {
        this.approver = approver;
    }

    // }}

    // {{ Items
    private final List<ClaimItem> items = new ArrayList<ClaimItem>();

    @MemberOrder(sequence = "6")
    public List<ClaimItem> getItems() {
        return items;
    }

    public void addToItems(final ClaimItem item) {
        items.add(item);
    }

    // }}

    // {{ action: Submit
    public void submit(final Approver approver) {
        setStatus("Submitted");
        setApprover(approver);
    }

    public String disableSubmit() {
        return getStatus().equals("New") ? null : "Claim has already been submitted";
    }

    public Object[] defaultSubmit() {
        return new Object[] { getClaimant().getApprover() };
    }
    // }}

}


text:
#ifndef SkFunction_DEFINED
#define SkFunction_DEFINED

// TODO: document, more pervasive move support in constructors, small-Fn optimization

#include "SkTemplates.h"
#include "SkTypes.h"

template <typename> class SkFunction;

template <typename R, typename... Args>
class SkFunction<R(Args...)> {
public:
    SkFunction() {}

    template <typename Fn>
    SkFunction(const Fn& fn) : fFunction(SkNEW_ARGS(LambdaImpl<Fn>, (fn))) {}

    SkFunction(R (*fn)(Args...)) : fFunction(SkNEW_ARGS(FnPtrImpl, (fn))) {}

    SkFunction(const SkFunction& other) { *this = other; }
    SkFunction& operator=(const SkFunction& other) {
        if (this != &other) {
            fFunction.reset(other.fFunction ? other.fFunction->clone() : nullptr);
        }
        return *this;
    }

    R operator()(Args... args) const {
        SkASSERT(fFunction.get());
        return fFunction->call(Forward(args)...);
    }

private:
    // ~= std::forward.  This moves its argument if possible, falling back to a copy if not.
    template <typename T> static T&& Forward(T& v) { return (T&&)v; }

    struct Interface {
        virtual ~Interface() {}
        virtual R call(Args...) const = 0;
        virtual Interface* clone() const = 0;
    };

    template <typename Fn>
    class LambdaImpl final : public Interface {
    public:
        LambdaImpl(const Fn& fn) : fFn(fn) {}

        R call(Args... args) const override { return fFn(Forward(args)...); }
        Interface* clone() const { return SkNEW_ARGS(LambdaImpl<Fn>, (fFn)); }
    private:
        Fn fFn;
    };

    class FnPtrImpl final : public Interface {
    public:
        FnPtrImpl(R (*fn)(Args...)) : fFn(fn) {}

        R call(Args... args) const override { return fFn(Forward(args)...); }
        Interface* clone() const { return SkNEW_ARGS(FnPtrImpl, (fFn)); }
    private:
        R (*fFn)(Args...);
    };

    SkAutoTDelete<Interface> fFunction;
};

#endif//SkFunction_DEFINED


text:
#include <assert.h>

#include <common>
#include <hw/pci.hpp>
#include <hw/pci_device.hpp>
#include <hw/msi.hpp>

/* PCI Register Config Space */
#define PCI_DEV_VEND_REG	0x00	/* for the 32 bit read of dev/vend */
#define PCI_VENDID_REG		0x00
#define PCI_DEVID_REG		0x02
#define PCI_CMD_REG			0x04
#define PCI_STATUS_REG		0x06
#define PCI_REVID_REG		0x08
#define PCI_PROGIF_REG		0x09
#define PCI_SUBCLASS_REG	0x0a
#define PCI_CLASS_REG		0x0b
#define PCI_CLSZ_REG		0x0c
#define PCI_LATTIM_REG		0x0d
#define PCI_HEADER_REG		0x0e
#define PCI_BIST_REG		0x0f

#define PCI_COMMAND_IO			0x01
#define PCI_COMMAND_MEM			0x02
#define PCI_COMMAND_MASTER	0x04

namespace hw {

  static constexpr std::array<const char*,3> bridge_subclasses {
    "Host",
    "ISA",
    "Other"
  };

  static constexpr std::array<const char*,2> nic_subclasses {
    "Ethernet",
    "Other"
  };

  static unsigned long pci_size(const unsigned long base, const unsigned long mask) noexcept {
    // Find the significant bits
    unsigned long size = mask & base;

    // Get the lowest of them to find the decode size
    size &= ~(size - 1);

    return size;
  }

  void PCI_Device::probe_resources() noexcept
  {
    //Find resources on this PCI device (scan the BAR's)
    for (int bar = 0; bar < 6; ++bar)
    {
      //Read the current BAR register
      uint32_t reg = PCI::CONFIG_BASE_ADDR_0 + (bar << 2);
      uint32_t value = read32(reg);

      if (!value) continue;

      //Write all 1's to the register, to get the length value (osdev)
      write_dword(reg, 0xFFFFFFFF);
      uint32_t len = read32(reg);

      //Put the value back
      write_dword(reg, value);

      uint32_t unmasked_val  {0};
      uint32_t pci__size     {0};

      if (value & 1) {
        // Resource type IO
        unmasked_val = value & PCI::BASE_ADDRESS_IO_MASK;
        pci__size = pci_size(len, PCI::BASE_ADDRESS_IO_MASK & 0xFFFF);
        this->m_iobase = bar;

      } else {
        // Resource type Mem
        unmasked_val = value & PCI::BASE_ADDRESS_MEM_MASK;
        pci__size = pci_size(len, PCI::BASE_ADDRESS_MEM_MASK);
      }
      this->m_resources.at(bar) = {unmasked_val, pci__size};

      INFO2("|  |- BAR%d %s @ 0x%x, size %i ", bar,
            (value & 1 ? "I/O" : "Mem"), unmasked_val, pci__size);
    }

  }

  PCI_Device::PCI_Device(const uint16_t pci_addr,
                         const uint32_t device_id,
                         const uint32_t devclass)
      : pci_addr_{pci_addr}, device_id_{device_id}
  {
    // set master, mem and io flags
    uint32_t cmd = read32(PCI_CMD_REG);
    cmd |= PCI_COMMAND_MASTER | PCI_COMMAND_MEM | PCI_COMMAND_IO;
    write_dword(PCI_CMD_REG, cmd);

    // device class info is coming from pci manager to save a PCI read
    this->devtype_.reg = devclass;
  }

  uint32_t PCI_Device::read_dword(const uint16_t pci_addr, const uint8_t reg) noexcept {
    PCI::msg req;

    req.data = 0x80000000;
    req.addr = pci_addr;
    req.reg  = reg;

    outpd(PCI::CONFIG_ADDR, 0x80000000 | req.data);
    return inpd(PCI::CONFIG_DATA);
  }
  void PCI_Device::write_dword(const uint8_t reg, const uint32_t value) noexcept {
    PCI::msg req;

    req.data = 0x80000000;
    req.addr = pci_addr_;
    req.reg  = reg;

    outpd(PCI::CONFIG_ADDR, 0x80000000 | req.data);
    outpd(PCI::CONFIG_DATA, value);
  }

  uint32_t PCI_Device::read32(const uint8_t reg) noexcept {
    PCI::msg req;

    req.data = 0x80000000;
    req.addr = pci_addr_;
    req.reg  = reg;

    outpd(PCI::CONFIG_ADDR, 0x80000000 | req.data);
    return inpd(PCI::CONFIG_DATA);
  }

  __attribute__((noinline))
  uint16_t PCI_Device::read16(const uint8_t reg) noexcept {
    PCI::msg req;
    req.data = 0x80000000;
    req.addr = pci_addr_;
    req.reg  = reg;

    outpd(PCI::CONFIG_ADDR, 0x80000000 | req.data);
    uint16_t data = inpw(PCI::CONFIG_DATA + (reg & 2));
    return data;
  }
  void PCI_Device::write16(const uint8_t reg, const uint16_t value) noexcept {
    PCI::msg req;
    req.data = 0x80000000;
    req.addr = pci_addr_;
    req.reg  = reg;

    outpd(PCI::CONFIG_ADDR, 0x80000000 | req.data);
    outpw(PCI::CONFIG_DATA + (reg & 2), value);
  }

  union capability_t
  {
    struct
    {
      uint8_t  id;
      uint8_t  next;
      uint16_t data;
    };
    uint32_t capd;
  };

  void PCI_Device::parse_capabilities()
  {
    caps = {};
    // the capability list is only available if bit 4
    // in the status register is set
    uint16_t status = read16(PCI_STATUS_REG);
    //printf("read16 %#x  status %#x\n", PCI_STATUS_REG, status);
    if ((status & 0x10) == 0) return;
    // this offset works for non-cardbus bridges
    uint32_t offset = 0x34;
    // read first capability
    offset = read16(offset) & 0xff;
    offset &= ~0x3; // lower 2 bits reserved

    while (offset) {
      capability_t cap;
      cap.capd = read32(offset);
      // remember capability
      this->caps.at(cap.id) = offset;
      // go to next cap
      offset = cap.next;
    }
  }

  void PCI_Device::deactivate()
  {
    // disables device (except for configuration)
    write_dword(PCI_CMD_REG, 0);
  }

  void PCI_Device::intx_enable()
  {
    auto cmd = read16(PCI_CMD_REG);
    write16(PCI_CMD_REG, cmd & ~(1 << 10));
    // delete msi-x
    if (this->msix) delete this->msix;
  }
  bool PCI_Device::intx_status()
  {
    auto stat = read16(PCI_STATUS_REG);
    return stat & (1 << 3);
  }

  std::string PCI_Device::to_string() const
  {
    char buffer[512];
    int len = 0;
    switch (PCI::classcode(devtype_.classcode)) {
    case PCI::classcode::BRIDGE:
      len = snprintf(buffer, sizeof(buffer), "%s, %s, %s (%#06x)",
            PCI::classcode_str(classcode()),
            PCI::vendor_str(vendor_id()),
            (devtype_.subclass < bridge_subclasses.size()
              ? bridge_subclasses[devtype_.subclass] : bridge_subclasses.back()),
            devtype_.subclass);
      break;
    case PCI::classcode::NIC:
      len = snprintf(buffer, sizeof(buffer), "%s, %s, %s (%#x:%#06x)",
            PCI::classcode_str(devtype_.classcode),
            PCI::vendor_str(vendor_id()),
            (devtype_.subclass < nic_subclasses.size()
              ? nic_subclasses[devtype_.subclass] : nic_subclasses.back()),
            this->vendor_id(), this->product_id());
      break;

    case PCI::classcode::STORAGE:
    default:
      len = snprintf(buffer, sizeof(buffer), "%s, %s (%#x:%#06x)",
            PCI::classcode_str(devtype_.classcode),
            PCI::vendor_str(vendor_id()),
            vendor_id(), product_id());
    } //< switch (devtype_.classcode)

    return std::string(buffer, len);
  }

} //< namespace hw


text:
class GURL;

namespace site_engagement {
class SiteEngagementService;
}

// Whether third-party cookie blocking was enabled for this pageload.
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class ThirdPartyCookieBlockState {
  kCookiesAllowed = 0,
  kThirdPartyCookiesBlocked = 1,
  kThirdPartyCookieBlockingDisabledForSite = 2,
  kMaxValue = kThirdPartyCookieBlockingDisabledForSite,
};

class NavigationMetricsRecorder
    : public content::WebContentsObserver,
      public content::WebContentsUserData<NavigationMetricsRecorder> {
 public:
  NavigationMetricsRecorder(const NavigationMetricsRecorder&) = delete;
  NavigationMetricsRecorder& operator=(const NavigationMetricsRecorder&) =
      delete;

  ~NavigationMetricsRecorder() override;

  // Turns on a synthetic field trial that is set on any navigation to a site
  // that requires a dedicated process.  Normally this is only used on Android,
  // but tests on other platforms can also turn this behavior on.
  void EnableSiteIsolationSyntheticTrialForTesting();

 private:
  explicit NavigationMetricsRecorder(content::WebContents* web_contents);
  friend class content::WebContentsUserData<NavigationMetricsRecorder>;

  ThirdPartyCookieBlockState GetThirdPartyCookieBlockState(const GURL& url);

  // content::WebContentsObserver overrides:
  void DidFinishNavigation(
      content::NavigationHandle* navigation_handle) override;

  raw_ptr<site_engagement::SiteEngagementService> site_engagement_service_;
  scoped_refptr<content_settings::CookieSettings> cookie_settings_;
  bool is_synthetic_isolation_trial_enabled_;

  WEB_CONTENTS_USER_DATA_KEY_DECL();
};

#endif  // CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_METRICS_RECORDER_H_


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Drake: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/>

     Home

     Installation

     Gallery

API Documentation

      C++
      Python

Resources

      Getting Help
      Tutorials
      Python Bindings
      For Developers
      Credits

     GitHub

Drake

  Drake C++ Documentation

  <form id="ddg-search-form" class="wy_form" action="https://duckduckgo.com/" method="get">
   <input type="text" name="q" placeholder="Search C++ API only…">
   <input type="hidden" name="sites" value="drake.mit.edu/doxygen_cxx">
  </form>
  <form id="ddg-search-form" class="wy_form" action="https://duckduckgo.com/" method="get">
   <input type="text" name="q" placeholder="Search all of Drake…">
   <input type="hidden" name="sites" value="drake.mit.edu">
  </form>

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

WitnessFunction< T > Member List

This is the complete list of members for WitnessFunction< T >, including all inherited members.

CalcCallback typedef	WitnessFunction< T >

CalcWitnessValue(const Context< T > &context) const	WitnessFunction< T >

description() const	WitnessFunction< T >

direction_type() const	WitnessFunction< T >

get_event() const	WitnessFunction< T >

get_mutable_event()	WitnessFunction< T >

get_system() const	WitnessFunction< T >

operator=(const WitnessFunction &)=delete	WitnessFunction< T >

operator=(WitnessFunction &&)=delete	WitnessFunction< T >

should_trigger(const T &w0, const T &wf) const	WitnessFunction< T >

WitnessFunction(const WitnessFunction &)=delete	WitnessFunction< T >

WitnessFunction(WitnessFunction &&)=delete	WitnessFunction< T >

          C++

          Python

          GitHub


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Hendersonia microphylla Cooke

### Remarks
null


text:
.combo-arrow {
  width: 18px;
  height: 20px;
  overflow: hidden;
  display: inline-block;
  vertical-align: top;
  cursor: pointer;
  opacity: 0.6;
  filter: alpha(opacity=60);
}
.combo-arrow-hover {
  opacity: 1.0;
  filter: alpha(opacity=100);
}
.combo-panel {
  overflow: auto;
}
.combo-arrow {
  background: url('images/combo_arrow.png') no-repeat center center;
}
.combo-panel {
  background-color: #fff;
}
.combo-arrow {
  background-color: #ffffff;
}
.combo-arrow-hover {
  background-color: #E6E6E6;
}
.combo-arrow:hover {
  background-color: #E6E6E6;
}
.combo .textbox-icon-disabled:hover {
  cursor: default;
}